mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-07 23:31:58 +01:00
sso fixes
This commit is contained in:
parent
40a04bc143
commit
3ef900b68f
@ -12,6 +12,7 @@ class ControllerLoginSSO extends Controller {
|
||||
|
||||
|
||||
$request = Registry::get('request');
|
||||
$session = Registry::get('session');
|
||||
|
||||
$db = Registry::get('db');
|
||||
|
||||
|
@ -329,6 +329,11 @@ class ModelUserAuth extends Model {
|
||||
if(isset($a['mail']['count'])) { $username = $a['mail'][0]; } else { $username = $a['mail']; }
|
||||
$username = strtolower(preg_replace("/^smtp\:/i", "", $username));
|
||||
|
||||
if($username == '') {
|
||||
syslog(LOG_INFO, "no email address found for " . $a['dn']);
|
||||
return 0;
|
||||
}
|
||||
|
||||
$query = $ldap->query(LDAP_BASE_DN, "(|(&(objectClass=$ldap_account_objectclass)($ldap_mail_attr=$username))(&(objectClass=$ldap_distributionlist_objectclass)($ldap_distributionlist_attr=$username)" . ")(&(objectClass=$ldap_distributionlist_objectclass)($ldap_distributionlist_attr=" . $a['dn'] . ")))", array());
|
||||
|
||||
$emails = $this->get_email_array_from_ldap_attr($query->rows);
|
||||
|
@ -1,25 +1,19 @@
|
||||
<?php
|
||||
|
||||
function go_to_setup() {
|
||||
Header("Location: setup/setup.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$stat = stat("config.php") or go_to_setup();
|
||||
if($stat[7] < 15){ go_to_setup(); }
|
||||
session_start();
|
||||
|
||||
|
||||
require_once("config.php");
|
||||
|
||||
require(DIR_SYSTEM . "/startup.php");
|
||||
|
||||
$session = new Session();
|
||||
Registry::set("session", $session);
|
||||
|
||||
$request = new Request();
|
||||
Registry::set("request", $request);
|
||||
|
||||
|
||||
session_start();
|
||||
|
||||
Registry::set('document', new Document());
|
||||
|
||||
|
||||
@ -30,6 +24,8 @@ Registry::set('load', $loader);
|
||||
$language = new Language();
|
||||
Registry::set('language', $language);
|
||||
|
||||
if(ENABLE_SYSLOG == 1) { openlog("piler-webui", LOG_PID, LOG_MAIL); }
|
||||
|
||||
|
||||
$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PREFIX);
|
||||
Registry::set('DB_DATABASE', DB_DATABASE);
|
||||
|
Loading…
Reference in New Issue
Block a user