// If the password must be more secure (since this is the root account) if (!IsValidEmail($data['admin_email'])) { $page->InfoBox('Email address <b>' . $data['admin_email'] . '</b> is not valid email'); $validData = false; } /////////// Root account data evaluation is done /////////// if ($validData) { // Create an hashes for this valid data $keywords['admin']['admin_password'] = md5($data['admin_password']); $keywords['admin']['admin_hashkey'] = md5($data['admin_username'] . $keywords['admin']['admin_password'] . $data['admin_email']); // Update mask class with the changed keywords $mask->SetKeywords(); // Get the installation queries and split them by the "next query" separator, // and then run each query and get an array of results. If there is no split // then the query will be an array with only one cell - still an array :) $results = $dbase->RunQuery($mask->GetSqlRootAccessQueries(TRUE)); // Go through all the results, and every one of them must be 'true' // othervice some query failed and installation is incomplete! $databaseErrorMessage = ''; $databaseSuccessCount = 0; $databaseFailedCount = 0; foreach ($results as $result) { if ($result['success']) { $databaseSuccessCount++; } else { $databaseFailedCount++; $databaseErrorMessage .= $result['error'] . "<br />\n"; } } // If some query failed if ($databaseFailedCount == 0) {
$hash =new PasswordHash(8, true); $final_password = $hash->HashPassword($data['admin_password']); // Create Library Password $keywords['special']['library_password'] = md5('RS' . $data['admin_username'] . $final_password); $keywords['admin']['admin_password'] = $data['admin_password']; $keywords['admin']['admin_hashkey'] = md5( $data['admin_username'].$keywords['admin']['admin_password'].$data['admin_email'] ); $keywords['special']['admin_password_hash'] = $final_password; // Update mask class with the changed keywords $mask->SetKeywords(); // Get the installation queries and split them by the "next query" separator, // and then run each query and get an array of results. If there is no split // then the query will be an array with only one cell - still an array :) $results = $dbase->RunQuery( $mask->GetSqlRootAccessQueries(true), false ); // Go through all the results, and every one of them must be 'true' // otherwise some query failed and installation is incomplete! $databaseErrorMessage = ''; $databaseSuccessCount = 0; $databaseFailedCount = 0; foreach($results as $result) { if($result['success']) $databaseSuccessCount++; else { $databaseFailedCount++; $databaseErrorMessage .= $result['error']."<br />\n";