Ejemplo n.º 1
0
 // outside this 'if' statement because it could be used in
 // below steps, so this is done to keep the installer stable!
 if ($steps[STEP_DBACCESS]['enabled']) {
     if (!$dbase->IsConnected()) {
         $page->MainTitle($steps[STEP_DBACCESS]['title'], 'dbaccess');
         $page->WarningBox('Connection has not been made to a database server. The step <a href="?step=' . STEP_DBCONNECT . '">' . '<b>' . $steps[STEP_DBCONNECT]['title'] . '</b></a> must be processed first!');
         $page->ShowPage(STEP_DBACCESS);
     }
     if (!$dbase->IsDatabaseSelected()) {
         $page->MainTitle($steps[STEP_DBACCESS]['title'], 'dbaccess');
         $page->WarningBox('Database has not been selected. The step <a href="?step=' . STEP_DBSELECT . '">' . '<b>' . $steps[STEP_DBSELECT]['title'] . '</b></a> must be processed first!');
         $page->ShowPage(STEP_DBACCESS);
     }
     // Run multiple tests to see if user has the priviledge
     // to create tables and manipulate data
     $dbtest = $dbase->TestUserPrivileges();
     // If some test failed, or ishidden is false and $step is set to this step
     if (!$dbtest['totalsuccess'] || !$steps[STEP_DBACCESS]['ishidden'] && $step == STEP_DBACCESS) {
         $page->MainTitle($steps[STEP_DBACCESS]['title'], 'dbaccess');
         // Get the username to single variable
         $username = $keywords['connection']['username'];
         // If all the tests rendered successful, show success
         if ($dbtest['totalsuccess']) {
             $page->SuccessBox('The user <b>' . $username . '</b> has sufficient database access. Proceed to the next step.');
         } else {
             if (!$dbtest['totalsuccess']) {
                 $page->WarningBox('The user <b>' . $username . '</b> must have permission to execute all of below commands ' . 'in order to continue. Either <a href="?step=' . STEP_DBCONNECT . '">try another login</a> ' . 'or contact the support at your hosting service.');
             }
         }
         // Explain litlebit what this is for
         $page->Paragraph('These commands are needed to install database tables, and then insert, update and delete data from those tables.');