\n";
+
+ // Verteiler Normal
+ $grp_obj = new gruppe($conn);
+ if(!$grp_obj->getgruppe($row->studiengang_kz, null, true, true))
+ echo $grp_obj->errormsg;
+
+ foreach($grp_obj->result as $row1)
+ {
+ echo "
";
+ echo "
• $row1->beschreibung
";
+
+ // LINK for opening a closed mail dispatcher
+ // display the open-link only when its a closed dispatcher and if the user has status lector
+ // if dispatcher has attribute aktiv=true no opening action is needed
+ echo "
";
+ if(!$row1->aktiv)
+ {
+ if($is_lector)
+ {
+ /* open a popup containing the final dispatcher address */
+ echo '';
+ echo "
\n";
+ }
+
+
+ //StudentenListe Rausschreiben
+ if($row->studiengang_kz!=0) //0 ist für ganzes TW
+ {
+ // ffe, 20060508: Display the opening link for department dispatchers only for students of the particular department
+ $std_obj = new student($conn, $user);
+
+ $qry_stud = "SELECT count(*) as anzahl FROM campus.vw_student WHERE studiengang_kz='$row->studiengang_kz'";
+
+ if(!$row_stud=pg_fetch_object(pg_query($conn, $qry_stud)))
+ echo 'Fehler beim laden der Studenten';
+
+ if($row_stud->anzahl>0)
+ {
+ echo "
• Alle Studenten dieses Studiengangs
";
+
+ // ffe, 20060508: Display the opening link for department dispatchers only for students of the particular department
+ if($is_lector || $std_obj->studiengang_kz==$row->studiengang_kz)
+ {
+ echo "
";
+ echo '
';
+ /* open a popup containing the final dispatcher address */
+ echo "
Um ein Mail an den Verteiler zu senden klicken Sie bitte auf den obigen Link. Ihr Mailprogramm öffnet automatisch eine Vorlage für ein neues Mail, welche bereits die korrekte Adresse enthält.
+
+
Das Senden ist für den Zeitraum von 2 Stunden bzw. für die einmalige Benutzung unter der Adresse ".$_REQUEST['grp'].$mail_id."@technikum-wien.at möglich.
+
+ ";
+ }
+ else
+ {
+ if($_REQUEST['grp']=="")
+ {
+ exit();
+ }
+ else
+ {
+ //Fixed for https
+ //echo"Bitte bestätigen Sie das Öffnen des Verteilers ".$_REQUEST['grp'].": Bestätige";
+ echo"Bitte bestätigen Sie das Öffnen des Verteilers ".$_REQUEST['grp'].": Bestätige";
+ }
+ }
+ ?>
+
+
diff --git a/cis/private/pers_in_grp.php b/cis/private/pers_in_grp.php
new file mode 100644
index 000000000..204e229ad
--- /dev/null
+++ b/cis/private/pers_in_grp.php
@@ -0,0 +1,45 @@
+
+
+
";
+ echo "";
+ }
+ }
+ else
+ echo 'Fehler beim Auslesen der Studentendaten';
+?>
+
+
+
\ No newline at end of file
diff --git a/cis/public/Dienstleistungskatalog.xls b/cis/public/Dienstleistungskatalog.xls
new file mode 100644
index 000000000..14fce2219
Binary files /dev/null and b/cis/public/Dienstleistungskatalog.xls differ
diff --git a/cis/public/faq_bug.html b/cis/public/faq_bug.html
new file mode 100644
index 000000000..fae1ac163
--- /dev/null
+++ b/cis/public/faq_bug.html
@@ -0,0 +1,313 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bugtracking - FAQ
+
+
+
+
+
+
Dieses Dokument soll eine Kurzeinführung in die Benutzung unseres Trouble Ticketing (Bugtracking) Systems darstellen. Sollten Sie hier keine Antworten finden, melden Sie sich bitte bei ffe@technikum-wien.at.
+ Trouble Tickets werden verwendet um dem IT-Service, der Haustechnik bzw. der Fernlehrabteilung Probleme zu melden.
+
+
+ Ein Trouble Ticket lässt sich im Wesentlichen mit einem Krankenblatt eines Patienten vergleichen.
+ Bei der erstmaligen Einlieferung im Krankenhaus wird dieses im Zuge der Anamnese neu angelegt.
+ Jeder Arzt trägt nun seine Diagnose, sowie die verordnete Therapie und Medikation ein und dokumentiert deren Erfolg.
+ Das Krankenblatt gibt nun einen schnellen Überblick, gewährleistet eine schnelle Einarbeitung und verhindert eine Mehrfachdosierung.
+ Ist die Krankheit besiegt und der Patient entlassen, wird das Krankenblatt archiviert.
+
+
+ Unser Trouble Ticket System funktioniert genauso wie das Krankenblatt, ein Problem durchläuft immer denselben Prozess:
+
Erfassung » Bearbeitung » Lösung » Archivierung
+
wobei der gerade aktuelle Status jederzeit durch Aufrufen der Oberfläche abgefragt werden kann.
+
Darüber hinaus werden Sie durch, vom System generierten, Mails automatisch über den aktuellen Stand Ihres Problems informiert.
+
+ Klicken Sie auf der CIS Infrastruktur » Bugtracking an.
+
+ Sie sehen dann eine Oberfläche wie in Abbildung 1 vor sich.
+ Die Icons stellen die Navigation dar, unter dem Bereich "Meine Tickets" sind all ihre Tickets und deren aktueller Status aufgelistet.
+ Geschlossene Tickets, also Probleme die abgeschlossen wurden, werden bei einem Klick auf "Geschlossene Tickets anzeigen" sichtbar.
+
+ Durch einen Klick auf den Icon "Neues Ticket" öffnet sich ein leeres Formular wie in Abbildung 2 ersichtlich.
+
+
+ In der Auswahlbox "An:" wählen Sie bitte eine passende Kategorie für Ihr Problem. (siehe Abbildung 3)
+
+
+ Im Feld "Betreff:" führen Sie bitte einen Aussagekräftigen Betreff an.
+
+ Im Feld "Text:" tragen Sie bitte Ihre Problembeschreibung ein, diese sollte aus zumindest folgenden Eckpunkten bestehen:
+
+
welcher Service / welches Gerät / Mobiliar zeigt
+
welchen Fehler / welches Fehlverhalten
+
+
+ Wenn es sich um ein Service (ein Programm, Fernlehrumgebung, Mail, etc. ...) handelt:
+
+
+
Von welchem Gerät aus versuchten Sie den Service zu nutzen (Standort, kurze Beschreibung zum verwendeten OS usw.)
+
+
+ Wenn es sich um ein Gerät / Mobiliar handelt
+
+
+
Wo befindet sich das Gerät / Mobiliar
+
Welche Bezeichnung trägt es
+
+
+ unter Umständen:
+
+
+
Welche Schritte wurden von Ihnen zur Problembeseitigung / Lokalisation gesetzt ?
+
+
+
+ Wenn Sie alle Eingaben getätigt haben, klicken Sie auf "Übermitteln" um das Ticket zu erstellen.
+
+
+
+
+
+
+
Abbildung 2 (Zum Vergrössern klicken)
+
+
+
+
+
+
Abbildung 3 (Zum Vergrössern klicken)
+
+
+
+
+ Alternativ haben Sie die Möglichkeit ein Mail an support@technikum-wien.at zu verfassen, Mails an diese Adresse werden automatisch ins BugTracking System eingereiht.
+
+ Nach der Erstellung eines neuen Tickets scheint dieses in der Rubrik "Meine Tickets" auf. (siehe Abbildung 4)
+
+
+ Durch einen Klick auf die Ticketnummer öffnet sich der Inhalt des Tickets.
+
+ Die Oberfläche wechselt in die Ansicht wie sie in Abbildung 5 ersichtlich ist.
+
+ In dieser Ansicht können Sie das komplette Geschehen rund um Ihr Ticket beobachten, dh. Sie können zu jedem Zeitpunkt einsehen, in welchem Status sich Ihr Problem gerade befindet.
+
+ Sollten Sie noch Detailinformationen hinzufügen wollen, so können Sie das ebenfalls in dieser Ansicht mit dem Formular am Seitenende (siehe Abbildung 5) tun. Sollte das Problem nicht mehr bestehen, haben Sie hier die Möglichkeit Ihr Ticket zu schliessen.
+
Dieses Dokument soll dazu dienen Antworten auf häufig gestellte Fragen über das FH-LAN zu beantworten. Sollten Sie hier keine Antworten finden, melden Sie sich bitte bei support@technikum-wien.at.
Drücken Sie CTRL+ALT+DEL (STRG+ALT+ENTF). Es erscheint ein Fenster mit 6 verschiedenen Auswahlmöglichkeiten. Klicken Sie auf "Kennwort ändern ..." und folgen Sie den Anweisungen. Achtung: Es wird hier auch das Passwort für Unix, Mail und sonstige Dienste geändert.
+
Linux:
+
Geben Sie in der Konsole den Befehl passwd ein. Sie werden nach dem alten und zweimal nach dem neuen Passwort gefragt.
+
WebMail Plattform:
+
Unter dem Punkt "Mein Konto" den Punkt "Passwort" auswählen. Geben Sie Ihr altes Passwort und zweimal Ihr neues Passwort ein, bestätigen Sie die Aktion mit "Passwort ändern"
+ In jedem Saal gibt es ca. 3 Rechner die mit einem ZIP-Laufwerk ausgerüstet sind. Diese können bei Bedarf auch freigegeben werden, damit von anderen Rechnern darauf zugegriffen werden kann.
+
+
+
+
+
+
+
+
+
+
+
+
Wie kann ich mein M:\ Laufwerk manuell verbinden (z.B. Laptop)?
Klicken Sie mit der rechten Maustaste auf das Icon Netzwerkumgebung und wählen Sie den Menüpunkt Netzlaufwerk verbinden. Im Pfad geben Sie "\\[File-Server]\[loginname]" ein, wobei [loginname] durch Ihren Login Namen zu ersetzen ist und [File-Server] Ihr zugeordneter Fileserver ist (fhe, stud02, stud03, ... siehe hier).
+ Nach drücken des OK Buttons, erscheint nach kurzer Zeit ein neuer Dialog in dem Sie nach Ihrem Login Namen und dem Kennwort gefragt werden. Geben Sie die Daten noch einmal ein, und wenn alles richtig eingetragen wurde, steht Ihnen sofort ein Laufwerk M:\ zur Verfügung.
Klicken Sie mit der rechten Maustaste auf das Icon Netzwerkumgebung und wählen Sie den Menüpunkt Netzlaufwerk verbinden. Im Pfad geben Sie "\\eid\lehre" ein.
+ Damit steht Ihnen sofort ein Laufwerk L:\ zur Verfügung.
+
+
+
+
+
+
+
+
+
+
+
+
Warum werden meine Einstellungen am Windows NT/XP Desktop nicht gespeichert?
Um sich von zu Hause aus zu verbinden benötigt man einen Internetzugang über einen Internetprovider, und ein SCP Programm (zB.: WinSCP) um die Daten kopieren zu können. Hostname ist Ihr Fileserver (siehe hier), die User ID und das Passwort entsprechen dem Loginnamen und dem Passwort im FH Bereich.
+ Wenn die Verbindung erfolgreich hergestellt worden ist, findet man sich in seinem Homeverzeichnis wieder und man kann mit dem Dateitransfer beginnen. Eine alternative Möglichkeit ist die Verbindung mittels SSH (z.B. putty).
+
+
+
+
+
+
+
+
+
+
+
+
Wie verbinde ich mich von zuhause mit dem Lehre-Verzeichnis am Technikum Wien?
So wie das persönliche Homeverzeichnis, liegt auch das Lehre Verzeichnis auf einem UNIX Server, auf den SCP oder SSH aus dem Internet zugegriffen werden kann. Der Servername lautet "eid.technikum-wien.at", Nach dem Anmelden muß man in das Verzeichnis "/lehre" wechseln und schon befindet man sich im Lehre Verzeichnis, das im FH-LAN als Laufwerk L:\ gemappt wird!
Sie legen einfach in Ihrem Benutzerverzeichnis (home Verzeichnis unter Unix oder einfach das Laufwerk M:\ innerhalb des FH LANs) eine Datei mit dem Namen .forward an (Achtung: nicht den Punkt vor forward vergessen). In diese Datei schreiben Sie einfach die E-Mail Adresse an die Sie die E-Mails weitergeleitet haben wollen. Sollten Sie die Nachrichten an mehrere Adressen weiterleiten, so schreiben Sie einfach mehrere E-Mail Adressen in diese Datei (jede Adresse in eine neue Zeile).
+ Wollen Sie das die Nachricht nicht nur weitergeleitet wird, sondern auch noch am Server pop.technikum-wien.at weiterhin verfügbar ist, so schreiben Sie einfach auch noch Ihre E-Mail Adresse der FH (username@technikum-wien.at) in die forward Datei.
+
+
+
+
+
+
+
+
+
+
+
+
Wie lange bleiben die Accounts der Absolventen erhalten?
Die Accounts bleiben bis Mitte August aufrecht. Spätestens im September wenn die neuen Accounts erzeugt werden, werden auch die alten Accounts der Absolventen gelöscht. Sollten Sie Ihren Account (durch Misserfolg bei der Diplomprüfung) noch länger brauchen, so bitten wir Sie uns rechtzeitig diesen Umstand mitzuteilen. In allen anderen Fällen ist eine Aufrechterhaltung des Accounts aus Ressourcenmangel nicht möglich!
Um den Proxy zu verwenden steht eine automatische Konfigurationshilfe zur Verfügung!
+ Dafür sind folgende Einstellungen in der Netscape Konfiguration erforderlich:
+
+
+
+
• Menü Edit (Bearbeiten)
+ • Punkt Preferences (Einstellungen) wählen
+ • In der Liste den Punkt Advanced (Erweiterte Einstellungen) aufklappen
+ • Den Punkt Proxies wählen
+ • Auswahl Automatic Proxy Configuration auswählen
+ • URL: http://cis.technikum-wien.at/config/fh.pac
+
+
+
+ Damit werden automatisch die richtigen Einstellungen für den neuen
+ Proxy übernommen.
+ BP = Bachelorprüfung
+ DP = Diplomprüfung
+ B vor Studiengangskürzel = Bachelorstudiengang
+ M vor Studiengangskürzel = Masterstudiengang
+ D vor Studiengangskürzel = Diplomstudiengang
+
+
Sponsionen
+
Reihungstest
+
Interne Termine
+
+ Senate, Kollegiumssitzungen, Wartungswochen, Semester-Kick-Off etc.
+
+
Veranstaltungen
+
+ Veranstaltungen der Unternehmenskommunikation, Infoabende, BEST,
+ Tag der offenen Tür, Messen im Haus und extern, Weiterbildungsveranstaltungen, etc.
+
+
+
\ No newline at end of file
diff --git a/cis/public/info/jahresplan_WS2006.html b/cis/public/info/jahresplan_WS2006.html
new file mode 100644
index 000000000..0053e9187
--- /dev/null
+++ b/cis/public/info/jahresplan_WS2006.html
@@ -0,0 +1,386 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Jahresplan WS2006
+
+
+
+
+
+
+
+
+
+
+
+
+
Diplomprüfungen/ Bachelorprüfungen
+
+
+ BP = Bachelorprüfung
+ DP = Diplomprüfung
+ B vor Studiengangskürzel = Bachelorstudiengang
+ M vor Studiengangskürzel = Masterstudiengang
+ D vor Studiengangskürzel = Diplomstudiengang
+
+
Sponsionen
+
Reihungstest
+
Interne Termine
+
+
+ Senate, Kollegiumssitzungen, Wartungswochen, Semester-Kick-Off etc.
+
+
Veranstaltungen
+
+
+ Veranstaltungen der Unternehmenskommunikation, Infoabende, BEST,
+ Tag der offenen Tür, Messen im Haus und extern, Weiterbildungsveranstaltungen, etc.
+
+ Die Massnahmen des vorbeugenden Brandschutzes dienen der Vermeidung der
+ Gefährdung von Gesundheit und Eigentum und sollen verhindern, dass
+ berhaupt ein Schadenfeuer entsteht und sich ausbreiten kann. Sie werden
+ daher gebeten, stets dafür zu sorgen, dass alle vorbeugenden Brandschutzmanahmen
+ beachtet werden und wirkungsvoll erhalten bleiben.
+
Wir
+ ersuchen um Verständnis, wenn wir aus Gründen der Vereinfachung
+ bei der Bearbeitung männlich geprägter Begriffe die Angabe des
+ Zusatzes "/innen" oder der dafür relevanten weiblichen
+ Bezeichnung unterlassen haben.
Für
+ die Brandsicherheit des Gebäudes sind die in der Anlage genannten
+ Brandschutzbeauftragten und Brandschutzwarte zuständig. Die Bekanntgabe
+ der aktuellen Brandschutzbeauftragten und Brandschutzwarte erfolgt im
+ Intranet.
+
Alle
+ Mitarbeiter haben den Brandschutz betreffende Weisungen dieser Personen
+ unverzüglich zu befolgen und ihnen alle Wahrnehmungen von Mängeln
+ auf dem
+
Die
+ nachstehend angeführten Bestimmungen sind unbedingt einzuhalten,
+ wobei die Nichtbefolgung unter Umständen zivil- und/oder auch strafrechtliche
+ Folgen nach sich ziehen kann.
Die
+ Einhaltung von Ordnung und Sauberkeit auf allen Arbeitsplätzen
+ und Verkehrswegen ist ein grundlegendes Erfordernis des Brandschutzes.
+ Alle Mitarbeiter des Unternehmens haben bei ihrer täglichen Arbeit
+ die Brandsicherheit stets zu beachten. Brennbare Abfälle, loses
+ Papier, leere Kartons und Verpackungen sind spätestens bei Arbeits-
+ oder Geschfätsschluss entsprechend zu entsorgen bzw. zu verstauen.
+ Papierablagerungen in der unmittelbaren Nähe von Gerten oder
+ Stromkabeln sind zu unterlassen.
+
+
+
+
+ 3.2
+
+ In allen Lagerräumen, Labors sowie allen technischen Betriebsräumen
+ besteht gesetzliches Rauchverbot. Alle Führungskrfte sind in
+ ihrem Bereich dafür verantwortlich, dass dies von den Mitarbeitern
+ aber auch von Studenten, Lieferanten und Kunden eingehalten wird.
+
+
+
+
+ 3.3
+
+ Fluchtwege und sonstige Verkehrswege sind in ihrer vollen Breite von
+ Lagerungen aller Art (auch von Blumentöpfen und Trögen)
+ freizuhalten.
+
+
+
+
+ 3.4
+
+ Brandschutztüren und Brandschutzklappen sind von Gegenständen
+ aller Art freizuhalten. Das „Aufkeilen“ von Brandschutztüren
+ z.B. mittels Kartons oder Holzkeilen ist untersagt. Brandschutztüren
+ sind, soweit sie nicht durch Haltemagnete offengehalten werden, prinzipiell
+ geschlossen zu halten.
+
+
+
+
+ 3.5
+
+ Angebrachte Hinweisschilder und Hinweiszeichen für Fluchtwege
+ und Brandbekämpfungseinrichtungen sowie Bodenmarkierungen sind
+ zu beachten und dürfen nicht der Sicht entzogen, beschädigt
+ oder verdeckt werden.
+
+
+
+
+ 3.6
+
+ Löschgeräte und Löschmittel müssen gut sichtbar
+ und leicht zugänglich sein, sie dürfen nicht zweckwidrig
+ verwendet, verdeckt oder verstellt werden.
+
+
+
+
+ 3.7
+
+ Feuergefährliche Abfälle sind in dicht schliessenden, feuerbeständigen
+ Abfallbehältern zu sammeln. Für einen rechtzeitigen Abtransport
+ ist zu sorgen. Aschenbecher dürfen nicht in Papierkörbe
+ entleert werden. Achtloses Wegwerfen von Putzabfällen, Verpackungsmaterial,
+ Rauchzeug und ähnlichem erhöht die Brandgefahr und ist daher
+ strengstens verboten.
+
+
+
+
+ 3.8
+
+ Die Lagerung von leicht brennbaren Gegenständen und Lösungsmitteln
+ bzw. Reinigungsmitteln ist nur in den dafür vorgesehenen Rumen
+ und in der jeweils zulässigen Menge gestattet.
+
+
+
+
+ 3.9
+
+ Nach Dienstschluss müssen sämtliche Elektrogeräte wie
+ Elektrokocher, Kaffeemaschinen, Ventilatoren und Heizlüfter abgeschaltet
+ und wenn möglich vom Stromnetz getrennt werden. Weiters dürfen
+ diese Geräte nicht auf brennbaren Unterlagen und in der unmittelbaren
+ Nähe von leicht entzündlichen Gegenständen wie Papierkörben,
+ Gardinen und ähnlichen aufgestellt sein.
+
+
+
+
+ 3.10
+
+ Nach Betriebsschluss sind alle Fenster, Zimmer- und Aussentüren
+ zu schliessen. Nach Ende der Heizperiode beziehungsweise in der Sommerzeit
+ können die (öffenbaren) Fenster in Kippstellung belassen
+ werden.
+
+
+
+
+ 3.11
+
+ In der Tiefgarage sind der Umgang mit offenem Feuer und Licht sowie
+ das Rauchen verboten. Fahrzeuge mit Flüssiggasantrieb dürfen
+ nicht in der Garage abgestellt werden. Brennbare Gegenstände
+ (z.B. Autoreifen) dürfen in der Tiefgarage nicht gelagert werden.
+ Studenten ist der Aufenthalt in der Tiefgarage untersagt.
+
+
+
+
+ 3.12
+
+ Dem Brandschutzbeauftragten ist im Rahmen der betrieblichen Eigenkontrolle
+ nach TRVB 120 der Zutritt zu allen Räumen zu ermöglichen.
+
+
+
+
+ 3.13
+
+ Ertönt im Haus ein Sirenenton, so ist den Anweisungen der Brandschutzwarte
+ Folge zu leisten und das Gebäude am schnellsten Wege zu verlassen
+ (= Räumungsalarm).
+
+
+
+
+ 3.14
+
+ Alle Tätigkeiten, die mit Rauch-, Staub- oder Dampfentwicklung
+ verbunden sind, sind vor Arbeitsbeginn dem Brandschutzbeauftragten
+ zu melden.
+
+
+
+
+ 3.15
+
+
+ Elektrische Anlagen sind vorschriftsmässig Instand zuhalten.
+ Änderungen und Reparaturen dürfen nur durch dazu befugtes
+ Personal vorgenommen werden. Das Herstellen provisorischer Installationen
+ ist verboten.
+
+
+
+
+ 3.16
+
+
+ Selbst mitgebrachte Elektrogeräte (Kaffeemaschinen etc.) sind
+ dem Brandschutzbeauftragten zur Kenntnis zu bringen. Und nur mit
+ Einverständnis der Infrastrukturabteilung erlaubt.
Wird ein Brandherd
+ bemerkt, so ist zu alarmieren:
+
+ 0 –
+ 112 Euronotruf
+ 0 –
+ 122 Feuerwehr
+ 0 –
+ 133 Polizei
+ 0 –
+ 144 Rettung
+
(Anmerkung:
+ Der Einsatz der Feuerwehr im Brandfall ist kostenlos!)
+ Geben Sie bitte
+ so konkret wie mglich an:
+
WER meldet
+ (Name, Tel.Nr., ev. Bereich)
+ WO brennt
+ es
+ WAS brennt
+ WIEVIELE
+ Personen sind betroffen bzw. in Gefahr
+
+
+
+
+
+ 4.2
+
+
+ Sind Personen in Gefahr, sind diese ohne Selbstgefährdung aus
+ dem Gefahrenbereich zu bringen.
+
+
+
+ 4.3
+
+ Unternehmen Sie
+ Löschversuche nur nach Alarmierung der Feuerwehr (ohne Eigen-
+ und Fremdgeäfhrdung) und schliessen Sie nach Räumung des
+ Standortes von Personen die Türen und Fenster des Brandraums.
+
+
+
+
+ 4.4
+
+
+ Beim Räumungsalarm
+ (Haussirene Dauerton) ist das Gebäude über das Stiegenhaus
+ sofort zu verlassen (Aufzug nicht benutzen!) und der vorgesehene
+ Sammelplatz aufzusuchen. Den Anweisungen des Sammelplatzleiters
+ ist unbedingt Folge zu leisten.
+
Sammelplatz
+ - Höchstädtplatz, Grünfläche
+
+ Falls dies nicht möglich ist:
+ - begeben Sie sich in den vom Brand am weitest entfernten aussenliegenden
+ Raum
+ - schliessen Sie die Türen
+ - öffnen Sie – wenn möglich - die Fenster und machen
+ Sie sich den Einsatzkräften bemerkbar
+
+
+
+
+ 4.5
+
+ Den Anordnungen
+ des Brandschutzbeauftragten, der Brandschutzwarte und der Feuerwehr
+ ist unbedingt Folge zu leisten.
+
+
+
+ 4.6
+
+ Die Verwendung
+ von Mobiltelefonen ist während des Brandfalles nur in dringenden
+ Fällen gestattet.
Nach
+ einem Räumungsalarm haben sich alle im Haus Anwesenden zur Feststellung
+ der Vollzähligkeit am vorgesehenen Sammelplatz zu versammeln.
+
+
+
+
+ 5.2
+
+
+
+ Die Feuerwehr ist nach Möglichkeit schon ausserhalb des Betriebsgebäudes
+ zu erwarten. Alle Zufahrten und Zugänge sind freizumachen.
+ Die Löschkräfte sind einzuweisen, ihren Anordnungen ist
+ Folge zu leisten.
+
+
+
+
+
+ 5.3
+
+
+ Der Brand ist mit den vorhandenen Löschgerten zu bekämpfen.
+ Dabei den Löschstrahl nicht in Rauch und Flammen, sondern von
+ unten direkt auf die brennenden Gegenstände richten. Leicht brennbare
+ Gegenstände sind aus der Nähe des Brandes zu entfernen oder
+ durch Kühlen mit Wasser vor Entzündung zu schützen.
Vom
+ Brand betroffene Räume dürfen nicht betreten werden.
+
+
+
+
+
+ 6.2
+
+
+ Alle Wahrnehmungen, die zur Ermittlung der Brandursache dienen können,
+ und sonstige Beobachtungen während des Brandablaufs sind dem
+ Einsatzleiter der Feuerwehr bzw. dem Brandschutzbeauftragten bekannt
+ zu geben.
+
+
+
+
+ 6.3
+
+
+ Aufräumarbeiten dürfen erst nach Erlaubnis durch den Rektor,
+ Feuerwehr, Sicherheitskräfte beziehungsweise Versicherungsorgane
+ erfolgen.
+
+
+
+
+ 6.4
+
+
+ Das Wiedereinschalten von elektronischen Anlagen ist erst nach Überprüfung
+ durch hiezu befugte Personen gestattet.
+
+
+
+
+ 6.5
+
+
+ Bentzte Feuerlöscher sind auf den Boden zu legen (nicht
+ stellen) und zur Wiederbefüllung sofort zu melden.
Diese Hausordnung
+ legt allgemeine Regelungen für den Aufenthalt von Personen und Fahrzeugen,
+ die Benützung der Infrastruktur, die Ordnung und Reinlichkeit sowie
+ die Sicherheit für das Technikum Wien fest. Diese Hausordnung wird
+ durch den Ausbildungsvertrag ergänzt.
+
Wir
+ ersuchen um Verständnis, wenn wir aus Gründen der Vereinfachung
+ bei der Bearbeitung männlich geprägter Begriffe die Angabe des
+ Zusatzes "/innen" oder der dafür relevanten weiblichen
+ Bezeichnung unterlassen haben.
+ Der Zugang für Studenten ist der Eingang Höchstdtplatz 5.
+ Das Betreten der PKW-Tiefgarage ist Studenten untersagt.
+ Die Hauseingänge sind Montag bis Freitag 7.30 bis 21.00 Uhr und Samstag
+ 7.30 bis 13.30 Uhr geöffnet.
+
Für
+ Unterrichtsfreie Zeiten stehen den Studenten folgende Bereiche zur Verfügung:
+
Studierräume
+ 5.OG
+ Studierräume6.OG
+ Mensa
+
Beim
+ Betreten des Hauses ist auf das bestehende Rauchverbot zu achten.
+ Das Betreten des Flachdaches ist nur zum Zwecke von Reparatur- und Wartungsarbeiten
+ gestattet.
+ Werkstätten und Laboratorien dürfen von Studenten nur während
+ der hierfür vorgesehenen Unterrichtszeit und nur in Anwesenheit einer
+ verantwortlichen Aufsichtsperson betreten werden. Für diese Räumlichkeiten
+ gelten die "WERKSTATTENORDNUNG" und die "LABORORDNUNG"
+ als Ergänzung zur Hausordnung.
+
+ Das Betreten der Installationsräume für Heizung, Trafos, Aufzüge,
+ Fernsprecher und dergleichen sowie der nicht für den Unterrichtsbetrieb
+ vorgesehenen Labors ist gefährlich und daher für Studenten ausnahmslos
+ verboten.
Die
+ Bibliothek im Raum steht allen Studierenden und Vortragenden offen. Die
+ Entlehnzeiten werden dort angeschlagen.
+
+ Im Technikum Wien sind Getränkeautomaten aufgestellt. Die Leergebinde
+ sind in dafür bereitgestellte Rückgabestellen zu retournieren.
+ Der
+ Stundenplan und der Terminplan für die Sprechstunden der Lehrkräfte
+ sind auf der Intranet-Seite einzusehen.
+ Mitteilungen des Sekretariats, des IT-Services und der Administrations-
+ Abteilung an die Studenten sind auf der Intranet-Seite einzusehen und sind
+ zu beachten.
+ Jede missbruchliche
+ Verwendung oder unnötige Ingangsetzung der Aufzüge ist zu unterlassen.
+ Durch Stromausfall oder andere Ursachen steckengebliebene Aufzüge werden
+ (notfalls mit Hilfe des Notstromaggregates) wieder in Gang gesetzt. Vorübergehend
+ eingeschlossene Aufzugbenutzer haben in Ruhe das Wirksamwerden des Ersatzantriebes
+ abzuwarten.
+ Die schonungsvolle Verwendung und Behandlung aller Einrichtungsgegenstnde,
+ Geräte, Maschinen, Installationen, Fenster, Türen, Wände,
+ Decken und Fussböden in allen Räumen des Technikum - Wien ist
+ für alle Personen verpflichtend.
+ Bei fahrlässigen oder mutwilligen Beschädigungen, groben Verunreinigungen,
+ Verlust oder Diebstahl von Schuleigentum sind Disziplinarmassnahmen gegen
+ die Verursacher oder die Verursachergruppe sowie der Ersatz der Reinigungs-,
+ Reparatur- oder Wiederbeschaffungskosten vorgesehen.
+
+
Die
+ Studierrume 5.12 5.13a und 6.12 6.13a sind mit Tischen und Sesseln ausgestattet.
+ Die Studenten haben dort für Ordnung und Reinlichkeit zu sorgen.
+ Vor dem Verlassen der Räume sind die Tische zu reinigen und die Sessel
+ zurechtzurücken.
In
+ den Gängen und Stiegenhäusern dürfen keine Gegenstände
+ abgestellt werden, da diese Bereiche aus Sicherheitsgründen frei
+ bleiben müssen.
+
Die
+ Brandschutztüren vom Stiegenhaus in die jeweiligen Gänge müssen immer
+ geschlossen sein.
+ Das Laufen in den Gängen und Stiegenhäusern ist zu unterlassen,
+ um Unfälle zu vermeiden.
+
+ Jedes unmotivierte oder missbräuchliche Einschalten oder Ingangsetzen
+ von Maschinen und Geräten (z.B. Aussenjalousien, Händetrockner
+ und dergleichen) ist zu unterlassen.
+ Im Katastrophenfall ist das Haus in der Hauptfluchtrichtung (in Richtung
+ der Fluchtsymbole) zu verlassen.
+ Für
+ Studierende stehen im Garderobenraum Schliessfächer zur Verfügung.
+
+
Von
+ der Aufbewahrung wichtiger Dokumente und Wertgegenständen - z.B.
+ Führerschein, Scheckkarte, Rechner, Uhren und Geldbeträgen -
+ in den Schliessfächern wird abgeraten. Das Technikum Wien haftet
+ nicht für den Inhalt der Schliessfächer.
+ Die "BRANDSCHUTZORDNUNG liegt in den Sekretariaten auf und wurde
+ von jedem Studenten entgegengenommen. Sie bildet einen Teil der Hausordnung.
+
Jede
+ missbruchliche Ingangsetzung der Brandmelder verursacht eine Störung
+ des Unterrichtsbetriebes und möglicherweise zu Gefährdungen.
+
+
Verursacher
+ bzw. Verursachergruppen haben daher schwerwiegende disziplinäre Massnahmen
+ zu erwarten.
+ In allen Gebäuden des Technikum Wien besteht Rauchverbot. (Siehe
+ Brandschutzordnung)
+
+ Die Brandmelder sind nicht mit der Feuerwehr verbunden, daher ist
+ im Brandfall die Feuerwehr per Telefon zu rufen.
+ Fundgegenstände werden
+ beim Laboranten aufbewahrt Raum 4.08. Alle im Technikum Wien gefundenen
+ Sachen sind im Sekretariat abzugeben.
+ Der Konsum und die Lagerung von alkoholischen Getränken sind in der
+ gesamten Fachhochschule untersagt.
+ Von den Studenten wird erwartet, dass sie sich an den unter Punkt 4 genannten
+ Aufenthaltsorten diszipliniert verhalten.
+ Das Eigentum der Studenten ist schonend zu behandeln.
+ Sparsamkeit im Energieverbrauch erfordert unter anderem das Abschalten der
+ Beleuchtung bei ausreichendem Tageslicht und das Schliessen der Eingangstüren
+ während der kalten Jahreszeit.
Der Reinlichkeit und der
+ Hygiene ist in allen Belangen grösstes Augenmerk zu schenken. Waschbecken,
+ Duschen und WC-Muscheln sind nach deren Bentzung sofort vom Bentzer zu
+ säubern.
+ Im gesamten Technikum Wien, gilt: Zerbrochene Flaschen, ausgeschüttete
+ Getränke, Speise- und Verpackungsreste sind unverzüglich zu
+ beseitigen.
+ Auf Mülltrennung ist zu achten.
+
Es sind dabei die gesondert
+ aufgestellten Behälter zu benützen.
+ .
+ Studenten, die durch Wegwerfen von Verpackungsmaterial, Zigarettenresten
+ u.a. Verschmutzungen herbeiführen, können von Lehrkräften
+ und Angehörigen des Hauspersonals zum Entfernen dieser Gegenstände
+ angehalten werden.
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cis/public/info/verordnungen/hausordnung.pdf b/cis/public/info/verordnungen/hausordnung.pdf
new file mode 100644
index 000000000..cabd8f6c1
Binary files /dev/null and b/cis/public/info/verordnungen/hausordnung.pdf differ
diff --git a/cis/public/info/verordnungen/laborordnung.doc b/cis/public/info/verordnungen/laborordnung.doc
new file mode 100644
index 000000000..c7fea0623
Binary files /dev/null and b/cis/public/info/verordnungen/laborordnung.doc differ
diff --git a/cis/public/info/verordnungen/ressourcen.html b/cis/public/info/verordnungen/ressourcen.html
new file mode 100644
index 000000000..b59f0ef68
--- /dev/null
+++ b/cis/public/info/verordnungen/ressourcen.html
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Verordnungen
+ - Richtlinien für die Verwendung von FH EDV Ressourcen
+
+
+
+
+
+
+
+
Richtlinien
+ für die Verwendung von FH EDV Ressourcen
+
+ 1. Die EDV Ressourcen sind als Unterstützung des Studiums gedacht
+ und dürfen nur in diesem Zusammenhang benutzt werden.
+
+
+
+
+
+
+
+ 2. Eine Verwendung mit dem Ziel von illegalen Handlungen sowie der Versuch,
+ den unberechtigten Zugang zu Systemen, Software, Services oder Informationen
+ zu erlangen, sind unzulässig.
+
+
+
+
+
+
+ 3. Jede Nachrichtenübermittlung, welche die öffentliche Ordnung
+ und Sicherheit oder die Sittlichkeit gefährdet oder welche gegen
+ Gesetze verstößt (Fernmeldegesetz
+ in der derzeit gültigen Fassung), ist zu unterlassen.
+ 5. Kommerzielle Werbung und Nutzung der Systeme sind unzulässig.
+
+
+
+
+
+
+ 6. Die von der Systemverwaltung vergebene Benutzerkennung und das vom
+ Studenten selbst gewählte Kennwort sind geheim zu halten und dürfen
+ keinesfalls an andere Personen weitergegeben werden. Für Remotezugriffe
+ wird die Verwendung von verschlüsselten Protokollen empfohlen. Wenn
+ ein Passwort weitergegeben wird oder bei unverschlüsselten Verbindungen
+ durch dritte ausgelesen wird, haftet der Accountbesitzer für missbräuchliche
+ Verwendungen seines Accounts.
+
+
+
+
+
+
+ 7. Jeder Student hat sich bei Arbeitsbeginn mit der ihm zugewiesenen Benutzerkennung
+ anzumelden und nach Beendigung seiner Arbeiten wieder abzumelden. Je nach
+ den technischen Möglichkeiten werden die An- und Abmeldungen protokolliert.
+
+
+
+
+
+
+ 8. Essen, Trinken und Rauchen sind in den EDV-Sälen und Labors verboten.
+
+
+
+
+
+
+ 9. Bei auftretenden Problemen und/oder Schäden an Geräten oder
+ bei Softwarefehleren (auch Viren) ist die Systemverwaltung unverzüglich
+ zu verständigen. Dazu ist das Bug Report System der IT-S zu verwenden.
+
+
+
+
+
+
+ 10. Jeder Benutzer haftet für die von ihm in den EDV-Labors verursachten
+ Schäden (Geräte, Software, Einrichtung, Gebäude).
+
+
+
+
+
+
+ 11. Die installierte Software auf den Arbeitsstationen kann für Übungszwecke
+ genutzt werden. Es ist nicht gestattet, Kopien der installierten Software
+ anzufertigen. Weiteres ist es nicht gestattet, private Software auf den
+ Arbeitsstationen zu installieren und/oder auszuführen.
+
+
+
+
+
+
+ 12. Jeder Benutzer ist dafür verantwortlich, dass keine Viren auf
+ dem System eingeschleppt werden. Er ist daher verpflichtet, jede Diskette
+ vor Gebrauch auf Virenbefall zu untersuchen. Eine von einem Virus befallene
+ Diskette darf nicht verwendet werden.
+
+
+
+
+
+
+ 13. Nicht beachten eines dieser Punkte wird mit adäquaten Maßnahmen,
+ die bis zum Accountentzug reichen können geahndet.
+
+
+
+
+
+
+
+
+
+
diff --git a/cis/public/info/verordnungen/ressourcen.pdf b/cis/public/info/verordnungen/ressourcen.pdf
new file mode 100644
index 000000000..4ca52e345
Binary files /dev/null and b/cis/public/info/verordnungen/ressourcen.pdf differ
diff --git a/include/File/CSV.php b/include/File/CSV.php
new file mode 100644
index 000000000..c4c4d44ad
--- /dev/null
+++ b/include/File/CSV.php
@@ -0,0 +1,514 @@
+
+ * @author Helgi Þormar
+ * @copyright 2004-2005 The Authors
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version CVS: $Id: CSV.php,v 1.24 2005/08/09 08:16:02 dufuz Exp $
+ * @link http://pear.php.net/package/File
+ */
+
+require_once 'PEAR.php';
+require_once 'File.php';
+
+/**
+* File class for handling CSV files (Comma Separated Values), a common format
+* for exchanging data.
+*
+* TODO:
+* - Usage example and Doc
+* - Use getPointer() in discoverFormat
+* - Add a line counter for being able to output better error reports
+* - Store the last error in GLOBALS and add File_CSV::getLastError()
+*
+* Wish:
+* - Other methods like readAll(), writeAll(), numFields(), numRows()
+* - Try to detect if a CSV has header or not in discoverFormat()
+*
+* Known Bugs:
+* (they has been analyzed but for the moment the impact in the speed for
+* properly handle this uncommon cases is too high and won't be supported)
+* - A field which is composed only by a single quoted separator (ie -> ;";";)
+* is not handled properly
+* - When there is exactly one field minus than the expected number and there
+* is a field with a separator inside, the parser will throw the "wrong count" error
+*
+* @author Tomas V.V.Cox
+* @author Helgi Þormar
+* @package File
+*/
+class File_CSV
+{
+ /**
+ * This raiseError method works in a different way. It will always return
+ * false (an error occurred) but it will call PEAR::raiseError() before
+ * it. If no default PEAR global handler is set, will trigger an error.
+ *
+ * @param string $error The error message
+ * @return bool always false
+ */
+ function raiseError($error)
+ {
+ // If a default PEAR Error handler is not set trigger the error
+ // XXX Add a PEAR::isSetHandler() method?
+ if ($GLOBALS['_PEAR_default_error_mode'] == PEAR_ERROR_RETURN) {
+ PEAR::raiseError($error, null, PEAR_ERROR_TRIGGER, E_USER_WARNING);
+ } else {
+ PEAR::raiseError($error);
+ }
+ return false;
+ }
+
+ /**
+ * Checks the configuration given by the user
+ *
+ * @access private
+ * @param string &$error The error will be written here if any
+ * @param array &$conf The configuration assoc array
+ * @return string error Returns a error message
+ */
+ function _conf(&$error, &$conf)
+ {
+ // check conf
+ if (!is_array($conf)) {
+ return $error = 'Invalid configuration';
+ }
+
+ if (!isset($conf['fields']) || !is_numeric($conf['fields'])) {
+ return $error = 'The number of fields must be numeric (the "fields" key)';
+ }
+
+ if (isset($conf['sep'])) {
+ if (strlen($conf['sep']) != 1) {
+ return $error = 'Separator can only be one char';
+ }
+ } elseif ($conf['fields'] > 1) {
+ return $error = 'Missing separator (the "sep" key)';
+ }
+
+ if (isset($conf['quote'])) {
+ if (strlen($conf['quote']) != 1) {
+ return $error = 'The quote char must be one char (the "quote" key)';
+ }
+ } else {
+ $conf['quote'] = null;
+ }
+
+ if (!isset($conf['crlf'])) {
+ $conf['crlf'] = "\n";
+ }
+
+ if (!isset($conf['eol2unix'])) {
+ $conf['eol2unix'] = true;
+ }
+ }
+
+ /**
+ * Return or create the file descriptor associated with a file
+ *
+ * @param string $file The name of the file
+ * @param array &$conf The configuration
+ * @param string $mode The open node (ex: FILE_MODE_READ or FILE_MODE_WRITE)
+ * @param boolean $reset if passed as true and resource for the file exists
+ * than the file pointer will be moved to the beginning
+ *
+ * @return mixed A file resource or false
+ */
+ function getPointer($file, &$conf, $mode = FILE_MODE_READ, $reset = false)
+ {
+ static $resources = array();
+ static $config;
+ if (isset($resources[$file])) {
+ $conf = $config;
+ if ($reset) {
+ fseek($resources[$file], 0);
+ }
+ return $resources[$file];
+ }
+ File_CSV::_conf($error, $conf);
+ if ($error) {
+ return File_CSV::raiseError($error);
+ }
+ $config = $conf;
+ PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
+ $fp = &File::_getFilePointer($file, $mode);
+ PEAR::popErrorHandling();
+ if (PEAR::isError($fp)) {
+ return File_CSV::raiseError($fp);
+ }
+ $resources[$file] = $fp;
+
+ if ($mode == FILE_MODE_READ && !empty($conf['header'])) {
+ if (!File_CSV::read($file, $conf)) {
+ return false;
+ }
+ }
+ return $fp;
+ }
+
+ /**
+ * Unquote data
+ *
+ * @param string $field The data to unquote
+ * @param string $quote The quote char
+ * @return string the unquoted data
+ */
+ function unquote($field, $quote)
+ {
+ // Trim first the string.
+ $field = trim($field);
+ $quote = trim($quote);
+
+ // Incase null fields (form: ;;)
+ if (!strlen($field)) {
+ return $field;
+ }
+
+ if ($quote && $field{0} == $quote && $field{strlen($field)-1} == $quote) {
+ return substr($field, 1, -1);
+ }
+ return $field;
+ }
+
+ /**
+ * Reads a row of data as an array from a CSV file. It's able to
+ * read memo fields with multiline data.
+ *
+ * @param string $file The filename where to write the data
+ * @param array &$conf The configuration of the dest CSV
+ *
+ * @return mixed Array with the data read or false on error/no more data
+ */
+ function readQuoted($file, &$conf)
+ {
+ if (!$fp = File_CSV::getPointer($file, $conf, FILE_MODE_READ)) {
+ return false;
+ }
+
+ $buff = $c = '';
+ $ret = array();
+ $i = 1;
+ $in_quote = false;
+ $quote = $conf['quote'];
+ $f = $conf['fields'];
+ $eol2unix = $conf['eol2unix'];
+ while (($ch = fgetc($fp)) !== false) {
+ $prev = $c;
+ $c = $ch;
+ // Common case
+ if ($c != $quote && $c != $conf['sep'] && $c != "\n" && $c != "\r") {
+ $buff .= $c;
+ continue;
+ }
+
+ // Start quote.
+ if ($quote && $c == $quote &&
+ ($prev == $conf['sep'] || $prev == "\n" || $prev === null ||
+ $prev == "\r" || $prev == ''))
+ {
+ $in_quote = true;
+ }
+
+ if ($in_quote) {
+ // When ends quote
+ if ($c == $conf['sep'] && $prev == $conf['quote']) {
+ $in_quote = false;
+ } elseif ($c == "\n" || $c == "\r") {
+ $sub = ($prev == "\r") ? 2 : 1;
+ if ((strlen($buff) >= $sub) &&
+ ($buff{strlen($buff) - $sub} == $quote))
+ {
+ $in_quote = false;
+ }
+ }
+ }
+
+ if (!$in_quote && ($c == $conf['sep'] || $c == "\n" || $c == "\r") && $prev != '') {
+ // More fields than expected
+ if (($c == $conf['sep']) && ((count($ret) + 1) == $f)) {
+ // Seek the pointer into linebreak character.
+ while (true) {
+ $c = fgetc($fp);
+ if ($c == "\n" || $c == "\r") {
+ break;
+ }
+ }
+
+ // Insert last field value.
+ $ret[] = File_CSV::unquote($buff, $quote);
+ return $ret;
+ }
+
+ // Less fields than expected
+ if (($c == "\n" || $c == "\r") && ($i != $f)) {
+ // Insert last field value.
+ $ret[] = File_CSV::unquote($buff, $quote);
+
+ // Pair the array elements to fields count.
+ return array_merge($ret,
+ array_fill(count($ret),
+ ($f - 1) - (count($ret) - 1),
+ '')
+ );
+ }
+
+ if ($prev == "\r") {
+ $buff = substr($buff, 0, -1);
+ }
+
+ // Convert EOL character to Unix EOL (LF).
+ if ($eol2unix) {
+ $buff = preg_replace('/(\r\n|\r)$/', "\n", $buff);
+ }
+
+ $ret[] = File_CSV::unquote($buff, $quote);
+ if (count($ret) == $f) {
+ return $ret;
+ }
+ $buff = '';
+ $i++;
+ continue;
+ }
+ $buff .= $c;
+ }
+ return !feof($fp) ? $ret : false;
+ }
+
+ /**
+ * Reads a "row" from a CSV file and return it as an array
+ *
+ * @param string $file The CSV file
+ * @param array &$conf The configuration of the dest CSV
+ *
+ * @return mixed Array or false
+ */
+ function read($file, &$conf)
+ {
+ if (!$fp = File_CSV::getPointer($file, $conf, FILE_MODE_READ)) {
+ return false;
+ }
+ // The size is limited to 4K
+ if (!$line = fgets($fp, 4096)) {
+ return false;
+ }
+
+ $fields = $conf['fields'] == 1 ? array($line) : explode($conf['sep'], $line);
+
+ if ($conf['quote']) {
+ $last =& $fields[count($fields) - 1];
+ // Fallback to read the line with readQuoted when guess
+ // that the simple explode won't work right
+ if (($last{strlen($last) - 1} == "\n"
+ && $last{0} == $conf['quote']
+ && $last{strlen(rtrim($last)) - 1} != $conf['quote'])
+ ||
+ (count($fields) != $conf['fields'])
+ // XXX perhaps there is a separator inside a quoted field
+ //preg_match("|{$conf['quote']}.*{$conf['sep']}.*{$conf['quote']}|U", $line)
+ )
+ {
+ fseek($fp, -1 * strlen($line), SEEK_CUR);
+ return File_CSV::readQuoted($file, $conf);
+ } else {
+ $last = rtrim($last);
+ foreach ($fields as $k => $v) {
+ $fields[$k] = File_CSV::unquote($v, $conf['quote']);
+ }
+ }
+ }
+
+ if (count($fields) != $conf['fields']) {
+ File_CSV::raiseError("Read wrong fields number count: '". count($fields) .
+ "' expected ".$conf['fields']);
+ return true;
+ }
+ return $fields;
+ }
+
+ /**
+ * Internal use only, will be removed in the future
+ *
+ * @param string $str The string to debug
+ * @access private
+ */
+ function _dbgBuff($str)
+ {
+ if (strpos($str, "\r") !== false) {
+ $str = str_replace("\r", "_r_", $str);
+ }
+ if (strpos($str, "\n") !== false) {
+ $str = str_replace("\n", "_n_", $str);
+ }
+ if (strpos($str, "\t") !== false) {
+ $str = str_replace("\t", "_t_", $str);
+ }
+ echo "buff: ($str)\n";
+ }
+
+ /**
+ * Writes a struc (array) in a file as CSV
+ *
+ * @param string $file The filename where to write the data
+ * @param array $fields Ordered array with the data
+ * @param array &$conf The configuration of the dest CSV
+ *
+ * @return bool True on success false otherwise
+ */
+ function write($file, $fields, &$conf)
+ {
+ if (!$fp = File_CSV::getPointer($file, $conf, FILE_MODE_WRITE)) {
+ return false;
+ }
+ if (count($fields) != $conf['fields']) {
+ File_CSV::raiseError("Wrong fields number count: '". count($fields) .
+ "' expected ".$conf['fields']);
+ return true;
+ }
+ $write = '';
+ for ($i = 0; $i < count($fields); $i++) {
+ if (!is_numeric($fields[$i]) && $conf['quote']) {
+ $write .= $conf['quote'] . $fields[$i] . $conf['quote'];
+ } else {
+ $write .= $fields[$i];
+ }
+ if ($i < (count($fields) - 1)) {
+ $write .= $conf['sep'];
+ } else {
+ $write .= $conf['crlf'];
+ }
+ }
+ if (!fwrite($fp, $write)) {
+ return File_CSV::raiseError('Can not write to file');
+ }
+ return true;
+ }
+
+ /**
+ * Discover the format of a CSV file (the number of fields, the separator
+ * and if it quote string fields)
+ *
+ * @param string the CSV file name
+ * @param array extra separators that should be checked for.
+ * @return mixed Assoc array or false
+ */
+ function discoverFormat($file, $extraSeps = array())
+ {
+ if (!$fp = @fopen($file, 'r')) {
+ return File_CSV::raiseError("Could not open file: $file");
+ }
+ $seps = array("\t", ';', ':', ',');
+ $seps = array_merge($seps, $extraSeps);
+ $matches = array();
+
+ // Set auto detect line ending for Mac EOL support if < PHP 4.3.0.
+ $phpver = version_compare('4.3.0', phpversion(), '<');
+ if ($phpver) {
+ $oldini = ini_get('auto_detect_line_endings');
+ ini_set('auto_detect_line_endings', '1');
+ }
+
+ // Take the first 10 lines and store the number of ocurrences
+ // for each separator in each line
+
+ $lines = file($file);
+ if (count($lines) > 10) {
+ $lines = array_slice($lines, 0, 10);
+ }
+
+ if ($phpver) {
+ ini_set('auto_detect_line_endings', $oldini);
+ }
+
+ foreach ($lines as $line) {
+ foreach ($seps as $sep) {
+ $matches[$sep][] = substr_count($line, $sep);
+ }
+ }
+
+ $final = array();
+ // Group the results by amount of equal ocurrences
+ foreach ($matches as $sep => $res) {
+ $times = array();
+ $times[0] = 0;
+ foreach ($res as $k => $num) {
+ if ($num > 0) {
+ $times[$num] = (isset($times[$num])) ? $times[$num] + 1 : 1;
+ }
+ }
+ arsort($times);
+
+ // Use max fields count.
+ $fields[$sep] = max(array_flip($times));
+ $amount[$sep] = $times[key($times)];
+ }
+
+ arsort($amount);
+ $sep = key($amount);
+
+ $conf['fields'] = $fields[$sep] + 1;
+ $conf['sep'] = $sep;
+
+ // Test if there are fields with quotes arround in the first 5 lines
+ $quotes = '"\'';
+ $quote = null;
+ if (count($lines) > 5) {
+ $lines = array_slice($lines, 0, 5);
+ }
+
+ foreach ($lines as $line) {
+ if (preg_match("|$sep([$quotes]).*([$quotes])$sep|U", $line, $match)) {
+ if ($match[1] == $match[2]) {
+ $quote = $match[1];
+ break;
+ }
+ }
+ if (preg_match("|^([$quotes]).*([$quotes])$sep{0,1}|", $line, $match)
+ || preg_match("|([$quotes]).*([$quotes])$sep\s$|Us", $line, $match))
+ {
+ if ($match[1] == $match[2]) {
+ $quote = $match[1];
+ break;
+ }
+ }
+ }
+ $conf['quote'] = $quote;
+ fclose($fp);
+ // XXX What about trying to discover the "header"?
+ return $conf;
+ }
+
+ /**
+ * Front to call getPointer and moving the resource to the
+ * beginning of the file
+ * Reset it if you like.
+ *
+ * @param string $file The name of the file
+ * @param array &$conf The configuration
+ * @param string $mode The open node (ex: FILE_MODE_READ or FILE_MODE_WRITE)
+ *
+ * @return boolean true on success false on failure
+ */
+ function resetPointer($file, &$conf, $mode)
+ {
+ if (!File_CSV::getPointer($file, $conf, $mode, true)) {
+ return false;
+ }
+
+ return true;
+ }
+}
+?>
\ No newline at end of file
diff --git a/include/File/Find.php b/include/File/Find.php
new file mode 100644
index 000000000..060da3a19
--- /dev/null
+++ b/include/File/Find.php
@@ -0,0 +1,269 @@
+ |
+// +----------------------------------------------------------------------+
+//
+// $Id: Find.php,v 1.14.2.3 2001/11/13 01:26:45 ssb Exp $
+//
+
+require_once 'PEAR.php';
+
+/**
+* Commonly needed functions searching directory trees
+*
+* @access public
+* @version $Id: Find.php,v 1.14.2.3 2001/11/13 01:26:45 ssb Exp $
+* @package File
+* @author Sterling Hughes
+*/
+class File_Find
+{
+ /**
+ * internal dir-list
+ * @var array
+ */
+ var $_dirs = array ();
+ /**
+ * founded files
+ * @var array
+ */
+ var $files = array ();
+ /**
+ * founded dirs
+ * @var array
+ */
+ var $directories = array ();
+
+ /**
+ * Search the current directory to find matches for the
+ * the specified pattern.
+ *
+ * @param string $pattern a string containing the pattern to search
+ * the directory for.
+ *
+ * @param string $direct_path a string containing the directory path
+ * to search.
+ *
+ * @param string $pattern_type a string containing the type of
+ * pattern matching functions to use (can either be 'php' or
+ * 'perl').
+ *
+ * @return array containing all of the files and directories
+ * matching the pattern or null if no matches
+ *
+ * @author Sterling Hughes
+ * @access public
+ */
+ function &glob ($pattern, $dirpath, $pattern_type='php')
+ {
+ $dh = @opendir ($dirpath);
+
+ if (!$dh) {
+ $pe = new FileFindException("Cannot open directory");
+ return ($pe);
+ }
+
+ $match_function = File_Find::_determineRegex($pattern, $pattern_type);
+ $matches = array();
+ while ($entry = @readdir ($dh)) {
+ if ($match_function($pattern, $entry) &&
+ $entry != '.' &&
+ $entry != '..') {
+ $matches[] = $entry;
+ }
+ }
+
+ @closedir ($dh);
+ return count($matches) > 0 ? $matches : null;
+ }
+
+ /**
+ * Map the directory tree given by the directory_path parameter.
+ *
+ * @param string $directory_path contains the directory path that you
+ * want to map.
+ *
+ * @return array a two element array, the first element containing a list
+ * of all the directories, the second element containing a list of all the
+ * files.
+ *
+ * @author Sterling Hughes
+ * @access public
+ */
+ function &maptree ($directory)
+ {
+ $this->_dirs = array($directory);
+
+ while (count($this->_dirs)) {
+ $dir = array_pop($this->_dirs);
+ File_Find::_build($dir);
+ array_push($this->directories, $dir);
+ }
+
+ return array($this->directories, $this->files);
+ }
+
+ /**
+ * Search the specified directory tree with the specified pattern. Return an
+ * array containing all matching files (no directories included).
+ *
+ * @param string $pattern the pattern to match every file with.
+ *
+ * @param string $directory the directory tree to search in.
+ *
+ * @param string $regex_type the type of regular expression support to use, either
+ * 'php' or 'perl'.
+ *
+ * @return array a list of files matching the pattern parameter in the the directory
+ * path specified by the directory parameter
+ *
+ * @author Sterling Hughes
+ * @access public
+ */
+ function &search ($pattern, $directory, $type='php') {
+ list (,$files) = File_Find::maptree($directory);
+ $match_function = File_Find::_determineRegex($pattern, $type);
+
+ reset($files);
+ while (list(,$entry) = each($files)) {
+ if ($match_function($pattern, $entry))
+ $matches[] = $entry;
+ }
+
+ return ($matches);
+ }
+ /**
+ * Determine whether or not a variable is a PEAR exception
+ *
+ * @param object PEAR_Error $var the variable to test.
+ *
+ * @return boolean returns true if the variable is a PEAR error, otherwise
+ * it returns false.
+ * @access public
+ */
+ function isError (&$var)
+ {
+ return PEAR::isError($var);
+ }
+
+ /**
+ * Fetch the current File_Find version
+ *
+ * @return string the current File_Find version.
+ * @access public
+ */
+ function File_Find_version()
+ {
+ return 1.1;
+ }
+ /**
+ * internal function to build singular directory trees, used by
+ * File_Find::maptree()
+ *
+ * @param string $directory name of the directory to read
+ * @return void
+ */
+ function _build ($directory)
+ {
+ $dh = @opendir ($directory);
+
+ if (!$dh) {
+ $pe = new FileFindException("Cannot open directory");
+ return $pe;
+ }
+
+ while ($entry = @readdir($dh)) {
+ if ($entry != '.' &&
+ $entry != '..') {
+
+ $entry = "$directory/$entry";
+
+ if (is_dir($entry))
+ array_push($this->_dirs, $entry);
+ else
+ array_push($this->files, $entry);
+
+ }
+
+ }
+
+ @closedir($dh);
+ }
+
+ /**
+ * internal function to determine the type of regular expression to
+ * use, implemented by File_Find::glob() and File_Find::search()
+ *
+ * @param string $type given RegExp type
+ * @return string kind of function ( "eregi", "ereg" or "preg_match") ;
+ *
+ */
+ function _determineRegex ($pattern, $type)
+ {
+ if (! strcasecmp($type, 'perl')) {
+ $match_function = 'preg_match';
+ } else if (! strcasecmp(substr($pattern, -2), '/i')) {
+ $match_function = 'eregi';
+ } else {
+ $match_function = 'ereg';
+ }
+
+ return $match_function;
+ }
+
+//End Class
+}
+/**
+* Exception Class for Errorhandling of File_Find
+* @access public
+*/
+class FileFindException extends PEAR_Error
+{
+ /**
+ * classname
+ * @var string
+ */
+ var $classname = 'FileFindException';
+ /**
+ * Message in front of the error message
+ * @var string
+ */
+ var $error_message_prepend = 'Error in File_Find';
+ /**
+ * Creates a PEAR_Error object
+ *
+ * @param string $message Error message
+ * @param int $mode Error mode
+ * @param int $level Error level
+ *
+ * @return object PEAR_Error
+ * @access public
+ */
+ function FileFindException ($message, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE)
+ {
+ $this->PEAR_Error($message, $mode, $level);
+ }
+}
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>
diff --git a/include/File/Match.php b/include/File/Match.php
new file mode 100644
index 000000000..cc9817ff3
--- /dev/null
+++ b/include/File/Match.php
@@ -0,0 +1,454 @@
+ |
+// +----------------------------------------------------------------------+
+//
+// $Id: Match.php,v 1.2 2001/07/22 14:38:15 mj Exp $
+//
+// Text Match Utility
+//
+
+/**
+ * Match Utility
+ *
+ * See http://www.sensimillian.com/docs/FILE/Match.php/ for full tar/zip
+ * including example file.
+ *
+ * @author Maximilian Schremser
+ * @version 1.0
+ * @package File
+ */
+class File_Match
+{
+
+ // {{{ Properties (All private)
+
+ var $find;
+ var $files;
+ var $directories;
+ var $include_subdir;
+ var $ignore_lines;
+ var $ignore_sep;
+ var $occurences;
+ var $find_function;
+ var $last_error;
+ var $match;
+
+ // }}}
+ // {{{ Constructor
+
+ /**
+ * Sets up the object
+ *
+ * @access public
+ * @param string $find The string/regex to find.
+ * @param array $files The file(s) to perform this operation on.
+ * @param array $directories (optional) The directories to perform this operation on.
+ * @param int $include_subdir If performing on directories, whether to traverse subdirectories.
+ * @param array $ignore_lines Ignore lines beginning with any of the strings in this array. This
+ * feature only works with the "normal" search.
+ *
+ */
+ function File_Match($find, $files, $directories = '', $include_subdir = 1, $ignore_lines = array())
+ {
+
+ $this->find = $find;
+ $this->files = $files;
+ $this->directories = $directories;
+ $this->include_subdir = $include_subdir;
+ $this->ignore_lines = $ignore_lines;
+
+ $this->occurences = 0;
+ $this->find_function = 'pregSearch';
+ $this->last_error = '';
+ $this->match = '';
+
+ }
+
+ // }}}
+ // {{{ getNumOccurences()
+
+ /**
+ * Accessor to return the number of occurences found.
+ *
+ * @access public
+ * @return int Number of occurences found.
+ *
+ * @author Richard Heyes
+ */
+ function getNumOccurences()
+ {
+ return $this->occurences;
+ }
+
+ // }}}
+ // {{{ getLastError()
+
+ /**
+ * Accessor for retrieving last error.
+ *
+ * @access public
+ * @return string The last error that occurred, if any.
+ *
+ * @author Richard Heyes
+ */
+ function getLastError()
+ {
+ return $this->last_error;
+ }
+
+ // }}}
+ // {{{ setFind()
+
+ /**
+ * Accessor for setting find variable.
+ *
+ * @access public
+ * @param string $find The string/regex to find.
+ *
+ * @author Richard Heyes
+ */
+ function setFind($find)
+ {
+ $this->find = $find;
+ }
+
+ // }}}
+ // {{{ setFiles()
+
+ /**
+ * Accessor for setting files variable.
+ *
+ * @access public
+ * @param array $files The file(s) to perform this operation on.
+ *
+ * @author Richard Heyes
+ */
+ function setFiles($files)
+ {
+ $this->files = $files;
+ }
+
+ // }}}
+ // {{{ setDirectories()
+
+ /**
+ * Accessor for setting directories variable.
+ *
+ * @access public
+ * @param array $directories The directories to perform this operation on.
+ *
+ * @author Richard Heyes
+ */
+ function setDirectories($directories)
+ {
+ $this->directories = $directories;
+ }
+
+ // }}}
+ // {{{ setIncludeSubdir
+
+ /**
+ * Accessor for setting include_subdir variable.
+ *
+ * @access public
+ * @param int $include_subdir Whether to traverse subdirectories or not.
+ *
+ * @author Richard Heyes
+ */
+ function setIncludeSubdir($include_subdir)
+ {
+ $this->include_subdir = $include_subdir;
+ }
+
+ // }}}
+ // {{{ setIgnoreLines()
+
+ /**
+ * Accessor for setting ignore_lines variable.
+ *
+ * @access public
+ * @param array $ignore_lines Ignore lines beginning with any of the strings in this array. This
+ * feature only works with the "normal" search.
+ *
+ * @author Richard Heyes
+ */
+ function setIgnoreLines($ignore_lines)
+ {
+ $this->ignore_lines = $ignore_lines;
+ }
+
+ // }}}
+ // {{{ setFindFunction()
+
+ /**
+ * Function to determine which search function is used.
+ *
+ * @access public
+ * @param string The search function that should be used. Can be any one of:
+ * normal - Default search. Goes line by line. Ignore lines feature only works with this type.
+ * quick - Uses str_replace for straight replacement throughout file. Quickest of the lot.
+ * preg - Uses preg_replace(), so any regex valid with this function is valid here.
+ * ereg - Uses ereg_replace(), so any regex valid with this function is valid here.
+ *
+ * @author Richard Heyes
+ */
+ function setFindFunction($find_function)
+ {
+ // bis jetzt nur pregSearch definiert
+ switch($find_function) {
+ case 'normal': $this->find_function = 'find';
+ return TRUE;
+ break;
+ case 'quick' : $this->find_function = 'quickSearch';
+ return TRUE;
+ break;
+
+ case 'preg' : $this->find_function = 'pregSearch';
+ return TRUE;
+ break;
+
+ case 'ereg' : $this->find_function = 'eregSearch';
+ return TRUE;
+ break;
+ default : $this->last_error = 'Invalid search function specified';
+ return FALSE;
+ break;
+ }
+ }
+
+ // }}}
+ // {{{ find()
+
+ /**
+ * Default ("normal") search routine.
+ *
+ * @access private
+ * @param string $filename The filename to search and replace upon.
+ * @return array Will return an array containing the new file contents and the number of occurences.
+ * Will return FALSE if there are no occurences.
+ *
+ * @author Richard Heyes
+ */
+ function find($filename)
+ {
+
+ $occurences = 0;
+ $file_array = file($filename);
+
+ for ($i=0; $iignore_lines) > 0) {
+ for ($j=0; $jignore_lines); $j++) {
+ if (substr($file_array[$i],0,strlen($this->ignore_lines[$j])) == $this->ignore_lines[$j]) continue 2;
+ }
+ }
+
+ $occurences += count(explode($this->find, $file_array[$i])) - 1;
+ $file_array[$i] = str_replace($this->find, $this->replace, $file_array[$i]);
+ }
+ if ($occurences > 0) $return = array($occurences, implode('', $file_array)); else $return = FALSE;
+ return $return;
+
+ }
+
+ // }}}
+ // {{{ quickSearch()
+
+ /**
+ * Quick search routine.
+ *
+ * @access private
+ * @param string $filename The filename to search and replace upon.
+ * @return array Will return an array containing the new file contents and the number of occurences.
+ * Will return FALSE if there are no occurences.
+ *
+ * @author Richard Heyes
+ */
+ function quickSearch($filename)
+ {
+
+ clearstatcache();
+
+ $file = fread($fp = fopen($filename, 'r'), filesize($filename)); fclose($fp);
+ $occurences = count(explode($this->find, $file)) - 1;
+ $file = str_replace($this->find, $this->replace, $file);
+
+ if ($occurences > 0) $return = array($occurences, $file); else $return = FALSE;
+ return $return;
+
+ }
+
+ // }}}
+ // {{{ pregSearch()
+
+ /**
+ * Preg search routine.
+ *
+ * @access private
+ * @param string $filename The filename to search and replace upon.
+ * Will return FALSE if there are no occurences.
+ *
+ * @author Maximilian Schremser
+ */
+ function pregSearch($filename)
+ {
+ clearstatcache();
+
+ $file = fread($fp = fopen($filename, 'r'), filesize($filename));
+ fclose($fp);
+ $this->occurences = preg_match($this->find, $file, $this->match);
+ }
+
+ // }}}
+ // {{{ eregSearch()
+
+ /**
+ * Ereg search routine.
+ *
+ * @access private
+ * @param string $filename The filename to search and replace upon.
+ * @return array Will return an array containing the new file contents and the number of occurences.
+ * Will return FALSE if there are no occurences.
+ *
+ * @author Richard Heyes
+ */
+ function eregSearch($filename)
+ {
+
+ clearstatcache();
+
+ $file = fread($fp = fopen($filename, 'r'), filesize($filename)); fclose($fp);
+
+ $occurences = count($matches = split($this->find, $file)) -1;
+ $file = ereg_replace($this->find, $this->replace, $file);
+
+ if ($occurences > 0) $return = array($occurences, $file); else $return = FALSE;
+ return $return;
+
+ }
+
+ // }}}
+ // {{{ writeout()
+
+ /**
+ * Function to writeout the file contents.
+ *
+ * @access private
+ * @param string $filename The filename of the file to write.
+ * @param string $contents The contents to write to the file.
+ *
+ * @author Richard Heyes
+ */
+ function writeout($filename, $contents)
+ {
+
+ if ($fp = @fopen($filename, 'w')) {
+ flock($fp,2);
+ fwrite($fp, $contents);
+ flock($fp,3);
+ fclose($fp);
+ } else {
+ $this->last_error = 'Could not open file: '.$filename;
+ }
+
+ }
+
+ // }}}
+ // {{{ doFiles()
+
+ /**
+ * Function called by doFind() to go through any files that need searching.
+ *
+ * @access private
+ * @param string $ser_func The search function to use.
+ *
+ * @author Richard Heyes
+ */
+ function doFiles($ser_func)
+ {
+ if (!is_array($this->files)) $this->files = explode(',', $this->files);
+ for ($i=0; $ifiles); $i++) {
+ if ($this->files[$i] == '.' OR $this->files[$i] == '..') continue;
+ if (is_dir($this->files[$i]) == TRUE) continue;
+ $newfile = $this->$ser_func($this->files[$i]);
+ if (is_array($newfile) == TRUE){
+ $this->writeout($this->files[$i], $newfile[1]);
+ $this->occurences += $newfile[0];
+ }
+ }
+ }
+
+ // }}}
+ // {{{ doDirectories()
+
+ /**
+ * Function called by doFind() to go through any directories that need searching.
+ *
+ * @access private
+ * @param string $ser_func The search function to use.
+ *
+ * @author Richard Heyes
+ */
+ function doDirectories($ser_func)
+ {
+ if (!is_array($this->directories)) $this->directories = explode(',', $this->directories);
+ for ($i=0; $idirectories); $i++) {
+ $dh = opendir($this->directories[$i]);
+ while ($file = readdir($dh)) {
+ if ($file == '.' OR $file == '..') continue;
+
+ if (is_dir($this->directories[$i].$file) == TRUE) {
+ if ($this->include_subdir == 1) {
+ $this->directories[] = $this->directories[$i].$file.'/';
+ continue;
+ } else {
+ continue;
+ }
+ }
+
+ $newfile = $this->$ser_func($this->directories[$i].$file);
+ if (is_array($newfile) == TRUE) {
+ $this->writeout($this->directories[$i].$file, $newfile[1]);
+ $this->occurences += $newfile[0];
+ }
+ }
+ }
+ }
+
+ // }}}
+ // {{{ doFind()
+
+ /**
+ * This starts the search/replace off. Call this to do the search.
+ * First do whatever files are specified, and/or if directories are specified,
+ * do those too.
+ *
+ * @access public
+ *
+ * @author Richard Heyes
+ */
+ function doFind()
+ {
+ if ($this->find != '') {
+ if ((is_array($this->files) AND count($this->files) > 0) OR $this->files != '') $this->doFiles($this->find_function);
+ if ($this->directories != '') $this->doDirectories($this->find_function);
+ }
+ }
+
+ // }}}
+
+}
+?>
diff --git a/include/File/Passwd.php b/include/File/Passwd.php
new file mode 100644
index 000000000..eac9c7b02
--- /dev/null
+++ b/include/File/Passwd.php
@@ -0,0 +1,208 @@
+ |
+// +----------------------------------------------------------------------+
+//
+// $Id: Passwd.php,v 1.4 2001/07/13 17:56:50 mj Exp $
+//
+// Manipulate standard UNIX passwd,.htpasswd and CVS pserver passwd files
+
+require_once 'PEAR.php' ;
+
+/**
+* Class to manage passwd-style files
+*
+* @author Rasmus Lerdorf
+*/
+class File_Passwd {
+
+ /**
+ * Passwd file
+ * @var string
+ */
+ var $filename ;
+
+ /**
+ * Hash list of users
+ * @var array
+ */
+ var $users ;
+
+ /**
+ * hash list of csv-users
+ * @var array
+ */
+ var $cvs ;
+
+ /**
+ * filehandle for lockfile
+ * @var int
+ */
+ var $fplock ;
+
+ /**
+ * locking state
+ * @var boolean
+ */
+ var $locked ;
+
+ /**
+ * name of the lockfile
+ * @var string
+ */
+ var $lockfile = './passwd.lock';
+
+ /**
+ * Constructor
+ * Requires the name of the passwd file. This functions opens the file and read it.
+ * Changes to this file will written first in the lock file, so it is still possible
+ * to access the passwd file by another programs. The lock parameter controls the locking
+ * oft the lockfile, not of the passwd file! ( Swapping $lock and $lockfile would
+ * breaks bc to v1.3 and smaller).
+ * Don't forget to call close() to save changes!
+ *
+ * @param $file name of the passwd file
+ * @param $lock if 'true' $lockfile will be locked
+ * @param $lockfile name of the temp file, where changes are saved
+ *
+ * @access public
+ * @see close()
+ */
+
+ function File_Passwd($file, $lock=0, $lockfile="") {
+ $this->filename = $file;
+ if( !empty( $lockfile) ) {
+ $this->lockfile = $lockfile ;
+ }
+
+ $this->fplock = fopen($this->lockfile, 'w');
+ if($lock) {
+ flock($this->fplock, LOCK_EX);
+ $this->locked = true;
+ }
+
+ $fp = fopen($file,'r') ;
+ if( !$fp) {
+ return new PEAR_Error( "Couldn't open '$file'!", 1, PEAR_ERROR_RETURN) ;
+ }
+ while(!feof($fp)) {
+ $line = fgets($fp, 128);
+ list($user,$pass,$cvsuser) = explode(':',$line);
+ if(strlen($user)) {
+ $this->users[$user] = $pass;
+ $this->cvs[$user] = trim($cvsuser);
+ }
+ }
+ fclose($fp);
+ } // end func File_Passwd()
+
+ /**
+ * Adds a user
+ *
+ * @param $user new user id
+ * @param $pass password for new user
+ * @param $cvs cvs user id (needed for pserver passwd files)
+ *
+ * @return mixed returns PEAR_Error, if the user already exists
+ * @access public
+ */
+ function addUser($user,$pass,$cvsuser="") {
+ if(!isset($this->users[$user]) && $this->locked) {
+ $this->users[$user] = crypt($pass);
+ $this->cvs[$user] = $cvsuser;
+ return true;
+ } else {
+ return new PEAR_Error( "Couldn't add user '$user', because the user already exists!", 2, PEAR_ERROR_RETURN) ;
+ }
+ } // end func addUser()
+
+ /**
+ * Modifies a user
+ *
+ * @param $user user id
+ * @param $pass new password for user
+ * @param $cvs cvs user id (needed for pserver passwd files)
+ *
+ * @return mixed returns PEAR_Error, if the user doesn't exists
+ * @access public
+ */
+
+ function modUser($user,$pass,$cvsuser="") {
+ if(isset($this->users[$user]) && $this->locked) {
+ $this->users[$user] = crypt($pass);
+ $this->cvs[$user] = $cvsuser;
+ return true;
+ } else {
+ return new PEAR_Error( "Couldn't modify user '$user', because the user doesn't exists!", 3, PEAR_ERROR_RETURN) ;
+ }
+ } // end func modUser()
+
+ /**
+ * Deletes a user
+ *
+ * @param $user user id
+ *
+ * @return mixed returns PEAR_Error, if the user doesn't exists
+ * @access public
+ */
+
+ function delUser($user) {
+ if(isset($this->users[$user]) && $this->locked) {
+ unset($this->users[$user]);
+ unset($this->cvs[$user]);
+ } else {
+ return new PEAR_Error( "Couldn't delete user '$user', because the user doesn't exists!", 3, PEAR_ERROR_RETURN) ;
+ }
+ } // end func delUser()
+
+ /**
+ * Verifies a user's password
+ *
+ * @param $user user id
+ * @param $pass password for user
+ *
+ * @return boolean true if password is ok
+ * @access public
+ */
+ function verifyPassword($user,$pass) {
+ if(isset($this->users[$user])) {
+ if($this->users[$user] == crypt($pass,substr($this->users[$user],0,2))) return true;
+ }
+ return false;
+ } // end func verifyPassword()
+
+ /**
+ * Writes changes to passwd file and unlocks it
+ *
+ * @access public
+ */
+ function close() {
+ if($this->locked) {
+ foreach($this->users as $user => $pass) {
+ if($this->cvs[$user]) {
+ fputs($this->fplock, "$user:$pass:".$this->cvs[$user]."\n");
+ } else {
+ fputs($this->fplock, "$user:$pass\n");
+ }
+ }
+ rename($this->lockfile,$this->filename);
+ flock($this->fplock, LOCK_UN);
+ $this->locked = false;
+ fclose($this->fplock);
+ }
+ } // end func close()
+}
+?>
diff --git a/include/File/SearchReplace.php b/include/File/SearchReplace.php
new file mode 100644
index 000000000..cc11e7562
--- /dev/null
+++ b/include/File/SearchReplace.php
@@ -0,0 +1,479 @@
+ |
+// +----------------------------------------------------------------------+
+//
+// $Id: SearchReplace.php,v 1.2 2001/07/22 14:38:15 mj Exp $
+//
+// Search and Replace Utility
+//
+
+/**
+ * Search and Replace Utility
+ *
+ * See http://www.heyes-computing.net/scripts/ for full tar/zip
+ * including example file.
+ *
+ * @author Richard Heyes
+ * @version 1.0
+ * @package File
+ */
+class File_SearchReplace
+{
+
+ // {{{ Properties (All private)
+
+ var $find;
+ var $replace;
+ var $files;
+ var $directories;
+ var $include_subdir;
+ var $ignore_lines;
+ var $ignore_sep;
+ var $occurences;
+ var $search_function;
+ var $last_error;
+
+ // }}}
+ // {{{ Constructor
+
+ /**
+ * Sets up the object
+ *
+ * @access public
+ * @param string $find The string/regex to find.
+ * @param string $replace The string/regex to replace $find with.
+ * @param array $files The file(s) to perform this operation on.
+ * @param array $directories (optional) The directories to perform this operation on.
+ * @param int $include_subdir If performing on directories, whether to traverse subdirectories.
+ * @param array $ignore_lines Ignore lines beginning with any of the strings in this array. This
+ * feature only works with the "normal" search.
+ *
+ * @author Richard Heyes
+ */
+ function File_SearchReplace($find, $replace, $files, $directories = '', $include_subdir = 1, $ignore_lines = array())
+ {
+
+ $this->find = $find;
+ $this->replace = $replace;
+ $this->files = $files;
+ $this->directories = $directories;
+ $this->include_subdir = $include_subdir;
+ $this->ignore_lines = $ignore_lines;
+
+ $this->occurences = 0;
+ $this->search_function = 'search';
+ $this->last_error = '';
+
+ }
+
+ // }}}
+ // {{{ getNumOccurences()
+
+ /**
+ * Accessor to return the number of occurences found.
+ *
+ * @access public
+ * @return int Number of occurences found.
+ *
+ * @author Richard Heyes
+ */
+ function getNumOccurences()
+ {
+ return $this->occurences;
+ }
+
+ // }}}
+ // {{{ getLastError()
+
+ /**
+ * Accessor for retrieving last error.
+ *
+ * @access public
+ * @return string The last error that occurred, if any.
+ *
+ * @author Richard Heyes
+ */
+ function getLastError()
+ {
+ return $this->last_error;
+ }
+
+ // }}}
+ // {{{ setFind()
+
+ /**
+ * Accessor for setting find variable.
+ *
+ * @access public
+ * @param string $find The string/regex to find.
+ *
+ * @author Richard Heyes
+ */
+ function setFind($find)
+ {
+ $this->find = $find;
+ }
+
+ // }}}
+ // {{{ setReplace()
+
+ /**
+ * Accessor for setting replace variable.
+ *
+ * @access public
+ * @param string $replace The string/regex to replace the find string/regex with.
+ *
+ * @author Richard Heyes
+ */
+ function setReplace($replace)
+ {
+ $this->replace = $replace;
+ }
+
+ // }}}
+ // {{{ setFiles()
+
+ /**
+ * Accessor for setting files variable.
+ *
+ * @access public
+ * @param array $files The file(s) to perform this operation on.
+ *
+ * @author Richard Heyes
+ */
+ function setFiles($files)
+ {
+ $this->files = $files;
+ }
+
+ // }}}
+ // {{{ setDirectories()
+
+ /**
+ * Accessor for setting directories variable.
+ *
+ * @access public
+ * @param array $directories The directories to perform this operation on.
+ *
+ * @author Richard Heyes
+ */
+ function setDirectories($directories)
+ {
+ $this->directories = $directories;
+ }
+
+ // }}}
+ // {{{ setIncludeSubdir
+
+ /**
+ * Accessor for setting include_subdir variable.
+ *
+ * @access public
+ * @param int $include_subdir Whether to traverse subdirectories or not.
+ *
+ * @author Richard Heyes
+ */
+ function setIncludeSubdir($include_subdir)
+ {
+ $this->include_subdir = $include_subdir;
+ }
+
+ // }}}
+ // {{{ setIgnoreLines()
+
+ /**
+ * Accessor for setting ignore_lines variable.
+ *
+ * @access public
+ * @param array $ignore_lines Ignore lines beginning with any of the strings in this array. This
+ * feature only works with the "normal" search.
+ *
+ * @author Richard Heyes
+ */
+ function setIgnoreLines($ignore_lines)
+ {
+ $this->ignore_lines = $ignore_lines;
+ }
+
+ // }}}
+ // {{{ setSearchFunction()
+
+ /**
+ * Function to determine which search function is used.
+ *
+ * @access public
+ * @param string The search function that should be used. Can be any one of:
+ * normal - Default search. Goes line by line. Ignore lines feature only works with this type.
+ * quick - Uses str_replace for straight replacement throughout file. Quickest of the lot.
+ * preg - Uses preg_replace(), so any regex valid with this function is valid here.
+ * ereg - Uses ereg_replace(), so any regex valid with this function is valid here.
+ *
+ * @author Richard Heyes
+ */
+ function setSearchFunction($search_function)
+ {
+ switch($search_function) {
+ case 'normal': $this->search_function = 'search';
+ return TRUE;
+ break;
+
+ case 'quick' : $this->search_function = 'quickSearch';
+ return TRUE;
+ break;
+
+ case 'preg' : $this->search_function = 'pregSearch';
+ return TRUE;
+ break;
+
+ case 'ereg' : $this->search_function = 'eregSearch';
+ return TRUE;
+ break;
+
+ default : $this->last_error = 'Invalid search function specified';
+ return FALSE;
+ break;
+ }
+ }
+
+ // }}}
+ // {{{ search()
+
+ /**
+ * Default ("normal") search routine.
+ *
+ * @access private
+ * @param string $filename The filename to search and replace upon.
+ * @return array Will return an array containing the new file contents and the number of occurences.
+ * Will return FALSE if there are no occurences.
+ *
+ * @author Richard Heyes
+ */
+ function search($filename)
+ {
+
+ $occurences = 0;
+ $file_array = file($filename);
+
+ for ($i=0; $iignore_lines) > 0) {
+ for ($j=0; $jignore_lines); $j++) {
+ if (substr($file_array[$i],0,strlen($this->ignore_lines[$j])) == $this->ignore_lines[$j]) continue 2;
+ }
+ }
+
+ $occurences += count(explode($this->find, $file_array[$i])) - 1;
+ $file_array[$i] = str_replace($this->find, $this->replace, $file_array[$i]);
+ }
+ if ($occurences > 0) $return = array($occurences, implode('', $file_array)); else $return = FALSE;
+ return $return;
+
+ }
+
+ // }}}
+ // {{{ quickSearch()
+
+ /**
+ * Quick search routine.
+ *
+ * @access private
+ * @param string $filename The filename to search and replace upon.
+ * @return array Will return an array containing the new file contents and the number of occurences.
+ * Will return FALSE if there are no occurences.
+ *
+ * @author Richard Heyes
+ */
+ function quickSearch($filename)
+ {
+
+ clearstatcache();
+
+ $file = fread($fp = fopen($filename, 'r'), filesize($filename)); fclose($fp);
+ $occurences = count(explode($this->find, $file)) - 1;
+ $file = str_replace($this->find, $this->replace, $file);
+
+ if ($occurences > 0) $return = array($occurences, $file); else $return = FALSE;
+ return $return;
+
+ }
+
+ // }}}
+ // {{{ pregSearch()
+
+ /**
+ * Preg search routine.
+ *
+ * @access private
+ * @param string $filename The filename to search and replace upon.
+ * @return array Will return an array containing the new file contents and the number of occurences.
+ * Will return FALSE if there are no occurences.
+ *
+ * @author Richard Heyes
+ */
+ function pregSearch($filename)
+ {
+
+ clearstatcache();
+
+ $file = fread($fp = fopen($filename, 'r'), filesize($filename)); fclose($fp);
+ $occurences = count($matches = preg_split($this->find, $file)) - 1;
+ $file = preg_replace($this->find, $this->replace, $file);
+
+ if ($occurences > 0) $return = array($occurences, $file); else $return = FALSE;
+ return $return;
+
+ }
+
+ // }}}
+ // {{{ eregSearch()
+
+ /**
+ * Ereg search routine.
+ *
+ * @access private
+ * @param string $filename The filename to search and replace upon.
+ * @return array Will return an array containing the new file contents and the number of occurences.
+ * Will return FALSE if there are no occurences.
+ *
+ * @author Richard Heyes
+ */
+ function eregSearch($filename)
+ {
+
+ clearstatcache();
+
+ $file = fread($fp = fopen($filename, 'r'), filesize($filename)); fclose($fp);
+
+ $occurences = count($matches = split($this->find, $file)) -1;
+ $file = ereg_replace($this->find, $this->replace, $file);
+
+ if ($occurences > 0) $return = array($occurences, $file); else $return = FALSE;
+ return $return;
+
+ }
+
+ // }}}
+ // {{{ writeout()
+
+ /**
+ * Function to writeout the file contents.
+ *
+ * @access private
+ * @param string $filename The filename of the file to write.
+ * @param string $contents The contents to write to the file.
+ *
+ * @author Richard Heyes
+ */
+ function writeout($filename, $contents)
+ {
+
+ if ($fp = @fopen($filename, 'w')) {
+ flock($fp,2);
+ fwrite($fp, $contents);
+ flock($fp,3);
+ fclose($fp);
+ } else {
+ $this->last_error = 'Could not open file: '.$filename;
+ }
+
+ }
+
+ // }}}
+ // {{{ doFiles()
+
+ /**
+ * Function called by doSearch() to go through any files that need searching.
+ *
+ * @access private
+ * @param string $ser_func The search function to use.
+ *
+ * @author Richard Heyes
+ */
+ function doFiles($ser_func)
+ {
+ if (!is_array($this->files)) $this->files = explode(',', $this->files);
+ for ($i=0; $ifiles); $i++) {
+ if ($this->files[$i] == '.' OR $this->files[$i] == '..') continue;
+ if (is_dir($this->files[$i]) == TRUE) continue;
+ $newfile = $this->$ser_func($this->files[$i]);
+ if (is_array($newfile) == TRUE){
+ $this->writeout($this->files[$i], $newfile[1]);
+ $this->occurences += $newfile[0];
+ }
+ }
+ }
+
+ // }}}
+ // {{{ doDirectories()
+
+ /**
+ * Function called by doSearch() to go through any directories that need searching.
+ *
+ * @access private
+ * @param string $ser_func The search function to use.
+ *
+ * @author Richard Heyes
+ */
+ function doDirectories($ser_func)
+ {
+ if (!is_array($this->directories)) $this->directories = explode(',', $this->directories);
+ for ($i=0; $idirectories); $i++) {
+ $dh = opendir($this->directories[$i]);
+ while ($file = readdir($dh)) {
+ if ($file == '.' OR $file == '..') continue;
+
+ if (is_dir($this->directories[$i].$file) == TRUE) {
+ if ($this->include_subdir == 1) {
+ $this->directories[] = $this->directories[$i].$file.'/';
+ continue;
+ } else {
+ continue;
+ }
+ }
+
+ $newfile = $this->$ser_func($this->directories[$i].$file);
+ if (is_array($newfile) == TRUE) {
+ $this->writeout($this->directories[$i].$file, $newfile[1]);
+ $this->occurences += $newfile[0];
+ }
+ }
+ }
+ }
+
+ // }}}
+ // {{{ doSearch()
+
+ /**
+ * This starts the search/replace off. Call this to do the search.
+ * First do whatever files are specified, and/or if directories are specified,
+ * do those too.
+ *
+ * @access public
+ *
+ * @author Richard Heyes
+ */
+ function doSearch()
+ {
+ if ($this->find != '') {
+ if ((is_array($this->files) AND count($this->files) > 0) OR $this->files != '') $this->doFiles($this->search_function);
+ if ($this->directories != '') $this->doDirectories($this->search_function);
+ }
+ }
+
+ // }}}
+
+}
+?>
diff --git a/include/File/Util.php b/include/File/Util.php
new file mode 100644
index 000000000..941c61441
--- /dev/null
+++ b/include/File/Util.php
@@ -0,0 +1,457 @@
+
+ * @copyright 2004-2005 Michael Wallner
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version CVS: $Id: Util.php,v 1.21 2005/08/09 07:52:13 mike Exp $
+ * @link http://pear.php.net/package/File
+ */
+
+/**#@+
+ * Sorting Constants
+ */
+define('FILE_SORT_NONE', 0);
+define('FILE_SORT_REVERSE', 1);
+define('FILE_SORT_NAME', 2);
+define('FILE_SORT_SIZE', 4);
+define('FILE_SORT_DATE', 8);
+define('FILE_SORT_RANDOM', 16);
+/**#@-*/
+
+/**#@+
+ * Listing Constants
+ */
+define('FILE_LIST_FILES', 1);
+define('FILE_LIST_DIRS', 2);
+define('FILE_LIST_DOTS', 4);
+define('FILE_LIST_ALL', FILE_LIST_FILES | FILE_LIST_DIRS | FILE_LIST_DOTS);
+/**#@-*/
+
+/**
+ * @ignore
+ */
+define('FILE_WIN32', defined('OS_WINDOWS') ? OS_WINDOWS : !strncasecmp(PHP_OS, 'win', 3));
+
+/**
+ * File_Util
+ *
+ * File and directory utility functions.
+ *
+ * @access public
+ * @static
+ */
+class File_Util
+{
+ /**
+ * Returns a string path built from the array $pathParts. Where a join
+ * occurs multiple separators are removed. Joins using the optional
+ * separator, defaulting to the PHP DIRECTORY_SEPARATOR constant.
+ *
+ * @static
+ * @access public
+ * @param array $parts Array containing the parts to be joined
+ * @param string $separator The directory seperator
+ */
+ function buildPath($parts, $separator = DIRECTORY_SEPARATOR)
+ {
+ $qs = '/^'. preg_quote($separator, '/') .'+$/';
+ for ($i = 0, $c = count($parts); $i < $c; $i++) {
+ if (!strlen($parts[$i]) || preg_match($qs, $parts[$i])) {
+ unset($parts[$i]);
+ } elseif (0 == $i) {
+ $parts[$i] = rtrim($parts[$i], $separator);
+ } elseif ($c - 1 == $i) {
+ $parts[$i] = ltrim($parts[$i], $separator);
+ } else {
+ $parts[$i] = trim($parts[$i], $separator);
+ }
+ }
+ return implode($separator, $parts);
+ }
+
+ /**
+ * Returns a path without leading / or C:\. If this is not
+ * present the path is returned as is.
+ *
+ * @static
+ * @access public
+ * @param string $path The path to be processed
+ * @return string The processed path or the path as is
+ */
+ function skipRoot($path)
+ {
+ if (File_Util::isAbsolute($path)) {
+ if (FILE_WIN32) {
+ return substr($path, $path{3} == '\\' ? 4 : 3);
+ }
+ return ltrim($path, '/');
+ }
+ return $path;
+ }
+
+ /**
+ * Returns the temp directory according to either the TMP, TMPDIR, or
+ * TEMP env variables. If these are not set it will also check for the
+ * existence of /tmp, %WINDIR%\temp
+ *
+ * @static
+ * @access public
+ * @return string The system tmp directory
+ */
+ function tmpDir()
+ {
+ if (FILE_WIN32) {
+ if (isset($_ENV['TEMP'])) {
+ return $_ENV['TEMP'];
+ }
+ if (isset($_ENV['TMP'])) {
+ return $_ENV['TMP'];
+ }
+ if (isset($_ENV['windir'])) {
+ return $_ENV['windir'] . '\\temp';
+ }
+ if (isset($_ENV['SystemRoot'])) {
+ return $_ENV['SystemRoot'] . '\\temp';
+ }
+ if (isset($_SERVER['TEMP'])) {
+ return $_SERVER['TEMP'];
+ }
+ if (isset($_SERVER['TMP'])) {
+ return $_SERVER['TMP'];
+ }
+ if (isset($_SERVER['windir'])) {
+ return $_SERVER['windir'] . '\\temp';
+ }
+ if (isset($_SERVER['SystemRoot'])) {
+ return $_SERVER['SystemRoot'] . '\\temp';
+ }
+ return '\temp';
+ }
+ if (isset($_ENV['TMPDIR'])) {
+ return $_ENV['TMPDIR'];
+ }
+ if (isset($_SERVER['TMPDIR'])) {
+ return $_SERVER['TMPDIR'];
+ }
+ return '/tmp';
+ }
+
+ /**
+ * Returns a temporary filename using tempnam() and File::tmpDir().
+ *
+ * @static
+ * @access public
+ * @param string $dirname Optional directory name for the tmp file
+ * @return string Filename and path of the tmp file
+ */
+ function tmpFile($dirname = null)
+ {
+ if (!isset($dirname)) {
+ $dirname = File_Util::tmpDir();
+ }
+ return tempnam($dirname, 'temp.');
+ }
+
+ /**
+ * Returns boolean based on whether given path is absolute or not.
+ *
+ * @static
+ * @access public
+ * @param string $path Given path
+ * @return boolean True if the path is absolute, false if it is not
+ */
+ function isAbsolute($path)
+ {
+ if (preg_match('/(?:\/|\\\)\.\.(?=\/|$)/', $path)) {
+ return false;
+ }
+ if (FILE_WIN32) {
+ return preg_match('/^[a-zA-Z]:(\\\|\/)/', $path);
+ }
+ return ($path{0} == '/') || ($path{0} == '~');
+ }
+
+ /**
+ * Get path relative to another path
+ *
+ * @static
+ * @access public
+ * @return string
+ * @param string $path
+ * @param string $root
+ * @param string $separator
+ */
+ function relativePath($path, $root, $separator = DIRECTORY_SEPARATOR)
+ {
+ $path = File_Util::realpath($path, $separator);
+ $root = File_Util::realpath($root, $separator);
+ $dirs = explode($separator, $path);
+ $comp = explode($separator, $root);
+
+ if (FILE_WIN32) {
+ if (strcasecmp($dirs[0], $comp[0])) {
+ return $path;
+ }
+ unset($dirs[0], $comp[0]);
+ }
+
+ foreach ($comp as $i => $part) {
+ if (isset($dirs[$i]) && $part == $dirs[$i]) {
+ unset($dirs[$i], $comp[$i]);
+ } else {
+ break;
+ }
+ }
+
+ return str_repeat('..' . $separator, count($comp)) . implode($separator, $dirs);
+ }
+
+ /**
+ * Get real path (works with non-existant paths)
+ *
+ * @static
+ * @access public
+ * @return string
+ * @param string $path
+ * @param string $separator
+ */
+ function realPath($path, $separator = DIRECTORY_SEPARATOR)
+ {
+ if (!strlen($path)) {
+ return $separator;
+ }
+
+ $drive = '';
+ if (FILE_WIN32) {
+ $path = preg_replace('/[\\\\\/]/', $separator, $path);
+ if (preg_match('/([a-zA-Z]\:)(.*)/', $path, $matches)) {
+ $drive = $matches[1];
+ $path = $matches[2];
+ } else {
+ $cwd = getcwd();
+ $drive = substr($cwd, 0, 2);
+ if ($path{0} !== $separator{0}) {
+ $path = substr($cwd, 3) . $separator . $path;
+ }
+ }
+ } elseif ($path{0} !== $separator) {
+ $path = getcwd() . $separator . $path;
+ }
+
+ $dirStack = array();
+ foreach (explode($separator, $path) as $dir) {
+ if (strlen($dir) && $dir !== '.') {
+ if ($dir == '..') {
+ array_pop($dirStack);
+ } else {
+ $dirStack[] = $dir;
+ }
+ }
+ }
+
+ return $drive . $separator . implode($separator, $dirStack);
+ }
+
+ /**
+ * Check whether path is in root path
+ *
+ * @static
+ * @access public
+ * @return bool
+ * @param string $path
+ * @param string $root
+ */
+ function pathInRoot($path, $root)
+ {
+ static $realPaths = array();
+
+ if (!isset($realPaths[$root])) {
+ $realPaths[$root] = File_Util::realPath($root);
+ }
+
+ return false !== strstr(File_Util::realPath($path), $realPaths[$root]);
+ }
+
+ /**
+ * List Directory
+ *
+ * The final argument, $cb, is a callback that either evaluates to true or
+ * false and performs a filter operation, or it can also modify the
+ * directory/file names returned. To achieve the latter effect use as
+ * follows:
+ *
+ *
+ * name, "\n";
+ * }
+ * ?>
+ *
+ *
+ * @static
+ * @access public
+ * @return array
+ * @param string $path
+ * @param int $list
+ * @param int $sort
+ * @param mixed $cb
+ */
+ function listDir($path, $list = FILE_LIST_ALL, $sort = FILE_SORT_NONE, $cb = null)
+ {
+ if (!strlen($path) || !is_dir($path)) {
+ return null;
+ }
+
+ $entries = array();
+ for ($dir = dir($path); false !== $entry = $dir->read(); ) {
+ if ($list & FILE_LIST_DOTS || $entry{0} !== '.') {
+ $isRef = ($entry === '.' || $entry === '..');
+ $isDir = $isRef || is_dir($path .'/'. $entry);
+ if ( ((!$isDir && $list & FILE_LIST_FILES) ||
+ ($isDir && $list & FILE_LIST_DIRS)) &&
+ (!is_callable($cb) ||
+ call_user_func_array($cb, array(&$entry)))) {
+ $entries[] = (object) array(
+ 'name' => $entry,
+ 'size' => $isDir ? null : filesize($path .'/'. $entry),
+ 'date' => filemtime($path .'/'. $entry),
+ );
+ }
+ }
+ }
+ $dir->close();
+
+ if ($sort) {
+ $entries = File_Util::sortFiles($entries, $sort);
+ }
+
+ return $entries;
+ }
+
+ /**
+ * Sort Files
+ *
+ * @static
+ * @access public
+ * @return array
+ * @param array $files
+ * @param int $sort
+ */
+ function sortFiles($files, $sort)
+ {
+ if (!$files) {
+ return array();
+ }
+
+ if (!$sort) {
+ return $files;
+ }
+
+ if ($sort === 1) {
+ return array_reverse($files);
+ }
+
+ if ($sort & FILE_SORT_RANDOM) {
+ shuffle($files);
+ return $files;
+ }
+
+ $names = array();
+ $sizes = array();
+ $dates = array();
+
+ if ($sort & FILE_SORT_NAME) {
+ $r = &$names;
+ } elseif ($sort & FILE_SORT_DATE) {
+ $r = &$dates;
+ } elseif ($sort & FILE_SORT_SIZE) {
+ $r = &$sizes;
+ } else {
+ asort($files, SORT_REGULAR);
+ return $files;
+ }
+
+ $sortFlags = array(
+ FILE_SORT_NAME => SORT_STRING,
+ FILE_SORT_DATE => SORT_NUMERIC,
+ FILE_SORT_SIZE => SORT_NUMERIC,
+ );
+
+ foreach ($files as $file) {
+ $names[] = $file->name;
+ $sizes[] = $file->size;
+ $dates[] = $file->date;
+ }
+
+ if ($sort & FILE_SORT_REVERSE) {
+ arsort($r, $sortFlags[$sort & ~1]);
+ } else {
+ asort($r, $sortFlags[$sort]);
+ }
+
+ $result = array();
+ foreach ($r as $i => $f) {
+ $result[] = $files[$i];
+ }
+
+ return $result;
+ }
+
+ /**
+ * Switch File Extension
+ *
+ * @static
+ * @access public
+ * @return string|array
+ * @param string|array $filename
+ * @param string $to new file extension
+ * @param string $from change only files with this extension
+ * @param bool $reverse change only files not having $from extension
+ */
+ function switchExt($filename, $to, $from = null, $reverse = false)
+ {
+ if (is_array($filename)) {
+ foreach ($filename as $key => $file) {
+ $filename[$key] = File_Util::switchExt($file, $to, $from);
+ }
+ return $filename;
+ }
+
+ if ($len = strlen($from)) {
+ $ext = substr($filename, -$len - 1);
+ $cfn = FILE_WIN32 ? 'strcasecmp' : 'strcmp';
+ if (!$reverse == $cfn($ext, '.'. $from)) {
+ return $filename;
+ }
+ return substr($filename, 0, -$len - 1) .'.'. $to;
+ }
+
+ if ($pos = strpos($filename, '.')) {
+ return substr($filename, 0, $pos) .'.'. $to;
+ }
+
+ return $filename .'.'. $to;
+ }
+
+}
+
+?>
diff --git a/include/lehrveranstaltung.class.php b/include/lehrveranstaltung.class.php
index d753a5921..032f607a6 100644
--- a/include/lehrveranstaltung.class.php
+++ b/include/lehrveranstaltung.class.php
@@ -71,47 +71,6 @@ class lehrveranstaltung
*/
function load($lehrveranstaltung_id)
{
- //gueltigkeit von lehrveranstaltung_id pruefen
- if(!is_numeric($lehrveranstaltung_id) || $lehrveranstaltung_id == '')
- {
- $this->errormsg = 'lehrveranstaltung_id muss eine gueltige Zahl sein';
- return false;
- }
-
- $qry = "SELECT * FROM lehre.tbl_lehrveranstaltung WHERE lehrveranstaltung_pk = '$lehrveranstaltung_id';";
-
- if(!$res = pg_query($this->conn, $qry))
- {
- $this->errormsg = 'Datensatz konnte nicht geladen werden';
- return false;
- }
-
- if($row = pg_fetch_object($res))
- {
- $this->lehrveranstaltung_id = $row->lehrveranstaltung_pk;
- $this->art = $row->art;
- $this->ausbildungssemester_id = $row->ausbildungssemester_fk;
- $this->beschreibung = $row->beschreibung;
- $this->ectspunkte = $row->ectspunkte;
- $this->fachbereich_id = $row->fachbereich_fk;
- $this->kategorie = $row->kategorie;
- $this->kurzbezeichnung = $row->kurzbezeichnung;
- $this->name = $row->name;
- $this->notenlektor_id = $row->notenlektor_fk;
- $this->nummer = $row->nummer;
- $this->nummerintern = $row->nummerintern;
- $this->sortierung = $row->sortierung;
- $this->studentenwochenstunden = $row->studentenwochenstunden;
- $this->studiengang_id = $row->studiengang_fk;
- $this->studiensemester_id = $row->studiensemester_fk;
- $this->updateamum = $row->creationdate;
- $this->updatevon = $row->creationuser;
- }
- else
- {
- $this->errormsg = 'Datensatz konnte nicht geladen werden';
- return false;
- }
return true;
}
@@ -134,26 +93,27 @@ class lehrveranstaltung
{
$lv_obj = new lehrveranstaltung($this->conn);
- $lv_obj->lehrveranstaltung_id = $row->lehrveranstaltung_pk;
- $lv_obj->art = $row->art;
- $lv_obj->ausbildungssemester_id = $row->ausbildungssemester_fk;
- $lv_obj->beschreibung = $row->beschreibung;
- $lv_obj->ectspunkte = $row->ectspunkte;
- $lv_obj->fachbereich_id = $row->fachbereich_fk;
- $lv_obj->kategorie = $row->kategorie;
- $lv_obj->kurzbezeichnung = $row->kurzbezeichnung;
- $lv_obj->name = $row->name;
- $lv_obj->notenlektor_id = $row->notenlektor_fk;
- $lv_obj->nummer = $row->nummer;
- $lv_obj->nummerintern = $row->nummerintern;
- $lv_obj->sortierung = $row->sortierung;
- $lv_obj->studentenwochenstunden = $row->studentenwochenstunden;
- $lv_obj->studiengang_id = $row->studiengang_fk;
- $lv_obj->studiensemester_id = $row->studiensemester_fk;
- $lv_obj->updateamum = $row->creationdate;
- $lv_obj->updatevon = $row->creationuser;
+ $lv_obj->lehrveranstaltung_id=$row->lehrveranstaltung_id;
+ $lv_obj->studiengang_kz=$row->studiengang_kz;
+ $lv_obj->bezeichnung=$row->bezeichnung;
+ $lv_obj->kurzbz=$row->kurzbz;
+ $lv_obj->semester=$row->semester;
+ $lv_obj->ects=$row->ects;
+ $lv_obj->semesterstunden=$row->semesterstunden;
+ $lv_obj->anmerkung=$row->anmerkung;
+ $lv_obj->lehre=($row->lehre=='t'?true:false);
+ $lv_obj->lehreverzeichnis=$row->lehreverzeichnis;
+ $lv_obj->aktiv=($row->aktiv=='t'?true:false);
+ $lv_obj->ext_id=$row->ext_id;
+ $lv_obj->insertamum=$row->insertamum;
+ $lv_obj->insertvon=$row->insertvon;
+ $lv_obj->planfaktor=$row->planfaktor;
+ $lv_obj->planlektoren=$row->planlektoren;
+ $lv_obj->planpersonalkosten=$row->planpersonalkosten;
+ $lv_obj->updateamum=$row->updateamum;
+ $lv_obj->updatevon=$row->updatevon;
- $this->result[] = $lv_obj;
+ $this->lehrveranstaltungen[] = $lv_obj;
}
return true;
@@ -166,7 +126,7 @@ class lehrveranstaltung
* $ausbildungssemester_id ID des ausbildungssemesters (optional)
* @return true wenn ok, false im Fehlerfall
*/
- function load_lva($studiengang_id, $studiensemester_id=null, $ausbildungssemester_id=null)
+ function load_lva($studiengang_id, $ausbildungssemester_id=null, $lehre=null)
{
//Variablen pruefen
if(!is_numeric($studiengang_id) || $studiengang_id =='')
@@ -174,26 +134,27 @@ class lehrveranstaltung
$this->errormsg = 'studiengang_id muss eine gueltige Zahl sein';
return false;
}
- if($studiensemester_id != null && (!is_numeric($studiensemester_id) || $studiensemester_id == ''))
- {
- $this->errormsg = 'studiensemester_id muss eine gueltige Zahl sein';
- return false;
- }
if($ausbildungssemester_id != null && (!is_numeric($ausbildungssemester_id) || $ausbildungssemester_id == ''))
{
$this->errormsg = 'ausbildungssemester_id muss eine gueltige Zahl sein';
return false;
}
+ if($lehre!=null && !is_bool($lehre))
+ {
+ $this->errormsg = 'Lehre muss ein boolscher Wert sein';
+ return false;
+ }
//Select Befehl zusammenbauen
- $qry = "SELECT * FROM lehre.tbl_lehrveranstaltung WHERE studiengang_fk = '$studiengang_id'";
-
- if($studiensemester_id != null)
- $qry .= " AND studiensemester_fk = '$studiensemester_id'";
+ $qry = "SELECT * FROM lehre.tbl_lehrveranstaltung WHERE studiengang_kz = '$studiengang_id'";
if($ausbildungssemester_id != null)
- $qry .= " AND ausbildungssemester_fk = '$ausbildungssemester_id'";
- $qry .= " ORDER BY name";
+ $qry .= " AND semester = '$ausbildungssemester_id'";
+ if($lehre!=null)
+ $qry .= " AND lehre=".($lehre?'true':'false');
+
+ $qry .= " ORDER BY bezeichnung";
+
//Datensaetze laden
if(!$res = pg_query($this->conn, $qry))
{
@@ -205,26 +166,27 @@ class lehrveranstaltung
{
$lv_obj = new lehrveranstaltung($this->conn);
- $lv_obj->lehrveranstaltung_id = $row->lehrveranstaltung_pk;
- $lv_obj->art = $row->art;
- $lv_obj->ausbildungssemester_id = $row->ausbildungssemester_fk;
- $lv_obj->beschreibung = $row->beschreibung;
- $lv_obj->ectspunkte = $row->ectspunkte;
- $lv_obj->fachbereich_id = $row->fachbereich_fk;
- $lv_obj->kategorie = $row->kategorie;
- $lv_obj->kurzbezeichnung = $row->kurzbezeichnung;
- $lv_obj->name = $row->name;
- $lv_obj->notenlektor_id = $row->notenlektor_fk;
- $lv_obj->nummer = $row->nummer;
- $lv_obj->nummerintern = $row->nummerintern;
- $lv_obj->sortierung = $row->sortierung;
- $lv_obj->studentenwochenstunden = $row->studentenwochenstunden;
- $lv_obj->studiengang_id = $row->studiengang_fk;
- $lv_obj->studiensemester_id = $row->studiensemester_fk;
- $lv_obj->updateamum = $row->creationdate;
- $lv_obj->updatevon = $row->creationuser;
+ $lv_obj->lehrveranstaltung_id=$row->lehrveranstaltung_id;
+ $lv_obj->studiengang_kz=$row->studiengang_kz;
+ $lv_obj->bezeichnung=$row->bezeichnung;
+ $lv_obj->kurzbz=$row->kurzbz;
+ $lv_obj->semester=$row->semester;
+ $lv_obj->ects=$row->ects;
+ $lv_obj->semesterstunden=$row->semesterstunden;
+ $lv_obj->anmerkung=$row->anmerkung;
+ $lv_obj->lehre=($row->lehre=='t'?true:false);
+ $lv_obj->lehreverzeichnis=$row->lehreverzeichnis;
+ $lv_obj->aktiv=($row->aktiv=='t'?true:false);
+ $lv_obj->ext_id=$row->ext_id;
+ $lv_obj->insertamum=$row->insertamum;
+ $lv_obj->insertvon=$row->insertvon;
+ $lv_obj->planfaktor=$row->planfaktor;
+ $lv_obj->planlektoren=$row->planlektoren;
+ $lv_obj->planpersonalkosten=$row->planpersonalkosten;
+ $lv_obj->updateamum=$row->updateamum;
+ $lv_obj->updatevon=$row->updatevon;
- $this->result[] = $lv_obj;
+ $this->lehrveranstaltungen[] = $lv_obj;
}
return true;
diff --git a/include/news.class.php b/include/news.class.php
index c740db108..3dc01384a 100644
--- a/include/news.class.php
+++ b/include/news.class.php
@@ -94,8 +94,18 @@ class news
// **********************************
function getnews($maxalter, $studiengang_kz, $semester)
{
- $qry = "SELECT * FROM campus.tbl_news WHERE (now()-updateamum)conn, $qry))
{
while($row = pg_fetch_object($result))
diff --git a/include/studiengang.class.php b/include/studiengang.class.php
index 1857a2b4d..049370261 100644
--- a/include/studiengang.class.php
+++ b/include/studiengang.class.php
@@ -122,9 +122,12 @@ class studiengang
// * Liefert alle Studiengaenge
// * @return true wenn ok, false im Fehlerfall
// *******************************************
- function getAll($order)
+ function getAll($order=null)
{
- $qry = "SELECT * FROM tbl_studiengang order by $order;";
+ $qry = "SELECT * FROM tbl_studiengang";
+
+ if($order!=null)
+ $qry .=" ORDER BY $order";
if(!$res = pg_query($this->conn, $qry))
{
diff --git a/include/studiensemester.class.php b/include/studiensemester.class.php
index 4a86a3f7a..d7cd725e6 100644
--- a/include/studiensemester.class.php
+++ b/include/studiensemester.class.php
@@ -156,5 +156,61 @@ class studiensemester
return false;
}
}
+
+ // ******************************************************************
+ // * Liefert das Aktuelle Studiensemester
+ // * @return aktuelles Studiensemester oder false wenn es keines gibt
+ // ******************************************************************
+ function getakt()
+ {
+ $qry = "SELECT studiensemester_kurzbz FROM tbl_studiensemester WHERE start <= now() AND ende >= now()";
+ if(!$res=pg_exec($this->conn,$qry))
+ {
+ $this->errormsg = pg_errormessage($this->conn);
+ return false;
+ }
+
+ if(pg_num_rows($res)>0)
+ {
+ $erg = pg_fetch_object($res);
+ return $erg->studiensemester_kurzbz;
+ }
+ else
+ {
+ $this->errormsg = "Kein aktuelles Studiensemester vorhanden";
+ return false;
+ }
+ }
+
+ /**
+ * Liefert das Aktuelle Studiensemester oder das darauffolgende
+ * @return Studiensemester oder false wenn es keines gibt
+ */
+ function getaktorNext()
+ {
+ if($stsem=$this->getakt())
+ return $stsem;
+ else
+ {
+ $qry = "SELECT studiensemester_kurzbz FROM tbl_studiensemester WHERE ende >= now() ORDER BY ende";
+ if(!$res=pg_exec($this->conn,$qry))
+ {
+ $this->errormsg = pg_errormessage($this->conn);
+ return false;
+ }
+
+ if(pg_num_rows($res)>0)
+ {
+ $erg = pg_fetch_object($res);
+ return $erg->studiensemester_kurzbz;
+ }
+ else
+ {
+ $this->errormsg = "Kein aktuelles Studiensemester vorhanden";
+ return false;
+ }
+ }
+ }
+
}
?>
\ No newline at end of file