We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 8ef2abf3 authored by mattl's avatar mattl

Render RegiserThrottle extra profile data properly

parent 799c2e47
......@@ -160,7 +160,7 @@ class RegisterThrottlePlugin extends Plugin
return true;
}
$ri = Registration_ip::getKV('user_id', $profile->id);
$ri = Registration_ip::getKV('user_id', $target->getID());
$ipaddress = null;
if ($ri instanceof Registration_ip) {
$ipaddress = $ri->ipaddress;
......@@ -172,12 +172,17 @@ class RegisterThrottlePlugin extends Plugin
$action->element('h2', null, _('Registration IP'));
// TRANS: Label for the information about which IP a users registered from.
$action->element('strong', null, _('Registered from:'));
$action->element('a',
[ 'class'=>'ipaddress',
'href'=>common_local_url('ipregistrations', array('ipaddress'=>$ipaddress)),
],
$ipaddress ?: 'unknown');
$el = 'span';
$attrs = ['class'=>'ipaddress'];
if (!is_null($ipaddress)) {
$el = 'a';
$attrs['href'] = common_local_url('ipregistrations', array('ipaddress'=>$ipaddress));
}
$action->element($el, $attrs,
// TRANS: Unknown IP address.
$ipaddress ?: _('unknown'));
$action->elementEnd('div');
}
......
......@@ -15,7 +15,7 @@ class IpregistrationsAction extends ManagedAction
protected function doPreparation()
{
if (!$scoped->hasRight(Right::SILENCEUSER) && !$scoped->hasRole(Profile_role::ADMINISTRATOR)) {
if (!$this->scoped->hasRight(Right::SILENCEUSER) && !$this->scoped->hasRole(Profile_role::ADMINISTRATOR)) {
throw new AuthorizationException(_('You are not authorized to view this page.'));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment