Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-2010, 01:40 PM
Starter Member
 
Posts: 1
Question uid from my account is changeable, is it rigth?

Hello people,

I am doing a simple routine to autenticate a PHP WebPage using the LDAP Accounts, I need to log (into a file or table) the access, therefore I would use the account ID field but I just have that the uid field is the account name (string) and it is changeable by Zimbra Administration GUI,
So if someone will change her account name the log Reports will be incomplete.

I think that I have something wrong, this is my code

Code:
<?php
$ds = ldap_connect("Server",389) or die('die :(');  //find the server
$set = ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
if ($ds) {

    $r=ldap_bind($ds, 'uid=thesign,ou=people,dc=grupotusa,dc=mx','strong') or die('error');   //make connection
     $justthese = array("givenname", "mail","uid");
     $filter = "(&(objectClass=account))";

    $sr=ldap_search($ds, "uid=thesign,ou=people,dc=grupotusa,dc=mx", "uid=thesign",$justthese); //search the user

   $info = ldap_get_entries($ds, $sr);  //get all information

   print_r($info);
And this prints:

Code:
Array
(
    [count] => 1
    [0] => Array
        (
            [mail] => Array
                (
                    [count] => 1
                    [0] => thesign@grupotusa.mx
                )

            [0] => mail
            [uid] => Array
                (
                    [count] => 1
                    [0] => thesign
                )

            [1] => uid
            [givenname] => Array
                (
                    [count] => 1
                    [0] => ivan
                )

            [2] => givenname
            [count] => 3
            [dn] => uid=thesign,ou=people,dc=grupotusa,dc=mx
        )

)

Does anyone know how to get an static numerical ID filed? or what is the advice in things like this?

Regards

7th Sign |Ivan
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.