Menu

LDAP Authentication

2009-08-06
2013-04-02
  • Jason Ulrich

    Jason Ulrich - 2009-08-06

    We have a previous install that is using LDAP authentication, but I can find no documentation on how to implement that with a fresh code base?  Any help?

     
    • Glen Davies

      Glen Davies - 2009-08-09

      you need to create a file in includes/lib/auth called ldap.inc.php and in it put the following function - but you will need to modify the internals of this function to match your ldap server authentication requirements. Then if you log in to interact and go to server admin under settings you should see ldap as an authentication option.

      function auth_ldap($user_name, $password, $password2, $level_key) {

          global $CONFIG;

              if ($conn = @ldap_connect('localhost')) {
                    $binddn = "uid=$user_name,ou=Users,dc=smart-net,dc=local";
                    if (!$rs = @ldap_bind($conn, $binddn, $password)) {
                      return false;
                    } else {
                      return true;
                    }
              } else {
                    return false;
              }
         
         
      }

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.