+// Call-back function to check if first admin data is valid
+function isInstallerPostFirstAdminValid ($currentTab) {
+ // Is all data valid?
+ if (!isPostRequestElementSet('admin_login')) {
+ // Login not set
+ $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_FIRST_ADMIN_LOGIN_EMPTY--}';
+ array_push($GLOBALS['installer_failed_fields'][$currentTab], 'admin_login');
+ return FALSE;
+ } elseif (strlen(postRequestElement('admin_login')) < 4) {
+ // Login to short
+ $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_FIRST_ADMIN_LOGIN_SHORT--}';
+ array_push($GLOBALS['installer_failed_fields'][$currentTab], 'admin_login');
+ return FALSE;
+ } elseif (!isPostRequestElementSet('admin_email')) {
+ // Email address not set
+ $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_FIRST_ADMIN_EMAIL_EMPTY--}';
+ array_push($GLOBALS['installer_failed_fields'][$currentTab], 'admin_email');
+ return FALSE;
+ } elseif (!isInstallerAdminEmailValid(postRequestElement('admin_email'))) {
+ // Invalid email address
+ $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_FIRST_ADMIN_EMAIL_INVALID--}';
+ array_push($GLOBALS['installer_failed_fields'][$currentTab], 'admin_email');
+ return FALSE;
+ } elseif ((!isPostRequestElementSet('admin_password1')) && (isPostRequestElementSet('admin_password2'))) {
+ // Password 1 not set
+ $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_FIRST_ADMIN_PASSWORD1_EMPTY--}';
+ array_push($GLOBALS['installer_failed_fields'][$currentTab], 'admin_password1');
+ return FALSE;
+ } elseif ((isPostRequestElementSet('admin_password1')) && (!isPostRequestElementSet('admin_password2'))) {
+ // Password 2 not set
+ $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_FIRST_ADMIN_PASSWORD2_EMPTY--}';
+ array_push($GLOBALS['installer_failed_fields'][$currentTab], 'admin_password2');
+ return FALSE;
+ } elseif (postRequestElement('admin_password1') != postRequestElement('admin_password2')) {
+ // Passwords mismatch
+ $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_FIRST_ADMIN_PASSWORDS_MISMATCH--}';
+ array_push($GLOBALS['installer_failed_fields'][$currentTab], 'admin_password1', 'admin_password2');
+ return FALSE;
+ } elseif (!isStrongPassword(postRequestElement('admin_password1'))) {
+ // Weak passwords entered
+ $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_FIRST_ADMIN_PASSWORDS_WEAK--}';
+ array_push($GLOBALS['installer_failed_fields'][$currentTab], 'admin_password1', 'admin_password2');
+ return FALSE;
+ } // END - if
+
+ // All tests passed
+ return TRUE;
+}
+
+// Store given tab in session
+function installTabOkay ($currentTab) {
+ // Is it set?
+ if (isSessionVariableSet('installer_okay')) {
+ // Is this tab already found?
+ if (strpos(getSession('installer_okay'), $currentTab) === FALSE) {
+ // Then extend it
+ setSession('installer_okay', getSession('installer_okay') . ';' . $currentTab);
+ } // END - if
+ } else {
+ // Initially set it
+ setSession('installer_okay', $currentTab);
+ }
+}
+
+// Checks whether at least the required tabs are completed
+function isInstallationDataCompleted () {
+ // Check both
+ $isCompleted = (
+ (isSessionVariableSet('installer_okay')) &&
+ (strpos(getSession('installer_okay'), 'base_data') !== FALSE) &&
+ (strpos(getSession('installer_okay'), 'database_config') !== FALSE)
+ );
+
+ // Return it
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isCompleted=' . intval($isCompleted) . ',installer_okay=' . getSession('installer_okay'));
+ return $isCompleted;
+}
+