Merci de revenir plus tard."; exit(); } */ // 1. Get a semaphore id for the alternc magic number (18577) $alternc_sem = sem_get ( 18577 ); // 2. Declare the shutdown function, that release the semaphore function alternc_shutdown() { global $alternc_sem; @sem_release( $alternc_sem ); } // 3. Register the shutdown function register_shutdown_function("alternc_shutdown"); // 4. Acquire the semaphore : with that process, sem_acquire( $alternc_sem ); if (ini_get("safe_mode")) { echo "SAFE MODE IS ENABLED for the web panel ! It's a bug in your php or apache configuration, please fix it !!"; exit(); } // For people who want to authenticate with HTTP AUTH if (isset($_GET['http_auth'])) $http_auth=strval($_GET['http_auth']); if (isset($http_auth) && $http_auth) { if (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW'])) { header('WWW-Authenticate: Basic realm="Test Authentication System"'); header('HTTP/1.0 401 Unauthorized'); exit(); } } if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) { // Gruiiik $_REQUEST["username"]=$_SERVER['PHP_AUTH_USER']; $_REQUEST["password"]=$_SERVER['PHP_AUTH_PW']; } $help_baseurl="http://www.aide-alternc.org/"; /* Server Domain Name */ $host=getenv("HTTP_HOST"); /* Global variables (AlternC configuration) */ require_once(dirname(__FILE__)."/local.php"); /* PHPLIB inclusions : */ $root=$L_ALTERNC_LOC."/bureau/"; require_once($root."class/db_mysql.php"); require_once($root."class/functions.php"); require_once($root."class/variables.php"); // Redirection si appel à https://(!fqdn)/ if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"]=="on" && $host!=$L_FQDN) { header("Location: https://$L_FQDN/"); } // Classe héritée de la classe db de la phplib. /** * Class for MySQL management in the bureau * * This class heriting from the db class of the phplib manages * the connection to the MySQL database. */ class DB_system extends DB_Sql { var $Host,$Database,$User,$Password; /** * Creator */ function DB_system() { global $L_MYSQL_HOST,$L_MYSQL_DATABASE,$L_MYSQL_LOGIN,$L_MYSQL_PWD; $this->Host = $L_MYSQL_HOST; $this->Database = $L_MYSQL_DATABASE; $this->User = $L_MYSQL_LOGIN; $this->Password = $L_MYSQL_PWD; } } $db= new DB_system(); // Current User ID = the user whose commands are made on behalf of. $cuid=0; $classes=array(); /* CLASSES PHP : automatic include : */ $c=opendir($root."class/"); while ($di=readdir($c)) { if (preg_match("#^m_(.*)\\.php$#",$di,$match)) { // $ $name1="m_".$match[1]; $name2=$match[1]; $classes[]=$name2; require_once($root."class/".$name1.".php"); } } closedir($c); /* THE DEFAULT CLASSES ARE : dom, ftp, mail, quota, bro, admin, mem, mysql, err */ /* Language */ include_once("lang_env.php"); $mem=new m_mem(); $err=new m_err(); $authip=new m_authip(); /* Check the User identity (if required) */ if (!defined('NOCHECK')) { if (!$mem->checkid()) { $error=$err->errstr(); include("index.php"); exit(); } } for($i=0;$i