Bug #17280
closedFrontend User / class_sv_auth.php
0%
Description
sorry, in advance for my broken english...*
we have some typo3 projekts...we athenticate against an openldap through eu_ldap....
everything works fine exept one thing...
every time a fe_user has not already been imported fromin ldap and the group this user belongs to, has not already been imported from ldap the fe_user can not log in...
although the fe_user is is correctly imported, the fe_usergroup is imported and even a fe_user session is created and everything seems to work fine the user can not log in.
the second login works...(cause now the group is already present...
this means the first fe_user of a fe_group which has not already been imported
can not log in...
if the fe_group is already present....nice, then everything works fine...
additionally php logs an error:
HP Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /typo3_src-4.1.1/t3lib/class.t3lib_db.php on line 796, referer...
mysql debug says:
caller:
t3lib_DB::exec_SELECTquery
Error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1) AND (lockToDomain='' OR lockToDomain IS NULL OR lockToDomain='www2.....' at line 4
lastBuildQuery:
SELECT uid,subgroup
FROM fe_groups
WHERE deleted=0 AND hidden=0 AND uid IN (,1) AND (lockToDomain='' OR lockToDomain IS NULL OR lockToDomain='www2.....')
( (,1) is a syntax error in sql....)
debug_backtrace:
require // ux_tslib_fe->determineid // ux_tslib_fe->fetch_the_id // ux_tslib_fe->initusergroups // tslib_feuserauth->fetchgroupdata // tx_sv_auth->getgroups // tx_sv_auth->getsubgroups // t3lib_db->exec_selectquery // t3lib_db->debug
i will try to fix this for our installed typo3 instances but it should be fixed globally....
this does only happen to frontend_users...
i tried the same scenario for be_users...
everything worked very nice....nothing went wrong...
thx in advance...
i wrote a thread related to this issue...
http://www.typo3.net/forum/list/list_post//61982/
this code produces the mysql query
on lines 190/191
[php]
if (!$this->authInfo['showHiddenRecords']) $hiddenP = 'AND hidden=0 ';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,subgroup', 'fe_groups', 'deleted=0 '.$hiddenP.' AND uid IN ('.$grList.')'.$lockToDomain_SQL);
[/php]
the list is being created in line 211
[php]
$theList = implode(',',t3lib_div::intExplode(',',$row['subgroup']));
[/php]
(issue imported from #M5568)
Files
Updated by Michael Kornowski over 17 years ago
we solved the problem by using a regular expression in the statement which produces an errorous sql in our special circumstances, but we will test it for a week if it works without sidekicks...
[PHP] preg_replace('/^,/','', $grList) ?>[/PHP]
this is the code together with the regex....
[PHP]
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,subgroup', 'fe_groups', 'deleted=0 '.$hiddenP.' AND uid IN ('.preg_replace('/^,/','', $grList).')'.$lockToDomain_SQL);?>
[/PHP]
it seems to work for the moment....
another possibility could be to do this in the code which defines $grList....
in class.t3lib_userauthgroup.php....
something like this pseudo....
[PHP]
$seek = ',';
$pos = strpos($grList, $seek);
if ($pos === 0){
$grList = substr($grList,1);
}
else
(...)
?>
[/PHP]
would be so nice if this could be fixed globally....
bye,
micha
Updated by Popy no-lastname-given over 17 years ago
The problem is : a connected user belongs to group -2 ! Also the problem is not here
Updated by Christian Kuhn over 15 years ago
Resolved, no change required:
Following the (german) thread in http://www.typo3.net/forum/list/list_post//61982/ this issue turned out to be a bug in ext:eu_ldap that is very likely to be fixed meanwhile.
The error was a invalid "IN (,1)" in a sql where-clause.
I was unable to find a svn or something of this extension to follow code changes, but a quick look into eu_ldap/mod1/class.tx_euldap_div.php told me that any comma in front of the list is deleted.
Please reopen this issue if this problem still exists and can be nailed down to a core problem.