|
|
|
@ -32,14 +32,14 @@ require_once('common.php'); |
|
|
|
|
|
|
|
# force user to delete setup.php (allows creation of superadmins!)
|
|
|
|
if (file_exists (realpath ("./setup.php"))) { |
|
|
|
if (is_string($CONF['configured']) && $CONF['configured'] == 'I_know_the_risk_of_not_deleting_setup.php') |
|
|
|
{ |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (is_string($CONF['configured']) && $CONF['configured'] == 'I_know_the_risk_of_not_deleting_setup.php') |
|
|
|
{ |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
print "Please delete setup.php before using Postfix Admin!"; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] == "GET") |
|
|
|
@ -55,12 +55,12 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") |
|
|
|
$fPassword = ''; |
|
|
|
if (isset ($_POST['fUsername'])) $fUsername = escape_string ($_POST['fUsername']); |
|
|
|
if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); |
|
|
|
$lang = safepost('lang'); |
|
|
|
$lang = safepost('lang'); |
|
|
|
|
|
|
|
if ( $lang != check_language(0) ) { # only set cookie if language selection was changed
|
|
|
|
setcookie('lang', $lang, time() + 60*60*24*30); # language cookie, lifetime 30 days
|
|
|
|
# (language preference cookie is processed even if username and/or password are invalid)
|
|
|
|
} |
|
|
|
if ( $lang != check_language(0) ) { # only set cookie if language selection was changed
|
|
|
|
setcookie('lang', $lang, time() + 60*60*24*30); # language cookie, lifetime 30 days
|
|
|
|
# (language preference cookie is processed even if username and/or password are invalid)
|
|
|
|
} |
|
|
|
|
|
|
|
$result = db_query ("SELECT password FROM $table_admin WHERE username='$fUsername' AND active='1'"); |
|
|
|
if ($result['rows'] == 1) |
|
|
|
@ -105,4 +105,6 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") |
|
|
|
include ("./templates/login.php"); |
|
|
|
include ("./templates/footer.php"); |
|
|
|
} |
|
|
|
|
|
|
|
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ |
|
|
|
?>
|