} } if (@$_REQUEST['action'] == 'save') { $clir_internal = @$_REQUEST['clir-internal'] == 'yes' ? 'yes' : 'no'; $clir_external = @$_REQUEST['clir-external'] == 'yes' ? 'yes' : 'no'; if ($disabled['clir'] == '') { gs_clir_activate($_SESSION['sudo_user']['name'], 'internal', $clir_internal); gs_clir_activate($_SESSION['sudo_user']['name'], 'external', $clir_external); } if ($disabled['cw'] == '') { $cw = !!@$_REQUEST['callwaiting']; # setting this reboots phone, so check if it has really changed $cw_old = gs_callwaiting_get($_SESSION['sudo_user']['name']); if (!isGsError($cw_old)) { if ($cw != $cw_old) { gs_callwaiting_activate($_SESSION['sudo_user']['name'], $cw); } } } if ($disabled['clip'] == '') { if (isset($_REQUEST['callerid_ext'])) { $callerid_num = $_REQUEST['callerid_ext']; $ok = gs_user_callerid_set($_SESSION['sudo_user']['name'], $callerid_num, 'external'); if (isGsError($ok)) { echo $ok->getMsg(); } } if (isset($_REQUEST['callerid_int'])) { $callerid_num = $_REQUEST['callerid_int']; $ok = gs_user_callerid_set($_SESSION['sudo_user']['name'], $callerid_num, 'internal'); if (isGsError($ok)) {
} $url_polycom_provdir = GS_PROV_SCHEME . "://" . GS_PROV_HOST . (GS_PROV_PORT ? ":" . GS_PROV_PORT : "") . GS_PROV_PATH . "polycom/"; $url_polycom_features = $url_polycom_provdir . "features.php"; $url_polycom_menu = $url_polycom_provdir . "configmenu.php"; //////////////////// SET FEATURE { if ($type != false && isset($_REQUEST["state"])) { $state = trim(@$_REQUEST['state']); $user_name = $db->executeGetOne("SELECT `user` FROM `users` WHERE `id`='" . $db->escape($user_id) . "'"); if ($type == "callwaiting" && $show_cw) { $oldresult = (int) $db->executeGetOne("SELECT `active` FROM `callwaiting` WHERE `user_id`=" . $user_id); if ($state == "yes" || $state == "no") { if ($oldresult == 1 && $state == "no") { gs_callwaiting_activate($user_name, 0); } else { if ($oldresult == 0 && $state == "yes") { gs_callwaiting_activate($user_name, 1); } } } } else { if ($show_clir && ($type == "internal" || $type == "external")) { if ($state == "no" || $state == "yes") { gs_clir_activate($user_name, $type, $state); } } else { if ($type == "cidint" && $show_clip) { gs_user_callerid_set($user_name, $state, "internal"); } else { if ($type == "cidext" && $show_clip) { gs_user_callerid_set($user_name, $state, "external"); } else {