[ Index ] |
|
Code source de Serendipity 1.2 |
1 <?php # $Id: configuration.inc.php 1816 2007-08-06 10:18:39Z garvinhicking $ 2 # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) 3 # All rights reserved. See LICENSE file for licensing details 4 5 if (IN_serendipity !== true) { 6 die ("Don't hack!"); 7 } 8 9 umask(0000); 10 $umask = 0775; 11 @define('IN_installer', true); 12 13 if (!isset($_POST['installAction'])) { 14 $_POST['installAction'] = ''; 15 } 16 17 if (!serendipity_checkPermission('siteConfiguration') && !serendipity_checkPermission('blogConfiguration')) { 18 return; 19 } 20 21 switch ($_POST['installAction'] && serendipity_checkFormToken()) { 22 case 'check': 23 $oldConfig = $serendipity; 24 $res = serendipity_updateConfiguration(); 25 if (is_array($res)) { 26 echo DIAGNOSTIC_ERROR; 27 echo '<div class="serendipityAdminMsgError">- <img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . implode('<br />', $res) . '</div><br /><br />'; 28 } else { 29 /* If we have new rewrite rules, then install them */ 30 $permalinkOld = array( 31 $oldConfig['serendipityHTTPPath'], 32 $oldConfig['serendipityPath'], 33 $oldConfig['baseURL'], 34 $oldConfig['indexFile'], 35 $oldConfig['rewrite']); 36 37 $permalinkNew = array( 38 $serendipity['serendipityHTTPPath'], 39 $serendipity['serendipityPath'], 40 $serendipity['baseURL'], 41 $serendipity['indexFile'], 42 $serendipity['rewrite']); 43 44 // Compare all old permalink section values against new one. A change in any of those 45 // will force to update the .htaccess for rewrite rules. 46 if ($serendipity['rewrite'] != 'none') { 47 $permconf = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE); 48 if (is_array($permconf) && is_array($permconf['permalinks']['items'])) { 49 foreach($permconf['permalinks']['items'] AS $permitem) { 50 $permalinkOld[] = $oldConfig[$permitem['var']]; 51 $permalinkNew[] = $serendipity[$permitem['var']]; 52 } 53 } 54 } 55 56 if (serendipity_checkPermission('siteConfiguration') && serialize($permalinkOld) != serialize($permalinkNew)) { 57 printf(ATTEMPT_WRITE_FILE, $serendipity['serendipityPath'] . '.htaccess'); 58 $res = serendipity_installFiles($serendipity['serendipityPath']); 59 if (is_array($res)) { 60 echo implode('<br />', $res); 61 } else { 62 echo DONE . '<br />'; 63 } 64 65 serendipity_buildPermalinks(); 66 } 67 68 echo '<br /><div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . WRITTEN_N_SAVED .'</div>'; 69 } 70 71 break; 72 73 default: 74 $from = &$serendipity; 75 $t = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE); 76 serendipity_printConfigTemplate($t, $from, false, true); 77 break; 78 } 79 80 /* vim: set sts=4 ts=4 expandtab : */ 81 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Nov 24 09:00:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |