Thread: SF.net SVN: postfixadmin: [117] trunk/edit-mailbox.php
Brought to you by:
christian_boltz,
gingerdog
From: <Gin...@us...> - 2007-10-02 13:37:39
|
Revision: 117 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=117&view=rev Author: GingerDog Date: 2007-10-02 06:37:42 -0700 (Tue, 02 Oct 2007) Log Message: ----------- edit-mailbox.php; try and make it work properly Modified Paths: -------------- trunk/edit-mailbox.php Modified: trunk/edit-mailbox.php =================================================================== --- trunk/edit-mailbox.php 2007-10-02 12:49:56 UTC (rev 116) +++ trunk/edit-mailbox.php 2007-10-02 13:37:42 UTC (rev 117) @@ -38,6 +38,10 @@ authentication_require_role('admin'); $SESSID_USERNAME = authentication_get_username(); +$fUsername = 'x'; +$fDomain = 'y'; +$error = 0; + if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']); $fUsername = strtolower ($fUsername); if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']); @@ -45,33 +49,40 @@ $pEdit_mailbox_name_text = $PALANG['pEdit_mailbox_name_text']; $pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text']; +$result = db_query("SELECT * FROM $table_mailbox WHERE username = '$fUsername' AND domain = '$fDomain'"); +if($result['rows'] != 1) { + die("Invalid username chosen; user does not exist in mailbox table"); +} + +if (!(check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) ) +{ + $error = 1; + $tName = $fName; + $tQuota = $fQuota; + $tActive = $fActive; + $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</font>"; // XXX ergh; why is a closing font tag here? +} + +$user_details = db_array($result['result']); + if ($_SERVER['REQUEST_METHOD'] == "GET") { - if (check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) + if (check_owner($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) { - $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$fUsername' AND domain='$fDomain'"); - if ($result['rows'] == 1) - { - $row = db_array ($result['result']); - $tName = $row['name']; - $tQuota = divide_quota($row['quota']); - $tActive = $row['active']; - if ('pgsql'==$CONF['database_type']) { - $tActive = ('t'==$row['active']) ? 1 : 0; - } + $tName = $user_details['name']; + $tQuota = divide_quota($user_details['quota']); + $tActive = $user_details['active']; + if ('pgsql'==$CONF['database_type']) { + $tActive = ('t'==$user_details['active']) ? 1 : 0; } $result = db_query ("SELECT * FROM $table_domain WHERE domain='$fDomain'"); if ($result['rows'] == 1) { - $row = db_array ($result['result']); - $tMaxquota = $row['maxquota']; + $row = db_array ($result['result']); + $tMaxquota = $row['maxquota']; } } - else - { - $tMessage = $PALANG['pEdit_mailbox_login_error']; - } } if ($_SERVER['REQUEST_METHOD'] == "POST") @@ -82,22 +93,15 @@ if (isset ($_POST['fQuota'])) $fQuota = intval ($_POST['fQuota']); if (isset ($_POST['fActive'])) $fActive = escape_string ($_POST['fActive']); - if (! (check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) ) - { - $error = 1; - $tName = $fName; - $tQuota = $fQuota; - $tActive = $fActive; - $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</font>"; - } - if ($fPassword != $fPassword2) - { - $error = 1; - $tName = $fName; - $tQuota = $fQuota; - $tActive = $fActive; - $pEdit_mailbox_password_text = $PALANG['pEdit_mailbox_password_text_error']; + if($fPassword != $user_details['password']){ + if($fPassword == $fPassword2) { + $fPassword = pacrypt($fPassword); + } + else { + flash_error($PALANG['pEdit_mailbox_password_text_error']); + $error = 1; + } } if ($CONF['quota'] == "YES") @@ -111,7 +115,6 @@ $pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text_error']; } } - if ($error != 1) { if (!empty ($fQuota)) @@ -125,35 +128,20 @@ if ($fActive == "on") { + $sqlActive = db_get_boolean(True); $fActive = 1; } else { + $sqlActive = db_get_boolean(False); $fActive = 0; } - $sqlActive=$fActive; - if ('pgsql'==$CONF['database_type']) { - $sqlActive=($fActive) ? 'true':'false'; - } - if (empty ($fPassword) and empty ($fPassword2)) - { - $result = db_query ("UPDATE $table_mailbox SET name='$fName',quota=$quota,modified=NOW(),active=$sqlActive WHERE username='$fUsername' AND domain='$fDomain'"); - if ($result['rows'] == 1) $result = db_query ("UPDATE $table_alias SET modified=NOW(),active='$sqlActive' WHERE address='$fUsername' AND domain='$fDomain'"); - } - else - { - $password = pacrypt ($fPassword); - $result = db_query ("UPDATE $table_mailbox SET password='$password',name='$fName',quota=$quota,modified=NOW(),active=$sqlActive WHERE username='$fUsername' AND domain='$fDomain'"); - if ($result['rows'] == 1) $result = db_query ("UPDATE $table_alias SET modified=NOW(),active='$sqlActive' WHERE address='$fUsername' AND domain='$fDomain'"); - } - - if ($result['rows'] != 1) - { + $result = db_query ("UPDATE $table_mailbox SET name='$fName',password='$fPassword',quota=$quota,modified=NOW(),active=$sqlActive WHERE username='$fUsername' AND domain='$fDomain'"); + if ($result['rows'] != 1) { $tMessage = $PALANG['pEdit_mailbox_result_error']; } - else - { + else { db_log ($SESSID_USERNAME, $fDomain, 'edit_mailbox', $fUsername); if (authentication_has_role('global-admin')) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-02 23:17:11
|
Revision: 119 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=119&view=rev Author: christian_boltz Date: 2007-10-02 16:17:07 -0700 (Tue, 02 Oct 2007) Log Message: ----------- - Fix HTML (<span> is opened inside the error message, close it again) Modified Paths: -------------- trunk/edit-mailbox.php Modified: trunk/edit-mailbox.php =================================================================== --- trunk/edit-mailbox.php 2007-10-02 13:41:23 UTC (rev 118) +++ trunk/edit-mailbox.php 2007-10-02 23:17:07 UTC (rev 119) @@ -60,7 +60,7 @@ $tName = $fName; $tQuota = $fQuota; $tActive = $fActive; - $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</font>"; // XXX ergh; why is a closing font tag here? + $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</span>"; } $user_details = db_array($result['result']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-11-04 00:53:11
|
Revision: 185 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=185&view=rev Author: christian_boltz Date: 2007-11-03 17:53:13 -0700 (Sat, 03 Nov 2007) Log Message: ----------- - fix: password was always changed when editing a mailbox. Thanks to Ryan Wagoner for pointing this out. - first usage of db_update function ;-) Modified Paths: -------------- trunk/edit-mailbox.php Modified: trunk/edit-mailbox.php =================================================================== --- trunk/edit-mailbox.php 2007-11-04 00:50:09 UTC (rev 184) +++ trunk/edit-mailbox.php 2007-11-04 00:53:13 UTC (rev 185) @@ -96,7 +96,9 @@ if($fPassword != $user_details['password']){ if($fPassword == $fPassword2) { - $fPassword = pacrypt($fPassword); + if ($fPassword != "") { + $formvars['password'] = pacrypt($fPassword); + } } else { flash_error($PALANG['pEdit_mailbox_password_text_error']); @@ -137,8 +139,13 @@ $fActive = 0; } - $result = db_query ("UPDATE $table_mailbox SET name='$fName',password='$fPassword',quota=$quota,modified=NOW(),active=$sqlActive WHERE username='$fUsername' AND domain='$fDomain'"); - if ($result['rows'] != 1) { + $formvars['name'] = $fName; + $formvars['quota'] =$quota; + $formvars['active']=$sqlActive; + + $result = db_update ('mailbox', "username='$fUsername' AND domain='$fDomain'", $formvars, array('modified')); + + if ($result != 1) { $tMessage = $PALANG['pEdit_mailbox_result_error']; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2007-12-17 07:03:49
|
Revision: 272 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=272&view=rev Author: GingerDog Date: 2007-12-16 23:03:54 -0800 (Sun, 16 Dec 2007) Log Message: ----------- edit-mailbox.php; indentation fix Modified Paths: -------------- trunk/edit-mailbox.php Modified: trunk/edit-mailbox.php =================================================================== --- trunk/edit-mailbox.php 2007-12-17 07:02:45 UTC (rev 271) +++ trunk/edit-mailbox.php 2007-12-17 07:03:54 UTC (rev 272) @@ -49,112 +49,110 @@ $pEdit_mailbox_name_text = $PALANG['pEdit_mailbox_name_text']; $pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text']; -$result = db_query("SELECT * FROM $table_mailbox WHERE username = '$fUsername' AND domain = '$fDomain'"); -if($result['rows'] != 1) { - die("Invalid username chosen; user does not exist in mailbox table"); -} if (!(check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) ) { - $error = 1; - $tName = $fName; - $tQuota = $fQuota; - $tActive = $fActive; - $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</span>"; + $error = 1; + $tName = $fName; + $tQuota = $fQuota; + $tActive = $fActive; + $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</span>"; } +$result = db_query("SELECT * FROM $table_mailbox WHERE username = '$fUsername' AND domain = '$fDomain'"); +if($result['rows'] != 1) { + die("Invalid username chosen; user does not exist in mailbox table"); +} $user_details = db_array($result['result']); if ($_SERVER['REQUEST_METHOD'] == "GET") { - if (check_owner($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) - { - $tName = $user_details['name']; - $tQuota = divide_quota($user_details['quota']); - $tActive = $user_details['active']; - if ('pgsql'==$CONF['database_type']) { - $tActive = ('t'==$user_details['active']) ? 1 : 0; - } + if (check_owner($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) + { + $tName = $user_details['name']; + $tQuota = divide_quota($user_details['quota']); + $tActive = $user_details['active']; + if ('pgsql'==$CONF['database_type']) { + $tActive = ('t'==$user_details['active']) ? 1 : 0; + } - $result = db_query ("SELECT * FROM $table_domain WHERE domain='$fDomain'"); - if ($result['rows'] == 1) - { - $row = db_array ($result['result']); - $tMaxquota = $row['maxquota']; - } - } + $result = db_query ("SELECT * FROM $table_domain WHERE domain='$fDomain'"); + if ($result['rows'] == 1) + { + $row = db_array ($result['result']); + $tMaxquota = $row['maxquota']; + } + } } if ($_SERVER['REQUEST_METHOD'] == "POST") { - if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); - if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); - if (isset ($_POST['fName'])) $fName = escape_string ($_POST['fName']); - if (isset ($_POST['fQuota'])) $fQuota = intval ($_POST['fQuota']); - if (isset ($_POST['fActive'])) $fActive = escape_string ($_POST['fActive']); + if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); + if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); + if (isset ($_POST['fName'])) $fName = escape_string ($_POST['fName']); + if (isset ($_POST['fQuota'])) $fQuota = intval ($_POST['fQuota']); + if (isset ($_POST['fActive'])) $fActive = escape_string ($_POST['fActive']); + if($fPassword != $user_details['password']){ + if($fPassword == $fPassword2) { + if ($fPassword != "") { + $formvars['password'] = pacrypt($fPassword); + } + } + else { + flash_error($PALANG['pEdit_mailbox_password_text_error']); + $error = 1; + } + } - if($fPassword != $user_details['password']){ - if($fPassword == $fPassword2) { - if ($fPassword != "") { - $formvars['password'] = pacrypt($fPassword); - } - } - else { - flash_error($PALANG['pEdit_mailbox_password_text_error']); - $error = 1; - } - } + if ($CONF['quota'] == "YES") + { + if (!check_quota ($fQuota, $fDomain)) + { + $error = 1; + $tName = $fName; + $tQuota = $fQuota; + $tActive = $fActive; + $pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text_error']; + } + } + if ($error != 1) + { + if (!empty ($fQuota)) + { + $quota = multiply_quota ($fQuota); + } + else + { + $quota = 0; + } - if ($CONF['quota'] == "YES") - { - if (!check_quota ($fQuota, $fDomain)) - { - $error = 1; - $tName = $fName; - $tQuota = $fQuota; - $tActive = $fActive; - $pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text_error']; - } - } - if ($error != 1) - { - if (!empty ($fQuota)) - { - $quota = multiply_quota ($fQuota); - } - else - { - $quota = 0; - } + if ($fActive == "on") + { + $sqlActive = db_get_boolean(True); + $fActive = 1; + } + else + { + $sqlActive = db_get_boolean(False); + $fActive = 0; + } - if ($fActive == "on") - { - $sqlActive = db_get_boolean(True); - $fActive = 1; - } - else - { - $sqlActive = db_get_boolean(False); - $fActive = 0; - } + $formvars['name'] = $fName; + $formvars['quota'] =$quota; + $formvars['active']=$sqlActive; - $formvars['name'] = $fName; - $formvars['quota'] =$quota; - $formvars['active']=$sqlActive; + $result = db_update ('mailbox', "username='$fUsername' AND domain='$fDomain'", $formvars, array('modified')); + if ($result != 1) { + $tMessage = $PALANG['pEdit_mailbox_result_error']; + } + else { + db_log ($SESSID_USERNAME, $fDomain, 'edit_mailbox', $fUsername); - $result = db_update ('mailbox', "username='$fUsername' AND domain='$fDomain'", $formvars, array('modified')); - - if ($result != 1) { - $tMessage = $PALANG['pEdit_mailbox_result_error']; - } - else { - db_log ($SESSID_USERNAME, $fDomain, 'edit_mailbox', $fUsername); - - header ("Location: list-virtual.php?domain=$fDomain"); - exit; - } - } +// header ("Location: list-virtual.php?domain=$fDomain"); + exit; + } + } } include ("templates/header.php"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2008-01-03 21:51:04
|
Revision: 285 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=285&view=rev Author: GingerDog Date: 2008-01-03 13:51:08 -0800 (Thu, 03 Jan 2008) Log Message: ----------- edit-mailbox.php: random edits - I thought password length check was already in... </confusion> Modified Paths: -------------- trunk/edit-mailbox.php Modified: trunk/edit-mailbox.php =================================================================== --- trunk/edit-mailbox.php 2008-01-03 21:50:39 UTC (rev 284) +++ trunk/edit-mailbox.php 2008-01-03 21:51:08 UTC (rev 285) @@ -52,107 +52,112 @@ if (!(check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) ) { - $error = 1; - $tName = $fName; - $tQuota = $fQuota; - $tActive = $fActive; - $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</span>"; + $error = 1; + $tName = $fName; + $tQuota = $fQuota; + $tActive = $fActive; + $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</span>"; } $result = db_query("SELECT * FROM $table_mailbox WHERE username = '$fUsername' AND domain = '$fDomain'"); if($result['rows'] != 1) { - die("Invalid username chosen; user does not exist in mailbox table"); + die("Invalid username chosen; user does not exist in mailbox table"); } $user_details = db_array($result['result']); if ($_SERVER['REQUEST_METHOD'] == "GET") { - if (check_owner($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) - { - $tName = $user_details['name']; - $tQuota = divide_quota($user_details['quota']); - $tActive = $user_details['active']; - if ('pgsql'==$CONF['database_type']) { - $tActive = ('t'==$user_details['active']) ? 1 : 0; - } + if (check_owner($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) + { + $tName = $user_details['name']; + $tQuota = divide_quota($user_details['quota']); + $tActive = $user_details['active']; + if ('pgsql'==$CONF['database_type']) { + $tActive = ('t'==$user_details['active']) ? 1 : 0; + } - $result = db_query ("SELECT * FROM $table_domain WHERE domain='$fDomain'"); - if ($result['rows'] == 1) - { - $row = db_array ($result['result']); - $tMaxquota = $row['maxquota']; - } - } + $result = db_query ("SELECT * FROM $table_domain WHERE domain='$fDomain'"); + if ($result['rows'] == 1) + { + $row = db_array ($result['result']); + $tMaxquota = $row['maxquota']; + } + } } if ($_SERVER['REQUEST_METHOD'] == "POST") { - if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); - if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); - if (isset ($_POST['fName'])) $fName = escape_string ($_POST['fName']); - if (isset ($_POST['fQuota'])) $fQuota = intval ($_POST['fQuota']); - if (isset ($_POST['fActive'])) $fActive = escape_string ($_POST['fActive']); + if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); + if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); + if (isset ($_POST['fName'])) $fName = escape_string ($_POST['fName']); + if (isset ($_POST['fQuota'])) $fQuota = intval ($_POST['fQuota']); + if (isset ($_POST['fActive'])) $fActive = escape_string ($_POST['fActive']); - if($fPassword != $user_details['password']){ - if($fPassword == $fPassword2) { - if ($fPassword != "") { - $formvars['password'] = pacrypt($fPassword); - } - } - else { - flash_error($PALANG['pEdit_mailbox_password_text_error']); - $error = 1; - } - } + if($fPassword != $user_details['password']){ + $min_length = $CONF['min_password_length']; - if ($CONF['quota'] == "YES") - { - if (!check_quota ($fQuota, $fDomain)) - { - $error = 1; - $tName = $fName; - $tQuota = $fQuota; - $tActive = $fActive; - $pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text_error']; - } - } - if ($error != 1) - { - if (!empty ($fQuota)) - { - $quota = multiply_quota ($fQuota); - } - else - { - $quota = 0; - } + if($min_length > 0 && strlen($fPassword) < $min_length) { + flash_error($PALANG['pPasswordTooShort']); + $error = 1; + } + if($fPassword == $fPassword2) { + if ($fPassword != "") { + $formvars['password'] = pacrypt($fPassword); + } + } + else { + flash_error($PALANG['pEdit_mailbox_password_text_error']); + $error = 1; + } + } + if ($CONF['quota'] == "YES") + { + if (!check_quota ($fQuota, $fDomain)) + { + $error = 1; + $tName = $fName; + $tQuota = $fQuota; + $tActive = $fActive; + $pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text_error']; + } + } + if ($error != 1) + { + if (!empty ($fQuota)) + { + $quota = multiply_quota ($fQuota); + } + else + { + $quota = 0; + } - if ($fActive == "on") - { - $sqlActive = db_get_boolean(True); - $fActive = 1; - } - else - { - $sqlActive = db_get_boolean(False); - $fActive = 0; - } + if ($fActive == "on") + { + $sqlActive = db_get_boolean(True); + $fActive = 1; + } + else + { + $sqlActive = db_get_boolean(False); + $fActive = 0; + } - $formvars['name'] = $fName; - $formvars['quota'] =$quota; - $formvars['active']=$sqlActive; + $formvars['name'] = $fName; + $formvars['quota'] =$quota; + $formvars['active']=$sqlActive; - $result = db_update ('mailbox', "username='$fUsername' AND domain='$fDomain'", $formvars, array('modified')); - if ($result != 1) { - $tMessage = $PALANG['pEdit_mailbox_result_error']; - } - else { - db_log ($SESSID_USERNAME, $fDomain, 'edit_mailbox', $fUsername); + $result = db_update ('mailbox', "username='$fUsername' AND domain='$fDomain'", $formvars, array('modified')); + if ($result != 1) { + $tMessage = $PALANG['pEdit_mailbox_result_error']; + } + else { + db_log ($SESSID_USERNAME, $fDomain, 'edit_mailbox', $fUsername); -// header ("Location: list-virtual.php?domain=$fDomain"); - exit; - } - } + header ("Location: list-virtual.php?domain=$fDomain"); + exit(0); + } + } } include ("templates/header.php"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2008-01-06 17:12:07
|
Revision: 287 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=287&view=rev Author: GingerDog Date: 2008-01-06 09:12:10 -0800 (Sun, 06 Jan 2008) Log Message: ----------- edit-mailbox.php: Closes #1865124 - too short error was not telling the user the minimum size Modified Paths: -------------- trunk/edit-mailbox.php Modified: trunk/edit-mailbox.php =================================================================== --- trunk/edit-mailbox.php 2008-01-03 21:58:02 UTC (rev 286) +++ trunk/edit-mailbox.php 2008-01-06 17:12:10 UTC (rev 287) @@ -97,7 +97,7 @@ $min_length = $CONF['min_password_length']; if($min_length > 0 && strlen($fPassword) < $min_length) { - flash_error($PALANG['pPasswordTooShort']); + flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length'])); $error = 1; } if($fPassword == $fPassword2) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-09 21:49:43
|
Revision: 291 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=291&view=rev Author: christian_boltz Date: 2008-01-09 13:47:28 -0800 (Wed, 09 Jan 2008) Log Message: ----------- edit-mailbox.php - fix: put the values the user entered in the form again if an error was detected (instead of showing the form completely empty) - fix: do not check for password length when password is not going to be changed (empty password field). Thanks to Danilo Montagna (dmontagna) for pointing this out! https://sourceforge.net/forum/message.php?msg_id=4709926 Modified Paths: -------------- trunk/edit-mailbox.php Modified: trunk/edit-mailbox.php =================================================================== --- trunk/edit-mailbox.php 2008-01-06 20:20:42 UTC (rev 290) +++ trunk/edit-mailbox.php 2008-01-09 21:47:28 UTC (rev 291) @@ -96,12 +96,12 @@ if($fPassword != $user_details['password']){ $min_length = $CONF['min_password_length']; - if($min_length > 0 && strlen($fPassword) < $min_length) { - flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length'])); - $error = 1; - } if($fPassword == $fPassword2) { if ($fPassword != "") { + if($min_length > 0 && strlen($fPassword) < $min_length) { + flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length'])); + $error = 1; + } $formvars['password'] = pacrypt($fPassword); } } @@ -157,6 +157,13 @@ header ("Location: list-virtual.php?domain=$fDomain"); exit(0); } + } + else + { + # error detected. Put the values the user entered in the form again. + $tName = $fName; + $tQuota = $fQuota; + $tActive = $fActive; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2008-02-28 11:58:52
|
Revision: 304 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=304&view=rev Author: GingerDog Date: 2008-02-28 03:58:52 -0800 (Thu, 28 Feb 2008) Log Message: ----------- edit-mailbox.php- if the user clicks on cancel, forward them to somewhere else, and not save stuff - see https://sourceforge.net/tracker/index.php?func=detail&aid=1888847&group_id=191583&atid=937964 Modified Paths: -------------- trunk/edit-mailbox.php Modified: trunk/edit-mailbox.php =================================================================== --- trunk/edit-mailbox.php 2008-02-26 20:31:25 UTC (rev 303) +++ trunk/edit-mailbox.php 2008-02-28 11:58:52 UTC (rev 304) @@ -85,6 +85,11 @@ } } +if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['cancel'])) { + header("Location: list-virtual.php?domain=$fDomain"); + exit(0); +} + if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2008-06-17 21:19:35
|
Revision: 386 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=386&view=rev Author: GingerDog Date: 2008-06-17 14:19:44 -0700 (Tue, 17 Jun 2008) Log Message: ----------- edit-mailbox.php: merge of patch from https://sourceforge.net/tracker/index.php?func=detail&aid=1996052&group_id=191583&atid=937966 ; thanks Sylvain BEUCLER - beuc Modified Paths: -------------- trunk/edit-mailbox.php Modified: trunk/edit-mailbox.php =================================================================== --- trunk/edit-mailbox.php 2008-06-17 21:16:57 UTC (rev 385) +++ trunk/edit-mailbox.php 2008-06-17 21:19:44 UTC (rev 386) @@ -153,6 +153,7 @@ $formvars['active']=$sqlActive; $result = db_update ('mailbox', "username='$fUsername' AND domain='$fDomain'", $formvars, array('modified')); + $maildir = $user_details['maildir']; if ($result != 1 || !mailbox_postedit($fUsername,$fDomain,$maildir, $quota)) { $tMessage = $PALANG['pEdit_mailbox_result_error']; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |