Fixed a bug with admin login
parent
510091bc10
commit
918668ccb5
|
|
@ -13,6 +13,7 @@ if(!defined('entry'))define('entry', true);
|
|||
?>
|
||||
<?php
|
||||
require('../entry.php');
|
||||
|
||||
global $user, $conf, $tumble;
|
||||
$template = new plantillas("admin");
|
||||
|
||||
|
|
|
|||
|
|
@ -34,9 +34,11 @@ class user extends Conexion_Mysql {
|
|||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
|
|||
18
entry.php
18
entry.php
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
ob_start();
|
||||
if(!defined('entry') || !entry) die('Not a valid page');
|
||||
/*
|
||||
* Created on Sep 15, 2007
|
||||
|
|
@ -24,6 +25,10 @@
|
|||
* classes/imgsize.php
|
||||
*/
|
||||
|
||||
error_reporting (E_ALL);
|
||||
ini_set('display_errors', '1');
|
||||
|
||||
|
||||
// PHP settings specific to Gelato
|
||||
ini_set('pcre.backtrack_limit', '10000');
|
||||
// Globals to be used throughout the application
|
||||
|
|
@ -31,10 +36,12 @@ define('Absolute_Path', dirname(__FILE__).DIRECTORY_SEPARATOR);
|
|||
$installed = true;
|
||||
$configFile = Absolute_Path.'config.php';
|
||||
|
||||
if(strpos($_SERVER['REQUEST_URI'],'/admin'))$dir = "../"; else $dir = "";
|
||||
$dir = (strpos($_SERVER['REQUEST_URI'],'/admin')) ? "../" : "";
|
||||
|
||||
if (!file_exists($configFile) and basename($_SERVER['PHP_SELF'])!='install.php'){
|
||||
header("Location: {$dir}install.php");exit;
|
||||
}else{
|
||||
header("Location: {$dir}install.php");
|
||||
exit;
|
||||
} else {
|
||||
include(Absolute_Path.'classes/install.class.php');
|
||||
$install = new Install();
|
||||
if(!$install->is_gelato_installed()){
|
||||
|
|
@ -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,6 +70,7 @@ 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();
|
||||
|
|
@ -75,3 +84,4 @@ if($installed){
|
|||
unset($feeds);
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue