mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
- added/fixed vim: lines to nearly all *.php files (exception: templates/*)
(ts=3 or ts=4 depending on the file content) - several whitespace fixes - (no code changes) git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@566 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
parent
12c4c45416
commit
11c39af699
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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]</span>";
|
||||
}
|
||||
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]</span>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($error != 1)
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -85,3 +85,6 @@ if (!file_exists (realpath ("./setup.php")) || $CONF['configured'] == 'I_know_th
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
24
login.php
24
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: */
|
||||
?>
|
||||
|
@ -28,4 +28,6 @@ session_destroy ();
|
||||
|
||||
header ("Location: login.php");
|
||||
exit;
|
||||
|
||||
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
|
||||
?>
|
||||
|
2
main.php
2
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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -209,8 +209,8 @@ if ($config_loaded) {
|
||||
} else {
|
||||
print "<li><b>Error: Can't connect to database</b><br />\n";
|
||||
print "Please edit the \$CONF['database_*'] parameters in config.inc.php.\n";
|
||||
print "$error_text</li>\n";
|
||||
$error ++;
|
||||
print "$error_text</li>\n";
|
||||
$error ++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -369,3 +369,6 @@ else
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
|
||||
?>
|
||||
|
@ -14,9 +14,9 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<?php
|
||||
if (file_exists (realpath ("../".$CONF['theme_css']))) {
|
||||
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"../".htmlentities($CONF['theme_css'])."\" />\n";
|
||||
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"../".htmlentities($CONF['theme_css'])."\" />\n";
|
||||
} else {
|
||||
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"".htmlentities($CONF['theme_css'])."\" />\n";
|
||||
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"".htmlentities($CONF['theme_css'])."\" />\n";
|
||||
}
|
||||
?>
|
||||
<title>Postfix Admin - <?php print $_SERVER['HTTP_HOST']; ?></title>
|
||||
@ -26,14 +26,14 @@ if (file_exists (realpath ("../".$CONF['theme_css']))) {
|
||||
<?php
|
||||
if (file_exists (realpath ("../".$CONF['theme_logo'])))
|
||||
{
|
||||
print "<img id=\"login_header_logo\" src=\"../".htmlentities($CONF['theme_logo'])."\" />\n";
|
||||
print "<img id=\"login_header_logo\" src=\"../".htmlentities($CONF['theme_logo'])."\" />\n";
|
||||
} else {
|
||||
print "<img id=\"login_header_logo\" src=\"".htmlentities($CONF['theme_logo'])."\" />\n";
|
||||
print "<img id=\"login_header_logo\" src=\"".htmlentities($CONF['theme_logo'])."\" />\n";
|
||||
}
|
||||
|
||||
if (($CONF['show_header_text'] == "YES") and ($CONF['header_text']))
|
||||
{
|
||||
print "<h2>" . $CONF['header_text'] . "</h2>\n";
|
||||
print "<h2>" . $CONF['header_text'] . "</h2>\n";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -26,4 +26,6 @@
|
||||
*/
|
||||
header ("Location: login.php");
|
||||
exit;
|
||||
|
||||
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
|
||||
?>
|
||||
|
@ -29,4 +29,6 @@ session_destroy ();
|
||||
|
||||
header ("Location: login.php");
|
||||
exit;
|
||||
|
||||
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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;
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user