You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(43) |
Nov
(73) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(34) |
Feb
(110) |
Mar
(24) |
Apr
(44) |
May
(37) |
Jun
(22) |
Jul
(20) |
Aug
(28) |
Sep
(50) |
Oct
(11) |
Nov
(132) |
Dec
(595) |
2002 |
Jan
(1099) |
Feb
(579) |
Mar
(63) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(125) |
Sep
(101) |
Oct
(25) |
Nov
(34) |
Dec
(47) |
2003 |
Jan
(82) |
Feb
(182) |
Mar
(71) |
Apr
(3) |
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
(14) |
Oct
(6) |
Nov
(124) |
Dec
(68) |
2004 |
Jan
(64) |
Feb
(191) |
Mar
(199) |
Apr
(298) |
May
(252) |
Jun
(426) |
Jul
(134) |
Aug
(13) |
Sep
(96) |
Oct
(75) |
Nov
(232) |
Dec
(171) |
2005 |
Jan
(205) |
Feb
(165) |
Mar
(8) |
Apr
(74) |
May
(21) |
Jun
(19) |
Jul
(37) |
Aug
(69) |
Sep
(141) |
Oct
(118) |
Nov
(31) |
Dec
(7) |
2006 |
Jan
(5) |
Feb
(10) |
Mar
(35) |
Apr
(24) |
May
(34) |
Jun
(29) |
Jul
(5) |
Aug
(38) |
Sep
(30) |
Oct
(37) |
Nov
(30) |
Dec
(86) |
2007 |
Jan
(414) |
Feb
(40) |
Mar
(18) |
Apr
(10) |
May
(66) |
Jun
(60) |
Jul
(105) |
Aug
(55) |
Sep
(64) |
Oct
(7) |
Nov
(11) |
Dec
(5) |
2008 |
Jan
(26) |
Feb
(28) |
Mar
(79) |
Apr
(34) |
May
(61) |
Jun
(24) |
Jul
(29) |
Aug
(160) |
Sep
(62) |
Oct
(70) |
Nov
(32) |
Dec
(14) |
2009 |
Jan
(140) |
Feb
(135) |
Mar
(153) |
Apr
(53) |
May
(24) |
Jun
(138) |
Jul
(90) |
Aug
(46) |
Sep
(72) |
Oct
(84) |
Nov
(32) |
Dec
(4) |
2010 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(55) |
May
(89) |
Jun
(131) |
Jul
(41) |
Aug
(38) |
Sep
(42) |
Oct
(11) |
Nov
(27) |
Dec
(54) |
2011 |
Jan
(127) |
Feb
(16) |
Mar
(71) |
Apr
(52) |
May
(32) |
Jun
(31) |
Jul
(4) |
Aug
|
Sep
(45) |
Oct
(26) |
Nov
(36) |
Dec
(10) |
2012 |
Jan
(23) |
Feb
(6) |
Mar
(13) |
Apr
(18) |
May
(1) |
Jun
(4) |
Jul
(3) |
Aug
(12) |
Sep
(57) |
Oct
(96) |
Nov
(163) |
Dec
(124) |
2013 |
Jan
(11) |
Feb
(17) |
Mar
(7) |
Apr
(48) |
May
(15) |
Jun
(29) |
Jul
(12) |
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
(3) |
2014 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
(8) |
Jun
(90) |
Jul
(104) |
Aug
(12) |
Sep
(81) |
Oct
(139) |
Nov
(111) |
Dec
(64) |
2015 |
Jan
(46) |
Feb
(74) |
Mar
(56) |
Apr
(61) |
May
(3) |
Jun
(7) |
Jul
(11) |
Aug
(5) |
Sep
(15) |
Oct
(1) |
Nov
(1) |
Dec
(15) |
2016 |
Jan
(25) |
Feb
(33) |
Mar
(24) |
Apr
(4) |
May
(24) |
Jun
(3) |
Jul
(75) |
Aug
|
Sep
(2) |
Oct
(38) |
Nov
(4) |
Dec
(18) |
2017 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(14) |
Jun
|
Jul
(5) |
Aug
(9) |
Sep
|
Oct
(23) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(9) |
Apr
(60) |
May
(1) |
Jun
|
Jul
(13) |
Aug
|
Sep
(11) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(15) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
2021 |
Jan
(24) |
Feb
(33) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(64) |
Jul
(71) |
Aug
(114) |
Sep
(82) |
Oct
(32) |
Nov
(76) |
Dec
(86) |
2022 |
Jan
(162) |
Feb
(41) |
Mar
(11) |
Apr
(9) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2023 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2024 |
Jan
(7) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
(90) |
Mar
(19) |
Apr
|
May
(6) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <var...@us...> - 2010-04-01 17:39:23
|
Revision: 7317 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7317&view=rev Author: vargenau Date: 2010-04-01 17:39:07 +0000 (Thu, 01 Apr 2010) Log Message: ----------- Wiki moved into Gforge plugin directory Modified Paths: -------------- trunk/g Modified: trunk/g =================================================================== --- trunk/g 2010-04-01 09:15:31 UTC (rev 7316) +++ trunk/g 2010-04-01 17:39:07 UTC (rev 7317) @@ -47,7 +47,7 @@ // Disable compression, seems needed to get all the messages. $no_gz_buffer=true; -require_once('../env.inc.php'); +require_once('../../env.inc.php'); require_once $gfwww.'include/pre.php'; require_once $gfplugins.'wiki/include/wikiconfig.class.php'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-04-01 09:15:42
|
Revision: 7316 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7316&view=rev Author: vargenau Date: 2010-04-01 09:15:31 +0000 (Thu, 01 Apr 2010) Log Message: ----------- Add class gforgepassuser Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2010-04-01 08:17:24 UTC (rev 7315) +++ trunk/lib/main.php 2010-04-01 09:15:31 UTC (rev 7316) @@ -114,7 +114,8 @@ // revive db handle, because these don't survive sessions if (isset($this->_user) and ( ! isa($this->_user, WikiUserClassname()) - or (strtolower(get_class($this->_user)) == '_passuser'))) + or (strtolower(get_class($this->_user)) == '_passuser') + or (strtolower(get_class($this->_user)) == '_gforgepassuser'))) { $this->_user = WikiUser($userid, $this->_user->_prefs); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-04-01 08:17:39
|
Revision: 7315 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7315&view=rev Author: vargenau Date: 2010-04-01 08:17:24 +0000 (Thu, 01 Apr 2010) Log Message: ----------- Add Gforge/Fusionforge backend Modified Paths: -------------- trunk/g Added Paths: ----------- trunk/lib/WikiDB/backend/PearDB_ffpgsql.php Modified: trunk/g =================================================================== --- trunk/g 2010-03-31 12:09:03 UTC (rev 7314) +++ trunk/g 2010-04-01 08:17:24 UTC (rev 7315) @@ -1,7 +1,7 @@ <?php // -*-php-*- $Id$ /* - * Copyright (C) 2008-2009 Alcatel-Lucent + * Copyright (C) 2008-2010 Alcatel-Lucent * * This file is part of PhpWiki. * @@ -270,7 +270,7 @@ // Override the default configuration for VARIABLES after index.php: // E.g. Use another DB: $DBParams['dbtype'] = 'SQL'; - $DBParams['dsn'] = 'pgsql://' . $sys_dbuser . ':' . + $DBParams['dsn'] = 'ffpgsql://' . $sys_dbuser . ':' . $sys_dbpasswd . '@' . $sys_dbhost .'/' . $sys_dbname; $DBParams['prefix'] = "plugin_wiki_"; Added: trunk/lib/WikiDB/backend/PearDB_ffpgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_ffpgsql.php (rev 0) +++ trunk/lib/WikiDB/backend/PearDB_ffpgsql.php 2010-04-01 08:17:24 UTC (rev 7315) @@ -0,0 +1,705 @@ +<?php // -*-php-*- +rcs_id('$Id$'); + +/* + * Copyright (C) 2001-2009 $ThePhpWikiProgrammingTeam + * Copyright (C) 2010 Alain Peyrat, Alcatel-Lucent + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PhpWiki; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* + * Standard Alcatel-Lucent disclaimer for contributing to open source + * + * "The Fusionforge backend ("Contribution") has not been tested and/or + * validated for release as or in products, combinations with products or + * other commercial use. Any use of the Contribution is entirely made at + * the user's own responsibility and the user can not rely on any features, + * functionalities or performances Alcatel-Lucent has attributed to the + * Contribution. + * + * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY + * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE, + * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE + * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER + * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND + * ALONE BASIS." + */ + + +require_once('lib/ErrorManager.php'); +require_once('lib/WikiDB/backend/PearDB_pgsql.php'); + +class WikiDB_backend_PearDB_ffpgsql +extends WikiDB_backend_PearDB_pgsql +{ + function WikiDB_backend_PearDB_ffpgsql($dbparams) { + $dbparams['dsn'] = str_replace('ffpgsql:', 'pgsql:', $dbparams['dsn']); + parent::WikiDB_backend_PearDB_pgsql($dbparams); + + $p = strlen(PAGE_PREFIX)+1; + $page_tbl = $this->_table_names['page_tbl']; + $this->page_tbl_fields = "$page_tbl.id AS id, substring($page_tbl.pagename from $p) AS pagename, $page_tbl.hits AS hits"; + + pg_set_client_encoding("iso-8859-1"); + } + + function get_all_pagenames() { + $dbh = &$this->_dbh; + extract($this->_table_names); + $pat = PAGE_PREFIX; + $p = strlen($pat)+1; + return $dbh->getCol("SELECT substring(pagename from $p)" + . " FROM $nonempty_tbl, $page_tbl" + . " WHERE $nonempty_tbl.id=$page_tbl.id" + . " AND substring($page_tbl.pagename from 0 for $p) = '$pat'"); + } + + function numPages($filter=false, $exclude='') { + $dbh = &$this->_dbh; + extract($this->_table_names); + $pat = PAGE_PREFIX; + $p = strlen($pat)+1; + return $dbh->getOne("SELECT count(*)" + . " FROM $nonempty_tbl, $page_tbl" + . " WHERE $nonempty_tbl.id=$page_tbl.id" + . " AND substring($page_tbl.pagename from 0 for $p) = '$pat'"); + } + + function get_pagedata($pagename) { + return parent::get_pagedata(PAGE_PREFIX.$pagename); + } + + function update_pagedata($pagename, $newdata) { + $dbh = &$this->_dbh; + $page_tbl = $this->_table_names['page_tbl']; + + // Hits is the only thing we can update in a fast manner. + if (count($newdata) == 1 && isset($newdata['hits'])) { + // Note that this will fail silently if the page does not + // have a record in the page table. Since it's just the + // hit count, who cares? + $pagename = PAGE_PREFIX.$pagename; + $dbh->query(sprintf("UPDATE $page_tbl SET hits=%d WHERE pagename='%s'", + $newdata['hits'], $dbh->escapeSimple($pagename))); + return; + } + + $this->lock(array($page_tbl), true); + $data = $this->get_pagedata($pagename); + if (!$data) { + $data = array(); + $this->_get_pageid($pagename, true); // Creates page record + } + + @$hits = (int)$data['hits']; + unset($data['hits']); + + foreach ($newdata as $key => $val) { + if ($key == 'hits') + $hits = (int)$val; + else if (empty($val)) + unset($data[$key]); + else + $data[$key] = $val; + } + + /* Portability issue -- not all DBMS supports huge strings + * so we need to 'bind' instead of building a simple SQL statment. + * Note that we do not need to escapeSimple when we bind + $dbh->query(sprintf("UPDATE $page_tbl" + . " SET hits=%d, pagedata='%s'" + . " WHERE pagename='%s'", + $hits, + $dbh->escapeSimple($this->_serialize($data)), + $dbh->escapeSimple($pagename))); + */ + $pagename = PAGE_PREFIX.$pagename; + $dbh->query("UPDATE $page_tbl" + . " SET hits=?, pagedata=?" + . " WHERE pagename=?", + array($hits, $this->_serialize($data), $pagename)); + $this->unlock(array($page_tbl)); + } + + function get_latest_version($pagename) { + return parent::get_latest_version(PAGE_PREFIX.$pagename); + } + + function get_previous_version($pagename, $version) { + return parent::get_previous_version(PAGE_PREFIX.$pagename, $version); + } + + function get_versiondata($pagename, $version, $want_content = false) { + $dbh = &$this->_dbh; + extract($this->_table_names); + extract($this->_expressions); + + // assert(is_string($pagename) and $pagename != ""); + // assert($version > 0); + + //trigger_error("GET_REVISION $pagename $version $want_content", E_USER_NOTICE); + // FIXME: optimization: sometimes don't get page data? + if ($want_content) { + $fields = $this->page_tbl_fields + . ",$page_tbl.pagedata as pagedata," + . $this->version_tbl_fields; + } + else { + $fields = $this->page_tbl_fields . "," + . "mtime, minor_edit, versiondata," + . "$iscontent AS have_content"; + } + + $pagename = PAGE_PREFIX.$pagename; + $result = $dbh->getRow(sprintf("SELECT $fields" + . " FROM $page_tbl, $version_tbl" + . " WHERE $page_tbl.id=$version_tbl.id" + . " AND pagename='%s'" + . " AND version=%d", + $dbh->escapeSimple($pagename), $version), + DB_FETCHMODE_ASSOC); + + return $this->_extract_version_data($result); + } + + function get_cached_html($pagename) { + return parent::get_cached_html(PAGE_PREFIX.$pagename); + } + + function set_cached_html($pagename, $data) { + return parent::set_cached_html(PAGE_PREFIX.$pagename, $data); + } + + function _get_pageid($pagename, $create_if_missing = false) { + + // check id_cache + global $request; + $cache =& $request->_dbi->_cache->_id_cache; + if (isset($cache[$pagename])) { + if ($cache[$pagename] or !$create_if_missing) { + return $cache[$pagename]; + } + } + + // attributes play this game. + if ($pagename === '') return 0; + + $dbh = &$this->_dbh; + $page_tbl = $this->_table_names['page_tbl']; + $pagename = PAGE_PREFIX.$pagename; + + $query = sprintf("SELECT id FROM $page_tbl WHERE pagename='%s'", + $dbh->escapeSimple($pagename)); + + if (!$create_if_missing) + return $dbh->getOne($query); + + $id = $dbh->getOne($query); + if (empty($id)) { + $this->lock(array($page_tbl), true); // write lock + $max_id = $dbh->getOne("SELECT MAX(id) FROM $page_tbl"); + $id = $max_id + 1; + // requires createSequence and on mysql lock the interim table ->getSequenceName + //$id = $dbh->nextId($page_tbl . "_id"); + $dbh->query(sprintf("INSERT INTO $page_tbl" + . " (id,pagename,hits)" + . " VALUES (%d,'%s',0)", + $id, $dbh->escapeSimple($pagename))); + $this->unlock(array($page_tbl)); + } + return $id; + } + + function purge_page($pagename) { + $dbh = &$this->_dbh; + extract($this->_table_names); + + $this->lock(); + if ( ($id = $this->_get_pageid($pagename, false)) ) { + $dbh->query("DELETE FROM $nonempty_tbl WHERE id=$id"); + $dbh->query("DELETE FROM $recent_tbl WHERE id=$id"); + $dbh->query("DELETE FROM $version_tbl WHERE id=$id"); + $dbh->query("DELETE FROM $link_tbl WHERE linkfrom=$id"); + $nlinks = $dbh->getOne("SELECT COUNT(*) FROM $link_tbl WHERE linkto=$id"); + if ($nlinks) { + // We're still in the link table (dangling link) so we can't delete this + // altogether. + $dbh->query("UPDATE $page_tbl SET hits=0, pagedata='' WHERE id=$id"); + $result = 0; + } + else { + $dbh->query("DELETE FROM $page_tbl WHERE id=$id"); + $result = 1; + } + } else { + $result = -1; // already purged or not existing + } + $this->unlock(); + return $result; + } + + function get_links($pagename, $reversed=true, $include_empty=false, + $sortby='', $limit='', $exclude='', + $want_relations = false) + { + $dbh = &$this->_dbh; + extract($this->_table_names); + + if ($reversed) + list($have,$want) = array('linkee', 'linker'); + else + list($have,$want) = array('linker', 'linkee'); + $orderby = $this->sortby($sortby, 'db', array('pagename')); + if ($orderby) $orderby = " ORDER BY $want." . $orderby; + if ($exclude) // array of pagenames + $exclude = " AND $want.pagename NOT IN ".$this->_sql_set($exclude); + else + $exclude=''; + + $pat = PAGE_PREFIX; + $p = strlen($pat)+1; + + $qpagename = $dbh->escapeSimple($pagename); + // MeV+APe 2007-11-14 + // added "dummyname" so that database accepts "ORDER BY" + $sql = "SELECT DISTINCT $want.id AS id, substring($want.pagename from $p) AS pagename, $want.pagename AS dummyname," + . ($want_relations ? " related.pagename as linkrelation" : " $want.hits AS hits") + . " FROM " + . (!$include_empty ? "$nonempty_tbl, " : '') + . " $page_tbl linkee, $page_tbl linker, $link_tbl " + . ($want_relations ? " JOIN $page_tbl related ON ($link_tbl.relation=related.id)" : '') + . " WHERE linkfrom=linker.id AND linkto=linkee.id" + . " AND $have.pagename='$pat$qpagename'" + . " AND substring($want.pagename from 0 for $p) = '$pat'" + . (!$include_empty ? " AND $nonempty_tbl.id=$want.id" : "") + //. " GROUP BY $want.id" + . $exclude + . $orderby; + if ($limit) { + // extract from,count from limit + list($from,$count) = $this->limit($limit); + $result = $dbh->limitQuery($sql, $from, $count); + } else { + $result = $dbh->query($sql); + } + + return new WikiDB_backend_PearDB_iter($this, $result); + } + + function get_all_pages($include_empty=false, $sortby='', $limit='', $exclude='') { + $dbh = &$this->_dbh; + extract($this->_table_names); + + $pat = PAGE_PREFIX; + $p = strlen($pat)+1; + + $orderby = $this->sortby($sortby, 'db'); + if ($orderby) $orderby = ' ORDER BY ' . $orderby; + if ($exclude) // array of pagenames + $exclude = " AND $page_tbl.pagename NOT IN ".$this->_sql_set($exclude); + else + $exclude=''; + + if (strstr($orderby, 'mtime ')) { // multiple columns possible + if ($include_empty) { + $sql = "SELECT " + . $this->page_tbl_fields + . " FROM $page_tbl, $recent_tbl, $version_tbl" + . " WHERE $page_tbl.id=$recent_tbl.id" + . " AND $page_tbl.id=$version_tbl.id AND latestversion=version" + . " AND substring($page_tbl.pagename from 0 for $p) = '$pat'" + . $exclude + . $orderby; + } + else { + $sql = "SELECT " + . $this->page_tbl_fields + . " FROM $nonempty_tbl, $page_tbl, $recent_tbl, $version_tbl" + . " WHERE $nonempty_tbl.id=$page_tbl.id" + . " AND $page_tbl.id=$recent_tbl.id" + . " AND $page_tbl.id=$version_tbl.id AND latestversion=version" + . " AND substring($page_tbl.pagename from 0 for $p) = '$pat'" + . $exclude + . $orderby; + } + } else { + if ($include_empty) { + $sql = "SELECT " + . $this->page_tbl_fields + . " FROM $page_tbl" + . ($exclude ? " WHERE $exclude" : '') + . ($exclude ? " AND " : " WHERE ") + . " substring($page_tbl.pagename from 0 for $p) = '$pat'" + . $orderby; + } + else { + $sql = "SELECT " + . $this->page_tbl_fields + . " FROM $nonempty_tbl, $page_tbl" + . " WHERE $nonempty_tbl.id=$page_tbl.id" + . " AND substring($page_tbl.pagename from 0 for $p) = '$pat'" + . $exclude + . $orderby; + } + } + if ($limit) { + // extract from,count from limit + list($from,$count) = $this->limit($limit); + $result = $dbh->limitQuery($sql, $from, $count); + } else { + $result = $dbh->query($sql); + } + return new WikiDB_backend_PearDB_iter($this, $result); + } + + function most_popular($limit=20, $sortby='-hits') { + $dbh = &$this->_dbh; + extract($this->_table_names); + $pat = PAGE_PREFIX; + $p = strlen($pat)+1; + if ($limit < 0){ + $order = "hits ASC"; + $limit = -$limit; + $where = ""; + } else { + $order = "hits DESC"; + $where = " AND hits > 0"; + } + $orderby = ''; + if ($sortby != '-hits') { + if ($order = $this->sortby($sortby, 'db')) + $orderby = " ORDER BY " . $order; + } else { + $orderby = " ORDER BY $order"; + } + //$limitclause = $limit ? " LIMIT $limit" : ''; + $sql = "SELECT " + . $this->page_tbl_fields + . " FROM $nonempty_tbl, $page_tbl" + . " WHERE $nonempty_tbl.id=$page_tbl.id" + . " AND substring($page_tbl.pagename from 0 for $p) = '$pat'" + . $where + . $orderby; + if ($limit) { + list($from, $count) = $this->limit($limit); + $result = $dbh->limitQuery($sql, $from, $count); + } else { + $result = $dbh->query($sql); + } + + return new WikiDB_backend_PearDB_iter($this, $result); + } + + function most_recent($params) { + $limit = 0; + $since = 0; + $include_minor_revisions = false; + $exclude_major_revisions = false; + $include_all_revisions = false; + extract($params); + + $dbh = &$this->_dbh; + extract($this->_table_names); + + $pick = array(); + if ($since) + $pick[] = "mtime >= $since"; + + + if ($include_all_revisions) { + // Include all revisions of each page. + $table = "$page_tbl, $version_tbl"; + $join_clause = "$page_tbl.id=$version_tbl.id"; + + if ($exclude_major_revisions) { + // Include only minor revisions + $pick[] = "minor_edit <> 0"; + } + elseif (!$include_minor_revisions) { + // Include only major revisions + $pick[] = "minor_edit = 0"; + } + } + else { + $table = "$page_tbl, $recent_tbl"; + $join_clause = "$page_tbl.id=$recent_tbl.id"; + $table .= ", $version_tbl"; + $join_clause .= " AND $version_tbl.id=$page_tbl.id"; + + if ($exclude_major_revisions) { + // Include only most recent minor revision + $pick[] = 'version=latestminor'; + } + elseif (!$include_minor_revisions) { + // Include only most recent major revision + $pick[] = 'version=latestmajor'; + } + else { + // Include only the latest revision (whether major or minor). + $pick[] ='version=latestversion'; + } + } + $order = "DESC"; + if($limit < 0){ + $order = "ASC"; + $limit = -$limit; + } + // $limitclause = $limit ? " LIMIT $limit" : ''; + $where_clause = $join_clause; + if ($pick) + $where_clause .= " AND " . join(" AND ", $pick); + + $pat = PAGE_PREFIX; + $p = strlen($pat)+1; + + // FIXME: use SQL_BUFFER_RESULT for mysql? + $sql = "SELECT " + . $this->page_tbl_fields . ", " . $this->version_tbl_fields + . " FROM $table" + . " WHERE $where_clause" + . " AND substring($page_tbl.pagename from 0 for $p) = '$pat'" + . " ORDER BY mtime $order"; + if ($limit) { + list($from, $count) = $this->limit($limit); + $result = $dbh->limitQuery($sql, $from, $count); + } else { + $result = $dbh->query($sql); + } + return new WikiDB_backend_PearDB_iter($this, $result); + } + + function wanted_pages($exclude_from='', $exclude='', $sortby='', $limit='') { + $dbh = &$this->_dbh; + extract($this->_table_names); + $pat = PAGE_PREFIX; + $p = strlen($pat)+1; + if ($orderby = $this->sortby($sortby, 'db', array('pagename','wantedfrom'))) + $orderby = 'ORDER BY ' . $orderby; + + if ($exclude_from) // array of pagenames + $exclude_from = " AND pp.pagename NOT IN ".$this->_sql_set($exclude_from); + if ($exclude) // array of pagenames + $exclude = " AND p.pagename NOT IN ".$this->_sql_set($exclude); + + $p = strlen(PAGE_PREFIX)+1; + $sql = "SELECT substring(p.pagename from $p) AS wantedfrom, substring(pp.pagename from $p) AS pagename" + . " FROM $page_tbl p, $link_tbl linked" + . " LEFT JOIN $page_tbl pp ON linked.linkto = pp.id" + . " LEFT JOIN $nonempty_tbl ne ON linked.linkto = ne.id" + . " WHERE ne.id IS NULL" + . " AND p.id = linked.linkfrom" + . " AND substring(p.pagename from 0 for $p) = '$pat'" + . " AND substring(pp.pagename from 0 for $p) = '$pat'" + . $exclude_from + . $exclude + . $orderby; + if ($limit) { + // oci8 error: WHERE NULL = NULL appended + list($from, $count) = $this->limit($limit); + $result = $dbh->limitQuery($sql, $from, $count * 3); + } else { + $result = $dbh->query($sql); + } + return new WikiDB_backend_PearDB_generic_iter($this, $result); + } + + function rename_page ($pagename, $to) { + $dbh = &$this->_dbh; + extract($this->_table_names); + + $this->lock(); + if (($id = $this->_get_pageid($pagename, false)) ) { + if ($new = $this->_get_pageid($to, false)) { + // Cludge Alert! + // This page does not exist (already verified before), but exists in the page table. + // So we delete this page. + $dbh->query("DELETE FROM $nonempty_tbl WHERE id=$new"); + $dbh->query("DELETE FROM $recent_tbl WHERE id=$new"); + $dbh->query("DELETE FROM $version_tbl WHERE id=$new"); + // We have to fix all referring tables to the old id + $dbh->query("UPDATE $link_tbl SET linkfrom=$id WHERE linkfrom=$new"); + $dbh->query("UPDATE $link_tbl SET linkto=$id WHERE linkto=$new"); + $dbh->query("DELETE FROM $page_tbl WHERE id=$new"); + } + $dbh->query(sprintf("UPDATE $page_tbl SET pagename='%s' WHERE id=$id", + $dbh->escapeSimple(PAGE_PREFIX.$to))); + } + $this->unlock(); + return $id; + } + + function is_wiki_page($pagename) { + return parent::is_wiki_page(PAGE_PREFIX.$pagename); + } + + function increaseHitCount($pagename) { + return parent::increaseHitCount(PAGE_PREFIX.$pagename); + } + + function _serialize($data) { + return WikiDB_backend_PearDB::_serialize($data); + } + + /** + * Pack tables. + * NOTE: Disable vacuum, wikiuser is not the table owner + */ + function optimize() { + return 0; + } + + /** + * Title search. + */ + function text_search($search, $fulltext=false, $sortby='', $limit='', + $exclude='') + { + $dbh = &$this->_dbh; + extract($this->_table_names); + $pat = PAGE_PREFIX; + $len = strlen($pat)+1; + $orderby = $this->sortby($sortby, 'db'); + if ($sortby and $orderby) $orderby = ' ORDER BY ' . $orderby; + + $searchclass = get_class($this)."_search"; + // no need to define it everywhere and then fallback. memory! + if (!class_exists($searchclass)) + $searchclass = "WikiDB_backend_PearDB_search"; + $searchobj = new $searchclass($search, $dbh); + + $table = "$nonempty_tbl, $page_tbl"; + $join_clause = "$nonempty_tbl.id=$page_tbl.id"; + $fields = $this->page_tbl_fields; + + if ($fulltext) { + $table .= ", $recent_tbl"; + $join_clause .= " AND $page_tbl.id=$recent_tbl.id"; + + $table .= ", $version_tbl"; + $join_clause .= " AND $page_tbl.id=$version_tbl.id AND latestversion=version"; + + $fields .= ", $page_tbl.pagedata as pagedata, " . $this->version_tbl_fields; + // TODO: title still ignored, need better rank and subselect + $callback = new WikiMethodCb($searchobj, "_fulltext_match_clause"); + $search_string = $search->makeTsearch2SqlClauseObj($callback); + $search_string = str_replace(array("%"," "), array("","&"), $search_string); + $search_clause = "substring(plugin_wiki_page.pagename from 0 for $len) = '$pat') AND ("; + + $search_clause .= "idxFTI @@ to_tsquery('$search_string')"; + if (!$orderby) + $orderby = " ORDER BY rank(idxFTI, to_tsquery('$search_string')) DESC"; + } else { + $callback = new WikiMethodCb($searchobj, "_pagename_match_clause"); + $search_clause = "substring(plugin_wiki_page.pagename from 0 for $len) = '$pat') AND ("; + $search_clause .= $search->makeSqlClauseObj($callback); + } + + $sql = "SELECT $fields FROM $table" + . " WHERE $join_clause" + . " AND ($search_clause)" + . $orderby; + if ($limit) { + list($from, $count) = $this->limit($limit); + $result = $dbh->limitQuery($sql, $from, $count); + } else { + $result = $dbh->query($sql); + } + + $iter = new WikiDB_backend_PearDB_iter($this, $result); + $iter->stoplisted = @$searchobj->stoplisted; + return $iter; + } + + function exists_link($pagename, $link, $reversed=false) { + $dbh = &$this->_dbh; + extract($this->_table_names); + + if ($reversed) + list($have, $want) = array('linkee', 'linker'); + else + list($have, $want) = array('linker', 'linkee'); + $qpagename = $dbh->escapeSimple($pagename); + $qlink = $dbh->escapeSimple($link); + $row = $dbh->GetRow("SELECT $want.pagename as result" + . " FROM $link_tbl, $page_tbl linker, $page_tbl linkee, $nonempty_tbl" + . " WHERE linkfrom=linker.id AND linkto=linkee.id" + . " AND $have.pagename='$qpagename'" + . " AND $want.pagename='$qlink'" + . " LIMIT 1"); + return $row['result'] ? 1 : 0; + } +}; + +class WikiDB_backend_PearDB_ffpgsql_search +extends WikiDB_backend_PearDB_pgsql_search +{ + function _pagename_match_clause($node) { + $word = $node->sql(); + // @alu: use _quote maybe instead of direct pg_escape_string + $word = pg_escape_string($word); + $len = strlen(PAGE_PREFIX)+1; + if ($node->op == 'REGEX') { // posix regex extensions + return ($this->_case_exact + ? "substring(pagename from $len) ~* '$word'" + : "substring(pagename from $len) ~ '$word'"); + } else { + return ($this->_case_exact + ? "substring(pagename from $len) LIKE '$word'" + : "substring(pagename from $len) ILIKE '$word'"); + } + } + + /** + * use tsearch2. See schemas/psql-tsearch2.sql and /usr/share/postgresql/contrib/tsearch2.sql + * TODO: don't parse the words into nodes. rather replace "[ +]" with & and "-" with "!" and " or " with "|" + * tsearch2 query language: @@ "word | word", "word & word", ! word + * ~* '.*something that does not exist.*' + */ + /* + phrase search for "history lesson": + + SELECT id FROM tab WHERE ts_idx_col @@ to_tsquery('history&lesson') + AND text_col ~* '.*history\\s+lesson.*'; + + The full-text index will still be used, and the regex will be used to + prune the results afterwards. + */ + function _fulltext_match_clause($node) { + $word = strtolower($node->word); + $word = str_replace(" ", "&", $word); // phrase fix + + // @alu: use _quote maybe instead of direct pg_escape_string + $word = pg_escape_string($word); + + return $word; + } +} + +// (c-file-style: "gnu") +// Local Variables: +// mode: php +// tab-width: 8 +// c-basic-offset: 4 +// c-hanging-comment-ender-p: nil +// indent-tabs-mode: nil +// End: +?> Property changes on: trunk/lib/WikiDB/backend/PearDB_ffpgsql.php ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-31 12:09:09
|
Revision: 7314 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7314&view=rev Author: vargenau Date: 2010-03-31 12:09:03 +0000 (Wed, 31 Mar 2010) Log Message: ----------- Avoid direct call to file themeinfo.php Modified Paths: -------------- trunk/themes/Crao/themeinfo.php trunk/themes/Hawaiian/themeinfo.php trunk/themes/MacOSX/themeinfo.php trunk/themes/MonoBook/themeinfo.php trunk/themes/Portland/themeinfo.php trunk/themes/Sidebar/themeinfo.php trunk/themes/SpaceWiki/themeinfo.php trunk/themes/Wordpress/themeinfo.php trunk/themes/blog/themeinfo.php trunk/themes/default/themeinfo.php trunk/themes/gforge/themeinfo.php trunk/themes/shamino_com/themeinfo.php trunk/themes/smaller/themeinfo.php trunk/themes/wikilens/themeinfo.php Modified: trunk/themes/Crao/themeinfo.php =================================================================== --- trunk/themes/Crao/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/Crao/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); /* Modified: trunk/themes/Hawaiian/themeinfo.php =================================================================== --- trunk/themes/Hawaiian/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/Hawaiian/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,10 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} rcs_id('$Id$'); Modified: trunk/themes/MacOSX/themeinfo.php =================================================================== --- trunk/themes/MacOSX/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/MacOSX/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php //-*-php-*- +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); /** Modified: trunk/themes/MonoBook/themeinfo.php =================================================================== --- trunk/themes/MonoBook/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/MonoBook/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); /** * The new mediawiki (Wikipedia.org) default style. Modified: trunk/themes/Portland/themeinfo.php =================================================================== --- trunk/themes/Portland/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/Portland/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); /* Modified: trunk/themes/Sidebar/themeinfo.php =================================================================== --- trunk/themes/Sidebar/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/Sidebar/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); /* Modified: trunk/themes/SpaceWiki/themeinfo.php =================================================================== --- trunk/themes/SpaceWiki/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/SpaceWiki/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,10 @@ <?php // -*-php-*- +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} rcs_id('$Id$'); Modified: trunk/themes/Wordpress/themeinfo.php =================================================================== --- trunk/themes/Wordpress/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/Wordpress/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); /* Modified: trunk/themes/blog/themeinfo.php =================================================================== --- trunk/themes/blog/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/blog/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); /** Modified: trunk/themes/default/themeinfo.php =================================================================== --- trunk/themes/default/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/default/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); /* Modified: trunk/themes/gforge/themeinfo.php =================================================================== --- trunk/themes/gforge/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/gforge/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); require_once('lib/WikiTheme.php'); Modified: trunk/themes/shamino_com/themeinfo.php =================================================================== --- trunk/themes/shamino_com/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/shamino_com/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); /** * A minimalistic design by walter rafelsberger Modified: trunk/themes/smaller/themeinfo.php =================================================================== --- trunk/themes/smaller/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/smaller/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); /** * tiny actionbar, only Edit (if signed in) and Info => PageInfo, Modified: trunk/themes/wikilens/themeinfo.php =================================================================== --- trunk/themes/wikilens/themeinfo.php 2010-03-31 11:59:04 UTC (rev 7313) +++ trunk/themes/wikilens/themeinfo.php 2010-03-31 12:09:03 UTC (rev 7314) @@ -1,4 +1,11 @@ <?php +// Avoid direct call to this file. +// PHPWIKI_VERSION is defined in lib/prepend.php +if (!defined('PHPWIKI_VERSION')) { + header("Location: /"); + exit; +} + rcs_id('$Id$'); /** * The wikilens theme is just a normal WikiTheme (can be based on any, here based on default), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-31 11:59:10
|
Revision: 7313 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7313&view=rev Author: vargenau Date: 2010-03-31 11:59:04 +0000 (Wed, 31 Mar 2010) Log Message: ----------- define('PHPWIKI_VERSION', '1.4.0RC-20100431'); Modified Paths: -------------- trunk/lib/prepend.php Modified: trunk/lib/prepend.php =================================================================== --- trunk/lib/prepend.php 2010-03-31 09:49:47 UTC (rev 7312) +++ trunk/lib/prepend.php 2010-03-31 11:59:04 UTC (rev 7313) @@ -12,7 +12,7 @@ rcs_id('$Id$'); // see lib/stdlib.php: phpwiki_version() -define('PHPWIKI_VERSION', '1.3.14-20090604'); +define('PHPWIKI_VERSION', '1.4.0RC-20100431'); /** * Returns true if current php version is at mimimum a.b.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-31 09:49:53
|
Revision: 7312 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7312&view=rev Author: vargenau Date: 2010-03-31 09:49:47 +0000 (Wed, 31 Mar 2010) Log Message: ----------- Fix Gforge CSS Modified Paths: -------------- trunk/themes/gforge/gforge-print.css trunk/themes/gforge/gforge.css Modified: trunk/themes/gforge/gforge-print.css =================================================================== --- trunk/themes/gforge/gforge-print.css 2010-03-31 09:25:47 UTC (rev 7311) +++ trunk/themes/gforge/gforge-print.css 2010-03-31 09:49:47 UTC (rev 7312) @@ -63,7 +63,7 @@ a.namedurl img { display: none; } /* Do not print "none" sorting icon */ -.sortarrow img[src="/images/sort_none.gif"] { display: none; } +img[src="/wiki/themes/gforge/buttons/no_order.png"] { display: none; } /** * Table of content @@ -79,9 +79,11 @@ border-bottom: 1px solid black; } +/* div.toclist a::after { content: leader('.') target-counter(attr(href), page); } +*/ table.boxed, table.bordered, table.bordered th, table.bordered td { border-color: black; Modified: trunk/themes/gforge/gforge.css =================================================================== --- trunk/themes/gforge/gforge.css 2010-03-31 09:25:47 UTC (rev 7311) +++ trunk/themes/gforge/gforge.css 2010-03-31 09:49:47 UTC (rev 7312) @@ -254,15 +254,13 @@ /** * headings */ -div.toc p.toctitle, h1, h2, h3, h4, h5, h6 { +div.toc p.toctitle, h2, h3, h4, h5, h6 { font-family: Verdana, Arial, Helvetica, sans-serif; padding-top: .5em; padding-bottom: .17em; border-bottom: 1px solid #aaaaaa; } -h1 { margin: 0; } - h1, h1 .backlinks, h2, .wikitext h2 a, h3, .wikitext h3 a, h4, .wikitext h4 a, h5, h6 { text-decoration: none; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-31 09:25:58
|
Revision: 7311 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7311&view=rev Author: vargenau Date: 2010-03-31 09:25:47 +0000 (Wed, 31 Mar 2010) Log Message: ----------- Fix border, hspace, vspace attributes handling Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2010-03-31 09:00:27 UTC (rev 7310) +++ trunk/lib/stdlib.php 2010-03-31 09:25:47 UTC (rev 7311) @@ -455,8 +455,8 @@ } // These attributes take a number (pixels): border, hspace, vspace elseif ((($attr == "border") || ($attr == "hspace") || ($attr == "vspace")) - && (is_int($value))) { - $link->setAttr($attr, $value); + && (is_numeric($value))) { + $link->setAttr($attr, (int)$value); } // These attributes take a number (pixels) or a percentage: height, width elseif ((($attr == "height") || ($attr == "width")) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-31 09:00:33
|
Revision: 7310 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7310&view=rev Author: vargenau Date: 2010-03-31 09:00:27 +0000 (Wed, 31 Mar 2010) Log Message: ----------- Make all 5 levels work Modified Paths: -------------- trunk/lib/plugin/CreateToc.php Modified: trunk/lib/plugin/CreateToc.php =================================================================== --- trunk/lib/plugin/CreateToc.php 2010-03-30 11:38:23 UTC (rev 7309) +++ trunk/lib/plugin/CreateToc.php 2010-03-31 09:00:27 UTC (rev 7310) @@ -2,7 +2,7 @@ rcs_id('$Id$'); /* * Copyright 2004,2005 $ThePhpWikiProgrammingTeam - * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright 2008-2010 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -275,10 +275,12 @@ if ($level < 1 or $level > 5) continue; $phpwikiclassiclevel = 4 -$level; $wikicreolelevel = $level + 1; - if ($phpwikiclassiclevel < 1 or $phpwikiclassiclevel > 3) continue; - if ((preg_match('/^\s*(!{'.$phpwikiclassiclevel.','.$phpwikiclassiclevel.'})([^!].*)$/', $content[$i], $match)) - or (preg_match('/^\s*(={'.$wikicreolelevel.','.$wikicreolelevel.'})([^=].*)$/', $content[$i], $match)) ) - { + $trim = trim($content[$i]); + + if ((((strpos($trim, '=') === 0)) + && (preg_match('/^\s*(={'.$wikicreolelevel.','.$wikicreolelevel.'})([^=].*)$/', $content[$i], $match))) + or (((strpos($trim, '!') === 0)) + && ((preg_match('/^\s*(!{'.$phpwikiclassiclevel.','.$phpwikiclassiclevel.'})([^!].*)$/', $content[$i], $match))))) { $this->_tocCounter($tocCounter, $level); if (!strstr($content[$i],'#[')) { $s = trim($match[2]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2010-03-30 11:38:30
|
Revision: 7309 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7309&view=rev Author: rurban Date: 2010-03-30 11:38:23 +0000 (Tue, 30 Mar 2010) Log Message: ----------- revert general part of r7169. multiple categories do not like ---\n Modified Paths: -------------- trunk/lib/EditToolbar.php Modified: trunk/lib/EditToolbar.php =================================================================== --- trunk/lib/EditToolbar.php 2010-03-25 14:50:10 UTC (rev 7308) +++ trunk/lib/EditToolbar.php 2010-03-30 11:38:23 UTC (rev 7309) @@ -1,6 +1,6 @@ <?php rcs_id('$Id$'); -/* Copyright 2004-2009 $ThePhpWikiProgrammingTeam +/* Copyright 2004-2010 $ThePhpWikiProgrammingTeam * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. @@ -306,9 +306,9 @@ if (defined('GFORGE') and GFORGE) { $categories[] = "['$page', '%0A----%0A%5B%5B".$page."%5D%5D']"; } else if (DISABLE_MARKUP_WIKIWORD or (!isWikiWord($page))) { - $categories[] = "['$page', '%0A----%0A%5B".$page."%5D']"; + $categories[] = "['$page', '%0A%5B".$page."%5D']"; } else { - $categories[] = "['$page', '%0A----%0A".$page."']"; + $categories[] = "['$page', '%0A".$page."']"; } } if (!$categories) return ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-25 14:50:16
|
Revision: 7308 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7308&view=rev Author: vargenau Date: 2010-03-25 14:50:10 +0000 (Thu, 25 Mar 2010) Log Message: ----------- New argument for RssFeedPlugin: titleonly Modified Paths: -------------- trunk/lib/plugin/RssFeed.php trunk/pgsrc/Help%2FRssFeedPlugin Modified: trunk/lib/plugin/RssFeed.php =================================================================== --- trunk/lib/plugin/RssFeed.php 2010-03-04 15:15:46 UTC (rev 7307) +++ trunk/lib/plugin/RssFeed.php 2010-03-25 14:50:10 UTC (rev 7308) @@ -44,11 +44,12 @@ // Establish default values for each of this plugin's arguments. function getDefaultArguments() { - return array('feed' => "", - 'description' => "", - 'url' => "", //"http://phpwiki.org/RecentChanges?format=rss", - 'maxitem' => 0, - 'debug' => false, + return array('feed' => "", + 'description' => "", + 'url' => "", //"http://phpwiki.org/RecentChanges?format=rss", + 'maxitem' => 0, + 'titleonly' => false, + 'debug' => false, ); } @@ -103,7 +104,7 @@ $cell_authordate = HTML::div(array('class'=> 'authordate'), $cell_author, HTML::raw(" - "), $cell_pubDate); $cell->pushContent($cell_authordate); - if (!empty($item['description'])) + if ((!$titleonly) && (!empty($item['description']))) $cell->pushContent(HTML::div(array('class'=> 'itemdesc'), HTML::raw($item['description']))); $html->pushContent($cell); Modified: trunk/pgsrc/Help%2FRssFeedPlugin =================================================================== --- trunk/pgsrc/Help%2FRssFeedPlugin 2010-03-04 15:15:46 UTC (rev 7307) +++ trunk/pgsrc/Help%2FRssFeedPlugin 2010-03-25 14:50:10 UTC (rev 7308) @@ -1,4 +1,4 @@ -Date: Mon, 1 Jun 2009 15:05:05 +0000 +Date: Thu, 25 Mar 2010 15:45:58 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -38,7 +38,11 @@ |- | **maxitem** | Max. number of entries (0 = unlimited) -| ~0 +| 0 +|- +| **titleonly** +| If //true//, do not display item body (boolean) +| false |} == Examples This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-04 15:15:53
|
Revision: 7307 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7307&view=rev Author: vargenau Date: 2010-03-04 15:15:46 +0000 (Thu, 04 Mar 2010) Log Message: ----------- Use preg_match instead of ereg (deprecated) Modified Paths: -------------- trunk/lib/FileFinder.php Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2010-03-04 15:11:56 UTC (rev 7306) +++ trunk/lib/FileFinder.php 2010-03-04 15:15:46 UTC (rev 7307) @@ -156,9 +156,13 @@ * @return bool True if path is absolute. */ function _is_abs($path) { - if (ereg('^/', $path)) return true; - elseif (isWindows() and (eregi('^[a-z]:[/\\]', $path))) return true; - else return false; + if (preg_match('#^/#', $path)) { + return true; + } elseif (isWindows() and (preg_match('#^[a-z]:[/\\]#i', $path))) { + return true; + } else { + return false; + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-04 15:12:05
|
Revision: 7306 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7306&view=rev Author: vargenau Date: 2010-03-04 15:11:56 +0000 (Thu, 04 Mar 2010) Log Message: ----------- Test GFORGE in update() and get() Modified Paths: -------------- trunk/lib/WikiUserNew.php Modified: trunk/lib/WikiUserNew.php =================================================================== --- trunk/lib/WikiUserNew.php 2010-03-04 13:42:18 UTC (rev 7305) +++ trunk/lib/WikiUserNew.php 2010-03-04 15:11:56 UTC (rev 7306) @@ -1,8 +1,8 @@ <?php //-*-php-*- rcs_id('$Id$'); /* Copyright (C) 2004,2005,2006,2007,2009 $ThePhpWikiProgrammingTeam - * Copyright (C) 2009 Marc-Etienne Vargenau, Alcatel-Lucent - * Copyright (C) 2009 Roger Guignard, Alcatel-Lucent + * Copyright (C) 2009-2010 Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright (C) 2009-2010 Roger Guignard, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -1756,6 +1756,10 @@ * For true verification (value = 2), we'd need a mailserver hook. */ function update($value) { + // email address is already checked by Gforge + if (defined('GFORGE') and GFORGE) { + return; + } if (!empty($this->_init)) return; $verified = $this->getraw('emailVerified'); // hack! @@ -1772,6 +1776,17 @@ } } } + + function get($name) { + // get email address from Gforge + if (defined('GFORGE') && GFORGE && session_loggedin()) { + $user = session_get_user(); + return $user->getEmail(); + } else { + parent::get($name); + } + } + } /** Check for valid email address This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-04 13:42:25
|
Revision: 7305 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7305&view=rev Author: vargenau Date: 2010-03-04 13:42:18 +0000 (Thu, 04 Mar 2010) Log Message: ----------- email address is already checked by Gforge Modified Paths: -------------- trunk/lib/WikiUserNew.php Modified: trunk/lib/WikiUserNew.php =================================================================== --- trunk/lib/WikiUserNew.php 2010-03-04 12:39:07 UTC (rev 7304) +++ trunk/lib/WikiUserNew.php 2010-03-04 13:42:18 UTC (rev 7305) @@ -1731,6 +1731,11 @@ extends _UserPreference { function sanify($value) { + + // email address is already checked by Gforge + if (defined('GFORGE') and GFORGE) { + return $value; + } // check for valid email address if ($this->get('email') == $value and $this->getraw('emailVerified')) return $value; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-04 12:39:13
|
Revision: 7304 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7304&view=rev Author: vargenau Date: 2010-03-04 12:39:07 +0000 (Thu, 04 Mar 2010) Log Message: ----------- Check _HomePagehandle is set (avoid PHP5 warning) Modified Paths: -------------- trunk/lib/WikiUser/PearDb.php Modified: trunk/lib/WikiUser/PearDb.php =================================================================== --- trunk/lib/WikiUser/PearDb.php 2010-03-04 12:17:14 UTC (rev 7303) +++ trunk/lib/WikiUser/PearDb.php 2010-03-04 12:39:07 UTC (rev 7304) @@ -51,7 +51,7 @@ return $this->_prefs; } } - if (isset($this->_HomePagehandle)) { + if (isset($this->_HomePagehandle) && $this->_HomePagehandle) { if ($restored_from_page = $this->_prefs->retrieve ($this->_HomePagehandle->get('pref'))) { $updated = $this->_prefs->updatePrefs($restored_from_page); @@ -94,11 +94,11 @@ $dbh->quote($packed), $dbh->quote($this->_userid))); } //delete pageprefs: - if ($this->_HomePagehandle and $this->_HomePagehandle->get('pref')) + if (isset($this->_HomePagehandle) && $this->_HomePagehandle and $this->_HomePagehandle->get('pref')) $this->_HomePagehandle->set('pref', ''); } else { //store prefs in homepage, not in cookie - if ($this->_HomePagehandle and !$id_only) + if (isset($this->_HomePagehandle) && $this->_HomePagehandle and !$id_only) $this->_HomePagehandle->set('pref', $packed); } return $count; //count($this->_prefs->unpack($packed)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-04 12:17:23
|
Revision: 7303 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7303&view=rev Author: vargenau Date: 2010-03-04 12:17:14 +0000 (Thu, 04 Mar 2010) Log Message: ----------- In PHP5, you have to clone UserPreferences so that WatchPage works Modified Paths: -------------- trunk/lib/WikiUserNew.php trunk/lib/plugin/WatchPage.php Modified: trunk/lib/WikiUserNew.php =================================================================== --- trunk/lib/WikiUserNew.php 2010-03-04 10:48:07 UTC (rev 7302) +++ trunk/lib/WikiUserNew.php 2010-03-04 12:17:14 UTC (rev 7303) @@ -1964,6 +1964,14 @@ } } + function __clone() { + foreach ($this as $key => $val) { + if (is_object($val) || (is_array($val))) { + $this->{$key} = unserialize(serialize($val)); + } + } + } + function _getPref($name) { if ($name == 'emailVerified') $name = 'email'; Modified: trunk/lib/plugin/WatchPage.php =================================================================== --- trunk/lib/plugin/WatchPage.php 2010-03-04 10:48:07 UTC (rev 7302) +++ trunk/lib/plugin/WatchPage.php 2010-03-04 12:17:14 UTC (rev 7303) @@ -154,7 +154,7 @@ } elseif ($add and $request->getArg('verify')) { // this is not executed so far. // add page to watchlist, verified - $rp = $user->getPreferences(); + $rp = clone($user->getPreferences()); $rp->set('notifyPages', $this->addpagelist($page, $pagelist)); $user->setPreferences($rp); $request->_setUser($user); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-03-04 10:48:15
|
Revision: 7302 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7302&view=rev Author: vargenau Date: 2010-03-04 10:48:07 +0000 (Thu, 04 Mar 2010) Log Message: ----------- Replace tabs by spaces; remove EOL spaces Modified Paths: -------------- trunk/lib/plugin/AddComment.php trunk/lib/plugin/AllPages.php trunk/lib/plugin/AllUsers.php trunk/lib/plugin/AnalyseAccessLogSql.php trunk/lib/plugin/AppendText.php trunk/lib/plugin/AsciiMath.php trunk/lib/plugin/AsciiSVG.php trunk/lib/plugin/BackLinks.php trunk/lib/plugin/BlogArchives.php trunk/lib/plugin/BlogJournal.php trunk/lib/plugin/BoxRight.php trunk/lib/plugin/CacheTest.php trunk/lib/plugin/Calendar.php trunk/lib/plugin/CalendarList.php trunk/lib/plugin/Chart.php trunk/lib/plugin/CreateBib.php trunk/lib/plugin/CreatePage.php trunk/lib/plugin/CreateToc.php trunk/lib/plugin/Diff.php trunk/lib/plugin/DynamicIncludePage.php trunk/lib/plugin/EditMetaData.php trunk/lib/plugin/ExternalSearch.php trunk/lib/plugin/FileInfo.php trunk/lib/plugin/FoafViewer.php trunk/lib/plugin/FrameInclude.php trunk/lib/plugin/FullTextSearch.php trunk/lib/plugin/GoTo.php trunk/lib/plugin/GoogleMaps.php trunk/lib/plugin/GooglePlugin.php trunk/lib/plugin/GraphViz.php trunk/lib/plugin/HtmlConverter.php trunk/lib/plugin/Imdb.php trunk/lib/plugin/IncludePage.php trunk/lib/plugin/IncludePages.php trunk/lib/plugin/IncludeSiteMap.php trunk/lib/plugin/InterWikiSearch.php trunk/lib/plugin/JabberPresence.php trunk/lib/plugin/LdapSearch.php trunk/lib/plugin/LinkDatabase.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/ListPages.php trunk/lib/plugin/ListRelations.php trunk/lib/plugin/MediawikiTable.php trunk/lib/plugin/ModeratedPage.php trunk/lib/plugin/MostPopular.php trunk/lib/plugin/NewPagesPerUser.php trunk/lib/plugin/NoCache.php trunk/lib/plugin/OldStyleTable.php trunk/lib/plugin/OrphanedPages.php trunk/lib/plugin/PageDump.php trunk/lib/plugin/PageGroup.php trunk/lib/plugin/PageHistory.php trunk/lib/plugin/PageInfo.php trunk/lib/plugin/PageTrail.php trunk/lib/plugin/PasswordReset.php trunk/lib/plugin/PhotoAlbum.php trunk/lib/plugin/PhpWeather.php trunk/lib/plugin/Ploticus.php trunk/lib/plugin/PluginManager.php trunk/lib/plugin/PopUp.php trunk/lib/plugin/PopularNearby.php trunk/lib/plugin/PopularTags.php trunk/lib/plugin/PreferenceApp.php trunk/lib/plugin/Processing.php trunk/lib/plugin/RandomPage.php trunk/lib/plugin/RateIt.php trunk/lib/plugin/RawHtml.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/RecentChangesCached.php trunk/lib/plugin/RecentComments.php trunk/lib/plugin/RecentReferrers.php trunk/lib/plugin/RedirectTo.php trunk/lib/plugin/RelatedChanges.php trunk/lib/plugin/RichTable.php trunk/lib/plugin/RssFeed.php trunk/lib/plugin/SearchHighlight.php trunk/lib/plugin/SemanticRelations.php trunk/lib/plugin/SemanticSearch.php trunk/lib/plugin/SemanticSearchAdvanced.php trunk/lib/plugin/SiteMap.php trunk/lib/plugin/SpellCheck.php trunk/lib/plugin/SqlResult.php trunk/lib/plugin/SyncWiki.php trunk/lib/plugin/SyntaxHighlighter.php trunk/lib/plugin/SystemInfo.php trunk/lib/plugin/TeX2png.php trunk/lib/plugin/Template.php trunk/lib/plugin/TexToPng.php trunk/lib/plugin/TitleSearch.php trunk/lib/plugin/Transclude.php trunk/lib/plugin/TranslateText.php trunk/lib/plugin/UnfoldSubpages.php trunk/lib/plugin/UpLoad.php trunk/lib/plugin/UriResolver.php trunk/lib/plugin/UserPreferences.php trunk/lib/plugin/UserRatings.php trunk/lib/plugin/VisualWiki.php trunk/lib/plugin/WantedPages.php trunk/lib/plugin/WatchPage.php trunk/lib/plugin/WhoIsOnline.php trunk/lib/plugin/WikiAdminChmod.php trunk/lib/plugin/WikiAdminChown.php trunk/lib/plugin/WikiAdminMarkup.php trunk/lib/plugin/WikiAdminPurge.php trunk/lib/plugin/WikiAdminRemove.php trunk/lib/plugin/WikiAdminRename.php trunk/lib/plugin/WikiAdminSearchReplace.php trunk/lib/plugin/WikiAdminSelect.php trunk/lib/plugin/WikiAdminSetAcl.php trunk/lib/plugin/WikiAdminSetExternal.php trunk/lib/plugin/WikiAdminUtils.php trunk/lib/plugin/WikiBlog.php trunk/lib/plugin/WikiForm.php trunk/lib/plugin/WikiFormRich.php trunk/lib/plugin/WikiForum.php trunk/lib/plugin/WikiPoll.php trunk/lib/plugin/WikicreoleTable.php trunk/lib/plugin/YouTube.php trunk/lib/plugin/_AuthInfo.php trunk/lib/plugin/_BackendInfo.php trunk/lib/plugin/_GroupInfo.php trunk/lib/plugin/_Retransform.php trunk/lib/plugin/_WikiTranslation.php trunk/lib/plugin/text2png.php Modified: trunk/lib/plugin/AddComment.php =================================================================== --- trunk/lib/plugin/AddComment.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/AddComment.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -2,7 +2,7 @@ rcs_id('$Id$'); /* * Copyright (C) 2004 $ThePhpWikiProgrammingTeam - * + * * This file is part of PhpWiki. * * PhpWiki is free software; you can redistribute it and/or modify @@ -59,7 +59,7 @@ // 'add' - only show entry box for new comment // 'show,add' - show old comments, then entry box // 'add,show' - show entry box followed by list of comments - // jshide - boolean - quick javascript expansion of the comments + // jshide - boolean - quick javascript expansion of the comments // and addcomment box function getDefaultArguments() { @@ -80,7 +80,7 @@ // Get our form args. $comment = $request->getArg("comment"); $request->setArg('comment', false); - + if ($request->isPost() and !empty($comment['addcomment'])) { $this->add($request, $comment, 'comment'); // noreturn } @@ -125,12 +125,12 @@ $div->pushContent($show); break; case 'add': - global $WikiTheme; - if (!$WikiTheme->DUMP_MODE) { - $add = $this->showForm($request, $args, 'addcomment'); - //if ($args['jshide']) $add->setAttr('style','display:none;'); - $div->pushContent($add); - } + global $WikiTheme; + if (!$WikiTheme->DUMP_MODE) { + $add = $this->showForm($request, $args, 'addcomment'); + //if ($args['jshide']) $add->setAttr('style','display:none;'); + $div->pushContent($add); + } break; default: return $this->error(sprintf("Bad mode ('%s')", $show)); @@ -139,7 +139,7 @@ $html->pushContent($div); return $html; } - + }; // For emacs users Modified: trunk/lib/plugin/AllPages.php =================================================================== --- trunk/lib/plugin/AllPages.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/AllPages.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -56,7 +56,7 @@ 'userpages' => false )); } - + // info arg allows multiple columns // info=mtime,hits,summary,version,author,locked,minor,markup or all // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges @@ -72,53 +72,53 @@ $timer = new DebugTimer; } $caption = _("All pages in this wiki ({total} total):"); - + if ( !empty($args['userpages']) ) { $pages = PageList::allUserPages($args['include_empty'], $args['sortby'], '' - ); - $caption = _("List of user-created pages ({total} total):"); - $args['count'] = $request->getArg('count'); + ); + $caption = _("List of user-created pages ({total} total):"); + $args['count'] = $request->getArg('count'); } elseif ( !empty($args['owner']) ) { $pages = PageList::allPagesByOwner($args['owner'], $args['include_empty'], $args['sortby'], '' - ); - $caption = fmt("List of pages owned by [%s] ({total} total):", - WikiLink($args['owner'] == '[]' - ? $request->_user->getAuthenticatedId() - : $args['owner'], - 'if_known')); - $args['count'] = $request->getArg('count'); - $pages->_options['count'] = $args['count']; + ); + $caption = fmt("List of pages owned by [%s] ({total} total):", + WikiLink($args['owner'] == '[]' + ? $request->_user->getAuthenticatedId() + : $args['owner'], + 'if_known')); + $args['count'] = $request->getArg('count'); + $pages->_options['count'] = $args['count']; } elseif ( !empty($args['author']) ) { $pages = PageList::allPagesByAuthor($args['author'], $args['include_empty'], - $args['sortby'], '' - ); - $caption = fmt("List of pages last edited by [%s] ({total} total):", - WikiLink($args['author'] == '[]' - ? $request->_user->getAuthenticatedId() - : $args['author'], - 'if_known')); - $args['count'] = $request->getArg('count'); - $pages->_options['count'] = $args['count']; + $args['sortby'], '' + ); + $caption = fmt("List of pages last edited by [%s] ({total} total):", + WikiLink($args['author'] == '[]' + ? $request->_user->getAuthenticatedId() + : $args['author'], + 'if_known')); + $args['count'] = $request->getArg('count'); + $pages->_options['count'] = $args['count']; } elseif ( !empty($args['creator']) ) { $pages = PageList::allPagesByCreator($args['creator'], $args['include_empty'], $args['sortby'], '' - ); - $caption = fmt("List of pages created by [%s] ({total} total):", - WikiLink($args['creator'] == '[]' - ? $request->_user->getAuthenticatedId() - : $args['creator'], - 'if_known')); - $args['count'] = $request->getArg('count'); - $pages->_options['count'] = $args['count']; + ); + $caption = fmt("List of pages created by [%s] ({total} total):", + WikiLink($args['creator'] == '[]' + ? $request->_user->getAuthenticatedId() + : $args['creator'], + 'if_known')); + $args['count'] = $request->getArg('count'); + $pages->_options['count'] = $args['count']; //} elseif ($pages) { // $args['count'] = count($pages); } else { - if (! $request->getArg('count')) + if (! $request->getArg('count')) $args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']); - else - $args['count'] = $request->getArg('count'); + else + $args['count'] = $request->getArg('count'); } if (empty($args['count']) and !empty($pages)) $args['count'] = count($pages); @@ -132,7 +132,7 @@ if ($pages !== false) $pagelist->addPageList($pages); else - $pagelist->addPages( $dbi->getAllPages($args['include_empty'], $args['sortby'], + $pagelist->addPages( $dbi->getAllPages($args['include_empty'], $args['sortby'], $args['limit']) ); if (defined('DEBUG') && DEBUG && $args['debug']) { return HTML($pagelist, Modified: trunk/lib/plugin/AllUsers.php =================================================================== --- trunk/lib/plugin/AllUsers.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/AllUsers.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -25,9 +25,9 @@ /** * Based on AllPages and WikiGroup. * - * We list all users, - * either homepage users (prefs stored in a page), - * users with db prefs and + * We list all users, + * either homepage users (prefs stored in a page), + * users with db prefs and * externally authenticated users with a db users table, if auth_user_exists is defined. */ class WikiPlugin_AllUsers Modified: trunk/lib/plugin/AnalyseAccessLogSql.php =================================================================== --- trunk/lib/plugin/AnalyseAccessLogSql.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/AnalyseAccessLogSql.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -66,12 +66,12 @@ $query = ''; $backend_type = $request->_dbi->_backend->backendType(); switch ($backend_type) { - case 'mysql': + case 'mysql': $Referring_URL = "left(referer,length(referer)-instr(reverse(referer),'?'))"; break; - case 'pgsql': - case 'postgres7': + case 'pgsql': + case 'postgres7': $Referring_URL = "substr(referer,0,position('?' in referer))"; break; - default: + default: $Referring_URL = "referer"; } switch ($args['mode']) { @@ -101,12 +101,12 @@ if ($where_conditions<>'') $where_conditions = 'WHERE '.$where_conditions.' '; switch ($backend_type) { - case 'mysql': + case 'mysql': $Referring_Domain = "left(referer, if(locate('/', referer, 8) > 0,locate('/', referer, 8) -1, length(referer)))"; break; - case 'pgsql': - case 'postgres7': + case 'pgsql': + case 'postgres7': $Referring_Domain = "substr(referer,0,8) || regexp_replace(substr(referer,8), '/.*', '')"; break; - default: + default: $Referring_Domain = "referer"; break; } $query = "SELECT " @@ -183,13 +183,13 @@ // If PHPSESSID appears in the URI, just display the URI to the left of this $sessname = session_name(); switch ($backend_type) { - case 'mysql': + case 'mysql': $Request_URI = "IF(instr(request_uri, '$sessname')=0, request_uri,left(request_uri, instr(request_uri, '$sessname')-2))"; break; - case 'pgsql': - case 'postgres7': + case 'pgsql': + case 'postgres7': $Request_URI = "regexp_replace(request_uri, '$sessname.*', '')"; break; - default: + default: $Request_URI = 'request_uri'; break; } $now = time(); @@ -239,7 +239,7 @@ return array( 'mode' => 'referring_domains', // referring_domains, referring_urls, remote_hosts, users, host_users, search_bots, search_bots_hits - 'caption' => '', + 'caption' => '', // blank means use the mode as the caption/title for the output 'local_referrers' => 'true', // only show external referring sites 'period' => '', // the type of period to report: @@ -356,19 +356,19 @@ $len = strlen($localhost); $backend_type = $request->_dbi->_backend->backendType(); switch ($backend_type) { - case 'mysql': + case 'mysql': $ref_localhost = "left(referer,$len)<>'$localhost'"; break; - case 'pgsql': - case 'postgres7': + case 'pgsql': + case 'postgres7': $ref_localhost = "substr(referer,0,$len)<>'$localhost'"; break; - default: + default: $ref_localhost = ""; } $where_conditions = $where_conditions.$ref_localhost; } // The assumed contract is that there is a space at the end of the - // conditions string, so that following SQL clauses (such as GROUP BY) + // conditions string, so that following SQL clauses (such as GROUP BY) // will not cause a syntax error if ($where_conditions<>'') $where_conditions = $where_conditions.' '; Modified: trunk/lib/plugin/AppendText.php =================================================================== --- trunk/lib/plugin/AppendText.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/AppendText.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -28,7 +28,7 @@ * See http://sourceforge.net/mailarchive/message.php?msg_id=10141823 * why not to use "text" as parameter. Nasty mozilla bug with mult. radio rows. * - * Todo: multiple pages. e.g. AppendText s=~[CategoryINtime~] page=<!plugin TitleSearch intime !> + * Todo: multiple pages. e.g. AppendText s=~[CategoryINtime~] page=<!plugin TitleSearch intime !> */ class WikiPlugin_AppendText extends WikiPlugin @@ -48,7 +48,7 @@ function getDefaultArguments() { return array('page' => '[pagename]', - 'pages' => false, + 'pages' => false, 's' => '', // Text to append. 'before' => '', // Add before (ignores after if defined) 'after' => '', // Add after line beginning with this @@ -65,17 +65,17 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - if (!$args['pages'] or !$request->isPost()) { - return $this->_work($args['page'], $args, $dbi, $request); - } else { - $html = HTML(); - if ($args['page'] != $basepage) - $html->pushContent("pages argument overrides page argument. ignored.",HTML::br()); - foreach ($args['pages'] as $pagename) { - $html->pushContent($this->_work($pagename, $args, $dbi, $request)); - } - return $html; - } + if (!$args['pages'] or !$request->isPost()) { + return $this->_work($args['page'], $args, $dbi, $request); + } else { + $html = HTML(); + if ($args['page'] != $basepage) + $html->pushContent("pages argument overrides page argument. ignored.",HTML::br()); + foreach ($args['pages'] as $pagename) { + $html->pushContent($this->_work($pagename, $args, $dbi, $request)); + } + return $html; + } } function _work($pagename, $args, $dbi, &$request) { @@ -95,7 +95,7 @@ $pagename)); return $message; } - + $current = $page->getCurrentRevision(); $oldtext = $current->getPackedContent(); $text = $args['s']; @@ -104,15 +104,15 @@ if (!empty($args['before'])) { $before = preg_quote($args['before'], "/"); // Insert before - $newtext = preg_match("/\n${before}/", $oldtext) + $newtext = preg_match("/\n${before}/", $oldtext) ? preg_replace("/(\n${before})/", "\n" . preg_quote($text, "/") . "\\1", - $oldtext) + $oldtext) : $this->_fallback($text, $oldtext, $args['before'], $message); } elseif (!empty($args['after'])) { // Insert after $after = preg_quote($args['after'], "/"); - $newtext = preg_match("/\n${after}/", $oldtext) + $newtext = preg_match("/\n${after}/", $oldtext) ? preg_replace("/(\n${after})/", "\\1\n" . preg_quote($text, "/"), $oldtext) @@ -129,19 +129,19 @@ if ($page->save($newtext, $current->getVersion() + 1, $meta)) { $message->pushContent(_("Page successfully updated."), HTML::br()); } - + // AppendText has been called from the same page that got modified // so we directly show the page. if ( $request->getArg($pagename) == $pagename ) { - // TODO: Just invalidate the cache, if AppendText didn't + // TODO: Just invalidate the cache, if AppendText didn't // change anything before. - // + // return $request->redirect(WikiURL($pagename, false, 'absurl'), false); // The user asked to be redirected to the modified page } elseif ($args['redirect']) { return $request->redirect(WikiURL($pagename, false, 'absurl'), false); - + } else { $link = HTML::em(WikiLink($pagename)); $message->pushContent(HTML::Raw(sprintf(_("Go to %s."), $link->asXml()))); Modified: trunk/lib/plugin/AsciiMath.php =================================================================== --- trunk/lib/plugin/AsciiMath.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/AsciiMath.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -27,19 +27,19 @@ require_once("lib/ASCIIMathPHP/ASCIIMathPHP.class.php"); } -/** +/** * Render ASCII math as MathML * Requires ENABLE_XHTML_XML = true * See http://www.jcphysics.com/ASCIIMath/ * Syntax: http://www1.chapman.edu/~jipsen/mathml/asciimathsyntax.xml * Example: "int_-1^1 sqrt(1-x^2)dx = pi/2" * => <math xmlns="http://www.w3.org/1998/Math/MathML"> - <mrow><msubsup><mo>∫</mo><mn>-1</mn><mn>1</mn></msubsup></mrow> - <msqrt><mrow><mn>1</mn><mo>-</mo><msup><mi>x</mi><mn>2</mn></msup></mrow></msqrt> - <mi>d</mi> - <mi>x</mi> - <mo>=</mo> - <mfrac><mi>π</mi><mo>2</mo></mfrac> + <mrow><msubsup><mo>∫</mo><mn>-1</mn><mn>1</mn></msubsup></mrow> + <msqrt><mrow><mn>1</mn><mo>-</mo><msup><mi>x</mi><mn>2</mn></msup></mrow></msqrt> + <mi>d</mi> + <mi>x</mi> + <mo>=</mo> + <mfrac><mi>π</mi><mo>2</mo></mfrac> </math> */ class WikiPlugin_AsciiMath Modified: trunk/lib/plugin/AsciiSVG.php =================================================================== --- trunk/lib/plugin/AsciiSVG.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/AsciiSVG.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -44,8 +44,8 @@ function getDefaultArguments() { return array('width' => 200, 'height' => 200, - 'script' => false, // one line script. not very likely - 'onmousemove' => false + 'script' => false, // one line script. not very likely + 'onmousemove' => false ); } function handle_plugin_args_cruft(&$argstr, &$args) { @@ -67,21 +67,21 @@ $html->pushContent($js); $WikiTheme->_asciiSVG = 1; // prevent duplicates } - // extract <script> - if (preg_match("/^(.*)<script>(.*)<\/script>/ism", $this->source, $m)) { - $this->source = $m[1]; - $args['script'] = $m[2]; - } - $embedargs = array('width' => $args['width'], - 'height' => $args['height'], - //'src' => "d.svg", - 'script' => $this->source); - // additional onmousemove argument - if ($args['onmousemove']) $embedargs['onmousemove'] = $args['onmousemove']; + // extract <script> + if (preg_match("/^(.*)<script>(.*)<\/script>/ism", $this->source, $m)) { + $this->source = $m[1]; + $args['script'] = $m[2]; + } + $embedargs = array('width' => $args['width'], + 'height' => $args['height'], + //'src' => "d.svg", + 'script' => $this->source); + // additional onmousemove argument + if ($args['onmousemove']) $embedargs['onmousemove'] = $args['onmousemove']; // we need script='data' and not script="data" $embed = new AsciiSVG_HTML("embed", $embedargs); $html->pushContent($embed); - if ($args['script']) $html->pushContent(JavaScript($args['script'])); + if ($args['script']) $html->pushContent(JavaScript($args['script'])); return $html; } }; @@ -89,7 +89,7 @@ class AsciiSVG_HTML extends HtmlElement { function startTag() { $start = "<" . $this->_tag; - $this->_setClasses(); + $this->_setClasses(); foreach ($this->_attr as $attr => $val) { if (is_bool($val)) { if (!$val) @@ -98,7 +98,7 @@ } $qval = str_replace("\"", '"', $this->_quote((string)$val)); if ($attr == 'script') - // note the ' not " + // note the ' not " $start .= " $attr='$qval'"; else $start .= " $attr=\"$qval\""; Modified: trunk/lib/plugin/BackLinks.php =================================================================== --- trunk/lib/plugin/BackLinks.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/BackLinks.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -30,16 +30,16 @@ function getName() { return _("BackLinks"); } - + function getDescription() { return sprintf(_("List all pages which link to %s."), '[pagename]'); } - + function getVersion() { return preg_replace("/[Revision: $]/", '', "\$Revision$"); } - + function getDefaultArguments() { return array_merge ( @@ -47,8 +47,8 @@ array('include_self' => false, 'noheader' => false, 'page' => '[pagename]', - 'linkmore' => '', // If count>0 and limit>0 display a link with - // the number of all results, linked to the given pagename. + 'linkmore' => '', // If count>0 and limit>0 display a link with + // the number of all results, linked to the given pagename. )); } @@ -70,39 +70,39 @@ if ($info) { $info = explode(",", $info); if (in_array('count',$info)) - $args['types']['count'] = + $args['types']['count'] = new _PageList_Column_BackLinks_count('count', _("#"), 'center'); } - if (!empty($limit)) - $args['limit'] = $limit; + if (!empty($limit)) + $args['limit'] = $limit; $args['dosort'] = !empty($args['sortby']); // override DB sort (??) $pagelist = new PageList($info, $exclude, $args); // support logical AND: page1,page2 - $pages = explodePageList($page); - $count = count($pages); - if (count($pages) > 1) { - // AND: the intersection of all these pages - $bl = array(); - foreach ($pages as $p) { - $dp = $dbi->getPage($p); - $bi = $dp->getBackLinks(false, $sortby, 0, $exclude); - while ($b = $bi->next()) { - $name = $b->getName(); - if (isset($bl[$name])) - $bl[$name]++; - else - $bl[$name] = 1; - } - } - foreach ($bl as $b => $v) - if ($v == $count) - $pagelist->addPage($b); - } else { - $p = $dbi->getPage($page); - $pagelist->addPages($p->getBackLinks(false, $sortby, 0, $exclude)); - } - $total = $pagelist->getTotal(); + $pages = explodePageList($page); + $count = count($pages); + if (count($pages) > 1) { + // AND: the intersection of all these pages + $bl = array(); + foreach ($pages as $p) { + $dp = $dbi->getPage($p); + $bi = $dp->getBackLinks(false, $sortby, 0, $exclude); + while ($b = $bi->next()) { + $name = $b->getName(); + if (isset($bl[$name])) + $bl[$name]++; + else + $bl[$name] = 1; + } + } + foreach ($bl as $b => $v) + if ($v == $count) + $pagelist->addPage($b); + } else { + $p = $dbi->getPage($page); + $pagelist->addPages($p->getBackLinks(false, $sortby, 0, $exclude)); + } + $total = $pagelist->getTotal(); // Localization note: In English, the differences between the // various phrases spit out here may seem subtle or negligible @@ -112,8 +112,8 @@ // distinction as it does with English in this case. :) if (!$noheader) { if ($page == $request->getArg('pagename') - and !$dbi->isWikiPage($page)) - { + and !$dbi->isWikiPage($page)) + { // BackLinks plugin is more than likely being called // upon for an empty page on said page, while either // 'browse'ing, 'create'ing or 'edit'ing. @@ -122,10 +122,10 @@ // the Un~WikiLink~ified (plain) name of the uncreated // page currently being viewed. $pagelink = $page; - + if ($pagelist->isEmpty()) return HTML::p(fmt("No other page links to %s yet.", $pagelink)); - + if ($total == 1) $pagelist->setCaption(fmt("One page would link to %s:", $pagelink)); @@ -140,21 +140,21 @@ $total, $pagelink)); } else { - if ($count) { - $tmp_pages = $pages; - $p = array_shift($tmp_pages); - $pagelink = HTML(WikiLink($p, 'auto')); - foreach ($tmp_pages as $p) - $pagelink->pushContent(" ",_("AND")," ",WikiLink($p, 'auto')); - } else - // BackLinks plugin is being displayed on a normal page. + if ($count) { + $tmp_pages = $pages; + $p = array_shift($tmp_pages); + $pagelink = HTML(WikiLink($p, 'auto')); + foreach ($tmp_pages as $p) + $pagelink->pushContent(" ",_("AND")," ",WikiLink($p, 'auto')); + } else + // BackLinks plugin is being displayed on a normal page. $pagelink = WikiLink($page, 'auto'); - + if ($pagelist->isEmpty()) return HTML::p(fmt("No page links to %s.", $pagelink)); - + //trigger_error("DEBUG: " . $pagelist->getTotal()); - + if ($total == 1) $pagelist->setCaption(fmt("One page links to %s:", $pagelink)); @@ -166,18 +166,18 @@ // $pagelink)); else $pagelist->setCaption(fmt("%s pages link to %s:", - $limit > 0 ? $total : _("Those"), - $pagelink)); + $limit > 0 ? $total : _("Those"), + $pagelink)); } } - if (!empty($args['linkmore']) - and $dbi->isWikiPage($args['linkmore']) - and $limit > 0 and $total > $limit - ) - $pagelist->addCaption(WikiLink($args['linkmore'], "auto", _("More..."))); + if (!empty($args['linkmore']) + and $dbi->isWikiPage($args['linkmore']) + and $limit > 0 and $total > $limit + ) + $pagelist->addCaption(WikiLink($args['linkmore'], "auto", _("More..."))); return $pagelist; } - + }; // how many links from this backLink to other pages Modified: trunk/lib/plugin/BlogArchives.php =================================================================== --- trunk/lib/plugin/BlogArchives.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/BlogArchives.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -2,7 +2,7 @@ rcs_id('$Id$'); /* * Copyright (C) 2004 $ThePhpWikiProgrammingTeam - * + * * This file is part of PhpWiki. * * PhpWiki is free software; you can redistribute it and/or modify @@ -23,7 +23,7 @@ require_once('lib/plugin/WikiBlog.php'); /** - * BlogArchives - List monthly links for the current users blog if signed, + * BlogArchives - List monthly links for the current users blog if signed, * or the ADMIN_USER's Blog if not. * On month=... list the blog titles per month. * @@ -51,7 +51,7 @@ function getDefaultArguments() { return //array_merge //( - //PageList::supportedArgs(), + //PageList::supportedArgs(), array('user' => '', 'order' => 'reverse', // latest first 'info' => 'month,numpages', // ignored @@ -77,9 +77,9 @@ } if (!$args['user'] or $args['user'] == ADMIN_USER) { if (BLOG_DEFAULT_EMPTY_PREFIX) - $args['user'] = ''; // "Blogs/day" pages + $args['user'] = ''; // "Blogs/day" pages else - $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages + $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages } $parent = (empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR); @@ -87,15 +87,15 @@ //$pagelist = new PageList($args['info'], $args['exclude'], $args); //if (!is_array('pagename'), explode(',', $info)) // unset($pagelist->_columns['pagename']); - + $sp = HTML::Raw('· '); if (!empty($args['month'])) { $prefix = $parent . $this->_blogPrefix('wikiblog') . SUBPAGE_SEPARATOR . $args['month']; $pages = $dbi->titleSearch(new TextSearchQuery("^".$prefix, true, 'posix')); $html = HTML::ul(); while ($page = $pages->next()) { - $rev = $page->getCurrentRevision(false); - if ($rev->get('pagetype') != 'wikiblog') continue; + $rev = $page->getCurrentRevision(false); + if ($rev->get('pagetype') != 'wikiblog') continue; $blog = $this->_blog($rev); $html->pushContent(HTML::li(WikiLink($page, 'known', $rev->get('summary')))); } @@ -117,13 +117,13 @@ $months = array(); foreach ($blogs as $rev) { $blog = $this->_blog($rev); - $mon = $blog['month']; + $mon = $blog['month']; if (empty($months[$mon])) - $months[$mon] = + $months[$mon] = array('title' => $this->_monthTitle($mon), 'num' => 1, 'month' => $mon, - 'link' => WikiURL($basepage, + 'link' => WikiURL($basepage, $this->_nonDefaultArgs(array('month' => $mon)))); else $months[$mon]['num']++; @@ -137,7 +137,7 @@ return HTML(HTML::h3(_("Blog Archives:")), $html); else return $html; - } else + } else return ''; } Modified: trunk/lib/plugin/BlogJournal.php =================================================================== --- trunk/lib/plugin/BlogJournal.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/BlogJournal.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -2,7 +2,7 @@ rcs_id('$Id$'); /* * Copyright (C) 2005 $ThePhpWikiProgrammingTeam - * + * * This file is part of PhpWiki. * * PhpWiki is free software; you can redistribute it and/or modify @@ -23,10 +23,10 @@ require_once('lib/plugin/WikiBlog.php'); /** - * BlogJournal - Include the latest blog entries for the current users blog if signed, + * BlogJournal - Include the latest blog entries for the current users blog if signed, * or the ADMIN_USER's Blog if not. * UnfoldSubpages for blogs. - * Rui called this plugin "JournalLast", but this was written completely independent, + * Rui called this plugin "JournalLast", but this was written completely independent, * without having seen the src. * * @author: Reini Urban @@ -73,9 +73,9 @@ } if (!$args['user'] or $args['user'] == ADMIN_USER) { if (BLOG_DEFAULT_EMPTY_PREFIX) { - $args['user'] = ''; // "Blogs/day" pages + $args['user'] = ''; // "Blogs/day" pages } else { - $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages + $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages } } $parent = (empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR); @@ -96,8 +96,8 @@ } if ($args['user'] == $user->UserName() or $args['user'] == '') $html->pushContent(Button(array('action'=>'WikiBlog', - 'mode'=>'add'), - _("New entry"), $base)); + 'mode'=>'add'), + _("New entry"), $base)); if (!$i) return HTML(HTML::h3(_("No Blog Entries")), $html); if (!$args['noheader']) Modified: trunk/lib/plugin/BoxRight.php =================================================================== --- trunk/lib/plugin/BoxRight.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/BoxRight.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -49,13 +49,13 @@ // validators have already been handled by displayPage. return true; } - + function run($dbi, $argstr, &$request, $basepage) { if (!$basepage) { return $this->error("$basepage unset?"); } include_once("lib/BlockParser.php"); - $page = $request->getPage($basepage); + $page = $request->getPage($basepage); return HTML::div(array('class'=>'boxright'), TransformText($argstr)); } Modified: trunk/lib/plugin/CacheTest.php =================================================================== --- trunk/lib/plugin/CacheTest.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/CacheTest.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -2,7 +2,7 @@ rcs_id('$Id$'); /* * Copyright (C) 2002 Johannes Große - * + * * This file is part of PhpWiki. * * PhpWiki is free software; you can redistribute it and/or modify Modified: trunk/lib/plugin/Calendar.php =================================================================== --- trunk/lib/plugin/Calendar.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/Calendar.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -59,21 +59,21 @@ 'month_format' => '%B %Y', 'wday_format' => '%a', 'start_wday' => '1', // start now with Monday - 'display_weeknum' => 0); + 'display_weeknum' => 0); } /** - * return links (static only as of action=edit) + * return links (static only as of action=edit) * * @param string $argstr The plugin argument string. * @param string $basepage The pagename the plugin is invoked from. * @return array List of pagenames linked to (or false). */ function getWikiPageLinks ($argstr, $basepage) { - if (isset($this->_links)) + if (isset($this->_links)) return $this->_links; else { - global $request; + global $request; $this->run($request->_dbi, $argstr, $request, $basepage); return $this->_links; } @@ -126,7 +126,7 @@ $fs = $this->args['wday_format']; $row = HTML::tr(); $row->setattr('class', 'cal-dayname'); - if ($this->args['display_weeknum']) + if ($this->args['display_weeknum']) $row->pushContent(HTML::td(array('class' => 'cal-dayname', 'align' => 'center'), _("Wk"))); @@ -197,7 +197,7 @@ 1, // mday (1-31) $args['year']); - $colnum = $args['display_weeknum'] ? 8 : 7; + $colnum = $args['display_weeknum'] ? 8 : 7; $cal = HTML::table(array('cellspacing' => 0, 'cellpadding' => 2, 'class' => 'cal'), @@ -216,9 +216,9 @@ $tbody = HTML::tbody(); $row = HTML::tr(); - if ($args['display_weeknum']) + if ($args['display_weeknum']) $row->pushContent(HTML::td(array('class' => 'cal-weeknum'), - ((int)strftime("%U", $time))+1)); // %U problem. starts with 0 + ((int)strftime("%U", $time))+1)); // %U problem. starts with 0 $col = (7 + $t['tm_wday'] - $args['start_wday']) % 7; if ($col > 0) $row->pushContent(HTML::td(array('colspan' => $col))); @@ -235,9 +235,9 @@ $time += SECONDS_PER_DAY; $t = localtime($time, 1); $done = $t['tm_mday'] == 1; - if (!$col and !$done and $args['display_weeknum']) - $row->pushContent(HTML::td(array('class' => 'cal-weeknum'), - ((int)strftime("%U", $time))+1)); // starts with 0 + if (!$col and !$done and $args['display_weeknum']) + $row->pushContent(HTML::td(array('class' => 'cal-weeknum'), + ((int)strftime("%U", $time))+1)); // starts with 0 } if ($row->getContent()) { Modified: trunk/lib/plugin/CalendarList.php =================================================================== --- trunk/lib/plugin/CalendarList.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/CalendarList.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -22,19 +22,19 @@ */ // if not defined in config.ini -if (!defined('PLUGIN_CALENDARLIST_ORDER')) - define('PLUGIN_CALENDARLIST_ORDER', 'normal'); +if (!defined('PLUGIN_CALENDARLIST_ORDER')) + define('PLUGIN_CALENDARLIST_ORDER', 'normal'); if (!defined('PLUGIN_CALENDARLIST_NEXT_N_DAYS')) define('PLUGIN_CALENDARLIST_NEXT_N_DAYS',''); -if (!defined('PLUGIN_CALENDARLIST_NEXT_N')) - define('PLUGIN_CALENDARLIST_NEXT_N', ''); +if (!defined('PLUGIN_CALENDARLIST_NEXT_N')) + define('PLUGIN_CALENDARLIST_NEXT_N', ''); if (!defined('PLUGIN_CALENDARLIST_LAST_N_DAYS')) define('PLUGIN_CALENDARLIST_LAST_N_DAYS',''); -if (!defined('PLUGIN_CALENDARLIST_LAST_N')) - define('PLUGIN_CALENDARLIST_LAST_N', ''); +if (!defined('PLUGIN_CALENDARLIST_LAST_N')) + define('PLUGIN_CALENDARLIST_LAST_N', ''); /** - * This is a list of calendar appointments. + * This is a list of calendar appointments. * Same arguments as Calendar, so no one is confused * Uses <dl><dd>DATE<dt>page contents... * Derived from Calendar.php by Martin Norbäck <ma...@sa...> @@ -66,16 +66,16 @@ function getDefaultArguments() { return array('prefix' => '[pagename]', 'date_format' => '%Y-%m-%d', - 'order' => PLUGIN_CALENDARLIST_ORDER, // normal or reverse (report sequence) + 'order' => PLUGIN_CALENDARLIST_ORDER, // normal or reverse (report sequence) 'year' => '', 'month' => '', 'month_offset' => 0, //support ranges: next n days/events - 'next_n_days' => PLUGIN_CALENDARLIST_NEXT_N_DAYS, // one or the other, not both - 'next_n' => PLUGIN_CALENDARLIST_NEXT_N, + 'next_n_days' => PLUGIN_CALENDARLIST_NEXT_N_DAYS, // one or the other, not both + 'next_n' => PLUGIN_CALENDARLIST_NEXT_N, // last n days/entries: - 'last_n_days' => PLUGIN_CALENDARLIST_LAST_N_DAYS, // one or the other, not both - 'last_n' => PLUGIN_CALENDARLIST_LAST_N, + 'last_n_days' => PLUGIN_CALENDARLIST_LAST_N_DAYS, // one or the other, not both + 'last_n' => PLUGIN_CALENDARLIST_LAST_N, 'month_format' => '%B %Y', 'wday_format' => '%a', @@ -83,40 +83,40 @@ } /** - * return links (static only as of action=edit) + * return links (static only as of action=edit) * * @param string $argstr The plugin argument string. * @param string $basepage The pagename the plugin is invoked from. * @return array List of pagenames linked to (or false). */ function getWikiPageLinks ($argstr, $basepage) { - if (isset($this->_links)) + if (isset($this->_links)) return $this->_links; else { - global $request; + global $request; $this->run($request->_dbi, $argstr, $request, $basepage); return $this->_links; } } function _count_events($dbi, $n = 7, $direction = 1) { - // This is used by the last_n/next_n options to determine the date that - // accounts for the number of N events in the past/future. - // RETURNS: date of N-th event or the last item found - $args = &$this->args; // gather the args array - $timeTMP = time(); // start with today's date - $t = $timeTMP; // init the control date variable to now - - for ($i=0; $i<=180; $i++) { // loop thru 180 days, past or future + // This is used by the last_n/next_n options to determine the date that + // accounts for the number of N events in the past/future. + // RETURNS: date of N-th event or the last item found + $args = &$this->args; // gather the args array + $timeTMP = time(); // start with today's date + $t = $timeTMP; // init the control date variable to now + + for ($i=0; $i<=180; $i++) { // loop thru 180 days, past or future $date_string = strftime($args['date_format'], $t); $page_for_date = $args['prefix'] . SUBPAGE_SEPARATOR . $date_string; if ($dbi->isWikiPage($page_for_date)) { // if this date has any comments/events - $timeTMP = $t; // capture the date of this event for return - if ($n-- <= 0) break; // if we reached the limit, return the date + $timeTMP = $t; // capture the date of this event for return + if ($n-- <= 0) break; // if we reached the limit, return the date } - $t += 24 * 3600 * $direction; // advance one day back or forward + $t += 24 * 3600 * $direction; // advance one day back or forward } - + // return the date of the N-th or last, most past/future event in the range return $timeTMP; } @@ -168,7 +168,7 @@ } $base = mktime(0, 0, 0, // h, m, s $args['month'], // month 1-12 - $args['mday'], + $args['mday'], $args['year']); // must have base 1900 // *************************************************** @@ -223,7 +223,7 @@ for ($i = $start; ($step > 0) ? $i < $end : $i > $end; $i += $step) { $cal->pushContent($this->_date($dbi, $i)); } - // end of Plugin CalendarList display logic + // end of Plugin CalendarList display logic // *************************************************** return $cal; Modified: trunk/lib/plugin/Chart.php =================================================================== --- trunk/lib/plugin/Chart.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/Chart.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -62,12 +62,12 @@ function getDefaultArguments() { return array('width' => 200, 'height' => 200, - 'type' => 'line', // or 'area', 'bar', 'pie' + 'type' => 'line', // or 'area', 'bar', 'pie' // 'xlabel' => 'x', // TODO // 'ylabel' => 'y', // TODO - 'color' => 'green', - // 'legend' => false, // TODO - 'data' => false // mandatory + 'color' => 'green', + // 'legend' => false, // TODO + 'data' => false // mandatory ); } function handle_plugin_args_cruft(&$argstr, &$args) { @@ -140,9 +140,9 @@ } } - $embedargs = array('width' => $args['width'], - 'height' => $args['height'], - 'script' => $source); + $embedargs = array('width' => $args['width'], + 'height' => $args['height'], + 'script' => $source); $embed = new SVG_HTML("embed", $embedargs); $html->pushContent($embed); return $html; Modified: trunk/lib/plugin/CreateBib.php =================================================================== --- trunk/lib/plugin/CreateBib.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/CreateBib.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -23,9 +23,9 @@ /** * CreateBib: Automatically create a BibTex file from page * - * Usage: + * Usage: * <?plugin CreateBib pagename||=whatever ?> - * + * * @author: Lea Viljanen */ @@ -52,18 +52,18 @@ function preg_quote ($heading) { return str_replace(array("/",".","?","*"), - array('\/','\.','\?','\*'), $heading); + array('\/','\.','\?','\*'), $heading); } - + // Have to include the $starttag and $endtag to the regexps... - function extractBibTeX (&$content, $starttag, $endtag) + function extractBibTeX (&$content, $starttag, $endtag) { $bib = array(); $start = false; $stop = false; - for ($i=0; $i<count($content); $i++) + for ($i=0; $i<count($content); $i++) { // $starttag shows when to start if (preg_match('/^@/',$content[$i],$match)) { @@ -87,7 +87,7 @@ $articles = array(); for ($i=0; $i<count($content); $i++) { // Should match "* [WikiPageName] whatever" - //if (preg_match('/^\s*\*\s+(\[.+\])/',$content[$i],$match)) + //if (preg_match('/^\s*\*\s+(\[.+\])/',$content[$i],$match)) if (preg_match('/^\s*\*\s+\[(.+)\]/',$content[$i],$match)) { $articles[] = $match[1]; @@ -95,8 +95,8 @@ } return $articles; } - + function dumpFile(&$thispage, $filename) { include_once("lib/loadsave.php"); $mailified = MailifyPage($thispage); @@ -126,14 +126,14 @@ $current = $page->getCurrentRevision(); $content = $current->getContent(); - // Prepare the button to trigger dumping - $dump_url = $request->getURLtoSelf(array("file" => "tube.bib")); + // Prepare the button to trigger dumping + $dump_url = $request->getURLtoSelf(array("file" => "tube.bib")); global $WikiTheme; - $dump_button = $WikiTheme->makeButton("To File", - $dump_url , 'foo'); + $dump_button = $WikiTheme->makeButton("To File", + $dump_url , 'foo'); $html = HTML::div(array('class' => 'bib','align' => 'left')); - $html->pushContent($dump_button, ' '); + $html->pushContent($dump_button, ' '); $list = HTML::pre(array('id'=>'biblist', 'class' => 'bib')); // Let's find the subpages @@ -162,7 +162,7 @@ $c = $p->getCurrentRevision(); $pagedata = $c->getContent(); $this->dumpFile($pagedata, $request->getArg('file')); - } + } return $html; } Modified: trunk/lib/plugin/CreatePage.php =================================================================== --- trunk/lib/plugin/CreatePage.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/CreatePage.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -21,12 +21,12 @@ */ /** - * This allows you to create a page getting the new pagename from a - * forms-based interface, and optionally with the initial content from - * some template, plus expansion of some variables via %%variable%% statements + * This allows you to create a page getting the new pagename from a + * forms-based interface, and optionally with the initial content from + * some template, plus expansion of some variables via %%variable%% statements * in the template. * - * Put <?plugin-form CreatePage ?> at some page, browse this page, + * Put <?plugin-form CreatePage ?> at some page, browse this page, * enter the name of the page to create, then click the button. * * Usage: <?plugin-form CreatePage template=SomeTemplatePage vars="year=2004&name=None" ?> @@ -69,45 +69,45 @@ $s = trim($s); if (!$s) { return $this->error(_("Cannot create page with empty name!")); - } - // TODO: javascript warning if "/" or SUBPAGE_SEPARATOR in s - if ($verify) { - $head = _("CreatePage failed"); - if ($dbi->isWikiPage($verify)) { - $msg = _("Do you really want to create the page '%s'?"); - } else { - $msg = _("Do you really want to create the page '%s'?"); - } - if (isSubPage($s)) { - $main = subPageSlice(0); - if (!$dbi->isWikiPage(subPageSlice(0))) { - $msg .= "\n" . _("The new page you want to create will be a subpage.") - . "\n" . _("Subpages cannot be created unless the parent page exists."); - return alert($head, $msg); - } else { - $msg .= "\n" . _("The new page you want to create will be a subpage."); - } - } - if (strpos($s, " \/")) { - $msg .= "\n" . _("Subpages with ending space are not allowed as directory name on Windows."); - return alert($head, $msg); - } - } + } + // TODO: javascript warning if "/" or SUBPAGE_SEPARATOR in s + if ($verify) { + $head = _("CreatePage failed"); + if ($dbi->isWikiPage($verify)) { + $msg = _("Do you really want to create the page '%s'?"); + } else { + $msg = _("Do you really want to create the page '%s'?"); + } + if (isSubPage($s)) { + $main = subPageSlice(0); + if (!$dbi->isWikiPage(subPageSlice(0))) { + $msg .= "\n" . _("The new page you want to create will be a subpage.") + . "\n" . _("Subpages cannot be created unless the parent page exists."); + return alert($head, $msg); + } else { + $msg .= "\n" . _("The new page you want to create will be a subpage."); + } + } + if (strpos($s, " \/")) { + $msg .= "\n" . _("Subpages with ending space are not allowed as directory name on Windows."); + return alert($head, $msg); + } + } $param = array('action' => 'edit'); if ($template and $dbi->isWikiPage($template)) { $param['template'] = $template; - } elseif (!empty($initial_content)) { + } elseif (!empty($initial_content)) { // Warning! Potential URI overflow here on the GET redirect. Better use template. $param['initial_content'] = $initial_content; } - // If the initial_content is too large, pre-save the content in the page + // If the initial_content is too large, pre-save the content in the page // and redirect without that argument. // URI length limit: // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.2.1 $url = WikiURL($s, $param, 'absurl'); // FIXME: expand vars in templates here. - if (strlen($url) > 255 + if (strlen($url) > 255 or ($param['template']) or preg_match('/%%\w+%%/', $initial_content)) // need variable expansion { @@ -116,7 +116,7 @@ $page = $dbi->getPage($s); $current = $page->getCurrentRevision(); $version = $current->getVersion(); - // overwrite empty (deleted) pages + // overwrite empty (deleted) pages if ($version and !$current->hasDefaultContents() and !$overwrite) { return $this->error(fmt("%s already exists", WikiLink($s))); } else { @@ -129,15 +129,15 @@ $initial_content = $currenttmpl->getPackedContent(); $meta['markup'] = $currenttmpl->_data['markup']; - if (preg_match('/<noinclude>.+<\/noinclude>/s', $initial_content)) { - $initial_content = preg_replace("/<noinclude>.+?<\/noinclude>/s", "", - $initial_content); - } + if (preg_match('/<noinclude>.+<\/noinclude>/s', $initial_content)) { + $initial_content = preg_replace("/<noinclude>.+?<\/noinclude>/s", "", + $initial_content); + } } $meta['summary'] = _("Created by CreatePage"); - $content = $this->doVariableExpansion($initial_content, $vars, $s, $request); + $content = $this->doVariableExpansion($initial_content, $vars, $s, $request); - if ($content !== $initial_content) { + if ($content !== $initial_content) { // need to destroy the template so that editpage doesn't overwrite it. unset($param['template']); $url = WikiURL($s, $param, 'absurl'); Modified: trunk/lib/plugin/CreateToc.php =================================================================== --- trunk/lib/plugin/CreateToc.php 2010-03-04 10:30:39 UTC (rev 7301) +++ trunk/lib/plugin/CreateToc.php 2010-03-04 10:48:07 UTC (rev 7302) @@ -130,7 +130,7 @@ function preg_quote ($heading) { return str_replace(array("/",".","?","*"), - array('\/','\.','\?','\*'), $heading); + array('\/','\.','\?','\*'), $heading); } // Get HTML header corresponding to current level (level is set of ! or =) @@ -173,55 +173,55 @@ $level, &$hstart, &$hend, $basepage=false) { $hstart = 0; $hend = 0; - $h = $this->_getHeader($level); + $h = $this->_getHeader($level); $qheading = $this->_quote($heading); - for ($j=$start_index; $j < count($content); $j++) { + for ($j=$start_index; $j < count($content); $j++) { if (is_string($content[$j])) { - if (preg_match("/<$h>$qheading<\/$h>/", - $content[$j])) - return $j; + if (preg_match("/<$h>$qheading<\/$h>/", + $content[$j])) + return $j; } elseif (isa($content[$j], 'cached_link')) { - if (method_exists($content[$j],'asXML')) { - $content[$j]->_basepage = $basepage; - $content[$j] = $content[$j]->asXML(); - } else - $content[$j] = $content[$j]->asString(); - // shortcut for single wikiword or link headers - if ($content[$j] == $heading - and substr($content[$j-1],-4,4) == "<$h>" - and substr($content[$j+1],0,5) == "</$h>") - { - $hstart = $j-1; - $hend = $j+1; - retur... [truncated message content] |
From: <var...@us...> - 2010-03-04 10:30:46
|
Revision: 7301 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7301&view=rev Author: vargenau Date: 2010-03-04 10:30:39 +0000 (Thu, 04 Mar 2010) Log Message: ----------- Replace tabs by spaces; remove EOL spaces Modified Paths: -------------- trunk/lib/WikiUser/AdoDb.php trunk/lib/WikiUser/BogoLogin.php trunk/lib/WikiUser/Db.php trunk/lib/WikiUser/EMailConfirm.php trunk/lib/WikiUser/Facebook.php trunk/lib/WikiUser/File.php trunk/lib/WikiUser/Forbidden.php trunk/lib/WikiUser/GForge.php trunk/lib/WikiUser/HttpAuth.php trunk/lib/WikiUser/HttpAuthUpper.php trunk/lib/WikiUser/IMAP.php trunk/lib/WikiUser/LDAP.php trunk/lib/WikiUser/LdapUpper.php trunk/lib/WikiUser/OpenID.php trunk/lib/WikiUser/POP3.php trunk/lib/WikiUser/PdoDb.php trunk/lib/WikiUser/PearDb.php trunk/lib/WikiUser/PersonalPage.php trunk/lib/WikiUser/Session.php Modified: trunk/lib/WikiUser/AdoDb.php =================================================================== --- trunk/lib/WikiUser/AdoDb.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/AdoDb.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -12,7 +12,7 @@ * ADODB methods * Simple sprintf, no prepare. * - * Warning: Since we use FETCH_MODE_ASSOC (string hash) and not the also faster + * Warning: Since we use FETCH_MODE_ASSOC (string hash) and not the also faster * FETCH_MODE_ROW (numeric), we have to use the correct aliases in auth_* sql statements! * * TODO: Change FETCH_MODE in adodb WikiDB sublasses. @@ -78,28 +78,28 @@ if (!$id_only and isset($this->_prefs->_update)) { $this->getAuthDbh(); $dbh = &$this->_auth_dbi; - // check if the user already exists (not needed with mysql REPLACE) - $rs = $dbh->Execute(sprintf($this->_prefs->_select, $dbh->qstr($this->_userid))); - if ($rs->EOF) { - $rs->Close(); - $prefs_blob = false; - } else { - $prefs_blob = @$rs->fields['prefs']; - $rs->Close(); - } - if ($prefs_blob) { - $db_result = $dbh->Execute(sprintf($this->_prefs->_update, - $dbh->qstr($packed), - $dbh->qstr($this->_userid))); - } else { - // Otherwise, insert a record for them and set it to the defaults. - $dbi = $request->getDbh(); - $this->_prefs->_insert = $this->prepare($dbi->getAuthParam('pref_insert'), - array("pref_blob", "userid")); - $db_result = $dbh->Execute(sprintf($this->_prefs->_insert, - $dbh->qstr($packed), - $dbh->qstr($this->_userid))); - } + // check if the user already exists (not needed with mysql REPLACE) + $rs = $dbh->Execute(sprintf($this->_prefs->_select, $dbh->qstr($this->_userid))); + if ($rs->EOF) { + $rs->Close(); + $prefs_blob = false; + } else { + $prefs_blob = @$rs->fields['prefs']; + $rs->Close(); + } + if ($prefs_blob) { + $db_result = $dbh->Execute(sprintf($this->_prefs->_update, + $dbh->qstr($packed), + $dbh->qstr($this->_userid))); + } else { + // Otherwise, insert a record for them and set it to the defaults. + $dbi = $request->getDbh(); + $this->_prefs->_insert = $this->prepare($dbi->getAuthParam('pref_insert'), + array("pref_blob", "userid")); + $db_result = $dbh->Execute(sprintf($this->_prefs->_insert, + $dbh->qstr($packed), + $dbh->qstr($this->_userid))); + } $db_result->Close(); // delete pageprefs: if ($this->_HomePagehandle and $this->_HomePagehandle->get('pref')) @@ -113,7 +113,7 @@ } return 0; } - + function userExists() { $this->getAuthDbh(); $dbh = &$this->_auth_dbi; @@ -126,11 +126,11 @@ $dbi =& $GLOBALS['request']->_dbi; // Prepare the configured auth statements if ($dbi->getAuthParam('auth_check') and empty($this->_authselect)) { - $this->_authselect = $this->prepare($dbi->getAuthParam('auth_check'), + $this->_authselect = $this->prepare($dbi->getAuthParam('auth_check'), array("password", "userid")); } //NOTE: for auth_crypt_method='crypt' no special auth_user_exists is needed - if ( !$dbi->getAuthParam('auth_user_exists') + if ( !$dbi->getAuthParam('auth_user_exists') and $this->_auth_crypt_method == 'crypt' and $this->_authselect) { @@ -146,7 +146,7 @@ if (! $dbi->getAuthParam('auth_user_exists')) trigger_error(fmt("%s is missing", 'DBAUTH_AUTH_USER_EXISTS'), E_USER_WARNING); - $this->_authcheck = $this->prepare($dbi->getAuthParam('auth_user_exists'), + $this->_authcheck = $this->prepare($dbi->getAuthParam('auth_user_exists'), 'userid'); $rs = $dbh->Execute(sprintf($this->_authcheck, $dbh->qstr($this->_userid))); if (!$rs->EOF) { @@ -157,16 +157,16 @@ } } // User does not exist yet. - // Maybe the user is allowed to create himself. Generally not wanted in - // external databases, but maybe wanted for the wiki database, for performance + // Maybe the user is allowed to create himself. Generally not wanted in + // external databases, but maybe wanted for the wiki database, for performance // reasons if (empty($this->_authcreate) and $dbi->getAuthParam('auth_create')) { $this->_authcreate = $this->prepare($dbi->getAuthParam('auth_create'), array("password", "userid")); } - if (!empty($this->_authcreate) and + if (!empty($this->_authcreate) and isset($GLOBALS['HTTP_POST_VARS']['auth']) and - isset($GLOBALS['HTTP_POST_VARS']['auth']['passwd'])) + isset($GLOBALS['HTTP_POST_VARS']['auth']['passwd'])) { $passwd = $GLOBALS['HTTP_POST_VARS']['auth']['passwd']; $dbh->Execute(sprintf($this->_authcreate, @@ -174,7 +174,7 @@ $dbh->qstr($this->_userid))); return true; } - + return $this->_tryNextUser(); } @@ -205,8 +205,8 @@ E_USER_WARNING); //NOTE: for auth_crypt_method='crypt' defined('ENCRYPTED_PASSWD',true) must be set if ($this->_auth_crypt_method == 'crypt') { - $rs = $dbh->Execute(sprintf($this->_authselect, - $dbh->qstr($this->_userid))); + $rs = $dbh->Execute(sprintf($this->_authselect, + $dbh->qstr($this->_userid))); if (!$rs->EOF) { $stored_password = $rs->fields['password']; $rs->Close(); @@ -233,7 +233,7 @@ $result = !empty($okay); } - if ($result) { + if ($result) { $this->_level = WIKIAUTH_USER; return $this->_level; } elseif (USER_AUTH_POLICY === 'strict') { Modified: trunk/lib/WikiUser/BogoLogin.php =================================================================== --- trunk/lib/WikiUser/BogoLogin.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/BogoLogin.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -4,13 +4,13 @@ * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) */ -/** Without stored password. A _BogoLoginPassUser with password +/** Without stored password. A _BogoLoginPassUser with password * is automatically upgraded to a PersonalPagePassUser. */ class _BogoLoginPassUser extends _PassUser { var $_authmethod = 'BogoLogin'; - + function userExists() { if (isWikiWord($this->_userid)) { $this->_level = WIKIAUTH_BOGO; Modified: trunk/lib/WikiUser/Db.php =================================================================== --- trunk/lib/WikiUser/Db.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/Db.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -13,15 +13,15 @@ * libnss-mysql. * * We support only the SQL and ADODB backends. - * The other WikiDB backends (flat, cvs, dba, ...) should be used for pages, - * not for auth stuff. If one would like to use e.g. dba for auth, he should - * use PearDB (SQL) with the right $DBAuthParam['auth_dsn']. - * (Not supported yet, since we require SQL. SQLite would make since when + * The other WikiDB backends (flat, cvs, dba, ...) should be used for pages, + * not for auth stuff. If one would like to use e.g. dba for auth, he should + * use PearDB (SQL) with the right $DBAuthParam['auth_dsn']. + * (Not supported yet, since we require SQL. SQLite would make since when * it will come to PHP) * * @tables: user, pref * - * Preferences are handled in the parent class _PassUser, because the + * Preferences are handled in the parent class _PassUser, because the * previous classes may also use DB pref_select and pref_update. * * Flat files auth is handled by the auth method "File". @@ -31,7 +31,7 @@ { var $_authselect, $_authupdate, $_authcreate; - // This can only be called from _PassUser, because the parent class + // This can only be called from _PassUser, because the parent class // sets the auth_dbi and pref methods, before this class is initialized. function _DbPassUser($UserName='',$prefs=false) { if (!$this->_prefs) { @@ -81,7 +81,7 @@ return false; } - /* Since we properly quote the username, we allow most chars here. + /* Since we properly quote the username, we allow most chars here. Just " ; and ' is forbidden, max length: 48 as defined in the schema. */ function isValidName ($userid = false) { Modified: trunk/lib/WikiUser/EMailConfirm.php =================================================================== --- trunk/lib/WikiUser/EMailConfirm.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/EMailConfirm.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -7,7 +7,7 @@ class _EMailConfirmPassUser extends _PassUser /** - * Unconfirmed users have ANON access, + * Unconfirmed users have ANON access, * confirmed users are equal to passusers WIKIAUTH_USER. * * Users give their email at registration, phpwiki sends a link per email, @@ -16,7 +16,7 @@ * Preferences are handled in _PassUser */ { - // This can only be called from _PassUser, because the parent class + // This can only be called from _PassUser, because the parent class // sets the pref methods, before this class is initialized. function _EMailConfirmPassUser($UserName='', $prefs=false, $file='') { if (!$this->_prefs and isa($this, "_EMailPassUser")) { Modified: trunk/lib/WikiUser/Facebook.php =================================================================== --- trunk/lib/WikiUser/Facebook.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/Facebook.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -26,12 +26,12 @@ $web = new HttpClient("www.facebook.com", 80); if (DEBUG & _DEBUG_LOGIN) $web->setDebug(true); // collect cookies from http://www.facebook.com/login.php - $web->persist_cookies = true; + $web->persist_cookies = true; $web->cookie_host = 'www.facebook.com'; $firstlogin = $web->get("/login.php"); if (!$firstlogin) { if (DEBUG & (_DEBUG_LOGIN | _DEBUG_VERBOSE)) - trigger_error(sprintf(_("Facebook connect failed with %d %s"), + trigger_error(sprintf(_("Facebook connect failed with %d %s"), $web->status, $web->errormsg), E_USER_WARNING); } @@ -45,7 +45,7 @@ E_USER_WARNING); } $this->_authmethod = 'Facebook'; - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => $retval", + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => $retval", E_USER_WARNING); if ($retval) { $this->_level = WIKIAUTH_USER; @@ -62,8 +62,8 @@ E_USER_WARNING); return $this->_tryNextUser(); } - if (DEBUG & _DEBUG_LOGIN) - trigger_error(get_class($this)."::userExists => true (dummy)", E_USER_WARNING); + if (DEBUG & _DEBUG_LOGIN) + trigger_error(get_class($this)."::userExists => true (dummy)", E_USER_WARNING); return true; } } Modified: trunk/lib/WikiUser/File.php =================================================================== --- trunk/lib/WikiUser/File.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/File.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -15,7 +15,7 @@ { var $_file, $_may_change; - // This can only be called from _PassUser, because the parent class + // This can only be called from _PassUser, because the parent class // sets the pref methods, before this class is initialized. function _FilePassUser($UserName='', $prefs=false, $file='') { if (!$this->_prefs and isa($this, "_FilePassUser")) { @@ -29,7 +29,7 @@ if (empty($file) and defined('AUTH_USER_FILE')) $file = AUTH_USER_FILE; // same style as in main.php - include_once(dirname(__FILE__)."/../pear/File_Passwd.php"); + include_once(dirname(__FILE__)."/../pear/File_Passwd.php"); // "__PHP_Incomplete_Class" if (!empty($file) or empty($this->_file) or !isa($this->_file, "File_Passwd")) $this->_file = new File_Passwd($file, false, $file.'.lock'); @@ -37,7 +37,7 @@ return false; return $this; } - + function mayChangePass() { return $this->_may_change; } @@ -49,7 +49,7 @@ $this->_authmethod = 'File'; if (isset($this->_file->users[$this->_userid])) return true; - + return $this->_tryNextUser(); } @@ -69,7 +69,7 @@ $this->_level = WIKIAUTH_ADMIN; return $this->_level; } - + return $this->_tryNextPass($submitted_password); } @@ -78,7 +78,7 @@ return false; } if ($this->_may_change) { - $this->_file = new File_Passwd($this->_file->filename, true, + $this->_file = new File_Passwd($this->_file->filename, true, $this->_file->filename.'.lock'); $result = $this->_file->modUser($this->_userid, $submitted_password); $this->_file->close(); Modified: trunk/lib/WikiUser/Forbidden.php =================================================================== --- trunk/lib/WikiUser/Forbidden.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/Forbidden.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -4,8 +4,8 @@ * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) */ -/** - * The PassUser name gets created automatically. +/** + * The PassUser name gets created automatically. * That's why this class is empty, but must exist. */ class _ForbiddenPassUser Modified: trunk/lib/WikiUser/GForge.php =================================================================== --- trunk/lib/WikiUser/GForge.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/GForge.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -4,30 +4,30 @@ * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) */ -/** Call the gforge functions to get the username - * +/** Call the gforge functions to get the username + * */ class _GForgePassUser extends _PassUser { var $_is_external = 0; - + function _GForgePassUser($UserName='',$prefs=false) { - if ($prefs) $this->_prefs = $prefs; + if ($prefs) $this->_prefs = $prefs; if (!isset($this->_prefs->_method)) _PassUser::_PassUser($UserName); if ($UserName) $this->_userid = $UserName; $this->_authmethod = 'GForge'; - - // Is this double check really needed? + + // Is this double check really needed? // It is not expensive so we keep it for now. if ($this->userExists()) return $this; - else + else return $GLOBALS['ForbiddenUser']; } function userExists() { - global $group_id; + global $group_id; // Mapping (phpWiki vs GForge) performed is: // ANON for non logged or non member @@ -37,7 +37,7 @@ // Get project object (if error => ANON) $project =& group_get_object($group_id); - + if (!$project || !is_object($project)) { $this->_level = WIKIAUTH_ANON; return false; @@ -56,7 +56,7 @@ $member = $perm->isMember(); } - if ($member) { + if ($member) { $this->_userid = $user->getRealName(); $this->_is_external = $user->getIsExternal(); if ($perm->isAdmin()) { @@ -67,12 +67,12 @@ return $this; } } - $this->_level = WIKIAUTH_ANON; - return false; + $this->_level = WIKIAUTH_ANON; + return false; } function checkPass($submitted_password) { - return $this->userExists() + return $this->userExists() ? ($this->isAdmin() ? WIKIAUTH_ADMIN : WIKIAUTH_USER) : WIKIAUTH_ANON; } Modified: trunk/lib/WikiUser/HttpAuth.php =================================================================== --- trunk/lib/WikiUser/HttpAuth.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/HttpAuth.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -6,12 +6,12 @@ /** * We have two possibilities here. - * 1) The webserver location is already HTTP protected. Usually Basic, but also + * 1) The webserver location is already HTTP protected. Usually Basic, but also * NTLM or Digest. Then just use this username and do nothing. * 2) The webserver location is not protected, so we enforce basic HTTP Protection * by sending a 401 error and let the client display the login dialog. * This makes only sense if HttpAuth is the last method in USER_AUTH_ORDER, - * since the other methods cannot be transparently called after this enforced + * since the other methods cannot be transparently called after this enforced * external dialog. * Try the available auth methods (most likely Bogo) and sent this header back. * header('Authorization: Basic '.base64_encode("$userid:$passwd")."\r\n"; @@ -25,8 +25,8 @@ _PassUser::_PassUser($UserName); if ($UserName) $this->_userid = $UserName; $this->_authmethod = 'HttpAuth'; - - // Is this double check really needed? + + // Is this double check really needed? // It is not expensive so we keep it for now. if ($this->userExists()) { return $this; @@ -38,8 +38,8 @@ // FIXME! This doesn't work yet! // Allow httpauth by other method: Admin for now only function _fake_auth($userid, $passwd) { - return false; - + return false; + header('WWW-Authenticate: Basic realm="'.WIKI_NAME.'"'); header("Authorization: Basic ".base64_encode($userid.":".$passwd)); if (!isset($_SERVER)) @@ -53,14 +53,14 @@ function logout() { if (!isset($_SERVER)) $_SERVER =& $GLOBALS['HTTP_SERVER_VARS']; - // Maybe we should random the realm to really force a logout. + // Maybe we should random the realm to really force a logout. // But the next login will fail. // better_srand(); $realm = microtime().rand(); // TODO: On AUTH_TYPE=NTLM this will fail. Only Basic supported so far. header('WWW-Authenticate: Basic realm="'.WIKI_NAME.'"'); if (strstr(php_sapi_name(), 'apache')) - header('HTTP/1.0 401 Unauthorized'); - else + header('HTTP/1.0 401 Unauthorized'); + else header("Status: 401 Access Denied"); //IIS and CGI need that unset($GLOBALS['REMOTE_USER']); unset($_SERVER['PHP_AUTH_USER']); @@ -70,30 +70,30 @@ function _http_username() { if (!isset($_SERVER)) $_SERVER =& $GLOBALS['HTTP_SERVER_VARS']; - if (!empty($_SERVER['PHP_AUTH_USER'])) - return $_SERVER['PHP_AUTH_USER']; - if (!empty($_SERVER['REMOTE_USER'])) - return $_SERVER['REMOTE_USER']; + if (!empty($_SERVER['PHP_AUTH_USER'])) + return $_SERVER['PHP_AUTH_USER']; + if (!empty($_SERVER['REMOTE_USER'])) + return $_SERVER['REMOTE_USER']; if (!empty($GLOBALS['HTTP_ENV_VARS']['REMOTE_USER'])) - return $GLOBALS['HTTP_ENV_VARS']['REMOTE_USER']; - if (!empty($GLOBALS['REMOTE_USER'])) - return $GLOBALS['REMOTE_USER']; - // IIS + Basic - if (!empty($_SERVER['HTTP_AUTHORIZATION'])) { - list($userid, $passwd) = explode(':', + return $GLOBALS['HTTP_ENV_VARS']['REMOTE_USER']; + if (!empty($GLOBALS['REMOTE_USER'])) + return $GLOBALS['REMOTE_USER']; + // IIS + Basic + if (!empty($_SERVER['HTTP_AUTHORIZATION'])) { + list($userid, $passwd) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6))); return $userid; - } - return ''; + } + return ''; } - + // force http auth authorization function userExists() { if (!isset($_SERVER)) $_SERVER =& $GLOBALS['HTTP_SERVER_VARS']; $username = $this->_http_username(); - if (strstr($username, "\\") - and isset($_SERVER['AUTH_TYPE']) + if (strstr($username, "\\") + and isset($_SERVER['AUTH_TYPE']) and $_SERVER['AUTH_TYPE'] == 'NTLM') { // allow domain\user, change userid to domain/user @@ -103,7 +103,7 @@ } // FIXME: if AUTH_TYPE = NTLM there's a domain\\name <> domain\name mismatch if (empty($username) - or strtolower($username) != strtolower($this->_userid)) + or strtolower($username) != strtolower($this->_userid)) { $this->logout(); $user = $GLOBALS['ForbiddenUser']; @@ -113,17 +113,17 @@ //exit; } $this->_userid = $username; - // we should check if he is a member of admin, + // we should check if he is a member of admin, // because HttpAuth has its own logic. $this->_level = WIKIAUTH_USER; if ($this->isAdmin()) $this->_level = WIKIAUTH_ADMIN; return $this; } - + // ignore password, this is checked by the webservers http auth. function checkPass($submitted_password) { - return $this->userExists() + return $this->userExists() ? ($this->isAdmin() ? WIKIAUTH_ADMIN : WIKIAUTH_USER) : WIKIAUTH_ANON; } Modified: trunk/lib/WikiUser/HttpAuthUpper.php =================================================================== --- trunk/lib/WikiUser/HttpAuthUpper.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/HttpAuthUpper.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -6,13 +6,13 @@ /** * We have two possibilities here: - * 1) The webserver location is already HTTP protected. - * Usually Basic by some auth module (ldap, mysql, ...), but also NTLM or Digest. + * 1) The webserver location is already HTTP protected. + * Usually Basic by some auth module (ldap, mysql, ...), but also NTLM or Digest. * Then just use this username and do nothing. * 2) The webserver location is not protected, so we enforce basic HTTP Protection * by sending a 401 error and let the client display the login dialog. * This makes only sense if HttpAuth is the last method in USER_AUTH_ORDER, - * since the other methods cannot be transparently called after this enforced + * since the other methods cannot be transparently called after this enforced * external dialog. * Try the available auth methods (most likely Bogo) and sent this header back. * header('Authorization: Basic '.base64_encode("$userid:$passwd")."\r\n"; @@ -24,11 +24,11 @@ if ($prefs) $this->_prefs = $prefs; if (!isset($this->_prefs->_method)) _PassUser::_PassUser($UserName); - if ($UserName) + if ($UserName) $this->_userid = $UserName; $this->_authmethod = 'HttpAuthUpper'; - - // Is this double check really needed? + + // Is this double check really needed? // It is not expensive so we keep it for now. if ($this->userExists()) { return $this; @@ -40,8 +40,8 @@ // FIXME! This doesn't work yet! // Allow httpauth by other method: Admin for now only function _fake_auth($userid, $passwd) { - return false; - + return false; + header('WWW-Authenticate: Basic realm="'.WIKI_NAME.'"'); header("Authorization: Basic ".base64_encode($userid.":".$passwd)); if (!isset($_SERVER)) @@ -55,14 +55,14 @@ function logout() { if (!isset($_SERVER)) $_SERVER =& $GLOBALS['HTTP_SERVER_VARS']; - // Maybe we should random the realm to really force a logout. + // Maybe we should random the realm to really force a logout. // But the next login will fail. // better_srand(); $realm = microtime().rand(); // TODO: On AUTH_TYPE=NTLM this will fail. Only Basic supported so far. header('WWW-Authenticate: Basic realm="'.WIKI_NAME.'"'); if (strstr(php_sapi_name(), 'apache')) - header('HTTP/1.0 401 Unauthorized'); - else + header('HTTP/1.0 401 Unauthorized'); + else header("Status: 401 Access Denied"); //IIS and CGI need that unset($GLOBALS['REMOTE_USER']); unset($_SERVER['PHP_AUTH_USER']); @@ -72,38 +72,38 @@ function _http_username() { if (!isset($_SERVER)) $_SERVER =& $GLOBALS['HTTP_SERVER_VARS']; - if (!empty($_SERVER['PHP_AUTH_USER'])) - return $_SERVER['PHP_AUTH_USER']; - if (!empty($_SERVER['REMOTE_USER'])) - return $_SERVER['REMOTE_USER']; + if (!empty($_SERVER['PHP_AUTH_USER'])) + return $_SERVER['PHP_AUTH_USER']; + if (!empty($_SERVER['REMOTE_USER'])) + return $_SERVER['REMOTE_USER']; if (!empty($GLOBALS['HTTP_ENV_VARS']['REMOTE_USER'])) - return $GLOBALS['HTTP_ENV_VARS']['REMOTE_USER']; - if (!empty($GLOBALS['REMOTE_USER'])) - return $GLOBALS['REMOTE_USER']; - // IIS + Basic - if (!empty($_SERVER['HTTP_AUTHORIZATION'])) { - list($userid, $passwd) = explode(':', + return $GLOBALS['HTTP_ENV_VARS']['REMOTE_USER']; + if (!empty($GLOBALS['REMOTE_USER'])) + return $GLOBALS['REMOTE_USER']; + // IIS + Basic + if (!empty($_SERVER['HTTP_AUTHORIZATION'])) { + list($userid, $passwd) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6))); return $userid; - } - return ''; + } + return ''; } // special: force upcase username function UserName() { if (!empty($this->_userid)) { - $this->_userid = strtoupper($this->_userid); + $this->_userid = strtoupper($this->_userid); return strtoupper($this->_userid); - } + } } - + // force http auth authorization function userExists() { if (!isset($_SERVER)) $_SERVER =& $GLOBALS['HTTP_SERVER_VARS']; $username = strtoupper($this->_http_username()); - if (strstr($username, "\\") - and isset($_SERVER['AUTH_TYPE']) + if (strstr($username, "\\") + and isset($_SERVER['AUTH_TYPE']) and $_SERVER['AUTH_TYPE'] == 'NTLM') { // allow domain\user, change userid to domain/user @@ -113,7 +113,7 @@ } // FIXME: if AUTH_TYPE = NTLM there's a domain\\name <> domain\name mismatch if (empty($username) - or strtolower($username) != strtolower($this->_userid)) + or strtolower($username) != strtolower($this->_userid)) { $this->logout(); $user = $GLOBALS['ForbiddenUser']; @@ -123,17 +123,17 @@ //exit; } $this->_userid = strtoupper($username); - // we should check if he is a member of admin, + // we should check if he is a member of admin, // because HttpAuth has its own logic. $this->_level = WIKIAUTH_USER; if ($this->isAdmin()) $this->_level = WIKIAUTH_ADMIN; return $this; } - + // ignore password, this is checked by the webservers http auth. function checkPass($submitted_password) { - return $this->userExists() + return $this->userExists() ? ($this->isAdmin() ? WIKIAUTH_ADMIN : WIKIAUTH_USER) : WIKIAUTH_ANON; } Modified: trunk/lib/WikiUser/IMAP.php =================================================================== --- trunk/lib/WikiUser/IMAP.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/IMAP.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -14,12 +14,12 @@ { function checkPass($submitted_password) { if (!$this->isValidName()) { - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => failed isValidName", E_USER_WARNING); + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => failed isValidName", E_USER_WARNING); trigger_error(_("Invalid username."),E_USER_WARNING); return $this->_tryNextPass($submitted_password); } if (!$this->_checkPassLength($submitted_password)) { - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => failed checkPassLength", E_USER_WARNING); + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => failed checkPassLength", E_USER_WARNING); return WIKIAUTH_FORBIDDEN; } $userid = $this->_userid; @@ -28,16 +28,16 @@ if ($mbox) { imap_close($mbox); $this->_authmethod = 'IMAP'; - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => ok", E_USER_WARNING); + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => ok", E_USER_WARNING); $this->_level = WIKIAUTH_USER; return $this->_level; } else { if ($submitted_password != "") { // if LENGTH 0 is allowed - trigger_error(_("Unable to connect to IMAP server "). IMAP_AUTH_HOST, + trigger_error(_("Unable to connect to IMAP server "). IMAP_AUTH_HOST, E_USER_WARNING); } } - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => wrong", E_USER_WARNING); + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => wrong", E_USER_WARNING); return $this->_tryNextPass($submitted_password); } @@ -47,15 +47,15 @@ return true; if ($this->checkPass($this->_prefs->get('passwd'))) { - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::userExists => true (pass ok)", E_USER_WARNING); + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::userExists => true (pass ok)", E_USER_WARNING); return true; - } - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::userExists => false (pass wrong)", E_USER_WARNING); + } + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::userExists => false (pass wrong)", E_USER_WARNING); return $this->_tryNextUser(); } function mayChangePass() { - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::mayChangePass => false", E_USER_WARNING); + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::mayChangePass => false", E_USER_WARNING); return false; } } Modified: trunk/lib/WikiUser/LDAP.php =================================================================== --- trunk/lib/WikiUser/LDAP.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/LDAP.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -29,15 +29,15 @@ if (LDAP_AUTH_USER) if (LDAP_AUTH_PASSWORD) // Windows Active Directory Server is strict - $r = ldap_bind($this->_ldap, LDAP_AUTH_USER, LDAP_AUTH_PASSWORD); + $r = ldap_bind($this->_ldap, LDAP_AUTH_USER, LDAP_AUTH_PASSWORD); else - $r = ldap_bind($this->_ldap, LDAP_AUTH_USER); + $r = ldap_bind($this->_ldap, LDAP_AUTH_USER); else $r = true; // anonymous bind allowed if (!$r) { $this->_free(); trigger_error(sprintf(_("Unable to bind LDAP server %s using %s %s"), - LDAP_AUTH_HOST, LDAP_AUTH_USER, LDAP_AUTH_PASSWORD), + LDAP_AUTH_HOST, LDAP_AUTH_USER, LDAP_AUTH_PASSWORD), E_USER_WARNING); return false; } @@ -47,7 +47,7 @@ } } - /** + /** * free and close the bound ressources */ function _free() { @@ -58,7 +58,7 @@ } /** - * LDAP names allow all chars but "*", "(", ")", "\", "NUL". + * LDAP names allow all chars but "*", "(", ")", "\", "NUL". * " should be quoted as \" * Quoting is done by \xx (two-digit hexcode). "*" <=> "\2a" * Non-ascii chars must be converted to utf-8. @@ -67,15 +67,15 @@ * @see http://www.faqs.org/rfcs/rfc4514.html LDAP String Representation of Distinguished Names */ function _stringEscape($name) { - $name = strtr(utf8_encode($name), - array("*" => "\\2a", - "?" => "\\3f", - "(" => "\\28", - ")" => "\\29", - "\\" => "\\5c", - '"' => '\"', - "\0" => "\\00")); - return $name; + $name = strtr(utf8_encode($name), + array("*" => "\\2a", + "?" => "\\3f", + "(" => "\\28", + ")" => "\\29", + "\\" => "\\5c", + '"' => '\"', + "\0" => "\\00")); + return $name; } /** @@ -84,7 +84,7 @@ */ function isValidName ($userid = false) { if (!$userid) $userid = $this->_userid; - // We are more restrictive here, but must allow explitly utf-8 + // We are more restrictive here, but must allow explitly utf-8 return preg_match("/^[\-\w_\.@ ]+$/u", $userid) and strlen($userid) < 64; } @@ -98,20 +98,20 @@ * @see http://www.faqs.org/rfcs/rfc4514.html LDAP String Representation of Distinguished Names */ function _searchparam($userid) { - $euserid = $this->_stringEscape($userid); - // Need to set the right root search information. See config/config.ini - if (LDAP_SEARCH_FILTER) { - $st_search = str_replace("\$userid", $euserid, LDAP_SEARCH_FILTER); - } else { - $st_search = LDAP_SEARCH_FIELD - ? LDAP_SEARCH_FIELD."=$euserid" - : "uid=$euserid"; - } - return $st_search; + $euserid = $this->_stringEscape($userid); + // Need to set the right root search information. See config/config.ini + if (LDAP_SEARCH_FILTER) { + $st_search = str_replace("\$userid", $euserid, LDAP_SEARCH_FILTER); + } else { + $st_search = LDAP_SEARCH_FIELD + ? LDAP_SEARCH_FIELD."=$euserid" + : "uid=$euserid"; + } + return $st_search; } /** - * Passwords must not be escaped, but sent as "stringprep"'ed utf-8. + * Passwords must not be escaped, but sent as "stringprep"'ed utf-8. * * @see http://www.faqs.org/rfcs/rfc4514.html LDAP String Representation of Distinguished Names * @see http://www.faqs.org/rfcs/rfc3454.html stringprep @@ -119,7 +119,7 @@ function checkPass($submitted_password) { $this->_authmethod = 'LDAP'; - $this->_userid = trim($this->_userid); + $this->_userid = trim($this->_userid); $userid = $this->_userid; if (!$this->isValidName()) { trigger_error(_("Invalid username."), E_USER_WARNING); @@ -130,32 +130,32 @@ $this->_free(); return WIKIAUTH_FORBIDDEN; } - // A LDAP speciality: Empty passwords are always true for ldap_bind !!! - // So we have to disallow this regardless of PASSWORD_LENGTH_MINIMUM = 0 + // A LDAP speciality: Empty passwords are always true for ldap_bind !!! + // So we have to disallow this regardless of PASSWORD_LENGTH_MINIMUM = 0 if (strlen($submitted_password) == 0) { trigger_error(_("Empty password not allowed for LDAP"), E_USER_WARNING); $this->_free(); - return $this->_tryNextPass($submitted_password); - //return WIKIAUTH_FORBIDDEN; + return $this->_tryNextPass($submitted_password); + //return WIKIAUTH_FORBIDDEN; } /*if (strstr($userid,'*')) { // should be safely escaped now - trigger_error(fmt("Invalid username '%s' for LDAP Auth", $userid), + trigger_error(fmt("Invalid username '%s' for LDAP Auth", $userid), E_USER_WARNING); return WIKIAUTH_FORBIDDEN; - }*/ + }*/ if ($ldap = $this->_init()) { - $st_search = $this->_searchparam($userid); + $st_search = $this->_searchparam($userid); if (!$this->_sr = ldap_search($ldap, LDAP_BASE_DN, $st_search)) { - trigger_error(_("Could not search in LDAP"), E_USER_WARNING); - $this->_free(); + trigger_error(_("Could not search in LDAP"), E_USER_WARNING); + $this->_free(); return $this->_tryNextPass($submitted_password); } - $info = ldap_get_entries($ldap, $this->_sr); + $info = ldap_get_entries($ldap, $this->_sr); if (empty($info["count"])) { - if (DEBUG) - trigger_error(_("User not found in LDAP"), E_USER_WARNING); - $this->_free(); + if (DEBUG) + trigger_error(_("User not found in LDAP"), E_USER_WARNING); + $this->_free(); return $this->_tryNextPass($submitted_password); } // There may be more hits with this userid. @@ -163,69 +163,69 @@ for ($i = 0; $i < $info["count"]; $i++) { $dn = $info[$i]["dn"]; // The password must be converted to utf-8, but unescaped. - // On wrong password the ldap server will return: + // On wrong password the ldap server will return: // "Unable to bind to server: Server is unwilling to perform" // The @ catches this error message. - // If CHARSET=utf-8 the form should have already converted it to utf-8. + // If CHARSET=utf-8 the form should have already converted it to utf-8. if ($r = @ldap_bind($ldap, $dn, $submitted_password)) { // ldap_bind will return TRUE if everything matches - // Optionally get the mail from LDAP - if (!empty($info[$i]["mail"][0])) { - $this->_prefs->_prefs['email']->default_value = $info[$i]["mail"][0]; - } - $this->_free(); + // Optionally get the mail from LDAP + if (!empty($info[$i]["mail"][0])) { + $this->_prefs->_prefs['email']->default_value = $info[$i]["mail"][0]; + } + $this->_free(); $this->_level = WIKIAUTH_USER; return $this->_level; } else { - // Try again, this time explicitly - if ($r = @ldap_bind($ldap, $dn, utf8_encode($submitted_password))) { - if (!empty($info[$i]["mail"][0])) { - $this->_prefs->_prefs['email']->default_value = $info[$i]["mail"][0]; - } - $this->_free(); - $this->_level = WIKIAUTH_USER; - return $this->_level; - } - } + // Try again, this time explicitly + if ($r = @ldap_bind($ldap, $dn, utf8_encode($submitted_password))) { + if (!empty($info[$i]["mail"][0])) { + $this->_prefs->_prefs['email']->default_value = $info[$i]["mail"][0]; + } + $this->_free(); + $this->_level = WIKIAUTH_USER; + return $this->_level; + } + } } - if (DEBUG) - trigger_error(_("Wrong password: ") . - str_repeat("*", strlen($submitted_password)), - E_USER_WARNING); + if (DEBUG) + trigger_error(_("Wrong password: ") . + str_repeat("*", strlen($submitted_password)), + E_USER_WARNING); $this->_free(); } else { $this->_free(); - trigger_error(fmt("Could not connect to LDAP host %s", LDAP_AUTH_HOST), E_USER_WARNING); - } + trigger_error(fmt("Could not connect to LDAP host %s", LDAP_AUTH_HOST), E_USER_WARNING); + } return $this->_tryNextPass($submitted_password); } function userExists() { - $this->_userid = trim($this->_userid); + $this->_userid = trim($this->_userid); $userid = $this->_userid; if (strstr($userid, '*')) { trigger_error(fmt("Invalid username '%s' for LDAP Auth", $userid), E_USER_WARNING); return false; - } + } if ($ldap = $this->_init()) { // Need to set the right root search information. see ../index.php - $st_search = $this->_searchparam($userid); + $st_search = $this->_searchparam($userid); if (!$this->_sr = ldap_search($ldap, LDAP_BASE_DN, $st_search)) { - $this->_free(); - return $this->_tryNextUser(); + $this->_free(); + return $this->_tryNextUser(); } - $info = ldap_get_entries($ldap, $this->_sr); + $info = ldap_get_entries($ldap, $this->_sr); if ($info["count"] > 0) { - $this->_free(); - UpgradeUser($GLOBALS['ForbiddenUser'], $this); + $this->_free(); + UpgradeUser($GLOBALS['ForbiddenUser'], $this); return true; } } - $this->_free(); + $this->_free(); return $this->_tryNextUser(); } Modified: trunk/lib/WikiUser/LdapUpper.php =================================================================== --- trunk/lib/WikiUser/LdapUpper.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/LdapUpper.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -16,22 +16,22 @@ { function checkPass($submitted_password) { - return parent::checkPass($submitted_password); + return parent::checkPass($submitted_password); } function UserName() { if (!empty($this->_userid)) { - $this->_userid = trim(strtoupper($this->_userid)); - if (!empty($this->_HomePagehandle) and is_object($this->_HomePagehandle)) - $this->_HomePagehandle->_pagename = $this->_userid; + $this->_userid = trim(strtoupper($this->_userid)); + if (!empty($this->_HomePagehandle) and is_object($this->_HomePagehandle)) + $this->_HomePagehandle->_pagename = $this->_userid; return strtoupper($this->_userid); - } + } } function userExists() { - // lowercase check and uppercase visibility - $this->_userid = trim(strtoupper($this->_userid)); - return parent::userExists(); + // lowercase check and uppercase visibility + $this->_userid = trim(strtoupper($this->_userid)); + return parent::userExists(); } } Modified: trunk/lib/WikiUser/OpenID.php =================================================================== --- trunk/lib/WikiUser/OpenID.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/OpenID.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -12,7 +12,7 @@ * Preferences are handled in _PassUser */ { - // This can only be called from _PassUser, because the parent class + // This can only be called from _PassUser, because the parent class // sets the pref methods, before this class is initialized. function _OpenIDPassUser($UserName='', $prefs=false, $file='') { if (!$this->_prefs and isa($this, "_OpenIDPassUser")) { Modified: trunk/lib/WikiUser/POP3.php =================================================================== --- trunk/lib/WikiUser/POP3.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/POP3.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -15,11 +15,11 @@ function checkPass($submitted_password) { if (!$this->isValidName()) { trigger_error(_("Invalid username."), E_USER_WARNING); - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => failed isValidName", E_USER_WARNING); + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => failed isValidName", E_USER_WARNING); return $this->_tryNextPass($submitted_password); } if (!$this->_checkPassLength($submitted_password)) { - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => failed checkPassLength", E_USER_WARNING); + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => failed checkPassLength", E_USER_WARNING); return WIKIAUTH_FORBIDDEN; } $userid = $this->_userid; @@ -62,7 +62,7 @@ E_USER_WARNING); } $this->_authmethod = 'POP3'; - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => $retval", E_USER_WARNING); + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::checkPass => $retval", E_USER_WARNING); if ($retval) { $this->_level = WIKIAUTH_USER; } else { @@ -72,7 +72,7 @@ } function __userExists() { - if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::userExists => true (dummy)", E_USER_WARNING); + if (DEBUG & _DEBUG_LOGIN) trigger_error(get_class($this)."::userExists => true (dummy)", E_USER_WARNING); return true; } } Modified: trunk/lib/WikiUser/PdoDb.php =================================================================== --- trunk/lib/WikiUser/PdoDb.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/PdoDb.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -31,14 +31,14 @@ return false; } $this->_userid = $UserName; - // make use of session data. generally we only initialize this every time, + // make use of session data. generally we only initialize this every time, // but do auth checks only once $this->_auth_crypt_method = $GLOBALS['request']->_dbi->getAuthParam('auth_crypt_method'); return $this; } function getPreferences() { - // override the generic slow method here for efficiency and not to + // override the generic slow method here for efficiency and not to // clutter the homepage metadata with prefs. _AnonUser::getPreferences(); $this->getAuthDbh(); @@ -47,7 +47,7 @@ $db_result = $dbh->query(sprintf($this->_prefs->_select, $dbh->quote($this->_userid))); // patched by fre...@pa... $prefs = $db_result->fetch(PDO_FETCH_BOTH); - $prefs_blob = @$prefs["prefs"]; + $prefs_blob = @$prefs["prefs"]; if ($restored_from_db = $this->_prefs->retrieve($prefs_blob)) { $updated = $this->_prefs->updatePrefs($restored_from_db); //$this->_prefs = new UserPreferences($restored_from_db); @@ -116,7 +116,7 @@ } } //NOTE: for auth_crypt_method='crypt' no special auth_user_exists is needed - if ( !$dbi->getAuthParam('auth_user_exists') + if ( !$dbi->getAuthParam('auth_user_exists') and $this->_auth_crypt_method == 'crypt' and $this->_authselect) { @@ -142,8 +142,8 @@ return true; } // User does not exist yet. - // Maybe the user is allowed to create himself. Generally not wanted in - // external databases, but maybe wanted for the wiki database, for performance + // Maybe the user is allowed to create himself. Generally not wanted in + // external databases, but maybe wanted for the wiki database, for performance // reasons if (empty($this->_authcreate) and $dbi->getAuthParam('auth_create')) { try { @@ -154,9 +154,9 @@ return false; } } - if (!empty($this->_authcreate) and + if (!empty($this->_authcreate) and isset($GLOBALS['HTTP_POST_VARS']['auth']) and - isset($GLOBALS['HTTP_POST_VARS']['auth']['passwd'])) + isset($GLOBALS['HTTP_POST_VARS']['auth']['passwd'])) { $passwd = $GLOBALS['HTTP_POST_VARS']['auth']['passwd']; try { @@ -173,7 +173,7 @@ } return $this->_tryNextUser(); } - + function checkPass($submitted_password) { //global $DBAuthParams; $this->getAuthDbh(); Modified: trunk/lib/WikiUser/PearDb.php =================================================================== --- trunk/lib/WikiUser/PearDb.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/PearDb.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -28,14 +28,14 @@ return false; } $this->_userid = $UserName; - // make use of session data. generally we only initialize this every time, + // make use of session data. generally we only initialize this every time, // but do auth checks only once $this->_auth_crypt_method = $GLOBALS['request']->_dbi->getAuthParam('auth_crypt_method'); return $this; } function getPreferences() { - // override the generic slow method here for efficiency and not to + // override the generic slow method here for efficiency and not to // clutter the homepage metadata with prefs. _AnonUser::getPreferences(); $this->getAuthDbh(); @@ -44,7 +44,7 @@ $db_result = $dbh->query(sprintf($this->_prefs->_select, $dbh->quote($this->_userid))); // patched by fre...@pa... $prefs = $db_result->fetchRow(); - $prefs_blob = @$prefs["prefs"]; + $prefs_blob = @$prefs["prefs"]; if ($restored_from_db = $this->_prefs->retrieve($prefs_blob)) { $updated = $this->_prefs->updatePrefs($restored_from_db); //$this->_prefs = new UserPreferences($restored_from_db); @@ -74,25 +74,25 @@ $packed = $this->_prefs->store(); if (!$id_only and isset($this->_prefs->_update)) { $dbh = &$this->_auth_dbi; - // check if the user already exists (not needed with mysql REPLACE) - $db_result = $dbh->query(sprintf($this->_prefs->_select, - $dbh->quote($this->_userid))); - $prefs = $db_result->fetchRow(); - $prefs_blob = @$prefs["prefs"]; - // If there are prefs for the user, update them. - if($prefs_blob != "" ){ - $dbh->simpleQuery(sprintf($this->_prefs->_update, - $dbh->quote($packed), - $dbh->quote($this->_userid))); - } else { - // Otherwise, insert a record for them and set it to the defaults. - // jo...@de... - $dbi = $GLOBALS['request']->getDbh(); - $this->_prefs->_insert = $this->prepare($dbi->getAuthParam('pref_insert'), - array("pref_blob", "userid")); - $dbh->simpleQuery(sprintf($this->_prefs->_insert, - $dbh->quote($packed), $dbh->quote($this->_userid))); - } + // check if the user already exists (not needed with mysql REPLACE) + $db_result = $dbh->query(sprintf($this->_prefs->_select, + $dbh->quote($this->_userid))); + $prefs = $db_result->fetchRow(); + $prefs_blob = @$prefs["prefs"]; + // If there are prefs for the user, update them. + if($prefs_blob != "" ){ + $dbh->simpleQuery(sprintf($this->_prefs->_update, + $dbh->quote($packed), + $dbh->quote($this->_userid))); + } else { + // Otherwise, insert a record for them and set it to the defaults. + // jo...@de... + $dbi = $GLOBALS['request']->getDbh(); + $this->_prefs->_insert = $this->prepare($dbi->getAuthParam('pref_insert'), + array("pref_blob", "userid")); + $dbh->simpleQuery(sprintf($this->_prefs->_insert, + $dbh->quote($packed), $dbh->quote($this->_userid))); + } //delete pageprefs: if ($this->_HomePagehandle and $this->_HomePagehandle->get('pref')) $this->_HomePagehandle->set('pref', ''); @@ -120,13 +120,13 @@ $dbi =& $GLOBALS['request']->_dbi; // Prepare the configured auth statements if ($dbi->getAuthParam('auth_check') and empty($this->_authselect)) { - $this->_authselect = $this->prepare($dbi->getAuthParam('auth_check'), + $this->_authselect = $this->prepare($dbi->getAuthParam('auth_check'), array("password", "userid")); } //NOTE: for auth_crypt_method='crypt' no special auth_user_exists is needed - if (!$dbi->getAuthParam('auth_user_exists') - and $this->_auth_crypt_method == 'crypt' - and $this->_authselect) + if (!$dbi->getAuthParam('auth_user_exists') + and $this->_auth_crypt_method == 'crypt' + and $this->_authselect) { $rs = $dbh->query(sprintf($this->_authselect, $dbh->quote($this->_userid))); if ($rs->numRows()) @@ -142,16 +142,16 @@ return true; } // User does not exist yet. - // Maybe the user is allowed to create himself. Generally not wanted in - // external databases, but maybe wanted for the wiki database, for performance + // Maybe the user is allowed to create himself. Generally not wanted in + // external databases, but maybe wanted for the wiki database, for performance // reasons if (empty($this->_authcreate) and $dbi->getAuthParam('auth_create')) { $this->_authcreate = $this->prepare($dbi->getAuthParam('auth_create'), array("password", "userid")); } - if (!empty($this->_authcreate) and + if (!empty($this->_authcreate) and isset($GLOBALS['HTTP_POST_VARS']['auth']) and - isset($GLOBALS['HTTP_POST_VARS']['auth']['passwd'])) + isset($GLOBALS['HTTP_POST_VARS']['auth']['passwd'])) { $passwd = $GLOBALS['HTTP_POST_VARS']['auth']['passwd']; $dbh->simpleQuery(sprintf($this->_authcreate, @@ -161,7 +161,7 @@ } return $this->_tryNextUser(); } - + function checkPass($submitted_password) { //global $DBAuthParams; $this->getAuthDbh(); Modified: trunk/lib/WikiUser/PersonalPage.php =================================================================== --- trunk/lib/WikiUser/PersonalPage.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/PersonalPage.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -13,7 +13,7 @@ { var $_authmethod = 'PersonalPage'; - /* Very loose checking, since we properly quote the PageName. + /* Very loose checking, since we properly quote the PageName. Just trim spaces, ... See lib/stdlib.php */ function isValidName ($userid = false) { @@ -27,14 +27,14 @@ } /** A PersonalPagePassUser requires PASSWORD_LENGTH_MINIMUM. - * BUT if the user already has a homepage with an empty password + * BUT if the user already has a homepage with an empty password * stored, allow login but warn him to change it. */ function checkPass($submitted_password) { if ($this->userExists()) { $stored_password = $this->_prefs->get('passwd'); if (empty($stored_password)) { - if (PASSWORD_LENGTH_MINIMUM > 0) { + if (PASSWORD_LENGTH_MINIMUM > 0) { trigger_error(sprintf( _("PersonalPage login method:")."\n". _("You stored an empty password in your '%s' page.")."\n". @@ -42,8 +42,8 @@ _("Please set a password in UserPreferences."), $this->_userid), E_USER_WARNING); $this->_level = WIKIAUTH_BOGO; - } else { - if (!empty($submitted_password)) + } else { + if (!empty($submitted_password)) trigger_error(sprintf( _("PersonalPage login method:")."\n". _("You stored an empty password in your '%s' page.")."\n". @@ -51,7 +51,7 @@ _("Please set a password in UserPreferences."), $this->_userid), E_USER_WARNING); $this->_level = WIKIAUTH_USER; - } + } return $this->_level; } if ($this->_checkPass($submitted_password, $stored_password)) Modified: trunk/lib/WikiUser/Session.php =================================================================== --- trunk/lib/WikiUser/Session.php 2010-02-10 13:43:16 UTC (rev 7300) +++ trunk/lib/WikiUser/Session.php 2010-03-04 10:30:39 UTC (rev 7301) @@ -4,9 +4,9 @@ * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) */ -/** +/** * Support reuse of existing user session from another application. - * You have to define which session variable holds the userid, and + * You have to define which session variable holds the userid, and * at what level is that user then. 1: BogoUser, 2: PassUser * define('AUTH_SESS_USER','userid'); * define('AUTH_SESS_LEVEL',2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-02-10 13:43:22
|
Revision: 7300 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7300&view=rev Author: vargenau Date: 2010-02-10 13:43:16 +0000 (Wed, 10 Feb 2010) Log Message: ----------- Avoid error message in PHP 5.3 Modified Paths: -------------- trunk/lib/CachedMarkup.php Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2010-02-09 17:30:15 UTC (rev 7299) +++ trunk/lib/CachedMarkup.php 2010-02-10 13:43:16 UTC (rev 7300) @@ -243,7 +243,7 @@ // to change itself $val = $item->expand($basepage, $this); if ($val) $val->printXML(); - else trigger_error("empty item $item"); + else trigger_error('empty item ' . print_r($item, true)); } else { $item->printXML(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-02-09 17:30:21
|
Revision: 7299 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7299&view=rev Author: vargenau Date: 2010-02-09 17:30:15 +0000 (Tue, 09 Feb 2010) Log Message: ----------- Make plugin SystemInfo work for PHP 5.3 Modified Paths: -------------- trunk/lib/plugin/SystemInfo.php Modified: trunk/lib/plugin/SystemInfo.php =================================================================== --- trunk/lib/plugin/SystemInfo.php 2010-02-08 15:59:24 UTC (rev 7298) +++ trunk/lib/plugin/SystemInfo.php 2010-02-09 17:30:15 UTC (rev 7299) @@ -456,7 +456,7 @@ if (!empty($availableargs[$arg])) return $availableargs[$arg](); elseif (method_exists($this, $arg)) // any defined SystemInfo->method() - return call_user_func_array(array(&$this, $arg), ''); + return call_user_func_array(array(&$this, $arg), array()); elseif (defined($arg) && // any defined constant !in_array($arg,array('ADMIN_PASSWD','DATABASE_DSN','DBAUTH_AUTH_DSN'))) return constant($arg); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-02-08 15:59:31
|
Revision: 7298 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7298&view=rev Author: vargenau Date: 2010-02-08 15:59:24 +0000 (Mon, 08 Feb 2010) Log Message: ----------- 2009 is gone Modified Paths: -------------- trunk/pgsrc/ReleaseNotes Modified: trunk/pgsrc/ReleaseNotes =================================================================== --- trunk/pgsrc/ReleaseNotes 2010-02-04 14:14:18 UTC (rev 7297) +++ trunk/pgsrc/ReleaseNotes 2010-02-08 15:59:24 UTC (rev 7298) @@ -1,4 +1,4 @@ -Date: Mon, 24 Aug 2009 19:46:34 +0000 +Date: Mon, 8 Feb 2010 16:58:34 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -10,7 +10,7 @@ <<CreateToc with_toclink||=1 headers||=1,2,3>> -== 1.4.0 ?? 2009 Reini Urban, Sabri Labbenes, Marc-Etienne Vargenau +== 1.4.0 ?? 2010 Reini Urban, Sabri Labbenes, Marc-Etienne Vargenau An important modification in this release is the implementation of full Wikicreole 1.0 syntax, including additions. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-02-04 14:14:28
|
Revision: 7297 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7297&view=rev Author: vargenau Date: 2010-02-04 14:14:18 +0000 (Thu, 04 Feb 2010) Log Message: ----------- Selenium tests work with ENABLE_EDIT_TOOLBAR now Modified Paths: -------------- trunk/g Modified: trunk/g =================================================================== --- trunk/g 2010-02-04 14:08:36 UTC (rev 7296) +++ trunk/g 2010-02-04 14:14:18 UTC (rev 7297) @@ -245,10 +245,7 @@ define('DISABLE_GETIMAGESIZE', true); - if (isset($sys_use_selenium) && $sys_use_selenium) { - // Temporary disabled for selenium based tests. - define('ENABLE_EDIT_TOOLBAR', false); - } + define('ENABLE_EDIT_TOOLBAR', true); // If the user is logged in, let the Wiki know if (session_loggedin()){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-02-04 14:08:47
|
Revision: 7296 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7296&view=rev Author: vargenau Date: 2010-02-04 14:08:36 +0000 (Thu, 04 Feb 2010) Log Message: ----------- Describe arguments Modified Paths: -------------- trunk/pgsrc/Help%2FRecentChangesPlugin Modified: trunk/pgsrc/Help%2FRecentChangesPlugin =================================================================== --- trunk/pgsrc/Help%2FRecentChangesPlugin 2010-01-27 12:40:44 UTC (rev 7295) +++ trunk/pgsrc/Help%2FRecentChangesPlugin 2010-02-04 14:08:36 UTC (rev 7296) @@ -1,4 +1,4 @@ -Date: Mon, 1 Jun 2009 15:05:05 +0000 +Date: Thu, 4 Feb 2010 14:56:26 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -65,32 +65,32 @@ | false |- | **format** -| +| Default is HTML. Other: rss, rss2, rss091, atom, sidebar, box, contribs | false |- | **daylist** -| +| Comma-separated list of days | false |- | **difflinks** -| +| Show diff links | true |- | **historylinks** -| -| false +| Show history links +| false (true for Monobook and Gforge) |- | **caption** +| Custom caption | -| |- | **category** +| Limit pages to a given category | -| |- | **pagematch** +| Limit to pages matching pattern | -| |} == Example This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-01-27 12:40:51
|
Revision: 7295 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7295&view=rev Author: vargenau Date: 2010-01-27 12:40:44 +0000 (Wed, 27 Jan 2010) Log Message: ----------- Assigning the return value of new by reference is deprecated Modified Paths: -------------- trunk/lib/pear/DB.php Modified: trunk/lib/pear/DB.php =================================================================== --- trunk/lib/pear/DB.php 2010-01-27 10:14:23 UTC (rev 7294) +++ trunk/lib/pear/DB.php 2010-01-27 12:40:44 UTC (rev 7295) @@ -307,7 +307,7 @@ return $tmp; } - @$obj =& new $classname; + @$obj = new $classname; foreach ($options as $option => $value) { $test = $obj->setOption($option, $value); @@ -381,7 +381,7 @@ return $tmp; } - @$obj =& new $classname; + @$obj = new $classname; foreach ($options as $option => $value) { $test = $obj->setOption($option, $value); @@ -887,7 +887,7 @@ if ($object_class == 'stdClass') { $arr = (object) $arr; } else { - $arr = &new $object_class($arr); + $arr = new $object_class($arr); } } return $arr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-01-27 10:14:29
|
Revision: 7294 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7294&view=rev Author: vargenau Date: 2010-01-27 10:14:23 +0000 (Wed, 27 Jan 2010) Log Message: ----------- Valid XHTML Modified Paths: -------------- trunk/themes/Sidebar/templates/dump-footer.tmpl Modified: trunk/themes/Sidebar/templates/dump-footer.tmpl =================================================================== --- trunk/themes/Sidebar/templates/dump-footer.tmpl 2010-01-22 15:28:52 UTC (rev 7293) +++ trunk/themes/Sidebar/templates/dump-footer.tmpl 2010-01-27 10:14:23 UTC (rev 7294) @@ -4,6 +4,6 @@ ?> <hr class="printer" noshade="noshade" /> <div class="visualClear"></div> -<div><?= $WikiTheme->getOwnerMessage($page) ?> <?= $WikiTheme->getLastModifiedMessage($revision) ?> <?= $WikiTheme->getAuthorMessage($revision) ?><br> +<div><?= $WikiTheme->getOwnerMessage($page) ?> <?= $WikiTheme->getLastModifiedMessage($revision) ?> <?= $WikiTheme->getAuthorMessage($revision) ?><br /> This page was accessed <?= $page->get('hits') ?> times, and edited <?= $revision->getVersion() ?> times.</div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-01-22 15:28:58
|
Revision: 7293 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7293&view=rev Author: vargenau Date: 2010-01-22 15:28:52 +0000 (Fri, 22 Jan 2010) Log Message: ----------- Improve RssFeed plugin CSS Modified Paths: -------------- trunk/themes/gforge/gforge.css Modified: trunk/themes/gforge/gforge.css =================================================================== --- trunk/themes/gforge/gforge.css 2010-01-22 15:26:58 UTC (rev 7292) +++ trunk/themes/gforge/gforge.css 2010-01-22 15:28:52 UTC (rev 7293) @@ -894,14 +894,19 @@ td.sidebar { border-spacing: 0px; margin: 0ex;} /* RssFeed */ -div.rss { margin: 1em; padding: 1em; font-size: 0.9em; background-color: #eeeeee; border: thin dashed #aaaaaa; } -div.feed { color: #333; margin: -0.5em; margin-bottom: 0em; padding: 0.3em; font-weight: bold; background-color: #f2f2f2; font-size: 1.2em; } -div.itemdesc { padding-left: 1em; } -div.rssitem { border-top: thin dashed #aaaaaa; } +div.rss { margin: 1em; padding: 1em; } +div.feed { margin: -0.5em; margin-bottom: 0em; padding: 0.3em; + font-weight: bold; font-size: 1.2em; } +.chandesc { font-weight: bold; } +div.rssitem { padding-top:1em; padding-bottom: 1em; + border-top: 2px solid #565c5e; /* Alcatel-Lucent grey */ } +div.itemname { padding-bottom: 1em; font-weight: bold; } +div.itemdesc { padding-left: 1em; } +div.authordate { font-style: italic; } a.rssicon { font-weight:normal; font-size:small; vertical-align:middle; } /* SqlResult */ -table.sqlresult { +table.sqlresult { border: 1px outset gray; background: white; margin: 0.5ex 0.5em; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |