From 2f52a8402dd88d0c30ed48eff07d883690c00a33 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Wed, 19 Oct 2011 21:26:31 +0000 Subject: [PATCH] edit-domain.php: - deleted (obsoleted by create-domain.php) create-domain.php: - fixed wrong variable name that broke saving an edited domain configs/menu.conf, templates/adminlistdomain.tpl - changed to use create-domain.php?edit= instead of edit-domain?domain= git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1226 a1433add-5e2c-0410-b055-b7f2511e0802 --- configs/menu.conf | 2 +- create-domain.php | 4 +- edit-domain.php | 136 ---------------------------------- templates/adminlistdomain.tpl | 2 +- 4 files changed, 4 insertions(+), 140 deletions(-) delete mode 100644 edit-domain.php diff --git a/configs/menu.conf b/configs/menu.conf index 66e6fc12..ebbbea2c 100644 --- a/configs/menu.conf +++ b/configs/menu.conf @@ -51,4 +51,4 @@ url_edit_admin = edit-admin.php [adminlistdomain] url_edit_active_domain = edit-active-domain.php -url_edit_domain = edit-domain.php +url_edit_domain = create-domain.php diff --git a/create-domain.php b/create-domain.php index 15fd29c0..779a0d88 100644 --- a/create-domain.php +++ b/create-domain.php @@ -13,7 +13,7 @@ * @license GNU GPL v2 or later. * * File: create-domain.php - * Allows administrators to create new domains. + * Allows administrators to create or edit domains. * Template File: admin_edit-domain.tpl */ @@ -71,7 +71,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") { } } } - if ($edit != "") $field[$id_field] = $edit; + if ($edit != "") $values[$id_field] = $edit; if (!$handler->init($values[$id_field])) { $error = 1; diff --git a/edit-domain.php b/edit-domain.php deleted file mode 100644 index d990458e..00000000 --- a/edit-domain.php +++ /dev/null @@ -1,136 +0,0 @@ - $fDescription, - 'aliases' => $fAliases, - 'mailboxes' => $fMailboxes, - 'maxquota' => $fMaxquota, - 'quota' => $fQuota, - 'backupmx' => $sqlBackupmx, - 'active' => $sqlActive, - ); - - if($CONF['transport'] != 'NO') { # only change transport if it is allowed in config. Otherwise, keep the old value. - $db_values['transport'] =$fTransport; - } - - $result = db_update('domain', 'domain', $domain, $db_values); - - if ($result == 1) { - header ("Location: list-domain.php"); - exit; - } else { - flash_error($PALANG['pAdminEdit_domain_result_error']); - } -} - -$smarty->assign ('mode', 'edit'); -$smarty->assign ('errortext', ''); -$smarty->assign ('tDomain', $domain); -$smarty->assign ('tDescription', $tDescription); -$smarty->assign ('tAliases', $tAliases); -$smarty->assign ('tMailboxes', $tMailboxes); -$smarty->assign ('tMaxquota', $tMaxquota); -$smarty->assign ('tQuota', $tDomainquota); -$smarty->assign ('tTransport', select_options($CONF['transport_options'], array($tTransport)), false); -if ($tBackupmx) $smarty->assign ('tBackupmx', ' checked="checked"'); -if ($tActive) $smarty->assign ('tActive', ' checked="checked"'); -$smarty->assign ('smarty_template', 'admin_edit-domain'); -$smarty->display ('index.tpl'); - -/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ diff --git a/templates/adminlistdomain.tpl b/templates/adminlistdomain.tpl index df644a18..75e2ba90 100644 --- a/templates/adminlistdomain.tpl +++ b/templates/adminlistdomain.tpl @@ -34,7 +34,7 @@ {$domain.backupmx} {$domain.modified} {$domain.active} - {$PALANG.edit} + {$PALANG.edit} {$PALANG.del} {/foreach}