if ($cur->id != $this->owner->id) {
$this->clientError(_('You are not the owner of this application.'), 401);
+ return false;
}
return true;
$defaultAccess = ($this->application->access_type & Oauth_application::$writeAccess)
? 'read-write' : 'read-only';
$profile = Profile::staticGet($this->application->owner);
- $userCnt = 0; // XXX: count how many users use the app
+
+ $appUsers = new Oauth_application_user();
+ $appUsers->application_id = $this->application->id;
+ $userCnt = $appUsers->count();
$this->raw(sprintf(
- _('Created by %1$s - %2$s access by default - %3$d users.'),
+ _('created by %1$s - %2$s access by default - %3$d users'),
$profile->getBestName(),
$defaultAccess,
$userCnt
$this->elementStart('ul');
$this->elementStart('li', 'entity_edit');
$this->element('a',
- array('href' =>
- common_local_url(
- 'editapplication',
- array(
- 'nickname' => $this->owner->nickname,
- 'id' => $this->application->id
- )
- )
- ), 'Edit');
+ array('href' => common_local_url('editapplication',
+ array('id' => $this->application->id))),
+ 'Edit');
$this->elementEnd('li');
$this->elementStart('li', 'entity_reset_keysecret');
'class' => 'form_reset_key',
'method' => 'POST',
'action' => common_local_url('showapplication',
- array('nickname' => $cur->nickname,
- 'id' => $this->application->id))));
+ array('id' => $this->application->id))));
$this->elementStart('fieldset');
$this->hidden('token', common_session_token());
$this->elementEnd('dl');
$this->element('p', 'note',
- _('Note: We support hmac-sha1 signatures. We do not support the plaintext signature method.'));
+ _('Note: We support HMAC-SHA1 signatures. We do not support the plaintext signature method.'));
$this->elementEnd('div');
$this->elementStart('p', array('id' => 'application_action'));
$this->element('a',
- array(
- 'href' => common_local_url(
- 'apps',
- array('nickname' => $this->owner->nickname)),
- 'class' => 'more'
- ),
- 'View your applications');
+ array('href' => common_local_url('oauthappssettings'),
+ 'class' => 'more'),
+ 'View your applications');
$this->elementEnd('p');
}
}
}
-