forked from GNUsocial/gnu-social
Less scary OAuth authorization messages when using anonymous consumer
This commit is contained in:
parent
aef88c7cee
commit
479096c8d7
@ -386,7 +386,7 @@ class ApiOauthAuthorizeAction extends Action
|
|||||||
$this->elementStart('ul', 'form_data');
|
$this->elementStart('ul', 'form_data');
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
$this->elementStart('p');
|
$this->elementStart('p');
|
||||||
if (!empty($this->app->icon)) {
|
if (!empty($this->app->icon) && $this->app->name != 'anonymous') {
|
||||||
$this->element('img', array('src' => $this->app->icon));
|
$this->element('img', array('src' => $this->app->icon));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,11 +396,19 @@ class ApiOauthAuthorizeAction extends Action
|
|||||||
// TRANS: User notification of external application requesting account access.
|
// TRANS: User notification of external application requesting account access.
|
||||||
// TRANS: %1$s is the application name requesting access, %2$s is the organisation behind the application,
|
// TRANS: %1$s is the application name requesting access, %2$s is the organisation behind the application,
|
||||||
// TRANS: %3$s is the access type requested, %4$s is the StatusNet sitename.
|
// TRANS: %3$s is the access type requested, %4$s is the StatusNet sitename.
|
||||||
$msg = _('The application <strong>%1$s</strong> by ' .
|
if ($this->app->name == 'anonymous') {
|
||||||
'<strong>%2$s</strong> would like the ability ' .
|
// Special message for the anonymous app and consumer
|
||||||
|
$msg = _('An application would like the ability ' .
|
||||||
'to <strong>%3$s</strong> your %4$s account data. ' .
|
'to <strong>%3$s</strong> your %4$s account data. ' .
|
||||||
'You should only give access to your %4$s account ' .
|
'You should only give access to your %4$s account ' .
|
||||||
'to third parties you trust.');
|
'to third parties you trust.');
|
||||||
|
} else {
|
||||||
|
$msg = _('The application <strong>%1$s</strong> by ' .
|
||||||
|
'<strong>%2$s</strong> would like the ability ' .
|
||||||
|
'to <strong>%3$s</strong> your %4$s account data. ' .
|
||||||
|
'You should only give access to your %4$s account ' .
|
||||||
|
'to third parties you trust.');
|
||||||
|
}
|
||||||
|
|
||||||
$this->raw(sprintf($msg,
|
$this->raw(sprintf($msg,
|
||||||
$this->app->name,
|
$this->app->name,
|
||||||
@ -580,14 +588,14 @@ class ApiOauthAuthorizeAction extends Action
|
|||||||
// TRANS: Header of user notification after authorising an application access to a profile.
|
// TRANS: Header of user notification after authorising an application access to a profile.
|
||||||
// TRANS: %s is the authorised application name.
|
// TRANS: %s is the authorised application name.
|
||||||
_('You have successfully authorized %s.'),
|
_('You have successfully authorized %s.'),
|
||||||
$this->app->name
|
($this->app->name == 'anonymous') ? 'the application' : $this->app->name
|
||||||
);
|
);
|
||||||
|
|
||||||
$msg = sprintf(
|
$msg = sprintf(
|
||||||
// TRANS: Uer notification after authorising an application access to a profile.
|
// TRANS: Uer notification after authorising an application access to a profile.
|
||||||
// TRANS: %s is the authorised application name.
|
// TRANS: %s is the authorised application name.
|
||||||
_('Please return to %s and enter the following security code to complete the process.'),
|
_('Please return to %s and enter the following security code to complete the process.'),
|
||||||
$this->app->name
|
($this->app->name == 'anonymous') ? 'the application' : $this->app->name
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($this->reqToken->verified_callback == 'oob') {
|
if ($this->reqToken->verified_callback == 'oob') {
|
||||||
|
@ -31,8 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once INSTALLDIR . '/lib/info.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for displaying an OAuth verifier pin
|
* Class for displaying an OAuth verifier pin
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user