mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-03 11:59:16 +01:00
fix to allow @ in usernames if no (only one) eGW-domain is used
This commit is contained in:
parent
392703e0e1
commit
0d250b0c82
@ -160,6 +160,10 @@
|
|||||||
{
|
{
|
||||||
$login .= '@' . $_POST['logindomain'];
|
$login .= '@' . $_POST['logindomain'];
|
||||||
}
|
}
|
||||||
|
elseif(count($GLOBALS['phpgw_domain']) == 1)
|
||||||
|
{
|
||||||
|
$login .= '@'.$GLOBALS['phpgw_info']['server']['default_domain'];
|
||||||
|
}
|
||||||
$GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create($login,$_POST['passwd'],$_POST['passwd_type']);
|
$GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create($login,$_POST['passwd'],$_POST['passwd_type']);
|
||||||
|
|
||||||
if (! isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid'])
|
if (! isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid'])
|
||||||
|
@ -244,6 +244,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function split_login_domain($both,&$login,&$domain)
|
||||||
|
{
|
||||||
|
$parts = explode('@',$both);
|
||||||
|
$domain = array_pop($parts);
|
||||||
|
$login = implode('@',$parts);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check to see if a session is still current and valid
|
* Check to see if a session is still current and valid
|
||||||
*
|
*
|
||||||
@ -277,7 +284,7 @@
|
|||||||
|
|
||||||
$this->session_flags = $session['session_flags'];
|
$this->session_flags = $session['session_flags'];
|
||||||
|
|
||||||
list($this->account_lid,$this->account_domain) = explode('@', $session['session_lid']);
|
$this->split_login_domain($session['session_lid'],$this->account_lid,$this->account_domain);
|
||||||
|
|
||||||
if ($this->account_domain == '')
|
if ($this->account_domain == '')
|
||||||
{
|
{
|
||||||
@ -496,7 +503,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->clean_sessions();
|
$this->clean_sessions();
|
||||||
list($this->account_lid,$this->account_domain) = explode('@', $login);
|
$this->split_login_domain($login,$this->account_lid,$this->account_domain);
|
||||||
|
|
||||||
$now = time();
|
$now = time();
|
||||||
|
|
||||||
if (strstr($login,'@') === False)
|
if (strstr($login,'@') === False)
|
||||||
|
@ -91,11 +91,12 @@
|
|||||||
if (isset($_POST['login'])) // on login
|
if (isset($_POST['login'])) // on login
|
||||||
{
|
{
|
||||||
$GLOBALS['login'] = $_POST['login'];
|
$GLOBALS['login'] = $_POST['login'];
|
||||||
if (strstr($GLOBALS['login'],'@') === False)
|
if (strstr($GLOBALS['login'],'@') === False || count($GLOBALS['phpgw_domain']) == 1)
|
||||||
{
|
{
|
||||||
$GLOBALS['login'] .= '@' . get_var('logindomain',array('POST'),$GLOBALS['phpgw_info']['server']['default_domain']);
|
$GLOBALS['login'] .= '@' . get_var('logindomain',array('POST'),$GLOBALS['phpgw_info']['server']['default_domain']);
|
||||||
}
|
}
|
||||||
list(,$GLOBALS['phpgw_info']['user']['domain']) = explode('@',$GLOBALS['login']);
|
$parts = explode('@',$GLOBALS['login']);
|
||||||
|
$GLOBALS['phpgw_info']['user']['domain'] = array_pop($parts);
|
||||||
}
|
}
|
||||||
else // on "normal" pageview
|
else // on "normal" pageview
|
||||||
{
|
{
|
||||||
@ -258,7 +259,14 @@
|
|||||||
{
|
{
|
||||||
if (@$_POST['login'] != '')
|
if (@$_POST['login'] != '')
|
||||||
{
|
{
|
||||||
list($login) = explode("@",$_POST['login']);
|
if (count($GLOBALS['phpgw_domain']) > 1)
|
||||||
|
{
|
||||||
|
list($login) = explode('@',$_POST['login']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$login = $_POST['login'];
|
||||||
|
}
|
||||||
print_debug('LID',$login,'app');
|
print_debug('LID',$login,'app');
|
||||||
$login_id = $GLOBALS['phpgw']->accounts->name2id($login);
|
$login_id = $GLOBALS['phpgw']->accounts->name2id($login);
|
||||||
print_debug('User ID',$login_id,'app');
|
print_debug('User ID',$login_id,'app');
|
||||||
|
Loading…
Reference in New Issue
Block a user