X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-admins_add.php;h=eb3ec7336682ec831abdf7d1b406460ea04fca7c;hp=d9fd08a64d190bc4582b96f07f8e153a11ffa789;hb=d3c4fdd9bfab35389e1a5ff48f3952d527c7b4bb;hpb=1355d2c0b29510dbd407f9cde9f41a5ac02d01fa diff --git a/inc/modules/admin/what-admins_add.php b/inc/modules/admin/what-admins_add.php index d9fd08a64d..eb3ec73366 100644 --- a/inc/modules/admin/what-admins_add.php +++ b/inc/modules/admin/what-admins_add.php @@ -17,7 +17,7 @@ * Needs to be in all Files and every File needs "svn propset * * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * - * Copyright (c) 2003 - 2008 by Roland Haeder * + * Copyright (c) 2003 - 2009 by Roland Haeder * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -37,41 +37,41 @@ ************************************************************************/ // Some security stuff... -if ((!defined('__SECURITY')) || (!IS_ADMIN())) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; - require($INC); -} +if ((!defined('__SECURITY')) || (!isAdmin())) { + die(); +} // END - if // Add description as navigation point -ADD_DESCR('admin', __FILE__); +addMenuDescription('admin', __FILE__); // Display form is default $FORM = true; -if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST('login')) && (REQUEST_ISSET_POST('email')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) { +if ((isPostRequestElementSet('add')) && (isPostRequestElementSet('login')) && (isPostRequestElementSet('email')) && (isPostRequestElementSet('pass1')) && (isPostRequestElementSet('pass2')) && (postRequestElement('pass1') == postRequestElement('pass2'))) { // Add admin when not added already - if (REGISTER_ADMIN(REQUEST_POST('login'), generateHash(REQUEST_POST('pass1')), REQUEST_POST('email')) == 'done') { + if (addAdminAccount(postRequestElement('login'), generateHash(postRequestElement('pass1')), postRequestElement('email')) == 'done') { // Do not ouput any form! $FORM = false; // Admin login saved - LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ADD_DONE')); + loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ADD_DONE')); // Run filter chain - runFilterChain('post_admin_added', REQUEST_POST_ARRAY()); + runFilterChain('post_admin_added', postRequestArray()); } // END - if } // END - if // Shall we display the form? if ($FORM === true) { - // Set missing elements - // @TODO Do we still need this ugly code here? - if (!REQUEST_ISSET_POST('login')) REQUEST_SET_POST('login', ''); - if (!REQUEST_ISSET_POST('email')) REQUEST_SET_POST('email', ''); + // Prepare content + $content = merge_array( + array('login' => '', 'email' => ''), + postRequestArray() + ); // Load form from template - LOAD_TEMPLATE('admin_admins_add', REQUEST_POST_ARRAY()); + loadTemplate('admin_admins_add', false, $content); } // END - if -// +// [EOF] ?>