", $email); break; case "AT_DOT": $email = str_replace("plus.sbg.ac.at", "sbg.ac.at", $email); $email = str_replace("@", " AT ", $email); $email = str_replace("", " AT ", $email); $email = str_replace(".", " DOT ", $email); break; } return $email; } function secure_email($email) { $email = str_replace("plus.sbg.ac.at", "sbg.ac.at", $email); $email = str_replace("@", "", $email); return $email; } function change_email($email) { $email = str_replace("plus.sbg.ac.at", "sbg.ac.at", $email); return $email; } function personal_info($peid,$inst_name) { global $suche,$ldap,$filter,$row_count,$filter1; $peid=$_GET['peid']; $inst_name= $_GET['inst_name']; if ($peid <="") { return "

Für diese Person stehen keine detaillierten Informationen zur Verfügung (fehlende Personalnummer).



"; } // ldap infos $filter1="employeeid=$peid"; $filter="( & (employeeid=$peid) (department=$inst_name))"; // echo $filter; $ds=ldap_connect("141.201.100.10", 3268); // $ds=ldap_connect("plusad01.plus.sbg.ac.at", 389); if ($ds) { #### bisher gueltig #$r=ldap_bind($ds, "CN=Ldap Suche,OU=Informatikdienste und Telefon,OU=Serviceeinrichtungen,DC=plus,DC=sbg,DC=ac,DC=at","spadl" ); #### wegen umkopieren in AD #### $r=@ldap_bind($ds, "CN=Ldap Suche,OU=Informatikdienste und Telefon,OU=Serviceeinrichtungen,DC=plus,DC=sbg,DC=ac,DC=at","spadl" ); // $sr=ldap_search($ds,"DC=plus,DC=sbg,DC=ac,DC=at", $filter,$justthese); $sr=ldap_search($ds,"DC=plus,DC=sbg,DC=ac,DC=at", $filter1); $info = ldap_get_entries($ds, $sr); $row_count = $info['count']; if ($row_count > 1) { $sr=ldap_search($ds,"DC=plus,DC=sbg,DC=ac,DC=at", $filter); $info = ldap_get_entries($ds, $sr); } $tpl=new HTMLtemplate; $tpl->load("ldapperson.htt"); $i=0; #print_r($info); /* //-- ----------------------- // begin oracle/fodok infos //-- ----------------------- #$conn = @Ora_Logon("uso_ris_v2@fodok", "uso_ris_v298"); $conn = @Ora_Logon("uso_ris_v2@fodok", "fodokchange_04"); $curs = @ora_open($conn); @ora_commitoff($conn); //$query = "select title ins_title, wwwsbg_pers_url,fodok_pers_url,lvvz_pers_url,wwwsbg_ins_url,fodok_ins_url,lvvz_ins_url // from s_uso_zsd where adv_pers_id = " . utf8_decode($info[$i]["employeeid"][0]) . // " and adv_ins_id= " . utf8_decode($info[$i]["departmentnumber"][0]) . "and lvvz_pers_url is not null"; // ACHTUNG !!!!!!! // die Einschraenkung ueber den institutsnamen ist eher 'ne vage Definition // ist aber momentan nicht anders realisierbar weil keine inst_id oder kostenstellennummer auf ADS if ($inst_name > "" and $row_count > 1) { $query = "select title ins_title, wwwsbg_pers_url,fodok_pers_url,lvvz_pers_url,wwwsbg_ins_url,fodok_ins_url,lvvz_ins_url " . "from s_uso_zsd where adv_pers_id = " . utf8_decode($info[$i]["employeeid"][0]) . " and lvvz_pers_url is not null" . " and upper(title) like upper('%$inst_name%')"; } else { $query = "select title ins_title, wwwsbg_pers_url,fodok_pers_url,lvvz_pers_url,wwwsbg_ins_url,fodok_ins_url,lvvz_ins_url " . "from s_uso_zsd where adv_pers_id = " . utf8_decode($info[$i]["employeeid"][0]) . " and lvvz_pers_url is not null"; } //echo $query; @ora_parse($curs, $query); @ora_exec($curs); $ncols = @ora_numcols($curs); $nrecords = 1; #var_dump($query); #var_dump($nrecords); #var_dump($curs); while (@ora_fetch($curs) and $nrecords <= 100) { $nrecords++; $irecord=0; while($irecord<$ncols-1) { #var_dump($persinfo); $persinfo['ins_title']= @ora_getcolumn($curs,$irecord);$irecord++; $persinfo['wwwsbg_pers_url']= @ora_getcolumn($curs,$irecord);$irecord++; $persinfo['fodok_pers_url']= @ora_getcolumn($curs,$irecord);$irecord++; $persinfo['lvvz_pers_url']= @ora_getcolumn($curs,$irecord);$irecord++; $persinfo['wwwsbg_ins_url']= @ora_getcolumn($curs,$irecord);$irecord++; $persinfo['fodok_ins_url']= @ora_getcolumn($curs,$irecord);$irecord++; $persinfo['lvvz_ins_url']= @ora_getcolumn($curs,$irecord);$irecord++; } //end while } //end while #var_dump($persinfo); $persinfo['myfodok']= "http://uni-online.sbg.ac.at/pls/portal/nav.show"; @ora_close($curs); @ora_logoff($conn); //--------------------------- // end oracle/fodok infos //--------------------------- */ $persinfo = array(); # if ($persinfo['wwwsbg_pers_url']=="") { if (! isset($persinfo['wwwsbg_pers_url'])) { $persinfo['web_url']=""; } else { $persinfo['web_url']="Web/Url"; } $name = $info[$i]["cn"][0]; $persinfo['vname']=$info[$i]["givenname"][0]; $persinfo['nname']=$info[$i]["sn"][0]; $persinfo['personaltitle']=$info[$i]["personaltitle"][0]; $persinfo['title']=$info[$i]["title"][0]; #$persinfo['url']=$info[$i]["wwwhomepage"][0]; if (isset($info[$i]["wwwhomepage"][0])){ $persinfo['url']= $info[$i]["wwwhomepage"][0];} if (isset ($info[$i]["url"][0])){ $persinfo['url1']=$info[$i]["url"][0];} if (! isset($persinfo['url'])) { $persinfo['web_url']=""; } else { if (ereg("^http://", $persinfo['url'])==true) { $tpl_user=$tpl->getTemplate("url_area"); $persinfo['web_url']="Web/Url"; $persinfo['http']=""; $tpl->insert("url_area", $tpl_user, $persinfo); } else { $tpl_user=$tpl->getTemplate("url_area"); $persinfo['web_url']="Web/Url"; $persinfo['http']="http://"; $tpl->insert("url_area", $tpl_user, $persinfo); } } if (! isset ($persinfo['url1'])) { $persinfo['web_url']=""; } else { if (ereg("^http://", $persinfo['url1'])==true) { $tpl_user=$tpl->getTemplate("url_area2"); $persinfo['http1']=""; $tpl->insert("url_area2", $tpl_user, $persinfo); } else { $tpl_user=$tpl->getTemplate("url_area2"); $persinfo['http1']="http://"; $tpl->insert("url_area2", $tpl_user, $persinfo); } } $UNILAN = getenv("REMOTE_ADDR"); if (($ip = ereg("^141.201.([0-9]+)([.]+)([0-9]+)$", $UNILAN)) == TRUE) { $UNILAN = TRUE; } else { $UNILAN = FALSE; } if ($UNILAN == FALSE) { $tpl_user=$tpl->getTemplate("mailto_no"); $persmail['mail']=transform_email($info[$i]["mail"][0],"PNG"); $persmail['mail_AT_DOT']=transform_email($info[$i]["mail"][0],"AT_DOT"); $tpl->insert("mailto_no", $tpl_user, $persmail); } else { $tpl_user=$tpl->getTemplate("mailto"); $persmail['mailto']=change_email($info[$i]["mail"][0]); $tpl->insert("mailto", $tpl_user, $persmail); } $persinfo['telephonenumber']=$info[$i]["telephonenumber"][0]; $persinfo['facsimiletelephonenumber']=$info[$i]["facsimiletelephonenumber"][0]; /* neue Faxnummer anzeigen AK, 29.03.2011*/ $persinfo['otherfacsimiletelephonenumber']=$info[$i]["otherfacsimiletelephonenumber"][0]; # if (isset ($info[$i]["description"][0])){$perstemp=$info[$i]["description"][0];} # $desc=str_replace("$",", ",$perstemp); // $desc=str_replace(">",">", $desc); // $desc=str_replace("<","<", $desc); # $persinfo['description']=$desc; if (isset ($info[$i]["description"][0])){ $persinfo['description']=str_replace("$",", ",$info[$i]["description"][0]); } $persinfo['where']=$info[$i]["department"][0]; if (isset($info[$i]["physicaldeliveryofficename"][0])){ $persinfo['where2']=$info[$i]["physicaldeliveryofficename"][0]; } /* if($persinfo['where2']=="" || $persinfo['where2']=="," || $persinfo['where2']==NULL) { $persinfo['wherebr']=""; } else { $persinfo['wherebr']="
"; } */ $postaladdress=$info[$i]["streetaddress"][0] . ', ' . $info[$i]["postalcode"][0] . ' ' . $info[$i]["st"][0]; $persinfo['address']=$postaladdress; $tpl->replaceVars($persinfo); ldap_close($ds); } #var_dump($persinfo); return $tpl->getText(); } #end ld_search echo ' Universität Salzburg - ldapsearch '; include("includes/ldap_oben.inc"); $content=personal_info($peid,$inst_name); echo $content; include("includes/ldap_unten.inc"); echo ''; ?>