Example #1
0
 function init()
 {
     $this->pos = 0;
     $st = new LDAP_Lehrer();
     $this->ldap_result = $st->search($this->attribs);
     //print_er($this->ldap_result, "SFDDS");
     return true;
 }
Example #2
0
 function import()
 {
     if (array_key_exists('dn', $_REQUEST)) {
         $st = new LDAP_Lehrer();
         $st->setDN($_REQUEST['dn'], true);
         core_set_param('__schulv_record_dn', $_REQUEST['dn'], $this->argv['prefix']);
         core_set_param('dn', $_REQUEST['dn'], $this->argv['prefix']);
         $ldap = Schulv::ldapConnect();
         if ($result = $ldap->read($st->getDN(), "(objectClass=*)")) {
             //print_er($ldap->result);
             reset($this->mapping);
             while (list($k, $v) = each($this->mapping)) {
                 core_set_param($k, $ldap->get($v), $this->argv['prefix']);
             }
             $val = $ldap->get($this->mapping['lehrbefaehigung'], false, ",");
             //print "VAL $val";
             core_set_param('lehrbefaehigung', $val, $this->argv['prefix']);
             core_set_param('adresse', $ldap->get($this->mapping['adresse'], false, "\n"), $this->argv['prefix']);
             return true;
         }
         return false;
     }
     return false;
 }