You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-01-03 17:02:30 +03:00
functions.inc.php: - function check_language - new optional parameter $use_post (needed by login.php) - check for language cookie - check for $_POST['lang'] - removed substr() call because it made pt-br translation unuseable - new function language_selector - returns a HTML dropdown language selector - new function safecookie - similar to safeget, but for cookies templates/login.php, templates/users_login.php: - display language selector dropdown login.php, users/login.php: - check for selected language - set cookie if user selected non-default language languages/language.php: (NEW FILE) - list of supported languages - language names taken from phpMyAdmin login form common.php: - include languages/language.php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@280 a1433add-5e2c-0410-b055-b7f2511e0802
47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Postfix Admin
|
|
*
|
|
* LICENSE
|
|
* This source file is subject to the GPL license that is bundled with
|
|
* this package in the file LICENSE.TXT.
|
|
*
|
|
* Further details on the project are available at :
|
|
* http://www.postfixadmin.com or http://postfixadmin.sf.net
|
|
*
|
|
* @version $Id$
|
|
* @license GNU GPL v2 or later.
|
|
*
|
|
* File: common.php
|
|
* All pages should include this file - which itself sets up the necessary
|
|
* environment and ensures other functions are loaded.
|
|
*/
|
|
|
|
define('POSTFIXADMIN', 1); # checked in included files
|
|
|
|
$incpath = dirname(__FILE__);
|
|
(ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_runtime', '0') : '1');
|
|
(ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_sybase', '0') : '1');
|
|
|
|
if(ini_get('register_globals')) {
|
|
die("Please turn off register_globals; edit your php.ini");
|
|
}
|
|
require_once("$incpath/variables.inc.php");
|
|
if(!is_file("$incpath/config.inc.php")) {
|
|
// incorrectly setup...
|
|
header("Location: setup.php");
|
|
exit(0);
|
|
}
|
|
require_once("$incpath/config.inc.php");
|
|
if(isset($CONF['configured'])) {
|
|
if($CONF['configured'] == FALSE) {
|
|
header("Location: setup.php");
|
|
exit(0);
|
|
}
|
|
}
|
|
require_once("$incpath/languages/language.php");
|
|
require_once("$incpath/functions.inc.php");
|
|
require_once("$incpath/languages/" . check_language () . ".lang");
|
|
|
|
session_start();
|