Ejemplo n.º 1
0
 *
 *   Installer2 - Database Script File
 *   $Id$
 *
 */
# Database scripts expect the following:
#  - $dbconfig (config.inc.php) loaded
#  - All bhdb_* functions loaded
#  - configfunc.inc.php loaded
# 2.1b -> 2.1g
# Import filecodes and users into memory
$filecoderows = select_bhdb("filecodes", "", "");
$userrows = select_bhdb("users", "", "");
# Remove old tables
drop_bhdb("filecodes");
drop_bhdb("users");
$insttables['filecodes'] = array("filecode" => array("type" => "varchar"), "filepath" => array("type" => "text"), "expires" => array("type" => "varchar"), "username" => array("type" => "varchar"), "email" => array("type" => "text"), "notify" => array("type" => "varchar"));
$insttables['log'] = array("entryid" => array("type" => "varchar"), "time" => array("type" => "varchar"), "username" => array("type" => "varchar"), "ip" => array("type" => "varchar"), "type" => array("type" => "varchar"), "page" => array("type" => "text"), "filepath" => array("type" => "text"), "data" => array("type" => "text"));
$insttables['users'] = array("username" => array("type" => "varchar"), "password" => array("type" => "varchar"), "homedir" => array("type" => "text"), "type" => array("type" => "varchar"), "disabled" => array("type" => "varchar"), "quota" => array("type" => "varchar"));
$insttables['filecodereminders'] = array("filecode" => array("type" => "varchar"), "remindat" => array("type" => "varchar"));
$insttables['satellitetransfers'] = array("transferid" => array("type" => "varchar"), "file" => array("type" => "text"), "offset" => array("type" => "varchar"), "length" => array("type" => "varchar"));
# Add them
foreach ($insttables as $tablename => $tablecontent) {
    $result = create_bhdb($tablename, $tablecontent);
    if ($result === FALSE) {
        $errors[] = $dbmoderror;
    }
}
# Correct them & add
foreach ($filecoderows as $key => $filecoderow) {
    $filecoderow['notify'] = 0;
Ejemplo n.º 2
0
 * ByteHoard 2.1
 * Copyright (c) Andrew Godwin & contributors 2004
 *
 *   Installer2 - Database Script File
 *   $Id$
 *
 */
# Database scripts expect the following:
#  - $dbconfig (config.inc.php) loaded
#  - All bhdb_* functions loaded
#  - configfunc.inc.php loaded
# 2.1a -> 2.1b
# Import filecodes into memory
$filecoderows = select_bhdb("filecodes", "", "");
# Remove old filecodes table
drop_bhdb("filecodes");
$insttables['modulesdirectory'] = array("module" => array("type" => "varchar"), "status" => array("type" => "varchar"));
$insttables['packages'] = array("code" => array("type" => "varchar"), "name" => array("type" => "varchar"), "description" => array("type" => "text"), "version" => array("type" => "varchar"), "type" => array("type" => "varchar"));
$insttables['passwordresets'] = array("username" => array("type" => "varchar"), "resetid" => array("type" => "varchar"), "time" => array("type" => "varchar"));
$insttables['registrations'] = array("regid" => array("type" => "varchar"), "username" => array("type" => "varchar"), "password" => array("type" => "varchar"), "email" => array("type" => "text"), "fullname" => array("type" => "text"), "status" => array("type" => "varchar"), "regtime" => array("type" => "varchar"));
$insttables['filecodes'] = array("filecode" => array("type" => "varchar"), "filepath" => array("type" => "text"), "expires" => array("type" => "varchar"), "username" => array("type" => "varchar"), "email" => array("type" => "text"));
# Add them
foreach ($insttables as $tablename => $tablecontent) {
    $result = create_bhdb($tablename, $tablecontent);
    if ($result === FALSE) {
        $errors[] = $dbmoderror;
    }
}
# Right. Now add New Stuff (TM)
insert_bhdb("logactions", array("type" => "BH_SIGNUP_VALIDATED", "action" => "logtofile"));
insert_bhdb("logactions", array("type" => "BH_SIGNUP_M_PENDING", "action" => "emailtype", "parameters" => "admin"));