* @link http://status.net/
* @link http://openid.net/
*/
-
class OpenIDPlugin extends Plugin
{
// Plugin parameter: set true to disallow non-OpenID logins
global $config;
$config['site']['openidonly'] = (bool)$this->openidOnly;
}
-
}
/**
*
* @return boolean hook return
*/
-
function onStartInitializeRouter($m)
{
$m->connect('main/openid', array('action' => 'openidlogin'));
*
* @return boolean hook return
*/
-
function onStartConnectPath(&$path, &$defaults, &$rules, &$result)
{
if (common_config('site', 'openidonly')) {
*
* @return boolean hook return
*/
-
function onArgsInitialize($args)
{
if (common_config('site', 'openidonly')) {
*
* @return boolean hook return
*/
-
function onEndPublicXRDS($action, &$xrdsOutputter)
{
$xrdsOutputter->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)',
*
* @return boolean hook return
*/
-
function onEndUserXRDS($action, &$xrdsOutputter)
{
$xrdsOutputter->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)',
*
* @return boolean hook return
*/
-
function onStartPrimaryNav($action)
{
if (common_config('site', 'openidonly') && !common_logged_in()) {
*
* @return boolean hook return
*/
-
function onStartLoginGroupNav(&$action)
{
if (common_config('site', 'openidonly')) {
*
* @return boolean hook return
*/
-
function onEndLoginGroupNav(&$action)
{
$this->showOpenIDLoginTab($action);
*
* @return void
*/
-
function showOpenIDLoginTab($action)
{
$action_name = $action->trimmed('action');
*
* @return void
*/
-
function onStartAccountSettingsPasswordMenuItem($menu, &$unused) {
if (common_config('site', 'openidonly')) {
return false;
*
* @return boolean hook return
*/
-
function onEndAccountSettingsNav(&$action)
{
$action_name = $action->trimmed('action');
*
* @return boolean hook return
*/
-
function onAutoload($cls)
{
switch ($cls)
*
* @return boolean hook return
*/
-
function onSensitiveAction($action, &$ssl)
{
switch ($action)
*
* @return boolean hook return
*/
-
function onLoginAction($action, &$login)
{
switch ($action)
*
* @return void
*/
-
function onEndShowHeadElements($action)
{
if ($action instanceof ShowstreamAction) {
*
* @return boolean whether to continue
*/
-
function onRedirectToLogin($action, $user)
{
if (common_config('site', 'openid_only') || (!empty($user) && User_openid::hasOpenID($user->id))) {
*
* @return boolean hook value
*/
-
function onEndShowPageNotice($action)
{
$name = $action->trimmed('action');
*
* @return boolean hook value
*/
-
function onStartLoadDoc(&$title, &$output)
{
if ($title == 'openid') {
*
* @return boolean hook value
*/
-
function onEndLoadDoc($title, &$output)
{
if ($title == 'help') {
*
* @return boolean hook value
*/
-
function onCheckSchema()
{
$schema = Schema::get();
*
* @return boolean hook value
*/
-
function onUserDeleteRelated($user, &$tables)
{
$tables[] = 'User_openid';
*
* @return boolean hook value
*/
-
function onEndAdminPanelNav($nav)
{
if (AdminPanelAction::canAdmin('openid')) {
$nav->out->menuItem(
common_local_url('openidadminpanel'),
- _m('OpenID'),
+ // TRANS: OpenID configuration menu item.
+ _m('MENU','OpenID'),
+ // TRANS: Tooltip for OpenID configuration menu item.
_m('OpenID configuration'),
$action_name == 'openidadminpanel',
'nav_openid_admin_panel'
*
* @return boolean hook value
*/
-
function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'OpenID',
$provider = common_config('openid', 'trusted_provider');
$appendUsername = common_config('openid', 'append_username');
if ($provider) {
+ // TRANS: Field label.
$action->element('label', array(), _m('OpenID provider'));
$action->element('span', array(), $provider);
if ($appendUsername) {
'style' => 'float: none'));
}
$action->element('p', 'form_guide',
+ // TRANS: Form guide.
($appendUsername ? _m('Enter your username.') . ' ' : '') .
+ // TRANS: Form guide.
_m('You will be sent to the provider\'s site for authentication.'));
$action->hidden('openid_url', $provider);
} else {