add support for apps to register alternative login methods

below the standard login a list of icons/button will be displayed
This commit is contained in:
Thomas Mueller 2013-01-29 17:28:08 +01:00
parent 5143660cd3
commit 825cdf8560
3 changed files with 26 additions and 1 deletions

View File

@ -41,5 +41,19 @@
<input type="submit" id="submit" class="login primary" value="<?php echo $l->t('Log in'); ?>"/>
</fieldset>
</form>
<?php OCP\Util::addscript('core', 'visitortimezone'); ?>
<?php if (!empty($_['alt_login'])) { ?>
<form>
<fieldset>
<legend style="margin-bottom: 20px;"><?php echo $l->t('Alternative Logins:') ?></legend>
<ul>
<? foreach($_['alt_login'] as $login): ?>
<li style="height: 40px;"><a class="button" href="<?php echo $login['href']; ?>" ><?php echo $login['name']; ?></a></li>
<?php endforeach; ?>
</ul>
</fieldset>
</form>
<?php } ?>
<?php
OCP\Util::addscript('core', 'visitortimezone');

View File

@ -36,6 +36,7 @@ class OC_App{
static private $appTypes = array();
static private $loadedApps = array();
static private $checkedApps = array();
static private $altLogin = array();
/**
* @brief loads all apps
@ -557,6 +558,14 @@ class OC_App{
self::$personalForms[]= $app.'/'.$page.'.php';
}
public static function registerLogIn($entry) {
self::$altLogin[] = $entry;
}
public static function getAlternativeLogIns() {
return self::$altLogin;
}
/**
* @brief: get a list of all apps in the apps folder
* @return array or app names (string IDs)

View File

@ -312,6 +312,8 @@ class OC_Util {
$redirect_url = OC_Util::sanitizeHTML($_REQUEST['redirect_url']);
$parameters['redirect_url'] = urlencode($redirect_url);
}
$parameters['alt_login'] = OC_App::getAlternativeLogIns();
OC_Template::printGuestPage("", "login", $parameters);
}