From 06c9b7c6ce48ef583b83c10b952eb9800fc7ebe7 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Wed, 19 Dec 2012 17:33:40 +0000 Subject: [PATCH] 2012-12-19 Juan Manuel Ramon * include/functions_users.php: Fixed warning when chat log file doesn't exists. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7312 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_users.php | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 16f8e2765e..e0260086ab 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-12-19 Juan Manuel Ramon + + * include/functions_users.php: Fixed warning when chat log file + doesn't exists. + 2012-12-19 Juan Manuel Ramon * extensions/module_groups.php: Fixed view, colors in cells were diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php index 864e930999..18bf0f2b91 100644 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -713,9 +713,13 @@ function users_get_last_type_message() { $text_encode = @file_get_contents($log_chat_file); $log = json_decode($text_encode, true); - $last = end($log); - - $return = $last['type']; + // Prevent from error when chat file log doesn't exists + if (empty($log)) + $return = false; + else { + $last = end($log); + $return = $last['type']; + } fclose($fp_global_counter); }