LuckyCoinkydink/include/admin/configuration.inc.php
Ian fb81d6a121 added temporary backend developer template dir switch - Please read:
The smartified code as forked from master to 2.0 being outsourced,
now is to find in /include/admin/tplold, which will still be used as
the default backend template dir.
To switch to the new version, please paste the dirs and files of s9y-admin-tpl
as adviced in the readme and reload, but also add a
```php
	// End of Serendipity configuration file
	// You can place your own special variables after here:

	define('SWITCH_TEMPLATE_VERSION', 'true');

```
to the end of your serendipity_config_local.inc.php.

To switch back to the old smartified files, just set a // to the define().
2012-11-20 14:38:28 +01:00

90 lines
3.1 KiB
PHP

<?php # $Id$
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
if (IN_serendipity !== true) {
die ("Don't hack!");
}
umask(0000);
$umask = 0775;
@define('IN_installer', true);
if (!isset($_POST['installAction'])) {
$_POST['installAction'] = '';
}
if (!serendipity_checkPermission('siteConfiguration') && !serendipity_checkPermission('blogConfiguration')) {
return;
}
$data = array();
switch ($_POST['installAction'] && serendipity_checkFormToken()) {
case 'check':
$data['installAction'] = 'check';
$oldConfig = $serendipity;
$res = serendipity_updateConfiguration();
$data['res'] = $res;
if (is_array($res)) {
$data['diagnosticError'] = true;
} else {
/* If we have new rewrite rules, then install them */
$permalinkOld = array(
$oldConfig['serendipityHTTPPath'],
$oldConfig['serendipityPath'],
$oldConfig['defaultBaseURL'],
$oldConfig['indexFile'],
$oldConfig['rewrite']);
$permalinkNew = array(
$serendipity['serendipityHTTPPath'],
$serendipity['serendipityPath'],
$serendipity['defaultBaseURL'],
$serendipity['indexFile'],
$serendipity['rewrite']);
// Compare all old permalink section values against new one. A change in any of those
// will force to update the .htaccess for rewrite rules.
$permconf = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE);
if (is_array($permconf) && is_array($permconf['permalinks']['items'])) {
foreach($permconf['permalinks']['items'] AS $permitem) {
$permalinkOld[] = $oldConfig[$permitem['var']];
$permalinkNew[] = $serendipity[$permitem['var']];
}
}
if (serendipity_checkPermission('siteConfiguration') && serialize($permalinkOld) != serialize($permalinkNew)) {
$data['htaccessRewrite'] = true;
$data['serendipityPath'] = $serendipity['serendipityPath'];
$res = serendipity_installFiles($serendipity['serendipityPath']);
$data['res'] = $res;
serendipity_buildPermalinks();
}
}
break;
default:
$from = &$serendipity;
$t = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE);
ob_start();
serendipity_printConfigTemplate($t, $from, false, true);
$data['config'] = ob_get_contents();
ob_end_clean();
break;
}
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/configuration.inc.tpl";
$content = $serendipity['smarty']->fetch('file:'. $tfile);
echo $content;
/* vim: set sts=4 ts=4 expandtab : */
?>