getProxy('alias'); do_header(); // Normal page request (GET) if ($_SERVER['REQUEST_METHOD'] == "GET") { $row = $alias->get(); if ($row === false) { bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale'); textdomain('postfixadmin'); $tMessage = _("Unable to locate alias!"); bindtextdomain('squirrelmail', SM_PATH . 'locale'); textdomain('squirrelmail'); exit(0); } } if ($_SERVER['REQUEST_METHOD'] == "POST") { $pEdit_alias_goto = _("To"); $fGoto = $_POST['fGoto']; // reform string into a list... $goto = preg_replace('/\r\n/', ',', $fGoto); $goto = preg_replace('/[\s]+/i', '', $goto); $goto = preg_replace('/\,*$/', '', $goto); $array = preg_split('/,/', $goto); $error = 0; // check that we have valid addresses in the list foreach ($array as $key => $email_address) { if (empty($email_address)) { unset($array[$key]); continue; } if (check_email($email_address) != "") { $error = 1; $tGoto = $goto; bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale'); textdomain('postfixadmin'); $tMessage = _("The email address that you have entered is not valid:") . " $email_address"; bindtextdomain('squirrelmail', SM_PATH . 'locale'); textdomain('squirrelmail'); } } if ($error != 1) { $flag = 'forward_and_store'; // goto = $USERID_USERNAME; $success = $alias->update($array, $flag); if (!$success) { bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale'); textdomain('postfixadmin'); $tMessage = _("Unable to modify the alias!"); bindtextdomain('squirrelmail', SM_PATH . 'locale'); textdomain('squirrelmail'); } else { bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale'); textdomain('postfixadmin'); echo "

". _("Alias successfully changed!"). "\n

"; bindtextdomain('squirrelmail', SM_PATH . 'locale'); textdomain('squirrelmail'); echo "

". _("Click here to go back") ."

"; exit; } } } bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale'); textdomain('postfixadmin'); if (!isset($tMessage)) { $tMessage = ''; } echo "
". _("Options") ." - ". _("Edit Alias"). "
". _("Edit an alias* for your email address.
One entry per line."). "
". _("*Additional forward-aliases always receive messages BCC!"). "\n
" . _("To remove an alias, simply delete its line from the text box.") . "
". _("Edit Forwards"). "
$tMessage
". _("Alias"). ":\n " . $_SESSION['username'] . "
   
". _("To"). ":\n
   
 
"; bindtextdomain('squirrelmail', SM_PATH . 'locale'); textdomain('squirrelmail');