original_string: 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;
          }
      }
code: 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;
          }
      }
code_tokens: 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 ; } }
docstring: Update user's email address from ldap
docstring_tokens: Update user s email address from ldap