Merge pull request #1357 from owncloud/alternative-loging-master

add support for apps to register alternative login methods
This commit is contained in:
Thomas Müller 2013-02-06 06:49:58 -08:00
commit efdaea4557
4 changed files with 30 additions and 1 deletions

View File

@ -211,6 +211,10 @@ fieldset.warning {
}
fieldset.warning legend { color:#b94a48 !important; }
/* Alternative Logins */
#alternative-logins legend { margin-bottom:10px; }
#alternative-logins li { height:40px; display:inline-block; white-space:nowrap; }
/* NAVIGATION ------------------------------------------------------------- */
#navigation {

View File

@ -43,5 +43,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 id="alternative-logins">
<fieldset>
<legend><?php echo $l->t('Alternative Logins') ?></legend>
<ul>
<? foreach($_['alt_login'] as $login): ?>
<li><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
@ -568,6 +569,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

@ -300,6 +300,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);
}