diff --git a/bureau/class/config.php b/bureau/class/config.php index 02def355..1ffefc29 100644 --- a/bureau/class/config.php +++ b/bureau/class/config.php @@ -66,12 +66,17 @@ if (ini_get("safe_mode")) { exit(); } +$error = ""; /* PHPLIB inclusions : */ $root="/var/alternc/bureau/"; /* Server Domain Name */ $host=getenv("HTTP_HOST"); +/* Custom PHP debugger */ +require_once($root."class/error_handler.php"); +$queryCount = 0; + /* Global variables (AlternC configuration) */ require_once($root."class/local.php"); @@ -79,6 +84,8 @@ require_once($root."class/db_mysql.php"); require_once($root."class/functions.php"); require_once($root."class/variables.php"); +$tempsDebut = microtimeFloat(); + // Redirection si appel à https://(!fqdn)/ if ($_SERVER["HTTPS"]=="on" && $host!=$L_FQDN) { header("Location: https://$L_FQDN/"); @@ -143,7 +150,14 @@ $err=new m_err(); /* Check the User identity (if required) */ if (!defined('NOCHECK')) { - if (!$mem->checkid()) { + $fields = array ( + "username" => array ("request", "string", ""), + "password" => array ("request", "string", ""), + "restrictip" => array ("request", "integer", 0), + ); + getFields($fields); + + if (!$mem->checkid($username,$password,$restrictip)) { $error=$err->errstr(); include("index.php"); exit(); diff --git a/bureau/class/m_mem.php b/bureau/class/m_mem.php index c1872a84..548b1a94 100644 --- a/bureau/class/m_mem.php +++ b/bureau/class/m_mem.php @@ -161,8 +161,8 @@ class m_mem { * @global string $username/password le login/pass de l'utilisateur * @return TRUE si la session est correcte, FALSE sinon. */ - function checkid() { - global $db,$err,$session,$username,$password,$cuid,$restrictip; + function checkid($username, $password, $restrictip) { + global $db,$err,$session,$cuid; if ($username && $password) { return $this->login($username,$password,$restrictip); }