1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-11-26 11:23:04 +03:00

create-mailbox.php:

- show password when $CONF['generate_password'] == 'YES', fixes
  https://sourceforge.net/tracker/index.php?func=detail&aid=2015707&group_id=191583&atid=937964
- do not show password if it was _not_ autogenerated and $CONF['show_password'] == 'NO'


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@481 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
Christian Boltz
2008-11-12 22:57:30 +00:00
parent 0411a11b4c
commit 852edf88c6

View File

@@ -112,11 +112,13 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error1']; $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error1'];
} }
$tPassGenerated = 0;
if (empty ($fPassword) or empty ($fPassword2) or ($fPassword != $fPassword2)) if (empty ($fPassword) or empty ($fPassword2) or ($fPassword != $fPassword2))
{ {
if (empty ($fPassword) and empty ($fPassword2) and $CONF['generate_password'] == "YES") if (empty ($fPassword) and empty ($fPassword2) and $CONF['generate_password'] == "YES")
{ {
$fPassword = generate_password (); $fPassword = generate_password ();
$tPassGenerated = 1;
} }
else else
{ {
@@ -278,22 +280,6 @@ TODO: this is the end of /create-mailbox.php code segment
*/ */
$tDomain = $fDomain; $tDomain = $fDomain;
if ($CONF['generate_password'] == "YES")
{
$tMessage .= " / $fPassword)</br />";
}
else
{
if ($CONF['show_password'] == "YES")
{
$tMessage .= " / $fPassword)</br />";
}
else
{
$tMessage .= ")</br />";
}
}
$tQuota = $CONF['maxquota']; $tQuota = $CONF['maxquota'];
if ($fMail == "on") if ($fMail == "on")
@@ -320,11 +306,14 @@ TODO: this is the end of /create-mailbox.php code segment
} }
} }
$tShowpass = "";
if ( $tPassGenerated == 1 || $CONF['show_password'] == "YES") $tShowpass = " / $fPassword";
if (create_mailbox_subfolders($fUsername,$fPassword)) if (create_mailbox_subfolders($fUsername,$fPassword))
{ {
$tMessage = $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername)"; $tMessage .= $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername$tShowpass)";
} else { } else {
$tMessage = $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername)"; $tMessage .= $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername$tShowpass)";
} }
} }