# HG changeset patch # User Dan # Date 1198818473 18000 # Node ID 993fb077944feac136c8e8a1e0a74cbba2eb8ba9 # Parent 491518997ae5e6a9a59b51c00b044934896ed097# Parent 5d62ef764b0dcbd2e1814e7eb6e6e60fba3270d0 Merging in the last couple of revisions from stable diff -r 491518997ae5 -r 993fb077944f includes/clientside/static/misc.js diff -r 491518997ae5 -r 993fb077944f includes/clientside/static/windows.js --- a/includes/clientside/static/windows.js Fri Dec 28 00:03:27 2007 -0500 +++ b/includes/clientside/static/windows.js Fri Dec 28 00:07:53 2007 -0500 @@ -234,6 +234,10 @@ * dom-drag.js * 09.25.2001 * www.youngpup.net + * The original version of this code is in the + * public domain. We have relicensed this modified + * version under the GPL version 2 or later for + * Enano. **************************************************/ var Drag = { diff -r 491518997ae5 -r 993fb077944f includes/search.php diff -r 491518997ae5 -r 993fb077944f includes/sessions.php --- a/includes/sessions.php Fri Dec 28 00:03:27 2007 -0500 +++ b/includes/sessions.php Fri Dec 28 00:07:53 2007 -0500 @@ -2908,6 +2908,13 @@ var $acl_defaults_used = Array(); /** + * Tracks whether Wiki Mode is on for the page we're operating on. + * @var bool + */ + + var $wiki_mode = false; + + /** * Constructor. * @param string $page_id The ID of the page to check * @param string $namespace The namespace of the page to check. @@ -2964,6 +2971,36 @@ $this->page_id = $page_id; $this->namespace = $namespace; + + $pathskey = $paths->nslist[$this->namespace].$this->page_id; + $ppwm = 2; + if ( isset($paths->pages[$pathskey]) ) + { + if ( isset($paths->pages[$pathskey]['wiki_mode']) ) + $ppwm = $paths->pages[$pathskey]['wiki_mode']; + } + if ( $ppwm == 1 && ( $session->user_logged_in || getConfig('wiki_mode_require_login') != '1' ) ) + $this->wiki_mode = true; + else if ( $ppwm == 1 && !$session->user_logged_in && getConfig('wiki_mode_require_login') == '1' ) + $this->wiki_mode = true; + else if ( $ppwm == 0 ) + $this->wiki_mode = false; + else if ( $ppwm == 2 ) + { + if ( $session->user_logged_in ) + { + $this->wiki_mode = ( getConfig('wiki_mode') == '1' ); + } + else + { + $this->wiki_mode = ( getConfig('wiki_mode') == '1' && getConfig('wiki_mode_require_login') != '1' ); + } + } + else + { + // Ech. Internal logic failure, this should never happen. + return false; + } } /** @@ -2977,30 +3014,29 @@ { // echo '
' . print_r($this->perms, true) . ''; global $db, $session, $paths, $template, $plugins; // Common objects + if ( isset( $this->perms[$type] ) ) { if ( $this->perms[$type] == AUTH_DENY ) + { $ret = false; - else if ( $this->perms[$type] == AUTH_WIKIMODE && - ( isset($paths->pages[$paths->nslist[$this->namespace].$this->page_id]) && - ( $paths->pages[$paths->nslist[$this->namespace].$this->page_id]['wiki_mode'] == '1' || - ( $paths->pages[$paths->nslist[$this->namespace].$this->page_id]['wiki_mode'] == '2' - && getConfig('wiki_mode') == '1' - ) ) ) ) + } + else if ( $this->perms[$type] == AUTH_WIKIMODE && $this->wiki_mode ) + { $ret = true; - else if ( $this->perms[$type] == AUTH_WIKIMODE && ( - !isset($paths->pages[$paths->nslist[$this->namespace].$this->page_id]) - || ( - isset($paths->pages[$paths->nslist[$this->namespace].$this->page_id]) && ( - $paths->pages[$paths->nslist[$this->namespace].$this->page_id]['wiki_mode'] == '0' - || ( - $paths->pages[$paths->nslist[$this->namespace].$this->page_id]['wiki_mode'] == '2' && getConfig('wiki_mode') != '1' - ) ) ) ) ) + } + else if ( $this->perms[$type] == AUTH_WIKIMODE && !$this->wiki_mode ) + { $ret = false; + } else if ( $this->perms[$type] == AUTH_ALLOW ) + { $ret = true; + } else if ( $this->perms[$type] == AUTH_DISALLOW ) + { $ret = false; + } } else if(isset($this->acl_types[$type])) { diff -r 491518997ae5 -r 993fb077944f licenses/index.html --- a/licenses/index.html Fri Dec 28 00:03:27 2007 -0500 +++ b/licenses/index.html Fri Dec 28 00:07:53 2007 -0500 @@ -85,6 +85,7 @@
View text: Attribution 2.0 [deed]
-