in AlternC ! */ $fatalcsrf=false; if (count($_POST) && !defined("NOCSRF")) { if (csrf_check()<=0) { // We will trigger the error LATER in the code => need initialization of classes $fatalcsrf=true; } } /* Check the User identity (if not disabled) */ if (!defined('NOCHECK')) { if (!$mem->checkid()) { if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) { header('WWW-Authenticate: Basic realm="AlternC Authentication"'); header('HTTP/1.0 401 Unauthorized'); exit(); } include("$root/admin/index.php"); exit(); } } for ($i = 0; $i < count($classes); $i++) { $name2 = $classes[$i]; if (isset($$name2)) continue; // for already instancied class like mem, msg or authip $name1 = "m_" . $name2; $$name2 = new $name1(); } $oldid = intval(isset($_COOKIE['oldid']) ? $_COOKIE['oldid'] : ''); $isinvited = false; if ($admin->enabled) $isinvited = true; if ($oldid && $oldid != $cuid) { $isinvited = true; } // Init some vars variable_get('hosting_tld', '', 'This is a FQDN that designates the main hostname of the service. For example, hosting_tld determines in what TLD the "free" user domain is created. If this is set to "example.com", a checkbox will appear in the user creation dialog requesting the creator if he wants to create the domain "username.example.com".', array('desc' => 'Wanted FQDN', 'type' => 'string')); variable_get('subadmin_restriction', '0', "This variable sets the way the account list works for accounts other than 'admin' (2000). 0 (default) = admin other than admin/2000 can see their own account, but not the other one 1 = admin other than admin/2000 can see any account by clicking the ''show all accounts'' link.", array('desc' => 'Shared access activated?', 'type' => 'boolean')); variable_get('auth_ip_ftp_default_yes', '1', "This variable sets if you want to allow all IP address to access FTP by default. If the user start to define some IP or subnet in the allow list, only those he defined will be allowed.", array('desc' => 'Allow by default?', 'type' => 'boolean')); if ((variable_get('sql_max_username_length', NULL)==NULL)||(variable_get('sql_max_database_length', NULL)==NULL)) { $result = $db->query("SELECT (SELECT CHARACTER_MAXIMUM_LENGTH length FROM information_schema.columns WHERE TABLE_SCHEMA='mysql' and TABLE_NAME='user' and COLUMN_NAME='User') username, (SELECT CHARACTER_MAXIMUM_LENGTH length FROM information_schema.columns WHERE TABLE_SCHEMA='mysql' and TABLE_NAME='db' and COLUMN_NAME='Db') `database`"); if ($db->next_record($result)) { $variable = $db->Record; $variable['username']=min(128, $variable['username']); $variable['database']=min($variable['database'], $variable['username']); variable_set('sql_max_username_length', $variable['username'], 'Maximum length allowed for SQL usernames by your SQL server (do not modify unless you know what you do)'); variable_set('sql_max_database_length', $variable['database'], 'Maximum length allowed for SQL database names by your SQL server (do not modify unless you know what you do)'); } } // any page can add elements to js/css part of BEFORE including head.php $addhead=array('js'=>array(), 'css'=>array()); if ($fatalcsrf) { require_once("main.php"); exit(); }