From e719c6c4dde6e0397150d7a4c5b4447f83292fb2 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Tue, 10 Jan 2012 00:30:01 +0000 Subject: [PATCH] create-alias.php: - deleted, obsoleted by edit.php?table=alias functions.inc.php: - drop function check_alias() - it was only used by create-alias.php (AliasHandler has a similar function create_allowed(), which is a copy of check_alias() with superfluous {...} removed) configs/menu.conf - replace create-alias.php with edit.php?table=alias - append "?" to url_create_mailbox to avoid temporary change in menu.tpl (create-mailbox is the only one which still needs ? instead of &) templates/list-virtual.tpl: - use {#url_create_alias#} instead of hardcoded create-alias.php templates/menu.tpl: - $url_domain: url-escape domain, use & instead of ? git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1317 a1433add-5e2c-0410-b055-b7f2511e0802 --- configs/menu.conf | 4 +- create-alias.php | 203 ------------------------------------- functions.inc.php | 23 ----- templates/list-virtual.tpl | 2 +- templates/menu.tpl | 2 +- 5 files changed, 4 insertions(+), 230 deletions(-) delete mode 100644 create-alias.php diff --git a/configs/menu.conf b/configs/menu.conf index e3ae07cf..e6692129 100644 --- a/configs/menu.conf +++ b/configs/menu.conf @@ -7,8 +7,8 @@ url_list_domain = list-domain.php url_edit_domain = edit.php?table=domain # list-virtual url_list_virtual = list-virtual.php -url_create_mailbox = create-mailbox.php -url_create_alias = create-alias.php +url_create_mailbox = create-mailbox.php? +url_create_alias = edit.php?table=alias url_create_alias_domain = edit.php?table=aliasdomain # fetchmail url_fetchmail = fetchmail.php diff --git a/create-alias.php b/create-alias.php deleted file mode 100644 index 7629cf11..00000000 --- a/create-alias.php +++ /dev/null @@ -1,203 +0,0 @@ -($fAddress -> $fGoto)
\n"); - } - else { - db_log ($fDomain, 'create_alias', "$fAddress -> $fGoto"); - - $tDomain = $fDomain; - flash_info($PALANG['pCreate_alias_result_success'] . "
($fAddress -> $fGoto)
\n"); - } - } else { # on error - $tAddress = htmlentities($_POST['fAddress']); - $tGoto = htmlentities($_POST['fGoto']); - $tDomain = htmlentities($_POST['fDomain']); - } -} - -$smarty->assign ('mode', 'create'); -$smarty->assign ('tAddress', $tAddress); -$smarty->assign ('select_options', select_options ($list_domains, array ($tDomain)), false); -$smarty->assign ('pCreate_alias_address_text_error', $pCreate_alias_address_text_error, false); -$smarty->assign ('tGoto', $tGoto, false); -$smarty->assign ('smarty_template', 'edit-alias'); -$smarty->display ('index.tpl'); - -/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ -?> diff --git a/functions.inc.php b/functions.inc.php index 7489a36b..5e7fe939 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -576,29 +576,6 @@ function get_mailbox_properties ($username) { -// -// check_alias -// Action: Checks if the domain is still able to create aliases. -// Call: check_alias (string domain) -// -function check_alias ($domain) { - $limit = get_domain_properties ($domain); - if ($limit['aliases'] == 0) { - # 0 = unlimited, -1 = disabled - return true; - } - if ($limit['aliases'] < 0) { - return false; - } - if ($limit['alias_count'] >= $limit['aliases']) { - return false; - } else { - return true; - } -} - - - // // check_mailbox // Action: Checks if the domain is still able to create mailboxes. diff --git a/templates/list-virtual.tpl b/templates/list-virtual.tpl index 297a2483..9f318d95 100644 --- a/templates/list-virtual.tpl +++ b/templates/list-virtual.tpl @@ -45,7 +45,7 @@ {$nav_bar_alias.bottom} {if $tCanAddAlias} -
{$PALANG.pMenu_create_alias}
+
{$PALANG.pMenu_create_alias}
{/if} {/if} {if $tab=='all'}
{/if} diff --git a/templates/menu.tpl b/templates/menu.tpl index fcde9b04..81be24b1 100644 --- a/templates/menu.tpl +++ b/templates/menu.tpl @@ -3,7 +3,7 @@ {if !empty($smarty.get) && !empty($smarty.get.domain)} {*** zuweisung muss eleganter gehen ***} {assign var="url_domain" value=$smarty.get.domain} - {assign var="url_domain" value="?domain=$url_domain"} + {assign var="url_domain" value="&domain={$url_domain|escape:url}"} {/if} {/strip}