• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP needreload函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中needreload函数的典型用法代码示例。如果您正苦于以下问题:PHP needreload函数的具体用法?PHP needreload怎么用?PHP needreload使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了needreload函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: doConfigPageInit

 public function doConfigPageInit()
 {
     $request = array('action', 'id', 'goto0', 'name', 'text', 'engine');
     $vars = array();
     $goto = null;
     foreach ($request as $key) {
         $vars[$key] = isset($_REQUEST[$key]) ? $_REQUEST[$key] : null;
     }
     if (isset($vars['goto0']) && isset($_REQUEST[$vars['goto0'] . "0"])) {
         $goto = $_REQUEST[$vars['goto0'] . "0"];
     }
     switch ($vars['action']) {
         case "add":
             $_REQUEST['id'] = \tts_add($vars['name'], $vars['text'], $goto, $vars['engine']);
             \needreload();
             break;
         case "delete":
             \tts_del($vars['id']);
             $_REQUEST['id'] = null;
             \needreload();
             break;
         case "edit":
             \tts_update($vars['id'], $vars['name'], $vars['text'], $goto, $_REQUEST['engine']);
             \needreload();
             break;
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:27,代码来源:Tts.class.php


示例2: doConfigPageInit

 public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     $action = isset($request['action']) ? $request['action'] : '';
     $password = isset($request['password']) ? $request['password'] : '';
     $fc_description = isset($request['fc_description']) ? $request['fc_description'] : '';
     $day_recording_id = isset($request['day_recording_id']) ? $request['day_recording_id'] : '';
     $night_recording_id = isset($request['night_recording_id']) ? $request['night_recording_id'] : '';
     isset($request['itemid']) ? $itemid = $request['itemid'] : ($itemid = '');
     $extdisplay = isset($request['extdisplay']) ? $request['extdisplay'] : '';
     switch ($action) {
         case "add":
         case "edit":
         case "edited":
             \daynight_edit($request, $itemid);
             \needreload();
             $_REQUEST['view'] = null;
             break;
         case "delete":
             \daynight_del($itemid);
             \needreload();
             $_REQUEST['view'] = null;
             break;
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:25,代码来源:Daynight.class.php


示例3: doConfigPageInit

 public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     isset($request['action']) ? $action = $request['action'] : ($action = '');
     isset($request['view']) ? $view = $request['view'] : ($view = '');
     isset($request['itemid']) ? $itemid = $request['itemid'] : ($itemid = '');
     if (isset($request['action'])) {
         switch ($action) {
             case "add":
                 pinsets_add($request);
                 needreload();
                 redirect_standard();
                 break;
             case "delete":
                 pinsets_del($itemid);
                 needreload();
                 redirect_standard();
                 break;
             case "edit":
                 pinsets_edit($itemid, $request);
                 needreload();
                 redirect_standard('itemid', 'view');
                 break;
         }
     }
 }
开发者ID:lidl,项目名称:pinsets,代码行数:26,代码来源:Pinsets.class.php


示例4: doConfigPageInit

 public function doConfigPageInit($page)
 {
     if (!empty($_POST)) {
         $readonly = $_POST['readonly'] == 'yes' ? 1 : 0;
         if (empty($_POST['id'])) {
             $id = $this->addUser($_POST['name'], $_POST['password'], $_POST['password_type'], $readonly);
             $_REQUEST['user'] = $id ? $id : '';
         } else {
             if ($_POST['password'] == '******') {
                 $this->editUser($_POST['id'], $_POST['name'], $readonly);
             } else {
                 $this->editUser($_POST['id'], $_POST['name'], $readonly, $_POST['password'], $_POST['password_type']);
             }
             $_REQUEST['user'] = $_POST['id'];
             $_REQUEST['view'] = 'form';
         }
         needreload();
     } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete') {
         if (!empty($_REQUEST['user'])) {
             $this->deleteUser($_REQUEST['user']);
             needreload();
             unset($_REQUEST['user']);
             if (isset($_REQUEST['view'])) {
                 unset($_REQUEST['view']);
             }
         }
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:28,代码来源:Arimanager.class.php


示例5: doConfigPageInit

 public function doConfigPageInit($page)
 {
     $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
     if (isset($_REQUEST['delete'])) {
         $action = 'delete';
     }
     $queueprio_id = isset($_REQUEST['queueprio_id']) ? $_REQUEST['queueprio_id'] : false;
     $description = isset($_REQUEST['description']) ? $_REQUEST['description'] : '';
     $queue_priority = isset($_REQUEST['queue_priority']) ? $_REQUEST['queue_priority'] : '';
     $dest = isset($_REQUEST['dest']) ? $_REQUEST['dest'] : '';
     if (isset($_REQUEST['goto0']) && $_REQUEST['goto0']) {
         $dest = $_REQUEST[$_REQUEST['goto0'] . '0'];
     }
     switch ($action) {
         case 'add':
             $_REQUEST['extdisplay'] = queueprio_add($description, $queue_priority, $dest);
             needreload();
             break;
         case 'edit':
             queueprio_edit($queueprio_id, $description, $queue_priority, $dest);
             $_REQUEST['extdisplay'] = $queueprio_id;
             needreload();
             break;
         case 'delete':
             queueprio_delete($queueprio_id);
             needreload();
             break;
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:29,代码来源:Queueprio.class.php


示例6: doConfigPageInit

 public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     isset($request['extdisplay']) ? $extdisplay = $request['extdisplay'] : ($extdisplay = '');
     isset($request['description']) ? $description = $request['description'] : ($description = '');
     isset($request['destdial']) ? $destdial = $request['destdial'] : ($destdial = '');
     isset($request['view']) ? $view = $request['view'] : ($view = '');
     isset($request['action']) ? $action = $request['action'] : ($action = '');
     switch ($action) {
         case "add":
             $extdisplay = $this->add($request['description'], $request['destdial']);
             needreload();
             redirect_standard();
             break;
         case "delete":
             $this->del($request['extdisplay']);
             needreload();
             redirect_standard();
             break;
         case "edit":
             $this->update($request['extdisplay'], $request['description'], $request['destdial']);
             needreload();
             redirect_standard('extdisplay', 'view');
             break;
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:26,代码来源:Miscdests.class.php


示例7: doConfigPageInit

 public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     $type = isset($request['type']) ? $request['type'] : 'setup';
     $action = isset($request['action']) ? $request['action'] : '';
     if (isset($request['delete'])) {
         $action = 'delete';
     }
     $language_id = isset($request['language_id']) ? $request['language_id'] : false;
     $description = isset($request['description']) ? $request['description'] : '';
     $lang_code = isset($request['lang_code']) ? $request['lang_code'] : '';
     $dest = isset($request['dest']) ? $request['dest'] : '';
     $view = isset($request['view']) ? $request['view'] : '';
     if (isset($request['goto0']) && $request['goto0']) {
         $dest = $request[$request['goto0'] . '0'];
     }
     switch ($action) {
         case 'add':
             $request['extdisplay'] = languages_add($description, $lang_code, $dest);
             needreload();
             break;
         case 'edit':
             languages_edit($language_id, $description, $lang_code, $dest);
             needreload();
             break;
         case 'delete':
             languages_delete($language_id);
             needreload();
             break;
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:31,代码来源:Languages.class.php


示例8: doConfigPageInit

 public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     $error_displays = array();
     $action = isset($request['action']) ? $request['action'] : '';
     $post_codec = isset($request['codec']) ? $request['codec'] : array();
     $post_vcodec = isset($request['vcodec']) ? $request['vcodec'] : array();
     $iax_settings['codecpriority'] = isset($request['codecpriority']) ? $request['codecpriority'] : 'host';
     $iax_settings['bandwidth'] = isset($request['bandwidth']) ? $request['bandwidth'] : 'unset';
     $iax_settings['videosupport'] = isset($request['videosupport']) ? $request['videosupport'] : 'no';
     $iax_settings['maxregexpire'] = isset($request['maxregexpire']) ? htmlspecialchars($request['maxregexpire']) : '3600';
     $iax_settings['minregexpire'] = isset($request['minregexpire']) ? htmlspecialchars($request['minregexpire']) : '60';
     $iax_settings['jitterbuffer'] = isset($request['jitterbuffer']) ? $request['jitterbuffer'] : 'no';
     $iax_settings['forcejitterbuffer'] = isset($request['forcejitterbuffer']) ? $request['forcejitterbuffer'] : 'no';
     $iax_settings['maxjitterbuffer'] = isset($request['maxjitterbuffer']) ? htmlspecialchars($request['maxjitterbuffer']) : '200';
     $iax_settings['resyncthreshold'] = isset($request['resyncthreshold']) ? htmlspecialchars($request['resyncthreshold']) : '1000';
     $iax_settings['maxjitterinterps'] = isset($request['maxjitterinterps']) ? htmlspecialchars($request['maxjitterinterps']) : '10';
     $iax_settings['bindaddr'] = isset($request['bindaddr']) ? htmlspecialchars($request['bindaddr']) : '';
     $iax_settings['bindport'] = isset($request['bindport']) ? htmlspecialchars($request['bindport']) : '';
     $iax_settings['delayreject'] = isset($request['delayreject']) ? htmlspecialchars($request['delayreject']) : 'yes';
     $codecs = array('ulaw' => '', 'alaw' => '', 'slin' => '', 'g726' => '', 'gsm' => '', 'g729' => '', 'ilbc' => '', 'g723' => '', 'g726aal2' => '', 'adpcm' => '', 'lpc10' => '', 'speex' => '', 'g722' => '', 'siren7' => '', 'siren14' => '');
     // With the new sorting, the vars should come to us in the sorted order so just use that
     //
     $pri = 1;
     foreach (array_keys($post_codec) as $codec) {
         $codecs[$codec] = $pri++;
     }
     $iax_settings['codecs'] = $codecs;
     $video_codecs = array('h261' => '', 'h263' => '', 'h263p' => '', 'h264' => '');
     $pri = 1;
     foreach (array_keys($post_vcodec) as $vcodec) {
         $video_codecs[$vcodec] = $pri++;
     }
     $iax_settings['video_codecs'] = $video_codecs;
     $p_idx = $n_idx = 0;
     while (isset($request["iax_custom_key_{$p_idx}"])) {
         if ($request["iax_custom_key_{$p_idx}"] != '') {
             $iax_settings["iax_custom_key_{$n_idx}"] = htmlspecialchars($request["iax_custom_key_{$p_idx}"]);
             $iax_settings["iax_custom_val_{$n_idx}"] = htmlspecialchars($request["iax_custom_val_{$p_idx}"]);
             $n_idx++;
         }
         $p_idx++;
     }
     switch ($action) {
         case "edit":
             //just delete and re-add
             if (($errors = iaxsettings_edit($iax_settings)) !== true) {
                 $error_displays = process_errors($errors);
             } else {
                 needreload();
                 //redirect_standard();
             }
             break;
         default:
             /* only get them if first time load, if they pressed submit, use values from POST */
             $iax_settings = iaxsettings_get();
     }
     $error_displays = array_merge($error_displays, iaxsettings_check_custom_files());
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:59,代码来源:Iaxsettings.class.php


示例9: doConfigPageInit

 public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     isset($request['action']) ? $action = $request['action'] : ($action = '');
     isset($request['view']) ? $view = $request['view'] : ($view = 'form');
     //the extension we are currently displaying
     $account = isset($request['account']) ? $request['account'] : '';
     $extdisplay = isset($request['extdisplay']) && $request['extdisplay'] != '' ? $request['extdisplay'] : $account;
     $orig_account = isset($request['orig_account']) ? $request['orig_account'] : '';
     $music = isset($request['music']) ? $request['music'] : '';
     $users = isset($request['users']) ? $request['users'] : '0';
     //check if the extension is within range for this user
     if ($account != "" && !checkRange($account)) {
         echo "<script>javascript:alert('" . _("Warning! Extension") . " {$account} " . _("is not allowed for your account.") . "');</script>";
     } else {
         //if submitting form, update database
         switch ($action) {
             case "add":
                 $conflict_url = array();
                 $usage_arr = framework_check_extension_usage($account);
                 if (!empty($usage_arr)) {
                     $conflict_url = framework_display_extension_usage_alert($usage_arr);
                 } elseif ($this->addConference($account, $request['name'], $request['userpin'], $request['adminpin'], $request['options'], $request['joinmsg_id'], $music, $users, $request['adminpin']) !== false) {
                     needreload();
                 }
                 break;
             case "delete":
                 $this->deleteConference($extdisplay);
                 needreload();
                 break;
             case "edit":
                 //just delete and re-add
                 //check to see if the room number has changed
                 if ($orig_account != '' && $orig_account != $account) {
                     $conflict_url = array();
                     $usage_arr = framework_check_extension_usage($account);
                     if (!empty($usage_arr)) {
                         $conflict_url = framework_display_extension_usage_alert($usage_arr);
                         break;
                     } else {
                         $this->deleteConference($orig_account);
                         $request['extdisplay'] = $account;
                         //redirect to the new ext
                         $old = conferences_getdest($orig_account);
                         $new = conferences_getdest($account);
                         framework_change_destination($old[0], $new[0]);
                     }
                 } else {
                     $this->deleteConference($account);
                 }
                 $this->addConference($account, $request['name'], $request['userpin'], $request['adminpin'], $request['options'], $request['joinmsg_id'], $music, $users, $request['language']);
                 needreload();
                 break;
         }
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:56,代码来源:Conferences.class.php


示例10: itslenny_edit

function itslenny_edit($id, $post)
{
    global $db;
    $var1 = $db->escapeSimple($post['enable']);
    $var2 = $db->escapeSimple($post['record']);
    $var3 = $db->escapeSimple($post['destination']);
    $var4 = $db->escapeSimple($post['silence']);
    $var5 = $db->escapeSimple($post['itterations']);
    $results = sql("\n\t\tUPDATE itslenny \n\t\tSET \n\t\t\tenable = '{$var1}', \n\t\t\trecord = '{$var2}', \n\t\t\tdestination = '{$var3}',\n\t\t\tsilence = '{$var4}',\n\t\t\titterations = '{$var5}'\n\t\tWHERE id = '{$id}'");
    needreload();
}
开发者ID:raylee,项目名称:freepbx-Its_Lenny,代码行数:11,代码来源:functions.inc.php


示例11: doConfigPageInit

 public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     if ($page == "callrecording") {
         $type = isset($request['type']) ? $request['type'] : 'setup';
         $view = isset($request['view']) ? $request['view'] : 'form';
         $action = isset($request['action']) ? $request['action'] : '';
         if (isset($request['delete'])) {
             $action = 'delete';
         }
         $callrecording_id = isset($request['callrecording_id']) ? $request['callrecording_id'] : false;
         $description = isset($request['description']) ? $request['description'] : '';
         $callrecording_mode = isset($request['callrecording_mode']) ? $request['callrecording_mode'] : '';
         $dest = isset($request['dest']) ? $request['dest'] : '';
         if (isset($request['goto0']) && $request['goto0']) {
             $dest = $request[$request['goto0'] . '0'];
         }
         switch ($action) {
             case 'add':
                 $request['extdisplay'] = callrecording_add($description, $callrecording_mode, $dest);
                 needreload();
                 //redirect_standard('extdisplay', 'view');
                 break;
             case 'edit':
                 callrecording_edit($callrecording_id, $description, $callrecording_mode, $dest);
                 needreload();
                 //redirect_standard('extdisplay', 'view');
                 break;
             case 'delete':
                 callrecording_delete($callrecording_id);
                 needreload();
                 //redirect_standard();
                 break;
         }
     }
     if ($page == "routing") {
         $viewing_itemid = isset($request['id']) ? $request['id'] : '';
         $action = isset($request['action']) ? $request['action'] : null;
         $route_id = $viewing_itemid;
         //dbug("got request for callrecording process for route: $route_id action: $action");
         if (isset($request['Submit'])) {
             $action = isset($action) ? $action : 'editroute';
         }
         // $action won't be set on the redirect but callrecordingAddRoute will be in the session
         //
         if (!$action && !empty($_SESSION['callrecordingAddRoute'])) {
             callrecording_adjustroute($route_id, 'delayed_insert_route', $_SESSION['callrecordingAddRoute']);
             unset($_SESSION['callrecordingAddRoute']);
         } elseif ($action) {
             callrecording_adjustroute($route_id, $action, $request['callrecording']);
         }
     }
 }
开发者ID:lidl,项目名称:callrecording,代码行数:53,代码来源:Callrecording.class.php


示例12: doConfigPageInit

 public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     $dispnum = 'vmblast';
     //used for switch on config.php
     $action = isset($request['action']) ? $request['action'] : '';
     //the extension we are currently displaying
     $account = isset($request['account']) ? $request['account'] : '';
     $extdisplay = isset($request['extdisplay']) ? ltrim($request['extdisplay'], 'GRP-') : ($account != '' ? $account : '');
     $description = isset($request['description']) ? $request['description'] : '';
     $audio_label = isset($request['audio_label']) ? $request['audio_label'] : -1;
     $password = isset($request['password']) ? $request['password'] : '';
     $default_group = isset($request['default_group']) ? $request['default_group'] : '0';
     $vmblast_list = isset($request['vmblast_list']) ? $request['vmblast_list'] : '';
     $view = isset($request['view']) ? $request['view'] : 'form';
     // do if we are submitting a form
     if (isset($request['action'])) {
         //check if the extension is within range for this user
         if (isset($account) && !checkRange($account)) {
             echo "<script>javascript:alert('" . _("Warning! Extension") . " " . $account . " " . _("is not allowed for your account") . ".');</script>";
         } else {
             //add group
             if ($action == 'addGRP') {
                 $conflict_url = array();
                 $usage_arr = framework_check_extension_usage($account);
                 if (!empty($usage_arr)) {
                     $conflict_url = framework_display_extension_usage_alert($usage_arr);
                 } else {
                     if (vmblast_add($account, $vmblast_list, $description, $audio_label, $password, $default_group)) {
                         //$request['action'] = 'delGRP';
                         $_REQUEST['view'] = 'form';
                         $_REQUEST['extdisplay'] = $account;
                         needreload();
                         //redirect_standard('extdisplay', 'view');
                     }
                 }
             }
             //del group
             if ($action == 'delGRP') {
                 vmblast_del($account);
                 needreload();
             }
             //edit group - just delete and then re-add the extension
             if ($action == 'editGRP') {
                 vmblast_del($account);
                 vmblast_add($account, $vmblast_list, $description, $audio_label, $password, $default_group);
                 needreload();
             }
         }
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:51,代码来源:Vmblast.class.php


示例13: doConfigPageInit

 public function doConfigPageInit($page)
 {
     isset($_REQUEST['action']) ? $action = $_REQUEST['action'] : ($action = '');
     isset($_REQUEST['itemid']) ? $itemid = $_REQUEST['itemid'] : ($itemid = '');
     switch ($action) {
         case "add":
             $_REQUEST['itemid'] = callback_add($_POST);
             needreload();
             break;
         case "delete":
             callback_del($itemid);
             needreload();
             break;
         case "edit":
             callback_edit($itemid, $_POST);
             needreload();
             break;
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:19,代码来源:Callback.class.php


示例14: doConfigPageInit

 public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     isset($request['action']) ? $action = $request['action'] : ($action = '');
     isset($request['view']) ? $view = $request['view'] : ($view = 'form');
     isset($request['itemid']) ? $itemid = $request['itemid'] : ($itemid = '');
     if (isset($request['action'])) {
         switch ($action) {
             case "add":
                 cidlookup_add($request);
                 needreload();
                 redirect_standard();
                 break;
             case "delete":
                 cidlookup_del($itemid);
                 needreload();
                 redirect_standard();
                 break;
             case "edit":
                 cidlookup_edit($itemid, $request);
                 needreload();
                 redirect_standard('itemid');
                 break;
             case "getJSON":
                 switch ($request['jdata']) {
                     case "cid_modules":
                         header('Content-Type: application/json');
                         echo json_encode($this->cid_modules);
                         exit;
                         break;
                     default:
                         header('Content-Type: application/json');
                         echo json_encode(array('status' => 'ERROR', 'message' => 'Invalid Request'));
                         exit;
                         break;
                 }
                 break;
         }
     }
 }
开发者ID:lidl,项目名称:cidlookup,代码行数:40,代码来源:Cidlookup.class.php


示例15: featurecodeadmin_update

function featurecodeadmin_update($req)
{
    foreach ($req as $key => $item) {
        // Split up...
        // 0 - action
        // 1 - modulename
        // 2 - featurename
        $arr = explode("#", $key);
        if (count($arr) == 3) {
            $action = $arr[0];
            $modulename = $arr[1];
            $featurename = $arr[2];
            $fieldvalue = $item;
            // Is there a more efficient way of doing this?
            switch ($action) {
                case "ena":
                    $fcc = new featurecode($modulename, $featurename);
                    if ($fieldvalue == 1) {
                        $fcc->setEnabled(true);
                    } else {
                        $fcc->setEnabled(false);
                    }
                    $fcc->update();
                    break;
                case "custom":
                    $fcc = new featurecode($modulename, $featurename);
                    if ($fieldvalue == $fcc->getDefault()) {
                        $fcc->setCode('');
                        // using default
                    } else {
                        $fcc->setCode($fieldvalue);
                    }
                    $fcc->update();
                    break;
            }
        }
    }
    needreload();
}
开发者ID:umjinsun12,项目名称:dngshin,代码行数:39,代码来源:functions.inc.php


示例16: update

 public function update($codes = array())
 {
     if (!empty($codes)) {
         foreach ($codes as $module => $features) {
             foreach ($features as $name => $data) {
                 $fcc = new \featurecode($module, $name);
                 if (!empty($data['enable'])) {
                     $fcc->setEnabled(true);
                 } else {
                     $fcc->setEnabled(false);
                 }
                 if (empty($data['customize']) || $data['code'] == $fcc->getDefault()) {
                     $fcc->setCode('');
                 } else {
                     $fcc->setCode($data['code']);
                 }
                 $fcc->update();
             }
         }
         needreload();
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:22,代码来源:Featurecodeadmin.class.php


示例17: doConfigPageInit

 public function doConfigPageInit($page)
 {
     $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
     $itemid = isset($_REQUEST['itemid']) ? $_REQUEST['itemid'] : '';
     switch ($action) {
         case "add":
             $_REQUEST['itemid'] = disa_add($_POST);
             needreload();
             break;
         case "delete":
             $oldItem = disa_get($itemid);
             disa_del($itemid);
             needreload();
             break;
         case "edit":
             //just delete and re-add
             disa_edit($itemid, $_POST);
             $_REQUEST['itemid'] = $itemid;
             needreload();
             break;
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:22,代码来源:Disa.class.php


示例18: core_trunks_edit

     break;
 case "edittrunk":
     if ($tech == 'pjsip') {
         $channelid = !empty($_REQUEST['trunk_name']) ? $_REQUEST['trunk_name'] : '';
     }
     core_trunks_edit($trunknum, $channelid, $dialoutprefix, $maxchans, $outcid, $peerdetails, $usercontext, $userconfig, $register, $keepcid, trim($failtrunk), $disabletrunk, $trunk_name, $provider, $continue, $dialopts);
     // this can rewrite too, so edit is the same
     core_trunks_update_dialrules($trunknum, $dialpattern_insert, true);
     needreload();
     redirect_standard('extdisplay');
     break;
 case "deltrunk":
     core_trunks_del($trunknum);
     core_trunks_delete_dialrules($trunknum);
     core_routing_trunk_delbyid($trunknum);
     needreload();
     redirect_standard();
     break;
 case "populatenpanxx7":
 case "populatenpanxx10":
     $dialpattern_array = $dialpattern_insert;
     if (preg_match("/^([2-9]\\d\\d)-?([2-9]\\d\\d)\$/", $_REQUEST["npanxx"], $matches)) {
         // first thing we do is grab the exch:
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($ch, CURLOPT_URL, "http://www.localcallingguide.com/xmllocalprefix.php?npa=" . $matches[1] . "&nxx=" . $matches[2]);
         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Linux; FreePBX Local Trunks Configuration)");
         $str = curl_exec($ch);
         curl_close($ch);
         // quick 'n dirty - nabbed from PEAR
         require_once $amp_conf['AMPWEBROOT'] . '/admin/modules/core/XML_Parser.php';
开发者ID:umjinsun12,项目名称:dngshin,代码行数:31,代码来源:page.trunks.php


示例19: uninstall

 /**
  * Uninstall a module, but files remain
  * @param string   The name of the module to install
  * @param bool     If true, skips status and dependency checks
  * @return mixed   True if succesful, array of error messages if not succesful
  */
 function uninstall($modulename, $force = false)
 {
     global $db;
     global $amp_conf;
     $modules = $this->getinfo($modulename);
     if (!isset($modules[$modulename])) {
         return array(_("Specified module not found"));
     }
     if (!$force) {
         if ($modules[$modulename]['status'] == MODULE_STATUS_NOTINSTALLED) {
             return array(_("Module not installed: cannot uninstall"));
         }
         if (($depmods = $this->reversedepends($modulename)) !== false) {
             return array(_("Cannot disable: The following modules depend on this one: ") . implode(',', $depmods));
         }
     }
     // Check if another module wants this uninstall to be rejected
     // The module must have a callback: [modulename]_module_uninstall_check_callbak() that takes
     // a single modules array from module_getinfo() about the module to be uninstalled
     // and it must pass back boolean true if the uninstall can proceed, or a message
     // indicating why the uninstall must fail
     //
     $rejects = array();
     foreach (mod_func_iterator('module_uninstall_check_callback', $modules) as $mod => $res) {
         if ($res !== true) {
             $rejects[] = $res;
         }
     }
     if (!empty($rejects)) {
         return $rejects;
     }
     $sql = "DELETE FROM modules WHERE modulename = '" . $db->escapeSimple($modulename) . "'";
     $results = $db->query($sql);
     if (DB::IsError($results)) {
         return array(_("Error updating database: ") . $results->getMessage());
     }
     if (!$this->_runscripts($modulename, 'uninstall', $modules)) {
         return array(_("Failed to run un-installation scripts"));
     }
     // Now make sure all feature codes are uninstalled in case the module has not already done it
     //
     require_once dirname(__FILE__) . '/featurecodes.class.php';
     //TODO: do we need this, now that we have bootstrap? -MB
     featurecodes_delModuleFeatures($modulename);
     $freepbx_conf =& freepbx_conf::create();
     $freepbx_conf->remove_module_settings($modulename);
     $mod_asset_dir = $amp_conf['AMPWEBROOT'] . "/admin/assets/" . $modulename;
     if (is_link($mod_asset_dir)) {
         @unlink($mod_asset_dir);
     }
     needreload();
     //invalidate the modulelist class since it is now stale
     modulelist::create($db)->invalidate();
     try {
         $sth = FreePBX::Database()->prepare("DELETE FROM `kvstore` WHERE `module` = :mod");
         $sth->execute(array(":mod" => $modulename));
     } catch (\Exception $e) {
     }
     return true;
 }
开发者ID:ntadmin,项目名称:framework,代码行数:66,代码来源:modulefunctions.class.php


示例20: updateTlsOwner

 /**
  * Update the TLS Port if requested
  *
  * This is called when 'tlsportowner' is submitted as part of the POST.
  * It checks to see if the requested channel driver does own the TLS port,
  * and if it doesn't, it assigns it.
  *
  * If the other driver is assigned to that port, it moves it to 5161.
  */
 public function updateTlsOwner($driver = false)
 {
     // Who owns it at the moment?
     $owner = $this->getTlsPortOwner();
     if ($owner == $driver) {
         // Nothing to do, we're already correct
         return true;
     }
     // Does chan_sip want to own the TLS port?
     if ($driver == "sip") {
         // We're moving chansip to 5061
         $this->updateChanSipSettings("tlsbindport", 5061);
         needreload();
         // If pjsip is listening on 5061, move it to 5161
         $pjsipbinds = $this->getConfig("binds");
         $pjsipbinds = is_array($pjsipbinds) ? $pjsipbinds : array();
         foreach ($pjsipbinds as $pjproto => $binds) {
             // Skip if not tls
             if ($pjproto !== "tls") {
                 continue;
             }
             // Get all the listening TLS interfaces and if they're
             // set to 5061, set them to 5161
             foreach ($binds as $ip => $state) {
                 $p = $this->getConfig($pjproto . "port-" . $ip);
                 if ($p == 5061) {
                     // It's a conflict. move to 5161
                     $this->setConfig($pjproto . "port-" . $ip, 5161);
                 }
             }
         }
     } elseif ($driver = "pjsip") {
         // We're setting pjsip to own 5061. Does chansip think it
         // owns it?
         $chansip = $this->getChanSipSettings();
         if (!isset($chansip['tlsbindport']) || !$chansip['tlsbindport'] || $chansip['tlsbindport'] == 5061) {
             // Yes it does. Move to 5161.
             $this->updateChanSipSettings("tlsbindport", 5161);
             needreload();
         }
         // Update all tls listeners for pjsip to listen on 5061
         $pjsipbinds = $this->getConfig("binds");
         $pjsipbinds = is_array($pjsipbinds) ? $pjsipbinds : array();
         foreach ($pjsipbinds as $pjproto => $binds) {
             // Skip if not tls
             if ($pjproto !== "tls") {
                 continue;
             }
             // Get all the listening TLS interfaces and if they're
             // set to 5061, set them to 5161
             foreach ($binds as $ip => $state) {
                 $p = $this->getConfig($pjproto . "port-" . $ip);
                 if ($p != 5061) {
                     // It's a conflict. move to 5161
                     $this->setConfig($pjproto . "port-" . $ip, 5061);
                     needreload();
                 }
             }
         }
     } else {
         throw new \Exception("Can't change tls owner to unknown driver '{$driver}'");
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:72,代码来源:Sipsettings.class.php



注:本文中的needreload函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP network_admin_url函数代码示例发布时间:2022-05-15
下一篇:
PHP need_rbac_auth函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap