/** * Update database */ public function db($continue = null) { Yii::app()->loadHelper("update/update"); if (isset($continue) && $continue == "yes") { $aViewUrls['output'] = CheckForDBUpgrades($continue); $aData['display']['header'] = false; } else { $aData['display']['header'] = true; $aViewUrls['output'] = CheckForDBUpgrades(); } $aData['updatedbaction'] = true; $this->_renderWrappedTemplate('update', $aViewUrls, $aData); }
/** * Update database */ public function db($continue = null) { Yii::app()->loadHelper("update/update"); if (isset($continue) && $continue == "yes") { $aViewUrls['output'] = CheckForDBUpgrades($continue); $aData['display']['header'] = false; } else { $aData['display']['header'] = true; $aViewUrls['output'] = CheckForDBUpgrades(); } $aData['updatedbaction'] = true; // TODO: Add admin theme, WITHOUT call _renderWrappedTemplate. We don't want to // do any database queries when updating the database. $aData = array_merge($aData, $aViewUrls); Yii::app()->getController()->renderPartial('databaseupdate/db', $aData); }
$clang = new limesurvey_lang("en"); $adminoutput = getAdminHeader(); // Alle future output is written into this and then outputted at the end of file ob_implicit_flush(true); sendcacheheaders(); if (!$database_exists) { $adminoutput .= "<br />\n" . "<table width='350' align='center' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n" . "\t<tr bgcolor='#555555'><td colspan='2' height='4'><font size='1' face='verdana' color='white'><strong>" . $clang->gT("LimeSurvey Setup") . "</strong></td></tr>\n" . "\t<tr bgcolor='#CCCCCC'><td align='center'>\n" . "<strong>" . $clang->gT("Welcome to LimeSurvey Setup!") . "</strong><br /><br />\n" . $clang->gT("The database defined in config.php does not exist.") . "<br />\n" . $clang->gT("LimeSurvey can attempt to create this database for you.") . "<br /><br />\n" . $clang->gT("Your selected database name is:") . "<strong> {$databasename}</strong><br />\n" . "<br /><input type='submit' value='" . $clang->gT("Create Database") . "' onclick='location.href=\"createdb.php\"' /></center>\n" . "</td></tr></table>\n" . "</body>\n</html>\n"; } elseif ($dbexistsbutempty && !(returnglobal('createdbstep2') == $clang->gT("Populate Database"))) { $connect->database = $databasename; $connect->Execute("USE DATABASE `{$databasename}`"); $adminoutput .= "<div class='messagebox ui-corner-all'><div class='header ui-widget-header' >" . $clang->gT("LimeSurvey Setup") . "</div>\n"; $adminoutput .= "<br /><div class='successtitle'>\n"; $adminoutput .= sprintf($clang->gT('A database named "%s" already exists.'), $databasename) . "</div><p>\n"; $adminoutput .= $clang->gT("Do you want to populate that database now by creating the necessary tables?") . "<br /><br />\n"; $adminoutput .= "<form method='post' action='createdb.php'>"; $adminoutput .= "<input type='submit' name='createdbstep2' value='" . $clang->gT("Populate Database") . "'></form></div>"; } else { //DB EXISTS, CHECK FOR APPROPRIATE UPGRADES $connect->database = $databasename; $connect->Execute("USE DATABASE `{$databasename}`"); ob_start(); CheckForDBUpgrades(); $output = ob_get_clean(); if ($output == '') { $adminoutput .= '<br />LimeSurvey Database is up to date. No action needed'; } else { $adminoutput .= $output; } $adminoutput .= "<br />Please <a href='{$homeurl}/{$scriptname}'>log in.</a>"; } echo $adminoutput;
$action=''; require_once($rootdir.'/classes/core/language.php'); $clang = new limesurvey_lang($defaultlang); include_once($homedir.'/update/updater.php'); if(isset($_GET['continue']) && $_GET['continue']==1) { echo getAdminHeader(); CheckForDBUpgrades(); echo "<br /><a href='$homeurl'>".$clang->gT("Back to main menu")."</a></div>"; updatecheck(); echo getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual")); } else { echo getAdminHeader(), '<div class="messagebox">',CheckForDBUpgrades(),'</div>', getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual")) ; } die; } if (is_dir($homedir."/install") && $debug<2) { die ("<p style='text-align: center; margin-left: auto; margin-right: auto; width: 500px; margin-top: 50px;'><img src='../images/limecursor-handle.png' /><strong>Congratulations</strong><br /><br />Your installation is now complete. The final step is to remove or rename the LimeSurvey installation directory (admin/install) on your server since it may be a security risk.<br /><br />Once this directory has been removed or renamed you will be able to log in to your new LimeSurvey Installation.<br /><br /><a href='admin.php'>Try again</a></p>"); } } //Admin menus and standards //IF THIS IS AN ADMIN SCRIPT, RUN THE SESSIONCONTROL SCRIPT if ($sourcefrom == "admin")
// Check if the DB is up to date if (!$dbexistsbutempty && $sourcefrom == 'admin') { $usrow = getGlobalSetting('DBVersion'); if (intval($usrow) < $dbversionnumber) { $action = ''; require_once $rootdir . '/classes/core/language.php'; $clang = new limesurvey_lang($defaultlang); include_once $homedir . '/update/updater.php'; if (isset($_GET['continue']) && $_GET['continue'] == 1) { echo getAdminHeader(); CheckForDBUpgrades(); echo "<br /><a href='{$homeurl}'>" . $clang->gT("Back to main menu") . "</a></div>"; updatecheck(); echo getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual")); } else { echo getAdminHeader(), '<div class="messagebox">', CheckForDBUpgrades(), '</div>', getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual")); } die; } if (is_dir($homedir . "/install") && $debug < 2) { die("<p style='text-align: center; margin-left: auto; margin-right: auto; width: 500px; margin-top: 50px;'><img src='../images/limecursor-handle.png' /><strong>Congratulations</strong><br /><br />Your installation is now complete. The final step is to remove or rename the LimeSurvey installation directory (admin/install) on your server since it may be a security risk.<br /><br />Once this directory has been removed or renamed you will be able to log in to your new LimeSurvey Installation.<br /><br /><a href='admin.php'>Try again</a></p>"); } } //Admin menus and standards //IF THIS IS AN ADMIN SCRIPT, RUN THE SESSIONCONTROL SCRIPT if ($sourcefrom == "admin") { include $homedir . "/sessioncontrol.php"; /** * @param string $htmlheader * This is the html header text for all administration pages *
$updateavailable = 0; $updatebuild = ''; $updateversion = ''; $updatelastcheck = ''; $updatekey = ''; $updatekeyvaliduntil = ''; require $homedir . '/globalsettings.php'; // Check if the DB is up to date if (!$dbexistsbutempty && $sourcefrom == 'admin') { $usrow = getGlobalSetting('DBVersion'); if (intval($usrow) < $dbversionnumber) { $action = ''; require_once $rootdir . '/classes/core/language.php'; $clang = new limesurvey_lang($defaultlang); include_once $homedir . '/update/updater.php'; $output = CheckForDBUpgrades(); echo $output; echo "<br /><a href='{$homeurl}'>" . $clang->gT("Back to main menu") . "</a>"; updatecheck(); die; } if (is_dir($homedir . "/install") && $debug < 2) { die("<p style='text-align: center; margin-left: auto; margin-right: auto; width: 500px; margin-top: 50px;'><img src='../images/limecursor-handle.png' /><strong>Congratulations</strong><br /><br />Your installation is now complete. The final step is to remove or rename the LimeSurvey installation directory (admin/install) on your server since it may be a security risk.<br /><br />Once this directory has been removed or renamed you will be able to log in to your new LimeSurvey Installation.<br /><br /><a href='admin.php'>Try again</a></p>"); } } //Admin menus and standards //IF THIS IS AN ADMIN SCRIPT, RUN THE SESSIONCONTROL SCRIPT if ($sourcefrom == "admin") { include $homedir . "/sessioncontrol.php"; /** * @param string $htmlheader