if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
-}
+} // END - if
// Add description as navigation point
ADD_DESCR('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 ((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'))) {
// Add admin when not added already
- if (REGISTER_ADMIN(REQUEST_POST('login'), generateHash(REQUEST_POST('pass1')), REQUEST_POST('email')) == "done") {
+ if (REGISTER_ADMIN(REQUEST_POST('login'), generateHash(REQUEST_POST('pass1')), REQUEST_POST('email')) == 'done') {
// Do not ouput any form!
$FORM = false;
// 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' => ''),
+ REQUEST_POST_ARRAY()
+ );
// Load form from template
- LOAD_TEMPLATE("admin_admins_add");
+ LOAD_TEMPLATE('admin_admins_add', false, $content);
} // END - if
//