private function updateEmail()
    {
        if (!LOCAL) {
            $ds = ldap_connect("addressbook.ic.ac.uk");
            $r = ldap_bind($ds);
            $justthese = array("mail");
            $sr = ldap_search(
                $ds,
                "ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk",
                "uid=".$this->getUser(),
                $justthese
            );
            $info = ldap_get_entries($ds, $sr);
            if ($info["count"] > 0) {
                $this->setEmail($info[0]['mail'][0]);
                return ($info[0]['mail'][0]);
            } else {
                return false;
            }
        } else {
            $email = $this->getEmail();
            return $email;
        }
    }
private function updateEmail()
    {
        if (!LOCAL) {
            $ds = ldap_connect("addressbook.ic.ac.uk");
            $r = ldap_bind($ds);
            $justthese = array("mail");
            $sr = ldap_search(
                $ds,
                "ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk",
                "uid=".$this->getUser(),
                $justthese
            );
            $info = ldap_get_entries($ds, $sr);
            if ($info["count"] > 0) {
                $this->setEmail($info[0]['mail'][0]);
                return ($info[0]['mail'][0]);
            } else {
                return false;
            }
        } else {
            $email = $this->getEmail();
            return $email;
        }
    }
private function updateEmail ( ) { if ( ! LOCAL ) { $ ds = ldap_connect ( "addressbook.ic.ac.uk" ) ; $ r = ldap_bind ( $ ds ) ; $ justthese = array ( "mail" ) ; $ sr = ldap_search ( $ ds , "ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk" , "uid=" . $ this -> getUser ( ) , $ justthese ) ; $ info = ldap_get_entries ( $ ds , $ sr ) ; if ( $ info [ "count" ] > 0 ) { $ this -> setEmail ( $ info [ 0 ] [ 'mail' ] [ 0 ] ) ; return ( $ info [ 0 ] [ 'mail' ] [ 0 ] ) ; } else { return false ; } } else { $ email = $ this -> getEmail ( ) ; return $ email ; } }
Update user's email address from ldap
Update user s email address from ldap