# HG changeset patch # User Dan # Date 1190922937 14400 # Node ID d8156d18ac58dcf72a3b3f7ee9bbfb319e21d934 # Parent fa3dab3cfb0878ab26e7ea5da852672e6103b835 Sync from stable (Coblynau beta) diff -r fa3dab3cfb08 -r d8156d18ac58 includes/common.php --- a/includes/common.php Mon Sep 24 23:59:42 2007 -0400 +++ b/includes/common.php Thu Sep 27 15:55:37 2007 -0400 @@ -2,7 +2,7 @@ /* * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between - * Version 1.0.2 (Coblynau) + * Version 1.0 (Banshee) * Copyright (C) 2006-2007 Dan Fuhry * * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License @@ -23,7 +23,7 @@ exit; } -$version = '1.0.2b1'; +$version = '1.0.1'; function microtime_float() { @@ -56,7 +56,12 @@ if(defined('ENANO_DEBUG')) { - require_once(ENANO_ROOT.'/includes/debugger/debugConsole.php'); +// require_once(ENANO_ROOT.'/includes/debugger/debugConsole.php'); + function dc_here($m) { return false; } + function dc_dump($a, $g) { return false; } + function dc_watch($n) { return false; } + function dc_start_timer($u) { return false; } + function dc_stop_timer($m) { return false; } } else { function dc_here($m) { return false; } function dc_dump($a, $g) { return false; } @@ -149,44 +154,6 @@ grinding_halt('Version mismatch', '

It seems that the Enano release we\'re trying to run ('.$version.') is different from the version specified in your database ('.enano_version().'). Perhaps you need to upgrade?

'); } -// -// Low level maintenance -// - -// If the search algorithm backend has been changed, empty out the search cache (the two cache formats are incompatible with each other) -if ( getConfig('last_search_algo') != SEARCH_MODE ) -{ - if ( !$db->sql_query('DELETE FROM '.table_prefix.'search_cache;') ) - $db->_die(); - setConfig('last_search_algo', SEARCH_MODE); -} - -// If the AES key size has been changed, bail out and fast -if ( !getConfig('aes_key_size') ) -{ - setConfig('aes_key_size', AES_BITS); -} -else if ( $ks = getConfig('aes_key_size') ) -{ - if ( intval($ks) != AES_BITS ) - { - grinding_halt('AES key size changed', '

Enano has detected that the AES key size in constants.php has been changed. This change cannot be performed after installation, otherwise the private key would have to be re-generated and all passwords would have to be re-encrypted.

Please change the key size back to ' . $ks . ' bits and reload this page.

'); - } -} - -// Same for AES block size -if ( !getConfig('aes_block_size') ) -{ - setConfig('aes_block_size', AES_BLOCKSIZE); -} -else if ( $ks = getConfig('aes_block_size') ) -{ - if ( intval($ks) != AES_BLOCKSIZE ) - { - grinding_halt('AES block size changed', '

Enano has detected that the AES block size in constants.php has been changed. This change cannot be performed after installation, otherwise all passwords would have to be re-encrypted.

Please change the block size back to ' . $ks . ' bits and reload this page.

'); - } -} - // Our list of tables included in Enano $system_table_list = Array( table_prefix.'categories', @@ -209,10 +176,7 @@ table_prefix.'groups', table_prefix.'group_members', table_prefix.'acl', - table_prefix.'search_cache', - table_prefix.'page_groups', - table_prefix.'page_group_members', - table_prefix.'tags' + table_prefix.'search_cache' ); dc_here('common: initializing base classes'); @@ -268,7 +232,7 @@ $text = RenderMan::render($n) . '
- If you have an administrative account, you may log in to the site. + If you have an administrative account, you may log in to the site or use the administration panel.
'; $paths->wiki_mode = 0; die_semicritical('Site disabled', $text); diff -r fa3dab3cfb08 -r d8156d18ac58 includes/pageprocess.php --- a/includes/pageprocess.php Mon Sep 24 23:59:42 2007 -0400 +++ b/includes/pageprocess.php Thu Sep 27 15:55:37 2007 -0400 @@ -2,7 +2,7 @@ /* * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between - * Version 1.0.2 (Coblynau) + * Version 1.0.1 (Loch Ness) * pageprocess.php - intelligent retrieval of pages * Copyright (C) 2006-2007 Dan Fuhry * @@ -212,7 +212,7 @@ return false; } } - else if ( $this->namespace == 'User' && strpos($this->page_id, '/') === false ) + else if ( $this->namespace == 'User' ) { $this->_handle_userpage(); } @@ -371,8 +371,6 @@ global $db, $session, $paths, $template, $plugins; // Common objects $text = $this->fetch_text(); - $text = preg_replace('/([\s]*)__NOBREADCRUMBS__([\s]*)/', '', $text); - $text = preg_replace('/([\s]*)__NOTOC__([\s]*)/', '', $text); $redir_enabled = false; if ( preg_match('/^#redirect \[\[([^\]]+?)\]\]/i', $text, $match ) ) @@ -420,7 +418,6 @@ $template->tpl_strings['PAGE_NAME'] = htmlspecialchars( $this->title ); $this->header(); - $this->do_breadcrumbs(); if ( $_errormsg ) { @@ -634,8 +631,6 @@ )); $target_username = preg_replace('/^' . preg_quote($paths->nslist['User']) . '/', '', $target_username); - $target_username = explode('/', $target_username); - $target_username = $target_username[0]; if ( ( $page_name == str_replace('_', ' ', $this->page_id) || $page_name == $paths->nslist['User'] . str_replace('_', ' ', $this->page_id) ) || !$this->page_exists ) { @@ -709,13 +704,6 @@ echo 'Real name: ' . $userdata['real_name'] . ''; } - // Administer user button - - if ( $session->user_level >= USER_LEVEL_ADMIN ) - { - echo 'Administer user'; - } - // Comments echo '' . htmlspecialchars($target_username) . '\'s latest comments'; @@ -942,7 +930,6 @@ function _handle_redirect($page_id, $namespace) { - global $db, $session, $paths, $template, $plugins; // Common objects $arr_pid = array($this->page_id, $this->namespace); if ( $namespace == 'Special' || $namespace == 'Admin' ) { @@ -952,7 +939,7 @@ { return 'This page infinitely redirects with another page (or another series of pages), and the infinite redirect was trapped.'; } - $page_id_key = $paths->nslist[ $namespace ] . sanitize_page_id($page_id); + $page_id_key = $paths->nslist[ $namespace ] . $page_id; if ( !isset($paths->pages[$page_id_key]) ) { return 'This page redirects to another page that doesn\'t exist.'; @@ -976,39 +963,14 @@ { global $db, $session, $paths, $template, $plugins; // Common objects - // Log it for crying out loud - $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'illegal_page\', '.time().', \''.date('d M Y h:i a').'\', \''.$db->escape($session->username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', \'' . $db->escape(serialize(array($this->page_id, $this->namespace))) . '\')'); - $ob = ''; - //$template->tpl_strings['PAGE_NAME'] = 'Access denied'; - $template->tpl_strings['PAGE_NAME'] = htmlspecialchars( $this->title ); + $template->tpl_strings['PAGE_NAME'] = 'Access denied'; if ( $this->send_headers ) { $ob .= $template->getHeader(); } - if ( count($this->redirect_stack) > 0 ) - { - $stack = array_reverse($this->redirect_stack); - foreach ( $stack as $oldtarget ) - { - $url = makeUrlNS($oldtarget[1], $oldtarget[0], 'redirect=no', true); - $page_id_key = $paths->nslist[ $oldtarget[1] ] . $oldtarget[0]; - $page_data = $paths->pages[$page_id_key]; - $title = ( isset($page_data['name']) ) ? $page_data['name'] : $paths->nslist[$oldtarget[1]] . htmlspecialchars( str_replace('_', ' ', dirtify_page_id( $oldtarget[0] ) ) ); - $a = '' . $title . ''; - - $url = makeUrlNS($this->namespace, $this->page_id, 'redirect=no', true); - $page_id_key = $paths->nslist[ $this->namespace ] . $this->page_id; - $page_data = $paths->pages[$page_id_key]; - $title = ( isset($page_data['name']) ) ? $page_data['name'] : $paths->nslist[$this->namespace] . htmlspecialchars( str_replace('_', ' ', dirtify_page_id( $this->page_id ) ) ); - $b = '' . $title . ''; - - $ob .= '(Redirected to ' . $b . ' from ' . $a . ')
'; - } - } - $ob .= '
Access to this page is denied.
This may be because you are not logged in or you have not met certain criteria for viewing this page.
'; if ( $this->send_headers ) @@ -1082,11 +1044,8 @@ { global $db, $session, $paths, $template, $plugins; // Common objects + $this->header(); header('HTTP/1.1 404 Not Found'); - - $this->header(); - $this->do_breadcrumbs(); - if ( $userpage ) { echo '

There is no page with this title yet.

@@ -1116,10 +1075,6 @@ { $r = $db->fetchrow(); echo '

This page was deleted on ' . $r['date_string'] . '. The stated reason was:

' . $r['edit_summary'] . '

You can probably roll back the deletion.

'; - if ( $session->user_level >= USER_LEVEL_ADMIN ) - { - echo '

Additional admin options: detag page

'; - } } $db->free_result(); } @@ -1130,58 +1085,6 @@ } /** - * Echoes out breadcrumb data, if appropriate. - * @access private - */ - - function do_breadcrumbs() - { - global $db, $session, $paths, $template, $plugins; // Common objects - if ( strpos($this->text_cache, '__NOBREADCRUMBS__') !== false ) - return false; - $breadcrumb_data = explode('/', $this->page_id); - if ( count($breadcrumb_data) > 1 ) - { - echo ' - - - '; - } - } - - /** * PHP 4 constructor. * @see PageProcessor::__construct() */ diff -r fa3dab3cfb08 -r d8156d18ac58 includes/tagcloud.php --- a/includes/tagcloud.php Mon Sep 24 23:59:42 2007 -0400 +++ b/includes/tagcloud.php Thu Sep 27 15:55:37 2007 -0400 @@ -2,7 +2,7 @@ /* * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between - * Version 1.0.2 (Coblynau) + * Version 1.0.1 (Loch Ness) * Copyright (C) 2006-2007 Dan Fuhry * * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License diff -r fa3dab3cfb08 -r d8156d18ac58 themes/oxygen/header.tpl --- a/themes/oxygen/header.tpl Mon Sep 24 23:59:42 2007 -0400 +++ b/themes/oxygen/header.tpl Thu Sep 27 15:55:37 2007 -0400 @@ -1,5 +1,5 @@ - + {PAGE_NAME} • {SITE_NAME} @@ -11,7 +11,6 @@ {ADDITIONAL_HEADERS} @@ -165,7 +160,7 @@
-  +

ondblclick="ajaxRenameInline();" title="Double-click to rename this page" id="h2PageName">{PAGE_NAME}