Closed hellweiss closed 11 years ago
@blizzz maybe the error is in user_ldap/lib/helper.php
@hellweiss could you change line 57 in apps/user_ldap/lib/helper.php to
$query .= ' AND
configvalue= "1"';
(adding " around 1)? Does it help?
sorry, now i got this. I'm not a developer, but shouldn't the configvalue be "yes" because the value is stored yes in the database ?
{"app":"PHP","message":"SQLSTATE[42703]: Undefined column: 7 FEHLER: Spalte \u00bb1\u00ab existiert nicht\nLINE 5: AND \"configvalue\" = \"1\"\n ^ at \/var\/www\/owncloud\/lib\/db.php#855","level":4,"time":1362045947} {"app":"PHP","message":"SQLSTATE[42703]: Undefined column: 7 FEHLER: Spalte \u00bb1\u00ab existiert nicht\nLINE 5: AND \"configvalue\" = \"1\"\n ^ at \/var\/www\/owncloud\/lib\/db.php#855","level":4,"time":1362045952}
does not work with yes either
No, it needs to be 1. It is about the configvalue for configkey ending with ldap_configuration_active..
There is something wrong with the query now, because it is looking for column named 1 which is not there of course. Lines 48 to 58 should look like this, is it the case?
static public function getServerConfigurationPrefixes($activeConfigurations = false) {
$referenceConfigkey = 'ldap_configuration_active';
$query = '
SELECT DISTINCT `configkey`
FROM `*PREFIX*appconfig`
WHERE `configkey` LIKE ?
';
if($activeConfigurations) {
$query .= ' AND `configvalue` = "1"';
}
$query = \OCP\DB::prepare($query);
![Uploading oc_pgsql.png . . .]() that's exactly how it looks like.
Somehow cant' upload Screenshots. error remains: undefined column.
Okay, one more try. Otherwise i need to undust my PG installation.
Please change the code so it looks like:
static public function getServerConfigurationPrefixes($activeConfigurations = false) {
$referenceConfigkey = 'ldap_configuration_active';
$query = '
SELECT DISTINCT `configkey`
FROM `*PREFIX*appconfig`
WHERE `configkey` LIKE ?
';
$param = array('%'.$referenceConfigkey);
if($activeConfigurations) {
$query .= ' AND `configvalue` = ?';
$param [] = '1';
}
$query = \OCP\DB::prepare($query);
$serverConfigs = $query->execute($param)->fetchAll();
$prefixes = array();
Hope it will work like this.
This are the entries in the oc_appconfig table regarding user_ldap:
appid, configkey, configvalue user_ldap, enabled, yes user_ldap, installed_version, 0.3.9.4 user_ldap, types, authentication
sorry, now i got this:
{"app":"PHP","message":"SQLSTATE[08P01]: <
guys it seems to me that it's a problem of quotes :
brol = "1" -- means the column brol = the column 1
but
brol = '1' -- means the column brol = the value 1 (as a string)
you're right, changed it like so:
if($activeConfigurations) {
$query .= ' AND `configvalue` = \'1\'';
now i got the logon screen, lets see ....
It works. Thank you very much. I took the original helper.php from beta2 an changed line Numer 57 to:
$query .= ' AND configvalue
= \'1\'';
Thanks again and best regards.
BTW, I've looked through the ldap source and there are multiple parts where parameters are enclosed in double quotes. I think you should convert them to single quotes, just in case @blizzz
As it's now merged, could you please test that it work? thanks
Sure, but i can only test if ldap works with pgsql Database. Okay, testing with Sqlite shouldn't be a Problem though. I'll get back with some results tomorrow.
No Errors regarding user_ldap in owncloud.log, tested with pgsql and sqlite. Thank you, works for me. Can be closed.
Awesome! Thanks a lot for the test!
thanks @eMerzh
if i enable user_ldap module, i get the following error log, and a blank owncloud page in the browser.
{"app":"PHP","message":"SQLSTATE[42883]: Undefined function: 7 FEHLER: Operator existiert nicht: text = integer\nLINE 5: AND \"configvalue\" = 1\n ^\nHINT: Kein Operator stimmt mit dem angegebenen Namen und den Argumenttypen \u00fcberein. Sie m\u00fcssen m\u00f6glicherweise ausdr\u00fcckliche Typumwandlungen hinzuf\u00fcgen. at \/var\/www\/owncloud\/lib\/db.php#855","level":4,"time":1361965662}