Fix username login

This commit is contained in:
Johannes Zellner 2016-04-11 10:51:52 +02:00
parent ecfb7a81ea
commit d609d4905c

View file

@ -13,7 +13,7 @@ setup_ldap_source() {
# id, type, name, is_actived, cfg, allow_auto_register, created, updated
if mysql -u"${MYSQL_USERNAME}" -p"${MYSQL_PASSWORD}" -h mysql --database="${MYSQL_DATABASE}" \
-e "REPLACE INTO login_source VALUES (1,2,'cloudron',1,'{\"Name\":\"cloudron\",\"Host\":\"${LDAP_SERVER}\",\"Port\":${LDAP_PORT},\"UseSSL\":false,\"UserBase\":\"${LDAP_USERS_BASE_DN}\",\"AttributeUsername\":\"uid\",\"AttributeName\":\"\",\"AttributeSurname\":\"\",\"AttributeMail\":\"mail\",\"Filter\":\"(\\\\u0026(objectClass=user)(username=%s))\",\"AdminFilter\":\"(memberof=cn=admins,${LDAP_GROUPS_BASE_DN})\",\"Enabled\":true}','2015-06-24 17:14:12','2015-06-24 17:25:03');"; then
-e "REPLACE INTO login_source VALUES (1,2,'cloudron',1,'{\"Name\":\"cloudron\",\"Host\":\"${LDAP_SERVER}\",\"Port\":${LDAP_PORT},\"UseSSL\":false,\"UserBase\":\"${LDAP_USERS_BASE_DN}\",\"AttributeUsername\":\"username\",\"AttributeName\":\"displayname\",\"AttributeSurname\":\"\",\"AttributeMail\":\"mail\",\"Filter\":\"(\\\\u0026(objectClass=user)(username=%s))\",\"AdminFilter\":\"(memberof=cn=admins,${LDAP_GROUPS_BASE_DN})\",\"Enabled\":true}','2015-06-24 17:14:12','2015-06-24 17:25:03');"; then
echo "LDAP Authentication Setup"
else
echo "Failed to setup LDAP authentication"