diff --git a/system/mlists/mlists_create.php b/system/mlists/mlists_create.php index 1b4dff59e..eb67f7b84 100644 --- a/system/mlists/mlists_create.php +++ b/system/mlists/mlists_create.php @@ -5,12 +5,16 @@ require_once('../../vilesci/config.inc.php'); require_once('../../include/functions.inc.php'); require_once('../../include/globals.inc.php'); + require_once('../../include/studiensemester.class.php'); + if (!$conn = pg_pconnect(CONN_STRING)) die('Es konnte keine Verbindung zum Server aufgebaut werden.'); if(!($result_stg=pg_query($conn, "SELECT studiengang_kz, bezeichnung, lower(typ::varchar(1) || kurzbz) as kurzbz FROM public.tbl_studiengang ORDER BY kurzbz ASC"))) die(pg_errormessage($conn)); $num_rows=pg_num_rows($result_stg); + $ss=new studiensemester($conn); + $ss_nearest=$ss->getNearest(); ?> @@ -46,7 +50,7 @@ 'FROM campus.vw_benutzer, public.tbl_benutzergruppe '. 'WHERE vw_benutzer.uid=tbl_benutzergruppe.uid AND '. "UPPER(gruppe_kurzbz)=UPPER('$mg_kurzbz') AND tbl_benutzergruppe.uid NOT LIKE '\\\\_%' ". - 'AND studiensemester_kurzbz IS NULL ORDER BY nachname'; + "AND (studiensemester_kurzbz IS NULL OR studiensemester_kurzbz='$ss_nearest') ORDER BY nachname;"; //echo $sql_query; if(!($result_person=pg_query($conn, $sql_query))) die(pg_errormessage($conn)); diff --git a/system/mlists/student_lists_create.php b/system/mlists/student_lists_create.php index 580ad7138..92bd37044 100644 --- a/system/mlists/student_lists_create.php +++ b/system/mlists/student_lists_create.php @@ -138,7 +138,8 @@ // ---------- Eine Datei mit allen Studentent anlegen ------------------- $sql_query="SELECT studiengang_kz, bezeichnung, lower(typ::varchar(1) || kurzbz) as kurzbz,uid, nachname, vorname, - semester, verband, gruppe FROM campus.vw_student JOIN tbl_studiengang USING (studiengang_kz) WHERE uid NOT LIKE '\\\\_%' AND semester<10 AND semester>0"; + semester, verband, gruppe FROM campus.vw_student JOIN tbl_studiengang USING (studiengang_kz) + WHERE uid NOT LIKE '\\\\_%' AND semester<10 AND semester>0 AND vw_student.aktiv AND (substring(uid from 1 for 1)<'0' OR substring(uid from 1 for 1)>'9')"; echo $sql_query; if(!($result=pg_query($conn, $sql_query))) die(pg_errormessage($conn)); diff --git a/vilesci/left.php b/vilesci/left.php index 2ff441193..6a16d4d74 100644 --- a/vilesci/left.php +++ b/vilesci/left.php @@ -285,6 +285,34 @@   + + + + + +  Benutzer + + + + + + + + + + + +
  + + +  LDAP-Check + +
+ + + +   + @@ -320,18 +348,18 @@   - + - + -  Lektoren +  Mitarbeiter - + diff --git a/vilesci/personen/ldap_check.php b/vilesci/personen/ldap_check.php new file mode 100644 index 000000000..e67b2f2de --- /dev/null +++ b/vilesci/personen/ldap_check.php @@ -0,0 +1,118 @@ +"; + if ($ds) + { + //echo "Binding ..."; + $r=ldap_bind($ds); // this is an "anonymous" bind, typically + // read-only access + //echo "Bind result is " . $r . "
"; + } + else + echo "

Unable to connect to LDAP server

"; + +?> + + + LDAP-Check + + + + + +

LDAP-Check (Benutzer)

+
+ Benutzer werden geladen und die UID im LDAP geprueft. +

+ Folgende Benutzer sind aktiv und haben keinen LDAP-Eintrag:
+ + "; + echo ""; + + $i=0; + while ($row=pg_fetch_object($result)) + { + + // Search uid entry + $sr=ldap_search($ds, "ou=People, dc=technikum-wien, dc=at", "uid=".$row->uid); + //echo "Search result is " . $sr . "
"; + //echo "Number of entires returned is " . ldap_count_entries($ds, $sr) . "
"; + //echo "Getting entries ...

"; + $info = ldap_get_entries($ds, $sr); + //echo "Data for " . $info["count"] . " items returned:

"; + /*for ($i=0; $i<$info["count"]; $i++) + { + echo "dn is: " . $info[$i]["dn"] . "
"; + echo "first cn entry is: " . $info[$i]["cn"][0] . "
"; + echo "first email entry is: " . $info[$i]["mail"][0] . "


"; + }*/ + + if ($info["count"]==0) + { + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $email=$row->uid.'@technikum-wien.at'; + echo ""; + //echo ""; + //echo ""; + //echo ""; + echo ""; + $i++; + flush(); + } + if ($i>19) + break; + } + echo "
   Übersicht
UIDTitelNachnameVornameVornamenTitelPostAktiveMailAktion
".$row->uid."".$row->titelpre."".$row->nachname."".$row->vorname."".$row->vornamen."".$row->titelpost."$emailEditDelete
"; + echo $i.' Ergebnisse
'; + } + else + echo "Fehler beim laden der Mitarbeiter: ".pg_errormessage($conn); + + echo "Closing connection"; + ldap_close($ds); + +?> + + + diff --git a/vilesci/stammdaten/imexport/zutrittskarten/import.php b/vilesci/stammdaten/imexport/zutrittskarten/import.php index 44181918f..7f6828b0e 100644 --- a/vilesci/stammdaten/imexport/zutrittskarten/import.php +++ b/vilesci/stammdaten/imexport/zutrittskarten/import.php @@ -94,7 +94,16 @@ $pin=trim(substr($fp[$i],$beginpos,$endpos-$beginpos)); //echo $pin.'
'; $sql_query="INSERT INTO sync.tbl_zutrittskarte (key,name,firstname,groupe,logaswnumber,physaswnumber,validstart,validend,text1,text2,text3,text4,text5,text6,pin) - VALUES ('$key','$name','$firstname','$groupe','$logaswnumber','$physaswnumber','$validstart','$validend','$text1','$text2','$text3','$text4','$text5','$text6','$pin')"; + VALUES ('$key','$name','$firstname','$groupe','$logaswnumber','$physaswnumber',"; + if ($validstart=='') + $sql_query.="NULL,"; + else + $sql_query.="'$validstart',"; + if ($validend=='') + $sql_query.="NULL,"; + else + $sql_query.="'$validend',"; + $sql_query.="'$text1','$text2','$text3','$text4','$text5','$text6','$pin')"; $result=pg_exec($conn, $sql_query); //echo $sql_query; if(!$result)