0byt3m1n1
Path:
/
data
/
applications
/
aps.bak
/
coppermine
/
1.5.12-0
/
standard
/
scripts
/
[
Home
]
File: configure
<?php ini_set('include_path', '.'); require_once('env-parser.php'); require_once('file-util.php'); require_once('db-util.php'); require_once('app-util.php'); require_once('upgrade-app.php'); $config_files = array( '/' => array( array('config.inc.php.in', 'include/config.inc.php')), '/cgi-bin' => array() ); $schema_files = array( 'schema.sql' => 'main', 'basic.sql' => 'main' ); $reconf_schema_files = array( 'reconfigure.sql' => 'main' ); $remove_schema_files = array( 'remove.sql' => 'main' ); $upgrade_schema_files = array( 'upgrade.sql' => 'main' ); $psa_params = array ( ); $db_ids = array ( 'main' ); $web_ids = array ( 'albums', '/' ); $settings_params = array ( 'admin_name', 'admin_password', 'admin_email', 'title', 'gallery_desc' ); $settings_enum_params = array ( 'theme' => array( 'curve' => 'curve', 'eyeball' => 'eyeball', 'hardwired' => 'hardwired', 'rainy_day' => 'rainy_day', 'sample' => 'sample', 'water_drop' => 'water_drop' ), 'locale' => array( 'ar-EG' => 'arabic', 'bg-BG' => 'bulgarian', 'zh-CN' => 'chinese_gb', 'cz-CZ' => 'czech', 'da-DK' => 'danish', 'nl-NL' => 'dutch', 'en-US' => 'english', 'en-UK' => 'english_gb', 'et-EE' => 'estonian', 'fi-FI' => 'finish', 'fr-FR' => 'french', 'fr-LU' => 'luxembourgish', 'de-DE' => 'german', 'de-SI' => 'german_formal', 'el-GR' => 'greek', 'hu-HU' => 'hungarian', 'ja-JP' => 'japanese', 'pl-PL' => 'polish', 'pt-BR' => 'brazilian_portuguese', 'ru-RU' => 'russian', 'sk-SK' => 'slovak', 'sl-SI' => 'slovenian', 'es-ES' => 'spanish', 'es-MX' => 'spanish_mx', 'tr-TR' => 'turkish', 'uk-UA' => 'ukrainian' ) ); $default_theme = 'curve'; $default_lang = 'english'; $crypt_settings_params = array ( ); $psa_modify_hash = get_psa_modify_hash($psa_params); $db_modify_hash = get_db_modify_hash($db_ids); $web_modify_hash = get_web_modify_hash($web_ids); $settings_modify_hash = get_settings_modify_hash($settings_params); $settings_enum_modify_hash = get_settings_enum_modify_hash($settings_enum_params); $crypt_settings_modify_hash = get_crypt_settings_modify_hash($crypt_settings_params); $additional_modify_hash = get_additional_modify_hash(); if(count($argv) < 2) { print "Usage: configure (install | upgrade <version> | configure | remove)\n"; exit(1); } $command = $argv[1]; if($command == "upgrade") { if($argv[2] && $argv[3]){ if ( ! strlen($settings_enum_modify_hash['@@THEME@@']) ) { $settings_enum_modify_hash['@@THEME@@'] = $default_theme; } if ( ! strlen($settings_enum_modify_hash['@@LOCALE@@']) ) { $settings_enum_modify_hash['@@LOCALE@@'] = $default_lang; } configure($config_files, $upgrade_schema_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash); define('SKIP_AUTHENTICATION', true); $curdir = getcwd(); chdir(get_web_dir("/")); include(get_web_dir("/")."/update.php"); chdir($curdir); //upgrade_app($argv[2], $argv[3], $config_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash); exit(0); } else{ print "Error: upgrade version or release not specified.\n"; exit(1); } } if($command == "install") { configure($config_files, $schema_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash); exit(0); } if($command == "remove") { remove_app($remove_schema_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash); exit(0); } if($command == "configure") { configure($config_files, $reconf_schema_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash); exit(0); } print "Error: unknown command $command.\n"; exit(1); ?>