X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-admins_add.php;h=0b5d3932fb36641afba408e3098b9f75aa457de2;hb=94eb7e461c29c7050a41aa6d5edcd3a1707bf904;hp=a5f8f6cebde07ce00a1f902da610d2167372aa82;hpb=09f5758c42a33a56bdd461c946ffe759a59c54aa;p=mailer.git diff --git a/inc/modules/admin/what-admins_add.php b/inc/modules/admin/what-admins_add.php index a5f8f6cebd..0b5d3932fb 100644 --- a/inc/modules/admin/what-admins_add.php +++ b/inc/modules/admin/what-admins_add.php @@ -14,12 +14,10 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -43,27 +41,31 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { } // END - if // Add description as navigation point -addMenuDescription('admin', __FILE__); +addYouAreHereLink('admin', __FILE__); // Display form is default -$FORM = true; +$FORM = TRUE; -if ((isPostRequestParameterSet('add')) && (isPostRequestParameterSet('login')) && (isPostRequestParameterSet('email')) && (isPostRequestParameterSet('pass1')) && (isPostRequestParameterSet('pass2')) && (postRequestParameter('pass1') == postRequestParameter('pass2'))) { - // Add admin when not added already - if (addAdminAccount(postRequestParameter('login'), generateHash(postRequestParameter('pass1')), postRequestParameter('email')) == 'done') { - // Do not ouput any form! - $FORM = false; +// Is the form sent? +if (isFormSent('add')) { + // Check all + if ((isPostRequestElementSet('login')) && (isPostRequestElementSet('email')) && (isPostRequestElementSet('password1')) && (isPostRequestElementSet('password2')) && (postRequestElement('password1') == postRequestElement('password2'))) { + // Add admin when not added already + if (addAdminAccount(postRequestElement('login'), generateHash(postRequestElement('password1')), postRequestElement('email')) == 'done') { + // Do not ouput any form! + $FORM = FALSE; - // Admin login saved - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ADD_DONE')); + // Admin login saved + displayMessage('{--ADMIN_ADMINS_ADD_DONE--}'); - // Run filter chain - runFilterChain('post_admin_added', postRequestArray()); + // Run filter chain + runFilterChain('post_admin_added', postRequestArray()); + } // END - if } // END - if } // END - if // Shall we display the form? -if ($FORM === true) { +if ($FORM === TRUE) { // Prepare content $content = merge_array( array('login' => '', 'email' => ''), @@ -71,7 +73,7 @@ if ($FORM === true) { ); // Load form from template - loadTemplate('admin_admins_add', false, $content); + loadTemplate('admin_add_admins', FALSE, $content); } // END - if // [EOF]