Ejemplo n.º 1
0
function reinitDB()
{
    global $db, $config, $adminPassword, $adminLogin;
    //Nettoyage des précedents tests en cas d'interuption
    dropDB();
    initDB();
    upgradeDB(FALSE);
    $ret = $db->query($sql = "INSERT " . $config['db']['prefix'] . "users VALUES (NULL, '{$adminLogin}','{$adminPassword}','',1);");
    return $ret;
}
Ejemplo n.º 2
0
 public function testInstallationDB()
 {
     global $db, $config, $adminPassword, $adminLogin;
     dropDB();
     $resInit = initDB();
     $this->assertNotEquals(FALSE, $resInit);
     $resPass = $db->query("INSERT " . $config['db']['prefix'] . "users VALUES (NULL, '{$adminLogin}','{$adminPassword}','',1);");
     $this->assertNotEquals(FALSE, $resPass);
     upgradeDB(FALSE);
     $result = $db->checkDB();
     reinitDB();
     $this->assertEquals(TRUE, $result);
 }
Ejemplo n.º 3
0
*/
include_once 'admin_header.php';
include_once SMARTSECTION_ROOT_PATH . "class/dbupdater.php";
$dbupdater = new SmartsectionDbupdater();
global $xoopsModule;
$module_id = $xoopsModule->getVar('mid');
$op = 'default';
if (isset($_REQUEST['op'])) {
    $op = $_REQUEST['op'];
}
switch ($op) {
    case "checkTables":
        checkTables();
        break;
    case "upgradeDB":
        upgradeDB();
        break;
    default:
        header("Location: " . SMARTSECTION_URL . "admin/index.php");
        break;
}
function checkTables()
{
    global $xoopsModule, $oAdminButton;
    xoops_cp_header();
    smartsection_adminmenu(-1, _AM_SSECTION_DB_CHECKTABLES);
    //1. Determine previous release
    if (!smartsection_TableExists('smartsection_meta')) {
        $ver = '0.93';
    } else {
        if (!($ver = smartsection_GetMeta('version'))) {