Browse Source

add support for apps to register alternative login methods

below the standard login a list of icons/button will be displayed
remotes/origin/stable5
Thomas Mueller 14 years ago
parent
commit
825cdf8560
  1. 16
      core/templates/login.php
  2. 9
      lib/app.php
  3. 2
      lib/util.php

16
core/templates/login.php

@ -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');

9
lib/app.php

@ -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)

2
lib/util.php

@ -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);
}

Loading…
Cancel
Save