Esempio n. 1
0
require_once 'install/classes/class.phpconfig.php';
echo "- Source files loaded<br />";
if (!class_exists('filesystem')) {
    require_once 'install/classes/class.filesystem.php';
    $filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
    $filesystem->set_wd($config['ftp_path'], $config['fpath']);
}
if (!class_exists('DB')) {
    require_once 'install/classes/database/' . $config['dbsystem'] . '.inc.php';
    $db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['dbprefix']);
    $db->setPersistence($config['pconnect']);
}
echo "- FTP class loaded, Database connection started.<br />";
// Hooks
$hooks = array_map('trim', file('admin/data/hooks.txt'));
removeHook($hooks, 'pdf');
$filesystem->file_put_contents('admin/data/hooks.txt', implode("\r\n", $hooks));
echo "- Hooks updated.<br />";
// Config
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('fname', str, htmlentities($config['fname'], ENT_QUOTES));
$c->updateconfig('fdesc', str, htmlentities($config['fdesc'], ENT_QUOTES));
$c->updateconfig('always_send_js', int, 1);
$c->updateconfig('vote_change', int, 0);
$c->updateconfig('botgfxtest_width', int, 150);
$c->updateconfig('botgfxtest_height', int, 40);
$c->updateconfig('botgfxtest_recaptcha_private', str, '');
$c->updateconfig('botgfxtest_recaptcha_public', str, '');
$c->delete('pdfcompress');
Esempio n. 2
0
echo "- Source files loaded<br />";
if (!class_exists('filesystem')) {
    require_once 'install/classes/class.filesystem.php';
    $filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
    $filesystem->set_wd($config['ftp_path'], $config['fpath']);
}
if (!class_exists('DB')) {
    require_once 'install/classes/database/' . $config['dbsystem'] . '.inc.php';
    $db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['dbprefix']);
    $db->setPersistence($config['pconnect']);
}
echo "- FTP class loaded, Database connection started.<br />";
// Hooks (ToDo: this sould be done in one step!)
$hooks = array_map('trim', file('admin/data/hooks.txt'));
removeHook($hooks, 'pdf');
removeHook($hooks, 'components_');
$hooks[] = '';
$hooks[] = 'admin/packages_admin.php';
$filesystem->file_put_contents('admin/data/hooks.txt', implode("\r\n", $hooks));
$hooks = file_get_contents('admin/data/hooks.txt');
$add_com = array('components.php');
$add_acom = array('admin/packages_admin.php');
$result = $db->query("SELECT internal FROM {$db->pre}packages");
while ($row = $db->fetch_assoc($result)) {
    $internal = preg_quote($row['internal'], "~");
    if (!preg_match("~^-component_{$internal}\$~im", $hooks)) {
        $add_com[] = "-component_{$row['internal']}";
    }
    if (!preg_match("~^-admin_component_{$internal}\$~im", $hooks)) {
        $add_acom[] = "-admin_component_{$row['internal']}";
    }
Esempio n. 3
0
if (!class_exists('filesystem')) {
    require_once 'install/classes/class.filesystem.php';
    $filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
    $filesystem->set_wd($config['ftp_path'], $config['fpath']);
}
if (!class_exists('DB')) {
    require_once 'install/classes/database/' . $config['dbsystem'] . '.inc.php';
    $db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['dbprefix']);
    $db->setPersistence($config['pconnect']);
}
echo "- FTP class loaded, Database connection started.<br />";
// Hooks
$hooks = array_map('trim', file('admin/data/hooks.txt'));
removeHook($hooks, 'editprofile_copy_');
removeHook($hooks, 'popup_hlcode_');
removeHook($hooks, 'popup_code_');
insertHookAfter($hooks, 'showtopic_entry_added', 'showtopic_attachments_prepared');
$filesystem->file_put_contents('admin/data/hooks.txt', implode("\r\n", $hooks));
echo "- Hooks updated.<br />";
// Config
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('doclang', int, $config['langdir']);
$c->updateconfig('error_reporting', str, 'E_ALL');
$c->updateconfig('login_attempts_blocktime', int, 60);
$c->updateconfig('login_attempts_max', int, 5);
$c->updateconfig('login_attempts_time', int, 60);
$c->delete('check_filesystem');
$c->delete('enable_jabber');
$c->delete('jabber_server');