Page MenuHomePhabricator

Vote buttons for not-yet-logged in user.
Closed, ResolvedPublic

Description

Author: van.de.bugger

Description:
Proposed patch.

Vote buttons send not-yet-logged-in user to login page, but after login user is not redirected back to original page.

Proposed patch fixes the problem: after logging in user is redirected back to original page.


Version: unspecified
Severity: normal

Attached:

Details

Reference
bz34284

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:16 AM
bzimport set Reference to bz34284.

Using $wgOut there feels a tad bit icky, but then again, I don't have a better alternative...

  • $login = SpecialPage::getTitleFor( 'Userlogin' );
  • $voteLink .= "<a href=\"{$login->escapeFullURL()}\" rel=\"nofollow\">";

+ $login = SpecialPage::getTitleFor( 'UserLogin' );
One small nitpick: SpecialPage::getTitleFor() expects the *canonical* special page name (which is usually /not/ CamelCase), so that it'll return the correct output even for non-English languages.

In any case, thanks for the patch once again! I've applied it in r111040.

van.de.bugger wrote:

Using $wgOut there feels a tad bit icky...

Let us consider another variant: Removing voting buttons if user is not logged in.

It is not so bad, because voting buttons may be misleading. For example: user is not logged in, s/he see voting buttons, click one, logging in, getting back... and do not have voting buttons at all, because s/he does not have "comment" right. (Oops, it is a subject of my next report.)

What do you think?