Commit graph

244 commits

Author SHA1 Message Date
Daniel Friesen
476731f179 Followup r80248; Fix inverted message exists tests in ProtectionForm. 2011-08-17 14:10:41 +00:00
Rotem Liss
53e9941f36 In the protection form, show the current protection expiry time in the local time and not in UTC. 2011-08-03 07:33:00 +00:00
Aaron Schulz
930ccf282c * Split off WikiPage class from Article, WikiFilePage class from ImagePage, and WikiCategoryPage from CategoryPage.
* WikiPage functions/fields are "magically" part of Article when accessed for b/c. Magic is kind of ugly but there are too many callers to make breaking changes atm. Some functions are just wrappers for WikiPage ones (were magic won't work).
* Added newFromID() to each WikiPage subclass (works around pre-existing inheritance problem).
* Added Page class for convenient type hinting and changed hints from Article -> Page. This lets things use WikiPage objects without getting type errors.
* Updated FlaggedPage to extend WikiPage. Worked around getOldIdFromRequest().
* Added setTimestamp() to WikiPage and moved some timestamp setting code from ParserCache to Article.
* Removed ampersands from $dbw arguments.
* @TODO: dependency inject user objects for WikiPage

The idea is to migrate things to use WikiPage, as the run-of-the-mill "new Article()" call doesn't care about $oldid and $wgRequest. After that, Article, ImagePage, and CategoryPage can be rewritten as an Action class or something sane (a Viewer class of sorts).
2011-06-29 22:09:51 +00:00
Aaron Schulz
55c6aed1ab Removed raw Article->field accessing 2011-06-28 14:10:55 +00:00
Matěj Grabovský
c8c3159a85 Follow-up r90371, per comment by ^demon
Escape wikitext in username before passing it to certain messages; also remove <nowiki>s in those as they're superfluous.
2011-06-20 19:45:35 +00:00
Krinkle
2d03eedf8a WatchAction requires token (BREAKING CHANGE)
* (bug 27655) Require token for watching/unwatching pages
* Previously done for API (bug 29070) in r88522
* As with markpatrolled, the tokens are not compatible and made that way on purpose. The API requires the POST method and uses a universal token per-session. Since the front-end is all GET based (also per convention like in markpatrolled and rollback) they are stronger salted (title / action specific)
* ajax.watch used the API already and was switched in r88554.
* The actual watching/unwatching code was moved from WatchAction->onView to WatchAction::doWatch. This was done to allow the API to do the action without needing to generate a token like the front-end needs (or having to duplicate code). It is now similar to RecentChange::markPatrolled (in that it  also a "central" function that does not care about tokens, it's called after the token-handling)
* JavaScript / Gadgets that utilize action=watch in their scripts:
** Effects should be minimal as they should be using the API (see r88522 and wikitech-l)
** If they use index.php and scrap the link from the page, they can continue to do so.

* There are links to the watch action all over the place. I've tried to catch most of them, but there may be some I miss. Migration in most cases is just a matter of adding an array item to the $query for:
 'token' => WatchAction::getWatchToken( $title, $user [, $action] )
or changing:
 Action::factory( 'watch', $article )->execute();
to:
 WatchAction::doWatch( $title, $user );

While replacing the usages in some cases an instance of Article() no longer had to be created, in others $wgUser had to be retrieved from global (which was implied before but needs to be given directly now)

Other notes:
* Article->unwatch() and Article->watch(), which were deprecated as of 1.18 and are no longer used in core, may be broken in scenarios where the Request does not have a 'token' but is making a call to $article->watch()
* Some extensions need to be fixed, I'm currently running a grep search and will fix them a.s.a.p 


[1] http://www.mediawiki.org/wiki/ResourceLoader/Default_modules?mw.user#tokens
2011-06-06 00:09:03 +00:00
Sam Reed
36cb6833e4 More documentation updates and additions
Getting bored of this tonight now I think...
2011-05-21 20:06:57 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Roan Kattouw
7611624a1a (bug 16921) Add JavaScript-based enforcing of byte limits on move and protection forms. Patch by Jan Paul Posma 2011-04-25 11:39:30 +00:00
Happy-melon
8779f4b55f r86001, now with less scariness :P I took out the delete action and did purge instead, which is a much more self-contained action-with-a-form. Also implement a few changes suggested by Brion on IRC last night. 2011-04-14 10:38:29 +00:00
Happy-melon
bc4a096805 Revert r86001: Brion says it's too scary :D will recommit in pieces 2011-04-13 23:36:27 +00:00
Happy-melon
6dc8136d12 New infrastructure for actions, as discussed on wikitech-l. Fairly huge commit.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc).  Create abstract base classes Action and FormlessAction to support these two cases.  HTMLForm is an integral part of the form-based structure.
* Look mum, no globals!  :D  Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept.  This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php.  This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible.  There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter.  On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way.  Update LiquidThreads to use these new hooks where appropriate.
2011-04-13 23:04:07 +00:00
Happy-melon
21fcf991d0 Follow-ups to r84258 2011-03-18 22:28:39 +00:00
Happy-melon
ac5751ee48 Follow-up r84249: reimplement isAllowedAny(), and restore isAllowed() to only-accepting-one-parameter mode for the time being. 2011-03-18 21:07:05 +00:00
Happy-melon
81852ea1a6 Allow User::isAllowed() to take varargs. "is allowed X or Y" is by far the more common multiple permission check in core, so this is now the behaviour of isAllowed( X, Y ); also add isAllowedAll(...) for testing "is allowed X and Y". Has the nice side effect of adding visibility to a very old function. 2011-03-18 14:48:21 +00:00
Alexandre Emsenhuber
b85a785c22 We have OutputPage::showPermissionsErrorPage() for that 2011-02-08 15:19:49 +00:00
Daniel Friesen
39ab3cfc9f Implement Message::isBlank and Message::isDisabled.
And while we're at it... update a random assortment of code using wfEmptyMsg to use the new wfMessage class and our exists/isBlank/isDisabled methods.
2011-01-14 10:51:05 +00:00
Platonides
b422cf8111 A couple of Xml::hidden calls left by r75723 2010-10-31 18:17:56 +00:00
Trevor Parscal
fd5ad32869 Fixed check for mediaWiki existance and removed additional unneeded wrapping in mediaWiki.loader.using calls as per comments on r73499. 2010-09-22 18:03:29 +00:00
Roan Kattouw
32377424b9 Merging resourceloader branch into trunk. Full documentation is at http://www.mediawiki.org/wiki/ResourceLoader and a general overview has been posted on wikitech-li <http://lists.wikimedia.org/pipermail/wikitech-l/2010-September/049253.html>. One important change is that all JS is now loaded at the bottom, so any scripts assuming things from wikibits or whatever are present will fail. 2010-09-04 04:00:09 +00:00
Alexandre Emsenhuber
5be509b0c1 * Standardised file description headers
* Added some descriptions
* Added @file where needed
2010-08-08 14:23:14 +00:00
Alexandre Emsenhuber
3d57cb9db8 * Use Html::linkedScript() and Html::inlineScript() 2010-06-02 19:28:44 +00:00
Alexandre Emsenhuber
9ab3d55384 Fixed some doxygen warnings and documented a bit 2010-05-23 19:25:07 +00:00
Sam Reed
b6e0df246f Attempt at normalistion of comparison styles - empty string on left and right hand side normalised to it being on the rhs
Before this change, there were (? being regex 0 or 1)

"" ===? 1
'' ===? 24
"" !==? 8
'' !==? 32

== "" 14
== '' 344
!= "" 9
!== "" 4
!= '' 151
!== '' 85


Rhs was the much more common, and the preferred style by many developers.. (Was a similar discussion in #mediawiki recently.. After that lolbugreport i think)

Where there is a string (non empty) on the lhs, and variable/method call on the rhs still need normalising
2010-01-06 19:59:42 +00:00
Matěj Grabovský
4a099928f7 (bug 21455) Fixed "Watch this page" checkbox appearing on some special pages even to non-logged in users 2009-11-14 11:07:46 +00:00
Bryan Tong Minh
6fec9d682b Follow-up to r58633 and r58628 (lqt): Rename Title::getProtectionTypes to Title::getRestrictionTypes and fix the hook name. 2009-11-09 12:05:30 +00:00
Andrew Garrett
f6f5e90888 Enabling changes for r56828: some refactoring and code cleanup of the protection interface, including a new hook, generalisation to more restriction types than edit/move, and some other related changes. 2009-11-06 10:27:44 +00:00
Bryan Tong Minh
37a8e9a147 * (bug 6579) Fixed protecting images from uploading only
* Added upload by default to $wgRestrictionTypes

Also requires MessagesEn.php accidently committed in r58536
2009-11-04 12:55:00 +00:00
Aaron Schulz
0d833fe671 * Added $wgFlaggedRevsProtectLevels to allow for site defined review "protection" levels. Disables stabilization and a small fieldset to the protection form with the options.
* Added three ProtectionForm hooks for the above
* Removed PHP4-ism from getPageVisibilitySettings()
2009-10-02 18:46:19 +00:00
Alex Z
c255da09f0 (bug 20136) Synchronize the protection form expiry boxes onchange in addition to onkeyup.
Technically the onkeyup handler is redundant, but at least on Firefox, onchange doesn't run
until after the input loses focus, so its somewhat less intuitive, but necessary if the user
clicks an option from a browser's autosuggestion
2009-09-06 04:10:26 +00:00
Ryan Schmidt
bed5f5d54e * Add autopromote condition APCOND_BLOCKED to autopromote blocked users to various user groups.
* Add $wgRemoveGroups as a means of restricting a group's rights. The syntax is identical to $wgGroupPermissions, but users in these groups will have these rights stripped from them.
* Modify Special:ListGroupRights so that it displays revoked permissions as well (the display of assigned vs. revoked is changeable via css).
* Bump $wgStyleVersion
2009-06-18 02:50:16 +00:00
Alexandre Emsenhuber
36b535d199 Kill some E_NOTICE when protecting a non-existing page 2009-06-12 18:31:07 +00:00
Alexandre Emsenhuber
8e2e5d473e Fix for r51493, r51084 and realted: use Title::makeTitle() rather than Title::newFromText() 2009-06-05 13:12:15 +00:00
Siebrand Mazeland
e17b75e76a Follow-up to r51084:
* address case sensitivity issue raised by Splarka on CR
* also change to edit link on Special:Block
2009-06-05 07:33:57 +00:00
Siebrand Mazeland
f8f8dd2cb2 Fix a usability issue on protect and [file ]delete forms. "Edit ... reasons" link now contains action=edit to save a click. 2009-05-27 20:35:16 +00:00
Niklas Laxström
4bb02cdc33 * Follow-up for r50691, add \n to be safe in case there is line-start sensitive markup 2009-05-17 15:44:51 +00:00
Siebrand Mazeland
1f4160caa1 (bug 18522) Wrap MediaWiki:Protect-cascadeon in a div for identification (patch by Happy-melon) 2009-05-17 14:57:30 +00:00
Siebrand Mazeland
547858b7fe Use link() instead of deprecated makeLinkObj() where possible. 2009-05-08 23:24:31 +00:00
Chad Horohoe
2664b438f1 Remove some unused $wgOut's. 2009-04-07 15:56:26 +00:00
Aaron Schulz
c800133fbd Break line 2009-01-26 19:11:34 +00:00
Raimond Spekking
3fd4899655 Replaced some hardcoded colons with the colon-separator message 2009-01-07 22:49:54 +00:00
Aaron Schulz
eaf7243c5f (bug 16507) Not setting "other time" on creation unprotection error removed 2009-01-03 16:33:15 +00:00
Siebrand Mazeland
c678efcab2 Split date ($2) and time ($3) in 'protect-existing-expiry' per request of a translator. Leaving the old timestamp ($1) in for backward compatibility. 2008-10-06 20:01:43 +00:00
Chad Horohoe
414360a350 +a few docs 2008-10-06 15:31:03 +00:00
Alex Z
7049385253 Use a new message for protection form expiry options instead of recycling the blockip one. 2008-09-29 01:35:04 +00:00
Alex Z
2e373adf83 * (bug 15701) Protection form was too wide for some browsers as 2 columns, switching to 1 column format.
* Move the "unlock move permissions" checkbox to a more logical place with the options for move protection, instead of with the cascading checkbox.
2008-09-25 02:08:59 +00:00
Aaron Schulz
c4d743ec39 Shorten expiry box 2008-09-24 11:53:03 +00:00
Raimond Spekking
09049f4e32 Add a link to edit the proction reason list 2008-09-22 16:16:37 +00:00
Alex Z
6f2e810f8b Tweak to ProtectionForm: Title::getRestrictionExpiry returns 'infinity' for 'infinite' 2008-09-16 18:46:58 +00:00
Tim Starling
fd30ddc11a In protect.js:
* Use fragments of English when naming things, instead of a jumble of words vaguely related to the topic
* Use verbs in function names that are related to what the functions do
* Move all functions into an object, to avoid prefixes that look like part of a nonsensical sentence
* Fixed a bug whereby the "move" controls would not be unlocked if the expiry times differed. Refactored the relevant code.
* When the user types something into the "other time" box, automatically select "other time" from the drop-down list.

In ProtectionForm:
* Use the new protect.js interface
* Use accessor instead of Title member variable mRestrictionsExpiry
* Added an "existing expiry" option to the expiry drop-down list, instead of putting the ISO 8601 time in the "other" box
* Formatting
* Fixed convoluted expiry time data flow, documented
* s/List/Selection, for variables containing a value that the user has selected from a list
2008-09-16 04:09:06 +00:00
Alex Z
3a4183931c Allow cascading protection to be turned off without changing other settings 2008-09-14 01:11:54 +00:00
Aaron Schulz
cfda5fb062 make "other time" chain properly with JS 2008-09-13 09:24:51 +00:00
Aaron Schulz
66c1402e25 Cleanup for r40770:
* Clean up protection form
* Fix syntax typo (use '==', not '=')
* Fix $2 message in movepage cascade warning
2008-09-13 08:53:07 +00:00
Alex Z
807c3afaa7 (bug 12650) Make it possible to enter separate expiry times for each restriction type. 2008-09-13 05:33:24 +00:00
Alexandre Emsenhuber
0512db6bc3 We already have an Article object, so no need to recreate another one.
Also removed some PHP4-ism.
2008-09-11 20:01:39 +00:00
Rotem Liss
d3808460a6 Protection form: Show action as header of an action if the message for this action does not exist. 2008-09-07 08:28:45 +00:00
Rotem Liss
b4841ed400 Show properly-sized select elements in protection form when the user does not have a specific permission. 2008-09-07 08:24:00 +00:00
Aaron Schulz
d347a1a785 Some form consistency tweaks 2008-09-07 01:10:35 +00:00
Aaron Schulz
537d20c03b * Add time/reason dropdown for protect form (bug 10799)
* Shorten message
2008-09-06 23:20:58 +00:00
Aaron Schulz
a5fae953fd Fix regression from r40518; keep current values of page when no query params given 2008-09-06 17:12:45 +00:00
Aaron Schulz
b7b98cda92 Set values from query params (bug 12750) 2008-09-06 07:20:13 +00:00
Aryeh Gregor
650be91fb8 Refactor a bit preparatory to fixing bug 8068: rewrite the robot policy stuff in OutputPage to allow index and follow policy to be set separately. Also now validates input to setRobotPolicy(). And renamed setRobotpolicy to setRobotPolicy, too. If anyone was accessing $mRobotpolicy directly they're out of luck, though. 2008-07-23 19:05:43 +00:00
Ryan Schmidt
bbbd2e176a * fix error in buildSelector function 2008-07-02 01:44:20 +00:00
Aaron Schulz
7887c332de * Revert r36478; I don't see the point in this cryptic code
* Restore r36273 as explain on mailing list
2008-06-21 03:17:35 +00:00
Alexandre Emsenhuber
17a9beebd6 Note that restrictions are rights, not groups. So now, cascading protection will be allowed if all groups that have the right being check have the 'protect' right too. 2008-06-19 20:40:41 +00:00
Bryan Tong Minh
65e1c0cdeb Removed $wgEnableCascadingProtection. It was a quite pointless configuration setting which was not even properly implemented. Cascading protection has been always possible regardless of this configuration setting. 2008-06-11 21:36:07 +00:00
Ryan Schmidt
0f1cbdc80f * fixing bug 14241: pages can no longer be protected to levels you are not in 2008-05-24 16:49:05 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Niklas Laxström
2b6cfa578c * Expiry handling is really sub-optimal here 2008-04-18 06:57:47 +00:00
Brion Vibber
cf814a87c6 Cleanup for r33429 - fix double-escaping 2008-04-16 17:40:47 +00:00
Raimond Spekking
6c9f80faad * Use existing CSS classes for input form aligning
* Use more XML functions
2008-04-16 15:58:25 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Brion Vibber
19f2ab0bc4 * (bug 11039) Add missing labels on protection form
May help with screen readers which get a bit lost on the listbox-in-table layout
Fixed up some release notes entries
2008-04-09 00:02:13 +00:00
Aaron Schulz
441068209b Add showLogExtract() and remove use of FauxRequest hacks 2008-04-02 20:20:47 +00:00
Brion Vibber
44a34dbce8 * (bug 13428) Fix regression in protection form layout HTML validity
a ; in place of a . there...
2008-03-19 00:08:58 +00:00
Raimond Spekking
f035995162 * Add a CSS id to the 2nd table
* Prettify input form for RTL wikis a bit
2008-03-13 10:05:11 +00:00
Raimond Spekking
67e06d3a90 Fix PHP notice from r31871. Thanks to Aaron :) 2008-03-12 15:48:11 +00:00
Raimond Spekking
5188987d62 * Add a nice fieldset around the input form
* Use proper XML functions
* Make the title/subtitle of input form consistent with move/delete/filedelete/filerevert forms
* Rename the former subtitle message to the new title message for all languages
* Rename the former title message to the new legend message for all languages
* Kill whitespaces
2008-03-12 15:19:29 +00:00
Tim Starling
377561cd1e * Introduced OutputPage::addWikiMsg() and OutputPage::wrapWikiMsg(), to make it easier to avoid double-parsing. Double-parsing introduces differences between the old and new parsers.
* Used the new functions in the relevant places throughout the core. Where this was not possible, used wfMsgNoTrans() to avoid double-parsing.
* Calling wfEscapeWikiText() on a title before passing it to a message is unnecessary and causes bugs. The best idea is to let the message do its own escaping. Removed wfEscapeWikiText() from the caller of addedwatchtext, removedwatchtext, deletedtext, protect-text, nosuchusershort and movepage-moved. Updated all message files to use <nowiki>$1</nowiki> where appropriate in these messages. 
* Removed unnecessary empty message handling from semiprotectedpagewarning
* Removed nonsense warning about the output of wfMsg() not being safe for inclusion in HTML. 
* Changed wfShellExec() to use passthru/ob_get_contents instead of exec(). This avoids corruption of whitespace in the response. 
* Added $wgValidateAllHtml feature, to optionally validate HTML on output. 
* Fixed missing newline in cascadeprotected in MessagesEn.php
* Belatedly updated addedwatchtext to take account of the new "monobook" skin. No unwatch link in the sidebar anymore.
2008-02-18 07:25:35 +00:00
Raimond Spekking
cea6746acf partly revert of r30110. looks like an accident. 2008-01-24 13:58:40 +00:00
Huji
615041d7b4 (bug 12738) Database query syntax error in maintenance/storage/compressOld.inc 2008-01-24 11:21:36 +00:00
Brion Vibber
a15ed4bc6b * (bug 12567) Fix for misformatted read-only messages on edit, protect.
Also added proper read-only checks to several special pages.
  Have removed read-only checks from the general user permission framework
  since it doesn't belong there; user authorization is independent from
  the database's read-only state, and the way we check and present error
  conditions is necessarily different. Further, as a detail it was formatting
  the actual message incorrectly as an inline message when historically it's a
  big block message with tables and images and stuff.
2008-01-15 01:55:48 +00:00
Aaron Schulz
8d4aaa2121 More title protection clean up. JS errors were being thrown calling the non-existent cascade checkbox. Also the chain box was showing for non-existent titles even though 'create' was the only available protection type. 2007-12-11 22:10:44 +00:00
Andrew Garrett
34d22f6edc * (bug 2919) Allow the protection of non-existent pages using the regular protection interface.
* WARNING: This revision requires a schema change, which is included in maintenance/archives/patch-protected_titles.sql, and can be applied in the normal manner (update.php).
2007-12-11 09:51:56 +00:00
Andrew Garrett
a94424d59c * (bug 11346) Prevent users who cannot edit a page from changing its restrictions. 2007-12-01 09:08:43 +00:00
Rotem Liss
ea46bf1ff1 Limit text field of deletion, protection and user rights changes reasons to 255 characters (already restricted in the database) 2007-11-04 15:20:45 +00:00
Andrew Garrett
b62ec76ae2 * Ensure, on the server side, that cascading protection cannot be applied to anything but full protection, so as to prevent people from using semi-cascade-protected pages to protect arbitrary pages.
* Fix a bug in the previous javascript implementation of this behaviour (protection is per-right, not per-group!)
2007-09-10 06:27:36 +00:00
Rob Church
a54fc5b974 (bug 10872) Fall back to sane defaults when generating protection selector labels for custom restriction levels 2007-08-11 16:24:01 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Rob Church
9245969b82 Drop the redirect=no thing for non-redirects, per Brion. Seems like a waste of time and a needless load of the page record and text to me, but he's the boss... 2007-06-26 21:24:23 +00:00
Rob Church
e8e9be1176 (bug 10344) Don't follow a redirect after changing its protection level 2007-06-23 19:37:31 +00:00
Brion Vibber
cd3924342e Revert r23166, 23178, 23179, and probably some other related bits.
There are issues with putting robots stuff into the current protection system, so we're backing this out to prevent another backwards-compatibility disaster when it's done in a more reliable way. :)
2007-06-22 14:52:49 +00:00
Raimond Spekking
3b72b28943 * Some cosmetic tweaks
** ProtectionForm: move 'watch this page' checkbox between reason field and submit button like in all other forms too
** SpecialMovepage.php: right shift checkboxes a bit like in all other forms too, move hardcoded colons to message file for better localization
2007-06-22 07:41:45 +00:00
Rob Church
7fcf8aff1a i18n and better label text, don't assume all users speak robots.txt 2007-06-21 20:58:48 +00:00
Rob Church
795ed1c389 * Allow wiki links in "protect-robotspolicy", I imagine people are likely to want to link to help
* Typos
2007-06-21 20:50:29 +00:00
Rotem Liss
73c51ed3cc Adding a direction mark, for RTL wikis (it may be better to localise the text, though). 2007-06-21 16:08:11 +00:00
Raimond Spekking
8027310503 * (bug 9415) Added options to Special:Protect to allow setting of per-page robot
policies. This can be done only by users with the 'editrobots' permission
  Based on a patch of AmiDaniel
2007-06-21 15:51:28 +00:00
Rob Church
4d09760870 Our release manager believes I need to be shot. I am a mindless drone without opinion in this matter. 2007-06-19 14:42:46 +00:00
Rob Church
7734700c78 * (bug 8760) Allow wiki links in "protectexpiry" message
* Introduce wfMsgWithLinks() and a content-language counterpart, wfMsgForContentWithLinks(); these escape HTML and render wiki links in text, so should be suitable for labels and so on
* Make Linker::formatLinksInComment() public
2007-06-07 22:16:19 +00:00
Rob Church
768b1eadaa * (bug 9769) Provide "watch this page" toggle on protection form
* Clean up protection form a little
* Change default text for "protectcomment", "protectexpiry", "unprotectcomment" and "protect-cascade" messages
2007-06-05 02:18:49 +00:00
Daniel Cannon
b0d24a3a10 (bug 7691) Show deletion log following noarticletext and newarticletext when creating a new page. 2007-06-02 00:41:16 +00:00
Nick Jenkins
b4d37577b9 Removing or commenting out unused variables or globals, and adding declarations for two arrays. 2007-05-08 09:09:46 +00:00
Nick Jenkins
bd23ec29c6 Doc tweaks:
* Seems like an opportune time to introduce "@addtogroup Media" documentation tags.
* Merge "@addtogroup Metadata" (used by Exif.php) into "@addtogroup Media".
* Few more moving comment blocks to above classes.
2007-04-24 06:53:31 +00:00
Aaron Schulz
1937ee0924 *Add {{plural}} to Protect-cascadeon too. (bug 8664) 2007-04-24 02:04:04 +00:00
Raimond Spekking
e26d9b56ad * adding an ID to the submit button
* changing ID introduced with r20998: for new IDs use 'mw-'
2007-04-16 10:34:58 +00:00
Raimond Spekking
727b74e543 Adding an ID to the form itself 2007-04-04 07:35:13 +00:00
Nick Jenkins
113bb1c772 Documentation tweaks to help documentation systems (Doxygen + PHPDocumentor)
pick up the appropriate tags, and documentation blobs for classes. This is 
the same as per r20769, but with the grouping changes (e.g. removing "@{{") omitted.
Please be advised that more related documentation tweaks may follow later - e.g. 
Doxygen generates a log file of warnings that is 574 Kb in size, when run over 
the just the trunk/phase3 code ... eek! Thankfully, much of that is just 
whining about functions without documentation   ;-)
2007-04-04 05:22:37 +00:00
Rob Church
c0e0aa1de7 (bug 9033) Use a more specific error message when users are not able/allowed to edit page protection levels due to a block, database lock or permissions 2007-04-02 07:39:32 +00:00
Brion Vibber
3a6ac5a3c3 Revert r20769: we don't use PHPDocumentor anymore, we use doxygen.
If making mass changes to tweak to its preferences, probably better to do it for the tool we actually generate docs with. :)
2007-03-28 14:16:43 +00:00
Nick Jenkins
5fef2333d4 PHPDocumentor [http://en.wikipedia.org/wiki/PhpDocumentor] documentation tweaking stuff.
Minor doc tweaks to prevent some PHPDocumentor warnings or errors when run on the includes/ directory. PHPDocumentor uses a syntax very similar to javadoc - mostly we already use this, but there were a few scattered places that were adjusted to make them consistent with the rest of the code. In practical terms, these changes were made:
* @url becomes @link
* @fixme becomes @todo
* HTML tags in descriptions must be closed / balanced.
* @bug was removed (where the bug was long fixed), or changed into a @todo (in the few situations where the bug was still pending)
* @obsolete becomes @deprecated
* Things like "/**@{{" and "/**@}}*/" which cause "unknown tag" warnings were removed
* @access must be a valid access level.
* @desc tag not needed, removed.
* Doesn't seem to like @licence, will accept @license however.
* Use full comment block notation in a few places (i.e. open block with "/**", start each line with " *", and end block with " */")

Then additional to this, to get some class docs associated with their respective classes:
* Moved some docs to right above those classes (deleting blank lines, or moving descriptions from the file headers)
* Marked some classes without docs as "@todo document"
* (done up to "class MIMEsearchPage" on the "classtrees_MediaWiki.html" page for the includes/ directory)
2007-03-28 08:53:02 +00:00
Nick Jenkins
f1fb0bc169 * Prevent E_STRICT error when '$wgDebugDumpSql = true', and a path has been defined for $wgDebugLogFile,
but $wgDebugLogFile does not exist yet: "filesize(): stat failed for sql-log.txt in includes/GlobalFunctions.php on line 219"
* Removing unused global $IP.
* Indentation of an if/else block.
* Trivial comment typo.
* Prevent PHP Fatal error: "Call to a member function getText() on a non-object in includes/SpecialListusers.php on line 46", 
  when opening a URL such as http://192.168.0.64/wiki/index.php/Special:Listusers?username=%22%27%3E 
  (i.e. when "Display users starting at:" username supplied in Special:Listusers is not a valid MediaWiki title).
* Fix HTML validation of protection form (i.e. when "action=protect").
2007-03-19 07:08:58 +00:00
Aaron Schulz
11ef493f49 *Add nifty JS function to grey out cascade option when it will not apply 2007-03-15 02:52:28 +00:00
Aaron Schulz
f55dcf8e2f *Add framework for proper protection cascading 2007-03-14 22:57:32 +00:00
Andrew Garrett
4f98bda5ba Fix for ProtectionForm - consider expiry times invalid if theyre in the past. Also a *very* minor typo fix from my previous work on alignment in the expiry box. 2007-02-16 07:39:33 +00:00
Andrew Garrett
da8ae236ae Fix for ProtectionForm - make mwProtect-reason retain its value when errors are spat as errors are :-) 2007-02-16 07:21:03 +00:00
Andrew Garrett
be72d62432 Disable the expiry field in Protection for users without the requisite permission. 2007-01-23 07:57:41 +00:00
Nick Jenkins
61678d8a5d * Removing a handful of unused globals.
* $stack is not modified in Profiler::calltreeCount(), no need to pass-by-ref.
* Add FIXME marker to non-cross-platform line.
* A freshly created string does not need to be returned by reference. [Xml::namespaceSelector() and HTMLnamespaceselector() ].
2007-01-23 07:29:58 +00:00
Brion Vibber
50d9a5ec18 Further fixes to protection expiry:
* Use RFC 2822-style date/time format instead of localized formatting for
  the expiry time in the protection form; while ugly, it actually works;
  a localized time is usually lossy (changing the time on submit) and
  more significantly will fail for any UI language that's not english!
* Rearrange some of the form display logic to handle error conditions
  a little more gracefully; invalid expiry format caused the form to
  be displayed twice.
* Should be nicer on session token expiration as well, showing the
  form instead of just an exception message.
2007-01-22 20:59:00 +00:00
Andrew Garrett
957839573b * (bug 4133) Allow page protections to be made with an expiry date, in the same format as block expiry dates. Existing protections are assumed to be infinite, as are protections made with the new field left blank. 2007-01-22 08:26:41 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Antoine Musso
b144fcb85d Rename constructors to __constructor 2007-01-20 13:34:31 +00:00
Andrew Garrett
a355a684c1 Various, 2007-01-12 09:10:30 +00:00
Andrew Garrett
ff67bbdda8 Various tweaks for last commit, including a merge of the functions to determine if an image/page is cascade-protected; message changes, et cetera 2007-01-12 08:37:07 +00:00
Andrew Garrett
1d95a6efa9 Display MULTIPLE culprit pages for cascading protection in the messages. Also improve performance by separating boolean 'is this page affected by a cascading protection' from array 'who are the culprits for this cascading protection' -- both are cached in member variables of the Title object. 2007-01-12 07:31:34 +00:00
Andrew Garrett
283621653b UI stuff for the cascading protection feature - warnings for sysops editing cascading protected pages (including which page the protection has come from), more useful errors for users (including which page the protection has come from), and a note at the top of the protect page when trying to unprotect a page affected by cascading protection to the effect of 'you can't affect the cascading protection here'. 2007-01-12 04:43:33 +00:00
Andrew Garrett
19cca14f69 Restore backwards-compatibility for old types of restrictions; wipe page_restrictions column in update for page_restrictions and on updateRestrictions 2007-01-12 01:44:33 +00:00
Andrew Garrett
4e14efacc7 Fix a couple of mistyped variable names, mysql strict incompatibilities, make cascading protect checkbox disabled for users without protect permission. 2007-01-11 01:17:19 +00:00
Andrew Garrett
b6d674623e Fixes for a couple of embarrassing bugs I should have caught in testing. Brion and Tim save the day... 2007-01-11 00:31:04 +00:00
Andrew Garrett
b3a8d488a8 Merge from branches/werdna/restrictions-separation (forked at r18959): * Branch page_restrictions column out into its own table, also creating a 'cascading protection' feature, which automagically disallows edits to pages transcluded into a page protected with this new option. Various other code tidiness fixes and refactoring in the log messages of branches/werdna/restrictions-separation. REQUIRES DATABASE SCHEMA UPGRADE 2007-01-10 23:32:38 +00:00
Tim Starling
b1cd1b035c Fixed inefficient use of array_keys() introduced by Nick in r17880. If this is setting off alarms, then fix the alarms. 2006-11-25 17:11:58 +00:00
Nick Jenkins
14c53b728f Code housekeeping stuff (and barring any stuff-ups on my behalf, there should be no changes in behaviour whatsoever after this) -
* removing some unused global declarations.
* removing or commenting out or adding comments for unused local vars.
* Adding one or two local var declarations.
* Declaring $matches array passed to preg_match() / preg_match_all() as array() before using [not required, just have a slight preference for the explicitness].
* remove one or two pass-by-reference function declarations where the value is not modified.
* Adding some braces to if-else blocks.
* In Parser.php, stripstrate is now an object rather than an array as per r17820, so we no longer need ask for a reference to it (as in "$x =& $this->mStripState;"), and in fact it's probably just simpler to get rid of $x altogether.
* Moving some preg regexes from "" quoting to '' quoting to stop static analyzer whinging about bad escape sequences.

... up to "LinksUpdate.php" in the includes/ directory.
2006-11-23 08:25:56 +00:00
Brion Vibber
3af8ce82b9 * Added global $wgStyleVersion to centralize bumping CSS and JS file versions
for cache-friendly style and script updating
2006-10-13 21:48:19 +00:00
Tim Starling
3005679b0e * Removed lots of explicit require_once statements. The autoloader should theoretically be faster, because it always uses an absolute path, eliminating the need for a search, and it is never called unnecessarily. Absolute paths are also more robust in the face of odd configurations or usage patterns. Moved a few constants around to support this, they always have to be available before the method call.
* Deleted DatabaseMysql.php, no longer necessary, database classes are autoloaded. 
* Moved wfGetMimeMagic() to MimeMagic::singleton()
* Fixed a couple of __CLASS__.'::'.__FUNCTION__ things.
2006-10-03 13:00:52 +00:00
Niklas Laxström
3b454333ef * More escaping 2006-07-08 13:53:50 +00:00
Rotem Liss
7dd78c22e3 Reverting 15375 - causes JavaScript error. 2006-07-06 16:42:48 +00:00
Rotem Liss
a0a851d472 (bug 6571) Protect page: "Unlock move permissions" appears when "move" is not an option 2006-07-06 16:09:41 +00:00
Tim Starling
02547dac72 Removed most exit() calls from the MediaWiki core, by replacing them with either a throw or by classic error checking. OutputPage::fatalError() and similar functions are deprecated, use either OutputPage::showFatalError() to return control or throw new FatalError() to relinquish it. Backwards compatibility of all interfaces has been maintained, thus extensions should continue to work and can be ported at a later date. 2006-06-07 06:40:24 +00:00
Brion Vibber
f2c29baf9f Update the FSF's address in all these GPL stub headers 2006-04-05 07:43:17 +00:00
Niklas Laxström
85ca43d2ee * Restriction types now use restriction-* messages instead of ui messages
* Don't try to link to current page on protection tab
2006-02-18 15:07:02 +00:00
Ævar Arnfjörð Bjarmason
04eb005d4f * If you're using a global, remember the global thingy... 2006-01-10 16:19:32 +00:00
Ævar Arnfjörð Bjarmason
a26d5a49d7 * s~\t+$~~ 2006-01-07 13:31:29 +00:00
Ævar Arnfjörð Bjarmason
7bbe971aec * s~ +$~~ 2006-01-07 13:09:30 +00:00
Rob Church
868e8a971a Prevent blocked users from changing page protection levels 2006-01-06 23:25:26 +00:00
Brion Vibber
a35fcb0bed * (bug 1735) Revamped protection interface
* (bug 675) Add page protection level for unregistered/new accounts
* User::isNewbie now uses the registration date and $wgAutoconfirmAge
* Log views show message when no matches
2005-12-22 05:41:06 +00:00