From 81059ddbdd033a9c03dcecfe4769d7fb8225db85 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Fri, 12 Dec 2008 19:40:39 +0000 Subject: [PATCH] allow local_part to change (in theory this code serves no purpose, as the username cannot be changed.. but perhaps it will be in the future (part 2 of operation shut-up-libertytek-charles :) ) git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@496 a1433add-5e2c-0410-b055-b7f2511e0802 --- edit-mailbox.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/edit-mailbox.php b/edit-mailbox.php index 7ec44cf9..d08dd80d 100644 --- a/edit-mailbox.php +++ b/edit-mailbox.php @@ -151,8 +151,10 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") $formvars['name'] = $fName; $formvars['quota'] =$quota; $formvars['active']=$sqlActive; - - $result = db_update ('mailbox', "username='$fUsername' AND domain='$fDomain'", $formvars, array('modified')); + if(preg_match('/^(.*)@/', $fUsername, $matches)) { + $formvars['local_part'] = $matches[1]; + } + $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'];