remove obsolete functions from AliasHandler (part 2/2)

AliasHandler.php:
- remove obsolete functions update(), is_mailbox_alias(), 
  is_vacation_address(), hasAliasRecord()
- updated delete() to use new *Handler syntax (most of it should be
  moved to PFAHandler, but that's another story ;-)

users/edit-alias.php:
- replace $ah->update with $ah->set / $ah->store
- use 0/1 for $fForward_and_store instead of YES/NO
- use safepost instead of isset()

templates/users_edit-alias.tpl:
- use 0/1 for $fForward_and_store instead of YES/NO

xmlrpc.php:
- replace $ah->update with new *Handler syntax

Note: the changes in xmlrpc.php are untested again ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1358 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
Christian Boltz committed 2012-04-09 01:48:04 +00:00
1 parent fff6654634
commit e9d8fa1ff9
4 files changed
+38 -158

No files matched your search

+20 -8
View File
@@ -60,8 +60,11 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$pEdit_alias_goto = $PALANG['pEdit_alias_goto'];
if (isset($_POST['fGoto'])) $fGoto = trim($_POST['fGoto']);
if (isset($_POST['fForward_and_store'])) $fForward_and_store = $_POST['fForward_and_store'];
$fGoto = trim(safepost('fGoto'));
$fForward_and_store = safepost('fForward_and_store');
# TODO: use edit.php (or create a edit_user.php)
# TODO: this will obsolete lots of the code below (parsing $goto and the error checks)
$goto = strtolower ($fGoto);
$goto = preg_replace ('/\\\r\\\n/', ',', $goto);
@@ -76,7 +79,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$goto = array_merge(array_unique($goto));
$good_goto = array();
if($fForward_and_store != 'YES' && sizeof($goto) == 1 && $goto[0] == '') {
if($fForward_and_store != 1 && sizeof($goto) == 1 && $goto[0] == '') {
flash_error($PALANG['pEdit_alias_goto_text_error1']);
$error += 1;
}
@@ -100,22 +103,31 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
}
if ($error == 0) {
$flags = 'remote_only';
if($fForward_and_store == "YES" ) {
$flags = 'forward_and_store';
$values = array(
'goto' => $good_goto,
'goto_mailbox' => $fForward_and_store,
);
if (!$ah->set($values)) {
$errormsg = $ah->errormsg;
flash_error($errormsg[0]);
}
$updated = $ah->update($good_goto, $flags);
$updated = $ah->store();
if($updated) {
header ("Location: main.php");
exit;
}
flash_error($PALANG['pEdit_alias_result_error']);
}
else {
$tGotoArray = $goto;
}
$smarty->assign ('tGotoArray', $tGotoArray);
if ($fForward_and_store == "YES") {
if ($fForward_and_store == 1) {
$smarty->assign ('forward_and_store', ' checked="checked"');
$smarty->assign ('forward_only', '');
} else {