echo "<br />" . $noresultsmsg . "<br />\n"; } echo "</body>\n"; echo "<softkey index=\"1\" label=\"" . __("Zurück") . "\" action=\"Softkey:Back\" />\n"; echo "<softkey index=\"2\" label=\"\" action=\"\" />\n"; echo "<softkey index=\"3\" label=\"" . __("Beenden") . "\" action=\"Softkey:Exit\" />\n"; echo "<softkey index=\"4\" label=\"\" action=\"\" />\n"; echo "</html>\n"; _ob_send(); } #################################### IMPORTED PHONEBOOK } #################################### INTERNAL PHONEBOOK { if ($type === "gs") { $mac = preg_replace("/[^\\dA-Z]/", "", strToUpper(trim(@$_REQUEST["m"]))); $user_groups = gs_group_members_groups_get(array($user_id), "user"); $permission_groups = gs_group_permissions_get($user_groups, "phonebook_user"); $group_members = gs_group_members_get($permission_groups); ob_start(); echo $phonebook_doctype . "\n"; $pagetitle = __("Telefonbuch") . " - " . $typeToTitle[$type]; $searchsql = "1"; $noresultsmsg = __("Dieses Telefonbuch enthält keine Einträge."); if (strlen($querystring) > 0) { $pagetitle .= " ('" . $querystring . "')"; $searchsql = "`u`.`lastname` LIKE '%" . $querystring . "%' OR `u`.`firstname` LIKE '%" . $querystring . "%'"; $noresultsmsg = sprintf(__("Keine Treffer für \"%s\". Drücken Sie 'Zurück', um eine neue Suche auszuführen."), $querystring); } echo "<html>\n"; echo "<head><title>" . htmlEnt($pagetitle) . "</title></head>\n"; echo "<body><br />\n"; $query = "SELECT `u`.`lastname` `ln`, `u`.`firstname` `fn`, `s`.`name` `ext` " . "FROM " . " `users` `u` JOIN " . " `ast_sipfriends` `s` ON (`s`.`_user_id`=`u`.`id`) " . "WHERE " . " `u`.`id` IN (" . implode(",", $group_members) . ") AND (" . " `u`.`id` != " . $user_id . " ) AND " . $searchsql . " " . "ORDER BY `u`.`lastname`, `u`.`firstname` " . "LIMIT " . $num_results;
function gui_get_grouped_peers($user_id, $type) { require_once GS_DIR . 'inc/group-fns.php'; $user_groups = gs_group_members_groups_get(array($user_id), 'user'); $permission_groups = gs_group_permissions_get($user_groups, $type); $group_members = gs_group_members_get($permission_groups); return $group_members; }
} $type = trim(@$_REQUEST["t"]); if (!in_array($type, array("forward"), true)) { $type = false; } $user = trim(@$_REQUEST["u"]); if (!preg_match("/^\\d+\$/", $user)) { _err("Not a valid SIP user."); } $db = gs_db_slave_connect(); $user_id = getUserID($user); $mac = preg_replace("/[^\\dA-Z]/", "", strtoupper(trim(@$_REQUEST["m"]))); // check permissions $user_groups = gs_group_members_groups_get(array($user_id), "user"); $members_fwd = gs_group_permissions_get($user_groups, "forward"); $members_rt = gs_group_permissions_get($user_groups, "ringtone_set"); if (count($members_fwd) <= 0) { $show_forward = false; } else { $show_forward = true; } if (count($members_rt) <= 0) { $show_rt = false; } else { $show_rt = true; } // setup i18n stuff gs_setlang(gs_get_lang_user($db, $user, GS_LANG_FORMAT_GS)); gs_loadtextdomain("gemeinschaft-gui"); gs_settextdomain("gemeinschaft-gui"); $url_polycom_provdir = GS_PROV_SCHEME . "://" . GS_PROV_HOST . (GS_PROV_PORT ? ":" . GS_PROV_PORT : "") . GS_PROV_PATH . "polycom/";
return -1; } return $user_id; } //--------------------------------------------------------------------------- if (!gs_get_conf("GS_POLYCOM_PROV_ENABLED")) { gs_log(GS_LOG_DEBUG, "Polycom provisioning not enabled"); _err("Not enabled."); } $db = gs_db_slave_connect(); $mac = preg_replace("/[^\\dA-Z]/", "", strtoupper(trim(@$_REQUEST["m"]))); $user = trim(@$_REQUEST["u"]); $user_id = getUserID($user); // Check permissions $user_groups = gs_group_members_groups_get(array($user_id), "user"); $members = gs_group_permissions_get($user_groups, "dnd_set"); // exit if access is not granted if (count($members) <= 0) { exit(1); } // setup i18n stuff gs_setlang(gs_get_lang_user($db, $user, GS_LANG_FORMAT_GS)); gs_loadtextdomain("gemeinschaft-gui"); gs_settextdomain("gemeinschaft-gui"); $user_id_check = $db->executeGetOne("SELECT `user_id` FROM `phones` WHERE `mac_addr`='" . $db->escape($mac) . "'"); if ($user_id != $user_id_check) { _err("Not authorized"); } $remote_addr = @$_SERVER["REMOTE_ADDR"]; $remote_addr_check = $db->executeGetOne("SELECT `current_ip` FROM `users` WHERE `id`='" . $user_id . "'"); if ($remote_addr != $remote_addr_check) {
echo '<h2>'; if (@$MODULES[$SECTION]['icon']) { echo '<img alt=" " src="', GS_URL_PATH, str_replace('%s', '32', $MODULES[$SECTION]['icon']), '" /> '; } if (count($MODULES[$SECTION]['sub']) > 1) { echo $MODULES[$SECTION]['title'], ' - '; } echo $MODULES[$SECTION]['sub'][$MODULE]['title']; echo '</h2>', "\n"; $action = @$_REQUEST['action']; $user_id = @$_SESSION['sudo_user']['info']['id']; if (!$user_id) { exit; } $user_groups = gs_group_members_groups_get(array($user_id), 'user'); $queue_ids = gs_group_members_get(gs_group_permissions_get($user_groups, 'monitor_queues', 'queue')); if ($action == 'save') { $colors = array(); for ($status = 0; $status <= 255; ++$status) { if (array_key_exists('ec' . $status, $_REQUEST)) { $colors[$status] = trim($_REQUEST['ec' . $status]); } } $queues = array(); foreach ($queue_ids as $queue_id) { $queue = array(); if (array_key_exists('qa' . $queue_id, $_REQUEST) && $_REQUEST['qa' . $queue_id] == "on") { $queue['active'] = 1; } else { $queue['active'] = 0; }
* of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. \*******************************************************************/ defined('GS_VALID') or die('No direct access.'); $user_id = (int) @$_SESSION['sudo_user']['info']['id']; $user_groups = gs_group_members_groups_get(array($user_id), 'user'); $permission_groups = gs_group_permissions_get($user_groups, 'phonebook_imported_edit'); $group_members = gs_group_members_get($permission_groups); if (in_array($user_id, $group_members)) { $is_admin = true; } else { $is_admin = false; } echo '<h2>'; if (@$MODULES[$SECTION]['icon']) { echo '<img alt=" " src="', GS_URL_PATH, str_replace('%s', '32', $MODULES[$SECTION]['icon']), '" /> '; } if (count($MODULES[$SECTION]['sub']) > 1) { echo $MODULES[$SECTION]['title'], ' - '; } echo $MODULES[$SECTION]['sub'][$MODULE]['title']; echo '</h2>', "\n";
if ($user_id < 1) { snom_textscreen(__('Fehler'), __('Benutzer unbekannt')); } return $user_id; } if (!gs_get_conf('GS_SNOM_PROV_ENABLED')) { gs_log(GS_LOG_DEBUG, "Snom provisioning not enabled"); snom_textscreen(__('Fehler'), __('Nicht aktiviert')); } $db = gs_db_slave_connect(); $user = trim(@$_REQUEST['u']); $user_id = getUserID($user); ## Check permissions # $user_groups = gs_group_members_groups_get(array($user_id), 'user'); $members = gs_group_permissions_get($user_groups, 'forward'); if (count($members) <= 0) { _err('Forbidden'); } // setup i18n stuff gs_setlang(gs_get_lang_user($db, $user, GS_LANG_FORMAT_GS)); gs_loadtextdomain("gemeinschaft-gui"); gs_settextdomain("gemeinschaft-gui"); $type = trim(@$_REQUEST['t']); if (!in_array($type, array('internal', 'external', 'std', 'var', 'timeout'), true)) { $type = false; } $tmp = array(15 => array('k' => 'internal', 'v' => gs_get_conf('GS_CLIR_INTERNAL', __("von intern"))), 25 => array('k' => 'external', 'v' => gs_get_conf('GS_CLIR_EXTERNAL', __("von extern")))); kSort($tmp); foreach ($tmp as $arr) { $typeToTitle[$arr['k']] = $arr['v'];
include_once GS_DIR . 'inc/gs-fns/gs_user_callerids_get.php'; include_once GS_DIR . 'inc/group-fns.php'; echo '<h2>'; if (@$MODULES[$SECTION]['icon']) { echo '<img alt=" " src="', GS_URL_PATH, str_replace('%s', '32', $MODULES[$SECTION]['icon']), '" /> '; } if (count($MODULES[$SECTION]['sub']) > 1) { echo $MODULES[$SECTION]['title'], ' - '; } echo $MODULES[$SECTION]['sub'][$MODULE]['title']; echo '</h2>', "\n"; $user_groups = gs_group_members_groups_get(array($_SESSION['real_user']['info']['id']), 'user'); $members_clip = gs_group_permissions_get($user_groups, 'clip_set'); $members_clir = gs_group_permissions_get($user_groups, 'clir_set'); $members_cw = gs_group_permissions_get($user_groups, 'callwaiting_set'); $members_adm = gs_group_permissions_get($user_groups, 'sudo_user'); $disabled = array('clip' => '', 'clir' => '', 'cw' => ''); if (count($members_adm) <= 0) { if (count($members_clip) <= 0) { $disabled['clip'] = ' disabled'; } if (count($members_clir) <= 0) { $disabled['clir'] = ' disabled'; } if (count($members_cw) <= 0) { $disabled['cw'] = ' disabled'; } } if (@$_REQUEST['action'] == 'save') { $clir_internal = @$_REQUEST['clir-internal'] == 'yes' ? 'yes' : 'no'; $clir_external = @$_REQUEST['clir-external'] == 'yes' ? 'yes' : 'no';
$action = @$_REQUEST['action']; if ($action == 'report') { $group = @$_REQUEST['group']; $month_d = (int) @$_REQUEST['month']; } else { $action = ''; $group = ''; //$month_d = -1; # previous month $month_d = 0; # current month } if (!$group) { $group = @$_SESSION['sudo_user']['name']; } $user_groups = gs_group_members_groups_get(array(@$_SESSION['sudo_user']['info']['id']), 'user'); $select_groups = gs_group_permissions_get($user_groups, 'call_stats', 'user'); $group_info = gs_group_info_get($select_groups); if (array_search($group, $select_groups) === false) { $exts_sql = ''; } else { $users = gs_group_members_get(array($group)); $exts_sql = userids_to_exts($users); } ?> <form method="get" action="<?php echo GS_URL_PATH; ?>
<td style="width:140px;"><code>*4</code></td> <td style="width:420px;"> <?php echo __('Einrichten eines Weckrufes'); ?> </td> </tr> </tbody> </table> <?php } ?> <?php if (count(gs_group_permissions_get($user_groups, 'login_queues')) > 0) { ?> <table cellspacing="1" class="phonebook"> <thead> <tr> <th colspan="2"><?php echo __('Warteschlangen'); ?> </th> </tr> </thead> <tbody> <tr> <td style="width:140px;"><code>*5 <i><?php echo __('Durchwahl'); ?>
if (@$_REQUEST['action'] == 'save') { $clir_internal = @$_REQUEST['clir-internal'] == 'yes' ? 'yes' : 'no'; $clir_external = @$_REQUEST['clir-external'] == 'yes' ? 'yes' : 'no'; gs_clir_activate($_SESSION['sudo_user']['name'], 'internal', $clir_internal); gs_clir_activate($_SESSION['sudo_user']['name'], 'external', $clir_external); $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); } } } $user_groups = gs_group_members_groups_get(array(@$_SESSION['sudo_user']['info']['id']), 'user'); $queues_allowed = gs_group_members_get(gs_group_permissions_get($user_groups, 'login_queues', 'queue')); $user = gs_user_get($_SESSION['sudo_user']['name']); $queue_ids = @$_REQUEST['queue_id']; if (@$_REQUEST['action'] == 'loginqueue' && !empty($queue_ids)) { $ami = new AMI(); $ami->ami_login('gscc', 'gspass', '127.0.0.1', 5038); $agent = $DB->executeGetOne('SELECT `name` FROM `ast_sipfriends` WHERE `_user_id`=' . $user['id']); // Ich vertraue gs_group_members_get // in dem array sind NUR int() $queue_ids = array_intersect($queue_ids, $queues_allowed); $rs = $DB->execute('SELECT `_id`, `name` FROM `ast_queues` WHERE `_host_id`=' . $user['host_id'] . ' AND `_id` IN (' . implode(",", $queue_ids) . ') AND `_id` NOT IN (SELECT `_queue_id` FROM `ast_queue_members` WHERE `_user_id`=' . $user['id'] . ')'); while ($queue_map = $rs->fetchRow()) { $penalty = $DB->executeGetOne('SELECT `penalty` FROM `penalties` WHERE `_user_id`=' . $user['id'] . ' AND `_queue_id`=' . $queue_map['_id']);
?> </td> </tr> <tr> <td><code>*98*</code></td> <td> <?php echo __('Abwesenheitsansage für Anrufe von extern aufzeichnen'); ?> </td> </tr> </tbody> </table> <?php if (count(gs_group_permissions_get($user_groups, 'private_call')) > 0) { ?> <table cellspacing="1" class="phonebook"> <thead> <tr> <th colspan="2"><?php echo __('Privatgespräche'); ?> </th> </tr> </thead> <tbody> <tr> <td style="width:140px;"><code>*7* <i><?php echo __('Nummer'); ?>
} //--------------------------------------------------------------------------- if (!gs_get_conf('GS_POLYCOM_PROV_ENABLED')) { gs_log(GS_LOG_DEBUG, 'Polycom provisioning not enabled'); _err('Not enabled.'); } $type = trim(@$_REQUEST['t']); if (!in_array($type, array('internal', 'external', 'std', 'var', 'timeout'), true)) { $type = false; } $db = gs_db_slave_connect(); $user = trim(@$_REQUEST["u"]); $user_id = getUserID($user); // Check permissions $user_groups = gs_group_members_groups_get(array($user_id), "user"); $members = gs_group_permissions_get($user_groups, "forward"); if (count($members) <= 0) { _err("Forbidden"); } // setup i18n stuff gs_setlang(gs_get_lang_user($db, $user, GS_LANG_FORMAT_GS)); gs_loadtextdomain("gemeinschaft-gui"); gs_settextdomain("gemeinschaft-gui"); $tmp = array(15 => array("k" => "internal", "v" => gs_get_conf("GS_CLIR_INTERNAL", __("von intern"))), 25 => array("k" => "external", "v" => gs_get_conf("GS_CLIR_EXTERNAL", __("von extern")))); ksort($tmp); foreach ($tmp as $arr) { $typeToTitle[$arr["k"]] = $arr["v"]; } $url_polycom_provdir = GS_PROV_SCHEME . '://' . GS_PROV_HOST . (GS_PROV_PORT ? ':' . GS_PROV_PORT : '') . GS_PROV_PATH . 'polycom/'; $url_polycom_callforward = $url_polycom_provdir . "callforward.php"; $url_polycom_menu = $url_polycom_provdir . "configmenu.php";
echo '<br /><p align="center"><a href="setup/">Setup</a></p>', "\n"; echo '</body>', "\n"; echo '</html>'; exit; } } } } include_once GS_DIR . 'inc/gettext.php'; require_once GS_DIR . 'htdocs/gui/inc/session.php'; # defines $DB require_once GS_HTDOCS_DIR . 'inc/modules.php'; if (!@$_SESSION['login_ok']) { $display_modules = array(); } else { $display_modules = gs_group_members_get(gs_group_permissions_get(gs_group_members_groups_get(array(@$_SESSION['sudo_user']['info']['id']), 'user'), 'display_module_gui', 'module_gui')); } # get section & module # if (array_key_exists('s', $_REQUEST)) { $SECTION = $_REQUEST['s']; if ($SECTION != '') { $MODULE = array_key_exists('m', $_REQUEST) ? $_REQUEST['m'] : ''; } else { $SECTION = 'home'; $MODULE = ''; } } else { $SECTION = 'home'; $MODULE = ''; }
echo '<h2>'; if (@$MODULES[$SECTION]['icon']) { echo '<img alt=" " src="', GS_URL_PATH, str_replace('%s', '32', $MODULES[$SECTION]['icon']), '" /> '; } if (count($MODULES[$SECTION]['sub']) > 1) { echo $MODULES[$SECTION]['title'], ' - '; } echo $MODULES[$SECTION]['sub'][$MODULE]['title']; echo '</h2>', "\n"; $action = @$_REQUEST['action']; $user_id = @$_SESSION['sudo_user']['info']['id']; if (!$user_id) { exit; } $user_groups = gs_group_members_groups_get(array($user_id), 'user'); $monitor_group_ids = gs_group_permissions_get($user_groups, 'monitor_peers', 'user'); if ($action == 'save') { $colors = array(); for ($status = 0; $status <= 255; ++$status) { if (array_key_exists('ec' . $status, $_REQUEST)) { $colors[$status] = trim($_REQUEST['ec' . $status]); } } $groups = array(); foreach ($monitor_group_ids as $group_id) { $group = array(); if (array_key_exists('qa' . $group_id, $_REQUEST) && $_REQUEST['qa' . $group_id] == "on") { $group['active'] = 1; } else { $group['active'] = 0; }
$actives['vmln-' . ++$ncnt] = sprintf(__('Ansg. %u'), $ncnt); $timeruleactives['vmln-' . $r['id']] = sprintf(__('Ansg. %u'), $ncnt); } $id = (int) $DB->executeGetOne('SELECT `_queue_id` from `queue_cf_timerules` WHERE `_queue_id`=' . $queue_id); if ($id) { $actives['trl'] = __('Zeitsteuerung'); } $id = (int) $DB->executeGetOne('SELECT `_queue_id` from `queue_cf_parallelcall` WHERE `_queue_id`=' . $queue_id); if ($id) { $actives['par'] = __('Parallelruf'); $timeruleactives['par'] = __('Parallelruf'); } } $queues = @gs_queues_get(); $user_groups = gs_group_members_groups_get(array(@$_SESSION['sudo_user']['info']['id']), 'user'); $queue_groups = gs_group_members_get(gs_group_permissions_get($user_groups, 'forward_queues', 'queue')); if (isGsError($queues)) { echo __('Fehler beim Abfragen der Warteschlangen.'), ' - ', $queues->getMsg(); return; # return to parent file } elseif (!is_array($queues)) { echo __('Fehler beim Abfragen der Warteschlangen.'); return; # return to parent file } $queue = null; if ($queue_ext != '') { foreach ($queues as $q) { if ($q['name'] == $queue_ext && array_search($q['id'], $queue_groups) !== false) { $queue = $q; break;
if (!is_array($user)) { snom_textscreen(__('Fehler'), __('Datenbankfehler')); } // setup i18n stuff gs_setlang(gs_get_lang_user($db, $user, GS_LANG_FORMAT_GS)); gs_loadtextdomain('gemeinschaft-gui'); gs_settextdomain('gemeinschaft-gui'); $remote_addr = @$_SERVER["REMOTE_ADDR"]; $remote_addr_check = $db->executeGetOne("SELECT `current_ip` FROM `users` WHERE `id`='" . $user_id . "'"); if ($remote_addr != $remote_addr_check) { snom_textscreen(__('Fehler'), __('Keine Berechtigung')); } # check permissions # $user_groups = gs_group_members_groups_get(array($user_id), 'user'); $members = gs_group_permissions_get($user_groups, 'agent'); if (count($members) <= 0) { snom_textscreen(__('Fehler'), __('Keine Berechtigung')); } # get agent # if ($agent) { $agent_id = (int) $db->executeGetOne('SELECT `id` FROM `agents` WHERE `number`="' . $agent . '"'); } else { $agent_id = (int) $db->executeGetOne('SELECT `id` FROM `agents` WHERE `user_id`=' . $user_id); } $old_user_id = (int) $db->executeGetOne('SELECT `user_id` FROM `agents` WHERE `id`=' . $agent_id . ' AND `user_id` > 0'); if ($old_user_id == $user_id) { $db->execute('DELETE FROM `ast_queue_members` WHERE `_user_id`=' . $user_id); $db->execute('UPDATE `agents` SET `user_id`=0, `paused`=0 WHERE `id`=' . $agent_id); $agent_number = $db->executeGetOne('SELECT `number` FROM `agents` WHERE `id`=' . $agent_id);
* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. \*******************************************************************/ defined('GS_VALID') or die('No direct access.'); include_once GS_DIR . 'inc/group-fns.php'; $user_id = (int) @$_SESSION['sudo_user']['info']['id']; $user_groups = gs_group_members_groups_get(array($user_id), 'user'); $permission_groups = gs_group_permissions_get($user_groups, 'phonebook_user'); $group_members = gs_group_members_get($permission_groups); echo '<h2>'; if (@$MODULES[$SECTION]['icon']) { echo '<img alt=" " src="', GS_URL_PATH, str_replace('%s', '32', $MODULES[$SECTION]['icon']), '" /> '; } if (count($MODULES[$SECTION]['sub']) > 1) { echo $MODULES[$SECTION]['title'], ' - '; } echo $MODULES[$SECTION]['sub'][$MODULE]['title']; echo '</h2>', "\n"; echo '<script type="text/javascript" src="', GS_URL_PATH, 'js/arrnav.js"></script>', "\n"; $per_page = (int) GS_GUI_NUM_RESULTS; $name = trim(@$_REQUEST['name']); $number = trim(@$_REQUEST['number']); $page = (int) @$_REQUEST['page'];
gs_settextdomain("gemeinschaft-gui"); // group permissions $user_groups = gs_group_members_groups_get(array($user_id), "user"); $members_clip = gs_group_permissions_get($user_groups, "clip_set"); if (count($members_clip) <= 0) { $show_clip = false; } else { $show_clip = true; } $members_clir = gs_group_permissions_get($user_groups, "clir_set"); if (count($members_clir) <= 0) { $show_clir = false; } else { $show_clir = true; } $members_callwaiting = gs_group_permissions_get($user_groups, "callwaiting_set"); if (count($members_callwaiting) <= 0) { $show_cw = false; } else { $show_cw = true; } $tmp = array(); if ($show_clir) { $tmp[15] = array("k" => "internal", "v" => gs_get_conf("GS_CLIR_INTERNAL", __("CLIR Intern"))); $tmp[25] = array("k" => "external", "v" => gs_get_conf("GS_CLIR_EXTERNAL", __("CLIR Extern"))); } if ($show_cw) { $tmp[35] = array("k" => "callwaiting", "v" => gs_get_conf("GS_CALLWAITING", __("Anklopfen"))); } if ($show_clip) { $tmp[45] = array("k" => "cidext", "v" => gs_get_conf("GS_CALLERID", __("CID extern")));
} else { $action = ''; $group = @$_SESSION['sudo_user']['name']; //$month_d = -1; # previous month $day_d = 0; # current month $h_start = 7; $h_end = 18; } if (!$group) { $group = @$_SESSION['sudo_user']['name']; } $user_groups = gs_group_members_groups_get(array(@$_SESSION['sudo_user']['info']['id']), 'user'); $select_groups = gs_group_permissions_get($user_groups, 'call_stats', 'user'); $group_info = gs_group_info_get($select_groups); $queue_groups = gs_group_members_get(gs_group_permissions_get($user_groups, 'call_stats', 'queue')); if (array_search($group, $select_groups) === FALSE) { $exts_sql = ''; } else { $users = gs_group_members_get(array($group)); $exts_sql = userids_to_exts($users); } if (array_search($queue_id, $queue_groups) === FALSE) { $queue_id = 0; } ?> <form method="get" action="<?php
return -1; } $user_id = (int) $db->executeGetOne('SELECT `_user_id` FROM `ast_sipfriends` WHERE `name`=\'' . $db->escape($ext) . '\''); if ($user_id < 1) { _return - 1; } return $user_id; } $type = trim(@$_REQUEST['t']); $db = gs_db_slave_connect(); $user = trim(@$_REQUEST['u']); $user_id = getUserID($user); ## Check permissions # $user_groups = gs_group_members_groups_get(array($user_id), 'user'); $members = gs_group_permissions_get($user_groups, 'dnd_set'); if (count($members) <= 0) { exit(1); } $url_snom_dnd = GS_PROV_SCHEME . '://' . GS_PROV_HOST . (GS_PROV_PORT == 80 ? '' : ':' . GS_PROV_PORT) . GS_PROV_PATH . 'snom/dnd.php'; #################################### INITIAL SCREEN { if ($type == 1) { $mac = preg_replace('/[^\\dA-Z]/', '', strToUpper(trim(@$_REQUEST['m']))); echo $user_id; $user_id_check = $db->executeGetOne('SELECT `user_id` FROM `phones` WHERE `mac_addr`=\'' . $db->escape($mac) . '\''); if ($user_id != $user_id_check) { exit(1); } $remote_addr = @$_SERVER['REMOTE_ADDR']; $remote_addr_check = $db->executeGetOne('SELECT `current_ip` FROM `users` WHERE `id`=\'' . $user_id . '\''); if ($remote_addr != $remote_addr_check) {