Huji has uploaded a new change for review. https://gerrit.wikimedia.org/r/310558
Change subject: Dump page should work for non-encrypted elections too ...................................................................... Dump page should work for non-encrypted elections too Bug: T145648 Change-Id: I63501b80faf607b6d885300e88dacab093c466e4 --- M i18n/en.json M includes/entities/Election.php M includes/pages/DumpPage.php 3 files changed, 5 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll refs/changes/58/310558/1 diff --git a/i18n/en.json b/i18n/en.json index 680ea01..7eea65b 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -83,8 +83,7 @@ "securepoll-header-admin": "Admin", "securepoll-cookie-dup-list": "Cookie duplicate users", "securepoll-dump-title": "Dump: $1", - "securepoll-dump-no-crypt": "No encrypted election record is available for this election, because the election is not configured to use encryption.", - "securepoll-dump-not-finished": "Encrypted election records are only available after the finish date on $1 at $2", + "securepoll-dump-not-finished": "Election records are only available after the finish date on $1 at $2", "securepoll-dump-no-urandom": "Cannot open /dev/urandom. \nTo maintain voter privacy, encrypted election records are only publically available when they can be shuffled with a secure random number stream.", "securepoll-dump-private": "Sorry, viewing the encrypted record dump for this election is restricted to election administrators.", "securepoll-urandom-not-supported": "This server does not support cryptographic random number generation.\nTo maintain voter privacy, encrypted election records are only publically available when they can be shuffled with a secure random number stream.", diff --git a/includes/entities/Election.php b/includes/entities/Election.php index ff0ef1d..29148b7 100644 --- a/includes/entities/Election.php +++ b/includes/entities/Election.php @@ -360,10 +360,6 @@ * Call a callback function for each valid vote record, in random order. */ function dumpVotesToCallback( $callback ) { - if ( !$this->getCrypt() ) { - return Status::newFatal( 'securepoll-dump-no-crypt' ); - } - $random = $this->context->getRandom(); $status = $random->open(); if ( !$status->isOK() ) { diff --git a/includes/pages/DumpPage.php b/includes/pages/DumpPage.php index a0465de..71cb1ef 100644 --- a/includes/pages/DumpPage.php +++ b/includes/pages/DumpPage.php @@ -29,21 +29,16 @@ $out->setPageTitle( $this->msg( 'securepoll-dump-title', $this->election->getMessage( 'title' ) )->text() ); - if ( !$this->election->getCrypt() ) { - $out->addWikiMsg( 'securepoll-dump-no-crypt' ); + if ( !$this->election->isFinished() ) { + $out->addWikiMsg( 'securepoll-dump-not-finished', + $this->specialPage->getLanguage()->date( $this->election->getEndDate() ), + $this->specialPage->getLanguage()->time( $this->election->getEndDate() ) ); return; } $isAdmin = $this->election->isAdmin( $this->specialPage->getUser() ); if ( $this->election->getProperty( 'voter-privacy' ) && !$isAdmin ) { $out->addWikiMsg( 'securepoll-dump-private' ); - return; - } - - if ( !$this->election->isFinished() ) { - $out->addWikiMsg( 'securepoll-dump-not-finished', - $this->specialPage->getLanguage()->date( $this->election->getEndDate() ), - $this->specialPage->getLanguage()->time( $this->election->getEndDate() ) ); return; } -- To view, visit https://gerrit.wikimedia.org/r/310558 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63501b80faf607b6d885300e88dacab093c466e4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SecurePoll Gerrit-Branch: master Gerrit-Owner: Huji <huji.h...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits