Re: svn: /web/php-wiki/trunk/ dokuwiki/lib/plugins/doodle/syntax.php systems/doodle-voting.diff
| From: | Paul Dragoonis | Date: | Mon, 11 Jul 2011 16:34:38 +0000 |
| Subject: | Re: svn: /web/php-wiki/trunk/ dokuwiki/lib/plugins/doodle/syntax.php systems/doodle-voting.diff | ||
| References: | 1 | Groups: | php.webmaster |
| Request: | Send a blank email to php-webmaster+get-11570@lists.php.net to get a copy of this message | ||
On Mon, Jul 11, 2011 at 5:11 PM, Philip Olson <philip@php.net> wrote:
> philip Mon, 11 Jul 2011 16:11:49 +0000
>
> Revision:
> http://svn.php.net/viewvc?view=revision&revision=313140
>
> Log:
> Added voting restriction to 'PHP SVN users' and 'voting' groups. Almost
> implements rfc/voting. Patch by Ferenc Kovács (untested)
>
> Changed paths:
> U web/php-wiki/trunk/dokuwiki/lib/plugins/doodle/syntax.php
> A web/php-wiki/trunk/systems/doodle-voting.diff
>
> Modified: web/php-wiki/trunk/dokuwiki/lib/plugins/doodle/syntax.php
> ===================================================================
> --- web/php-wiki/trunk/dokuwiki/lib/plugins/doodle/syntax.php 2011-07-11 16:00:02 UTC (rev
> 313139)
> +++ web/php-wiki/trunk/dokuwiki/lib/plugins/doodle/syntax.php 2011-07-11 16:11:49 UTC (rev
> 313140)
> @@ -199,9 +199,14 @@
> }
> //FIXME: count($choices) may be different from number of choices in $doodle data!
>
> + $can_vote = false;
> + if (count(array_intersect(array('admin', 'phpcvs',
> 'voting'), $INFO['userinfo']['grps'])) > 0) {
> + $can_vote = true;
> + }
> +
> // ----- FORM ACTIONS (only allowed when showing the page, not when editing) -----
> $formId =
> 'doodle__form__'.cleanID($this->params['title']);
> - if ($ACT == 'show' && $_REQUEST['formId'] == $formId )
> {
> + if ($ACT == 'show' && $_REQUEST['formId'] == $formId
> && $can_vote) {
> // ---- cast new vote
> if (!empty($_REQUEST['cast__vote'])) {
> $this->castVote();
> @@ -291,7 +296,7 @@
> }
>
> // ---- calculates if user is allowed to vote
> - $this->template['inputTR'] = $this->getInputTR();
> + $this->template['inputTR'] =
> ($can_vote?$this->getInputTR():'');
>
> // ----- I am using PHP as a templating enginge here.
> //debout("Template", $this->template);
>
> Added: web/php-wiki/trunk/systems/doodle-voting.diff
> ===================================================================
> --- web/php-wiki/trunk/systems/doodle-voting.diff
> (rev 0)
> +++ web/php-wiki/trunk/systems/doodle-voting.diff 2011-07-11 16:11:49 UTC (rev 313140)
> @@ -0,0 +1,29 @@
> +Index: dokuwiki/lib/plugins/doodle/syntax.php
> +===================================================================
> +--- dokuwiki/lib/plugins/doodle/syntax.php (revision 313139)
> ++++ dokuwiki/lib/plugins/doodle/syntax.php (working copy)
> +@@ -199,9 +199,14 @@
> + }
> + //FIXME: count($choices) may be different from number of choices in $doodle data!
> +
> ++ $can_vote = false;
> ++ if (count(array_intersect(array('admin', 'phpcvs',
> 'voting'), $INFO['userinfo']['grps'])) > 0) {
> ++ $can_vote = true;
> ++ }
> ++
> + // ----- FORM ACTIONS (only allowed when showing the page, not when editing)
> -----
> + $formId =
> 'doodle__form__'.cleanID($this->params['title']);
> +- if ($ACT == 'show' && $_REQUEST['formId'] == $formId
> ) {
> ++ if ($ACT == 'show' && $_REQUEST['formId'] == $formId
> && $can_vote) {
> + // ---- cast new vote
> + if (!empty($_REQUEST['cast__vote'])) {
> + $this->castVote();
> +@@ -291,7 +296,7 @@
> + }
> +
> + // ---- calculates if user is allowed to vote
> +- $this->template['inputTR'] = $this->getInputTR();
> ++ $this->template['inputTR'] =
> ($can_vote?$this->getInputTR():'');
> +
> + // ----- I am using PHP as a templating enginge here.
> + //debout("Template", $this->template);
>
Am I correct in assuming that a vote will be closed to only people
part of svn, or with a @php.net account? Is there a difference ? I
would +1 this idea so that we will achieve quality over quantity.
Cheers,
Paul.
>
> --
> PHP Webmaster List Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>