function voicemail_configprocess() { //create vars from the request extract($_REQUEST); $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null; $extdisplay = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] : null; //if submitting form, update database switch ($action) { case "add": if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { $usage_arr = framework_check_extension_usage($_REQUEST['extension']); if (!empty($usage_arr)) { $GLOBALS['abort'] = true; } else { voicemail_mailbox_add($extdisplay, $_REQUEST); needreload(); } } break; case "del": // call remove before del, it needs to know context info // voicemail_mailbox_remove($extdisplay); voicemail_mailbox_del($extdisplay); needreload(); break; case "edit": if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { voicemail_mailbox_del($extdisplay); if ($vm != 'disabled') { voicemail_mailbox_add($extdisplay, $_REQUEST); } needreload(); } break; } }
/** * Delete user function, it's run twice because of scemantics with * old freepbx but it's harmless * @param string $extension The extension number * @param bool $editmode If we are in edit mode or not */ public function delUser($extension, $editmode = false) { if (!$editmode) { if (!function_exists('voicemail_mailbox_remove')) { $this->FreePBX->Modules->loadFunctionsInc('voicemail'); } voicemail_mailbox_remove($extension); voicemail_mailbox_del($extension); } }