Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

php/ldap authentication code for panther server



Dear all

Have just used this code to replace the yellow pages authentication code in my home grown php solutions.

Regards

Tim

******

authenticate function auth_user($user,$pass) {
  $ldapserver = 'ldap://xxx.xxx.xxx.xxx/';
  $ds=ldap_connect($ldapserver);
  if ($ds) {
    ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
    $dn="uid=$user,cn=users,dc=as,dc=edu,dc=au";
    $r=ldap_bind($ds,$dn,$pass);
    if ($r) { echo "logged in";
    } else {
              echo "sorry";
}
}
}

--
_______________________________________________________________________
Tim Scott - email@hidden  AIM: timothydscott01
Computing Teacher, The Armidale School, Armidale, 2351
AUSTRALIA    +61 427 277 702
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.