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,16 +17,20 @@
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>
*/ */
//includes
include "root.php"; include "root.php";
require_once "resources/require.php"; require_once "resources/require.php";
require_once "resources/check_auth.php"; require_once "resources/check_auth.php";
require_once "./resources/functions/get_call_activity.php"; require_once "./resources/functions/get_call_activity.php";
//check permissions
if (permission_exists('operator_panel_view')) { if (permission_exists('operator_panel_view')) {
//access granted //access granted
} }
@ -39,8 +43,8 @@ else {
$language = new text; $language = new text;
$text = $language->get(); $text = $language->get();
//get the call activity
$activity = get_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']);
@ -58,6 +62,12 @@ if (is_array($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();'";
echo "<table width='100%'>"; echo "<table width='100%'>";