From 3502d79055721d938d373c0f5ca97f1a013c646a Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 11 Nov 2010 11:19:37 +0000 Subject: [PATCH] 2010-11-11 Sergio Martin * include/fgraph.php: Fixed session auth for external access git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3573 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/fgraph.php | 17 +++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 9968819289..b7ae0b70ee 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-11-11 Sergio Martin + + * include/fgraph.php: Fixed session auth for + external access + 2010-11-11 Raúl Mateos * general/error_install.php, general/error_perms.php, general/header.php, diff --git a/pandora_console/include/fgraph.php b/pandora_console/include/fgraph.php index d89eb080d1..9c0cea533b 100644 --- a/pandora_console/include/fgraph.php +++ b/pandora_console/include/fgraph.php @@ -50,14 +50,15 @@ if (! isset ($config["id_user"])) { if (isset($_SESSION["id_usuario"])) { $config["id_user"] = $_SESSION["id_usuario"]; } -} - -if (! isset ($config["id_user"])) { - require_once('../mobile/include/user.class.php'); - session_start (); - session_write_close (); - $user = $_SESSION['user']; - $config["id_user"] = $user->getIdUser(); + else if (! isset ($config["id_user"])) { + require_once('../mobile/include/user.class.php'); + session_start (); + session_write_close (); + $user = $_SESSION['user']; + if(!empty($user)) { + $config["id_user"] = $user->getIdUser(); + } + } } //Fixed the graph for cron (that it's login)