http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99648
Revision: 99648
Author: jeroendedauw
Date: 2011-10-12 19:58:39 +0000 (Wed, 12 Oct 2011)
Log Message:
-----------
correct handling of session fails on special:mycontests
Modified Paths:
--------------
trunk/extensions/Contest/Contest.i18n.php
trunk/extensions/Contest/specials/SpecialMyContests.php
Modified: trunk/extensions/Contest/Contest.i18n.php
===================================================================
--- trunk/extensions/Contest/Contest.i18n.php 2011-10-12 19:28:56 UTC (rev
99647)
+++ trunk/extensions/Contest/Contest.i18n.php 2011-10-12 19:58:39 UTC (rev
99648)
@@ -195,6 +195,7 @@
'contest-mycontests-header-contest' => 'Contest',
'contest-mycontests-header-challenge' => 'Challenge',
'contest-mycontests-signup-success' => 'You have successfully signed up
for this contest.',
+ 'contest-mycontests-sessionfail' => 'Your submission could not be saved
due to loss of session data. Please try again.',
'contest-submission-submit' => 'Submit',
'contest-submission-unknown' => 'There is no contest with the provided
name.',
Modified: trunk/extensions/Contest/specials/SpecialMyContests.php
===================================================================
--- trunk/extensions/Contest/specials/SpecialMyContests.php 2011-10-12
19:28:56 UTC (rev 99647)
+++ trunk/extensions/Contest/specials/SpecialMyContests.php 2011-10-12
19:58:39 UTC (rev 99648)
@@ -36,8 +36,7 @@
return;
}
- if ( $this->getRequest()->wasPosted()
- && $this->getUser()->matchEditToken(
$this->getRequest()->getVal( 'wpEditToken' ) ) ) {
+ if ( $this->getRequest()->wasPosted() ) {
$contestant = ContestContestant::s()->selectRow( null,
array( 'id' => $this->getRequest()->getInt( 'wpcontestant-id' ) ) );
$this->showSubmissionPage( $contestant );
}
@@ -239,6 +238,10 @@
if ( $this->getRequest()->getCheck( 'new' ) ) {
$this->showSuccess( 'contest-mycontests-signup-success'
);
}
+ else if ( $this->getRequest()->wasPosted()
+ && !$this->getUser()->matchEditToken(
$this->getRequest()->getVal( 'wpEditToken' ) ) ) {
+ $this->showError( 'contest-mycontests-sessionfail' );
+ }
$this->getOutput()->setPageTitle(
$contestant->getContest()->getField( 'name' ) );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs