Update index_inc.php

Prevent php warnings.
This commit is contained in:
FusionPBX 2017-01-29 13:06:07 -07:00 committed by GitHub
parent 7b401b39a0
commit 72094f870f
1 changed files with 37 additions and 27 deletions

View File

@ -17,31 +17,35 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2015 Portions created by the Initial Developer are Copyright (C) 2008-2016
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
*/ */
include "root.php";
require_once "resources/require.php"; //includes
require_once "resources/check_auth.php"; include "root.php";
require_once "./resources/functions/get_call_activity.php"; require_once "resources/require.php";
if (permission_exists('operator_panel_view')) { require_once "resources/check_auth.php";
require_once "./resources/functions/get_call_activity.php";
//check permissions
if (permission_exists('operator_panel_view')) {
//access granted //access granted
} }
else { else {
echo "access denied"; echo "access denied";
exit; exit;
} }
//add multi-lingual support //add multi-lingual support
$language = new text; $language = new text;
$text = $language->get(); $text = $language->get();
$activity = get_call_activity(); //get the call activity
$activity = get_call_activity();
if (is_array($activity)) foreach ($activity as $extension => $fields) { if (is_array($activity)) foreach ($activity as $extension => $fields) {
if (substr_count($fields['call_group'], ',')) { if (substr_count($fields['call_group'], ',')) {
$tmp = explode(',', $fields['call_group']); $tmp = explode(',', $fields['call_group']);
if (is_array($tmp)) foreach ($tmp as $tmp_index => $tmp_value) { if (is_array($tmp)) foreach ($tmp as $tmp_index => $tmp_value) {
@ -52,11 +56,17 @@ if (is_array($activity)) foreach ($activity as $extension => $fields) {
else if ($fields['call_group'] != '') { else if ($fields['call_group'] != '') {
$groups[] = $fields['call_group']; $groups[] = $fields['call_group'];
} }
} }
if (is_array($groups)) { if (is_array($groups)) {
$groups = array_unique($groups); $groups = array_unique($groups);
sort($groups); sort($groups);
} }
//prevent warnings
if (!is_array($_SESSION['user']['extensions'])) {
$_SESSION['user']['extensions'] = array();
}
$onhover_pause_refresh = " onmouseover='refresh_stop();' onmouseout='refresh_start();'"; $onhover_pause_refresh = " onmouseover='refresh_stop();' onmouseout='refresh_start();'";