diff --git a/create-alias.php b/create-alias.php index 41328dec..6e2cd82b 100644 --- a/create-alias.php +++ b/create-alias.php @@ -41,7 +41,7 @@ if(authentication_has_role('global-admin')) { $list_domains = list_domains (); } else { - $list_domains = list_domains_for_admin ($username); + $list_domains = list_domains_for_admin ($username); } $pCreate_alias_goto_text = $PALANG['pCreate_alias_goto_text']; @@ -57,7 +57,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isset ($_POST['fAddress']) && isset ($_POST['fDomain'])) { $fAddress = escape_string($_POST['fAddress']) . "@" . escape_string ($_POST['fDomain']); - $fAddress = strtolower ($fAddress); + $fAddress = strtolower ($fAddress); } if (isset ($_POST['fGoto'])) { @@ -156,4 +156,5 @@ include ("templates/header.php"); include ("templates/menu.php"); include ("templates/create-alias.php"); include ("templates/footer.php"); +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/delete.php b/delete.php index 41a12abc..6340a105 100644 --- a/delete.php +++ b/delete.php @@ -171,5 +171,5 @@ include ("templates/menu.php"); include ("templates/message.php"); include ("templates/footer.php"); -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/edit-admin.php b/edit-admin.php index a05515b8..8671836b 100644 --- a/edit-admin.php +++ b/edit-admin.php @@ -101,11 +101,11 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") $sqlActive = db_get_boolean(False); } - $password_query = ''; - if ($fPassword != '') { # do not change password to empty one - $password_query = ", password='$fPassword'"; - } - $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive' $password_query WHERE username='$username'"); + $password_query = ''; + if ($fPassword != '') { # do not change password to empty one + $password_query = ", password='$fPassword'"; + } + $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive' $password_query WHERE username='$username'"); if ($fSadmin == "on") $fSadmin = 'ALL'; @@ -155,5 +155,5 @@ include ("templates/menu.php"); include ("templates/admin_edit-admin.php"); include ("templates/footer.php"); -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/edit-alias.php b/edit-alias.php index 49013d3e..434592cf 100644 --- a/edit-alias.php +++ b/edit-alias.php @@ -99,15 +99,15 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") $array = array(); } - for ($i = 0; $i < sizeof ($array); $i++) { - if (in_array ("$array[$i]", $CONF['default_aliases'])) continue; - if (empty ($array[$i])) continue; # TODO: should never happen - remove after 2.2 release - if (!check_email ($array[$i])) - { - $error = 1; - $tGoto = $goto; - $tMessage = $PALANG['pEdit_alias_goto_text_error2'] . "$array[$i]"; - } + for ($i = 0; $i < sizeof ($array); $i++) { + if (in_array ("$array[$i]", $CONF['default_aliases'])) continue; + if (empty ($array[$i])) continue; # TODO: should never happen - remove after 2.2 release + if (!check_email ($array[$i])) + { + $error = 1; + $tGoto = $goto; + $tMessage = $PALANG['pEdit_alias_goto_text_error2'] . "$array[$i]"; + } } if ($error != 1) diff --git a/edit-domain.php b/edit-domain.php index 236c1cdc..1186b00c 100644 --- a/edit-domain.php +++ b/edit-domain.php @@ -121,5 +121,5 @@ include ("templates/menu.php"); include ("templates/admin_edit-domain.php"); include ("templates/footer.php"); -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/index.php b/index.php index 1e17e5c3..21939023 100644 --- a/index.php +++ b/index.php @@ -85,3 +85,6 @@ if (!file_exists (realpath ("./setup.php")) || $CONF['configured'] == 'I_know_th

+ diff --git a/list-admin.php b/list-admin.php index 7d63ad7a..8ba307ea 100644 --- a/list-admin.php +++ b/list-admin.php @@ -27,9 +27,9 @@ authentication_require_role('global-admin'); $list_admins = list_admins(); if ((is_array ($list_admins) and sizeof ($list_admins) > 0)) { - for ($i = 0; $i < sizeof ($list_admins); $i++) { - $admin_properties[$i] = get_admin_properties ($list_admins[$i]); - } + for ($i = 0; $i < sizeof ($list_admins); $i++) { + $admin_properties[$i] = get_admin_properties ($list_admins[$i]); + } } include ("templates/header.php"); @@ -37,4 +37,5 @@ include ("templates/menu.php"); include ("templates/admin_list-admin.php"); include ("templates/footer.php"); +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/login.php b/login.php index db6eb277..8f46de07 100644 --- a/login.php +++ b/login.php @@ -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: */ ?> diff --git a/logout.php b/logout.php index d6c3e847..0ec7fea2 100644 --- a/logout.php +++ b/logout.php @@ -28,4 +28,6 @@ session_destroy (); header ("Location: login.php"); exit; + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/main.php b/main.php index ccb46fb5..2da69d2d 100644 --- a/main.php +++ b/main.php @@ -31,4 +31,6 @@ include ("./templates/header.php"); include ("./templates/menu.php"); include ("./templates/main.php"); include ("./templates/footer.php"); + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/password.php b/password.php index e7e5d631..7460d463 100644 --- a/password.php +++ b/password.php @@ -93,4 +93,6 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") include ("./templates/password.php"); include ("./templates/footer.php"); } + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/search.php b/search.php index 3dbf547b..f5cd9d4b 100644 --- a/search.php +++ b/search.php @@ -90,7 +90,7 @@ if ($result['rows'] > 0) { $row['modified']=gmstrftime('%c %Z',$row['modified']); $row['active']=('t'==$row['active']) ? 1 : 0; - } + } $tAlias[] = $row; } } @@ -129,5 +129,5 @@ include ("templates/menu.php"); include ("templates/search.php"); include ("templates/footer.php"); -// vim:ts=4:sw=4:et +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/setup.php b/setup.php index bcf38cd9..33496ed9 100644 --- a/setup.php +++ b/setup.php @@ -209,8 +209,8 @@ if ($config_loaded) { } else { print "
  • Error: Can't connect to database
    \n"; print "Please edit the \$CONF['database_*'] parameters in config.inc.php.\n"; - print "$error_text
  • \n"; - $error ++; + print "$error_text\n"; + $error ++; } } @@ -369,3 +369,6 @@ else + diff --git a/templates/header.php b/templates/header.php index e3f46237..d72fbbdb 100644 --- a/templates/header.php +++ b/templates/header.php @@ -14,9 +14,9 @@ \n"; + print "\n"; } else { - print "\n"; + print "\n"; } ?> Postfix Admin - <?php print $_SERVER['HTTP_HOST']; ?> @@ -26,14 +26,14 @@ if (file_exists (realpath ("../".$CONF['theme_css']))) { \n"; + print "\n"; } else { - print "\n"; + print "\n"; } if (($CONF['show_header_text'] == "YES") and ($CONF['header_text'])) { - print "

    " . $CONF['header_text'] . "

    \n"; + print "

    " . $CONF['header_text'] . "

    \n"; } ?> @@ -57,3 +57,6 @@ if(isset($_SESSION['flash'])) { /* nuke it from orbit. It's the only way to be sure. */ $_SESSION['flash'] = array(); } + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ +?> diff --git a/users/edit-alias.php b/users/edit-alias.php index cb3236d6..34305cb8 100644 --- a/users/edit-alias.php +++ b/users/edit-alias.php @@ -135,4 +135,6 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") include ("../templates/users_edit-alias.php"); include ("../templates/footer.php"); } + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/users/index.php b/users/index.php index 9b815840..a002c928 100644 --- a/users/index.php +++ b/users/index.php @@ -26,4 +26,6 @@ */ header ("Location: login.php"); exit; + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/users/logout.php b/users/logout.php index 924a63b4..6b5e6763 100644 --- a/users/logout.php +++ b/users/logout.php @@ -29,4 +29,6 @@ session_destroy (); header ("Location: login.php"); exit; + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/users/main.php b/users/main.php index ea575365..01b99e9a 100644 --- a/users/main.php +++ b/users/main.php @@ -54,4 +54,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") include ("../templates/users_main.php"); include ("../templates/footer.php"); } + +/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/users/password.php b/users/password.php index 59918e31..febef327 100644 --- a/users/password.php +++ b/users/password.php @@ -32,7 +32,7 @@ require_once('../common.php'); authentication_require_role('user'); $USERID_USERNAME = authentication_get_username(); -$tmp = preg_split ('/@/', $USERID_USERNAME); +$tmp = preg_split ('/@/', $USERID_USERNAME); $USERID_DOMAIN = $tmp[1]; if ($_SERVER['REQUEST_METHOD'] == "POST") @@ -58,7 +58,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") $row = db_array ($result['result']); $checked_password = pacrypt($fPassword_current, $row['password']); - $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$username' AND password='$checked_password'"); + $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$username' AND password='$checked_password'"); if ($result['rows'] != 1) { $error = 1; diff --git a/variables.inc.php b/variables.inc.php index 828e55c2..2ae72ef4 100644 --- a/variables.inc.php +++ b/variables.inc.php @@ -19,8 +19,8 @@ */ if (ereg ("variables.inc.php", $_SERVER['PHP_SELF'])) { - header ("Location: login.php"); - exit; + header ("Location: login.php"); + exit; } $error = ""; @@ -99,4 +99,6 @@ $pEdit_mailbox_username_text = " "; $pPassword_admin_text = " "; $pPassword_password_current_text = " "; $pPassword_password_text = " "; + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?>