Пример #1
0
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->savedata();
echo "- Configuration updated.<br />";
// Languages
$ini = array('settings' => array('language_de' => array('compatible_version' => VISCACHA_VERSION), 'language' => array('compatible_version' => VISCACHA_VERSION)), 'admin/frames' => array('language_de' => array('admin_scheduler_log' => 'Protokoll der geplanten Aufgaben')), 'classes' => array('language_de' => array('mailer_encoding' => 'Unbekanntes Encoding-Format: ', 'mailer_execute' => 'Konnte folgenden Befehl nicht ausf&uuml;hren: ', 'mailer_file_access' => 'Zugriff auf folgende Datei fehlgeschlagen: ', 'mailer_file_open' => 'Datei Fehler: Konnte folgende Datei nicht &ouml;ffnen: ', 'mailer_from_failed' => 'Die folgende Absenderadresse ist nicht korrekt: ', 'mailer_recipients_failed' => 'SMTP Fehler: Die folgenden Empf&auml;nger sind nicht korrekt: ', 'mailer_signing' => 'Fehler beim Signieren: ', 'mailer_empty_message' => 'E-Mail Inhalt ist leer.', 'mailer_invalid_address' => 'E-Mail wird nicht gesendet, die Adresse ist ung&uuml;ltig.', 'mailer_smtp_connect_failed' => 'Verbindung zu SMTP Server fehlgeschlagen.', 'mailer_smtp_error' => 'Fehler vom SMTP Server: ', 'mailer_variable_set' => 'Kann Variable nicht setzen oder zur&uuml;cksetzen: '), 'language' => array('mailer_authenticate' => 'SMTP Error: Could not authenticate.', 'mailer_connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'mailer_data_not_accepted' => 'SMTP Error: Data not accepted.', 'mailer_encoding' => 'Unknown encoding: ', 'mailer_execute' => 'Could not execute: ', 'mailer_file_access' => 'Could not access file: ', 'mailer_file_open' => 'File Error: Could not open file: ', 'mailer_from_failed' => 'The following From address failed: ', 'mailer_instantiate' => 'Could not instantiate mail function.', 'mailer_mailer_not_supported' => ' mailer is not supported.', 'mailer_provide_address' => 'You must provide at least one recipient email address.', 'mailer_recipients_failed' => 'SMTP Error: The following recipients failed: ', 'mailer_empty_message' => 'Message body empty', 'mailer_invalid_address' => 'Invalid address', 'mailer_smtp_connect_failed' => 'SMTP Connect() failed.', 'mailer_smtp_error' => 'SMTP server error: ', 'mailer_variable_set' => 'Cannot set or reset variable: ')), 'global' => array('language_de' => array('digest_d' => 'Tägliche E-Mail-Benachrichtigung', 'digest_none' => 'Keine Benachrichtigung', 'img_captcha_session_expired_error' => 'Seite aktualisieren', 'digest_f' => 'Nur Favorit'), 'language' => array('digest_none' => 'No notification', 'img_captcha_session_expired_error' => 'Refresh page', 'digest_f' => 'Favorite only')));
updateLanguageFiles($ini);
echo "- Language files updated.<br />";
$newCss = file_get_contents('temp/standard.css');
$dir = dir('designs');
while (false !== ($entry = $dir->read())) {
    if (is_id($entry)) {
        $path = "{$dir->path}/{$entry}/standard.css";
        $css = file_get_contents($path);
        if (!empty($css)) {
            $css .= $newCss;
            if (!$filesystem->file_put_contents($path, $css)) {
                $css = null;
            }
        }
        if (empty($css)) {
            echo "<br />!!! <strong>Warning:</strong> Updating {$path} failed. Plase add the following CSS code to your main css file in designs/{$entry}:<br /><code>";
            echo htmlentities($newCss);
            echo "</code><br /><br />";
        }
    }
}
echo "- Stylesheets updated.<br />";
// Set incompatible packages inactive
setPackagesInactive();
echo "- Incompatible Packages set as 'inactive'.<br />";
// Refresh Cache
Пример #2
0
echo "- FTP class loaded, Database connection started.<br />";
// Config/Hooks
$c = new manageconfig();
$c->getdata('../data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->delete('asia');
$c->savedata();
$c = new manageconfig();
$c->getdata('../admin/data/config.inc.php', 'admconfig');
$c->updateconfig('default_language', int, 0);
$c->updateconfig('checked_package_updates', int, 0);
$c->savedata();
$hooks = file_get_contents('../admin/data/hooks.txt');
if (strpos($hooks, "-update") === false) {
    $hooks = str_replace("-uninstall", "-uninstall\r\n-update_init\r\n-update_finish", $hooks);
    $filesystem->file_put_contents('../admin/data/hooks.txt', $hooks);
}
echo "- Configuration and Hooks updated.<br />";
// Old files
$filesystem->unlink('../classes/class.imageconverter.php');
echo "- Old files deleted.<br />";
// Stylesheets
$dir = dir('../designs/');
while (false !== ($entry = $dir->read())) {
    $path = $dir->path . DIRECTORY_SEPARATOR . $entry . DIRECTORY_SEPARATOR;
    if (is_dir($path) && is_numeric($entry) && $entry > 0) {
        if (file_exists($path . 'standard.css')) {
            $file = file_get_contents($path . 'standard.css');
            $file .= "\r\n.tooltip {\r\n\tleft: -1000px;\r\n\ttop: -1000px;\r\n\tvisibility: hidden;\r\n\tposition: absolute;\r\n\tmax-width: 300px;\r\n\tmax-height: 300px;\r\n\toverflow: auto;\r\n\tborder: 1px solid #336699;\r\n\tbackground-color: #ffffff;\r\n\tfont-size: 8pt;\r\n}\r\n";
            $file .= "\r\n.tooltip_header {\r\n\tdisplay: block;\r\n\tbackground-color: #E1E8EF;\r\n\tcolor: #24486C;\r\n\tpadding: 3px;\r\n\tborder-bottom: 1px solid #839FBC;\r\n}\r\n";
            $file .= "\r\n.tooltip_body {\r\n\tpadding: 3px;\r\n}\r\n";
Пример #3
0
        while (false !== ($entry = $dir->read())) {
            if (is_id($entry) && is_dir($rep[1] . '/' . $entry)) {
                $dirs[$rep[1]][$entry] = $rep[1] . '/' . $entry . '/';
            }
        }
        $dir->close();
    }
    $content = file_get_contents($rep[0]);
    foreach ($dirs[$rep[1]] as $path) {
        $target = $path . $rep[3];
        if (file_exists($target)) {
            $filesystem->chmod($target, 0666);
        } elseif (!@is_dir(dirname($target))) {
            $filesystem->mkdir(dirname($target), 0777);
        }
        $filesystem->file_put_contents($target, $content);
    }
}
?>
<div class="bfoot">Source file updater - Step <?php 
echo $sub;
?>
 of <?php 
echo count($tar_packs);
?>
 - Currently extracting: <?php 
echo $tar_packs[$sub];
?>
</div>
<?php 
if ($error === false) {
include_once "classes/class.breadcrumb.php";
// Global functions
require_once "classes/function.global.php";
// Load Flood-Check
include_once "classes/function.flood.php";
if (!file_exists('.htaccess')) {
    $htaccess = '';
    if ($config['hterrordocs'] == 1) {
        $htaccess = "\n\t    ErrorDocument 400\t{$config['furl']}/misc.php?action=error&id=400\n\t    ErrorDocument 401\t{$config['furl']}/misc.php?action=error&id=401\n\t    ErrorDocument 403\t{$config['furl']}/misc.php?action=error&id=403\n\t    ErrorDocument 404\t{$config['furl']}/misc.php?action=error&id=404\n\t    ErrorDocument 500\t{$config['furl']}/misc.php?action=error&id=500\n\t    ";
    }
    if ($config['correctsubdomains'] == 1) {
        $url = parse_url($config['furl']);
        $host = str_ireplace('www.', '', $url['host']);
        $htaccess .= "\n\t    RewriteEngine On\n\t    RewriteCond %{HTTP_HOST} ^www\\." . preg_quote($host) . "\$ [NC]\n\t    RewriteRule ^(.*)\$ http://" . $host . "/\$1 [R=301,L]\n\t    ";
    }
    $filesystem->file_put_contents('.htaccess', $htaccess);
}
$breadcrumb = new breadcrumb();
$breadcrumb->Add($config['fname'], 'index.php');
$phpdoc = new OutputDoc($config['gzip']);
$phpdoc->Start($config['gzcompression']);
if ($config['gzip'] == 1 && $phpdoc->Encoding()) {
    $gzbenchval = 'On - Compression Rate: ' . $config['gzcompression'];
} else {
    $gzbenchval = 'Off';
}
($code = $plugins->load('frontend_init')) ? eval($code) : null;
if ($config['foffline'] && defined('TEMPSHOWLOG') == false && SCRIPTNAME != 'external') {
    $slog = new slog();
    $my = $slog->logged();
    $my->p = $slog->Permissions();
Пример #5
0
    $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');
$c->delete('jabber_user');
$c->delete('jabber_pass');
Пример #6
0
// templates
$dir = "../templates/";
$tplids = array();
$d = dir($dir);
while (false !== ($entry = $d->read())) {
    if (is_dir($dir . $entry) && preg_match('/^\\d{1,}$/', $entry) && $entry != '.' && $entry != '..') {
        $tplids[] = $entry;
    }
}
$d->close();
foreach ($tplids as $id) {
    $tpldir = $dir . $id;
    $filesystem->chmod($tpldir . '/header.html', 0666);
    $header = file_get_contents($tpldir . '/header.html');
    $header = str_ireplace("<!--[if lt IE 7]>", "<!--[if IE]>", $header);
    $filesystem->file_put_contents($tpldir . '/header.html', $header);
}
echo "- Templates updated.<br />";
$ini = array('global' => array('language' => array('post_settings' => 'Options:', 'pm_not_found' => 'Private Message not found.'), 'language_de' => array('register_resend_desc' => 'Sollten Sie sich bereits registriert - aber den Bestätigungslink der Registrierungs-E-Mail noch nicht angeklickt haben, konnte Ihre Registrierung nicht vollständig abgeschlossen werden. Sie haben hier die Möglichkeit, Ihnen diese E-Mail erneut zuschicken zu lassen, ohne den Registrierungsvorgang wiederholen zu müssen. Dazu tragen Sie lediglich den bereits von Ihnen beantragten Benutzernamen ein - und die E-Mail wird Ihnen erneut an Ihre bereits bei der Registrierung angegebene E-Mail-Adresse übersandt.', 'pm_not_found' => 'Die PN wurde nicht gefunden.')));
$c = new manageconfig();
$codes = array();
$keys = array('language', 'language_de');
foreach ($keys as $entry) {
    if (preg_match('~language_(\\w{2})_?(\\w{0,2})~i', $entry, $code)) {
        if (!isset($codes[$code[1]])) {
            $codes[$code[1]] = array();
        }
        if (isset($code[2])) {
            $codes[$code[1]][] = $code[2];
        } else {
            if (!in_array('', $codes[$code[1]])) {
Пример #7
0
$c = new manageconfig();
$c->getdata('../data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('disableregistration', int, 0);
$c->updateconfig('hidedesign', int, 0);
$c->updateconfig('hidelanguage', int, 0);
$c->updateconfig('mlist_fields', str, 'fullname,pm,regdate,hp,icq,yahoo,aol,msn,jabber,skype');
$c->updateconfig('mlist_filtergroups', int, 0);
$c->updateconfig('mlist_showinactive', int, 0);
$c->updateconfig('register_notification', str, '');
$c->updateconfig('updatepostcounter', int, 1);
$c->savedata();
$d = file('../data/cron/crontab.inc.php');
$d = array_map('trim', $d);
$d[] = '0	*/6	*	*	*	recountpostcounts.php	#Recount User Post Counter';
$filesystem->file_put_contents('../data/cron/crontab.inc.php', implode("\n", $d));
$filesystem->unlink('../images/1/bbcodes/wiki.gif');
$db->query("ALTER TABLE `{$db->pre}forums` ADD `count_posts` enum('0','1') NOT NULL default '1' AFTER `last_topic`", __LINE__, __FILE__);
$db->query("ALTER TABLE `{$db->pre}user` ADD `posts` mediumint(7) unsigned NOT NULL default '0' AFTER `regdate`", __LINE__, __FILE__);
// Update Postcounts
$result = $db->query("SELECT COUNT(*) AS new, u.posts, u.id FROM {$db->pre}replies AS r LEFT JOIN {$db->pre}user AS u ON u.id = r.name WHERE r.guest = '0' GROUP BY u.id", __LINE__, __FILE__);
$i = 0;
while ($row = $db->fetch_assoc($result)) {
    if ($row['new'] != $row['posts']) {
        $i++;
        $db->query("UPDATE {$db->pre}user SET posts = '{$row['new']}' WHERE id = '{$row['id']}'", __LINE__, __FILE__);
    }
}
// Refresh Cache
$dirs = array('../cache/', '../cache/modules/');
foreach ($dirs as $dir) {
Пример #8
0
    }
}
// Cache löschen
$cachedir = 'cache/';
if ($dh = @opendir($dir)) {
    while (($file = readdir($dh)) !== false) {
        if (strpos($file, '.inc.php') !== false) {
            $fileTrim = str_replace('.inc.php', '', $file);
            $filesystem->unlink($cachedir . $file);
        }
    }
    closedir($dh);
}
if (count($error) == 0) {
    $lf = './locked.txt';
    $filesystem->file_put_contents($lf, '');
    ?>
<div class="bbody">
<p>The installation is completed. You can access the Admin Control Panel with your username and password.
Please go through the settings and change everything to fit your needs.
After doing this, you can switch your board "online". By default it is switched "offline".
If you have problems, visit <a href="http://docs.viscacha.org" target="_blank">Viscacha.org</a>.</p>
<p class="hl_false">
For your server security please completely remove the installation directory (<code><?php 
    echo realpath('./');
    ?>
</code>) including all files and sub-folders!
<?php 
    if (file_exists($lf)) {
        ?>
It is locked at the moment, but we highly recommend to remove the directory.
Пример #9
0
    $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']}";
    }
}
if (count($add_com) > 1) {
    $hooks = preg_replace("~^components.php\$~im", implode("\r\n", $add_com), $hooks);
Пример #10
0
$c->updateconfig('spider_pendinglist', int, 0);
$c->updateconfig(array('module_1', 'relatednum'), int, 5);
$c->updateconfig(array('module_3', 'items'), int, 5);
$c->updateconfig(array('module_3', 'teaserlength'), int, 300);
$c->updateconfig(array('module_4', 'title'), str, 'Ticker');
$c->updateconfig(array('module_4', 'feed'), int, 1);
$c->updateconfig(array('module_7', 'text'), str, 'Willkommen in Ihrer <a href="http://www.viscacha.org" target="_blank">Viscacha</a>-Installation!');
$c->updateconfig(array('module_7', 'title'), str, 'Wichtige Nachricht!');
$c->updateconfig(array('module_9', 'topicnum'), int, 10);
$c->updateconfig(array('module_10', 'repliesnum'), int, 5);
$c->savedata();
$filesystem->unlink('../admin/form.php');
$filesystem->unlink('../templates/newsfeed.js');
rmdirr('../classes/magpie_rss/extlib/');
$filesystem->mkdir('../cache/modules/', 0777);
$filesystem->file_put_contents('../data/errlog_php.inc.php', '');
$db->query("ALTER TABLE `{$db->pre}abos` CHANGE `type` `type` ENUM( '', 'd', 'w', 'f' ) NOT NULL", __LINE__, __FILE__, false);
$result = $db->query("SELECT mid, tid FROM {$db->pre}fav", __LINE__, __FILE__, false);
while ($row = $db->fetch_assoc($result)) {
    $db->query("INSERT INTO `{$db->pre}abos` (`mid`, `tid`, `type`) VALUES ('{$row['mid']}', '{$row['tid']}', 'f')", __LINE__, __FILE__, false);
}
$db->query("DROP TABLE `{$db->pre}fav`", __LINE__, __FILE__, false);
$db->query("ALTER TABLE `{$db->pre}bbcode` CHANGE `type` `type` ENUM('censor','word','replace') NOT NULL DEFAULT 'word'", __LINE__, __FILE__, false);
$db->query("ALTER TABLE `{$db->pre}bbcode` RENAME `{$db->pre}textparser`", __LINE__, __FILE__, false);
$db->query("DROP TABLE `{$db->pre}bbcode`", __LINE__, __FILE__, false);
$db->query("ALTER TABLE `{$db->pre}cat` ADD `forumzahl` tinyint(3) unsigned NOT NULL default '0' AFTER `optvalue`", __LINE__, __FILE__, false);
$db->query("ALTER TABLE `{$db->pre}cat` ADD `topiczahl` tinyint(3) unsigned NOT NULL default '0' AFTER `forumzahl`", __LINE__, __FILE__, false);
$db->query("ALTER TABLE `{$db->pre}cat` ADD `invisible` enum('0','1') NOT NULL default '0' AFTER `prefix`", __LINE__, __FILE__, false);
$db->query("ALTER TABLE `{$db->pre}cat` ADD INDEX ( `last_topic` )", __LINE__, __FILE__, false);
$db->query("ALTER TABLE `{$db->pre}designs` DROP COLUMN `smileyfolder`", __LINE__, __FILE__, false);
$db->query("ALTER TABLE `{$db->pre}designs` DROP COLUMN `smileypath`", __LINE__, __FILE__, false);
Пример #11
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
$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');
$c->delete('pdfdownload');
Пример #12
0
    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, 'components_');
$hooks[] = '';
$hooks[] = 'admin/packages_admin.php';
$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('spider_logvisits', int, 2);
$c->delete('always_send_js');
$c->savedata();
$c = new manageconfig();
$c->getdata('admin/data/config.inc.php', 'admconfig');
$c->updateconfig('checked_package_updates', int, 0);
$c->savedata();
echo "- Configuration updated.<br />";
// Old files
$filesystem->unlink('templates/lang2js.php');
Пример #13
0
      'compatible_version' => VISCACHA_VERSION,
    ),
  )
);
updateLanguageFiles($ini);

$dir = dir('language');
while (false !== ($entry = $dir->read())) {
	$path = "{$dir->path}/{$entry}";
	if (is_dir($path) && is_id($entry)) {
		$lng_settings = loadSettingArray($path);
		if ($lng_settings['lang_code'] != 'de') {
			$lng_settings['lang_code'] = 'en';
		}
		$filesystem->file_put_contents(
			"{$path}/mails/digest_d.php",
			file_get_contents('install/package/update_08/language/'.$lng_settings['lang_code'].'/digest_d.php')
		);
		$filesystem->file_put_contents(
			"{$path}/mails/digest_w.php",
			file_get_contents('install/package/update_08/language/'.$lng_settings['lang_code'].'/digest_w.php')
		);
		$filesystem->file_put_contents(
			"{$path}/mails/digest_s.php",
			file_get_contents('install/package/update_08/language/'.$lng_settings['lang_code'].'/digest_s.php')
		);
		$filesystem->file_put_contents(
			"{$path}/mails/report_post.php",
			file_get_contents('install/package/update_08/language/'.$lng_settings['lang_code'].'/report_post.php')
		);
	}
}
Пример #14
0
    } else {
        $config['dbsystem'] = 'mysql';
    }
    $c = new manageconfig();
    $c->getdata('../data/config.inc.php');
    $c->updateconfig('host', str);
    $c->updateconfig('dbuser', str);
    $c->updateconfig('dbpw', str);
    $c->updateconfig('database', str);
    $c->updateconfig('pconnect', int);
    $c->updateconfig('dbprefix', str);
    $c->updateconfig('dbsystem', str);
    $c->savedata();
    $errlog = '../data/errlog_' . $config['dbsystem'] . '.inc.php';
    if (!file_exists($errlog)) {
        $filesystem->file_put_contents($errlog, '');
        $filesystem->chmod($errlog, 0666);
    }
    ?>
<div class="bfoot center">Database Settings saved!</div>
<?php 
}
require '../data/config.inc.php';
$prefix = preg_replace("/\\W+/i", '', $config['dbprefix']);
if ($prefix != $config['dbprefix']) {
    ?>
<div class="bbody">The prefix is not valid!</div>
<div class="bfoot center"><a class="submit" href="index.php?package=install&amp;step=<?php 
    echo $step - 1;
    ?>
">Go back</a> <a class="submit" href="index.php?package=install&amp;step=<?php 
Пример #15
0
    }
}
// Cache löschen
$cachedir = 'cache/';
if ($dh = @opendir($dir)) {
    while (($file = readdir($dh)) !== false) {
        if (strpos($file, '.inc.php') !== false) {
            $fileTrim = str_replace('.inc.php', '', $file);
            $filesystem->unlink($cachedir . $file);
        }
    }
    closedir($dh);
}
if (count($error) == 0) {
    $lf = './locked.txt';
    $filesystem->file_put_contents($lf, '', true);
    ?>
<div class="bbody">
<p>The installation is completed. You can access the Admin Control Panel with your username and password.
Please go through the settings and change everything to fit your needs.
After doing this, you can switch your board "online". By default it is switched "offline".
If you have problems, visit <a href="http://docs.viscacha.org" target="_blank">Viscacha.org</a>.</p>
<p class="hl_false">
For your server security please completely remove the installation directory (<addr><?php 
    echo realpath('./install/');
    ?>
</addr>) including all files and sub-folders!
<?php 
    if (file_exists($lf)) {
        ?>
It is locked at the moment, but we highly recommend to remove the directory.
        // 401 ErrorDocument entfernt wegen Fehlermeldung (Bug #293): "Cannot use a full URL in a 401 ErrorDocument directive"
        // Grund: Relative Angaben beschädigen bei Adressen in Unterverzeichnissen die relativen Verlinkungen zu Bildern etc.
        $htaccess[] = "ErrorDocument 403\t{$config['furl']}/misc.php?action=error&id=403";
        $htaccess[] = "ErrorDocument 404\t{$config['furl']}/misc.php?action=error&id=404";
        $htaccess[] = "ErrorDocument 500\t{$config['furl']}/misc.php?action=error&id=500";
        $htaccess[] = "";
    }
    if ($config['correctsubdomains'] == 1) {
        $url = parse_url($config['furl']);
        $host = str_ireplace('www.', '', $url['host']);
        $htaccess[] = "RewriteEngine On";
        $htaccess[] = "RewriteCond %{HTTP_HOST} ^www\\." . preg_quote($host) . "\$ [NC]";
        $htaccess[] = "RewriteRule ^(.*)\$ http://" . $host . "/\$1 [R=301,L]";
        $htaccess[] = "";
    }
    $filesystem->file_put_contents('.htaccess', implode("\r\n", $htaccess));
}
$breadcrumb = new breadcrumb();
$breadcrumb->Add($config['fname'], 'index.php');
$phpdoc = new OutputDoc($config['gzip']);
$phpdoc->Start($config['gzcompression']);
define('PAGE_IS_GZIPPED', $config['gzip'] == 1 && $phpdoc->Encoding());
($code = $plugins->load('frontend_init')) ? eval($code) : null;
// Global and important functions (not for cron and external)
if (defined('TEMPNOFUNCINIT') == false || $config['foffline'] && defined('TEMPSHOWLOG') == false) {
    define('SCRIPT_START_TIME', benchmarktime());
    $slog = new slog();
    $my = $slog->logged();
    $lang->init($my->language);
    $tpl = new tpl();
    $slog->checkBan();
Пример #17
0
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']}";
    }
}
if (count($add_com) > 1) {
    $hooks = preg_replace("~^components.php\$~im", implode("\r\n", $add_com), $hooks);
}
if (count($add_acom) > 1) {
    $hooks = preg_replace("~^admin/packages_admin.php\$~im", implode("\r\n", $add_acom), $hooks);
}
$filesystem->file_put_contents('admin/data/hooks.txt', $hooks);
echo "- Hooks updated.<br />";
// Config
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('local_mode', int, 0);
$c->updateconfig('multiple_instant_notifications', int, 0);
$c->savedata();
$c = new manageconfig();
$c->getdata('admin/data/config.inc.php', 'admconfig');
$c->updateconfig('checked_package_updates', int, 0);
$c->savedata();
echo "- Configuration updated.<br />";
// Languages
$ini = array('admin/forums' => array('language_de' => array('admin_forum_until' => 'bis '), 'language' => array('admin_forum_until' => 'until ')), 'admin/global' => array('language_de' => array('gmt' => 'GMT'), 'language' => array('gmt' => 'GMT')), 'admin/language' => array('language_de' => array('admin_lang_imported_successfully' => 'Sprachpaket wurde erfolgreich importiert.'), 'language' => array('admin_lang_imported_successfully' => 'Languagepack imported successfully.')), 'admin/members' => array('language_de' => array('admin_member_keep_time_zone' => NULL), 'language' => array('admin_member_keep_time_zone' => NULL)), 'admin/misc' => array('language_de' => array('admin_misc_license_not_forun' => NULL, 'admin_misc_license_not_found' => 'Lizenztext wurde leider nicht gefunden.', 'admin_misc_mysql_version' => 'Datenbank-Version:'), 'language' => array('admin_misc_license_not_forun' => NULL, 'admin_misc_license_not_found' => 'License not found.', 'admin_misc_mysql_version' => 'Database version:')), 'admin/packages' => array('language_de' => array('admin_packages_plugins_template_manage_templates_for_package' => ' Template-Verwaltung des Pakets '), 'language' => array('admin_packages_plugins_template_manage_templates_for_package' => 'Template Management for Package ')), 'admin/settings' => array('language_de' => array('admin_htaccess_error_doc_info' => 'Bei einem Server-Fehler (400, 403, 404, 500) wird die benutzerdefinierte Fehlerseite angezeigt. Beispiel: <a href="misc.php?action=error&id=404" target="_blank">Fehler 404</a>', 'admin_test_ftp_connection' => 'Daten speichern und FTP-Verbindung ggf. testen', 'admin_timezone_maintain' => NULL, 'admin_wordwrap_character_html_tag_long_words' => 'Wordwrap: Text (HTML erlaubt) der für die Trennung von zu langen Wörtern genutzt wird:', 'admin_ftp_php_extension_error' => 'Viscacha benötigt mindestens fsockopen, die Sockets-Erweiterung oder die FTP-Erweiterung für die FTP-Funktionalität. Bitte aktiviere eines dieser Features oder deaktiviere FTP.', 'admin_multiple_instant_notifications' => 'Pro Antwort eine E-Mail-Benachrichtigungen schicken:', 'admin_multiple_instant_notifications_info' => 'Bei der sofortigen E-Mail-Benachrichtigung (Abonnements) von Themen wird, wenn diese Option aktiviert ist, pro Antwort eine Benachrichtigung geschickt. Andernfalls wird nur bei der ersten Antwort seit dem letzten Besuch eine Benachrichtigung verschickt.', 'admin_topics_subscriptions' => 'Themen & Beiträge » Abonnements'), 'language' => array('admin_htaccess_error_doc_info' => 'On Server-Errors (400, 403, 404, 500) the custom Error-sites will be shown. Example: <a href="misc.php?action=error&id=404" target="_blank">Error 404</a>', 'admin_test_ftp_connection' => 'Save data and if so test FTP connection', 'admin_timezone_maintain' => NULL, 'admin_wordwrap_character_html_tag_long_words' => 'Wordwrap: Text (HTML allowed) which will be used for separation of too long words:', 'admin_ftp_php_extension_error' => 'Viscacha needs at least fsockopen, sockets extension or ftp extension to work! Please enable one of this features or disable ftp.', 'admin_multiple_instant_notifications' => 'Send one e-mail subscriptions per reply:', 'admin_multiple_instant_notifications_info' => 'For instant e-mail notifications (subscriptions) of replies you can receive one notification per reply, if this option is turned on. In the other case, you only get one notification for the first reply since your last visit.', 'admin_topics_subscriptions' => 'Topics & Posts » Subscriptions')), 'admin/slog' => array('language_de' => array('admin_slog_day' => 'Tag', 'admin_slog_month' => 'Monat', 'admin_slog_week' => 'Woche'), 'language' => array('admin_slog_day' => 'Day', 'admin_slog_month' => 'Month', 'admin_slog_week' => 'Week')), 'bbcodes' => array('language_de' => array('bb_edit_author' => 'Nachträgliche Anmerkung des Autors:', 'bb_edit_mod' => 'Nachträgliche Anmerkung von', 'bb_hidden_content' => 'Versteckter Inhalt:', 'bb_offtopic' => 'Off-Topic:', 'bb_quote' => 'Zitat:', 'bb_quote_by' => 'Zitat von', 'bb_sourcecode' => 'Quelltext:', 'geshi_hlcode_title' => '{$lang_name}-Quelltext:', 'geshi_hlcode_txtdownload' => 'Download'), 'language' => array('bb_edit_author' => 'Additional note by the author:', 'bb_edit_mod' => 'Additional note by', 'bb_hidden_content' => 'Hidden Content:', 'bb_offtopic' => 'Off Topic:', 'bb_quote' => 'Quote:', 'bb_quote_by' => 'Quote by', 'bb_sourcecode' => 'Source Code:', 'geshi_hlcode_title' => 'Source code ({$lang_name}):', 'geshi_hlcode_txtdownload' => 'Download')), 'global' => array('language_de' => array('bb_edit_author' => NULL, 'bb_edit_mod' => NULL, 'bb_hidden_content' => NULL, 'bb_offtopic' => NULL, 'bb_quote' => NULL, 'bb_quote_by' => NULL, 'bb_sourcecode' => NULL, 'geshi_hlcode_title' => NULL, 'geshi_hlcode_txtdownload' => NULL, 'htaccess_errdesc_401' => NULL, 'htaccess_error_401' => NULL, 'timestamps_gmt_diff' => 'Alle Zeitangaben in {%my->timezone_str}.', 'timezone_current' => NULL, 'timezone_desc' => 'Aktuelle Uhrzeit: {%my->current_time}.', 'timezone_summer' => NULL, 'gmt' => 'GMT', 'showtopic_options_fav_remove' => 'Aus den Favoriten entfernen', 'vote_reply_too_long' => 'Die Antwortmöglichkeit {$i} ist zu lang.'), 'language' => array('bb_edit_author' => NULL, 'bb_edit_mod' => NULL, 'bb_hidden_content' => NULL, 'bb_offtopic' => NULL, 'bb_quote' => NULL, 'bb_quote_by' => NULL, 'bb_sourcecode' => NULL, 'geshi_hlcode_title' => NULL, 'geshi_hlcode_txtdownload' => NULL, 'htaccess_errdesc_401' => NULL, 'htaccess_error_401' => NULL, 'timestamps_gmt_diff' => 'All times are {%my->timezone_str}.', 'timezone_current' => NULL, 'timezone_desc' => 'Current time: {%my->current_time}.', 'timezone_summer' => NULL, 'gmt' => 'GMT', 'showtopic_options_fav_remove' => 'Remove from favorites', 'vote_reply_too_long' => 'Option {$i} of your vote is too long.')), 'settings' => array('language_de' => array('compatible_version' => '0.8'), 'language' => array('compatible_version' => '0.8')));
Пример #18
0
    $filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
    $filesystem->set_wd($config['ftp_path']);
}
if (!class_exists('DB')) {
    require_once '../classes/database/' . $config['dbsystem'] . '.inc.php';
    $db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['pconnect'], true, $config['dbprefix']);
    $db->pre = $db->prefix();
    $db->errlogfile = '../' . $db->errlogfile;
}
// admin
$file = '../admin/data/hooks.txt';
$edit = file_get_contents($file);
$edit = preg_replace("~(-editprofile_abos_end[\r\n]+)~i", "\\1-editprofile_pic3_start\r\n-editprofile_pic3_end\r\n", $edit);
$edit = preg_replace("~(-misc_rules_end[\r\n]+)~i", "\\1-misc_board_rules_start\r\n-misc_board_rules_prepared\r\n-misc_board_rules_end\r\n", $edit);
$filesystem->chmod($file, 0666);
$filesystem->file_put_contents($file, $edit);
$file = '../admin/data/lang_email.php';
$edit = file($file);
$edit = array_map("trim", $edit);
$edit[] = "new_topic\tNotification about new topics for the board team";
$edit[] = "new_reply\tNotification about new replies for the board team";
$filesystem->chmod($file, 0666);
$filesystem->file_put_contents($file, implode("\n", $edit));
// classes
if (file_exists('../classes/function.cache.php')) {
    $filesystem->unlink('../classes/function.cache.php');
}
// data
$c = new manageconfig();
$c->getdata('../data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
Пример #19
0
    require_once '../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']);
}
if (!class_exists('DB')) {
    require_once '../classes/database/' . $config['dbsystem'] . '.inc.php';
    $db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['pconnect'], true, $config['dbprefix']);
    $db->pre = $db->prefix();
    $db->errlogfile = '../' . $db->errlogfile;
}
echo "- FTP class loaded, Database connection started.<br />";
// Hooks
$filesystem->chmod('../admin/data/hooks.txt', 0666);
$hooks = file_get_contents('../admin/data/hooks.txt');
$hooks = str_replace("-register_form_end", "-register_form_end\n-register_resend_start\n-register_resend_form_start\n-register_resend_form_end\n-register_resend2_start\n-register_resend2_check\n-register_resend2_end", $hooks);
$filesystem->file_put_contents('../admin/data/hooks.txt', $hooks);
$hooks = file_get_contents('../admin/data/hooks.txt');
if (strpos($hooks, 'register_resend_form_start') !== false) {
    echo "- Hooks added.<br />";
} else {
    echo "- Hooks could not be added. Ask the support for help.<br />";
}
// Config
$c = new manageconfig();
$c->getdata('../data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('sessionmails', int, $config['sessionmails'] == 1 ? 0 : 1);
$c->updateconfig('email_check_mx', int, 0);
$c->updateconfig('fullname_posts', int, 1);
$c->updateconfig('lasttopic_chars', int, 40);
$c->updateconfig('pm_user_status', int, 1);