-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") {
- // Do not ouput any form!
- $FORM = false;
+// Is the form sent?
+if (isFormSent('add')) {
+ // Check all
+ if ((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;