mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Replace "insert rap about tokens here" with a rap about tokens
Test Plan: Made getTokenStatus() return the four legal values and an illegal one, looked at the linked account page and confirmed that the rap rendered and had correct meter Reviewers: epriestley Reviewed By: epriestley CC: miorel, aran, Korvin Differential Revision: https://secure.phabricator.com/D4433
This commit is contained in:
parent
e2e890672a
commit
e2f37b059b
2 changed files with 22 additions and 3 deletions
|
@ -41,4 +41,14 @@ final class PhabricatorUserOAuthInfo extends PhabricatorUserDAO {
|
||||||
return idx($map, $status, 'Unknown');
|
return idx($map, $status, 'Unknown');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getRappableTokenStatus($status) {
|
||||||
|
static $map = array(
|
||||||
|
self::TOKEN_STATUS_NONE => 'There is no token',
|
||||||
|
self::TOKEN_STATUS_GOOD => 'Your token\'s good',
|
||||||
|
self::TOKEN_STATUS_FAIL => 'Your token failed',
|
||||||
|
self::TOKEN_STATUS_EXPIRED => 'Your token\'s old',
|
||||||
|
);
|
||||||
|
return idx($map, $status, 'This code\'s got bugs');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,17 +160,26 @@ final class PhabricatorSettingsPanelOAuth
|
||||||
}
|
}
|
||||||
|
|
||||||
$status = $oauth_info->getTokenStatus();
|
$status = $oauth_info->getTokenStatus();
|
||||||
$status = PhabricatorUserOAuthInfo::getReadableTokenStatus($status);
|
$readable_status = PhabricatorUserOAuthInfo::getReadableTokenStatus(
|
||||||
|
$status);
|
||||||
|
$rappable_status = PhabricatorUserOAuthInfo::getRappableTokenStatus(
|
||||||
|
$status);
|
||||||
|
$rap = 'Yo yo yo<br />'.
|
||||||
|
'My name\'s DJ Token and I\'m here to say<br />'.
|
||||||
|
// pronounce as "dollar rappable status" for meter to work
|
||||||
|
"$rappable_status, hey hey hey hey<br />".
|
||||||
|
'I rap \'bout tokens, that might be why<br />'.
|
||||||
|
'I\'m such a cool and popular guy';
|
||||||
|
|
||||||
$token_form = new AphrontFormView();
|
$token_form = new AphrontFormView();
|
||||||
$token_form
|
$token_form
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->appendChild(
|
->appendChild(
|
||||||
'<p class="aphront-from-instructions">insert rap about tokens</p>')
|
'<p class="aphront-from-instructions">'.$rap.'</p>')
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormStaticControl())
|
id(new AphrontFormStaticControl())
|
||||||
->setLabel('Token Status')
|
->setLabel('Token Status')
|
||||||
->setValue($status))
|
->setValue($readable_status))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormStaticControl())
|
id(new AphrontFormStaticControl())
|
||||||
->setLabel('Expires')
|
->setLabel('Expires')
|
||||||
|
|
Loading…
Reference in a new issue