mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
Fix: Added support for e-mail in user_id.
This commit is contained in:
parent
2cffc50145
commit
fe03c956d3
21
login.php
21
login.php
@ -28,7 +28,7 @@
|
||||
include('./header.inc.php');
|
||||
if(function_exists('CreateObject'))
|
||||
{
|
||||
$GLOBALS['phpgw']->session = CreateObject('phpgwapi.sessions');
|
||||
$GLOBALS['phpgw']->session = CreateObject('phpgwapi.sessions',array_keys($GLOBALS['phpgw_domain']));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -45,6 +45,7 @@
|
||||
$GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['login_template_set'];
|
||||
$tmpl = CreateObject('phpgwapi.Template', $GLOBALS['phpgw_info']['server']['template_dir']);
|
||||
|
||||
|
||||
// read the images from the login-template-set, not the (maybe not even set) users template-set
|
||||
$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = $GLOBALS['phpgw_info']['login_template_set'];
|
||||
|
||||
@ -203,7 +204,22 @@
|
||||
$login = $_POST['login'];
|
||||
}
|
||||
|
||||
if(strstr($login,'@') === False && isset($_POST['logindomain']))
|
||||
//conference - for strings like vinicius@thyamad.com@default , allows
|
||||
//that user have a login that is his e-mail. (viniciuscb)
|
||||
$login_parts = explode('@',$login);
|
||||
$got_login = false;
|
||||
if (count($login_parts) > 1)
|
||||
{
|
||||
//Last part of login string, when separated by @, is a domain name
|
||||
if (array_key_exists(array_pop($login_parts),$GLOBALS['phpgw_domain']))
|
||||
{
|
||||
$got_login = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$got_login)
|
||||
{
|
||||
if(isset($_POST['logindomain']))
|
||||
{
|
||||
$login .= '@' . $_POST['logindomain'];
|
||||
}
|
||||
@ -211,6 +227,7 @@
|
||||
{
|
||||
$login .= '@'.$GLOBALS['phpgw_info']['server']['default_domain'];
|
||||
}
|
||||
}
|
||||
$GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create($login,$passwd,$passwd_type,'u');
|
||||
|
||||
if(!isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid'])
|
||||
|
Loading…
Reference in New Issue
Block a user