function search($attribs = false)
 {
     $ldap = Schulv::ldapConnect();
     $filter = "(objectclass=schulvStudent)";
     if ($ldap->search(sprintf("ou=students,%s", SCHULV_SUFFIX), $filter, $attribs)) {
         return $ldap->result;
     }
     return false;
 }
 function search($attribs = false)
 {
     $ldap = Schulv::ldapConnect();
     $filter = "(objectclass=schulvSchule)";
     if ($ldap->search(SCHULV_SUFFIX, $filter, $attribs)) {
         return $ldap->result;
     }
     return false;
 }
 function search($attribs = false)
 {
     $ldap = Schulv::ldapConnect();
     $filter = "(objectclass=schulvLehramt)";
     if ($ldap->search(sprintf("%s,%s", LDAP_LEHRAMT_RDN, SCHULV_SUFFIX), $filter, $attribs)) {
         return $ldap->result;
     }
     return false;
 }
 function search($attribs = false)
 {
     $ldap = Schulv::ldapConnect();
     $filter = "(objectclass=schulvLehrbefaehigung)";
     if ($ldap->search(sprintf("%s,%s", LDAP_LEHRBEF_RDN, SCHULV_SUFFIX), $filter, $attribs)) {
         //print_er($ldap->result);
         return $ldap->result;
     }
     return false;
 }
Beispiel #5
0
 function nextUid($idname = 'schulvLastuid')
 {
     /*  hier gibts eine Race-Condition zwischen ldapSearch und ldapModify;
     			soetwas wie record-locking gibts aber __noch__ nicht in OpenLDAP...
     			im OpenLDAP CVS Tree wird soetwas unterstuezt im Zusammenspiel mit Sleepycat DB 4.x
     			sodass wir in Zukunft hoffentlich mit Locking arbeiten koennen...
     		 */
     $ldap = Schulv::ldapConnect();
     $res = $ldap->search(SCHULV_SUFFIX, "(objectclass=schulvAdministration)");
     if ($res > 0) {
         $uidnr = $ldap->result[0]['schulvlastuid'][0] + 1;
         $modifyinfo['schulvlastuid'] = $uidnr;
         $ldap->attr_replace($ldap->result[0]["dn"], $modifyinfo);
     } else {
         die("Fatal Error. schulvAdministration Objekt nicht gefunden in Schulv::nextUid.");
     }
     return $uidnr;
 }
Beispiel #6
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;
 }
Beispiel #7
0
 function import()
 {
     if (array_key_exists('dn', $_REQUEST)) {
         $st = new LDAP_schulvSchule();
         $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']);
             }
             return true;
         }
         return false;
     }
     return false;
 }