Call to undefined function setup_userman()

In an effort to not get flamed (again) for posting something, I figured I’d just throw something out here on the internet for anyone that happens to run by this.

Ran a FreePBX upgrade this morning that bricked my amportal. Was getting:

PHP Fatal error: Call to undefined function setup_userman() in /var/www/html/admin/modules/cxpanel/lib/PHPMailer/class.phpmailer.php on line 0

After running an strace on module admin I found this:
lstat("/var/www/html/admin/modules/cxpanel/lib/PHPMailer/class.phpmailer.php", {st_mode=S_IFREG|0664, st_size=117475, …}) = 0

So I went into cxpanel/functions.inc.php and deleted the userman check… (lines 45-63)
//Setup userman hooks
if(!function_exists(‘setup_userman’)){
global $amp_conf;
$um = module_getinfo(‘userman’, MODULE_STATUS_ENABLED);
if(file_exists($amp_conf[‘AMPWEBROOT’].’/admin/modules/userman/functions.inc.php’) && (isset($um[‘userman’][‘status’]) && $um[‘userman’][‘status’] === MODULE_STATUS_ENABLED)) {
include_once($amp_conf[‘AMPWEBROOT’].’/admin/modules/userman/functions.inc.php’);
} else {
//dont do anymore work, we need userman and it needs to be enabled
}
if(function_exists(‘setup_userman’)) {
try {
$userman = setup_userman();
$userman->registerHook(‘addUser’,‘cxpanel_userman_add’);
$userman->registerHook(‘updateUser’,‘cxpanel_userman_update’);
} catch(\Exception $e) {
//dont do anymore work, we need userman and it needs to be enabled
}
}
}

– Reran the upgrade script and it worked fine. Just an FYI for anyone that sees this.

I moved 2 posts to an existing topic: GUI Blank after recent update

The posts were removed - at any rate, I googled the error message, I didn’t search for the proper terms apparently. Thanks for the reply!