diff --git a/admin/index.php b/admin/index.php index 4690bda..1fca8a5 100644 --- a/admin/index.php +++ b/admin/index.php @@ -13,6 +13,7 @@ if(!defined('entry'))define('entry', true); ?> conf = new configuration(); } - function isAdmin() { - + function isAdmin() { + if ((!empty($_SESSION["user_id"]) && !empty($_SESSION["user_login"])) && (isset($_SESSION['authenticated']) && $_SESSION['authenticated']==true)) { return true; } - if(isset($_COOKIE["PHPSESSID"]) && $_COOKIE["PHPSESSID"]!="") { + if(isset($_COOKIE["PHPSESSID"]) && $_COOKIE["PHPSESSID"]!="") { + if ((!empty($_SESSION["user_id"]) && !empty($_SESSION["user_login"])) && (isset($_SESSION['authenticated']) && $_SESSION['authenticated']==true)) { return true; } + } return false; @@ -79,7 +81,7 @@ class user extends Conexion_Mysql { } } - function isAuthenticated(){ + function isAuthenticated() { return $this->isAdmin(); } diff --git a/entry.php b/entry.php index cf2ba18..0bb019f 100644 --- a/entry.php +++ b/entry.php @@ -1,4 +1,5 @@ is_gelato_installed()){ if(basename($_SERVER['PHP_SELF'])!='install.php'){ header("Location: {$dir}install.php");exit; @@ -45,8 +52,9 @@ if (!file_exists($configFile) and basename($_SERVER['PHP_SELF'])!='install.php') } } -if($installed) +if($installed) { require($configFile); +} require_once("classes/configuration.class.php"); require_once("classes/textile.class.php"); @@ -62,16 +70,18 @@ require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php'); require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'lang.functions.php'); if($installed){ + // Globals to be used throughout the application $user = new user(); $tumble = new gelato(); $conf = new configuration(); $db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password); - + session_start(); - - $feeds = new feeds(); - $feeds->updateFeeds(); + + $feeds = new feeds(); + $feeds->updateFeeds(); unset($feeds); } ?> +