- Posts: 3
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
Please Log in to join the conversation.
<?php $ldap_host = "ldap://ldap.server.IP.address"; $ldap_port = 389; $bind_dn = "CN=bind_user,OU=User Account,DC=domain,DC=com"; $bind_pwd = "bind_user_password"; $base_dn = "ou=actual ou,dc=domain,dc=com"; $username = "username of actual user on AD"; // sAMAccountName of a real AD user $filter = "(&(objectClass=user)(sAMAccountName=$username))"; $ds = ldap_connect($ldap_host, $ldap_port); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ds, LDAP_OPT_REFERRALS, 0); if (!$ds) { die("Could not connect to LDAP server"); } echo "Connected to LDAP<br>"; if (!ldap_bind($ds, $bind_dn, $bind_pwd)) { die("LDAP bind failed<br>"); } echo "Bind successful<br>"; $search = ldap_search($ds, $base_dn, $filter); $entries = ldap_get_entries($ds, $search); if ($entries["count"] == 0) { die("User not found in LDAP<br>"); } $user_dn = $entries[0]["dn"]; echo "Found user: $user_dn<br>"; // Now try binding as the actual user $user_password = "password_for_test_user"; // AD password if (@ldap_bind($ds, $user_dn, $user_password)) { echo "<strong>LDAP login successful for user $username</strong>"; } else { echo "<strong>LDAP login failed for user $username</strong>"; } ?>
system.db.CDbCommand.query(SHOW FULL COLUMNS FROM lime_surveys) 1 0.00288 0.00288 0.00288 0.00288 system.db.CDbCommand.query(SHOW FULL COLUMNS FROM lime_plugins) 1 0.00106 0.00106 0.00106 0.00106 system.db.CDbCommand.query(SHOW FULL COLUMNS FROM lime_plugin_settings) 1 0.00100 0.00100 0.00100 0.00100 system.db.CDbCommand.query(SHOW FULL COLUMNS FROM lime_settings_global) 1 0.00098 0.00098 0.00098 0.00098 system.db.CDbCommand.query(SHOW FULL COLUMNS FROM lime_asset_version) 1 0.00094 0.00094 0.00094 0.00094 system.db.CDbCommand.query(SHOW CREATE TABLE lime_surveys) 1 0.00064 0.00064 0.00064 0.00064 system.db.CDbCommand.query(SHOW CREATE TABLE lime_plugins) 1 0.00049 0.00049 0.00049 0.00049 system.db.CDbCommand.query(SELECT * FROM lime_asset_version t WHERE path = :path LIMIT 1. Bound with :path='/var/www/html/limesurvey/application/extensions/yiiwheels/widgets/select2/assets') 1 0.00046 0.00046 0.00046 0.00046 system.db.CDbCommand.query(SELECT t1.message AS message, t2.translation AS translation FROM lime_source_message t1, lime_message t2 WHERE t1.id=t2.id AND t1.category=:category AND t2.language=:language. Bound with :category='', :language='en') 1 0.00045 0.00045 0.00045 0.00045 system.db.CDbCommand.query(SELECT * FROM lime_plugins t WHERE t.active=:yp0 ORDER BY priority DESC. Bound with :yp0=1) 1 0.00045 0.00045 0.00045 0.00045 system.db.CDbCommand.query(SELECT * FROM lime_settings_global t WHERE stg_name=:name LIMIT 1. Bound with :name='DBVersion') 1 0.00044 0.00044 0.00044 0.00044 system.db.CDbCommand.query(SHOW CREATE TABLE lime_asset_version) 1 0.00044 0.00044 0.00044 0.00044 system.db.CDbCommand.query(SHOW CREATE TABLE lime_plugin_settings) 1 0.00042 0.00042 0.00042 0.00042 system.db.CDbCommand.query(SELECT * FROM lime_asset_version t WHERE path = :path LIMIT 1. Bound with :path='/var/www/html/limesurvey/application/extensions/FlashMessage/assets') 1 0.00039 0.00039 0.00039 0.00039 system.db.CDbCommand.query(SELECT * FROM lime_settings_global t) 1 0.00038 0.00038 0.00038 0.00038 system.db.CDbCommand.query(SELECT * FROM lime_asset_version t WHERE path = :path LIMIT 1. Bound with :path='/var/www/html/limesurvey/application/extensions/LimeScript/assets/script.js') 1 0.00037 0.00037 0.00037 0.00037 system.db.CDbCommand.query(SHOW CREATE TABLE lime_settings_global) 1 0.00036 0.00036 0.00036 0.00036 system.db.CDbCommand.query(SELECT * FROM lime_plugin_settings t WHERE t.plugin_id=:yp0 AND t.model IS NULL AND t.model_id IS NULL AND t.key=:yp1. Bound with :yp0='5', :yp1='is_default') 1 0.00033 0.00033 0.00033 0.00033
Please Log in to join the conversation.