From 6a6e1c835281d82f6de4c4331d13523583b5c04a Mon Sep 17 00:00:00 2001 From: Martin Oemus Date: Mon, 17 Apr 2017 17:27:23 +0200 Subject: [PATCH] use Config-class, check auth first, fixed redirect --- users/edit-alias.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/users/edit-alias.php b/users/edit-alias.php index ea18ac8e..3e029f05 100644 --- a/users/edit-alias.php +++ b/users/edit-alias.php @@ -22,15 +22,15 @@ $rel_path = '../'; require_once('../common.php'); $smarty->assign ('smarty_template', 'users_edit-alias'); +authentication_require_role('user'); +$USERID_USERNAME = authentication_get_username(); + // is edit-alias support enabled in $CONF ? -if($CONF['edit_alias'] == 'NO') { - header ("Location: $Return_url"); +if (! Config::bool('edit_alias')) { + header ("Location: main.php"); exit(0); } -authentication_require_role('user'); -$USERID_USERNAME = authentication_get_username(); - $ah = new AliasHandler(); $ah->init($USERID_USERNAME); @@ -145,4 +145,4 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") } /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ -?> +?> \ No newline at end of file