Example #1
0
function start_update()
{
    // The updater
    html_header("Coppermine - Upgrade");
    html_logo();
    test_fs();
    if ($errors != '') {
        html_prereq_errors($errors);
    } else {
        test_sql_connection();
        if ($errors == '') {
            update_tables();
            update_system_thumbs();
        } else {
            html_error($errors);
        }
        if ($errors == '') {
            html_install_success($notes);
            session_destroy();
        } else {
            html_error($errors);
        }
    }
    html_footer();
}
Example #2
0
function start_update()
{
    global $errors, $notes, $lang_update_php, $LINEBREAK;
    global $update_icon, $ok_icon, $already_done_icon, $error_icon, $file_system_icon;
    // The updater
    //html_header($lang_update_php['title']);
    test_sql_connection();
    if (function_exists('cpg_fetch_icon')) {
        $update_icon = cpg_fetch_icon('update_database', 2);
        $ok_icon = cpg_fetch_icon('ok', 2);
        $already_done_icon = cpg_fetch_icon('info', 2);
        $error_icon = cpg_fetch_icon('stop', 2);
        $file_system_icon = cpg_fetch_icon('hdd', 2);
    } else {
        $update_icon = '';
        $ok_icon = '';
        $already_done_icon = '';
        $error_icon = '';
        $file_system_icon = '';
    }
    if ($errors == '') {
        echo '        <table border="0" cellspacing="0" cellpadding="0" class="maintable">' . $LINEBREAK;
        update_tables();
        update_files();
        echo '        </table>' . $LINEBREAK;
    } else {
        html_error($errors);
    }
    if ($errors == '') {
        html_install_success($notes);
        session_destroy();
    } else {
        html_error($errors);
    }
    //html_footer();
}
 public function step3()
 {
     if (session('step') != 2) {
         $this->redirect('step2');
     }
     $this->display();
     if (session('update')) {
         $db = Db::getInstance();
         //更新数据表
         update_tables($db, C('DB_PREFIX'));
     } else {
         //连接数据库
         $dbconfig = session('db_config');
         $db = Db::getInstance($dbconfig);
         //创建数据表
         create_tables($db, $dbconfig['DB_PREFIX']);
         //注册创始人帐号
         $auth = build_auth_key();
         $admin = session('admin_info');
         register_administrator($db, $dbconfig['DB_PREFIX'], $admin, $auth);
         //创建配置文件
         $conf = write_config($dbconfig, $auth);
         session('config_file', $conf);
     }
     if (session('error')) {
         //show_msg();
     } else {
         session('step', 3);
         $this->redirect('Index/complete');
     }
 }
Example #4
0
        }
    }
    echo "</table>";
}
// --------------------------------- MAIN CODE ----------------------------- //
// The defaults values
$table_prefix = $_POST['table_prefix'];
$DFLT = array('cfg_d' => 'include', 'cfg_f' => 'include/config.inc.php', 'alb_d' => 'albums', 'upl_d' => 'userpics');
$errors = '';
$notes = '';
// The installer
html_header("Coppermine - Upgrade");
html_logo();
test_fs();
if ($errors != '') {
    html_prereq_errors($errors);
} else {
    test_sql_connection();
    if ($errors == '') {
        update_tables();
        update_system_thumbs();
    } else {
        html_error($errors);
    }
    if ($errors == '') {
        html_install_success($notes);
    } else {
        html_error($errors);
    }
}
html_footer();
Example #5
0
function fncDisply()
{
    $retval = "";
    $retval .= "<!DOCTYPE    HTML PUBLIC '-//W3C//DTD HTML   4.01 Transitional//EN'>" . LB;
    $retval .= "<html>" . LB;
    $retval .= "<head>" . LB;
    $retval .= "    <title>UserBox update tables</title>" . LB;
    $retval .= "</head>" . LB;
    $retval .= "<body   bgcolor='#ffffff'>" . LB;
    $retval .= "<h1>UserBox update tables. </h1>" . LB;
    $retval .= "<form action=" . "'" . THIS_SCRIPT . "'" . "method='post'>" . LB;
    $retval .= "    <input type='submit' name='action' value='submit'>" . LB;
    $retval .= "    <input type='submit' name='action' value='cancel'>" . LB;
    $retval .= "</form>" . LB;
    $retval .= "</body>" . LB;
    $retval .= "</html>" . LB;
    return $retval;
}
$action = "";
if (isset($_REQUEST['action'])) {
    $action = COM_applyFilter($_REQUEST['action'], false);
}
$display = "";
if ($action == "") {
    $display = fncDisply();
} elseif ($action == "submit") {
    $display = update_tables();
} else {
    $display = "cancel!";
}
echo $display;
 public function step3()
 {
     if (session('step') != 2) {
         $this->redirect('step2');
     }
     $this->display();
     if (session('update')) {
         $db = Db::getInstance();
         //更新数据表
         update_tables($db, C('DB_PREFIX'));
     } else {
         //连接数据库
         $dbconfig = session('db_config');
         $db = Db::getInstance($dbconfig);
         //创建数据表
         create_tables($db, $dbconfig['DB_PREFIX']);
         //注册创始人帐号
         $admin = session('admin_info');
         $admin['password'] = md5($admin['password']);
         register_administrator($db, $dbconfig['DB_PREFIX'], $admin, $auth);
         //创建配置文件
         $conf = write_config($dbconfig, $auth);
         session('config_file', $conf);
     }
     if (session('error')) {
         //show_msg();
     } else {
         session('step', 3);
         Storage::put(APP_PATH . 'Common/Conf/install.lock', 'lock');
         $this->redirect('Index/complete');
     }
 }