|
From: <var...@us...> - 2008-09-05 15:18:41
|
Revision: 6234
http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6234&view=rev
Author: vargenau
Date: 2008-09-05 15:18:45 +0000 (Fri, 05 Sep 2008)
Log Message:
-----------
Implemented action=purge
Modified Paths:
--------------
trunk/lib/main.php
trunk/lib/removepage.php
trunk/themes/gforge/templates/actionbar.tmpl
Added Paths:
-----------
trunk/lib/purgepage.php
Modified: trunk/lib/main.php
===================================================================
--- trunk/lib/main.php 2008-09-05 09:48:17 UTC (rev 6233)
+++ trunk/lib/main.php 2008-09-05 15:18:45 UTC (rev 6234)
@@ -560,6 +560,7 @@
'create' => _("create this page"),
'loadfile' => _("load files into this wiki"),
'lock' => _("lock this page"),
+ 'purge' => _("purge this page"),
'remove' => _("remove this page"),
'unlock' => _("unlock this page"),
'upload' => _("upload a zip dump"),
@@ -601,6 +602,7 @@
'create' => _("Creating pages"),
'loadfile' => _("Loading files"),
'lock' => _("Locking pages"),
+ 'purge' => _("Purging pages"),
'remove' => _("Removing pages"),
'unlock' => _("Unlocking pages"),
'upload' => _("Uploading zip dumps"),
@@ -702,6 +704,7 @@
case 'upload':
case 'loadfile':
+ case 'purge':
case 'remove':
case 'lock':
case 'unlock':
@@ -1162,6 +1165,16 @@
$this->action_browse();
}
+ function action_purge () {
+ $pagename = $this->getArg('pagename');
+ if (strstr($pagename, _("PhpWikiAdministration"))) {
+ $this->action_browse();
+ } else {
+ include('lib/purgepage.php');
+ PurgePage($this);
+ }
+ }
+
function action_remove () {
// This check is now redundant.
//$user->requireAuth(WIKIAUTH_ADMIN);
@@ -1396,656 +1409,6 @@
if (!defined('PHPWIKI_NOMAIN') or !PHPWIKI_NOMAIN)
main();
-
-// $Log: not supported by cvs2svn $
-// Revision 1.244 2008/06/22 09:51:14 rurban
-//
-// Fix user_theme handling on login. pref store ->default_value
-// Fallback to default if '0'.
-//
-// Revision 1.243 2008/03/22 21:49:18 rurban
-// Improve pref handling
-// clone the user object before destroying the important but lengthy fields.
-// (overlong session data)
-//
-// Revision 1.242 2008/02/14 18:27:49 rurban
-// signin fixes for !ENABLE_USER_NEW (to overcome php-5.2 recursion login
-// problems)
-//
-// Revision 1.241 2007/09/22 12:39:32 rurban
-// fix unknown variable WikiTheme
-//
-// Revision 1.240 2007/09/19 18:02:12 rurban
-// htmldump optimization: continue dump on access denied
-//
-// Revision 1.239 2007/09/12 19:41:01 rurban
-// revise INSECURE_ACTIONS_LOCALHOST_ONLY actions
-//
-// Revision 1.238 2007/09/01 13:24:23 rurban
-// add INSECURE_ACTIONS_LOCALHOST_ONLY. advanced security settings
-//
-// Revision 1.237 2007/08/25 18:03:34 rurban
-// change rename action from access perm change to edit: allow the signed in user to rename.
-//
-// Revision 1.236 2007/07/21 18:08:49 rurban
-// more searchtypes
-//
-// Revision 1.235 2007/07/14 12:04:19 rurban
-// support searchtype=external (mediawiki like search buttons: Text, Title, External)
-//
-// Revision 1.234 2007/07/01 09:36:10 rurban
-// themes are now easier derivable classes from other themes.
-// removed global code setters, switched to $WikiTheme->load() in main
-//
-// Revision 1.233 2007/06/02 21:07:21 rurban
-// _isActionPage ($pagename, $verbose = true)
-//
-// Revision 1.232 2007/05/13 18:13:20 rurban
-// improve prefs: only save with userid
-//
-// Revision 1.231 2007/02/17 14:16:44 rurban
-// action_soap, action_setpref, anon perms for wikitohtml, setpref
-//
-// Revision 1.230 2007/01/27 21:52:15 rurban
-// Improved login header for !ALLOW_ANON_USER
-//
-// Revision 1.229 2007/01/07 18:44:30 rurban
-// Fix typo for moderation
-//
-// Revision 1.228 2007/01/02 13:22:17 rurban
-// allow application/xml for xmlrpc detection: acdropdown uses this type. silence findActionPage warnings
-//
-// Revision 1.227 2006/12/22 17:53:55 rurban
-// Remove action from edited url
-// move wikitohtml to lib/WysiwygEdit/Wikiwyg.php
-//
-// Revision 1.226 2006/09/06 06:01:45 rurban
-// minor cleanup
-//
-// Revision 1.225 2006/05/31 19:59:57 jeannicolas
-//
-//
-// Added wysiwyg_editor 1.1b
-//
-// Revision 1.224 2006/05/13 19:59:55 rurban
-// added wysiwyg_editor-1.3a feature by Jean-Nicolas GEREONE <jea...@st...>
-// converted wysiwyg_editor-1.3a js to WysiwygEdit framework
-// changed default ENABLE_WYSIWYG = true and added WYSIWYG_BACKEND = Wikiwyg
-//
-// Revision 1.223 2006/03/19 15:01:00 rurban
-// sf.net patch #1333957 by Matt Brown: Authentication cookie identical across all wikis on a host
-//
-// Revision 1.222 2006/03/19 14:53:12 rurban
-// sf.net patch #1438392 by Matt Brown: Bogo Login is broken when ENABLE_PAGEPERM=false
-//
-// Revision 1.221 2006/03/19 14:23:51 rurban
-// sf.net patch #1377011 by Matt Brown: add DATABASE_OPTIMISE_FREQUENCY
-//
-// Revision 1.220 2006/03/07 21:04:15 rurban
-// wikihash for php-5.1
-//
-// Revision 1.219 2005/10/30 14:20:42 rurban
-// move Captcha specific vars and methods into a Captcha object
-// randomize Captcha chars positions and angles (smoothly)
-//
-// Revision 1.218 2005/10/29 14:18:06 rurban
-// fix typo
-//
-// Revision 1.217 2005/09/18 12:44:00 rurban
-// novatrope patch to let only _AUTHENTICATED view pages
-//
-// Revision 1.216 2005/08/27 09:40:46 rurban
-// fix login with HttpAuth
-//
-// Revision 1.215 2005/08/07 10:50:27 rurban
-// postpone guard
-//
-// Revision 1.214 2005/08/07 09:14:03 rurban
-// fix cookie logout; let the WIKI_ID cookie get deleted
-//
-// Revision 1.213 2005/06/10 06:10:35 rurban
-// ensure Update Preferences gets through
-//
-// Revision 1.212 2005/04/25 20:17:14 rurban
-// captcha feature by Benjamin Drieu. Patch #1110699
-//
-// Revision 1.211 2005/04/11 19:42:54 rurban
-// reformatting, SESSION_SAVE_PATH check
-//
-// Revision 1.210 2005/04/07 06:06:34 rurban
-// add _SERVER[REMOTE_USER] check for pubcookie et al, Bug #1177259 (iamjpr)
-//
-// Revision 1.209 2005/04/06 06:19:30 rurban
-// Revert the previous wrong bugfix #1175761: USECACHE was mixed with WIKIDB_NOCACHE_MARKUP.
-// Fix WIKIDB_NOCACHE_MARKUP in main (always set it) and clarify it in WikiDB
-//
-// Revision 1.208 2005/02/28 21:24:32 rurban
-// ignore forbidden ini_set warnings. Bug #1117254 by Xavier Roche
-//
-// Revision 1.207 2005/02/10 19:03:37 rurban
-// try to avoid duoplicate lang/theme init
-//
-// Revision 1.206 2005/02/04 11:30:10 rurban
-// remove old comments
-//
-// Revision 1.205 2005/01/29 20:41:47 rurban
-// some minor php5 strictness fixes
-//
-// Revision 1.204 2005/01/25 07:35:42 rurban
-// add TODO comment
-//
-// Revision 1.203 2005/01/21 14:11:23 rurban
-// better moderation class tag
-//
-// Revision 1.202 2005/01/21 12:02:32 rurban
-// deduce username for xmlrpc also
-//
-// Revision 1.201 2005/01/20 10:18:17 rurban
-// reformatting
-//
-// Revision 1.200 2004/12/26 17:08:36 rurban
-// php5 fixes: case-sensitivity, no & new
-//
-// Revision 1.199 2004/12/19 00:58:01 rurban
-// Enforce PASSWORD_LENGTH_MINIMUM in almost all PassUser checks,
-// Provide an errormessage if so. Just PersonalPage and BogoLogin not.
-// Simplify httpauth logout handling and set sessions for all methods.
-// fix main.php unknown index "x" getLevelDescription() warning.
-//
-// Revision 1.198 2004/12/17 16:49:51 rurban
-// avoid Invalid username message on Sign In button click
-//
-// Revision 1.197 2004/12/17 16:39:55 rurban
-// enable sessions for HttpAuth
-//
-// Revision 1.196 2004/12/10 02:36:43 rurban
-// More help with the new native xmlrpc lib. no warnings, no user cookie on xmlrpc.
-//
-// Revision 1.195 2004/12/09 22:24:44 rurban
-// optimize on _DEBUG_SQL only. but now again on every 50th request, not just save.
-//
-// Revision 1.194 2004/11/30 17:46:49 rurban
-// added ModeratedPage POST action hook (part 2/3)
-//
-// Revision 1.193 2004/11/30 07:51:08 rurban
-// fixed SESSION_SAVE_PATH warning msg
-//
-// Revision 1.192 2004/11/21 11:59:20 rurban
-// remove final \n to be ob_cache independent
-//
-// Revision 1.191 2004/11/19 19:22:03 rurban
-// ModeratePage part1: change status
-//
-// Revision 1.190 2004/11/15 15:56:40 rurban
-// don't load PagePerm on ENABLE_PAGEPERM = false to save memory. Move mayAccessPage() to main.php
-//
-// Revision 1.189 2004/11/09 17:11:16 rurban
-// * revert to the wikidb ref passing. there's no memory abuse there.
-// * use new wikidb->_cache->_id_cache[] instead of wikidb->_iwpcache, to effectively
-// store page ids with getPageLinks (GleanDescription) of all existing pages, which
-// are also needed at the rendering for linkExistingWikiWord().
-// pass options to pageiterator.
-// use this cache also for _get_pageid()
-// This saves about 8 SELECT count per page (num all pagelinks).
-// * fix passing of all page fields to the pageiterator.
-// * fix overlarge session data which got broken with the latest ACCESS_LOG_SQL changes
-//
-// Revision 1.188 2004/11/07 16:02:52 rurban
-// new sql access log (for spam prevention), and restructured access log class
-// dbh->quote (generic)
-// pear_db: mysql specific parts seperated (using replace)
-//
-// Revision 1.187 2004/11/05 22:08:52 rurban
-// Ok: Fix loading all required userclasses beforehand. This is much slower than before but safes a few bytes RAM
-//
-// Revision 1.186 2004/11/05 20:53:35 rurban
-// login cleanup: better debug msg on failing login,
-// checked password less immediate login (bogo or anon),
-// checked olduser pref session error,
-// better PersonalPage without password warning on minimal password length=0
-// (which is default now)
-//
-// Revision 1.185 2004/11/01 13:55:05 rurban
-// fix against switching user new/old between sessions
-//
-// Revision 1.184 2004/11/01 10:43:57 rurban
-// seperate PassUser methods into seperate dir (memory usage)
-// fix WikiUser (old) overlarge data session
-// remove wikidb arg from various page class methods, use global ->_dbi instead
-// ...
-//
-// Revision 1.183 2004/10/14 19:23:58 rurban
-// remove debugging prints
-//
-// Revision 1.182 2004/10/12 13:13:19 rurban
-// php5 compatibility (5.0.1 ok)
-//
-// Revision 1.181 2004/10/07 16:08:58 rurban
-// fixed broken FileUser session handling.
-// thanks to Arnaud Fontaine for detecting this.
-// enable file user Administrator membership.
-//
-// Revision 1.180 2004/10/04 23:39:34 rurban
-// just aesthetics
-//
-// Revision 1.179 2004/09/25 18:57:42 rurban
-// better ACL error message: view not browse, change not setacl, ...
-//
-// Revision 1.178 2004/09/25 16:27:36 rurban
-// better not allowed description: on global disallowed, and on missing pageperms
-//
-// Revision 1.177 2004/09/14 10:31:09 rurban
-// exclude E_STRICT for php5: untested. I believe this must be set earlier because the parsing step is already strict, and this is called at run-time
-//
-// Revision 1.176 2004/08/05 17:33:22 rurban
-// aesthetic typo
-//
-// Revision 1.175 2004/07/13 13:08:25 rurban
-// fix PEAR memory waste issues
-//
-// Revision 1.174 2004/07/08 13:50:32 rurban
-// various unit test fixes: print error backtrace on _DEBUG_TRACE; allusers fix; new PHPWIKI_NOMAIN constant for omitting the mainloop
-//
-// Revision 1.173 2004/07/05 12:57:54 rurban
-// add mysql timeout
-//
-// Revision 1.172 2004/07/03 08:04:19 rurban
-// fixed implicit PersonalPage login (e.g. on edit), fixed to check against create ACL on create, not edit
-//
-// Revision 1.171 2004/06/29 09:30:42 rurban
-// force string hash
-//
-// Revision 1.170 2004/06/25 14:29:20 rurban
-// WikiGroup refactoring:
-// global group attached to user, code for not_current user.
-// improved helpers for special groups (avoid double invocations)
-// new experimental config option ENABLE_XHTML_XML (fails with IE, and document.write())
-// fixed a XHTML validation error on userprefs.tmpl
-//
-// Revision 1.169 2004/06/20 14:42:54 rurban
-// various php5 fixes (still broken at blockparser)
-//
-// Revision 1.168 2004/06/17 10:39:18 rurban
-// fix reverse translation of possible actionpage
-//
-// Revision 1.167 2004/06/16 13:21:16 rurban
-// stabilize on failing ldap queries or bind
-//
-// Revision 1.166 2004/06/15 09:15:52 rurban
-// IMPORTANT: fixed passwd handling for passwords stored in prefs:
-// fix encrypted usage, actually store and retrieve them from db
-// fix bogologin with passwd set.
-// fix php crashes with call-time pass-by-reference (references wrongly used
-// in declaration AND call). This affected mainly Apache2 and IIS.
-// (Thanks to John Cole to detect this!)
-//
-// Revision 1.165 2004/06/14 11:31:37 rurban
-// renamed global $Theme to $WikiTheme (gforge nameclash)
-// inherit PageList default options from PageList
-// default sortby=pagename
-// use options in PageList_Selectable (limit, sortby, ...)
-// added action revert, with button at action=diff
-// added option regex to WikiAdminSearchReplace
-//
-// Revision 1.164 2004/06/13 13:54:25 rurban
-// Catch fatals on the four dump calls (as file and zip, as html and mimified)
-// FoafViewer: Check against external requirements, instead of fatal.
-// Change output for xhtmldumps: using file:// urls to the local fs.
-// Catch SOAP fatal by checking for GOOGLE_LICENSE_KEY
-// Import GOOGLE_LICENSE_KEY and FORTUNE_DIR from config.ini.
-//
-// Revision 1.163 2004/06/13 11:35:32 rurban
-// check for create action on action=edit not to fool PagePerm checks
-//
-// Revision 1.162 2004/06/08 10:05:11 rurban
-// simplified admin action shortcuts
-//
-// Revision 1.161 2004/06/07 22:58:40 rurban
-// simplified chown, setacl, dump actions
-//
-// Revision 1.160 2004/06/07 22:44:14 rurban
-// added simplified chown, setacl actions
-//
-// Revision 1.159 2004/06/06 16:58:51 rurban
-// added more required ActionPages for foreign languages
-// install now english ActionPages if no localized are found. (again)
-// fixed default anon user level to be 0, instead of -1
-// (wrong "required administrator to view this page"...)
-//
-// Revision 1.158 2004/06/04 20:32:53 rurban
-// Several locale related improvements suggested by Pierrick Meignen
-// LDAP fix by John Cole
-// reanable admin check without ENABLE_PAGEPERM in the admin plugins
-//
-// Revision 1.157 2004/06/04 12:40:21 rurban
-// Restrict valid usernames to prevent from attacks against external auth or compromise
-// possible holes.
-// Fix various WikiUser old issues with default IMAP,LDAP,POP3 configs. Removed these.
-// Fxied more warnings
-//
-// Revision 1.156 2004/06/03 17:58:16 rurban
-// support immediate LANG and THEME switch inside a session
-//
-// Revision 1.155 2004/06/03 10:18:19 rurban
-// fix FileUser locking issues, new config ENABLE_PAGEPERM
-//
-// Revision 1.154 2004/06/02 18:01:46 rurban
-// init global FileFinder to add proper include paths at startup
-// adds PHPWIKI_DIR if started from another dir, lib/pear also
-// fix slashify for Windows
-// fix USER_AUTH_POLICY=old, use only USER_AUTH_ORDER methods (besides HttpAuth)
-//
-// Revision 1.153 2004/06/01 15:28:00 rurban
-// AdminUser only ADMIN_USER not member of Administrators
-// some RateIt improvements by dfrankow
-// edit_toolbar buttons
-//
-// Revision 1.152 2004/05/27 17:49:06 rurban
-// renamed DB_Session to DbSession (in CVS also)
-// added WikiDB->getParam and WikiDB->getAuthParam method to get rid of globals
-// remove leading slash in error message
-// added force_unlock parameter to File_Passwd (no return on stale locks)
-// fixed adodb session AffectedRows
-// added FileFinder helpers to unify local filenames and DATA_PATH names
-// editpage.php: new edit toolbar javascript on ENABLE_EDIT_TOOLBAR
-//
-// Revision 1.151 2004/05/25 12:40:48 rurban
-// trim the pagename
-//
-// Revision 1.150 2004/05/25 10:18:44 rurban
-// Check for UTF-8 URLs; Internet Explorer produces these if you
-// type non-ASCII chars in the URL bar or follow unescaped links.
-// Fixes sf.net bug #953949
-// src: languages/Language.php:checkTitleEncoding() from mediawiki
-//
-// Revision 1.149 2004/05/18 13:31:19 rurban
-// hold warnings until headers are sent. new Error-style with collapsed output of repeated messages
-//
-// Revision 1.148 2004/05/17 17:43:29 rurban
-// CGI: no PATH_INFO fix
-//
-// Revision 1.147 2004/05/15 19:48:33 rurban
-// fix some too loose PagePerms for signed, but not authenticated users
-// (admin, owner, creator)
-// no double login page header, better login msg.
-// moved action_pdf to lib/pdf.php
-//
-// Revision 1.146 2004/05/15 18:31:01 rurban
-// some action=pdf Request fixes: With MSIE it works now. Now the work with the page formatting begins.
-//
-// Revision 1.145 2004/05/12 10:49:55 rurban
-// require_once fix for those libs which are loaded before FileFinder and
-// its automatic include_path fix, and where require_once doesn't grok
-// dirname(__FILE__) != './lib'
-// upgrade fix with PearDB
-// navbar.tmpl: remove spaces for IE button alignment
-//
-// Revision 1.144 2004/05/06 19:26:16 rurban
-// improve stability, trying to find the InlineParser endless loop on sf.net
-//
-// remove end-of-zip comments to fix sf.net bug #777278 and probably #859628
-//
-// Revision 1.143 2004/05/06 17:30:38 rurban
-// CategoryGroup: oops, dos2unix eol
-// improved phpwiki_version:
-// pre -= .0001 (1.3.10pre: 1030.099)
-// -p1 += .001 (1.3.9-p1: 1030.091)
-// improved InstallTable for mysql and generic SQL versions and all newer tables so far.
-// abstracted more ADODB/PearDB methods for action=upgrade stuff:
-// backend->backendType(), backend->database(),
-// backend->listOfFields(),
-// backend->listOfTables(),
-//
-// Revision 1.142 2004/05/04 22:34:25 rurban
-// more pdf support
-//
-// Revision 1.141 2004/05/03 13:16:47 rurban
-// fixed UserPreferences update, esp for boolean and int
-//
-// Revision 1.140 2004/05/02 21:26:38 rurban
-// limit user session data (HomePageHandle and auth_dbi have to invalidated anyway)
-// because they will not survive db sessions, if too large.
-// extended action=upgrade
-// some WikiTranslation button work
-// revert WIKIAUTH_UNOBTAINABLE (need it for main.php)
-// some temp. session debug statements
-//
-// Revision 1.139 2004/05/02 15:10:07 rurban
-// new finally reliable way to detect if /index.php is called directly
-// and if to include lib/main.php
-// new global AllActionPages
-// SetupWiki now loads all mandatory pages: HOME_PAGE, action pages, and warns if not.
-// WikiTranslation what=buttons for Carsten to create the missing MacOSX buttons
-// PageGroupTestOne => subpages
-// renamed PhpWikiRss to PhpWikiRecentChanges
-// more docs, default configs, ...
-//
-// Revision 1.138 2004/05/01 15:59:29 rurban
-// more php-4.0.6 compatibility: superglobals
-//
-// Revision 1.137 2004/04/29 19:39:44 rurban
-// special support for formatted plugins (one-liners)
-// like <small><plugin BlaBla ></small>
-// iter->asArray() helper for PopularNearby
-// db_session for older php's (no &func() allowed)
-//
-// Revision 1.136 2004/04/29 17:18:19 zorloc
-// Fixes permission failure issues. With PagePermissions and Disabled
-// Actions when user did not have permission WIKIAUTH_FORBIDDEN was
-// returned. In WikiUser this was ok because WIKIAUTH_FORBIDDEN had a
-// value of 11 -- thus no user could perform that action. But
-// WikiUserNew has a WIKIAUTH_FORBIDDEN value of -1 -- thus a user
-// without sufficent permission to do anything. The solution is a new
-// high value permission level (WIKIAUTH_UNOBTAINABLE) to be the
-// default level for access failure.
-//
-// Revision 1.135 2004/04/26 12:15:01 rurban
-// check default config values
-//
-// Revision 1.134 2004/04/23 06:46:37 zorloc
-// Leave DB connection open when USE_DB_SESSION is true so that session info can be written to the DB.
-//
-// Revision 1.133 2004/04/20 18:10:31 rurban
-// config refactoring:
-// FileFinder is needed for WikiFarm scripts calling index.php
-// config run-time calls moved to lib/IniConfig.php:fix_configs()
-// added PHPWIKI_DIR smart-detection code (Theme finder)
-// moved FileFind to lib/FileFinder.php
-// cleaned lib/config.php
-//
-// Revision 1.132 2004/04/19 21:51:41 rurban
-// php5 compatibility: it works!
-//
-// Revision 1.131 2004/04/19 18:27:45 rurban
-// Prevent from some PHP5 warnings (ref args, no :: object init)
-// php5 runs now through, just one wrong XmlElement object init missing
-// Removed unneccesary UpgradeUser lines
-// Changed WikiLink to omit version if current (RecentChanges)
-//
-// Revision 1.130 2004/04/18 00:25:53 rurban
-// allow "0" pagename
-//
-// Revision 1.129 2004/04/07 23:13:19 rurban
-// fixed pear/File_Passwd for Windows
-// fixed FilePassUser sessions (filehandle revive) and password update
-//
-// Revision 1.128 2004/04/02 15:06:55 rurban
-// fixed a nasty ADODB_mysql session update bug
-// improved UserPreferences layout (tabled hints)
-// fixed UserPreferences auth handling
-// improved auth stability
-// improved old cookie handling: fixed deletion of old cookies with paths
-//
-// Revision 1.127 2004/03/25 17:00:31 rurban
-// more code to convert old-style pref array to new hash
-//
-// Revision 1.126 2004/03/24 19:39:03 rurban
-// php5 workaround code (plus some interim debugging code in XmlElement)
-// php5 doesn't work yet with the current XmlElement class constructors,
-// WikiUserNew does work better than php4.
-// rewrote WikiUserNew user upgrading to ease php5 update
-// fixed pref handling in WikiUserNew
-// added Email Notification
-// added simple Email verification
-// removed emailVerify userpref subclass: just a email property
-// changed pref binary storage layout: numarray => hash of non default values
-// print optimize message only if really done.
-// forced new cookie policy: delete pref cookies, use only WIKI_ID as plain string.
-// prefs should be stored in db or homepage, besides the current session.
-//
-// Revision 1.125 2004/03/14 16:30:52 rurban
-// db-handle session revivification, dba fixes
-//
-// Revision 1.124 2004/03/12 15:48:07 rurban
-// fixed explodePageList: wrong sortby argument order in UnfoldSubpages
-// simplified lib/stdlib.php:explodePageList
-//
-// Revision 1.123 2004/03/10 15:41:27 rurban
-// use default pref mysql table
-//
-// Revision 1.122 2004/03/08 18:17:09 rurban
-// added more WikiGroup::getMembersOf methods, esp. for special groups
-// fixed $LDAP_SET_OPTIONS
-// fixed _AuthInfo group methods
-//
-// Revision 1.121 2004/03/01 13:48:45 rurban
-// rename fix
-// p[] consistency fix
-//
-// Revision 1.120 2004/03/01 10:22:41 rurban
-// initializeTheme optimize
-//
-// Revision 1.119 2004/02/26 20:45:06 rurban
-// check for ALLOW_ANON_USER = false
-//
-// Revision 1.118 2004/02/26 01:32:03 rurban
-// fixed session login with old WikiUser object.
-// strangely, the errormask gets corrupted to 1, Pear???
-//
-// Revision 1.117 2004/02/24 17:19:37 rurban
-// debugging helpers only
-//
-// Revision 1.116 2004/02/24 15:17:14 rurban
-// improved auth errors with individual pages. the fact that you may
-// not browse a certain admin page does not conclude that you may not
-// browse the whole wiki. renamed browse => view
-//
-// Revision 1.115 2004/02/15 21:34:37 rurban
-// PageList enhanced and improved.
-// fixed new WikiAdmin... plugins
-// editpage, Theme with exp. htmlarea framework
-// (htmlarea yet committed, this is really questionable)
-// WikiUser... code with better session handling for prefs
-// enhanced UserPreferences (again)
-// RecentChanges for show_deleted: how should pages be deleted then?
-//
-// Revision 1.114 2004/02/15 17:30:13 rurban
-// workaround for lost db connnection handle on session restauration (->_auth_dbi)
-// fixed getPreferences() (esp. from sessions)
-// fixed setPreferences() (update and set),
-// fixed AdoDb DB statements,
-// update prefs only at UserPreferences POST (for testing)
-// unified db prefs methods (but in external pref classes yet)
-//
-// Revision 1.113 2004/02/12 13:05:49 rurban
-// Rename functional for PearDB backend
-// some other minor changes
-// SiteMap comes with a not yet functional feature request: includepages (tbd)
-//
-// Revision 1.112 2004/02/09 03:58:12 rurban
-// for now default DB_SESSION to false
-// PagePerm:
-// * not existing perms will now query the parent, and not
-// return the default perm
-// * added pagePermissions func which returns the object per page
-// * added getAccessDescription
-// WikiUserNew:
-// * added global ->prepare (not yet used) with smart user/pref/member table prefixing.
-// * force init of authdbh in the 2 db classes
-// main:
-// * fixed session handling (not triple auth request anymore)
-// * don't store cookie prefs with sessions
-// stdlib: global obj2hash helper from _AuthInfo, also needed for PagePerm
-//
-// Revision 1.111 2004/02/07 10:41:25 rurban
-// fixed auth from session (still double code but works)
-// fixed GroupDB
-// fixed DbPassUser upgrade and policy=old
-// added GroupLdap
-//
-// Revision 1.110 2004/02/03 09:45:39 rurban
-// LDAP cleanup, start of new Pref classes
-//
-// Revision 1.109 2004/01/30 19:57:58 rurban
-// fixed DBAuthParams['pref_select']: wrong _auth_dbi object used.
-//
-// Revision 1.108 2004/01/28 14:34:14 rurban
-// session table takes the common prefix
-// + various minor stuff
-// reallow password changing
-//
-// Revision 1.107 2004/01/27 23:23:39 rurban
-// renamed ->Username => _userid for consistency
-// renamed mayCheckPassword => mayCheckPass
-// fixed recursion problem in WikiUserNew
-// fixed bogo login (but not quite 100% ready yet, password storage)
-//
-// Revision 1.106 2004/01/26 09:17:49 rurban
-// * changed stored pref representation as before.
-// the array of objects is 1) bigger and 2)
-// less portable. If we would import packed pref
-// objects and the object definition was changed, PHP would fail.
-// This doesn't happen with an simple array of non-default values.
-// * use $prefs->retrieve and $prefs->store methods, where retrieve
-// understands the interim format of array of objects also.
-// * simplified $prefs->get() and fixed $prefs->set()
-// * added $user->_userid and class '_WikiUser' portability functions
-// * fixed $user object ->_level upgrading, mostly using sessions.
-// this fixes yesterdays problems with loosing authorization level.
-// * fixed WikiUserNew::checkPass to return the _level
-// * fixed WikiUserNew::isSignedIn
-// * added explodePageList to class PageList, support sortby arg
-// * fixed UserPreferences for WikiUserNew
-// * fixed WikiPlugin for empty defaults array
-// * UnfoldSubpages: added pagename arg, renamed pages arg,
-// removed sort arg, support sortby arg
-//
-// Revision 1.105 2004/01/25 03:57:15 rurban
-// WikiUserNew support (temp. ENABLE_USER_NEW constant)
-//
-// Revision 1.104 2003/12/26 06:41:16 carstenklapp
-// Bugfix: Try to defer OS errors about session.save_path and ACCESS_LOG,
-// so they don't prevent IE from partially (or not at all) rendering the
-// page. This should help a little for the IE user who encounters trouble
-// when setting up a new PhpWiki for the first time.
-//
-// Revision 1.103 2003/12/02 00:10:00 carstenklapp
-// Bugfix: Ongoing work to untangle UserPreferences/WikiUser/request code
-// mess: UserPreferences should take effect immediately now upon signing
-// in.
-//
-// Revision 1.102 2003/11/25 22:55:32 carstenklapp
-// Localization bugfix: For wikis where English is not the default system
-// language, make sure that the authority error message (i.e. "You must
-// sign in to edit pages in this wiki" etc.) is displayed in the wiki's
-// default language. Previously it would always display in English.
-// (Added call to update_locale() before displaying any messages prior to
-// the login prompt.)
-//
-// Revision 1.101 2003/11/25 21:49:44 carstenklapp
-// Bugfix: For a non-english wiki or when the user's preference is not
-// english, the wiki would always use the english ActionPage first if it
-// was present rather than the appropriate localised variant. (PhpWikis
-// running only in english or Wikis running ONLY without any english
-// ActionPages would not notice this bug, only when both english and
-// localised ActionPages were in the DB.) Now we check for the localised
-// variant first.
-//
-// Revision 1.100 2003/11/18 16:54:18 carstenklapp
-// Reformatting only: Tabs to spaces, added rcs log.
-//
-
-
// Local Variables:
// mode: php
// tab-width: 8
Added: trunk/lib/purgepage.php
===================================================================
--- trunk/lib/purgepage.php (rev 0)
+++ trunk/lib/purgepage.php 2008-09-05 15:18:45 UTC (rev 6234)
@@ -0,0 +1,70 @@
+<?php
+rcs_id('$Id: purgepage.php,v 1.26 2004/12/20 12:12:31 rurban Exp $');
+require_once('lib/Template.php');
+
+function PurgePage (&$request) {
+ global $WikiTheme;
+
+ $page = $request->getPage();
+ $pagelink = WikiLink($page);
+
+ if ($request->getArg('cancel')) {
+ $request->redirect(WikiURL($page)); // noreturn
+ }
+
+ $current = $page->getCurrentRevision();
+
+ if (!$current or !($version = $current->getVersion())) {
+ $html = HTML::p(array('class' => 'error'), _("Sorry, this page does not exist."));
+ }
+ elseif (!$request->isPost() || !$request->getArg('verify')) {
+
+ $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)),
+ 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()
+ );
+ $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));
+ }
+ elseif ($request->getArg('currentversion') != $version) {
+ $html = HTML(HTML::p(array('class' => 'error'), (_("Someone has edited the page!"))),
+ HTML::p(fmt("Since you started the purge process, someone has saved a new version of %s. Please check to make sure you still want to permanently purge the page from the database.", $pagelink)));
+ }
+ else {
+ // Real purge.
+ $pagename = $page->getName();
+ $dbi = $request->getDbh();
+ $dbi->purgePage($pagename);
+ $dbi->touch();
+ $html = HTML::div(array('class' => 'feedback'), fmt("Purged page '%s' successfully.", $pagename));
+ }
+
+ GeneratePage($html, _("Purge Page"));
+}
+
+// For emacs users
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>
Modified: trunk/lib/removepage.php
===================================================================
--- trunk/lib/removepage.php 2008-09-05 09:48:17 UTC (rev 6233)
+++ trunk/lib/removepage.php 2008-09-05 15:18:45 UTC (rev 6234)
@@ -15,15 +15,14 @@
$current = $page->getCurrentRevision();
if (!$current or !($version = $current->getVersion())) {
- $html = HTML(HTML::h2(_("Already deleted")),
- HTML::p(_("Sorry, this page is not in the database.")));
+ $html = HTML::p(array('class' => 'error'), _("Sorry, this page does not exist."));
}
elseif (!$request->isPost() || !$request->getArg('verify')) {
$removeB = Button('submit:verify', _("Remove Page"), 'wikiadmin');
$cancelB = Button('submit:cancel', _("Cancel"), 'button'); // use generic wiki button look
- $html = HTML(HTML::h2(fmt("You are about to remove '%s'!", $pagelink)),
+ $html = HTML(HTML::p(fmt("You are about to remove '%s'!", $pagelink)),
HTML::form(array('method' => 'post',
'action' => $request->getPostURL()),
HiddenInputs(array('currentversion' => $version,
@@ -45,7 +44,7 @@
$sample));
}
elseif ($request->getArg('currentversion') != $version) {
- $html = HTML(HTML::h2(_("Someone has edited the page!")),
+ $html = HTML(HTML::p(array('class' => 'error'), (_("Someone has edited the page!"))),
HTML::p(fmt("Since you started the deletion process, someone has saved a new version of %s. Please check to make sure you still want to permanently remove the page from the database.", $pagelink)));
}
else {
@@ -54,10 +53,7 @@
$dbi = $request->getDbh();
$dbi->deletePage($pagename);
$dbi->touch();
- $link = HTML::a(array('href' => 'javascript:history.go(-2)'),
- _("Back to the previous page."));
- $html = HTML(HTML::h2(fmt("Removed page '%s' successfully.", $pagename)),
- HTML::div($link), HTML::hr());
+ $html = HTML::div(array('class' => 'feedback'), fmt("Removed page '%s' successfully.", $pagename));
}
GeneratePage($html, _("Remove Page"));
@@ -72,4 +68,4 @@
// c-hanging-comment-ender-p: nil
// indent-tabs-mode: nil
// End:
-?>
\ No newline at end of file
+?>
Modified: trunk/themes/gforge/templates/actionbar.tmpl
===================================================================
--- trunk/themes/gforge/templates/actionbar.tmpl 2008-09-05 09:48:17 UTC (rev 6233)
+++ trunk/themes/gforge/templates/actionbar.tmpl 2008-09-05 15:18:45 UTC (rev 6234)
@@ -115,8 +115,8 @@
<td class="spacer"> </td>
<?php } ?>
- <?php if (($user->isAdmin() or mayAccessPage('remove', $page->getName())) && $revision) { ?>
- <td><?= Button('remove', _("Remove")) ?></td>
+ <?php if (($user->isAdmin() or mayAccessPage('purge', $page->getName())) && $revision) { ?>
+ <td><?= Button('purge', _("Purge")) ?></td>
<td class="spacer"> </td>
<?php } ?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|