From: <ru...@us...> - 2009-06-04 11:28:52
|
Revision: 6867 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6867&view=rev Author: rurban Date: 2009-06-04 11:28:48 +0000 (Thu, 04 Jun 2009) Log Message: ----------- do not printf, use echo! use DOCTYPE Modified Paths: -------------- trunk/lib/RssWriter.php trunk/lib/RssWriter2.php Modified: trunk/lib/RssWriter.php =================================================================== --- trunk/lib/RssWriter.php 2009-06-04 11:27:30 UTC (rev 6866) +++ trunk/lib/RssWriter.php 2009-06-04 11:28:48 UTC (rev 6867) @@ -117,7 +117,7 @@ */ function __spew() { header("Content-Type: application/xml; charset=" . RSS_ENCODING); - printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", RSS_ENCODING); + echo('<'.'?xml version="1.0" encoding="'.RSS_ENCODING.'"?'.">\n"); //printf("<!-- generator=\"PhpWiki-%s\" -->\n", PHPWIKI_VERSION); $this->printXML(); } @@ -209,7 +209,7 @@ */ function __spew() { header("Content-Type: application/atom+xml; charset=" . RSS_ENCODING); - printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", RSS_ENCODING); + echo('<'.'?xml version="1.0" encoding="'.RSS_ENCODING.'"?'.">\n"); //printf("<!-- generator=\"PhpWiki-%s\" -->\n", PHPWIKI_VERSION); $this->printXML(); } Modified: trunk/lib/RssWriter2.php =================================================================== --- trunk/lib/RssWriter2.php 2009-06-04 11:27:30 UTC (rev 6866) +++ trunk/lib/RssWriter2.php 2009-06-04 11:28:48 UTC (rev 6867) @@ -65,12 +65,12 @@ */ function __spew() { header("Content-Type: application/rss+xml; charset=" . RSS_ENCODING); - printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", RSS_ENCODING); + echo('<'.'?xml version="1.0" encoding="'.RSS_ENCODING.'"?'.">\n"); //printf("<!-- generator=\"PhpWiki-%s\" -->\n", PHPWIKI_VERSION); //RSS2 really is 0.92 - //echo '<!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.92.dtd">',"\n"; - //echo "<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">\n"; - //echo " %HTMLlat1;]>\n"; + echo '<!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.92.dtd">',"\n"; + echo "<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">\n"; + echo " %HTMLlat1;]>\n"; $this->printXML(); } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-11 11:52:36
|
Revision: 6915 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6915&view=rev Author: vargenau Date: 2009-06-11 11:52:32 +0000 (Thu, 11 Jun 2009) Log Message: ----------- Give exact number of pages listed (number was incorrect in case pages were not listed because of restrictive ACL) Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/plugin/AllPages.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-11 09:30:10 UTC (rev 6914) +++ trunk/lib/PageList.php 2009-06-11 11:52:32 UTC (rev 6915) @@ -1436,8 +1436,11 @@ if ($tokens) $this->_pages = array_slice($this->_pages, $tokens['OFFSET'], $tokens['COUNT']); } + $nb_row = 0; foreach ($this->_pages as $pagenum => $page) { - $rows[] = $this->_renderPageRow($page, $i++); + $one_row = $this->_renderPageRow($page, $i++); + $rows[] = $one_row; + if ($one_row) $nb_row++; } $table = HTML::table(array('cellpadding' => 0, 'cellspacing' => 1, @@ -1446,6 +1449,7 @@ 'class' => 'pagelist', )); if ($caption) { + $caption = preg_replace('/{total}/', $nb_row, asString($caption)); $table->pushContent(HTML::caption(array('align'=>'top'), $caption)); } @@ -1520,9 +1524,17 @@ if (empty($this->_pages)) return; // stop recursion if (!isset($this->_options['listtype'])) $this->_options['listtype'] = ''; + $nb_row = 0; + foreach ($this->_pages as $pagenum => $page) { + $one_row = $this->_renderPageRow($page); + $rows[] = array('header' => WikiLink($page), 'render' => $one_row); + if ($one_row) $nb_row++; + } $out = HTML(); - if ($caption) + if ($caption) { + $caption = preg_replace('/{total}/', $nb_row, asString($caption)); $out->pushContent(HTML::p($caption)); + } // Semantic Search et al: only unique list entries, esp. with nopage if (!is_array($this->_pages[0]) and is_string($this->_pages[0])) { $this->_pages = array_unique($this->_pages); @@ -1626,15 +1638,15 @@ list($offset, $pagesize) = $this->limit($this->_options['limit']); else $pagesize=0; - foreach ($this->_pages as $pagenum => $page) { - $pagehtml = $this->_renderPageRow($page); + foreach (array_reverse($rows) as $one_row) { + $pagehtml = $one_row['render']; if (!$pagehtml) continue; $group = ($i++ / $this->_group_rows); //TODO: here we switch every row, in tables every third. // unification or parametrized? $class = ($group % 2) ? 'oddrow' : 'evenrow'; if ($this->_options['listtype'] == 'dl') { - $header = WikiLink($page); + $header = $one_row['header']; //if ($this->_sortby['hi_content']) $list->pushContent(HTML::dt(array('class' => $class), $header), HTML::dd(array('class' => $class), $pagehtml)); @@ -1688,8 +1700,10 @@ function _emptyList($caption) { $html = HTML(); - if ($caption) + if ($caption) { + $caption = preg_replace('/{total}/', '0', asString($caption)); $html->pushContent(HTML::p($caption)); + } if ($this->_messageIfEmpty) $html->pushContent(HTML::blockquote(HTML::p($this->_messageIfEmpty))); return $html; Modified: trunk/lib/plugin/AllPages.php =================================================================== --- trunk/lib/plugin/AllPages.php 2009-06-11 09:30:10 UTC (rev 6914) +++ trunk/lib/plugin/AllPages.php 2009-06-11 11:52:32 UTC (rev 6915) @@ -69,48 +69,45 @@ // Todo: extend given _GET args if ($args['debug']) $timer = new DebugTimer; - $caption = _("All pages in this wiki (%d total):"); + $caption = _("All pages in this wiki ({total} total):"); if ( !empty($args['userpages']) ) { $pages = PageList::allUserPages($args['include_empty'], $args['sortby'], '' ); - $caption = fmt("List of user-created pages (%d total):", count($pages)); + $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] (%d total):", + $caption = fmt("List of pages owned by [%s] ({total} total):", WikiLink($args['owner'] == '[]' ? $request->_user->getAuthenticatedId() : $args['owner'], - 'if_known'), - count($pages)); + '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] (%d total):", + $caption = fmt("List of pages last edited by [%s] ({total} total):", WikiLink($args['author'] == '[]' ? $request->_user->getAuthenticatedId() : $args['author'], - 'if_known'), - count($pages)); + '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] (%d total):", + $caption = fmt("List of pages created by [%s] ({total} total):", WikiLink($args['creator'] == '[]' ? $request->_user->getAuthenticatedId() : $args['creator'], - 'if_known'), - count($pages)); + 'if_known')); $args['count'] = $request->getArg('count'); $pages->_options['count'] = $args['count']; //} elseif ($pages) { @@ -132,11 +129,9 @@ if ($pages !== false) $pagelist->addPageList($pages); - else { - $result = $dbi->getAllPages($args['include_empty'], $args['sortby'], - $args['limit']); - $pagelist->addPages( $result ); - } + else + $pagelist->addPages( $dbi->getAllPages($args['include_empty'], $args['sortby'], + $args['limit']) ); if ($args['debug']) { return HTML($pagelist, HTML::p(fmt("Elapsed time: %s s", $timer->getStats()))); @@ -144,7 +139,6 @@ return $pagelist; } } - }; // Local Variables: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-07-14 10:13:56
|
Revision: 7034 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7034&view=rev Author: vargenau Date: 2009-07-14 10:13:44 +0000 (Tue, 14 Jul 2009) Log Message: ----------- Default to UTF-8 Modified Paths: -------------- trunk/lib/loadsave.php trunk/lib/ziplib.php Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2009-07-14 10:05:45 UTC (rev 7033) +++ trunk/lib/loadsave.php 2009-07-14 10:13:44 UTC (rev 7034) @@ -1233,7 +1233,7 @@ } } if (empty($pagehash['charset'])) - $pagehash['charset'] = 'iso-8859-1'; + $pagehash['charset'] = 'utf-8'; // compare to target charset if (strtolower($pagehash['charset']) != strtolower($GLOBALS['charset'])) { $pageinfo['content'] = charset_convert($params['charset'], $GLOBALS['charset'], $pageinfo['content']); @@ -1305,7 +1305,7 @@ // plain old file $user = $request->getUser(); - $file_charset = 'iso-8859-1'; + $file_charset = 'utf-8'; // compare to target charset if ($file_charset != strtolower($GLOBALS['charset'])) { $text = charset_convert($file_charset, $GLOBALS['charset'], $text); Modified: trunk/lib/ziplib.php =================================================================== --- trunk/lib/ziplib.php 2009-07-14 10:05:45 UTC (rev 7033) +++ trunk/lib/ziplib.php 2009-07-14 10:13:44 UTC (rev 7034) @@ -876,7 +876,7 @@ ExitWiki( sprintf("Unknown %s", 'encoding type: $encoding') ); if (empty($params['charset'])) - $params['charset'] = 'iso-8859-1'; + $params['charset'] = 'utf-8'; // compare to target charset if (strtolower($params['charset']) != strtolower($GLOBALS['charset'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-07-17 09:07:23
|
Revision: 7044 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7044&view=rev Author: vargenau Date: 2009-07-17 09:07:16 +0000 (Fri, 17 Jul 2009) Log Message: ----------- Add fieldset Modified Paths: -------------- trunk/lib/purgepage.php trunk/lib/removepage.php Modified: trunk/lib/purgepage.php =================================================================== --- trunk/lib/purgepage.php 2009-07-16 12:58:22 UTC (rev 7043) +++ trunk/lib/purgepage.php 2009-07-17 09:07:16 UTC (rev 7044) @@ -22,26 +22,23 @@ $purgeB = Button('submit:verify', _("Purge Page"), 'wikiadmin'); $cancelB = Button('submit:cancel', _("Cancel"), 'button'); // use generic wiki button look - $html = HTML(HTML::p(fmt("You are about to purge '%s'!", $pagelink)), + $fieldset = HTML::fieldset(HTML::p(fmt("You are about to purge '%s'!", $pagelink)), HTML::form(array('method' => 'post', 'action' => $request->getPostURL()), HiddenInputs(array('currentversion' => $version, 'pagename' => $page->getName(), 'action' => 'purge')), - HTML::div(array('class' => 'toolbar'), $purgeB, $WikiTheme->getButtonSeparator(), - $cancelB)), - HTML::hr() + $cancelB)) ); $sample = HTML::div(array('class' => 'transclusion')); // simple and fast preview expanding only newlines foreach (explode("\n", firstNWordsOfContent(100, $current->getPackedContent())) as $s) { $sample->pushContent($s, HTML::br()); } - $html->pushContent(HTML::div(array('class' => 'wikitext'), - $sample)); + $html = HTML($fieldset, HTML::div(array('class' => 'wikitext'), $sample)); } elseif ($request->getArg('currentversion') != $version) { $html = HTML(HTML::p(array('class' => 'error'), (_("Someone has edited the page!"))), Modified: trunk/lib/removepage.php =================================================================== --- trunk/lib/removepage.php 2009-07-16 12:58:22 UTC (rev 7043) +++ trunk/lib/removepage.php 2009-07-17 09:07:16 UTC (rev 7044) @@ -22,26 +22,23 @@ $removeB = Button('submit:verify', _("Remove Page"), 'wikiadmin'); $cancelB = Button('submit:cancel', _("Cancel"), 'button'); // use generic wiki button look - $html = HTML(HTML::p(fmt("You are about to remove '%s'!", $pagelink)), + $fieldset = HTML::fieldset(HTML::p(fmt("You are about to remove '%s'!", $pagelink)), HTML::form(array('method' => 'post', 'action' => $request->getPostURL()), HiddenInputs(array('currentversion' => $version, 'pagename' => $page->getName(), 'action' => 'remove')), - HTML::div(array('class' => 'toolbar'), $removeB, $WikiTheme->getButtonSeparator(), - $cancelB)), - HTML::hr() + $cancelB)) ); $sample = HTML::div(array('class' => 'transclusion')); // simple and fast preview expanding only newlines foreach (explode("\n", firstNWordsOfContent(100, $current->getPackedContent())) as $s) { $sample->pushContent($s, HTML::br()); } - $html->pushContent(HTML::div(array('class' => 'wikitext'), - $sample)); + $html = HTML($fieldset, HTML::div(array('class' => 'wikitext'), $sample)); } elseif ($request->getArg('currentversion') != $version) { $html = HTML(HTML::p(array('class' => 'error'), (_("Someone has edited the page!"))), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-08-24 12:18:35
|
Revision: 7078 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7078&view=rev Author: rurban Date: 2009-08-24 12:16:57 +0000 (Mon, 24 Aug 2009) Log Message: ----------- add READONLY Modified Paths: -------------- trunk/lib/DbaDatabase.php trunk/lib/IniConfig.php trunk/lib/PagePerm.php trunk/lib/WikiDB.php trunk/lib/WikiUserNew.php trunk/lib/main.php Modified: trunk/lib/DbaDatabase.php =================================================================== --- trunk/lib/DbaDatabase.php 2009-08-24 12:14:12 UTC (rev 7077) +++ trunk/lib/DbaDatabase.php 2009-08-24 12:16:57 UTC (rev 7078) @@ -19,6 +19,7 @@ _("Supported handlers are: %s"), $handler, join(",",dba_handlers()))); } + $this->readonly = false; if ($mode) $this->open($mode); } @@ -42,6 +43,10 @@ echo "You don't seem to have DBA support compiled into PHP."; } + if (READONLY) { + $mode = 'r'; + } + // lock supported since 4.3.0: if (check_php_version(4,3,0) and (strlen($mode) == 1)) { // PHP 4.3.x Windows lock bug workaround: http://bugs.php.net/bug.php?id=23975 @@ -54,9 +59,19 @@ while (($dbh = dba_open($this->_file, $mode, $this->_handler)) < 1) { if ($watchdog <= 0) break; - flush(); // "c" failed, try "w" instead. - if (substr($mode,0,1) == "c" and file_exists($this->_file)) + if ($mode == "w" + and file_exists($this->_file) + and (isWindows() or !is_writable($this->_file))) + { + // try to continue with read-only + if (!defined("READONLY")) + define("READONLY", true); + $GLOBALS['request']->_dbi->readonly = true; + $this->readonly = true; + $mode = "r"; + } + if (substr($mode,0,1) == "c" and file_exists($this->_file) and !READONLY) $mode = "w"; // conflict: wait some random time to unlock (as with ethernet) $secs = 0.5 + ((double)rand(1,32767)/32767); @@ -72,7 +87,15 @@ $error->errstr .= "\nfile: " . $this->_file . "\nmode: " . $mode . "\nhandler: " . $this->_handler; - $ErrorManager->handleError($error); + // try to continue with read-only + if (!defined("READONLY")) + define("READONLY", true); + $GLOBALS['request']->_dbi->readonly = true; + $this->readonly = true; + if (!file_exist($this->_file)) { + $ErrorManager->handleError($error); + flush(); + } } else { trigger_error("dba_open failed", E_USER_ERROR); @@ -119,6 +142,7 @@ } function delete($key) { + if ($this->readonly) return; if (!dba_delete($key, $this->_dbh)) return $this->_error("delete($key)"); } @@ -129,6 +153,7 @@ function set($key, $val) { $dbh = &$this->_dbh; + if ($this->readonly) return; if (dba_exists($key, $dbh)) { if ($val !== false) { if (!dba_replace($key, $val, $dbh)) Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2009-08-24 12:14:12 UTC (rev 7077) +++ trunk/lib/IniConfig.php 2009-08-24 12:16:57 UTC (rev 7078) @@ -203,7 +203,8 @@ 'ENABLE_SEARCHHIGHLIGHT', 'DISABLE_UPLOAD_ONLY_ALLOWED_EXTENSIONS', 'ENABLE_AUTH_OPENID', 'INSECURE_ACTIONS_LOCALHOST_ONLY', 'ENABLE_MAILNOTIFY', 'ENABLE_RECENTCHANGESBOX', 'ENABLE_PAGE_PUBLIC', - 'ENABLE_AJAX', 'ENABLE_EXTERNAL_PAGES' + 'ENABLE_AJAX', 'ENABLE_EXTERNAL_PAGES', + 'READONLY' ); $rs = @parse_ini_file($file); @@ -267,7 +268,7 @@ 'ALLOW_IMAP_LOGIN', 'ALLOW_USER_LOGIN', 'REQUIRE_SIGNIN_BEFORE_EDIT', 'WIKIDB_NOCACHE_MARKUP', - 'COMPRESS_OUTPUT', 'USE_BYTEA' + 'COMPRESS_OUTPUT', 'USE_BYTEA', 'READONLY', ))) { ; @@ -331,6 +332,8 @@ E_USER_ERROR); } } + // Detect readonly database, e.g. system mounted read-only for maintenance + // via dbh->readonly later. Unfortunately not possible as constant. // USE_DB_SESSION default logic: if (!defined('USE_DB_SESSION')) { Modified: trunk/lib/PagePerm.php =================================================================== --- trunk/lib/PagePerm.php 2009-08-24 12:14:12 UTC (rev 7077) +++ trunk/lib/PagePerm.php 2009-08-24 12:16:57 UTC (rev 7078) @@ -234,12 +234,20 @@ global $request; $page = $request->getPage($pagename); + + // Exceptions: if (defined('GFORGE') and GFORGE) { if ($pagename != '.' && isset($request->_user->_is_external) && $request->_user->_is_external && ! $page->get('external')) { $permcache[$pagename][$access] = 0; return 0; } } + if ((READONLY or $request->_dbi->readonly) + and in_array($access, array('edit','create','change'))) + { + return 0; + } + // Page not found; check against default permissions if (! $page->exists() ) { $perm = new PagePermission(); Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2009-08-24 12:14:12 UTC (rev 7077) +++ trunk/lib/WikiDB.php 2009-08-24 12:16:57 UTC (rev 7078) @@ -91,6 +91,10 @@ * * Which dba handler to use. Good choices are probably either * 'gdbm' or 'db2'. + * + * <dt> readonly + * <dd> Either set by config.ini: READONLY = true or detected automatically + * when a database can be read but cannot be updated. * </dl> * * @return WikiDB A WikiDB object. @@ -126,6 +130,8 @@ if ((int)DEBUG & _DEBUG_SQL) { $this->_backend->check(); } + // might be changed when opening the database fails + $this->readonly = defined("READONLY") ? READONLY : false; } /** @@ -210,6 +216,7 @@ * @see purgePage */ function deletePage($pagename) { + if ($this->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } // don't create empty revisions of already purged pages. if ($this->_backend->get_latest_version($pagename)) $result = $this->_cache->delete_page($pagename); @@ -242,6 +249,7 @@ * @see deletePage */ function purgePage($pagename) { + if ($this->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } $result = $this->_cache->purge_page($pagename); $this->deletePage($pagename); // just for the notification return $result; @@ -511,6 +519,7 @@ * @return boolean true or false */ function renamePage($from, $to, $updateWikiLinks = false) { + if ($this->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } assert(is_string($from) && $from != ''); assert(is_string($to) && $to != ''); $result = false; @@ -662,6 +671,7 @@ * @param string $newval New value. */ function set($key, $newval) { + if ($this->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } if (!$key || $key[0] == '%') return; @@ -790,6 +800,7 @@ * use a WikiDB_PageRevision object here.) */ function deleteRevision($version) { + if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } $backend = &$this->_wikidb->_backend; $cache = &$this->_wikidb->_cache; $pagename = &$this->_pagename; @@ -839,6 +850,7 @@ * </ul> */ function mergeRevision($version) { + if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } $backend = &$this->_wikidb->_backend; $cache = &$this->_wikidb->_cache; $pagename = &$this->_pagename; @@ -905,6 +917,7 @@ * $version was incorrect, returns false */ function createRevision($version, &$content, $metadata, $links) { + if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } $backend = &$this->_wikidb->_backend; $cache = &$this->_wikidb->_cache; $pagename = &$this->_pagename; @@ -983,6 +996,7 @@ * @param hash $meta Meta-data for new revision. */ function save($wikitext, $version, $meta, $formatted = null) { + if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } if (is_null($formatted)) $formatted = new TransformedText($this, $wikitext, $meta); $type = $formatted->getType(); @@ -1317,6 +1331,7 @@ and $key == '_cached_html' and method_exists($backend, 'set_cached_html')) { + if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } return $backend->set_cached_html($pagename, $newval); } @@ -1331,6 +1346,7 @@ return; // values identical, skip update. } + if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } $cache->update_pagedata($pagename, array($key => $newval)); } @@ -1351,6 +1367,7 @@ * @access public */ function increaseHitCount() { + if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_NOTICE); return; } if (method_exists($this->_wikidb->_backend, 'increaseHitCount')) $this->_wikidb->_backend->increaseHitCount($this->_pagename); else { @@ -2084,6 +2101,9 @@ array_push ($this->_versiondata_cache, array()); $this->_glv_cache = array(); $this->_id_cache = array(); // formerly ->_dbi->_iwpcache (nonempty pages => id) + + if (isset($GLOBALS['request']->_dbi)) + $this->readonly = $GLOBALS['request']->_dbi->readonly; } function close() { @@ -2110,6 +2130,7 @@ function update_pagedata($pagename, $newdata) { assert(is_string($pagename) && $pagename != ''); + if ($this->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } $this->_backend->update_pagedata($pagename, $newdata); @@ -2134,12 +2155,14 @@ } function delete_page($pagename) { + if ($this->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } $result = $this->_backend->delete_page($pagename); $this->invalidate_cache($pagename); return $result; } function purge_page($pagename) { + if ($this->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } $result = $this->_backend->purge_page($pagename); $this->invalidate_cache($pagename); return $result; @@ -2192,6 +2215,7 @@ function set_versiondata($pagename, $version, $data) { //unset($this->_versiondata_cache[$pagename][$version]); + if ($this->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } $new = $this->_backend->set_versiondata($pagename, $version, $data); // Update the cache $this->_versiondata_cache[$pagename][$version]['1'] = $data; @@ -2201,6 +2225,7 @@ } function update_versiondata($pagename, $version, $data) { + if ($this->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } $new = $this->_backend->update_versiondata($pagename, $version, $data); // Update the cache $this->_versiondata_cache[$pagename][$version]['1'] = $data; @@ -2211,6 +2236,7 @@ } function delete_versiondata($pagename, $version) { + if ($this->readonly) { trigger_error("readonly database", E_USER_WARNING); return; } $new = $this->_backend->delete_versiondata($pagename, $version); if (isset($this->_versiondata_cache[$pagename][$version])) unset ($this->_versiondata_cache[$pagename][$version]); Modified: trunk/lib/WikiUserNew.php =================================================================== --- trunk/lib/WikiUserNew.php 2009-08-24 12:14:12 UTC (rev 7077) +++ trunk/lib/WikiUserNew.php 2009-08-24 12:16:57 UTC (rev 7078) @@ -930,7 +930,11 @@ // Check the configured Prefs methods $dbi = $this->getAuthDbh(); $dbh = $GLOBALS['request']->getDbh(); - if ( $dbi and !isset($this->_prefs->_select) and $dbh->getAuthParam('pref_select')) { + if ( $dbi + and !$dbh->readonly + and !isset($this->_prefs->_select) + and $dbh->getAuthParam('pref_select')) + { if (!$this->_prefs) { $this->_prefs = new UserPreferences(); $need_pref = true; Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2009-08-24 12:14:12 UTC (rev 7077) +++ trunk/lib/main.php 2009-08-24 12:16:57 UTC (rev 7078) @@ -77,8 +77,9 @@ if (USE_DB_SESSION) { include_once('lib/DbSession.php'); $dbi =& $this->_dbi; - $this->_dbsession = new DbSession($dbi, $dbi->getParam('prefix') - . $dbi->getParam('db_session_table')); + if (!READONLY) + $this->_dbsession = new DbSession($dbi, $dbi->getParam('prefix') + . $dbi->getParam('db_session_table')); } // Fixme: Does pear reset the error mask to 1? We have to find the culprit This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-08-24 12:24:12
|
Revision: 7083 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7083&view=rev Author: rurban Date: 2009-08-24 12:24:02 +0000 (Mon, 24 Aug 2009) Log Message: ----------- PHP5 syntax Modified Paths: -------------- trunk/lib/WikiDB/SQL.php trunk/lib/pear/DB/common.php Modified: trunk/lib/WikiDB/SQL.php =================================================================== --- trunk/lib/WikiDB/SQL.php 2009-08-24 12:22:05 UTC (rev 7082) +++ trunk/lib/WikiDB/SQL.php 2009-08-24 12:24:02 UTC (rev 7083) @@ -22,7 +22,7 @@ } include_once ("lib/WikiDB/backend/PearDB_".$backend.".php"); $backend_class = "WikiDB_backend_PearDB_".$backend; - $backend = & new $backend_class($dbparams); + $backend = new $backend_class($dbparams); if (DB::isError($backend->_dbh)) return; $this->WikiDB($backend, $dbparams); } Modified: trunk/lib/pear/DB/common.php =================================================================== --- trunk/lib/pear/DB/common.php 2009-08-24 12:22:05 UTC (rev 7082) +++ trunk/lib/pear/DB/common.php 2009-08-24 12:24:02 UTC (rev 7083) @@ -944,7 +944,7 @@ * @see DB_common::prepare() * @access public */ - function &execute($stmt, $data = array()) + function execute($stmt, $data = array()) { $realquery = $this->executeEmulateQuery($stmt, $data); if (DB::isError($realquery)) { @@ -955,7 +955,7 @@ if (DB::isError($result) || $result === DB_OK) { return $result; } else { - $tmp =& new DB_result($this, $result); + $tmp = new DB_result($this, $result); return $tmp; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-09-11 08:04:16
|
Revision: 7110 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7110&view=rev Author: vargenau Date: 2009-09-11 08:04:02 +0000 (Fri, 11 Sep 2009) Log Message: ----------- Remove $Log Modified Paths: -------------- trunk/lib/WikiDB/backend/PDO_oci8.php trunk/lib/WikiDB/backend/PDO_pgsql.php trunk/lib/WikiDB/backend/dumb/MostPopularIter.php trunk/lib/WikiDB/flatfile.php trunk/lib/WikiUser/EMailConfirm.php trunk/lib/WysiwygEdit/spaw.php trunk/lib/imdb.php trunk/lib/plugin/CacheTest.php trunk/lib/plugin/CreateBib.php trunk/lib/plugin/Imdb.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/NewPagesPerUser.php trunk/lib/plugin/RecentEdits.php trunk/lib/plugin/UriResolver.php trunk/lib/plugin/_Retransform.php Modified: trunk/lib/WikiDB/backend/PDO_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_oci8.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/WikiDB/backend/PDO_oci8.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -87,8 +87,6 @@ } } -// $Log: not supported by cvs2svn $ - // (c-file-style: "gnu") // Local Variables: // mode: php @@ -97,4 +95,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> Modified: trunk/lib/WikiDB/backend/PDO_pgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_pgsql.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/WikiDB/backend/PDO_pgsql.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -50,8 +50,6 @@ } } -// $Log: not supported by cvs2svn $ - // (c-file-style: "gnu") // Local Variables: // mode: php @@ -60,4 +58,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> Modified: trunk/lib/WikiDB/backend/dumb/MostPopularIter.php =================================================================== --- trunk/lib/WikiDB/backend/dumb/MostPopularIter.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/WikiDB/backend/dumb/MostPopularIter.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -66,8 +66,6 @@ return $ahits - $bhits; } -// $Log: not supported by cvs2svn $ - // For emacs users // Local Variables: // mode: php Modified: trunk/lib/WikiDB/flatfile.php =================================================================== --- trunk/lib/WikiDB/flatfile.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/WikiDB/flatfile.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -49,10 +49,6 @@ } } - -// $Log: not supported by cvs2svn $ - - // (c-file-style: "gnu") // Local Variables: // mode: php Modified: trunk/lib/WikiUser/EMailConfirm.php =================================================================== --- trunk/lib/WikiUser/EMailConfirm.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/WikiUser/EMailConfirm.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -40,8 +40,6 @@ } } -// $Log: not supported by cvs2svn $ - // Local Variables: // mode: php // tab-width: 8 @@ -49,4 +47,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> Modified: trunk/lib/WysiwygEdit/spaw.php =================================================================== --- trunk/lib/WysiwygEdit/spaw.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/WysiwygEdit/spaw.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -46,11 +46,6 @@ } } -/* - $Log: not supported by cvs2svn $ - -*/ - // Local Variables: // mode: php // tab-width: 8 @@ -58,4 +53,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> Modified: trunk/lib/imdb.php =================================================================== --- trunk/lib/imdb.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/imdb.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -357,8 +357,6 @@ }; -// $Log: not supported by cvs2svn $ - // (c-file-style: "gnu") // Local Variables: // mode: php @@ -367,4 +365,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> Modified: trunk/lib/plugin/CacheTest.php =================================================================== --- trunk/lib/plugin/CacheTest.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/plugin/CacheTest.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -150,8 +150,6 @@ } // WikiPlugin_CacheTest -// $Log: not supported by cvs2svn $ - // For emacs users // Local Variables: // mode: php Modified: trunk/lib/plugin/CreateBib.php =================================================================== --- trunk/lib/plugin/CreateBib.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/plugin/CreateBib.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -168,7 +168,6 @@ } }; -// $Log: not supported by cvs2svn $ // Based on CreateTOC // For emacs users Modified: trunk/lib/plugin/Imdb.php =================================================================== --- trunk/lib/plugin/Imdb.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/plugin/Imdb.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -110,9 +110,6 @@ } }; -// $Log: not supported by cvs2svn $ -// - // For emacs users // Local Variables: // mode: php Modified: trunk/lib/plugin/LinkSearch.php =================================================================== --- trunk/lib/plugin/LinkSearch.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/plugin/LinkSearch.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -180,9 +180,6 @@ } } -// $Log: not supported by cvs2svn $ -// - // Local Variables: // mode: php // tab-width: 8 Modified: trunk/lib/plugin/NewPagesPerUser.php =================================================================== --- trunk/lib/plugin/NewPagesPerUser.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/plugin/NewPagesPerUser.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -116,12 +116,6 @@ } }; -//function cmp_by_num($a, $b) { // larger first -// return $a < $b ? 1 : 0; -//} - -// $Log: not supported by cvs2svn $ - // Local Variables: // mode: php // tab-width: 8 Modified: trunk/lib/plugin/RecentEdits.php =================================================================== --- trunk/lib/plugin/RecentEdits.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/plugin/RecentEdits.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -42,8 +42,6 @@ } } -// $Log: not supported by cvs2svn $ - // (c-file-style: "gnu") // Local Variables: // mode: php Modified: trunk/lib/plugin/UriResolver.php =================================================================== --- trunk/lib/plugin/UriResolver.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/plugin/UriResolver.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -65,8 +65,6 @@ } }; -// $Log: not supported by cvs2svn $ - // For emacs users // Local Variables: // mode: php Modified: trunk/lib/plugin/_Retransform.php =================================================================== --- trunk/lib/plugin/_Retransform.php 2009-09-10 16:24:18 UTC (rev 7109) +++ trunk/lib/plugin/_Retransform.php 2009-09-11 08:04:02 UTC (rev 7110) @@ -85,8 +85,6 @@ }; -// $Log: not supported by cvs2svn $ - // (c-file-style: "gnu") // Local Variables: // mode: php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-09-16 08:24:08
|
Revision: 7123 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7123&view=rev Author: vargenau Date: 2009-09-16 08:23:59 +0000 (Wed, 16 Sep 2009) Log Message: ----------- Encode the notification mail subject if it contains non-ASCII characters Modified Paths: -------------- trunk/lib/MailNotify.php trunk/lib/stdlib.php Modified: trunk/lib/MailNotify.php =================================================================== --- trunk/lib/MailNotify.php 2009-09-16 08:20:16 UTC (rev 7122) +++ trunk/lib/MailNotify.php 2009-09-16 08:23:59 UTC (rev 7123) @@ -181,6 +181,12 @@ $notice = false, $silent = true) { + if (defined('GFORGE') and GFORGE) { + // Add WIKI_NAME to Subject + $subject = "[".WIKI_NAME."] ".$subject; + } + // Encode $subject if needed + $encoded_subject = $this->subject_encode($subject); $emails = $this->emails; $from = $this->from; // Do not send if modification is from Gforge admin @@ -197,7 +203,7 @@ "Content-Transfer-Encoding: 8bit"; $ok = mail(($to = array_shift($emails)), - "[".WIKI_NAME."] ".$subject, + $encoded_subject, $subject."\n".$content, $headers ); @@ -211,7 +217,7 @@ fwrite($f, "\nX-MailFailure: " . $last_err); } fwrite($f, "\nDate: " . CTime()); - fwrite($f, "\nSubject: $subject"); + fwrite($f, "\nSubject: $encoded_subject"); fwrite($f, "\nFrom: $from"); fwrite($f, "\nTo: $to"); fwrite($f, "\nBcc: ".join(',', $emails)); @@ -250,7 +256,7 @@ return; } $backend = &$request->_dbi->_backend; - $subject = _("Page change").' '.urlencode($this->pagename); + $subject = _("Page change").' '.($this->pagename); $previous = $backend->get_previous_version($this->pagename, $version); if (!isset($meta['mtime'])) $meta['mtime'] = time(); if ($previous) { @@ -300,7 +306,7 @@ $pagename = $this->pagename; //$editedby = sprintf(_("Edited by: %s"), $meta['author']) . ' ' . $meta['author_id']; $editedby = sprintf(_("Edited by: %s"), $this->from); - $subject = sprintf(_("Page rename %s to %s"), urlencode($pagename), urlencode($to)); + $subject = sprintf(_("Page rename %s to %s"), $pagename, $to); $link = WikiURL($to, true); $this->sendMail($subject, $editedby."\n".$link."\n\n"."Renamed $pagename to $to"); @@ -339,7 +345,7 @@ if (!empty($this->emails)) { $editedby = sprintf(_("Removed by: %s"), $this->from); // Todo: host_id //$emails = join(',', $this->emails); - $subject = sprintf(_("Page removed %s"), urlencode($pagename)); + $subject = sprintf(_("Page removed %s"), $pagename); $page = $wikidb->getPage($pagename); $rev = $page->getCurrentRevision(true); $content = $rev->getPackedContent(); @@ -449,6 +455,25 @@ return HTML(HTML::h1("Confirm E-mail address"), HTML::p("Your e-mail address has now been confirmed.")); } + + function subject_encode ($subject) { + // We need to encode the subject if it contains non-ASCII characters + // The page name may contain non-ASCII characters, as well as + // the translation of the messages, e.g. _("PageChange Notification of %s"); + + // If all characters are ASCII, do nothing + if (isAsciiString($subject)) { + return $subject; + } + + // Let us try quoted printable first + if (function_exists('quoted_printable_encode')) { // PHP 5.3 + return quoted_printable_encode($subject); + } + + // If not, encode in base64 (less human-readable) + return base64_encode($subject); + } } // Local Variables: Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2009-09-16 08:20:16 UTC (rev 7122) +++ trunk/lib/stdlib.php 2009-09-16 08:23:59 UTC (rev 7123) @@ -1980,6 +1980,14 @@ } /** + * isAsciiString($string) + */ +function isAsciiString($s) { + $ptrASCII = '[\x00-\x7F]'; + return preg_match("/^($ptrASCII)*$/s", $s); +} + +/** * isUtf8String($string) - cheap utf-8 detection * * segfaults for strings longer than 10kb! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-10-11 14:18:24
|
Revision: 7202 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7202&view=rev Author: vargenau Date: 2009-10-11 14:18:08 +0000 (Sun, 11 Oct 2009) Log Message: ----------- Allow OGG in Video plugin with HTML 5 <video> tag Modified Paths: -------------- trunk/lib/HtmlElement.php trunk/lib/plugin/UpLoad.php trunk/lib/plugin/Video.php trunk/lib/stdlib.php Modified: trunk/lib/HtmlElement.php =================================================================== --- trunk/lib/HtmlElement.php 2009-10-09 17:17:10 UTC (rev 7201) +++ trunk/lib/HtmlElement.php 2009-10-11 14:18:08 UTC (rev 7202) @@ -437,6 +437,12 @@ $el = new HtmlElement('legend'); return $el->_init2(func_get_args()); } + + /****************************************/ + function video (/*...*/) { + $el = new HtmlElement('video'); + return $el->_init2(func_get_args()); + } } define('HTMLTAG_EMPTY', 1); @@ -460,7 +466,7 @@ . 'div fieldset frameset' // other with inline content - . 'caption dt label legend ' + . 'caption dt label legend video ' // other with either inline or block . 'dd del ins li td th colgroup'); Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2009-10-09 17:17:10 UTC (rev 7201) +++ trunk/lib/plugin/UpLoad.php 2009-10-11 14:18:08 UTC (rev 7202) @@ -88,6 +88,7 @@ odp ods odt +ogg patch pdf png Modified: trunk/lib/plugin/Video.php =================================================================== --- trunk/lib/plugin/Video.php 2009-10-09 17:17:10 UTC (rev 7201) +++ trunk/lib/plugin/Video.php 2009-10-11 14:18:08 UTC (rev 7202) @@ -73,6 +73,20 @@ $args = $this->getArgs($argstr, $request); extract($args); + if (! $url && ! $file) { + return $this->error(_("Both 'url' or 'file' parameters missing.")); + } elseif ($url && $file) { + return $this->error(_("Choose only one of 'url' or 'page' parameters.")); + } elseif ($file) { + // $url = SERVER_URL . getUploadDataPath() . '/' . $file; + $url = getUploadDataPath() . '/' . $file; + } + + if (string_ends_with($url, ".ogg")) { + return HTML::video(array('autoplay' => 'true', 'controls' => 'true', 'src' => $url), + _("Your browser does not understand the HTML 5 video tag.")); + } + $html = HTML(); $object = HTML::object(array('data' => SERVER_URL . $WikiTheme->_findData('flowplayer-3.1.3.swf'), @@ -88,15 +102,6 @@ 'value' => "false")); $object->pushContent($param); - if (! $url && ! $file) { - return $this->error(_("Both 'url' or 'file' parameters missing.")); - } - elseif ($url && $file) { - return $this->error(_("Choose only one of 'url' or 'page' parameters.")); - } - elseif ($file) { - $url = SERVER_URL . getUploadDataPath() . '/' . $file; - } $value = "config={'clip':{'url':'" . $url . "','autoPlay':" . $autoplay . "}}"; $param = HTML::param(array('name' => "flashvars", 'value' => $value)); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2009-10-09 17:17:10 UTC (rev 7201) +++ trunk/lib/stdlib.php 2009-10-11 14:18:08 UTC (rev 7202) @@ -2463,7 +2463,8 @@ */ function is_video ($filename) { - return string_ends_with(strtolower($filename), ".flv"); + return string_ends_with(strtolower($filename), ".flv") + or string_ends_with(strtolower($filename), ".ogg"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-10-13 06:58:45
|
Revision: 7208 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7208&view=rev Author: rurban Date: 2009-10-13 06:58:34 +0000 (Tue, 13 Oct 2009) Log Message: ----------- Standardize Video plugin to use ImgObject() for embedded objects. Check arguments. Support hash as ImgObject argument not to split sensitive (support spaces in args). Modified Paths: -------------- trunk/lib/plugin/Video.php trunk/lib/stdlib.php Modified: trunk/lib/plugin/Video.php =================================================================== --- trunk/lib/plugin/Video.php 2009-10-13 06:15:17 UTC (rev 7207) +++ trunk/lib/plugin/Video.php 2009-10-13 06:58:34 UTC (rev 7208) @@ -2,6 +2,7 @@ rcs_id('$Id$'); /* * Copyright 2009 Roger Guignard and Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright 2009 Reini Urban * * This file is part of PhpWiki. * @@ -59,11 +60,12 @@ } function getDefaultArguments() { - return array('width' => 460, - 'height' => 320, - 'url' => '', - 'file' => '', + return array('width' => 460, + 'height' => 320, + 'url' => '', + 'file' => '', 'autoplay' => 'false' + 'image' => '', ); } @@ -76,74 +78,35 @@ if (! $url && ! $file) { return $this->error(_("Both 'url' or 'file' parameters missing.")); } elseif ($url && $file) { - return $this->error(_("Choose only one of 'url' or 'page' parameters.")); + return $this->error(_("Choose only one of 'url' or 'file' parameters.")); } elseif ($file) { - // $url = SERVER_URL . getUploadDataPath() . '/' . $file; - $url = getUploadDataPath() . '/' . $file; + $url = getUploadDataPath() . $file; } + // TODO: Check HTML5 browser capabilities if (string_ends_with($url, ".ogg")) { return HTML::video(array('autoplay' => 'true', 'controls' => 'true', 'src' => $url), _("Your browser does not understand the HTML 5 video tag.")); } + if (!$image) $image = $url; + if ($autoplay != 'true' and $autoplay != 'false') + return $this->error(fmt("Invalid argument %s", "autoplay")); + if (!is_numeric($width)) + return $this->error(fmt("Invalid argument %s", "width")); + if (!is_numeric($height)) + return $this->error(fmt("Invalid argument %s", "height")); + if (preg_match("/'/", $url)) + return $this->error(fmt("Invalid argument %s", "url")); - $html = HTML(); - - if (isBrowserIE()) { - $object = HTML::object(array('id' => 'flowplayer', - 'classid' => 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000', - 'width' => $width, - 'height' => $height)); - - $param = HTML::param(array('name' => 'movie', - 'value' => SERVER_URL . $WikiTheme->_findData('flowplayer-3.1.3.swf'))); - $object->pushContent($param); - - $param = HTML::param(array('name' => "allowfullscreen", - 'value' => "true")); - $object->pushContent($param); - - $param = HTML::param(array('name' => "allowscriptaccess", - 'value' => "false")); - $object->pushContent($param); - - $flashvars = "config={'clip':{'url':'" . $url . "','autoPlay':" . $autoplay . "}}"; - - $param = HTML::param(array('name' => 'flashvars', - 'value' => $flashvars)); - $object->pushContent($param); - - $embed = HTML::embed(array('type' => 'application/x-shockwave-flash', - 'width' => $width, - 'height' => $height, - 'src' => SERVER_URL . $WikiTheme->_findData('flowplayer-3.1.3.swf'), - 'flashvars' => $flashvars)); - $object->pushContent($embed); - - $html->pushContent($object); - - } else { - $object = HTML::object(array('data' => SERVER_URL . $WikiTheme->_findData('flowplayer-3.1.3.swf'), - 'type' => "application/x-shockwave-flash", - 'width' => $width, - 'height' => $height)); - - $param = HTML::param(array('name' => "allowfullscreen", - 'value' => "true")); - $object->pushContent($param); - - $param = HTML::param(array('name' => "allowscriptaccess", - 'value' => "false")); - $object->pushContent($param); - - $value = "config={'clip':{'url':'" . $url . "','autoPlay':" . $autoplay . "}}"; - $param = HTML::param(array('name' => "flashvars", - 'value' => $value)); - $object->pushContent($param); - - $html->pushContent($object); - } - return $html; + $params = array("data" => SERVER_URL . $WikiTheme->_findData('flowplayer-3.1.3.swf'), + "type" => "application/x-shockwave-flash", + "width" => $width, + "height" => $height, + "allowfullscreen" => "true", + "allowscriptaccess" => "false", + "flashvars"=> + "config={'clip':{'url':'" . $url . "','autoPlay':" . $autoplay . "}}'"); + return ImgObject(HTML::img(array('src' => $image)), $params); } }; Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2009-10-13 06:15:17 UTC (rev 7207) +++ trunk/lib/stdlib.php 2009-10-13 06:58:34 UTC (rev 7208) @@ -601,29 +601,58 @@ */ function ImgObject($img, $url) { // get the url args: data="sample.svgz" type="image/svg+xml" width="400" height="300" - $args = split(' ', $url); - $params = array(); - if (count($args) >= 1) { - $url = array_shift($args); - $found = array(); - foreach ($args as $attr) { - foreach (explode(",","data,classid,archive,codebase,name,usemap,type,". - "codetype,standby,tabindex,declare") as $param) - { + $params = explode(",","data,classid,archive,codebase,name,usemap,type,". + "codetype,standby,tabindex,declare"); + if (is_array($url)) { + $args = $url; + $found = array(); + foreach ($args as $attr => $value) { + foreach ($params as $param) { + if ($param == $attr) { + $img->setAttr($param, $value); + if (isset($found[$param])) $found[$param]++; + else $found[$param] = 1; + break; + } + } + } + // now all remaining args are added as <param> to the object + $params = array(); + foreach ($args as $attr => $value) { + if (!isset($found[$attr])) { + $params[] = HTML::param(array('name' => $attr, + 'value' => $value)); + } + } + $url = $img->getAttr('src'); + $force_img = "png|jpg|gif|jpeg|bmp"; + if (!preg_match("/\.(".$force_img.")/i", $url)) { + $img->setAttr('src', false); + } + } else { + $args = split(' ', $url); + if (count($args) >= 1) { + $url = array_shift($args); + $found = array(); + foreach ($args as $attr) { + foreach ($params as $param) { if (preg_match("/^$param=(\S+)$/i",$attr,$m)) { $img->setAttr($param, $m[1]); - $found[$attr]++; + if (isset($found[$param])) $found[$param]++; + else $found[$param] = 1; break; } } } - // now all remaing args are added as <param> to the object + // now all remaining args are added as <param> to the object + $params = array(); foreach ($args as $attr) { - if (!$found[$attr] and preg_match("/^(\S+)=(\S+)$/i",$attr,$m)) { + if (!isset($found[$attr]) and preg_match("/^(\S+)=(\S+)$/i",$attr,$m)) { $params[] = HTML::param(array('name' => $m[1], 'value' => $m[2])); } } + } } $type = $img->getAttr('type'); if (!$type) { @@ -631,13 +660,14 @@ if (function_exists('mime_content_type')) $type = mime_content_type($url); } - $object = HTML::object(array_merge($img->_attr, array('src' => $url, 'type' => $type)), + $object = HTML::object(array_merge($img->_attr, + array('type' => $type)), //'src' => $url $img->_content); $object->setAttr('class', 'inlineobject'); if ($params) { foreach ($params as $param) $object->pushContent($param); } - if (isBrowserSafari()) { + if (isBrowserSafari() and !isBrowserSafari(532)) { // recent chrome can do OBJECT return HTML::embed($object->_attr, $object->_content); } $object->pushContent(HTML::embed($object->_attr)); @@ -1235,7 +1265,7 @@ $RE[] = "/(?<= |${sep}|^)([AI])([[:upper:]][[:lower:]])/"; break; case 'fr': - $RE[] = "/(?<= |${sep}|^)([À])([[:upper:]][[:lower:]])/"; + $RE[] = "/(?<= |${sep}|^)([\xC3])([[:upper:]][[:lower:]])/"; break; } // Split at underscore @@ -2622,7 +2652,7 @@ function strip_accents($text) { $res = utf8_decode($text); $res = strtr($res, - utf8_decode('àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ'), + utf8_decode('\xC3áâãäçèéêëìíîïñòóôõöùúûüýÿ\xC3\xC3?ÂÃÄÇÈÉÊËÌ\xC3?Î\xC3?ÑÒÓÔÕÖÙÚÛÜ\xC3?'), 'aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY'); return utf8_encode($res); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-10-13 07:46:31
|
Revision: 7209 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7209&view=rev Author: rurban Date: 2009-10-13 07:46:22 +0000 (Tue, 13 Oct 2009) Log Message: ----------- Revert r7194 Properly fix "limit" database injection. limit mostly has a "," It is encoded as [offset,]count Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/WikiDB/backend.php trunk/lib/plugin/AllPages.php trunk/lib/plugin/AllUsers.php trunk/lib/plugin/BackLinks.php trunk/lib/plugin/FullTextSearch.php trunk/lib/plugin/LikePages.php trunk/lib/plugin/LinkDatabase.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/ListPages.php trunk/lib/plugin/ListRelations.php trunk/lib/plugin/ListSubpages.php trunk/lib/plugin/MostPopular.php trunk/lib/plugin/RandomPage.php trunk/lib/plugin/RecentReferrers.php trunk/lib/plugin/SemanticSearch.php trunk/lib/plugin/SemanticSearchAdvanced.php trunk/lib/plugin/TitleSearch.php trunk/lib/plugin/UnfoldSubpages.php trunk/lib/plugin/WantedPages.php trunk/lib/plugin/WikiAdminSelect.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/PageList.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -1359,11 +1359,26 @@ } function limit($limit) { - if (is_array($limit)) return $limit; - if (strstr($limit, ',')) - return split(',', $limit); - else + if (is_array($limit)) { + list($from, $count) = $limit; + if ((!empty($from) && !is_numeric($from)) or (!empty($count) && !is_numeric($count))) { + return $this->error(_("Illegal 'limit' argument: must be numeric")); + } + return $limit; + } + if (strstr($limit, ',')) { + list($from, $limit) = split(',', $limit); + if ((!empty($from) && !is_numeric($from)) or (!empty($limit) && !is_numeric($limit))) { + return $this->error(_("Illegal 'limit' argument: must be numeric")); + } + return array($from, $limit); + } + else { + if (!empty($limit) && !is_numeric($limit)) { + return $this->error(_("Illegal 'limit' argument: must be numeric")); + } return array(0, $limit); + } } function pagingTokens($numrows = false, $ncolumns = false, $limit = false) { Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/WikiDB/backend.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -524,10 +524,19 @@ * list($offset,$count) = $this->limit($args['limit']); */ function limit($limit) { - if (strstr($limit, ',')) - return split(',', $limit); - else + if (strstr($limit, ',')) { + list($from, $limit) = split(',', $limit); + if ((!empty($from) && !is_numeric($from)) or (!empty($limit) && !is_numeric($limit))) { + return $this->error(_("Illegal 'limit' argument: must be numeric")); + } + return array($from, $limit); + } + else { + if (!empty($limit) && !is_numeric($limit)) { + return $this->error(_("Illegal 'limit' argument: must be numeric")); + } return array(0, $limit); + } } /** Modified: trunk/lib/plugin/AllPages.php =================================================================== --- trunk/lib/plugin/AllPages.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/AllPages.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -66,10 +66,6 @@ function run($dbi, $argstr, $request, $basepage) { $args = $this->getArgs($argstr, $request); - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - $pages = false; // Todo: extend given _GET args if (defined('DEBUG') && DEBUG && $args['debug']) { Modified: trunk/lib/plugin/AllUsers.php =================================================================== --- trunk/lib/plugin/AllUsers.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/AllUsers.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -67,10 +67,6 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - extract($args); if (defined('DEBUG') && DEBUG && $debug) { $timer = new DebugTimer; Modified: trunk/lib/plugin/BackLinks.php =================================================================== --- trunk/lib/plugin/BackLinks.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/BackLinks.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -60,10 +60,6 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - extract($args); if (empty($page) and $page != '0') return ''; Modified: trunk/lib/plugin/FullTextSearch.php =================================================================== --- trunk/lib/plugin/FullTextSearch.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/FullTextSearch.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -73,10 +73,6 @@ $args = $this->getArgs($argstr, $request); - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - if (empty($args['s'])) { return HTML(); } Modified: trunk/lib/plugin/LikePages.php =================================================================== --- trunk/lib/plugin/LikePages.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/LikePages.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -59,10 +59,6 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - extract($args); if (empty($page) && empty($prefix) && empty($suffix)) return ''; Modified: trunk/lib/plugin/LinkDatabase.php =================================================================== --- trunk/lib/plugin/LinkDatabase.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/LinkDatabase.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -76,10 +76,6 @@ global $WikiTheme; $args = $this->getArgs($argstr, $request); - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - $caption = _("All pages with all links in this wiki (%d total):"); if ( !empty($args['owner']) ) { Modified: trunk/lib/plugin/LinkSearch.php =================================================================== --- trunk/lib/plugin/LinkSearch.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/LinkSearch.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -130,10 +130,6 @@ global $WikiTheme; $args = $this->getArgs($argstr, $request); - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - if (empty($args['page'])) $args['page'] = "*"; $form = $this->showForm($dbi, $request, $args); Modified: trunk/lib/plugin/ListPages.php =================================================================== --- trunk/lib/plugin/ListPages.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/ListPages.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -68,10 +68,6 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - extract($args); // If the ratings table does not exist, or on dba it will break otherwise. // Check if WikiTheme isa 'wikilens' Modified: trunk/lib/plugin/ListRelations.php =================================================================== --- trunk/lib/plugin/ListRelations.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/ListRelations.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -50,11 +50,6 @@ } function run ($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - extract($args); $pagelist = new PageList($info, $exclude, $args); // should attributes be listed as pagename here? Modified: trunk/lib/plugin/ListSubpages.php =================================================================== --- trunk/lib/plugin/ListSubpages.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/ListSubpages.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -61,11 +61,6 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - if ($args['basepage']) $pagename = $args['basepage']; else Modified: trunk/lib/plugin/MostPopular.php =================================================================== --- trunk/lib/plugin/MostPopular.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/MostPopular.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -60,11 +60,6 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - extract($args); if (strstr($sortby,'mtime')) { trigger_error(_("sortby=mtime not supported with MostPopular"), Modified: trunk/lib/plugin/RandomPage.php =================================================================== --- trunk/lib/plugin/RandomPage.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/RandomPage.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -56,11 +56,6 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - extract($args); // fix deprecated arg Modified: trunk/lib/plugin/RecentReferrers.php =================================================================== --- trunk/lib/plugin/RecentReferrers.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/RecentReferrers.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -38,11 +38,6 @@ return HTML::div(array('class' => "error"), "Error: no ACCESS_LOG"); } $args = $this->getArgs($argstr, $request); - - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - $table = HTML::table(array('cellpadding' => 1, 'cellspacing' => 2, 'border' => 0, Modified: trunk/lib/plugin/SemanticSearch.php =================================================================== --- trunk/lib/plugin/SemanticSearch.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/SemanticSearch.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -276,11 +276,6 @@ $this->_supported_operators = array(':=','<','<=','>','>=','!=','==','=~'); $this->_text_operators = array(':=','==','=~','!='); $args = $this->getArgs($argstr, $request); - - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - if (empty($args['page'])) $args['page'] = "*"; if (!isset($args['s'])) // it might be (integer) 0 Modified: trunk/lib/plugin/SemanticSearchAdvanced.php =================================================================== --- trunk/lib/plugin/SemanticSearchAdvanced.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/SemanticSearchAdvanced.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -133,11 +133,6 @@ $this->_supported_operators = array(':=','<','<=','>','>=','!=','==','=~'); $args = $this->getArgs($argstr, $request); - - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - $posted = $request->getArg('semsearch'); $request->setArg('semsearch', false); if ($request->isPost() and isset($posted['help'])) { Modified: trunk/lib/plugin/TitleSearch.php =================================================================== --- trunk/lib/plugin/TitleSearch.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/TitleSearch.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -73,11 +73,6 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - if (empty($args['s'])) { return HTML(); } Modified: trunk/lib/plugin/UnfoldSubpages.php =================================================================== --- trunk/lib/plugin/UnfoldSubpages.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/UnfoldSubpages.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -82,11 +82,6 @@ if (!$included_pages) $included_pages = array($basepage); $args = $this->getArgs($argstr, $request); - - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - extract($args); $query = new TextSearchQuery($pagename . SUBPAGE_SEPARATOR . '*', true, 'glob'); $subpages = $dbi->titleSearch($query, $sortby, $limit, $exclude); Modified: trunk/lib/plugin/WantedPages.php =================================================================== --- trunk/lib/plugin/WantedPages.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/WantedPages.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -62,11 +62,6 @@ // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - if (!empty($args['exclude_from'])) $args['exclude_from'] = is_string($args['exclude_from']) ? explodePageList($args['exclude_from']) Modified: trunk/lib/plugin/WikiAdminSelect.php =================================================================== --- trunk/lib/plugin/WikiAdminSelect.php 2009-10-13 06:58:34 UTC (rev 7208) +++ trunk/lib/plugin/WikiAdminSelect.php 2009-10-13 07:46:22 UTC (rev 7209) @@ -120,11 +120,6 @@ //if ($request->getArg('action') != 'browse') // return $this->disabled("(action != 'browse')"); $args = $this->getArgs($argstr, $request); - - if (!empty($args['limit']) && !is_numeric($args['limit'])) { - return $this->error(_("Illegal 'limit' argument: must be numeric")); - } - $this->_args = $args; extract($args); $this->preSelectS($args, $request); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-10-21 06:20:06
|
Revision: 7229 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7229&view=rev Author: vargenau Date: 2009-10-21 06:19:58 +0000 (Wed, 21 Oct 2009) Log Message: ----------- Use GFORGE instead of $WikiTheme Modified Paths: -------------- trunk/lib/CachedMarkup.php trunk/lib/plugin/PluginManager.php trunk/lib/plugin/UpLoad.php Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2009-10-21 05:57:01 UTC (rev 7228) +++ trunk/lib/CachedMarkup.php 2009-10-21 06:19:58 UTC (rev 7229) @@ -42,8 +42,7 @@ // a single quote is entered in the Summary box: // - the history is wrong (user and comment missing) // - the table of contents plugin no longer works - global $WikiTheme; - if (isa($WikiTheme, 'WikiTheme_gforge')) { + if (defined('GFORGE') and GFORGE) { return serialize($this); } Modified: trunk/lib/plugin/PluginManager.php =================================================================== --- trunk/lib/plugin/PluginManager.php 2009-10-21 05:57:01 UTC (rev 7228) +++ trunk/lib/plugin/PluginManager.php 2009-10-21 06:19:58 UTC (rev 7229) @@ -86,8 +86,6 @@ function _generateTableBody(&$info, &$dbi, &$request, &$table) { - global $WikiTheme; - $plugin_dir = 'lib/plugin'; if (defined('PHPWIKI_DIR')) $plugin_dir = PHPWIKI_DIR . "/$plugin_dir"; @@ -124,7 +122,7 @@ // make a link if an actionpage exists $pluginNamelink = $pluginName; $pluginDocPageName = _("Help")."/" . $pluginName . "Plugin"; - if (isa($WikiTheme, 'WikiTheme_gforge')) { + if (defined('GFORGE') and GFORGE) { $pluginDocPageName = _("Help").":" . $pluginName . "Plugin"; } @@ -152,7 +150,7 @@ $pluginDocPageNamelink = WikiLink($pluginDocPageName,'if_known'); } - if (isa($WikiTheme, 'WikiTheme_gforge')) { + if (defined('GFORGE') and GFORGE) { $pluginDocPageNamelink = WikiLink($pluginDocPageName, 'known'); } Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2009-10-21 05:57:01 UTC (rev 7228) +++ trunk/lib/plugin/UpLoad.php 2009-10-21 06:19:58 UTC (rev 7229) @@ -178,8 +178,7 @@ // Make sure that the user is logged in. $user = $request->getUser(); if (!$user->isAuthenticated()) { - global $WikiTheme; - if (isa($WikiTheme, 'WikiTheme_gforge')) { + if (defined('GFORGE') and GFORGE) { $message->pushContent(HTML::div(array('class' => 'error'), HTML::p(_("You cannot upload files.")), HTML::ul( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-11-02 19:01:34
|
Revision: 7256 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7256&view=rev Author: vargenau Date: 2009-11-02 19:01:20 +0000 (Mon, 02 Nov 2009) Log Message: ----------- Normalize header Modified Paths: -------------- trunk/lib/AccessLog.php trunk/lib/Captcha.php trunk/lib/PagePerm.php trunk/lib/Request.php trunk/lib/WikiGroup.php trunk/lib/WikiPluginCached.php trunk/lib/imagecache.php trunk/lib/imdb.php trunk/lib/main.php trunk/lib/pdf.php trunk/lib/stdlib.php trunk/lib/upgrade.php Modified: trunk/lib/AccessLog.php =================================================================== --- trunk/lib/AccessLog.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/AccessLog.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,23 +1,23 @@ <?php rcs_id('$Id$'); /* - Copyright 2005, 2007 Reini Urban - - 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 + * Copyright 2005, 2007 Reini Urban + * + * 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 */ /** @@ -741,4 +741,4 @@ // indent-tabs-mode: nil // End: // vim: expandtab shiftwidth=4: -?> \ No newline at end of file +?> Modified: trunk/lib/Captcha.php =================================================================== --- trunk/lib/Captcha.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/Captcha.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,27 +1,27 @@ <?php rcs_id('$Id$'); /** - Session Captcha v1.0 - by Gavin M. Roy <gm...@bt...> - Modified by Benjamin Drieu <bd...@ap...> - 2005 for PhpWiki - get_captcha_random_word() contributed by Dan Frankowski 2005 for PhpWiki - objectified and randomized 2005 by Reini Urban + * Session Captcha v1.0 + * by Gavin M. Roy <gm...@bt...> + * Modified by Benjamin Drieu <bd...@ap...> - 2005 for PhpWiki + * get_captcha_random_word() contributed by Dan Frankowski 2005 for PhpWiki + * objectified and randomized 2005 by Reini Urban + * + * This File 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. + * + * This File 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 This File; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ - This File 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. - - This File 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 This File; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - class Captcha { function Captcha($meta = array(), $width = 250, $height = 80) { Modified: trunk/lib/PagePerm.php =================================================================== --- trunk/lib/PagePerm.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/PagePerm.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,24 +1,24 @@ <?php // -*-php-*- rcs_id('$Id$'); /* - Copyright 2004,2007 $ThePhpWikiProgrammingTeam - Copyright 2009 Marc-Etienne Vargenau, 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 + * Copyright 2004,2007 $ThePhpWikiProgrammingTeam + * Copyright 2009 Marc-Etienne Vargenau, 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 */ /** Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/Request.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,23 +1,23 @@ <?php // -*-php-*- rcs_id('$Id$'); /* - Copyright (C) 2002,2004,2005,2006,2009 $ThePhpWikiProgrammingTeam - - 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 + * Copyright (C) 2002,2004,2005,2006,2009 $ThePhpWikiProgrammingTeam + * + * 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 */ // backward compatibility for PHP < 4.2.0 Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/WikiGroup.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,23 +1,23 @@ <?php rcs_id('$Id$'); /* - Copyright (C) 2003, 2004 $ThePhpWikiProgrammingTeam - - 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 + * Copyright (C) 2003, 2004 $ThePhpWikiProgrammingTeam + * + * 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 */ if (!defined('GROUP_METHOD') or Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/WikiPluginCached.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,23 +1,23 @@ <?php rcs_id('$Id$'); /* - Copyright (C) 2002 Johannes Große - Copyright (C) 2004,2007 Reini Urban - - 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 + * Copyright (C) 2002 Johannes Große + * Copyright (C) 2004,2007 Reini Urban + * + * 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 */ /** Modified: trunk/lib/imagecache.php =================================================================== --- trunk/lib/imagecache.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/imagecache.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,23 +1,24 @@ <?php rcs_id('$Id$'); /* - Copyright (C) 2002 Johannes Große + * Copyright (C) 2002 Johannes Große + * + * 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 + */ - 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 - */ /** * Gets an image from the cache and prints it to the browser. * This file belongs to WikiPluginCached. Modified: trunk/lib/imdb.php =================================================================== --- trunk/lib/imdb.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/imdb.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,22 +1,22 @@ <?php rcs_id('$Id$'); /** - Copyright 2004 Reini Urban - - This file is (not yet) 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 + * Copyright 2004 Reini Urban + * + * This file is (not yet) 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 */ /** Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/main.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,23 +1,23 @@ <?php //-*-php-*- rcs_id('$Id$'); /* - Copyright 1999-2008 $ThePhpWikiProgrammingTeam - - 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 + * Copyright 1999-2008 $ThePhpWikiProgrammingTeam + * + * 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 */ define ('USE_PREFS_IN_PAGE', true); Modified: trunk/lib/pdf.php =================================================================== --- trunk/lib/pdf.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/pdf.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,25 +1,25 @@ <?php // -*-php-*- rcs_id('$Id$'); /* - Copyright (C) 2003 Olivier PLATHEY - Copyright (C) 200? Don Sebà - Copyright (C) 2004,2006,2007 Reini Urban - - 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 + * Copyright (C) 2003 Olivier PLATHEY + * Copyright (C) 200? Don Sebà + * Copyright (C) 2004,2006,2007 Reini Urban + * + * 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 */ //define("USE_EXTERNAL_HTML2PDF", "htmldoc --quiet --format pdf14 --jpeg --webpage --no-toc --no-title %s"); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/stdlib.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,23 +1,23 @@ <?php //rcs_id('$Id$'); /* - Copyright 1999-2008 $ThePhpWikiProgrammingTeam - Copyright 2008-2009 Marc-Etienne Vargenau, 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 + * Copyright 1999-2008 $ThePhpWikiProgrammingTeam + * Copyright 2008-2009 Marc-Etienne Vargenau, 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 */ /* Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2009-11-02 09:51:56 UTC (rev 7255) +++ trunk/lib/upgrade.php 2009-11-02 19:01:20 UTC (rev 7256) @@ -1,24 +1,24 @@ <?php //-*-php-*- rcs_id('$Id$'); /* - Copyright 2004,2005,2006,2007 $ThePhpWikiProgrammingTeam - Copyright 2008 Marc-Etienne Vargenau, 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 + * Copyright 2004,2005,2006,2007 $ThePhpWikiProgrammingTeam + * Copyright 2008 Marc-Etienne Vargenau, 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 */ /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-11-05 14:34:14
|
Revision: 7259 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7259&view=rev Author: rurban Date: 2009-11-05 14:34:03 +0000 (Thu, 05 Nov 2009) Log Message: ----------- Fix Bug#2892522 Textsearch highlighting with two words fails. Pass highlighter regexp to PageList and use it. Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/plugin/FullTextSearch.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-11-04 15:45:25 UTC (rev 7258) +++ trunk/lib/PageList.php 2009-11-05 14:34:03 UTC (rev 7259) @@ -377,10 +377,13 @@ // on very large Wikis this will fail if used with AllPages // (PHP memory limit exceeded) class _PageList_Column_content extends _PageList_Column { - function _PageList_Column_content ($field, $default_heading, $align = false, $search = false) { + function _PageList_Column_content ($field, $default_heading, $align=false, + $search=false, $hilight_re=false) + { $this->_PageList_Column($field, $default_heading, $align); $this->bytes = 50; $this->search = $search; + $this->hilight_re = $hilight_re; if ($field == 'content') { $this->_heading .= sprintf(_(" ... first %d bytes"), $this->bytes); @@ -399,11 +402,8 @@ or $revision_handle->_data['%content'] === true)) { $revision_handle = $page_handle->getCurrentRevision(true); } - // Not sure why implode is needed here, I thought - // getContent() already did this, but it seems necessary. - $c = implode("\n", $revision_handle->getContent()); - if (empty($pagelist->_sortby[$this->_field])) - unset($revision_handle->_data['%content']); + //if (!empty($pagelist->_sortby) and empty($pagelist->_sortby[$this->_field])) + // unset($revision_handle->_data['%content']); if ($this->_field == 'hi_content') { if (!empty($revision_handle->_data['%pagedata'])) { $revision_handle->_data['%pagedata']['_cached_html'] = ''; @@ -416,19 +416,41 @@ $score = $page_handle->score; elseif (is_array($page_handle) and !empty($page_handle['score'])) $score = $page_handle['score']; - // Remove special characters so that highlighting works - $search = preg_replace('/^[\^\*]/', '', $search); - $search = preg_replace('/[\^\*]$/', '', $search); + + $hilight_re = $this->hilight_re; + // use the TextSearchQuery highlighter + if ($search and $hilight_re) { + $matches = preg_grep("/$hilight_re/i", $revision_handle->getContent()); + $html = array(); + foreach (array_slice($matches,0,5) as $line) { + $line = WikiPlugin_FullTextSearch::highlight_line($line, $hilight_re); + $html[] = HTML::dd(HTML::small(array('class' => 'search-context'), + $line)); + } + if ($score) + $html[] = sprintf("... [%0.1f]",$score); + return HTML::div(array('style' => 'font-size:x-small'), + HTML::div(array('class' => 'transclusion'), + $html)); + } + // Remove special characters so that highlighting works + $search = preg_replace('/^[\^\*]/', '', $search); + $search = preg_replace('/[\^\*]$/', '', $search); + $c =& $revision_handle->getPackedContent(); if ($search and ($i = strpos(strtolower($c), strtolower($search))) !== false) { $l = strlen($search); $j = max(0, $i - ($this->bytes / 2)); return HTML::div(array('style' => 'font-size:x-small'), HTML::div(array('class' => 'transclusion'), - HTML::span(($j ? '...' : '').substr($c, $j, ($j ? $this->bytes / 2 : $i))), - HTML::span(array("style"=>"background:yellow"),substr($c, $i, $l)), - HTML::span(substr($c, $i+$l, ($this->bytes / 2))."..."." ".($score ? sprintf("[%0.1f]",$score):"")))); + HTML::span(($j ? '...' : '') + .substr($c, $j, ($j ? $this->bytes / 2 : $i))), + HTML::span(array("style"=>"background:yellow"), + substr($c, $i, $l)), + HTML::span(substr($c, $i+$l, ($this->bytes / 2)) + ."..."." " + .($score ? sprintf("[%0.1f]",$score):"")))); } else { - if (strpos($c," ") !== false) + if (strpos($c," ") !== false) $c = ""; else $c = sprintf(_("%s not found"), '»'.$search.'«'); Modified: trunk/lib/plugin/FullTextSearch.php =================================================================== --- trunk/lib/plugin/FullTextSearch.php 2009-11-04 15:45:25 UTC (rev 7258) +++ trunk/lib/plugin/FullTextSearch.php 2009-11-05 14:34:03 UTC (rev 7259) @@ -1,7 +1,7 @@ <?php // -*-php-*- rcs_id('$Id$'); /* - * Copyright 1999,2000,2001,2002,2004,2005,2007 $ThePhpWikiProgrammingTeam + * Copyright 1999-2002,2004,2005,2007,2009 $ThePhpWikiProgrammingTeam * * This file is part of PhpWiki. * @@ -88,7 +88,7 @@ unset($args['info']); $args['listtype'] = 'dl'; $args['types'] = array(new _PageList_Column_content - ('rev:hi_content', _("Content"), "left", $s)); + ('rev:hi_content', _("Content"), "left", $s, $hilight_re)); $list = new PageList(false, $exclude, $args); $list->setCaption(fmt("Full text search results for '%s'", $s)); while ($page = $pages->next()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-01-22 13:58:38
|
Revision: 7285 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7285&view=rev Author: vargenau Date: 2010-01-22 13:58:31 +0000 (Fri, 22 Jan 2010) Log Message: ----------- Replace 'split' function (deprecated in PHP5.3) by 'explode' function (for PHP 5.3 migration) Modified Paths: -------------- trunk/lib/CachedMarkup.php trunk/lib/PageType.php trunk/lib/stdlib.php Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2010-01-22 13:52:52 UTC (rev 7284) +++ trunk/lib/CachedMarkup.php 2010-01-22 13:58:31 UTC (rev 7285) @@ -682,7 +682,7 @@ } function getPagename($basepage) { - list ($moniker, $page) = split (":", $this->_link, 2); + list ($moniker, $page) = explode (":", $this->_link, 2); $page = new WikiPageName($page, $basepage); if ($page->isValid()) return $page->name; else return false; Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2010-01-22 13:52:52 UTC (rev 7284) +++ trunk/lib/PageType.php 2010-01-22 13:58:31 UTC (rev 7285) @@ -170,7 +170,7 @@ function link ($link, $linktext = false) { global $WikiTheme; - list ($moniker, $page) = split (":", $link, 2); + list ($moniker, $page) = explode (":", $link, 2); if (!isset($this->_map[$moniker])) { return HTML::span(array('class' => 'bad-interwiki'), Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2010-01-22 13:52:52 UTC (rev 7284) +++ trunk/lib/stdlib.php 2010-01-22 13:58:31 UTC (rev 7285) @@ -425,7 +425,7 @@ if (empty($alt)) $alt = ""; // Extract URL - $arr = split(' ',$url); + $arr = explode(' ',$url); if (!empty($arr)) $url = $arr[0]; if (! IsSafeURL($url)) { $link = HTML::span(array('class' => 'error'), _("BAD URL -- remove all of <, >, \"")); @@ -633,7 +633,7 @@ $img->setAttr('src', false); } } else { - $args = split(' ', $url); + $args = explode(' ', $url); if (count($args) >= 1) { $url = array_shift($args); $found = array(); @@ -716,7 +716,7 @@ function SplitQueryArgs ($query_args = '') { // FIXME: use the arg-seperator which might not be & - $split_args = split('&', $query_args); + $split_args = explode('&', $query_args); $args = array(); while (list($key, $val) = each($split_args)) if (preg_match('/^ ([^=]+) =? (.*) /x', $val, $m)) @@ -827,7 +827,7 @@ if (is_string($name)) { $this->shortName = $name; if (strstr($name, ':')) { - list($moniker, $shortName) = split (":", $name, 2); + list($moniker, $shortName) = explode (":", $name, 2); $map = getInterwikiMap(); // allow overrides to custom maps if (isset($map->_map[$moniker])) { $url = $map->_map[$moniker]; @@ -846,7 +846,7 @@ $name = $url; } if (strstr($shortName, '?')) { - list($shortName, $dummy) = split("\?", $shortName, 2); + list($shortName, $dummy) = explode("\?", $shortName, 2); } $this->shortName = $shortName; } @@ -1212,7 +1212,7 @@ * @return string */ function expand_tabs($str, $tab_width = 8) { - $split = split("\t", $str); + $split = explode("\t", $str); $tail = array_pop($split); $expanded = "\n"; foreach ($split as $hunk) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-01-22 14:07:01
|
Revision: 7286 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7286&view=rev Author: vargenau Date: 2010-01-22 14:06:31 +0000 (Fri, 22 Jan 2010) Log Message: ----------- Process log messages of type 'E_DEPRECATED' as warnings (for PHP 5.3 migration) Modified Paths: -------------- trunk/lib/ErrorManager.php trunk/lib/main.php Modified: trunk/lib/ErrorManager.php =================================================================== --- trunk/lib/ErrorManager.php 2010-01-22 13:58:31 UTC (rev 7285) +++ trunk/lib/ErrorManager.php 2010-01-22 14:06:31 UTC (rev 7286) @@ -12,9 +12,9 @@ error_reporting(E_ALL & ~E_STRICT); } */ -define ('EM_FATAL_ERRORS', E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | ~2048); +define ('EM_FATAL_ERRORS', E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | ~2048 & ((check_php_version(5,3)) ? ~E_DEPRECATED : ~0)); define ('EM_WARNING_ERRORS', - E_WARNING | E_CORE_WARNING | E_COMPILE_WARNING | E_USER_WARNING); + E_WARNING | E_CORE_WARNING | E_COMPILE_WARNING | E_USER_WARNING | ((check_php_version(5,3)) ? E_DEPRECATED : 0)); define ('EM_NOTICE_ERRORS', E_NOTICE | E_USER_NOTICE); /* It is recommended to leave assertions on. Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2010-01-22 13:58:31 UTC (rev 7285) +++ trunk/lib/main.php 2010-01-22 14:06:31 UTC (rev 7286) @@ -2,6 +2,8 @@ rcs_id('$Id$'); /* * Copyright 1999-2008 $ThePhpWikiProgrammingTeam + * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright (C) 2009 Roger Guignard, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -1330,7 +1332,7 @@ // Postpone warnings global $ErrorManager; if (defined('E_STRICT')) // and (E_ALL & E_STRICT)) // strict php5? - $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE|E_USER_WARNING|E_WARNING|E_STRICT); + $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE|E_USER_WARNING|E_WARNING|E_STRICT|((check_php_version(5,3)) ? E_DEPRECATED : 0)); else $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE|E_USER_WARNING|E_WARNING); $request = new WikiRequest(); 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:17:02
|
Revision: 7291 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7291&view=rev Author: vargenau Date: 2010-01-22 15:16:55 +0000 (Fri, 22 Jan 2010) Log Message: ----------- Add AUTHOR and PUBDATE in RSS feed Modified Paths: -------------- trunk/lib/RssParser.php trunk/lib/plugin/RssFeed.php Modified: trunk/lib/RssParser.php =================================================================== --- trunk/lib/RssParser.php 2010-01-22 15:12:23 UTC (rev 7290) +++ trunk/lib/RssParser.php 2010-01-22 15:16:55 UTC (rev 7291) @@ -45,6 +45,8 @@ extends XmlParser { var $title = ""; + var $author = ""; + var $pubDate = ""; var $link = ""; var $description = ""; var $inside_item = false; @@ -81,6 +83,8 @@ $GLOBALS['rss_parser_items'] =& $this->items; } $this->items[] = array("title" => $this->item['TITLE'], + "author" => $this->item['AUTHOR'], + "pubDate" => $this->item['PUBDATE'], "description" => @$this->item['DESCRIPTION'], "link" => $this->item['LINK']); $this->item = array("TITLE" => "", Modified: trunk/lib/plugin/RssFeed.php =================================================================== --- trunk/lib/plugin/RssFeed.php 2010-01-22 15:12:23 UTC (rev 7290) +++ trunk/lib/plugin/RssFeed.php 2010-01-22 15:16:55 UTC (rev 7291) @@ -98,6 +98,11 @@ HTML::a(array('href'=>$item['link']), HTML::raw($item['title']))); $cell->pushContent($cell_title); + $cell_author = HTML::raw($item['author']); + $cell_pubDate = HTML::raw($item['pubDate']); + $cell_authordate = HTML::div(array('class'=> 'authordate'), + $cell_author, HTML::raw(" - "), $cell_pubDate); + $cell->pushContent($cell_authordate); if (!empty($item['description'])) $cell->pushContent(HTML::div(array('class'=> 'itemdesc'), HTML::raw($item['description']))); 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-05-12 09:35:56
|
Revision: 7397 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7397&view=rev Author: vargenau Date: 2010-05-12 09:35:50 +0000 (Wed, 12 May 2010) Log Message: ----------- New global $AllAllowedPlugins; version of plugins no longer makes sense with Subversion global version number Modified Paths: -------------- trunk/lib/IniConfig.php trunk/lib/plugin/PluginManager.php Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2010-05-12 09:32:34 UTC (rev 7396) +++ trunk/lib/IniConfig.php 2010-05-12 09:35:50 UTC (rev 7397) @@ -591,68 +591,148 @@ $ErrorManager->pushErrorHandler (new WikiFunctionCb('_ignore_unknown_charset_warning')); } - // Used by SetupWiki to pull in required pages, if not translated, then in english. - // Also used by _WikiTranslation. Really important are only those which return pagelists - // or contain basic functionality. - /* - All pages containing plugins of the same name as the filename: - cd pgsrc - grep -l '\?plugin ' *| perl -ne'$/=0;chop; s/%([\da-fA-F]{2})/pack("C",hex($1))/ge; next LINE if m{^(Help/|Template|Pgsrc)}; print "$_\n"; {local $/;open F,"<$_"; $f=join("",<F>);} push @a,$_ if $f=~/plugin $_/; END{print join(":",@a)};' - */ - $AllActionPages = explode(':', + + // All pages containing plugins of the same name as the filename + $ActionPages = explode(':', 'AllPages:AllUsers:AppendText:AuthorHistory:' .'BackLinks:' .'CreatePage:' - .'FindPage:FullTextSearch:FuzzyPages:' + .'FullTextSearch:FuzzyPages:' .'LikePages:LinkDatabase:LinkSearch:ListRelations:' .'ModeratedPage:MostPopular:' .'NewPagesPerUser:' .'OrphanedPages:' .'PageDump:PageHistory:PageInfo:PluginManager:' .'RateIt:' // RateIt works only in wikilens derived themes - .'RandomPage:RecentChanges:RelatedChanges:' + .'RandomPage:RecentChanges:RelatedChanges:RecentEdits:' .'SearchHighlight:SemanticRelations:SemanticSearch:SystemInfo:' .'TitleSearch:' .'UpLoad:UserPreferences:' .'UserRatings:' // UserRatings works only in wikilens derived themes - .'WantedPages:WatchPage:WhoIsOnline:WikiAdminSelect:' - // plus some derivations - .'AllPagesCreatedByMe:AllPagesLastEditedByMe:AllPagesOwnedByMe:AllUserPages:' - .'FullRecentChanges:' - .'LeastPopular:LockedPages:' - .'MyRecentEdits:MyRecentChanges:' - .'PhpWikiAdministration:' - .'PhpWikiAdministration/Chown:' - .'PhpWikiAdministration/Purge:' - .'PhpWikiAdministration/Remove:' - .'PhpWikiAdministration/Rename:' - .'PhpWikiAdministration/SearchReplace:' - .'PhpWikiAdministration/SetAcl:' - .'RecentChangesMyPages:RecentEdits:RecentNewPages:' - .'UserContribs'); + .'WantedPages:WatchPage:WhoIsOnline:WikiAdminSelect'); // The GFORGE theme omits them if (!defined('GFORGE') or !GFORGE) { // Add some some action pages depending on configuration if (defined('DEBUG') and DEBUG) { - $AllActionPages[] = 'DebugInfo'; - $AllActionPages[] = 'EditMetaData'; - $AllActionPages[] = 'SpellCheck'; // SpellCheck does not work + $ActionPages[] = 'DebugInfo'; + $ActionPages[] = 'EditMetaData'; + $ActionPages[] = 'SpellCheck'; // SpellCheck does not work + } + $ActionPages[] = 'BlogArchives'; + $ActionPages[] = 'BlogJournal'; + $ActionPages[] = 'InterWikiSearch'; + $ActionPages[] = 'LdapSearch'; + $ActionPages[] = 'PasswordReset'; + $ActionPages[] = 'RecentComments'; + $ActionPages[] = 'TranslateText'; + $ActionPages[] = 'UriResolver'; + $ActionPages[] = 'WikiBlog'; + } + + global $AllAllowedPlugins; + $AllAllowedPlugins = $ActionPages; + // Add plugins that have no corresponding action page + $AllAllowedPlugins[] = 'AsciiSVG'; + $AllAllowedPlugins[] = 'BoxRight'; + $AllAllowedPlugins[] = 'CalendarList'; + $AllAllowedPlugins[] = 'Calendar'; + $AllAllowedPlugins[] = 'CategoryPage'; + $AllAllowedPlugins[] = 'Chart'; + $AllAllowedPlugins[] = 'Comment'; + $AllAllowedPlugins[] = 'CreateBib'; + $AllAllowedPlugins[] = 'CreateToc'; + $AllAllowedPlugins[] = 'CurrentTime'; + $AllAllowedPlugins[] = 'DeadEndPages'; + $AllAllowedPlugins[] = 'Diff'; + $AllAllowedPlugins[] = 'DynamicIncludePage'; + $AllAllowedPlugins[] = 'ExternalSearch'; + $AllAllowedPlugins[] = 'FileInfo'; + $AllAllowedPlugins[] = 'GoogleMaps'; + $AllAllowedPlugins[] = 'GooglePlugin'; + $AllAllowedPlugins[] = 'GoTo'; + $AllAllowedPlugins[] = 'HelloWorld'; + $AllAllowedPlugins[] = 'IncludePage'; + $AllAllowedPlugins[] = 'IncludePages'; + $AllAllowedPlugins[] = 'IncludeSiteMap'; + $AllAllowedPlugins[] = 'IncludeTree'; + $AllAllowedPlugins[] = 'ListPages'; + $AllAllowedPlugins[] = 'ListSubpages'; + $AllAllowedPlugins[] = 'MediawikiTable'; + $AllAllowedPlugins[] = 'NoCache'; + $AllAllowedPlugins[] = 'OldStyleTable'; + $AllAllowedPlugins[] = 'PageGroup'; + $AllAllowedPlugins[] = 'PageTrail'; + $AllAllowedPlugins[] = 'PhotoAlbum'; + $AllAllowedPlugins[] = 'PhpHighlight'; + $AllAllowedPlugins[] = 'PopularTags'; + $AllAllowedPlugins[] = 'PopUp'; + $AllAllowedPlugins[] = 'PrevNext'; + $AllAllowedPlugins[] = 'Processing'; + $AllAllowedPlugins[] = 'RawHtml'; + $AllAllowedPlugins[] = 'RecentChangesCached'; + $AllAllowedPlugins[] = 'RecentReferrers'; + $AllAllowedPlugins[] = 'RedirectTo'; + $AllAllowedPlugins[] = 'RichTable'; + $AllAllowedPlugins[] = 'RssFeed'; + $AllAllowedPlugins[] = 'SemanticSearchAdvanced'; + $AllAllowedPlugins[] = 'SiteMap'; + $AllAllowedPlugins[] = 'SyncWiki'; + $AllAllowedPlugins[] = 'SyntaxHighlighter'; + $AllAllowedPlugins[] = 'Template'; + $AllAllowedPlugins[] = 'Transclude'; + $AllAllowedPlugins[] = 'UnfoldSubpages'; + $AllAllowedPlugins[] = 'Video'; + $AllAllowedPlugins[] = 'WikiAdminChown'; + $AllAllowedPlugins[] = 'WikiAdminPurge'; + $AllAllowedPlugins[] = 'WikiAdminRemove'; + $AllAllowedPlugins[] = 'WikiAdminRename'; + $AllAllowedPlugins[] = 'WikiAdminSearchReplace'; + $AllAllowedPlugins[] = 'WikiAdminSetAcl'; + $AllAllowedPlugins[] = 'WikiAdminUtils'; + $AllAllowedPlugins[] = 'WikicreoleTable'; + $AllAllowedPlugins[] = 'WikiForm'; + $AllAllowedPlugins[] = 'WikiFormRich'; + $AllAllowedPlugins[] = 'WikiPoll'; + $AllAllowedPlugins[] = 'YouTube'; + + // Used by SetupWiki to pull in required pages, if not translated, then in english. + // Also used by _WikiTranslation. Really important are only those which return pagelists + // or contain basic functionality. + $AllActionPages = $ActionPages; + $AllActionPages[] = 'AllPagesCreatedByMe'; + $AllActionPages[] = 'AllPagesLastEditedByMe'; + $AllActionPages[] = 'AllPagesOwnedByMe'; + $AllActionPages[] = 'AllUserPages'; + $AllActionPages[] = 'FullRecentChanges'; + $AllActionPages[] = 'LeastPopular'; + $AllActionPages[] = 'LockedPages'; + $AllActionPages[] = 'MyRecentEdits'; + $AllActionPages[] = 'MyRecentChanges'; + $AllActionPages[] = 'PhpWikiAdministration'; + $AllActionPages[] = 'PhpWikiAdministration/Chown'; + $AllActionPages[] = 'PhpWikiAdministration/Purge'; + $AllActionPages[] = 'PhpWikiAdministration/Remove'; + $AllActionPages[] = 'PhpWikiAdministration/Rename'; + $AllActionPages[] = 'PhpWikiAdministration/SearchReplace'; + $AllActionPages[] = 'PhpWikiAdministration/SetAcl'; + $AllActionPages[] = 'RecentChangesMyPages'; + $AllActionPages[] = 'RecentEdits'; + $AllActionPages[] = 'RecentNewPages'; + $AllActionPages[] = 'UserContribs'; + + // The GFORGE theme omits them + if (!defined('GFORGE') or !GFORGE) { + // Add some some action pages depending on configuration + if (defined('DEBUG') and DEBUG) { $AllActionPages[] = 'PhpWikiAdministration/Chmod'; } - $AllActionPages[] = 'BlogArchives'; - $AllActionPages[] = 'BlogJournal'; - $AllActionPages[] = 'InterWikiSearch'; - $AllActionPages[] = 'LdapSearch'; - $AllActionPages[] = 'PasswordReset'; $AllActionPages[] = 'PhpWikiAdministration/Markup'; - $AllActionPages[] = 'RecentComments'; - $AllActionPages[] = 'TranslateText'; - $AllActionPages[] = 'UriResolver'; - $AllActionPages[] = 'WikiBlog'; } + if (defined('GFORGE') and GFORGE) { if (defined('ENABLE_EXTERNAL_PAGES') and ENABLE_EXTERNAL_PAGES) { + $AllAllowedPlugins[] = 'WikiAdminSetExternal'; $AllActionPages[] = 'ExternalPages'; } } Modified: trunk/lib/plugin/PluginManager.php =================================================================== --- trunk/lib/plugin/PluginManager.php 2010-05-12 09:32:34 UTC (rev 7396) +++ trunk/lib/plugin/PluginManager.php 2010-05-12 09:35:50 UTC (rev 7397) @@ -58,8 +58,6 @@ $this->_generateColheadings($info, $table); $this->_generateTableBody($info, $dbi, $request, $table); $h->pushContent($table); - - //$h->pushContent(HTML::h2(_("Disabled Plugins"))); } else { $h->pushContent(fmt("You must be an administrator to %s.", @@ -75,7 +73,7 @@ function _generateColheadings(&$info, &$table) { // table headings $tr = HTML::tr(); - $headings = array(_("Plugin"), _("Version"), _("Description")); + $headings = array(_("Plugin"), _("Description")); if ($info == 'args') $headings []= _("Arguments"); foreach ($headings as $title) { @@ -86,6 +84,8 @@ function _generateTableBody(&$info, &$dbi, &$request, &$table) { + global $AllAllowedPlugins; + $plugin_dir = 'lib/plugin'; if (defined('PHPWIKI_DIR')) $plugin_dir = PHPWIKI_DIR . "/$plugin_dir"; @@ -100,8 +100,12 @@ $w = new WikiPluginLoader; foreach ($plugins as $pluginName) { + + $pluginName = str_replace(".php", "", $pluginName); + if (in_array($pluginName, $AllAllowedPlugins) === false) { + continue; + } // instantiate a plugin - $pluginName = str_replace(".php", "", $pluginName); $temppluginclass = "<? plugin $pluginName ?>"; // hackish $p = $w->getPlugin($pluginName, false); // second arg? // trap php files which aren't WikiPlugin~s @@ -114,7 +118,6 @@ continue; // skip this non WikiPlugin file } $desc = $p->getDescription(); - $ver = $p->getVersion(); $arguments = $p->getArgumentsDescription(); unset($p); //done querying plugin object, release from memory @@ -170,7 +173,7 @@ // plugin just has an actionpage $tr->pushContent(HTML::td($pluginNamelink)); } - $tr->pushContent(HTML::td($ver), HTML::td($desc)); + $tr->pushContent(HTML::td($desc)); if ($info == 'args') { // add Arguments column $style = array('style' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-05-31 12:01:44
|
Revision: 7448 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7448&view=rev Author: vargenau Date: 2010-05-31 12:01:38 +0000 (Mon, 31 May 2010) Log Message: ----------- Let's assume PHP >= 4.2 Modified Paths: -------------- trunk/lib/Request.php trunk/lib/WikiCallback.php trunk/lib/WikiUserNew.php trunk/lib/difflib.php trunk/lib/plugin/PhpHighlight.php trunk/lib/plugin/WikiAdminChmod.php trunk/lib/plugin/WikiAdminChown.php trunk/lib/plugin/WikiAdminMarkup.php trunk/lib/plugin/WikiAdminRemove.php trunk/lib/plugin/WikiAdminRename.php trunk/lib/plugin/WikiAdminSearchReplace.php trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/Request.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -20,14 +20,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// backward compatibility for PHP < 4.2.0 -if (!function_exists('ob_clean')) { - function ob_clean() { - ob_end_clean(); - ob_start(); - } -} - class Request { function Request() { Modified: trunk/lib/WikiCallback.php =================================================================== --- trunk/lib/WikiCallback.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/WikiCallback.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -119,37 +119,7 @@ function call_array ($args) { $method = &$this->methodName; - //$obj = &$this->object; - - // This should work, except PHP's before 4.0.5 (which includes mine) - // don't have 'call_user_method_array'. - if (check_php_version(4,0,5)) { - return call_user_func_array(array(&$this->object, $method), $args); - } - - // This should work, but doesn't. At least in my PHP, the object seems - // to get passed by value, rather than reference, so any changes to the - // object made by the called method get lost. - /* - switch (count($args)) { - case 0: return call_user_method($method, $obj); - case 1: return call_user_method($method, $obj, $args[0]); - case 2: return call_user_method($method, $obj, $args[0], $args[1]); - case 3: return call_user_method($method, $obj, $args[0], $args[1], $args[2]); - case 4: return call_user_method($method, $obj, $args[0], $args[1], $args[2], $args[3]); - default: trigger_error("Too many arguments to method callback", E_USER_ERROR); - } - */ - - // This seems to work, at least for me (so far): - switch (count($args)) { - case 0: return $this->object->$method(); - case 1: return $this->object->$method($args[0]); - case 2: return $this->object->$method($args[0], $args[1]); - case 3: return $this->object->$method($args[0], $args[1], $args[2]); - case 4: return $this->object->$method($args[0], $args[1], $args[2], $args[3]); - default: trigger_error("Too many arguments to method callback", E_USER_ERROR); - } + return call_user_func_array(array(&$this->object, $method), $args); } function toPearCb() { Modified: trunk/lib/WikiUserNew.php =================================================================== --- trunk/lib/WikiUserNew.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/WikiUserNew.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -1080,7 +1080,7 @@ $dbh = $request->getDbh(); // use phpwiki database } elseif ($dbh->getAuthParam('auth_dsn') == $dbh->getParam('dsn')) { $dbh = $request->getDbh(); // same phpwiki database - } else { // use another external database handle. needs PHP >= 4.1 + } else { // use another external database handle. $local_params = array_merge($GLOBALS['DBParams'],$GLOBALS['DBAuthParams']); $local_params['dsn'] = $local_params['auth_dsn']; $dbh = WikiDB::open($local_params); Modified: trunk/lib/difflib.php =================================================================== --- trunk/lib/difflib.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/difflib.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -11,7 +11,6 @@ // FIXME: possibly remove assert()'s for production version? -// PHP3 does not have assert() define('USE_ASSERTS', function_exists('assert')); class _DiffOp { Modified: trunk/lib/plugin/PhpHighlight.php =================================================================== --- trunk/lib/plugin/PhpHighlight.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/PhpHighlight.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -41,8 +41,6 @@ * * Author: Martin Geisler <gim...@gi...>. * - * Added compatibility for PHP < 4.2.0, where the highlight_string() - * function has no second argument. * Added ability to override colors defined in php.ini --Carsten Klapp * * Known Problems: Modified: trunk/lib/plugin/WikiAdminChmod.php =================================================================== --- trunk/lib/plugin/WikiAdminChmod.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminChmod.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -28,8 +28,6 @@ * Usage: <<WikiAdminChmod >> or called via WikiAdminSelect * Author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 so far. */ require_once('lib/PageList.php'); require_once('lib/plugin/WikiAdminSelect.php'); Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminChown.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -25,8 +25,6 @@ * Usage: <<WikiAdminChown s||=* >> or called via WikiAdminSelect * @author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 so far. */ require_once('lib/PageList.php'); require_once('lib/plugin/WikiAdminSelect.php'); Modified: trunk/lib/plugin/WikiAdminMarkup.php =================================================================== --- trunk/lib/plugin/WikiAdminMarkup.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminMarkup.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -25,8 +25,6 @@ * Usage: <<WikiAdminMarkup s||=* >> or called via WikiAdminSelect * @author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 so far. */ require_once('lib/PageList.php'); require_once('lib/plugin/WikiAdminSelect.php'); Modified: trunk/lib/plugin/WikiAdminRemove.php =================================================================== --- trunk/lib/plugin/WikiAdminRemove.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminRemove.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -28,7 +28,6 @@ * KNOWN ISSUES: * Currently we must be Admin. * Future versions will support PagePermissions. - * requires PHP 4.2 so far. */ // maybe display more attributes with this class... require_once('lib/PageList.php'); Modified: trunk/lib/plugin/WikiAdminRename.php =================================================================== --- trunk/lib/plugin/WikiAdminRename.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminRename.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -25,8 +25,6 @@ * Usage: <<WikiAdminRename >> or called via WikiAdminSelect * @author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 at least. */ require_once('lib/PageList.php'); require_once('lib/plugin/WikiAdminSelect.php'); Modified: trunk/lib/plugin/WikiAdminSearchReplace.php =================================================================== --- trunk/lib/plugin/WikiAdminSearchReplace.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminSearchReplace.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -25,8 +25,6 @@ * Usage: <<WikiAdminSearchReplace >> or called via WikiAdminSelect * Author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 so far. */ require_once('lib/PageList.php'); require_once('lib/plugin/WikiAdminSelect.php'); Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -27,9 +27,6 @@ * Usage: <<WikiAdminSetAcl >> or called via WikiAdminSelect * Author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 so far. - * * TODO: UI to add custom group/username. * Currently it's easier to dump a page, fix it manually and * import it, than use Setacl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-05-31 12:44:54
|
Revision: 7450 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7450&view=rev Author: vargenau Date: 2010-05-31 12:44:46 +0000 (Mon, 31 May 2010) Log Message: ----------- Remove safe_wordwrap, use standard PHP wordwrap Modified Paths: -------------- trunk/lib/config.php trunk/lib/plugin/PageDump.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2010-05-31 12:38:21 UTC (rev 7449) +++ trunk/lib/config.php 2010-05-31 12:44:46 UTC (rev 7450) @@ -518,10 +518,6 @@ } } -function safe_wordwrap($str, $width=80, $break="\n", $cut=false) { - return wordwrap($str, $width, $break, $cut); -} - function getUploadFilePath() { if (defined('UPLOAD_FILE_PATH')) { Modified: trunk/lib/plugin/PageDump.php =================================================================== --- trunk/lib/plugin/PageDump.php 2010-05-31 12:38:21 UTC (rev 7449) +++ trunk/lib/plugin/PageDump.php 2010-05-31 12:44:46 UTC (rev 7450) @@ -140,7 +140,7 @@ } // We are displaing inline preview in a WikiPage, so wrap the // text if it is too long--unless quoted-printable (TODO). - $mailified = safe_wordwrap($mailified, 70); + $mailified = wordwrap($mailified, 70); $dlcvs = Button(array(//'page' => $page, 'action' => $this->getName(), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-05-31 12:50:59
|
Revision: 7451 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7451&view=rev Author: vargenau Date: 2010-05-31 12:50:50 +0000 (Mon, 31 May 2010) Log Message: ----------- RIP Netscape 3 & 4 Modified Paths: -------------- trunk/lib/config.php trunk/lib/editpage.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2010-05-31 12:44:46 UTC (rev 7450) +++ trunk/lib/config.php 2010-05-31 12:50:50 UTC (rev 7451) @@ -96,14 +96,6 @@ if ($version) return $agent and browserVersion() >= $version; else return $agent; } -// NS3 or less -function isBrowserNS3() { - return (isBrowserNetscape() and browserVersion() < 4.0); -} -// NS4 or less -function isBrowserNS4() { - return (isBrowserNetscape() and browserVersion() < 5.0); -} // must omit display alternate stylesheets: konqueror 3.1.4 // http://sourceforge.net/tracker/index.php?func=detail&aid=945154&group_id=6121&atid=106121 function isBrowserKonqueror($version = false) { Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2010-05-31 12:44:46 UTC (rev 7450) +++ trunk/lib/editpage.php 2010-05-31 12:50:50 UTC (rev 7451) @@ -624,11 +624,6 @@ 'cols' => $request->getPref('editWidth'), 'readonly' => (bool) $readonly), $this->_content); - /** <textarea wrap="virtual"> is not valid XHTML but Netscape 4 requires it - * to wrap long lines. - */ - if (isBrowserNS4()) - $textarea->setAttr('wrap', 'virtual'); if (ENABLE_WYSIWYG) { return $this->WysiwygEdit->Textarea($textarea, $this->_wikicontent, $textarea->getAttr('name')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-05-31 13:24:05
|
Revision: 7457 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7457&view=rev Author: vargenau Date: 2010-05-31 13:23:56 +0000 (Mon, 31 May 2010) Log Message: ----------- Remove pcre_fix_posix_classes function Modified Paths: -------------- trunk/lib/CachedMarkup.php trunk/lib/IniConfig.php trunk/lib/config.php trunk/lib/stdlib.php Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2010-05-31 13:15:22 UTC (rev 7456) +++ trunk/lib/CachedMarkup.php 2010-05-31 13:23:56 UTC (rev 7457) @@ -176,9 +176,9 @@ function _glean_description($text) { static $two_sentences; if (!$two_sentences) { - $two_sentences = pcre_fix_posix_classes("[.?!][\")]*\s+[\"(]*[[:upper:])]" - . ".*" - . "[.?!][\")]*\s*[\"(]*([[:upper:])]|$)"); + $two_sentences = "[.?!][\")]*\s+[\"(]*[[:upper:])]" + . ".*" + . "[.?!][\")]*\s*[\"(]*([[:upper:])]|$)"; } if (!isset($this->_description) and preg_match("/$two_sentences/sx", $text)) Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2010-05-31 13:15:22 UTC (rev 7456) +++ trunk/lib/IniConfig.php 2010-05-31 13:23:56 UTC (rev 7457) @@ -56,8 +56,7 @@ * * - Get rid of WikiNameRegexp and KeywordLinkRegexp as globals by finding * everywhere that uses them as variables and modify the code to use - * them as constants. Will involve hacking around - * pcre_fix_posix_classes (probably with redefines()). + * them as constants. */ include_once (dirname(__FILE__)."/config.php"); @@ -969,8 +968,6 @@ } // language dependent updates: - $WikiNameRegexp = pcre_fix_posix_classes($WikiNameRegexp); - //if ($KeywordLinkRegexp) $KeywordLinkRegexp = pcre_fix_posix_classes($KeywordLinkRegexp); if (!defined('CATEGORY_GROUP_PAGE')) define('CATEGORY_GROUP_PAGE',_("CategoryGroup")); if (!defined('WIKI_NAME')) Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2010-05-31 13:15:22 UTC (rev 7456) +++ trunk/lib/config.php 2010-05-31 13:23:56 UTC (rev 7457) @@ -277,10 +277,6 @@ return $loc; } -function pcre_fix_posix_classes ($regexp) { - return $regexp; -} - function deduce_script_name() { $s = &$GLOBALS['HTTP_SERVER_VARS']; $script = @$s['SCRIPT_NAME']; Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2010-05-31 13:15:22 UTC (rev 7456) +++ trunk/lib/stdlib.php 2010-05-31 13:23:56 UTC (rev 7457) @@ -1280,7 +1280,7 @@ $RE[] = "/(${sep})([^${sep}]+)/"; foreach ($RE as $key) - $RE[$key] = pcre_fix_posix_classes($key); + $RE[$key] = $key; } foreach ($RE as $regexp) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2010-06-07 10:59:55
|
Revision: 7473 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7473&view=rev Author: rurban Date: 2010-06-07 10:59:48 +0000 (Mon, 07 Jun 2010) Log Message: ----------- simplify if GFORGE Modified Paths: -------------- trunk/lib/EditToolbar.php trunk/lib/MailNotify.php Modified: trunk/lib/EditToolbar.php =================================================================== --- trunk/lib/EditToolbar.php 2010-06-07 10:55:52 UTC (rev 7472) +++ trunk/lib/EditToolbar.php 2010-06-07 10:59:48 UTC (rev 7473) @@ -68,12 +68,13 @@ } if (ENABLE_EDIT_TOOLBAR) { - $js = JavaScript('',array('src' => $WikiTheme->_findData("toolbar.js"))); - if (empty($WikiTheme->_headers_printed)) - $WikiTheme->addMoreHeaders($js); + $js = JavaScript('',array('src' => $WikiTheme->_findData("toolbar.js"))); + if (empty($WikiTheme->_headers_printed)) { + $WikiTheme->addMoreHeaders($js); + } else { // from an actionpage: WikiBlog, AddComment, WikiForum - printXML($js); - printXML(JavaScript('define_f()')); + printXML($js); + printXML(JavaScript('define_f()')); } } @@ -96,8 +97,8 @@ $this->tokens['EDIT_TOOLBAR'] =& $content; } else { $content = $this->_generate(); - // regenerate buttons every 3600 seconds - $cache->save($id, $content, '+3600', 'toolbarcache'); + // regenerate buttons every 1 hr/6 hrs + $cache->save($id, $content, DEBUG ? '+3600' : '+21600', 'toolbarcache'); $this->tokens['EDIT_TOOLBAR'] =& $content; } } @@ -113,10 +114,8 @@ if (ENABLE_EDIT_TOOLBAR) { $username = $request->_user->UserName(); - if (defined('GFORGE') and GFORGE) { + if (GFORGE or DISABLE_MARKUP_WIKIWORD or (!isWikiWord($username))) { $username = '[['.$username.']]'; - } else if (DISABLE_MARKUP_WIKIWORD or (!isWikiWord($username))) { - $username = '['.$username.']'; } $signature = " ––".$username." ".CTime(); $toolarray = array( @@ -303,7 +302,7 @@ $categories = array(); while ($p = $pages->next()) { $page = $p->getName(); - if (defined('GFORGE') and GFORGE) { + if (GFORGE) { $categories[] = "['$page', '%0A----%0A%5B%5B".$page."%5D%5D']"; } else if (DISABLE_MARKUP_WIKIWORD or (!isWikiWord($page))) { $categories[] = "['$page', '%0A%5B".$page."%5D']"; @@ -383,7 +382,7 @@ require_once('lib/TextSearchQuery.php'); $dbi =& $GLOBALS['request']->_dbi; $page_iter = $dbi->titleSearch(new TextSearchQuery($query, $case_exact, $regex)); - if ($page_iter->count()) { + if ($page_iter->count() > 0) { global $WikiTheme; $pages = array(); while ($p = $page_iter->next()) { @@ -415,6 +414,12 @@ $pd = new fileSet($image_dir, '*'); $images = $pd->getFiles(); unset($pd); + if (UPLOAD_USERDIR) { + $image_dir .= "/" . $request->_user->_userid; + $pd = new fileSet($image_dir, '*'); + $images = array_merge($images, $pd->getFiles()); + unset($pd); + } sort($images); if (!empty($images)) { $image_js = ''; Modified: trunk/lib/MailNotify.php =================================================================== --- trunk/lib/MailNotify.php 2010-06-07 10:55:52 UTC (rev 7472) +++ trunk/lib/MailNotify.php 2010-06-07 10:59:48 UTC (rev 7473) @@ -61,7 +61,7 @@ function fromId() { global $request; - if (defined('GFORGE') and GFORGE) { + if (GFORGE) { return $request->_user->getId(); } else { return $request->_user->getId() . '@' . $request->get('REMOTE_HOST'); @@ -72,7 +72,7 @@ global $request; // Disable verification of emails for corporate env. - if (defined('GFORGE') and GFORGE) { + if (GFORGE) { $doverify = false; } @@ -188,10 +188,8 @@ $emails = $this->emails; $from = $this->from; // Do not send if modification is from Gforge admin - if (defined('GFORGE') and GFORGE) { - if ($from == ADMIN_USER) { - return; - } + if (GFORGE and $from == ADMIN_USER) { + return; } if (!$notice) $notice = _("PageChange Notification of %s"); $headers = "From: $from\r\n" . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2010-06-07 12:08:13
|
Revision: 7476 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7476&view=rev Author: rurban Date: 2010-06-07 12:08:07 +0000 (Mon, 07 Jun 2010) Log Message: ----------- simplify if GFORGE Modified Paths: -------------- trunk/lib/IniConfig.php trunk/lib/PagePerm.php Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2010-06-07 11:42:44 UTC (rev 7475) +++ trunk/lib/IniConfig.php 2010-06-07 12:08:07 UTC (rev 7476) @@ -194,6 +194,7 @@ 'DISABLE_HTTP_REDIRECT', 'PLUGIN_CACHED_USECACHE', 'PLUGIN_CACHED_FORCE_SYNCMAP', 'BLOG_DEFAULT_EMPTY_PREFIX', 'DATABASE_PERSISTENT', + 'GFORGE', 'ENABLE_DISCUSSION_LINK', 'ENABLE_CAPTCHA', 'ENABLE_WYSIWYG', 'WYSIWYG_DEFAULT_PAGETYPE_HTML', 'DISABLE_MARKUP_WIKIWORD', 'ENABLE_MARKUP_COLOR', 'ENABLE_MARKUP_TEMPLATE', @@ -203,7 +204,7 @@ 'ENABLE_AUTH_OPENID', 'INSECURE_ACTIONS_LOCALHOST_ONLY', 'ENABLE_MAILNOTIFY', 'ENABLE_RECENTCHANGESBOX', 'ENABLE_PAGE_PUBLIC', 'ENABLE_AJAX', 'ENABLE_EXTERNAL_PAGES', - 'READONLY', 'GFORGE' + 'READONLY' ); $rs = @parse_ini_file($file); Modified: trunk/lib/PagePerm.php =================================================================== --- trunk/lib/PagePerm.php 2010-06-07 11:42:44 UTC (rev 7475) +++ trunk/lib/PagePerm.php 2010-06-07 12:08:07 UTC (rev 7476) @@ -236,7 +236,7 @@ $page = $request->getPage($pagename); // Exceptions: - if (defined('GFORGE') and GFORGE) { + if (GFORGE) { if ($pagename != '.' && isset($request->_user->_is_external) && $request->_user->_is_external && ! $page->get('external')) { $permcache[$pagename][$access] = 0; return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |