Thread: SF.net SVN: postfixadmin:[410] trunk/create-mailbox.php
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2008-07-22 21:57:42
|
Revision: 410 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=410&view=rev Author: christian_boltz Date: 2008-07-22 21:57:51 +0000 (Tue, 22 Jul 2008) Log Message: ----------- create-mailbox.php: - removed duplicate @version and @license comment Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2008-07-22 20:03:53 UTC (rev 409) +++ trunk/create-mailbox.php 2008-07-22 21:57:51 UTC (rev 410) @@ -9,9 +9,6 @@ * Further details on the project are available at : * http://www.postfixadmin.com or http://postfixadmin.sf.net * - * @version $Id$ - * @license GNU GPL v2 or later. - * * File: create-mailbox.php * Responsible for allowing for the creation of mail boxes * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2008-10-11 19:58:39
|
Revision: 465 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=465&view=rev Author: GingerDog Date: 2008-10-11 19:58:34 +0000 (Sat, 11 Oct 2008) Log Message: ----------- create-mailbox.php: force username to be lowercase - this helps some IMAP clients apprently Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2008-10-11 07:43:11 UTC (rev 464) +++ trunk/create-mailbox.php 2008-10-11 19:58:34 UTC (rev 465) @@ -259,6 +259,9 @@ To be compared / merged. */ + // apparently uppercase usernames really confuse some IMAP clients. + $fUsername = strtolower($fUsername); + $result = db_query ("INSERT INTO $table_mailbox (username,password,name,maildir,quota,domain,created,modified,active) VALUES ('$fUsername','$password','$fName','$maildir','$quota','$fDomain',NOW(),NOW(),'$sqlActive')"); if ($result['rows'] != 1 || !mailbox_postcreation($fUsername,$fDomain,$maildir, $quota)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 20:32:48
|
Revision: 478 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=478&view=rev Author: christian_boltz Date: 2008-11-12 20:32:45 +0000 (Wed, 12 Nov 2008) Log Message: ----------- create-mailbox.php - added two ) in success messages Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2008-11-12 20:15:04 UTC (rev 477) +++ trunk/create-mailbox.php 2008-11-12 20:32:45 UTC (rev 478) @@ -322,9 +322,9 @@ if (create_mailbox_subfolders($fUsername,$fPassword)) { - $tMessage = $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername"; + $tMessage = $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername)"; } else { - $tMessage = $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername"; + $tMessage = $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername)"; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 22:57:35
|
Revision: 481 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=481&view=rev Author: christian_boltz Date: 2008-11-12 22:57:30 +0000 (Wed, 12 Nov 2008) Log Message: ----------- 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' Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2008-11-12 22:07:50 UTC (rev 480) +++ trunk/create-mailbox.php 2008-11-12 22:57:30 UTC (rev 481) @@ -112,11 +112,13 @@ $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error1']; } + $tPassGenerated = 0; if (empty ($fPassword) or empty ($fPassword2) or ($fPassword != $fPassword2)) { if (empty ($fPassword) and empty ($fPassword2) and $CONF['generate_password'] == "YES") { $fPassword = generate_password (); + $tPassGenerated = 1; } else { @@ -278,22 +280,6 @@ */ $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']; if ($fMail == "on") @@ -320,11 +306,14 @@ } } + $tShowpass = ""; + if ( $tPassGenerated == 1 || $CONF['show_password'] == "YES") $tShowpass = " / $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 { - $tMessage = $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername)"; + $tMessage .= $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername$tShowpass)"; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2008-12-12 19:42:17
|
Revision: 497 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=497&view=rev Author: GingerDog Date: 2008-12-12 19:42:12 +0000 (Fri, 12 Dec 2008) Log Message: ----------- specify the local_part when adding new mailboxes; part 3 of operation shutup-libertytek-charles :) Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2008-12-12 19:40:39 UTC (rev 496) +++ trunk/create-mailbox.php 2008-12-12 19:42:12 UTC (rev 497) @@ -263,8 +263,11 @@ // apparently uppercase usernames really confuse some IMAP clients. $fUsername = strtolower($fUsername); - - $result = db_query ("INSERT INTO $table_mailbox (username,password,name,maildir,quota,domain,created,modified,active) VALUES ('$fUsername','$password','$fName','$maildir','$quota','$fDomain',NOW(),NOW(),'$sqlActive')"); + $local_part = ''; + if(preg_match('/^(.*)@/', $fUsername, $matches)) { + $local_part = $matches[1]; + } + $result = db_query ("INSERT INTO $table_mailbox (username,password,name,maildir,local_part,quota,domain,created,modified,active) VALUES ('$fUsername','$password','$fName','$maildir','$local_part','$quota','$fDomain',NOW(),NOW(),'$sqlActive')"); if ($result['rows'] != 1 || !mailbox_postcreation($fUsername,$fDomain,$maildir, $quota)) { $tDomain = $fDomain; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-04-06 19:54:28
|
Revision: 612 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=612&view=rev Author: GingerDog Date: 2009-04-06 19:54:11 +0000 (Mon, 06 Apr 2009) Log Message: ----------- create-mailbox.php: Remove commented out & dead code Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2009-04-02 20:49:32 UTC (rev 611) +++ trunk/create-mailbox.php 2009-04-06 19:54:11 UTC (rev 612) @@ -40,10 +40,10 @@ authentication_require_role('admin'); $SESSID_USERNAME = authentication_get_username(); if(authentication_has_role('global-admin')) { - $list_domains = list_domains (); + $list_domains = list_domains (); } else { - $list_domains = list_domains_for_admin($SESSID_USERNAME); + $list_domains = list_domains_for_admin($SESSID_USERNAME); } @@ -53,274 +53,216 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") { - $fDomain = $list_domains[0]; - if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']); + $fDomain = $list_domains[0]; + if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']); - if(!in_array($fDomain, $list_domains)) { - die("Invalid domain name selected, or you tried to select a domain you are not an admin for"); - } - $tDomain = $fDomain; - $result = db_query ("SELECT * FROM $table_domain WHERE domain='$fDomain'"); - if ($result['rows'] == 1) - { - $row = db_array ($result['result']); - $tQuota = $row['maxquota']; - } + if(!in_array($fDomain, $list_domains)) { + die("Invalid domain name selected, or you tried to select a domain you are not an admin for"); + } + $tDomain = $fDomain; + $result = db_query ("SELECT * FROM $table_domain WHERE domain='$fDomain'"); + if ($result['rows'] == 1) + { + $row = db_array ($result['result']); + $tQuota = $row['maxquota']; + } } if ($_SERVER['REQUEST_METHOD'] == "POST") { - if (isset ($_POST['fUsername']) && isset ($_POST['fDomain'])) $fUsername = escape_string ($_POST['fUsername']) . "@" . escape_string ($_POST['fDomain']); - $fUsername = strtolower ($fUsername); - if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); - if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); - isset ($_POST['fName']) ? $fName = escape_string ($_POST['fName']) : $fName = ""; - if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']); - isset ($_POST['fQuota']) ? $fQuota = intval($_POST['fQuota']) : $fQuota = 0; - isset ($_POST['fActive']) ? $fActive = escape_string ($_POST['fActive']) : $fActive = "1"; - if (isset ($_POST['fMail'])) $fMail = escape_string ($_POST['fMail']); + if (isset ($_POST['fUsername']) && isset ($_POST['fDomain'])) $fUsername = escape_string ($_POST['fUsername']) . "@" . escape_string ($_POST['fDomain']); + $fUsername = strtolower ($fUsername); + if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); + if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); + isset ($_POST['fName']) ? $fName = escape_string ($_POST['fName']) : $fName = ""; + if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']); + isset ($_POST['fQuota']) ? $fQuota = intval($_POST['fQuota']) : $fQuota = 0; + isset ($_POST['fActive']) ? $fActive = escape_string ($_POST['fActive']) : $fActive = "1"; + if (isset ($_POST['fMail'])) $fMail = escape_string ($_POST['fMail']); - if ( (!check_owner ($SESSID_USERNAME, $fDomain)) && (!authentication_has_role('global-admin')) ) - { - $error = 1; - $tUsername = escape_string ($_POST['fUsername']); - $tName = $fName; - $tQuota = $fQuota; - $tDomain = $fDomain; - $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error1']; - } + if ( (!check_owner ($SESSID_USERNAME, $fDomain)) && (!authentication_has_role('global-admin')) ) + { + $error = 1; + $tUsername = escape_string ($_POST['fUsername']); + $tName = $fName; + $tQuota = $fQuota; + $tDomain = $fDomain; + $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error1']; + } - if (!check_mailbox ($fDomain)) - { - $error = 1; - $tUsername = escape_string ($_POST['fUsername']); - $tName = $fName; - $tQuota = $fQuota; - $tDomain = $fDomain; - $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error3']; - } + if (!check_mailbox ($fDomain)) + { + $error = 1; + $tUsername = escape_string ($_POST['fUsername']); + $tName = $fName; + $tQuota = $fQuota; + $tDomain = $fDomain; + $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error3']; + } - if (empty ($fUsername) or !check_email ($fUsername)) - { - $error = 1; - $tUsername = escape_string ($_POST['fUsername']); - $tName = $fName; - $tQuota = $fQuota; - $tDomain = $fDomain; - $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error1']; - } + if (empty ($fUsername) or !check_email ($fUsername)) + { + $error = 1; + $tUsername = escape_string ($_POST['fUsername']); + $tName = $fName; + $tQuota = $fQuota; + $tDomain = $fDomain; + $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error1']; + } - $tPassGenerated = 0; - if (empty ($fPassword) or empty ($fPassword2) or ($fPassword != $fPassword2)) - { - if (empty ($fPassword) and empty ($fPassword2) and $CONF['generate_password'] == "YES") - { - $fPassword = generate_password (); - $tPassGenerated = 1; - } - else - { - $error = 1; - $tUsername = escape_string ($_POST['fUsername']); - $tName = $fName; - $tQuota = $fQuota; - $tDomain = $fDomain; - $pCreate_mailbox_password_text = $PALANG['pCreate_mailbox_password_text_error']; - } - } + $tPassGenerated = 0; + if (empty ($fPassword) or empty ($fPassword2) or ($fPassword != $fPassword2)) + { + if (empty ($fPassword) and empty ($fPassword2) and $CONF['generate_password'] == "YES") + { + $fPassword = generate_password (); + $tPassGenerated = 1; + } + else + { + $error = 1; + $tUsername = escape_string ($_POST['fUsername']); + $tName = $fName; + $tQuota = $fQuota; + $tDomain = $fDomain; + $pCreate_mailbox_password_text = $PALANG['pCreate_mailbox_password_text_error']; + } + } - if ($CONF['quota'] == "YES") - { - if (!check_quota ($fQuota, $fDomain)) - { - $error = 1; - $tUsername = escape_string ($_POST['fUsername']); - $tName = $fName; - $tQuota = $fQuota; - $tDomain = $fDomain; - $pCreate_mailbox_quota_text = $PALANG['pCreate_mailbox_quota_text_error']; - } - } + if ($CONF['quota'] == "YES") + { + if (!check_quota ($fQuota, $fDomain)) + { + $error = 1; + $tUsername = escape_string ($_POST['fUsername']); + $tName = $fName; + $tQuota = $fQuota; + $tDomain = $fDomain; + $pCreate_mailbox_quota_text = $PALANG['pCreate_mailbox_quota_text_error']; + } + } - $result = db_query ("SELECT * FROM $table_alias WHERE address='$fUsername'"); - if ($result['rows'] == 1) - { - $error = 1; - $tUsername = escape_string ($_POST['fUsername']); - $tName = $fName; - $tQuota = $fQuota; - $tDomain = $fDomain; - $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error2']; - } + $result = db_query ("SELECT * FROM $table_alias WHERE address='$fUsername'"); + if ($result['rows'] == 1) + { + $error = 1; + $tUsername = escape_string ($_POST['fUsername']); + $tName = $fName; + $tQuota = $fQuota; + $tDomain = $fDomain; + $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error2']; + } - if ($error != 1) - { - $password = pacrypt ($fPassword); + if ($error != 1) + { + $password = pacrypt ($fPassword); - if ($CONF['domain_path'] == "YES") - { - if ($CONF['domain_in_mailbox'] == "YES") - { - $maildir = $fDomain . "/" . $fUsername . "/"; - } - else - { - $maildir = $fDomain . "/" . escape_string (strtolower($_POST['fUsername'])) . "/"; - } - } - else - { - $maildir = $fUsername . "/"; - } - - if (!empty ($fQuota)) - { - $quota = multiply_quota ($fQuota); - } - else - { - $quota = 0; - } - - if ($fActive == "on") - { - $sqlActive = db_get_boolean(True); - } - else - { - $sqlActive = db_get_boolean(False); - } - if ('pgsql'==$CONF['database_type']) - { - db_query('BEGIN'); - } - - $result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified,active) VALUES ('$fUsername','$fUsername','$fDomain',NOW(),NOW(),'$sqlActive')"); - if ($result['rows'] != 1) - { - $tDomain = $fDomain; - $tMessage = $PALANG['pAlias_result_error'] . "<br />($fUsername -> $fUsername)</br />"; - } - -/* -# TODO: The following code segment is from admin/create-mailbox.php. To be compared/merged with the code from /create-mailbox.php. - Lines starting with /* were inserted to keep this section in commented mode. - - - if ($result['rows'] != 1) - { - $tDomain = $fDomain; - $tMessage .= $PALANG['pCreate_mailbox_result_error'] . "<br />($fUsername)<br />"; - } - else - { - - $error=TRUE; // Being pessimistic - if (mailbox_postcreation($fUsername,$fDomain,$maildir)) - { - if ('pgsql'==$CONF['database_type']) + if ($CONF['domain_path'] == "YES") + { + if ($CONF['domain_in_mailbox'] == "YES") { - $result=db_query("COMMIT"); - -/* should really not be possible: */ -/* - if (!$result) die('COMMIT-query failed.'); + $maildir = $fDomain . "/" . $fUsername . "/"; } - $error=FALSE; - } else { - $tMessage .= $PALANG['pCreate_mailbox_result_error'] . "<br />($fUsername)<br />"; - if ('pgsql'==$CONF['database_type']) + else { - $result=db_query("ROLLBACK"); - -/* should really not be possible: */ -/* - if (!$result) die('ROLLBACK-query failed.'); - } else { - /* - When we cannot count on transactions, we need to move forward, despite - the problems. - */ -/* - $error=FALSE; + $maildir = $fDomain . "/" . escape_string (strtolower($_POST['fUsername'])) . "/"; } - } + } + else + { + $maildir = $fUsername . "/"; + } + if (!empty ($fQuota)) + { + $quota = multiply_quota ($fQuota); + } + else + { + $quota = 0; + } - if (!$error) - { - db_log ($CONF['admin_email'], $fDomain, 'create_mailbox', $fUsername); + if ($fActive == "on") + { + $sqlActive = db_get_boolean(True); + } + else + { + $sqlActive = db_get_boolean(False); + } + if ('pgsql'==$CONF['database_type']) + { + db_query('BEGIN'); + } - */ + $result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified,active) VALUES ('$fUsername','$fUsername','$fDomain',NOW(),NOW(),'$sqlActive')"); + if ($result['rows'] != 1) + { + $tDomain = $fDomain; + $tMessage = $PALANG['pAlias_result_error'] . "<br />($fUsername -> $fUsername)</br />"; + } -/* -TODO: this is the start of /create-mailbox code segment that was originally used in /create-mailbox.php instead - of the above from admin/create-mailbox.php. - To be compared / merged. - */ - // apparently uppercase usernames really confuse some IMAP clients. - $fUsername = strtolower($fUsername); - $local_part = ''; - if(preg_match('/^(.*)@/', $fUsername, $matches)) { - $local_part = $matches[1]; - } - $result = db_query ("INSERT INTO $table_mailbox (username,password,name,maildir,local_part,quota,domain,created,modified,active) VALUES ('$fUsername','$password','$fName','$maildir','$local_part','$quota','$fDomain',NOW(),NOW(),'$sqlActive')"); - if ($result['rows'] != 1 || !mailbox_postcreation($fUsername,$fDomain,$maildir, $quota)) - { - $tDomain = $fDomain; - $tMessage .= $PALANG['pCreate_mailbox_result_error'] . "<br />($fUsername)<br />"; - db_query('ROLLBACK'); - } - else - { - db_query('COMMIT'); - db_log ($SESSID_USERNAME, $fDomain, 'create_mailbox', "$fUsername"); -/* -TODO: this is the end of /create-mailbox.php code segment - */ - $tDomain = $fDomain; + // apparently uppercase usernames really confuse some IMAP clients. + $fUsername = strtolower($fUsername); + $local_part = ''; + if(preg_match('/^(.*)@/', $fUsername, $matches)) { + $local_part = $matches[1]; + } - $tQuota = $CONF['maxquota']; + $result = db_query ("INSERT INTO $table_mailbox (username,password,name,maildir,local_part,quota,domain,created,modified,active) VALUES ('$fUsername','$password','$fName','$maildir','$local_part','$quota','$fDomain',NOW(),NOW(),'$sqlActive')"); + if ($result['rows'] != 1 || !mailbox_postcreation($fUsername,$fDomain,$maildir, $quota)) + { + $tDomain = $fDomain; + $tMessage .= $PALANG['pCreate_mailbox_result_error'] . "<br />($fUsername)<br />"; + db_query('ROLLBACK'); + } + else + { + db_query('COMMIT'); + db_log ($SESSID_USERNAME, $fDomain, 'create_mailbox', "$fUsername"); + $tDomain = $fDomain; - if ($fMail == "on") - { - $fTo = $fUsername; - $fFrom = $SESSID_USERNAME; - $fHeaders = "To: " . $fTo . "\n"; - $fHeaders .= "From: " . $fFrom . "\n"; + $tQuota = $CONF['maxquota']; - $fHeaders .= "Subject: " . encode_header ($PALANG['pSendmail_subject_text']) . "\n"; - $fHeaders .= "MIME-Version: 1.0\n"; - $fHeaders .= "Content-Type: text/plain; charset=utf-8\n"; - $fHeaders .= "Content-Transfer-Encoding: 8bit\n"; - - $fHeaders .= $CONF['welcome_text']; + if ($fMail == "on") + { + $fTo = $fUsername; + $fFrom = $SESSID_USERNAME; + $fHeaders = "To: " . $fTo . "\n"; + $fHeaders .= "From: " . $fFrom . "\n"; - if (!smtp_mail ($fTo, $fFrom, $fHeaders)) - { - $tMessage .= "<br />" . $PALANG['pSendmail_result_error'] . "<br />"; - } - else - { - $tMessage .= "<br />" . $PALANG['pSendmail_result_success'] . "<br />"; - } - } + $fHeaders .= "Subject: " . encode_header ($PALANG['pSendmail_subject_text']) . "\n"; + $fHeaders .= "MIME-Version: 1.0\n"; + $fHeaders .= "Content-Type: text/plain; charset=utf-8\n"; + $fHeaders .= "Content-Transfer-Encoding: 8bit\n"; - $tShowpass = ""; - if ( $tPassGenerated == 1 || $CONF['show_password'] == "YES") $tShowpass = " / $fPassword"; + $fHeaders .= $CONF['welcome_text']; - if (create_mailbox_subfolders($fUsername,$fPassword)) - { - $tMessage .= $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername$tShowpass)"; - } else { - $tMessage .= $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername$tShowpass)"; - } + if (!smtp_mail ($fTo, $fFrom, $fHeaders)) + { + $tMessage .= "<br />" . $PALANG['pSendmail_result_error'] . "<br />"; + } + else + { + $tMessage .= "<br />" . $PALANG['pSendmail_result_success'] . "<br />"; + } + } - } - } + $tShowpass = ""; + if ( $tPassGenerated == 1 || $CONF['show_password'] == "YES") $tShowpass = " / $fPassword"; + + if (create_mailbox_subfolders($fUsername,$fPassword)) + { + $tMessage .= $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername$tShowpass)"; + } else { + $tMessage .= $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername$tShowpass)"; + } + + } + } } 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...> - 2010-04-19 22:27:41
|
Revision: 820 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=820&view=rev Author: GingerDog Date: 2010-04-19 22:27:35 +0000 (Mon, 19 Apr 2010) Log Message: ----------- reindent Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2010-04-19 22:26:18 UTC (rev 819) +++ trunk/create-mailbox.php 2010-04-19 22:27:35 UTC (rev 820) @@ -158,10 +158,10 @@ { $password = pacrypt ($fPassword); - if($CONF['maildir_name_hook'] != 'NO' && function_exists($CONF['maildir_name_hook'])) { - $hook_func = $CONF['maildir_name_hook']; - $maildir = $hook_func ($fDomain, $fUsername); - } + if($CONF['maildir_name_hook'] != 'NO' && function_exists($CONF['maildir_name_hook'])) { + $hook_func = $CONF['maildir_name_hook']; + $maildir = $hook_func ($fDomain, $fUsername); + } else if ($CONF['domain_path'] == "YES") { if ($CONF['domain_in_mailbox'] == "YES") @@ -211,7 +211,7 @@ $fUsername = strtolower($fUsername); $local_part = ''; if(preg_match('/^(.*)@/', $fUsername, $matches)) { - $local_part = $matches[1]; + $local_part = $matches[1]; } $result = db_query ("INSERT INTO $table_mailbox (username,password,name,maildir,local_part,quota,domain,created,modified,active) VALUES ('$fUsername','$password','$fName','$maildir','$local_part','$quota','$fDomain',NOW(),NOW(),'$sqlActive')"); @@ -225,45 +225,45 @@ { db_query('COMMIT'); db_log ($SESSID_USERNAME, $fDomain, 'create_mailbox', "$fUsername"); - $tDomain = $fDomain; + $tDomain = $fDomain; - $tQuota = $CONF['maxquota']; + $tQuota = $CONF['maxquota']; - if ($fMail == "on") - { - $fTo = $fUsername; - $fFrom = $SESSID_USERNAME; - $fHeaders = "To: " . $fTo . "\n"; - $fHeaders .= "From: " . $fFrom . "\n"; + if ($fMail == "on") + { + $fTo = $fUsername; + $fFrom = $SESSID_USERNAME; + $fHeaders = "To: " . $fTo . "\n"; + $fHeaders .= "From: " . $fFrom . "\n"; - $fHeaders .= "Subject: " . encode_header ($PALANG['pSendmail_subject_text']) . "\n"; - $fHeaders .= "MIME-Version: 1.0\n"; - $fHeaders .= "Content-Type: text/plain; charset=utf-8\n"; - $fHeaders .= "Content-Transfer-Encoding: 8bit\n"; - - $fHeaders .= $CONF['welcome_text']; + $fHeaders .= "Subject: " . encode_header ($PALANG['pSendmail_subject_text']) . "\n"; + $fHeaders .= "MIME-Version: 1.0\n"; + $fHeaders .= "Content-Type: text/plain; charset=utf-8\n"; + $fHeaders .= "Content-Transfer-Encoding: 8bit\n"; - if (!smtp_mail ($fTo, $fFrom, $fHeaders)) - { - $tMessage .= "<br />" . $PALANG['pSendmail_result_error'] . "<br />"; + $fHeaders .= $CONF['welcome_text']; + + if (!smtp_mail ($fTo, $fFrom, $fHeaders)) + { + $tMessage .= "<br />" . $PALANG['pSendmail_result_error'] . "<br />"; + } + else + { + $tMessage .= "<br />" . $PALANG['pSendmail_result_success'] . "<br />"; + } } - else + + $tShowpass = ""; + if ( $tPassGenerated == 1 || $CONF['show_password'] == "YES") $tShowpass = " / $fPassword"; + + if (create_mailbox_subfolders($fUsername,$fPassword)) { - $tMessage .= "<br />" . $PALANG['pSendmail_result_success'] . "<br />"; + $tMessage .= $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername$tShowpass)"; + } else { + $tMessage .= $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername$tShowpass)"; } - } - $tShowpass = ""; - if ( $tPassGenerated == 1 || $CONF['show_password'] == "YES") $tShowpass = " / $fPassword"; - - if (create_mailbox_subfolders($fUsername,$fPassword)) - { - $tMessage .= $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername$tShowpass)"; - } else { - $tMessage .= $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername$tShowpass)"; } - - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-12-30 22:40:16
|
Revision: 926 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=926&view=rev Author: christian_boltz Date: 2010-12-30 22:40:10 +0000 (Thu, 30 Dec 2010) Log Message: ----------- create-mailbox.php: - let smtp_mail() construct the mail headers Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2010-12-30 22:34:59 UTC (rev 925) +++ trunk/create-mailbox.php 2010-12-30 22:40:10 UTC (rev 926) @@ -233,17 +233,10 @@ { $fTo = $fUsername; $fFrom = $SESSID_USERNAME; - $fHeaders = "To: " . $fTo . "\n"; - $fHeaders .= "From: " . $fFrom . "\n"; + $fSubject = $CONF['pSendmail_subject_text']; + $fBody = $CONF['welcome_text']; - $fHeaders .= "Subject: " . encode_header ($PALANG['pSendmail_subject_text']) . "\n"; - $fHeaders .= "MIME-Version: 1.0\n"; - $fHeaders .= "Content-Type: text/plain; charset=utf-8\n"; - $fHeaders .= "Content-Transfer-Encoding: 8bit\n"; - - $fHeaders .= $CONF['welcome_text']; - - if (!smtp_mail ($fTo, $fFrom, $fHeaders)) + if (!smtp_mail ($fTo, $fFrom, $fSubject, $fBody)) { $tMessage .= "<br />" . $PALANG['pSendmail_result_error'] . "<br />"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2011-07-31 20:29:23
|
Revision: 1155 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1155&view=rev Author: christian_boltz Date: 2011-07-31 20:29:17 +0000 (Sun, 31 Jul 2011) Log Message: ----------- create-mailbox: - switch to edit-mailbox template (I forgot this in r1154) - added some TODO notes Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2011-07-31 15:22:17 UTC (rev 1154) +++ trunk/create-mailbox.php 2011-07-31 20:29:17 UTC (rev 1155) @@ -64,6 +64,9 @@ { $row = db_array ($result['result']); $tQuota = $row['maxquota']; + # TODO: check for remaining domain quota, reduce $tQuota if it is lower + # Note: this is dependent on the domain, which means to do it correct we'd have to remove the domain dropdown and hardcode the domain name from ?domain=... + # allowed_quota() will provide the maximum allowed quota } } @@ -72,7 +75,7 @@ if (isset ($_POST['fUsername']) && isset ($_POST['fDomain'])) $fUsername = escape_string ($_POST['fUsername']) . "@" . escape_string ($_POST['fDomain']); $fUsername = strtolower ($fUsername); - if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); + if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); # TODO: remove escaping (except for DB query and when handing it over to dovecotpw) - https://sourceforge.net/tracker/?func=detail&aid=3094804&group_id=191583&atid=937964 if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); isset ($_POST['fName']) ? $fName = escape_string ($_POST['fName']) : $fName = ""; if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']); @@ -269,7 +272,7 @@ $smarty->assign ('tName', $tName, false); $smarty->assign ('tQuota', $tQuota); $smarty->assign ('mailbox_quota_text_error', $pCreate_mailbox_quota_text_error, false); -$smarty->assign ('smarty_template', 'create-mailbox'); +$smarty->assign ('smarty_template', 'edit-mailbox'); $smarty->display ('index.tpl'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2011-09-25 19:13:45
|
Revision: 1194 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1194&view=rev Author: christian_boltz Date: 2011-09-25 19:13:39 +0000 (Sun, 25 Sep 2011) Log Message: ----------- create-mailbox.php: - check password with validate_password - cleanup password validation - cleanup/merge duplicate assignment of $t* variables This fixes the remaining 50% of https://sourceforge.net/tracker/?func=detail&aid=1951979&group_id=191583&atid=937964 Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2011-09-25 18:53:58 UTC (rev 1193) +++ trunk/create-mailbox.php 2011-09-25 19:13:39 UTC (rev 1194) @@ -87,49 +87,33 @@ if ( (!check_owner ($SESSID_USERNAME, $fDomain)) && (!authentication_has_role('global-admin')) ) { $error = 1; - $tUsername = escape_string ($_POST['fUsername']); - $tName = $fName; - $tQuota = $fQuota; - $tDomain = $fDomain; $pCreate_mailbox_username_text_error = $PALANG['pCreate_mailbox_username_text_error1']; } if (!check_mailbox ($fDomain)) { $error = 1; - $tUsername = escape_string ($_POST['fUsername']); - $tName = $fName; - $tQuota = $fQuota; - $tDomain = $fDomain; $pCreate_mailbox_username_text_error = $PALANG['pCreate_mailbox_username_text_error3']; } if (empty ($fUsername) or !check_email ($fUsername)) { $error = 1; - $tUsername = escape_string ($_POST['fUsername']); - $tName = $fName; - $tQuota = $fQuota; - $tDomain = $fDomain; $pCreate_mailbox_username_text_error = $PALANG['pCreate_mailbox_username_text_error1']; } $tPassGenerated = 0; - if (empty ($fPassword) or empty ($fPassword2) or ($fPassword != $fPassword2)) - { - if (empty ($fPassword) and empty ($fPassword2) and $CONF['generate_password'] == "YES") - { - $fPassword = generate_password (); - $tPassGenerated = 1; - } - else - { + if (empty ($fPassword) && empty ($fPassword2) && $CONF['generate_password'] == "YES") { + $fPassword = generate_password (); + $tPassGenerated = 1; + } elseif (empty ($fPassword) || empty ($fPassword2) || ($fPassword != $fPassword2)) { $error = 1; - $tUsername = escape_string ($_POST['fUsername']); - $tName = $fName; - $tQuota = $fQuota; - $tDomain = $fDomain; $pCreate_mailbox_password_text_error = $PALANG['pCreate_mailbox_password_text_error']; + } else { + $validpass = validate_password($fPassword); + if(count($validpass) > 0) { + $pCreate_mailbox_password_text_error = $validpass[0]; # TODO: honor all error messages, not only the first one + $error = 1; } } @@ -138,10 +122,6 @@ if (!check_quota ($fQuota, $fDomain)) { $error = 1; - $tUsername = escape_string ($_POST['fUsername']); - $tName = $fName; - $tQuota = $fQuota; - $tDomain = $fDomain; $pCreate_mailbox_quota_text_error = $PALANG['pCreate_mailbox_quota_text_error']; } } @@ -150,15 +130,15 @@ if ($result['rows'] == 1) { $error = 1; + $pCreate_mailbox_username_text_error = $PALANG['pCreate_mailbox_username_text_error2']; + } + + if ($error != 0) { $tUsername = escape_string ($_POST['fUsername']); $tName = $fName; $tQuota = $fQuota; $tDomain = $fDomain; - $pCreate_mailbox_username_text_error = $PALANG['pCreate_mailbox_username_text_error2']; - } - - if ($error != 1) - { + } else { $password = pacrypt ($fPassword); if($CONF['maildir_name_hook'] != 'NO' && function_exists($CONF['maildir_name_hook'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2011-09-29 22:39:50
|
Revision: 1197 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1197&view=rev Author: christian_boltz Date: 2011-09-29 22:39:44 +0000 (Thu, 29 Sep 2011) Log Message: ----------- create-mailbox.php: - use smtp_get_admin_email() instead of the admin's username as sender for the welcome mail This fixes http://sourceforge.net/tracker/?func=detail&aid=2958684&group_id=191583&atid=937964 reported by mrfrenzy on IRC Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2011-09-29 22:15:58 UTC (rev 1196) +++ trunk/create-mailbox.php 2011-09-29 22:39:44 UTC (rev 1197) @@ -215,7 +215,7 @@ if ($fMail == "on") { $fTo = $fUsername; - $fFrom = $SESSID_USERNAME; + $fFrom = smtp_get_admin_email(); $fSubject = $PALANG['pSendmail_subject_text']; $fBody = $CONF['welcome_text']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2012-05-28 20:26:49
|
Revision: 1398 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1398&view=rev Author: christian_boltz Date: 2012-05-28 20:26:43 +0000 (Mon, 28 May 2012) Log Message: ----------- create-mailbox.php: - do not escape the password coming from $_POST. Fixes https://sourceforge.net/tracker/index.php?func=detail&aid=3094804&group_id=191583&atid=937964 Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2012-05-28 20:05:48 UTC (rev 1397) +++ trunk/create-mailbox.php 2012-05-28 20:26:43 UTC (rev 1398) @@ -75,8 +75,8 @@ if (isset ($_POST['fUsername']) && isset ($_POST['fDomain'])) $fUsername = escape_string ($_POST['fUsername']) . "@" . escape_string ($_POST['fDomain']); $fUsername = strtolower ($fUsername); - if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); # TODO: remove escaping (except for DB query and when handing it over to dovecotpw) - https://sourceforge.net/tracker/?func=detail&aid=3094804&group_id=191583&atid=937964 - if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); + if (isset ($_POST['fPassword'])) $fPassword = $_POST['fPassword']; # NOT ESCAPED! + if (isset ($_POST['fPassword2'])) $fPassword2 = $_POST['fPassword2']; # NOT ESCAPED isset ($_POST['fName']) ? $fName = escape_string ($_POST['fName']) : $fName = ""; if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']); isset ($_POST['fQuota']) ? $fQuota = intval($_POST['fQuota']) : $fQuota = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2011-05-22 11:24:54
|
Revision: 1060 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1060&view=rev Author: christian_boltz Date: 2011-05-22 11:24:48 +0000 (Sun, 22 May 2011) Log Message: ----------- create-mailbox.php: - pSendmail_subject_text comes from $PALANG, not $CONF Thiss fixes https://sourceforge.net/tracker/?func=detail&aid=3305302&group_id=191583&atid=937964 reported by Dale Blount (lnxus @SF) Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2011-05-01 20:08:29 UTC (rev 1059) +++ trunk/create-mailbox.php 2011-05-22 11:24:48 UTC (rev 1060) @@ -233,7 +233,7 @@ { $fTo = $fUsername; $fFrom = $SESSID_USERNAME; - $fSubject = $CONF['pSendmail_subject_text']; + $fSubject = $PALANG['pSendmail_subject_text']; $fBody = $CONF['welcome_text']; if (!smtp_mail ($fTo, $fFrom, $fSubject, $fBody)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2011-10-11 20:14:32
|
Revision: 1201 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1201&view=rev Author: christian_boltz Date: 2011-10-11 20:14:26 +0000 (Tue, 11 Oct 2011) Log Message: ----------- create-mailbox: - always display correct available quota (using allowed_quota()) Patch by Dale Blount (lnxus@SF), https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3421296&group_id=191583 Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2011-10-10 22:15:16 UTC (rev 1200) +++ trunk/create-mailbox.php 2011-10-11 20:14:26 UTC (rev 1201) @@ -63,7 +63,7 @@ if ($result['rows'] == 1) { $row = db_array ($result['result']); - $tQuota = $row['maxquota']; + $tQuota = allowed_quota($tDomain, 0); # TODO: check for remaining domain quota, reduce $tQuota if it is lower # Note: this is dependent on the domain, which means to do it correct we'd have to remove the domain dropdown and hardcode the domain name from ?domain=... # allowed_quota() will provide the maximum allowed quota @@ -210,7 +210,7 @@ db_log ($fDomain, 'create_mailbox', "$fUsername"); $tDomain = $fDomain; - $tQuota = $CONF['maxquota']; + $tQuota = allowed_quota($tDomain, 0); if ($fMail == "on") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |