parent
4be66099c0
commit
8d7c15e924
|
@ -66,12 +66,17 @@ if (ini_get("safe_mode")) {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$error = "";
|
||||||
|
|
||||||
/* PHPLIB inclusions : */
|
/* PHPLIB inclusions : */
|
||||||
$root="/var/alternc/bureau/";
|
$root="/var/alternc/bureau/";
|
||||||
/* Server Domain Name */
|
/* Server Domain Name */
|
||||||
$host=getenv("HTTP_HOST");
|
$host=getenv("HTTP_HOST");
|
||||||
|
|
||||||
|
/* Custom PHP debugger */
|
||||||
|
require_once($root."class/error_handler.php");
|
||||||
|
$queryCount = 0;
|
||||||
|
|
||||||
/* Global variables (AlternC configuration) */
|
/* Global variables (AlternC configuration) */
|
||||||
require_once($root."class/local.php");
|
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/functions.php");
|
||||||
require_once($root."class/variables.php");
|
require_once($root."class/variables.php");
|
||||||
|
|
||||||
|
$tempsDebut = microtimeFloat();
|
||||||
|
|
||||||
// Redirection si appel à https://(!fqdn)/
|
// Redirection si appel à https://(!fqdn)/
|
||||||
if ($_SERVER["HTTPS"]=="on" && $host!=$L_FQDN) {
|
if ($_SERVER["HTTPS"]=="on" && $host!=$L_FQDN) {
|
||||||
header("Location: https://$L_FQDN/");
|
header("Location: https://$L_FQDN/");
|
||||||
|
@ -143,7 +150,14 @@ $err=new m_err();
|
||||||
|
|
||||||
/* Check the User identity (if required) */
|
/* Check the User identity (if required) */
|
||||||
if (!defined('NOCHECK')) {
|
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();
|
$error=$err->errstr();
|
||||||
include("index.php");
|
include("index.php");
|
||||||
exit();
|
exit();
|
||||||
|
|
|
@ -161,8 +161,8 @@ class m_mem {
|
||||||
* @global string $username/password le login/pass de l'utilisateur
|
* @global string $username/password le login/pass de l'utilisateur
|
||||||
* @return TRUE si la session est correcte, FALSE sinon.
|
* @return TRUE si la session est correcte, FALSE sinon.
|
||||||
*/
|
*/
|
||||||
function checkid() {
|
function checkid($username, $password, $restrictip) {
|
||||||
global $db,$err,$session,$username,$password,$cuid,$restrictip;
|
global $db,$err,$session,$cuid;
|
||||||
if ($username && $password) {
|
if ($username && $password) {
|
||||||
return $this->login($username,$password,$restrictip);
|
return $this->login($username,$password,$restrictip);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue