HEX
Server: Apache
System: Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User: u41188965 (3074900)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //kunden/kunden/kunden/kunden/kunden/homepages/oneclick/phpBB/3.0.12/64/scripts/configure
<?php

error_reporting(E_ALL & ~E_WARNING);

ini_set('include_path', '.');
include_once 'env-variables.php';  // list of all teh encioremental variables
include_once 'functions.php'; // a list of functions for upgrade and install

if (count($argv) < 2) {
    print "Usage: configure (install | upgrade <version> | configure | remove)\n";
    exit(1);
}

$command = $argv[1];

if ($command == "install") {
    $source = "phpbbmysql.sql";
    if (!file_exists($source)) {
        echo("sql file not found;");
        exit(1);
    }
    $source2 = "phpbbDB.sql";
    if (!file_exists($source2)) {
        echo("sql file not found;");
        exit(1);
    }

    $user_obj = new my_user();
    $db_obj = new mysql_db_connect();
    $file_obj = new config_file();
    $util = new utility();


    system("mv -v " . webdir . "/install_pack/* " . webdir . "/");

    $db_obj->split_file($source);
    $db_obj->create_database();

    $db_obj->split_file($source2);
    $db_obj->create_database();

	
    $db_obj->rename_tables('phpbb_', table_prefix);
    $util->default_lang();
    $user_obj->insert_user();
    $util->website_name_description();
    $file_obj->create_configuration_file();

    system("rm -R " . webdir . "/install_pack");
    system("rm -R " . webdir . "/install");
} // done ok

if ($command == "upgrade") {
    $file = new config_file();
    $util = new utility();
    $db_obj = new mysql_db_connect();
    
    $prefix = $util->getprefix();
    if ($prefix != table_prefix) {
        $db_obj->rename_tables($prefix, table_prefix);
        system("rm -R " . webdir . "/config.php");
        $file->create_configuration_file();
    }
  
    shell_exec("php " . webdir . "/install/database_update.php");
    
    system("cp " . webdir . "/install_pack/styles/* " . webdir . "/styles/");

    try {
        $util->insert_lang();
        $file->delete_cache_files();
    } catch (Exception $ex) {
        echo $ex;
    }

    system("rm -R " . webdir . "/install");
    system("rm -R " . webdir . "/install_pack");
} 

if ($command == "configure") {
    $file_obj = new config_file();
    $util = new utility();

    $util->switch_mode();
    
    $user_obj = new my_user();
    
    $util->website_name_description();
    $user_obj->switch_user();
    $file_obj->delete_cache_files();
    $util->check_lang();
    
} // done to test

if ($command == "remove") {
    $db_obj = new mysql_db_connect();
    $util = new utility();
    $db_obj->get_tables_name(table_prefix);
    $db_obj->drop_tables();
}  // done ok