commit 1bf9923edf56c0a726391c333e7ec539155151af Author: aschwarz Date: Thu Mar 9 11:22:13 2023 +0100 first commit diff --git a/Archiv/AD.docx b/Archiv/AD.docx new file mode 100755 index 0000000..0e85304 Binary files /dev/null and b/Archiv/AD.docx differ diff --git a/Archiv/AW Was tun bei Statusõnderung.msg b/Archiv/AW Was tun bei Statusõnderung.msg new file mode 100755 index 0000000..a1fedfd Binary files /dev/null and b/Archiv/AW Was tun bei Statusõnderung.msg differ diff --git a/Archiv/Dokument4.txt b/Archiv/Dokument4.txt new file mode 100755 index 0000000..3e48335 --- /dev/null +++ b/Archiv/Dokument4.txt @@ -0,0 +1,27 @@ +Status Neu + +Dann soll man erstmal die Daten sehen vom VV. +Der Admin kann dann verschiedene Aktionen ausfhren, ohne den Status zu ndern: +-> Gutachterbenennung + --> Mail an Ausschuss, der die Gutachter freigeben muss. + --> Fristsetzung, bis wann der Ausschuss ablehnen kann: Endefrist mit in die Mail + --> Mglichkeit Gutachter nachbenennen. + --> Hat der Ausschuss zugestimmt, werden die Gutachter angeschrieben + --> Zugestimmt, gilt der Antrag, wenn die Merheit des Ausschusses nicht innerhalb der Frist abgelehnt hat. + Fragen hierzu: Schreibt das System die Gutachter automatisch an, oder soll ein manueller Eingriff erforderlich sein? + Stimmt der Ausschuss gesamt ber die Gutachter ab, oder entscheidet er einzeln ber jeden vorgeschlagenen Gutachter? + --> Ich meine man hat sich auf Einzelabstimmung festgelegt. + --> Erst mit dem Anschreiben der Gutachter wird der Status auf "Gutachter benannt" gesetzt + +-> Beteiligte benennen + --> + +-> Entscheidung terminieren + +Manuelle Statusndern: +Entschieden + --> weiteres Vorgehen nach Prmienkatalog (Eingabe/Vorgehen muss noch besprochen werden) + --> Begrndung + +Auschluss + --> Begrndung \ No newline at end of file diff --git a/Archiv/Programmierung Ideenmanagement.docx b/Archiv/Programmierung Ideenmanagement.docx new file mode 100755 index 0000000..1be7712 Binary files /dev/null and b/Archiv/Programmierung Ideenmanagement.docx differ diff --git a/Archiv/ProgrammierungIdeenmanagement110407.docx b/Archiv/ProgrammierungIdeenmanagement110407.docx new file mode 100755 index 0000000..7160a33 Binary files /dev/null and b/Archiv/ProgrammierungIdeenmanagement110407.docx differ diff --git a/Archiv/Prõmienkatalog.msg b/Archiv/Prõmienkatalog.msg new file mode 100755 index 0000000..41ce2c9 Binary files /dev/null and b/Archiv/Prõmienkatalog.msg differ diff --git a/Archiv/Verfahren mit Statis.doc b/Archiv/Verfahren mit Statis.doc new file mode 100755 index 0000000..be0a466 Binary files /dev/null and b/Archiv/Verfahren mit Statis.doc differ diff --git a/Archiv/Vorgehensweise Gutachterbestellung.txt b/Archiv/Vorgehensweise Gutachterbestellung.txt new file mode 100755 index 0000000..ad8266e --- /dev/null +++ b/Archiv/Vorgehensweise Gutachterbestellung.txt @@ -0,0 +1,42 @@ +1) Ausschuss definieren: ++ -> Personen sind in imt_user ++ -> Es wird eine eigene Rolle geben + +2) Auswahl der gewnschten Gutachter. +# -> Vorabfrage Auswahl der bisher erfassten User alternativ Student / Professor / Extern (nicht AD) angeben fr Neuanlage + --> oberer Teil Bisher benannte Gutachter (Name, Frist, Status(Bei Ausschussprfung, Angenommen, Abgelehnt) ++ --> unterer Teil. Neue Gutachter hinzufgen ++ -> Student Abfrage des Namens ber LDAP mglich, AG Jahrgang mssen gefunden werden ++ -> Professor Abfrage des Namens ber LDAP mglich, Fakultt sollte gefunde werden. ++ -> Extern. Eingabe der Daten manuell ++ -> Nach Neuanlage mit Benutzerkennung Kenner setzen, dass Mail noch nicht versendet wurde Spalte in imt_user (Alternativ kein PW setzen, das wird erst mein Mailversand generiert) ++ -> Zurck auf Eingangsseite. Gutachter ist in der Liste erfassten User ++ -> Bei Auswahl des erfassten User Eingabemglichkeit des Datum, bis wann Ausschuss ablehnen muss sowie Kommentarfeld ++ -> Mail an Ausschussmitglieder mit Einsicht des Fristdatums sowie des Kommentars ++ -> Bei erfolgreichem Versenden Status des VV einmalig auf "Status vorgeprft setzen" im Verlauf, wenn Status Neu noch gesetzt ist bzw. noch nicht vorgeprft gesetzt wurde ++ -> Auerdem den Verlauf aktualisieren mit Gutachtername und Fristdatum + + -> Nach Fristablauf: Hat die Mehrheit des Ausschusses zugestimmt bzw nichts gemacht, ist der Gutachter bestimmt worden. + -> Manueller Eingriff, wann Gutachter angeschrieben wird: Dann aber Passwort des Gutachters setzen, Per Mail anschreiben mit + Textfeldeingabemglichkeit und Zugangsdaten mit Aktivierungslink wenn kein Passwort gesetzt war + (das bedeudet, dass der Gutachter sich nicht selber registriert hat) + und Recht setzen, dass der diesen VV im Gutachterbereich anschauen darf + -> Status Gutachter benannt im Verlauf. Das klaptt nicht beim Vorschlag, da es mehrere Gutachter sein knnen und Beteiligtenstatus zwischenfunken kann + + + +Status: + +Ermitteln Anzahl der Gutachter + +Ist die Frist abgelaufen + -> JA + -> Ist die Anzahl der Ablehnung < Hlfte "Anzahl der Gutachter" + JA --> Status: Angenommen, weitere Aktionen ermglichen + Nein --> Status: Abgelehnt + + + -> NEIN + -> Ist die "Anzahl Zustimmung" >= Hlfte "Anzahl der Gutachter" + JA --> Status: Angenommen, weitere Aktionen ermglichen + Nein --> Status: Bei Ausschussprfung \ No newline at end of file diff --git a/Archiv/erm_ideenmanagement.mwb b/Archiv/erm_ideenmanagement.mwb new file mode 100755 index 0000000..bcfb2a7 Binary files /dev/null and b/Archiv/erm_ideenmanagement.mwb differ diff --git a/Archiv/erm_ideenmanagement.mwb.bak b/Archiv/erm_ideenmanagement.mwb.bak new file mode 100755 index 0000000..0753513 Binary files /dev/null and b/Archiv/erm_ideenmanagement.mwb.bak differ diff --git a/Archiv/ideenmanagement.sql b/Archiv/ideenmanagement.sql new file mode 100755 index 0000000..b2acc78 --- /dev/null +++ b/Archiv/ideenmanagement.sql @@ -0,0 +1,534 @@ +-- phpMyAdmin SQL Dump +-- version 3.3.3 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Erstellungszeit: 11. Mai 2011 um 14:23 +-- Server Version: 5.1.37 +-- PHP-Version: 5.3.0 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Datenbank: `ideenmanagement` +-- + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_ausschuss_gutachter_erg` +-- + +CREATE TABLE IF NOT EXISTS `imt_ausschuss_gutachter_erg` ( + `gaid` int(11) NOT NULL AUTO_INCREMENT, + `imtuid` int(11) NOT NULL, + `gid` int(11) NOT NULL, + `ergebnis` enum('Y','N') COLLATE utf8_bin NOT NULL, + `erfass_dat` date NOT NULL, + PRIMARY KEY (`gaid`), + KEY `imtuid` (`imtuid`), + KEY `gid` (`gid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ; + +-- +-- Daten für Tabelle `imt_ausschuss_gutachter_erg` +-- + + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_beteiligte` +-- + +CREATE TABLE IF NOT EXISTS `imt_beteiligte` ( + `bid` int(11) NOT NULL AUTO_INCREMENT, + `imtuid` int(11) NOT NULL, + `vid` int(11) NOT NULL, + `bemerkung` text COLLATE utf8_bin NOT NULL, + `erfass_dat` datetime NOT NULL, + PRIMARY KEY (`bid`), + KEY `imtuid` (`imtuid`), + KEY `vid` (`vid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ; + +-- +-- Daten für Tabelle `imt_beteiligte` +-- + + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_gruppenmitglieder` +-- + +CREATE TABLE IF NOT EXISTS `imt_gruppenmitglieder` ( + `gmid` int(11) NOT NULL AUTO_INCREMENT, + `vid` int(11) NOT NULL, + `name` varchar(250) COLLATE utf8_bin NOT NULL, + `mail` varchar(250) COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`gmid`), + KEY `vid` (`vid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ; + +-- +-- Daten für Tabelle `imt_gruppenmitglieder` +-- + + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_gruppenmitglieder_temp` +-- + +CREATE TABLE IF NOT EXISTS `imt_gruppenmitglieder_temp` ( + `session` varchar(250) COLLATE utf8_bin NOT NULL, + `imtuid` int(11) NOT NULL, + `name` varchar(250) COLLATE utf8_bin NOT NULL, + `mail` varchar(250) COLLATE utf8_bin NOT NULL, + `datum` datetime NOT NULL, + KEY `imtuid` (`imtuid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- +-- Daten für Tabelle `imt_gruppenmitglieder_temp` +-- + + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_gutachter` +-- + +CREATE TABLE IF NOT EXISTS `imt_gutachter` ( + `gid` int(11) NOT NULL AUTO_INCREMENT, + `imtuid` int(11) NOT NULL, + `vid` int(11) NOT NULL, + `bemerkung` text COLLATE utf8_bin NOT NULL, + `erfass_dat` datetime NOT NULL, + `frist_datum` date NOT NULL COMMENT 'Datum, bis wann der Ausschuss abstimmen muss', + `ablehn_dat` datetime NOT NULL, + PRIMARY KEY (`gid`), + KEY `imtuid` (`imtuid`), + KEY `vid` (`vid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ; + +-- +-- Daten für Tabelle `imt_gutachter` +-- + +INSERT INTO `imt_gutachter` (`gid`, `imtuid`, `vid`, `bemerkung`, `erfass_dat`, `frist_datum`, `ablehn_dat`) VALUES +(1, 3, 1, '', '2011-05-09 09:28:06', '2011-05-13', '0000-00-00 00:00:00'); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_kategorie` +-- + +CREATE TABLE IF NOT EXISTS `imt_kategorie` ( + `kid` int(11) NOT NULL AUTO_INCREMENT, + `kategorie` varchar(250) COLLATE utf8_bin NOT NULL, + `sort_order` int(11) NOT NULL, + PRIMARY KEY (`kid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=18 ; + +-- +-- Daten für Tabelle `imt_kategorie` +-- + +INSERT INTO `imt_kategorie` (`kid`, `kategorie`, `sort_order`) VALUES +(0, 'Ohne Kategorie', 0), +(1, 'Haushalt', 10), +(2, 'Organisation', 20), +(3, 'Umwelt', 30), +(4, 'Prüfungsamt', 40), +(5, 'Reisekosten', 50), +(6, 'Bibliothek', 60), +(7, 'Rechenzentrum', 70), +(8, 'Personalmanagement', 80), +(9, 'Studienangelegenheiten', 90), +(10, 'Akademisches Auslandsamt', 100), +(11, 'Qualitätsmanagement', 110), +(12, 'Evaluation', 120), +(13, 'Fakultät 1', 130), +(14, 'Fakultät 2', 140), +(15, 'Institut für Angewandte Forschung', 150), +(16, 'Hochschule allgemein', 160), +(17, 'Sonstiges', 170); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_parameter` +-- + +CREATE TABLE IF NOT EXISTS `imt_parameter` ( + `PID` int(5) NOT NULL AUTO_INCREMENT, + `Beschreibung` varchar(200) COLLATE utf8_bin NOT NULL DEFAULT '', + `Wert1` varchar(200) COLLATE utf8_bin DEFAULT NULL, + `Wert2` varchar(200) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`PID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=3 ; + +-- +-- Daten für Tabelle `imt_parameter` +-- + +INSERT INTO `imt_parameter` (`PID`, `Beschreibung`, `Wert1`, `Wert2`) VALUES +(1, 'Ansprechpartner im Fehlerfall', 'Frau Henzel', 'henzel@hs-ludwigsburg.de'), +(2, 'Benutzer Passwort LDAP User', 'LDAPqueryUser', 'ldHS332'); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_rechte` +-- + +CREATE TABLE IF NOT EXISTS `imt_rechte` ( + `reid` int(11) NOT NULL AUTO_INCREMENT, + `beschreibung` varchar(100) COLLATE utf8_bin NOT NULL, + `dateiname` varchar(50) COLLATE utf8_bin NOT NULL, + `target` varchar(50) COLLATE utf8_bin NOT NULL, + `bereich` enum('B','U') COLLATE utf8_bin NOT NULL COMMENT 'Bearbeiten, User', + `sort_order` int(5) NOT NULL, + PRIMARY KEY (`reid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=9 ; + +-- +-- Daten für Tabelle `imt_rechte` +-- + +INSERT INTO `imt_rechte` (`reid`, `beschreibung`, `dateiname`, `target`, `bereich`, `sort_order`) VALUES +(1, 'Neu (Eingegangen)', 'status.php?id=1', 'admin_haupt', 'B', 10), +(2, 'In Bearbeitung', 'status.php?id=100', 'admin_haupt', 'B', 20), +(7, 'Entschieden', 'status.php?id=7', 'admin_haupt', 'B', 70), +(8, 'Ausschluss', 'status.php?id=8', 'admin_haupt', 'B', 80); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_rolle` +-- + +CREATE TABLE IF NOT EXISTS `imt_rolle` ( + `roid` int(11) NOT NULL AUTO_INCREMENT, + `bezeichnung` varchar(200) COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`roid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=5 ; + +-- +-- Daten für Tabelle `imt_rolle` +-- + +INSERT INTO `imt_rolle` (`roid`, `bezeichnung`) VALUES +(1, 'Administrator'), +(2, 'Gutachter'), +(3, 'Beteiligter'), +(4, 'Ausschuss'); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_rollen_rechte_zuord` +-- + +CREATE TABLE IF NOT EXISTS `imt_rollen_rechte_zuord` ( + `reid` int(11) NOT NULL, + `roid` int(11) NOT NULL, + KEY `reid` (`reid`), + KEY `roid` (`roid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- +-- Daten für Tabelle `imt_rollen_rechte_zuord` +-- + +INSERT INTO `imt_rollen_rechte_zuord` (`reid`, `roid`) VALUES +(1, 1), +(2, 1), +(7, 1), +(8, 1); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_rollen_user_zuord` +-- + +CREATE TABLE IF NOT EXISTS `imt_rollen_user_zuord` ( + `rozuid` int(11) NOT NULL AUTO_INCREMENT, + `roid` int(11) NOT NULL, + `imtuid` int(11) NOT NULL, + PRIMARY KEY (`rozuid`), + KEY `roid` (`roid`), + KEY `imtuid` (`imtuid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=5 ; + +-- +-- Daten für Tabelle `imt_rollen_user_zuord` +-- + +INSERT INTO `imt_rollen_user_zuord` (`rozuid`, `roid`, `imtuid`) VALUES +(1, 1, 1), +(3, 4, 1); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_stati` +-- + +CREATE TABLE IF NOT EXISTS `imt_stati` ( + `sid` int(11) NOT NULL AUTO_INCREMENT, + `status` varchar(250) COLLATE utf8_bin NOT NULL, + `sort_order` int(11) NOT NULL, + PRIMARY KEY (`sid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=10 ; + +-- +-- Daten für Tabelle `imt_stati` +-- + +INSERT INTO `imt_stati` (`sid`, `status`, `sort_order`) VALUES +(0, 'Kein Status', 0), +(1, 'Neu (Eingegangen)', 10), +(2, 'Vorprüfung bestanden', 20), +(3, 'Gutachterbenennung', 30), +(4, 'Beteiligte angehört', 40), +(5, 'Gutachten eingegangen', 50), +(6, 'Entscheidung terminiert', 60), +(7, 'Entschieden', 70), +(8, 'Ausschluss', 80); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_user` +-- + +CREATE TABLE IF NOT EXISTS `imt_user` ( + `imtuid` int(11) NOT NULL AUTO_INCREMENT, + `vorname` varchar(20) COLLATE utf8_bin NOT NULL DEFAULT '', + `nachname` varchar(20) COLLATE utf8_bin NOT NULL DEFAULT '', + `mail` varchar(40) COLLATE utf8_bin NOT NULL, + `beziehung` varchar(1) COLLATE utf8_bin NOT NULL, + `ag` varchar(10) COLLATE utf8_bin NOT NULL, + `jahrgang` varchar(10) COLLATE utf8_bin NOT NULL, + `fakultaet` varchar(250) COLLATE utf8_bin NOT NULL, + `uid` varchar(23) COLLATE utf8_bin NOT NULL DEFAULT '', + `passwort` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '', + `pw_expire` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `mail_inaktiv` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `erstell_dat` datetime NOT NULL COMMENT 'Wann wurde der Benutzer angelegt', + `aktiv` varchar(1) COLLATE utf8_bin NOT NULL DEFAULT '0', + `akivierungscode` varchar(250) COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`imtuid`), + UNIQUE KEY `uid` (`uid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Benutzer' AUTO_INCREMENT=4 ; + +-- +-- Daten für Tabelle `imt_user` +-- + +INSERT INTO `imt_user` (`imtuid`, `vorname`, `nachname`, `mail`, `beziehung`, `ag`, `jahrgang`, `fakultaet`, `uid`, `passwort`, `pw_expire`, `mail_inaktiv`, `erstell_dat`, `aktiv`, `akivierungscode`) VALUES +(1, 'Alexander', 'Schwarz', 'netblack@gmx.de', 'S', 'C', '00', '', 'schwaral', 'f5df16d9bd60b0894064b5777139de79', '2012-04-18 12:51:16', '0000-00-00 00:00:00', '2011-04-14 09:03:13', '1', '77554321 '), +(2, 'Silke', 'Henzel', 'henzel@hs-ludwigsburg.de', '', '', '', 'Fakultät 1', 'henzelsi', 'f5df16d9bd60b0894064b5777139de79', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0', ''), +(3, 'Wolfgang', 'Rieth', 'rieth@hs-ludwigsburg.de', '', '', '', 'Fakultät 1', 'riethwol', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2011-04-27 08:29:11', '1', ''); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_userlog` +-- + +CREATE TABLE IF NOT EXISTS `imt_userlog` ( + `lid` int(11) NOT NULL AUTO_INCREMENT, + `Datum` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `IP` varchar(15) COLLATE utf8_bin NOT NULL DEFAULT '', + `user_agent` varchar(255) COLLATE utf8_bin NOT NULL, + `imtuid` int(11) DEFAULT NULL, + PRIMARY KEY (`lid`), + KEY `imtuid` (`imtuid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Logins der Anwender' AUTO_INCREMENT=13 ; + +-- +-- Daten für Tabelle `imt_userlog` +-- + +INSERT INTO `imt_userlog` (`lid`, `Datum`, `IP`, `user_agent`, `imtuid`) VALUES +(1, '2011-04-15 10:30:45', '127.0.0.1', 'Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0', 1), +(2, '2011-04-18 07:18:19', '127.0.0.1', 'Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0', 1), +(3, '2011-04-18 07:54:01', '127.0.0.1', 'Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0', 1), +(4, '2011-04-18 11:13:38', '127.0.0.1', 'Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0', 1), +(5, '2011-04-18 14:18:10', '127.0.0.1', 'Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0', 1), +(6, '2011-04-19 09:59:08', '127.0.0.1', 'Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0', 1), +(7, '2011-04-19 11:29:34', '127.0.0.1', 'Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0', 1), +(8, '2011-04-26 10:31:01', '127.0.0.1', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1)', 1), +(9, '2011-04-26 11:38:49', '127.0.0.1', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1)', 1), +(10, '2011-04-27 07:36:42', '127.0.0.1', 'Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0', 1), +(11, '2011-05-04 14:29:23', '127.0.0.1', 'Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0', 1), +(12, '2011-05-05 13:03:50', '127.0.0.1', 'Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0', 1); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_user_ad` +-- + +CREATE TABLE IF NOT EXISTS `imt_user_ad` ( + `uid` int(11) NOT NULL AUTO_INCREMENT, + `objectsid` varchar(255) COLLATE utf8_bin NOT NULL, + `accountname` varchar(255) COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`uid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ; + +-- +-- Daten für Tabelle `imt_user_ad` +-- + +INSERT INTO `imt_user_ad` (`uid`, `objectsid`, `accountname`) VALUES +(1, 'adf', 'SCHWARAL'); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_verlauf` +-- + +CREATE TABLE IF NOT EXISTS `imt_verlauf` ( + `vlid` int(11) NOT NULL AUTO_INCREMENT, + `datum` datetime NOT NULL, + `bearbeiter` int(11) NOT NULL, + `status` int(11) NOT NULL, + `vid` int(11) NOT NULL, + `verlauf` varchar(255) COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`vlid`), + KEY `vid` (`vid`), + KEY `bearbeiter` (`bearbeiter`), + KEY `status` (`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=4 ; + +-- +-- Daten für Tabelle `imt_verlauf` +-- + +INSERT INTO `imt_verlauf` (`vlid`, `datum`, `bearbeiter`, `status`, `vid`, `verlauf`) VALUES +(1, '2011-05-05 08:37:35', 1, 1, 1, 'Verbesserungsvorschlag erstellt'), +(2, '2011-05-05 08:41:06', 1, 0, 1, 'Kategorie wurde neu gesetzt: Hochschule allgemein'), +(3, '2011-05-09 09:28:07', 1, 0, 1, 'Mailfehler: Alexander Schwarz über Bestellung von Gutachter Wolfgang Rieth'); + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `imt_vorschlag` +-- + +CREATE TABLE IF NOT EXISTS `imt_vorschlag` ( + `vid` int(11) NOT NULL AUTO_INCREMENT, + `imtuid` int(11) NOT NULL, + `betreff` varchar(255) COLLATE utf8_bin NOT NULL, + `beschreibung` text COLLATE utf8_bin NOT NULL, + `vorschlag` text COLLATE utf8_bin NOT NULL, + `nutzen` text COLLATE utf8_bin NOT NULL, + `public` enum('Y','N') COLLATE utf8_bin NOT NULL, + `kategorie` int(11) NOT NULL, + `erfass_dat` datetime NOT NULL, + `hinweis_eigen` text COLLATE utf8_bin NOT NULL, + `hinweis_admin` text COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`vid`), + KEY `imtuid` (`imtuid`), + KEY `kategorie` (`kategorie`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ; + +-- +-- Daten für Tabelle `imt_vorschlag` +-- + +INSERT INTO `imt_vorschlag` (`vid`, `imtuid`, `betreff`, `beschreibung`, `vorschlag`, `nutzen`, `public`, `kategorie`, `erfass_dat`, `hinweis_eigen`, `hinweis_admin`) VALUES +(1, 1, 'Selbstreinigende Toilettenspülung', 'Die Rohrleitungen sind dann nicht mehr schmutzig', 'Heißwasserspülung einbauen', 'Man spart sich die Kosten eines Flaschners', 'Y', 16, '2011-05-05 08:37:35', '', ''); + +-- +-- Constraints der exportierten Tabellen +-- + +-- +-- Constraints der Tabelle `imt_ausschuss_gutachter_erg` +-- +ALTER TABLE `imt_ausschuss_gutachter_erg` + ADD CONSTRAINT `imt_ausschuss_gutachter_erg_ibfk_2` FOREIGN KEY (`gid`) REFERENCES `imt_gutachter` (`gid`), + ADD CONSTRAINT `imt_ausschuss_gutachter_erg_ibfk_1` FOREIGN KEY (`imtuid`) REFERENCES `imt_user` (`imtuid`); + +-- +-- Constraints der Tabelle `imt_beteiligte` +-- +ALTER TABLE `imt_beteiligte` + ADD CONSTRAINT `imt_beteiligte_ibfk_2` FOREIGN KEY (`vid`) REFERENCES `imt_vorschlag` (`vid`), + ADD CONSTRAINT `imt_beteiligte_ibfk_1` FOREIGN KEY (`imtuid`) REFERENCES `imt_user` (`imtuid`); + +-- +-- Constraints der Tabelle `imt_gruppenmitglieder` +-- +ALTER TABLE `imt_gruppenmitglieder` + ADD CONSTRAINT `imt_gruppenmitglieder_ibfk_1` FOREIGN KEY (`vid`) REFERENCES `imt_vorschlag` (`vid`); + +-- +-- Constraints der Tabelle `imt_gruppenmitglieder_temp` +-- +ALTER TABLE `imt_gruppenmitglieder_temp` + ADD CONSTRAINT `imt_gruppenmitglieder_temp_ibfk_1` FOREIGN KEY (`imtuid`) REFERENCES `imt_user` (`imtuid`); + +-- +-- Constraints der Tabelle `imt_gutachter` +-- +ALTER TABLE `imt_gutachter` + ADD CONSTRAINT `imt_gutachter_ibfk_1` FOREIGN KEY (`imtuid`) REFERENCES `imt_user` (`imtuid`), + ADD CONSTRAINT `imt_gutachter_ibfk_2` FOREIGN KEY (`vid`) REFERENCES `imt_vorschlag` (`vid`); + +-- +-- Constraints der Tabelle `imt_rollen_rechte_zuord` +-- +ALTER TABLE `imt_rollen_rechte_zuord` + ADD CONSTRAINT `imt_rollen_rechte_zuord_ibfk_1` FOREIGN KEY (`reid`) REFERENCES `imt_rechte` (`reid`), + ADD CONSTRAINT `imt_rollen_rechte_zuord_ibfk_2` FOREIGN KEY (`roid`) REFERENCES `imt_rolle` (`roid`); + +-- +-- Constraints der Tabelle `imt_rollen_user_zuord` +-- +ALTER TABLE `imt_rollen_user_zuord` + ADD CONSTRAINT `imt_rollen_user_zuord_ibfk_1` FOREIGN KEY (`roid`) REFERENCES `imt_rolle` (`roid`), + ADD CONSTRAINT `imt_rollen_user_zuord_ibfk_2` FOREIGN KEY (`imtuid`) REFERENCES `imt_user` (`imtuid`); + +-- +-- Constraints der Tabelle `imt_userlog` +-- +ALTER TABLE `imt_userlog` + ADD CONSTRAINT `imt_userlog_ibfk_1` FOREIGN KEY (`imtuid`) REFERENCES `imt_user` (`imtuid`); + +-- +-- Constraints der Tabelle `imt_verlauf` +-- +ALTER TABLE `imt_verlauf` + ADD CONSTRAINT `imt_verlauf_ibfk_1` FOREIGN KEY (`vid`) REFERENCES `imt_vorschlag` (`vid`), + ADD CONSTRAINT `imt_verlauf_ibfk_2` FOREIGN KEY (`bearbeiter`) REFERENCES `imt_user` (`imtuid`), + ADD CONSTRAINT `imt_verlauf_ibfk_3` FOREIGN KEY (`status`) REFERENCES `imt_stati` (`sid`); + +-- +-- Constraints der Tabelle `imt_vorschlag` +-- +ALTER TABLE `imt_vorschlag` + ADD CONSTRAINT `imt_vorschlag_ibfk_1` FOREIGN KEY (`imtuid`) REFERENCES `imt_user` (`imtuid`), + ADD CONSTRAINT `imt_vorschlag_ibfk_3` FOREIGN KEY (`kategorie`) REFERENCES `imt_kategorie` (`kid`); + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/Archiv/testszenario.txt b/Archiv/testszenario.txt new file mode 100755 index 0000000..4b7ccde --- /dev/null +++ b/Archiv/testszenario.txt @@ -0,0 +1,15 @@ +Ausgabe Registrierung erfolgreich abgeschlossen - >Mails abrufen +Ausgabe Registrierung nicht erfolgreich abgeschlossen --> Admin + + +Ausgabe -> Aktivierung fehlgeschlagen -->Admin + + +testszenario: + +Alle Pflichtfelder +Mail ungltig / bereits vorhanden -> auch beim Absenden +Registrierung +Aktivierung mit falschem aktcode +Aktivierung mit richtigem aktcode +login \ No newline at end of file diff --git a/Archiv/view_idm_user.sql b/Archiv/view_idm_user.sql new file mode 100755 index 0000000..687f5ed --- /dev/null +++ b/Archiv/view_idm_user.sql @@ -0,0 +1,5 @@ +create view idm_user +as +(SELECT nachname, vorname, uid, pwd, mail,'S' art from kurs.stud where durchgefallen != 'Y') +union +(select doz_name, doz_vorname, doz_uid, doz_pwd, doz_mail, 'D' art from kurs.doz) \ No newline at end of file diff --git a/abschluss.php b/abschluss.php new file mode 100755 index 0000000..e2d4bd3 --- /dev/null +++ b/abschluss.php @@ -0,0 +1,951 @@ + $value){ + if ( substr( $key, 0, $search_len) == $search_prefix) { + unset( $_SESSION[$key]); + } + } +} + +$action = $_GET['action']; +if($action == ''){ + + if($_GET['error'] == 1){ + $smarty->assign('abschluss_pflichtfelder', "1"); + $smarty->assign('abschluss_error_text', "Es ist zu einem Fehler gekommen. Bitte treffen Sie eine Auswahl."); + } + + $db = dbconnect(); + + # Alle Vorschläge, die in einer Sitzung behandelt wurden (Sitzungstermin liegt in Vergangenheit) + $query = "SELECT a.vid, betreff, date_format(erfass_dat, '%d.%m.%Y (%H:%i)') datum, vorname, nachname + FROM imt_vorschlag a, imt_sitzungen_vorschlag b, imt_user c + WHERE a.vid = b.vid + AND a.imtuid = c.imtuid + AND b.isid IN (SELECT isid FROM imt_sitzungen WHERE datum <= now()) + AND a.vid NOT IN (SELECT vid FROM imt_verlauf WHERE status IN ('7','8')) + ORDER BY erfass_dat ASC"; + + $result = $db->query ($query) + or die ("Cannot execute query"); + + $table_data1 = array(); + + while ($row = $result->fetch_array()){ + + array_push($table_data1, array( + 'vid' => $row[vid], + 'betreff' => $row[betreff], + 'datum' => $row[datum], + 'vorname' => $row[vorname], + 'nachname' => $row[nachname] + ) + ); + } + + $smarty->assign('table_data1', $table_data1); + + +} + +if($action == 'step2'){ +#echo $action; + + # Daten aufbereiten für zurückbutton + if(isset($_SESSION["abschluss_annahme"])){ + $smarty->assign('abschluss_annahme', $_SESSION["abschluss_annahme"]); + }else{ + # Standard ist Ja bei der Annahme + $smarty->assign('abschluss_annahme', "J"); + } + + + + + if(isset($_POST["auswahl"])){ + $vid = $_POST["auswahl"]; + $_SESSION["abschluss_vid"] = $vid; + } + + if($_SESSION["abschluss_vid"] == ''){ + $fehler = 1; + echo ""; + } + + if(!isset($fehler )){ + + } + + +} + +if($action == 'step3'){ +#echo $action; + # Daten aufbereiten für zurückbutton + if(isset($_SESSION["abschluss_bemerkung"])){ + $smarty->assign('abschluss_bemerkung', $_SESSION["abschluss_bemerkung"]); + } + + if(isset($_POST["annahme"])){ + $annahme = $_POST["annahme"]; + $_SESSION["abschluss_annahme"] = $annahme; + if($annahme == 'Z'){ + echo ""; + } + } + + if($_SESSION["abschluss_annahme"] == 'J'){ + $smarty->assign('abschluss_field_begruendung', "Bitte begründen Sie die Annahme des Vorschlags"); + }else{ + $smarty->assign('abschluss_field_begruendung', "Bitte begründen Sie die Ablehnung des Vorschlags"); + } + + if($_GET['error'] == 1){ + $smarty->assign('abschluss_annahme', $_SESSION["abschluss_annahme"]); + $smarty->assign('abschluss_pflichtfelder', "1"); + $smarty->assign('abschluss_error_text', "Es ist zu einem Fehler gekommen. Bitte begründen Sie Ihre Entscheidung"); + }else{ + + } + +} + +if($action == 'step3a'){ +#echo $action; + +# echo "
"; +# echo nl2br(print_r($_SESSION,true)); +# echo "
"; + + if(isset($_POST["abschluss_bemerkung"])){ + $abschluss_bemerkung = $_POST["abschluss_bemerkung"]; + $_SESSION["abschluss_bemerkung"] = $abschluss_bemerkung; + } + + if($_SESSION["abschluss_bemerkung"] == ''){ + $fehler = 1; + echo ""; + } + + if(!isset($fehler )){ + + if($_GET['error'] == 1){ + $smarty->assign('abschluss_pflichtfelder', "1"); + $smarty->assign('abschluss_error_text', "Es ist zu einem Fehler gekommen. Bitte füllen Sie mind. 1 Pflichtfeld aus!"); + }else{ + $vid = $_SESSION["abschluss_vid"]; + $db = dbconnect(); + $result = $db->query("SELECT annahme, ziel, begruendung, umsetzung, praemierung + FROM imt_bew_vorschlag + WHERE vid = '$vid'"); + $row = $result->fetch_array(); + + # Daten aufbereiten für zurückbutton + if(isset($_SESSION["abschluss_chk1"])){ + $smarty->assign('abschluss_chk1', $_SESSION["abschluss_chk1"]); + }else{ + if(preg_match("/1/",$row[ziel])){ + $smarty->assign('abschluss_chk1', 1); + }else{ + $smarty->assign('abschluss_chk1', 0); + } + } + + if(isset($_SESSION["abschluss_chk2"])){ + $smarty->assign('abschluss_chk2', $_SESSION["abschluss_chk2"]); + }else{ + if(preg_match("/2/",$row[ziel])){ + $smarty->assign('abschluss_chk2', 2); + }else{ + $smarty->assign('abschluss_chk2', 0); + } + } + + if(isset($_SESSION["abschluss_chk3"])){ + $smarty->assign('abschluss_chk3', $_SESSION["abschluss_chk3"]); + }else{ + if(preg_match("/3/",$row[ziel])){ + $smarty->assign('abschluss_chk3', 3); + }else{ + $smarty->assign('abschluss_chk3', 0); + } + } + + if(isset($_SESSION["abschluss_chk4"])){ + $smarty->assign('abschluss_chk4', $_SESSION["abschluss_chk4"]); + }else{ + if(preg_match("/4/",$row[ziel])){ + $smarty->assign('abschluss_chk4', 4); + }else{ + $smarty->assign('abschluss_chk4', 0); + } + } + + if(isset($_SESSION["abschluss_chk5"])){ + $smarty->assign('abschluss_chk5', $_SESSION["abschluss_chk5"]); + }else{ + if(preg_match("/5/",$row[ziel])){ + $smarty->assign('abschluss_chk5', 5); + }else{ + $smarty->assign('abschluss_chk5', 0); + } + } + + } + + + } +} + + + +if($action == 'step4'){ +#echo $action; + + + + # Daten aufbereiten für zurückbutton + if(isset($_SESSION["abschluss_praemie"])){ + $smarty->assign('abschluss_praemie', $_SESSION["abschluss_praemie"]); + }else{ + $smarty->assign('abschluss_praemie', "J"); + } + + + if(isset($_GET['back'])){ ## Kenner wird bei Step 5 im Zurückbutton gesetzt + $abschluss_chk1 = $_SESSION["abschluss_chk1"]; + $abschluss_chk2 = $_SESSION["abschluss_chk2"]; + $abschluss_chk3 = $_SESSION["abschluss_chk3"]; + $abschluss_chk4 = $_SESSION["abschluss_chk4"]; + $abschluss_chk5 = $_SESSION["abschluss_chk5"]; + }else{ + if(isset($_POST["chk1"])){ + $abschluss_chk1 = $_POST["chk1"]; + $_SESSION["abschluss_chk1"] = $abschluss_chk1; + }else{ + $_SESSION["abschluss_chk1"] = ""; + } + + if(isset($_POST["chk2"])){ + $abschluss_chk2 = $_POST["chk2"]; + $_SESSION["abschluss_chk2"] = $abschluss_chk2; + }else{ + $_SESSION["abschluss_chk2"] = ""; + } + + if(isset($_POST["chk3"])){ + $abschluss_chk3 = $_POST["chk3"]; + $_SESSION["abschluss_chk3"] = $abschluss_chk3; + }else{ + $_SESSION["abschluss_chk3"] = ""; + } + + if(isset($_POST["chk4"])){ + $abschluss_chk4 = $_POST["chk4"]; + $_SESSION["abschluss_chk4"] = $abschluss_chk4; + }else{ + $_SESSION["abschluss_chk4"] = ""; + } + + if(isset($_POST["chk5"])){ + $abschluss_chk5 = $_POST["chk5"]; + $_SESSION["abschluss_chk5"] = $abschluss_chk5; + }else{ + $_SESSION["abschluss_chk5"] = ""; + } + } + + + +/* + if(isset($_POST["chk1"])){ + $abschluss_chk1 = $_POST["chk1"]; + $_SESSION["abschluss_chk1"] = $abschluss_chk1; + }else{ + unset($_SESSION["abschluss_chk1"]); + $abschluss_chk1 = ""; + } + + if(isset($_POST["chk2"])){ + $abschluss_chk2 = $_POST["chk2"]; + $_SESSION["abschluss_chk2"] = $abschluss_chk2; + }else{ + unset($_SESSION["abschluss_chk2"]); + $abschluss_chk2 = ""; + } +*/ + ## Fehler, wenn keine Checkboxen ausgefüllt wurden + if($abschluss_chk1 == "" AND $abschluss_chk2 == "" AND $abschluss_chk3 == "" AND $abschluss_chk4 == "" AND $abschluss_chk5 == ""){ + $fehler = 1; + echo ""; + } + + if(!isset($fehler )){ + + + + + } + + +} + + +if($action == 'step5'){ +#echo $action; + + # Wenn der Vorschlag abgelehnt wurde, dann darf nur ein Teil des Prämienkatalogs abgefragt werden + # Übergabe der Entscheidung in html: + $smarty->assign('abschluss_annahme', $_SESSION["abschluss_annahme"]); + + + + # Daten aufbereiten für zurückbutton + if(isset($_SESSION["abschluss_praemie1"])){ + $smarty->assign('abschluss_praemie1', $_SESSION["abschluss_praemie1"]); + }else{ + # Defaultwerte + if($_SESSION["abschluss_annahme"] == 'J'){ + $smarty->assign('abschluss_praemie1', "1"); + }else{ + # Punkt 1 gibt es bei Ablehnung eines Vorschlags nicht: Min. 2 Punkte, mind. 5 Punkte + $smarty->assign('abschluss_praemie1', "2"); + } + } + + if(isset($_SESSION["abschluss_praemie2"])){ + $smarty->assign('abschluss_praemie2', $_SESSION["abschluss_praemie2"]); + }else{ + # Defaultwerte + if($_SESSION["abschluss_annahme"] == 'J'){ + $smarty->assign('abschluss_praemie2', "1"); + }else{ + # Punkt 1 gibt es bei Ablehnung eines Vorschlags nicht: Min. 2 Punkte, mind. 5 Punkte + $smarty->assign('abschluss_praemie2', "3"); + } + } + + if(isset($_SESSION["abschluss_praemie3"])){ + $smarty->assign('abschluss_praemie3', $_SESSION["abschluss_praemie3"]); + }else{ + $smarty->assign('abschluss_praemie3', "1"); + } + + if(isset($_SESSION["abschluss_praemie4"])){ + $smarty->assign('abschluss_praemie4', $_SESSION["abschluss_praemie4"]); + }else{ + $smarty->assign('abschluss_praemie4', "1"); + } + + + + if(isset($_POST["praemie"])){ + $praemie = $_POST["praemie"]; + $_SESSION["abschluss_praemie"] = $praemie; + } + + $smarty->assign('abschluss_praemie', $_SESSION["abschluss_praemie"]); + if($_SESSION["abschluss_praemie"] == 'J'){ + # Bei Ja, den Fragenkatalog einblenden + + } + + if($_SESSION["abschluss_praemie"] == 'N'){ + # Bei Nein, den Weiter mit den Informationsfelder (step7) + echo ""; + } + + +} + +if($action == 'step6'){ +#echo $action; + + + + if(isset($_POST["praemie_1"])){ + $praemie1 = $_POST["praemie_1"]; + $_SESSION["abschluss_praemie1"] = $praemie1; + $praemie2 = $_POST["praemie_2"]; + $_SESSION["abschluss_praemie2"] = $praemie2; + $praemie3 = $_POST["praemie_3"]; + $_SESSION["abschluss_praemie3"] = $praemie3; + $praemie4 = $_POST["praemie_4"]; + $_SESSION["abschluss_praemie4"] = $praemie4; + + $praemie_punkte = $praemie1+$praemie2+$praemie3+$praemie4; + $_SESSION["abschluss_praemiepunkte"] = $praemie_punkte; + } + + # Prämie bei angenommenem Vorschlag + if($_SESSION["abschluss_annahme"] == 'J'){ + + $db = dbconnect(); + $result = $db->query("SELECT klasse, praemie_euro, praemie_dienstfrei + FROM imt_praemie + WHERE punkte_umsetzbar = $_SESSION[abschluss_praemiepunkte]"); + $row = $result->fetch_array(); + + $gutschein = "$row[praemie_euro]"; + $dienstbefreiung = "$row[praemie_dienstfrei]"; + #Prämienklasse + $klassierung = "$row[klasse]"; + } + + # Prämie bei abgelehntem Vorschlag + if($_SESSION["abschluss_annahme"] == 'N'){ + $db = dbconnect(); + $result = $db->query("SELECT klasse, praemie_euro, praemie_dienstfrei + FROM imt_praemie + WHERE punkte_nicht_umsetzbar = $_SESSION[abschluss_praemiepunkte]"); + $row = $result->fetch_array(); + + $gutschein = "$row[praemie_euro]"; + $dienstbefreiung = "$row[praemie_dienstfrei]"; + #Prämienklasse + $klassierung = "$row[klasse]"; + } + + + + $_SESSION["abschluss_guschein"] = $gutschein; + $_SESSION["abschluss_dienstbefreiung"] = $dienstbefreiung; + $_SESSION["abschluss_klassierung"] = $klassierung; + + + if(isset($_SESSION["abschluss_gutschein_or_befreiung"])){ + $smarty->assign('abschluss_gutschein_or_befreiung', $_SESSION["abschluss_gutschein_or_befreiung"]); + }else{ + $smarty->assign('abschluss_gutschein_or_befreiung', "gutschein"); + } + + + $query_public = $db->query("SELECT public + FROM imt_vorschlag + WHERE vid = '$_SESSION[abschluss_vid]' + ") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_public = $query_public->fetch_array(); + + if($row_public["public"] == 'Y'){ + $public = "Y"; + $public_text = "Liegt vor"; + }else{ + $public = "N"; + $public_text = "Liegt nicht vor"; + } + $_SESSION["abschluss_public"] = $public; + + + # Feldname anpassen Gutschein /Prämie + if($_SESSION["abschluss_klassierung"] >= 3){ + $smarty->assign('abschluss_field_gutschein', "Prämie:"); + }else{ + $smarty->assign('abschluss_field_gutschein', "Gutschein:"); + } + + $smarty->assign('abschluss_praemiepunkte', $_SESSION["abschluss_praemiepunkte"]); + $smarty->assign('abschluss_guschein', $_SESSION["abschluss_guschein"]); + $smarty->assign('abschluss_dienstbefreiung', $_SESSION["abschluss_dienstbefreiung"]); + $smarty->assign('abschluss_klassierung', $_SESSION["abschluss_klassierung"]); + $smarty->assign('abschluss_public_text', $public_text); + + +} + +if($action == 'step7'){ +#echo $action; + + if($_SESSION["abschluss_annahme"] == 'N'){ + # Bei Nein, den Weiter mit den Informationsfelder (step8) + echo ""; + } + + if($_SESSION["abschluss_praemie"] == 'N'){ + $smarty->assign('abschluss_backlink', "step4"); + }else{ + $smarty->assign('abschluss_backlink', "step6"); + } + + # Daten aufbereiten für zurückbutton + if(isset($_SESSION["abschluss_information_massnahme"])){ + $smarty->assign('abschluss_information_massnahme', $_SESSION["abschluss_information_massnahme"]); + } + + if(isset($_SESSION["abschluss_information_sachstand"])){ + $smarty->assign('abschluss_information_sachstand', $_SESSION["abschluss_information_sachstand"]); + } + + + if($_GET['error'] == 1){ + $smarty->assign('abschluss_pflichtfelder', "1"); + $smarty->assign('abschluss_error_text', "Es ist zu einem Fehler gekommen. Bitte füllen Sie das Feld über die geplanten Maßnahmen aus"); + }else{ + + if(isset($_POST["abschluss_praemie_gutschein"])){ + $_SESSION["abschluss_guschein_save"] = 1; + $_SESSION["abschluss_guschein"] = $_POST["abschluss_praemie_gutschein"]; + }else{ + unset($_SESSION["abschluss_guschein_save"]); + } + + if(isset($_POST["abschluss_gutschein_or_befreiung"])){ + $_SESSION["abschluss_gutschein_or_befreiung"] = $_POST["abschluss_gutschein_or_befreiung"]; + } + + if($_SESSION["abschluss_dienstbefreiung"] == 0){ + ## Hier muss noch rein, dass gutschein ist, wenn keine Auswahl kommt, achtung auf zurück button + $_SESSION["abschluss_gutschein_or_befreiung"] = "gutschein"; + } + + + } + +} + + +if($action == 'step8'){ +# echo $action; + +# echo "
"; +# echo nl2br(print_r($_SESSION,true)); +# echo "
"; + + if($_SESSION["abschluss_annahme"] == 'N' AND $_SESSION["abschluss_praemie"] == 'N'){ + $smarty->assign('abschluss_backlink', "step4"); + }elseif($_SESSION["abschluss_annahme"] == 'J' AND $_SESSION["abschluss_praemie"] == 'N'){ + $smarty->assign('abschluss_backlink', "step7"); + }elseif($_SESSION["abschluss_annahme"] == 'N' AND $_SESSION["abschluss_praemie"] == 'J'){ + $smarty->assign('abschluss_backlink', "step6"); + }else{ + $smarty->assign('abschluss_backlink', "step7"); + } + + + if(isset($_POST["abschluss_information_massnahme"])){ + $abschluss_information_massnahme = $_POST["abschluss_information_massnahme"]; + $_SESSION["abschluss_information_massnahme"] = $abschluss_information_massnahme; + } + + + if(isset($_POST["abschluss_information_sachstand"])){ + $abschluss_information_sachstand = $_POST["abschluss_information_sachstand"]; + $_SESSION["abschluss_information_sachstand"] = $abschluss_information_sachstand; + } + + if($_SESSION["abschluss_information_massnahme"] == '' AND $_SESSION["abschluss_annahme"] == 'J'){ + $fehler = 1; + echo ""; + } + + if(!isset($fehler )){ + + if($_SESSION["abschluss_praemie"] == 'N'){ + # Man kann die Prämienpunkte Beit step4 mit nein bestätigen, dann darf es diese Variablen nicht geben. + # Wenn man zuerst ja gedrückt hat, die Prämie ausgefüllt hat und dann zurück und Prämie=N gewählt hat würde es die Var trotzdem geben + unset($_SESSION["abschluss_guschein"]); + unset($_SESSION["abschluss_dienstbefreiung"]); + unset($_SESSION["abschluss_klassierung"]); + unset($_SESSION["abschluss_praemiepunkte"]); + } + + $abschluss_annahme = $_SESSION["abschluss_annahme"]; + if($abschluss_annahme == 'J'){ + $smarty->assign('abschluss_annahme', "Ja"); + }else{ + $smarty->assign('abschluss_annahme', "Nein"); + } + + $abschluss_bemerkung = $_SESSION["abschluss_bemerkung"]; + $smarty->assign('abschluss_bemerkung', $abschluss_bemerkung); + + + if($_SESSION["abschluss_chk1"] == 1){ + $smarty->assign('abschluss_chk1_txt', 1); + } + + if($_SESSION["abschluss_chk2"] == 2){ + $smarty->assign('abschluss_chk2_txt', 2); + } + + if($_SESSION["abschluss_chk3"] == 3){ + $smarty->assign('abschluss_chk3_txt', 3); + } + + if($_SESSION["abschluss_chk4"] == 4){ + $smarty->assign('abschluss_chk4_txt', 4); + } + + if($_SESSION["abschluss_chk5"] == 5){ + $smarty->assign('abschluss_chk5_txt', 5); + } + + + + + $query_public = $db->query("SELECT public + FROM imt_vorschlag + WHERE vid = '$_SESSION[abschluss_vid]' + ") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_public = $query_public->fetch_array(); + + if($row_public["public"] == 'Y'){ + $public = "Y"; + $public_text = "Liegt vor"; + }else{ + $public = "N"; + $public_text = "Liegt nicht vor"; + } + $_SESSION["abschluss_public"] = $public; + + $smarty->assign('abschluss_public', $public_text); + + + $abschluss_vid = $_SESSION["abschluss_vid"]; + $smarty->assign('abschluss_vid', $abschluss_vid); + + $abschluss_information_massnahme = $_SESSION["abschluss_information_massnahme"]; + $smarty->assign('abschluss_information_massnahme', $abschluss_information_massnahme); + + $abschluss_information_sachstand = $_SESSION["abschluss_information_sachstand"]; + $smarty->assign('abschluss_information_sachstand', $abschluss_information_sachstand); + + $abschluss_praemiepunkte = $_SESSION["abschluss_praemiepunkte"]; + $smarty->assign('abschluss_praemiepunkte', $abschluss_praemiepunkte); + + $abschluss_guschein = $_SESSION["abschluss_guschein"]; + $smarty->assign('abschluss_guschein', $abschluss_guschein); + + $abschluss_dienstbefreiung = $_SESSION["abschluss_dienstbefreiung"]; + $smarty->assign('abschluss_dienstbefreiung', $abschluss_dienstbefreiung); + + $abschluss_klassierung = $_SESSION["abschluss_klassierung"]; + $smarty->assign('abschluss_klassierung', $abschluss_klassierung); + + $abschluss_gutschein_or_befreiung = $_SESSION["abschluss_gutschein_or_befreiung"]; + $smarty->assign('abschluss_gutschein_or_befreiung', $abschluss_gutschein_or_befreiung); + + # Feldname anpassen Gutschein /Prämie + if($_SESSION["abschluss_klassierung"] >= 3 AND $_SESSION["abschluss_gutschein_or_befreiung"] == 'gutschein'){ + $smarty->assign('abschluss_field_gutschein8', "Prämie:"); + $_SESSION["abschluss_klassierung_kurzel"] = 'P'; # Prämie + }elseif($_SESSION["abschluss_klassierung"] < 3 AND $_SESSION["abschluss_gutschein_or_befreiung"] == 'gutschein'){ + $smarty->assign('abschluss_field_gutschein8', "Gutschein:"); + $_SESSION["abschluss_klassierung_kurzel"] = 'G'; # Gutschein + }else{ + $_SESSION["abschluss_klassierung_kurzel"] = 'B'; # Befreiung + } + + +/* + echo "


Ausgabe der Variablen für den Eintrag in die Datenbank...
"; + echo nl2br(print_r($_SESSION,true)); + echo "

"; +*/ + } + + + +} + +if($action == 'step9'){ +#echo $action; + + + $aend_dat = date("Y-m-d H:i:s"); + $abschluss_vid = $_SESSION["abschluss_vid"]; + $abschluss_annahme = $_SESSION["abschluss_annahme"]; + $abschluss_bemerkung = $_SESSION["abschluss_bemerkung"]; + $abschluss_praemie = $_SESSION["abschluss_praemie"]; + $abschluss_guschein = $_SESSION["abschluss_guschein"]; + $abschluss_dienstbefreiung = $_SESSION["abschluss_dienstbefreiung"]; + $abschluss_klassierung = $_SESSION["abschluss_klassierung"]; + $abschluss_information_massnahme = $_SESSION["abschluss_information_massnahme"]; + $abschluss_information_sachstand = $_SESSION["abschluss_information_sachstand"]; + $abschluss_ziel = trim("$_SESSION[abschluss_chk1]$_SESSION[abschluss_chk2]$_SESSION[abschluss_chk3]$_SESSION[abschluss_chk4]$_SESSION[abschluss_chk5]"); + + if($_SESSION["abschluss_praemie"] =='N'){ + unset($_SESSION["abschluss_praemie1"]); + unset($_SESSION["abschluss_praemie2"]); + unset($_SESSION["abschluss_praemie3"]); + unset($_SESSION["abschluss_praemie4"]); + unset($_SESSION["abschluss_praemiepunkte"]); + $abschluss_praemie1 = ''; + $abschluss_praemie2 = ''; + $abschluss_praemie3 = ''; + $abschluss_praemie4 = ''; + $abschluss_praemiepunkte = ''; + $abschluss_klassierung_kurzel = ''; + }else{ + $abschluss_praemie1 = $_SESSION["abschluss_praemie1"]; + $abschluss_praemie2 = $_SESSION["abschluss_praemie2"]; + $abschluss_praemie3 = $_SESSION["abschluss_praemie3"]; + $abschluss_praemie4 = $_SESSION["abschluss_praemie4"]; + $abschluss_praemiepunkte = $_SESSION["abschluss_praemiepunkte"]; + $abschluss_klassierung_kurzel = $_SESSION["abschluss_klassierung_kurzel"]; + } + + $db = dbconnect(); + + if(!isset($_SESSION["abschluss_veid"])){ + # Schritt 1: Daten erfassen + $sql1 = $db->query("INSERT INTO imt_vorschlag_ende ( erfass_dat + , vid + , annahme + , annahme_bemerkung + , ziel + , praemie + , punkte_praemie1 + , punkte_praemie2 + , punkte_praemie3 + , punkte_praemie4 + , punkte_gesamt + , praemie_gutschein + , dienstbefreiung + , klassierung + , massnahme + , sachstand + , praemienart + ) + VALUES + ( '$aend_dat' + , '$abschluss_vid' + , '$abschluss_annahme' + , '$abschluss_bemerkung' + , '$abschluss_ziel' + , '$abschluss_praemie' + , '$abschluss_praemie1' + , '$abschluss_praemie2' + , '$abschluss_praemie3' + , '$abschluss_praemie4' + , '$abschluss_praemiepunkte' + , '$abschluss_guschein' + , '$abschluss_dienstbefreiung' + , '$abschluss_klassierung' + , '$abschluss_information_massnahme' + , '$abschluss_information_sachstand' + , '$abschluss_klassierung_kurzel' + ) + "); + echo "INSERT INTO imt_vorschlag_ende ( erfass_dat + , vid + , annahme + , annahme_bemerkung + , ziel + , praemie + , punkte_praemie1 + , punkte_praemie2 + , punkte_praemie3 + , punkte_praemie4 + , punkte_gesamt + , praemie_gutschein + , dienstbefreiung + , klassierung + , massnahme + , sachstand + , praemienart + ) + VALUES + ( '$aend_dat' + , '$abschluss_vid' + , '$abschluss_annahme' + , '$abschluss_bemerkung' + , '$abschluss_ziel' + , '$abschluss_praemie' + , '$abschluss_praemie1' + , '$abschluss_praemie2' + , '$abschluss_praemie3' + , '$abschluss_praemie4' + , '$abschluss_praemiepunkte' + , '$abschluss_guschein' + , '$abschluss_dienstbefreiung' + , '$abschluss_klassierung' + , '$abschluss_information_massnahme' + , '$abschluss_information_sachstand' + , '$abschluss_klassierung_kurzel' + ) + "; + $veid = $db->insert_id; + $_SESSION["abschluss_veid"] = $veid; + + if($_SESSION["abschluss_annahme"] == 'J'){ + $result_stat = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid = '$_SESSION[abschluss_vid]' + AND status = '7'"); + $row_stat = $result_stat->fetch_array(); + if($row_stat[Anz] == 0){ + verlauf($uid, $_SESSION["abschluss_vid"], 'Vorschlag wurde angenommen', '7', $aend_dat); + } + } + + + if($_SESSION["abschluss_annahme"] == 'N'){ + $result_stat = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid = '$_SESSION[abschluss_vid]' + AND status = '8'"); + $row_stat = $result_stat->fetch_array(); + if($row_stat[Anz] == 0){ + verlauf($uid, $_SESSION["abschluss_vid"], 'Vorschlag wurde ausgeschlossen', '8', $aend_dat); + } + } + + + $query_ga = $db->query("SELECT uid, a.imtuid, passwort, vorname, nachname, betreff + FROM imt_user a, imt_vorschlag b + WHERE a.imtuid=b.imtuid + AND b.vid='$_SESSION[abschluss_vid]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_ga = $query_ga->fetch_array(); + + $query_entscheidung = $db->query("SELECT annahme, annahme_bemerkung + FROM imt_vorschlag_ende + WHERE vid='$_SESSION[abschluss_vid]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_entscheidung = $query_entscheidung->fetch_array(); + + if($row_entscheidung[annahme] == 'J'){ + $entscheidung = 'angenommen'; + }else{ + $entscheidung = 'abgelehnt'; + } + $empfaenger = "$row_ga[imtuid]"; + $betreff = "Entscheidung Vorschlag $_SESSION[abschluss_vid]"; + $text = " + + + Entscheidung Vorschlag + + + + Guten Tag $row_ga[vorname] $row_ga[nachname]! +

+ Im Rahmen des Ideenmanagements ist ein Verbesserungsvorschlag eingegangen. + Ihr Vorschlag wurde wie folgt entschieden: + +
+
+ + + + + + + + + + + + + + + + + +
+ + Vorschlag: + + + + $row_ga[betreff] + +
+ + ID: + + + + $_SESSION[abschluss_vid] + +
+ + Entscheidung: + + + + $entscheidung + +
+ + Bemerkung: + + + + $row_entscheidung[annahme_bemerkung] + +
+
+ Bei Fragen wenden Sie sich bitte an den Qualitätsmanagementbeauftragten. +

+ Diese Mail wurde automatisch generiert!
+ Antworten Sie daher nicht auf diese Mail.
+
+ Vielen Dank! + + "; + + + #mail_einstell($_SESSION[abschluss_vid], $uid, $empfaenger, NULL, NULL, $betreff, $text, 110, NULL); + + + + # Prüfen ob Gutachterrecht / Beteiligtenrecht noch gebraucht wird, ggf löschen + gutachter_beteiligter_del($_SESSION["abschluss_vid"]); + } +} + +if($action == 'zuruckstell'){ + $vid = $_SESSION["abschluss_vid"]; + $smarty->assign('abschluss_zuruckstell_vid', $vid); + + $db = dbconnect(); + $result = $db->query("SELECT betreff + FROM imt_vorschlag + WHERE vid = '$vid'"); + $row = $result->fetch_array(); + $smarty->assign('abschluss_zuruckstell_betreff', $row['betreff']); + +} + + +if($action == 'zuruckstell1'){ + $vid = $_SESSION["abschluss_vid"]; + $sql = $db->query ("DELETE FROM imt_sitzungen_vorschlag WHERE vid='$vid'"); + $Link = basename($_SERVER['PHP_SELF'])."?new=1"; + echo " + + "; + +} + +if($action == 'zuruckstell2'){ + +$Link = basename($_SERVER['PHP_SELF'])."?new=1"; +echo " + +"; +} + +$smarty->assign('action', "$action"); +$smarty->display("$template/$templatename"); +?> \ No newline at end of file diff --git a/adLDAP/CHANGELOG.txt b/adLDAP/CHANGELOG.txt new file mode 100755 index 0000000..0e4057c --- /dev/null +++ b/adLDAP/CHANGELOG.txt @@ -0,0 +1,92 @@ +adLDAP - PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY + +Written by Scott Barnett, Richard Hyland +email: scott@wiggumworld.com, adldap@richardhyland.com +http://adldap.sourceforge.net/ + + +CHANGELOG +------------------------------------------------------------------------------------------- + +Version 3.3.2 +------------- +[+] New feature: Move the user to a new OU using user_move() function +[-] Bug fix: Prevent an 'undefined index' error in recursive_groups() when full PHP E_ALL logging is enabled +[-] Bug fix: user_groups() does not return primary group when objectsid is not given (Tracker ID:2931213) +[-] Bug fix: Undefined index in function user_info for non-existent users (Tracker ID:2922729) +[-] Bug fix: Force user_info to find objectCategory of person as if a sAMAccountName also exists in a group it will return that group. (Tracker ID:3006096) +[-] Bug fix: Return false for user_info if the user does not exist +[-] Bug fix: user_info, checks for for a "count" value that not exist in $entries array if "memberof" isn't passed in $fields array. (Tracker ID:2993172) +[-] Bug fix: In authenticate() if user authentication fails function returns and does not rebind with admin credentials - so the other funcions don't work anymore as $this->_bind === false. (Tracker ID:2987887) +[-] Bug fix: When calling $ldap->user_modify('user', array("expires"=>0)) the function fails due to the value being 0. Changed to isset (Tracker ID:3036726) +[-] Bug fix: When calling user_info allow the username to be either a sAMAccountName or userPrincipalName attribute + + +Version 3.3.1 +------------- +[-] Bug fix: Prevent empty $username and $password in authenticate from falling through to the default administrator login + +Version 3.3 +----------- + +[+] New feature: Calling adLDAP without LDAP support in PHP will now throw an adLDAPException +[+] New feature: Specifying a NULL $_base_dn will now automatically attempt to detect the base_dn from your domain controller +[+] New feature: Most user objects can now be queried using a user's GUID as well as their username (samAccountName). Set the $isGUID optional parameter to true. To obtain a user's GUID either use the username2guid() function or decodeGuid() +[+] New function: username2guid($username) will return a string representation of the GUID for a given username +[+] New function: decodeGuid($binaryGuid) will convert a binary GUID to a string +[+] New function: find_base_dn() will return the base_dn from your domain controller +[+] New function: get_root_dse($attributes) will return root domain controller configuration attributes such as the default naming context, current DC time, etc +[+] New function: exchange_servers($attributes) will return a list of Exchange servers in your domain +[+] New function: exchange_storage_groups($exchangeServer, $attributes, $recursive) will return a list of Storage groups on any given Exchange server. Setting $recursive to true (or inheriting from the $_recursive_groups setting will automatically query the databases within a storage group) +[+] New function: exchange_storage_databases($storageGroup, $attributes) will return a list of Databases in any given storage group on any given Exchange server +[+] New function: exchange_add_X400($username, $country, $admd, $pdmd, $org, $surname, $givenname, $isGUID=false) will add an X400 address to the Exchange server +[-] Bug fix: Null comparison error in contact_mailenable() + +Version 3.2 +----------- + +[+] New function: user_password_expiry($username) which will return the timestamp and formatted time of when a user's password expires based both on domain policy and user password expiry policy +[+] New function: groups_in_group($group, $recursive = NULL) returns a list of groups within a group +[+] New function: all_groups() function to list ALL types of group rather than just security groups alone +[+] New function: folder_list($folder_name = NULL, $dn_type = ADLDAP_FOLDER, $recursive = NULL, $type = NULL) allows you to navigate the AD folder structure +[+] New function: computer_ingroup() +[+] New function: computer_groups() +[+] New function: connect() +[+] New function: disconnect() +[+] New feature: Added recursive group lookups to group_members() to recursively get the username of users in a group +[+] New feature: TLS support +[+] New feature: Added getters and setters for core variables +[-] Change: Renamed all_groups() to all_security_groups() +[-] Change: Re-written ldap_slashes() function based on a port from Per's Net::LDAP::Util escape_filter_value +[-] Bug fix: Attempt to deal with special char + in group_info() +[-] Bug fix: user_ingroup() would not allow recursion to be disabled using the $recursive parameter and would only inherit from $_recursive_groups variable +[-] Bug fix: Runtime overriding of $recursive group lookups failed due to changes in PHP 5.2 + + +Version 3.1 +----------- + +[+] New function: get_last_error() returns the last error returned by your domain controller +[+] New feature: Automatically detect and encode 8bit characters when being added to an AD object +[+] New feature: Exception handing added for connections or attempting methods that require SSL where it is not set +[+] New feature: Added pager to the schema +[+] New feature: New method to obtain a user's or contacts primary group that is far less intensive using get_primary_group(). The old group_cn() is now deprecated +[-] Change: Only return primary group memberof if a user or contact is returned +[-] Bug fix: Contact could not be added to a group +[-] Bug fix: bool2str() function caused exchange mailbox creation to fail + + +Version 3.0 +----------- + +[+] New function: user_delete() +[+] New feature: Source code comments totally overhauled +[+] New feature: Configuration options and functions now have their visibility defined. adLDAP is now PHP 5 compatible only. +[+] New feature: Exchange mailbox creation for users +[+] New feature: Add new SMTP addresses to a user +[+] New feature: Change the default SMTP address for a user +[+] New feature: Remove an SMTP address for a user +[+] New feature: Mail enable a contact +[+] New feature: Create, query, delete contacts +[+] New feature: Enable or disable a user with user_enable() or user_disable() +[-] Bug fix: Disabling a user did not work \ No newline at end of file diff --git a/adLDAP/LICENCE.txt b/adLDAP/LICENCE.txt new file mode 100755 index 0000000..2661dc2 --- /dev/null +++ b/adLDAP/LICENCE.txt @@ -0,0 +1,457 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + diff --git a/adLDAP/README.txt b/adLDAP/README.txt new file mode 100755 index 0000000..eb49297 --- /dev/null +++ b/adLDAP/README.txt @@ -0,0 +1,43 @@ +PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY +Version 3.3.2 + +Written by Scott Barnett, Richard Hyland +email: scott@wiggumworld.com, adldap@richardhyland.com +http://adldap.sourceforge.net/ + +We'd appreciate any improvements or additions to be submitted back +to benefit the entire community :) + +PHP Version 5 with SSL and LDAP support + +I generally install libraries and classes in a folder in the document root +called "includes/". If you want to use somewhere else, just edit the +include directives in the scripts. + +The examples should be pretty self explanatory. If you require more +information, please visit http://adldap.sourceforge.net/ + +------------------- + +For full API documentation see http://adldap.sourceforge.net/wiki/doku.php?id=api + +1. Copy adLDAP.php to your server +2. Edit the configuring variables in the class itself if you so wish to +3. From your script add the following code + +require_once(dirname(__FILE__) . '/adLDAP.php'); +$adldap = new adLDAP(); + +------------------- + + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + diff --git a/adLDAP/URLs.txt b/adLDAP/URLs.txt new file mode 100755 index 0000000..5e26a57 --- /dev/null +++ b/adLDAP/URLs.txt @@ -0,0 +1,2 @@ +http://www.administrator.de/index.php?content=31891 +http://www.php.de/php-einsteiger/50623-login-mittels-active-directory-ldap.html \ No newline at end of file diff --git a/adLDAP/adLDAP.php b/adLDAP/adLDAP.php new file mode 100755 index 0000000..e3d4640 --- /dev/null +++ b/adLDAP/adLDAP.php @@ -0,0 +1,2418 @@ +_account_suffix = $_account_suffix; + } + + /** + * Get the account suffix + * + * @return string + */ + public function get_account_suffix() + { + return $this->_account_suffix; + } + + /** + * Set the domain controllers array + * + * @param array $_domain_controllers + * @return void + */ + public function set_domain_controllers(array $_domain_controllers) + { + $this->_domain_controllers = $_domain_controllers; + } + + /** + * Get the list of domain controllers + * + * @return void + */ + public function get_domain_controllers() + { + return $this->_domain_controllers; + } + + /** + * Set the username of an account with higher priviledges + * + * @param string $_ad_username + * @return void + */ + public function set_ad_username($_ad_username) + { + $this->_ad_username = $_ad_username; + } + + /** + * Get the username of the account with higher priviledges + * + * This will throw an exception for security reasons + */ + public function get_ad_username() + { + throw new adLDAPException('For security reasons you cannot access the domain administrator account details'); + } + + /** + * Set the password of an account with higher priviledges + * + * @param string $_ad_password + * @return void + */ + public function set_ad_password($_ad_password) + { + $this->_ad_password = $_ad_password; + } + + /** + * Get the password of the account with higher priviledges + * + * This will throw an exception for security reasons + */ + public function get_ad_password() + { + throw new adLDAPException('For security reasons you cannot access the domain administrator account details'); + } + + /** + * Set whether to detect the true primary group + * + * @param bool $_real_primary_group + * @return void + */ + public function set_real_primarygroup($_real_primarygroup) + { + $this->_real_primarygroup = $_real_primarygroup; + } + + /** + * Get the real primary group setting + * + * @return bool + */ + public function get_real_primarygroup() + { + return $this->_real_primarygroup; + } + + /** + * Set whether to use SSL + * + * @param bool $_use_ssl + * @return void + */ + public function set_use_ssl($_use_ssl) + { + $this->_use_ssl = $_use_ssl; + } + + /** + * Get the SSL setting + * + * @return bool + */ + public function get_use_ssl() + { + return $this->_use_ssl; + } + + /** + * Set whether to use TLS + * + * @param bool $_use_tls + * @return void + */ + public function set_use_tls($_use_tls) + { + $this->_use_tls = $_use_tls; + } + + /** + * Get the TLS setting + * + * @return bool + */ + public function get_use_tls() + { + return $this->_use_tls; + } + + /** + * Set whether to lookup recursive groups + * + * @param bool $_recursive_groups + * @return void + */ + public function set_recursive_groups($_recursive_groups) + { + $this->_recursive_groups = $_recursive_groups; + } + + /** + * Get the recursive groups setting + * + * @return bool + */ + public function get_recursive_groups() + { + return $this->_recursive_groups; + } + + /** + * Default Constructor + * + * Tries to bind to the AD domain over LDAP or LDAPs + * + * @param array $options Array of options to pass to the constructor + * @throws Exception - if unable to bind to Domain Controller + * @return bool + */ + function __construct($options=array()){ + // You can specifically overide any of the default configuration options setup above + if (count($options)>0){ + if (array_key_exists("account_suffix",$options)){ $this->_account_suffix=$options["account_suffix"]; } + if (array_key_exists("base_dn",$options)){ $this->_base_dn=$options["base_dn"]; } + if (array_key_exists("domain_controllers",$options)){ $this->_domain_controllers=$options["domain_controllers"]; } + if (array_key_exists("ad_username",$options)){ $this->_ad_username=$options["ad_username"]; } + if (array_key_exists("ad_password",$options)){ $this->_ad_password=$options["ad_password"]; } + if (array_key_exists("real_primarygroup",$options)){ $this->_real_primarygroup=$options["real_primarygroup"]; } + if (array_key_exists("use_ssl",$options)){ $this->_use_ssl=$options["use_ssl"]; } + if (array_key_exists("use_tls",$options)){ $this->_use_tls=$options["use_tls"]; } + if (array_key_exists("recursive_groups",$options)){ $this->_recursive_groups=$options["recursive_groups"]; } + } + + if ($this->ldap_supported() === false) { + throw new adLDAPException('No LDAP support for PHP. See: http://www.php.net/ldap'); + } + + return $this->connect(); + } + + /** + * Default Destructor + * + * Closes the LDAP connection + * + * @return void + */ + function __destruct(){ $this->close(); } + + /** + * Connects and Binds to the Domain Controller + * + * @return bool + */ + public function connect() { + // Connect to the AD/LDAP server as the username/password + $dc=$this->random_controller(); + if ($this->_use_ssl){ + $this->_conn = ldap_connect("ldaps://".$dc, 636); + } else { + $this->_conn = ldap_connect($dc); + } + + // Set some ldap options for talking to AD + ldap_set_option($this->_conn, LDAP_OPT_PROTOCOL_VERSION, 3); + ldap_set_option($this->_conn, LDAP_OPT_REFERRALS, 0); + + if ($this->_use_tls) { + ldap_start_tls($this->_conn); + } + + // Bind as a domain admin if they've set it up + if ($this->_ad_username!=NULL && $this->_ad_password!=NULL){ + $this->_bind = @ldap_bind($this->_conn,$this->_ad_username.$this->_account_suffix,$this->_ad_password); + if (!$this->_bind){ + if ($this->_use_ssl && !$this->_use_tls){ + // If you have problems troubleshooting, remove the @ character from the ldap_bind command above to get the actual error message + throw new adLDAPException('Bind to Active Directory failed. Either the LDAPs connection failed or the login credentials are incorrect. AD said: ' . $this->get_last_error()); + } else { + throw new adLDAPException('Bind to Active Directory failed. Check the login credentials and/or server details. AD said: ' . $this->get_last_error()); + } + } + } + + if ($this->_base_dn == NULL) { + $this->_base_dn = $this->find_base_dn(); + } + + return (true); + } + + /** + * Closes the LDAP connection + * + * @return void + */ + public function close() { + ldap_close ($this->_conn); + } + + /** + * Validate a user's login credentials + * + * @param string $username A user's AD username + * @param string $password A user's AD password + * @param bool optional $prevent_rebind + * @return bool + */ + public function authenticate($username, $password, $prevent_rebind = false) { + // Prevent null binding + if ($username === NULL || $password === NULL) { return false; } + if (empty($username) || empty($password)) { return false; } + + // Bind as the user + $ret = true; + $this->_bind = @ldap_bind($this->_conn, $username . $this->_account_suffix, $password); + if (!$this->_bind){ $ret = false; } + + // Cnce we've checked their details, kick back into admin mode if we have it + if ($this->_ad_username !== NULL && !$prevent_rebind) { + $this->_bind = @ldap_bind($this->_conn, $this->_ad_username . $this->_account_suffix , $this->_ad_password); + if (!$this->_bind){ + // This should never happen in theory + throw new adLDAPException('Rebind to Active Directory failed. AD said: ' . $this->get_last_error()); + } + } + + return $ret; + } + + //***************************************************************************************************************** + // GROUP FUNCTIONS + + /** + * Add a group to a group + * + * @param string $parent The parent group name + * @param string $child The child group name + * @return bool + */ + public function group_add_group($parent,$child){ + + // Find the parent group's dn + $parent_group=$this->group_info($parent,array("cn")); + if ($parent_group[0]["dn"]===NULL){ return (false); } + $parent_dn=$parent_group[0]["dn"]; + + // Find the child group's dn + $child_group=$this->group_info($child,array("cn")); + if ($child_group[0]["dn"]===NULL){ return (false); } + $child_dn=$child_group[0]["dn"]; + + $add=array(); + $add["member"] = $child_dn; + + $result=@ldap_mod_add($this->_conn,$parent_dn,$add); + if ($result==false){ return (false); } + return (true); + } + + /** + * Add a user to a group + * + * @param string $group The group to add the user to + * @param string $user The user to add to the group + * @param bool $isGUID Is the username passed a GUID or a samAccountName + * @return bool + */ + public function group_add_user($group,$user,$isGUID=false){ + // Adding a user is a bit fiddly, we need to get the full DN of the user + // and add it using the full DN of the group + + // Find the user's dn + $user_dn=$this->user_dn($user,$isGUID); + if ($user_dn===false){ return (false); } + + // Find the group's dn + $group_info=$this->group_info($group,array("cn")); + if ($group_info[0]["dn"]===NULL){ return (false); } + $group_dn=$group_info[0]["dn"]; + + $add=array(); + $add["member"] = $user_dn; + + $result=@ldap_mod_add($this->_conn,$group_dn,$add); + if ($result==false){ return (false); } + return (true); + } + + /** + * Add a contact to a group + * + * @param string $group The group to add the contact to + * @param string $contact_dn The DN of the contact to add + * @return bool + */ + public function group_add_contact($group,$contact_dn){ + // To add a contact we take the contact's DN + // and add it using the full DN of the group + + // Find the group's dn + $group_info=$this->group_info($group,array("cn")); + if ($group_info[0]["dn"]===NULL){ return (false); } + $group_dn=$group_info[0]["dn"]; + + $add=array(); + $add["member"] = $contact_dn; + + $result=@ldap_mod_add($this->_conn,$group_dn,$add); + if ($result==false){ return (false); } + return (true); + } + + /** + * Create a group + * + * @param array $attributes Default attributes of the group + * @return bool + */ + public function group_create($attributes){ + if (!is_array($attributes)){ return ("Attributes must be an array"); } + if (!array_key_exists("group_name",$attributes)){ return ("Missing compulsory field [group_name]"); } + if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); } + if (!array_key_exists("description",$attributes)){ return ("Missing compulsory field [description]"); } + if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); } + $attributes["container"]=array_reverse($attributes["container"]); + + //$member_array = array(); + //$member_array[0] = "cn=user1,cn=Users,dc=yourdomain,dc=com"; + //$member_array[1] = "cn=administrator,cn=Users,dc=yourdomain,dc=com"; + + $add=array(); + $add["cn"] = $attributes["group_name"]; + $add["samaccountname"] = $attributes["group_name"]; + $add["objectClass"] = "Group"; + $add["description"] = $attributes["description"]; + //$add["member"] = $member_array; UNTESTED + + $container="OU=".implode(",OU=",$attributes["container"]); + $result=ldap_add($this->_conn,"CN=".$add["cn"].", ".$container.",".$this->_base_dn,$add); + if ($result!=true){ return (false); } + + return (true); + } + + /** + * Remove a group from a group + * + * @param string $parent The parent group name + * @param string $child The child group name + * @return bool + */ + public function group_del_group($parent,$child){ + + // Find the parent dn + $parent_group=$this->group_info($parent,array("cn")); + if ($parent_group[0]["dn"]===NULL){ return (false); } + $parent_dn=$parent_group[0]["dn"]; + + // Find the child dn + $child_group=$this->group_info($child,array("cn")); + if ($child_group[0]["dn"]===NULL){ return (false); } + $child_dn=$child_group[0]["dn"]; + + $del=array(); + $del["member"] = $child_dn; + + $result=@ldap_mod_del($this->_conn,$parent_dn,$del); + if ($result==false){ return (false); } + return (true); + } + + /** + * Remove a user from a group + * + * @param string $group The group to remove a user from + * @param string $user The AD user to remove from the group + * @param bool $isGUID Is the username passed a GUID or a samAccountName + * @return bool + */ + public function group_del_user($group,$user,$isGUID=false){ + + // Find the parent dn + $group_info=$this->group_info($group,array("cn")); + if ($group_info[0]["dn"]===NULL){ return (false); } + $group_dn=$group_info[0]["dn"]; + + // Find the users dn + $user_dn=$this->user_dn($user,$isGUID); + if ($user_dn===false){ return (false); } + + $del=array(); + $del["member"] = $user_dn; + + $result=@ldap_mod_del($this->_conn,$group_dn,$del); + if ($result==false){ return (false); } + return (true); + } + + /** + * Remove a contact from a group + * + * @param string $group The group to remove a user from + * @param string $contact_dn The DN of a contact to remove from the group + * @return bool + */ + public function group_del_contact($group,$contact_dn){ + + // Find the parent dn + $group_info=$this->group_info($group,array("cn")); + if ($group_info[0]["dn"]===NULL){ return (false); } + $group_dn=$group_info[0]["dn"]; + + $del=array(); + $del["member"] = $contact_dn; + + $result=@ldap_mod_del($this->_conn,$group_dn,$del); + if ($result==false){ return (false); } + return (true); + } + + /** + * Return a list of groups in a group + * + * @param string $group The group to query + * @param bool $recursive Recursively get groups + * @return array + */ + public function groups_in_group($group, $recursive = NULL){ + if (!$this->_bind){ return (false); } + if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it + + // Search the directory for the members of a group + $info=$this->group_info($group,array("member","cn")); + $groups=$info[0]["member"]; + if (!is_array($groups)) { + return (false); + } + + $group_array=array(); + + for ($i=0; $i<$groups["count"]; $i++){ + $filter="(&(objectCategory=group)(distinguishedName=".$this->ldap_slashes($groups[$i])."))"; + $fields = array("samaccountname", "distinguishedname", "objectClass"); + $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields); + $entries = ldap_get_entries($this->_conn, $sr); + + // not a person, look for a group + if ($entries['count'] == 0 && $recursive == true) { + $filter="(&(objectCategory=group)(distinguishedName=".$this->ldap_slashes($groups[$i])."))"; + $fields = array("distinguishedname"); + $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields); + $entries = ldap_get_entries($this->_conn, $sr); + if (!isset($entries[0]['distinguishedname'][0])) { + continue; + } + $sub_groups = $this->groups_in_group($entries[0]['distinguishedname'][0], $recursive); + if (is_array($sub_groups)) { + $group_array = array_merge($group_array, $sub_groups); + $group_array = array_unique($group_array); + } + continue; + } + + $group_array[] = $entries[0]['distinguishedname'][0]; + } + return ($group_array); + } + + /** + * Return a list of members in a group + * + * @param string $group The group to query + * @param bool $recursive Recursively get group members + * @return array + */ + public function group_members($group, $recursive = NULL){ + if (!$this->_bind){ return (false); } + if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it + // Search the directory for the members of a group + $info=$this->group_info($group,array("member","cn")); + $users=$info[0]["member"]; + if (!is_array($users)) { + return (false); + } + + $user_array=array(); + + for ($i=0; $i<$users["count"]; $i++){ + $filter="(&(objectCategory=person)(distinguishedName=".$this->ldap_slashes($users[$i])."))"; + $fields = array("samaccountname", "distinguishedname", "objectClass"); + $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields); + $entries = ldap_get_entries($this->_conn, $sr); + + // not a person, look for a group + if ($entries['count'] == 0 && $recursive == true) { + $filter="(&(objectCategory=group)(distinguishedName=".$this->ldap_slashes($users[$i])."))"; + $fields = array("samaccountname"); + $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields); + $entries = ldap_get_entries($this->_conn, $sr); + if (!isset($entries[0]['samaccountname'][0])) { + continue; + } + $sub_users = $this->group_members($entries[0]['samaccountname'][0], $recursive); + if (is_array($sub_users)) { + $user_array = array_merge($user_array, $sub_users); + $user_array = array_unique($user_array); + } + continue; + } + + if ($entries[0]['samaccountname'][0] === NULL && $entries[0]['distinguishedname'][0] !== NULL) { + $user_array[] = $entries[0]['distinguishedname'][0]; + } + elseif ($entries[0]['samaccountname'][0] !== NULL) { + $user_array[] = $entries[0]['samaccountname'][0]; + } + } + return ($user_array); + } + + /** + * Group Information. Returns an array of information about a group. + * The group name is case sensitive + * + * @param string $group_name The group name to retrieve info about + * @param array $fields Fields to retrieve + * @return array + */ + public function group_info($group_name,$fields=NULL){ + if ($group_name===NULL){ return (false); } + if (!$this->_bind){ return (false); } + + if (stristr($group_name, '+')) { + $group_name=stripslashes($group_name); + } + + $filter="(&(objectCategory=group)(name=".$this->ldap_slashes($group_name)."))"; + //echo ($filter."!!!
"); + if ($fields===NULL){ $fields=array("member","memberof","cn","description","distinguishedname","objectcategory","samaccountname"); } + $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields); + $entries = ldap_get_entries($this->_conn, $sr); + //print_r($entries); + return ($entries); + } + + /** + * Return a complete list of "groups in groups" + * + * @param string $group The group to get the list from + * @return array + */ + public function recursive_groups($group){ + if ($group===NULL){ return (false); } + + $ret_groups=array(); + + $groups=$this->group_info($group,array("memberof")); + if (isset($groups[0]["memberof"]) && is_array($groups[0]["memberof"])) { + $groups=$groups[0]["memberof"]; + + if ($groups){ + $group_names=$this->nice_names($groups); + $ret_groups=array_merge($ret_groups,$group_names); //final groups to return + + foreach ($group_names as $id => $group_name){ + $child_groups=$this->recursive_groups($group_name); + $ret_groups=array_merge($ret_groups,$child_groups); + } + } + } + + return ($ret_groups); + } + + /** + * Returns a complete list of the groups in AD based on a SAM Account Type + * + * @param string $samaccounttype The account type to return + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function search_groups($samaccounttype = ADLDAP_SECURITY_GLOBAL_GROUP, $include_desc = false, $search = "*", $sorted = true) { + if (!$this->_bind){ return (false); } + + $filter = '(&(objectCategory=group)'; + if ($samaccounttype !== null) { + $filter .= '(samaccounttype='. $samaccounttype .')'; + } + $filter .= '(cn='.$search.'))'; + // Perform the search and grab all their details + $fields=array("samaccountname","description"); + $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields); + $entries = ldap_get_entries($this->_conn, $sr); + + $groups_array = array(); + for ($i=0; $i<$entries["count"]; $i++){ + if ($include_desc && strlen($entries[$i]["description"][0]) > 0 ){ + $groups_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["description"][0]; + } elseif ($include_desc){ + $groups_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["samaccountname"][0]; + } else { + array_push($groups_array, $entries[$i]["samaccountname"][0]); + } + } + if( $sorted ){ asort($groups_array); } + return ($groups_array); + } + + /** + * Returns a complete list of all groups in AD + * + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function all_groups($include_desc = false, $search = "*", $sorted = true){ + $groups_array = $this->search_groups(null, $include_desc, $search, $sorted); + return ($groups_array); + } + + /** + * Returns a complete list of security groups in AD + * + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function all_security_groups($include_desc = false, $search = "*", $sorted = true){ + $groups_array = $this->search_groups(ADLDAP_SECURITY_GLOBAL_GROUP, $include_desc, $search, $sorted); + return ($groups_array); + } + + /** + * Returns a complete list of distribution lists in AD + * + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function all_distribution_groups($include_desc = false, $search = "*", $sorted = true){ + $groups_array = $this->search_groups(ADLDAP_DISTRIBUTION_GROUP, $include_desc, $search, $sorted); + return ($groups_array); + } + + //***************************************************************************************************************** + // USER FUNCTIONS + + /** + * Create a user + * + * If you specify a password here, this can only be performed over SSL + * + * @param array $attributes The attributes to set to the user account + * @return bool + */ + public function user_create($attributes){ + // Check for compulsory fields + if (!array_key_exists("username",$attributes)){ return ("Missing compulsory field [username]"); } + if (!array_key_exists("firstname",$attributes)){ return ("Missing compulsory field [firstname]"); } + if (!array_key_exists("surname",$attributes)){ return ("Missing compulsory field [surname]"); } + if (!array_key_exists("email",$attributes)){ return ("Missing compulsory field [email]"); } + if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); } + if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); } + + if (array_key_exists("password",$attributes) && (!$this->_use_ssl && !$this->_use_tls)){ + throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.'); + } + + if (!array_key_exists("display_name",$attributes)){ $attributes["display_name"]=$attributes["firstname"]." ".$attributes["surname"]; } + + // Translate the schema + $add=$this->adldap_schema($attributes); + + // Additional stuff only used for adding accounts + $add["cn"][0]=$attributes["display_name"]; + $add["samaccountname"][0]=$attributes["username"]; + $add["objectclass"][0]="top"; + $add["objectclass"][1]="person"; + $add["objectclass"][2]="organizationalPerson"; + $add["objectclass"][3]="user"; //person? + //$add["name"][0]=$attributes["firstname"]." ".$attributes["surname"]; + + // Set the account control attribute + $control_options=array("NORMAL_ACCOUNT"); + if (!$attributes["enabled"]){ $control_options[]="ACCOUNTDISABLE"; } + $add["userAccountControl"][0]=$this->account_control($control_options); + //echo ("

"); print_r($add);
+
+        // Determine the container
+        $attributes["container"]=array_reverse($attributes["container"]);
+        $container="OU=".implode(",OU=",$attributes["container"]);
+
+        // Add the entry
+        $result=@ldap_add($this->_conn, "CN=".$add["cn"][0].", ".$container.",".$this->_base_dn, $add);
+        if ($result!=true){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Delete a user account
+    * 
+    * @param string $username The username to delete (please be careful here!)
+    * @param bool $isGUID Is the username a GUID or a samAccountName
+    * @return array
+    */
+    public function user_delete($username,$isGUID=false) {      
+        $userinfo = $this->user_info($username, array("*"),$isGUID);
+        $dn = $userinfo[0]['distinguishedname'][0];
+        $result=$this->dn_delete($dn);
+        if ($result!=true){ return (false); }        
+        return (true);
+    }
+    
+    /**
+    * Groups the user is a member of
+    * 
+    * @param string $username The username to query
+    * @param bool $recursive Recursive list of groups
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return array
+    */
+    public function user_groups($username,$recursive=NULL,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+        
+        // Search the directory for their information
+        $info=@$this->user_info($username,array("memberof","primarygroupid"),$isGUID);
+        $groups=$this->nice_names($info[0]["memberof"]); // Presuming the entry returned is our guy (unique usernames)
+
+        if ($recursive === true){
+            foreach ($groups as $id => $group_name){
+                $extra_groups=$this->recursive_groups($group_name);
+                $groups=array_merge($groups,$extra_groups);
+            }
+        }
+        
+        return ($groups);
+    }
+    
+    /**
+    * Find information about the users
+    * 
+    * @param string $username The username to query
+    * @param array $fields Array of parameters to query
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return array
+    */
+    public function user_info($username,$fields=NULL,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+
+        if ($isGUID === true) {
+            $username = $this->strguid2hex($username);
+            $filter="objectguid=".$username;
+        }
+        else if (strstr($username, "@")) {
+             $filter="userPrincipalName=".$username;
+        }
+        else {
+             $filter="samaccountname=".$username;
+        }
+        $filter = "(&(objectCategory=person)({$filter}))";
+        if ($fields===NULL){ $fields=array("samaccountname","mail","memberof","department","displayname","telephonenumber","primarygroupid","objectsid"); }
+        if (!in_array("objectsid",$fields)){
+            $fields[] = "objectsid";
+        }
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        if (isset($entries[0])) {
+            if ($entries[0]['count'] >= 1) {
+                if (in_array("memberof", $fields)) {
+                    // AD does not return the primary group in the ldap query, we may need to fudge it
+                    if ($this->_real_primarygroup && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["objectsid"][0])){
+                        //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
+                        $entries[0]["memberof"][]=$this->get_primary_group($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
+                    } else {
+                        $entries[0]["memberof"][]="CN=Domain Users,CN=Users,".$this->_base_dn;
+                    }
+                    $entries[0]["memberof"]["count"]++;
+                }
+            }
+            return $entries;
+        }
+        return false;
+    }
+    
+    /**
+    * Determine if a user is in a specific group
+    * 
+    * @param string $username The username to query
+    * @param string $group The name of the group to check against
+    * @param bool $recursive Check groups recursively
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_ingroup($username,$group,$recursive=NULL,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if ($group===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it
+        
+        // Get a list of the groups
+        $groups=$this->user_groups($username,$recursive,$isGUID);
+        
+        // Return true if the specified group is in the group list
+        if (in_array($group,$groups)){ return (true); }
+
+        return (false);
+    }
+    
+    /**
+    * Determine a user's password expiry date
+    * 
+    * @param string $username The username to query
+    * @param book $isGUID Is the username passed a GUID or a samAccountName
+    * @requires bcmath http://www.php.net/manual/en/book.bc.php
+    * @return array
+    */
+    public function user_password_expiry($username,$isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        if (!$this->_bind){ return (false); }
+        if (!function_exists('bcmod')) { return ("Missing function support [bcmod] http://www.php.net/manual/en/book.bc.php"); };
+        
+        $userinfo = $this->user_info($username, array("pwdlastset", "useraccountcontrol"), $isGUID);
+        $pwdlastset = $userinfo[0]['pwdlastset'][0];
+        $status = array();
+        
+        if ($userinfo[0]['useraccountcontrol'][0] == '66048') {
+            // Password does not expire
+            return "Does not expire";
+        }
+        if ($pwdlastset === '0') {
+            // Password has already expired
+            return "Password has expired";
+        }
+        
+         // Password expiry in AD can be calculated from TWO values:
+         //   - User's own pwdLastSet attribute: stores the last time the password was changed
+         //   - Domain's maxPwdAge attribute: how long passwords last in the domain
+         //
+         // Although Microsoft chose to use a different base and unit for time measurements.
+         // This function will convert them to Unix timestamps
+         $sr = ldap_read($this->_conn, $this->_base_dn, 'objectclass=*', array('maxPwdAge'));
+         if (!$sr) {
+             return false;
+         }
+         $info = ldap_get_entries($this->_conn, $sr);
+         $maxpwdage = $info[0]['maxpwdage'][0];
+         
+
+         // See MSDN: http://msdn.microsoft.com/en-us/library/ms974598.aspx
+         //
+         // pwdLastSet contains the number of 100 nanosecond intervals since January 1, 1601 (UTC), 
+         // stored in a 64 bit integer. 
+         //
+         // The number of seconds between this date and Unix epoch is 11644473600.
+         //
+         // maxPwdAge is stored as a large integer that represents the number of 100 nanosecond
+         // intervals from the time the password was set before the password expires.
+         //
+         // We also need to scale this to seconds but also this value is a _negative_ quantity!
+         //
+         // If the low 32 bits of maxPwdAge are equal to 0 passwords do not expire
+         //
+         // Unfortunately the maths involved are too big for PHP integers, so I've had to require
+         // BCMath functions to work with arbitrary precision numbers.
+         if (bcmod($maxpwdage, 4294967296) === '0') {
+            return "Domain does not expire passwords";
+        }
+        
+        // Add maxpwdage and pwdlastset and we get password expiration time in Microsoft's
+        // time units.  Because maxpwd age is negative we need to subtract it.
+        $pwdexpire = bcsub($pwdlastset, $maxpwdage);
+    
+        // Convert MS's time to Unix time
+        $status['expiryts'] = bcsub(bcdiv($pwdexpire, '10000000'), '11644473600');
+        $status['expiryformat'] = date('Y-m-d H:i:s', bcsub(bcdiv($pwdexpire, '10000000'), '11644473600'));
+        
+        return $status;
+    }
+    
+    /**
+    * Modify a user
+    * 
+    * @param string $username The username to query
+    * @param array $attributes The attributes to modify.  Note if you set the enabled attribute you must not specify any other attributes
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_modify($username,$attributes,$isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        if (array_key_exists("password",$attributes) && !$this->_use_ssl){ 
+            throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');
+        }
+
+        // Find the dn of the user
+        $user_dn=$this->user_dn($username,$isGUID);
+        if ($user_dn===false){ return (false); }
+        
+        // Translate the update to the LDAP schema                
+        $mod=$this->adldap_schema($attributes);
+        
+        // Check to see if this is an enabled status update
+        if (!$mod && !array_key_exists("enabled", $attributes)){ return (false); }
+        
+        // Set the account control attribute (only if specified)
+        if (array_key_exists("enabled",$attributes)){
+            if ($attributes["enabled"]){ $control_options=array("NORMAL_ACCOUNT"); }
+            else { $control_options=array("NORMAL_ACCOUNT","ACCOUNTDISABLE"); }
+            $mod["userAccountControl"][0]=$this->account_control($control_options);
+        }
+
+        // Do the update
+        $result=@ldap_modify($this->_conn,$user_dn,$mod);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Disable a user account
+    * 
+    * @param string $username The username to disable
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_disable($username,$isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        $attributes=array("enabled"=>0);
+        $result = $this->user_modify($username, $attributes, $isGUID);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Enable a user account
+    * 
+    * @param string $username The username to enable
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_enable($username,$isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        $attributes=array("enabled"=>1);
+        $result = $this->user_modify($username, $attributes, $isGUID);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Set the password of a user - This must be performed over SSL
+    * 
+    * @param string $username The username to modify
+    * @param string $password The new password
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_password($username,$password,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if ($password===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if (!$this->_use_ssl && !$this->_use_tls){ 
+            throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');
+        }
+        
+        $user_dn=$this->user_dn($username,$isGUID);
+        if ($user_dn===false){ return (false); }
+                
+        $add=array();
+        $add["unicodePwd"][0]=$this->encode_password($password);
+        
+        $result=ldap_mod_replace($this->_conn,$user_dn,$add);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Return a list of all users in AD
+    * 
+    * @param bool $include_desc Return a description of the user
+    * @param string $search Search parameter
+    * @param bool $sorted Sort the user accounts
+    * @return array
+    */
+    public function all_users($include_desc = false, $search = "*", $sorted = true){
+        if (!$this->_bind){ return (false); }
+        
+        // Perform the search and grab all their details
+        $filter = "(&(objectClass=user)(samaccounttype=". ADLDAP_NORMAL_ACCOUNT .")(objectCategory=person)(cn=".$search."))";
+        $fields=array("samaccountname","displayname");
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+
+        $users_array = array();
+        for ($i=0; $i<$entries["count"]; $i++){
+            if ($include_desc && strlen($entries[$i]["displayname"][0])>0){
+                $users_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["displayname"][0];
+            } elseif ($include_desc){
+                $users_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["samaccountname"][0];
+            } else {
+                array_push($users_array, $entries[$i]["samaccountname"][0]);
+            }
+        }
+        if ($sorted){ asort($users_array); }
+        return ($users_array);
+    }
+    
+    /**
+    * Converts a username (samAccountName) to a GUID
+    * 
+    * @param string $username The username to query
+    * @return string
+    */
+    public function username2guid($username) {
+        if (!$this->_bind){ return (false); }
+        if ($username === null){ return ("Missing compulsory field [username]"); }
+        
+        $filter = "samaccountname=" . $username; 
+        $fields = array("objectGUID"); 
+        $sr = @ldap_search($this->_conn, $this->_base_dn, $filter, $fields); 
+        if (ldap_count_entries($this->_conn, $sr) > 0) { 
+            $entry = @ldap_first_entry($this->_conn, $sr); 
+            $guid = @ldap_get_values_len($this->_conn, $entry, 'objectGUID'); 
+            $strGUID = $this->binary2text($guid[0]);          
+            return ($strGUID); 
+        }
+        else { 
+            return (false); 
+        } 
+    }
+    
+    /**
+    * Move a user account to a different OU
+    *
+    * @param string $username The username to move (please be careful here!)
+    * @param array $container The container or containers to move the user to (please be careful here!).
+    * accepts containers in 1. parent 2. child order
+    * @return array
+    */
+    public function user_move($username, $container) {
+        if (!$this->_bind){ return (false); }
+        if ($username === null){ return ("Missing compulsory field [username]"); }
+        if ($container === null){ return ("Missing compulsory field [container]"); }
+        if (!is_array($container)){ return ("Container must be an array"); }
+        
+        $userinfo = $this->user_info($username, array("*"));
+        $dn = $userinfo[0]['distinguishedname'][0];
+        $newrdn = "cn=" . $username;
+        $container = array_reverse($container);
+        $newcontainer = "ou=" . implode(",ou=",$container);
+        $newbasedn = strtolower($newcontainer) . "," . $this->_base_dn;
+        $result=@ldap_rename($this->_conn,$dn,$newrdn,$newbasedn,true);
+        if ($result !== true) {
+            return (false);
+        }
+        return (true);
+    }
+    
+    //*****************************************************************************************************************
+    // CONTACT FUNCTIONS
+    // * Still work to do in this area, and new functions to write
+    
+    /**
+    * Create a contact
+    * 
+    * @param array $attributes The attributes to set to the contact
+    * @return bool
+    */
+    public function contact_create($attributes){
+        // Check for compulsory fields
+        if (!array_key_exists("display_name",$attributes)){ return ("Missing compulsory field [display_name]"); }
+        if (!array_key_exists("email",$attributes)){ return ("Missing compulsory field [email]"); }
+        if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); }
+        if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); }
+
+        // Translate the schema
+        $add=$this->adldap_schema($attributes);
+        
+        // Additional stuff only used for adding contacts
+        $add["cn"][0]=$attributes["display_name"];
+        $add["objectclass"][0]="top";
+        $add["objectclass"][1]="person";
+        $add["objectclass"][2]="organizationalPerson";
+        $add["objectclass"][3]="contact"; 
+        if (!isset($attributes['exchange_hidefromlists'])) {
+            $add["msExchHideFromAddressLists"][0]="TRUE";
+        }
+
+        // Determine the container
+        $attributes["container"]=array_reverse($attributes["container"]);
+        $container="OU=".implode(",OU=",$attributes["container"]);
+
+        // Add the entry
+        $result=@ldap_add($this->_conn, "CN=".$add["cn"][0].", ".$container.",".$this->_base_dn, $add);
+        if ($result!=true){ return (false); }
+        
+        return (true);
+    }  
+    
+    /**
+    * Determine the list of groups a contact is a member of
+    * 
+    * @param string $distinguisedname The full DN of a contact
+    * @param bool $recursive Recursively check groups
+    * @return array
+    */
+    public function contact_groups($distinguishedname,$recursive=NULL){
+        if ($distinguishedname===NULL){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+        
+        // Search the directory for their information
+        $info=@$this->contact_info($distinguishedname,array("memberof","primarygroupid"));
+        $groups=$this->nice_names($info[0]["memberof"]); //presuming the entry returned is our contact
+
+        if ($recursive === true){
+            foreach ($groups as $id => $group_name){
+                $extra_groups=$this->recursive_groups($group_name);
+                $groups=array_merge($groups,$extra_groups);
+            }
+        }
+        
+        return ($groups);
+    }
+    
+    /**
+    * Get contact information
+    * 
+    * @param string $distinguisedname The full DN of a contact
+    * @param array $fields Attributes to be returned
+    * @return array
+    */
+    public function contact_info($distinguishedname,$fields=NULL){
+        if ($distinguishedname===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+
+        $filter="distinguishedName=".$distinguishedname;
+        if ($fields===NULL){ $fields=array("distinguishedname","mail","memberof","department","displayname","telephonenumber","primarygroupid","objectsid"); }
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        if ($entries[0]['count'] >= 1) {
+            // AD does not return the primary group in the ldap query, we may need to fudge it
+            if ($this->_real_primarygroup && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["primarygroupid"][0])){
+                //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
+                $entries[0]["memberof"][]=$this->get_primary_group($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
+            } else {
+                $entries[0]["memberof"][]="CN=Domain Users,CN=Users,".$this->_base_dn;
+            }
+        }
+        
+        $entries[0]["memberof"]["count"]++;
+        return ($entries);
+    }
+    
+    /**
+    * Determine if a contact is a member of a group
+    * 
+    * @param string $distinguisedname The full DN of a contact
+    * @param string $group The group name to query
+    * @param bool $recursive Recursively check groups
+    * @return bool
+    */
+    public function contact_ingroup($distinguisedname,$group,$recursive=NULL){
+        if ($distinguisedname===NULL){ return (false); }
+        if ($group===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        
+        // Get a list of the groups
+        $groups=$this->contact_groups($distinguisedname,array("memberof"),$recursive);
+        
+        // Return true if the specified group is in the group list
+        if (in_array($group,$groups)){ return (true); }
+
+        return (false);
+    }          
+    
+    /**
+    * Modify a contact
+    * 
+    * @param string $distinguishedname The contact to query
+    * @param array $attributes The attributes to modify.  Note if you set the enabled attribute you must not specify any other attributes
+    * @return bool
+    */
+    public function contact_modify($distinguishedname,$attributes){
+        if ($distinguishedname===NULL){ return ("Missing compulsory field [distinguishedname]"); }
+        
+        // Translate the update to the LDAP schema                
+        $mod=$this->adldap_schema($attributes);
+        
+        // Check to see if this is an enabled status update
+        if (!$mod){ return (false); }
+        
+        // Do the update
+        $result=ldap_modify($this->_conn,$distinguishedname,$mod);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Delete a contact
+    * 
+    * @param string $distinguishedname The contact dn to delete (please be careful here!)
+    * @return array
+    */
+    public function contact_delete($distinguishedname) {
+        $result = $this->dn_delete($distinguishedname);
+        if ($result!=true){ return (false); }       
+        return (true);
+    }
+    
+    /**
+    * Return a list of all contacts
+    * 
+    * @param bool $include_desc Include a description of a contact
+    * @param string $search The search parameters
+    * @param bool $sorted Whether to sort the results
+    * @return array
+    */
+    public function all_contacts($include_desc = false, $search = "*", $sorted = true){
+        if (!$this->_bind){ return (false); }
+        
+        // Perform the search and grab all their details
+        $filter = "(&(objectClass=contact)(cn=".$search."))";
+        $fields=array("displayname","distinguishedname");           
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+
+        $users_array = array();
+        for ($i=0; $i<$entries["count"]; $i++){
+            if ($include_desc && strlen($entries[$i]["displayname"][0])>0){
+                $users_array[ $entries[$i]["distinguishedname"][0] ] = $entries[$i]["displayname"][0];
+            } elseif ($include_desc){
+                $users_array[ $entries[$i]["distinguishedname"][0] ] = $entries[$i]["distinguishedname"][0];
+            } else {
+                array_push($users_array, $entries[$i]["distinguishedname"][0]);
+            }
+        }
+        if ($sorted){ asort($users_array); }
+        return ($users_array);
+    }
+    
+    //*****************************************************************************************************************
+    // FOLDER FUNCTIONS
+    
+    /**
+    * Returns a folder listing for a specific OU
+    * See http://adldap.sourceforge.net/wiki/doku.php?id=api_folder_functions
+    * 
+    * @param array $folder_name An array to the OU you wish to list. 
+    *                           If set to NULL will list the root, strongly recommended to set 
+    *                           $recursive to false in that instance!
+    * @param string $dn_type The type of record to list.  This can be ADLDAP_FOLDER or ADLDAP_CONTAINER.
+    * @param bool $recursive Recursively search sub folders
+    * @param bool $type Specify a type of object to search for
+    * @return array
+    */
+    public function folder_list($folder_name = NULL, $dn_type = ADLDAP_FOLDER, $recursive = NULL, $type = NULL) {
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+
+        $filter = '(&';
+        if ($type !== NULL) {
+            switch ($type) {
+                case 'contact':
+                    $filter .= '(objectClass=contact)';
+                    break;
+                case 'computer':
+                    $filter .= '(objectClass=computer)';
+                    break;
+                case 'group':
+                    $filter .= '(objectClass=group)';
+                    break;
+                case 'folder':
+                    $filter .= '(objectClass=organizationalUnit)';
+                    break;
+                case 'container':
+                    $filter .= '(objectClass=container)';
+                    break;
+                case 'domain':
+                    $filter .= '(objectClass=builtinDomain)';
+                    break;
+                default:
+                    $filter .= '(objectClass=user)';
+                    break;   
+            }
+        }
+        else {
+            $filter .= '(objectClass=*)';   
+        }
+        // If the folder name is null then we will search the root level of AD
+        // This requires us to not have an OU= part, just the base_dn
+        $searchou = $this->_base_dn;
+        if (is_array($folder_name)) {
+            $ou = $dn_type . "=".implode("," . $dn_type . "=",$folder_name);
+            $filter .= '(!(distinguishedname=' . $ou . ',' . $this->_base_dn . ')))';
+            $searchou = $ou . ',' . $this->_base_dn;
+        }
+        else {
+            $filter .= '(!(distinguishedname=' . $this->_base_dn . ')))';
+        }
+
+        if ($recursive === true) {
+            $sr=ldap_search($this->_conn, $searchou, $filter, array('objectclass', 'distinguishedname', 'samaccountname'));
+            $entries = @ldap_get_entries($this->_conn, $sr);
+            if (is_array($entries)) {
+                return $entries;
+            }
+        }
+        else {
+            $sr=ldap_list($this->_conn, $searchou, $filter, array('objectclass', 'distinguishedname', 'samaccountname'));
+            $entries = @ldap_get_entries($this->_conn, $sr);
+            if (is_array($entries)) {
+                return $entries;
+            }
+        }
+        
+        return false;
+    }
+    
+    //*****************************************************************************************************************
+    // COMPUTER FUNCTIONS
+    
+    /**
+    * Get information about a specific computer
+    * 
+    * @param string $computer_name The name of the computer
+    * @param array $fields Attributes to return
+    * @return array
+    */
+    public function computer_info($computer_name,$fields=NULL){
+        if ($computer_name===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+
+        $filter="(&(objectClass=computer)(cn=".$computer_name."))";
+        if ($fields===NULL){ $fields=array("memberof","cn","displayname","dnshostname","distinguishedname","objectcategory","operatingsystem","operatingsystemservicepack","operatingsystemversion"); }
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        return ($entries);
+    }
+    
+    /**
+    * Check if a computer is in a group
+    * 
+    * @param string $computer_name The name of the computer
+    * @param string $group The group to check
+    * @param bool $recursive Whether to check recursively
+    * @return array
+    */
+    public function computer_ingroup($computer_name,$group,$recursive=NULL){
+        if ($computer_name===NULL){ return (false); }
+        if ($group===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // use the default option if they haven't set it
+
+        //get a list of the groups
+        $groups=$this->computer_groups($computer_name,array("memberof"),$recursive);
+
+        //return true if the specified group is in the group list
+        if (in_array($group,$groups)){ return (true); }
+
+        return (false);
+    }
+    
+    /**
+    * Get the groups a computer is in
+    * 
+    * @param string $computer_name The name of the computer
+    * @param bool $recursive Whether to check recursively
+    * @return array
+    */
+    public function computer_groups($computer_name,$recursive=NULL){
+        if ($computer_name===NULL){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+
+        //search the directory for their information
+        $info=@$this->computer_info($computer_name,array("memberof","primarygroupid"));
+        $groups=$this->nice_names($info[0]["memberof"]); //presuming the entry returned is our guy (unique usernames)
+
+        if ($recursive === true){
+            foreach ($groups as $id => $group_name){
+              $extra_groups=$this->recursive_groups($group_name);
+              $groups=array_merge($groups,$extra_groups);
+            }
+        }
+
+        return ($groups);
+    }
+    
+    //************************************************************************************************************
+    //  ORGANIZATIONAL UNIT FUNCTIONS
+    
+     /**
+    * Create an organizational unit
+    * 
+    * @param array $attributes Default attributes of the ou
+    * @return bool
+    */
+    public function ou_create($attributes){
+        if (!is_array($attributes)){ return ("Attributes must be an array"); }
+        if (!array_key_exists("ou_name",$attributes)){ return ("Missing compulsory field [ou_name]"); }
+        if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); }
+        if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); }
+        $attributes["container"]=array_reverse($attributes["container"]);
+
+        $add=array();
+        $add["objectClass"] = "organizationalUnit";
+
+        $container="OU=".implode(",OU=",$attributes["container"]);
+        $result=ldap_add($this->_conn,"CN=".$add["cn"].", ".$container.",".$this->_base_dn,$add);
+        if ($result!=true){ return (false); }
+        
+        return (true);
+    }
+    
+    //************************************************************************************************************
+    // EXCHANGE FUNCTIONS
+    
+    /**
+    * Create an Exchange account
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param array $storagegroup The mailbox, Exchange Storage Group, for the user account, this must be a full CN
+    *                            If the storage group has a different base_dn to the adLDAP configuration, set it using $base_dn
+    * @param string $emailaddress The primary email address to add to this user
+    * @param string $mailnickname The mail nick name.  If mail nickname is blank, the username will be used
+    * @param bool $usedefaults Indicates whether the store should use the default quota, rather than the per-mailbox quota.
+    * @param string $base_dn Specify an alternative base_dn for the Exchange storage group
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_create_mailbox($username, $storagegroup, $emailaddress, $mailnickname=NULL, $usedefaults=TRUE, $base_dn=NULL, $isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($storagegroup===NULL){ return ("Missing compulsory array [storagegroup]"); }
+        if (!is_array($storagegroup)){ return ("[storagegroup] must be an array"); }
+        if ($emailaddress===NULL){ return ("Missing compulsory field [emailaddress]"); }
+        
+        if ($base_dn===NULL) {
+            $base_dn = $this->_base_dn;   
+        }
+        
+        $container="CN=".implode(",CN=",$storagegroup);
+        
+        if ($mailnickname===NULL) { $mailnickname=$username; }
+        $mdbUseDefaults = $this->bool2str($usedefaults);
+        
+        $attributes = array(
+            'exchange_homemdb'=>$container.",".$base_dn,
+            'exchange_proxyaddress'=>'SMTP:' . $emailaddress,
+            'exchange_mailnickname'=>$mailnickname,
+            'exchange_usedefaults'=>$mdbUseDefaults
+        );
+        $result = $this->user_modify($username,$attributes,$isGUID);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Add an X400 address to Exchange
+    * See http://tools.ietf.org/html/rfc1685 for more information.
+    * An X400 Address looks similar to this X400:c=US;a= ;p=Domain;o=Organization;s=Doe;g=John;
+    * 
+    * @param string $username The username of the user to add the X400 to to
+    * @param string $country Country
+    * @param string $admd Administration Management Domain
+    * @param string $pdmd Private Management Domain (often your AD domain)
+    * @param string $org Organization
+    * @param string $surname Surname
+    * @param string $givenName Given name
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_add_X400($username, $country, $admd, $pdmd, $org, $surname, $givenname, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        
+        $proxyvalue = 'X400:';
+            
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"), $isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        // We do not have to demote an email address from the default so we can just add the new proxy address
+        $attributes['exchange_proxyaddress'] = $proxyvalue . 'c=' . $country . ';a=' . $admd . ';p=' . $pdmd . ';o=' . $org . ';s=' . $surname . ';g=' . $givenname . ';';
+       
+        // Translate the update to the LDAP schema                
+        $add=$this->adldap_schema($attributes);
+        
+        if (!$add){ return (false); }
+        
+        // Do the update
+        // Take out the @ to see any errors, usually this error might occur because the address already
+        // exists in the list of proxyAddresses
+        $result=@ldap_mod_add($this->_conn,$user_dn,$add);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Add an address to Exchange
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param string $emailaddress The email address to add to this user
+    * @param bool $default Make this email address the default address, this is a bit more intensive as we have to demote any existing default addresses
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_add_address($username, $emailaddress, $default=FALSE, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($emailaddress===NULL) { return ("Missing compulsory fields [emailaddress]"); }
+        
+        $proxyvalue = 'smtp:';
+        if ($default === true) {
+            $proxyvalue = 'SMTP:';
+        }
+              
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"),$isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        // We need to scan existing proxy addresses and demote the default one
+        if (is_array($user[0]["proxyaddresses"]) && $default===true) {
+            $modaddresses = array();
+            for ($i=0;$i_conn,$user_dn,$modaddresses);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+        else {
+            // We do not have to demote an email address from the default so we can just add the new proxy address
+            $attributes['exchange_proxyaddress'] = $proxyvalue . $emailaddress;
+            
+            // Translate the update to the LDAP schema                
+            $add=$this->adldap_schema($attributes);
+            
+            if (!$add){ return (false); }
+            
+            // Do the update
+            // Take out the @ to see any errors, usually this error might occur because the address already
+            // exists in the list of proxyAddresses
+            $result=@ldap_mod_add($this->_conn,$user_dn,$add);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+    }
+    
+    /**
+    * Remove an address to Exchange
+    * If you remove a default address the account will no longer have a default, 
+    * we recommend changing the default address first
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param string $emailaddress The email address to add to this user
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_del_address($username, $emailaddress, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($emailaddress===NULL) { return ("Missing compulsory fields [emailaddress]"); }
+        
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"),$isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        if (is_array($user[0]["proxyaddresses"])) {
+            $mod = array();
+            for ($i=0;$i_conn,$user_dn,$mod);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+        else {
+            return (false);
+        }
+    }
+    /**
+    * Change the default address
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param string $emailaddress The email address to make default
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_primary_address($username, $emailaddress, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($emailaddress===NULL) { return ("Missing compulsory fields [emailaddress]"); }
+        
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"), $isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        if (is_array($user[0]["proxyaddresses"])) {
+            $modaddresses = array();
+            for ($i=0;$i_conn,$user_dn,$modaddresses);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+        
+    }
+    
+    /**
+    * Mail enable a contact
+    * Allows email to be sent to them through Exchange
+    * 
+    * @param string $distinguishedname The contact to mail enable
+    * @param string $emailaddress The email address to allow emails to be sent through
+    * @param string $mailnickname The mailnickname for the contact in Exchange.  If NULL this will be set to the display name
+    * @return bool
+    */
+    public function exchange_contact_mailenable($distinguishedname, $emailaddress, $mailnickname=NULL){
+        if ($distinguishedname===NULL){ return ("Missing compulsory field [distinguishedname]"); }   
+        if ($emailaddress===NULL){ return ("Missing compulsory field [emailaddress]"); }  
+        
+        if ($mailnickname !== NULL) {
+            // Find the dn of the user
+            $user=$this->contact_info($distinguishedname,array("cn","displayname"));
+            if ($user[0]["displayname"]===NULL){ return (false); }
+            $mailnickname = $user[0]['displayname'][0];
+        }
+        
+        $attributes = array("email"=>$emailaddress,"contact_email"=>"SMTP:" . $emailaddress,"exchange_proxyaddress"=>"SMTP:" . $emailaddress,"exchange_mailnickname"=>$mailnickname);
+         
+        // Translate the update to the LDAP schema                
+        $mod=$this->adldap_schema($attributes);
+        
+        // Check to see if this is an enabled status update
+        if (!$mod){ return (false); }
+        
+        // Do the update
+        $result=ldap_modify($this->_conn,$distinguishedname,$mod);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Returns a list of Exchange Servers in the ConfigurationNamingContext of the domain
+    * 
+    * @param array $attributes An array of the AD attributes you wish to return
+    * @return array
+    */
+    public function exchange_servers($attributes = array('cn','distinguishedname','serialnumber')) {
+        if (!$this->_bind){ return (false); }
+        
+        $configurationNamingContext = $this->get_root_dse(array('configurationnamingcontext'));
+        $sr = @ldap_search($this->_conn,$configurationNamingContext[0]['configurationnamingcontext'][0],'(&(objectCategory=msExchExchangeServer))',$attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+        return $entries;
+    }
+    
+    /**
+    * Returns a list of Storage Groups in Exchange for a given mail server
+    * 
+    * @param string $exchangeServer The full DN of an Exchange server.  You can use exchange_servers() to find the DN for your server
+    * @param array $attributes An array of the AD attributes you wish to return
+    * @param bool $recursive If enabled this will automatically query the databases within a storage group
+    * @return array
+    */
+    public function exchange_storage_groups($exchangeServer, $attributes = array('cn','distinguishedname'), $recursive = NULL) {
+        if (!$this->_bind){ return (false); }
+        if ($exchangeServer===NULL){ return ("Missing compulsory field [exchangeServer]"); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; }
+
+        $filter = '(&(objectCategory=msExchStorageGroup))';
+        $sr=@ldap_search($this->_conn, $exchangeServer, $filter, $attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+
+        if ($recursive === true) {
+            for ($i=0; $i<$entries['count']; $i++) {
+                $entries[$i]['msexchprivatemdb'] = $this->exchange_storage_databases($entries[$i]['distinguishedname'][0]);       
+            }
+        }
+        
+        return $entries;
+    }
+    
+    /**
+    * Returns a list of Databases within any given storage group in Exchange for a given mail server
+    * 
+    * @param string $storageGroup The full DN of an Storage Group.  You can use exchange_storage_groups() to find the DN 
+    * @param array $attributes An array of the AD attributes you wish to return
+    * @return array
+    */
+    public function exchange_storage_databases($storageGroup, $attributes = array('cn','distinguishedname','displayname')) {
+        if (!$this->_bind){ return (false); }
+        if ($storageGroup===NULL){ return ("Missing compulsory field [storageGroup]"); }
+        
+        $filter = '(&(objectCategory=msExchPrivateMDB))';
+        $sr=@ldap_search($this->_conn, $storageGroup, $filter, $attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+        return $entries;
+    }
+    
+    //************************************************************************************************************
+    // SERVER FUNCTIONS
+    
+    /**
+    * Find the Base DN of your domain controller
+    * 
+    * @return string
+    */
+    public function find_base_dn() {
+        $namingContext = $this->get_root_dse(array('defaultnamingcontext'));   
+        return $namingContext[0]['defaultnamingcontext'][0];
+    }
+    
+    /**
+    * Get the RootDSE properties from a domain controller
+    * 
+    * @param array $attributes The attributes you wish to query e.g. defaultnamingcontext
+    * @return array
+    */
+    public function get_root_dse($attributes = array("*", "+")) {
+        if (!$this->_bind){ return (false); }
+        
+        $sr = @ldap_read($this->_conn, NULL, 'objectClass=*', $attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+        return $entries;
+    }
+
+    //************************************************************************************************************
+    // UTILITY FUNCTIONS (Many of these functions are protected and can only be called from within the class)
+
+    /**
+    * Get last error from Active Directory
+    * 
+    * This function gets the last message from Active Directory
+    * This may indeed be a 'Success' message but if you get an unknown error
+    * it might be worth calling this function to see what errors were raised
+    * 
+    * return string
+    */
+    public function get_last_error() {
+        return @ldap_error($this->_conn);
+    }
+    
+    /**
+    * Detect LDAP support in php
+    * 
+    * @return bool
+    */    
+    protected function ldap_supported() {
+        if (!function_exists('ldap_connect')) {
+            return (false);   
+        }
+        return (true);
+    }
+    
+    /**
+    * Schema
+    * 
+    * @param array $attributes Attributes to be queried
+    * @return array
+    */    
+    protected function adldap_schema($attributes){
+    
+        // LDAP doesn't like NULL attributes, only set them if they have values
+        // If you wish to remove an attribute you should set it to a space
+        // TO DO: Adapt user_modify to use ldap_mod_delete to remove a NULL attribute
+        $mod=array();
+        
+        // Check every attribute to see if it contains 8bit characters and then UTF8 encode them
+        array_walk($attributes, array($this, 'encode8bit'));
+
+        if ($attributes["address_city"]){ $mod["l"][0]=$attributes["address_city"]; }
+        if ($attributes["address_code"]){ $mod["postalCode"][0]=$attributes["address_code"]; }
+        //if ($attributes["address_country"]){ $mod["countryCode"][0]=$attributes["address_country"]; } // use country codes?
+        if ($attributes["address_country"]){ $mod["c"][0]=$attributes["address_country"]; }
+        if ($attributes["address_pobox"]){ $mod["postOfficeBox"][0]=$attributes["address_pobox"]; }
+        if ($attributes["address_state"]){ $mod["st"][0]=$attributes["address_state"]; }
+        if ($attributes["address_street"]){ $mod["streetAddress"][0]=$attributes["address_street"]; }
+        if ($attributes["company"]){ $mod["company"][0]=$attributes["company"]; }
+        if ($attributes["change_password"]){ $mod["pwdLastSet"][0]=0; }
+        if ($attributes["department"]){ $mod["department"][0]=$attributes["department"]; }
+        if ($attributes["description"]){ $mod["description"][0]=$attributes["description"]; }
+        if ($attributes["display_name"]){ $mod["displayName"][0]=$attributes["display_name"]; }
+        if ($attributes["email"]){ $mod["mail"][0]=$attributes["email"]; }
+        if ($attributes["expires"]){ $mod["accountExpires"][0]=$attributes["expires"]; } //unix epoch format?
+        if ($attributes["firstname"]){ $mod["givenName"][0]=$attributes["firstname"]; }
+        if ($attributes["home_directory"]){ $mod["homeDirectory"][0]=$attributes["home_directory"]; }
+        if ($attributes["home_drive"]){ $mod["homeDrive"][0]=$attributes["home_drive"]; }
+        if ($attributes["initials"]){ $mod["initials"][0]=$attributes["initials"]; }
+        if ($attributes["logon_name"]){ $mod["userPrincipalName"][0]=$attributes["logon_name"]; }
+        if ($attributes["manager"]){ $mod["manager"][0]=$attributes["manager"]; }  //UNTESTED ***Use DistinguishedName***
+        if ($attributes["office"]){ $mod["physicalDeliveryOfficeName"][0]=$attributes["office"]; }
+        if ($attributes["password"]){ $mod["unicodePwd"][0]=$this->encode_password($attributes["password"]); }
+        if ($attributes["profile_path"]){ $mod["profilepath"][0]=$attributes["profile_path"]; }
+        if ($attributes["script_path"]){ $mod["scriptPath"][0]=$attributes["script_path"]; }
+        if ($attributes["surname"]){ $mod["sn"][0]=$attributes["surname"]; }
+        if ($attributes["title"]){ $mod["title"][0]=$attributes["title"]; }
+        if ($attributes["telephone"]){ $mod["telephoneNumber"][0]=$attributes["telephone"]; }
+        if ($attributes["mobile"]){ $mod["mobile"][0]=$attributes["mobile"]; }
+        if ($attributes["pager"]){ $mod["pager"][0]=$attributes["pager"]; }
+        if ($attributes["ipphone"]){ $mod["ipphone"][0]=$attributes["ipphone"]; }
+        if ($attributes["web_page"]){ $mod["wWWHomePage"][0]=$attributes["web_page"]; }
+        if ($attributes["fax"]){ $mod["facsimileTelephoneNumber"][0]=$attributes["fax"]; }
+        if ($attributes["enabled"]){ $mod["userAccountControl"][0]=$attributes["enabled"]; }
+        
+        // Distribution List specific schema
+        if ($attributes["group_sendpermission"]){ $mod["dlMemSubmitPerms"][0]=$attributes["group_sendpermission"]; }
+        if ($attributes["group_rejectpermission"]){ $mod["dlMemRejectPerms"][0]=$attributes["group_rejectpermission"]; }
+        
+        // Exchange Schema
+        if ($attributes["exchange_homemdb"]){ $mod["homeMDB"][0]=$attributes["exchange_homemdb"]; }
+        if ($attributes["exchange_mailnickname"]){ $mod["mailNickname"][0]=$attributes["exchange_mailnickname"]; }
+        if ($attributes["exchange_proxyaddress"]){ $mod["proxyAddresses"][0]=$attributes["exchange_proxyaddress"]; }
+        if ($attributes["exchange_usedefaults"]){ $mod["mDBUseDefaults"][0]=$attributes["exchange_usedefaults"]; }
+        if ($attributes["exchange_policyexclude"]){ $mod["msExchPoliciesExcluded"][0]=$attributes["exchange_policyexclude"]; }
+        if ($attributes["exchange_policyinclude"]){ $mod["msExchPoliciesIncluded"][0]=$attributes["exchange_policyinclude"]; }       
+        if ($attributes["exchange_addressbook"]){ $mod["showInAddressBook"][0]=$attributes["exchange_addressbook"]; }       
+        
+        // This schema is designed for contacts
+        if ($attributes["exchange_hidefromlists"]){ $mod["msExchHideFromAddressLists"][0]=$attributes["exchange_hidefromlists"]; }
+        if ($attributes["contact_email"]){ $mod["targetAddress"][0]=$attributes["contact_email"]; }
+        
+        //echo ("
"); print_r($mod);
+        /*
+        // modifying a name is a bit fiddly
+        if ($attributes["firstname"] && $attributes["surname"]){
+            $mod["cn"][0]=$attributes["firstname"]." ".$attributes["surname"];
+            $mod["displayname"][0]=$attributes["firstname"]." ".$attributes["surname"];
+            $mod["name"][0]=$attributes["firstname"]." ".$attributes["surname"];
+        }
+        */
+
+        if (count($mod)==0){ return (false); }
+        return ($mod);
+    }
+
+    /**
+    * Coping with AD not returning the primary group
+    * http://support.microsoft.com/?kbid=321360 
+    * 
+    * For some reason it's not possible to search on primarygrouptoken=XXX
+    * If someone can show otherwise, I'd like to know about it :)
+    * this way is resource intensive and generally a pain in the @#%^
+    * 
+    * @deprecated deprecated since version 3.1, see get get_primary_group
+    * @param string $gid Group ID
+    * @return string
+    */
+    protected function group_cn($gid){    
+        if ($gid===NULL){ return (false); }
+        $r=false;
+        
+        $filter="(&(objectCategory=group)(samaccounttype=". ADLDAP_SECURITY_GLOBAL_GROUP ."))";
+        $fields=array("primarygrouptoken","samaccountname","distinguishedname");
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        for ($i=0; $i<$entries["count"]; $i++){
+            if ($entries[$i]["primarygrouptoken"][0]==$gid){
+                $r=$entries[$i]["distinguishedname"][0];
+                $i=$entries["count"];
+            }
+        }
+
+        return ($r);
+    }
+    
+    /**
+    * Coping with AD not returning the primary group
+    * http://support.microsoft.com/?kbid=321360 
+    * 
+    * This is a re-write based on code submitted by Bruce which prevents the 
+    * need to search each security group to find the true primary group
+    * 
+    * @param string $gid Group ID
+    * @param string $usersid User's Object SID
+    * @return string
+    */
+    protected function get_primary_group($gid, $usersid){
+        if ($gid===NULL || $usersid===NULL){ return (false); }
+        $r=false;
+
+        $gsid = substr_replace($usersid,pack('V',$gid),strlen($usersid)-4,4);
+        $filter='(objectsid='.$this->getTextSID($gsid).')';
+        $fields=array("samaccountname","distinguishedname");
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+
+        return $entries[0]['distinguishedname'][0];
+     }
+     
+    /**
+    * Convert a binary SID to a text SID
+    * 
+    * @param string $binsid A Binary SID
+    * @return string
+    */
+     protected function getTextSID($binsid) {
+        $hex_sid = bin2hex($binsid);
+        $rev = hexdec(substr($hex_sid, 0, 2));
+        $subcount = hexdec(substr($hex_sid, 2, 2));
+        $auth = hexdec(substr($hex_sid, 4, 12));
+        $result = "$rev-$auth";
+
+        for ($x=0;$x < $subcount; $x++) {
+            $subauth[$x] =
+                hexdec($this->little_endian(substr($hex_sid, 16 + ($x * 8), 8)));
+                $result .= "-" . $subauth[$x];
+        }
+
+        // Cheat by tacking on the S-
+        return 'S-' . $result;
+     }
+     
+    /**
+    * Converts a little-endian hex number to one that hexdec() can convert
+    * 
+    * @param string $hex A hex code
+    * @return string
+    */
+     protected function little_endian($hex) {
+        $result = '';
+        for ($x = strlen($hex) - 2; $x >= 0; $x = $x - 2) {
+            $result .= substr($hex, $x, 2);
+        }
+        return $result;
+     }
+     
+    /**
+    * Converts a binary attribute to a string
+    * 
+    * @param string $bin A binary LDAP attribute
+    * @return string
+    */
+    protected function binary2text($bin) {
+        $hex_guid = bin2hex($bin); 
+        $hex_guid_to_guid_str = ''; 
+        for($k = 1; $k <= 4; ++$k) { 
+            $hex_guid_to_guid_str .= substr($hex_guid, 8 - 2 * $k, 2); 
+        } 
+        $hex_guid_to_guid_str .= '-'; 
+        for($k = 1; $k <= 2; ++$k) { 
+            $hex_guid_to_guid_str .= substr($hex_guid, 12 - 2 * $k, 2); 
+        } 
+        $hex_guid_to_guid_str .= '-'; 
+        for($k = 1; $k <= 2; ++$k) { 
+            $hex_guid_to_guid_str .= substr($hex_guid, 16 - 2 * $k, 2); 
+        } 
+        $hex_guid_to_guid_str .= '-' . substr($hex_guid, 16, 4); 
+        $hex_guid_to_guid_str .= '-' . substr($hex_guid, 20); 
+        return strtoupper($hex_guid_to_guid_str);   
+    }
+    
+    /**
+    * Converts a binary GUID to a string GUID
+    * 
+    * @param string $binaryGuid The binary GUID attribute to convert
+    * @return string
+    */
+    public function decodeGuid($binaryGuid) {
+        if ($binaryGuid === null){ return ("Missing compulsory field [binaryGuid]"); }
+        
+        $strGUID = $this->binary2text($binaryGuid);          
+        return ($strGUID); 
+    }
+     
+    /**
+    * Converts a string GUID to a hexdecimal value so it can be queried
+    * 
+    * @param string $strGUID A string representation of a GUID
+    * @return string
+    */
+    protected function strguid2hex($strGUID) {
+        $strGUID = str_replace('-', '', $strGUID);
+
+        $octet_str = '\\' . substr($strGUID, 6, 2);
+        $octet_str .= '\\' . substr($strGUID, 4, 2);
+        $octet_str .= '\\' . substr($strGUID, 2, 2);
+        $octet_str .= '\\' . substr($strGUID, 0, 2);
+        $octet_str .= '\\' . substr($strGUID, 10, 2);
+        $octet_str .= '\\' . substr($strGUID, 8, 2);
+        $octet_str .= '\\' . substr($strGUID, 14, 2);
+        $octet_str .= '\\' . substr($strGUID, 12, 2);
+        //$octet_str .= '\\' . substr($strGUID, 16, strlen($strGUID));
+        for ($i=16; $i<=(strlen($strGUID)-2); $i++) {
+            if (($i % 2) == 0) {
+                $octet_str .= '\\' . substr($strGUID, $i, 2);
+            }
+        }
+        
+        return $octet_str;
+    }
+    
+    /**
+    * Obtain the user's distinguished name based on their userid 
+    * 
+    * 
+    * @param string $username The username
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return string
+    */
+    protected function user_dn($username,$isGUID=false){
+        $user=$this->user_info($username,array("cn"),$isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        return ($user_dn);
+    }
+
+    /**
+    * Encode a password for transmission over LDAP
+    *
+    * @param string $password The password to encode
+    * @return string
+    */
+    protected function encode_password($password){
+        $password="\"".$password."\"";
+        $encoded="";
+        for ($i=0; $i 
+    * @return string
+    */
+    protected function ldap_slashes($str){
+        return preg_replace('/([\x00-\x1F\*\(\)\\\\])/e',
+                            '"\\\\\".join("",unpack("H2","$1"))',
+                            $str);
+    }
+    
+    /**
+    * Select a random domain controller from your domain controller array
+    * 
+    * @return string
+    */
+    protected function random_controller(){
+        mt_srand(doubleval(microtime()) * 100000000); // For older PHP versions
+        return ($this->_domain_controllers[array_rand($this->_domain_controllers)]);
+    }
+    
+    /**
+    * Account control options
+    *
+    * @param array $options The options to convert to int 
+    * @return int
+    */
+    protected function account_control($options){
+        $val=0;
+
+        if (is_array($options)){
+            if (in_array("SCRIPT",$options)){ $val=$val+1; }
+            if (in_array("ACCOUNTDISABLE",$options)){ $val=$val+2; }
+            if (in_array("HOMEDIR_REQUIRED",$options)){ $val=$val+8; }
+            if (in_array("LOCKOUT",$options)){ $val=$val+16; }
+            if (in_array("PASSWD_NOTREQD",$options)){ $val=$val+32; }
+            //PASSWD_CANT_CHANGE Note You cannot assign this permission by directly modifying the UserAccountControl attribute.
+            //For information about how to set the permission programmatically, see the "Property flag descriptions" section.
+            if (in_array("ENCRYPTED_TEXT_PWD_ALLOWED",$options)){ $val=$val+128; }
+            if (in_array("TEMP_DUPLICATE_ACCOUNT",$options)){ $val=$val+256; }
+            if (in_array("NORMAL_ACCOUNT",$options)){ $val=$val+512; }
+            if (in_array("INTERDOMAIN_TRUST_ACCOUNT",$options)){ $val=$val+2048; }
+            if (in_array("WORKSTATION_TRUST_ACCOUNT",$options)){ $val=$val+4096; }
+            if (in_array("SERVER_TRUST_ACCOUNT",$options)){ $val=$val+8192; }
+            if (in_array("DONT_EXPIRE_PASSWORD",$options)){ $val=$val+65536; }
+            if (in_array("MNS_LOGON_ACCOUNT",$options)){ $val=$val+131072; }
+            if (in_array("SMARTCARD_REQUIRED",$options)){ $val=$val+262144; }
+            if (in_array("TRUSTED_FOR_DELEGATION",$options)){ $val=$val+524288; }
+            if (in_array("NOT_DELEGATED",$options)){ $val=$val+1048576; }
+            if (in_array("USE_DES_KEY_ONLY",$options)){ $val=$val+2097152; }
+            if (in_array("DONT_REQ_PREAUTH",$options)){ $val=$val+4194304; } 
+            if (in_array("PASSWORD_EXPIRED",$options)){ $val=$val+8388608; }
+            if (in_array("TRUSTED_TO_AUTH_FOR_DELEGATION",$options)){ $val=$val+16777216; }
+        }
+        return ($val);
+    }
+    
+    /**
+    * Take an LDAP query and return the nice names, without all the LDAP prefixes (eg. CN, DN)
+    *
+    * @param array $groups
+    * @return array
+    */
+    protected function nice_names($groups){
+
+        $group_array=array();
+        for ($i=0; $i<$groups["count"]; $i++){ // For each group
+            $line=$groups[$i];
+            
+            if (strlen($line)>0){ 
+                // More presumptions, they're all prefixed with CN=
+                // so we ditch the first three characters and the group
+                // name goes up to the first comma
+                $bits=explode(",",$line);
+                $group_array[]=substr($bits[0],3,(strlen($bits[0])-3));
+            }
+        }
+        return ($group_array);    
+    }
+    
+    /**
+    * Delete a distinguished name from Active Directory
+    * You should never need to call this yourself, just use the wrapper functions user_delete and contact_delete
+    *
+    * @param string $dn The distinguished name to delete
+    * @return bool
+    */
+    protected function dn_delete($dn){ 
+        $result=ldap_delete($this->_conn, $dn);
+        if ($result!=true){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Convert a boolean value to a string
+    * You should never need to call this yourself
+    *
+    * @param bool $bool Boolean value
+    * @return string
+    */
+    protected function bool2str($bool) {
+        return ($bool) ? 'TRUE' : 'FALSE';
+    }
+    
+    /**
+    * Convert 8bit characters e.g. accented characters to UTF8 encoded characters
+    */
+    protected function encode8bit(&$item, $key) {
+        $encode = false;
+        if (is_string($item)) {
+            for ($i=0; $i> 7) {
+                    $encode = true;
+                }
+            }
+        }
+        if ($encode === true && $key != 'password') {
+            $item = utf8_encode($item);   
+        }
+    }    
+}
+
+/**
+* adLDAP Exception Handler
+* 
+* Exceptions of this type are thrown on bind failure or when SSL is required but not configured
+* Example:
+* try {
+*   $adldap = new adLDAP();
+* }
+* catch (adLDAPException $e) {
+*   echo $e;
+*   exit();
+* }
+*/
+class adLDAPException extends Exception {}
+
+?>
\ No newline at end of file
diff --git a/adLDAP/adLDAP_hsnet.php b/adLDAP/adLDAP_hsnet.php
new file mode 100755
index 0000000..99cd475
--- /dev/null
+++ b/adLDAP/adLDAP_hsnet.php
@@ -0,0 +1,2422 @@
+_account_suffix = $_account_suffix;
+    }
+
+    /**
+    * Get the account suffix
+    * 
+    * @return string
+    */
+    public function get_account_suffix()
+    {
+          return $this->_account_suffix;
+    }
+    
+    /**
+    * Set the domain controllers array
+    * 
+    * @param array $_domain_controllers
+    * @return void
+    */
+    public function set_domain_controllers(array $_domain_controllers)
+    {
+          $this->_domain_controllers = $_domain_controllers;
+    }
+
+    /**
+    * Get the list of domain controllers
+    * 
+    * @return void
+    */
+    public function get_domain_controllers()
+    {
+          return $this->_domain_controllers;
+    }
+    
+    /**
+    * Set the username of an account with higher priviledges
+    * 
+    * @param string $_ad_username
+    * @return void
+    */
+    public function set_ad_username($_ad_username)
+    {
+          $this->_ad_username = $_ad_username;
+    }
+
+    /**
+    * Get the username of the account with higher priviledges
+    * 
+    * This will throw an exception for security reasons
+    */
+    public function get_ad_username()
+    {
+          throw new adLDAPException('For security reasons you cannot access the domain administrator account details');
+    }
+    
+    /**
+    * Set the password of an account with higher priviledges
+    * 
+    * @param string $_ad_password
+    * @return void
+    */
+    public function set_ad_password($_ad_password)
+    {
+          $this->_ad_password = $_ad_password;
+    }
+
+    /**
+    * Get the password of the account with higher priviledges
+    * 
+    * This will throw an exception for security reasons
+    */
+    public function get_ad_password()
+    {
+          throw new adLDAPException('For security reasons you cannot access the domain administrator account details');
+    }
+    
+    /**
+    * Set whether to detect the true primary group
+    * 
+    * @param bool $_real_primary_group
+    * @return void
+    */
+    public function set_real_primarygroup($_real_primarygroup)
+    {
+          $this->_real_primarygroup = $_real_primarygroup;
+    }
+
+    /**
+    * Get the real primary group setting
+    * 
+    * @return bool
+    */
+    public function get_real_primarygroup()
+    {
+          return $this->_real_primarygroup;
+    }
+    
+    /**
+    * Set whether to use SSL
+    * 
+    * @param bool $_use_ssl
+    * @return void
+    */
+    public function set_use_ssl($_use_ssl)
+    {
+          $this->_use_ssl = $_use_ssl;
+    }
+
+    /**
+    * Get the SSL setting
+    * 
+    * @return bool
+    */
+    public function get_use_ssl()
+    {
+          return $this->_use_ssl;
+    }
+    
+    /**
+    * Set whether to use TLS
+    * 
+    * @param bool $_use_tls
+    * @return void
+    */
+    public function set_use_tls($_use_tls)
+    {
+          $this->_use_tls = $_use_tls;
+    }
+
+    /**
+    * Get the TLS setting
+    * 
+    * @return bool
+    */
+    public function get_use_tls()
+    {
+          return $this->_use_tls;
+    }
+    
+    /**
+    * Set whether to lookup recursive groups
+    * 
+    * @param bool $_recursive_groups
+    * @return void
+    */
+    public function set_recursive_groups($_recursive_groups)
+    {
+          $this->_recursive_groups = $_recursive_groups;
+    }
+
+    /**
+    * Get the recursive groups setting
+    * 
+    * @return bool
+    */
+    public function get_recursive_groups()
+    {
+          return $this->_recursive_groups;
+    }
+
+    /**
+    * Default Constructor
+    * 
+    * Tries to bind to the AD domain over LDAP or LDAPs
+    * 
+    * @param array $options Array of options to pass to the constructor
+    * @throws Exception - if unable to bind to Domain Controller
+    * @return bool
+    */
+    function __construct($options=array()){
+        // You can specifically overide any of the default configuration options setup above
+        if (count($options)>0){
+            if (array_key_exists("account_suffix",$options)){ $this->_account_suffix=$options["account_suffix"]; }
+            if (array_key_exists("base_dn",$options)){ $this->_base_dn=$options["base_dn"]; }
+            if (array_key_exists("domain_controllers",$options)){ $this->_domain_controllers=$options["domain_controllers"]; }
+            if (array_key_exists("ad_username",$options)){ $this->_ad_username=$options["ad_username"]; }
+            if (array_key_exists("ad_password",$options)){ $this->_ad_password=$options["ad_password"]; }
+            if (array_key_exists("real_primarygroup",$options)){ $this->_real_primarygroup=$options["real_primarygroup"]; }
+            if (array_key_exists("use_ssl",$options)){ $this->_use_ssl=$options["use_ssl"]; }
+            if (array_key_exists("use_tls",$options)){ $this->_use_tls=$options["use_tls"]; }
+            if (array_key_exists("recursive_groups",$options)){ $this->_recursive_groups=$options["recursive_groups"]; }
+        }
+        
+        if ($this->ldap_supported() === false) {
+            throw new adLDAPException('No LDAP support for PHP.  See: http://www.php.net/ldap');
+        }
+
+        return $this->connect();
+    }
+
+    /**
+    * Default Destructor
+    * 
+    * Closes the LDAP connection
+    * 
+    * @return void
+    */
+    function __destruct(){ $this->close(); }
+
+    /**
+    * Connects and Binds to the Domain Controller
+    * 
+    * @return bool
+    */
+    public function connect() {
+        // Connect to the AD/LDAP server as the username/password
+        $dc=$this->random_controller();
+        if ($this->_use_ssl){
+            $this->_conn = ldap_connect("ldaps://".$dc, 636);
+        } else {
+            $this->_conn = ldap_connect($dc);
+        }
+               
+        // Set some ldap options for talking to AD
+        ldap_set_option($this->_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+        ldap_set_option($this->_conn, LDAP_OPT_REFERRALS, 0);
+        
+        if ($this->_use_tls) {
+            ldap_start_tls($this->_conn);
+        }
+               
+        // Bind as a domain admin if they've set it up
+        if ($this->_ad_username!=NULL && $this->_ad_password!=NULL){
+            $this->_bind = @ldap_bind($this->_conn,$this->_ad_username.$this->_account_suffix,$this->_ad_password);
+            if (!$this->_bind){
+                if ($this->_use_ssl && !$this->_use_tls){
+                    // If you have problems troubleshooting, remove the @ character from the ldap_bind command above to get the actual error message
+                    throw new adLDAPException('Bind to Active Directory failed. Either the LDAPs connection failed or the login credentials are incorrect. AD said: ' . $this->get_last_error());
+                } else {
+                    throw new adLDAPException('Bind to Active Directory failed. Check the login credentials and/or server details. AD said: ' . $this->get_last_error());
+                }
+            }
+        }
+        
+        if ($this->_base_dn == NULL) {
+            $this->_base_dn = $this->find_base_dn();   
+        }
+        
+        return (true);
+    }
+    
+    /**
+    * Closes the LDAP connection
+    * 
+    * @return void
+    */
+    public function close() {
+        ldap_close ($this->_conn);
+    }
+
+    /**
+    * Validate a user's login credentials
+    * 
+    * @param string $username A user's AD username
+    * @param string $password A user's AD password
+    * @param bool optional $prevent_rebind
+    * @return bool
+    */
+    public function authenticate($username, $password, $prevent_rebind = false) {
+        // Prevent null binding
+        if ($username === NULL || $password === NULL) { return false; } 
+        if (empty($username) || empty($password)) { return false; }
+        
+        // Bind as the user        
+        $ret = true;
+        $this->_bind = @ldap_bind($this->_conn, $username . $this->_account_suffix, $password);
+        if (!$this->_bind){ $ret = false; }
+        
+        // Cnce we've checked their details, kick back into admin mode if we have it
+        if ($this->_ad_username !== NULL && !$prevent_rebind) {
+            $this->_bind = @ldap_bind($this->_conn, $this->_ad_username . $this->_account_suffix , $this->_ad_password);
+            if (!$this->_bind){
+                // This should never happen in theory
+                throw new adLDAPException('Rebind to Active Directory failed. AD said: ' . $this->get_last_error());
+            } 
+        }
+        
+        return $ret;
+    }
+
+    //*****************************************************************************************************************
+    // GROUP FUNCTIONS
+
+    /**
+    * Add a group to a group
+    * 
+    * @param string $parent The parent group name
+    * @param string $child The child group name
+    * @return bool
+    */
+    public function group_add_group($parent,$child){
+
+        // Find the parent group's dn
+        $parent_group=$this->group_info($parent,array("cn"));
+        if ($parent_group[0]["dn"]===NULL){ return (false); }
+        $parent_dn=$parent_group[0]["dn"];
+        
+        // Find the child group's dn
+        $child_group=$this->group_info($child,array("cn"));
+        if ($child_group[0]["dn"]===NULL){ return (false); }
+        $child_dn=$child_group[0]["dn"];
+                
+        $add=array();
+        $add["member"] = $child_dn;
+        
+        $result=@ldap_mod_add($this->_conn,$parent_dn,$add);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Add a user to a group
+    * 
+    * @param string $group The group to add the user to
+    * @param string $user The user to add to the group
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function group_add_user($group,$user,$isGUID=false){
+        // Adding a user is a bit fiddly, we need to get the full DN of the user
+        // and add it using the full DN of the group
+        
+        // Find the user's dn
+        $user_dn=$this->user_dn($user,$isGUID);
+        if ($user_dn===false){ return (false); }
+        
+        // Find the group's dn
+        $group_info=$this->group_info($group,array("cn"));
+        if ($group_info[0]["dn"]===NULL){ return (false); }
+        $group_dn=$group_info[0]["dn"];
+        
+        $add=array();
+        $add["member"] = $user_dn;
+        
+        $result=@ldap_mod_add($this->_conn,$group_dn,$add);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Add a contact to a group
+    * 
+    * @param string $group The group to add the contact to
+    * @param string $contact_dn The DN of the contact to add
+    * @return bool
+    */
+    public function group_add_contact($group,$contact_dn){
+        // To add a contact we take the contact's DN
+        // and add it using the full DN of the group
+        
+        // Find the group's dn
+        $group_info=$this->group_info($group,array("cn"));
+        if ($group_info[0]["dn"]===NULL){ return (false); }
+        $group_dn=$group_info[0]["dn"];
+        
+        $add=array();
+        $add["member"] = $contact_dn;
+        
+        $result=@ldap_mod_add($this->_conn,$group_dn,$add);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+
+    /**
+    * Create a group
+    * 
+    * @param array $attributes Default attributes of the group
+    * @return bool
+    */
+    public function group_create($attributes){
+        if (!is_array($attributes)){ return ("Attributes must be an array"); }
+        if (!array_key_exists("group_name",$attributes)){ return ("Missing compulsory field [group_name]"); }
+        if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); }
+        if (!array_key_exists("description",$attributes)){ return ("Missing compulsory field [description]"); }
+        if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); }
+        $attributes["container"]=array_reverse($attributes["container"]);
+
+        //$member_array = array();
+        //$member_array[0] = "cn=user1,cn=Users,dc=yourdomain,dc=com";
+        //$member_array[1] = "cn=administrator,cn=Users,dc=yourdomain,dc=com";
+        
+        $add=array();
+        $add["cn"] = $attributes["group_name"];
+        $add["samaccountname"] = $attributes["group_name"];
+        $add["objectClass"] = "Group";
+        $add["description"] = $attributes["description"];
+        //$add["member"] = $member_array; UNTESTED
+
+        $container="OU=".implode(",OU=",$attributes["container"]);
+        $result=ldap_add($this->_conn,"CN=".$add["cn"].", ".$container.",".$this->_base_dn,$add);
+        if ($result!=true){ return (false); }
+        
+        return (true);
+    }
+
+    /**
+    * Remove a group from a group
+    * 
+    * @param string $parent The parent group name
+    * @param string $child The child group name
+    * @return bool
+    */
+    public function group_del_group($parent,$child){
+    
+        // Find the parent dn
+        $parent_group=$this->group_info($parent,array("cn"));
+        if ($parent_group[0]["dn"]===NULL){ return (false); }
+        $parent_dn=$parent_group[0]["dn"];
+        
+        // Find the child dn
+        $child_group=$this->group_info($child,array("cn"));
+        if ($child_group[0]["dn"]===NULL){ return (false); }
+        $child_dn=$child_group[0]["dn"];
+        
+        $del=array();
+        $del["member"] = $child_dn;
+        
+        $result=@ldap_mod_del($this->_conn,$parent_dn,$del);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Remove a user from a group
+    * 
+    * @param string $group The group to remove a user from
+    * @param string $user The AD user to remove from the group
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function group_del_user($group,$user,$isGUID=false){
+    
+        // Find the parent dn
+        $group_info=$this->group_info($group,array("cn"));
+        if ($group_info[0]["dn"]===NULL){ return (false); }
+        $group_dn=$group_info[0]["dn"];
+        
+        // Find the users dn
+        $user_dn=$this->user_dn($user,$isGUID);
+        if ($user_dn===false){ return (false); }
+
+        $del=array();
+        $del["member"] = $user_dn;
+        
+        $result=@ldap_mod_del($this->_conn,$group_dn,$del);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Remove a contact from a group
+    * 
+    * @param string $group The group to remove a user from
+    * @param string $contact_dn The DN of a contact to remove from the group
+    * @return bool
+    */
+    public function group_del_contact($group,$contact_dn){
+    
+        // Find the parent dn
+        $group_info=$this->group_info($group,array("cn"));
+        if ($group_info[0]["dn"]===NULL){ return (false); }
+        $group_dn=$group_info[0]["dn"];
+    
+        $del=array();
+        $del["member"] = $contact_dn;
+        
+        $result=@ldap_mod_del($this->_conn,$group_dn,$del);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Return a list of groups in a group
+    * 
+    * @param string $group The group to query
+    * @param bool $recursive Recursively get groups
+    * @return array
+    */
+    public function groups_in_group($group, $recursive = NULL){
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it 
+        
+        // Search the directory for the members of a group
+        $info=$this->group_info($group,array("member","cn"));
+        $groups=$info[0]["member"];
+        if (!is_array($groups)) {
+            return (false);   
+        }
+ 
+        $group_array=array();
+
+        for ($i=0; $i<$groups["count"]; $i++){ 
+             $filter="(&(objectCategory=group)(distinguishedName=".$this->ldap_slashes($groups[$i])."))";
+             $fields = array("samaccountname", "distinguishedname", "objectClass");
+             $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+             $entries = ldap_get_entries($this->_conn, $sr);
+
+             // not a person, look for a group  
+             if ($entries['count'] == 0 && $recursive == true) {  
+                $filter="(&(objectCategory=group)(distinguishedName=".$this->ldap_slashes($groups[$i])."))";  
+                $fields = array("distinguishedname");  
+                $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);  
+                $entries = ldap_get_entries($this->_conn, $sr);  
+                if (!isset($entries[0]['distinguishedname'][0])) {
+                    continue;  
+                }
+                $sub_groups = $this->groups_in_group($entries[0]['distinguishedname'][0], $recursive);  
+                if (is_array($sub_groups)) {
+                    $group_array = array_merge($group_array, $sub_groups); 
+                    $group_array = array_unique($group_array);  
+                }
+                continue;  
+             } 
+
+             $group_array[] = $entries[0]['distinguishedname'][0];
+        }
+        return ($group_array);
+    }
+    
+    /**
+    * Return a list of members in a group
+    * 
+    * @param string $group The group to query
+    * @param bool $recursive Recursively get group members
+    * @return array
+    */
+    public function group_members($group, $recursive = NULL){
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it 
+        // Search the directory for the members of a group
+        $info=$this->group_info($group,array("member","cn"));
+        $users=$info[0]["member"];
+        if (!is_array($users)) {
+            return (false);   
+        }
+ 
+        $user_array=array();
+
+        for ($i=0; $i<$users["count"]; $i++){ 
+             $filter="(&(objectCategory=person)(distinguishedName=".$this->ldap_slashes($users[$i])."))";
+             $fields = array("samaccountname", "distinguishedname", "objectClass");
+             $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+             $entries = ldap_get_entries($this->_conn, $sr);
+
+             // not a person, look for a group  
+             if ($entries['count'] == 0 && $recursive == true) {  
+                $filter="(&(objectCategory=group)(distinguishedName=".$this->ldap_slashes($users[$i])."))";  
+                $fields = array("samaccountname");  
+                $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);  
+                $entries = ldap_get_entries($this->_conn, $sr);  
+                if (!isset($entries[0]['samaccountname'][0])) {
+                    continue;  
+                }
+                $sub_users = $this->group_members($entries[0]['samaccountname'][0], $recursive);  
+                if (is_array($sub_users)) {
+                    $user_array = array_merge($user_array, $sub_users); 
+                    $user_array = array_unique($user_array);  
+                }
+                continue;  
+             } 
+
+             if ($entries[0]['samaccountname'][0] === NULL && $entries[0]['distinguishedname'][0] !== NULL) {
+                 $user_array[] = $entries[0]['distinguishedname'][0];
+             }
+             elseif ($entries[0]['samaccountname'][0] !== NULL) {
+                $user_array[] = $entries[0]['samaccountname'][0];
+             }
+        }
+        return ($user_array);
+    }
+    
+    /**
+    * Group Information.  Returns an array of information about a group.
+    * The group name is case sensitive
+    * 
+    * @param string $group_name The group name to retrieve info about
+    * @param array $fields Fields to retrieve
+    * @return array
+    */
+    public function group_info($group_name,$fields=NULL){
+        if ($group_name===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        
+        if (stristr($group_name, '+')) {
+            $group_name=stripslashes($group_name);   
+        }
+        
+        $filter="(&(objectCategory=group)(name=".$this->ldap_slashes($group_name)."))";
+        //echo ($filter."!!!
"); + if ($fields===NULL){ $fields=array("member","memberof","cn","description","distinguishedname","objectcategory","samaccountname"); } + $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields); + $entries = ldap_get_entries($this->_conn, $sr); + //print_r($entries); + return ($entries); + } + + /** + * Return a complete list of "groups in groups" + * + * @param string $group The group to get the list from + * @return array + */ + public function recursive_groups($group){ + if ($group===NULL){ return (false); } + + $ret_groups=array(); + + $groups=$this->group_info($group,array("memberof")); + if (isset($groups[0]["memberof"]) && is_array($groups[0]["memberof"])) { + $groups=$groups[0]["memberof"]; + + if ($groups){ + $group_names=$this->nice_names($groups); + $ret_groups=array_merge($ret_groups,$group_names); //final groups to return + + foreach ($group_names as $id => $group_name){ + $child_groups=$this->recursive_groups($group_name); + $ret_groups=array_merge($ret_groups,$child_groups); + } + } + } + + return ($ret_groups); + } + + /** + * Returns a complete list of the groups in AD based on a SAM Account Type + * + * @param string $samaccounttype The account type to return + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function search_groups($samaccounttype = ADLDAP_SECURITY_GLOBAL_GROUP, $include_desc = false, $search = "*", $sorted = true) { + if (!$this->_bind){ return (false); } + + $filter = '(&(objectCategory=group)'; + if ($samaccounttype !== null) { + $filter .= '(samaccounttype='. $samaccounttype .')'; + } + $filter .= '(cn='.$search.'))'; + // Perform the search and grab all their details + $fields=array("samaccountname","description"); + $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields); + $entries = ldap_get_entries($this->_conn, $sr); + + $groups_array = array(); + for ($i=0; $i<$entries["count"]; $i++){ + if ($include_desc && strlen($entries[$i]["description"][0]) > 0 ){ + $groups_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["description"][0]; + } elseif ($include_desc){ + $groups_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["samaccountname"][0]; + } else { + array_push($groups_array, $entries[$i]["samaccountname"][0]); + } + } + if( $sorted ){ asort($groups_array); } + return ($groups_array); + } + + /** + * Returns a complete list of all groups in AD + * + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function all_groups($include_desc = false, $search = "*", $sorted = true){ + $groups_array = $this->search_groups(null, $include_desc, $search, $sorted); + return ($groups_array); + } + + /** + * Returns a complete list of security groups in AD + * + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function all_security_groups($include_desc = false, $search = "*", $sorted = true){ + $groups_array = $this->search_groups(ADLDAP_SECURITY_GLOBAL_GROUP, $include_desc, $search, $sorted); + return ($groups_array); + } + + /** + * Returns a complete list of distribution lists in AD + * + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function all_distribution_groups($include_desc = false, $search = "*", $sorted = true){ + $groups_array = $this->search_groups(ADLDAP_DISTRIBUTION_GROUP, $include_desc, $search, $sorted); + return ($groups_array); + } + + //***************************************************************************************************************** + // USER FUNCTIONS + + /** + * Create a user + * + * If you specify a password here, this can only be performed over SSL + * + * @param array $attributes The attributes to set to the user account + * @return bool + */ + public function user_create($attributes){ + // Check for compulsory fields + if (!array_key_exists("username",$attributes)){ return ("Missing compulsory field [username]"); } + if (!array_key_exists("firstname",$attributes)){ return ("Missing compulsory field [firstname]"); } + if (!array_key_exists("surname",$attributes)){ return ("Missing compulsory field [surname]"); } + if (!array_key_exists("email",$attributes)){ return ("Missing compulsory field [email]"); } + if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); } + if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); } + + if (array_key_exists("password",$attributes) && (!$this->_use_ssl && !$this->_use_tls)){ + throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.'); + } + + if (!array_key_exists("display_name",$attributes)){ $attributes["display_name"]=$attributes["firstname"]." ".$attributes["surname"]; } + + // Translate the schema + $add=$this->adldap_schema($attributes); + + // Additional stuff only used for adding accounts + $add["cn"][0]=$attributes["display_name"]; + $add["samaccountname"][0]=$attributes["username"]; + $add["objectclass"][0]="top"; + $add["objectclass"][1]="person"; + $add["objectclass"][2]="organizationalPerson"; + $add["objectclass"][3]="user"; //person? + //$add["name"][0]=$attributes["firstname"]." ".$attributes["surname"]; + + // Set the account control attribute + $control_options=array("NORMAL_ACCOUNT"); + if (!$attributes["enabled"]){ $control_options[]="ACCOUNTDISABLE"; } + $add["userAccountControl"][0]=$this->account_control($control_options); + //echo ("
"); print_r($add);
+
+        // Determine the container
+        $attributes["container"]=array_reverse($attributes["container"]);
+        $container="OU=".implode(",OU=",$attributes["container"]);
+
+        // Add the entry
+        $result=@ldap_add($this->_conn, "CN=".$add["cn"][0].", ".$container.",".$this->_base_dn, $add);
+        if ($result!=true){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Delete a user account
+    * 
+    * @param string $username The username to delete (please be careful here!)
+    * @param bool $isGUID Is the username a GUID or a samAccountName
+    * @return array
+    */
+    public function user_delete($username,$isGUID=false) {      
+        $userinfo = $this->user_info($username, array("*"),$isGUID);
+        $dn = $userinfo[0]['distinguishedname'][0];
+        $result=$this->dn_delete($dn);
+        if ($result!=true){ return (false); }        
+        return (true);
+    }
+    
+    /**
+    * Groups the user is a member of
+    * 
+    * @param string $username The username to query
+    * @param bool $recursive Recursive list of groups
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return array
+    */
+    public function user_groups($username,$recursive=NULL,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+        
+        // Search the directory for their information
+        $info=@$this->user_info($username,array("memberof","primarygroupid"),$isGUID);
+        $groups=$this->nice_names($info[0]["memberof"]); // Presuming the entry returned is our guy (unique usernames)
+
+        if ($recursive === true){
+            foreach ($groups as $id => $group_name){
+                $extra_groups=$this->recursive_groups($group_name);
+                $groups=array_merge($groups,$extra_groups);
+            }
+        }
+        
+        return ($groups);
+    }
+    
+    /**
+    * Find information about the users
+    * 
+    * @param string $username The username to query
+    * @param array $fields Array of parameters to query
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return array
+    */
+    public function user_info($username,$fields=NULL,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+
+        if ($isGUID === true) {
+            $username = $this->strguid2hex($username);
+            $filter="objectguid=".$username;
+        }
+        else if (strstr($username, "@")) {
+             $filter="userPrincipalName=".$username;
+        }
+        else {
+             $filter="samaccountname=".$username;
+        }
+        $filter = "(&(objectCategory=person)({$filter}))";
+        if ($fields===NULL){ $fields=array("samaccountname","mail","memberof","department","displayname","telephonenumber","primarygroupid","objectsid"); }
+        if (!in_array("objectsid",$fields)){
+            $fields[] = "objectsid";
+        }
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        if (isset($entries[0])) {
+            if ($entries[0]['count'] >= 1) {
+                if (in_array("memberof", $fields)) {
+                    // AD does not return the primary group in the ldap query, we may need to fudge it
+                    if ($this->_real_primarygroup && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["objectsid"][0])){
+                        //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
+                        $entries[0]["memberof"][]=$this->get_primary_group($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
+                    } else {
+                        $entries[0]["memberof"][]="CN=Domain Users,CN=Users,".$this->_base_dn;
+                    }
+                    $entries[0]["memberof"]["count"]++;
+                }
+            }
+            return $entries;
+        }
+        return false;
+    }
+    
+    /**
+    * Determine if a user is in a specific group
+    * 
+    * @param string $username The username to query
+    * @param string $group The name of the group to check against
+    * @param bool $recursive Check groups recursively
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_ingroup($username,$group,$recursive=NULL,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if ($group===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it
+        
+        // Get a list of the groups
+        $groups=$this->user_groups($username,$recursive,$isGUID);
+        
+        // Return true if the specified group is in the group list
+        if (in_array($group,$groups)){ return (true); }
+
+        return (false);
+    }
+    
+    /**
+    * Determine a user's password expiry date
+    * 
+    * @param string $username The username to query
+    * @param book $isGUID Is the username passed a GUID or a samAccountName
+    * @requires bcmath http://www.php.net/manual/en/book.bc.php
+    * @return array
+    */
+    public function user_password_expiry($username,$isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        if (!$this->_bind){ return (false); }
+        if (!function_exists('bcmod')) { return ("Missing function support [bcmod] http://www.php.net/manual/en/book.bc.php"); };
+        
+        $userinfo = $this->user_info($username, array("pwdlastset", "useraccountcontrol"), $isGUID);
+        $pwdlastset = $userinfo[0]['pwdlastset'][0];
+        $status = array();
+        
+        if ($userinfo[0]['useraccountcontrol'][0] == '66048') {
+            // Password does not expire
+            return "Does not expire";
+        }
+        if ($pwdlastset === '0') {
+            // Password has already expired
+            return "Password has expired";
+        }
+        
+         // Password expiry in AD can be calculated from TWO values:
+         //   - User's own pwdLastSet attribute: stores the last time the password was changed
+         //   - Domain's maxPwdAge attribute: how long passwords last in the domain
+         //
+         // Although Microsoft chose to use a different base and unit for time measurements.
+         // This function will convert them to Unix timestamps
+         $sr = ldap_read($this->_conn, $this->_base_dn, 'objectclass=*', array('maxPwdAge'));
+         if (!$sr) {
+             return false;
+         }
+         $info = ldap_get_entries($this->_conn, $sr);
+         $maxpwdage = $info[0]['maxpwdage'][0];
+         
+
+         // See MSDN: http://msdn.microsoft.com/en-us/library/ms974598.aspx
+         //
+         // pwdLastSet contains the number of 100 nanosecond intervals since January 1, 1601 (UTC), 
+         // stored in a 64 bit integer. 
+         //
+         // The number of seconds between this date and Unix epoch is 11644473600.
+         //
+         // maxPwdAge is stored as a large integer that represents the number of 100 nanosecond
+         // intervals from the time the password was set before the password expires.
+         //
+         // We also need to scale this to seconds but also this value is a _negative_ quantity!
+         //
+         // If the low 32 bits of maxPwdAge are equal to 0 passwords do not expire
+         //
+         // Unfortunately the maths involved are too big for PHP integers, so I've had to require
+         // BCMath functions to work with arbitrary precision numbers.
+         if (bcmod($maxpwdage, 4294967296) === '0') {
+            return "Domain does not expire passwords";
+        }
+        
+        // Add maxpwdage and pwdlastset and we get password expiration time in Microsoft's
+        // time units.  Because maxpwd age is negative we need to subtract it.
+        $pwdexpire = bcsub($pwdlastset, $maxpwdage);
+    
+        // Convert MS's time to Unix time
+        $status['expiryts'] = bcsub(bcdiv($pwdexpire, '10000000'), '11644473600');
+        $status['expiryformat'] = date('Y-m-d H:i:s', bcsub(bcdiv($pwdexpire, '10000000'), '11644473600'));
+        
+        return $status;
+    }
+    
+    /**
+    * Modify a user
+    * 
+    * @param string $username The username to query
+    * @param array $attributes The attributes to modify.  Note if you set the enabled attribute you must not specify any other attributes
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_modify($username,$attributes,$isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        if (array_key_exists("password",$attributes) && !$this->_use_ssl){ 
+            throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');
+        }
+
+        // Find the dn of the user
+        $user_dn=$this->user_dn($username,$isGUID);
+        if ($user_dn===false){ return (false); }
+        
+        // Translate the update to the LDAP schema                
+        $mod=$this->adldap_schema($attributes);
+        
+        // Check to see if this is an enabled status update
+        if (!$mod && !array_key_exists("enabled", $attributes)){ return (false); }
+        
+        // Set the account control attribute (only if specified)
+        if (array_key_exists("enabled",$attributes)){
+            if ($attributes["enabled"]){ $control_options=array("NORMAL_ACCOUNT"); }
+            else { $control_options=array("NORMAL_ACCOUNT","ACCOUNTDISABLE"); }
+            $mod["userAccountControl"][0]=$this->account_control($control_options);
+        }
+
+        // Do the update
+        $result=@ldap_modify($this->_conn,$user_dn,$mod);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Disable a user account
+    * 
+    * @param string $username The username to disable
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_disable($username,$isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        $attributes=array("enabled"=>0);
+        $result = $this->user_modify($username, $attributes, $isGUID);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Enable a user account
+    * 
+    * @param string $username The username to enable
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_enable($username,$isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        $attributes=array("enabled"=>1);
+        $result = $this->user_modify($username, $attributes, $isGUID);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Set the password of a user - This must be performed over SSL
+    * 
+    * @param string $username The username to modify
+    * @param string $password The new password
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_password($username,$password,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if ($password===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if (!$this->_use_ssl && !$this->_use_tls){ 
+            throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');
+        }
+        
+        $user_dn=$this->user_dn($username,$isGUID);
+        if ($user_dn===false){ return (false); }
+                
+        $add=array();
+        $add["unicodePwd"][0]=$this->encode_password($password);
+        
+        $result=ldap_mod_replace($this->_conn,$user_dn,$add);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Return a list of all users in AD
+    * 
+    * @param bool $include_desc Return a description of the user
+    * @param string $search Search parameter
+    * @param bool $sorted Sort the user accounts
+    * @return array
+    */
+    public function all_users($include_desc = false, $search = "*", $sorted = true){
+        if (!$this->_bind){ return (false); }
+        
+        // Perform the search and grab all their details
+        $filter = "(&(objectClass=user)(samaccounttype=". ADLDAP_NORMAL_ACCOUNT .")(objectCategory=person)(cn=".$search."))";
+        $fields=array("samaccountname","displayname");
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+
+        $users_array = array();
+        for ($i=0; $i<$entries["count"]; $i++){
+            if ($include_desc && strlen($entries[$i]["displayname"][0])>0){
+                $users_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["displayname"][0];
+            } elseif ($include_desc){
+                $users_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["samaccountname"][0];
+            } else {
+                array_push($users_array, $entries[$i]["samaccountname"][0]);
+            }
+        }
+        if ($sorted){ asort($users_array); }
+        return ($users_array);
+    }
+    
+    /**
+    * Converts a username (samAccountName) to a GUID
+    * 
+    * @param string $username The username to query
+    * @return string
+    */
+    public function username2guid($username) {
+        if (!$this->_bind){ return (false); }
+        if ($username === null){ return ("Missing compulsory field [username]"); }
+        
+        $filter = "samaccountname=" . $username; 
+        $fields = array("objectGUID"); 
+        $sr = @ldap_search($this->_conn, $this->_base_dn, $filter, $fields); 
+        if (ldap_count_entries($this->_conn, $sr) > 0) { 
+            $entry = @ldap_first_entry($this->_conn, $sr); 
+            $guid = @ldap_get_values_len($this->_conn, $entry, 'objectGUID'); 
+            $strGUID = $this->binary2text($guid[0]);          
+            return ($strGUID); 
+        }
+        else { 
+            return (false); 
+        } 
+    }
+    
+    
+    /**
+    * Move a user account to a different OU
+    *
+    * @param string $username The username to move (please be careful here!)
+    * @param array $container The container or containers to move the user to (please be careful here!).
+    * accepts containers in 1. parent 2. child order
+    * @return array
+    */
+    public function user_move($username, $container) {
+        if (!$this->_bind){ return (false); }
+        if ($username === null){ return ("Missing compulsory field [username]"); }
+        if ($container === null){ return ("Missing compulsory field [container]"); }
+        if (!is_array($container)){ return ("Container must be an array"); }
+        
+        $userinfo = $this->user_info($username, array("*"));
+        $dn = $userinfo[0]['distinguishedname'][0];
+        $newrdn = "cn=" . $username;
+        $container = array_reverse($container);
+        $newcontainer = "ou=" . implode(",ou=",$container);
+        $newbasedn = strtolower($newcontainer) . "," . $this->_base_dn;
+        $result=@ldap_rename($this->_conn,$dn,$newrdn,$newbasedn,true);
+        if ($result !== true) {
+            return (false);
+        }
+        return (true);
+    }
+    
+    //*****************************************************************************************************************
+    // CONTACT FUNCTIONS
+    // * Still work to do in this area, and new functions to write
+    
+    /**
+    * Create a contact
+    * 
+    * @param array $attributes The attributes to set to the contact
+    * @return bool
+    */
+    public function contact_create($attributes){
+        // Check for compulsory fields
+        if (!array_key_exists("display_name",$attributes)){ return ("Missing compulsory field [display_name]"); }
+        if (!array_key_exists("email",$attributes)){ return ("Missing compulsory field [email]"); }
+        if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); }
+        if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); }
+
+        // Translate the schema
+        $add=$this->adldap_schema($attributes);
+        
+        // Additional stuff only used for adding contacts
+        $add["cn"][0]=$attributes["display_name"];
+        $add["objectclass"][0]="top";
+        $add["objectclass"][1]="person";
+        $add["objectclass"][2]="organizationalPerson";
+        $add["objectclass"][3]="contact"; 
+        if (!isset($attributes['exchange_hidefromlists'])) {
+            $add["msExchHideFromAddressLists"][0]="TRUE";
+        }
+
+        // Determine the container
+        $attributes["container"]=array_reverse($attributes["container"]);
+        $container="OU=".implode(",OU=",$attributes["container"]);
+
+        // Add the entry
+        $result=@ldap_add($this->_conn, "CN=".$add["cn"][0].", ".$container.",".$this->_base_dn, $add);
+        if ($result!=true){ return (false); }
+        
+        return (true);
+    }  
+    
+    /**
+    * Determine the list of groups a contact is a member of
+    * 
+    * @param string $distinguisedname The full DN of a contact
+    * @param bool $recursive Recursively check groups
+    * @return array
+    */
+    public function contact_groups($distinguishedname,$recursive=NULL){
+        if ($distinguishedname===NULL){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+        
+        // Search the directory for their information
+        $info=@$this->contact_info($distinguishedname,array("memberof","primarygroupid"));
+        $groups=$this->nice_names($info[0]["memberof"]); //presuming the entry returned is our contact
+
+        if ($recursive === true){
+            foreach ($groups as $id => $group_name){
+                $extra_groups=$this->recursive_groups($group_name);
+                $groups=array_merge($groups,$extra_groups);
+            }
+        }
+        
+        return ($groups);
+    }
+    
+    /**
+    * Get contact information
+    * 
+    * @param string $distinguisedname The full DN of a contact
+    * @param array $fields Attributes to be returned
+    * @return array
+    */
+    public function contact_info($distinguishedname,$fields=NULL){
+        if ($distinguishedname===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+
+        $filter="distinguishedName=".$distinguishedname;
+        if ($fields===NULL){ $fields=array("distinguishedname","mail","memberof","department","displayname","telephonenumber","primarygroupid","objectsid"); }
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        if ($entries[0]['count'] >= 1) {
+            // AD does not return the primary group in the ldap query, we may need to fudge it
+            if ($this->_real_primarygroup && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["primarygroupid"][0])){
+                //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
+                $entries[0]["memberof"][]=$this->get_primary_group($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
+            } else {
+                $entries[0]["memberof"][]="CN=Domain Users,CN=Users,".$this->_base_dn;
+            }
+        }
+        
+        $entries[0]["memberof"]["count"]++;
+        return ($entries);
+    }
+    
+    /**
+    * Determine if a contact is a member of a group
+    * 
+    * @param string $distinguisedname The full DN of a contact
+    * @param string $group The group name to query
+    * @param bool $recursive Recursively check groups
+    * @return bool
+    */
+    public function contact_ingroup($distinguisedname,$group,$recursive=NULL){
+        if ($distinguisedname===NULL){ return (false); }
+        if ($group===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        
+        // Get a list of the groups
+        $groups=$this->contact_groups($distinguisedname,array("memberof"),$recursive);
+        
+        // Return true if the specified group is in the group list
+        if (in_array($group,$groups)){ return (true); }
+
+        return (false);
+    }          
+    
+    /**
+    * Modify a contact
+    * 
+    * @param string $distinguishedname The contact to query
+    * @param array $attributes The attributes to modify.  Note if you set the enabled attribute you must not specify any other attributes
+    * @return bool
+    */
+    public function contact_modify($distinguishedname,$attributes){
+        if ($distinguishedname===NULL){ return ("Missing compulsory field [distinguishedname]"); }
+        
+        // Translate the update to the LDAP schema                
+        $mod=$this->adldap_schema($attributes);
+        
+        // Check to see if this is an enabled status update
+        if (!$mod){ return (false); }
+        
+        // Do the update
+        $result=ldap_modify($this->_conn,$distinguishedname,$mod);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Delete a contact
+    * 
+    * @param string $distinguishedname The contact dn to delete (please be careful here!)
+    * @return array
+    */
+    public function contact_delete($distinguishedname) {
+        $result = $this->dn_delete($distinguishedname);
+        if ($result!=true){ return (false); }       
+        return (true);
+    }
+    
+    /**
+    * Return a list of all contacts
+    * 
+    * @param bool $include_desc Include a description of a contact
+    * @param string $search The search parameters
+    * @param bool $sorted Whether to sort the results
+    * @return array
+    */
+    public function all_contacts($include_desc = false, $search = "*", $sorted = true){
+        if (!$this->_bind){ return (false); }
+        
+        // Perform the search and grab all their details
+        $filter = "(&(objectClass=contact)(cn=".$search."))";
+        $fields=array("displayname","distinguishedname");           
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+
+        $users_array = array();
+        for ($i=0; $i<$entries["count"]; $i++){
+            if ($include_desc && strlen($entries[$i]["displayname"][0])>0){
+                $users_array[ $entries[$i]["distinguishedname"][0] ] = $entries[$i]["displayname"][0];
+            } elseif ($include_desc){
+                $users_array[ $entries[$i]["distinguishedname"][0] ] = $entries[$i]["distinguishedname"][0];
+            } else {
+                array_push($users_array, $entries[$i]["distinguishedname"][0]);
+            }
+        }
+        if ($sorted){ asort($users_array); }
+        return ($users_array);
+    }
+    
+    //*****************************************************************************************************************
+    // FOLDER FUNCTIONS
+    
+    /**
+    * Returns a folder listing for a specific OU
+    * See http://adldap.sourceforge.net/wiki/doku.php?id=api_folder_functions
+    * 
+    * @param array $folder_name An array to the OU you wish to list. 
+    *                           If set to NULL will list the root, strongly recommended to set 
+    *                           $recursive to false in that instance!
+    * @param string $dn_type The type of record to list.  This can be ADLDAP_FOLDER or ADLDAP_CONTAINER.
+    * @param bool $recursive Recursively search sub folders
+    * @param bool $type Specify a type of object to search for
+    * @return array
+    */
+    public function folder_list($folder_name = NULL, $dn_type = ADLDAP_FOLDER, $recursive = NULL, $type = NULL) {
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+
+        $filter = '(&';
+        if ($type !== NULL) {
+            switch ($type) {
+                case 'contact':
+                    $filter .= '(objectClass=contact)';
+                    break;
+                case 'computer':
+                    $filter .= '(objectClass=computer)';
+                    break;
+                case 'group':
+                    $filter .= '(objectClass=group)';
+                    break;
+                case 'folder':
+                    $filter .= '(objectClass=organizationalUnit)';
+                    break;
+                case 'container':
+                    $filter .= '(objectClass=container)';
+                    break;
+                case 'domain':
+                    $filter .= '(objectClass=builtinDomain)';
+                    break;
+                default:
+                    $filter .= '(objectClass=user)';
+                    break;   
+            }
+        }
+        else {
+            $filter .= '(objectClass=*)';   
+        }
+        // If the folder name is null then we will search the root level of AD
+        // This requires us to not have an OU= part, just the base_dn
+        $searchou = $this->_base_dn;
+        if (is_array($folder_name)) {
+            $ou = $dn_type . "=".implode("," . $dn_type . "=",$folder_name);
+            $filter .= '(!(distinguishedname=' . $ou . ',' . $this->_base_dn . ')))';
+            $searchou = $ou . ',' . $this->_base_dn;
+        }
+        else {
+            $filter .= '(!(distinguishedname=' . $this->_base_dn . ')))';
+        }
+
+        if ($recursive === true) {
+            $sr=ldap_search($this->_conn, $searchou, $filter, array('objectclass', 'distinguishedname', 'samaccountname'));
+            $entries = @ldap_get_entries($this->_conn, $sr);
+            if (is_array($entries)) {
+                return $entries;
+            }
+        }
+        else {
+            $sr=ldap_list($this->_conn, $searchou, $filter, array('objectclass', 'distinguishedname', 'samaccountname'));
+            $entries = @ldap_get_entries($this->_conn, $sr);
+            if (is_array($entries)) {
+                return $entries;
+            }
+        }
+        
+        return false;
+    }
+    
+    //*****************************************************************************************************************
+    // COMPUTER FUNCTIONS
+    
+    /**
+    * Get information about a specific computer
+    * 
+    * @param string $computer_name The name of the computer
+    * @param array $fields Attributes to return
+    * @return array
+    */
+    public function computer_info($computer_name,$fields=NULL){
+        if ($computer_name===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+
+        $filter="(&(objectClass=computer)(cn=".$computer_name."))";
+        if ($fields===NULL){ $fields=array("memberof","cn","displayname","dnshostname","distinguishedname","objectcategory","operatingsystem","operatingsystemservicepack","operatingsystemversion"); }
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        return ($entries);
+    }
+    
+    /**
+    * Check if a computer is in a group
+    * 
+    * @param string $computer_name The name of the computer
+    * @param string $group The group to check
+    * @param bool $recursive Whether to check recursively
+    * @return array
+    */
+    public function computer_ingroup($computer_name,$group,$recursive=NULL){
+        if ($computer_name===NULL){ return (false); }
+        if ($group===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // use the default option if they haven't set it
+
+        //get a list of the groups
+        $groups=$this->computer_groups($computer_name,array("memberof"),$recursive);
+
+        //return true if the specified group is in the group list
+        if (in_array($group,$groups)){ return (true); }
+
+        return (false);
+    }
+    
+    /**
+    * Get the groups a computer is in
+    * 
+    * @param string $computer_name The name of the computer
+    * @param bool $recursive Whether to check recursively
+    * @return array
+    */
+    public function computer_groups($computer_name,$recursive=NULL){
+        if ($computer_name===NULL){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+
+        //search the directory for their information
+        $info=@$this->computer_info($computer_name,array("memberof","primarygroupid"));
+        $groups=$this->nice_names($info[0]["memberof"]); //presuming the entry returned is our guy (unique usernames)
+
+        if ($recursive === true){
+            foreach ($groups as $id => $group_name){
+              $extra_groups=$this->recursive_groups($group_name);
+              $groups=array_merge($groups,$extra_groups);
+            }
+        }
+
+        return ($groups);
+    }
+    
+    //************************************************************************************************************
+    //  ORGANIZATIONAL UNIT FUNCTIONS
+    
+     /**
+    * Create an organizational unit
+    * 
+    * @param array $attributes Default attributes of the ou
+    * @return bool
+    */
+    public function ou_create($attributes){
+        if (!is_array($attributes)){ return ("Attributes must be an array"); }
+        if (!array_key_exists("ou_name",$attributes)){ return ("Missing compulsory field [ou_name]"); }
+        if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); }
+        if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); }
+        $attributes["container"]=array_reverse($attributes["container"]);
+
+        $add=array();
+        $add["objectClass"] = "organizationalUnit";
+
+        $container="OU=".implode(",OU=",$attributes["container"]);
+        $result=ldap_add($this->_conn,"CN=".$add["cn"].", ".$container.",".$this->_base_dn,$add);
+        if ($result!=true){ return (false); }
+        
+        return (true);
+    }
+    
+    //************************************************************************************************************
+    // EXCHANGE FUNCTIONS
+    
+    /**
+    * Create an Exchange account
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param array $storagegroup The mailbox, Exchange Storage Group, for the user account, this must be a full CN
+    *                            If the storage group has a different base_dn to the adLDAP configuration, set it using $base_dn
+    * @param string $emailaddress The primary email address to add to this user
+    * @param string $mailnickname The mail nick name.  If mail nickname is blank, the username will be used
+    * @param bool $usedefaults Indicates whether the store should use the default quota, rather than the per-mailbox quota.
+    * @param string $base_dn Specify an alternative base_dn for the Exchange storage group
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_create_mailbox($username, $storagegroup, $emailaddress, $mailnickname=NULL, $usedefaults=TRUE, $base_dn=NULL, $isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($storagegroup===NULL){ return ("Missing compulsory array [storagegroup]"); }
+        if (!is_array($storagegroup)){ return ("[storagegroup] must be an array"); }
+        if ($emailaddress===NULL){ return ("Missing compulsory field [emailaddress]"); }
+        
+        if ($base_dn===NULL) {
+            $base_dn = $this->_base_dn;   
+        }
+        
+        $container="CN=".implode(",CN=",$storagegroup);
+        
+        if ($mailnickname===NULL) { $mailnickname=$username; }
+        $mdbUseDefaults = $this->bool2str($usedefaults);
+        
+        $attributes = array(
+            'exchange_homemdb'=>$container.",".$base_dn,
+            'exchange_proxyaddress'=>'SMTP:' . $emailaddress,
+            'exchange_mailnickname'=>$mailnickname,
+            'exchange_usedefaults'=>$mdbUseDefaults
+        );
+        $result = $this->user_modify($username,$attributes,$isGUID);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Add an X400 address to Exchange
+    * See http://tools.ietf.org/html/rfc1685 for more information.
+    * An X400 Address looks similar to this X400:c=US;a= ;p=Domain;o=Organization;s=Doe;g=John;
+    * 
+    * @param string $username The username of the user to add the X400 to to
+    * @param string $country Country
+    * @param string $admd Administration Management Domain
+    * @param string $pdmd Private Management Domain (often your AD domain)
+    * @param string $org Organization
+    * @param string $surname Surname
+    * @param string $givenName Given name
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_add_X400($username, $country, $admd, $pdmd, $org, $surname, $givenname, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        
+        $proxyvalue = 'X400:';
+            
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"), $isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        // We do not have to demote an email address from the default so we can just add the new proxy address
+        $attributes['exchange_proxyaddress'] = $proxyvalue . 'c=' . $country . ';a=' . $admd . ';p=' . $pdmd . ';o=' . $org . ';s=' . $surname . ';g=' . $givenname . ';';
+       
+        // Translate the update to the LDAP schema                
+        $add=$this->adldap_schema($attributes);
+        
+        if (!$add){ return (false); }
+        
+        // Do the update
+        // Take out the @ to see any errors, usually this error might occur because the address already
+        // exists in the list of proxyAddresses
+        $result=@ldap_mod_add($this->_conn,$user_dn,$add);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Add an address to Exchange
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param string $emailaddress The email address to add to this user
+    * @param bool $default Make this email address the default address, this is a bit more intensive as we have to demote any existing default addresses
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_add_address($username, $emailaddress, $default=FALSE, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($emailaddress===NULL) { return ("Missing compulsory fields [emailaddress]"); }
+        
+        $proxyvalue = 'smtp:';
+        if ($default === true) {
+            $proxyvalue = 'SMTP:';
+        }
+              
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"),$isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        // We need to scan existing proxy addresses and demote the default one
+        if (is_array($user[0]["proxyaddresses"]) && $default===true) {
+            $modaddresses = array();
+            for ($i=0;$i_conn,$user_dn,$modaddresses);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+        else {
+            // We do not have to demote an email address from the default so we can just add the new proxy address
+            $attributes['exchange_proxyaddress'] = $proxyvalue . $emailaddress;
+            
+            // Translate the update to the LDAP schema                
+            $add=$this->adldap_schema($attributes);
+            
+            if (!$add){ return (false); }
+            
+            // Do the update
+            // Take out the @ to see any errors, usually this error might occur because the address already
+            // exists in the list of proxyAddresses
+            $result=@ldap_mod_add($this->_conn,$user_dn,$add);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+    }
+    
+    /**
+    * Remove an address to Exchange
+    * If you remove a default address the account will no longer have a default, 
+    * we recommend changing the default address first
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param string $emailaddress The email address to add to this user
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_del_address($username, $emailaddress, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($emailaddress===NULL) { return ("Missing compulsory fields [emailaddress]"); }
+        
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"),$isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        if (is_array($user[0]["proxyaddresses"])) {
+            $mod = array();
+            for ($i=0;$i_conn,$user_dn,$mod);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+        else {
+            return (false);
+        }
+    }
+    /**
+    * Change the default address
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param string $emailaddress The email address to make default
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_primary_address($username, $emailaddress, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($emailaddress===NULL) { return ("Missing compulsory fields [emailaddress]"); }
+        
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"), $isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        if (is_array($user[0]["proxyaddresses"])) {
+            $modaddresses = array();
+            for ($i=0;$i_conn,$user_dn,$modaddresses);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+        
+    }
+    
+    /**
+    * Mail enable a contact
+    * Allows email to be sent to them through Exchange
+    * 
+    * @param string $distinguishedname The contact to mail enable
+    * @param string $emailaddress The email address to allow emails to be sent through
+    * @param string $mailnickname The mailnickname for the contact in Exchange.  If NULL this will be set to the display name
+    * @return bool
+    */
+    public function exchange_contact_mailenable($distinguishedname, $emailaddress, $mailnickname=NULL){
+        if ($distinguishedname===NULL){ return ("Missing compulsory field [distinguishedname]"); }   
+        if ($emailaddress===NULL){ return ("Missing compulsory field [emailaddress]"); }  
+        
+        if ($mailnickname !== NULL) {
+            // Find the dn of the user
+            $user=$this->contact_info($distinguishedname,array("cn","displayname"));
+            if ($user[0]["displayname"]===NULL){ return (false); }
+            $mailnickname = $user[0]['displayname'][0];
+        }
+        
+        $attributes = array("email"=>$emailaddress,"contact_email"=>"SMTP:" . $emailaddress,"exchange_proxyaddress"=>"SMTP:" . $emailaddress,"exchange_mailnickname"=>$mailnickname);
+         
+        // Translate the update to the LDAP schema                
+        $mod=$this->adldap_schema($attributes);
+        
+        // Check to see if this is an enabled status update
+        if (!$mod){ return (false); }
+        
+        // Do the update
+        $result=ldap_modify($this->_conn,$distinguishedname,$mod);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Returns a list of Exchange Servers in the ConfigurationNamingContext of the domain
+    * 
+    * @param array $attributes An array of the AD attributes you wish to return
+    * @return array
+    */
+    public function exchange_servers($attributes = array('cn','distinguishedname','serialnumber')) {
+        if (!$this->_bind){ return (false); }
+        
+        $configurationNamingContext = $this->get_root_dse(array('configurationnamingcontext'));
+        $sr = @ldap_search($this->_conn,$configurationNamingContext[0]['configurationnamingcontext'][0],'(&(objectCategory=msExchExchangeServer))',$attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+        return $entries;
+    }
+    
+    /**
+    * Returns a list of Storage Groups in Exchange for a given mail server
+    * 
+    * @param string $exchangeServer The full DN of an Exchange server.  You can use exchange_servers() to find the DN for your server
+    * @param array $attributes An array of the AD attributes you wish to return
+    * @param bool $recursive If enabled this will automatically query the databases within a storage group
+    * @return array
+    */
+    public function exchange_storage_groups($exchangeServer, $attributes = array('cn','distinguishedname'), $recursive = NULL) {
+        if (!$this->_bind){ return (false); }
+        if ($exchangeServer===NULL){ return ("Missing compulsory field [exchangeServer]"); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; }
+
+        $filter = '(&(objectCategory=msExchStorageGroup))';
+        $sr=@ldap_search($this->_conn, $exchangeServer, $filter, $attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+
+        if ($recursive === true) {
+            for ($i=0; $i<$entries['count']; $i++) {
+                $entries[$i]['msexchprivatemdb'] = $this->exchange_storage_databases($entries[$i]['distinguishedname'][0]);       
+            }
+        }
+        
+        return $entries;
+    }
+    
+    /**
+    * Returns a list of Databases within any given storage group in Exchange for a given mail server
+    * 
+    * @param string $storageGroup The full DN of an Storage Group.  You can use exchange_storage_groups() to find the DN 
+    * @param array $attributes An array of the AD attributes you wish to return
+    * @return array
+    */
+    public function exchange_storage_databases($storageGroup, $attributes = array('cn','distinguishedname','displayname')) {
+        if (!$this->_bind){ return (false); }
+        if ($storageGroup===NULL){ return ("Missing compulsory field [storageGroup]"); }
+        
+        $filter = '(&(objectCategory=msExchPrivateMDB))';
+        $sr=@ldap_search($this->_conn, $storageGroup, $filter, $attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+        return $entries;
+    }
+    
+    //************************************************************************************************************
+    // SERVER FUNCTIONS
+    
+    /**
+    * Find the Base DN of your domain controller
+    * 
+    * @return string
+    */
+    public function find_base_dn() {
+        $namingContext = $this->get_root_dse(array('defaultnamingcontext'));   
+        return $namingContext[0]['defaultnamingcontext'][0];
+    }
+    
+    /**
+    * Get the RootDSE properties from a domain controller
+    * 
+    * @param array $attributes The attributes you wish to query e.g. defaultnamingcontext
+    * @return array
+    */
+    public function get_root_dse($attributes = array("*", "+")) {
+        if (!$this->_bind){ return (false); }
+        
+        $sr = @ldap_read($this->_conn, NULL, 'objectClass=*', $attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+        return $entries;
+    }
+
+    //************************************************************************************************************
+    // UTILITY FUNCTIONS (Many of these functions are protected and can only be called from within the class)
+
+    /**
+    * Get last error from Active Directory
+    * 
+    * This function gets the last message from Active Directory
+    * This may indeed be a 'Success' message but if you get an unknown error
+    * it might be worth calling this function to see what errors were raised
+    * 
+    * return string
+    */
+    public function get_last_error() {
+        return @ldap_error($this->_conn);
+    }
+    
+    /**
+    * Detect LDAP support in php
+    * 
+    * @return bool
+    */    
+    protected function ldap_supported() {
+        if (!function_exists('ldap_connect')) {
+            return (false);   
+        }
+        return (true);
+    }
+    
+    /**
+    * Schema
+    * 
+    * @param array $attributes Attributes to be queried
+    * @return array
+    */    
+    protected function adldap_schema($attributes){
+    
+        // LDAP doesn't like NULL attributes, only set them if they have values
+        // If you wish to remove an attribute you should set it to a space
+        // TO DO: Adapt user_modify to use ldap_mod_delete to remove a NULL attribute
+        $mod=array();
+        
+        // Check every attribute to see if it contains 8bit characters and then UTF8 encode them
+        array_walk($attributes, array($this, 'encode8bit'));
+
+        if ($attributes["address_city"]){ $mod["l"][0]=$attributes["address_city"]; }
+        if ($attributes["address_code"]){ $mod["postalCode"][0]=$attributes["address_code"]; }
+        //if ($attributes["address_country"]){ $mod["countryCode"][0]=$attributes["address_country"]; } // use country codes?
+        if ($attributes["address_country"]){ $mod["c"][0]=$attributes["address_country"]; }
+        if ($attributes["address_pobox"]){ $mod["postOfficeBox"][0]=$attributes["address_pobox"]; }
+        if ($attributes["address_state"]){ $mod["st"][0]=$attributes["address_state"]; }
+        if ($attributes["address_street"]){ $mod["streetAddress"][0]=$attributes["address_street"]; }
+        if ($attributes["company"]){ $mod["company"][0]=$attributes["company"]; }
+        if ($attributes["change_password"]){ $mod["pwdLastSet"][0]=0; }
+        if ($attributes["department"]){ $mod["department"][0]=$attributes["department"]; }
+        if ($attributes["description"]){ $mod["description"][0]=$attributes["description"]; }
+        if ($attributes["display_name"]){ $mod["displayName"][0]=$attributes["display_name"]; }
+        if ($attributes["email"]){ $mod["mail"][0]=$attributes["email"]; }
+        if ($attributes["expires"]){ $mod["accountExpires"][0]=$attributes["expires"]; } //unix epoch format?
+        if ($attributes["firstname"]){ $mod["givenName"][0]=$attributes["firstname"]; }
+        if ($attributes["home_directory"]){ $mod["homeDirectory"][0]=$attributes["home_directory"]; }
+        if ($attributes["home_drive"]){ $mod["homeDrive"][0]=$attributes["home_drive"]; }
+        if ($attributes["initials"]){ $mod["initials"][0]=$attributes["initials"]; }
+        if ($attributes["logon_name"]){ $mod["userPrincipalName"][0]=$attributes["logon_name"]; }
+        if ($attributes["manager"]){ $mod["manager"][0]=$attributes["manager"]; }  //UNTESTED ***Use DistinguishedName***
+        if ($attributes["office"]){ $mod["physicalDeliveryOfficeName"][0]=$attributes["office"]; }
+        if ($attributes["password"]){ $mod["unicodePwd"][0]=$this->encode_password($attributes["password"]); }
+        if ($attributes["profile_path"]){ $mod["profilepath"][0]=$attributes["profile_path"]; }
+        if ($attributes["script_path"]){ $mod["scriptPath"][0]=$attributes["script_path"]; }
+        if ($attributes["surname"]){ $mod["sn"][0]=$attributes["surname"]; }
+        if ($attributes["title"]){ $mod["title"][0]=$attributes["title"]; }
+        if ($attributes["telephone"]){ $mod["telephoneNumber"][0]=$attributes["telephone"]; }
+        if ($attributes["mobile"]){ $mod["mobile"][0]=$attributes["mobile"]; }
+        if ($attributes["pager"]){ $mod["pager"][0]=$attributes["pager"]; }
+        if ($attributes["ipphone"]){ $mod["ipphone"][0]=$attributes["ipphone"]; }
+        if ($attributes["web_page"]){ $mod["wWWHomePage"][0]=$attributes["web_page"]; }
+        if ($attributes["fax"]){ $mod["facsimileTelephoneNumber"][0]=$attributes["fax"]; }
+        if ($attributes["enabled"]){ $mod["userAccountControl"][0]=$attributes["enabled"]; }
+        
+        // Distribution List specific schema
+        if ($attributes["group_sendpermission"]){ $mod["dlMemSubmitPerms"][0]=$attributes["group_sendpermission"]; }
+        if ($attributes["group_rejectpermission"]){ $mod["dlMemRejectPerms"][0]=$attributes["group_rejectpermission"]; }
+        
+        // Exchange Schema
+        if ($attributes["exchange_homemdb"]){ $mod["homeMDB"][0]=$attributes["exchange_homemdb"]; }
+        if ($attributes["exchange_mailnickname"]){ $mod["mailNickname"][0]=$attributes["exchange_mailnickname"]; }
+        if ($attributes["exchange_proxyaddress"]){ $mod["proxyAddresses"][0]=$attributes["exchange_proxyaddress"]; }
+        if ($attributes["exchange_usedefaults"]){ $mod["mDBUseDefaults"][0]=$attributes["exchange_usedefaults"]; }
+        if ($attributes["exchange_policyexclude"]){ $mod["msExchPoliciesExcluded"][0]=$attributes["exchange_policyexclude"]; }
+        if ($attributes["exchange_policyinclude"]){ $mod["msExchPoliciesIncluded"][0]=$attributes["exchange_policyinclude"]; }       
+        if ($attributes["exchange_addressbook"]){ $mod["showInAddressBook"][0]=$attributes["exchange_addressbook"]; }       
+        
+        // This schema is designed for contacts
+        if ($attributes["exchange_hidefromlists"]){ $mod["msExchHideFromAddressLists"][0]=$attributes["exchange_hidefromlists"]; }
+        if ($attributes["contact_email"]){ $mod["targetAddress"][0]=$attributes["contact_email"]; }
+        
+        //echo ("
"); print_r($mod);
+        /*
+        // modifying a name is a bit fiddly
+        if ($attributes["firstname"] && $attributes["surname"]){
+            $mod["cn"][0]=$attributes["firstname"]." ".$attributes["surname"];
+            $mod["displayname"][0]=$attributes["firstname"]." ".$attributes["surname"];
+            $mod["name"][0]=$attributes["firstname"]." ".$attributes["surname"];
+        }
+        */
+
+        if (count($mod)==0){ return (false); }
+        return ($mod);
+    }
+
+    /**
+    * Coping with AD not returning the primary group
+    * http://support.microsoft.com/?kbid=321360 
+    * 
+    * For some reason it's not possible to search on primarygrouptoken=XXX
+    * If someone can show otherwise, I'd like to know about it :)
+    * this way is resource intensive and generally a pain in the @#%^
+    * 
+    * @deprecated deprecated since version 3.1, see get get_primary_group
+    * @param string $gid Group ID
+    * @return string
+    */
+    protected function group_cn($gid){    
+        if ($gid===NULL){ return (false); }
+        $r=false;
+        
+        $filter="(&(objectCategory=group)(samaccounttype=". ADLDAP_SECURITY_GLOBAL_GROUP ."))";
+        $fields=array("primarygrouptoken","samaccountname","distinguishedname");
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        for ($i=0; $i<$entries["count"]; $i++){
+            if ($entries[$i]["primarygrouptoken"][0]==$gid){
+                $r=$entries[$i]["distinguishedname"][0];
+                $i=$entries["count"];
+            }
+        }
+
+        return ($r);
+    }
+    
+    /**
+    * Coping with AD not returning the primary group
+    * http://support.microsoft.com/?kbid=321360 
+    * 
+    * This is a re-write based on code submitted by Bruce which prevents the 
+    * need to search each security group to find the true primary group
+    * 
+    * @param string $gid Group ID
+    * @param string $usersid User's Object SID
+    * @return string
+    */
+    protected function get_primary_group($gid, $usersid){
+        if ($gid===NULL || $usersid===NULL){ return (false); }
+        $r=false;
+
+        $gsid = substr_replace($usersid,pack('V',$gid),strlen($usersid)-4,4);
+        $filter='(objectsid='.$this->getTextSID($gsid).')';
+        $fields=array("samaccountname","distinguishedname");
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+
+        return $entries[0]['distinguishedname'][0];
+     }
+     
+    /**
+    * Convert a binary SID to a text SID
+    * 
+    * @param string $binsid A Binary SID
+    * @return string
+    */
+     protected function getTextSID($binsid) {
+        $hex_sid = bin2hex($binsid);
+        $rev = hexdec(substr($hex_sid, 0, 2));
+        $subcount = hexdec(substr($hex_sid, 2, 2));
+        $auth = hexdec(substr($hex_sid, 4, 12));
+        $result = "$rev-$auth";
+
+        for ($x=0;$x < $subcount; $x++) {
+            $subauth[$x] =
+                hexdec($this->little_endian(substr($hex_sid, 16 + ($x * 8), 8)));
+                $result .= "-" . $subauth[$x];
+        }
+
+        // Cheat by tacking on the S-
+        return 'S-' . $result;
+     }
+     
+    /**
+    * Converts a little-endian hex number to one that hexdec() can convert
+    * 
+    * @param string $hex A hex code
+    * @return string
+    */
+     protected function little_endian($hex) {
+        $result = '';
+        for ($x = strlen($hex) - 2; $x >= 0; $x = $x - 2) {
+            $result .= substr($hex, $x, 2);
+        }
+        return $result;
+     }
+     
+    /**
+    * Converts a binary attribute to a string
+    * 
+    * @param string $bin A binary LDAP attribute
+    * @return string
+    */
+    protected function binary2text($bin) {
+        $hex_guid = bin2hex($bin); 
+        $hex_guid_to_guid_str = ''; 
+        for($k = 1; $k <= 4; ++$k) { 
+            $hex_guid_to_guid_str .= substr($hex_guid, 8 - 2 * $k, 2); 
+        } 
+        $hex_guid_to_guid_str .= '-'; 
+        for($k = 1; $k <= 2; ++$k) { 
+            $hex_guid_to_guid_str .= substr($hex_guid, 12 - 2 * $k, 2); 
+        } 
+        $hex_guid_to_guid_str .= '-'; 
+        for($k = 1; $k <= 2; ++$k) { 
+            $hex_guid_to_guid_str .= substr($hex_guid, 16 - 2 * $k, 2); 
+        } 
+        $hex_guid_to_guid_str .= '-' . substr($hex_guid, 16, 4); 
+        $hex_guid_to_guid_str .= '-' . substr($hex_guid, 20); 
+        return strtoupper($hex_guid_to_guid_str);   
+    }
+    
+    /**
+    * Converts a binary GUID to a string GUID
+    * 
+    * @param string $binaryGuid The binary GUID attribute to convert
+    * @return string
+    */
+    public function decodeGuid($binaryGuid) {
+        if ($binaryGuid === null){ return ("Missing compulsory field [binaryGuid]"); }
+        
+        $strGUID = $this->binary2text($binaryGuid);          
+        return ($strGUID); 
+    }
+     
+    /**
+    * Converts a string GUID to a hexdecimal value so it can be queried
+    * 
+    * @param string $strGUID A string representation of a GUID
+    * @return string
+    */
+    protected function strguid2hex($strGUID) {
+        $strGUID = str_replace('-', '', $strGUID);
+
+        $octet_str = '\\' . substr($strGUID, 6, 2);
+        $octet_str .= '\\' . substr($strGUID, 4, 2);
+        $octet_str .= '\\' . substr($strGUID, 2, 2);
+        $octet_str .= '\\' . substr($strGUID, 0, 2);
+        $octet_str .= '\\' . substr($strGUID, 10, 2);
+        $octet_str .= '\\' . substr($strGUID, 8, 2);
+        $octet_str .= '\\' . substr($strGUID, 14, 2);
+        $octet_str .= '\\' . substr($strGUID, 12, 2);
+        //$octet_str .= '\\' . substr($strGUID, 16, strlen($strGUID));
+        for ($i=16; $i<=(strlen($strGUID)-2); $i++) {
+            if (($i % 2) == 0) {
+                $octet_str .= '\\' . substr($strGUID, $i, 2);
+            }
+        }
+        
+        return $octet_str;
+    }
+    
+    /**
+    * Obtain the user's distinguished name based on their userid 
+    * 
+    * 
+    * @param string $username The username
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return string
+    */
+    protected function user_dn($username,$isGUID=false){
+        $user=$this->user_info($username,array("cn"),$isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        return ($user_dn);
+    }
+
+    /**
+    * Encode a password for transmission over LDAP
+    *
+    * @param string $password The password to encode
+    * @return string
+    */
+    protected function encode_password($password){
+        $password="\"".$password."\"";
+        $encoded="";
+        for ($i=0; $i 
+    * @return string
+    */
+    protected function ldap_slashes($str){
+        return preg_replace('/([\x00-\x1F\*\(\)\\\\])/e',
+                            '"\\\\\".join("",unpack("H2","$1"))',
+                            $str);
+    }
+    
+    /**
+    * Select a random domain controller from your domain controller array
+    * 
+    * @return string
+    */
+    protected function random_controller(){
+        mt_srand(doubleval(microtime()) * 100000000); // For older PHP versions
+        return ($this->_domain_controllers[array_rand($this->_domain_controllers)]);
+    }
+    
+    /**
+    * Account control options
+    *
+    * @param array $options The options to convert to int 
+    * @return int
+    */
+    protected function account_control($options){
+        $val=0;
+
+        if (is_array($options)){
+            if (in_array("SCRIPT",$options)){ $val=$val+1; }
+            if (in_array("ACCOUNTDISABLE",$options)){ $val=$val+2; }
+            if (in_array("HOMEDIR_REQUIRED",$options)){ $val=$val+8; }
+            if (in_array("LOCKOUT",$options)){ $val=$val+16; }
+            if (in_array("PASSWD_NOTREQD",$options)){ $val=$val+32; }
+            //PASSWD_CANT_CHANGE Note You cannot assign this permission by directly modifying the UserAccountControl attribute.
+            //For information about how to set the permission programmatically, see the "Property flag descriptions" section.
+            if (in_array("ENCRYPTED_TEXT_PWD_ALLOWED",$options)){ $val=$val+128; }
+            if (in_array("TEMP_DUPLICATE_ACCOUNT",$options)){ $val=$val+256; }
+            if (in_array("NORMAL_ACCOUNT",$options)){ $val=$val+512; }
+            if (in_array("INTERDOMAIN_TRUST_ACCOUNT",$options)){ $val=$val+2048; }
+            if (in_array("WORKSTATION_TRUST_ACCOUNT",$options)){ $val=$val+4096; }
+            if (in_array("SERVER_TRUST_ACCOUNT",$options)){ $val=$val+8192; }
+            if (in_array("DONT_EXPIRE_PASSWORD",$options)){ $val=$val+65536; }
+            if (in_array("MNS_LOGON_ACCOUNT",$options)){ $val=$val+131072; }
+            if (in_array("SMARTCARD_REQUIRED",$options)){ $val=$val+262144; }
+            if (in_array("TRUSTED_FOR_DELEGATION",$options)){ $val=$val+524288; }
+            if (in_array("NOT_DELEGATED",$options)){ $val=$val+1048576; }
+            if (in_array("USE_DES_KEY_ONLY",$options)){ $val=$val+2097152; }
+            if (in_array("DONT_REQ_PREAUTH",$options)){ $val=$val+4194304; } 
+            if (in_array("PASSWORD_EXPIRED",$options)){ $val=$val+8388608; }
+            if (in_array("TRUSTED_TO_AUTH_FOR_DELEGATION",$options)){ $val=$val+16777216; }
+        }
+        return ($val);
+    }
+    
+    /**
+    * Take an LDAP query and return the nice names, without all the LDAP prefixes (eg. CN, DN)
+    *
+    * @param array $groups
+    * @return array
+    */
+    protected function nice_names($groups){
+
+        $group_array=array();
+        for ($i=0; $i<$groups["count"]; $i++){ // For each group
+            $line=$groups[$i];
+            
+            if (strlen($line)>0){ 
+                // More presumptions, they're all prefixed with CN=
+                // so we ditch the first three characters and the group
+                // name goes up to the first comma
+                $bits=explode(",",$line);
+                $group_array[]=substr($bits[0],3,(strlen($bits[0])-3));
+            }
+        }
+        return ($group_array);    
+    }
+    
+    /**
+    * Delete a distinguished name from Active Directory
+    * You should never need to call this yourself, just use the wrapper functions user_delete and contact_delete
+    *
+    * @param string $dn The distinguished name to delete
+    * @return bool
+    */
+    protected function dn_delete($dn){ 
+        $result=ldap_delete($this->_conn, $dn);
+        if ($result!=true){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Convert a boolean value to a string
+    * You should never need to call this yourself
+    *
+    * @param bool $bool Boolean value
+    * @return string
+    */
+    protected function bool2str($bool) {
+        return ($bool) ? 'TRUE' : 'FALSE';
+    }
+    
+    /**
+    * Convert 8bit characters e.g. accented characters to UTF8 encoded characters
+    */
+    protected function encode8bit(&$item, $key) {
+        $encode = false;
+        if (is_string($item)) {
+            for ($i=0; $i> 7) {
+                    $encode = true;
+                }
+            }
+        }
+        if ($encode === true && $key != 'password') {
+            $item = utf8_encode($item);   
+        }
+    }    
+}
+
+/**
+* adLDAP Exception Handler
+* 
+* Exceptions of this type are thrown on bind failure or when SSL is required but not configured
+* Example:
+* try {
+*   $adldap = new adLDAP();
+* }
+* catch (adLDAPException $e) {
+*   echo $e;
+*   exit();
+* }
+*/
+class adLDAPException extends Exception {}
+
+?>
\ No newline at end of file
diff --git a/adLDAP/adLDAP_studnet.php b/adLDAP/adLDAP_studnet.php
new file mode 100755
index 0000000..99ce94a
--- /dev/null
+++ b/adLDAP/adLDAP_studnet.php
@@ -0,0 +1,2421 @@
+_account_suffix = $_account_suffix;
+    }
+
+    /**
+    * Get the account suffix
+    * 
+    * @return string
+    */
+    public function get_account_suffix()
+    {
+          return $this->_account_suffix;
+    }
+    
+    /**
+    * Set the domain controllers array
+    * 
+    * @param array $_domain_controllers
+    * @return void
+    */
+    public function set_domain_controllers(array $_domain_controllers)
+    {
+          $this->_domain_controllers = $_domain_controllers;
+    }
+
+    /**
+    * Get the list of domain controllers
+    * 
+    * @return void
+    */
+    public function get_domain_controllers()
+    {
+          return $this->_domain_controllers;
+    }
+    
+    /**
+    * Set the username of an account with higher priviledges
+    * 
+    * @param string $_ad_username
+    * @return void
+    */
+    public function set_ad_username($_ad_username)
+    {
+          $this->_ad_username = $_ad_username;
+    }
+
+    /**
+    * Get the username of the account with higher priviledges
+    * 
+    * This will throw an exception for security reasons
+    */
+    public function get_ad_username()
+    {
+          throw new adLDAPException('For security reasons you cannot access the domain administrator account details');
+    }
+    
+    /**
+    * Set the password of an account with higher priviledges
+    * 
+    * @param string $_ad_password
+    * @return void
+    */
+    public function set_ad_password($_ad_password)
+    {
+          $this->_ad_password = $_ad_password;
+    }
+
+    /**
+    * Get the password of the account with higher priviledges
+    * 
+    * This will throw an exception for security reasons
+    */
+    public function get_ad_password()
+    {
+          throw new adLDAPException('For security reasons you cannot access the domain administrator account details');
+    }
+    
+    /**
+    * Set whether to detect the true primary group
+    * 
+    * @param bool $_real_primary_group
+    * @return void
+    */
+    public function set_real_primarygroup($_real_primarygroup)
+    {
+          $this->_real_primarygroup = $_real_primarygroup;
+    }
+
+    /**
+    * Get the real primary group setting
+    * 
+    * @return bool
+    */
+    public function get_real_primarygroup()
+    {
+          return $this->_real_primarygroup;
+    }
+    
+    /**
+    * Set whether to use SSL
+    * 
+    * @param bool $_use_ssl
+    * @return void
+    */
+    public function set_use_ssl($_use_ssl)
+    {
+          $this->_use_ssl = $_use_ssl;
+    }
+
+    /**
+    * Get the SSL setting
+    * 
+    * @return bool
+    */
+    public function get_use_ssl()
+    {
+          return $this->_use_ssl;
+    }
+    
+    /**
+    * Set whether to use TLS
+    * 
+    * @param bool $_use_tls
+    * @return void
+    */
+    public function set_use_tls($_use_tls)
+    {
+          $this->_use_tls = $_use_tls;
+    }
+
+    /**
+    * Get the TLS setting
+    * 
+    * @return bool
+    */
+    public function get_use_tls()
+    {
+          return $this->_use_tls;
+    }
+    
+    /**
+    * Set whether to lookup recursive groups
+    * 
+    * @param bool $_recursive_groups
+    * @return void
+    */
+    public function set_recursive_groups($_recursive_groups)
+    {
+          $this->_recursive_groups = $_recursive_groups;
+    }
+
+    /**
+    * Get the recursive groups setting
+    * 
+    * @return bool
+    */
+    public function get_recursive_groups()
+    {
+          return $this->_recursive_groups;
+    }
+
+    /**
+    * Default Constructor
+    * 
+    * Tries to bind to the AD domain over LDAP or LDAPs
+    * 
+    * @param array $options Array of options to pass to the constructor
+    * @throws Exception - if unable to bind to Domain Controller
+    * @return bool
+    */
+    function __construct($options=array()){
+        // You can specifically overide any of the default configuration options setup above
+        if (count($options)>0){
+            if (array_key_exists("account_suffix",$options)){ $this->_account_suffix=$options["account_suffix"]; }
+            if (array_key_exists("base_dn",$options)){ $this->_base_dn=$options["base_dn"]; }
+            if (array_key_exists("domain_controllers",$options)){ $this->_domain_controllers=$options["domain_controllers"]; }
+            if (array_key_exists("ad_username",$options)){ $this->_ad_username=$options["ad_username"]; }
+            if (array_key_exists("ad_password",$options)){ $this->_ad_password=$options["ad_password"]; }
+            if (array_key_exists("real_primarygroup",$options)){ $this->_real_primarygroup=$options["real_primarygroup"]; }
+            if (array_key_exists("use_ssl",$options)){ $this->_use_ssl=$options["use_ssl"]; }
+            if (array_key_exists("use_tls",$options)){ $this->_use_tls=$options["use_tls"]; }
+            if (array_key_exists("recursive_groups",$options)){ $this->_recursive_groups=$options["recursive_groups"]; }
+        }
+        
+        if ($this->ldap_supported() === false) {
+            throw new adLDAPException('No LDAP support for PHP.  See: http://www.php.net/ldap');
+        }
+
+        return $this->connect();
+    }
+
+    /**
+    * Default Destructor
+    * 
+    * Closes the LDAP connection
+    * 
+    * @return void
+    */
+    function __destruct(){ $this->close(); }
+
+    /**
+    * Connects and Binds to the Domain Controller
+    * 
+    * @return bool
+    */
+    public function connect() {
+        // Connect to the AD/LDAP server as the username/password
+        $dc=$this->random_controller();
+        if ($this->_use_ssl){
+            $this->_conn = ldap_connect("ldaps://".$dc, 636);
+        } else {
+            $this->_conn = ldap_connect($dc);
+        }
+               
+        // Set some ldap options for talking to AD
+        ldap_set_option($this->_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+        ldap_set_option($this->_conn, LDAP_OPT_REFERRALS, 0);
+        
+        if ($this->_use_tls) {
+            ldap_start_tls($this->_conn);
+        }
+               
+        // Bind as a domain admin if they've set it up
+        if ($this->_ad_username!=NULL && $this->_ad_password!=NULL){
+            $this->_bind = @ldap_bind($this->_conn,$this->_ad_username.$this->_account_suffix,$this->_ad_password);
+            if (!$this->_bind){
+                if ($this->_use_ssl && !$this->_use_tls){
+                    // If you have problems troubleshooting, remove the @ character from the ldap_bind command above to get the actual error message
+                    throw new adLDAPException('Bind to Active Directory failed. Either the LDAPs connection failed or the login credentials are incorrect. AD said: ' . $this->get_last_error());
+                } else {
+                    throw new adLDAPException('Bind to Active Directory failed. Check the login credentials and/or server details. AD said: ' . $this->get_last_error());
+                }
+            }
+        }
+        
+        if ($this->_base_dn == NULL) {
+            $this->_base_dn = $this->find_base_dn();   
+        }
+        
+        return (true);
+    }
+    
+    /**
+    * Closes the LDAP connection
+    * 
+    * @return void
+    */
+    public function close() {
+        ldap_close ($this->_conn);
+    }
+
+    /**
+    * Validate a user's login credentials
+    * 
+    * @param string $username A user's AD username
+    * @param string $password A user's AD password
+    * @param bool optional $prevent_rebind
+    * @return bool
+    */
+    public function authenticate($username, $password, $prevent_rebind = false) {
+        // Prevent null binding
+        if ($username === NULL || $password === NULL) { return false; } 
+        if (empty($username) || empty($password)) { return false; }
+        
+        // Bind as the user        
+        $ret = true;
+        $this->_bind = @ldap_bind($this->_conn, $username . $this->_account_suffix, $password);
+        if (!$this->_bind){ $ret = false; }
+        
+        // Cnce we've checked their details, kick back into admin mode if we have it
+        if ($this->_ad_username !== NULL && !$prevent_rebind) {
+            $this->_bind = @ldap_bind($this->_conn, $this->_ad_username . $this->_account_suffix , $this->_ad_password);
+            if (!$this->_bind){
+                // This should never happen in theory
+                throw new adLDAPException('Rebind to Active Directory failed. AD said: ' . $this->get_last_error());
+            } 
+        }
+        
+        return $ret;
+    }
+
+    //*****************************************************************************************************************
+    // GROUP FUNCTIONS
+
+    /**
+    * Add a group to a group
+    * 
+    * @param string $parent The parent group name
+    * @param string $child The child group name
+    * @return bool
+    */
+    public function group_add_group($parent,$child){
+
+        // Find the parent group's dn
+        $parent_group=$this->group_info($parent,array("cn"));
+        if ($parent_group[0]["dn"]===NULL){ return (false); }
+        $parent_dn=$parent_group[0]["dn"];
+        
+        // Find the child group's dn
+        $child_group=$this->group_info($child,array("cn"));
+        if ($child_group[0]["dn"]===NULL){ return (false); }
+        $child_dn=$child_group[0]["dn"];
+                
+        $add=array();
+        $add["member"] = $child_dn;
+        
+        $result=@ldap_mod_add($this->_conn,$parent_dn,$add);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Add a user to a group
+    * 
+    * @param string $group The group to add the user to
+    * @param string $user The user to add to the group
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function group_add_user($group,$user,$isGUID=false){
+        // Adding a user is a bit fiddly, we need to get the full DN of the user
+        // and add it using the full DN of the group
+        
+        // Find the user's dn
+        $user_dn=$this->user_dn($user,$isGUID);
+        if ($user_dn===false){ return (false); }
+        
+        // Find the group's dn
+        $group_info=$this->group_info($group,array("cn"));
+        if ($group_info[0]["dn"]===NULL){ return (false); }
+        $group_dn=$group_info[0]["dn"];
+        
+        $add=array();
+        $add["member"] = $user_dn;
+        
+        $result=@ldap_mod_add($this->_conn,$group_dn,$add);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Add a contact to a group
+    * 
+    * @param string $group The group to add the contact to
+    * @param string $contact_dn The DN of the contact to add
+    * @return bool
+    */
+    public function group_add_contact($group,$contact_dn){
+        // To add a contact we take the contact's DN
+        // and add it using the full DN of the group
+        
+        // Find the group's dn
+        $group_info=$this->group_info($group,array("cn"));
+        if ($group_info[0]["dn"]===NULL){ return (false); }
+        $group_dn=$group_info[0]["dn"];
+        
+        $add=array();
+        $add["member"] = $contact_dn;
+        
+        $result=@ldap_mod_add($this->_conn,$group_dn,$add);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+
+    /**
+    * Create a group
+    * 
+    * @param array $attributes Default attributes of the group
+    * @return bool
+    */
+    public function group_create($attributes){
+        if (!is_array($attributes)){ return ("Attributes must be an array"); }
+        if (!array_key_exists("group_name",$attributes)){ return ("Missing compulsory field [group_name]"); }
+        if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); }
+        if (!array_key_exists("description",$attributes)){ return ("Missing compulsory field [description]"); }
+        if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); }
+        $attributes["container"]=array_reverse($attributes["container"]);
+
+        //$member_array = array();
+        //$member_array[0] = "cn=user1,cn=Users,dc=yourdomain,dc=com";
+        //$member_array[1] = "cn=administrator,cn=Users,dc=yourdomain,dc=com";
+        
+        $add=array();
+        $add["cn"] = $attributes["group_name"];
+        $add["samaccountname"] = $attributes["group_name"];
+        $add["objectClass"] = "Group";
+        $add["description"] = $attributes["description"];
+        //$add["member"] = $member_array; UNTESTED
+
+        $container="OU=".implode(",OU=",$attributes["container"]);
+        $result=ldap_add($this->_conn,"CN=".$add["cn"].", ".$container.",".$this->_base_dn,$add);
+        if ($result!=true){ return (false); }
+        
+        return (true);
+    }
+
+    /**
+    * Remove a group from a group
+    * 
+    * @param string $parent The parent group name
+    * @param string $child The child group name
+    * @return bool
+    */
+    public function group_del_group($parent,$child){
+    
+        // Find the parent dn
+        $parent_group=$this->group_info($parent,array("cn"));
+        if ($parent_group[0]["dn"]===NULL){ return (false); }
+        $parent_dn=$parent_group[0]["dn"];
+        
+        // Find the child dn
+        $child_group=$this->group_info($child,array("cn"));
+        if ($child_group[0]["dn"]===NULL){ return (false); }
+        $child_dn=$child_group[0]["dn"];
+        
+        $del=array();
+        $del["member"] = $child_dn;
+        
+        $result=@ldap_mod_del($this->_conn,$parent_dn,$del);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Remove a user from a group
+    * 
+    * @param string $group The group to remove a user from
+    * @param string $user The AD user to remove from the group
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function group_del_user($group,$user,$isGUID=false){
+    
+        // Find the parent dn
+        $group_info=$this->group_info($group,array("cn"));
+        if ($group_info[0]["dn"]===NULL){ return (false); }
+        $group_dn=$group_info[0]["dn"];
+        
+        // Find the users dn
+        $user_dn=$this->user_dn($user,$isGUID);
+        if ($user_dn===false){ return (false); }
+
+        $del=array();
+        $del["member"] = $user_dn;
+        
+        $result=@ldap_mod_del($this->_conn,$group_dn,$del);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Remove a contact from a group
+    * 
+    * @param string $group The group to remove a user from
+    * @param string $contact_dn The DN of a contact to remove from the group
+    * @return bool
+    */
+    public function group_del_contact($group,$contact_dn){
+    
+        // Find the parent dn
+        $group_info=$this->group_info($group,array("cn"));
+        if ($group_info[0]["dn"]===NULL){ return (false); }
+        $group_dn=$group_info[0]["dn"];
+    
+        $del=array();
+        $del["member"] = $contact_dn;
+        
+        $result=@ldap_mod_del($this->_conn,$group_dn,$del);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Return a list of groups in a group
+    * 
+    * @param string $group The group to query
+    * @param bool $recursive Recursively get groups
+    * @return array
+    */
+    public function groups_in_group($group, $recursive = NULL){
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it 
+        
+        // Search the directory for the members of a group
+        $info=$this->group_info($group,array("member","cn"));
+        $groups=$info[0]["member"];
+        if (!is_array($groups)) {
+            return (false);   
+        }
+ 
+        $group_array=array();
+
+        for ($i=0; $i<$groups["count"]; $i++){ 
+             $filter="(&(objectCategory=group)(distinguishedName=".$this->ldap_slashes($groups[$i])."))";
+             $fields = array("samaccountname", "distinguishedname", "objectClass");
+             $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+             $entries = ldap_get_entries($this->_conn, $sr);
+
+             // not a person, look for a group  
+             if ($entries['count'] == 0 && $recursive == true) {  
+                $filter="(&(objectCategory=group)(distinguishedName=".$this->ldap_slashes($groups[$i])."))";  
+                $fields = array("distinguishedname");  
+                $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);  
+                $entries = ldap_get_entries($this->_conn, $sr);  
+                if (!isset($entries[0]['distinguishedname'][0])) {
+                    continue;  
+                }
+                $sub_groups = $this->groups_in_group($entries[0]['distinguishedname'][0], $recursive);  
+                if (is_array($sub_groups)) {
+                    $group_array = array_merge($group_array, $sub_groups); 
+                    $group_array = array_unique($group_array);  
+                }
+                continue;  
+             } 
+
+             $group_array[] = $entries[0]['distinguishedname'][0];
+        }
+        return ($group_array);
+    }
+    
+    /**
+    * Return a list of members in a group
+    * 
+    * @param string $group The group to query
+    * @param bool $recursive Recursively get group members
+    * @return array
+    */
+    public function group_members($group, $recursive = NULL){
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it 
+        // Search the directory for the members of a group
+        $info=$this->group_info($group,array("member","cn"));
+        $users=$info[0]["member"];
+        if (!is_array($users)) {
+            return (false);   
+        }
+ 
+        $user_array=array();
+
+        for ($i=0; $i<$users["count"]; $i++){ 
+             $filter="(&(objectCategory=person)(distinguishedName=".$this->ldap_slashes($users[$i])."))";
+             $fields = array("samaccountname", "distinguishedname", "objectClass");
+             $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+             $entries = ldap_get_entries($this->_conn, $sr);
+
+             // not a person, look for a group  
+             if ($entries['count'] == 0 && $recursive == true) {  
+                $filter="(&(objectCategory=group)(distinguishedName=".$this->ldap_slashes($users[$i])."))";  
+                $fields = array("samaccountname");  
+                $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);  
+                $entries = ldap_get_entries($this->_conn, $sr);  
+                if (!isset($entries[0]['samaccountname'][0])) {
+                    continue;  
+                }
+                $sub_users = $this->group_members($entries[0]['samaccountname'][0], $recursive);  
+                if (is_array($sub_users)) {
+                    $user_array = array_merge($user_array, $sub_users); 
+                    $user_array = array_unique($user_array);  
+                }
+                continue;  
+             } 
+
+             if ($entries[0]['samaccountname'][0] === NULL && $entries[0]['distinguishedname'][0] !== NULL) {
+                 $user_array[] = $entries[0]['distinguishedname'][0];
+             }
+             elseif ($entries[0]['samaccountname'][0] !== NULL) {
+                $user_array[] = $entries[0]['samaccountname'][0];
+             }
+        }
+        return ($user_array);
+    }
+    
+    /**
+    * Group Information.  Returns an array of information about a group.
+    * The group name is case sensitive
+    * 
+    * @param string $group_name The group name to retrieve info about
+    * @param array $fields Fields to retrieve
+    * @return array
+    */
+    public function group_info($group_name,$fields=NULL){
+        if ($group_name===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        
+        if (stristr($group_name, '+')) {
+            $group_name=stripslashes($group_name);   
+        }
+        
+        $filter="(&(objectCategory=group)(name=".$this->ldap_slashes($group_name)."))";
+        //echo ($filter."!!!
"); + if ($fields===NULL){ $fields=array("member","memberof","cn","description","distinguishedname","objectcategory","samaccountname"); } + $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields); + $entries = ldap_get_entries($this->_conn, $sr); + //print_r($entries); + return ($entries); + } + + /** + * Return a complete list of "groups in groups" + * + * @param string $group The group to get the list from + * @return array + */ + public function recursive_groups($group){ + if ($group===NULL){ return (false); } + + $ret_groups=array(); + + $groups=$this->group_info($group,array("memberof")); + if (isset($groups[0]["memberof"]) && is_array($groups[0]["memberof"])) { + $groups=$groups[0]["memberof"]; + + if ($groups){ + $group_names=$this->nice_names($groups); + $ret_groups=array_merge($ret_groups,$group_names); //final groups to return + + foreach ($group_names as $id => $group_name){ + $child_groups=$this->recursive_groups($group_name); + $ret_groups=array_merge($ret_groups,$child_groups); + } + } + } + + return ($ret_groups); + } + + /** + * Returns a complete list of the groups in AD based on a SAM Account Type + * + * @param string $samaccounttype The account type to return + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function search_groups($samaccounttype = ADLDAP_SECURITY_GLOBAL_GROUP, $include_desc = false, $search = "*", $sorted = true) { + if (!$this->_bind){ return (false); } + + $filter = '(&(objectCategory=group)'; + if ($samaccounttype !== null) { + $filter .= '(samaccounttype='. $samaccounttype .')'; + } + $filter .= '(cn='.$search.'))'; + // Perform the search and grab all their details + $fields=array("samaccountname","description"); + $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields); + $entries = ldap_get_entries($this->_conn, $sr); + + $groups_array = array(); + for ($i=0; $i<$entries["count"]; $i++){ + if ($include_desc && strlen($entries[$i]["description"][0]) > 0 ){ + $groups_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["description"][0]; + } elseif ($include_desc){ + $groups_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["samaccountname"][0]; + } else { + array_push($groups_array, $entries[$i]["samaccountname"][0]); + } + } + if( $sorted ){ asort($groups_array); } + return ($groups_array); + } + + /** + * Returns a complete list of all groups in AD + * + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function all_groups($include_desc = false, $search = "*", $sorted = true){ + $groups_array = $this->search_groups(null, $include_desc, $search, $sorted); + return ($groups_array); + } + + /** + * Returns a complete list of security groups in AD + * + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function all_security_groups($include_desc = false, $search = "*", $sorted = true){ + $groups_array = $this->search_groups(ADLDAP_SECURITY_GLOBAL_GROUP, $include_desc, $search, $sorted); + return ($groups_array); + } + + /** + * Returns a complete list of distribution lists in AD + * + * @param bool $include_desc Whether to return a description + * @param string $search Search parameters + * @param bool $sorted Whether to sort the results + * @return array + */ + public function all_distribution_groups($include_desc = false, $search = "*", $sorted = true){ + $groups_array = $this->search_groups(ADLDAP_DISTRIBUTION_GROUP, $include_desc, $search, $sorted); + return ($groups_array); + } + + //***************************************************************************************************************** + // USER FUNCTIONS + + /** + * Create a user + * + * If you specify a password here, this can only be performed over SSL + * + * @param array $attributes The attributes to set to the user account + * @return bool + */ + public function user_create($attributes){ + // Check for compulsory fields + if (!array_key_exists("username",$attributes)){ return ("Missing compulsory field [username]"); } + if (!array_key_exists("firstname",$attributes)){ return ("Missing compulsory field [firstname]"); } + if (!array_key_exists("surname",$attributes)){ return ("Missing compulsory field [surname]"); } + if (!array_key_exists("email",$attributes)){ return ("Missing compulsory field [email]"); } + if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); } + if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); } + + if (array_key_exists("password",$attributes) && (!$this->_use_ssl && !$this->_use_tls)){ + throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.'); + } + + if (!array_key_exists("display_name",$attributes)){ $attributes["display_name"]=$attributes["firstname"]." ".$attributes["surname"]; } + + // Translate the schema + $add=$this->adldap_schema($attributes); + + // Additional stuff only used for adding accounts + $add["cn"][0]=$attributes["display_name"]; + $add["samaccountname"][0]=$attributes["username"]; + $add["objectclass"][0]="top"; + $add["objectclass"][1]="person"; + $add["objectclass"][2]="organizationalPerson"; + $add["objectclass"][3]="user"; //person? + //$add["name"][0]=$attributes["firstname"]." ".$attributes["surname"]; + + // Set the account control attribute + $control_options=array("NORMAL_ACCOUNT"); + if (!$attributes["enabled"]){ $control_options[]="ACCOUNTDISABLE"; } + $add["userAccountControl"][0]=$this->account_control($control_options); + //echo ("
"); print_r($add);
+
+        // Determine the container
+        $attributes["container"]=array_reverse($attributes["container"]);
+        $container="OU=".implode(",OU=",$attributes["container"]);
+
+        // Add the entry
+        $result=@ldap_add($this->_conn, "CN=".$add["cn"][0].", ".$container.",".$this->_base_dn, $add);
+        if ($result!=true){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Delete a user account
+    * 
+    * @param string $username The username to delete (please be careful here!)
+    * @param bool $isGUID Is the username a GUID or a samAccountName
+    * @return array
+    */
+    public function user_delete($username,$isGUID=false) {      
+        $userinfo = $this->user_info($username, array("*"),$isGUID);
+        $dn = $userinfo[0]['distinguishedname'][0];
+        $result=$this->dn_delete($dn);
+        if ($result!=true){ return (false); }        
+        return (true);
+    }
+    
+    /**
+    * Groups the user is a member of
+    * 
+    * @param string $username The username to query
+    * @param bool $recursive Recursive list of groups
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return array
+    */
+    public function user_groups($username,$recursive=NULL,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+        
+        // Search the directory for their information
+        $info=@$this->user_info($username,array("memberof","primarygroupid"),$isGUID);
+        $groups=$this->nice_names($info[0]["memberof"]); // Presuming the entry returned is our guy (unique usernames)
+
+        if ($recursive === true){
+            foreach ($groups as $id => $group_name){
+                $extra_groups=$this->recursive_groups($group_name);
+                $groups=array_merge($groups,$extra_groups);
+            }
+        }
+        
+        return ($groups);
+    }
+    
+    /**
+    * Find information about the users
+    * 
+    * @param string $username The username to query
+    * @param array $fields Array of parameters to query
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return array
+    */
+    public function user_info($username,$fields=NULL,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+
+        if ($isGUID === true) {
+            $username = $this->strguid2hex($username);
+            $filter="objectguid=".$username;
+        }
+        else if (strstr($username, "@")) {
+             $filter="userPrincipalName=".$username;
+        }
+        else {
+             $filter="samaccountname=".$username;
+        }
+        $filter = "(&(objectCategory=person)({$filter}))";
+        if ($fields===NULL){ $fields=array("samaccountname","mail","memberof","department","displayname","telephonenumber","primarygroupid","objectsid"); }
+        if (!in_array("objectsid",$fields)){
+            $fields[] = "objectsid";
+        }
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        if (isset($entries[0])) {
+            if ($entries[0]['count'] >= 1) {
+                if (in_array("memberof", $fields)) {
+                    // AD does not return the primary group in the ldap query, we may need to fudge it
+                    if ($this->_real_primarygroup && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["objectsid"][0])){
+                        //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
+                        $entries[0]["memberof"][]=$this->get_primary_group($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
+                    } else {
+                        $entries[0]["memberof"][]="CN=Domain Users,CN=Users,".$this->_base_dn;
+                    }
+                    $entries[0]["memberof"]["count"]++;
+                }
+            }
+            return $entries;
+        }
+        return false;
+    }
+    
+    /**
+    * Determine if a user is in a specific group
+    * 
+    * @param string $username The username to query
+    * @param string $group The name of the group to check against
+    * @param bool $recursive Check groups recursively
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_ingroup($username,$group,$recursive=NULL,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if ($group===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it
+        
+        // Get a list of the groups
+        $groups=$this->user_groups($username,$recursive,$isGUID);
+        
+        // Return true if the specified group is in the group list
+        if (in_array($group,$groups)){ return (true); }
+
+        return (false);
+    }
+    
+    /**
+    * Determine a user's password expiry date
+    * 
+    * @param string $username The username to query
+    * @param book $isGUID Is the username passed a GUID or a samAccountName
+    * @requires bcmath http://www.php.net/manual/en/book.bc.php
+    * @return array
+    */
+    public function user_password_expiry($username,$isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        if (!$this->_bind){ return (false); }
+        if (!function_exists('bcmod')) { return ("Missing function support [bcmod] http://www.php.net/manual/en/book.bc.php"); };
+        
+        $userinfo = $this->user_info($username, array("pwdlastset", "useraccountcontrol"), $isGUID);
+        $pwdlastset = $userinfo[0]['pwdlastset'][0];
+        $status = array();
+        
+        if ($userinfo[0]['useraccountcontrol'][0] == '66048') {
+            // Password does not expire
+            return "Does not expire";
+        }
+        if ($pwdlastset === '0') {
+            // Password has already expired
+            return "Password has expired";
+        }
+        
+         // Password expiry in AD can be calculated from TWO values:
+         //   - User's own pwdLastSet attribute: stores the last time the password was changed
+         //   - Domain's maxPwdAge attribute: how long passwords last in the domain
+         //
+         // Although Microsoft chose to use a different base and unit for time measurements.
+         // This function will convert them to Unix timestamps
+         $sr = ldap_read($this->_conn, $this->_base_dn, 'objectclass=*', array('maxPwdAge'));
+         if (!$sr) {
+             return false;
+         }
+         $info = ldap_get_entries($this->_conn, $sr);
+         $maxpwdage = $info[0]['maxpwdage'][0];
+         
+
+         // See MSDN: http://msdn.microsoft.com/en-us/library/ms974598.aspx
+         //
+         // pwdLastSet contains the number of 100 nanosecond intervals since January 1, 1601 (UTC), 
+         // stored in a 64 bit integer. 
+         //
+         // The number of seconds between this date and Unix epoch is 11644473600.
+         //
+         // maxPwdAge is stored as a large integer that represents the number of 100 nanosecond
+         // intervals from the time the password was set before the password expires.
+         //
+         // We also need to scale this to seconds but also this value is a _negative_ quantity!
+         //
+         // If the low 32 bits of maxPwdAge are equal to 0 passwords do not expire
+         //
+         // Unfortunately the maths involved are too big for PHP integers, so I've had to require
+         // BCMath functions to work with arbitrary precision numbers.
+         if (bcmod($maxpwdage, 4294967296) === '0') {
+            return "Domain does not expire passwords";
+        }
+        
+        // Add maxpwdage and pwdlastset and we get password expiration time in Microsoft's
+        // time units.  Because maxpwd age is negative we need to subtract it.
+        $pwdexpire = bcsub($pwdlastset, $maxpwdage);
+    
+        // Convert MS's time to Unix time
+        $status['expiryts'] = bcsub(bcdiv($pwdexpire, '10000000'), '11644473600');
+        $status['expiryformat'] = date('Y-m-d H:i:s', bcsub(bcdiv($pwdexpire, '10000000'), '11644473600'));
+        
+        return $status;
+    }
+    
+    /**
+    * Modify a user
+    * 
+    * @param string $username The username to query
+    * @param array $attributes The attributes to modify.  Note if you set the enabled attribute you must not specify any other attributes
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_modify($username,$attributes,$isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        if (array_key_exists("password",$attributes) && !$this->_use_ssl){ 
+            throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');
+        }
+
+        // Find the dn of the user
+        $user_dn=$this->user_dn($username,$isGUID);
+        if ($user_dn===false){ return (false); }
+        
+        // Translate the update to the LDAP schema                
+        $mod=$this->adldap_schema($attributes);
+        
+        // Check to see if this is an enabled status update
+        if (!$mod && !array_key_exists("enabled", $attributes)){ return (false); }
+        
+        // Set the account control attribute (only if specified)
+        if (array_key_exists("enabled",$attributes)){
+            if ($attributes["enabled"]){ $control_options=array("NORMAL_ACCOUNT"); }
+            else { $control_options=array("NORMAL_ACCOUNT","ACCOUNTDISABLE"); }
+            $mod["userAccountControl"][0]=$this->account_control($control_options);
+        }
+
+        // Do the update
+        $result=@ldap_modify($this->_conn,$user_dn,$mod);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Disable a user account
+    * 
+    * @param string $username The username to disable
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_disable($username,$isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        $attributes=array("enabled"=>0);
+        $result = $this->user_modify($username, $attributes, $isGUID);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Enable a user account
+    * 
+    * @param string $username The username to enable
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_enable($username,$isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }
+        $attributes=array("enabled"=>1);
+        $result = $this->user_modify($username, $attributes, $isGUID);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Set the password of a user - This must be performed over SSL
+    * 
+    * @param string $username The username to modify
+    * @param string $password The new password
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function user_password($username,$password,$isGUID=false){
+        if ($username===NULL){ return (false); }
+        if ($password===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if (!$this->_use_ssl && !$this->_use_tls){ 
+            throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');
+        }
+        
+        $user_dn=$this->user_dn($username,$isGUID);
+        if ($user_dn===false){ return (false); }
+                
+        $add=array();
+        $add["unicodePwd"][0]=$this->encode_password($password);
+        
+        $result=ldap_mod_replace($this->_conn,$user_dn,$add);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Return a list of all users in AD
+    * 
+    * @param bool $include_desc Return a description of the user
+    * @param string $search Search parameter
+    * @param bool $sorted Sort the user accounts
+    * @return array
+    */
+    public function all_users($include_desc = false, $search = "*", $sorted = true){
+        if (!$this->_bind){ return (false); }
+        
+        // Perform the search and grab all their details
+        $filter = "(&(objectClass=user)(samaccounttype=". ADLDAP_NORMAL_ACCOUNT .")(objectCategory=person)(cn=".$search."))";
+        $fields=array("samaccountname","displayname");
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+
+        $users_array = array();
+        for ($i=0; $i<$entries["count"]; $i++){
+            if ($include_desc && strlen($entries[$i]["displayname"][0])>0){
+                $users_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["displayname"][0];
+            } elseif ($include_desc){
+                $users_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["samaccountname"][0];
+            } else {
+                array_push($users_array, $entries[$i]["samaccountname"][0]);
+            }
+        }
+        if ($sorted){ asort($users_array); }
+        return ($users_array);
+    }
+    
+    /**
+    * Converts a username (samAccountName) to a GUID
+    * 
+    * @param string $username The username to query
+    * @return string
+    */
+    public function username2guid($username) {
+        if (!$this->_bind){ return (false); }
+        if ($username === null){ return ("Missing compulsory field [username]"); }
+        
+        $filter = "samaccountname=" . $username; 
+        $fields = array("objectGUID"); 
+        $sr = @ldap_search($this->_conn, $this->_base_dn, $filter, $fields); 
+        if (ldap_count_entries($this->_conn, $sr) > 0) { 
+            $entry = @ldap_first_entry($this->_conn, $sr); 
+            $guid = @ldap_get_values_len($this->_conn, $entry, 'objectGUID'); 
+            $strGUID = $this->binary2text($guid[0]);          
+            return ($strGUID); 
+        }
+        else { 
+            return (false); 
+        } 
+    }
+    
+    /**
+    * Move a user account to a different OU
+    *
+    * @param string $username The username to move (please be careful here!)
+    * @param array $container The container or containers to move the user to (please be careful here!).
+    * accepts containers in 1. parent 2. child order
+    * @return array
+    */
+    public function user_move($username, $container) {
+        if (!$this->_bind){ return (false); }
+        if ($username === null){ return ("Missing compulsory field [username]"); }
+        if ($container === null){ return ("Missing compulsory field [container]"); }
+        if (!is_array($container)){ return ("Container must be an array"); }
+        
+        $userinfo = $this->user_info($username, array("*"));
+        $dn = $userinfo[0]['distinguishedname'][0];
+        $newrdn = "cn=" . $username;
+        $container = array_reverse($container);
+        $newcontainer = "ou=" . implode(",ou=",$container);
+        $newbasedn = strtolower($newcontainer) . "," . $this->_base_dn;
+        $result=@ldap_rename($this->_conn,$dn,$newrdn,$newbasedn,true);
+        if ($result !== true) {
+            return (false);
+        }
+        return (true);
+    }
+    
+    //*****************************************************************************************************************
+    // CONTACT FUNCTIONS
+    // * Still work to do in this area, and new functions to write
+    
+    /**
+    * Create a contact
+    * 
+    * @param array $attributes The attributes to set to the contact
+    * @return bool
+    */
+    public function contact_create($attributes){
+        // Check for compulsory fields
+        if (!array_key_exists("display_name",$attributes)){ return ("Missing compulsory field [display_name]"); }
+        if (!array_key_exists("email",$attributes)){ return ("Missing compulsory field [email]"); }
+        if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); }
+        if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); }
+
+        // Translate the schema
+        $add=$this->adldap_schema($attributes);
+        
+        // Additional stuff only used for adding contacts
+        $add["cn"][0]=$attributes["display_name"];
+        $add["objectclass"][0]="top";
+        $add["objectclass"][1]="person";
+        $add["objectclass"][2]="organizationalPerson";
+        $add["objectclass"][3]="contact"; 
+        if (!isset($attributes['exchange_hidefromlists'])) {
+            $add["msExchHideFromAddressLists"][0]="TRUE";
+        }
+
+        // Determine the container
+        $attributes["container"]=array_reverse($attributes["container"]);
+        $container="OU=".implode(",OU=",$attributes["container"]);
+
+        // Add the entry
+        $result=@ldap_add($this->_conn, "CN=".$add["cn"][0].", ".$container.",".$this->_base_dn, $add);
+        if ($result!=true){ return (false); }
+        
+        return (true);
+    }  
+    
+    /**
+    * Determine the list of groups a contact is a member of
+    * 
+    * @param string $distinguisedname The full DN of a contact
+    * @param bool $recursive Recursively check groups
+    * @return array
+    */
+    public function contact_groups($distinguishedname,$recursive=NULL){
+        if ($distinguishedname===NULL){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+        
+        // Search the directory for their information
+        $info=@$this->contact_info($distinguishedname,array("memberof","primarygroupid"));
+        $groups=$this->nice_names($info[0]["memberof"]); //presuming the entry returned is our contact
+
+        if ($recursive === true){
+            foreach ($groups as $id => $group_name){
+                $extra_groups=$this->recursive_groups($group_name);
+                $groups=array_merge($groups,$extra_groups);
+            }
+        }
+        
+        return ($groups);
+    }
+    
+    /**
+    * Get contact information
+    * 
+    * @param string $distinguisedname The full DN of a contact
+    * @param array $fields Attributes to be returned
+    * @return array
+    */
+    public function contact_info($distinguishedname,$fields=NULL){
+        if ($distinguishedname===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+
+        $filter="distinguishedName=".$distinguishedname;
+        if ($fields===NULL){ $fields=array("distinguishedname","mail","memberof","department","displayname","telephonenumber","primarygroupid","objectsid"); }
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        if ($entries[0]['count'] >= 1) {
+            // AD does not return the primary group in the ldap query, we may need to fudge it
+            if ($this->_real_primarygroup && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["primarygroupid"][0])){
+                //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
+                $entries[0]["memberof"][]=$this->get_primary_group($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
+            } else {
+                $entries[0]["memberof"][]="CN=Domain Users,CN=Users,".$this->_base_dn;
+            }
+        }
+        
+        $entries[0]["memberof"]["count"]++;
+        return ($entries);
+    }
+    
+    /**
+    * Determine if a contact is a member of a group
+    * 
+    * @param string $distinguisedname The full DN of a contact
+    * @param string $group The group name to query
+    * @param bool $recursive Recursively check groups
+    * @return bool
+    */
+    public function contact_ingroup($distinguisedname,$group,$recursive=NULL){
+        if ($distinguisedname===NULL){ return (false); }
+        if ($group===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        
+        // Get a list of the groups
+        $groups=$this->contact_groups($distinguisedname,array("memberof"),$recursive);
+        
+        // Return true if the specified group is in the group list
+        if (in_array($group,$groups)){ return (true); }
+
+        return (false);
+    }          
+    
+    /**
+    * Modify a contact
+    * 
+    * @param string $distinguishedname The contact to query
+    * @param array $attributes The attributes to modify.  Note if you set the enabled attribute you must not specify any other attributes
+    * @return bool
+    */
+    public function contact_modify($distinguishedname,$attributes){
+        if ($distinguishedname===NULL){ return ("Missing compulsory field [distinguishedname]"); }
+        
+        // Translate the update to the LDAP schema                
+        $mod=$this->adldap_schema($attributes);
+        
+        // Check to see if this is an enabled status update
+        if (!$mod){ return (false); }
+        
+        // Do the update
+        $result=ldap_modify($this->_conn,$distinguishedname,$mod);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Delete a contact
+    * 
+    * @param string $distinguishedname The contact dn to delete (please be careful here!)
+    * @return array
+    */
+    public function contact_delete($distinguishedname) {
+        $result = $this->dn_delete($distinguishedname);
+        if ($result!=true){ return (false); }       
+        return (true);
+    }
+    
+    /**
+    * Return a list of all contacts
+    * 
+    * @param bool $include_desc Include a description of a contact
+    * @param string $search The search parameters
+    * @param bool $sorted Whether to sort the results
+    * @return array
+    */
+    public function all_contacts($include_desc = false, $search = "*", $sorted = true){
+        if (!$this->_bind){ return (false); }
+        
+        // Perform the search and grab all their details
+        $filter = "(&(objectClass=contact)(cn=".$search."))";
+        $fields=array("displayname","distinguishedname");           
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+
+        $users_array = array();
+        for ($i=0; $i<$entries["count"]; $i++){
+            if ($include_desc && strlen($entries[$i]["displayname"][0])>0){
+                $users_array[ $entries[$i]["distinguishedname"][0] ] = $entries[$i]["displayname"][0];
+            } elseif ($include_desc){
+                $users_array[ $entries[$i]["distinguishedname"][0] ] = $entries[$i]["distinguishedname"][0];
+            } else {
+                array_push($users_array, $entries[$i]["distinguishedname"][0]);
+            }
+        }
+        if ($sorted){ asort($users_array); }
+        return ($users_array);
+    }
+    
+    //*****************************************************************************************************************
+    // FOLDER FUNCTIONS
+    
+    /**
+    * Returns a folder listing for a specific OU
+    * See http://adldap.sourceforge.net/wiki/doku.php?id=api_folder_functions
+    * 
+    * @param array $folder_name An array to the OU you wish to list. 
+    *                           If set to NULL will list the root, strongly recommended to set 
+    *                           $recursive to false in that instance!
+    * @param string $dn_type The type of record to list.  This can be ADLDAP_FOLDER or ADLDAP_CONTAINER.
+    * @param bool $recursive Recursively search sub folders
+    * @param bool $type Specify a type of object to search for
+    * @return array
+    */
+    public function folder_list($folder_name = NULL, $dn_type = ADLDAP_FOLDER, $recursive = NULL, $type = NULL) {
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+
+        $filter = '(&';
+        if ($type !== NULL) {
+            switch ($type) {
+                case 'contact':
+                    $filter .= '(objectClass=contact)';
+                    break;
+                case 'computer':
+                    $filter .= '(objectClass=computer)';
+                    break;
+                case 'group':
+                    $filter .= '(objectClass=group)';
+                    break;
+                case 'folder':
+                    $filter .= '(objectClass=organizationalUnit)';
+                    break;
+                case 'container':
+                    $filter .= '(objectClass=container)';
+                    break;
+                case 'domain':
+                    $filter .= '(objectClass=builtinDomain)';
+                    break;
+                default:
+                    $filter .= '(objectClass=user)';
+                    break;   
+            }
+        }
+        else {
+            $filter .= '(objectClass=*)';   
+        }
+        // If the folder name is null then we will search the root level of AD
+        // This requires us to not have an OU= part, just the base_dn
+        $searchou = $this->_base_dn;
+        if (is_array($folder_name)) {
+            $ou = $dn_type . "=".implode("," . $dn_type . "=",$folder_name);
+            $filter .= '(!(distinguishedname=' . $ou . ',' . $this->_base_dn . ')))';
+            $searchou = $ou . ',' . $this->_base_dn;
+        }
+        else {
+            $filter .= '(!(distinguishedname=' . $this->_base_dn . ')))';
+        }
+
+        if ($recursive === true) {
+            $sr=ldap_search($this->_conn, $searchou, $filter, array('objectclass', 'distinguishedname', 'samaccountname'));
+            $entries = @ldap_get_entries($this->_conn, $sr);
+            if (is_array($entries)) {
+                return $entries;
+            }
+        }
+        else {
+            $sr=ldap_list($this->_conn, $searchou, $filter, array('objectclass', 'distinguishedname', 'samaccountname'));
+            $entries = @ldap_get_entries($this->_conn, $sr);
+            if (is_array($entries)) {
+                return $entries;
+            }
+        }
+        
+        return false;
+    }
+    
+    //*****************************************************************************************************************
+    // COMPUTER FUNCTIONS
+    
+    /**
+    * Get information about a specific computer
+    * 
+    * @param string $computer_name The name of the computer
+    * @param array $fields Attributes to return
+    * @return array
+    */
+    public function computer_info($computer_name,$fields=NULL){
+        if ($computer_name===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+
+        $filter="(&(objectClass=computer)(cn=".$computer_name."))";
+        if ($fields===NULL){ $fields=array("memberof","cn","displayname","dnshostname","distinguishedname","objectcategory","operatingsystem","operatingsystemservicepack","operatingsystemversion"); }
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        return ($entries);
+    }
+    
+    /**
+    * Check if a computer is in a group
+    * 
+    * @param string $computer_name The name of the computer
+    * @param string $group The group to check
+    * @param bool $recursive Whether to check recursively
+    * @return array
+    */
+    public function computer_ingroup($computer_name,$group,$recursive=NULL){
+        if ($computer_name===NULL){ return (false); }
+        if ($group===NULL){ return (false); }
+        if (!$this->_bind){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // use the default option if they haven't set it
+
+        //get a list of the groups
+        $groups=$this->computer_groups($computer_name,array("memberof"),$recursive);
+
+        //return true if the specified group is in the group list
+        if (in_array($group,$groups)){ return (true); }
+
+        return (false);
+    }
+    
+    /**
+    * Get the groups a computer is in
+    * 
+    * @param string $computer_name The name of the computer
+    * @param bool $recursive Whether to check recursively
+    * @return array
+    */
+    public function computer_groups($computer_name,$recursive=NULL){
+        if ($computer_name===NULL){ return (false); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
+        if (!$this->_bind){ return (false); }
+
+        //search the directory for their information
+        $info=@$this->computer_info($computer_name,array("memberof","primarygroupid"));
+        $groups=$this->nice_names($info[0]["memberof"]); //presuming the entry returned is our guy (unique usernames)
+
+        if ($recursive === true){
+            foreach ($groups as $id => $group_name){
+              $extra_groups=$this->recursive_groups($group_name);
+              $groups=array_merge($groups,$extra_groups);
+            }
+        }
+
+        return ($groups);
+    }
+    
+    //************************************************************************************************************
+    //  ORGANIZATIONAL UNIT FUNCTIONS
+    
+     /**
+    * Create an organizational unit
+    * 
+    * @param array $attributes Default attributes of the ou
+    * @return bool
+    */
+    public function ou_create($attributes){
+        if (!is_array($attributes)){ return ("Attributes must be an array"); }
+        if (!array_key_exists("ou_name",$attributes)){ return ("Missing compulsory field [ou_name]"); }
+        if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); }
+        if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); }
+        $attributes["container"]=array_reverse($attributes["container"]);
+
+        $add=array();
+        $add["objectClass"] = "organizationalUnit";
+
+        $container="OU=".implode(",OU=",$attributes["container"]);
+        $result=ldap_add($this->_conn,"CN=".$add["cn"].", ".$container.",".$this->_base_dn,$add);
+        if ($result!=true){ return (false); }
+        
+        return (true);
+    }
+    
+    //************************************************************************************************************
+    // EXCHANGE FUNCTIONS
+    
+    /**
+    * Create an Exchange account
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param array $storagegroup The mailbox, Exchange Storage Group, for the user account, this must be a full CN
+    *                            If the storage group has a different base_dn to the adLDAP configuration, set it using $base_dn
+    * @param string $emailaddress The primary email address to add to this user
+    * @param string $mailnickname The mail nick name.  If mail nickname is blank, the username will be used
+    * @param bool $usedefaults Indicates whether the store should use the default quota, rather than the per-mailbox quota.
+    * @param string $base_dn Specify an alternative base_dn for the Exchange storage group
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_create_mailbox($username, $storagegroup, $emailaddress, $mailnickname=NULL, $usedefaults=TRUE, $base_dn=NULL, $isGUID=false){
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($storagegroup===NULL){ return ("Missing compulsory array [storagegroup]"); }
+        if (!is_array($storagegroup)){ return ("[storagegroup] must be an array"); }
+        if ($emailaddress===NULL){ return ("Missing compulsory field [emailaddress]"); }
+        
+        if ($base_dn===NULL) {
+            $base_dn = $this->_base_dn;   
+        }
+        
+        $container="CN=".implode(",CN=",$storagegroup);
+        
+        if ($mailnickname===NULL) { $mailnickname=$username; }
+        $mdbUseDefaults = $this->bool2str($usedefaults);
+        
+        $attributes = array(
+            'exchange_homemdb'=>$container.",".$base_dn,
+            'exchange_proxyaddress'=>'SMTP:' . $emailaddress,
+            'exchange_mailnickname'=>$mailnickname,
+            'exchange_usedefaults'=>$mdbUseDefaults
+        );
+        $result = $this->user_modify($username,$attributes,$isGUID);
+        if ($result==false){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Add an X400 address to Exchange
+    * See http://tools.ietf.org/html/rfc1685 for more information.
+    * An X400 Address looks similar to this X400:c=US;a= ;p=Domain;o=Organization;s=Doe;g=John;
+    * 
+    * @param string $username The username of the user to add the X400 to to
+    * @param string $country Country
+    * @param string $admd Administration Management Domain
+    * @param string $pdmd Private Management Domain (often your AD domain)
+    * @param string $org Organization
+    * @param string $surname Surname
+    * @param string $givenName Given name
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_add_X400($username, $country, $admd, $pdmd, $org, $surname, $givenname, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        
+        $proxyvalue = 'X400:';
+            
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"), $isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        // We do not have to demote an email address from the default so we can just add the new proxy address
+        $attributes['exchange_proxyaddress'] = $proxyvalue . 'c=' . $country . ';a=' . $admd . ';p=' . $pdmd . ';o=' . $org . ';s=' . $surname . ';g=' . $givenname . ';';
+       
+        // Translate the update to the LDAP schema                
+        $add=$this->adldap_schema($attributes);
+        
+        if (!$add){ return (false); }
+        
+        // Do the update
+        // Take out the @ to see any errors, usually this error might occur because the address already
+        // exists in the list of proxyAddresses
+        $result=@ldap_mod_add($this->_conn,$user_dn,$add);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Add an address to Exchange
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param string $emailaddress The email address to add to this user
+    * @param bool $default Make this email address the default address, this is a bit more intensive as we have to demote any existing default addresses
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_add_address($username, $emailaddress, $default=FALSE, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($emailaddress===NULL) { return ("Missing compulsory fields [emailaddress]"); }
+        
+        $proxyvalue = 'smtp:';
+        if ($default === true) {
+            $proxyvalue = 'SMTP:';
+        }
+              
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"),$isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        // We need to scan existing proxy addresses and demote the default one
+        if (is_array($user[0]["proxyaddresses"]) && $default===true) {
+            $modaddresses = array();
+            for ($i=0;$i_conn,$user_dn,$modaddresses);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+        else {
+            // We do not have to demote an email address from the default so we can just add the new proxy address
+            $attributes['exchange_proxyaddress'] = $proxyvalue . $emailaddress;
+            
+            // Translate the update to the LDAP schema                
+            $add=$this->adldap_schema($attributes);
+            
+            if (!$add){ return (false); }
+            
+            // Do the update
+            // Take out the @ to see any errors, usually this error might occur because the address already
+            // exists in the list of proxyAddresses
+            $result=@ldap_mod_add($this->_conn,$user_dn,$add);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+    }
+    
+    /**
+    * Remove an address to Exchange
+    * If you remove a default address the account will no longer have a default, 
+    * we recommend changing the default address first
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param string $emailaddress The email address to add to this user
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_del_address($username, $emailaddress, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($emailaddress===NULL) { return ("Missing compulsory fields [emailaddress]"); }
+        
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"),$isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        if (is_array($user[0]["proxyaddresses"])) {
+            $mod = array();
+            for ($i=0;$i_conn,$user_dn,$mod);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+        else {
+            return (false);
+        }
+    }
+    /**
+    * Change the default address
+    * 
+    * @param string $username The username of the user to add the Exchange account to
+    * @param string $emailaddress The email address to make default
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return bool
+    */
+    public function exchange_primary_address($username, $emailaddress, $isGUID=false) {
+        if ($username===NULL){ return ("Missing compulsory field [username]"); }     
+        if ($emailaddress===NULL) { return ("Missing compulsory fields [emailaddress]"); }
+        
+        // Find the dn of the user
+        $user=$this->user_info($username,array("cn","proxyaddresses"), $isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        
+        if (is_array($user[0]["proxyaddresses"])) {
+            $modaddresses = array();
+            for ($i=0;$i_conn,$user_dn,$modaddresses);
+            if ($result==false){ return (false); }
+            
+            return (true);
+        }
+        
+    }
+    
+    /**
+    * Mail enable a contact
+    * Allows email to be sent to them through Exchange
+    * 
+    * @param string $distinguishedname The contact to mail enable
+    * @param string $emailaddress The email address to allow emails to be sent through
+    * @param string $mailnickname The mailnickname for the contact in Exchange.  If NULL this will be set to the display name
+    * @return bool
+    */
+    public function exchange_contact_mailenable($distinguishedname, $emailaddress, $mailnickname=NULL){
+        if ($distinguishedname===NULL){ return ("Missing compulsory field [distinguishedname]"); }   
+        if ($emailaddress===NULL){ return ("Missing compulsory field [emailaddress]"); }  
+        
+        if ($mailnickname !== NULL) {
+            // Find the dn of the user
+            $user=$this->contact_info($distinguishedname,array("cn","displayname"));
+            if ($user[0]["displayname"]===NULL){ return (false); }
+            $mailnickname = $user[0]['displayname'][0];
+        }
+        
+        $attributes = array("email"=>$emailaddress,"contact_email"=>"SMTP:" . $emailaddress,"exchange_proxyaddress"=>"SMTP:" . $emailaddress,"exchange_mailnickname"=>$mailnickname);
+         
+        // Translate the update to the LDAP schema                
+        $mod=$this->adldap_schema($attributes);
+        
+        // Check to see if this is an enabled status update
+        if (!$mod){ return (false); }
+        
+        // Do the update
+        $result=ldap_modify($this->_conn,$distinguishedname,$mod);
+        if ($result==false){ return (false); }
+        
+        return (true);
+    }
+    
+    /**
+    * Returns a list of Exchange Servers in the ConfigurationNamingContext of the domain
+    * 
+    * @param array $attributes An array of the AD attributes you wish to return
+    * @return array
+    */
+    public function exchange_servers($attributes = array('cn','distinguishedname','serialnumber')) {
+        if (!$this->_bind){ return (false); }
+        
+        $configurationNamingContext = $this->get_root_dse(array('configurationnamingcontext'));
+        $sr = @ldap_search($this->_conn,$configurationNamingContext[0]['configurationnamingcontext'][0],'(&(objectCategory=msExchExchangeServer))',$attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+        return $entries;
+    }
+    
+    /**
+    * Returns a list of Storage Groups in Exchange for a given mail server
+    * 
+    * @param string $exchangeServer The full DN of an Exchange server.  You can use exchange_servers() to find the DN for your server
+    * @param array $attributes An array of the AD attributes you wish to return
+    * @param bool $recursive If enabled this will automatically query the databases within a storage group
+    * @return array
+    */
+    public function exchange_storage_groups($exchangeServer, $attributes = array('cn','distinguishedname'), $recursive = NULL) {
+        if (!$this->_bind){ return (false); }
+        if ($exchangeServer===NULL){ return ("Missing compulsory field [exchangeServer]"); }
+        if ($recursive===NULL){ $recursive=$this->_recursive_groups; }
+
+        $filter = '(&(objectCategory=msExchStorageGroup))';
+        $sr=@ldap_search($this->_conn, $exchangeServer, $filter, $attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+
+        if ($recursive === true) {
+            for ($i=0; $i<$entries['count']; $i++) {
+                $entries[$i]['msexchprivatemdb'] = $this->exchange_storage_databases($entries[$i]['distinguishedname'][0]);       
+            }
+        }
+        
+        return $entries;
+    }
+    
+    /**
+    * Returns a list of Databases within any given storage group in Exchange for a given mail server
+    * 
+    * @param string $storageGroup The full DN of an Storage Group.  You can use exchange_storage_groups() to find the DN 
+    * @param array $attributes An array of the AD attributes you wish to return
+    * @return array
+    */
+    public function exchange_storage_databases($storageGroup, $attributes = array('cn','distinguishedname','displayname')) {
+        if (!$this->_bind){ return (false); }
+        if ($storageGroup===NULL){ return ("Missing compulsory field [storageGroup]"); }
+        
+        $filter = '(&(objectCategory=msExchPrivateMDB))';
+        $sr=@ldap_search($this->_conn, $storageGroup, $filter, $attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+        return $entries;
+    }
+    
+    //************************************************************************************************************
+    // SERVER FUNCTIONS
+    
+    /**
+    * Find the Base DN of your domain controller
+    * 
+    * @return string
+    */
+    public function find_base_dn() {
+        $namingContext = $this->get_root_dse(array('defaultnamingcontext'));   
+        return $namingContext[0]['defaultnamingcontext'][0];
+    }
+    
+    /**
+    * Get the RootDSE properties from a domain controller
+    * 
+    * @param array $attributes The attributes you wish to query e.g. defaultnamingcontext
+    * @return array
+    */
+    public function get_root_dse($attributes = array("*", "+")) {
+        if (!$this->_bind){ return (false); }
+        
+        $sr = @ldap_read($this->_conn, NULL, 'objectClass=*', $attributes);
+        $entries = @ldap_get_entries($this->_conn, $sr);
+        return $entries;
+    }
+
+    //************************************************************************************************************
+    // UTILITY FUNCTIONS (Many of these functions are protected and can only be called from within the class)
+
+    /**
+    * Get last error from Active Directory
+    * 
+    * This function gets the last message from Active Directory
+    * This may indeed be a 'Success' message but if you get an unknown error
+    * it might be worth calling this function to see what errors were raised
+    * 
+    * return string
+    */
+    public function get_last_error() {
+        return @ldap_error($this->_conn);
+    }
+    
+    /**
+    * Detect LDAP support in php
+    * 
+    * @return bool
+    */    
+    protected function ldap_supported() {
+        if (!function_exists('ldap_connect')) {
+            return (false);   
+        }
+        return (true);
+    }
+    
+    /**
+    * Schema
+    * 
+    * @param array $attributes Attributes to be queried
+    * @return array
+    */    
+    protected function adldap_schema($attributes){
+    
+        // LDAP doesn't like NULL attributes, only set them if they have values
+        // If you wish to remove an attribute you should set it to a space
+        // TO DO: Adapt user_modify to use ldap_mod_delete to remove a NULL attribute
+        $mod=array();
+        
+        // Check every attribute to see if it contains 8bit characters and then UTF8 encode them
+        array_walk($attributes, array($this, 'encode8bit'));
+
+        if ($attributes["address_city"]){ $mod["l"][0]=$attributes["address_city"]; }
+        if ($attributes["address_code"]){ $mod["postalCode"][0]=$attributes["address_code"]; }
+        //if ($attributes["address_country"]){ $mod["countryCode"][0]=$attributes["address_country"]; } // use country codes?
+        if ($attributes["address_country"]){ $mod["c"][0]=$attributes["address_country"]; }
+        if ($attributes["address_pobox"]){ $mod["postOfficeBox"][0]=$attributes["address_pobox"]; }
+        if ($attributes["address_state"]){ $mod["st"][0]=$attributes["address_state"]; }
+        if ($attributes["address_street"]){ $mod["streetAddress"][0]=$attributes["address_street"]; }
+        if ($attributes["company"]){ $mod["company"][0]=$attributes["company"]; }
+        if ($attributes["change_password"]){ $mod["pwdLastSet"][0]=0; }
+        if ($attributes["department"]){ $mod["department"][0]=$attributes["department"]; }
+        if ($attributes["description"]){ $mod["description"][0]=$attributes["description"]; }
+        if ($attributes["display_name"]){ $mod["displayName"][0]=$attributes["display_name"]; }
+        if ($attributes["email"]){ $mod["mail"][0]=$attributes["email"]; }
+        if ($attributes["expires"]){ $mod["accountExpires"][0]=$attributes["expires"]; } //unix epoch format?
+        if ($attributes["firstname"]){ $mod["givenName"][0]=$attributes["firstname"]; }
+        if ($attributes["home_directory"]){ $mod["homeDirectory"][0]=$attributes["home_directory"]; }
+        if ($attributes["home_drive"]){ $mod["homeDrive"][0]=$attributes["home_drive"]; }
+        if ($attributes["initials"]){ $mod["initials"][0]=$attributes["initials"]; }
+        if ($attributes["logon_name"]){ $mod["userPrincipalName"][0]=$attributes["logon_name"]; }
+        if ($attributes["manager"]){ $mod["manager"][0]=$attributes["manager"]; }  //UNTESTED ***Use DistinguishedName***
+        if ($attributes["office"]){ $mod["physicalDeliveryOfficeName"][0]=$attributes["office"]; }
+        if ($attributes["password"]){ $mod["unicodePwd"][0]=$this->encode_password($attributes["password"]); }
+        if ($attributes["profile_path"]){ $mod["profilepath"][0]=$attributes["profile_path"]; }
+        if ($attributes["script_path"]){ $mod["scriptPath"][0]=$attributes["script_path"]; }
+        if ($attributes["surname"]){ $mod["sn"][0]=$attributes["surname"]; }
+        if ($attributes["title"]){ $mod["title"][0]=$attributes["title"]; }
+        if ($attributes["telephone"]){ $mod["telephoneNumber"][0]=$attributes["telephone"]; }
+        if ($attributes["mobile"]){ $mod["mobile"][0]=$attributes["mobile"]; }
+        if ($attributes["pager"]){ $mod["pager"][0]=$attributes["pager"]; }
+        if ($attributes["ipphone"]){ $mod["ipphone"][0]=$attributes["ipphone"]; }
+        if ($attributes["web_page"]){ $mod["wWWHomePage"][0]=$attributes["web_page"]; }
+        if ($attributes["fax"]){ $mod["facsimileTelephoneNumber"][0]=$attributes["fax"]; }
+        if ($attributes["enabled"]){ $mod["userAccountControl"][0]=$attributes["enabled"]; }
+        
+        // Distribution List specific schema
+        if ($attributes["group_sendpermission"]){ $mod["dlMemSubmitPerms"][0]=$attributes["group_sendpermission"]; }
+        if ($attributes["group_rejectpermission"]){ $mod["dlMemRejectPerms"][0]=$attributes["group_rejectpermission"]; }
+        
+        // Exchange Schema
+        if ($attributes["exchange_homemdb"]){ $mod["homeMDB"][0]=$attributes["exchange_homemdb"]; }
+        if ($attributes["exchange_mailnickname"]){ $mod["mailNickname"][0]=$attributes["exchange_mailnickname"]; }
+        if ($attributes["exchange_proxyaddress"]){ $mod["proxyAddresses"][0]=$attributes["exchange_proxyaddress"]; }
+        if ($attributes["exchange_usedefaults"]){ $mod["mDBUseDefaults"][0]=$attributes["exchange_usedefaults"]; }
+        if ($attributes["exchange_policyexclude"]){ $mod["msExchPoliciesExcluded"][0]=$attributes["exchange_policyexclude"]; }
+        if ($attributes["exchange_policyinclude"]){ $mod["msExchPoliciesIncluded"][0]=$attributes["exchange_policyinclude"]; }       
+        if ($attributes["exchange_addressbook"]){ $mod["showInAddressBook"][0]=$attributes["exchange_addressbook"]; }       
+        
+        // This schema is designed for contacts
+        if ($attributes["exchange_hidefromlists"]){ $mod["msExchHideFromAddressLists"][0]=$attributes["exchange_hidefromlists"]; }
+        if ($attributes["contact_email"]){ $mod["targetAddress"][0]=$attributes["contact_email"]; }
+        
+        //echo ("
"); print_r($mod);
+        /*
+        // modifying a name is a bit fiddly
+        if ($attributes["firstname"] && $attributes["surname"]){
+            $mod["cn"][0]=$attributes["firstname"]." ".$attributes["surname"];
+            $mod["displayname"][0]=$attributes["firstname"]." ".$attributes["surname"];
+            $mod["name"][0]=$attributes["firstname"]." ".$attributes["surname"];
+        }
+        */
+
+        if (count($mod)==0){ return (false); }
+        return ($mod);
+    }
+
+    /**
+    * Coping with AD not returning the primary group
+    * http://support.microsoft.com/?kbid=321360 
+    * 
+    * For some reason it's not possible to search on primarygrouptoken=XXX
+    * If someone can show otherwise, I'd like to know about it :)
+    * this way is resource intensive and generally a pain in the @#%^
+    * 
+    * @deprecated deprecated since version 3.1, see get get_primary_group
+    * @param string $gid Group ID
+    * @return string
+    */
+    protected function group_cn($gid){    
+        if ($gid===NULL){ return (false); }
+        $r=false;
+        
+        $filter="(&(objectCategory=group)(samaccounttype=". ADLDAP_SECURITY_GLOBAL_GROUP ."))";
+        $fields=array("primarygrouptoken","samaccountname","distinguishedname");
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+        
+        for ($i=0; $i<$entries["count"]; $i++){
+            if ($entries[$i]["primarygrouptoken"][0]==$gid){
+                $r=$entries[$i]["distinguishedname"][0];
+                $i=$entries["count"];
+            }
+        }
+
+        return ($r);
+    }
+    
+    /**
+    * Coping with AD not returning the primary group
+    * http://support.microsoft.com/?kbid=321360 
+    * 
+    * This is a re-write based on code submitted by Bruce which prevents the 
+    * need to search each security group to find the true primary group
+    * 
+    * @param string $gid Group ID
+    * @param string $usersid User's Object SID
+    * @return string
+    */
+    protected function get_primary_group($gid, $usersid){
+        if ($gid===NULL || $usersid===NULL){ return (false); }
+        $r=false;
+
+        $gsid = substr_replace($usersid,pack('V',$gid),strlen($usersid)-4,4);
+        $filter='(objectsid='.$this->getTextSID($gsid).')';
+        $fields=array("samaccountname","distinguishedname");
+        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
+        $entries = ldap_get_entries($this->_conn, $sr);
+
+        return $entries[0]['distinguishedname'][0];
+     }
+     
+    /**
+    * Convert a binary SID to a text SID
+    * 
+    * @param string $binsid A Binary SID
+    * @return string
+    */
+     protected function getTextSID($binsid) {
+        $hex_sid = bin2hex($binsid);
+        $rev = hexdec(substr($hex_sid, 0, 2));
+        $subcount = hexdec(substr($hex_sid, 2, 2));
+        $auth = hexdec(substr($hex_sid, 4, 12));
+        $result = "$rev-$auth";
+
+        for ($x=0;$x < $subcount; $x++) {
+            $subauth[$x] =
+                hexdec($this->little_endian(substr($hex_sid, 16 + ($x * 8), 8)));
+                $result .= "-" . $subauth[$x];
+        }
+
+        // Cheat by tacking on the S-
+        return 'S-' . $result;
+     }
+     
+    /**
+    * Converts a little-endian hex number to one that hexdec() can convert
+    * 
+    * @param string $hex A hex code
+    * @return string
+    */
+     protected function little_endian($hex) {
+        $result = '';
+        for ($x = strlen($hex) - 2; $x >= 0; $x = $x - 2) {
+            $result .= substr($hex, $x, 2);
+        }
+        return $result;
+     }
+     
+    /**
+    * Converts a binary attribute to a string
+    * 
+    * @param string $bin A binary LDAP attribute
+    * @return string
+    */
+    protected function binary2text($bin) {
+        $hex_guid = bin2hex($bin); 
+        $hex_guid_to_guid_str = ''; 
+        for($k = 1; $k <= 4; ++$k) { 
+            $hex_guid_to_guid_str .= substr($hex_guid, 8 - 2 * $k, 2); 
+        } 
+        $hex_guid_to_guid_str .= '-'; 
+        for($k = 1; $k <= 2; ++$k) { 
+            $hex_guid_to_guid_str .= substr($hex_guid, 12 - 2 * $k, 2); 
+        } 
+        $hex_guid_to_guid_str .= '-'; 
+        for($k = 1; $k <= 2; ++$k) { 
+            $hex_guid_to_guid_str .= substr($hex_guid, 16 - 2 * $k, 2); 
+        } 
+        $hex_guid_to_guid_str .= '-' . substr($hex_guid, 16, 4); 
+        $hex_guid_to_guid_str .= '-' . substr($hex_guid, 20); 
+        return strtoupper($hex_guid_to_guid_str);   
+    }
+    
+    /**
+    * Converts a binary GUID to a string GUID
+    * 
+    * @param string $binaryGuid The binary GUID attribute to convert
+    * @return string
+    */
+    public function decodeGuid($binaryGuid) {
+        if ($binaryGuid === null){ return ("Missing compulsory field [binaryGuid]"); }
+        
+        $strGUID = $this->binary2text($binaryGuid);          
+        return ($strGUID); 
+    }
+     
+    /**
+    * Converts a string GUID to a hexdecimal value so it can be queried
+    * 
+    * @param string $strGUID A string representation of a GUID
+    * @return string
+    */
+    protected function strguid2hex($strGUID) {
+        $strGUID = str_replace('-', '', $strGUID);
+
+        $octet_str = '\\' . substr($strGUID, 6, 2);
+        $octet_str .= '\\' . substr($strGUID, 4, 2);
+        $octet_str .= '\\' . substr($strGUID, 2, 2);
+        $octet_str .= '\\' . substr($strGUID, 0, 2);
+        $octet_str .= '\\' . substr($strGUID, 10, 2);
+        $octet_str .= '\\' . substr($strGUID, 8, 2);
+        $octet_str .= '\\' . substr($strGUID, 14, 2);
+        $octet_str .= '\\' . substr($strGUID, 12, 2);
+        //$octet_str .= '\\' . substr($strGUID, 16, strlen($strGUID));
+        for ($i=16; $i<=(strlen($strGUID)-2); $i++) {
+            if (($i % 2) == 0) {
+                $octet_str .= '\\' . substr($strGUID, $i, 2);
+            }
+        }
+        
+        return $octet_str;
+    }
+    
+    /**
+    * Obtain the user's distinguished name based on their userid 
+    * 
+    * 
+    * @param string $username The username
+    * @param bool $isGUID Is the username passed a GUID or a samAccountName
+    * @return string
+    */
+    protected function user_dn($username,$isGUID=false){
+        $user=$this->user_info($username,array("cn"),$isGUID);
+        if ($user[0]["dn"]===NULL){ return (false); }
+        $user_dn=$user[0]["dn"];
+        return ($user_dn);
+    }
+
+    /**
+    * Encode a password for transmission over LDAP
+    *
+    * @param string $password The password to encode
+    * @return string
+    */
+    protected function encode_password($password){
+        $password="\"".$password."\"";
+        $encoded="";
+        for ($i=0; $i 
+    * @return string
+    */
+    protected function ldap_slashes($str){
+        return preg_replace('/([\x00-\x1F\*\(\)\\\\])/e',
+                            '"\\\\\".join("",unpack("H2","$1"))',
+                            $str);
+    }
+    
+    /**
+    * Select a random domain controller from your domain controller array
+    * 
+    * @return string
+    */
+    protected function random_controller(){
+        mt_srand(doubleval(microtime()) * 100000000); // For older PHP versions
+        return ($this->_domain_controllers[array_rand($this->_domain_controllers)]);
+    }
+    
+    /**
+    * Account control options
+    *
+    * @param array $options The options to convert to int 
+    * @return int
+    */
+    protected function account_control($options){
+        $val=0;
+
+        if (is_array($options)){
+            if (in_array("SCRIPT",$options)){ $val=$val+1; }
+            if (in_array("ACCOUNTDISABLE",$options)){ $val=$val+2; }
+            if (in_array("HOMEDIR_REQUIRED",$options)){ $val=$val+8; }
+            if (in_array("LOCKOUT",$options)){ $val=$val+16; }
+            if (in_array("PASSWD_NOTREQD",$options)){ $val=$val+32; }
+            //PASSWD_CANT_CHANGE Note You cannot assign this permission by directly modifying the UserAccountControl attribute.
+            //For information about how to set the permission programmatically, see the "Property flag descriptions" section.
+            if (in_array("ENCRYPTED_TEXT_PWD_ALLOWED",$options)){ $val=$val+128; }
+            if (in_array("TEMP_DUPLICATE_ACCOUNT",$options)){ $val=$val+256; }
+            if (in_array("NORMAL_ACCOUNT",$options)){ $val=$val+512; }
+            if (in_array("INTERDOMAIN_TRUST_ACCOUNT",$options)){ $val=$val+2048; }
+            if (in_array("WORKSTATION_TRUST_ACCOUNT",$options)){ $val=$val+4096; }
+            if (in_array("SERVER_TRUST_ACCOUNT",$options)){ $val=$val+8192; }
+            if (in_array("DONT_EXPIRE_PASSWORD",$options)){ $val=$val+65536; }
+            if (in_array("MNS_LOGON_ACCOUNT",$options)){ $val=$val+131072; }
+            if (in_array("SMARTCARD_REQUIRED",$options)){ $val=$val+262144; }
+            if (in_array("TRUSTED_FOR_DELEGATION",$options)){ $val=$val+524288; }
+            if (in_array("NOT_DELEGATED",$options)){ $val=$val+1048576; }
+            if (in_array("USE_DES_KEY_ONLY",$options)){ $val=$val+2097152; }
+            if (in_array("DONT_REQ_PREAUTH",$options)){ $val=$val+4194304; } 
+            if (in_array("PASSWORD_EXPIRED",$options)){ $val=$val+8388608; }
+            if (in_array("TRUSTED_TO_AUTH_FOR_DELEGATION",$options)){ $val=$val+16777216; }
+        }
+        return ($val);
+    }
+    
+    /**
+    * Take an LDAP query and return the nice names, without all the LDAP prefixes (eg. CN, DN)
+    *
+    * @param array $groups
+    * @return array
+    */
+    protected function nice_names($groups){
+
+        $group_array=array();
+        for ($i=0; $i<$groups["count"]; $i++){ // For each group
+            $line=$groups[$i];
+            
+            if (strlen($line)>0){ 
+                // More presumptions, they're all prefixed with CN=
+                // so we ditch the first three characters and the group
+                // name goes up to the first comma
+                $bits=explode(",",$line);
+                $group_array[]=substr($bits[0],3,(strlen($bits[0])-3));
+            }
+        }
+        return ($group_array);    
+    }
+    
+    /**
+    * Delete a distinguished name from Active Directory
+    * You should never need to call this yourself, just use the wrapper functions user_delete and contact_delete
+    *
+    * @param string $dn The distinguished name to delete
+    * @return bool
+    */
+    protected function dn_delete($dn){ 
+        $result=ldap_delete($this->_conn, $dn);
+        if ($result!=true){ return (false); }
+        return (true);
+    }
+    
+    /**
+    * Convert a boolean value to a string
+    * You should never need to call this yourself
+    *
+    * @param bool $bool Boolean value
+    * @return string
+    */
+    protected function bool2str($bool) {
+        return ($bool) ? 'TRUE' : 'FALSE';
+    }
+    
+    /**
+    * Convert 8bit characters e.g. accented characters to UTF8 encoded characters
+    */
+    protected function encode8bit(&$item, $key) {
+        $encode = false;
+        if (is_string($item)) {
+            for ($i=0; $i> 7) {
+                    $encode = true;
+                }
+            }
+        }
+        if ($encode === true && $key != 'password') {
+            $item = utf8_encode($item);   
+        }
+    }    
+}
+
+/**
+* adLDAP Exception Handler
+* 
+* Exceptions of this type are thrown on bind failure or when SSL is required but not configured
+* Example:
+* try {
+*   $adldap = new adLDAP();
+* }
+* catch (adLDAPException $e) {
+*   echo $e;
+*   exit();
+* }
+*/
+class adLDAPException extends Exception {}
+
+?>
\ No newline at end of file
diff --git a/adLDAP/examples/authenticate.php b/adLDAP/examples/authenticate.php
new file mode 100755
index 0000000..ce66d32
--- /dev/null
+++ b/adLDAP/examples/authenticate.php
@@ -0,0 +1,73 @@
+";
+//force the browser to use ssl (STRONGLY RECOMMENDED!!!!!!!!)
+#if ($_SERVER["SERVER_PORT"]!=443){ header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); exit(); }
+
+//you should look into using PECL filter or some form of filtering here for POST variables
+$username=strtoupper($_POST["username"]); //remove case sensitivity on the username
+$password=$_POST["password"];
+$formage=$_POST["formage"];
+
+if ($_POST["oldform"]){ //prevent null bind
+
+	if ($username!=NULL && $password!=NULL){
+		//include the class and create a connection
+		include ("../adLDAP.php");
+        try {
+		    $adldap = new adLDAP();
+        }
+        catch (adLDAPException $e) {
+            echo $e; exit();   
+        }
+		
+		//authenticate the user
+		if ($adldap -> authenticate($username,$password)){
+			//establish your session and redirect
+			session_start();
+			$_SESSION["username"]=$username;
+			$redir="Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/menu.htm";
+			header($redir);
+			exit;
+		}
+	}
+	$failed=1;
+}
+
+?>
+
+
+
+adLDAP example
+
+
+
+
+This area is restricted.
+Please login to continue.
+ +
+ + +Username:
+Password:
+
+ +
+Login Failed!

\n"); } ?> +
+ +You have successfully logged out."); } ?> + + + + + + diff --git a/adLDAP/examples/examples.php b/adLDAP/examples/examples.php new file mode 100755 index 0000000..7c91e10 --- /dev/null +++ b/adLDAP/examples/examples.php @@ -0,0 +1,123 @@ +\n"); + +// authenticate a username/password +if (0){ + $result=$ldap->authenticate("username","password"); + var_dump($result); +} + +// add a group to a group +if (0){ + $result=$ldap->group_add_group("Parent Group Name","Child Group Name"); + var_dump($result); +} + +// add a user to a group +if (0){ + $result=$ldap->group_add_user("Group Name","username"); + var_dump($result); +} + +// create a group +if (0){ + $attributes=array( + "group_name"=>"Test Group", + "description"=>"Just Testing", + "container"=>array("Groups","A Container"), + ); + $result=$ldap->group_create($attributes); + var_dump($result); +} + +// retrieve information about a group +if (0){ + $result=$ldap->group_info("Group Name"); + var_dump($result); +} + +// create a user account +if (0){ + $attributes=array( + "username"=>"freds", + "logon_name"=>"freds@mydomain.local", + "firstname"=>"Fred", + "surname"=>"Smith", + "company"=>"My Company", + "department"=>"My Department", + "email"=>"freds@mydomain.local", + "container"=>array("Container Parent","Container Child"), + "enabled"=>1, + "password"=>"Password123", + ); + + try { + $result=$ldap->user_create($attributes); + var_dump($result); + } + catch (adLDAPException $e) { + echo $e; exit(); + } +} + +// retrieve the group membership for a user +if (0){ + $result=$ldap->user_groups("username"); + print_r($result); +} + +// retrieve information about a user +if (0){ + $result=$ldap->user_info("username"); + print_r($result); +} + +// check if a user is a member of a group +if (0){ + $result=$ldap->user_ingroup("username","Group Name"); + var_dump($result); +} + +// modify a user account (this example will set "user must change password at next logon") +if (0){ + $attributes=array( + "change_password"=>1, + ); + $result=$ldap->user_modify("username",$attributes); + var_dump($result); +} + +// change the password of a user +if (0){ + try { + $result=$ldap->user_password("username","Password123"); + var_dump($result); + } + catch (adLDAPException $e) { + echo $e; exit(); + } +} + +// list the contents of the Users OU +if (0){ + $result=$ldap->folder_list(array('Users'), ADLDAP_FOLDER, false); + var_dump ($result); +} +?> \ No newline at end of file diff --git a/adLDAP/examples/menu.htm b/adLDAP/examples/menu.htm new file mode 100755 index 0000000..f743139 --- /dev/null +++ b/adLDAP/examples/menu.htm @@ -0,0 +1,5 @@ + + +If you called authenticate.php and you are redirected to this page, you successfully authenticated against Active Directory + + \ No newline at end of file diff --git a/admin_frame.php b/admin_frame.php new file mode 100755 index 0000000..48e9414 --- /dev/null +++ b/admin_frame.php @@ -0,0 +1,4 @@ +display("$template/$templatename"); ?> \ No newline at end of file diff --git a/ajaxtabs.js b/ajaxtabs.js new file mode 100755 index 0000000..997e146 --- /dev/null +++ b/ajaxtabs.js @@ -0,0 +1,224 @@ +//** Ajax Tabs Content script v2.0- Dynamic Drive DHTML code library (http://www.dynamicdrive.com) +//** Updated Oct 21st, 07 to version 2.0. Contains numerous improvements +//** Updated Feb 18th, 08 to version 2.1: Adds a public "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically. Only .js file changed from v2.0. +//** Updated April 8th, 08 to version 2.2: +// -Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0) +// -Modified Ajax routine so testing the script out locally in IE7 now works + +var ddajaxtabssettings={} +ddajaxtabssettings.bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no) +ddajaxtabssettings.loadstatustext=" Requesting content..." + + +////NO NEED TO EDIT BELOW//////////////////////// + +function ddajaxtabs(tabinterfaceid, contentdivid){ + this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container + this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container + this.enabletabpersistence=true + this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container + this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array + this.contentdivid=contentdivid + this.defaultHTML="" + this.defaultIframe='' + this.defaultIframe=this.defaultIframe.replace(/').appendTo(content); + } + + wrap.show(); + + busy = false; + + $.fancybox.center(); + + currentOpts.onComplete(currentArray, currentIndex, currentOpts); + + _preload_images(); + }, + + _preload_images = function() { + var href, + objNext; + + if ((currentArray.length -1) > currentIndex) { + href = currentArray[ currentIndex + 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + + if (currentIndex > 0) { + href = currentArray[ currentIndex - 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + }, + + _draw = function(pos) { + var dim = { + width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), + height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), + + top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), + left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) + }; + + if (typeof final_pos.opacity !== 'undefined') { + dim.opacity = pos < 0.5 ? 0.5 : pos; + } + + wrap.css(dim); + + content.css({ + 'width' : dim.width - currentOpts.padding * 2, + 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 + }); + }, + + _get_viewport = function() { + return [ + $(window).width() - (currentOpts.margin * 2), + $(window).height() - (currentOpts.margin * 2), + $(document).scrollLeft() + currentOpts.margin, + $(document).scrollTop() + currentOpts.margin + ]; + }, + + _get_zoom_to = function () { + var view = _get_viewport(), + to = {}, + resize = currentOpts.autoScale, + double_padding = currentOpts.padding * 2, + ratio; + + if (currentOpts.width.toString().indexOf('%') > -1) { + to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); + } else { + to.width = currentOpts.width + double_padding; + } + + if (currentOpts.height.toString().indexOf('%') > -1) { + to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); + } else { + to.height = currentOpts.height + double_padding; + } + + if (resize && (to.width > view[0] || to.height > view[1])) { + if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { + ratio = (currentOpts.width ) / (currentOpts.height ); + + if ((to.width ) > view[0]) { + to.width = view[0]; + to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); + } + + if ((to.height) > view[1]) { + to.height = view[1]; + to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); + } + + } else { + to.width = Math.min(to.width, view[0]); + to.height = Math.min(to.height, view[1]); + } + } + + to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); + to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); + + return to; + }, + + _get_obj_pos = function(obj) { + var pos = obj.offset(); + + pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; + pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; + + pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; + pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; + + pos.width = obj.width(); + pos.height = obj.height(); + + return pos; + }, + + _get_zoom_from = function() { + var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, + from = {}, + pos, + view; + + if (orig && orig.length) { + pos = _get_obj_pos(orig); + + from = { + width : pos.width + (currentOpts.padding * 2), + height : pos.height + (currentOpts.padding * 2), + top : pos.top - currentOpts.padding - 20, + left : pos.left - currentOpts.padding - 20 + }; + + } else { + view = _get_viewport(); + + from = { + width : currentOpts.padding * 2, + height : currentOpts.padding * 2, + top : parseInt(view[3] + view[1] * 0.5, 10), + left : parseInt(view[2] + view[0] * 0.5, 10) + }; + } + + return from; + }, + + _animate_loading = function() { + if (!loading.is(':visible')){ + clearInterval(loadingTimer); + return; + } + + $('div', loading).css('top', (loadingFrame * -40) + 'px'); + + loadingFrame = (loadingFrame + 1) % 12; + }; + + /* + * Public methods + */ + + $.fn.fancybox = function(options) { + if (!$(this).length) { + return this; + } + + $(this) + .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) + .unbind('click.fb') + .bind('click.fb', function(e) { + e.preventDefault(); + + if (busy) { + return; + } + + busy = true; + + $(this).blur(); + + selectedArray = []; + selectedIndex = 0; + + var rel = $(this).attr('rel') || ''; + + if (!rel || rel == '' || rel === 'nofollow') { + selectedArray.push(this); + + } else { + selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); + selectedIndex = selectedArray.index( this ); + } + + _start(); + + return; + }); + + return this; + }; + + $.fancybox = function(obj) { + var opts; + + if (busy) { + return; + } + + busy = true; + opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; + + selectedArray = []; + selectedIndex = parseInt(opts.index, 10) || 0; + + if ($.isArray(obj)) { + for (var i = 0, j = obj.length; i < j; i++) { + if (typeof obj[i] == 'object') { + $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); + } else { + obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); + } + } + + selectedArray = jQuery.merge(selectedArray, obj); + + } else { + if (typeof obj == 'object') { + $(obj).data('fancybox', $.extend({}, opts, obj)); + } else { + obj = $({}).data('fancybox', $.extend({content : obj}, opts)); + } + + selectedArray.push(obj); + } + + if (selectedIndex > selectedArray.length || selectedIndex < 0) { + selectedIndex = 0; + } + + _start(); + }; + + $.fancybox.showActivity = function() { + clearInterval(loadingTimer); + + loading.show(); + loadingTimer = setInterval(_animate_loading, 66); + }; + + $.fancybox.hideActivity = function() { + loading.hide(); + }; + + $.fancybox.next = function() { + return $.fancybox.pos( currentIndex + 1); + }; + + $.fancybox.prev = function() { + return $.fancybox.pos( currentIndex - 1); + }; + + $.fancybox.pos = function(pos) { + if (busy) { + return; + } + + pos = parseInt(pos); + + selectedArray = currentArray; + + if (pos > -1 && pos < currentArray.length) { + selectedIndex = pos; + _start(); + + } else if (currentOpts.cyclic && currentArray.length > 1) { + selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; + _start(); + } + + return; + }; + + $.fancybox.cancel = function() { + if (busy) { + return; + } + + busy = true; + + $.event.trigger('fancybox-cancel'); + + _abort(); + + selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); + + busy = false; + }; + + // Note: within an iframe use - parent.$.fancybox.close(); + $.fancybox.close = function() { + if (busy || wrap.is(':hidden')) { + return; + } + + busy = true; + + if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { + busy = false; + return; + } + + _abort(); + + $(close.add( nav_left ).add( nav_right )).hide(); + + $(content.add( overlay )).unbind(); + + $(window).unbind("resize.fb scroll.fb"); + $(document).unbind('keydown.fb'); + + content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); + + if (currentOpts.titlePosition !== 'inside') { + title.empty(); + } + + wrap.stop(); + + function _cleanup() { + overlay.fadeOut('fast'); + + title.empty().hide(); + wrap.hide(); + + $.event.trigger('fancybox-cleanup'); + + content.empty(); + + currentOpts.onClosed(currentArray, currentIndex, currentOpts); + + currentArray = selectedOpts = []; + currentIndex = selectedIndex = 0; + currentOpts = selectedOpts = {}; + + busy = false; + } + + if (currentOpts.transitionOut == 'elastic') { + start_pos = _get_zoom_from(); + + var pos = wrap.position(); + + final_pos = { + top : pos.top , + left : pos.left, + width : wrap.width(), + height : wrap.height() + }; + + if (currentOpts.opacity) { + final_pos.opacity = 1; + } + + title.empty().hide(); + + fx.prop = 1; + + $(fx).animate({ prop: 0 }, { + duration : currentOpts.speedOut, + easing : currentOpts.easingOut, + step : _draw, + complete : _cleanup + }); + + } else { + wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); + } + }; + + $.fancybox.resize = function() { + if (overlay.is(':visible')) { + overlay.css('height', $(document).height()); + } + + $.fancybox.center(true); + }; + + $.fancybox.center = function() { + var view, align; + + if (busy) { + return; + } + + align = arguments[0] === true ? 1 : 0; + view = _get_viewport(); + + if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { + return; + } + + wrap + .stop() + .animate({ + 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), + 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) + }, typeof arguments[0] == 'number' ? arguments[0] : 200); + }; + + $.fancybox.init = function() { + if ($("#fancybox-wrap").length) { + return; + } + + $('body').append( + tmp = $('
'), + loading = $('
'), + overlay = $('
'), + wrap = $('
') + ); + + outer = $('
') + .append('
') + .appendTo( wrap ); + + outer.append( + content = $('
'), + close = $(''), + title = $('
'), + + nav_left = $(''), + nav_right = $('') + ); + + close.click($.fancybox.close); + loading.click($.fancybox.cancel); + + nav_left.click(function(e) { + e.preventDefault(); + $.fancybox.prev(); + }); + + nav_right.click(function(e) { + e.preventDefault(); + $.fancybox.next(); + }); + + if ($.fn.mousewheel) { + wrap.bind('mousewheel.fb', function(e, delta) { + if (busy) { + e.preventDefault(); + + } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { + e.preventDefault(); + $.fancybox[ delta > 0 ? 'prev' : 'next'](); + } + }); + } + + if (!$.support.opacity) { + wrap.addClass('fancybox-ie'); + } + + if (isIE6) { + loading.addClass('fancybox-ie6'); + wrap.addClass('fancybox-ie6'); + + $('').prependTo(outer); + } + }; + + $.fn.fancybox.defaults = { + padding : 10, + margin : 40, + opacity : false, + modal : false, + cyclic : false, + scrolling : 'auto', // 'auto', 'yes' or 'no' + + width : 560, + height : 340, + + autoScale : true, + autoDimensions : true, + centerOnScroll : false, + + ajax : {}, + swf : { wmode: 'transparent' }, + + hideOnOverlayClick : true, + hideOnContentClick : false, + + overlayShow : true, + overlayOpacity : 0.7, + overlayColor : '#777', + + titleShow : true, + titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' + titleFormat : null, + titleFromAlt : false, + + transitionIn : 'fade', // 'elastic', 'fade' or 'none' + transitionOut : 'fade', // 'elastic', 'fade' or 'none' + + speedIn : 300, + speedOut : 300, + + changeSpeed : 300, + changeFade : 'fast', + + easingIn : 'swing', + easingOut : 'swing', + + showCloseButton : true, + showNavArrows : true, + enableEscapeButton : true, + enableKeyboardNav : true, + + onStart : function(){}, + onCancel : function(){}, + onComplete : function(){}, + onCleanup : function(){}, + onClosed : function(){}, + onError : function(){} + }; + + $(document).ready(function() { + $.fancybox.init(); + }); + +})(jQuery); \ No newline at end of file diff --git a/fancybox/jquery.fancybox-1.3.4.pack.js b/fancybox/jquery.fancybox-1.3.4.pack.js new file mode 100755 index 0000000..1373ed0 --- /dev/null +++ b/fancybox/jquery.fancybox-1.3.4.pack.js @@ -0,0 +1,46 @@ +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("
")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('

The requested content cannot be loaded.
Please try again later.

'); +F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)|| +c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick= +false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('
').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel", +function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='';P="";b.each(e.swf,function(x,H){C+='';P+=" "+x+'="'+H+'"'});C+='";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win== +"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('
');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor, +opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length? +d.titlePosition=="float"?'
'+s+'
':'
'+s+"
":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding}); +y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height== +i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents()); +f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode== +37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto"); +s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('').appendTo(j); +f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c); +j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type== +"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"), +10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)}; +b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k= +0,C=a.length;ko.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+ +1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h= +true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1; +b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5- +d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('
'),t=b('
'),u=b('
'),f=b('
'));D=b('
').append('
').appendTo(f); +D.append(j=b('
'),E=b(''),n=b('
'),z=b(''),A=b(''));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()}); +b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('').prependTo(D)}}}; +b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing", +easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery); \ No newline at end of file diff --git a/fancybox/jquery.livequery.js b/fancybox/jquery.livequery.js new file mode 100755 index 0000000..dde8ad8 --- /dev/null +++ b/fancybox/jquery.livequery.js @@ -0,0 +1,250 @@ +/*! Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + * Version: 1.0.3 + * Requires jQuery 1.1.3+ + * Docs: http://docs.jquery.com/Plugins/livequery + */ + +(function($) { + +$.extend($.fn, { + livequery: function(type, fn, fn2) { + var self = this, q; + + // Handle different call patterns + if ($.isFunction(type)) + fn2 = fn, fn = type, type = undefined; + + // See if Live Query already exists + $.each( $.livequery.queries, function(i, query) { + if ( self.selector == query.selector && self.context == query.context && + type == query.type && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) ) + // Found the query, exit the each loop + return (q = query) && false; + }); + + // Create new Live Query if it wasn't found + q = q || new $.livequery(this.selector, this.context, type, fn, fn2); + + // Make sure it is running + q.stopped = false; + + // Run it immediately for the first time + q.run(); + + // Contnue the chain + return this; + }, + + expire: function(type, fn, fn2) { + var self = this; + + // Handle different call patterns + if ($.isFunction(type)) + fn2 = fn, fn = type, type = undefined; + + // Find the Live Query based on arguments and stop it + $.each( $.livequery.queries, function(i, query) { + if ( self.selector == query.selector && self.context == query.context && + (!type || type == query.type) && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) && !this.stopped ) + $.livequery.stop(query.id); + }); + + // Continue the chain + return this; + } +}); + +$.livequery = function(selector, context, type, fn, fn2) { + this.selector = selector; + this.context = context || document; + this.type = type; + this.fn = fn; + this.fn2 = fn2; + this.elements = []; + this.stopped = false; + + // The id is the index of the Live Query in $.livequery.queries + this.id = $.livequery.queries.push(this)-1; + + // Mark the functions for matching later on + fn.$lqguid = fn.$lqguid || $.livequery.guid++; + if (fn2) fn2.$lqguid = fn2.$lqguid || $.livequery.guid++; + + // Return the Live Query + return this; +}; + +$.livequery.prototype = { + stop: function() { + var query = this; + + if ( this.type ) + // Unbind all bound events + this.elements.unbind(this.type, this.fn); + else if (this.fn2) + // Call the second function for all matched elements + this.elements.each(function(i, el) { + query.fn2.apply(el); + }); + + // Clear out matched elements + this.elements = []; + + // Stop the Live Query from running until restarted + this.stopped = true; + }, + + run: function() { + // Short-circuit if stopped + if ( this.stopped ) return; + var query = this; + + var oEls = this.elements, + els = $(this.selector, this.context), + nEls = els.not(oEls); + + // Set elements to the latest set of matched elements + this.elements = els; + + if (this.type) { + // Bind events to newly matched elements + nEls.bind(this.type, this.fn); + + // Unbind events to elements no longer matched + if (oEls.length > 0) + $.each(oEls, function(i, el) { + if ( $.inArray(el, els) < 0 ) + $.event.remove(el, query.type, query.fn); + }); + } + else { + // Call the first function for newly matched elements + nEls.each(function() { + query.fn.apply(this); + }); + + // Call the second function for elements no longer matched + if ( this.fn2 && oEls.length > 0 ) + $.each(oEls, function(i, el) { + if ( $.inArray(el, els) < 0 ) + query.fn2.apply(el); + }); + } + } +}; + +$.extend($.livequery, { + guid: 0, + queries: [], + queue: [], + running: false, + timeout: null, + + checkQueue: function() { + if ( $.livequery.running && $.livequery.queue.length ) { + var length = $.livequery.queue.length; + // Run each Live Query currently in the queue + while ( length-- ) + $.livequery.queries[ $.livequery.queue.shift() ].run(); + } + }, + + pause: function() { + // Don't run anymore Live Queries until restarted + $.livequery.running = false; + }, + + play: function() { + // Restart Live Queries + $.livequery.running = true; + // Request a run of the Live Queries + $.livequery.run(); + }, + + registerPlugin: function() { + $.each( arguments, function(i,n) { + // Short-circuit if the method doesn't exist + if (!$.fn[n]) return; + + // Save a reference to the original method + var old = $.fn[n]; + + // Create a new method + $.fn[n] = function() { + // Call the original method + var r = old.apply(this, arguments); + + // Request a run of the Live Queries + $.livequery.run(); + + // Return the original methods result + return r; + } + }); + }, + + run: function(id) { + if (id != undefined) { + // Put the particular Live Query in the queue if it doesn't already exist + if ( $.inArray(id, $.livequery.queue) < 0 ) + $.livequery.queue.push( id ); + } + else + // Put each Live Query in the queue if it doesn't already exist + $.each( $.livequery.queries, function(id) { + if ( $.inArray(id, $.livequery.queue) < 0 ) + $.livequery.queue.push( id ); + }); + + // Clear timeout if it already exists + if ($.livequery.timeout) clearTimeout($.livequery.timeout); + // Create a timeout to check the queue and actually run the Live Queries + $.livequery.timeout = setTimeout($.livequery.checkQueue, 20); + }, + + stop: function(id) { + if (id != undefined) + // Stop are particular Live Query + $.livequery.queries[ id ].stop(); + else + // Stop all Live Queries + $.each( $.livequery.queries, function(id) { + $.livequery.queries[ id ].stop(); + }); + } +}); + +// Register core DOM manipulation methods +$.livequery.registerPlugin('append', 'prepend', 'after', 'before', 'wrap', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'empty', 'remove'); + +// Run Live Queries when the Document is ready +$(function() { $.livequery.play(); }); + + +// Save a reference to the original init method +var init = $.prototype.init; + +// Create a new init method that exposes two new properties: selector and context +$.prototype.init = function(a,c) { + // Call the original init and save the result + var r = init.apply(this, arguments); + + // Copy over properties if they exist already + if (a && a.selector) + r.context = a.context, r.selector = a.selector; + + // Set properties + if ( typeof a == 'string' ) + r.context = c || document, r.selector = a; + + // Return the result + return r; +}; + +// Give the init function the jQuery prototype for later instantiation (needed after Rev 4091) +$.prototype.init.prototype = $.prototype; + +})(jQuery); \ No newline at end of file diff --git a/fancybox/jquery.mousewheel-3.0.4.pack.js b/fancybox/jquery.mousewheel-3.0.4.pack.js new file mode 100755 index 0000000..cb66588 --- /dev/null +++ b/fancybox/jquery.mousewheel-3.0.4.pack.js @@ -0,0 +1,14 @@ +/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) +* Licensed under the MIT License (LICENSE.txt). +* +* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. +* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. +* Thanks to: Seamus Leahy for adding deltaX and deltaY +* +* Version: 3.0.4 +* +* Requires: 1.2.2+ +*/ + +(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a= +f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); \ No newline at end of file diff --git a/fancybox/livequery-1.0.3.zip b/fancybox/livequery-1.0.3.zip new file mode 100755 index 0000000..6f0d188 Binary files /dev/null and b/fancybox/livequery-1.0.3.zip differ diff --git a/fancybox/web.js b/fancybox/web.js new file mode 100755 index 0000000..72b54b9 --- /dev/null +++ b/fancybox/web.js @@ -0,0 +1,11 @@ +jQuery(document).ready(function() { + $("#box2").fancybox({ + 'width' : '75%', + 'height' : '75%', + 'autoScale' : true, + 'transitionIn' : 'elastic', + 'transitionOut' : 'elastic', + 'type' : 'iframe' + }); + +}); \ No newline at end of file diff --git a/fill_erfassen.php b/fill_erfassen.php new file mode 100755 index 0000000..6ed3325 --- /dev/null +++ b/fill_erfassen.php @@ -0,0 +1,34 @@ +assign('action', "$action"); +$smarty->display("$template/$templatename"); + +?> \ No newline at end of file diff --git a/func_beteiligter_angehoert.php b/func_beteiligter_angehoert.php new file mode 100755 index 0000000..80dab0d --- /dev/null +++ b/func_beteiligter_angehoert.php @@ -0,0 +1,84 @@ += 1, dann Status "Beteiligte angehört" setzen + + + Zu setzen beim Aufruf der Seite bearbeiten.php + + + /* + 1) Prüfen, wie viele Gutachter es gibt, deren Frist nicht verstrichen ist.1 + 2) Wieviel mal gibt es den Status 107 bereits zu diesem Vorschlag + 3) wurde bereits der Status "Alle Gutachter angehört" gesetzt: Status 5 + 4) wenn nicht, dann 5) wenn 2 >= 1, dann Status "Gutachter angehört" setzen + + + Zu setzen beim Aufruf der Seite bearbeiten.php + + Mail Henzel vom 19.10.2011 analog für Beteiligte: + Für den Prozess ist es gar nicht so wichtig, dass alle Gutachter angehört worden sind. + Über die Idee kann auch entschieden werden, wenn nur ein Gutachten eingegangen ist. + Deshalb würde ich den Status "alle Gutachter angehört" nur setzen, wenn alle Gutachter + wirklich auch ein Gutachten abgegeben haben. + + Frage Schwarz war: + ich bin mir jetzt nicht schlüssig, wann der Status "Alle Gutachter angehört" gesetzt werden soll. + + + Fall1 + Es gibt 2 Gutachter, einer davon gibt ab, der andere hat noch Zeit, + da innerhalb seiner Frist --> Status Alle Gutachter angehört darf nicht gesetzt werden. + + Fall2 + Es gibt 2 Gutachter, einer davon gibt ab, der andere hat nicht abgegeben + innerhalb der Frist--> Soll dann der Status Alle Gutachter angehört gesetzt werden? + + + */ + + + $db = dbconnect(); + + #1 + $query_betang1 = $db->query("SELECT count(*) Anz + FROM imt_beteiligte + WHERE vid = '$vid' + # AND stellung_dat > '0000-00-00 00:00:00' + # AND frist_datum < date_format(now(), '%Y-%m-%d') + ") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_betang1 = $query_betang1->fetch_array(); + + #2 + $query_betang2 = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid = '$vid' + AND status = '106' + ") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_betang2 = $query_betang2->fetch_array(); + + #3 + $query_betang3 = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid = '$vid' + AND status = '4' + ") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_betang3 = $query_betang3->fetch_array(); + + #4 + if($row_betang3[Anz] == 0){ + #5 + if($row_betang2[Anz] == $row_betang1[Anz] AND $row_betang1[Anz] > 0){ + verlauf($uid, $vid, "Alle Beteiligte angehört", 4, ''); + } + } + +} + +?> \ No newline at end of file diff --git a/func_beteiligter_status.php b/func_beteiligter_status.php new file mode 100755 index 0000000..3d9f654 --- /dev/null +++ b/func_beteiligter_status.php @@ -0,0 +1,80 @@ +query("SELECT bid, frist_datum, date_format(stellung_dat, '%d.%m.%Y (%H:%i)') stellung_dat_form, stellung_dat + FROM imt_beteiligte + WHERE bid='$bid' + "); + $row_bet_data = $result_bet_data->fetch_array(); + + # Frist abgelaufen, Stellungnahme vom + # Frist abgelaufen, keine Stellungnahme abgegeben + # Erfassung noch möglich, Stellungnahme vom + # Erfassung noch möglich, noch keine Stellungnahme + + if($row_bet_data[stellung_dat] != '0000-00-00 00:00:00'){ + $status = ": Stellungnahme vom $row_bet_data[stellung_dat_form]"; + }else{ + $status = ""; + } + $aend_dat = date("Y-m-d"); + + if($row_bet_data[frist_datum] >= $aend_dat AND $row_bet_data[stellung_dat] != '0000-00-00 00:00:00'){ + return 1; + } + + if($row_bet_data[frist_datum] >= $aend_dat AND $row_bet_data[stellung_dat] == '0000-00-00 00:00:00'){ + return 2; + } + + if($row_bet_data[frist_datum] < $aend_dat AND $row_bet_data[stellung_dat] != '0000-00-00 00:00:00'){ + return 3; + } + + if($row_bet_data[frist_datum] < $aend_dat AND $row_bet_data[stellung_dat] == '0000-00-00 00:00:00'){ + return 4; + } + + + + } + + function beteiligter_status_klartext($bid, $status){ + global $db; + + if($status == 1){ + $result_bet_data = $db->query("SELECT bid, frist_datum, date_format(stellung_dat, '%d.%m.%Y (%H:%i)') stellung_dat_form, stellung_dat + FROM imt_beteiligte + WHERE bid='$bid' + "); + $row_bet_data = $result_bet_data->fetch_array(); + + return "Erfassung noch möglich, Stellungnahme vom $row_bet_data[stellung_dat_form]"; + } + + if($status == 2){ + return "Erfassung noch möglich, keine Stellungnahme abgegeben"; + } + + if($status == 3){ + $result_bet_data = $db->query("SELECT bid, frist_datum, date_format(stellung_dat, '%d.%m.%Y (%H:%i)') stellung_dat_form, stellung_dat + FROM imt_beteiligte + WHERE bid='$bid' + "); + $row_bet_data = $result_bet_data->fetch_array(); + + return "Frist abgelaufen, Stellungnahme vom $row_bet_data[stellung_dat_form]"; + } + + if($status == 4){ + return "Frist abgelaufen, keine Stellungnahme abgegeben"; + } + + } + +} +?> \ No newline at end of file diff --git a/func_genUser.php b/func_genUser.php new file mode 100755 index 0000000..0e2dcef --- /dev/null +++ b/func_genUser.php @@ -0,0 +1,72 @@ + "ae", "ü" => "ue", "ö" => "oe", "Ä" => "Ae", "Ü" => "Ue", "Ö" => "Oe", "ß" => "ss", " " => "", "prof" => "", "professor" => "", "." => "", "dr." => "", "doktor" => "", "." => ""); + $vorname = strtr($vorname, $upas); + $nachname = strtr($nachname, $upas); + + /* für 6+2 Regelung + if(strlen($nachname) <=6){ + $anz_vorname = 8-strlen($nachname); + }else{ + $anz_vorname = 2; + } + + $vorname = substr($vorname,0,$anz_vorname); + $nachname = substr($nachname,0,6); + $uid = $nachname.$vorname; + */ + + + + $uid = "idee_".$nachname.$vorname; + + + + $uid = substr($uid,0,13); + + + $db = dbconnect(); + $zaehler=1; + $found=0; + do { + $res_anz = $db->query("SELECT count(uid) Anz + FROM imt_user + WHERE uid='$uid' + ") + or die ("Cannot execute query genUser1"); + + + + $row_anz = $res_anz->fetch_array(); + if($row_anz[Anz] == 0){ + $found=1; + }else{ + if($zaehler <= 9){ + $uid = substr($uid,0,7); + $uid = $uid.$zaehler; + }elseif($zaehler <= 99){ + $uid = substr($uid,0,6); + $uid = $uid.$zaehler; + }elseif($zaehler <=999){ + $uid = substr($uid,0,5); + $uid = $uid.$zaehler; + }elseif($zaehler <=9999){ + $uid = substr($uid,0,4); + $uid = $uid.$zaehler; + }else{ + $uid = "Bitte Administrator kontaktieren"; + } + $zaehler++; + } + } while($found<1); + +return trim($uid); +} + + +?> \ No newline at end of file diff --git a/func_gutachter_angehoert.php b/func_gutachter_angehoert.php new file mode 100755 index 0000000..80a7fca --- /dev/null +++ b/func_gutachter_angehoert.php @@ -0,0 +1,76 @@ += 1, dann Status "Gutachter angehört" setzen + + + Zu setzen beim Aufruf der Seite bearbeiten.php + + Mail Henzel vom 19.10.2011 + Für den Prozess ist es gar nicht so wichtig, dass alle Gutachter angehört worden sind. + Über die Idee kann auch entschieden werden, wenn nur ein Gutachten eingegangen ist. + Deshalb würde ich den Status "alle Gutachter angehört" nur setzen, wenn alle Gutachter + wirklich auch ein Gutachten abgegeben haben. + + Frage Schwarz war: + ich bin mir jetzt nicht schlüssig, wann der Status "Alle Gutachter angehört" gesetzt werden soll. + + + Fall1 + Es gibt 2 Gutachter, einer davon gibt ab, der andere hat noch Zeit, + da innerhalb seiner Frist --> Status Alle Gutachter angehört darf nicht gesetzt werden. + + Fall2 + Es gibt 2 Gutachter, einer davon gibt ab, der andere hat nicht abgegeben + innerhalb der Frist--> Soll dann der Status Alle Gutachter angehört gesetzt werden? + + + */ + + + $db = dbconnect(); + + #1 + $query_gutang1 = $db->query("SELECT count(*) Anz + FROM imt_gutachter + WHERE vid = '$vid' + # AND stellung_dat > '0000-00-00 00:00:00' + # AND frist_datum_abgabe > date_format(now(), '%Y-%m-%d') + ") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_gutang1 = $query_gutang1->fetch_array(); + + + #2 + $query_gutang2 = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid = '$vid' + AND status = '107' + ") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_gutang2 = $query_gutang2->fetch_array(); + + + #3 + $query_gutang3 = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid = '$vid' + AND status = '5' + ") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_gutang3 = $query_gutang3->fetch_array(); + + #4 + if($row_gutang3[Anz] == 0){ + #5 + if($row_gutang2[Anz] == $row_gutang1[Anz] AND $row_gutang1[Anz] >0){ + verlauf($uid, $vid, "Alle Gutachter angehört", 5, ''); + } + } + +} + +?> \ No newline at end of file diff --git a/func_gutachter_beteiligter_del.php b/func_gutachter_beteiligter_del.php new file mode 100755 index 0000000..32da36d --- /dev/null +++ b/func_gutachter_beteiligter_del.php @@ -0,0 +1,128 @@ +query("SELECT status + FROM imt_verlauf + WHERE vid = $vid + AND status IN ('7', '8') + ORDER BY datum DESC + LIMIT 1"); + $row_abschl = $result_abschl->fetch_array(); + + if($row_abschl[status] == '7' OR $row_abschl[status] == '8'){ + + # Gutachter checken, ob die Ihre Gutachterrolle noch brauchen + + #1) Wer war den alles Gutachter beim aktuellen Vorschlag? + $query_gutdel = "SELECT imtuid + FROM imt_gutachter + WHERE vid = '$vid'"; + + $result_gutdel = $db->query ($query_gutdel) + or die ("Cannot execute query1"); + + while ($row_gutdel = $result_gutdel->fetch_array()){ + + # In welchen Vorschlägen war/ist der Gutachter noch beteiligt + $query_gutdel1 = "SELECT distinct vid + FROM imt_gutachter + WHERE imtuid = '$row_gutdel[imtuid]' + AND vid != '$vid'"; + + $result_gutdel1 = $db->query ($query_gutdel1) + or die ("Cannot execute query2"); + + $ln_zaehler = 0; + while ($row_gutdel1 = $result_gutdel1->fetch_array()){ + # Sind diese Vorschläge bereits abgeschlossen? Ist einer davon nicht abgeschlossen, + # dann kann die Rolle diesem Gutachter nicht weggenommen werden + + $gutachter = $row_gutdel[imtuid]; + $vid_cur = $row_gutdel1[vid]; + + $result_abschl1 = $db->query("SELECT status + FROM imt_verlauf + WHERE vid = $vid_cur + AND status IN ('7', '8') + ORDER BY datum DESC + LIMIT 1"); + $row_abschl1 = $result_abschl1->fetch_array(); + + if($row_abschl1[status] != '7' AND $row_abschl1[status] != '8'){ + $ln_zaehler = $ln_zaehler + 1; + } + } + if($ln_zaehler == 0){ + $sql2 = $db->query("DELETE FROM imt_rollen_user_zuord WHERE roid = '2' AND imtuid='$gutachter'"); + } + } + + + ######### Beteiligte checken ######################### + + + # Beteiligte checken, ob die Ihre Gutachterrolle noch brauchen + + #1) Wer war den alles Beteiligter beim aktuellen Vorschlag? + $query_betdel = "SELECT imtuid + FROM imt_beteiligte + WHERE vid = '$vid'"; + + $result_betdel = $db->query ($query_betdel) + or die ("Cannot execute query1"); + + while ($row_betdel = $result_betdel->fetch_array()){ + + # In welchen Vorschlägen war/ist der Beteiligte noch beteiligt + $query_betdel1 = "SELECT distinct vid + FROM imt_beteiligte + WHERE imtuid = '$row_betdel[imtuid]' + AND vid != '$vid'"; + + $result_betdel1 = $db->query ($query_betdel1) + or die ("Cannot execute query2"); + + $ln_zaehler1 = 0; + while ($row_betdel1 = $result_betdel1->fetch_array()){ + # Sind diese Vorschläge bereits abgeschlossen? Ist einer davon nicht abgeschlossen, + # dann kann die Rolle diesem Gutachter nicht weggenommen werden + + $beteiligter = $row_betdel[imtuid]; + $vid_cur = $row_betdel1[vid]; + + $result_abschl1 = $db->query("SELECT status + FROM imt_verlauf + WHERE vid = $vid_cur + AND status IN ('7', '8') + ORDER BY datum DESC + LIMIT 1"); + $row_abschl1 = $result_abschl1->fetch_array(); + + if($row_abschl1[status] != '7' AND $row_abschl1[status] != '8'){ + $ln_zaehler1 = $ln_zaehler1 + 1; + } + } + + if($ln_zaehler1 == 0){ + $sql2 = $db->query("DELETE FROM imt_rollen_user_zuord WHERE roid = '3' AND imtuid='$beteiligter'"); + } + } + + } // if($row_abschl[status] == '7' OR $row_abschl[status] == '8'){ + +} + +?> \ No newline at end of file diff --git a/func_gutachter_entscheid.php b/func_gutachter_entscheid.php new file mode 100755 index 0000000..e228991 --- /dev/null +++ b/func_gutachter_entscheid.php @@ -0,0 +1,113 @@ + Hälfte der Ausschussmitglieder ist, dann wurde der Gutachter angenommen + Prüfen, ob für den Gutachter bereits ein Verlauf gesetzt wurde + Wenn nicht -> Verlauf setzen (angenommen) + 6) Ist die Anzahl 4 < Hälfte der Ausschussmitglieder und Frist ist abgelaufen + Prüfen, ob für den Gutachter bereits ein Verlauf gesetzt wurde + Wenn nicht -> Verlauf setzen (abgelehnt) + */ + + #1 + $result_anz_aus = $db->query("SELECT count(*)/2 Anz + FROM imt_rollen_user_zuord + WHERE roid = '4'"); # 4 ist id RollenID des Ausschusses + $row_anz_aus = $result_anz_aus->fetch_array(); + + #2 + $result_ja = $db->query("SELECT count(*) Anz + FROM imt_ausschuss_gutachter_erg + WHERE gid = '$gid' + AND ergebnis = 'Y'"); + $row_ja = $result_ja->fetch_array(); + + + #3 + $result_frist = $db->query("SELECT count(*) Anz + FROM imt_gutachter a + WHERE a.gid = '$gid' + AND a.frist_datum < date_format( now( ) , '%Y-%m-%d' ) + "); + + $row_frist = $result_frist->fetch_array(); + + if($row_frist[Anz] > 0){ + # Wenn Frist schon abgelaufen ist, dann die Gutachter mitzählen, die versäumt haben eine Stimme abzugeben + $result_ja_vers = $db->query("SELECT count(*) Anz + FROM imt_rollen_user_zuord a + WHERE a.roid = '4' + AND a.imtuid NOT IN (SELECT imtuid FROM imt_ausschuss_gutachter_erg WHERE gid='$gid') + "); + $row_ja_vers = $result_ja_vers->fetch_array(); + $versaeumt = $row_ja_vers[Anz]; + }else{ + $versaeumt = 0; + } + + #4 + $anz_zugestimmt = $row_ja[Anz]+$versaeumt; + + + $result_name = $db->query("SELECT vorname, nachname + FROM imt_gutachter a, imt_user b + WHERE a.imtuid = b.imtuid + AND a.gid = '$gid' + "); + + $row_name = $result_name->fetch_array(); + + if($anz_zugestimmt > $row_anz_aus[Anz]){ + #5 + + $text = "Ausschuss hat Gutachter $row_name[vorname] $row_name[nachname] zugestimmt"; + + $result_verlauf = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid = '$vid' + AND status = '105' + AND verlauf='$text' + "); + + $row_verlauf = $result_verlauf->fetch_array(); + + if($row_verlauf[Anz] == 0){ + # Kein Eintrag in Verlauf, da Ausschuss nicht mehr über Gutachter abstimmt + # verlauf($uid, $vid, "$text", 105, ''); + ##ggf Mail an Henzel + } + + }else{ + #6 + + if($row_frist[Anz] > 0){ # Frist ist abgelaufen + $text = "Ausschuss hat Gutachter $row_name[vorname] $row_name[nachname] abgelehnt"; + + $result_verlauf = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid = '$vid' + AND status = '105' + AND verlauf='$text' + "); + $row_verlauf = $result_verlauf->fetch_array(); + + if($row_verlauf[Anz] == 0){ + $aend_dat = date("Y-m-d H:i:s"); + $sql = $db->query("UPDATE imt_gutachter SET ablehn_dat='$edit_hinweis_eigen' WHERE gid='$gid'"); + + # Kein Eintrag in Verlauf, da Ausschuss nicht mehr über Gutachter abstimmt + # verlauf($uid, $vid, "$text", 105,''); + } + + } + } +} + +?> \ No newline at end of file diff --git a/func_gutachter_status.php b/func_gutachter_status.php new file mode 100755 index 0000000..c289fc4 --- /dev/null +++ b/func_gutachter_status.php @@ -0,0 +1,165 @@ + Hälfte der Ausschussmitglieder ist und abgabefrist für Gutachter nicht gesetzt, + dann wurde der Gutachter angenommen, sonst ist der Status "Warten auf Gutachter" + 6) Ist die Anzahl 4 < Hälfte der Ausschussmitglieder und Frist ist abgelaufen + Prüfen, ob für den Gutachter bereits ein Verlauf gesetzt wurde + Wenn nicht -> Verlauf setzen (abgelehnt) + */ + + #1 + $result_anz_aus = $db->query("SELECT count(*)/2 Anz + FROM imt_rollen_user_zuord + WHERE roid = '4'"); # 4 ist id RollenID des Ausschusses + $row_anz_aus = $result_anz_aus->fetch_array(); + + #2 + $result_ja = $db->query("SELECT count(*) Anz + FROM imt_ausschuss_gutachter_erg + WHERE gid = '$gid' + AND ergebnis = 'Y'"); + $row_ja = $result_ja->fetch_array(); + + + #3 + $result_frist = $db->query("SELECT count(*) Anz + FROM imt_gutachter a + WHERE a.gid = '$gid' + AND a.frist_datum < date_format( now( ) , '%Y-%m-%d' ) + "); + $row_frist = $result_frist->fetch_array(); + + if($row_frist[Anz] > 0){ + # Wenn Frist schon abgelaufen ist, dann die Gutachter mitzählen, die versäumt haben eine Stimme abzugeben + $result_ja_vers = $db->query("SELECT count(*) Anz + FROM imt_rollen_user_zuord a + WHERE a.roid = '4' + AND a.imtuid NOT IN (SELECT imtuid FROM imt_ausschuss_gutachter_erg WHERE gid='$gid') + "); + $row_ja_vers = $result_ja_vers->fetch_array(); + $versaeumt = $row_ja_vers[Anz]; + }else{ + $versaeumt = 0; + } + + #4 + $anz_zugestimmt = $row_ja[Anz]+$versaeumt; + + + $result_name = $db->query("SELECT vorname, nachname + FROM imt_gutachter a, imt_user b + WHERE a.imtuid = b.imtuid + AND a.gid = '$gid' + "); + + $row_name = $result_name->fetch_array(); + + if($anz_zugestimmt > $row_anz_aus[Anz]){ + #5 + + $result_gafrist = $db->query("SELECT count(*) Anz + FROM imt_gutachter + WHERE frist_datum_abgabe != '0000-00-00' + AND gid = '$gid' + "); + + $row_gafrist = $result_gafrist->fetch_array(); + + if($row_gafrist[Anz] == 0){ + # Wenn dem Gutachter keine Frist gesetzt wurde, dann wurde er nur vom Ausschuss zugestimmt + return 1; + + }else{ + # Warten auf Gutachter, Frist läuft noch: stellung_dat == 0000-00-00 00:00:00 und frist_datum_abgabe <= date_format( now( ) , '%Y-%m-%d' ) + # Warten auf Gutachter, Frist abgelaufen: stellung_dat == 0000-00-00 00:00:00 und frist_datum_abgabe > date_format( now( ) , '%Y-%m-%d' ) + # Gutachten abgegeben, Frist läuft noch: stellung_dat != 0000-00-00 00:00:00 und frist_datum_abgabe <= date_format( now( ) , '%Y-%m-%d' ) + # Gutachten abgegeben, Frist abgelaufen: stellung_dat != 0000-00-00 00:00:00 und frist_datum_abgabe > date_format( now( ) , '%Y-%m-%d' ) + + $result_stelldat1 = $db->query("SELECT stellung_dat + FROM imt_gutachter + WHERE gid = '$gid' + "); + $row_stelldat1 = $result_stelldat1->fetch_array(); + + $result_fristabg1 = $db->query("SELECT count(*) Anz + FROM imt_gutachter a + WHERE a.gid = '$gid' + AND a.frist_datum_abgabe < date_format( now( ) , '%Y-%m-%d' ) + "); + $row_fristabg1 = $result_fristabg1->fetch_array(); + + if($row_stelldat1[stellung_dat] == '0000-00-00 00:00:00' AND $row_fristabg1[Anz] == 0){ + return 2; + } + + if($row_stelldat1[stellung_dat] == '0000-00-00 00:00:00' AND $row_fristabg1[Anz] == 1){ + return 3; + } + + if($row_stelldat1[stellung_dat] != '0000-00-00 00:00:00' AND $row_fristabg1[Anz] == 0){ + return 4; + } + + if($row_stelldat1[stellung_dat] != '0000-00-00 00:00:00' AND $row_fristabg1[Anz] == 1){ + return 5; + } + + + } + + }else{ + #6 + + if($row_frist[Anz] > 0){ # Frist ist abgelaufen + return 6; + }else{ + return 7; + } + } + } + + function gutachter_status_klartext($gid, $status){ + global $db; + if($status == 1){ + #return "Ausschuss zugestimmt"; + return "Gutachter anschreiben"; + } + + if($status == 2){ + return "Warten auf Gutachter, Frist läuft noch"; + } + + if($status == 3){ + return "Warten auf Gutachter, Frist abgelaufen"; + } + + if($status == 4){ + return "Gutachten abgegeben, Frist läuft noch"; + } + + if($status == 5){ + return "Gutachten abgegeben, Frist abgelaufen"; + } + + if($status == 6){ + return "Ausschuss abgelehnt"; + } + + if($status == 7){ + return "Warten auf Ausschuss"; + } + + } + +} +?> \ No newline at end of file diff --git a/func_htmlclean.php b/func_htmlclean.php new file mode 100755 index 0000000..a0052c0 --- /dev/null +++ b/func_htmlclean.php @@ -0,0 +1,35 @@ +]*>/','',$html); +$html= preg_replace('/<([^>]*)(class|lang|size|face)=("[^\"]*"|\'[^\']*\'|[^>]+)([^>]*)>/','',$html); +$html= preg_replace('/<([^>]*)(class|lang|size|face)=("[^\"]*"|\'[^\']*\'|[^>]+)([^>]*)>/','',$html); +$html= preg_replace('//', '', $html); +$html= preg_replace('/<\/meta(.|\s)*?>/', '', $html); +$html= preg_replace('//', '', $html); +$html= preg_replace('//s', '', $html); +$html= preg_replace('/\s{2,}/sm',' ',$html,PREG_SET_ORDER); //Mehr als zwei leerzeichen entfernen +$html= preg_replace('/\s{2,}/sm',' ',$html,PREG_SET_ORDER); //Mehr als zwei leerzeichen entfernen +$html= str_replace (array("\r\n"), array(""), $html); + +/* Nächster Abschnitt neu ab 10.06.2011*/ +$html = strip_tags($html, '
,,
    ,
  • ,
      '); +$html = str_replace (array('"'), array("\""), $html); +$html = str_replace (array("'"), array("\""), $html); +$html = str_replace (array(" type='disc'"), array(""), $html); + + +$html = strip_tags($html, '
      ,,
        ,
      • ,
          '); +$html = str_replace (array('"'), array("\""), $html); +$html = str_replace (array("'"), array("\""), $html); +$html = str_replace (array(" type='disc'"), array(""), $html); + +$html= trim($html); +/* $html= mysqli_escape_string($db,stripslashes($html)); */ + return $html; +} + +?> \ No newline at end of file diff --git a/func_mail_einstell.php b/func_mail_einstell.php new file mode 100755 index 0000000..43b3ae2 --- /dev/null +++ b/func_mail_einstell.php @@ -0,0 +1,17 @@ +query("INSERT INTO imt_mail (vid, imtuid, an, cc, bcc, betreff, body, einstell_dat, status, verlauf_status, verlauf_body) VALUES ('$vid', '$imtuid', '$an', '$cc', '$bcc', '$betreff', \"$body\", '$aend_dat', 'N', '$verlauf_status', '$verlauf_body')"); +#echo "INSERT INTO imt_mail (vid, imtuid, an, cc, bcc, betreff, body, einstell_dat, status, verlauf_status, verlauf_body) VALUES ('$vid', '$imtuid', '$an', '$cc', '$bcc', '$betreff', \"$body\", '$aend_dat', 'N', '$verlauf_status', '$verlauf_body')
          "; +} + +?> \ No newline at end of file diff --git a/func_mail_versand.php b/func_mail_versand.php new file mode 100755 index 0000000..88299da --- /dev/null +++ b/func_mail_versand.php @@ -0,0 +1,486 @@ +query("SELECT wert1, wert2 FROM imt_parameter WHERE pid='1'"); + $row_ansprech_global = $result_ansprech_global->fetch_array(); + + $result_ansprech_global1 = $db->query("SELECT wert1 FROM imt_parameter WHERE pid='3'"); + $row_ansprech_global1 = $result_ansprech_global1->fetch_array(); + + $result_ansprech_uid = $db->query("SELECT imtuid FROM imt_user WHERE mail IN (SELECT wert2 FROM imt_parameter WHERE pid='1')"); + $row_ansprech_uid = $result_ansprech_uid->fetch_array(); + + $global_service_admin = "$row_ansprech_global[wert1]"; + $global_service_mail = "$row_ansprech_global[wert2]"; + $global_service_admin_uid = "$row_ansprech_global1[wert1]"; + $global_service_uid = "$row_ansprech_uid[imtuid]"; + #--------------------------------------------------------------------------------------------------------------------------------------- + + + # $username = $_SESSION["global_username"]; + #$uid = $_SESSION["global_uid"]; + $login_dateiname = basename($_SERVER['PHP_SELF']); + $template = "modern"; +#--------------------------------------------------------------------------------------------------------------------------------------- + + require_once("func_verlauf.php"); + + $db = dbconnect(); + $result_mail_notw = $db->query("SELECT count(*) Anz + FROM imt_mail + WHERE status IN ('N', 'F')"); + $row_mail_notw = $result_mail_notw->fetch_array(); + if($row_mail_notw["Anz"] >0){ + $aend_dat = date("Y-m-d H:i:s"); + + $query_versand = "SELECT mid, vid, imtuid, an, cc, bcc, betreff, body, verlauf_status, verlauf_body, einstell_dat + FROM imt_mail + WHERE status IN ('N', 'F') + ORDER BY einstell_dat ASC"; + + $result_versand = $db->query ($query_versand) + or die ("Cannot execute query_versand"); + + + while ($row_versand = $result_versand->fetch_array()){ + + $query_an = $db->query("SELECT mail + FROM imt_user + WHERE imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_an = $query_an->fetch_array(); + + $query_cc = $db->query("SELECT mail + FROM imt_user + WHERE imtuid = '$row_versand[cc]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_cc = $query_cc->fetch_array(); + + $query_bcc = $db->query("SELECT mail + FROM imt_user + WHERE imtuid = '$row_versand[bcc]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_bcc = $query_bcc->fetch_array(); + + $headers = "MIME-Version: 1.0\n"; + $headers .= "Content-type: text/html; charset=utf-8\n"; + $headers .= "From: Ideenwettbewerb HS Ludwigsburg <$global_service_mail>\n"; + $headers .= "Cc: $row_cc[mail]\n"; + $headers .= "Bcc: $row_bcc[mail]\n"; + + $betreff = str_replace (array("ä", "ö", "ü", "ß", "Ä", "Ö", "Ü"), array("ä", "ö", "ü", "ß", "Ä", "Ö", "Ü"), $row_versand[betreff]); + $return = @mail($row_an[mail], $betreff, $row_versand[body], $headers); + + if($return){ + $sql_versand = $db->query("UPDATE imt_mail SET status='V', versand_dat='$aend_dat' WHERE mid='$row_versand[mid]'"); + }else{ + $sql_versandfehler = $db->query("UPDATE imt_mail SET status='F', versand_dat='$aend_dat' WHERE mid='$row_versand[mid]'"); + } + + + # Beteiligter benennen + if($row_versand[verlauf_status] == '100'){ + if($return){ + + $query_vorp = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid='$row_versand[vid]' + AND verlauf = 'Statusänderung: Vorprüfung bestanden'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_vorp = $query_vorp->fetch_array(); + + if($row_vorp[Anz] < 1){ + verlauf($row_versand[imtuid], $row_versand[vid], "Statusänderung: Vorprüfung bestanden", 2, ''); + } + + $query_get_data = $db->query("SELECT vorname, nachname, date_format(frist_datum, '%d.%m.%Y') frist_datum_form + FROM imt_user a, imt_beteiligte b + WHERE a.imtuid = b.imtuid + AND b.vid = '$row_versand[vid]' + AND a.imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + verlauf($row_versand[imtuid], $row_versand[vid], "Beteiligter $row_data[vorname] $row_data[nachname] informiert. Frist: $row_data[frist_datum_form]", $row_versand[verlauf_status], $row_versand[einstell_dat]); + + }else{ + + + $query_get_data = $db->query("SELECT vorname, nachname, date_format(frist_datum, '%d.%m.%Y') frist_datum_form + FROM imt_user a, imt_beteiligte b + WHERE a.imtuid = b.imtuid + AND b.vid = '$row_versand[vid]' + AND a.imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + $query_vorperr = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid='$row_versand[vid]' + AND verlauf = 'Mailfehler: Beteiligter $row_data[vorname] $row_data[nachname] nicht infomiert. Frist: $row_data[frist_datum_form]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_vorperr = $query_vorperr->fetch_array(); + + + if($row_vorperr[Anz] < 1){ + verlauf($row_versand[imtuid], $row_versand[vid], "Mailfehler: Beteiligter $row_data[vorname] $row_data[nachname] nicht infomiert. Frist: $row_data[frist_datum_form]", 0, ''); + }else{ + $sql_verlauf_err = $db->query("UPDATE imt_verlauf SET datum='$aend_dat' WHERE vid='$row_versand[vid]' AND verlauf = 'Mailfehler: Beteiligter $row_data[vorname] $row_data[nachname] nicht infomiert. Frist: $row_data[frist_datum_form]'"); + } + + } + + } + + + # Gutachter informiert + if($row_versand[verlauf_status] == '108'){ + if($return){ + + $query_vorp = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid='$row_versand[vid]' + AND verlauf = 'Statusänderung: Vorprüfung bestanden'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_vorp = $query_vorp->fetch_array(); + + if($row_vorp[Anz] < 1){ + verlauf($row_versand[imtuid], $row_versand[vid], "Statusänderung: Vorprüfung bestanden", 2, ''); + } + + $query_get_data = $db->query("SELECT vorname, nachname, date_format(frist_datum_abgabe, '%d.%m.%Y') frist_datum_form + FROM imt_user a, imt_gutachter b + WHERE a.imtuid = b.imtuid + AND b.vid = '$row_versand[vid]' + AND a.imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + verlauf($row_versand[imtuid], $row_versand[vid], "Gutachter $row_data[vorname] $row_data[nachname] informiert. Frist: $row_data[frist_datum_form]", $row_versand[verlauf_status], $row_versand[einstell_dat]); + + }else{ + + + $query_get_data = $db->query("SELECT vorname, nachname, date_format(frist_datum_abgabe, '%d.%m.%Y') frist_datum_form + FROM imt_user a, imt_gutachter b + WHERE a.imtuid = b.imtuid + AND b.vid = '$row_versand[vid]' + AND a.imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + $query_vorperr = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid='$row_versand[vid]' + AND verlauf = 'Mailfehler: Gutachter $row_data[vorname] $row_data[nachname] nicht infomiert. Frist: $row_data[frist_datum_form]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_vorperr = $query_vorperr->fetch_array(); + + + if($row_vorperr[Anz] < 1){ + verlauf($row_versand[imtuid], $row_versand[vid], "Mailfehler: Gutachter $row_data[vorname] $row_data[nachname] nicht infomiert. Frist: $row_data[frist_datum_form]", 0, ''); + }else{ + $sql_verlauf_err = $db->query("UPDATE imt_verlauf SET datum='$aend_dat' WHERE vid='$row_versand[vid]' AND verlauf = 'Mailfehler: Gutachter $row_data[vorname] $row_data[nachname] nicht infomiert. Frist: $row_data[frist_datum_form]'"); + } + + } + + } + + + + # Adminhinweis gesendeet + if($row_versand[verlauf_status] == '102'){ + if($return){ + + $query_get_data = $db->query("SELECT vorname, nachname, date_format(frist_datum_abgabe, '%d.%m.%Y') frist_datum_form + FROM imt_user a, imt_gutachter b + WHERE a.imtuid = b.imtuid + AND b.vid = '$row_versand[vid]' + AND a.imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + + verlauf($row_versand[imtuid], $row_versand[vid], 'Adminhinweis wurde geändert', 102, $row_versand[einstell_dat]); + + + }else{ + + + $query_get_data = $db->query("SELECT vorname, nachname, date_format(frist_datum_abgabe, '%d.%m.%Y') frist_datum_form + FROM imt_user a, imt_gutachter b + WHERE a.imtuid = b.imtuid + AND b.vid = '$row_versand[vid]' + AND a.imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + $query_vorperr = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid='$row_versand[vid]' + AND verlauf = 'Mailfehler: Adminhinweis konnte nicht zugestellt werden.'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_vorperr = $query_vorperr->fetch_array(); + + + if($row_vorperr[Anz] < 1){ + verlauf($row_versand[imtuid], $row_versand[vid], "Mailfehler: Adminhinweis konnte nicht zugestellt werden.", 0, ''); + }else{ + $sql_verlauf_err = $db->query("UPDATE imt_verlauf SET datum='$aend_dat' WHERE vid='$row_versand[vid]' AND verlauf = 'Mailfehler: Adminhinweis konnte nicht zugestellt werden.'"); + } + + } + + } + + + # Erfasserhinweis gesendeet + if($row_versand[verlauf_status] == '104'){ + if($return){ + + $query_get_data = $db->query("SELECT vorname, nachname, date_format(frist_datum_abgabe, '%d.%m.%Y') frist_datum_form + FROM imt_user a, imt_gutachter b + WHERE a.imtuid = b.imtuid + AND b.vid = '$row_versand[vid]' + AND a.imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + + verlauf($row_versand[imtuid], $row_versand[vid], 'Hinweis des Erfassers', 104, $row_versand[einstell_dat]); + + + }else{ + + + $query_get_data = $db->query("SELECT vorname, nachname, date_format(frist_datum_abgabe, '%d.%m.%Y') frist_datum_form + FROM imt_user a, imt_gutachter b + WHERE a.imtuid = b.imtuid + AND b.vid = '$row_versand[vid]' + AND a.imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + $query_vorperr = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid='$row_versand[vid]' + AND verlauf = 'Mailfehler: Erfasserhinweis konnte nicht zugestellt werden.'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_vorperr = $query_vorperr->fetch_array(); + + + if($row_vorperr[Anz] < 1){ + verlauf($row_versand[imtuid], $row_versand[vid], "Mailfehler: Erfasserhinweis konnte nicht zugestellt werden.", 0, ''); + }else{ + $sql_verlauf_err = $db->query("UPDATE imt_verlauf SET datum='$aend_dat' WHERE vid='$row_versand[vid]' AND verlauf = 'Mailfehler: Erfasserhinweis konnte nicht zugestellt werden.'"); + } + + } + + } + + + + # Sitzung terminieren + if($row_versand[verlauf_status] == '109'){ + if($return){ + + + $query_get_data = $db->query("SELECT vorname, nachname + FROM imt_user + WHERE imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + # Im verlauf_body kommen zwei Werte an: 1) Das Datum der Sitzung 2) die VID, die für eine Sitzung terminiert wurden + # Datum und VIDs sind durch | getrennt. Die einzelnen VIDs sind durch Komma getrennt. + $verlauf_body = preg_split('/\|/', $row_versand[verlauf_body]); + + + $datum = $verlauf_body[0]; + + $vids = preg_split('/\,/', $verlauf_body[1]); + + for($i=0;$iquery("SELECT count(*) Anz + FROM imt_verlauf + WHERE status = '109' + AND vid = '$vids[$i]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data2 = $query_get_data2->fetch_array(); + if($row_data2[Anz] == 0){ + # Bei Sitzungstermin verwalten können gleiche Vids nochmals kommen, wenn diese eben nicht verändert wurden. + # Um zu verhindern, dass diese nochmals in Verlauf gesetzt werden, diese if-Anweisung + verlauf($row_versand[imtuid], $vids[$i], "Ausschuss ($row_data[vorname] $row_data[nachname]) über Sitzung am $datum informiert.", $row_versand[verlauf_status], $row_versand[einstell_dat]); + } + } + + + + }else{ + + + $query_get_data = $db->query("SELECT vorname, nachname + FROM imt_user + WHERE imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + # Im verlauf_body kommen zwei Werte an: 1) Das Datum der Sitzung 2) die VID, die für eine Sitzung terminiert wurden + # Datum und VIDs sind durch | getrennt. Die einzelnen VIDs sind durch Komma getrennt. + $verlauf_body = preg_split('/\|/', $row_versand[verlauf_body]); + + + $datum = $verlauf_body[0]; + + $vids = preg_split('/\,/', $verlauf_body[1]); + + for($i=0;$iquery("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid='$vids[$i]' + AND verlauf = 'Mailfehler: Ausschuss ($row_data[vorname] $row_data[nachname]) nicht über Sitzung am $datum infomiert.'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_vorperr = $query_vorperr->fetch_array(); + + + if($row_vorperr[Anz] < 1){ + verlauf($row_versand[imtuid], $vids[$i], "Mailfehler: Ausschuss ($row_data[vorname] $row_data[nachname]) nicht über Sitzung am $datum infomiert.", 0, ''); + }else{ + $sql_verlauf_err = $db->query("UPDATE imt_verlauf SET datum='$aend_dat' WHERE vid='$vids[$i]' AND verlauf = 'Mailfehler: Ausschuss ($row_data[vorname] $row_data[nachname]) nicht über Sitzung am $datum infomiert.'"); + } + } + + } + + } + + + + # Vorschlag entschieden (Nachricht an Einreicher) + if($row_versand[verlauf_status] == '110'){ + if($return){ + + + $query_get_data = $db->query("SELECT vorname, nachname + FROM imt_user + WHERE imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + + $query_get_data2 = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE status = '110' + AND vid = '$row_versand[vid]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data2 = $query_get_data2->fetch_array(); + if($row_data2[Anz] == 0){ + # Bei Sitzungstermin verwalten können gleiche Vids nochmals kommen, wenn diese eben nicht verändert wurden. + # Um zu verhindern, dass diese nochmals in Verlauf gesetzt werden, diese if-Anweisung + verlauf($row_versand[imtuid], $row_versand[vid], "$row_data[vorname] $row_data[nachname] über Entscheidung informiert.", $row_versand[verlauf_status], $row_versand[einstell_dat]); + } + + + + + }else{ + + + $query_get_data = $db->query("SELECT vorname, nachname + FROM imt_user + WHERE imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + + $query_vorperr = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid='$row_versand[vid]' + AND verlauf = 'Mailfehler: $row_data[vorname] $row_data[nachname] nicht über Entscheidung infomiert.'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_vorperr = $query_vorperr->fetch_array(); + + + if($row_vorperr[Anz] < 1){ + verlauf($row_versand[imtuid], $row_versand[vid], "Mailfehler: $row_data[vorname] $row_data[nachname] nicht über Entscheidung infomiert.", 0, ''); + }else{ + $sql_verlauf_err = $db->query("UPDATE imt_verlauf SET datum='$aend_dat' WHERE vid='$row_versand[vid]' AND verlauf = 'Mailfehler: $row_data[vorname] $row_data[nachname] nicht über Entscheidung infomiert.'"); + } + + } + } + + # Ausschuss benachrichtigen + if($row_versand[verlauf_status] == '103'){ + if($return){ + + $query_vorp = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid='$row_versand[vid]' + AND verlauf = 'Statusänderung: Vorprüfung bestanden'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_vorp = $query_vorp->fetch_array(); + + if($row_vorp[Anz] < 1){ + verlauf($row_versand[imtuid], $row_versand[vid], "Statusänderung: Vorprüfung bestanden", 2, ''); + } + + $query_get_data = $db->query("SELECT vorname, nachname, date_format(frist_datum, '%d.%m.%Y') frist_datum_form + FROM imt_user a, imt_gutachter b + WHERE a.imtuid = b.imtuid + AND b.vid = '$row_versand[vid]' + AND a.imtuid = '$row_versand[verlauf_body]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + $query_get_data1 = $db->query("SELECT vorname, nachname + FROM imt_user a + WHERE a.imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data1 = $query_get_data1->fetch_array(); + + verlauf($row_versand[imtuid], $row_versand[vid], "Ausschuss ($row_data1[vorname] $row_data1[nachname]) über Gutachter $row_data[vorname] $row_data[nachname] informiert. Frist: $row_data[frist_datum_form]", $row_versand[verlauf_status], $row_versand[einstell_dat]); + + }else{ + + + $query_get_data = $db->query("SELECT vorname, nachname, date_format(frist_datum, '%d.%m.%Y') frist_datum_form + FROM imt_user a, imt_gutachter b + WHERE a.imtuid = b.imtuid + AND b.vid = '$row_versand[vid]' + AND a.imtuid = '$row_versand[verlauf_body]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data = $query_get_data->fetch_array(); + + $query_get_data1 = $db->query("SELECT vorname, nachname + FROM imt_user a + WHERE a.imtuid = '$row_versand[an]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data1 = $query_get_data1->fetch_array(); + + $query_vorperr = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid='$row_versand[vid]' + AND verlauf = 'Mailfehler: $row_data1[vorname] $row_data1[nachname] über Bestellung von Gutachter $row_data[vorname] $row_data[nachname]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_vorperr = $query_vorperr->fetch_array(); + + + if($row_vorperr[Anz] < 1){ + verlauf($row_versand[imtuid], $row_versand[vid], "Mailfehler: $row_data1[vorname] $row_data1[nachname] über Bestellung von Gutachter $row_data[vorname] $row_data[nachname]", 0, ''); + }else{ + $sql_verlauf_err = $db->query("UPDATE imt_verlauf SET datum='$aend_dat' WHERE vid='$row_versand[vid]' AND verlauf = 'Mailfehler: $row_data1[vorname] $row_data1[nachname] über Bestellung von Gutachter $row_data[vorname] $row_data[nachname]'"); + } + + } + + } + + + # Ausschuss benachrichtigen + if($row_versand[verlauf_status] == '1'){ + if($return){ + verlauf($row_versand[imtuid], $row_versand[vid], 'Verbesserungsvorschlag erstellt', $row_versand[verlauf_status], $row_versand[einstell_dat]); + } + } + + + } + }else{ + echo "keine Mails zu senden!"; + } +} + +echo mail_versand(); +?> diff --git a/func_rechte_vergabe.php b/func_rechte_vergabe.php new file mode 100755 index 0000000..2a4df9b --- /dev/null +++ b/func_rechte_vergabe.php @@ -0,0 +1,25 @@ +query("SELECT count(*) Anz + FROM imt_rollen_user_zuord + WHERE imtuid = '$imtuid' + AND roid = '$roid'"); + $row_roid = $result_roid->fetch_array(); + + if($row_roid[Anz] == 0){ + $sql_mail_einstell = $db->query("INSERT INTO imt_rollen_user_zuord (roid, imtuid) VALUES ('$roid', '$imtuid')"); + } + + /* + WICHTIG, die Rechte müssen teilweise wieder entzogen werden, wenn Sie nicht mehr gebraucht werden, also, + wenn z.B alle Beteiligungen abgeschlossen sind beim Benutzer (Status 7 oder 8) + + */ +} + +?> \ No newline at end of file diff --git a/func_sitzung_terminieren.php b/func_sitzung_terminieren.php new file mode 100755 index 0000000..62a6889 --- /dev/null +++ b/func_sitzung_terminieren.php @@ -0,0 +1,93 @@ +query("SELECT count(*) Anz + FROM imt_gutachter + WHERE frist_datum_abgabe > date_format(now(), '%Y-%m-%d') + AND vid = '$vid' + "); + $row_fust1 = $query_fust1->fetch_array(); + + + # Wenn 0, dann sind alle Fristen abgelaufen + $query_fust2 = $db->query("SELECT count(*) Anz + FROM imt_beteiligte + WHERE frist_datum > date_format(now(), '%Y-%m-%d') + AND vid = '$vid' + "); + $row_fust2 = $query_fust2->fetch_array(); + + if($row_fust1[Anz] == 0 AND $row_fust2[Anz] == 0){ + + # Prüfen, ob alle Stellungsnahmen eingegangen sind + $query_fust3 = $db->query("SELECT count(*) Anz + FROM imt_beteiligte + WHERE stellung_dat != '0000-00-00 00:00:00' + AND vid = '$vid' + "); + $row_fust3 = $query_fust3->fetch_array(); + + + # Mail Frau Ranz vom 04.06.2012, dass mind. 1 Stellungnahme genügt, nicht alle eingegangen sein müssen + /* + # Prüfen, ob alle Stellungsnahmen eingegangen sind + $query_fust3 = $db->query("SELECT count(*) Anz + FROM imt_beteiligte + WHERE stellung_dat = '0000-00-00 00:00:00' + AND vid = '$vid' + "); + $row_fust3 = $query_fust3->fetch_array(); + + # Mail Frau Ranz, dass mind. 1 Stellungnahme genügt, nicht alle eingegangen sien müssen + if($row_fust3[Anz] == 0){ + */ + + if($row_fust3[Anz] >= 1){ + + # Prüfen, ob mind 1 Gutachten eingegangen sind + $query_fust4 = $db->query("SELECT count(*) Anz + FROM imt_gutachter + WHERE stellung_dat != '0000-00-00 00:00:00' + AND vid = '$vid' + "); + $row_fust4 = $query_fust4->fetch_array(); + if($row_fust4[Anz] >= 1){ + return 0; + }else{ + # Es fehlt min ein Gutachten + # Es wird kein Gutachten mehr benötigt,daher auch Status 0 statt 1 + #return 1; + return 0; + } + + }else{ + # Warten auf Stellungnahmen. + # Es wird kein Gutachten mehr benötigt,daher auch Status 0 statt 2 + return 0; + } + }else{ + # Abgabefristen nicht abgelaufen. + return 3; + } + +} + +#if(sitzung_terminieren(3)){ +# echo "Sitzung terminieren"; +#}else{ +# echo "Sitzung nicht terminieren"; +#} + +?> \ No newline at end of file diff --git a/func_verlauf.php b/func_verlauf.php new file mode 100755 index 0000000..8a89a27 --- /dev/null +++ b/func_verlauf.php @@ -0,0 +1,26 @@ +query("SELECT count(*) Anz FROM imt_verlauf WHERE vid= '$vid' AND status='2'"); + $row_stat2 = $result_stat2->fetch_array(); + if($row_stat2[Anz] == 0){ + $result_1 = $db->query("INSERT INTO imt_verlauf (datum, bearbeiter, status, vid, verlauf) VALUES ('$aend_dat', '$user', '$status', '$vid', '$text')"); + } + }else{ + $result_1 = $db->query("INSERT INTO imt_verlauf (datum, bearbeiter, status, vid, verlauf) VALUES ('$aend_dat', '$user', '$status', '$vid', '$text')"); + } +} + +?> \ No newline at end of file diff --git a/gruppenmitglieder.php b/gruppenmitglieder.php new file mode 100755 index 0000000..10780e1 --- /dev/null +++ b/gruppenmitglieder.php @@ -0,0 +1,53 @@ +query ($query) + or die ("Cannot execute query"); + + $table_data = array(); + + while ($row = $result->fetch_array()){ + + array_push($table_data, array( + 'name' => $row['name'], + 'mail' => $row['mail'] + ) + ); + } + + $smarty->assign('table_data', $table_data); + +} + +if($action == 'save'){ + $name = $_POST["mitgl_name"]; + $mail = $_POST["mitgl_mail"]; + $sid = session_id(); + + $datum = date("Y-m-d H:i:s"); + + if($name != ''){ + $db = dbconnect(); + $sql = $db->query("INSERT INTO imt_gruppenmitglieder_temp (session, imtuid, name, mail, datum) VALUES ('$sid', '$_SESSION[global_uid]', '$name', '$mail', '$datum')"); + } + + echo ""; + +} + +$smarty->assign('action', "$action"); +$smarty->display("$template/$templatename"); + +?> \ No newline at end of file diff --git a/gutachten_bearbeiten.php b/gutachten_bearbeiten.php new file mode 100755 index 0000000..aee9688 --- /dev/null +++ b/gutachten_bearbeiten.php @@ -0,0 +1,43 @@ +query("SELECT count(*) Anz + FROM imt_vorschlag a + WHERE vid=$id + AND vid IN (SELECT vid FROM imt_gutachter WHERE imtuid ='$uid') + AND 1 = (SELECT CASE 1 WHEN (SELECT count(*) + FROM imt_verlauf d + WHERE d.vid=a.vid + AND d.status IN ('7', '8') + GROUP BY vid + )>0 + THEN '0' + ELSE '1' + END + # Man darf den Fall solange sehen, bis er abgeschlossen ist, also entweder mit Status 7 oder 8 + ) + "); +$row_vorh = $result_vorh->fetch_array(); + +if($row_vorh[Anz] == 0){ + $smarty->assign('gutachten_bearbeiten_err', "1"); +}else{ + $smarty->assign('gutachten_bearbeiten_err', "0"); + $smarty->assign('gutachten_bearbeiten_id', "$id"); +} + + +$smarty->display("$template/$templatename"); +?> \ No newline at end of file diff --git a/gutachten_edit.php b/gutachten_edit.php new file mode 100755 index 0000000..29a84e5 --- /dev/null +++ b/gutachten_edit.php @@ -0,0 +1,258 @@ +query("SELECT betreff, beschreibung, vorschlag, nutzen, public, kategorie, hinweis_eigen, hinweis_admin + FROM imt_user a, imt_vorschlag b + WHERE a.imtuid=b.imtuid + AND b.vid = '$id'"); + $row = $result->fetch_array(); + + + + $smarty->assign('gutachten_edit_id', "$id"); + $smarty->assign('gutachten_edit_betreff', "$row[betreff]"); + $smarty->assign('gutachten_edit_beschreibung', "$row[beschreibung]"); + $smarty->assign('gutachten_edit_vorschlag', "$row[vorschlag]"); + $smarty->assign('gutachten_edit_nutzen1', "$row[nutzen]"); + + $result_kat = $db->query("SELECT a.kategorie + FROM imt_kategorie a, imt_vorschlag b + WHERE a.kid = b.kategorie + AND b.vid = '$id'"); + + $row_kat = $result_kat->fetch_array(); + $smarty->assign('gutachten_edit_kat', "$row_kat[kategorie]"); + + if($_GET['error'] == 1){ + $smarty->assign('gutachten_edit_pflichtfelder', "1"); + $smarty->assign('gutachten_edit_error_text', "Es ist zu einem Fehler gekommen. Alle Felder sind Pflichtfelder!"); + + if($_SESSION["gutachten_edit_zweck"] == ""){$smarty->assign('gutachten_edit_zweck_ico', 1);} + $smarty->assign('gutachten_edit_zweck', $_SESSION["gutachten_edit_zweck"]); + + if($_SESSION["gutachten_edit_umsetzung"] == ""){$smarty->assign('gutachten_edit_umsetzung_ico', 1);} + $smarty->assign('gutachten_edit_umsetzung', $_SESSION["gutachten_edit_umsetzung"]); + + if($_SESSION["gutachten_edit_nutzen"] == ""){$smarty->assign('gutachten_edit_nutzen_ico', 1);} + $smarty->assign('gutachten_edit_nutzen', $_SESSION["gutachten_edit_nutzen"]); + + if($_SESSION["gutachten_edit_kosteneinsparung"] == ""){$smarty->assign('gutachten_edit_kosteneinsparung_ico', 1);} + $smarty->assign('gutachten_edit_kosteneinsparung', $_SESSION["gutachten_edit_kosteneinsparung"]); + + if($_SESSION["gutachten_edit_arbeitszeiteinsparung"] == ""){$smarty->assign('gutachten_edit_arbeitszeiteinsparung_ico', 1);} + $smarty->assign('gutachten_edit_arbeitszeiteinsparung', $_SESSION["gutachten_edit_arbeitszeiteinsparung"]); + + if($_SESSION["gutachten_edit_ideeneu"] == ""){$smarty->assign('gutachten_edit_ideeneu_ico', 1);} + $smarty->assign('gutachten_edit_ideeneu', $_SESSION["gutachten_edit_ideeneu"]); + + if($_SESSION["gutachten_edit_empfehlung"] == ""){$smarty->assign('gutachten_edit_empfehlung_ico', 1);} + $smarty->assign('gutachten_edit_empfehlung', $_SESSION["gutachten_edit_empfehlung"]); + + }else{ + + $result_bem = $db->query("SELECT zweck, umsetzung, nutzen, kosteneinsparung, arbeitszeiteinsparung, ideeneu, empfehlung + FROM imt_gutachter + WHERE imtuid = '$uid' + AND vid = '$id'"); + $row_bem = $result_bem->fetch_array(); + + $smarty->assign('gutachten_edit_zweck', "$row_bem[zweck]"); + $smarty->assign('gutachten_edit_umsetzung', "$row_bem[umsetzung]"); + $smarty->assign('gutachten_edit_nutzen', "$row_bem[nutzen]"); + $smarty->assign('gutachten_edit_kosteneinsparung', "$row_bem[kosteneinsparung]"); + $smarty->assign('gutachten_edit_arbeitszeiteinsparung', "$row_bem[arbeitszeiteinsparung]"); + $smarty->assign('gutachten_edit_ideeneu', "$row_bem[ideeneu]"); + $smarty->assign('gutachten_edit_empfehlung', "$row_bem[empfehlung]"); + } + $result_frist = $db->query("SELECT count(*) Anz + FROM imt_gutachter + WHERE imtuid = '$uid' + AND vid = '$id' + AND frist_datum_abgabe < date_format(now(), '%Y-%m-%d')"); + $row_frist = $result_frist->fetch_array(); + + + if($row_frist[Anz] > 0){ + $smarty->assign('gutachten_edit_fristablauf', "1"); + }else{ + $smarty->assign('gutachten_edit_fristablauf', "0"); + } + + + + + + + + + + + # Statis + $query3 = "SELECT date_format(datum, '%d.%m.%Y - %H:%i Uhr') datum1,b.sid, b.status, verlauf + FROM imt_verlauf a, imt_stati b + WHERE a.status = b.sid + AND a.status != 0 + AND a.vid='$id' + ORDER BY datum DESC"; + + $result3 = $db->query ($query3) + or die ("Cannot execute query3"); + + $table_data3 = array(); + $verlauf_dup = array(""); + while ($row3 = $result3->fetch_array()){ + $status = $row3[status]; + + if($row3['sid'] == '103'){ + # Da jedes Ausschussmitglied informiert wird, reicht es aus, wenn bei den Statusdetails nur ein Hinweis pro Gutachter genannt wird, nicht 5x pro Person + # Bei der Meldung "Ausschuss (Bernd Fuchsi) über Gutachter Wolf Wursti informiert. Frist: 25.06.2011" wird der Gutachter "Wolf Wursti" + # ausgeschnitten und in ein Array gepackt. Wird der gleiche Gutachter mit dem Status 103 nochamls durchgeschleift, wird in den else Bereich verwiesen + # Im Template werden nur die Statis angezeigt die != "" sind + $pos1 = strpos ($row3[verlauf], 'Gutachter')+9; + $status_103 = trim(substr($row3[verlauf], $pos1)); + $pos2 = strpos ($status_103, 'informiert')-1; + $status = trim(substr($status_103, 0,$pos2)); + + if (!in_array($status, $verlauf_dup)) { + $verlauf_dup[] = "$status"; + $status = $row3[status]; + }else{ + $status = ""; + } + + } + + + if($row3['sid'] == '7' OR $row3['sid'] == '8'){ + $info = '1'; + }else{ + $info = '0'; + } + + array_push($table_data3, array( + 'datum1' => $row3[datum1], + 'info' => $info, + 'status' => $status + ) + ); + + + + } + $smarty->assign('table_data3', $table_data3); + + +} + + + + + +if($action == 'save'){ + + $id = $_SESSION["gutachten_edit_id"]; + $zweck = htmlclean($_POST[gutachten_edit_zweck]); + $umsetzung = htmlclean($_POST[gutachten_edit_umsetzung]); + $nutzen = htmlclean($_POST[gutachten_edit_nutzen]); + $kosteneinsparung = htmlclean($_POST[gutachten_edit_kosteneinsparung]); + $arbeitszeiteinsparung = htmlclean($_POST[gutachten_edit_arbeitszeiteinsparung]); + $ideeneu = htmlclean($_POST[gutachten_edit_ideeneu]); + $empfehlung = htmlclean($_POST[gutachten_edit_empfehlung]); + + + if($zweck == "" OR $umsetzung == "" OR $nutzen == "" OR $kosteneinsparung == "" OR $arbeitszeiteinsparung == "" OR $ideeneu == "" OR $empfehlung == "" ){ + + $smarty->assign('gutachten_edit_error', "1"); + $_SESSION["gutachten_edit_zweck"] = $zweck; + $_SESSION["gutachten_edit_umsetzung"] = $umsetzung; + $_SESSION["gutachten_edit_nutzen"] = $nutzen; + $_SESSION["gutachten_edit_kosteneinsparung"] = $kosteneinsparung; + $_SESSION["gutachten_edit_arbeitszeiteinsparung"] = $arbeitszeiteinsparung; + $_SESSION["gutachten_edit_ideeneu"] = $ideeneu; + $_SESSION["gutachten_edit_empfehlung"] = $empfehlung; + echo ""; + + }else{ + + $smarty->assign('gutachten_edit_error', "0"); + $aend_dat = date("Y-m-d H:i:s"); + $sql_update = $db->query("UPDATE imt_gutachter + SET zweck='$zweck' + , umsetzung ='$umsetzung' + , nutzen = '$nutzen' + , kosteneinsparung = '$kosteneinsparung' + , arbeitszeiteinsparung = '$arbeitszeiteinsparung' + , ideeneu = '$ideeneu' + , empfehlung = '$empfehlung' + , stellung_dat='$aend_dat' + WHERE vid='$id' + AND imtuid='$uid'"); + + + # Verlauf setzen + # 1) beim abgeben des Gutachten, Verlauf setzen, beim wiederbearbeiten nur das Datum setzen + $query_get_data1 = $db->query("SELECT vorname, nachname + FROM imt_user a + WHERE a.imtuid = '$uid'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_data1 = $query_get_data1->fetch_array(); + + $text = "Gutachten von $row_data1[vorname] $row_data1[nachname] ist eingegangen"; + + $result_stat2 = $db->query("SELECT count(*) Anz + FROM imt_verlauf + WHERE vid= '$id' + AND status='107' + AND verlauf = '$text'"); + $row_stat2 = $result_stat2->fetch_array(); + + if($row_stat2[Anz] == 0){ + verlauf($uid, $id, "$text", 107, ''); + }else{ + $sql_verlauf_err = $db->query("UPDATE imt_verlauf + SET datum='$aend_dat' + WHERE vid='$id' + AND status = '107' + AND verlauf = '$text' + "); + } + echo" + + "; + + } + +} + + + +$smarty->assign('action', "$action"); +$smarty->display("$template/$templatename"); +?> \ No newline at end of file diff --git a/gutachten_erledigt.php b/gutachten_erledigt.php new file mode 100755 index 0000000..fda7c69 --- /dev/null +++ b/gutachten_erledigt.php @@ -0,0 +1,73 @@ +0 + THEN '0' + ELSE '1' + END + # Man darf den Fall solange sehen, bis er abgeschlossen ist, also entweder mit Status 7 oder 8 + ) + AND b.imtuid = '$uid' + AND frist_datum_abgabe != '0000-00-00' + GROUP BY a.vid + ORDER BY frist_datum ASC"; + + $result = $db->query ($query) + or die ("Cannot execute query"); + + $table_data1 = array(); + + while ($row = $result->fetch_array()){ + # frist_datum_abgabe kann nur gesetzt sein, wenn Ausschuss zugestimmt hat. + # Erst dann wird im Adminbereich das Briefsymbol sichtbar, wo das Datum gesetzt werden kann. + array_push($table_data1, array( + 'vid' => $row[vid], + 'betreff' => $row[betreff], + 'erfass_dat_form' => $row[erfass_dat_form], + 'frist_dat_form' => $row[frist_dat_form], + 'vorname' => $row[vorname], + 'nachname' => $row[nachname] + ) + ); + + + } + + $smarty->assign('table_data1', $table_data1); + + +} + + + + + +$smarty->assign('action', "$action"); +$smarty->display("$template/$templatename"); + +?> \ No newline at end of file diff --git a/gutachten_offen.php b/gutachten_offen.php new file mode 100755 index 0000000..b92354b --- /dev/null +++ b/gutachten_offen.php @@ -0,0 +1,75 @@ +0 + THEN '0' + ELSE '1' + END + # Man darf den Fall solange sehen, bis er abgeschlossen ist, also entweder mit Status 7 oder 8 + ) + AND b.imtuid = '$uid' + AND frist_datum_abgabe != '0000-00-00' + AND b.frist_datum_abgabe >= date_format(now(), '%Y-%m-%d') + AND b.stellung_dat ='0000-00-00 00:00:00' + GROUP BY a.vid + ORDER BY frist_datum ASC"; + + $result = $db->query ($query) + or die ("Cannot execute query"); + + $table_data1 = array(); + + while ($row = $result->fetch_array()){ + # frist_datum_abgabe kann nur gesetzt sein, wenn Ausschuss zugestimmt hat. + # Erst dann wird im Adminbereich das Briefsymbol sichtbar, wo das Datum gesetzt werden kann. + array_push($table_data1, array( + 'vid' => $row[vid], + 'betreff' => $row[betreff], + 'erfass_dat_form' => $row[erfass_dat_form], + 'frist_dat_form' => $row[frist_dat_form], + 'vorname' => $row[vorname], + 'nachname' => $row[nachname] + ) + ); + + + } + + $smarty->assign('table_data1', $table_data1); + + +} + + + + + +$smarty->assign('action', "$action"); +$smarty->display("$template/$templatename"); + +?> \ No newline at end of file diff --git a/gutachter_frame.php b/gutachter_frame.php new file mode 100755 index 0000000..b9242e9 --- /dev/null +++ b/gutachter_frame.php @@ -0,0 +1,10 @@ +display("$template/$templatename"); +?> \ No newline at end of file diff --git a/gutachterbenennung.php b/gutachterbenennung.php new file mode 100755 index 0000000..6c49441 --- /dev/null +++ b/gutachterbenennung.php @@ -0,0 +1,891 @@ + $value){ + if ( substr( $key, 0, $search_len) == $search_prefix) { + unset( $_SESSION[$key]); + } + } + } + + + +if($action == ''){ + + if($_GET['error'] == 1){ + $smarty->assign('gutachterbenennung_pflichtfelder', "1"); + $smarty->assign('gutachterbenennung_error_text', "Es ist zu einem Fehler gekommen. Bitte füllen Sie alle Pflichtfelder aus."); + + if($_SESSION["gutachterbenennung_user_gutachter"] == ""){$smarty->assign('gutachterbenennung_user_gutachter_ico', 1);} + } + + $id = $_SESSION["edit_id"]; + + $query1 = "SELECT a.gid, vorname, nachname, date_format(frist_datum, '%d.%m.%Y') frist_tag, date_format(frist_datum_abgabe, '%d.%m.%Y') frist_datum_abgabe + FROM imt_gutachter a, imt_user b + WHERE a.imtuid=b.imtuid + AND a.vid='$id' + ORDER BY nachname ASC"; + + $result1 = $db->query ($query1) + or die ("Cannot execute query"); + + $table_data1 = array(); + + ### Status des Gutachtens + ### Berechnen, ob bereits entschieden ist, da die Mehrzahl der Stimmen bereits abgegeben wurde + $gutachter = new gutachter(); + + while ($row1 = $result1->fetch_array()){ + + + gutachter_entscheid($uid, $row1[gid], $id); + $status = $gutachter -> gutachter_status($row1[gid]); + $status_klartext = $gutachter -> gutachter_status_klartext($row1[gid], $status); + +#/* Gutachter muss nicht mehr vom Ausschuss genehmigt werden +# if($status == '1' OR $status == '2' OR $status == '3' OR $status == '4' OR $status == '5'){ +# # Briefsymbol um Gutachter anzuschreiben anzeigen +# $gutachterbrief = 1; +# }else{ +# $gutachterbrief = 0; +# } +#*/ + # Es kann gleich das Briefsymbol eingeblendet werden ohne Ausschuss + $gutachterbrief = 1; + + if($row1[frist_datum_abgabe] == '00.00.0000'){ + $abgabefrist = "Gutachter noch nicht angeschrieben"; + }else{ + $abgabefrist = $row1[frist_datum_abgabe]; + } + + + array_push($table_data1, array( + 'gid' => $row1[gid], + 'vorname' => $row1[vorname], + 'nachname' => $row1[nachname], + 'status' => $status, + 'status_klartext' => $status_klartext, + 'gutachterbrief' => $gutachterbrief, + 'frist_tag' => $row1[frist_tag], + 'frist_datum_abgabe' => $abgabefrist + ) + ); + } + $smarty->assign('table_data1', $table_data1); + + + + + $query2 = "SELECT imtuid, vorname, nachname + FROM imt_user + ORDER BY nachname ASC"; + + $result2 = $db->query ($query2) + or die ("Cannot execute query2"); + + $table_data2 = array(); + + while ($row2 = $result2->fetch_array()){ + $query_dis_gut = $db->query("SELECT count(*) Anz + FROM imt_gutachter + WHERE vid='$id' + AND imtuid='$row2[imtuid]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_dis_gut = $query_dis_gut->fetch_array(); + if($row_dis_gut[Anz] > 0){ + $disable_gut = 1; + }else{ + $disable_gut = 0; + } + + + $query_dis_bet = $db->query("SELECT count(*) Anz + FROM imt_beteiligte + WHERE vid='$id' + AND imtuid='$row2[imtuid]'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_dis_bet = $query_dis_bet->fetch_array(); + if($row_dis_bet[Anz] > 0){ + $disable_bet = 1; + }else{ + $disable_bet = 0; + } + + + if($row2[imtuid] == $_GET[userid]){ + $selected = 1; + }else{ + $selected = 0; + } + array_push($table_data2, array( + 'imtuid' => $row2[imtuid], + 'vorname' => $row2[vorname], + 'nachname' => $row2[nachname], + 'disable_bet' => $disable_bet, + 'disable_gut' => $disable_gut, + 'selected' => $selected + ) + ); + } + $smarty->assign('table_data2', $table_data2); +} + +if($action == 'balance'){ + + if(isset($_POST["user_gutachter"])){ + $user_gutachter = $_POST["user_gutachter"]; + $_SESSION["gutachterbenennung_user_gutachter"] = $user_gutachter; + } + + if($user_gutachter == ""){ + echo ""; + }elseif($user_gutachter == "S"){ + # Gutachter soll ein Student sein + echo ""; + }elseif($user_gutachter == "P" OR $user_gutachter == "V"){ + # Gutachter soll ein Professor oder Verwaltungsmitarbeiter + echo ""; + }elseif($user_gutachter == "L"){ + # Gutachter soll ein Lehrbeauftragter ohne LDAP sein + echo ""; + }elseif($user_gutachter == "R"){ + # Beteiligter soll ein Mitarbeiter des Rechenzentrums sein + echo ""; + }else{ + # Wenn ein konkreter Benutzer ausgewählt wurde + echo ""; + } + +} + + +if($action == 'ldap2'){ + + $suchstring=utf8_decode($_POST['suchstring']); + $suchpfad=$_POST['suchpfad']; + + $result_ldap = $db->query("SELECT wert1 user, wert2 passwd + FROM imt_parameter + WHERE pid='2' + LIMIT 1"); + $row_ldap = $result_ldap->fetch_array(); + + $_ad_username="$row_ldap[user]"; + $_ad_password="$row_ldap[passwd]"; + + $user_gutachter = $_SESSION["gutachterbenennung_user_gutachter"]; + if($user_gutachter == "P" OR $user_gutachter == "V"){ + $_ldap_dn = "ou=OUHochschulnetzwerk,dc=hsnet,dc=hs-ludwigsburg,dc=de"; + $ds=@ldap_connect("141.10.128.30", "389"); // muss ein gültiger LDAP Server Port 389->3268 + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + } + + if($user_gutachter == "S"){ + $_ldap_dn = "ou=ouStudnet,dc=studnet,dc=hs-ludwigsburg,dc=de"; + $ds=@ldap_connect("141.10.144.37", "389"); // muss ein gültiger LDAP Server Port 389->3268 + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + } + + if($user_gutachter == "R"){ + $_ldap_dn = "ou=OURechenzentrum,dc=hsnet,dc=hs-ludwigsburg,dc=de"; + $ds=@ldap_connect("141.10.128.30", "389"); // muss ein gültiger LDAP Server Port 389->3268 + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + } + + if ($ds) { + + $r=ldap_bind($ds, $_ad_username, $_ad_password); + + + // Suchen des Nachnamen-Eintrags + #$suchstring2=$suchstring; + #$sr=ldap_search($ds,"o=fhov", "cn=$suchstring"); + $sr=ldap_search($ds, $_ldap_dn, "$suchpfad=$suchstring"); + + + + $anzahl = ldap_count_entries($ds,$sr); + + $info = ldap_get_entries($ds, $sr); + + $table_data3 = array(); + for ($i=0; $i<$info["count"]; $i++) { + + //$dn enthält dn-string ==> 'cn=test,ou=extern,o=fhov': Nachfolgende Zeilen nur ou extrahieren + + $uid = $info[$i]['samaccountname'][0]; + $vorname = $info[$i]['givenname'][0]; + $nachname = $info[$i]['sn'][0]; + $dn = $info[$i][dn]; + $mail = $info[$i]['mail'][0]; + + + $b = strpos ($dn, "OU=")+3; // Position bestimmen wo ou anfängt, +3 damit "ou=" nicht mitangezeigt wird, also Positon um 3 nach recht verschoben wird + if($user_gutachter == "P" OR $user_gutachter == "V"){ + # Bei Mitarbeiter: CN=Rieth\, Wolfgang,OU=Verwaltung,OU=Mitarbeiter,OU=OUHochschulnetzwerk,DC=hsnet,DC=hs-ludwigsburg,DC=de + $c = strpos ($dn, ",OU=Mitarbeiter"); // Position bestimmen woe ,o= anfängt + + if($c == ""){ + # Bei externen: CN=Schwarz\, Alexander,OU=Externe Benutzer,OU=OUHochschulnetzwerk,DC=hsnet,DC=hs-ludwigsburg,DC=de + $c = strpos ($dn, ",OU=OUHochschulnetzwerk"); // Position bestimmen woe ,o= anfängt + } + + } + if($user_gutachter == "S"){ + $c = strpos ($dn, ",OU=Benutzer"); // Position bestimmen woe ,o= anfängt + } + + $d = $c-$b; // beide Werte subrahieren, dann erhält man die Länge von ou + $gruppe = substr($dn, $b, $d); + + array_push($table_data3, array( + 'uid' => $uid, + 'vorname' => $vorname, + 'nachname' => $nachname, + 'gruppe' => $gruppe, + 'mail' => $mail + ) + ); + + $uid = ""; + $vorname = ""; + $nachname = ""; + $dn = ""; + $gruppe = ""; + $mail = ""; + + } + $smarty->assign('table_data3', $table_data3); + ldap_close($ds); + }else{ + echo "

          Verbindung zum LDAP Server nicht möglich

          "; + } + +} + + +if($action == 'ldap3'){ + + if($_GET['error'] == 1){ + $smarty->assign('gutachterbenennung_pflichtfelder', "1"); + $smarty->assign('gutachterbenennung_error_text', "Es ist zu einem Fehler gekommen. Bitte füllen Sie alle Pflichtfelder aus."); + + + if($_SESSION["gutachterbenennung_vorname"] == ""){$smarty->assign('gutachterbenennung_vorname_ico', 1);} + + if($_SESSION["gutachterbenennung_nachname"] == ""){$smarty->assign('gutachterbenennung_nachname_ico', 1);} + + if($_SESSION["gutachterbenennung_mail"] == ""){$smarty->assign('gutachterbenennung_mail_ico', 1);} + + if($_SESSION["gutachterbenennung_beziehung"] == ""){$smarty->assign('gutachterbenennung_beziehung_ico', 1);} + + if($_SESSION["gutachterbenennung_fakultaet"] == ""){$smarty->assign('gutachterbenennung_fakultaet_ico', 1);} + + if($_SESSION["gutachterbenennung_ag"] == ""){$smarty->assign('gutachterbenennung_ag_ico', 1);} + + if($_SESSION["gutachterbenennung_jahrgang"] == ""){$smarty->assign('gutachterbenennung_jahrgang_ico', 1);} + } + + if($_GET['error'] == 2){ + $smarty->assign('gutachterbenennung_pflichtfelder', "1"); + $smarty->assign('gutachterbenennung_error_text', "Die Mailadresse ist nicht gültig! Bitte tragen Sie eine gültige Mailadresse ein."); + } + + if($_GET['error'] == 3){ + $smarty->assign('gutachterbenennung_pflichtfelder', "1"); + $smarty->assign('gutachterbenennung_error_text', "Die Mailadresse ist im System bereits vorhanden. Setzen Sie sich bitte mit $global_service_admin in Verbindung"); + } + + $smarty->assign('gutachterbenennung_vorname', $_SESSION["gutachterbenennung_vorname"]); + $smarty->assign('gutachterbenennung_nachname', $_SESSION["gutachterbenennung_nachname"]); + $smarty->assign('gutachterbenennung_mail', $_SESSION["gutachterbenennung_mail"]); + $smarty->assign('gutachterbenennung_beziehung', $_SESSION["gutachterbenennung_beziehung"]); + $smarty->assign('gutachterbenennung_fakultaet', $_SESSION["gutachterbenennung_fakultaet"]); + $smarty->assign('gutachterbenennung_ag', $_SESSION["gutachterbenennung_ag"]); + $smarty->assign('gutachterbenennung_jahrgang', $_SESSION["gutachterbenennung_jahrgang"]); + + if(isset($_POST['auswahl'])){ + $suchstring=$_POST['auswahl']; + $_SESSION["gutachterbenennung_user_uid"] = $suchstring; + $suchpfad='samaccountname'; + + $result_ldap = $db->query("SELECT wert1 user, wert2 passwd + FROM imt_parameter + WHERE pid='2' + LIMIT 1"); + $row_ldap = $result_ldap->fetch_array(); + + $_ad_username="$row_ldap[user]"; + $_ad_password="$row_ldap[passwd]"; + + $user_gutachter = $_SESSION["gutachterbenennung_user_gutachter"]; + if($user_gutachter == "P" OR $user_gutachter == "V"){ + $_ldap_dn = "ou=OUHochschulnetzwerk,dc=hsnet,dc=hs-ludwigsburg,dc=de"; + $ds=@ldap_connect("141.10.128.30", "389"); // muss ein gültiger LDAP Server Port 389->3268 + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + } + + if($user_gutachter == "S"){ + $_ldap_dn = "ou=ouStudnet,dc=studnet,dc=hs-ludwigsburg,dc=de"; + $ds=@ldap_connect("141.10.144.37", "389"); // muss ein gültiger LDAP Server Port 389->3268 + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + } + + if($user_gutachter == "R"){ + $_ldap_dn = "ou=OURechenzentrum,dc=hsnet,dc=hs-ludwigsburg,dc=de"; + $ds=@ldap_connect("141.10.128.30", "389"); // muss ein gültiger LDAP Server Port 389->3268 + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + } + + + if ($ds) { + + $r=ldap_bind($ds, $_ad_username, $_ad_password); + + + // Suchen des Nachnamen-Eintrags + #$suchstring2=$suchstring; + #$sr=ldap_search($ds,"o=fhov", "cn=$suchstring"); + $sr=ldap_search($ds, $_ldap_dn, "$suchpfad=$suchstring"); + + + $anzahl = ldap_count_entries($ds,$sr); + + $info = ldap_get_entries($ds, $sr); + + $table_data3 = array(); + for ($i=0; $i<$info["count"]; $i++) { + + //$dn enthält dn-string ==> 'cn=test,ou=extern,o=fhov': Nachfolgende Zeilen nur ou extrahieren + + $vorname = $info[$i]['givenname'][0]; + $nachname = $info[$i]['sn'][0]; + $mail = $info[$i]['mail'][0]; + $dn = $info[$i][dn]; + $b = strpos ($dn, "OU=")+3; // Position bestimmen wo ou anfängt, +3 damit "ou=" nicht mitangezeigt wird, also Positon um 3 nach recht verschoben wird + $c = strpos ($dn, ",OU=Benutzer"); // Position bestimmen woe ,o= anfängt + $d = $c-$b; // beide Werte subrahieren, dann erhält man die Länge von ou + $gruppe = substr($dn, $b, $d); + $gruppe = str_replace ("Stud", "", $gruppe); + + + } + ldap_close($ds); + + if($user_gutachter == "S"){ + $db = dbconnect(); + $query = "SELECT distinct jahrgang + FROM kurs.stud + WHERE jahrgang <= substr(date_format(now(), '%Y'),3,2) + ORDER BY jahrgang desc + LIMIT 4"; + $result = $db->query ($query) + or die ("Cannot execute query1"); + + $table_data = array(); + + + while ($row = $result->fetch_array()){ + + if($row[jahrgang] == $gruppe){ + $select = 1; + }else{ + $select = 0; + } + + array_push($table_data, array( + 'select' => $select, + 'jahrgang' => $row['jahrgang'] + ) + ); + } + $smarty->assign('table_data', $table_data); + + } + + $smarty->assign('gutachterbenennung_beziehung', "$user_gutachter"); + $smarty->assign('gutachterbenennung_vorname', "$vorname"); + $smarty->assign('gutachterbenennung_nachname', "$nachname"); + $smarty->assign('gutachterbenennung_mail', "$mail"); + + }else{ + echo "

          Verbindung zum LDAP Server nicht möglich

          "; + } + } + +} + + +if($action == 'ldap4'){ + + $vorname = utf8_decode($_POST['vorname']); + $nachname = utf8_decode($_POST['nachname']); + $mail = utf8_decode($_POST['mail']); + $beziehung = utf8_decode($_POST['beziehung']); + + $ag = $_POST['ag']; + $jahrgang = $_POST['jahrgang']; + $fakultaet = $_POST['fakultaet']; + + $_SESSION["gutachterbenennung_vorname"] = "$vorname"; + $_SESSION["gutachterbenennung_nachname"] = "$nachname"; + $_SESSION["gutachterbenennung_mail"] = "$mail"; + $_SESSION["gutachterbenennung_beziehung"] = "$beziehung"; + + $_SESSION["gutachterbenennung_ag"] = "$ag"; + $_SESSION["gutachterbenennung_jahrgang"] = "$jahrgang"; + $_SESSION["gutachterbenennung_fakultaet"] = "$fakultaet"; + + if(!validEmail($mail)){ + $fehler = 1; + echo ""; + } + + + $db = dbconnect(); + $query = $db->query("SELECT count(*) Anz + FROM imt_user + WHERE mail = '$mail'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row = $query->fetch_array(); + + if($row[Anz] > 0){ + # Benutzer vorhanden + $fehler = 1; + echo ""; + } + + if($vorname == "" OR $nachname == "" OR $mail == "" OR $beziehung == ""){ + # Fehler Pflichtfelder + $fehler = 1; + echo ""; + } + + if($beziehung == "P" OR $beziehung == "L" OR $beziehung == ""){ + if($fakultaet == ""){ + # Fakultaet leer + $fehler = 1; + echo ""; + } + } + + if($beziehung == "S"){ + if($ag == "" OR $jahrgang == ""){ + # AG Jahrgang leer + $fehler = 1; + echo ""; + } + } + + + if(!isset($fehler )){ + if($beziehung == "P" OR $beziehung == "L"){ + $ag = ""; + $jahrgang = ""; + } + + if($beziehung == "S"){ + $fakultaet = ""; + } + + # Lehrbeauftragte und Externe Benutzer bekommen eine Benutzerkennung da Sie nicht in der Hochschule erfasst sind, zumindest nicht alle + if($beziehung == "E" or $beziehung == "L"){ + $benutzerkennung = genUser($vorname, $nachname); + + $datum=date("Y-m-d H:i:s"); + #$pw_expire = date("Y-m-d H:i:s", mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y")+1)); // ISO-8601 Format + $aktivierungscode = rand(1, 99999999); + + #$pool = "qwertzupasdfghkyxcvbnm"; + #$pool .= "23456789"; + #$pool .= "WERTZUPLKJHGFDSAYXCVBNM"; + # + #srand ((double)microtime()*1000000); + #for($index = 0; $index < 7; $index++) + #{ + #$pass_word .= substr($pool,(rand()%(strlen ($pool))), 1); + #} + + #$new_pw_md5=md5($pass_word); + }else{ + # Bei User innerhalb des ADs benötigt man die Original-Benutzerkennung, aber dafür kein Passwort + $benutzerkennung = $_SESSION["gutachterbenennung_user_uid"]; + } + + $db = dbconnect(); + $sql1 = $db->query("INSERT INTO imt_user ( vorname + , nachname + , mail + , beziehung + , ag + , jahrgang + , fakultaet + , uid + , erstell_dat + , aktiv + , akivierungscode + ) + VALUES + ( '$vorname' + , '$nachname' + , '$mail' + , '$beziehung' + , '$ag' + , '$jahrgang' + , '$fakultaet' + , '$benutzerkennung' + , '$datum' + , '1' + , '$aktivierungscode' + ) + "); + $imtuid = $db->insert_id; + + if($sql1){ // Wenn Insert geklappt hat, dann mail + # Bei erfolgreichem Insert, auf die Startseite gutachterbenennung wechseln und dort den Benutzer vorselektieren + echo ""; + }else{ + echo "Beim anlegen des Benutzer ist ein unbekannter Fehler aufgetreten!"; + } + + } + + +} + +if($action == 'frist'){ + # START: Da kein Ausschuss mehr benötigt wird, wird der Gutachter gleich erfasst + $imtuid = $_SESSION["gutachterbenennung_user_gutachter"]; + $vid = $_SESSION["edit_id"]; + $gutachterbemerkung = ""; # Dem Ausschuss muss keine Bemerkung mitgeteilt werden, da er nicht mehr informiert wird. + $aend_dat = date("Y-m-d H:i:s"); + $frist = "0000-00-00"; # Dem Ausschuss muss keine Bemerkung mitgeteilt werden, da er nicht mehr informiert wird. + $db = dbconnect(); + $sql1 = $db->query("INSERT INTO imt_gutachter ( imtuid + , vid + , bemerkung + , erfass_dat + , frist_datum + ) + VALUES + ( '$imtuid' + , '$vid' + , '$gutachterbemerkung' + , '$aend_dat' + , '$frist' + ) + "); + echo ""; + # ENDE: Da kein Ausschuss mehr benötigt wird, wird der Gutachter gleich erfasst +} + +if($action == 'anschreiben'){ + # Gutachter anschreiben, ihnen die Frist mitteilen und das Recht für den Gutachterbereich geben. + # GGf muss ein Passwort gesetzt und mitgeteilt werden + + $gid = $_GET['gid']; + $_SESSION["gutachterbenennung_gid"] = $gid; + + if($_GET['error'] == 1){ + $smarty->assign('gutachterbenennung_pflichtfelder', "1"); + $smarty->assign('gutachterbenennung_error_text', "Es ist zu einem Fehler gekommen. Bitte füllen Sie alle Pflichtfelder aus."); + + + if($_SESSION["gutachterbenennung_fristtag"] == "" OR $_SESSION["gutachterbenennung_fristmon"] == "" OR $_SESSION["gutachterbenennung_frisjahr"] == ""){$smarty->assign('gutachterbenennung_frist_ico', 1);} + if($_SESSION["gutachterbenennung_fristtag"] == ""){$smarty->assign('gutachterbenennung_fristtag_ico', 1);} + if($_SESSION["gutachterbenennung_fristmon"] == ""){$smarty->assign('gutachterbenennung_fristmon_ico', 1);} + if($_SESSION["gutachterbenennung_fristjahr"] == ""){$smarty->assign('gutachterbenennung_fristjahr_ico', 1);} + + + $smarty->assign('gutachterbenennung_fristtag', $_SESSION["gutachterbenennung_fristtag"]); + $smarty->assign('gutachterbenennung_fristmon', $_SESSION["gutachterbenennung_fristmon"]); + $smarty->assign('gutachterbenennung_fristjahr', $_SESSION["gutachterbenennung_fristjahr"]); + $smarty->assign('gutachterbenennung_gutachterbemerkung', $_SESSION["gutachterbenennung_gutachterbemerkung"]); + + }elseif($_GET['error'] == 2){ + $smarty->assign('gutachterbenennung_pflichtfelder', "1"); + $smarty->assign('gutachterbenennung_error_text', "Das Fristdatum ist nicht korrekt. Bitte korrigieren Sie das Datum!"); + + $smarty->assign('gutachterbenennung_fristtag', $_SESSION["gutachterbenennung_fristtag"]); + $smarty->assign('gutachterbenennung_fristmon', $_SESSION["gutachterbenennung_fristmon"]); + $smarty->assign('gutachterbenennung_fristjahr', $_SESSION["gutachterbenennung_fristjahr"]); + $smarty->assign('gutachterbenennung_gutachterbemerkung', $_SESSION["gutachterbenennung_gutachterbemerkung"]); + }else{ + + $query_ga = $db->query("SELECT date_format(frist_datum_abgabe, '%d') frist_datum_abgabe_tag, date_format(frist_datum_abgabe, '%m') frist_datum_abgabe_mon, date_format(frist_datum_abgabe, '%Y') frist_datum_abgabe_jahr, frist_datum_abgabe + FROM imt_gutachter + WHERE gid = '$gid'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_ga = $query_ga->fetch_array(); + + if($row_ga[frist_datum_abgabe] == '0000-00-00'){ + $smarty->assign('gutachterbenennung_fristtag', date("d",strtotime("+4 week")) ); + $smarty->assign('gutachterbenennung_fristmon', date("m",strtotime("+4 week")) ); + $smarty->assign('gutachterbenennung_fristjahr', date("Y",strtotime("+4 week")) ); + }else{ + $smarty->assign('gutachterbenennung_fristtag', $row_ga["frist_datum_abgabe_tag"] ); + $smarty->assign('gutachterbenennung_fristmon', $row_ga["frist_datum_abgabe_mon"] ); + $smarty->assign('gutachterbenennung_fristjahr', $row_ga["frist_datum_abgabe_jahr"] ); + } + } + + +} + + +if($action == 'anschreiben1'){ + # Gutachter anschreiben, ihnen die Frist mitteilen und das Recht für den Gutachterbereich geben. + # GGf muss ein Passwort gesetzt und mitgeteilt werden + + $gid = $_SESSION["gutachterbenennung_gid"]; + $tag = $_POST["frist_tag"]; + $mon = $_POST["frist_mon"]; + $jahr = $_POST["frist_jahr"]; + $abgabefrist = "$jahr-$mon-$tag"; + $gutachterbemerkung = $_POST["gutachter_bemerkung"]; + $beziehung = $_SESSION["gutachterbenennung_beziehung"]; + + $_SESSION["gutachterbenennung_fristtag"] = $tag; + $_SESSION["gutachterbenennung_fristmon"] = $mon; + $_SESSION["gutachterbenennung_fristjahr"] = $jahr; + $_SESSION["gutachterbenennung_gutachterbemerkung"] = $gutachterbemerkung; + + + + + if(!@checkdate($mon, $tag, $jahr)){ + # Fehler Datum + $fehler = 1; + echo ""; + } + + if($tag == "" OR $mon == "" OR $jahr == ""){ + # Fehler Pflichtfelder + $fehler = 1; + echo ""; + } + + if(!isset($fehler )){ + + # Daten des Gutachters abfragen + $db = dbconnect(); + $query_ga = $db->query("SELECT uid, imtuid, passwort, vorname, nachname, beziehung + FROM imt_user + WHERE imtuid IN (SELECT imtuid FROM imt_gutachter WHERE gid='$gid')") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_ga = $query_ga->fetch_array(); + + + + # Lehrbeauftragte und Externe Benutzer bekommen eine Benutzerkennung da Sie nicht in der Hochschule erfasst sind, zumindest nicht alle + if($row_ga['beziehung'] == "E" or $row_ga['beziehung'] == "L"){ + + if($row_ga[passwort] == ''){ + # Passwort ggf. setzen + + $pw_expire = date("Y-m-d H:i:s", mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y")+1)); // ISO-8601 Format + + $pool = "qwertzupasdfghkyxcvbnm"; + $pool .= "23456789"; + $pool .= "WERTZUPLKJHGFDSAYXCVBNM"; + + srand ((double)microtime()*1000000); + for($index = 0; $index < 7; $index++) + { + $pass_word .= substr($pool,(rand()%(strlen ($pool))), 1); + } + + $new_pw_md5=md5($pass_word); + $sql = $db->query ("UPDATE imt_user SET passwort='$new_pw_md5', pw_expire='$pw_expire' WHERE imtuid='$row_ga[imtuid]'"); + } + } + + + # Herausfinden, ob der Gutachter bereits ein Recht für den Gutachterbereicht, ggf setzen + rechte_vergabe($row_ga[imtuid], 2); + + # Frist setzen + $sql = $db->query ("UPDATE imt_gutachter SET frist_datum_abgabe='$abgabefrist' WHERE gid='$gid'"); + + + # Herausfinden des Betreffs des Verbesserungsvorschlages + $query_vv = $db->query("SELECT betreff, vid + FROM imt_vorschlag + WHERE vid IN (SELECT vid FROM imt_gutachter WHERE gid='$gid')") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row_vv = $query_vv->fetch_array(); + + + # Gutachter anschreiben + + $empfaenger = "$row_ga[imtuid]"; + $betreff = "Gutachteranhörung"; + $text = " + + + Gutachtenanhörung + + + + Guten Tag $row_ga[vorname] $row_ga[nachname]! +

          + Im Rahmen des Ideenmanagements ist ein Verbesserungsvorschlag eingegangen. + Zu diesem Vorschlag wurden Sie im System \"Ideenmanagement\" als Gutachter benannt. + Um eine sachliche Entscheidung über die eingereichte Idee treffen zu können, + benötigt der Ausschuss Ideenmanagement von Ihnen als Gutachter eine Stellungnahme. + Bitte halten Sie Stillschweigen über die eingereichte Idee ein. + +
          +
          + + + + + + + + + + "; + $benutzerkennung = $row_ga[uid]; + # Bei Benutzer im AD + $benutzerkennung2 = $_SESSION["gutachterbenennung_user_uid"]; + if($benutzerkennung != ""){ + $text .= " + + + + "; + } + + if($pass_word != ""){ + $text .= " + + + + "; + } + + if($benutzerkennung2 != ""){ + $text .= " + + + + "; + } + + if($gutachterbemerkung != ""){ + $text .= " + + + + "; + } + + $text .=" + + + + +
          + + Vorschlag: + + + + $row_vv[betreff] + +
          + + ID: + + + + $row_vv[vid] + +
          + + Benutzerkennung: + + + + $benutzerkennung + +
          + + Passwort: + + + + $pass_word + +
          + + Benutzerkennung: + + + + $benutzerkennung2 + +
          + + Bemerkung: + + + + $gutachterbemerkung + +
          + + Bearbeitungsfrist: + + + + $tag.$mon.$jahr + +
          +
          + Um den Vorschlag vollständig zu lesen und Ihre Stellungnahme abzugeben, melden Sie sich am System an und wechseln Sie auf das Register \"Gutachterbereich\". +

          + Klicken Sie hier um zum Ideenmanagement zu gelangen. +

          + Wir können die Motivation zum Einreichen der Ideen steigern, indem wir schnelle, aber ausreichend begründete Antworten geben. + Der Bearbeitungsaufwand soll sich am zu erwartenden Nutzen orientieren. + Sollten Sie die genannte Frist voraussichtlich nicht einhalten können, stimmen Sie bitte eine Zeitspanne mit dem/der QMB ab. + +

          + Diese Mail wurde automatisch generiert!
          + Antworten Sie daher nicht auf diese Mail.
          +
          + Vielen Dank! + + "; + + + mail_einstell($row_vv[vid], $uid, $empfaenger, NULL, NULL, $betreff, $text, 108, NULL); + + echo ""; + + } + + +} + +$smarty->assign('action', "$action"); +$smarty->display("$template/$templatename"); + +?> \ No newline at end of file diff --git a/hauptframe.php b/hauptframe.php new file mode 100755 index 0000000..c14a71b --- /dev/null +++ b/hauptframe.php @@ -0,0 +1,11 @@ +display("$template/$templatename"); + +?> \ No newline at end of file diff --git a/hauptframe_admin.php b/hauptframe_admin.php new file mode 100755 index 0000000..c14a71b --- /dev/null +++ b/hauptframe_admin.php @@ -0,0 +1,11 @@ +display("$template/$templatename"); + +?> \ No newline at end of file diff --git a/hauptframe_ausschuss.php b/hauptframe_ausschuss.php new file mode 100755 index 0000000..c14a71b --- /dev/null +++ b/hauptframe_ausschuss.php @@ -0,0 +1,11 @@ +display("$template/$templatename"); + +?> \ No newline at end of file diff --git a/hauptframe_beteiligte.php b/hauptframe_beteiligte.php new file mode 100755 index 0000000..c14a71b --- /dev/null +++ b/hauptframe_beteiligte.php @@ -0,0 +1,11 @@ +display("$template/$templatename"); + +?> \ No newline at end of file diff --git a/hauptframe_eingabe.php b/hauptframe_eingabe.php new file mode 100755 index 0000000..c14a71b --- /dev/null +++ b/hauptframe_eingabe.php @@ -0,0 +1,11 @@ +display("$template/$templatename"); + +?> \ No newline at end of file diff --git a/hauptframe_gutachter.php b/hauptframe_gutachter.php new file mode 100755 index 0000000..c14a71b --- /dev/null +++ b/hauptframe_gutachter.php @@ -0,0 +1,11 @@ +display("$template/$templatename"); + +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100755 index 0000000..37f57b0 --- /dev/null +++ b/index.php @@ -0,0 +1,419 @@ +assign('index_error', 1); + + if($errorno == 1){ + $smarty->assign('index_error_text', "Es müssen alle Felder ausgefüllt werden"); + } + + # Bei LDAP wird eine Registrierung automatisch durchgeführt + #if($errorno == 2){ + # $smarty->assign('index_error_text', "Ber Benutzername ist im System nicht vorhanden"); + #} + + if($errorno == 3){ + $smarty->assign('index_error_text', "Ber Benutzername oder das Passwort ist nicht korrekt
          Stellen Sie sicher, dass Ihr Benutzerkonto in der Hochschule aktiv ist."); + } + + # Daten aufbereiten bei Fehler + if(isset($_SESSION["global_username"])){ + $smarty->assign('index_user', $_SESSION["global_username"]); + } + } + + +} + +if($action == 'anmeld'){ + $username=strtolower($_POST["user"]); //remove case sensitivity on the username + $password=$_POST["password"]; + + if($_POST["user"] != ""){ + $_SESSION["global_username"]=$username; + } + if($username == "" OR $password == ""){ + echo ""; + }else{ + + $db = dbconnect(); + $query_ldapuser = $db->query("SELECT wert1, wert2 FROM imt_parameter WHERE pid='2'"); + $row_ldapuser = $query_ldapuser->fetch_array(); + + + + ################################ + ## Prüfe studnet ob Treffer + ################################ + # bind wird benötigt, sonst werden die Umlaute bei Namen nicht richtig angezeigt ?!!? + + $ds=@ldap_connect("141.10.144.37", "389"); + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + + $r=@ldap_bind($ds, $row_ldapuser['wert1'], $row_ldapuser['wert2']); + $_ldap_dn = "ou=ouStudnet,dc=studnet,dc=hs-ludwigsburg,dc=de"; + $sr=@ldap_search($ds, $_ldap_dn, "samaccountname=$username"); + $info = @ldap_get_entries($ds, $sr); + $anzahl = @ldap_count_entries($ds,$sr); + $vorname = $info[0]['givenname'][0]; + $nachname = $info[0]['sn'][0]; + $mail = $info[0]['mail'][0]; + $first = @ldap_first_entry($ds,$sr); + $distinguishedName = @ldap_get_dn($ds,$first); + $result_jg = $db->query("SELECT ag, jahrgang FROM kurs.stud WHERE lower(uid)='$username'"); + $row_jg = $result_jg->fetch_array(); + ################################ + + + ### Wenn binden fehlschlägt, also Passwort falsch + ##!!!!! IM STUDNET MIT DEM USERNAMEN BINDEN, IM HSNET MIT DEM DISTINGUISHEDNAME !!!!!!################# + #if ($bind = @ldap_bind($ds, $username, $password) AND $anzahl > 0){ + if ($bind = @ldap_bind($ds, $distinguishedName, $password) AND $anzahl > 0){ + # Bind funktioniert +#echo "studnet: Bind funktioniert: $anzahl
          "; + $login = "0"; + $login_ad = "studnet"; + }else{ + # Bind funktioniert nicht +#echo "studnet: Bind funktioniert nicht: $anzahl
          "; + $login = "1"; + ldap_close($ds); + } +#exit; + + ######## + # INFO hsnet: Würde man nur $_ldap_dn = "dc=hsnet,dc=hs-ludwigsburg,dc=de"; angeben ohne OU=OUHochschunetzwerk oä., würde php beim search nichts mehr finden und alle Passwörter akzeptieren + ######## + + + ################################ + ## Prüfe OUHochschulnetzwerk ob Treffer, wenn studnet nicht funktioniert + ################################ + if($login == "1" and $anzahl == "0"){ + + $ds=@ldap_connect("141.10.128.30", "389"); + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + + # bind wird benötigt, sonst werden die Umlaute bei Namen nicht richtig angezeigt ?!!? + $r=@ldap_bind($ds, $row_ldapuser['wert1'], $row_ldapuser['wert2']); + $_ldap_dn = "ou=OUHochschulnetzwerk,dc=hsnet,dc=hs-ludwigsburg,dc=de"; + $sr=@ldap_search($ds, $_ldap_dn, "samaccountname=$username"); + $info = @ldap_get_entries($ds, $sr); + $anzahl = @ldap_count_entries($ds,$sr); + $vorname = $info[0]['givenname'][0]; + $nachname = $info[0]['sn'][0]; + $mail = $info[0]['mail'][0]; + $first = @ldap_first_entry($ds,$sr); + $distinguishedName = @ldap_get_dn($ds,$first); + ################################ + + # Bind geht im hsnet nur über den DN "CN=Schwarz\, Alexander, OU=Externe Benutzer, ou=OUHochschulnetzwerk,dc=hsnet,dc=hs-ludwigsburg,dc=de" + ##!!!!! IM STUDNET MIT DEM USERNAMEN BINDEN, IM HSNET MIT DEM DISTINGUISHEDNAME !!!!!!################# + if ($bind = @ldap_bind($ds, $distinguishedName, $password) AND $anzahl > 0){ +#echo "hsnet: Bind funktioniert: $anzahl |$distinguishedName|
          "; + $login = "0"; + $login_ad = "hsnet"; + }else{ + # Bind funktioniert nicht + $login= "1"; + ldap_close($ds); +#echo "hsnet: Bind funktioniert nicht: $anzahl
          "; + } + + } + + + + ################################ + ## Prüfe OURechenzentrum ob Treffer, wenn studnet nicht funktioniert + ################################ + if($login == "1" and $anzahl == 0){ + + $ds=@ldap_connect("141.10.128.30", "389"); + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + + # bind wird benötigt, sonst werden die Umlaute bei Namen nicht richtig angezeigt ?!!? + $r=@ldap_bind($ds, $row_ldapuser['wert1'], $row_ldapuser['wert2']); + $_ldap_dn = "ou=OURechenzentrum,dc=hsnet,dc=hs-ludwigsburg,dc=de"; + $sr=@ldap_search($ds, $_ldap_dn, "samaccountname=$username"); + $info = @ldap_get_entries($ds, $sr); + $anzahl = @ldap_count_entries($ds,$sr); + $vorname = $info[0]['givenname'][0]; + $nachname = $info[0]['sn'][0]; + $mail = $info[0]['mail'][0]; + $first = @ldap_first_entry($ds,$sr); + $distinguishedName = @ldap_get_dn($ds,$first); + ################################ + + # Bind geht im hsnet nur über den DN "CN=Schwarz\, Alexander, OU=Externe Benutzer, ou=OUHochschulnetzwerk,dc=hsnet,dc=hs-ludwigsburg,dc=de" + ##!!!!! IM STUDNET MIT DEM USERNAMEN BINDEN, IM HSNET MIT DEM DISTINGUISHEDNAME !!!!!!################# + if ($bind = @ldap_bind($ds, $distinguishedName, $password) AND $anzahl > 0){ +#echo "RZ: Bind funktioniert: $anzahl
          "; + $login = "0"; + $login_ad = "hsnet"; + }else{ + # Bind funktioniert nicht +#echo "RZ: Bind funktioniert nicht: $anzahl
          "; + $login= "1"; + ldap_close($ds); + } + } + +/* + echo "
          + distinguishedName = $distinguishedName
          + anzahl_hs $anzahl
          + Username $username, $vorname, $nachname, $mail
          + account: $username, $password
          + login $login
          + exit; +*/ + + # Prüfen, ob der Benutzer ein Passwort in der Datenbank hat + $db = dbconnect(); + $result = $db->query("SELECT imtuid, uid, passwort FROM imt_user WHERE lower(uid)='$username'"); + $row = $result->fetch_array(); + + if($row['passwort'] != '' and $anzahl ==0 and $login==1){ + if(md5($password) == $row['passwort']){ + $login= "0"; + $anzahl = 1; + }else{ + $login= "1"; + $anzahl= "0"; + } + } +# echo "$row[uid] -> $row[passwort]"; +# exit; + + // Wenn expiredate überschritten, dann 1 + #$result2 = $db->query("SELECT 1 + # FROM imt_user + # WHERE pw_expire < now() + # AND uid = '$row[user]' + # "); + #$row2 = $result2->fetch_array(); + + + + + # Wenn es den Benutzer nicht gibt, wird bei LDAP automatisch registriert + #if ($username != strtoupper($row[uid])) { + # echo ""; + #} +#echo" +#


          +#login -> $login
          +#anzahl -> $anzahl
          +#"; +#exit; + // Passwort falsch + if ($login == "1"){ //Ging in studnet und hsnet der Login schief + # Cookies werden bereits gesetzt, falls sich jemand ein passwort zusenden lässt. + #$_SESSION["global_uid"] = $row[imtuid]; + #$_SESSION["global_username"] = $row[uid]; + ## => Bei LDAP nicht möglich! Nur Fehler ausgeben + echo ""; + } + + if ($login == "0" AND $anzahl > 0){ +# echo "geht -> weiter"; +# exit; + ## Login hat entweder im studnet oder im hsnet funktioniert. + ## Prüfen, ob es den Benutzer bereits gibt, sonst Registrierung durchführen + + $db = dbconnect(); + $resultanz = $db->query("SELECT count(*) Anz FROM imt_user WHERE lower(uid)='$username'"); + $rowanz = $resultanz->fetch_array(); + + if($rowanz['Anz'] > 0){ + # Benutzer ist bereits registriert + $db = dbconnect(); + $datum=date("Y-m-d H:i:s"); + $ip=getenv("REMOTE_ADDR"); + $agent=getenv("HTTP_USER_AGENT"); + $user_admin = $row['imtuid']; + $_SESSION["global_uid"] = $user_admin; + $_SESSION["global_username"] = $row['uid']; + $result_1 = $db->query("INSERT INTO imt_userlog (Datum, IP, user_agent, imtuid) VALUES ('$datum', '$ip', '$agent', '$user_admin')"); + $sql = $db->query ("UPDATE imt_user SET mail_inaktiv='0000-00-00 00:00:00' WHERE imtuid='$user_admin'"); + $smarty->assign('index_login', "1"); + }else{ +# echo "geht -> Register"; +# exit; + ## Registrierung durchführen + $_SESSION["register_vorname"] = "$vorname"; + $_SESSION["register_nachname"] = "$nachname"; + $_SESSION["register_mail"] = "$mail"; + + + + #$smarty->assign('register_ad', "$login_ad"); + + $_SESSION["register_ad"] = "$login_ad"; + if($login_ad == "studnet"){ + $_SESSION["register_ag"] = "$row_jg[ag]"; + $_SESSION["register_jahrgang"] = "$row_jg[jahrgang]"; + } + echo ""; + + + + + } + } + mysqli_close($db); + + } + +} +if($action == 'register'){ + + if(isset($_GET[error])){ + + $errorno = $_GET['error']; + $smarty->assign('index_error', 1); + + if($errorno == 4){ + # Daten aufbereiten bei Fehler Beziehung zur Hochschule hsnet + if(isset($_SESSION["register_fakultaet"])){ + $smarty->assign('register_fakultaet', $_SESSION["register_fakultaet"]); + } + $smarty->assign('register_error_text', "Es muss das Feld Beziehung zur Hochschule ausgefüllt werden."); + } + + if($errorno == 5){ + # Daten aufbereiten bei Fehler AG studnet + if(isset($_SESSION["register_jahrgang"])){ + $smarty->assign('register_jahrgang', $_SESSION["register_jahrgang"]); + } + $smarty->assign('register_error_text', "Es muss das Feld AG ausgefüllt werden."); + } + + if($errorno == 6){ + # Daten aufbereiten bei Fehler Jahrgang hsnet + if(isset($_SESSION["register_ag"])){ + $smarty->assign('register_ag', $_SESSION["register_ag"]); + } + $smarty->assign('register_error_text', "Es muss das Feld Jahrgang ausgefüllt werden."); + } + + + } + $db = dbconnect(); + $smarty->assign('register_ag', $_SESSION["register_ag"]); + $smarty->assign('register_adir', $_SESSION["register_ad"]); + + $query = "SELECT distinct jahrgang + FROM kurs.stud + WHERE jahrgang <= substr(date_format(now(), '%Y'),3,2) + ORDER BY jahrgang desc + LIMIT 4"; + $result = $db->query ($query) + or die ("Cannot execute query1"); + + $table_data = array(); + + while ($row = $result->fetch_array()){ + if($row['jahrgang'] == $_SESSION["register_jahrgang"]){ + $select = 1; + }else{ + $select = 0; + } + + array_push($table_data, array( + 'select' => $select, + 'jahrgang' => $row['jahrgang'] + ) + ); + } + + $smarty->assign('table_data', $table_data); +} + +if($action == 'register2'){ + $art = $_GET['art']; + + $username = $_SESSION["global_username"]; + $vorname = $_SESSION["register_vorname"]; + $nachname = $_SESSION["register_nachname"]; + $mail = $_SESSION["register_mail"]; + + if($art == 'hsnet'){ + $register_beziehung = $_POST['register_beziehung']; + + if ($register_beziehung == ""){ //Fehler, falls Pflichtfeld Beziehung zur Hochschule nicht gefüllt wurde + echo ""; + $_SESSION["register_fakultaet"] = $_POST['register_fakultaet']; + exit; + } + + $register_fakultaet = $_POST['register_fakultaet']; + $db = dbconnect(); + $datum=date("Y-m-d H:i:s"); + $result_1 = $db->query("INSERT INTO imt_user (vorname, nachname, mail, beziehung, fakultaet, uid, aktiv, erstell_dat) + VALUES ('$vorname', '$nachname', '$mail', '$register_beziehung', '$register_fakultaet', '$username', 1, '$datum')"); + + } + + if($art == 'studnet'){ + $ag = $_POST['ag']; + $jahrgang = $_POST['jahrgang']; + + if ($ag == ""){ //Fehler, falls Pflichtfeld Beziehung zur Hochschule nicht gefüllt wurde + echo ""; + $_SESSION["register_jahrgang"] = $jahrgang; + exit; + } + + if ($jahrgang == ""){ //Fehler, falls Pflichtfeld Beziehung zur Hochschule nicht gefüllt wurde + echo ""; + $_SESSION["register_ag"] = $ag; + exit; + } + + $db = dbconnect(); + $datum=date("Y-m-d H:i:s"); + $result_1 = $db->query("INSERT INTO imt_user (vorname, nachname, mail, beziehung, ag, jahrgang, uid, aktiv, erstell_dat) + VALUES ('$vorname', '$nachname', '$mail', 'S', '$ag', '$jahrgang', '$username', 1, '$datum')"); + } + + $db = dbconnect(); + $result_jg = $db->query("SELECT ag, jahrgang FROM kurs.stud WHERE lower(uid)='$username'"); + $row_jg = $result_jg->fetch_array(); + + $result = $db->query("SELECT imtuid FROM imt_user WHERE lower(uid)='$username'"); + $row = $result->fetch_array(); + + $datum=date("Y-m-d H:i:s"); + $ip=getenv("REMOTE_ADDR"); + $agent=getenv("HTTP_USER_AGENT"); + $user_admin = $row['imtuid']; + $_SESSION["global_uid"] = $user_admin; + $_SESSION["global_username"] = $row['uid']; + $result_1 = $db->query("INSERT INTO imt_userlog (Datum, IP, user_agent, imtuid) VALUES ('$datum', '$ip', '$agent', '$user_admin')"); + $sql = $db->query ("UPDATE imt_user SET mail_inaktiv='0000-00-00 00:00:00' WHERE imtuid='$user_admin'"); + $smarty->assign('index_login', "1"); +} + +$smarty->assign('action', "$action"); +$smarty->display("$template/$templatename"); +?> diff --git a/index_ad.php b/index_ad.php new file mode 100755 index 0000000..63a393b --- /dev/null +++ b/index_ad.php @@ -0,0 +1,279 @@ +assign('index_error', $_GET[error]); + + # Daten aufbereiten bei Fehler + if(isset($_SESSION["global_domain"])){ + $smarty->assign('index_domain', $_SESSION["global_domain"]); + }else{ + # defaultwert festlegen + $smarty->assign('index_domain', "hsnet"); + } + + if(isset($_SESSION["global_username"])){ + $smarty->assign('index_user', $_SESSION["global_username"]); + } + + + +} + +if($action == 'anmeld'){ + $username=strtoupper($_POST["user"]); //remove case sensitivity on the username + $password=$_POST["password"]; + $domain=$_POST["domain"]; + + if($_POST["domain"] != ""){ + $_SESSION["global_domain"]=$domain; + } + + if($_POST["user"] != ""){ + $_SESSION["global_username"]=$username; + } + + if($username == "" OR $password == ""){ + echo ""; + }else{ + + # muss gesetzte werden nachdem die Session global_domain definiert wurde + require_once("class_idee.php"); + + + + try { + $idee = new idee(); + } + catch (adLDAPException $e) { + echo $e; exit(); + } + + //authenticate the user + #$adldap -> set_domain_controllers(array("$ipdc")); + if ($idee -> authenticate($username,$password)){ + //establish your session and redirect + + $db = dbconnect(); + + + $objectsid = $idee -> username2osid($_SESSION["global_username"]); + + $result_imt = $db->query("SELECT uid FROM imt_user WHERE objectsid='$objectsid' AND accountname=upper('$_SESSION[global_username]') LIMIT 1"); + $row_imt = $result_imt->fetch_array(); + + if($row_imt[uid] == ""){ + $result_1 = $db->query("INSERT INTO imt_user (objectsid, accountname) VALUES ('$objectsid', '$_SESSION[global_username]')"); + $uid = $db->insert_id; + }else{ + $uid = $row_imt[uid]; + } + $_SESSION["global_uid"] = $uid; + + $datum=date("Y-m-d H:i:s"); + $ip=getenv("REMOTE_ADDR"); + $agent=getenv("HTTP_USER_AGENT"); + $user= $row[dtuid]; + $_SESSION["user"] = $row[dtuid]; + $result_1 = $db->query("INSERT INTO imt_userlog (Datum, IP, user_agent, uid) VALUES ('$datum', '$ip', '$agent', '$_SESSION[global_uid]')"); + + $redir="Location: indexframe.php"; + header($redir); + }else{ + echo ""; + } + + } + + + + /* + + $db = dbconnect(); + $result = $db->query("SELECT dtuid, uid, passwort FROM dt_user WHERE inaktiv != 'J' AND UPPER(uid)=UPPER('$_POST[user]')"); + $row = $result->fetch_array(); + + + // Anzahl der IPs im Monat + $result1 = $db->query("SELECT count(distinct left( ip, locate( '.', ip, 5 ) -1 )) ips_monat + FROM dt_userlog + WHERE dtuid ='$row[dtuid]' + AND DATE_SUB(NOW(), INTERVAL 1 MONTH) < Datum + "); + $row1 = $result1->fetch_array(); + + + // Wenn expiredate überschritten, dann 1 + $result2 = $db->query("SELECT 1 + FROM dt_user + WHERE pw_expire < now() + AND dtuid = '$row[dtuid]' + "); + $row2 = $result2->fetch_array(); + + + + // Leere Textfelder + if (empty($_POST['user']) or empty($_POST['passwort'])){ + $smarty->assign('index_noinput', "1"); + } + // Benutzer nicht im System + elseif (strtoupper($_POST['user']) != strtoupper($row[uid])) { + $smarty->assign('index_nouser', "1"); + } + // Passwort falsch + elseif (md5($_POST['passwort']) != $row[passwort]){ //verschlüsseltes Passwort überprüfen + # Session-Cookies werden bereits gesetzt, falls sich jemand ein passwort zusenden lässt. + $_SESSION["user"] = $row[dtuid]; + $smarty->assign('index_passwrong', "1"); + } + // Passwortwechsel notwendig + elseif(($row1[ips_monat] > 2 AND $row2[0] == 1) OR $row[uid] == $_POST['passwort']){ //Wenn mehr als 2 unterschiedliche Provider innerhalb eines Monats und Maximaldauer des Passworts abgelaufen, dann ändern + $db = dbconnect(); + $datum=date("Y-m-d H:i:s"); + $ip=getenv("REMOTE_ADDR"); + $agent=getenv("HTTP_USER_AGENT"); + $user= $row[dtuid]; + $_SESSION["user"] = $row[dtuid]; + + $result_dt = $db->query("SELECT dtid FROM dt_user_tankstelle WHERE dtuid='$user' LIMIT 1"); + $row_dt = $result_dt->fetch_array(); + $_SESSION["dtid"] = $row_dt[dtid]; + + $result_1 = $db->query("INSERT INTO dt_userlog (Datum, IP, user_agent, dtuid) VALUES ('$datum', '$ip', '$agent', '$user')"); + $sql = $db->query ("UPDATE dt_user SET mail_inaktiv='0000-00-00 00:00:00' WHERE dtuid='$user'"); + $smarty->assign('index_passswitch', "1"); + }else{ + $db = dbconnect(); + $datum=date("Y-m-d H:i:s"); + $ip=getenv("REMOTE_ADDR"); + $agent=getenv("HTTP_USER_AGENT"); + $user= $row[dtuid]; + $_SESSION["user"] = $row[dtuid]; + + $result_dt = $db->query("SELECT dtid FROM dt_user_tankstelle WHERE dtuid='$user' LIMIT 1"); + $row_dt = $result_dt->fetch_array(); + $_SESSION["dtid"] = $row_dt[dtid]; + + $result_1 = $db->query("INSERT INTO dt_userlog (Datum, IP, user_agent, dtuid) VALUES ('$datum', '$ip', '$agent', '$user')"); + $sql = $db->query ("UPDATE dt_user SET mail_inaktiv='0000-00-00 00:00:00' WHERE dtuid='$user'"); $smarty->assign('index_login', "1"); + } + mysqli_close($db); + */ +} + + +if($action == 'pass_gen'){ + + $dtuid = $_SESSION["user"]; + + $pool = "qwertzupasdfghkyxcvbnm"; + $pool .= "23456789"; + $pool .= "WERTZUPLKJHGFDSAYXCVBNM"; + + srand ((double)microtime()*1000000); + for($index = 0; $index < 7; $index++) + { + $pass_word .= substr($pool,(rand()%(strlen ($pool))), 1); + } + + $new_pw_md5=md5($pass_word); + + $db = dbconnect(); + $result = $db->query("SELECT distinct DATE_ADD(NOW(), INTERVAL 1 MONTH) exp_date + FROM dt_user + WHERE dtuid ='$dtuid' + "); + $row = $result->fetch_array(); + + $sql = $db->query ("UPDATE dt_user SET passwort='$new_pw_md5', pw_expire='$row[exp_date]' WHERE dtuid='$dtuid'"); + + $result2 = $db->query("SELECT uid, vorname, nachname, mail FROM dt_user WHERE dtuid='$dtuid'"); + $row2 = $result2->fetch_array(); + + $empfaenger = "$row2[mail]"; + $betreff = "RefillDB: Passwort zurückgesetzt"; + $text = " + + + Passwort zurückgesetzt + + + + Guten Tag $row2[vorname] $row2[nachname]!

          + Sie haben Ihr Passwort innerhalb der RefillDB zurückgesetzt!
          + Nachfolgend finden Sie Ihre neuen Zugangsdaten: +
          +
          + + + + + + + + + +
          + + Benutzerkennung: + + + + $row2[uid] + +
          + + Passwort: + + + + $pass_word + +
          +
          + Bitte beachten Sie, dass zwischen Groß- und
          + Kleinschreibung unterschieden wird. +

          + Link zu Leitgedanken-Online: RefillDB +

          + Diese Mail wurde automatisch generiert!
          + Antworten Sie daher nicht auf diese Mail.
          +
          + Vielen Dank! + + "; + + + $headers = "MIME-Version: 1.0\n"; + $headers .= "Content-type: text/html; charset=utf-8\n"; + $headers .= "From: RefillDB <$row2[mail]>\n"; + + $return = @mail($empfaenger, $betreff, $text, $headers); + + if($return){ + $smarty->assign('index_mailpass', "1"); + $mailadresse = $row2[mail]; + $smarty->assign('index_mailadr', "$mailadresse"); + }else{ + $smarty->assign('index_nomailpass', "1"); + } +} + + +$smarty->assign('action', "$action"); + + +$smarty->display("$template/$templatename"); +?> \ No newline at end of file diff --git a/index_db.php b/index_db.php new file mode 100755 index 0000000..b741a24 --- /dev/null +++ b/index_db.php @@ -0,0 +1,101 @@ +assign('index_error', 1); + + if($errorno == 1){ + $smarty->assign('index_error_text', "Es müssen alle Felder ausgefüllt werden"); + } + + if($errorno == 2){ + $smarty->assign('index_error_text', "Ber Benutzername ist im System nicht vorhanden"); + } + + if($errorno == 3){ + $smarty->assign('index_error_text', "Ber Benutzername oder das Passwort ist nicht korrekt
          Sie können hier ein neues Passwort beantragen"); + } + + # Daten aufbereiten bei Fehler + if(isset($_SESSION["global_username"])){ + $smarty->assign('index_user', $_SESSION["global_username"]); + } + } + + +} + +if($action == 'anmeld'){ + $username=strtoupper($_POST["user"]); //remove case sensitivity on the username + $password=$_POST["password"]; + + if($_POST["user"] != ""){ + $_SESSION["global_username"]=$username; + } + + if($username == "" OR $password == ""){ + echo ""; + }else{ + + + $db = dbconnect(); + $result = $db->query("SELECT imtuid, uid, passwort FROM imt_user WHERE aktiv = '1' AND UPPER(uid)='$username'"); + $row = $result->fetch_array(); + + + // Wenn expiredate überschritten, dann 1 + $result2 = $db->query("SELECT 1 + FROM imt_user + WHERE pw_expire < now() + AND uid = '$row[user]' + "); + $row2 = $result2->fetch_array(); + + + + + if ($username != strtoupper($row[uid])) { + echo ""; + } + // Passwort falsch + elseif (md5($password) != $row[passwort]){ //verschlüsseltes Passwort überprüfen + # Cookies werden bereits gesetzt, falls sich jemand ein passwort zusenden lässt. + $_SESSION["global_uid"] = $row[imtuid]; + $_SESSION["global_username"] = $row[uid]; + echo ""; + }else{ + $db = dbconnect(); + $datum=date("Y-m-d H:i:s"); + $ip=getenv("REMOTE_ADDR"); + $agent=getenv("HTTP_USER_AGENT"); + $user_admin = $row[imtuid]; + $_SESSION["global_uid"] = $user_admin; + $_SESSION["global_username"] = $row[uid]; + $result_1 = $db->query("INSERT INTO imt_userlog (Datum, IP, user_agent, imtuid) VALUES ('$datum', '$ip', '$agent', '$user_admin')"); + $sql = $db->query ("UPDATE imt_user SET mail_inaktiv='0000-00-00 00:00:00' WHERE imtuid='$user_admin'"); + $smarty->assign('index_login', "1"); + } + mysqli_close(); + + } + +} + +$smarty->assign('action', "$action"); +$smarty->display("$template/$templatename"); +?> \ No newline at end of file diff --git a/index_ldap.php b/index_ldap.php new file mode 100755 index 0000000..972201b --- /dev/null +++ b/index_ldap.php @@ -0,0 +1,400 @@ +assign('index_error', 1); + + if($errorno == 1){ + $smarty->assign('index_error_text', "Es müssen alle Felder ausgefüllt werden"); + } + + # Bei LDAP wird eine Registrierung automatisch durchgeführt + #if($errorno == 2){ + # $smarty->assign('index_error_text', "Ber Benutzername ist im System nicht vorhanden"); + #} + + if($errorno == 3){ + $smarty->assign('index_error_text', "Ber Benutzername oder das Passwort ist nicht korrekt
          Stellen Sie sicher, dass Ihr Benutzerkonto in der Hochschule aktiv ist."); + } + + # Daten aufbereiten bei Fehler + if(isset($_SESSION["global_username"])){ + $smarty->assign('index_user', $_SESSION["global_username"]); + } + } + + +} + +if($action == 'anmeld'){ + $username=strtolower($_POST["user"]); //remove case sensitivity on the username + $password=$_POST["password"]; + + if($_POST["user"] != ""){ + $_SESSION["global_username"]=$username; + } + if($username == "" OR $password == ""){ + echo ""; + }else{ + + $db = dbconnect(); + $query_ldapuser = $db->query("SELECT wert1, wert2 FROM imt_parameter WHERE pid='2'"); + $row_ldapuser = $query_ldapuser->fetch_array(); + + + + ################################ + ## Prüfe studnet ob Treffer + ################################ + # bind wird benötigt, sonst werden die Umlaute bei Namen nicht richtig angezeigt ?!!? + + $ds=@ldap_connect("141.10.144.37", "389"); + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + + $r=@ldap_bind($ds, $row_ldapuser['wert1'], $row_ldapuser['wert2']); + $_ldap_dn = "ou=ouStudnet,dc=studnet,dc=hs-ludwigsburg,dc=de"; + $sr=@ldap_search($ds, $_ldap_dn, "samaccountname=$username"); + $info = @ldap_get_entries($ds, $sr); + $anzahl = ldap_count_entries($ds,$sr); + $vorname = $info[0]['givenname'][0]; + $nachname = $info[0]['sn'][0]; + $mail = $info[0]['mail'][0]; + $first = ldap_first_entry($ds,$sr); + $distinguishedName = ldap_get_dn($ds,$first); + $result_jg = $db->query("SELECT ag, jahrgang FROM kurs.stud WHERE lower(uid)='$username'"); + $row_jg = $result_jg->fetch_array(); + ################################ + + + ### Wenn binden fehlschlägt, also Passwort falsch + ##!!!!! IM STUDNET MIT DEM USERNAMEN BINDEN, IM HSNET MIT DEM DISTINGUISHEDNAME !!!!!!################# + #if ($bind = @ldap_bind($ds, $username, $password) AND $anzahl > 0){ + if ($bind = ldap_bind($ds, $distinguishedName, $password) AND $anzahl > 0){ + # Bind funktioniert +#echo "studnet: Bind funktioniert: $anzahl
          "; + $login = "0"; + $login_ad = "studnet"; + }else{ + # Bind funktioniert nicht +#echo "studnet: Bind funktioniert nicht: $anzahl
          "; + $login = "1"; + ldap_close($ds); + } +#exit; + + ######## + # INFO hsnet: Würde man nur $_ldap_dn = "dc=hsnet,dc=hs-ludwigsburg,dc=de"; angeben ohne OU=OUHochschunetzwerk oä., würde php beim search nichts mehr finden und alle Passwörter akzeptieren + ######## + + + ################################ + ## Prüfe OUHochschulnetzwerk ob Treffer, wenn studnet nicht funktioniert + ################################ + if($login == "1" and $anzahl == "0"){ + + $ds=@ldap_connect("141.10.128.30", "389"); + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + + # bind wird benötigt, sonst werden die Umlaute bei Namen nicht richtig angezeigt ?!!? + $r=@ldap_bind($ds, $row_ldapuser['wert1'], $row_ldapuser['wert2']); + $_ldap_dn = "ou=OUHochschulnetzwerk,dc=hsnet,dc=hs-ludwigsburg,dc=de"; + $sr=@ldap_search($ds, $_ldap_dn, "samaccountname=$username"); + $info = @ldap_get_entries($ds, $sr); + $anzahl = ldap_count_entries($ds,$sr); + $vorname = $info[0]['givenname'][0]; + $nachname = $info[0]['sn'][0]; + $mail = $info[0]['mail'][0]; + $first = ldap_first_entry($ds,$sr); + $distinguishedName = ldap_get_dn($ds,$first); + ################################ + + # Bind geht im hsnet nur über den DN "CN=Schwarz\, Alexander, OU=Externe Benutzer, ou=OUHochschulnetzwerk,dc=hsnet,dc=hs-ludwigsburg,dc=de" + ##!!!!! IM STUDNET MIT DEM USERNAMEN BINDEN, IM HSNET MIT DEM DISTINGUISHEDNAME !!!!!!################# + if ($bind = ldap_bind($ds, $distinguishedName, $password) AND $anzahl > 0){ +#echo "hsnet: Bind funktioniert: $anzahl |$distinguishedName|
          "; + $login = "0"; + $login_ad = "hsnet"; + }else{ + # Bind funktioniert nicht + $login= "1"; + ldap_close($ds); +#echo "hsnet: Bind funktioniert nicht: $anzahl
          "; + } + + } + + + + ################################ + ## Prüfe OURechenzentrum ob Treffer, wenn studnet nicht funktioniert + ################################ + if($login == "1" and $anzahl == 0){ + + $ds=@ldap_connect("141.10.128.30", "389"); + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + + # bind wird benötigt, sonst werden die Umlaute bei Namen nicht richtig angezeigt ?!!? + $r=@ldap_bind($ds, $row_ldapuser['wert1'], $row_ldapuser['wert2']); + $_ldap_dn = "ou=OURechenzentrum,dc=hsnet,dc=hs-ludwigsburg,dc=de"; + $sr=@ldap_search($ds, $_ldap_dn, "samaccountname=$username"); + $info = @ldap_get_entries($ds, $sr); + $anzahl = ldap_count_entries($ds,$sr); + $vorname = $info[0]['givenname'][0]; + $nachname = $info[0]['sn'][0]; + $mail = $info[0]['mail'][0]; + $first = ldap_first_entry($ds,$sr); + $distinguishedName = ldap_get_dn($ds,$first); + ################################ + + # Bind geht im hsnet nur über den DN "CN=Schwarz\, Alexander, OU=Externe Benutzer, ou=OUHochschulnetzwerk,dc=hsnet,dc=hs-ludwigsburg,dc=de" + ##!!!!! IM STUDNET MIT DEM USERNAMEN BINDEN, IM HSNET MIT DEM DISTINGUISHEDNAME !!!!!!################# + if ($bind = ldap_bind($ds, $distinguishedName, $password) AND $anzahl > 0){ +#echo "RZ: Bind funktioniert: $anzahl
          "; + $login = "0"; + $login_ad = "hsnet"; + }else{ + # Bind funktioniert nicht +#echo "RZ: Bind funktioniert nicht: $anzahl
          "; + $login= "1"; + ldap_close($ds); + } + } + +/* + echo "
          + distinguishedName = $distinguishedName
          + anzahl_hs $anzahl
          + Username $username, $vorname, $nachname, $mail
          + account: $username, $password
          + login $login
          + exit; +*/ + $db = dbconnect(); + $result = $db->query("SELECT imtuid, uid, passwort FROM imt_user WHERE lower(uid)='$username'"); + $row = $result->fetch_array(); + + + // Wenn expiredate überschritten, dann 1 + #$result2 = $db->query("SELECT 1 + # FROM imt_user + # WHERE pw_expire < now() + # AND uid = '$row[user]' + # "); + #$row2 = $result2->fetch_array(); + + + + + # Wenn es den Benutzer nicht gibt, wird bei LDAP automatisch registriert + #if ($username != strtoupper($row[uid])) { + # echo ""; + #} + + // Passwort falsch + if ($login == "1"){ //Ging in studnet und hsnet der Login schief + # Cookies werden bereits gesetzt, falls sich jemand ein passwort zusenden lässt. + #$_SESSION["global_uid"] = $row[imtuid]; + #$_SESSION["global_username"] = $row[uid]; + ## => Bei LDAP nicht möglich! Nur Fehler ausgeben + echo ""; + } + + if ($login == "0" AND $anzahl > 0){ +# echo "geht -> weiter"; +# exit; + ## Login hat entweder im studnet oder im hsnet funktioniert. + ## Prüfen, ob es den Benutzer bereits gibt, sonst Registrierung durchführen + + $db = dbconnect(); + $resultanz = $db->query("SELECT count(*) Anz FROM imt_user WHERE lower(uid)='$username'"); + $rowanz = $resultanz->fetch_array(); + + if($rowanz['Anz'] > 0){ + # Benutzer ist bereits registriert + $db = dbconnect(); + $datum=date("Y-m-d H:i:s"); + $ip=getenv("REMOTE_ADDR"); + $agent=getenv("HTTP_USER_AGENT"); + $user_admin = $row['imtuid']; + $_SESSION["global_uid"] = $user_admin; + $_SESSION["global_username"] = $row['uid']; + $result_1 = $db->query("INSERT INTO imt_userlog (Datum, IP, user_agent, imtuid) VALUES ('$datum', '$ip', '$agent', '$user_admin')"); + $sql = $db->query ("UPDATE imt_user SET mail_inaktiv='0000-00-00 00:00:00' WHERE imtuid='$user_admin'"); + $smarty->assign('index_login', "1"); + }else{ +# echo "geht -> Register"; +# exit; + ## Registrierung durchführen + $_SESSION["register_vorname"] = "$vorname"; + $_SESSION["register_nachname"] = "$nachname"; + $_SESSION["register_mail"] = "$mail"; + + + + #$smarty->assign('register_ad', "$login_ad"); + + $_SESSION["register_ad"] = "$login_ad"; + if($login_ad == "studnet"){ + $_SESSION["register_ag"] = "$row_jg[ag]"; + $_SESSION["register_jahrgang"] = "$row_jg[jahrgang]"; + } + echo ""; + + + + + } + } + mysqli_close($db); + + } + +} +if($action == 'register'){ + + if(isset($_GET[error])){ + + $errorno = $_GET['error']; + $smarty->assign('index_error', 1); + + if($errorno == 4){ + # Daten aufbereiten bei Fehler Beziehung zur Hochschule hsnet + if(isset($_SESSION["register_fakultaet"])){ + $smarty->assign('register_fakultaet', $_SESSION["register_fakultaet"]); + } + $smarty->assign('register_error_text', "Es muss das Feld Beziehung zur Hochschule ausgefüllt werden."); + } + + if($errorno == 5){ + # Daten aufbereiten bei Fehler AG studnet + if(isset($_SESSION["register_jahrgang"])){ + $smarty->assign('register_jahrgang', $_SESSION["register_jahrgang"]); + } + $smarty->assign('register_error_text', "Es muss das Feld AG ausgefüllt werden."); + } + + if($errorno == 6){ + # Daten aufbereiten bei Fehler Jahrgang hsnet + if(isset($_SESSION["register_ag"])){ + $smarty->assign('register_ag', $_SESSION["register_ag"]); + } + $smarty->assign('register_error_text', "Es muss das Feld Jahrgang ausgefüllt werden."); + } + + + } + $db = dbconnect(); + $smarty->assign('register_ag', $_SESSION["register_ag"]); + $smarty->assign('register_adir', $_SESSION["register_ad"]); + + $query = "SELECT distinct jahrgang + FROM kurs.stud + WHERE jahrgang <= substr(date_format(now(), '%Y'),3,2) + ORDER BY jahrgang desc + LIMIT 4"; + $result = $db->query ($query) + or die ("Cannot execute query1"); + + $table_data = array(); + + while ($row = $result->fetch_array()){ + if($row['jahrgang'] == $_SESSION["register_jahrgang"]){ + $select = 1; + }else{ + $select = 0; + } + + array_push($table_data, array( + 'select' => $select, + 'jahrgang' => $row['jahrgang'] + ) + ); + } + + $smarty->assign('table_data', $table_data); +} + +if($action == 'register2'){ + $art = $_GET['art']; + + $username = $_SESSION["global_username"]; + $vorname = $_SESSION["register_vorname"]; + $nachname = $_SESSION["register_nachname"]; + $mail = $_SESSION["register_mail"]; + + if($art == 'hsnet'){ + $register_beziehung = $_POST['register_beziehung']; + + if ($register_beziehung == ""){ //Fehler, falls Pflichtfeld Beziehung zur Hochschule nicht gefüllt wurde + echo ""; + $_SESSION["register_fakultaet"] = $_POST['register_fakultaet']; + exit; + } + + $register_fakultaet = $_POST['register_fakultaet']; + $db = dbconnect(); + $datum=date("Y-m-d H:i:s"); + $result_1 = $db->query("INSERT INTO imt_user (vorname, nachname, mail, beziehung, fakultaet, uid, aktiv, erstell_dat) + VALUES ('$vorname', '$nachname', '$mail', '$register_beziehung', '$register_fakultaet', '$username', 1, '$datum')"); + + } + + if($art == 'studnet'){ + $ag = $_POST['ag']; + $jahrgang = $_POST['jahrgang']; + + if ($ag == ""){ //Fehler, falls Pflichtfeld Beziehung zur Hochschule nicht gefüllt wurde + echo ""; + $_SESSION["register_jahrgang"] = $jahrgang; + exit; + } + + if ($jahrgang == ""){ //Fehler, falls Pflichtfeld Beziehung zur Hochschule nicht gefüllt wurde + echo ""; + $_SESSION["register_ag"] = $ag; + exit; + } + + $db = dbconnect(); + $datum=date("Y-m-d H:i:s"); + $result_1 = $db->query("INSERT INTO imt_user (vorname, nachname, mail, beziehung, ag, jahrgang, uid, aktiv, erstell_dat) + VALUES ('$vorname', '$nachname', '$mail', 'S', '$ag', '$jahrgang', '$username', 1, '$datum')"); + } + + $db = dbconnect(); + $result_jg = $db->query("SELECT ag, jahrgang FROM kurs.stud WHERE lower(uid)='$username'"); + $row_jg = $result_jg->fetch_array(); + + $result = $db->query("SELECT imtuid FROM imt_user WHERE lower(uid)='$username'"); + $row = $result->fetch_array(); + + $datum=date("Y-m-d H:i:s"); + $ip=getenv("REMOTE_ADDR"); + $agent=getenv("HTTP_USER_AGENT"); + $user_admin = $row['imtuid']; + $_SESSION["global_uid"] = $user_admin; + $_SESSION["global_username"] = $row['uid']; + $result_1 = $db->query("INSERT INTO imt_userlog (Datum, IP, user_agent, imtuid) VALUES ('$datum', '$ip', '$agent', '$user_admin')"); + $sql = $db->query ("UPDATE imt_user SET mail_inaktiv='0000-00-00 00:00:00' WHERE imtuid='$user_admin'"); + $smarty->assign('index_login', "1"); +} + +$smarty->assign('action', "$action"); +$smarty->display("$template/$templatename"); +?> diff --git a/indexframe.php b/indexframe.php new file mode 100755 index 0000000..b9242e9 --- /dev/null +++ b/indexframe.php @@ -0,0 +1,10 @@ +display("$template/$templatename"); +?> \ No newline at end of file diff --git a/info_entscheid.php b/info_entscheid.php new file mode 100755 index 0000000..70a9bcb --- /dev/null +++ b/info_entscheid.php @@ -0,0 +1,46 @@ +query("SELECT annahme, annahme_bemerkung, praemie, punkte_gesamt, praemie_gutschein, dienstbefreiung, massnahme + FROM imt_vorschlag_ende + WHERE vid='$vid'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username + $row = $query->fetch_array(); + + if($row[annahme] == 'J'){ + $annahme = "Ja"; + }else{ + $annahme = "Nein"; + } + + if($row[praemie] == 'J'){ + $praemie = "Ja"; + }else{ + $praemie = "Nein"; + } + + $smarty->assign('info_entscheid_annahme', $annahme); + $smarty->assign('info_entscheid_annahme_bemerkung', $row[annahme_bemerkung]); + $smarty->assign('info_entscheid_praemie', $praemie); + $smarty->assign('info_entscheid_punkte_gesamt', $row[punkte_gesamt]); + $smarty->assign('info_entscheid_praemie_gutschein', $row[praemie_gutschein]); + $smarty->assign('info_entscheid_dienstbefreiung', $row[dienstbefreiung]); + $smarty->assign('info_entscheid_massnahme', $row[massnahme]); + +} + +$smarty->assign('action', "$action"); +$smarty->display("$template/$templatename"); +?> \ No newline at end of file diff --git a/language/german.inc.php b/language/german.inc.php new file mode 100755 index 0000000..b702d5c --- /dev/null +++ b/language/german.inc.php @@ -0,0 +1 @@ +assign('global_titel', "Ideenmanagement"); $smarty->assign('global_service_admin', "$global_service_admin"); $smarty->assign('global_service_mail', "$global_service_mail"); $smarty->assign('global_template', "$template"); #-------------- Globale Konfiguration beendet,Änderungen ab hier --------------- # hauptframe.html $smarty->assign('hauptframe_text1', "Hallo und herzlich Willkommen zum Ideenmanagement!"); $smarty->assign('hauptframe_text2', "Bitte treffen Sie im Menü Ihre Auswahl"); # hauptframe_eingabe.html $smarty->assign('hauptframe_eingabe_titel', "Eingabebereich"); $smarty->assign('hauptframe_eingabe_text1', "Hallo und Herzlich Willkommen zum Ideenmanagement!"); $smarty->assign('hauptframe_eingabe_text2', "Im Eingabebereich können Sie einen Verbesserungsvorschlag erfassen!"); # hauptframe_admin.html $smarty->assign('hauptframe_admin_titel', "Adminbereich"); $smarty->assign('hauptframe_admin_text1', "Hallo und Herzlich Willkommen zum Ideenmanagement!"); $smarty->assign('hauptframe_admin_text2', "Im Adminbereich können Sie Verbesserungsvorschläge bearbeiten!"); # hauptframe_ausschuss.html $smarty->assign('hauptframe_ausschuss_titel', "Ausschussbereich"); $smarty->assign('hauptframe_ausschuss_text1', "Hallo und Herzlich Willkommen zum Ideenmanagement!"); $smarty->assign('hauptframe_ausschuss_text2', "Im Ausschussbereich können Sie über Gutachterbenennungen entscheiden!"); # hauptframe_beteiligte.html $smarty->assign('hauptframe_beteiligte_titel', "Beteiligtenbereich"); $smarty->assign('hauptframe_beteiligte_text1', "Hallo und Herzlich Willkommen zum Ideenmanagement!"); $smarty->assign('hauptframe_beteiligte_text2', "Im Beteiligtenbereich können Sie eine Stellungnahme über Verbesserungsvorschläge abgeben!"); # hauptframe_gutachter.html $smarty->assign('hauptframe_gutachter_titel', "Gutachterbereich"); $smarty->assign('hauptframe_gutachter_text1', "Hallo und Herzlich Willkommen zum Ideenmanagement!"); $smarty->assign('hauptframe_gutachter_text2', "Im Gutachterbereich können Sie eine Stellungnahme über Verbesserungsvorschläge abgeben!"); # erfassen_eingabe.html $smarty->assign('erfassen_eingabe_titel', "Verbesserungsvorschlag erfassen"); $smarty->assign('erfassen_eingabe_mandatory_text', "Es ist zu einem Fehler gekommen. Bitte füllen Sie alle Pflichtfelder aus."); $smarty->assign('erfassen_eingabe_field_ersteller', "Ersteller/Ansprechpartner:"); $smarty->assign('erfassen_eingabe_field_mailadresse', "Mailadresse:"); $smarty->assign('erfassen_eingabe_field_gruppe', "Gruppenzugehörigkeit:"); $smarty->assign('erfassen_eingabe_field_gruppenmitglieder', "Weitere Ersteller (bei Gruppenvorschlag):"); $smarty->assign('erfassen_eingabe_field_betreff', "Betreff:"); $smarty->assign('erfassen_eingabe_field_beschreibung', "Situationsbeschreibung:"); $smarty->assign('erfassen_eingabe_field_vorschlag', "Verbesserungsvorschlag und konkreter Umsetzungsplan:"); $smarty->assign('erfassen_eingabe_field_nutzen', "Nutzen des Verbesserungsvorschlages:"); $smarty->assign('erfassen_eingabe_checkbox_public', "Der Verbesserungsvorschlag darf nach Abschluss veröffentlicht werden:"); $smarty->assign('erfassen_eingabe_checkbox_ldsg', "Hinsichtlich Ihrer persönlichen Daten weisen wir gemäß §14 LDSG darauf hin, dass diese nach Maßgabe der anwendbaren Datenschutzbestimmungen verarbeitet werden. Die von Ihnen in diesem Eingabeformular eingegeben persönlichen Daten werden nur zum Zweck des Ideenmanagements vom Qualitätsmanagement-Beauftragten der Hochschule Ludwigsburg für öffentliche Verwaltung und Finanzen verwendet. Ihr Verbesserungsvorschlag wird vor der Weitergabe anonymisiert. Eine Weitergabe der in diesem Kontaktformular übermittelten persönlichen Daten an Dritte findet nur im Rahmen der \"Gemeinsamen Verwaltungsvorschrift der Ministerien über die Auszeichnung von Vorschlägen zur Verbesserung der Landesverwaltung\" statt. Nach § 21 LDSG haben Sie das Recht, bei der Hochschule Auskunft über die zu Ihrer Person gespeicherten Daten zu beantragen und / oder unrichtig gespeicherte Daten berichtigen zu lassen.
          Ich bin mit dieser Verarbeitung der Daten einverstanden:
          (bitte ankreuzen, ansonsten kann keine weitere Bearbeitung stattfinden)"); $smarty->assign('erfassen_eingabe_abgeschlossen_titel', "Erfassen abgeschlossen"); $smarty->assign('erfassen_eingabe_abgeschlossen_text1', "Der Verbesserungsvorschlag wurde eingereicht"); $smarty->assign('erfassen_eingabe_abgeschlossen_text2', "ID des Vorschlages:"); # gruppenmitglieder.html $smarty->assign('gruppenmitglieder_eingabe_titel', "Gruppenmitglieder erfassen"); # logout.html $smarty->assign('logout_titel', "Logout"); $smarty->assign('logout_text', "Der Logout ist abgeschlossen!"); # menu.html $smarty->assign('menu_administrator', "Administration"); $smarty->assign('menu_profil', "Profil"); # index.html $smarty->assign('index_titel', "Login Ideenmanagement"); $smarty->assign('index_field_user', "Benutzerkennung:"); $smarty->assign('index_field_pass', "Passwort:"); $smarty->assign('index_register', "Melden Sie sich bitte mit Ihrer Hochschulkennung und entsprechendem Passwort an!"); # register.html $smarty->assign('register_aktivierung_erfolg_titel', "Aktivierung erfolgreich"); $smarty->assign('register_aktivierung_erfolg_text', "Die Aktivierung war erfolgreich. Sie können sich beim Ideenmanagement einlogen:"); $smarty->assign('register_aktivierung_keinerfolg_titel', "Aktivierung nicht erfolgreich"); $smarty->assign('register_aktivierung_keinerfolg_text', "Die Aktivierung war leider nicht erfolgreich. Setzen Sie sich bitte mit ".$global_service_admin." in Verbindung"); $smarty->assign('register_titel', "Benutzerregistrierung"); $smarty->assign('register_field_vorname', "Vorname:"); $smarty->assign('register_field_nachname', "Nachname:"); $smarty->assign('register_field_mail', "Mail:"); $smarty->assign('register_field_beziehung', "Beziehung zur Hochschule:"); $smarty->assign('register_field_ag', "AG"); $smarty->assign('register_field_jahrgang', "Jahrgang:"); $smarty->assign('register_field_fakultaet', "Fakultät:"); $smarty->assign('register_registrierung_erfolg_titel', "Registrierung erfolgreich"); $smarty->assign('register_registrierung_erfolg_text', "Die Registrierung war erfolgreich. Sie müssen Ihren angelegten Benutzer noch aktivieren.
          Prüfen Sie bitte dazu Ihre Mails bei der angegebenen Mailadresse."); $smarty->assign('register_registrierung_keinerfolg_titel', "Registrierung nicht erfolgreich"); $smarty->assign('register_registrierung_keinerfolg_text', "Die Registrierung war leider nicht erfolgreich. Setzen Sie sich bitte mit ".$global_service_admin." in Verbindung"); # passwort_vergessen.html $smarty->assign('passwort_vergessen_titel', "Zugangsdaten beantragen"); $smarty->assign('passwort_vergessen_text1', "Sie können hier neue Zugangsdaten beantragen. Dazu müssen Sie Ihre Mailadresse eingeben, die im System hinterlegt ist. Sie bekommen dann eine Mail mit weiteren Anweisungen!"); $smarty->assign('passwort_vergessen_field_mail', "Ihre registrierte Mailadresse:"); $smarty->assign('passwort_vergessen_anfordern_titel', "Passwortanforderung"); $smarty->assign('passwort_vergessen_anfordern_text', "Sie erhalten in Kürze eine Mail. Dort finden Sie ein Link, mit dem Sie das Passwort zurücksetzen können.
          Erhalten Sie keine Mail kontrollieren Sie bitte Ihren Spam-Ordner Ihres Mailaccounts."); $smarty->assign('passwort_vergessen_keinanfordern_titel', "Passwortanforderung nicht erfolgreich"); $smarty->assign('passwort_vergessen_keinanfordern_text', "Die Passwortanforderung war leider nicht erfolgreich. Setzen Sie sich bitte mit ".$global_service_admin." in Verbindung"); $smarty->assign('passwort_vergessen_erfolg_titel', "Zugangsdaten zurückgesetzt"); $smarty->assign('passwort_vergessen_erfolg_text', "Ihre Zugangsdaten wurden zurückgesetzt.
          Sie erhalten eine Mail mit den neuen Zugangsdaten"); $smarty->assign('passwort_vergessen_keinerfolg_titel', "Zugangsdaten nicht zurückgesetzt"); $smarty->assign('passwort_vergessen_keinerfolg_text', "Ihre Zugangsdaten wurden nicht zurückgesetzt.
          Setzen Sie sich bitte mit ".$global_service_admin." in Verbindung"); # bearbeiten.html $smarty->assign('bearbeiten_titel', "Verbesserungsvorschlag bearbeiten"); $smarty->assign('bearbeiten_err_titel', "Fehlerhafte ID"); $smarty->assign('bearbeiten_err_text', "Die ID ist im System nicht vorhanden"); # edit.html $smarty->assign('edit_titel', "Verbesserungsvorschlag bearbeiten"); $smarty->assign('edit_field_id', "ID:"); $smarty->assign('edit_field_ersteller', "Ersteller/Ansprechpartner:"); $smarty->assign('edit_field_mailadresse', "Mailadresse:"); $smarty->assign('edit_field_gruppe', "Gruppenzugehörigkeit:"); $smarty->assign('edit_field_gruppenmitglieder', "Weitere Ersteller (bei Gruppenvorschlag):"); $smarty->assign('edit_field_betreff', "Betreff:"); $smarty->assign('edit_field_beschreibung', "Situationsbeschreibung:"); $smarty->assign('edit_field_vorschlag', "Verbesserungsvorschlag und konkreter Umsetzungsplan:"); $smarty->assign('edit_field_nutzen', "Nutzen des Verbesserungsvorschlages:"); $smarty->assign('edit_field_public', "Veröffentlichung nach Abschluss:"); $smarty->assign('edit_field_hinweiseigen', "Hinweis Erfasser:"); $smarty->assign('edit_field_hinweisadmin', "Hinweis Admin:"); $smarty->assign('edit_field_category', "Kategorie:"); $smarty->assign('edit_field_status', "Status:"); $smarty->assign('edit_field_ausschlgrund', "Ausschlussgrund:"); $smarty->assign('edit_field_entschiedengrund', "Schließgrund:"); $smarty->assign('edit_mandatory_text', "Es ist zu einem Fehler gekommen. Bitte füllen Sie alle Pflichtfelder aus."); $smarty->assign('edit_checkbox_public', "Der Verbesserungsvorschlag darf nach Abschluss veröffentlicht werden:"); $smarty->assign('edit_checkbox_ldsg', "Hinsichtlich Ihrer persönlichen Daten weisen wir gemäß §14 LDSG darauf hin, dass diese nach Maßgabe der anwendbaren Datenschutzbestimmungen verarbeitet werden. Die von Ihnen in diesem Eingabeformular eingegeben persönlichen Daten werden nur zum Zweck des Ideenmanagements von der Qualitätsmanagement-Beauftragten der Hochschule Ludwigsburg für öffentliche Verwaltung und Finanzen verwendet. Ihr Verbesserungsvorschlag wird vor der Weitergabe anonymisiert. Eine Weitergabe der in diesem Kontaktformular übermittelten persönlichen Daten an Dritte findet nur im Rahmen der \"Gemeinsamen Verwaltungsvorschrift der Ministerien über die Auszeichnung von Vorschlägen zur Verbesserung der Landesverwaltung\" statt. Nach § 21 LDSG haben Sie das Recht, bei der Hochschule Auskunft über die zu Ihrer Person gespeicherten Daten zu beantragen und / oder unrichtig gespeicherte Daten berichtigen zu lassen.
          Ich bin mit dieser Verarbeitung der Daten einverstanden:
          (bitte ankreuzen, ansonsten kann keine weitere Bearbeitung stattfinden)"); $smarty->assign('edit_field_datum', "Datum"); $smarty->assign('edit_field_status', "Status"); $smarty->assign('edit_abgeschlossen_titel', "Erfassen abgeschlossen"); $smarty->assign('edit_abgeschlossen_text1', "Der Verbesserungsvorschlag wurde eingereicht"); $smarty->assign('edit_abgeschlossen_text2', "ID des Vorschlages:"); $smarty->assign('edit_ablehnen_bttn_text', "Sofortausschluss"); $smarty->assign('edit_ablehnung_field_begruendung', "Begründung der Ablehnung"); $smarty->assign('edit_ablehnung_titel', "Vorschlag abgelehnt"); $smarty->assign('edit_ablehnung_text', "Der Vorschlag wurde abgelehnt.
          Der Einreicher wird informiert!"); #gutachterbenennung.html $smarty->assign('gutachterbenennung_text1', "Bisher benannte Gutachter:"); $smarty->assign('gutachterbenennung_field_name', "Name"); $smarty->assign('gutachterbenennung_field_frist', "Ausschussfrist"); $smarty->assign('gutachterbenennung_field_frist_abgabe', "Abgabefrist Gutacher"); $smarty->assign('gutachterbenennung_field_status', "Status"); $smarty->assign('gutachterbenennung_field_aktionen', "Aktionen"); $smarty->assign('gutachterbenennung_ldap1_field_suche', "Suchbegriff:"); $smarty->assign('gutachterbenennung_ldap1_field_pfad', "Suchpfad:"); $smarty->assign('gutachterbenennung_ldap1_text1', "Es können auch nur Teile des Begriffs eingegeben werden: Henz*"); $smarty->assign('gutachterbenennung_ldap2_field_auswahl', "Auswahl"); $smarty->assign('gutachterbenennung_ldap2_field_uid', "Benutzerkennung"); $smarty->assign('gutachterbenennung_ldap2_field_name', "Name"); $smarty->assign('gutachterbenennung_ldap2_field_gruppe', "Gruppe"); $smarty->assign('gutachterbenennung_ldap2_field_mail', "Mail"); $smarty->assign('gutachterbenennung_ldap3_field_vorname', "Vorname:"); $smarty->assign('gutachterbenennung_ldap3_field_nachname', "Nachname:"); $smarty->assign('gutachterbenennung_ldap3_field_mail', "Mail:"); $smarty->assign('gutachterbenennung_ldap3_field_beziehung', "Beziehung zur Hochschule:"); $smarty->assign('gutachterbenennung_ldap3_field_ag', "AG"); $smarty->assign('gutachterbenennung_ldap3_field_jahrgang', "Jahrgang:"); $smarty->assign('gutachterbenennung_ldap3_field_fakultaet', "Fakultät:"); $smarty->assign('gutachterbenennung_frist_field_fristdat', "Fristdatum:"); $smarty->assign('gutachterbenennung_frist_field_bemerk', "Zusatzbemerkung:"); $smarty->assign('gutachterbenennung_frist2_text1', "Gutachterbenennung abgeschlossen!"); #beteiligtenbenennung.html $smarty->assign('beteiligtenbenennung_text1', "Bisher benannte Beteiligte:"); $smarty->assign('beteiligtenbenennung_field_name', "Name"); $smarty->assign('beteiligtenbenennung_field_frist', "Frist"); $smarty->assign('beteiligtenbenennung_field_status', "Status"); $smarty->assign('beteiligtenbenennung_field_aktionen', "Aktionen"); $smarty->assign('beteiligtenbenennung_ldap1_field_suche', "Suchbegriff:"); $smarty->assign('beteiligtenbenennung_ldap1_field_pfad', "Suchpfad:"); $smarty->assign('beteiligtenbenennung_ldap1_text1', "Es können auch nur Teile des Begriffs eingegeben werden: Henz*"); $smarty->assign('beteiligtenbenennung_ldap2_field_auswahl', "Auswahl"); $smarty->assign('beteiligtenbenennung_ldap2_field_uid', "Benutzerkennung"); $smarty->assign('beteiligtenbenennung_ldap2_field_name', "Name"); $smarty->assign('beteiligtenbenennung_ldap2_field_gruppe', "Gruppe"); $smarty->assign('beteiligtenbenennung_ldap2_field_mail', "Mail"); $smarty->assign('beteiligtenbenennung_ldap3_field_vorname', "Vorname:"); $smarty->assign('beteiligtenbenennung_ldap3_field_nachname', "Nachname:"); $smarty->assign('beteiligtenbenennung_ldap3_field_mail', "Mail:"); $smarty->assign('beteiligtenbenennung_ldap3_field_beziehung', "Beziehung zur Hochschule:"); $smarty->assign('beteiligtenbenennung_ldap3_field_ag', "AG"); $smarty->assign('beteiligtenbenennung_ldap3_field_jahrgang', "Jahrgang:"); $smarty->assign('beteiligtenbenennung_ldap3_field_fakultaet', "Fakultät:"); $smarty->assign('beteiligtenbenennung_frist_field_fristdat', "Fristdatum:"); $smarty->assign('beteiligtenbenennung_frist_field_bemerk', "Zusatzbemerkung:"); $smarty->assign('beteiligtenbenennung_frist2_text1', "Beteiligtenbenennung abgeschlossen!"); # erfassen_status.html $smarty->assign('erfassen_status_titel', "Status"); $smarty->assign('erfassen_status_err_titel', "Fehlerhafte ID"); $smarty->assign('erfassen_status_err_text', "Die ID ist im System nicht vorhanden"); $smarty->assign('erfassen_status_field_id', "ID"); $smarty->assign('erfassen_status_field_titel', "Betreff"); $smarty->assign('erfassen_status_field_erstelldatum', "Erstelldatum"); $smarty->assign('erfassen_status_field_select', "Auswahl"); $smarty->assign('erfassen_status_mandatory_text', "Es ist zu einem Fehler gekommen. Bitte füllen Sie alle Pflichtfelder aus."); $smarty->assign('erfassen_status_field_ersteller', "Ersteller/Ansprechpartner:"); $smarty->assign('erfassen_status_field_mailadresse', "Mailadresse:"); $smarty->assign('erfassen_status_field_gruppe', "Gruppenzugehörigkeit:"); $smarty->assign('erfassen_status_field_gruppenmitglieder', "weitere Einreicher (Gruppenmitglieder):"); $smarty->assign('erfassen_status_field_betreff', "Betreff:"); $smarty->assign('erfassen_status_field_beschreibung', "Situationsbeschreibung:"); $smarty->assign('erfassen_status_field_vorschlag', "Verbesserungsvorschlag und konkreter Umsetzungsplan:"); $smarty->assign('erfassen_status_field_nutzen', "Nutzen des Verbesserungsvorschlages:"); $smarty->assign('erfassen_status_field_public', "Veröffentlichung nach Abschluss:"); $smarty->assign('erfassen_status_field_kategorie', "Kategorie:"); $smarty->assign('erfassen_status_field_admhinweis', "Hinweis Administrator:"); $smarty->assign('erfassen_status_field_eigenhinweis', "Eigener Hinweis:"); $smarty->assign('erfassen_status_field_datum', "Datum"); $smarty->assign('erfassen_status_field_status', "Status"); $smarty->assign('erfassen_status_success_titel', "Hinweis erfasst"); $smarty->assign('erfassen_status_success_text', "Hinweis wurde erfasst!"); # ausschuss_gutachter.html $smarty->assign('ausschuss_gutachter_titel', "Gutachterbestätigung"); # ausschuss_bearbeiten.html $smarty->assign('ausschuss_bearbeiten_titel', "Gutachterbestätigung"); $smarty->assign('ausschuss_bearbeiten_err_titel', "Fehlerhafte ID"); $smarty->assign('ausschuss_bearbeiten_err_text', "Die ID ist im System nicht vorhanden"); # ausschuss_edit.html $smarty->assign('ausschuss_edit_field_id', "ID:"); $smarty->assign('ausschuss_edit_field_betreff', "Betreff:"); $smarty->assign('ausschuss_edit_field_beschreibung', "Situationsbeschreibung:"); $smarty->assign('ausschuss_edit_field_vorschlag', "Verbesserungsvorschlag und konkreter Umsetzungsplan:"); $smarty->assign('ausschuss_edit_field_nutzen', "Nutzen des Verbesserungsvorschlages:"); $smarty->assign('ausschuss_edit_field_category', "Kategorie:"); $smarty->assign('ausschuss_edit_field_name', "Name"); $smarty->assign('ausschuss_edit_field_auswahl', "Auswahl"); $smarty->assign('ausschuss_edit_field_hinweis', "Hinweis"); $smarty->assign('ausschuss_edit_field_frist', "Frist"); $smarty->assign('ausschuss_edit_field_datum', "Datum"); $smarty->assign('ausschuss_edit_field_status', "Status"); $smarty->assign('ausschuss_edit_abgeschlossen_titel', "Daten gespeichert"); $smarty->assign('ausschuss_edit_abgeschlossen_text1', "Der/die Gutachter wurde/n gespeichert"); $smarty->assign('ausschuss_edit_abgeschlossen_text2', "Sie werden automatisch weitergeleitet!"); # beteiligte_offen.html $smarty->assign('beteiligte_offen_titel', "Beteiligungen"); # beteiligte_bearbeiten.html $smarty->assign('beteiligte_bearbeiten_titel', "Stellungnahme"); $smarty->assign('beteiligte_bearbeiten_err_titel', "Fehlerhafte ID"); $smarty->assign('beteiligte_bearbeiten_err_text', "Die ID ist im System nicht vorhanden"); # beteiligte_edit.html $smarty->assign('beteiligte_edit_field_id', "ID:"); $smarty->assign('beteiligte_edit_field_betreff', "Betreff:"); $smarty->assign('beteiligte_edit_field_beschreibung', "Situationsbeschreibung:"); $smarty->assign('beteiligte_edit_field_vorschlag', "Verbesserungsvorschlag und konkreter Umsetzungsplan:"); $smarty->assign('beteiligte_edit_field_nutzen_desc', "Nutzen des Verbesserungsvorschlages:"); $smarty->assign('beteiligte_edit_field_category', "Kategorie:"); $smarty->assign('beteiligte_edit_abgeschlossen_titel', "Daten gespeichert"); $smarty->assign('beteiligte_edit_abgeschlossen_text1', "Die Stellungnahme wurde gespeichert"); $smarty->assign('beteiligte_edit_abgeschlossen_text2', "Sie werden automatisch weitergeleitet!"); $smarty->assign('beteiligte_edit_field_category', "Kategorie:"); $smarty->assign('beteiligte_edit_field_zweck', "1) Zweck"); $smarty->assign('beteiligte_edit_field_zweck_text', "Ist der Zweck der Idee sinnvoll im Sinne der Ziele des Ideenmanagements?
          "); $smarty->assign('beteiligte_edit_field_umsetzung', "2) Umsetzung"); $smarty->assign('beteiligte_edit_field_umsetzung_text', "Ist die Umsetzung der Idee technisch und operativ möglich? Würde die Umsetzung akzeptiert werden?
          Wenn nein, warum nicht? Gibt es bessere Alternativen?
          Wie hoch ist der Umsetzungsaufwand?
          Wie sind die Anwendungszeit, -häufigkeit und -orte einzuschätzen?
          "); $smarty->assign('beteiligte_edit_field_nutzen', "3) Nutzen"); $smarty->assign('beteiligte_edit_field_nutzen_text', "Wie ist der Nutzen der Idee einzuschätzen?"); $smarty->assign('beteiligte_edit_field_nutzenim_text', "a. Welcher Nutzen kann im Sinne des Ideenmanagements erwartet werden?"); $smarty->assign('beteiligte_edit_field_kosteneinsparung_text', "b. In welchem Ausmaß können Kosteneinsparungen erwartet werden?"); $smarty->assign('beteiligte_edit_field_arbeitszeit_text', "c. In welchem Ausmaß kann die Arbeitszeit eingespart werden?"); $smarty->assign('beteiligte_edit_field_innovation', "4) Innovation"); $smarty->assign('beteiligte_edit_field_innovation_text', "Wie neu ist die Idee für die Hochschule? Gibt es diese Idee schon seit längerer Zeit an der Hochschule? Wurde diese Idee bereits schon einmal eingebracht oder umgesetzt?"); $smarty->assign('beteiligte_edit_field_empfehlung', "5) Empfehlung über Annahme / Ablehnung der Idee"); $smarty->assign('beteiligte_edit_abgeschlossen_titel', "Daten gespeichert"); $smarty->assign('beteiligte_edit_abgeschlossen_text1', "Die Stellungnahme wurde gespeichert"); $smarty->assign('beteiligte_edit_abgeschlossen_text2', "Sie werden automatisch weitergeleitet!"); # gutachten_offen.html $smarty->assign('gutachten_offen_titel', "Gutachten"); # gutachten_bearbeiten.html $smarty->assign('gutachten_bearbeiten_titel', "Gutachten"); $smarty->assign('gutachten_bearbeiten_err_titel', "Fehlerhafte ID"); $smarty->assign('gutachten_bearbeiten_err_text', "Die ID ist im System nicht vorhanden"); # gutachten_edit.html $smarty->assign('gutachten_edit_vorwort', "Um eine sachliche Entscheidung über die eingereichte Idee treffen zu können, benötigt der Ausschuss Ideenmanagement eine objektive, präzise und fachliche Stellungnahme eines fachlich geeigneten Gutachters. Bitte halten Sie Stillschweigen über die eingereichte Idee ein.

          Wir können die Motivation zum Einreichen der Ideen steigern, indem wir schnelle, aber ausreichend begründete Antworten geben. Der Bearbeitungsaufwand soll sich am zu erwartenden Nutzen orientieren. Sollten Sie die Frist voraussichtlich nicht einhalten können, stimmen Sie bitte eine Zeitspanne mit dem QMB ab."); $smarty->assign('gutachten_edit_field_id', "ID:"); $smarty->assign('gutachten_edit_field_betreff', "Betreff:"); $smarty->assign('gutachten_edit_field_beschreibung', "Situationsbeschreibung:"); $smarty->assign('gutachten_edit_field_vorschlag', "Verbesserungsvorschlag und konkreter Umsetzungsplan:"); $smarty->assign('gutachten_edit_field_nutzen1', "Nutzen des Verbesserungsvorschlages:"); # ansicht_stellungnahme.html $smarty->assign('ansicht_stellungnahme_titel', "Stellungnahme"); $smarty->assign('ansicht_stellungnahme_field_betreff', "Betreff:"); $smarty->assign('ansicht_stellungnahme_field_datum', "Einreichdatum:"); $smarty->assign('ansicht_stellungnahme_field_stellungnahme', "Stellungnahme:"); $smarty->assign('ansicht_stellungnahme_field_zweck', "Zweck:"); $smarty->assign('ansicht_stellungnahme_field_umsetzung', "Umsetzung:"); $smarty->assign('ansicht_stellungnahme_field_nutzen', "Nutzen:"); $smarty->assign('ansicht_stellungnahme_field_kosteneinsparung', "Kosteneinsparung:"); $smarty->assign('ansicht_stellungnahme_field_arbeitszeiteinsparung', "Einsparung der Arbeitszeit:"); $smarty->assign('ansicht_stellungnahme_field_ideeneu', "Innovation:"); $smarty->assign('ansicht_stellungnahme_field_empfehlung', "Empfehlung:"); # ansicht_gutachten.html $smarty->assign('ansicht_gutachten_titel', "Gutachten"); $smarty->assign('ansicht_gutachten_field_betreff', "Betreff:"); $smarty->assign('ansicht_gutachten_field_datum', "Einreichdatum:"); $smarty->assign('ansicht_gutachten_field_zweck', "Zweck:"); $smarty->assign('ansicht_gutachten_field_umsetzung', "Umsetzung:"); $smarty->assign('ansicht_gutachten_field_nutzen', "Nutzen:"); $smarty->assign('ansicht_gutachten_field_kosteneinsparung', "Kosteneinsparung:"); $smarty->assign('ansicht_gutachten_field_arbeitszeiteinsparung', "Einsparung der Arbeitszeit:"); $smarty->assign('ansicht_gutachten_field_ideeneu', "Innovation:"); $smarty->assign('ansicht_gutachten_field_empfehlung', "Empfehlung:"); # ausschuss_bearbeitung_ansicht.html $smarty->assign('ausschuss_bearbeitung_ansicht_titel', "Verbesserungsvorschlag anzeigen"); # ausschuss_uberblick.html $smarty->assign('ausschuss_uberblick_field_id', "ID:"); $smarty->assign('ausschuss_uberblick_field_betreff', "Betreff:"); $smarty->assign('ausschuss_uberblick_field_beschreibung', "Situationsbeschreibung:"); $smarty->assign('ausschuss_uberblick_field_vorschlag', "Verbesserungsvorschlag und konkreter Umsetzungsplan:"); $smarty->assign('ausschuss_uberblick_field_nutzen', "Nutzen des Verbesserungsvorschlages:"); $smarty->assign('ausschuss_uberblick_field_public', "Veröffentlichung nach Abschluss:"); $smarty->assign('ausschuss_uberblick_field_category', "Kategorie:"); #gutachterbenennung.html $smarty->assign('ausschuss_gutachter_uberblick_text1', "Bisher benannte Gutachter:"); $smarty->assign('ausschuss_gutachter_uberblick_field_name', "Name"); $smarty->assign('ausschuss_gutachter_uberblick_field_frist', "Ausschussfrist"); $smarty->assign('ausschuss_gutachter_uberblick_field_frist_abgabe', "Abgabefrist Gutacher"); $smarty->assign('ausschuss_gutachter_uberblick_field_status', "Status"); #ausschuss_beteiligte_uberblick.html $smarty->assign('ausschuss_beteiligte_uberblick_text1', "Bisher benannte Beteiligte:"); $smarty->assign('ausschuss_beteiligte_uberblick_field_name', "Name"); $smarty->assign('ausschuss_beteiligte_uberblick_field_frist', "Frist"); $smarty->assign('ausschuss_beteiligte_uberblick_field_status', "Status"); $smarty->assign('ausschuss_beteiligte_uberblick_field_aktionen', "Aktionen"); # Sitzung_terminieren.html $smarty->assign('sitzung_terminieren_titel', "Sitzung terminieren"); $smarty->assign('sitzung_terminieren_field_datum', "Datum:"); $smarty->assign('sitzung_terminieren_field_uhr', "Uhrzeit:"); $smarty->assign('sitzung_terminieren_field_raum', "Raum:"); $smarty->assign('sitzung_terminieren_field_bemerkung', "Zusatzbemerkung"); $smarty->assign('sitzung_terminieren_field_id', "ID"); $smarty->assign('sitzung_terminieren_field_betreff', "Betreff"); $smarty->assign('sitzung_terminieren_field_status', "Status"); $smarty->assign('sitzung_terminieren_field_auswahl', "Auswahl"); $smarty->assign('sitzung_terminieren_titel_success_titel', "Sitzung terminiert"); $smarty->assign('sitzung_terminieren_titel_success_text', "Die Sitzung wurde terminiert. Der Ausschuss wird über den Termin informiert!"); # Sitzung_verwalten.html $smarty->assign('sitzung_verwalten_titel', "Sitzung verwalten"); $smarty->assign('sitzung_verwalten_field_datum1', "Datum"); $smarty->assign('sitzung_verwalten_field_zeit1', "Zeit"); $smarty->assign('sitzung_verwalten_field_raum1', "Raum"); $smarty->assign('sitzung_verwalten_field_beschreibung1', "Beschreibung"); $smarty->assign('sitzung_verwalten_field_status1', "Status"); $smarty->assign('sitzung_verwalten_field_vorlage1', "Vorlage"); $smarty->assign('sitzung_verwalten_field_auswahl1', "Auswahl"); $smarty->assign('sitzung_verwalten_field_datum', "Datum:"); $smarty->assign('sitzung_verwalten_field_uhr', "Uhrzeit:"); $smarty->assign('sitzung_verwalten_field_raum', "Raum:"); $smarty->assign('sitzung_verwalten_field_bemerkung', "Zusatzbemerkung"); $smarty->assign('sitzung_verwalten_field_id', "ID"); $smarty->assign('sitzung_verwalten_field_betreff', "Betreff"); $smarty->assign('sitzung_verwalten_field_status', "Status"); $smarty->assign('sitzung_verwalten_field_auswahl', "Auswahl"); $smarty->assign('sitzung_verwalten_titel_success_titel', "Sitzung terminiert"); $smarty->assign('sitzung_verwalten_titel_success_text', "Die Sitzung wurde geändert. Der Ausschuss wird über die Änderung informiert!"); # sitzung_vertretung.html $smarty->assign('sitzung_vertretung_titel', "Vertreter auswählen"); $smarty->assign('sitzung_vertretung_field_name', "Name"); $smarty->assign('sitzung_vertretung_field_auswahl', "Auswahl"); $smarty->assign('sitzung_vertretung_titel_success_titel', "Vertretung benannt"); $smarty->assign('sitzung_vertretung_titel_success_text', "Die Vertretung wird über den Termin informiert!"); # abschluss.html $smarty->assign('abschluss_titel', "Entscheidung Ausschuss"); $smarty->assign('abschluss_field_id', "ID"); $smarty->assign('abschluss_field_betreff', "Betreff"); $smarty->assign('abschluss_field_eingangsdatum', "Eingangsdatum"); $smarty->assign('abschluss_field_einreicher', "Einreicher"); $smarty->assign('abschluss_field_bearbeiten', "Bearbeiten"); $smarty->assign('abschluss_field_ziel', "Die Umsetzung folgender Ziele des Ideenmanagements wird durch diese Idee verfolgt/erreicht:"); $smarty->assign('abschluss_chk_1', "Erhöhung der Wirtschaftlichkeit"); $smarty->assign('abschluss_chk_2', "Stärkung der Serviceorientierung"); $smarty->assign('abschluss_chk_3', "Verbesserung der allgemeinen Arbeits- und Lernbedingungen"); $smarty->assign('abschluss_chk_4', "Förderung der Arbeitssicherheit und des Arbeitsschutzes"); $smarty->assign('abschluss_chk_5', "Diese Idee trägt nicht zur Erreichung eines der definierten Ziele des Ideenmanagements bei"); $smarty->assign('abschluss_field_annahme', "Wurde der eingereichte Vorschlag angenommen?"); $smarty->assign('abschluss_field_paraemie', "Soll eine Prämie ausgezahlt werden?"); $smarty->assign('abschluss_field_teilkriterium', "Teilkriterium"); $smarty->assign('abschluss_field_abstufung', "Abstufungen"); $smarty->assign('abschluss_field_auswahl', "Auswahl"); $smarty->assign('abschluss_field_punkt1', "1 Punkt"); $smarty->assign('abschluss_field_punkt2', "2 Punkte"); $smarty->assign('abschluss_field_punkt3', "3 Punkte"); $smarty->assign('abschluss_field_ausmass_leistung', "Ausmaß der schöpferischen Leistung"); $smarty->assign('abschluss_field_gehalt', "Schöpferischer Gehalt"); $smarty->assign('abschluss_field_1_1', "Vorschläge, welche sich auf andere Beispiele beziehen"); $smarty->assign('abschluss_field_1_2', "Echte Neuerung"); $smarty->assign('abschluss_field_1_3', "Besonders kreativ bzw. unkonventionell im Denken"); $smarty->assign('abschluss_field_qualitaet', "Qualität der Ausarbeitung"); $smarty->assign('abschluss_field_2_1', "Mehr ein Hinweis mit Ansatz einer Lösung, grundlegende Überarbeitung erforderlich"); $smarty->assign('abschluss_field_2_2', "Gute Ausarbeitung: Mit geringem Aufwand kann Lösungsweg festgelegt werden"); $smarty->assign('abschluss_field_2_3', "Hohe Qualität der Ausarbeitung: Perfekter Lösungsweg ist ausgearbeitet und aufgezeigt"); $smarty->assign('abschluss_field_ausmass_hs', "Ausmaß des Nutzens für die Hochschule"); $smarty->assign('abschluss_field_breite', "Anwendungsbreite"); $smarty->assign('abschluss_field_3_1', "Auswirkung für einen oder mehrere Arbeitsplätze der Hochschule"); $smarty->assign('abschluss_field_3_2', "Große Bedeutung und/oder Auswirkung für einzelne Bereiche der Hochschule"); $smarty->assign('abschluss_field_3_3', "Herausragende Bedeutung und/oder Außenwirkung für die gesamte Hochschule"); $smarty->assign('abschluss_field_verbesserung', "Grad der Verbesserung"); $smarty->assign('abschluss_field_4_1', "Geringe bis mittlere Verbesserung: Beitrag im Kern verwendbar"); $smarty->assign('abschluss_field_4_2', "Gute Verbesserung: Beitrag bringt Einsparungen und/oder andere erhebliche Vorteile"); $smarty->assign('abschluss_field_4_3', "Erhebliche Verbesserung: Beitrag bringt größere Einsparungen und/oder besonders bedeutende Vorteile"); $smarty->assign('abschluss_field_praemienpunkte', "Prämienpunkte:"); $smarty->assign('abschluss_field_dienstbefreiung', "oder Dienstbefreiung (bitte auswählen):"); $smarty->assign('abschluss_field_klassierung', "Klassierung:"); $smarty->assign('abschluss_field_public', "Einverständnis Veröffentlichung:"); $smarty->assign('abschluss_field_info_umsetzung', "Information über die geplante Maßnahmen zur Umsetzung"); $smarty->assign('abschluss_field_stand_umsetzung', "Information über den Stand der Umsetzung"); $smarty->assign('abschluss_field_id8', "VorschlagsID:"); $smarty->assign('abschluss_field_annahme8', "Annahme des Vorschlags:"); $smarty->assign('abschluss_field_begruendung8', "Begründung der Annahme:"); $smarty->assign('abschluss_field_public8', "Einverständnis Veröffentlichung:"); $smarty->assign('abschluss_field_info_umsetzung8', "Information über die geplante Maßnahmen zur Umsetzung:"); $smarty->assign('abschluss_field_stand_umsetzung8', "Information über den Stand der Umsetzung:"); $smarty->assign('abschluss_field_praemienpunkte8', "Prämienpunkte:"); $smarty->assign('abschluss_field_dienstbefreiung8', "Dienstbefreiung:"); $smarty->assign('abschluss_field_klassierung8', "Klassierung:"); $smarty->assign('abschluss_field_zuruckstell_text1', "Soll der folgende Vorschlag zurückgestellt werden?"); $smarty->assign('abschluss_field_zuruckstell_text2', "Der Vorschlag wurde zurückgestellt!"); # ansicht_entschieden.html $smarty->assign('ansicht_entschieden_titel_ent', "Entschieden"); $smarty->assign('ansicht_entschieden_titel_aus', "Ausschluss"); $smarty->assign('ansicht_entschieden_field_id', "ID:"); $smarty->assign('ansicht_entschieden_field_datumeingang', "Eingangsdatum:"); $smarty->assign('ansicht_entschieden_field_ersteller', "Ersteller/Ansprechpartner:"); $smarty->assign('ansicht_entschieden_field_mailadresse', "Mailadresse:"); $smarty->assign('ansicht_entschieden_field_gruppe', "Gruppenzugehörigkeit:"); $smarty->assign('ansicht_entschieden_field_gruppenmitglieder', "Weitere Ersteller (bei Gruppenvorschlag):"); $smarty->assign('ansicht_entschieden_field_betreff', "Betreff:"); $smarty->assign('ansicht_entschieden_field_beschreibung', "Situationsbeschreibung:"); $smarty->assign('ansicht_entschieden_field_vorschlag', "Verbesserungsvorschlag und konkreter Umsetzungsplan:"); $smarty->assign('ansicht_entschieden_field_nutzen', "Nutzen des Verbesserungsvorschlages:"); $smarty->assign('ansicht_entschieden_field_public', "Veröffentlichung nach Abschluss:"); $smarty->assign('ansicht_entschieden_field_category', "Kategorie:"); $smarty->assign('ansicht_entschieden_field_gutname', "Name:"); $smarty->assign('ansicht_entschieden_field_gutstatus', "Gutachten:"); $smarty->assign('ansicht_entschieden_field_betname', "Name:"); $smarty->assign('ansicht_entschieden_field_betstatus', "Stellungnahme:"); $smarty->assign('ansicht_entschieden_field_datum', "Datum:"); $smarty->assign('ansicht_entschieden_field_status', "Status:"); $smarty->assign('ansicht_entschieden_field_ausschlgrund', "Ausschlussgrund:"); $smarty->assign('ansicht_entschieden_field_entschiedengrund', "Schließgrund:"); $smarty->assign('ansicht_entschieden_field_annahme', "Vorschlag angenommen:"); $smarty->assign('ansicht_entschieden_field_bemerkung', "Abschlussbemerkung:"); $smarty->assign('ansicht_entschieden_field_ziel', "Die Umsetzung folgender Ziele des Ideenmanagements wird durch diese Idee verfolgt/erreicht:"); $smarty->assign('ansicht_entschieden_chk_1', "Erhöhung der Wirtschaftlichkeit"); $smarty->assign('ansicht_entschieden_chk_2', "Stärkung der Serviceorientierung"); $smarty->assign('ansicht_entschieden_chk_3', "Verbesserung der allgemeinen Arbeits- und Lernbedingungen"); $smarty->assign('ansicht_entschieden_chk_4', "Förderung der Arbeitssicherheit und des Arbeitsschutzes"); $smarty->assign('ansicht_entschieden_chk_5', "Diese Idee trägt nicht zur Erreichung eines der definierten Ziele des Ideenmanagements bei"); $smarty->assign('ansicht_entschieden_field_praemienzahlung', "Prämienzahlung:"); $smarty->assign('ansicht_entschieden_field_gehalt', "Schöpferischer Gehalt:"); $smarty->assign('ansicht_entschieden_field_qualitaet', "Qualität der Ausarbeitung:"); $smarty->assign('ansicht_entschieden_field_anwendungsbreite', "Anwendungsbreite:"); $smarty->assign('ansicht_entschieden_field_gradverbesserung', "Grad der Verbesserung:"); $smarty->assign('ansicht_entschieden_field_gesamtpunkte', "Gesamtpunktzahl:"); $smarty->assign('ansicht_entschieden_field_praemie', "Prämie:"); $smarty->assign('ansicht_entschieden_field_gutschein', "Gutschein:"); $smarty->assign('ansicht_entschieden_field_dienstbefreiung', "Dienstbefreiung:"); $smarty->assign('ansicht_entschieden_field_klassierung', "Klassierung:"); $smarty->assign('ansicht_entschieden_field_umsetzung', "Maßnahme zur Umsetzung:"); $smarty->assign('ansicht_entschieden_field_sachstand', "Sachstand zur Umsetzung:"); $smarty->assign('ansicht_entschieden_legend_allg', "Allgemeine Daten"); $smarty->assign('ansicht_entschieden_legend_gut', "Gutachter"); $smarty->assign('ansicht_entschieden_legend_bet', "Beteiligte"); $smarty->assign('ansicht_entschieden_legend_schluss', "Entscheidung Ausschuss"); $smarty->assign('ansicht_entschieden_legend_details', "Statusdetails"); # info_entscheid.html $smarty->assign('info_entscheid_titel', "Informationen zur Enscheidung"); $smarty->assign('info_entscheid_field_annahme', "Wurde der Vorschlag angenommen:"); $smarty->assign('info_entscheid_field_annahme_bemerkung', "Bemerkung:"); $smarty->assign('info_entscheid_field_praemie', "Wird eine Prämie ausgezahlt:"); $smarty->assign('info_entscheid_field_punkte_gesamt', "Anzal der Prämienpunkte:"); $smarty->assign('info_entscheid_field_praemie_gutschein', "Auszahlungsbetrag:"); $smarty->assign('info_entscheid_field_dienstbefreiung', "Dienstbefreiung:"); $smarty->assign('info_entscheid_field_massnahme', "Maßnahmen zur Umsetzung:"); # ausschuss_sitzung.html $smarty->assign('ausschuss_sitzung_titel', "Sitzungstermine"); $smarty->assign('ausschuss_sitzung_field_datum1', "Datum"); $smarty->assign('ausschuss_sitzung_field_zeit1', "Zeit"); $smarty->assign('ausschuss_sitzung_field_raum1', "Raum"); $smarty->assign('ausschuss_sitzung_field_beschreibung1', "Beschreibung"); $smarty->assign('ausschuss_sitzung_field_vorlage1', "Vorlage"); # passwortverwaltung.html $smarty->assign('passwort_titel', "Passwortverwaltung"); $smarty->assign('passwort_text', "Die Passwortfelder sind standardmäßig leer. Soll das aktuelle Passwort geändert werden, muss zuerst das alte Passwort eingegeben werden und danach das neue Passwort. Das neue Passwort darf nicht leer sein."); $smarty->assign('passwort_field_pwd_alt', "Altes Passwort:"); $smarty->assign('passwort_field_pwd_neu', "Neues Passwort:"); $smarty->assign('passwort_field_pwd_wied', "Wiederholung neues Passwort:"); $smarty->assign('passwort_success_text', "Das Passwort wurde geändert!"); # bewertungsvorschlag.html $smarty->assign('bewertungsvorschlag_mandatory_text', "Es ist zu einem Fehler gekommen. Bitte füllen Sie alle Pflichtfelder aus."); $smarty->assign('bewertungsvorschlag_text', "Bitte geben Sie ein Bewertungsvorschlag für die Ausschusssitzung ab:"); $smarty->assign('bewertungsvorschlag_success', "Der Bewertungsvorschlag wurde gespeichert!"); $smarty->assign('bewertungsvorschlag_field_annahme', "Annahme des Vorschlages:"); $smarty->assign('bewertungsvorschlag_field_ziel', "Die Umsetzung folgender Ziele des Ideenmanagements wird durch diese Idee verfolgt/erreicht:"); $smarty->assign('bewertungsvorschlag_chk_1', "Erhöhung der Wirtschaftlichkeit"); $smarty->assign('bewertungsvorschlag_chk_2', "Stärkung der Serviceorientierung"); $smarty->assign('bewertungsvorschlag_chk_3', "Verbesserung der allgemeinen Arbeits- und Lernbedingungen"); $smarty->assign('bewertungsvorschlag_chk_4', "Förderung der Arbeitssicherheit und des Arbeitsschutzes"); $smarty->assign('bewertungsvorschlag_chk_5', "Diese Idee trägt nicht zur Erreichung eines der definierten Ziele des Ideenmanagements bei"); $smarty->assign('bewertungsvorschlag_field_begruendung', "Begründung"); $smarty->assign('bewertungsvorschlag_field_umsetzung', "Umsetzung"); $smarty->assign('bewertungsvorschlag_field_paemierung', "Prämierung:"); # edit_ausschussmitglieder.html $smarty->assign('edit_ausschuss_titel', "Ausschussmitglieder verwalten"); $smarty->assign('edit_ausschuss_mitgl_ausw', "Ausschussmitglieder hinzufügen:"); $smarty->assign('edit_ausschuss_mitgl_vertreter', "Bei Ausschussvertreter bitte ankreuzen:"); $smarty->assign('edit_ausschuss_mitgl_vertreter_text', "Welches Ausschussmitglied wird vertreten:"); # edit_administratoren.html $smarty->assign('edit_admin_titel', "Administratoren verwalten"); $smarty->assign('edit_admin_mitgl_ausw', "Administratoren hinzufügen:"); # praemienkatalog.html $smarty->assign('praemienkatalog_titel', "Prämien verwalten"); $smarty->assign('praemienkatalog_field_klassierung', "Klassierung"); $smarty->assign('praemienkatalog_field_punkte_umsetzbar', "Punkte bei umsetzbaren Ideen"); $smarty->assign('praemienkatalog_field_punkte_nicht_umsetzbar', "Punkte bei nicht umsetzbaren Ideen"); $smarty->assign('praemienkatalog_field_praemie_euro', "Prämie"); $smarty->assign('praemienkatalog_field_praemie_dienstfrei', "Dienst- oder Arbeitsbefreiung"); ?> \ No newline at end of file diff --git a/ldap_search.php b/ldap_search.php new file mode 100755 index 0000000..c0a9283 --- /dev/null +++ b/ldap_search.php @@ -0,0 +1,425 @@ + + + + +Suchen + + + + + + +
          +
          + + + + + + + + + + + + + + + + + +
          + + +
          + LDAP Suche
          + In der Benutzerverwaltung suchen + +
          + + +
          + +
          +

          +

          +

          +

          +
          + + + + + + + + + + + + + + + + + + + + + + +
          + Suchbegriff: + +
          +
          + Suchpfad: + + Nachnamen
          + UIDs +
          + Domain: + + +
          +
          + Es können auch nur Teile des Begriffs eingegeben werden: Begri* +

          +

          + +
          +
          +


          +

          +
          + +
          + + +
          +
          +
          + + +"; +break; +case "suchen": +if($_POST['suchstring'] != "") +{ + $suchstring=$_POST['suchstring']; + $suchpfad=$_POST['suchpfad']; + $domain=$_POST['domain']; + setcookie("suchpfad","$suchpfad"); + setcookie("suchstring","$suchstring"); + setcookie("domain","$domain"); +} + +if($suchstring == "") +{ + $suchpfad=$_COOKIE["suchpfad"]; + $suchstring=$_COOKIE["suchstring"]; +} + + +$nummer = 0 + $_GET['nummer']; + +if(empty($_GET['sort'])) +{ + $sort = "desc"; +}else{ + NULL; +} + + +if(isset($_GET['sort0'])) +{ + if($sort0 == "asc") + { + $sort = "desc"; + } else { + $sort = "asc"; + } +} + +if(isset($_GET['sort1'])) +{ + if($sort1 == "asc") + { + $sort = "desc"; + } else { + $sort = "asc"; + } +} + +if(isset($_GET['sort3'])) +{ + if($sort3 == "asc") + { + $sort = "desc"; + } else { + $sort = "asc"; + } +} + +if(isset($_GET['sort4'])) +{ + if($sort4 == "asc") + { + $sort = "desc"; + } else { + $sort = "asc"; + } +} + +if(isset($_GET['sort5'])) +{ + if($sort5 == "asc") + { + $sort = "desc"; + } else { + $sort = "asc"; + } +} + +$_ad_username="LDAPqueryUser"; +$_ad_password="ldHS332"; + +if($domain == "hsnet"){ + $_ldap_dn = "ou=OUHochschulnetzwerk,dc=hsnet,dc=hs-ludwigsburg,dc=de"; + $ds=@ldap_connect("141.10.128.30", "389"); // muss ein gültiger LDAP Server Port 389->3268 + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); +} + +if($domain == "studnet"){ + $_ldap_dn = "ou=ouStudnet,dc=studnet,dc=hs-ludwigsburg,dc=de"; + $ds=@ldap_connect("141.10.144.37", "389"); // muss ein gültiger LDAP Server Port 389->3268 + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); +} + + +if ($ds) { + + $r=ldap_bind($ds, $_ad_username, $_ad_password); + + + // Suchen des Nachnamen-Eintrags + #$suchstring2=$suchstring; + #$sr=ldap_search($ds,"o=fhov", "cn=$suchstring"); + $sr=ldap_search($ds, $_ldap_dn, "$suchpfad=$suchstring"); + + + + $anzahl = ldap_count_entries($ds,$sr); + + $info = ldap_get_entries($ds, $sr); + + + + // Funktion mit der Sortierung + function multi_sort($input, $key, $type) { + if(is_array($input) && is_numeric($key)) { + $tmp_arr = array(); + $output = array(); + foreach($input as $i_key => $i_value) { + $tmp_arr[$i_key] = $i_value[$key]; + } + natcasesort($tmp_arr); + reset($tmp_arr); + foreach($tmp_arr as $tmp_key => $tmp_val) { + $output[] = $input[$tmp_key]; + } + if(strtolower($type) != "asc") return $output; + else return array_reverse($output); + } + } + + for ($i=0; $i<$info["count"]; $i++) { + + //$dn enthält dn-string ==> 'cn=test,ou=extern,o=fhov': Nachfolgende Zeilen nur ou extrahieren +$dn = $info[$i]['dn']; + $b = strpos ($dn, "ou=")+3; // Position bestimmen wo ou anfängt, +3 damit "ou=" nicht mitangezeigt wird, also Positon um 3 nach recht verschoben wird + $c = strpos ($dn, ",o="); // Position bestimmen woe ,o= anfängt + $d = $c-$b; // beide Werte subrahieren, dann erhält man die Länge von ou + $dn = substr($dn, $b, $d); + + + + $old_arr[$i][0] = $info[$i]['cn'][0]; + $old_arr[$i][1] = $info[$i]['sn'][0]; + $old_arr[$i][2] = $info[$i]['givenname'][0]; + $old_arr[$i][3] = $dn; + + if ($dn == 'DOZ') // bei den DOZ steht oft sowas wie "Prof." in dem Feld AG --> AG ausblenden + { + $old_arr[$i][4] = ''; + }else{ + $old_arr[$i][4] = $info[$i]['generationqualifier'][0]; + }; + + $old_arr[$i][5] = $info[$i]['mail'][0]; + } + + $new_arr = multi_sort($old_arr, $nummer, "$sort"); + + + echo" + + + + + + Suchergebnisse + + + + + + + + + + + + + + + + + + + +
          + +
          + Suchergebnisse zu Begriff $suchstring
          "; + if ($anzahl == 1){$einheit="Suchergebnis";}else{$einheit="Suchergebnisse";} + echo" + $anzahl $einheit
          +
          +
          + + + + + + + + + "; + + for ($i=0; $i<$info["count"]; $i++) { +/* + echo "01 ".$info[$i]['samaccountname'][0]."
          "; + echo "02 ".$info[$i]['givenname'][0]."
          "; + echo "03 ".$info[$i]['mail'][0]."
          "; + echo "04 ".$info[$i]['language'][0]."
          "; + echo "05 ".$info[$i]['allowunlimitedcredit'][0]."
          "; + echo "06 ".$info[$i]['accountbalance'][0]."
          "; + echo "07 ".$info[$i]['groupmembership'][0]."
          "; + echo "08 ".$info[$i]['groupmembership'][1]."
          "; + echo "08a".$info[$i]['groupmembership'][2]."
          "; + echo "08b".$info[$i]['groupmembership'][3]."
          "; + echo "09 ".$info[$i]['sn'][0]."
          "; + echo "10 ".$info[$i]['securityequals'][0]."
          "; + echo "11 ".$info[$i]['profile'][0]."
          "; + echo "12 ".$info[$i]['passwordrequired'][0]."
          "; + echo "13 ".$info[$i]['passwordminimumlength'][0]."
          "; + echo "14 ".$info[$i]['passwordexpirationtime'][0]."
          "; + echo "15 ".$info[$i]['passwordexpirationinterval'][0]."
          "; + echo "16 ".$info[$i]['passwordallowchange'][0]."
          "; + echo "17 ".$info[$i]['objectclass'][0]."
          "; + echo "18 ".$info[$i]['logintime'][0]."
          "; + echo "19 ".$info[$i]['loginintruderaddress'][0]."
          "; + echo "20 ".$info[$i]['loginexpirationtime'][0]."
          "; + echo "21 ".$info[$i]['ndshomedirectory'][0]."
          "; + echo "22 ".$info[$i]['cn'][0]."
          "; + echo "23 ".$info[$i]['acl'][0]."
          "; + echo "24 ".$info[$i][dn]."
          "; + echo "

          "; + echo "

          "; +*/ + + + $uid = $info[$i]['samaccountname'][0]; + $vorname = $info[$i]['givenname'][0]; + $nachname = $info[$i]['sn'][0]; + $dn = $info[$i][dn]; + $ag = $new_arr[$i][4]; + $mail = $info[$i]['mail'][0]; + + + echo" +

          + + + + + + + "; + $uid = ""; + $sn = ""; + $givenname = ""; + $dn = ""; + $mail = ""; + $ag = ""; + } + echo" +
          + UID + + Name + + Gruppe + + AG + + Mail +
          + $uid + + $vorname $nachname + + $dn + + $ag + + $mail +
          +
          +
          + + +
          + + "; + + + ldap_close($ds); + +} else { + echo "

          Verbindung zum LDAP Server nicht möglich

          "; +} + +} //ENDE SWITCH CASE +?> \ No newline at end of file diff --git a/ldap_search2.php b/ldap_search2.php new file mode 100755 index 0000000..1f416a3 --- /dev/null +++ b/ldap_search2.php @@ -0,0 +1,57 @@ +"; + }else{ + echo "connectid Nicht erfolgreich
          "; + } + +// Ihr könnt dies auch nutzen, um z.B. Usernamen und Passwort z.B. fürs Intranet zu verifizieren. +$binding = @ldap_bind($connectid,$username,$password) or die("Fehler"); + + if($binding){ + echo "binding Erfolgreich
          "; + }else{ + echo "binding Nicht erfolgreich
          "; + } + +// AD auslesen +$search = @ldap_search($connectid,$basedn,$filter); +$result = ldap_get_entries($connectid,$sr); + + if($search){ + echo "search Erfolgreich
          "; + }else{ + echo "search Nicht erfolgreich
          "; + } + + + if($result){ + echo "result Erfolgreich
          "; + }else{ + echo "result Nicht erfolgreich
          "; + } + +// in $result sind nun alle User mit allen Informationen enthalten. +print_r($result); + +?> \ No newline at end of file diff --git a/ldap_search3.php b/ldap_search3.php new file mode 100755 index 0000000..0627d4c --- /dev/null +++ b/ldap_search3.php @@ -0,0 +1,58 @@ +"; + }else{ + echo "connectid Nicht erfolgreich
          "; + } + +// Ihr könnt dies auch nutzen, um z.B. Usernamen und Passwort z.B. fürs Intranet zu verifizieren. +$binding = ldap_bind($connectid,$username,$password) or die("Fehler"); + + if($binding){ + echo "binding Erfolgreich
          "; + }else{ + echo "binding Nicht erfolgreich
          "; + } + +// AD auslesen +$sr = ldap_search($connectid,$basedn,$filter); +$result = ldap_get_entries($connectid,$sr); + + if($search){ + echo "search Erfolgreich
          "; + }else{ + echo "search Nicht erfolgreich
          "; + } + + + if($result){ + echo "result Erfolgreich
          "; + }else{ + echo "result Nicht erfolgreich
          "; + } + +// in $result sind nun alle User mit allen Informationen enthalten. +echo +print_r($result); + +?> \ No newline at end of file diff --git a/lib/Smarty-2.6.28.zip b/lib/Smarty-2.6.28.zip new file mode 100755 index 0000000..f131803 Binary files /dev/null and b/lib/Smarty-2.6.28.zip differ diff --git a/lib/smarty-3.1.29.zip b/lib/smarty-3.1.29.zip new file mode 100755 index 0000000..629c4c6 Binary files /dev/null and b/lib/smarty-3.1.29.zip differ diff --git a/lib/smarty/.gitattributes b/lib/smarty/.gitattributes new file mode 100755 index 0000000..412eeda --- /dev/null +++ b/lib/smarty/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/lib/smarty/.gitignore b/lib/smarty/.gitignore new file mode 100755 index 0000000..0ff15aa --- /dev/null +++ b/lib/smarty/.gitignore @@ -0,0 +1,221 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +############# +## Windows detritus +############# + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac crap +.DS_Store + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist/ +build/ +eggs/ +parts/ +var/ +sdist/ +develop-eggs/ +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +.idea/ + +# Smarty +lexer/*.php +lexer/*.out diff --git a/lib/smarty/.travis.yml b/lib/smarty/.travis.yml new file mode 100755 index 0000000..421ed9e --- /dev/null +++ b/lib/smarty/.travis.yml @@ -0,0 +1,24 @@ +language: php + +php: + - 5.3 + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - hhvm + +matrix: + allow_failures: + - php: hhvm + +before_script: + - travis_retry composer --prefer-source --dev install + +install: + - git clone --depth=50 --branch=master git://github.com/smarty-php/smarty-phpunit.git + +script: + - cd smarty-phpunit + - phpunit ./ + diff --git a/lib/smarty/BUGS b/lib/smarty/BUGS new file mode 100755 index 0000000..9f1a80f --- /dev/null +++ b/lib/smarty/BUGS @@ -0,0 +1,7 @@ +Smarty is supported only in PHP 4.0.6 or later. + +Smarty versions previous to 2.0 require the PEAR libraries. Be sure to include +the path to the PEAR libraries in your php include_path. Config_file.class.php +uses the PEAR library for its error handling routines. PEAR comes with the PHP +distribution. Unix users check /usr/local/lib/php, windows users check +C:/php/pear. diff --git a/lib/smarty/COMPOSER_RELEASE_NOTES.txt b/lib/smarty/COMPOSER_RELEASE_NOTES.txt new file mode 100755 index 0000000..c943d9f --- /dev/null +++ b/lib/smarty/COMPOSER_RELEASE_NOTES.txt @@ -0,0 +1,29 @@ + + +Starting with Smarty 3.1.21 Composer has been configured to load the packages from github. + +******************************************************************************* +* * +* NOTE: Because of this change you must clear your local composer cache with * +* the "composer clearcache" command * +* * +******************************************************************************* + +To get the latest stable version use + "require": { + "smarty/smarty": "~3.1" + } +in your composer.json file. + +To get the trunk version use + "require": { + "smarty/smarty": "~3.1@dev" + } + +The "smarty/smarty" package will start at libs/.... subfolder. + +To retrieve the development and documentation folders add + "require-dev": { + "smarty/smarty-dev": "~3.1@dev" + } + diff --git a/lib/smarty/COPYING.lib b/lib/smarty/COPYING.lib new file mode 100755 index 0000000..02bbb60 --- /dev/null +++ b/lib/smarty/COPYING.lib @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/lib/smarty/ChangeLog b/lib/smarty/ChangeLog new file mode 100755 index 0000000..2e19a7c --- /dev/null +++ b/lib/smarty/ChangeLog @@ -0,0 +1,9197 @@ +2013-09-30 + + * Fixed old vulnerability bug https://bugs.gentoo.org/show_bug.cgi?id=356615 + +2013-07-16 Uwe Tews + + * Fixed made Smarty_Compiler.class.php compatible with PHP 5.5 + + +2012-09-24 Uwe Tews + + * Fixed escape Smarty error messages to avoid possible script execution + + +2010-04-17 Uwe Tews + + * Fixed security hole in {math} plugin + +2007-09-27 TAKAGI Masahiro + + * docs/ja/designers/language-custom-functions/language-function-html-checkboxes.xml: + sync with en. + +2007-09-27 Monte Ohrt + + * docs/en/designers/language-custom-functions/language-function-html-checkboxes.xml: + remove redundant attribute + +2007-09-18 Messju Mohr + + * docs/id/programmers/plugins/plugins-functions.xml: + removed errornous whitespace + +2007-09-18 Zaenal Mutaqin + + * docs/id/designers/language-basic-syntax/language-escaping.xml + docs/id/designers/language-basic-syntax/language-math.xml + docs/id/designers/language-basic-syntax/language-syntax-attributes.xml + docs/id/designers/language-basic-syntax/language-syntax-comments.xml + docs/id/designers/language-basic-syntax/language-syntax-functions.xml + docs/id/designers/language-basic-syntax/language-syntax-quotes.xml + docs/id/designers/language-basic-syntax/language-syntax-variables.xml + docs/id/designers/language-builtin-functions/language-function-capture.xml + docs/id/designers/language-builtin-functions/language-function-config-load.xml + docs/id/designers/language-builtin-functions/language-function-foreach.xml + docs/id/designers/language-builtin-functions/language-function-if.xml + docs/id/designers/language-builtin-functions/language-function-include-php.xml + docs/id/designers/language-builtin-functions/language-function-include.xml + docs/id/designers/language-builtin-functions/language-function-insert.xml + docs/id/designers/language-builtin-functions/language-function-ldelim.xml + docs/id/designers/language-builtin-functions/language-function-literal.xml + docs/id/designers/language-builtin-functions/language-function-php.xml + docs/id/designers/language-builtin-functions/language-function-section.xml + docs/id/designers/language-builtin-functions/language-function-strip.xml + docs/id/designers/language-custom-functions/language-function-assign.xml + docs/id/designers/language-custom-functions/language-function-counter.xml + docs/id/designers/language-custom-functions/language-function-cycle.xml + docs/id/designers/language-custom-functions/language-function-debug.xml + docs/id/designers/language-custom-functions/language-function-eval.xml + docs/id/designers/language-custom-functions/language-function-fetch.xml + docs/id/designers/language-custom-functions/language-function-html-checkboxes.xml + docs/id/designers/language-custom-functions/language-function-html-image.xml + docs/id/designers/language-custom-functions/language-function-html-options.xml + docs/id/designers/language-custom-functions/language-function-html-radios.xml + docs/id/designers/language-custom-functions/language-function-html-select-date.xml + docs/id/designers/language-custom-functions/language-function-html-select-time.xml + docs/id/designers/language-custom-functions/language-function-html-table.xml + docs/id/designers/language-custom-functions/language-function-mailto.xml + docs/id/designers/language-custom-functions/language-function-math.xml + docs/id/designers/language-custom-functions/language-function-popup-init.xml + docs/id/designers/language-custom-functions/language-function-popup.xml + docs/id/designers/language-custom-functions/language-function-textformat.xml + docs/id/designers/language-modifiers/language-modifier-capitalize.xml + docs/id/designers/language-modifiers/language-modifier-cat.xml + docs/id/designers/language-modifiers/language-modifier-count-characters.xml + docs/id/designers/language-modifiers/language-modifier-count-paragraphs.xml + docs/id/designers/language-modifiers/language-modifier-count-sentences.xml + docs/id/designers/language-modifiers/language-modifier-count-words.xml + docs/id/designers/language-modifiers/language-modifier-date-format.xml + docs/id/designers/language-modifiers/language-modifier-default.xml + docs/id/designers/language-modifiers/language-modifier-escape.xml + docs/id/designers/language-modifiers/language-modifier-indent.xml + docs/id/designers/language-modifiers/language-modifier-lower.xml + docs/id/designers/language-modifiers/language-modifier-nl2br.xml + docs/id/designers/language-modifiers/language-modifier-regex-replace.xml + docs/id/designers/language-modifiers/language-modifier-replace.xml + docs/id/designers/language-modifiers/language-modifier-spacify.xml + docs/id/designers/language-modifiers/language-modifier-string-format.xml + docs/id/designers/language-modifiers/language-modifier-strip-tags.xml + docs/id/designers/language-modifiers/language-modifier-strip.xml + docs/id/designers/language-modifiers/language-modifier-truncate.xml + docs/id/designers/language-modifiers/language-modifier-upper.xml + docs/id/designers/language-modifiers/language-modifier-wordwrap.xml + docs/id/designers/language-variables/language-assigned-variables.xml + docs/id/designers/language-variables/language-config-variables.xml + docs/id/designers/language-variables/language-variables-smarty.xml + docs/id/programmers/advanced-features/advanced-features-objects.xml + docs/id/programmers/advanced-features/advanced-features-outputfilters.xml + docs/id/programmers/advanced-features/advanced-features-postfilters.xml + docs/id/programmers/advanced-features/advanced-features-prefilters.xml + docs/id/programmers/advanced-features/section-template-cache-handler-func.xml + docs/id/programmers/advanced-features/template-resources.xml + docs/id/programmers/api-functions/api-append-by-ref.xml + docs/id/programmers/api-functions/api-append.xml + docs/id/programmers/api-functions/api-assign-by-ref.xml + docs/id/programmers/api-functions/api-assign.xml + docs/id/programmers/api-functions/api-clear-all-assign.xml + docs/id/programmers/api-functions/api-clear-all-cache.xml + docs/id/programmers/api-functions/api-clear-assign.xml + docs/id/programmers/api-functions/api-clear-cache.xml + docs/id/programmers/api-functions/api-clear-compiled-tpl.xml + docs/id/programmers/api-functions/api-clear-config.xml + docs/id/programmers/api-functions/api-config-load.xml + docs/id/programmers/api-functions/api-display.xml + docs/id/programmers/api-functions/api-fetch.xml + docs/id/programmers/api-functions/api-get-config-vars.xml + docs/id/programmers/api-functions/api-get-registered-object.xml + docs/id/programmers/api-functions/api-get-template-vars.xml + docs/id/programmers/api-functions/api-is-cached.xml + docs/id/programmers/api-functions/api-load-filter.xml + docs/id/programmers/api-functions/api-register-block.xml + docs/id/programmers/api-functions/api-register-compiler-function.xml + docs/id/programmers/api-functions/api-register-function.xml + docs/id/programmers/api-functions/api-register-modifier.xml + docs/id/programmers/api-functions/api-register-object.xml + docs/id/programmers/api-functions/api-register-outputfilter.xml + docs/id/programmers/api-functions/api-register-postfilter.xml + docs/id/programmers/api-functions/api-register-prefilter.xml + docs/id/programmers/api-functions/api-register-resource.xml + docs/id/programmers/api-functions/api-template-exists.xml + docs/id/programmers/api-functions/api-trigger-error.xml + docs/id/programmers/api-functions/api-unregister-block.xml + docs/id/programmers/api-functions/api-unregister-compiler-function.xml + docs/id/programmers/api-functions/api-unregister-function.xml + docs/id/programmers/api-functions/api-unregister-modifier.xml + docs/id/programmers/api-functions/api-unregister-object.xml + docs/id/programmers/api-functions/api-unregister-outputfilter.xml + docs/id/programmers/api-functions/api-unregister-postfilter.xml + docs/id/programmers/api-functions/api-unregister-prefilter.xml + docs/id/programmers/api-functions/api-unregister-resource.xml + docs/id/programmers/api-variables/variable-autoload-filters.xml + docs/id/programmers/api-variables/variable-cache-dir.xml + docs/id/programmers/api-variables/variable-cache-handler-func.xml + docs/id/programmers/api-variables/variable-cache-lifetime.xml + docs/id/programmers/api-variables/variable-cache-modified-check.xml + docs/id/programmers/api-variables/variable-caching.xml + docs/id/programmers/api-variables/variable-compile-check.xml + docs/id/programmers/api-variables/variable-compile-dir.xml + docs/id/programmers/api-variables/variable-compile-id.xml + docs/id/programmers/api-variables/variable-compiler-class.xml + docs/id/programmers/api-variables/variable-config-booleanize.xml + docs/id/programmers/api-variables/variable-config-dir.xml + docs/id/programmers/api-variables/variable-config-fix-newlines.xml + docs/id/programmers/api-variables/variable-config-overwrite.xml + docs/id/programmers/api-variables/variable-config-read-hidden.xml + docs/id/programmers/api-variables/variable-debug-tpl.xml + docs/id/programmers/api-variables/variable-debugging-ctrl.xml + docs/id/programmers/api-variables/variable-debugging.xml + docs/id/programmers/api-variables/variable-default-modifiers.xml + docs/id/programmers/api-variables/variable-default-resource-type.xml + docs/id/programmers/api-variables/variable-default-template-handler-func.xml + docs/id/programmers/api-variables/variable-error-reporting.xml + docs/id/programmers/api-variables/variable-force-compile.xml + docs/id/programmers/api-variables/variable-left-delimiter.xml + docs/id/programmers/api-variables/variable-php-handling.xml + docs/id/programmers/api-variables/variable-plugins-dir.xml + docs/id/programmers/api-variables/variable-request-use-auto-globals.xml + docs/id/programmers/api-variables/variable-request-vars-order.xml + docs/id/programmers/api-variables/variable-right-delimiter.xml + docs/id/programmers/api-variables/variable-secure-dir.xml + docs/id/programmers/api-variables/variable-security-settings.xml + docs/id/programmers/api-variables/variable-security.xml + docs/id/programmers/api-variables/variable-template-dir.xml + docs/id/programmers/api-variables/variable-trusted-dir.xml + docs/id/programmers/api-variables/variable-use-sub-dirs.xml + docs/id/programmers/caching/caching-cacheable.xml + docs/id/programmers/caching/caching-groups.xml + docs/id/programmers/caching/caching-multiple-caches.xml + docs/id/programmers/caching/caching-setting-up.xml + docs/id/programmers/plugins/plugins-block-functions.xml + docs/id/programmers/plugins/plugins-compiler-functions.xml + docs/id/programmers/plugins/plugins-functions.xml + docs/id/programmers/plugins/plugins-howto.xml + docs/id/programmers/plugins/plugins-inserts.xml + docs/id/programmers/plugins/plugins-modifiers.xml + docs/id/programmers/plugins/plugins-naming-conventions.xml + docs/id/programmers/plugins/plugins-outputfilters.xml + docs/id/programmers/plugins/plugins-prefilters-postfilters.xml + docs/id/programmers/plugins/plugins-resources.xml + docs/id/programmers/plugins/plugins-writing.xml: + Typos correction and all translated now. + +2007-09-17 Messju Mohr + + * docs/id/bookinfo.xml + docs/id/getting-started.xml + docs/id/language-defs.ent + docs/id/language-snippets.ent + docs/id/livedocs.ent + docs/id/preface.xml: + added indonesian docs - thanks Zaenal Mutaqin + + * docs/scripts/generate_web.php: + raise pcre.backtrack_limit - thanks to takagi + +2007-09-16 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + fix typo + +2007-08-22 George Miroshnikov + + * docs/ru/getting-started.xml + docs/ru/getting-started.xml: + Sync with EN. + +2007-08-01 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + add append feature to capture + +2007-06-24 TAKAGI Masahiro + + * docs/ja/getting-started.xml: + sync with en. + +2007-06-24 Messju Mohr + + * docs/Makefile.in: + reverted accidently modified file + + * docs/Makefile.in + docs/de/getting-started.xml: + sync with en + + * docs/en/getting-started.xml: + fixed link to ini_set(). thanks to Lee Yunyoung. + +2007-06-18 TAKAGI Masahiro + + * docs/ja/language-snippets.ent + docs/ja/programmers/api-functions/api-register-outputfilter.xml + docs/ja/programmers/api-functions/api-register-postfilter.xml + docs/ja/programmers/api-functions/api-register-prefilter.xml: + sync with en. + +2007-06-18 Danilo Buerger + + * docs/en/language-snippets.ent + docs/en/programmers/api-functions/api-register-outputfilter.xml + docs/en/programmers/api-functions/api-register-postfilter.xml + docs/en/programmers/api-functions/api-register-prefilter.xml: + Updated docs according to the changes from the previous commit + + * NEWS + libs/Smarty.class.php: + Added the ability to (un)register multiple filters of the same type with + the same method name but different class name. Before it was not possible + due to the fact that only the method name was used to distinguish between + different filters of the same type. This does however not allow (same as + before) to register multiple filters of the same type with the same method + and class name (i.e. different instances of the same class). + +2007-05-29 Messju Mohr + + * libs/plugins/compiler.assign.php: + fixed typo + +2007-05-11 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed calling registered objects' methods with an empty argument list. + thanks marcello + +2007-05-03 TAKAGI Masahiro + + * docs/ja/designers/language-variables.xml + docs/ja/designers/language-builtin-functions/language-function-config-load.xml + docs/ja/designers/language-builtin-functions/language-function-foreach.xml + docs/ja/designers/language-builtin-functions/language-function-if.xml + docs/ja/designers/language-modifiers/language-modifier-cat.xml + docs/ja/designers/language-modifiers/language-modifier-wordwrap.xml + docs/ja/designers/language-variables/language-variables-smarty.xml: + sync with en. + +2007-05-03 Monte Ohrt + + * docs/en/designers/language-variables.xml + docs/en/designers/language-builtin-functions/language-function-config-load.xml + docs/en/designers/language-builtin-functions/language-function-foreach.xml + docs/en/designers/language-builtin-functions/language-function-if.xml + docs/en/designers/language-modifiers/language-modifier-cat.xml + docs/en/designers/language-modifiers/language-modifier-wordwrap.xml + docs/en/designers/language-variables/language-variables-smarty.xml: + update documentation corrections from marcello in the forums. Thanks + marcello! + +2007-04-22 TAKAGI Masahiro + + * docs/ja/programmers/advanced-features.xml + docs/ja/programmers/api-functions.xml + docs/ja/programmers/api-variables.xml: + corrected the garbled text. + +2007-04-21 TAKAGI Masahiro + + * docs/ja/bookinfo.xml + docs/ja/getting-started.xml + docs/ja/language-defs.ent + docs/ja/language-snippets.ent + docs/ja/livedocs.ent + docs/ja/make_chm_index.html + docs/ja/preface.xml + docs/ja/translation.xml + docs/ja/appendixes/bugs.xml + docs/ja/appendixes/resources.xml + docs/ja/appendixes/tips.xml + docs/ja/appendixes/troubleshooting.xml + docs/ja/designers/chapter-debugging-console.xml + docs/ja/designers/config-files.xml + docs/ja/designers/language-basic-syntax.xml + docs/ja/designers/language-builtin-functions.xml + docs/ja/designers/language-combining-modifiers.xml + docs/ja/designers/language-custom-functions.xml + docs/ja/designers/language-modifiers.xml + docs/ja/designers/language-variables.xml + docs/ja/designers/language-basic-syntax/language-escaping.xml + docs/ja/designers/language-basic-syntax/language-math.xml + docs/ja/designers/language-basic-syntax/language-syntax-attributes.xml + docs/ja/designers/language-basic-syntax/language-syntax-comments.xml + docs/ja/designers/language-basic-syntax/language-syntax-functions.xml + docs/ja/designers/language-basic-syntax/language-syntax-quotes.xml + docs/ja/designers/language-basic-syntax/language-syntax-variables.xml + docs/ja/designers/language-builtin-functions/language-function-capture.xml + docs/ja/designers/language-builtin-functions/language-function-config-load.xml + docs/ja/designers/language-builtin-functions/language-function-foreach.xml + docs/ja/designers/language-builtin-functions/language-function-if.xml + docs/ja/designers/language-builtin-functions/language-function-include-php.xml + docs/ja/designers/language-builtin-functions/language-function-include.xml + docs/ja/designers/language-builtin-functions/language-function-insert.xml + docs/ja/designers/language-builtin-functions/language-function-ldelim.xml + docs/ja/designers/language-builtin-functions/language-function-literal.xml + docs/ja/designers/language-builtin-functions/language-function-php.xml + docs/ja/designers/language-builtin-functions/language-function-section.xml + docs/ja/designers/language-builtin-functions/language-function-strip.xml + docs/ja/designers/language-custom-functions/language-function-assign.xml + docs/ja/designers/language-custom-functions/language-function-counter.xml + docs/ja/designers/language-custom-functions/language-function-cycle.xml + docs/ja/designers/language-custom-functions/language-function-debug.xml + docs/ja/designers/language-custom-functions/language-function-eval.xml + docs/ja/designers/language-custom-functions/language-function-fetch.xml + docs/ja/designers/language-custom-functions/language-function-html-checkboxes.xml + docs/ja/designers/language-custom-functions/language-function-html-image.xml + docs/ja/designers/language-custom-functions/language-function-html-options.xml + docs/ja/designers/language-custom-functions/language-function-html-radios.xml + docs/ja/designers/language-custom-functions/language-function-html-select-date.xml + docs/ja/designers/language-custom-functions/language-function-html-select-time.xml + docs/ja/designers/language-custom-functions/language-function-html-table.xml + docs/ja/designers/language-custom-functions/language-function-mailto.xml + docs/ja/designers/language-custom-functions/language-function-math.xml + docs/ja/designers/language-custom-functions/language-function-popup-init.xml + docs/ja/designers/language-custom-functions/language-function-popup.xml + docs/ja/designers/language-custom-functions/language-function-textformat.xml + docs/ja/designers/language-modifiers/language-modifier-capitalize.xml + docs/ja/designers/language-modifiers/language-modifier-cat.xml + docs/ja/designers/language-modifiers/language-modifier-count-characters.xml + docs/ja/designers/language-modifiers/language-modifier-count-paragraphs.xml + docs/ja/designers/language-modifiers/language-modifier-count-sentences.xml + docs/ja/designers/language-modifiers/language-modifier-count-words.xml + docs/ja/designers/language-modifiers/language-modifier-date-format.xml + docs/ja/designers/language-modifiers/language-modifier-default.xml + docs/ja/designers/language-modifiers/language-modifier-escape.xml + docs/ja/designers/language-modifiers/language-modifier-indent.xml + docs/ja/designers/language-modifiers/language-modifier-lower.xml + docs/ja/designers/language-modifiers/language-modifier-nl2br.xml + docs/ja/designers/language-modifiers/language-modifier-regex-replace.xml + docs/ja/designers/language-modifiers/language-modifier-replace.xml + docs/ja/designers/language-modifiers/language-modifier-spacify.xml + docs/ja/designers/language-modifiers/language-modifier-string-format.xml + docs/ja/designers/language-modifiers/language-modifier-strip-tags.xml + docs/ja/designers/language-modifiers/language-modifier-strip.xml + docs/ja/designers/language-modifiers/language-modifier-truncate.xml + docs/ja/designers/language-modifiers/language-modifier-upper.xml + docs/ja/designers/language-modifiers/language-modifier-wordwrap.xml + docs/ja/designers/language-variables/language-assigned-variables.xml + docs/ja/designers/language-variables/language-config-variables.xml + docs/ja/designers/language-variables/language-variables-smarty.xml + docs/ja/programmers/advanced-features.xml + docs/ja/programmers/api-functions.xml + docs/ja/programmers/api-variables.xml + docs/ja/programmers/caching.xml + docs/ja/programmers/plugins.xml + docs/ja/programmers/smarty-constants.xml + docs/ja/programmers/advanced-features/advanced-features-objects.xml + docs/ja/programmers/advanced-features/advanced-features-outputfilters.xml + docs/ja/programmers/advanced-features/advanced-features-postfilters.xml + docs/ja/programmers/advanced-features/advanced-features-prefilters.xml + docs/ja/programmers/advanced-features/section-template-cache-handler-func.xml + docs/ja/programmers/advanced-features/template-resources.xml + docs/ja/programmers/api-functions/api-append-by-ref.xml + docs/ja/programmers/api-functions/api-append.xml + docs/ja/programmers/api-functions/api-assign-by-ref.xml + docs/ja/programmers/api-functions/api-assign.xml + docs/ja/programmers/api-functions/api-clear-all-assign.xml + docs/ja/programmers/api-functions/api-clear-all-cache.xml + docs/ja/programmers/api-functions/api-clear-assign.xml + docs/ja/programmers/api-functions/api-clear-cache.xml + docs/ja/programmers/api-functions/api-clear-compiled-tpl.xml + docs/ja/programmers/api-functions/api-clear-config.xml + docs/ja/programmers/api-functions/api-config-load.xml + docs/ja/programmers/api-functions/api-display.xml + docs/ja/programmers/api-functions/api-fetch.xml + docs/ja/programmers/api-functions/api-get-config-vars.xml + docs/ja/programmers/api-functions/api-get-registered-object.xml + docs/ja/programmers/api-functions/api-get-template-vars.xml + docs/ja/programmers/api-functions/api-is-cached.xml + docs/ja/programmers/api-functions/api-load-filter.xml + docs/ja/programmers/api-functions/api-register-block.xml + docs/ja/programmers/api-functions/api-register-compiler-function.xml + docs/ja/programmers/api-functions/api-register-function.xml + docs/ja/programmers/api-functions/api-register-modifier.xml + docs/ja/programmers/api-functions/api-register-object.xml + docs/ja/programmers/api-functions/api-register-outputfilter.xml + docs/ja/programmers/api-functions/api-register-postfilter.xml + docs/ja/programmers/api-functions/api-register-prefilter.xml + docs/ja/programmers/api-functions/api-register-resource.xml + docs/ja/programmers/api-functions/api-template-exists.xml + docs/ja/programmers/api-functions/api-trigger-error.xml + docs/ja/programmers/api-functions/api-unregister-block.xml + docs/ja/programmers/api-functions/api-unregister-compiler-function.xml + docs/ja/programmers/api-functions/api-unregister-function.xml + docs/ja/programmers/api-functions/api-unregister-modifier.xml + docs/ja/programmers/api-functions/api-unregister-object.xml + docs/ja/programmers/api-functions/api-unregister-outputfilter.xml + docs/ja/programmers/api-functions/api-unregister-postfilter.xml + docs/ja/programmers/api-functions/api-unregister-prefilter.xml + docs/ja/programmers/api-functions/api-unregister-resource.xml + docs/ja/programmers/api-variables/variable-autoload-filters.xml + docs/ja/programmers/api-variables/variable-cache-dir.xml + docs/ja/programmers/api-variables/variable-cache-handler-func.xml + docs/ja/programmers/api-variables/variable-cache-lifetime.xml + docs/ja/programmers/api-variables/variable-cache-modified-check.xml + docs/ja/programmers/api-variables/variable-caching.xml + docs/ja/programmers/api-variables/variable-compile-check.xml + docs/ja/programmers/api-variables/variable-compile-dir.xml + docs/ja/programmers/api-variables/variable-compile-id.xml + docs/ja/programmers/api-variables/variable-compiler-class.xml + docs/ja/programmers/api-variables/variable-config-booleanize.xml + docs/ja/programmers/api-variables/variable-config-dir.xml + docs/ja/programmers/api-variables/variable-config-fix-newlines.xml + docs/ja/programmers/api-variables/variable-config-overwrite.xml + docs/ja/programmers/api-variables/variable-config-read-hidden.xml + docs/ja/programmers/api-variables/variable-debug-tpl.xml + docs/ja/programmers/api-variables/variable-debugging-ctrl.xml + docs/ja/programmers/api-variables/variable-debugging.xml + docs/ja/programmers/api-variables/variable-default-modifiers.xml + docs/ja/programmers/api-variables/variable-default-resource-type.xml + docs/ja/programmers/api-variables/variable-default-template-handler-func.xml + docs/ja/programmers/api-variables/variable-error-reporting.xml + docs/ja/programmers/api-variables/variable-force-compile.xml + docs/ja/programmers/api-variables/variable-left-delimiter.xml + docs/ja/programmers/api-variables/variable-php-handling.xml + docs/ja/programmers/api-variables/variable-plugins-dir.xml + docs/ja/programmers/api-variables/variable-request-use-auto-globals.xml + docs/ja/programmers/api-variables/variable-request-vars-order.xml + docs/ja/programmers/api-variables/variable-right-delimiter.xml + docs/ja/programmers/api-variables/variable-secure-dir.xml + docs/ja/programmers/api-variables/variable-security-settings.xml + docs/ja/programmers/api-variables/variable-security.xml + docs/ja/programmers/api-variables/variable-template-dir.xml + docs/ja/programmers/api-variables/variable-trusted-dir.xml + docs/ja/programmers/api-variables/variable-use-sub-dirs.xml + docs/ja/programmers/caching/caching-cacheable.xml + docs/ja/programmers/caching/caching-groups.xml + docs/ja/programmers/caching/caching-multiple-caches.xml + docs/ja/programmers/caching/caching-setting-up.xml + docs/ja/programmers/plugins/plugins-block-functions.xml + docs/ja/programmers/plugins/plugins-compiler-functions.xml + docs/ja/programmers/plugins/plugins-functions.xml + docs/ja/programmers/plugins/plugins-howto.xml + docs/ja/programmers/plugins/plugins-inserts.xml + docs/ja/programmers/plugins/plugins-modifiers.xml + docs/ja/programmers/plugins/plugins-naming-conventions.xml + docs/ja/programmers/plugins/plugins-outputfilters.xml + docs/ja/programmers/plugins/plugins-prefilters-postfilters.xml + docs/ja/programmers/plugins/plugins-resources.xml + docs/ja/programmers/plugins/plugins-writing.xml: + added Japanese translation files. + + * docs/Makefile.in + docs/configure.in: + added the configuration for Japanese translation. + +2007-04-11 Messju Mohr + + * docs/en/programmers/smarty-constants.xml: + fixed typo + +2007-04-04 Messju Mohr + + * docs/ru/getting-started.xml: + fixed uri for Zend Accelerator + +2007-04-03 Messju Mohr + + * docs/de/getting-started.xml + docs/es/getting-started.xml + docs/it/getting-started.xml + docs/pt_BR/getting-started.xml: + fixed uris for php-accelerator + +2007-03-08 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + +2007-03-07 Monte Ohrt + + * (Smarty_2_6_18) + NEWS: + update NEWS file with patch + + * (Smarty_2_6_18) + docs/en/designers/language-builtin-functions/language-function-section.xml: + note the fact that section loop will accept an integer + +2007-03-06 Monte Ohrt + + * NEWS + libs/plugins/function.html_select_date.php: + fix html_select_date separator when parts are missing (thanks to kayk for + the patch) + +2007-03-06 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + bumped version number + + * NEWS: + added release headline + + * libs/internals/core.write_compiled_include.php: + fixed detection of non-cached block when writing compiled includes + +2007-03-01 Danilo Buerger + + * NEWS + libs/Smarty_Compiler.class.php: + Applied boots clean up patch and removed commented out code. + Updated NEWS file + +2007-02-27 Danilo Buerger + + * NEWS + docs/en/designers/language-modifiers/language-modifier-date-format.xml + libs/internals/core.write_file.php + libs/plugins/modifier.date_format.php: + Updated smarty_core_write_file() and smarty_modifier_date_format() to speed + up Windows detection. + Emulated more parameters for Windows in smarty_modifier_date_format() and + fixed some old ones. + Updated the docs to tell what parameters are emulated on Windows. + Updated NEWS file. + + * NEWS: + Updated NEWS file to reflect changes commited in the last revision + +2007-02-27 Monte Ohrt + + * docs/en/appendixes/troubleshooting.xml: + fix typo + +2007-02-27 Danilo Buerger + + * libs/Smarty_Compiler.class.php: + Modified _(push|pop)_cacheable_state() to embedd alternate syntax. See this + bug report: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=10502 + +2007-02-26 Peter 'Mash' Morgan + + * docs/en/designers/language-custom-functions/language-function-html-options.xml: + Fix incorrect var name + +2007-02-23 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + escape creating of language=php from interleaving + + * libs/Smarty_Compiler.class.php: + add removed line back in + + * libs/Smarty_Compiler.class.php: + fix up last patch, remove unnecessary lines + + * libs/Smarty_Compiler.class.php: + fix situation when no compiled tags are present + + * libs/Smarty_Compiler.class.php: + fix problem with php open tags generated from tag interleaving + +2007-02-06 boots + + * docs/en/programmers/advanced-features/template-resources.xml: + Correct default template handler function example. + +2007-01-17 Messju Mohr + + * NEWS + libs/plugins/modifier.truncate.php: + fixed handling of $etc in the truncate modifier when $etc is longer + than $length. + + thanks to Sylvinus! + +2007-01-10 boots + + * NEWS + libs/plugins/modifier.date_format.php + libs/plugins/modifier.date_format.php: + fix handling of %I with mysql timestamps + + Thanks to Danilo Buerger + + * NEWS + libs/internals/core.write_file.php: + Better recognize Windows filesystems to reduce warnings + + * NEWS + libs/plugins/modifier.date_format.php: + Emulate %R in the date_format modifier on Windows + + Thanks to Danilo Buerger + +2006-12-10 Yannick Torres + + * docs/fr/getting-started.xml: + fix build + + * docs/fr/language-snippets.ent + docs/fr/designers/language-builtin-functions/language-function-include-php.xml + docs/fr/designers/language-modifiers/language-modifier-truncate.xml + docs/fr/designers/language-variables/language-variables-smarty.xml: + sync with EN + +2006-12-02 Peter 'Mash' Morgan + + * docs/en/designers/language-builtin-functions/language-function-include-php.xml: + Tidy example, speeling andd add links + + * docs/en/getting-started.xml: + Add/correct entities + + * docs/entities/global.ent: + Fix entities (strange) + +2006-12-01 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update dev version numbers + +2006-12-01 boots + + * (Smarty_2_6_16) + NEWS: + Fixed replacement bug introduced in trimwhitespaces output filter that + was introduced in the last release. + + Thanks to Spuerhund from the forums. + + * (Smarty_2_6_16) + libs/plugins/outputfilter.trimwhitespace.php: + Fixed replacement bug introduced by last changes. + + Thanks to Spuerhund from the forums. + +2006-11-30 Monte Ohrt + + * NEWS + docs/en/designers/language-modifiers/language-modifier-truncate.xml + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update dev version numbers, fix manual typo + +2006-11-22 George Miroshnikov + + * docs/ru/getting-started.xml + docs/ru/language-snippets.ent: + sync with EN + + * docs/en/getting-started.xml: + replaced hardcoded path separator with PATH_SEPARATOR constant + +2006-11-20 boots + + * libs/plugins/modifier.debug_print_var.php: + fix depth formatting of arrays and objects in modifier debug_print_var + +2006-11-10 Messju Mohr + + * docs/en/designers/language-variables/language-variables-smarty.xml: + fixed typo. thanks jonez. + +2006-11-08 boots + + * NEWS + libs/internals/core.write_file.php: + change file writing semantics in smarty_core_write_file() + + This avoids unlink() unless rename() fails or a Windows system is detected + + see: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=6956 + + Thanks to c960657 from the forums. + +2006-11-07 boots + + * NEWS + libs/debug.tpl: + update debug.tpl to xhtml 1.1 compliance, fix javascript escaping in debug + output and apply a Smarty based color scheme + + see: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=7178 + + thanks to cybot from the forums! + + * NEWS + libs/plugins/modifier.debug_print_var.php: + enhance reporting precision of debug_print_var modifier + + see: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=9281 + + thanks to cybot from the forums + +2006-11-01 boots + + * NEWS + libs/plugins/function.html_select_date.php: + make html_select_date work consistently with 0000-00-00 00:00:00 and + 0000-00-00 inputs + + Thanks to cybot from forums + +2006-10-16 George Miroshnikov + + * docs/en/language-snippets.ent: + minor typo fix - &$class doesn't make sense. + +2006-10-14 Yannick Torres + + * docs/fr/designers/language-basic-syntax.xml + docs/fr/designers/language-builtin-functions.xml + docs/fr/designers/language-basic-syntax/language-syntax-attributes.xml + docs/fr/designers/language-basic-syntax/language-syntax-comments.xml + docs/fr/designers/language-basic-syntax/language-syntax-quotes.xml + docs/fr/designers/language-builtin-functions/language-function-capture.xml + docs/fr/designers/language-builtin-functions/language-function-php.xml + docs/fr/designers/language-builtin-functions/language-function-section.xml + docs/fr/designers/language-custom-functions/language-function-popup-init.xml + docs/fr/designers/language-modifiers/language-modifier-escape.xml + docs/fr/programmers/api-functions/api-display.xml + docs/fr/programmers/plugins/plugins-inserts.xml: + sync with EN + +2006-10-14 Fernando Correa da Conceio + + * docs/pt_BR/programmers/api-variables/variable-error-reporting.xml: + New Translation + + * docs/pt_BR/designers/language-basic-syntax/language-escaping.xml + docs/pt_BR/designers/language-basic-syntax/language-syntax-variables.xml: + New Translations + + * docs/pt_BR/translation.xml: + Used in revcheck + + * docs/pt_BR/getting-started.xml + docs/pt_BR/language-snippets.ent + docs/pt_BR/make_chm_index.html + docs/pt_BR/preface.xml + docs/pt_BR/appendixes/resources.xml + docs/pt_BR/appendixes/troubleshooting.xml + docs/pt_BR/designers/language-modifiers/language-modifier-capitalize.xml + docs/pt_BR/designers/language-modifiers/language-modifier-cat.xml + docs/pt_BR/designers/language-modifiers/language-modifier-count-characters.xml + docs/pt_BR/designers/language-modifiers/language-modifier-count-paragraphs.xml + docs/pt_BR/designers/language-modifiers/language-modifier-count-sentences.xml + docs/pt_BR/designers/language-modifiers/language-modifier-count-words.xml + docs/pt_BR/designers/language-modifiers/language-modifier-date-format.xml + docs/pt_BR/designers/language-modifiers/language-modifier-default.xml + docs/pt_BR/designers/language-modifiers/language-modifier-escape.xml + docs/pt_BR/designers/language-modifiers/language-modifier-indent.xml + docs/pt_BR/designers/language-modifiers/language-modifier-lower.xml + docs/pt_BR/designers/language-modifiers/language-modifier-nl2br.xml + docs/pt_BR/designers/language-modifiers/language-modifier-regex-replace.xml + docs/pt_BR/designers/language-modifiers/language-modifier-replace.xml + docs/pt_BR/designers/language-modifiers/language-modifier-spacify.xml + docs/pt_BR/designers/language-modifiers/language-modifier-string-format.xml + docs/pt_BR/designers/language-modifiers/language-modifier-strip-tags.xml + docs/pt_BR/designers/language-modifiers/language-modifier-strip.xml + docs/pt_BR/designers/language-modifiers/language-modifier-truncate.xml + docs/pt_BR/designers/language-modifiers/language-modifier-upper.xml + docs/pt_BR/designers/language-modifiers/language-modifier-wordwrap.xml + docs/pt_BR/designers/language-variables/language-assigned-variables.xml + docs/pt_BR/designers/language-variables/language-config-variables.xml + docs/pt_BR/designers/language-variables/language-variables-smarty.xml + docs/pt_BR/programmers/advanced-features.xml + docs/pt_BR/programmers/api-functions.xml + docs/pt_BR/programmers/api-variables.xml + docs/pt_BR/programmers/caching.xml + docs/pt_BR/programmers/plugins.xml + docs/pt_BR/programmers/smarty-constants.xml + docs/pt_BR/programmers/advanced-features/advanced-features-objects.xml + docs/pt_BR/programmers/advanced-features/advanced-features-outputfilters.xml + docs/pt_BR/programmers/advanced-features/advanced-features-postfilters.xml + docs/pt_BR/programmers/advanced-features/advanced-features-prefilters.xml + docs/pt_BR/programmers/advanced-features/section-template-cache-handler-func.xml + docs/pt_BR/programmers/advanced-features/template-resources.xml + docs/pt_BR/programmers/api-functions/api-append-by-ref.xml + docs/pt_BR/programmers/api-functions/api-append.xml + docs/pt_BR/programmers/api-functions/api-assign-by-ref.xml + docs/pt_BR/programmers/api-functions/api-assign.xml + docs/pt_BR/programmers/api-functions/api-clear-all-assign.xml + docs/pt_BR/programmers/api-functions/api-clear-all-cache.xml + docs/pt_BR/programmers/api-functions/api-clear-assign.xml + docs/pt_BR/programmers/api-functions/api-clear-cache.xml + docs/pt_BR/programmers/api-functions/api-clear-compiled-tpl.xml + docs/pt_BR/programmers/api-functions/api-clear-config.xml + docs/pt_BR/programmers/api-functions/api-config-load.xml + docs/pt_BR/programmers/api-functions/api-display.xml + docs/pt_BR/programmers/api-functions/api-fetch.xml + docs/pt_BR/programmers/api-functions/api-get-config-vars.xml + docs/pt_BR/programmers/api-functions/api-get-registered-object.xml + docs/pt_BR/programmers/api-functions/api-get-template-vars.xml + docs/pt_BR/programmers/api-functions/api-is-cached.xml + docs/pt_BR/programmers/api-functions/api-load-filter.xml + docs/pt_BR/programmers/api-functions/api-register-block.xml + docs/pt_BR/programmers/api-functions/api-register-compiler-function.xml + docs/pt_BR/programmers/api-functions/api-register-function.xml + docs/pt_BR/programmers/api-functions/api-register-modifier.xml + docs/pt_BR/programmers/api-functions/api-register-object.xml + docs/pt_BR/programmers/api-functions/api-register-outputfilter.xml + docs/pt_BR/programmers/api-functions/api-register-postfilter.xml + docs/pt_BR/programmers/api-functions/api-register-prefilter.xml + docs/pt_BR/programmers/api-functions/api-register-resource.xml + docs/pt_BR/programmers/api-functions/api-template-exists.xml + docs/pt_BR/programmers/api-functions/api-trigger-error.xml + docs/pt_BR/programmers/api-functions/api-unregister-block.xml + docs/pt_BR/programmers/api-functions/api-unregister-compiler-function.xml + docs/pt_BR/programmers/api-functions/api-unregister-function.xml + docs/pt_BR/programmers/api-functions/api-unregister-modifier.xml + docs/pt_BR/programmers/api-functions/api-unregister-object.xml + docs/pt_BR/programmers/api-functions/api-unregister-outputfilter.xml + docs/pt_BR/programmers/api-functions/api-unregister-postfilter.xml + docs/pt_BR/programmers/api-functions/api-unregister-prefilter.xml + docs/pt_BR/programmers/api-functions/api-unregister-resource.xml + docs/pt_BR/programmers/api-variables/variable-autoload-filters.xml + docs/pt_BR/programmers/api-variables/variable-cache-dir.xml + docs/pt_BR/programmers/api-variables/variable-cache-handler-func.xml + docs/pt_BR/programmers/api-variables/variable-cache-lifetime.xml + docs/pt_BR/programmers/api-variables/variable-cache-modified-check.xml + docs/pt_BR/programmers/api-variables/variable-caching.xml + docs/pt_BR/programmers/api-variables/variable-compile-check.xml + docs/pt_BR/programmers/api-variables/variable-compile-dir.xml + docs/pt_BR/programmers/api-variables/variable-compile-id.xml + docs/pt_BR/programmers/api-variables/variable-compiler-class.xml + docs/pt_BR/programmers/api-variables/variable-config-booleanize.xml + docs/pt_BR/programmers/api-variables/variable-config-dir.xml + docs/pt_BR/programmers/api-variables/variable-config-fix-newlines.xml + docs/pt_BR/programmers/api-variables/variable-config-overwrite.xml + docs/pt_BR/programmers/api-variables/variable-config-read-hidden.xml + docs/pt_BR/programmers/api-variables/variable-debug-tpl.xml + docs/pt_BR/programmers/api-variables/variable-debugging-ctrl.xml + docs/pt_BR/programmers/api-variables/variable-debugging.xml + docs/pt_BR/programmers/api-variables/variable-default-modifiers.xml + docs/pt_BR/programmers/api-variables/variable-default-resource-type.xml + docs/pt_BR/programmers/api-variables/variable-default-template-handler-func.xml + docs/pt_BR/programmers/api-variables/variable-force-compile.xml + docs/pt_BR/programmers/api-variables/variable-global-assign.xml + docs/pt_BR/programmers/api-variables/variable-left-delimiter.xml + docs/pt_BR/programmers/api-variables/variable-php-handling.xml + docs/pt_BR/programmers/api-variables/variable-plugins-dir.xml + docs/pt_BR/programmers/api-variables/variable-request-use-auto-globals.xml + docs/pt_BR/programmers/api-variables/variable-request-vars-order.xml + docs/pt_BR/programmers/api-variables/variable-right-delimiter.xml + docs/pt_BR/programmers/api-variables/variable-secure-dir.xml + docs/pt_BR/programmers/api-variables/variable-security-settings.xml + docs/pt_BR/programmers/api-variables/variable-security.xml + docs/pt_BR/programmers/api-variables/variable-template-dir.xml + docs/pt_BR/programmers/api-variables/variable-trusted-dir.xml + docs/pt_BR/programmers/api-variables/variable-undefined.xml + docs/pt_BR/programmers/api-variables/variable-use-sub-dirs.xml + docs/pt_BR/programmers/caching/caching-cacheable.xml + docs/pt_BR/programmers/caching/caching-groups.xml + docs/pt_BR/programmers/caching/caching-multiple-caches.xml + docs/pt_BR/programmers/caching/caching-setting-up.xml + docs/pt_BR/programmers/plugins/plugins-block-functions.xml + docs/pt_BR/programmers/plugins/plugins-compiler-functions.xml + docs/pt_BR/programmers/plugins/plugins-functions.xml + docs/pt_BR/programmers/plugins/plugins-howto.xml + docs/pt_BR/programmers/plugins/plugins-inserts.xml + docs/pt_BR/programmers/plugins/plugins-modifiers.xml + docs/pt_BR/programmers/plugins/plugins-naming-conventions.xml + docs/pt_BR/programmers/plugins/plugins-outputfilters.xml + docs/pt_BR/programmers/plugins/plugins-prefilters-postfilters.xml + docs/pt_BR/programmers/plugins/plugins-resources.xml + docs/pt_BR/programmers/plugins/plugins-writing.xml: + Big update. Revision tag for all files. Some updates. Now I can update it + +2006-10-09 Peter 'Mash' Morgan + + * docs/en/getting-started.xml + docs/en/designers/language-basic-syntax.xml + docs/en/designers/language-custom-functions/language-function-popup-init.xml + docs/en/designers/language-modifiers/language-modifier-escape.xml + docs/en/programmers/api-functions/api-display.xml + docs/en/programmers/plugins/plugins-inserts.xml: + Minor changes and corrections + + * docs/en/designers/language-basic-syntax.xml + docs/en/designers/language-builtin-functions.xml + docs/en/designers/language-basic-syntax/language-syntax-attributes.xml + docs/en/designers/language-basic-syntax/language-syntax-comments.xml + docs/en/designers/language-basic-syntax/language-syntax-quotes.xml + docs/en/designers/language-modifiers/language-modifier-escape.xml: + Minor formatting and error correction + + * docs/en/designers/language-builtin-functions/language-function-capture.xml + docs/en/designers/language-builtin-functions/language-function-php.xml + docs/en/designers/language-builtin-functions/language-function-section.xml: + minor formatting and changes + + * docs/en/getting-started.xml: + Tidied up formatting so more readable, tidied up the install to the paths + are more clear (ta jj) + +2006-10-09 Yannick Torres + + * docs/fr/designers/language-builtin-functions/language-function-section.xml: + sync with EN + +2006-10-08 Yannick Torres + + * docs/fr/designers/language-builtin-functions/language-function-php.xml + docs/fr/designers/language-modifiers/language-modifier-escape.xml + docs/fr/designers/language-variables/language-variables-smarty.xml + docs/fr/programmers/api-variables/variable-request-use-auto-globals.xml: + fix build + + * docs/fr/designers/language-builtin-functions/language-function-strip.xml + docs/fr/programmers/caching.xml + docs/fr/programmers/smarty-constants.xml + docs/fr/programmers/api-variables/variable-autoload-filters.xml + docs/fr/programmers/api-variables/variable-cache-dir.xml + docs/fr/programmers/api-variables/variable-cache-handler-func.xml + docs/fr/programmers/api-variables/variable-cache-lifetime.xml + docs/fr/programmers/api-variables/variable-cache-modified-check.xml + docs/fr/programmers/api-variables/variable-caching.xml + docs/fr/programmers/api-variables/variable-compile-check.xml + docs/fr/programmers/api-variables/variable-compile-dir.xml + docs/fr/programmers/api-variables/variable-compile-id.xml + docs/fr/programmers/api-variables/variable-compiler-class.xml + docs/fr/programmers/api-variables/variable-config-booleanize.xml + docs/fr/programmers/api-variables/variable-config-dir.xml + docs/fr/programmers/api-variables/variable-config-fix-newlines.xml + docs/fr/programmers/api-variables/variable-config-overwrite.xml + docs/fr/programmers/api-variables/variable-config-read-hidden.xml + docs/fr/programmers/api-variables/variable-debug-tpl.xml + docs/fr/programmers/api-variables/variable-debugging-ctrl.xml + docs/fr/programmers/api-variables/variable-debugging.xml + docs/fr/programmers/api-variables/variable-default-modifiers.xml + docs/fr/programmers/api-variables/variable-default-resource-type.xml + docs/fr/programmers/api-variables/variable-default-template-handler-func.xml + docs/fr/programmers/api-variables/variable-error-reporting.xml + docs/fr/programmers/api-variables/variable-force-compile.xml + docs/fr/programmers/api-variables/variable-left-delimiter.xml + docs/fr/programmers/api-variables/variable-php-handling.xml + docs/fr/programmers/api-variables/variable-plugins-dir.xml + docs/fr/programmers/api-variables/variable-request-use-auto-globals.xml + docs/fr/programmers/api-variables/variable-request-vars-order.xml + docs/fr/programmers/api-variables/variable-right-delimiter.xml + docs/fr/programmers/api-variables/variable-secure-dir.xml + docs/fr/programmers/api-variables/variable-security-settings.xml + docs/fr/programmers/api-variables/variable-security.xml + docs/fr/programmers/api-variables/variable-template-dir.xml + docs/fr/programmers/api-variables/variable-trusted-dir.xml + docs/fr/programmers/api-variables/variable-use-sub-dirs.xml + docs/fr/programmers/caching/caching-cacheable.xml + docs/fr/programmers/caching/caching-groups.xml + docs/fr/programmers/caching/caching-multiple-caches.xml + docs/fr/programmers/caching/caching-setting-up.xml + docs/fr/programmers/plugins/plugins-block-functions.xml + docs/fr/programmers/plugins/plugins-compiler-functions.xml + docs/fr/programmers/plugins/plugins-functions.xml + docs/fr/programmers/plugins/plugins-inserts.xml + docs/fr/programmers/plugins/plugins-modifiers.xml + docs/fr/programmers/plugins/plugins-naming-conventions.xml + docs/fr/programmers/plugins/plugins-outputfilters.xml + docs/fr/programmers/plugins/plugins-prefilters-postfilters.xml + docs/fr/programmers/plugins/plugins-resources.xml + docs/fr/programmers/plugins/plugins-writing.xml: + sync with EN + +2006-10-07 Yannick Torres + + * docs/fr/programmers/advanced-features/advanced-features-objects.xml + docs/fr/programmers/advanced-features/advanced-features-outputfilters.xml + docs/fr/programmers/advanced-features/advanced-features-postfilters.xml + docs/fr/programmers/advanced-features/advanced-features-prefilters.xml + docs/fr/programmers/advanced-features/section-template-cache-handler-func.xml + docs/fr/programmers/advanced-features/template-resources.xml + docs/fr/programmers/api-functions/api-append-by-ref.xml + docs/fr/programmers/api-functions/api-append.xml + docs/fr/programmers/api-functions/api-assign-by-ref.xml + docs/fr/programmers/api-functions/api-assign.xml + docs/fr/programmers/api-functions/api-clear-all-assign.xml + docs/fr/programmers/api-functions/api-clear-all-cache.xml + docs/fr/programmers/api-functions/api-clear-assign.xml + docs/fr/programmers/api-functions/api-clear-cache.xml + docs/fr/programmers/api-functions/api-clear-compiled-tpl.xml + docs/fr/programmers/api-functions/api-clear-config.xml + docs/fr/programmers/api-functions/api-config-load.xml + docs/fr/programmers/api-functions/api-display.xml + docs/fr/programmers/api-functions/api-fetch.xml + docs/fr/programmers/api-functions/api-get-config-vars.xml + docs/fr/programmers/api-functions/api-get-registered-object.xml + docs/fr/programmers/api-functions/api-get-template-vars.xml + docs/fr/programmers/api-functions/api-is-cached.xml + docs/fr/programmers/api-functions/api-load-filter.xml + docs/fr/programmers/api-functions/api-register-block.xml + docs/fr/programmers/api-functions/api-register-compiler-function.xml + docs/fr/programmers/api-functions/api-register-function.xml + docs/fr/programmers/api-functions/api-register-modifier.xml + docs/fr/programmers/api-functions/api-register-object.xml + docs/fr/programmers/api-functions/api-register-outputfilter.xml + docs/fr/programmers/api-functions/api-register-postfilter.xml + docs/fr/programmers/api-functions/api-register-prefilter.xml + docs/fr/programmers/api-functions/api-register-resource.xml + docs/fr/programmers/api-functions/api-template-exists.xml + docs/fr/programmers/api-functions/api-trigger-error.xml + docs/fr/programmers/api-functions/api-unregister-block.xml + docs/fr/programmers/api-functions/api-unregister-compiler-function.xml + docs/fr/programmers/api-functions/api-unregister-function.xml + docs/fr/programmers/api-functions/api-unregister-modifier.xml + docs/fr/programmers/api-functions/api-unregister-object.xml + docs/fr/programmers/api-functions/api-unregister-outputfilter.xml + docs/fr/programmers/api-functions/api-unregister-postfilter.xml + docs/fr/programmers/api-functions/api-unregister-prefilter.xml + docs/fr/programmers/api-functions/api-unregister-resource.xml: + sync with EN + +2006-10-03 Yannick Torres + + * docs/fr/designers/language-custom-functions/language-function-html-select-time.xml + docs/fr/designers/language-custom-functions/language-function-html-table.xml + docs/fr/designers/language-custom-functions/language-function-mailto.xml + docs/fr/designers/language-custom-functions/language-function-math.xml + docs/fr/designers/language-custom-functions/language-function-popup-init.xml + docs/fr/designers/language-custom-functions/language-function-popup.xml + docs/fr/designers/language-custom-functions/language-function-textformat.xml + docs/fr/designers/language-modifiers/language-modifier-capitalize.xml + docs/fr/designers/language-modifiers/language-modifier-cat.xml + docs/fr/designers/language-modifiers/language-modifier-count-characters.xml + docs/fr/designers/language-modifiers/language-modifier-count-paragraphs.xml + docs/fr/designers/language-modifiers/language-modifier-count-sentences.xml + docs/fr/designers/language-modifiers/language-modifier-count-words.xml + docs/fr/designers/language-modifiers/language-modifier-date-format.xml + docs/fr/designers/language-modifiers/language-modifier-default.xml + docs/fr/designers/language-modifiers/language-modifier-escape.xml + docs/fr/designers/language-modifiers/language-modifier-indent.xml + docs/fr/designers/language-modifiers/language-modifier-lower.xml + docs/fr/designers/language-modifiers/language-modifier-nl2br.xml + docs/fr/designers/language-modifiers/language-modifier-regex-replace.xml + docs/fr/designers/language-modifiers/language-modifier-replace.xml + docs/fr/designers/language-modifiers/language-modifier-spacify.xml + docs/fr/designers/language-modifiers/language-modifier-string-format.xml + docs/fr/designers/language-modifiers/language-modifier-strip-tags.xml + docs/fr/designers/language-modifiers/language-modifier-strip.xml + docs/fr/designers/language-modifiers/language-modifier-truncate.xml + docs/fr/designers/language-modifiers/language-modifier-upper.xml + docs/fr/designers/language-modifiers/language-modifier-wordwrap.xml + docs/fr/designers/language-variables/language-assigned-variables.xml + docs/fr/designers/language-variables/language-config-variables.xml + docs/fr/designers/language-variables/language-variables-smarty.xml: + sync with EN + +2006-10-01 Yannick Torres + + * docs/fr/designers/language-builtin-functions/language-function-include-php.xml + docs/fr/designers/language-builtin-functions/language-function-include.xml + docs/fr/designers/language-builtin-functions/language-function-insert.xml + docs/fr/designers/language-builtin-functions/language-function-ldelim.xml + docs/fr/designers/language-builtin-functions/language-function-literal.xml + docs/fr/designers/language-builtin-functions/language-function-php.xml + docs/fr/designers/language-custom-functions/language-function-assign.xml + docs/fr/designers/language-custom-functions/language-function-counter.xml + docs/fr/designers/language-custom-functions/language-function-cycle.xml + docs/fr/designers/language-custom-functions/language-function-debug.xml + docs/fr/designers/language-custom-functions/language-function-eval.xml + docs/fr/designers/language-custom-functions/language-function-fetch.xml + docs/fr/designers/language-custom-functions/language-function-html-checkboxes.xml + docs/fr/designers/language-custom-functions/language-function-html-image.xml + docs/fr/designers/language-custom-functions/language-function-html-options.xml + docs/fr/designers/language-custom-functions/language-function-html-radios.xml + docs/fr/designers/language-custom-functions/language-function-html-select-date.xml: + sync with EN + +2006-09-30 Yannick Torres + + * docs/fr/getting-started.xml: + fix build + + * docs/fr/designers/chapter-debugging-console.xml + docs/fr/designers/config-files.xml + docs/fr/designers/language-builtin-functions.xml + docs/fr/designers/language-modifiers.xml + docs/fr/designers/language-variables.xml + docs/fr/designers/language-basic-syntax/language-escaping.xml + docs/fr/designers/language-basic-syntax/language-math.xml + docs/fr/designers/language-basic-syntax/language-syntax-comments.xml + docs/fr/designers/language-basic-syntax/language-syntax-functions.xml + docs/fr/designers/language-basic-syntax/language-syntax-quotes.xml + docs/fr/designers/language-basic-syntax/language-syntax-variables.xml + docs/fr/designers/language-builtin-functions/language-function-capture.xml + docs/fr/designers/language-builtin-functions/language-function-config-load.xml + docs/fr/designers/language-builtin-functions/language-function-foreach.xml + docs/fr/designers/language-builtin-functions/language-function-if.xml: + sync with EN + + * docs/fr/getting-started.xml + docs/fr/language-snippets.ent + docs/fr/appendixes/resources.xml + docs/fr/appendixes/tips.xml + docs/fr/appendixes/troubleshooting.xml: + sync with EN + +2006-09-27 Peter 'Mash' Morgan + + * docs/en/designers/language-builtin-functions/language-function-section.xml: + Minor tweaks and corrections + + * docs/en/getting-started.xml + docs/en/designers/chapter-debugging-console.xml + docs/en/designers/language-basic-syntax/language-syntax-comments.xml + docs/en/designers/language-custom-functions/language-function-html-image.xml + docs/en/designers/language-custom-functions/language-function-html-options.xml + docs/en/designers/language-custom-functions/language-function-html-radios.xml + docs/en/designers/language-custom-functions/language-function-html-select-date.xml + docs/en/designers/language-custom-functions/language-function-html-select-time.xml + docs/en/designers/language-custom-functions/language-function-html-table.xml + docs/en/designers/language-custom-functions/language-function-mailto.xml + docs/en/designers/language-custom-functions/language-function-popup-init.xml + docs/en/designers/language-custom-functions/language-function-textformat.xml + docs/en/designers/language-variables/language-config-variables.xml + docs/en/designers/language-variables/language-variables-smarty.xml: + Add literal tags to html, general formatting + + * docs/en/getting-started.xml + docs/en/appendixes/resources.xml + docs/en/appendixes/tips.xml + docs/en/appendixes/troubleshooting.xml + docs/en/designers/config-files.xml + docs/en/programmers/caching.xml + docs/en/programmers/smarty-constants.xml + docs/en/programmers/advanced-features/advanced-features-objects.xml + docs/en/programmers/advanced-features/advanced-features-outputfilters.xml + docs/en/programmers/advanced-features/advanced-features-postfilters.xml + docs/en/programmers/advanced-features/advanced-features-prefilters.xml + docs/en/programmers/advanced-features/section-template-cache-handler-func.xml + docs/en/programmers/advanced-features/template-resources.xml + docs/en/programmers/api-variables/variable-autoload-filters.xml + docs/en/programmers/api-variables/variable-cache-dir.xml + docs/en/programmers/api-variables/variable-cache-handler-func.xml + docs/en/programmers/api-variables/variable-cache-lifetime.xml + docs/en/programmers/api-variables/variable-cache-modified-check.xml + docs/en/programmers/api-variables/variable-caching.xml + docs/en/programmers/api-variables/variable-compile-check.xml + docs/en/programmers/api-variables/variable-compile-dir.xml + docs/en/programmers/api-variables/variable-compile-id.xml + docs/en/programmers/api-variables/variable-config-booleanize.xml + docs/en/programmers/api-variables/variable-config-dir.xml + docs/en/programmers/api-variables/variable-config-fix-newlines.xml + docs/en/programmers/api-variables/variable-config-overwrite.xml + docs/en/programmers/api-variables/variable-config-read-hidden.xml + docs/en/programmers/api-variables/variable-debug-tpl.xml + docs/en/programmers/api-variables/variable-debugging-ctrl.xml + docs/en/programmers/api-variables/variable-debugging.xml + docs/en/programmers/api-variables/variable-default-modifiers.xml + docs/en/programmers/api-variables/variable-default-resource-type.xml + docs/en/programmers/api-variables/variable-error-reporting.xml + docs/en/programmers/api-variables/variable-force-compile.xml + docs/en/programmers/api-variables/variable-left-delimiter.xml + docs/en/programmers/api-variables/variable-php-handling.xml + docs/en/programmers/api-variables/variable-plugins-dir.xml + docs/en/programmers/api-variables/variable-request-use-auto-globals.xml + docs/en/programmers/api-variables/variable-request-vars-order.xml + docs/en/programmers/api-variables/variable-right-delimiter.xml + docs/en/programmers/api-variables/variable-secure-dir.xml + docs/en/programmers/api-variables/variable-security-settings.xml + docs/en/programmers/api-variables/variable-security.xml + docs/en/programmers/api-variables/variable-template-dir.xml + docs/en/programmers/api-variables/variable-trusted-dir.xml + docs/en/programmers/api-variables/variable-use-sub-dirs.xml + docs/en/programmers/caching/caching-cacheable.xml + docs/en/programmers/caching/caching-groups.xml + docs/en/programmers/caching/caching-multiple-caches.xml + docs/en/programmers/caching/caching-setting-up.xml: + Tidy up of formatting + + * docs/entities/global.ent: + Adding some more resources + + * docs/en/programmers/plugins/plugins-block-functions.xml + docs/en/programmers/plugins/plugins-compiler-functions.xml + docs/en/programmers/plugins/plugins-functions.xml + docs/en/programmers/plugins/plugins-inserts.xml + docs/en/programmers/plugins/plugins-modifiers.xml + docs/en/programmers/plugins/plugins-naming-conventions.xml + docs/en/programmers/plugins/plugins-outputfilters.xml + docs/en/programmers/plugins/plugins-prefilters-postfilters.xml + docs/en/programmers/plugins/plugins-resources.xml + docs/en/programmers/plugins/plugins-writing.xml: + Tidy up some formatting + +2006-09-26 Peter 'Mash' Morgan + + * docs/en/programmers/api-functions/api-append-by-ref.xml + docs/en/programmers/api-functions/api-append.xml + docs/en/programmers/api-functions/api-assign-by-ref.xml + docs/en/programmers/api-functions/api-assign.xml + docs/en/programmers/api-functions/api-clear-all-assign.xml + docs/en/programmers/api-functions/api-clear-all-cache.xml + docs/en/programmers/api-functions/api-clear-assign.xml + docs/en/programmers/api-functions/api-clear-cache.xml + docs/en/programmers/api-functions/api-clear-compiled-tpl.xml + docs/en/programmers/api-functions/api-clear-config.xml + docs/en/programmers/api-functions/api-config-load.xml + docs/en/programmers/api-functions/api-display.xml + docs/en/programmers/api-functions/api-fetch.xml + docs/en/programmers/api-functions/api-get-config-vars.xml + docs/en/programmers/api-functions/api-get-registered-object.xml + docs/en/programmers/api-functions/api-get-template-vars.xml + docs/en/programmers/api-functions/api-is-cached.xml + docs/en/programmers/api-functions/api-load-filter.xml + docs/en/programmers/api-functions/api-register-block.xml + docs/en/programmers/api-functions/api-register-compiler-function.xml + docs/en/programmers/api-functions/api-register-function.xml + docs/en/programmers/api-functions/api-register-modifier.xml + docs/en/programmers/api-functions/api-register-object.xml + docs/en/programmers/api-functions/api-register-outputfilter.xml + docs/en/programmers/api-functions/api-register-postfilter.xml + docs/en/programmers/api-functions/api-register-prefilter.xml + docs/en/programmers/api-functions/api-register-resource.xml + docs/en/programmers/api-functions/api-template-exists.xml + docs/en/programmers/api-functions/api-trigger-error.xml + docs/en/programmers/api-functions/api-unregister-block.xml + docs/en/programmers/api-functions/api-unregister-compiler-function.xml + docs/en/programmers/api-functions/api-unregister-function.xml + docs/en/programmers/api-functions/api-unregister-modifier.xml + docs/en/programmers/api-functions/api-unregister-object.xml + docs/en/programmers/api-functions/api-unregister-outputfilter.xml + docs/en/programmers/api-functions/api-unregister-postfilter.xml + docs/en/programmers/api-functions/api-unregister-prefilter.xml + docs/en/programmers/api-functions/api-unregister-resource.xml: + Tidy up formatting and examples + + * docs/en/language-snippets.ent: + Moved recurring para for register_* + + * docs/en/designers/language-modifiers.xml: + Spelling on modifiers + + * docs/en/designers/language-builtin-functions.xml + docs/en/designers/language-modifiers.xml + docs/en/designers/language-custom-functions/language-function-html-options.xml + docs/en/designers/language-modifiers/language-modifier-capitalize.xml + docs/en/designers/language-modifiers/language-modifier-cat.xml + docs/en/designers/language-modifiers/language-modifier-count-characters.xml + docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml + docs/en/designers/language-modifiers/language-modifier-count-sentences.xml + docs/en/designers/language-modifiers/language-modifier-count-words.xml + docs/en/designers/language-modifiers/language-modifier-date-format.xml + docs/en/designers/language-modifiers/language-modifier-default.xml + docs/en/designers/language-modifiers/language-modifier-escape.xml + docs/en/designers/language-modifiers/language-modifier-indent.xml + docs/en/designers/language-modifiers/language-modifier-lower.xml + docs/en/designers/language-modifiers/language-modifier-nl2br.xml + docs/en/designers/language-modifiers/language-modifier-regex-replace.xml + docs/en/designers/language-modifiers/language-modifier-replace.xml + docs/en/designers/language-modifiers/language-modifier-spacify.xml + docs/en/designers/language-modifiers/language-modifier-string-format.xml + docs/en/designers/language-modifiers/language-modifier-strip-tags.xml + docs/en/designers/language-modifiers/language-modifier-strip.xml + docs/en/designers/language-modifiers/language-modifier-truncate.xml + docs/en/designers/language-modifiers/language-modifier-upper.xml + docs/en/designers/language-modifiers/language-modifier-wordwrap.xml: + Tidying up some markup + + * docs/en/designers/language-variables.xml: + typo + + * docs/en/designers/language-variables.xml + docs/en/designers/language-variables/language-assigned-variables.xml + docs/en/designers/language-variables/language-config-variables.xml + docs/en/designers/language-variables/language-variables-smarty.xml: + Tidy up formatting on variables + + * docs/en/designers/language-basic-syntax/language-escaping.xml + docs/en/designers/language-basic-syntax/language-math.xml + docs/en/designers/language-basic-syntax/language-syntax-comments.xml + docs/en/designers/language-basic-syntax/language-syntax-functions.xml + docs/en/designers/language-basic-syntax/language-syntax-quotes.xml + docs/en/designers/language-basic-syntax/language-syntax-variables.xml: + Formatting of the basic-syntax dir + + * docs/en/designers/language-custom-functions/language-function-assign.xml + docs/en/designers/language-custom-functions/language-function-counter.xml + docs/en/designers/language-custom-functions/language-function-cycle.xml + docs/en/designers/language-custom-functions/language-function-debug.xml + docs/en/designers/language-custom-functions/language-function-eval.xml + docs/en/designers/language-custom-functions/language-function-fetch.xml + docs/en/designers/language-custom-functions/language-function-html-checkboxes.xml + docs/en/designers/language-custom-functions/language-function-html-image.xml + docs/en/designers/language-custom-functions/language-function-html-options.xml + docs/en/designers/language-custom-functions/language-function-html-radios.xml + docs/en/designers/language-custom-functions/language-function-html-select-date.xml + docs/en/designers/language-custom-functions/language-function-html-select-time.xml + docs/en/designers/language-custom-functions/language-function-html-table.xml + docs/en/designers/language-custom-functions/language-function-mailto.xml + docs/en/designers/language-custom-functions/language-function-math.xml + docs/en/designers/language-custom-functions/language-function-popup-init.xml + docs/en/designers/language-custom-functions/language-function-popup.xml + docs/en/designers/language-custom-functions/language-function-textformat.xml: + More formatting and cleaning up examples + +2006-09-25 Peter 'Mash' Morgan + + * docs/en/designers/language-builtin-functions/language-function-foreach.xml + docs/en/designers/language-builtin-functions/language-function-section.xml: + Doh! removing tabs + + * docs/en/designers/language-builtin-functions/language-function-capture.xml + docs/en/designers/language-builtin-functions/language-function-config-load.xml + docs/en/designers/language-builtin-functions/language-function-foreach.xml + docs/en/designers/language-builtin-functions/language-function-if.xml + docs/en/designers/language-builtin-functions/language-function-include-php.xml + docs/en/designers/language-builtin-functions/language-function-include.xml + docs/en/designers/language-builtin-functions/language-function-insert.xml + docs/en/designers/language-builtin-functions/language-function-ldelim.xml + docs/en/designers/language-builtin-functions/language-function-literal.xml + docs/en/designers/language-builtin-functions/language-function-php.xml + docs/en/designers/language-builtin-functions/language-function-section.xml + docs/en/designers/language-builtin-functions/language-function-strip.xml: + A lot of formatting, tagging and tidy up. Some consistency at last + + * docs/en/designers/language-builtin-functions/language-function-section.xml: + Major tidy up + + * docs/en/designers/language-builtin-functions/language-function-foreach.xml: + Major tidy up, added index property and some examples + +2006-09-03 Yannick Torres + + * docs/fr/designers/language-custom-functions/language-function-popup-init.xml + docs/fr/programmers/advanced-features/advanced-features-outputfilters.xml + docs/fr/programmers/advanced-features/advanced-features-postfilters.xml + docs/fr/programmers/advanced-features/advanced-features-prefilters.xml: + sync with EN + +2006-09-01 George Miroshnikov + + * docs/ru/programmers/api-functions/api-append-by-ref.xml + docs/ru/programmers/api-functions/api-append.xml + docs/ru/programmers/api-functions/api-assign-by-ref.xml + docs/ru/programmers/api-functions/api-assign.xml + docs/ru/programmers/api-functions/api-clear-all-assign.xml + docs/ru/programmers/api-functions/api-clear-all-cache.xml + docs/ru/programmers/api-functions/api-clear-assign.xml + docs/ru/programmers/api-functions/api-clear-cache.xml + docs/ru/programmers/api-functions/api-clear-compiled-tpl.xml + docs/ru/programmers/api-functions/api-clear-config.xml + docs/ru/programmers/api-functions/api-config-load.xml + docs/ru/programmers/api-functions/api-display.xml: + sync with EN + +2006-08-25 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed wrong handling of name attribute in {insert} + thanks to Ivan Kravets for reporting this + + * libs/Smarty_Compiler.class.php: + fixed typo + +2006-08-21 George Miroshnikov + + * docs/ru/designers/language-custom-functions/language-function-popup-init.xml + docs/ru/programmers/advanced-features/advanced-features-objects.xml + docs/ru/programmers/advanced-features/advanced-features-outputfilters.xml + docs/ru/programmers/advanced-features/advanced-features-postfilters.xml + docs/ru/programmers/advanced-features/advanced-features-prefilters.xml + docs/ru/programmers/advanced-features/section-template-cache-handler-func.xml + docs/ru/programmers/advanced-features/template-resources.xml: + sync with EN + + * docs/en/programmers/advanced-features/advanced-features-prefilters.xml: + another missing dot + + * docs/en/programmers/advanced-features/advanced-features-postfilters.xml: + missing dot + + * docs/en/programmers/advanced-features/advanced-features-outputfilters.xml: + missing comma + +2006-08-19 Peter 'Mash' Morgan + + * docs/en/designers/language-custom-functions/language-function-popup-init.xml: + avoid dupes and added remote paths + +2006-08-06 Yannick Torres + + * docs/fr/designers/language-custom-functions/language-function-html-table.xml + docs/fr/designers/language-custom-functions/language-function-mailto.xml: + sync with EN + +2006-08-03 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fix false replacement of "$t" inside double quotes + thanks to checat for reporting this + +2006-07-20 George Miroshnikov + + * docs/ru/designers/language-custom-functions/language-function-html-table.xml + docs/ru/designers/language-custom-functions/language-function-mailto.xml: + incrementing EN-Revision + + * docs/ru/designers/language-custom-functions/language-function-assign.xml + docs/ru/designers/language-custom-functions/language-function-eval.xml + docs/ru/designers/language-custom-functions/language-function-fetch.xml + docs/ru/designers/language-custom-functions/language-function-html-checkboxes.xml + docs/ru/designers/language-custom-functions/language-function-html-image.xml + docs/ru/designers/language-custom-functions/language-function-html-options.xml + docs/ru/designers/language-custom-functions/language-function-html-radios.xml + docs/ru/designers/language-custom-functions/language-function-html-table.xml + docs/ru/designers/language-custom-functions/language-function-mailto.xml + docs/ru/designers/language-custom-functions/language-function-popup-init.xml + docs/ru/designers/language-custom-functions/language-function-popup.xml + docs/ru/designers/language-modifiers/language-modifier-date-format.xml + docs/ru/designers/language-modifiers/language-modifier-default.xml + docs/ru/designers/language-modifiers/language-modifier-escape.xml + docs/ru/designers/language-modifiers/language-modifier-indent.xml + docs/ru/designers/language-modifiers/language-modifier-lower.xml + docs/ru/designers/language-modifiers/language-modifier-nl2br.xml + docs/ru/designers/language-modifiers/language-modifier-strip.xml + docs/ru/designers/language-modifiers/language-modifier-truncate.xml + docs/ru/designers/language-modifiers/language-modifier-upper.xml + docs/ru/designers/language-modifiers/language-modifier-wordwrap.xml + docs/ru/designers/language-variables/language-variables-smarty.xml: + sync with EN + + * docs/en/designers/language-custom-functions/language-function-mailto.xml: + typo + +2006-07-10 boots + + * libs/plugins/function.html_table.php: + fixed email address in comments + + * NEWS + libs/plugins/function.html_table.php: + html_table: fixed th/tr output, added hdir support for column + headings,update docs to reflect new features + +2006-07-08 Messju Mohr + + * libs/plugins/function.html_table.php: + fix occasional notices on undefined variables + +2006-07-08 boots + + * libs/plugins/function.html_table.php: + Added ability to specify column headings in {html_table} + + Added th_attrs attribute which works similary to td_attr and tr_attr but + for TH elements. Changes the cols attribute to allow mixed values; a + numeric still specifies the number of columns to render but now an array + of values can be used to specify TH column values. The number of columns + is determine from the size of the array. Further, a comma-separated + string of column names can be used which is internally coverted to an + array and used as if it was specified as a normal array. + + Thanks for lynlyn for the feature request. + +2006-06-23 boots + + * libs/plugins/outputfilter.trimwhitespace.php: + fix comments in outputfilter.trimwhitespace + + * NEWS + libs/plugins/outputfilter.trimwhitespace.php: + fixed ordering of replacements in trimwhitespace output filter + + Thanks to Getty from IRC for reporting this. + +2006-06-20 boots + + * NEWS + libs/plugins/function.mailto.php: + update mailto function plugin to work around a firefox/thunderbird escaping + bug + + Thanks to elijahlofgren from the forums for reporting this and providing + the necessary patch + + * NEWS + libs/plugins/modifier.date_format.php: + emulate %l in the date_format modifier on windows + + thanks to Gibberish from the forums for reporting this + +2006-06-14 boots + + * NEWS + libs/plugins/modifier.capitalize.php: + Fix handling of apostrophes in the capitalize modifier. + + Thanks to asmecher from the forums for reporting this and providing a + partial solution. + +2006-05-28 Monte Ohrt + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + +2006-05-25 boots + + * NEWS + libs/Smarty_Compiler.class.php: + un-hide hidden xml open tags + +2006-05-09 boots + + * NEWS + libs/Smarty_Compiler.class.php: + separate handling of comment blocks from "special blocks" + + * NEWS + libs/plugins/function.popup_init.php: + reverted {popup_init} as proposed change to insertion behviour was not BC + +2006-05-04 boots + + * NEWS + libs/plugins/function.popup_init.php: + changed {popup_init} to only emit code once during a request + + Thanks to TGKnIght from forums + +2006-04-22 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fix handling of block-methods of registered objects + thanks to El Hombre Gris + +2006-04-04 Monte Ohrt + + * libs/plugins/function.html_select_date.php: + fix typo + +2006-03-09 Monte Ohrt + + * (Smarty_2_6_13) + NEWS: + update for release + +2006-03-08 Monte Ohrt + + * libs/plugins/modifier.regex_replace.php: + remove delim quote + + * libs/plugins/modifier.regex_replace.php: + fix delimiter issue + +2006-03-03 Monte Ohrt + + * libs/plugins/modifier.regex_replace.php: + use preg_replace to cover any space chars + + * libs/plugins/modifier.regex_replace.php: + fix problem with allowing "e" modifier + +2006-01-29 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed possiblity for E_NOTICE on an undefined variable in + Smarty_Compiler::_compile_if_tag() - thanks to sbeh + +2006-01-18 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + + * (Smarty_2_6_12) + NEWS: + commit 2.6.12 release + +2006-01-15 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed use of references $cache_attrs and $repeat in Smarty_Compiler. + + php does not allow to pass an assigned by reference to a function. since + php-5.1.2 + the reference to the lval gets lost when passing an assignment. + +2005-12-31 Messju Mohr + + * NEWS + libs/Smarty.class.php: + fixed incompatible use of fread() in Smarty::_read_file() + it choke on php-5.1.1 and later. + thanks to andig for pointing this out. + +2005-12-21 boots + + * NEWS + libs/Smarty_Compiler.class.php: + Fix improper tokenization of certain inline math expressions. + + Thanks to gerard at forums for reporting this. + +2005-12-19 Messju Mohr + + * libs/plugins/function.math.php: + fixed problem with math in certain LC_NUMERIC locales. + thanks to wiebren for providing problem+solution. + +2005-12-14 Messju Mohr + + * NEWS: + fixed iso-latin1 special chars + +2005-12-14 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + + * (Smarty_2_6_11) + NEWS: + commit NEWS file for 2.6.11 + +2005-12-08 Messju Mohr + + * docs/de/getting-started.xml: + sync with en + +2005-11-29 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed code generation of non-cacheable blocks to play well with php's + "Alternative syntax" used for example in compiled {if}..{else}..{/if} + blocks. + + (see: http://php.net/manual/en/control-structures.alternative-syntax.php + on "Alternative syntax") + + thanks to kihara from the forum. + +2005-11-26 Messju Mohr + + * NEWS: + fixed handling of multiple identical calls to {insert}. + + the function was called multiple times, but all inserts where replaced + by the results of the first call to the insert function. + + * libs/plugins/compiler.assign.php + libs/plugins/function.config_load.php: + added credits + + * libs/plugins/function.popup.php: + added "closeclick" from + http://www.bosrup.com/web/overlib/?Command_Reference + +2005-11-23 boots + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/modifier.escape.php: + replace {} string access with equivalent substr() to avoid E_STRICT + warnings in PHP 5.1 + +2005-11-09 boots + + * NEWS + libs/Smarty.class.php: + return valid reference in get_config_vars() when given var is non-existant + +2005-10-11 Monte Ohrt + + * libs/plugins/block.textformat.php + libs/plugins/compiler.assign.php + libs/plugins/function.assign_debug_info.php + libs/plugins/function.config_load.php + libs/plugins/function.counter.php + libs/plugins/function.eval.php + libs/plugins/function.fetch.php + libs/plugins/function.html_options.php + libs/plugins/function.html_select_date.php + libs/plugins/function.html_select_time.php + libs/plugins/function.math.php + libs/plugins/function.popup.php + libs/plugins/function.popup_init.php + libs/plugins/modifier.capitalize.php + libs/plugins/modifier.count_characters.php + libs/plugins/modifier.count_paragraphs.php + libs/plugins/modifier.count_sentences.php + libs/plugins/modifier.count_words.php + libs/plugins/modifier.date_format.php + libs/plugins/modifier.debug_print_var.php + libs/plugins/modifier.default.php + libs/plugins/modifier.escape.php + libs/plugins/modifier.indent.php + libs/plugins/modifier.lower.php + libs/plugins/modifier.regex_replace.php + libs/plugins/modifier.replace.php + libs/plugins/modifier.spacify.php + libs/plugins/modifier.string_format.php + libs/plugins/modifier.strip_tags.php + libs/plugins/modifier.truncate.php + libs/plugins/modifier.upper.php + libs/plugins/modifier.wordwrap.php + libs/plugins/shared.escape_special_chars.php + libs/plugins/shared.make_timestamp.php: + Added author title to plugins where they don't exist. I put my name where I + was the original or co-author. If there needs to be more credit given + somewhere, speak up! + +2005-10-10 Monte Ohrt + + * NEWS + libs/plugins/function.html_image.php: + add path_prefix to html_image, fix incorrect secure_dir error when image + file is missing + +2005-10-04 Monte Ohrt + + * demo/templates/index.tpl: + remove popup example, update section var syntax + +2005-09-16 Nuno Lopes + + * docs/de/getting-started.xml: + more fixes + + * docs/de/getting-started.xml: + fix php bug #34520: broken example display (de only) + +2005-08-30 Monte Ohrt + + * libs/plugins/modifier.escape.php: + change default charset from utf8 to iso-8859-1 + + * NEWS + libs/plugins/modifier.escape.php: + add char_set param + +2005-08-17 Monte Ohrt + + * NEWS: + fix notice in debug security check + + * libs/Smarty.class.php: + fix typo + + * NEWS + libs/Smarty.class.php: + return valid reference in get_template_vars() when given var is + non-existant + +2005-08-12 Monte Ohrt + + * NEWS + libs/plugins/modifier.escape.php: + add "urlpathinfo" escape type to escape modifier. (apache does not like %2F + in the PATH_INFO) + +2005-08-05 Monte Ohrt + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + +2005-08-04 Monte Ohrt + + * NEWS: + update secure_dir notes + + * NEWS: + allow debug.tpl to work from arbitrary dir + +2005-08-04 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed proper escaping for literal strings passed to + Smarty_Compiler::_expand_quoted_text() by + Smarty_Compiler::_parse_var_props() + +2005-07-27 Messju Mohr + + * NEWS + libs/plugins/shared.make_timestamp.php: + removed ambiguity for numeric values passed to smarty_make_timestamp(). + numeric values are *always* treated as timestamps now. + +2005-07-18 Messju Mohr + + * libs/Config_File.class.php: + removed E_NOTICE from Config_File::get() + + * libs/Smarty.class.php: + removed E_NOTICE + +2005-07-10 Yannick Torres + + * docs/fr/getting-started.xml: + sync with EN + +2005-07-08 Monte Ohrt + + * NEWS: + correct username in NEWS file + + * NEWS + libs/plugins/function.html_select_date.php: + added passthru attribute feature to html_select_date + +2005-07-03 Yannick Torres + + * docs/fr/language-snippets.ent + docs/fr/preface.xml: + sync with EN + +2005-06-16 Messju Mohr + + * docs/de/preface.xml + docs/de/preface.xml: + sync with en + +2005-06-13 Monte Ohrt + + * NEWS + libs/plugins/modifier.truncate.php: + add "middle" parameter to truncate modifier + +2005-06-10 Messju Mohr + + * docs/de/livedocs.ent: + added german livedocs.ent + + * docs/de/language-snippets.ent + docs/de/preface.xml: + sync with en + +2005-06-09 Messju Mohr + + * docs/de/bookinfo.xml + docs/de/getting-started.xml + docs/de/getting-started.xml: + sync with en + +2005-05-24 Yannick Torres + + * docs/fr/getting-started.xml + docs/fr/language-snippets.ent: + sync with EN + +2005-05-20 Monte Ohrt + + * libs/plugins/function.html_radios.php: + fix allowable label id characters + +2005-05-06 Monte Ohrt + + * NEWS + libs/plugins/function.html_radios.php: + make form input label ids optional (monte) + +2005-05-02 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + add error message for empty if/elseif statements + +2005-04-15 Monte Ohrt + + * NEWS + libs/plugins/function.html_radios.php: + cast selected value to string for comparison in html_radios + +2005-04-07 Messju Mohr + + * NEWS + libs/plugins/function.html_select_date.php: + added xhtml compliance to html_select_date's year_as_text-feature + thanks to Mark West + + * NEWS + libs/plugins/function.html_select_date.php: + fixed handling of selected month html_select_date + thanks to Yuri Weseman for providing problem+solution + +2005-04-07 Nuno Lopes + + * docs/configure.in: + sync configure and file-entities scripts with phpdoc, for better + windows/cygwin support + +2005-03-31 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + + * (Smarty_2_6_9) + NEWS: + update NEWS file + +2005-03-30 Messju Mohr + + * libs/plugins/function.math.php: + re-enabled hex-constant. i hope in a sane way this time. + +2005-03-30 Monte Ohrt + + * libs/plugins/function.math.php: + fix function testing logic + + * libs/Smarty_Compiler.class.php: + disable variable func calls completely + + * libs/Smarty_Compiler.class.php: + disallow variable func calls when security is enabled + +2005-03-22 Messju Mohr + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + bumped version-number to 2.6.9-dev + added headline of 2.6.6 release to NEWS file + +2005-03-21 Messju Mohr + + * (Smarty_2_6_8) + NEWS: + maybe even better this way. thanks monte :) + + * NEWS: + little more clear news-entry + +2005-03-21 Monte Ohrt + + * NEWS: + update NEWS with e-modifier removal + + * (Smarty_2_6_8) + libs/plugins/modifier.regex_replace.php: + remove e-modifier + +2005-03-19 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + objects don't get casted to arrays anymore in {foreach} + +2005-02-26 Messju Mohr + + * NEWS + libs/Smarty.class.php: + add "null" as a valid token for {if} when security is enabled + +2005-02-25 Monte Ohrt + + * NEWS + libs/plugins/function.mailto.php: + add javascript_charcode option to mailto + +2005-02-24 Monte Ohrt + + * NEWS: + update NEWS file + + * QUICK_START + libs/plugins/function.html_radios.php: + add label ids to html_radios + +2005-02-10 Monte Ohrt + + * QUICK_START: + update with directory structure + +2005-02-10 Nuno Lopes + + * docs/Makefile.in: + fix chm generation + +2005-02-10 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed too agressive {strip} around delimiters inside strip-blocks + +2005-02-10 Monte Ohrt + + * QUICK_START: + fix a couple errors + +2005-02-10 Nuno Lopes + + * docs/Makefile.in + docs/README: + commiting the new tools to make the CHM manual. + +2005-02-09 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed handling of strip-tags with non-default delimiters + +2005-02-04 Messju Mohr + + * libs/plugins/function.html_radios.php: + fixed syntax error. shame on me. + +2005-02-03 Monte Ohrt + + * QUICK_START: + fix example + + * QUICK_START: + initial commit + + * RELEASE_NOTES + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers in cvs + + * (Smarty_2_6_7) + NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + commit version numbers for new release + +2005-02-03 Messju Mohr + + * (Smarty_2_6_7) + libs/plugins/function.html_image.php: + fixed comment (thanks to CirTap) + +2005-02-01 Monte Ohrt + + * libs/plugins/function.html_image.php: + remove border tag + +2005-02-01 Messju Mohr + + * libs/Smarty.class.php: + fixed serialization of values containing newlines (like _cache_attrs) + in core_write_cache_file() + + bumped version to 2.6.6-dev-3 to indicate that the fileformat of cache + has changed + +2005-01-30 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed handling of hashed opening php-tags inside strip-blocks + (reported by titi_rafa) + +2005-01-30 Nuno Lopes + + * docs/fr/language-snippets.ent: + fix build + +2005-01-28 Messju Mohr + + * NEWS + libs/plugins/modifier.escape.php: + escape:url now uses the (RFC 1738 compliant) rawurlencode() + +2005-01-23 Messju Mohr + + * libs/Smarty.class.php: + replaced ? true : false and removed intermediate $_cookie_var in the + handling of the SMARTY_DEBUG-cookie + +2005-01-22 Yannick Torres + + * docs/fr/bookinfo.xml: + update EN-Revision tag + +2005-01-21 Monte Ohrt + + * README + RELEASE_NOTES + docs/de/bookinfo.xml + docs/fr/bookinfo.xml + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/function.cycle.php + libs/plugins/function.debug.php + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_table.php + libs/plugins/function.mailto.php + libs/plugins/modifier.cat.php + libs/plugins/modifier.nl2br.php + libs/plugins/modifier.strip.php + libs/plugins/outputfilter.trimwhitespace.php: + de-spammify e-mails + + * README + RELEASE_NOTES + docs/de/bookinfo.xml + docs/fr/bookinfo.xml + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/function.cycle.php + libs/plugins/function.debug.php + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_table.php + libs/plugins/function.mailto.php + libs/plugins/modifier.cat.php + libs/plugins/modifier.nl2br.php + libs/plugins/modifier.strip.php + libs/plugins/outputfilter.trimwhitespace.php: + update copyright notices, e-mail addresses + +2005-01-06 Messju Mohr + + * libs/Smarty_Compiler.class.php: + reduced the code that is generated on a {foreach}-block that has a + name. + + instead of pre-computing all foreach-properties (like first, last, + show) on each iteration, they are computed on demand as soon as + {$smarty.foreach.*}-variables are used. + + * NEWS + libs/Smarty_Compiler.class.php: + slight optimization in the compilation of $smarty.const.FOO . + + more complex consts like $smarty.const.$name still compile to + constant($this->_tpl_vars['name']) + +2005-01-05 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + make block functions and registered objects' block methods use a + local variable for block_content instead of $this->_block_content + + it's not necessary to have $smarty->_block_content accessible. + +2005-01-04 Yannick Torres + + * docs/fr/bookinfo.xml: + sync with EN + +2005-01-01 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + Happy new year from germany. + +2004-12-28 Monte Ohrt + + * libs/Smarty.class.php: + fix _read_file comments + +2004-12-26 Yannick Torres + + * docs/fr/getting-started.xml + docs/fr/preface.xml: + typo + + * docs/fr/language-defs.ent + docs/fr/language-snippets.ent + docs/fr/livedocs.ent: + sync with EN & typo + +2004-12-21 Yannick Torres + + * docs/fr/bookinfo.xml + docs/fr/getting-started.xml + docs/fr/translation.xml: + sync with EN + +2004-12-17 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed escaping of template-filenames in the generated code that loads + needed plugins + +2004-12-15 Monte Ohrt + + * NEWS + libs/plugins/function.popup.php: + fix invalid HTML issue with popup + +2004-12-06 boots + + * NEWS + libs/plugins/function.popup.php: + - fixed {popup} to properly handle inarray and function parameters and + added support for mouseoff and followmouse options + +2004-11-21 Mehdi Achour + + * docs/fr/livedocs.ent: + add livedocs specific entities files + +2004-11-16 Messju Mohr + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php: + cleaned up typecasting + +2004-11-15 Messju Mohr + + * libs/plugins/function.html_options.php: + fixed semantically misleading check for $options (use isset() instead + of is_array() because it is always an array). + + thanks to albert almeida. + +2004-11-08 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed unused code + +2004-10-25 Mehdi Achour + + * docs/fr/bookinfo.xml + docs/fr/getting-started.xml: + sync with en + +2004-10-13 Monte Ohrt + + * NEWS: + update header + +2004-10-02 Messju Mohr + + * NEWS: + fixed nocache-handling with nested includes. there was a logical error + in the replacement of internal nocache-tags to dynamic content that + lead to false results with deeply nested includes or with + nocache-blocks inside nocache-blocks. + + many thanks to Lars Jankowfsky for providing big help on reproducing + and tracking down this bug! + +2004-10-01 Messju Mohr + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + - better header for compiled includes (more in line with compiled + templates) + + - reuse cache_serials if a file is compiled more than once in one + process (force_compile) + + - don't print nocache-delimiters wenn already inside + process_cached_inserts() + +2004-09-29 Messju Mohr + + * libs/Smarty.class.php: + switched from @count() to !empty() . this was pointed out a few times + by a few people with buggy error-handlers + + * libs/Smarty_Compiler.class.php: + added some property declarations + +2004-09-28 Messju Mohr + + * libs/Smarty.class.php: + bumped up version number to reflect incompatibility in tempfiles of + 'core' vs. 'internals' + +2004-09-24 Messju Mohr + + * libs/plugins/function.html_select_date.php: + fixed $start_year when no value for the year in $time is given. + +2004-09-21 Messju Mohr + + * libs/plugins/function.html_table.php: + fixed handling of "inner"-attribute + + * libs/Smarty_Compiler.class.php: + fixed handling of object derefence inside backticks + +2004-09-20 Monte Ohrt + + * libs/debug.tpl: + add tags + +2004-09-18 boots + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/function.config_load.php + libs/plugins/function.debug.php + libs/plugins/function.fetch.php + libs/plugins/function.html_image.php: + Fixed \\r\\n line endings mistakenly introduced in last commit. d'oh. + +2004-09-16 boots + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.assemble_plugin_filepath.php + libs/core/core.assign_smarty_interface.php + libs/core/core.create_dir_structure.php + libs/core/core.display_debug_console.php + libs/core/core.get_include_path.php + libs/core/core.get_microtime.php + libs/core/core.get_php_resource.php + libs/core/core.is_secure.php + libs/core/core.is_trusted.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php + libs/core/core.process_cached_inserts.php + libs/core/core.process_compiled_include.php + libs/core/core.read_cache_file.php + libs/core/core.rm_auto.php + libs/core/core.rmdir.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include_php.php + libs/core/core.write_cache_file.php + libs/core/core.write_compiled_include.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php + libs/plugins/function.config_load.php + libs/plugins/function.debug.php + libs/plugins/function.fetch.php + libs/plugins/function.html_image.php: + Moved /libs/core to /libs/internals and created new constant, + SMARTY_CORE_DIR which defaults to SMARTY_DIR/internals. This should help + CVS and rsynch users butupgrades will require changes and this may affect + 3rd party plugins that use the /core dir. + +2004-09-15 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + moved $this->_num_const_regexp out of $this->_var_regexp and added it + to the places that affect $this->_var_regexp + + this should fix some problems parsing plugin-names endings with digits + +2004-09-14 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update files to 2.6.6-dev + +2004-09-13 Messju Mohr + + * NEWS: + fixed typo + +2004-09-13 Monte Ohrt + + * (Smarty_2_6_5) + NEWS: + update NEWS file with parsing correction note + +2004-09-11 Messju Mohr + + * libs/plugins/function.debug.php: + removed notice from {debug} + thanks to Peter Billen for pointing this one out! + +2004-09-11 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + fix more object calling syntax issues + +2004-09-10 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + added $smarty->security_settings['ALLOW_CONSTANTS'] + including test-cases for them + +2004-09-09 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + break down regex to digestable chunks, fix multiple param problem with + method calls, + add object method testing to unit_test cases + + * libs/Smarty_Compiler.class.php: + update code comment with more examples + + * libs/Smarty_Compiler.class.php: + allow objects in arbitrary param positions + + * libs/Smarty_Compiler.class.php: + fix object parameter regex, allow one level of object indirection + + * libs/Smarty_Compiler.class.php: + fix compile problem with numeric constants and math operator matching + +2004-09-07 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update files to 2.6.5-dev + + * (Smarty_2_6_4) + NEWS: + update NEWS file with 2.6.4 header + +2004-08-31 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + fix preg_quote + + * libs/Smarty_Compiler.class.php: + fix math in object params, clean up some regex on the way, change + preg_ delimiters to ~ to avoid character clashes with ! and % + +2004-08-30 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + add $smarty.ldelim and $smarty.rdelim to smarty special var + +2004-08-29 Messju Mohr + + * NEWS + libs/core/core.write_file.php: + tempnam() seems to be borken on many installation. + + now we try tempnam first and if that fails we generate our own + temp-filename with uniqid() + +2004-08-23 Monte Ohrt + + * libs/plugins/modifier.capitalize.php: + dont use constant, use static var instead + + * libs/plugins/modifier.capitalize.php: + implement optional param to capitalize for digit behavior + + * libs/plugins/modifier.capitalize.php: + another commit to capitalize, taking special chars into account + +2004-08-23 Messju Mohr + + * libs/Smarty_Compiler.class.php: + cleaned up attribute-handling in Smarty_Compiler::_compile_foreach_start() + +2004-08-23 Monte Ohrt + + * NEWS + libs/plugins/function.html_select_date.php + libs/plugins/modifier.capitalize.php: + fix capitalize modifier to not rely on buggy ucwords() func + +2004-08-20 Monte Ohrt + + * libs/plugins/function.html_select_date.php: + update version + + * NEWS + libs/plugins/function.html_select_date.php: + make time param work with negative timestamps, force year range to include + given date unless explicitly set + +2004-08-19 Monte Ohrt + + * NEWS + libs/plugins/function.fetch.php: + fix bug with fetch, passing user/pass in url did not work + +2004-08-13 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed handling of {foreachelse} and {sectionelse} that got borked with + the latest commit (v 1.330) + +2004-08-12 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed occasional wrong error messages on mismatched tags when + {else}, {elseif}, {foreachelse} or {sectionelse} is involved + + thanks to Ooypunk for pointing me on this + +2004-08-12 Nuno Lopes + + * docs/.cvsignore + docs/Makefile.in + docs/configure.in: + enable russian PDF builds + +2004-07-30 Nuno Lopes + + * docs/configure.in: + typo + + * docs/Makefile.in + docs/README + docs/configure.in: + add make test_xml + this is usefull to detect XML problems + +2004-07-29 Nuno Lopes + + * docs/configure.in: + avoid warnings in head + + * docs/.cvsignore + docs/Makefile.in + docs/README + docs/configure.in: + build pdf files + just type make pdf + +2004-07-27 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed handling of methods arguments. + + thanks to Manfred Wischin for finding this one and providing the + conceptual fix. + +2004-07-23 Messju Mohr + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php: + there was little flaw in smarty_function_html_radios() and + smarty_function_html_checkboxes(): + + the newly introduced assign-attribute was still added to the + tag-output as an extra-attribute. + + fixed. + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_select_date.php + libs/plugins/function.html_select_time.php + libs/plugins/modifier.date_format.php: + backed out renaming of _get_plugin_filepath() to get_plugin_filepath() + + we'll stick to _get_plugin_filepath() and look for a more viable + solution to be exposed to plugin-writers. + +2004-07-20 Messju Mohr + + * libs/Smarty_Compiler.class.php + libs/core/core.is_trusted.php + libs/plugins/compiler.assign.php: + Some fixes on PhpDocumentor comments. Thanks go to Ruben Vermeersch. + +2004-07-16 andreas halter + + * docs/de/bookinfo.xml + docs/de/getting-started.xml + docs/de/language-defs.ent + docs/de/language-snippets.ent + docs/de/preface.xml: + - updated for 2.6.3 + - updates for new build system + - added missing files + - corrections from users + - revcheck comments for all files + - big up to didou and nuno, brilliant work + - make test: ok + - make: ok + +2004-07-16 Nuno Lopes + + * docs/de/getting-started.xml: + fix the revision tracking tag + the revision number might not be right. just check it, please + +2004-07-16 andreas halter + + * docs/de/getting-started.xml: + - updated version (incl revcheck comment) for revcheck testing + +2004-07-14 Monte Ohrt + + * libs/Smarty.class.php: + replace " with ' where literal strings are quoted (ever so slight speedup) + +2004-07-12 Messju Mohr + + * libs/plugins/modifier.date_format.php: + changed call from $smarty->_get_plugin_filepath() to + $smarty->get_plugin_filepath() + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_select_date.php + libs/plugins/function.html_select_time.php: + renamed calls to $smarty->_get_plugin_filepath() to + $smarty->get_plugin_filepath() + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php: + renamed Smarty::_get_plugin_filepath() to Smarty::get_plugin_filepath() + + * NEWS + libs/Smarty.class.php + libs/core/core.write_compiled_include.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php: + removed touch() call. changing the timestamp of the compiled-template + to the source template's may be irritating for certain + source-code-caches. now a newly compiled template gets the current + time as timestamp. + +2004-07-02 gerald croes + + * docs/fr/getting-started.xml + docs/fr/preface.xml: + Fixed missing tags to be able to make doc again + + * docs/fr/preface.xml: + added the "is a good thing [TM]" as in en docs + + * docs/fr/getting-started.xml: + added ctags, updated screen => programm listing. + added the technical note founded on the en doc + +2004-07-02 Monte Ohrt + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php + libs/plugins/function.mailto.php: + add assign attribute to html_checkboxes and html_radios + +2004-07-01 Messju Mohr + + * NEWS + libs/Smarty.class.php: + removed use of get_include_filepath() inside + get_auto_filename(). thanks go to c960657 + + * NEWS + libs/Smarty_Compiler.class.php: + enhanced error-reporting for {foreach} + + * NEWS + libs/Smarty_Compiler.class.php: + fixed handling of digits inside tagnames. this problem slipped into + the regexps by adding support for numeric contants next to string + constants as variables. + +2004-06-27 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed escaping of backslashes in Smarty_Compiler::_quote_replace() + +2004-06-23 Monte Ohrt + + * libs/plugins/modifier.date_format.php: + display date_format %e, %T and %D as expected for windows + +2004-06-17 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + changed version-number to 2.6.4-dev + +2004-06-16 Monte Ohrt + + * (Smarty_2_6_3) + NEWS: + update NEWS file with version number + +2004-06-09 Monte Ohrt + + * NEWS + libs/plugins/modifier.escape.php: + added escapement of ' + + * docs/fr/translation.xml: + Add other translators. + +2004-06-08 Messju Mohr + + * libs/Smarty.class.php: + made the correct value of "use_sub_dirs" available to the compiler. + (not worth a NEWS-entry, i think) + +2004-06-01 Messju Mohr + + * libs/plugins/function.fetch.php: + fix: proper initialistaion of $content. + thanks to Dmitry Koteroff for pointing this out. + +2004-05-29 Mehdi Achour + + * docs/fr/translation.xml: + oups :) + + * docs/fr/translation.xml: + added translation file + +2004-05-28 Nuno Lopes + + * docs/Makefile.in: + clean also file-entities.php + +2004-05-28 Messju Mohr + + * NEWS + libs/plugins/function.mailto.php: + added obfuscation of protocol-string in {mailto} when using + hex-encoding (thanks to bharat) + +2004-05-26 Messju Mohr + + * NEWS + libs/Smarty.class.php: + enhanced auto-generated filenames for templates_c and cache + + incremented Smarty::_version because the tempfiles' structure changed + a little + +2004-05-23 Mehdi Achour + + * docs/fr/bookinfo.xml + docs/fr/getting-started.xml + docs/fr/preface.xml: + WS and added revcheck + +2004-05-21 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed typo in error-messages + + * docs/de/language-snippets.ent + docs/fr/language-snippets.ent: + added empty language-snippets.ent to fix "make web" + +2004-05-12 Monte Ohrt + + * NEWS + libs/plugins/modifier.escape.php: + add 'nonstd' escape modifier + +2004-05-07 Monte Ohrt + + * NEWS + libs/plugins/block.textformat.php: + update textformat to not output wrap chars after last para + +2004-05-06 Messju Mohr + + * NEWS + libs/core/core.write_file.php: + use tempnam() instead of unqid() to create better temporary files in + smarty_core_write_file(). + + (thanks to xces for finding this race-condition and his work on + fixing it) + +2004-05-04 Messju Mohr + + * libs/Smarty.class.php: + added check if for file_exists() to Smarty::_read_file() + +2004-04-30 Monte Ohrt + + * NEWS + libs/plugins/modifier.escape.php: + add 'mail' attribute to escape modifier + +2004-04-20 Mehdi Achour + + * docs/manual.xml.in: + added the language-snippets.ent file and started using entities for notes + under en/programmers/api-functions + +2004-04-18 Mehdi Achour + + * docs/de/getting-started.xml + docs/fr/getting-started.xml: + new global entity for zend and php-accelerator + + * docs/fr/bookinfo.xml + docs/fr/getting-started.xml + docs/fr/preface.xml: + added myself as translator and added vim comments and xml tags + +2004-04-16 Messju Mohr + + * NEWS: + added entry for numeric constants + + * libs/Smarty_Compiler.class.php: + removed unused 2nd param in call to _parse_var() + + * libs/Smarty_Compiler.class.php: + added explanation for $this->_num_const_regexp + + * NEWS + libs/plugins/modifier.escape.php: + added escape type "decentity" to smarty_modifier_escape() + + * libs/Smarty_Compiler.class.php: + enabled numerical constants be parsed as statements. + (like {10} or {10|@range:12} ) + + * libs/Smarty_Compiler.class.php: + removed unused $smarty_compiler->_dvar_num_var_regexp + + * libs/Smarty.class.php: + reverted Stuff + + * libs/debug.tpl + libs/core/core.assemble_plugin_filepath.php + libs/core/core.read_cache_file.php + libs/core/core.write_file.php + libs/plugins/function.eval.php + libs/plugins/function.popup.php + libs/plugins/modifier.escape.php + libs/plugins/shared.make_timestamp.php: + reverted stuff + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/debug.tpl + libs/core/core.assemble_plugin_filepath.php + libs/core/core.read_cache_file.php + libs/core/core.write_file.php + libs/plugins/function.eval.php + libs/plugins/function.popup.php + libs/plugins/modifier.escape.php + libs/plugins/shared.make_timestamp.php: + Smarty_Compiler.class.php + +2004-04-15 Messju Mohr + + * NEWS + libs/core/core.write_compiled_include.php: + made smarty_core_write_compiled_include() php5-aware + + if someone knows a better way than patching the source with the + tokenizer, please stand up! + +2004-04-14 Nuno Lopes + + * docs/Makefile.in: + remove file-entities.ent also + + * docs/.cvsignore + docs/Makefile.in + docs/README: + allow make revcheck + +2004-04-13 Nuno Lopes + + * docs/configure.in: + do not need inipath + +2004-04-13 Mehdi Achour + + * docs/TODO: + done + + * docs/configure.in + docs/manual.xml.in: + now the files entites are generated dynamically + +2004-04-12 Messju Mohr + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php: + removed unused functionality to load a subset of lines from a file in + Smarty::_read_file() + + additionally removed a warning that is emitted since php-4.3.5 when + fread() is called on an empty file (with filesize()==0). thanks to + Andreas Streichardt who pointed this out. + + * NEWS + libs/core/core.is_secure.php: + smarty_core_is_secure() only checks the file for readability now, not + the directory where is in. + + * libs/Smarty.class.php: + removed unused security_setting 'ALLOW_CONSTANTS' + +2004-04-07 Messju Mohr + + * libs/plugins/function.assign_debug_info.php + libs/plugins/function.cycle.php + libs/plugins/function.mailto.php: + removed trailing spaces + + * libs/Smarty.class.php: + removed unused $smarty->_error_msg + +2004-04-04 Nuno Lopes + + * docs/configure.in: + fixing my crap + put build_date back on-line + +2004-04-03 Nuno Lopes + + * docs/Makefile.in + docs/configure.in + docs/manual.xml.in: + trying to fix ru problems + +2004-03-30 Monte Ohrt + + * libs/core/core.display_debug_console.php: + fix problem with debug_tpl path and security + + * NEWS + libs/core/core.display_debug_console.php: + fix problem displaying debug console when $default_resource_type is not + "file:" + +2004-03-29 Mehdi Achour + + * docs/TODO: + and finally, add a TODO here + + * docs/de/bookinfo.xml + docs/de/manual.sgml + docs/fr/bookinfo.xml + docs/fr/manual.xml: + translate bookinfo.xml and put back the translators + +2004-03-28 Mehdi Achour + + * docs/manual.xml.in: + add global.ent and define some general entities + + * docs/de/bookinfo.xml + docs/de/getting-started.xml + docs/de/language-defs.ent + docs/de/preface.xml: + add new de files + + * docs/de/appendixes.sgml + docs/de/designers.sgml + docs/de/getting-started.sgml + docs/de/html-common.dsl + docs/de/preface.sgml + docs/de/programmers.sgml: + drop old de files + + * docs/fr/bookinfo.xml + docs/fr/getting-started.xml + docs/fr/manual.xml + docs/fr/preface.xml: + add ommited files + + * docs/fr/language-defs.ent: + split the french dir + + * docs/fr/appendixes.sgml + docs/fr/designers.sgml + docs/fr/getting-started.sgml + docs/fr/html-common.dsl + docs/fr/manual.sgml + docs/fr/preface.sgml + docs/fr/programmers.sgml: + drop old french files + + * docs/manual.xml.in: + let's put the new build system + +2004-03-26 Mehdi Achour + + * docs/de/common.dsl + docs/de/html.dsl + docs/fr/common.dsl + docs/fr/html.dsl + docs/fr/php.dsl: + not needed anymore + +2004-03-24 Nuno Lopes + + * docs/Makefile.in: + updated stylesheets + highlight PHP automatically + + * docs/Makefile.in + docs/html.dsl: + remove unneeded file + +2004-03-23 Nuno Lopes + + * docs/version.ent.in: + remove this also + + * docs/getting-started.sgml: + remove this one too + + * docs/appendixes.sgml + docs/common.dsl + docs/designers.sgml + docs/html-common.dsl + docs/manual.sgml + docs/php.dsl + docs/preface.sgml + docs/programmers.sgml: + removing uneeded files + + * docs/.cvsignore: + commiting missing files for docbook + + * docs/.cvsignore + docs/Makefile.in + docs/configure.in + docs/manual.xml.in: + bundling docbook 4 + now make and make web works + +2004-03-23 Messju Mohr + + * NEWS + libs/plugins/function.config_load.php: + unrolled call to the is_compiled()-check to be able to supply the + correct resource_base_path for config_load. this avoids errors when + config-files are accessed where security is enabled. + + thanks to shuther for pointing out this bug. + +2004-03-20 Nuno Lopes + + * docs/manual.xml.in: + fix build date + +2004-03-18 Messju Mohr + + * libs/core/core.is_secure.php: + removed merging of $smarty->template_dir into $smarty->secure_dir + + the resource_base_path is considerd secure instead. this change should + have absolutely no impact on smarty's security's behaviour + +2004-03-18 Nuno Lopes + + * docs/configure.in: + correcting non-existent var + + * docs/.cvsignore + docs/Makefile.in + docs/configure.in + docs/manual.xml.in + docs/version.ent.in: + generate build date + + * docs/.cvsignore + docs/Makefile.in + docs/README + docs/configure.in + docs/manual.xml.in: + new build/test system + +2004-03-18 Messju Mohr + + * libs/Smarty.class.php: + moved setting of a default resource_base_path from + Smarty::_parse_resource_name() to Smarty::_fetch_resource_info() + + this shouldn't affect anything, since all calls to + _parse_resource_name() that are not done from within + _fetch_resource_info() all pass their own resource_base_path + +2004-03-17 Messju Mohr + + * NEWS + libs/Smarty.class.php: + removed '.' from the list of default resource_base_paths in + _parse_resource_name() + + this should only affect _parse_resource_name() for templates, not for + php-resources and not for config_files. the latter pass two their own + resource_base_path. + +2004-03-16 Mehdi Achour + + * docs/appendixes.sgml + docs/getting-started.sgml + docs/preface.sgml: + adding editor comments + + * docs/appendixes.sgml + docs/getting-started.sgml: + cleaning words spacing, killing tabulations, using roles for + programlisting.. + +2004-03-15 Messju Mohr + + * libs/Smarty.class.php: + simplified Smarty::clear_all_cache(); + +2004-03-12 boots + + * docs/programmers.sgml: + Updated is_cached prototype to indicate proper return type. (thanks to + Geoffrey Hoffman) + +2004-03-11 Messju Mohr + + * libs/core/core.assemble_plugin_filepath.php: + fixed little bug that prevented plugins filepaths that are found in + php's include_path (and not in one of the plugins_dirs) from being + cached in the internal plugins-filepath-cache + +2004-03-01 Monte Ohrt + + * docs/designers.sgml: + update include_php docs:wq + :q + + * docs/appendixes.sgml: + update componentized template example to something useful + +2004-02-24 Messju Mohr + + * NEWS + libs/Smarty.class.php: + _parse_resource_name() returned true on non-existant absolute + paths. This caused a warning on _fetch_resource_info() when used in + conjunction with template_exists(). It should be fixed now without + negative effects. + +2004-02-24 Monte Ohrt + + * docs/designers.sgml: + one more typo + + * docs/designers.sgml: + fix typo + +2004-02-24 Messju Mohr + + * NEWS + libs/core/core.is_secure.php: + smarty_resource_*_secure got &$smarty passed errornously as 3rd + parameter and not as 2nd. this is fixed. + +2004-02-23 Messju Mohr + + * NEWS: + fix handling of integer values like width and delay im + smarty_function_popup() + + * libs/plugins/function.popup.php: + fixed handling of integer-attributes + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + updated version to 2.6.3-dev + +2004-02-22 Messju Mohr + + * libs/plugins/function.html_select_date.php: + removed notice on html_select_date with the month_empty-attribute + + * libs/plugins/function.mailto.php: + removed 2 notices of undefined vars (thanks Cit) + +2004-02-17 Monte Ohrt + + * NEWS: + add header + + * (Smarty_2_6_2) + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + change some info in headers, remove fluff + +2004-02-13 Messju Mohr + + * NEWS + libs/plugins/function.html_select_date.php: + correctly handle partially empty dates (like "2004--" or "-12-"). + + * docs/programmers.sgml: + learned something about and sgml and applied this to the + use.sub.dirs-section :) + + * docs/designers.sgml: + changed attribute-name "checked" to "selected" in the docs for + html_radios and html_checkboxes. "checked" is deprecated for ages + AFAIK and selected is recommended for consistency with {html_options} + + * docs/programmers.sgml: + added note about use_sub_dirs and Smarty-2.6.2 . + fixed markup for section about clear_compiled_tpl() . + +2004-02-12 Messju Mohr + + * NEWS + libs/Config_File.class.php: + YES and NO should not be booleanized inside triple-quotes in a + config-file. this behaviour changed by accident in 2.6.1 and is now + reverted to pre-2.6.1 behaviour + +2004-02-10 Messju Mohr + + * NEWS + libs/Config_File.class.php: + fixed slurping of a the next line following a triple-quoted value in a + config-file + +2004-02-07 Messju Mohr + + * libs/Config_File.class.php: + avoid @-operator for handling empty lines in Config_File.class.php + + * libs/Smarty_Compiler.class.php: + removed two notices from Smarty_Compiler::_parse_is_expr() + (thanks shuther!) + + * NEWS + libs/Smarty.class.php: + changed default for use_sub_dirs to false + + * libs/plugins/function.mailto.php: + removed notice of undefined variable. (thanks shuther!) + +2004-01-29 Messju Mohr + + * libs/Smarty_Compiler.class.php: + added file and line-number-information to error-messages regarding + assigned objects an an error messages regarding modifiers with + security. + +2004-01-27 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed use of temporary var $_params in compiled code of block-plugins + + * NEWS + libs/plugins/function.popup.php: + fixed quoting of values in smarty_function_popup() + +2004-01-25 Messju Mohr + + * docs/programmers.sgml: + documented parameters of Smarty::clear_compiled_tpl() + + * libs/Smarty_Compiler.class.php: + Smarty_Compiler::_syntax_error() uses Smarty::_trigger_fatal_error() now + instead of the trigger_error()-function + + * libs/Smarty.class.php: + Smarty::_trigger_fatal_error() uses Smarty::trigger_error() now, + instead of the native trigger_error()-function + + * libs/Smarty_Compiler.class.php: + unrecognized custom-functions trigger an error at compile now, not at + display-time. + +2004-01-23 Monte Ohrt + + * docs/getting-started.sgml: + reword a paragraph + +2004-01-22 Messju Mohr + + * libs/plugins/function.config_load.php: + removed emission of unnecessary notices for unavailable config-files + in config_load() + + * NEWS + libs/Config_File.class.php: + fixed handling of hidden sections in Config_File + +2004-01-21 Messju Mohr + + * NEWS + libs/plugins/function.config_load.php: + added handling of resources for {config_load} + +2004-01-19 Messju Mohr + + * NEWS + libs/plugins/function.html_table.php: + fixed bug when using arrays with tr_attr and td_attr in {html_table} + +2004-01-16 Monte Ohrt + + * NEWS: + add unit testing + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers, add initial unit test directory + + * (Smarty_2_6_1) + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers for 2.6.1 release + +2004-01-16 Messju Mohr + + * (Smarty_2_6_1) + NEWS + docs/programmers.sgml + libs/Smarty.class.php: + renamed $smarty->tpl_rror_reporting to $smarty->error_reporting + "tpl_" is a bit redundant here (it's a TemPLate-engine overall :) + +2004-01-15 Messju Mohr + + * libs/plugins/function.html_image.php: + forgot to remove duplicate is_secure()-check + + * NEWS + libs/plugins/function.html_image.php: + fix: $smarty->security is now correctly handled + + minor optimizations: + core/core.is_secure.php is only included when needed + $dpi_default is only determined when needed + +2004-01-14 Messju Mohr + + * docs/appendixes.sgml + docs/programmers.sgml: + removed suggestions to use extract() from the manual + + * docs/designers.sgml: + fixed typo + +2004-01-12 Messju Mohr + + * docs/designers.sgml: + mention SCRIPT_NAME below {$smarty} reserved variable because it got + lost in the docs for $smarty->global_assign + + * docs/designers.sgml: + added docs for {$smarty.version} special variable + + * docs/programmers.sgml: + removed docs for $global_assign + + * docs/programmers.sgml: + added docs for tpl_error_reporting + + * docs/designers.sgml: + added docs for year_empty-, month_empty- and day_emtpy-attributes of + html_select_date. maybe an example is needed to better explain empty + values in YYY-MM-DD. + +2004-01-10 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed handling of {php}-tags + +2004-01-10 Monte Ohrt + + * docs/designers.sgml: + fix html_checkboxes examples + +2004-01-08 Messju Mohr + + * NEWS + libs/core/core.assemble_plugin_filepath.php: + added caching of requested paths to smarty_core_assemble_plugin_filepath() + + * NEWS: + fix handling of comments inside {php}- and {literal}-blocks + + * libs/Smarty_Compiler.class.php: + fixed handling of comments inside {php} and {literal} + +2004-01-06 Messju Mohr + + * NEWS + libs/Config_File.class.php: + fixed bug handling triple-quotes in config-files + + * libs/Config_File.class.php: + fixed bugs with triple-quotes in config-files + thanks BRDude for finding them testing! + +2004-01-02 Messju Mohr + + * libs/Smarty.class.php: + removed unnecessary param in call to _fetch_resource_info() + +2003-12-30 Messju Mohr + + * libs/Smarty.class.php: + oops! removed tabs. + +2003-12-27 Messju Mohr + + * NEWS + libs/Smarty.class.php: + made $SCRIPT_NAME available again + changes default for request_use_auto_global to prefer autoglobals + + * libs/Smarty.class.php: + removed tabs and trailing spaces + + * NEWS + libs/Smarty_Compiler.class.php: + readded default_modifiers. who removed that? + +2003-12-23 Monte Ohrt + + * NEWS: + add portuguese docs + +2003-12-22 Monte Ohrt + + * docs/designers.sgml: + fix counter example + +2003-12-19 Monte Ohrt + + * libs/Smarty.class.php: + add debug console persistance feature + +2003-12-19 Messju Mohr + + * libs/plugins/block.textformat.php + libs/plugins/function.html_table.php + libs/plugins/function.popup.php: + removed extract(). enhanced parameter parsing. + + * libs/plugins/function.counter.php + libs/plugins/function.fetch.php + libs/plugins/function.popup_init.php + libs/plugins/modifier.capitalize.php + libs/plugins/modifier.cat.php + libs/plugins/modifier.date_format.php + libs/plugins/modifier.debug_print_var.php + libs/plugins/modifier.escape.php + libs/plugins/modifier.indent.php + libs/plugins/modifier.lower.php + libs/plugins/modifier.nl2br.php + libs/plugins/modifier.strip.php + libs/plugins/modifier.upper.php + libs/plugins/modifier.wordwrap.php + libs/plugins/outputfilter.trimwhitespace.php + libs/plugins/shared.escape_special_chars.php: + removed tabs. fixed indentiation. + + * libs/plugins/modifier.truncate.php: + removed tabs + + * libs/plugins/function.counter.php + libs/plugins/function.cycle.php: + removed extract() from parameter-parsing + +2003-12-17 Messju Mohr + + * libs/plugins/function.html_select_date.php: + fix plugin-name in error message + + * libs/plugins/function.html_select_time.php: + remove extract-call from {html_select_time} + + * NEWS + libs/plugins/function.html_select_date.php: + allow single-digit days and months without smarty_make_timestamp() + this makes dates like "1968-11-6" work correctly since no strtotime() + is involved + + add warning when unknown parameter is passed + +2003-12-16 Messju Mohr + + * NEWS + libs/Smarty.class.php: + fix headers sent erroneously with cache_modified_check and fetch() + +2003-12-12 Monte Ohrt + + * libs/plugins/function.config_load.php: + move set_path() call below the conditional bracket + + * NEWS + libs/plugins/function.config_load.php: + fix config_load filepath bug + +2003-12-12 boots + + * docs/designers.sgml: + Updated language.function.if with additional annotation and to fix error + that broke docs build process + +2003-12-11 Messju Mohr + + * libs/Smarty_Compiler.class.php: + little optimization for "is odd" and "is even" + +2003-12-11 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + fix 'is even by' and 'is odd by' logic + +2003-12-11 Messju Mohr + + * docs/designers.sgml: + update example-output of {mailto} + + * libs/plugins/function.mailto.php: + removed extract-call -> cleaner parameter-handling + + * libs/plugins/function.mailto.php: + fixed indentiation + + * TODO: + removed two done topics + +2003-12-11 boots + + * docs/designers.sgml: + Updated language.function.if to describe qualifiers (thanks andre) + +2003-12-10 Messju Mohr + + * NEWS + libs/plugins/function.html_select_date.php: + added day_empty, month_empty, year_empty and all_empty attributes + to pass an undefined date use {html_select_date time="--" ...} + + * libs/plugins/function.html_select_date.php: + removed extract()-call + + * libs/plugins/function.html_select_date.php: + fixed indetiation + +2003-12-10 boots + + * NEWS + docs/designers.sgml: + Added table to language.function.if to describe qualifiers + +2003-12-09 Messju Mohr + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_options.php: + strict comparason didn't work in all cases. use type-casting now. + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_options.php: + fix bug when comparing array-keys to "selected" in html_options and + html_checkboxes + + in_array() uses "strict" comparason now. + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php: + removed tabs, fixed indentiation + +2003-12-08 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + add better checks for correctly nested tags when compiling + +2003-12-04 Messju Mohr + + * libs/Smarty.class.php + libs/plugins/function.html_image.php: + fix: check $smarty->request_use_auto_globals at the last occurences of + HTTP_*_VARS + +2003-12-03 Messju Mohr + + * NEWS + libs/Smarty.class.php: + remove $global_assign property from Smarty and $global_assign-handling + from the constructor. the only visible change is, that $SCRIPT_NAME is + not available in the tempates anymore. $smarty.server.SCRIPT_NAME has + to be used from now. + +2003-12-03 boots + + * docs/designers.sgml: + Fixed example for count_characters + +2003-12-01 boots + + * docs/designers.sgml: + Added section "Escaping Smarty Parsing" under Basic Syntax. + +2003-12-01 Messju Mohr + + * libs/core/core.create_dir_structure.php: + thought again about my latest commit and backed it out. + + * libs/core/core.create_dir_structure.php: + fix root-dir-handling on windows filepath + +2003-11-29 boots + + * libs/plugins/function.config_load.php: + really make the fixes the last patch was supposed to do + + * libs/plugins/function.config_load.php: + removed tabs and killed trailing white-space + + * libs/plugins/function.config_load.php: + changed $smarty->_syntax_error to $smarty->trigger_error + +2003-11-27 Messju Mohr + + * NEWS + libs/plugins/modifier.debug_print_var.php: + remove warning in debug_print_var on php-resources + + * README: + fix version number + +2003-11-26 Messju Mohr + + * libs/Smarty_Compiler.class.php: + raise max_level for $smarty.config... to 3 to allow arrays of config-vars + +2003-11-25 Messju Mohr + + * libs/Smarty.class.php: + changed version-tag to indicate incompatibility to older compiled + templates + +2003-11-24 Messju Mohr + + * NEWS + libs/plugins/compiler.assign.php + libs/plugins/function.assign.php: + move function.assign.php to compiler.assign.php + + * libs/core/core.get_include_path.php: + silence occasional warnings of open_basedir- and + safe_mode-restrictions in core.get_include_path.php + +2003-11-23 Messju Mohr + + * libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php: + avoid touch()-ing of recently unlinked files by touch()-ing the + tempfile before rename instead of touch()-ing the resulting file after + rename. + + * NEWS + libs/Smarty.class.php: + add property $tpl_error_reporting + +2003-11-22 Messju Mohr + + * libs/plugins/function.assign.php: + remove use of extract() in smarty_function_assign() + + * NEWS + libs/Smarty.class.php: + remove property $undefined. "null" is used literally instead + +2003-11-21 Messju Mohr + + * libs/Smarty_Compiler.class.php: + remove two E_NOTICES + +2003-11-20 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + change version to 2.6.1-dev + +2003-11-19 Monte Ohrt + + * (Smarty_2_6_0) + NEWS: + update NEWS file + + * (Smarty_2_6_0) + docs/designers.sgml + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + change version numbers to 2.6.0 + +2003-11-19 Messju Mohr + + * docs/designers.sgml + docs/de/designers.sgml + docs/fr/designers.sgml: + fix examples of escape-modifier (in docs, docs/de and docs/fr !) + +2003-11-18 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + move Smarty::quote_replace() to Smarty_Compiler::_quote_replace() + + * libs/Smarty.class.php: + removed extract-calls from _include()- and _eval()-wrappers + variables passed with {include_php} have to accessed as members of $params + now + +2003-11-17 Messju Mohr + + * docs/designers.sgml: + fixed typo + +2003-11-13 Messju Mohr + + * libs/Config_File.class.php: + fix occasional notice + +2003-11-13 andreas halter + + * docs/de/designers.sgml: + - added cat modifier, thanks messju :-) + +2003-11-13 Monte Ohrt + + * (Smarty_2_6_0-RC3) + NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + commit RC3 tags + +2003-11-13 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fix handling of $var.key inside [] + + * libs/Smarty.class.php: + fix unnecessary loading of core.load_resource_plugin.php + + * (Smarty_2_6_0-RC3) + docs/fr/designers.sgml: + fixed example of html_table + +2003-11-11 Messju Mohr + + * NEWS + libs/core/core.process_cached_inserts.php: + fix handling of assign inside {insert}-tags + +2003-11-06 Messju Mohr + + * libs/core/core.read_cache_file.php: + added $exp_time-parameter + + * docs/programmers.sgml: + added $exp_time to cache_handler_func-example + + * libs/Smarty.class.php + libs/core/core.write_cache_file.php: + added $exp_time-parameter of clear_cache() and clear_all_cache() to + cache_handler_func. + +2003-11-05 Messju Mohr + + * NEWS + libs/Config_File.class.php: + fix handling if [...] inside triple-quotes in config-files + +2003-11-04 Messju Mohr + + * libs/Smarty.class.php: + fixed little bug in _parse_resource_name() (jlgunter, messju) + +2003-11-03 andreas halter + + * docs/designers.sgml + docs/de/designers.sgml + docs/fr/designers.sgml: + - changed Smarty.php.class occurences to Smarty.class.php + +2003-10-29 boots + + * docs/appendixes.sgml + docs/designers.sgml + docs/manual.sgml + docs/programmers.sgml + docs/de/appendixes.sgml + docs/de/designers.sgml + docs/de/programmers.sgml + docs/fr/appendixes.sgml + docs/fr/designers.sgml + docs/fr/getting-started.sgml + docs/fr/manual.sgml + docs/fr/preface.sgml + docs/fr/programmers.sgml: + Fixes to documentation syntax so that all content can be processed used + xsltproc docbook-xsl tools. In particular, fixes unescaped entities, + broken tags, unquoted attributes. + +2003-10-27 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fix handling of simple-math-operators inside modifiers + +2003-10-25 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed unused property _output_type + removed unused param $tag_attrs of _parse_var_props() + cleaned up alignment of class-properties + +2003-10-23 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed notice in php-tag handling in Smarty_Compiler::_compile_file() + + * libs/Smarty_Compiler.class.php: + removed two occasional E_NOTICES from + Smarty_Compiler::_compile_include_php_tag() + + * NEWS + libs/core/core.create_dir_structure.php: + fix handling of trailing-slashes in open_basedir in + smarty_core_create_dir_structure() + +2003-10-20 Messju Mohr + + * libs/Smarty_Compiler.class.php: + elements inside `` are bracketed now inside the compiled-tpl. this + fixes some issues with simple-math inside backticks. + +2003-10-16 Monte Ohrt + + * docs/designers.sgml: + update overlib docs, no working examples + +2003-10-12 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.is_secure.php: + move check for template_dir in secure_dir-array into core.is_secure.php + + this makes template_exists() work correctly with security=true even if + template_dir is not inside the secure_dir-array + +2003-10-11 Messju Mohr + + * libs/plugins/shared.make_timestamp.php: + tightened check for YYYYMMDDHHMMSS-format. thanks konstantin for + pointing this out. + + removed a few tabs. + + * libs/Smarty_Compiler.class.php: + fix precedence of simple-math-operators before modifiers. + thanks dominik! + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.assemble_plugin_filepath.php + libs/core/core.assign_smarty_interface.php + libs/core/core.create_dir_structure.php + libs/core/core.display_debug_console.php + libs/core/core.get_include_path.php + libs/core/core.get_microtime.php + libs/core/core.get_php_resource.php + libs/core/core.is_secure.php + libs/core/core.is_trusted.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php + libs/core/core.process_cached_inserts.php + libs/core/core.process_compiled_include.php + libs/core/core.read_cache_file.php + libs/core/core.rm_auto.php + libs/core/core.rmdir.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include_php.php + libs/core/core.write_compiled_include.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php: + removed tabs from the main and the core/*.php files + +2003-10-08 Monte Ohrt + + * (Smarty_2_6_0-RC2) + NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers to RC2 + +2003-09-18 Messju Mohr + + * docs/designers.sgml + docs/de/designers.sgml: + fixed description of cycle's advance-attribute + +2003-09-16 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + apply modifiers only once to section-loop and foreach-from attributes + +2003-09-15 Messju Mohr + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.write_cache_paths_file.php: + backed out _smarty_cached_paths-file-handling + + * libs/Smarty.class.php + libs/core/core.rm_auto.php: + fixed clear_compiled_tpl with explicit $tpl_file given + fixed return value of smarty_core_rm_auto() + Smarty::_unlink() + + * libs/Smarty.class.php: + little fix in _get_auto_filename() + +2003-09-14 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.assemble_auto_filename.php: + removed auto-filenames from path-cache. merged assemble_auto_filename + back into Smarty::_get_auto_filename() + +2003-09-12 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed quoting of modifier parameters + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.get_php_resource.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php: + remove Smarty::_plugin_implementation_exists() - use php's native + is_callable() + +2003-09-11 Messju Mohr + + * libs/Smarty.class.php: + silenced two notices acces HTTP_SERVER_VARS + +2003-09-10 andreas halter + + * docs/de/designers.sgml + docs/de/getting-started.sgml + docs/de/programmers.sgml: + - minor fixes (2 rep), slight wording changes + - jade transform problem fixed + +2003-09-08 andreas halter + + * docs/de/designers.sgml + docs/de/getting-started.sgml + docs/de/manual.sgml + docs/de/preface.sgml + docs/de/programmers.sgml: + all updated for 2.6.0 release, translated everything from 2_5_0 branch to + 20030908 + +2003-09-04 Messju Mohr + + * libs/Smarty.class.php: + proper checking for files in _fetch_resource_info() + +2003-09-02 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + ignore {strip}/{/strip) inside {strip}-blocks + + * libs/plugins/function.mailto.php: + fixed 2 notices in smarty_function_mailto() + +2003-09-01 Messju Mohr + + * libs/Smarty.class.php: + re-include cache_paths on multiple calls to fetch() to avoid + inconsistencies + at multiple calls to fetch() in one script + + * libs/Smarty_Compiler.class.php: + fixed handling of \r in {strip} + renamed $_trailing_lf to $_additional_newline + + * libs/Smarty_Compiler.class.php: + the weekly fix for {strip} :) + + * docs/designers.sgml: + fixed example for simple math. + +2003-08-29 Messju Mohr + + * libs/core/core.assign_smarty_interface.php + libs/core/core.display_debug_console.php + libs/plugins/function.assign.php + libs/plugins/function.html_options.php + libs/plugins/function.html_table.php: + fixed PHPDocumentor-comments (thanks Konstantin) + + * libs/core/core.rmdir.php: + made rmdir a bit more optimistic. especially it now removes + directories correctly that where created accidently by "safe_mode=On + && $use_sub_dirs=true" + +2003-08-27 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed removal of leading/trailing newlines in {strip}-blocks + +2003-08-25 Messju Mohr + + * INSTALL: + added note emphasizing the introduction of "libs/" with 2.5.0 + + * NEWS + libs/plugins/modifier.escape.php: + fixed proper escaping of " and ' with escape:javascript + +2003-08-22 Messju Mohr + + * NEWS + libs/core/core.assemble_plugin_filepath.php: + fixed bug in traversal of $smarty->plugins_dir-array in + smarty_core_assemble_plugin_filepath(). the first matching plugin in + the path should be used, not the last one. + + * libs/core/core.read_cache_file.php: + discard $_cache_info when the cache should be regenerated + +2003-08-20 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php + libs/plugins/block.strip.php: + reverted {strip} from a block-plugin back into the compiler + + * docs/programmers.sgml: + fixed examples for register_function() and register_block() + + * libs/Smarty.class.php: + made template_exists() quiet when the template does not exist (thanks + to konstatin for pointing this out) + +2003-08-18 Monte Ohrt + + * docs/getting-started.sgml: + fix example title + + * docs/README + docs/getting-started.sgml: + change installation wording confusion + +2003-08-18 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.read_cache_file.php: + fixed unnecessary load of source in template_exists() and the + compile-check of smarty_core_read_cache_file() + + * libs/Smarty_Compiler.class.php: + allow section-, array- and object-dereference in $smarty-references + +2003-08-15 Messju Mohr + + * docs/designers.sgml: + added parameter-descriptions for count_characters (thanks Konstantin + A. Pelepelin) + + fixed docs for {html_checkboxes} + +2003-08-14 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.read_cache_file.php: + fixed timestamp-check of config-files in smarty_core_read_cache_file() + + * libs/Smarty.class.php: + fixed typecasting for arrays in _parse_resource_name() + + * NEWS + libs/plugins/function.config_load.php: + fixes in config_load: + - handling of section-attribute + - reusing the same config-file multiple times + - serialization of config-data for php<4.2.0 (no var_export) + + many thanks to atu for pointing this out and for testing + +2003-08-13 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.smarty_include_php.php: + fixed problem with vars as attributes in {include_php} + +2003-08-13 Monte Ohrt + + * docs/README: + commit README file for documentation compiling + +2003-08-13 Messju Mohr + + * libs/debug.tpl + libs/plugins/modifier.debug_print_var.php: + removed '\r' from debug_print_vars' output + properly escape vars in javascript-version of debug.tpl + +2003-08-11 Monte Ohrt + + * (Smarty_2_6_0_RC1) + NEWS + docs/designers.sgml + docs/html.dsl + docs/php.dsl + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + get ready for 2.6.0-RC1 release + +2003-08-10 Messju Mohr + + * NEWS + libs/Smarty.class.php: + fixed status-header for cache_modified_check under cgi-sapi + +2003-08-09 Messju Mohr + + * libs/core/core.is_secure.php + libs/core/core.is_trusted.php: + synced secure_dir-checking with trusted_dir-checking + + * libs/core/core.is_secure.php: + tightenend path checking in smarty_core_is_secure() + +2003-08-08 Messju Mohr + + * libs/Smarty.class.php: + fix: proper nesting of $smarty->_cache_including flag in cascaded + cached/not-cached/fetched/inserted/foo-templates + + * libs/debug.tpl: + better escaping for $_debug_tpls[templates].filenames + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + removed redundant $smarty from Smarty::_smarty_include() + + * libs/debug.tpl: + proper escaping of filenames in debug-console (thanks to prossel). + +2003-08-07 Messju Mohr + + * docs/programmers.sgml: + added docs for block-methods of registered objects + + * docs/programmers.sgml: + fixed typo in example for registered objects + + * docs/designers.sgml: + fixed exampls of html_image and html_checkboxes + + * libs/plugins/function.debug.php: + fixed {debug} and removed tabs in function.debug.php + + * docs/programmers.sgml: + fixed example for register_object + + * docs/designers.sgml + docs/programmers.sgml: + updated docs for capture, html_table, html_image and register_object + +2003-08-07 Monte Ohrt + + * docs/designers.sgml + docs/programmers.sgml: + add math and default_resource_type to docs + + * docs/getting-started.sgml: + add core to example, add tech note + +2003-08-07 Messju Mohr + + * docs/manual.sgml + docs/fr/manual.sgml: + upd copyright in the docs + +2003-08-07 Monte Ohrt + + * docs/getting-started.sgml: + added core directory to install instructions + +2003-08-07 Messju Mohr + + * docs/designers.sgml + docs/programmers.sgml: + added docs for php-functions as modifiers + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + better caching of attributes for $cacheable=false-plugins + + * docs/programmers.sgml: + added section "caching.cacheable" to the docs, explaining the usage of + the $cacheable-flag of the register_(block|compiler|function)-functions + + * libs/Smarty_Compiler.class.php: + fixed output of custom-functions with cached attributes + + * docs/programmers.sgml: + docs update on callbacks to the register_*-functions + +2003-08-06 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.process_compiled_include.php: + added optional parameter $cache_attrs to register_function() and + register_block(). $cache_attrs is an array containing attribute- names + that should be cached on calls to functions that have $cacheable set + to false. + + * libs/Smarty.class.php: + fixed bug in _run_mod_handler + + * libs/Smarty_Compiler.class.php: + fixed bug with autoload-handling of modifiers. thanks ndre. + +2003-08-05 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + updated copyright notice + + * libs/Smarty.class.php + libs/core/core.load_plugins.php: + fixed bug that occurred when using the same not-cacheable plugin in + multiple includes + + * docs/programmers.sgml: + docs-update for plugins.writing + +2003-08-04 Messju Mohr + + * docs/designers.sgml + docs/programmers.sgml: + updated docs for register_block_function(), block-functions, + $request_use_auto_globals and html_checkboxes + +2003-07-31 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + enabled registration of class-methods as callbacks for the + register_*-functions + + use: array('classname', 'method_name')) as callback + +2003-07-29 Messju Mohr + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + modifiers are resolved at compile-time now. _run_mod_handler() is + still used for modifiers with map_array=true (== no preceeding '@') + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.smarty_include.php: + moved _smarty_include() back into Smarty.class.php + + * libs/Smarty.class.php + libs/core/core.load_plugins.php: + prevent unnecessary calls to _read_file() in _is_compiled() + converted method-call to internal function-call in + smarty_core_load_plugins() + +2003-07-28 Messju Mohr + + * libs/Smarty_Compiler.class.php: + quote smarty-header properly to prevent resource-names from escaping from + the comment + +2003-07-25 Messju Mohr + + * libs/core/core.create_dir_structure.php: + weakend race-condition and removed bogus error-message caused by that + in smarty_core_create_dir_structure(). + +2003-07-23 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.display_debug_console.php + libs/core/core.fetch_resource_info.php + libs/core/core.get_php_resource.php + libs/core/core.parse_resource_name.php + libs/core/core.process_cached_inserts.php + libs/core/core.read_cache_file.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include.php + libs/core/core.smarty_include_php.php + libs/plugins/function.eval.php: + moved _fetch_resource_info and _parse_resource_name back into + Smarty.class.php + renamed smarty_include and smarty_eval wrappers to _include and _eval + +2003-07-17 Messju Mohr + + * libs/core/core.process_compiled_include.php + libs/core/core.read_cache_file.php: + improved checking of compiled_include against cached-template with + non-cached-chunks + + * libs/core/core.write_compiled_include.php: + fixed too short open-tag + + * libs/plugins/function.eval.php: + fixed assign parameter for eval (must have gotton lost on its way to 2.5.0) + cleaned up indentiation + +2003-07-03 Messju Mohr + + * libs/Smarty_Compiler.class.php: + resurrected $foo->$bar syntax + + * libs/Smarty_Compiler.class.php: + i'm so stupid. kick me. + + * libs/Smarty_Compiler.class.php: + fixed initialisation of $this->_plugins in compile_block_tag() + +2003-07-03 Monte Ohrt + + * libs/Config_File.class.php: + add preg_quote delimiter + +2003-07-03 Messju Mohr + + * libs/Smarty_Compiler.class.php: + applied fix for {$var1->p1|modifier:$var2->p2}-syntax - thanks Dominik + +2003-07-02 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed duplicate generation of arg-list in _compile_block_tag() + + * libs/Smarty_Compiler.class.php: + fixed off-by-one-error in nocache-tag-handling + +2003-06-30 Messju Mohr + + * libs/Smarty_Compiler.class.php: + backed out errornously committed support for $foo->$bar + + * libs/core/core.write_file.php: + fixed indentiation, silenced occasional warning + + * libs/plugins/function.html_image.php: + match first character of file-attribute against "/" instead of + DIRECTORY_SEPARATOR since it is a url-path and not a file-path. + + * libs/Smarty_Compiler.class.php + libs/core/core.write_file.php + libs/plugins/function.html_image.php: + libs/plugins/function.html_image.php + + * libs/Smarty_Compiler.class.php: + re-fixed cacheable_state-handling + + * libs/core/core.display_debug_console.php + libs/core/core.process_cached_inserts.php + libs/core/core.process_compiled_include.php + libs/core/core.run_insert_handler.php: + extincting $this out of smarty_core_*-functions + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + fixed handling of nocache-state + +2003-06-29 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.smarty_include.php + libs/core/core.smarty_include_php.php + libs/plugins/function.eval.php: + removed $this from smarty_include and smarty_include_php + added cleaner handling of $this to {eval} + + * libs/core/core.load_resource_plugin.php: + fixed inlude_once-call + + * docs/de/designers.sgml + docs/fr/designers.sgml: + fixed examples of html_radios and html_checkboxes in german and french docs + +2003-06-25 Monte Ohrt + + * libs/core/core.assemble_auto_filename.php + libs/core/core.write_cache_paths_file.php: + fix typo, fix write_cache_paths logic + + * libs/Smarty.class.php + libs/core/core.assemble_auto_filename.php: + fix SMARTY_COMPILE_DIR_SEP problem, make local var + +2003-06-24 Monte Ohrt + + * libs/Smarty.class.php + libs/core/core.assemble_auto_filename.php + libs/core/core.write_cache_paths_file.php: + fixed cache_paths bug, simplified filename assembly logic + +2003-06-24 Messju Mohr + + * libs/plugins/function.html_image.php: + added parsing of forgotton param "basedir" + + * libs/Smarty_Compiler.class.php: + fixed $smarty.get-reference + + * libs/plugins/block.textformat.php: + removed warning + + * libs/Smarty_Compiler.class.php: + fixed value of _cacheable_state on compiler-startup + +2003-06-23 Monte Ohrt + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.write_cache_paths_file.php: + make cache_path per resource, fix a couple directory path issues + +2003-06-23 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed warning when compiling empty template + + * libs/core/core.write_compiled_include.php: + fixed bug in write_compiled_include + + * libs/core/core.assemble_plugin_filepath.php: + fixed warning + +2003-06-22 Messju Mohr + + * libs/plugins/function.eval.php: + fixed propagation of $this into evald code in smarty_function_eval() + + * libs/core/core.write_cache_paths_file.php + libs/core/core.write_compiled_include.php: + fix in compiled-include-handling + + * libs/core/core.assemble_auto_filename.php + libs/core/core.assemble_plugin_filepath.php + libs/core/core.assign_smarty_interface.php + libs/core/core.create_dir_structure.php + libs/core/core.fetch_resource_info.php + libs/core/core.get_include_path.php + libs/core/core.get_microtime.php + libs/core/core.get_php_resource.php + libs/core/core.is_secure.php + libs/core/core.is_trusted.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php + libs/core/core.parse_resource_name.php + libs/core/core.read_cache_file.php + libs/core/core.rm_auto.php + libs/core/core.rmdir.php + libs/core/core.write_cache_file.php + libs/core/core.write_cache_paths_file.php + libs/core/core.write_compiled_include.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php + libs/plugins/modifier.date_format.php: + started moving from $this to $smarty in core.*.php + +2003-06-21 Monte Ohrt + + * libs/core/core.create_dir_structure.php + libs/core/core.write_file.php + libs/plugins/function.config_load.php: + fix more dir paths + + * NEWS + libs/Smarty.class.php + libs/core/core.assemble_auto_filename.php + libs/core/core.assemble_plugin_filepath.php + libs/core/core.fetch_resource_info.php + libs/core/core.get_php_resource.php + libs/core/core.parse_resource_name.php + libs/core/core.process_cached_inserts.php + libs/core/core.read_cache_file.php + libs/core/core.rm_auto.php + libs/core/core.rmdir.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include.php + libs/core/core.smarty_include_php.php + libs/core/core.write_cache_file.php + libs/core/core.write_cache_paths_file.php + libs/core/core.write_compiled_include.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php + libs/plugins/function.config_load.php + libs/plugins/function.fetch.php + libs/plugins/function.html_image.php: + fix filepaths to core files to use DIRECTORY_SEPARATOR + +2003-06-21 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed {plugin|modifier} syntax + + * libs/Smarty.class.php + libs/core/core.write_compiled_include.php: + fixed compiled include handling + +2003-06-21 Monte Ohrt + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.assemble_auto_filename.php + libs/core/core.assemble_plugin_filepath.php + libs/core/core.write_cache_paths_file.php: + added filepath caching + +2003-06-20 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + update more varnames + + * libs/Smarty.class.php + libs/core/core.display_debug_console.php + libs/core/core.fetch_file_info.php + libs/core/core.fetch_resource_info.php + libs/core/core.get_php_resource.php + libs/core/core.parse_file_path.php + libs/core/core.parse_resource_name.php + libs/core/core.process_cached_inserts.php + libs/core/core.read_cache_file.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include.php + libs/core/core.smarty_include_php.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_compiled_template.php + libs/plugins/function.config_load.php: + refactored var naming to better reflect "resource" instead of "file" where + appropriate + +2003-06-19 Messju Mohr + + * libs/Smarty.class.php: + updated version-number to 2.5.0-cvs + + * libs/core/core.write_cache_file.php: + omit is-cache_dir-writable-check if a cache_handler_function is in use + + * libs/core/core.smarty_include_php.php: + fixed comments in smarty_include_php + +2003-06-19 Monte Ohrt + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.display_debug_console.php + libs/core/core.smarty_include.php + libs/plugins/function.eval.php: + split up _compile_template to _compile_file and _compile_source, fix eval + function + VS: ---------------------------------------------------------------------- + + * libs/plugins/function.config_load.php: + fix logic for _is_compiled() + +2003-06-19 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + added optional assign-attribute to {capture}-tag + + * NEWS + libs/Smarty.class.php: + added $cacheable-parameter to register_compiler_function() + +2003-06-18 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.load_plugins.php + libs/core/core.process_compiled_include.php + libs/core/core.read_cache_file.php + libs/core/core.write_cache_file.php + libs/core/core.write_compiled_include.php: + added $cacheable-parameter to register_function() and register_block() + + * libs/Smarty.class.php: + append '.php' to all compiled templates regardless of the settings of + $use_sub_dirs + + * libs/Smarty.class.php + libs/core/core.read_cache_file.php: + fixed $file_path-parameters passed to smarty_core_fetch_file_info() + +2003-06-17 Monte Ohrt + + * NEWS: + fix name + + * libs/Smarty_Compiler.class.php: + change varnames to follow coding methods + + * NEWS + libs/Smarty_Compiler.class.php: + add math patch to core + +2003-06-17 Messju Mohr + + * libs/core/core.smarty_include.php: + switched _process_template() to _is_compiled()-logic + +2003-06-17 Monte Ohrt + + * libs/Smarty.class.php: + fix _is_compiled logic + + * NEWS: + update news file + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + fix _run_mod_handler routine + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.display_debug_console.php + libs/core/core.fetch_file_info.php + libs/core/core.parse_file_path.php + libs/core/core.write_compiled_template.php + libs/plugins/function.config_load.php: + fix path problems, rename some varibles from "template" to "file" + +2003-06-16 Monte Ohrt + + * libs/core/core.fetch_file_info.php + libs/core/core.fetch_template_info.php: + rename file, commit + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.parse_file_path.php + libs/core/core.read_cache_file.php + libs/plugins/block.strip.php + libs/plugins/block.textformat.php + libs/plugins/compiler.config_load.php + libs/plugins/function.config_load.php + libs/plugins/function.eval.php + libs/plugins/function.fetch.php + libs/plugins/function.html_image.php: + fix config_load, compile fetched arrays to compile_dir, switch display + back to runtime. clean up var names and function names, split up compile + testing and compiling to separate funcs, rename some template_* functions + to + file_* functions and update logic so they can be used for file resources + other than templates. + +2003-06-16 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed little bug in _compile_custom_tag() + +2003-06-16 Monte Ohrt + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.assign_smarty_interface.php + libs/core/core.create_dir_structure.php + libs/core/core.display_debug_console.php + libs/core/core.fetch_template_info.php + libs/core/core.get_include_path.php + libs/core/core.get_microtime.php + libs/core/core.get_php_resource.php + libs/core/core.is_secure.php + libs/core/core.is_trusted.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php + libs/core/core.parse_file_path.php + libs/core/core.process_cached_inserts.php + libs/core/core.read_cache_file.php + libs/core/core.rm_auto.php + libs/core/core.rmdir.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include.php + libs/core/core.smarty_include_php.php + libs/core/core.write_cache_file.php + libs/core/core.write_compiled_template.php + libs/core/core.write_file.php + libs/plugins/core.assign_smarty_interface.php + libs/plugins/core.create_dir_structure.php + libs/plugins/core.display_debug_console.php + libs/plugins/core.fetch_template_info.php + libs/plugins/core.get_include_path.php + libs/plugins/core.get_microtime.php + libs/plugins/core.get_php_resource.php + libs/plugins/core.is_secure.php + libs/plugins/core.is_trusted.php + libs/plugins/core.load_plugins.php + libs/plugins/core.load_resource_plugin.php + libs/plugins/core.parse_file_path.php + libs/plugins/core.process_cached_inserts.php + libs/plugins/core.read_cache_file.php + libs/plugins/core.rm_auto.php + libs/plugins/core.rmdir.php + libs/plugins/core.run_insert_handler.php + libs/plugins/core.smarty_include.php + libs/plugins/core.smarty_include_php.php + libs/plugins/core.write_cache_file.php + libs/plugins/core.write_compiled_template.php + libs/plugins/core.write_file.php: + move core files into their own directory under SMARTY_DIR, + remove abstraction function _execute_core_function + + * libs/Smarty_Compiler.class.php: + fix newline handling for template for all template tags + +2003-06-11 Monte Ohrt + + * libs/plugins/compiler.config_load.php: + add compiler function to cvs repository + +2003-06-11 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + added config-option "request_use_auto_globals" to make auto-globals be + used as request vars instead of HTTP_*_VARS + +2003-06-11 Monte Ohrt + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/function.config_load.php: + make config vars compile statically + +2003-06-11 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + backed out newlines patch + + * NEWS + libs/Smarty_Compiler.class.php: + removed newlines in compiled templates after closing tags + +2003-06-10 Messju Mohr + + * docs/de/designers.sgml: + fixed german note on html_image and disk-access + +2003-06-10 Monte Ohrt + + * libs/plugins/core.parse_file_path.php: + fix bug with resource_type resolving + +2003-06-09 Monte Ohrt + + * docs/designers.sgml: + replace example with more practical one + +2003-06-08 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + added block-methods for registered objects + +2003-06-07 Messju Mohr + + * docs/programmers.sgml: + fixed bug in documentation for $smarty->default_modifiers + +2003-06-06 Monte Ohrt + + * libs/plugins/core.parse_file_path.php: + fix problem with new default_resource_type changes + + * NEWS: + update NEWS file info + + * NEWS + libs/Smarty.class.php + libs/plugins/core.parse_file_path.php: + add default_resource_type, ignore 1 char resource names + + * NEWS + libs/Config_File.class.php: + fix bug where config file starts with hidden section + +2003-06-04 Monte Ohrt + + * NEWS + libs/Smarty.class.php: + -** empty log message *** + +2003-06-03 Monte Ohrt + + * libs/plugins/function.html_image.php: + fix example in code comments + +2003-06-03 Messju Mohr + + * NEWS + libs/plugins/function.counter.php: + fixed behaviour of start=... for {counter} + +2003-06-02 Messju Mohr + + * NEWS + libs/plugins/function.counter.php: + fixed assign for {counter} + +2003-05-30 Monte Ohrt + + * libs/plugins/core.write_cache_file.php + libs/plugins/core.write_compiled_template.php: + add discrete error checking pertaining to $cache_dir + and $compile_dir, their existance and writability + +2003-05-28 Messju Mohr + + * NEWS + libs/plugins/function.html_table.php: + added params vdir, hdir and inner to html_table to allow looping over + the data in various directions + +2003-05-28 Monte Ohrt + + * libs/plugins/core.compile_template.php + libs/plugins/core.display_debug_console.php: + fix problem with security and debug.tpl file + +2003-05-23 Monte Ohrt + + * NEWS: + upd NEWS file + + * libs/Smarty_Compiler.class.php: + allow spaces in literal tags + +2003-05-22 Monte Ohrt + + * docs/fr/programmers.sgml: + fix special chars + +2003-05-19 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + speed up compiled templates, hardcode plugin filepaths instead of + recalculate at runtime + +2003-05-19 Messju Mohr + + * docs/designers.sgml: + fixed example of {html_image} + + * docs/designers.sgml: + fixed typo + +2003-05-12 Messju Mohr + + * libs/Smarty.class.php + libs/plugins/core.read_cache_file.php + libs/plugins/core.smarty_include.php + libs/plugins/function.config_load.php: + fixed multiple redundant occurrences for 'config' and 'template' in + $smarty->_cache_info + +2003-05-10 Messju Mohr + + * libs/plugins/core.create_dir_structure.php: + refurbished create_dir_structure to use '/' internally + + * libs/plugins/core.create_dir_structure.php: + fixed windows absolute-paths in smarty_core_create_dir_structure() + + * libs/plugins/core.create_dir_structure.php: + fixed error-message + +2003-05-09 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed warning due to missing param to _execute_core_function() + + * libs/Smarty_Compiler.class.php: + fixed quoting in _compile_include_php + + * libs/Smarty_Compiler.class.php: + fixed quoting of "file"-parameter in _compile_include_tag() + +2003-05-08 Monte Ohrt + + * docs/programmers.sgml: + fix typo + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/core.compile_template.php + libs/plugins/core.create_dir_structure.php + libs/plugins/core.fetch_template_info.php + libs/plugins/core.get_include_path.php + libs/plugins/core.get_microtime.php + libs/plugins/core.get_php_resource.php + libs/plugins/core.is_secure.php + libs/plugins/core.is_trusted.php + libs/plugins/core.load_plugins.php + libs/plugins/core.load_resource_plugin.php + libs/plugins/core.parse_file_path.php + libs/plugins/core.process_cached_inserts.php + libs/plugins/core.read_cache_file.php + libs/plugins/core.rm_auto.php + libs/plugins/core.rmdir.php + libs/plugins/core.run_insert_handler.php + libs/plugins/core.smarty_include.php + libs/plugins/core.smarty_include_php.php + libs/plugins/core.write_cache_file.php + libs/plugins/core.write_compiled_template.php + libs/plugins/core.write_file.php + libs/plugins/function.config_load.php + libs/plugins/function.fetch.php + libs/plugins/function.html_image.php: + abstract more private functions to plugin directory + + * libs/Config_File.class.php: + only add DIRECTORY_SEPARATOR if it isn't already present + + * libs/Config_File.class.php: + fix directory separator code, use DIRECTORY_SEPARATOR + +2003-05-08 Messju Mohr + + * docs/designers.sgml: + fixed example of html_checkboxes + + * NEWS + libs/Smarty.class.php: + fixed bug in _create_dir_structure() when used with + open_basedir-restriction and relative paths + + * docs/designers.sgml: + fixed example for html_radios + +2003-05-07 Monte Ohrt + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/core.assign_smarty_interface.php + libs/plugins/core.display_debug_console.php + libs/plugins/function.display_debug_console.php: + abstracted display_debug_console and assign_smarty_interface to plugin dir + as a test + + * libs/Smarty.class.php + libs/plugins/function.display_debug_console.php: + correct misc varnames, abstract debug console display to plugin function + + * libs/plugins/modifier.escape.php: + fix typo + +2003-05-05 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + add % to math + + * libs/Smarty.class.php: + clean up comments, formatting + + * NEWS + libs/Smarty.class.php: + keep DIR_SEP for 3rd party compatability + + * NEWS + libs/Smarty.class.php: + remove DIR_SEP, use DIRECTORY_SEPARATOR exclusively + + * libs/Smarty_Compiler.class.php: + remove ++ and -- math operators on template vars + +2003-05-04 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed unused parameter $quote from Smarty_Compiler::_parse_attrs() + + * libs/plugins/function.html_image.php: + fixed DIR_SEP in html_image-plugin + +2003-05-04 Monte Ohrt + + * NEWS + libs/Smarty.class.php: + rename DIR_SEP to SMARTY_DIR_SEP to avoid varname collisions + +2003-05-04 Messju Mohr + + * NEWS + libs/plugins/function.html_image.php: + changed "link" to "href" in html_image. "link" is still working but + deprecated + html_image always renders an alt-tag now (default alt="") + cleaned up indentiation of function.html_image.php + +2003-05-03 Monte Ohrt + + * libs/debug.tpl: + fix typo + +2003-05-02 Messju Mohr + + * NEWS + libs/plugins/function.counter.php: + fixed assign attribute for multiple counters + +2003-05-02 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + allow math on negative number + + * NEWS + libs/Smarty_Compiler.class.php: + added simple math operators to variables + +2003-05-02 Messju Mohr + + * docs/designers.sgml: + fixed typos + +2003-04-30 Monte Ohrt + + * docs/fr/appendixes.sgml + docs/fr/common.dsl + docs/fr/designers.sgml + docs/fr/getting-started.sgml + docs/fr/html-common.dsl + docs/fr/html.dsl + docs/fr/manual.sgml + docs/fr/php.dsl + docs/fr/preface.sgml + docs/fr/programmers.sgml: + add frech docs to cvs repository + +2003-04-29 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + reverted patch for case-insensitive tag-names + +2003-04-28 Messju Mohr + + * docs/programmers.sgml: + reverted back to humerous redundancy in the docs :). although we all + know we are here to generate template-based output, and not to have + fun ;-) + + * docs/getting-started.sgml: + fixed default user and group for max os x installation + + * libs/Smarty.class.php: + made $function[2] and $function[3] options for register_resource + + * libs/Smarty.class.php: + fixed issue with object-callback when fetching a php-resource + + * NEWS + libs/Smarty.class.php: + enabled array(&$obj. 'source', 'timestamp', 'secure', 'trusted') as + callback for register_resource() + + enabled array(&$obj, 'method') as callback for + $default_template_handler_func + +2003-04-27 Messju Mohr + + * docs/designers.sgml + docs/programmers.sgml: + fixed some typos, thank to mehdi + + * libs/plugins/function.counter.php: + prevent assign from overruling print-attribute in function.counter.php + + * libs/plugins/function.counter.php: + fixed problem with counter and assign + + * libs/Smarty.class.php: + fixed notice in _load_plugins() + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + made plugin-names case-insensitive. this affects + compiler/block/custom-functions and modifers. + +2003-04-26 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + remove unnecessary close/open tags from compiled templates + +2003-04-26 Messju Mohr + + * docs/designers.sgml: + added documentation for foreach.property.* + +2003-04-24 Messju Mohr + + * docs/designers.sgml: + fixed example table_attr and tr_attr in html_table-example + +2003-04-21 Greg Beaver + + * libs/Smarty.class.php: + fixed small bug in doc comments + +2003-04-21 Messju Mohr + + * NEWS + libs/plugins/function.html_image.php: + fixed errornous creation of '//' in image_path in html_image + +2003-04-21 Monte Ohrt + + * libs/plugins/modifier.debug_print_var.php: + fix htmlspecialchars() conflict + + * NEWS + libs/plugins/modifier.debug_print_var.php: + fix escapement of special chars in key values of debug console + + * NEWS + libs/plugins/function.config_load.php: + fixed debug timing logic for config_load + + * docs/designers.sgml: + fix example text + + +2003-04-20 Greg Beaver + * plugins/* + Smarty.class.php + Smarty_Compiler.class.php + Config_File.class.php: + updated all doc comments to phpDocumentor format (whew!) + +2003-04-06 Messju Mohr + + * libs/plugins/function.math.php: + allowed "_" in the name of variable-parameters to {math}-function + +2003-04-04 Monte Ohrt + + * NEWS + docs/designers.sgml + libs/Smarty_Compiler.class.php: + change backtic syntax from $`foo` to `$foo` + + * NEWS + libs/Smarty_Compiler.class.php: + recognize $foo[][] syntax in embedded quotes without backticks + +2003-04-03 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + name=123 is passed as an integer (not a string) to plugins now + +2003-04-01 Messju Mohr + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + added CVS $Id: ChangeLog 4779 2013-09-30 19:14:32Z Uwe.Tews@googlemail.com $ + +2003-03-31 Messju Mohr + + * libs/Smarty.class.php: + added missing compile_id inside Smarty_Compiler + + * libs/Smarty_Compiler.class.php: + fixed flaw when generating an error for missing postfilter + +2003-03-31 Monte Ohrt + + * docs/getting-started.sgml + docs/programmers.sgml: + fix typos + +2003-03-27 Messju Mohr + + * NEWS + libs/plugins/modifier.debug_print_var.php: + $length is now propagated to sub-values in debug_print_var + +2003-03-26 Monte Ohrt + + * NEWS: + update header + + * RELEASE_NOTES: + commit changes to release notes + + * (Smarty_2_5_0_RC2) + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + committing RC2 + +2003-03-24 Messju Mohr + + * NEWS + libs/Smarty.class.php: + made clear_cache() ignore compile_id when clearing cache_groups + + * libs/plugins/function.popup.php: + made onmouseout XHTML-compatible in function.popup.php + +2003-03-21 Messju Mohr + + * NEWS + libs/Smarty.class.php: + applied new var-names to fetch() + + * NEWS + libs/Smarty.class.php: + renamed $localvars to $_localvars in cache-file-handling-functions, + added _get_auto_id()-function + +2003-03-21 Monte Ohrt + + * libs/plugins/function.mailto.php + libs/plugins/function.popup.php: + update functions for XHTML compatability + +2003-03-21 Messju Mohr + + * libs/Smarty.class.php: + fixed wrong $auto_id in _read_cache_file() + + * NEWS + libs/Smarty.class.php: + swapped compile_id and cache_id in read_cache_file and write_cache_file + + * libs/Smarty.class.php: + reverted patch for ignoring compile-id back to -r1.364, due to problems + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php: + html_radios and html_checkboxes accept "selected" instead of "checked" + optionally now + + * NEWS + libs/Smarty.class.php: + swapped compile_id and cache_id for cache-file-handling again + +2003-03-20 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + fix notice when no parameter is passed to default + +2003-03-20 Messju Mohr + + * NEWS + libs/Smarty.class.php: + removed notice of undefined var in _rm_auto() + +2003-03-19 Monte Ohrt + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_table.php: + fix a few error messages, follow consistancy format plugin_name: errormsg + + * libs/plugins/function.html_radios.php: + update error messages + + * NEWS + libs/plugins/function.html_radios.php: + add a warning when an array is passed as the 'checked' value of html_radios + +2003-03-19 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed errormessage in _compile_smarty_ref() + + * NEWS + docs/designers.sgml: + updated docs for html_image + +2003-03-18 Messju Mohr + + * NEWS + libs/Smarty.class.php: + cleaned up calls to readdir() + + * libs/plugins/function.html_options.php: + fixed label for optgroup in html_options + +2003-03-18 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + fix (newly introduced) bug with passing multiple modifiers to a parameter + +2003-03-18 Messju Mohr + + * NEWS + docs/designers.sgml: + updated docs for html_checkboxes, html_options and html_radios + + * libs/plugins/function.html_options.php: + fixed wrong default-"name" in function.html_options.php + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php: + renamed "checkbox" and "radios" to "options" in {html_checkboxes} and + {html_radios} + + * libs/plugins/outputfilter.trimwhitespace.php: + tried to optimize re-replacement in outputfilter.trimwhitespace.php a + little + + * libs/plugins/outputfilter.trimwhitespace.php: + fixed greedy str_replace in outputfilter.trimwhitespace.php + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php: + html_options, html_checkboxes and html_radios now pass-thru all unknown + paramters + +2003-03-17 Messju Mohr + + * NEWS + libs/plugins/function.html_options.php: + html_options passthru all unknown paramters now + +2003-03-17 Monte Ohrt + + * NEWS + libs/plugins/function.html_image.php: + Fix link bug in html_image function, also make output XHTML compatible + + * libs/Smarty_Compiler.class.php: + fix issue of embedded var and escaped double quotes + +2003-03-15 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + back out "@" logic, apply only to default modifier special case + + * libs/Smarty_Compiler.class.php: + fix @ logic, only use upon an echo + + * NEWS + libs/Smarty_Compiler.class.php: + append "@" to template var echoes to supress possible notices + + * NEWS + libs/Smarty_Compiler.class.php: + append "@" to _run_mod_handler to supress warnings + +2003-03-14 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + fix problem with escaped double quotes + + * NEWS + libs/plugins/function.html_radios.php: + fixed html_options to not return an array + +2003-03-12 Messju Mohr + + * NEWS + libs/plugins/modifier.truncate.php: + fixed length in modifier.truncate.php + + * NEWS + libs/plugins/outputfilter.trimwhitespace.php: + fixed handling of '$'-signs in trimwhitespace outputfilter (messju) + +2003-03-12 Monte Ohrt + + * docs/programmers.sgml: + update technical explanation of assign_by_ref and append_by_ref + +2003-03-11 Monte Ohrt + + * NEWS + libs/Smarty.class.php: + fix config file recompiling code + +2003-03-07 Monte Ohrt + + * libs/plugins/function.html_image.php: + change E_USER_ERROR to E_USER_NOTICE + + * libs/plugins/function.html_image.php: + suppress warning in html_image + + * NEWS + libs/plugins/function.html_image.php: + update changes to html_image + +2003-03-06 Monte Ohrt + + * docs/designers.sgml + docs/de/appendixes.sgml + docs/de/common.dsl + docs/de/designers.sgml + docs/de/getting-started.sgml + docs/de/html-common.dsl + docs/de/html.dsl + docs/de/manual.sgml + docs/de/preface.sgml + docs/de/programmers.sgml: + add german docs to dist + + * NEWS: + update news file + + * libs/plugins/function.html_image.php: + fix width/height parameter index + + * NEWS + libs/Smarty.class.php: + get rid of unsetting name and script attributes to insert tags + +2003-03-05 Monte Ohrt + + * NEWS + RELEASE_NOTES: + update NEWS file + + * libs/plugins/modifier.string_format.php: + fix argument order, erroneously swapped a while back + + * (Smarty_2_5_0_RC1) + NEWS + README + RELEASE_NOTES + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + commit final changes for 2.5.0-RC1 + +2003-03-04 Monte Ohrt + + * docs/programmers.sgml: + remove $show_info_header and $show_info_include property vars from docs + +2003-03-03 Monte Ohrt + + * NEWS + libs/plugins/function.popup.php: + fixed PHP notice + +2003-02-28 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + simplify smarty.const.foo and smarty.const.$foo logic + + * libs/Smarty_Compiler.class.php: + only allow $foo syntax in embedded quotes, unless escaped with backticks + then allow any dollar var + + * NEWS + libs/Smarty_Compiler.class.php: + fix "once" var compiling to work with new attr compiling methods for + include_php + + * FAQ + NEWS + README + docs/designers.sgml + docs/getting-started.sgml + libs/Smarty_Compiler.class.php + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_select_date.php + libs/plugins/function.html_select_time.php + libs/plugins/function.html_table.php: + fix $smarty.const.foo compiling, clean up double quoted strings, + allow full dollar var syntax in quotes again + +2003-02-27 Monte Ohrt + + * docs/designers.sgml + docs/programmers.sgml + libs/Smarty_Compiler.class.php: + update docs, fix smarty var compiling, allow any $smarty.*.$foo syntax, + add $`foobar` for embedded variables + + * libs/plugins/function.html_image.php: + update functionality + +2003-02-26 Monte Ohrt + + * NEWS + libs/plugins/modifier.nl2br.php: + add nl2br modifier + + * libs/plugins/function.html_image.php: + add link parameter + +2003-02-24 Monte Ohrt + + * libs/Smarty.class.php + libs/plugins/function.html_image.php: + fix rename problem in windows, unlink first + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php + libs/plugins/shared.escape_special_chars.php: + update functions with separate escape_special_chars routine + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php: + commit checkboxes, update radios + + * NEWS + libs/Smarty.class.php + libs/plugins/function.html_image.php: + fix bug with get_registered_object + + * NEWS + libs/plugins/modifier.cat.php: + added cat modifier to distribution + + * NEWS + libs/Smarty_Compiler.class.php: + added << >> <> support to IF statements + + * libs/plugins/function.html_radios.php: + apply patch to initial html_radios function + + * NEWS + libs/Smarty.class.php: + fix _assign_smarty_interface to not overwrite keys other than 'request' + + * NEWS + libs/plugins/function.html_radios.php: + added html_radios to distribution + + * NEWS + libs/plugins/modifier.string_format.php: + fixed arg order of string_format + + * NEWS + libs/Smarty.class.php: + use tmp file for file writes, avoid race condition + + * NEWS + libs/Smarty_Compiler.class.php: + add $smarty.config.foo var, handle embedded smarty var correctly + + * NEWS + libs/plugins/function.fetch.php: + silence warnings in fetch plugin + +2003-02-21 Monte Ohrt + + * INSTALL: + update wording + + * INSTALL: + update install instructions + + * AUTHORS + BUGS + CREDITS + QUICKSTART + README + RESOURCES + TESTIMONIALS: + remove some files already in docs or elsewhere + + * demo/index.php: + add templates_c to repository + + * index.php: + move demo files to demo directory + + * Config_File.class.php + Smarty.class.php + Smarty_Compiler.class.php + debug.tpl: + moved lib files under libs directory + +2003-02-20 Monte Ohrt + + * NEWS + Smarty.class.php: + add get_config_vars() method, update get_template_vars() functionality + + * NEWS + Smarty.class.php: + fix minor logic in _fetch_template_info() + + * NEWS + Smarty.class.php: + support merging appended vars + + * NEWS + Smarty.class.php: + fix cache groups behavior with compile_id set + +2003-02-19 Monte Ohrt + + * Smarty.class.php: + back out third parameter, extend functionality of append + + * NEWS + Smarty_Compiler.class.php: + update imbedded vars, allow special $smarty vars + + * plugins/function.html_table.php: + add plugin html_table + + * NEWS + Smarty.class.php: + support appending key=>val pairs + + * NEWS + Smarty_Compiler.class.php: + change embedded variable logic to only recognize $foo and $foo[0][bar] + syntax + + * NEWS + Smarty_Compiler.class.php: + allow null as function attribute value + +2003-02-18 Monte Ohrt + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + support foo->bar[index] syntax + + * Smarty_Compiler.class.php: + allow $foo->bar[0] syntax + +2003-02-17 Monte Ohrt + + * plugins/modifier.escape.php: + fix syntax error from previous commit + + * NEWS + Smarty.class.php: + add error msgs to get_registered_object + + * Smarty.class.php: + add function for getting reference to registered object + + * Smarty_Compiler.class.php: + back out patches for object and objref calls on $smarty var + + * NEWS + Smarty_Compiler.class.php: + treat unrecognized param attribute syntax as a string + + * NEWS + Smarty_Compiler.class.php: + support $smarty.const.$foo syntax + + * NEWS + debug.tpl + plugins/modifier.count_words.php + plugins/modifier.escape.php: + fix E_NOTICE messages + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + add @ and === to if tokens, few param cleanups + +2003-02-16 Greg Beaver + + * ChangeLog + Smarty.class.php + Smarty_Compiler.class.php: + many more phpdoc comment upgrades + +2003-02-15 Greg Beaver + * Smarty.class.php + Smarty_Compiler.class.php + continue cleaning of phpdoc comments. All that is needed is the + addition of @return tags and perhaps a bit more verbose comments + and they are finished. + +2003-02-14 Monte Ohrt + + * NEWS + Smarty.class.php: + enable config_load error messages + + * NEWS + plugins/function.html_options.php: + fix html_options to not escape already escaped entities + + * NEWS + Smarty.class.php: + send Last-Modified header on cache creation, misc tab/spacing cleanup + +2003-02-13 Monte Ohrt + + * Smarty_Compiler.class.php + docs/designers.sgml: + allow dash in plain text + + * NEWS + Smarty_Compiler.class.php: + check strict syntax of function attributes + +2003-02-12 Monte Ohrt + + * NEWS + Smarty_Compiler.class.php: + dropped support for modifiers on object parameters, + added support for objects as modifier parameters + + * NEWS + Smarty_Compiler.class.php + docs/designers.sgml: + fix bug with decimal numbers in if statements, misc doc updates + +2003-02-11 Monte Ohrt + + * (Smarty_2_4_2) + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: + update version numbers + +2003-02-10 Monte Ohrt + + * NEWS + Smarty_Compiler.class.php: + add support for $foo->$bar syntax + + * NEWS: + update NEWS file + + * NEWS + Smarty_Compiler.class.php: + support full var syntax in quoted text, fix problem with const var access, + clean up some more regex code, fix object problem with no properties + +2003-02-06 Monte Ohrt + + * (Smarty_2_4_1) + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: + committed 2.4.1 changes + + * NEWS + Smarty_Compiler.class.php: + ignore case in IF statements + +2003-02-05 Monte Ohrt + + * NEWS + Smarty_Compiler.class.php: + treat undefined constants as null + + * NEWS + Smarty.class.php: + fix problem with inserts and nested fetches + + * Smarty_Compiler.class.php: + fix "if" regex for math tokens + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs/getting-started.sgml: + added support for extracting params to include_php + +2003-02-04 Monte Ohrt + + * RELEASE_NOTES: + reformat text + +2003-02-03 Monte Ohrt + + * NEWS: + update news file + +2003-02-03 Greg Beaver + + * ChangeLog + Smarty.class.php: + begin fixing phpdoc comments in Smarty.class.php + + * ChangeLog + Config_File.class.php: + fixed phpdoc comments + +2003-02-03 Monte Ohrt + + * Smarty_Compiler.class.php: + allow $foo->bar[$x].foo syntax + + * Smarty_Compiler.class.php + index.php + configs/test.conf + templates/index.tpl: + fix accidental commit + + * index.php + configs/test.conf + templates/index.tpl: + allow $foo->bar[$j].blah type of syntax + +2003-02-02 Greg Beaver + + * Smarty.class.php + begin fixing of phpdoc comments + + * Config_File.class.php + fix phpdoc comments, add phpDocumentor docblock templates + +2003-02-02 Monte Ohrt + + * Smarty.class.php + docs/html.dsl + docs/php.dsl: + fix version number + + * (Smarty_2_4_0) + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php + docs/appendixes.sgml + docs/designers.sgml + docs/programmers.sgml: + update Smarty version numbers + +2003-01-30 Monte Ohrt + + * NEWS + Smarty_Compiler.class.php + TODO: + fix order of php tag comparisons + + * NEWS + Smarty_Compiler.class.php: + fix known php tag handling problems + +2003-01-29 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php: + change comments to phpdoc style + +2003-01-28 Monte Ohrt + + * Smarty.class.php + docs/programmers.sgml: + make separate var for compiler file + + * plugins/function.fetch.php: + fix error call + +2003-01-25 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php: + add support for restriction to registered methods + + * plugins/outputfilter.trimwhitespace.php: + update with textarea support + +2003-01-24 Monte Ohrt + + * Smarty_Compiler.class.php: + fix compiling problem with {foreach} tags + + * Smarty.class.php + Smarty_Compiler.class.php: + put objects in own array, add object param format support, change + object syntax from foo.bar to foo->bar + +2003-01-23 Monte Ohrt + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + add support for object registration + +2003-01-22 Monte Ohrt + + * Smarty.class.php: + add file & line number of calling error to error message + +2003-01-21 Monte Ohrt + + * Smarty_Compiler.class.php: + put php style object syntax back in + +2003-01-20 Monte Ohrt + + * Smarty.class.php: + move security settings to fetch function for template_dir + + * NEWS + Smarty.class.php: + fix debug template and security, add template_dir to secure_dir at runtime + +2003-01-17 Monte Ohrt + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + added new object support without new template syntax + +2003-01-15 Monte Ohrt + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + fix if statement syntax for negative integers, fix issue with directories + named '0' + +2003-01-08 Monte Ohrt + + * Smarty.class.php + plugins/function.counter.php + plugins/function.cycle.php + plugins/function.debug.php + plugins/function.eval.php + plugins/function.fetch.php + plugins/function.html_options.php + plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/function.mailto.php + plugins/function.math.php + plugins/function.popup.php + plugins/function.popup_init.php: + update plugins to return values instead of echo, fix config file cache + to include global config variables in cache file + + * Smarty_Compiler.class.php: + fix bug with >= tests in if statements, comment out full object support + +2003-01-06 Monte Ohrt + + * NEWS + docs/html.dsl + plugins/modifier.escape.php: + add javascript escape parameter to escape modifier + +2003-01-02 Monte Ohrt + + * templates/header.tpl: + move the title into head where it should be + +2002-12-24 Monte Ohrt + + * Smarty_Compiler.class.php: + added correct line numbers to smarty syntax error messages + + * docs/programmers.sgml: + update append documentation, make more clear on its function + + * Smarty_Compiler.class.php: + fix modifier matching regexp + +2002-12-23 Monte Ohrt + + * Smarty_Compiler.class.php: + support nested function calls in IF statements + +2002-12-20 Monte Ohrt + + * Smarty_Compiler.class.php: + few more fixes, spaces around function parameters + + * Smarty_Compiler.class.php: + fix misc syntax issues with {if} tags + +2002-12-20 Monte Ohrt + + * Smarty_Compiler.class.php: + fix misc syntax issues with {if} tags + +2002-12-19 Monte Ohrt + + * Smarty_Compiler.class.php: + commit updates, passes all smoke tests + + * NEWS: + update NEWS file + + * Smarty_Compiler.class.php: + fixed literal string not in quotes as parameters + + * NEWS + Smarty_Compiler.class.php: + fix misc syntax issues, add ability to pass modifiers to functions + +2002-12-18 Monte Ohrt + + * NEWS: + update NEWS + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + update compiler code, clean up regex, add new syntax features + +2002-12-16 Monte Ohrt + + * NEWS: + update NEWS file + + * Smarty_Compiler.class.php: + commit updates for objects + +2002-12-14 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php: + fix bug with compiling config files with caching on + +2002-12-13 Monte Ohrt + + * Smarty_Compiler.class.php: + fix problem with matching single quoted strings + + * Smarty_Compiler.class.php: + update embedded variable logic, get rid of ."" at end of output + + * NEWS + docs/designers.sgml + plugins/function.html_select_date.php: + add day_value_format to html_select_date + +2002-12-12 Monte Ohrt + + * plugins/modifier.debug_print_var.php: + fix bug, double escaped values in display + + * Smarty.class.php: + move debug test back into fetch() + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + plugins/outputfilter.trimwhitespace.php: + assigned vars are no longer in global name space, few debug cleanups + +2002-12-11 Monte Ohrt + + * plugins/function.popup.php: + fix error in newline code + + * plugins/function.popup.php: + fix popup to allow newlines in text data + +2002-12-10 Monte Ohrt + + * Smarty.class.php: + fix plugin error logic + + * docs/designers.sgml + docs/programmers.sgml: + edit examples, make more verbose + + * NEWS + plugins/function.html_options.php: + escape html entities in the option values and output + + * NEWS + plugins/function.html_options.php: + fixed bug with label of html_options + +2002-12-09 Monte Ohrt + + * Smarty.class.php: + add support for var_export() + + * Config_File.class.php + Smarty.class.php: + clean up code, respect force_compile and compile_check flags + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs/designers.sgml + plugins/function.mailto.php: + add caching feature to config loading, document update, add mailto plugin + +2002-12-08 Monte Ohrt + + * plugins/function.fetch.php: + fix query part of URL + +2002-12-05 Monte Ohrt + + * docs/designers.sgml: + fix typos + +2002-11-22 Monte Ohrt + + * Smarty_Compiler.class.php: + patch for warning message + +2002-11-21 Monte Ohrt + + * RELEASE_NOTES + Smarty.class.php: + get rid of testing for a set value with assign function, just set to + whatever is passed into the template + + * docs/programmers.sgml: + fix typo + +2002-11-19 Monte Ohrt + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: + commit changes, ready for 2.3.1 release + +2002-11-01 Monte Ohrt + + * plugins/function.html_options.php: + added label attribute to all option outputs, cover w3c spec. + + * NEWS: update NEWS file + + * docs/designers.sgml: update docs for optgroup output + + * plugins/function.html_options.php: + make html_options work with optgroup, make func modular and recursive. + +2002-10-29 Monte Ohrt + + * NEWS + Smarty.class.php: set mtime on compile files so they match source files + +2002-10-18 Monte Ohrt + + * NEWS + Smarty.class.php: added proper support for open_basedir setting + + * docs/designers.sgml: clear up docs on index, iteration and rownum + +2002-10-16 Monte Ohrt + + * plugins/modifier.default.php: fix warning message in default modifier + +2002-09-25 Monte Ohrt + + * docs/designers.sgml + plugins/modifier.strip.php + NEWS: added strip variable modifier + +2002-09-24 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty_Compiler.class.php: + Fix to be able to use $smarty.x variables as arrays. + +2002-09-23 Monte Ohrt + + * Config_File.class.php: + add support for mac/dos formatted config files (fix newlines) + + * docs/programmers.sgml: add optional tags to clear_cache parameters + + * docs/designers.sgml: + fix error with include_php description, add $this to description + +2002-09-20 Monte Ohrt + + * NEWS + docs/getting-started.sgml: fixed errors with example setup docs + +2002-09-16 Monte Ohrt + + * plugins/block.textformat.php + docs/designers.sgml + NEWS: add textformat block function + +2002-09-10 Monte Ohrt + + * docs/designers.sgml: + add assign attribute to cycle function documentation + + * docs/designers.sgml + docs/programmers.sgml: fix typos + +2002-09-09 Monte Ohrt + + * plugins/function.debug.php + templates/header.tpl: + fix header in debug template, fix typo in header.tpl example + +2002-08-15 mohrt + + * docs/programmers.sgml: fix typos + +2002-08-08 mohrt + + * RELEASE_NOTES + Smarty.class.php: + supress warnings from unlink() and is_dir(), let error handler deal with it + +2002-08-07 mohrt + + * docs/appendixes.sgml + docs/designers.sgml + docs/programmers.sgml + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: update files with new version numbers + +2002-08-02 mohrt + + * NEWS: update NEWS file with credits + + * NEWS + Smarty.class.php: added assign_by_ref() and append_by_ref() functions + +2002-08-01 mohrt + + * TODO + NEWS + Smarty.class.php: + changed default warning type for plugin errors from E_USER_WARNING to E_USER_ERROR + +2002-07-29 mohrt + + * plugins/function.html_select_time.php + docs/designers.sgml + NEWS: added paramters to html_select_time plugin + +2002-07-25 Andrei Zmievski + + * TODO: *** empty log message *** + +2002-07-24 mohrt + + * QUICKSTART: update QUICKSTART guide + + * NEWS + debug.tpl + plugins/modifier.debug_print_var.php: + update debug console to show objects, fix warning in debug.tpl + +2002-07-23 mohrt + + * docs/programmers.sgml: fix load_filter examples + + * Config_File.class.php + NEWS: fix error when there are no sections in config file + +2002-07-19 mohrt + + * docs/getting-started.sgml: fix error in install guide + +2002-07-18 mohrt + + * Smarty_Compiler.class.php: + correct the expression match for smarty:nodefaults + +2002-07-17 mohrt + + * Smarty_Compiler.class.php: fix default modifier to work with config vars + + * Smarty_Compiler.class.php: got args to strstr backwards... + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + change default modifiers to array instead of string + + * Smarty_Compiler.class.php + docs/designers.sgml + Smarty.class.php: add default modifier logic, minor doc updates + + * NEWS + Smarty.class.php + plugins/function.popup_init.php: + make popup_init xhtml compliant, minor variable name changes for consistancy + +2002-07-16 mohrt + + * NEWS: update NEWS file + + * plugins/function.debug.php + Smarty.class.php + debug.tpl + NEWS: + fix problem with filenames on windows, add ability to supply expire time in seconds when clearing cache or compiled files + +2002-07-15 mohrt + + * Smarty.class.php: + fixed problem with insert tags when loading function from script attribute + and caching enabled (Monte) + +2002-07-14 mohrt + + * NEWS + Smarty.class.php: fix bug with debug_tpl file path for Windows + +2002-07-12 Monte Ohrt + + * Smarty.class.php: fix append function with array/string issue + +2002-07-11 Monte Ohrt + + * RELEASE_NOTES: update release notes + + * NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php + Config_File.class.php: update files to 2.2.0 tags, get ready for release + +2002-07-09 Monte Ohrt + + * NEWS + Smarty.class.php: make debug.tpl work with any delimiter + + * NEWS + Smarty.class.php: + change tests in append and assign to != '' instead of empty(), which is more accurate + +2002-07-08 Monte Ohrt + + * docs/designers.sgml: minor doc update + + * Smarty.class.php: + cast var as an array, simplify and get rid of PHP warning messages + +2002-07-03 Monte Ohrt + + * Smarty.class.php: one more N + + * Smarty.class.php: + prepend "N" to filenames to avoid possible OS issues with dir names starting with "-" + + * Smarty.class.php: only set $debug_tpl in constructor if empty + + * Smarty.class.php + docs/designers.sgml + docs/getting-started.sgml + docs/programmers.sgml: + make use_sub_dirs go back to crc32 for subdir separation + +2002-06-29 Monte Ohrt + + * plugins/function.eval.php: do nothing if $val is empty + + * TODO + plugins/function.eval.php + plugins/function.popup_init.php: + add zindex to popup init, fix error message for eval. + +2002-06-27 Monte Ohrt + + * Smarty.class.php: + only loop through relative paths for PHP include_path, remove $_relative variable + + * Smarty_Compiler.class.php: added {$smarty.version} variable + +2002-06-26 Monte Ohrt + + * docs/appendixes.sgml + docs/designers.sgml + docs/getting-started.sgml + docs/programmers.sgml + Smarty.class.php: + update plugin loading logic, look in SMARTY_DIR, then cwd. If all fail, then retry all with include_path + + * templates/header.tpl + Smarty.class.php: update get_include_path, get _path_array only once + + * Smarty.class.php: fix get_include_path function for windows + + * Smarty.class.php: update plugin search logic + + * Smarty.class.php: only search include_path if relative path + + * plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/modifier.date_format.php + Smarty_Compiler.class.php + NEWS + Smarty.class.php: allow plugins_dir to be an array of directories + +2002-06-25 Monte Ohrt + + * docs/programmers.sgml + docs/getting-started.sgml: update installation docs + + * debug.tpl + docs/getting-started.sgml + templates/debug.tpl + NEWS + Smarty.class.php: move debug.tpl to SMARTY_DIR, add to constructor + +2002-06-24 Monte Ohrt + + * plugins/function.assign_debug_info.php + NEWS: fixed warning message in function.assign_debug_info + + * Smarty.class.php: update include_path fixes + + * NEWS: + fixed $template_dir, $compile_dir, $cache_dir, $config_dir to respect include_path + +2002-06-23 Monte Ohrt + + * plugins/shared.make_timestamp.php: + update timestamp plugin to work when passed a timestamp + +2002-06-19 Monte Ohrt + + * NEWS: update NEWS file + + * plugins/modifier.date_format.php + docs/designers.sgml: + update date_format, allow optional 2nd paramater as default date if passed date is empty. update docs. + + * plugins/modifier.date_format.php: + fix date_format modifier, return nothing if given empty string + +2002-06-18 Monte Ohrt + + * NEWS + plugins/function.cycle.php: + gave $reset a default value in cycle function + + * plugins/function.html_select_date.php + plugins/shared.make_timestamp.php + NEWS: + corrected warnings in html_select_time function, made make timestamp always return a timestamp + +2002-06-17 Monte Ohrt + + * Smarty.class.php: swapped around cache_id and compile_id order + +2002-06-14 Monte Ohrt + + * docs/programmers.sgml + plugins/function.popup_init.php + Smarty.class.php: + change directory delimiter to "^" for cache and compile files + +2002-06-13 Andrei Zmievski + + * TODO: done. + + * Smarty_Compiler.class.php: + Optimize the calculation of section 'total' property. + +2002-06-11 Monte Ohrt + + * NEWS + Smarty.class.php: + added support for subdir exclusion, deletion by full or partial cache_id and compile_id, change file format to urlencoded values instead of crc32 + +2002-06-07 Monte Ohrt + + * Smarty.class.php: fix bug with last_modified_check code + + * NEWS + Smarty.class.php: + updated $GLOBALS refererence for HTTP_IF_MODIFIED_SINCE + +2002-06-06 Monte Ohrt + + * docs/designers.sgml + overlib.js: + remove overlib.js file from distribution, update plugin and docs + +2002-06-05 Monte Ohrt + + * docs/designers.sgml + NEWS + Smarty.class.php: fix 304 Not Modified, don't send content + +2002-06-03 Monte Ohrt + + * plugins/function.cycle.php: update version number + + * plugins/function.cycle.php + NEWS: + fixed cycle function to respect delimiter setting after initial setting + + * Smarty.class.php + NEWS: + update $GLOBALS references to work properly with track_globals settings + + * plugins/function.math.php: fixed bug with call $assign + + * docs/appendixes.sgml + docs/designers.sgml + plugins/function.html_options.php + plugins/function.html_select_time.php + NEWS + Smarty.class.php + Smarty_Compiler.class.php: + optimized for loops with count() function calls + +2002-06-01 Andrei Zmievski + + * TODO: *** empty log message *** + +2002-05-21 Monte Ohrt + + * NEWS: update NEWS file + + * plugins/function.html_select_date.php + RESOURCES + docs/designers.sgml + Config_File.class.php: + update html_select_date with month_value_format attribute for controlling the format of the month values. + +2002-05-17 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: + Made it possible to use simple variables inside [] for indexing. + +2002-05-16 Monte Ohrt + + * docs/designers.sgml + docs/getting-started.sgml + NEWS + Smarty.class.php + Smarty_Compiler.class.php + TESTIMONIALS: add "once" attribute to php_include, update docs + +2002-05-09 Andrei Zmievski + + * NEWS + TODO: *** empty log message *** + +2002-05-07 Monte Ohrt + + * plugins/function.cycle.php: remove \n from cycle function + + * docs/designers.sgml + plugins/function.cycle.php + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php + NEWS: + update cycle function to handle array as input, update files to 2.1.1 + +2002-05-06 Monte Ohrt + + * plugins/function.fetch.php: + update fetch function with more error checking + +2002-05-03 Monte Ohrt + + * docs/designers.sgml + plugins/function.counter.php: + update counter to use name instead of id (id still works though) + + * plugins/function.cycle.php + docs/designers.sgml: rename id to name for cycle function + + * plugins/function.cycle.php: + update cycle function to allow blank values parameter after initialized + + * plugins/function.cycle.php: fix syntax error + +2002-05-02 Monte Ohrt + + * plugins/function.cycle.php: ugh, another typo + + * plugins/function.cycle.php: update comments + + * docs/designers.sgml + plugins/function.cycle.php + NEWS: added function cycle + + * FAQ + Smarty.class.php: fix register_outputfilter function + +2002-05-01 Monte Ohrt + + * docs/designers.sgml + NEWS + Smarty.class.php: fixed bug with resource testing and include_path + +2002-04-30 Monte Ohrt + + * NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: update files for 2.1.0 release + +2002-04-30 Andrei Zmievski + + * plugins/function.fetch.php + docs/programmers.sgml + Smarty.class.php: Fix. + +2002-04-29 Andrei Zmievski + + * docs/programmers.sgml + docs/designers.sgml: A whole bunch of docs. + +2002-04-26 Monte Ohrt + + * FAQ + QUICKSTART + docs/programmers.sgml: update FAQ, QUICKSTART, small doc syntax fix + +2002-04-24 Monte Ohrt + + * docs/programmers.sgml + templates/debug.tpl + Smarty.class.php: changed doc structure a bit + +2002-04-16 Andrei Zmievski + + * Smarty.class.php: Add register/unregister API for output filters. + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + TODO: + Changed the way filters are loaded, which now has to be done explicitly, + either through load_filter() API or by filling in $autoload_filters variable. + Also renamed internal variable to avoid namespace pollution. + +2002-04-15 Andrei Zmievski + + * Smarty.class.php: + Fixed _get_php_resource() to take include_path into account. + +2002-04-15 Monte Ohrt + + * docs/designers.sgml: + update docs, get modifiers and functions into index for easy access + + * docs/programmers.sgml + NEWS + Smarty.class.php: update caching documentation + +2002-04-15 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty.class.php: Only turn down error notices if $debugging is false. + +2002-04-15 Monte Ohrt + + * NEWS: update NEWS file + + * plugins/function.html_select_date.php: + fixed logic so this works right when field_separator = "/" + + * plugins/function.html_select_date.php: + fix regular expression for matching date + +2002-04-13 Monte Ohrt + + * docs/designers.sgml: updated html_select_date docs to reflect changes + + * NEWS + plugins/function.html_select_date.php: + added YYYY-MM-DD support to html_select_date + +2002-04-12 Andrei Zmievski + + * TESTIMONIALS: New entry. + +2002-04-12 Monte Ohrt + + * plugins/modifier.strip_tags.php: back out changes to strip_tags + + * docs/programmers.sgml: update docs regarding cache_lifetime + + * plugins/modifier.strip_tags.php + Smarty.class.php: + update cache_lifetime logic: -1 = never expire, 0 = always expire + +2002-04-11 Andrei Zmievski + + * BUGS + FAQ + INSTALL + NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs/getting-started.sgml: + Fixed directory separtor issue. Requiring PHP 4.0.6 now. + + * NEWS + Smarty_Compiler.class.php: + Added ability to use simple variables for array indices or object properties. + + * TESTIMONIALS: Another one. + + * TESTIMONIALS: Adding one from Mark P. + +2002-04-05 Andrei Zmievski + + * Smarty_Compiler.class.php + NEWS + Smarty.class.php: Make it possible to unregister pre/postfilter plugins. + +2002-04-05 Monte Ohrt + + * INSTALL: Remove addons file from INSTALL instructions + +2002-04-04 Monte Ohrt + + * docs/designers.sgml: update doc error + + * docs/designers.sgml + plugins/modifier.escape.php + NEWS + Smarty.class.php: added htmlall attribute to escape modifier + +2002-04-03 Andrei Zmievski + + * Smarty_Compiler.class.php: Fixed undefined offset warning in {if} tag. + + * Smarty.class.php + NEWS: Added template_exists() API. + + * Smarty.class.php + Smarty_Compiler.class.php + NEWS: + - Added $smarty.template variable. + - Fixed {include_php} tag when dynamic values were used for 'file' attribute. + + * Config_File.class.php: Separator setting fix. + +2002-03-28 Monte Ohrt + + * FAQ + README: add digest address + + * FAQ + README + Smarty.class.php: update mailing list addresses + +2002-03-28 Andrei Zmievski + + * NEWS: *** empty log message *** + + * plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/modifier.date_format.php: + Fix for when plugins directory is not the default one. + +2002-03-28 Andrei Zmievski + + * NEWS: *** empty log message *** + + * plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/modifier.date_format.php: + Fix for when plugins directory is not the default one. + +2002-03-27 Monte Ohrt + + * FAQ: update FAQ page + +2002-03-26 Andrei Zmievski + + * CREDITS + NEWS + Smarty.class.php + Smarty_Compiler.class.php + TODO: Block functions changes. + + * Config_File.class.php: *** empty log message *** + +2002-03-25 Andrei Zmievski + + * Smarty.class.php + Smarty_Compiler.class.php: Initial implementation of block functions. + +2002-03-22 Monte Ohrt + + * docs/designers.sgml: fix documentation error in capture + +2002-03-22 Andrei Zmievski + + * Smarty.class.php: *** empty log message *** + + * Smarty.class.php: Turn off notices. + +2002-03-21 Andrei Zmievski + + * Smarty_Compiler.class.php: Make _current_file available to prefilters. + + * NEWS + Smarty.class.php: + Made is possible to assign variables in pre/postfilters. + +2002-03-20 Andrei Zmievski + + * plugins/function.html_select_date.php: Fixed +/- functionality. + + * NEWS: *** empty log message *** + +2002-03-20 Monte Ohrt + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: update version numbers + + * plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/modifier.date_format.php: + move .make_timestamp.php to shared.make_timestamp.php + + * NEWS + Smarty.class.php + docs/designers.sgml + plugins/function.fetch.php + plugins/function.html_select_date.php: + update file generation, replace crc32() '-' with 'N' + +2002-03-20 Andrei Zmievski + + * Smarty_Compiler.class.php: *** empty log message *** + +2002-03-19 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty.class.php + Smarty_Compiler.class.php: + Fix plugin behavior for inserts with script attribute. + + * NEWS: *** empty log message *** + + * Smarty_Compiler.class.php: Fix bug with $smarty.cookies. + + * TESTIMONIALS: *** empty log message *** + +2002-03-15 Monte Ohrt + + * NEWS + docs/designers.sgml: update Changelog + + * plugins/modifier.indent.php + plugins/modifier.wordwrap.php: add wordwrap and indent to repository + +2002-03-14 Monte Ohrt + + * Smarty.class.php: + remove show_info_include and show_info_header functions + +2002-03-13 Monte Ohrt + + * plugins/function.fetch.php: update fetch function + + * plugins/function.fetch.php: update fetch function with new parameters + +2002-03-12 Monte Ohrt + + * docs/designers.sgml: update doc tables + + * docs/designers.sgml: update docs columns + + * docs/getting-started.sgml + docs/appendixes.sgml: update docs + + * TESTIMONIALS + docs/appendixes.sgml: update syntax error in docs, add to testimonials + +2002-03-04 Monte Ohrt + + * FAQ + README: update FAQ, README with digest mode info + +2002-03-02 Monte Ohrt + + * QUICKSTART: update quickstart + + * Smarty.class.php: + change behavior so cache_lifetime = 0 never expires (instead of always regenerate) + +2002-03-01 Monte Ohrt + + * docs/designers.sgml: update doc example + +2002-03-01 Andrei Zmievski + + * CREDITS + RELEASE_NOTES + TODO + NEWS: *** empty log message *** + +2002-03-01 Monte Ohrt + + * docs/appendixes.sgml + docs/designers.sgml + docs/getting-started.sgml + docs/programmers.sgml: update document id tags + + * docs.sgml: remove docs.sgml + + * RESOURCES + Smarty.class.php: update resources + +2002-02-28 Andrei Zmievski + + * TESTIMONIALS + docs/appendixes.sgml + docs/designers.sgml + docs/programmers.sgml: *** empty log message *** + +2002-02-27 Andrei Zmievski + + * plugins/function.eval.php + docs/designers.sgml: *** empty log message *** + +2002-02-27 Monte Ohrt + + * plugins/function.eval.php: added eval function to plugin dir + +2002-02-27 Andrei Zmievski + + * NEWS: *** empty log message *** + +2002-02-27 Monte Ohrt + + * docs/designers.sgml: fix syntax error + + * docs/appendixes.sgml + docs/designers.sgml + docs/getting-started.sgml + docs/programmers.sgml: convert technical notes to docbook format + + * NEWS + docs/designers.sgml: added "eval" plugin docs + +2002-02-26 Andrei Zmievski + + * docs/programmers.sgml + docs/designers.sgml + docs/appendixes.sgml + docs/getting-started.sgml + docs/html-common.dsl + docs/.cvsignore: *** empty log message *** + + * docs/appendixes.sgml + docs/common.dsl + docs/designers.sgml + docs/getting-started.sgml + docs/html-common.dsl + docs/html.dsl + docs/manual.sgml + docs/preface.sgml + docs/programmers.sgml: Split up docs. + +2002-02-25 Andrei Zmievski + + * docs.sgml: *** empty log message *** + +2002-02-22 Monte Ohrt + + * docs.sgml: update docs + +2002-02-22 Andrei Zmievski + + * docs.sgml + AUTHORS + NEWS: *** empty log message *** + +2002-02-21 Monte Ohrt + + * Config_File.class.php + NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: update misc changes + +2002-02-21 Andrei Zmievski + + * docs.sgml: *** empty log message *** + +2002-02-20 Monte Ohrt + + * docs.sgml: misc updates + +2002-02-20 Andrei Zmievski + + * docs.sgml: *** empty log message *** + + * Smarty.class.php + plugins/function.assign.php + plugins/function.assign_debug_info.php + plugins/function.counter.php + plugins/function.fetch.php + plugins/function.math.php + plugins/function.popup.php + plugins/function.popup_init.php + plugins/modifier.escape.php: Fixup some naming. + +2002-02-20 Monte Ohrt + + * docs.sgml: update docs + +2002-02-20 Andrei Zmievski + + * docs.sgml: *** empty log message *** + +2002-02-20 Monte Ohrt + + * NEWS + docs.sgml + plugins/modifier.escape.php: + removed global vars from fetch function, added attrs to escape modifier + + * docs.sgml: add plugin chapter outline + +2002-02-19 Monte Ohrt + + * README + RELEASE_NOTES + RESOURCES + Smarty.class.php + docs.sgml + BUGS + FAQ + INSTALL + QUICKSTART: update docs + +2002-02-19 Andrei Zmievski + + * docs.sgml: Updated resources docs. + + * README: *** empty log message *** + + * docs.sgml: Updated description of {$smarty} variable. + + * BUGS + FAQ + INSTALL + QUICKSTART + RELEASE_NOTES + docs.sgml: Remove PEAR notes. + +2002-02-18 Andrei Zmievski + + * Config_File.class.php + NEWS: Removed dependency on PEAR. + +2002-02-18 Monte Ohrt + + * NEWS + docs.sgml + plugins/function.popup_init.php: add src attribute to popup_init + +2002-02-15 Andrei Zmievski + + * Smarty_Compiler.class.php + plugins/modifier.debug_print_var.php + NEWS + Smarty.class.php: Performance enhancements. + +2002-02-06 Andrei Zmievski + + * plugins/function.html_options.php: + Fix html_options output to be XHTML compatible. + +2002-02-05 Andrei Zmievski + + * Smarty.class.php + Smarty_Compiler.class.php: Fix up plugin inclusion. + + * Smarty.class.php + Smarty_Compiler.class.php + TODO + plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/modifier.date_format.php: Fix plugin directory access. + +2002-02-04 Andrei Zmievski + + * .cvsignore + Smarty_Compiler.class.php: *** empty log message *** + +2002-01-31 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + TODO + plugins/function.assign.php + plugins/function.assign_debug_info.php + plugins/function.counter.php + plugins/function.fetch.php + plugins/function.html_options.php + plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/function.math.php + plugins/function.popup.php + plugins/function.popup_init.php + plugins/modifier.capitalize.php + plugins/modifier.count_characters.php + plugins/modifier.count_paragraphs.php + plugins/modifier.count_sentences.php + plugins/modifier.count_words.php + plugins/modifier.date_format.php + plugins/modifier.debug_print_var.php + plugins/modifier.default.php + plugins/modifier.escape.php + plugins/modifier.lower.php + plugins/modifier.regex_replace.php + plugins/modifier.replace.php + plugins/modifier.spacify.php + plugins/modifier.string_format.php + plugins/modifier.strip_tags.php + plugins/modifier.truncate.php + plugins/modifier.upper.php + plugins/shared.make_timestamp.php + templates/index.tpl + AUTHORS + CREDITS + Config_File.class.php + README: Implemented plugin architecture. + + * NEWS: *** empty log message *** + +2002-01-30 Monte Ohrt + + * NEWS + Smarty.addons.php + Smarty.class.php + docs.sgml: added modifiers wordwrap and indent + +2002-01-28 Monte Ohrt + + * Smarty.class.php + docs.sgml: + add support for is-modified-since headers, adjust a doc example + +2002-01-24 Monte Ohrt + + * Smarty.class.php: cleanup formatting + + * NEWS + Smarty.class.php + docs.sgml: update ChangeLog, remove insert_tag_check parameter + +2002-01-24 Andrei Zmievski + + * plugins/standard.plugin.php: *** empty log message *** + +2002-01-24 Monte Ohrt + + * Smarty.class.php: fix syntax error + + * Smarty.class.php: removed unneccesary test from fetch() + +2002-01-23 Monte Ohrt + + * Smarty.addons.php: update overlib fixes + + * NEWS: update changelog + + * FAQ + NEWS + RESOURCES + Smarty.addons.php: updated overlib fixes + +2001-12-31 Andrei Zmievski + + * NEWS + Smarty.class.php: Fixed compile_id problem. + +2001-12-28 Monte Ohrt + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + fixed problem with using assigned var with include_php filepath + +2001-12-21 Monte Ohrt + + * RESOURCES: update RESOURCES + +2001-12-20 Monte Ohrt + + * FAQ + README: update FAQ + +2001-12-18 Monte Ohrt + + * Smarty_Compiler.class.php + docs.sgml + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php: update version numbers + +2001-12-18 Andrei Zmievski + + * NEWS + Smarty.class.php: Fixed clear_cache(). + +2001-12-14 Monte Ohrt + + * NEWS + Smarty.addons.php: + fixed bug in smarty_make_timestamp introduced in PHP 4.1.0 + +2001-12-13 Monte Ohrt + + * NEWS + Smarty.class.php + docs.sgml: update default function args, fix cached insert debug timing + +2001-12-12 Monte Ohrt + + * docs.sgml: fix syntax error in documentation + + * Smarty.class.php: update default template handling functionality + +2001-12-11 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php: update file fetching logic + +2001-12-11 Andrei Zmievski + + * NEWS + Smarty.class.php: Added 'script' attribute to {insert..}. + +2001-12-10 Monte Ohrt + + * NEWS + Smarty.class.php: added default template function handler + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: update version numbers in files to 1.5.1 + +2001-12-10 Andrei Zmievski + + * NEWS + Smarty.class.php: Removed error message from the _read_file() method. + + * Smarty.class.php: Fix check for compile and cache IDs. + +2001-12-06 Monte Ohrt + + * QUICKSTART: fix spelling error in QUICKSTART + + * docs.sgml: fixed spelling errors in documenation + + * Smarty_Compiler.class.php + docs.sgml + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php: commit 1.5.0 release + + * RESOURCES + docs.sgml: added RESOURCES file + +2001-12-05 Andrei Zmievski + + * Smarty_Compiler.class.php: Refactor. + +2001-12-05 Monte Ohrt + + * NEWS + Smarty_Compiler.class.php + docs.sgml: added assign to include and php_include + + * Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: *** empty log message *** + +2001-12-04 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: Formatting. + +2001-12-04 Monte Ohrt + + * Smarty_Compiler.class.php + NEWS + Smarty.class.php: update ChangeLog + +2001-12-04 Andrei Zmievski + + * NEWS + Smarty.class.php: Formatting. + +2001-12-04 Monte Ohrt + + * Smarty.class.php: removed SMARTY_DIR setting in constructor + + * Smarty.class.php: fix Smarty.class.php indention error + + * Smarty.class.php: update trusted logic + +2001-12-03 Monte Ohrt + + * Smarty.class.php: + fix up is_secure, is_trusted, make _parse_tpl_path function + + * Smarty.class.php: fix problem with testing SMARTY_DIR as empty + + * NEWS + docs.sgml: update documentation, change log + + * Smarty.class.php: + update constructor to check for SMARTY_DIR before assigning + +2001-12-03 Andrei Zmievski + + * NEWS + Smarty.class.php: *** empty log message *** + +2001-12-03 Monte Ohrt + + * FAQ + INSTALL + RELEASE_NOTES: update a few files + + * NEWS + QUICKSTART + Smarty.class.php + docs.sgml: added trusted_dir functionality, cleaned up secure_dir logic + +2001-12-03 Andrei Zmievski + + * NEWS: *** empty log message *** + + * NEWS + Smarty.class.php: - Introduced $compile_id class variable. + - Fixed a situation where if $cache_id and $compile_id were both null + they were passed to auto functions as empty string instead of null. + +2001-11-30 Monte Ohrt + + * NEWS + Smarty.class.php: + change variable names in fetch() fuction to smarty_* to avoid namespace conflicts + + * NEWS + Smarty.class.php: fixed bug in _rm_auto with catenated null values + +2001-11-29 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: Added $smarty.section.* syntax. + + * Smarty_Compiler.class.php: Made 'name' attribute optional for {foreach}. + +2001-11-29 Monte Ohrt + + * Smarty.class.php + index.php: remove assign "now" in index.tpl + +2001-11-29 Andrei Zmievski + + * NEWS + Smarty.addons.php + Smarty.class.php: Fix formatting. + +2001-11-28 Monte Ohrt + + * NEWS + Smarty.class.php + docs.sgml: + removed return statements from _read_cache_file (how did they get in there?) + +2001-11-27 Monte Ohrt + + * docs.sgml + NEWS + Smarty.addons.php + Smarty.class.php: + fixed bugs and added assign attribute to several functions + +2001-11-27 Andrei Zmievski + + * NEWS: Some rewording. + + * Smarty_Compiler.class.php: Fix $smarty.capture access. + + * TODO: *** empty log message *** + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + Made {config_load ..} merge globals from each config file only once per scope. + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: - Added {foreach ...}. + - Made certain $smarty.* references handled at compilation time. + +2001-11-26 Monte Ohrt + + * Config_File.class.php + NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: commit cache handler functionality + +2001-11-20 Andrei Zmievski + + * NEWS + Smarty.addons.php + Smarty_Compiler.class.php: Various fixes and additions. + + * NEWS + index.php: *** empty log message *** + +2001-11-05 Monte Ohrt + + * Smarty.class.php: changed _read_file parameter from $end to $lines + + * NEWS + Smarty.class.php: fixed is_cache, make cache reading more efficient + +2001-11-02 Monte Ohrt + + * FAQ + NEWS: update FAQ with mailing list Reply-To header FAQ + + * NEWS + Smarty.class.php + index.php: supress fopen errors, return false if cache file won't load + +2001-11-01 Monte Ohrt + + * QUICKSTART + docs.sgml + index.php: update QUICKSTART guide with index key example + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: commit all updates for 1.4.6 + +2001-11-01 Andrei Zmievski + + * NEWS: *** empty log message *** + +2001-10-30 Monte Ohrt + + * Smarty.addons.php: fix assign function problem with empty value passed + + * NEWS + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + templates/debug.tpl: + fixed bug in assign function when passing an empty value + +2001-10-26 Monte Ohrt + + * Smarty.addons.php + Smarty.class.php + index.php: fix minor typo in debug code + +2001-10-26 Andrei Zmievski + + * Smarty.class.php: Typo. + +2001-10-26 Monte Ohrt + + * Smarty.addons.php: + update debug console output, handle html encoding correctly + +2001-10-26 Andrei Zmievski + + * Smarty.addons.php + templates/debug.tpl: Debug formatting. + + * Smarty.class.php: Disable rmdir warning. + +2001-10-26 Monte Ohrt + + * Smarty.addons.php + Smarty.class.php + templates/debug.tpl: update debugging to expand array variables + + * Smarty.class.php + docs.sgml: + update docs for fetching only timestamp with custom template source functions + + * Smarty.addons.php: fix debug console error + +2001-10-26 Andrei Zmievski + + * docs.sgml: Typos. + + * Smarty.addons.php: Cleanup whitespace. + + * Smarty_Compiler.class.php: Clean up whitespace. + + * Smarty.class.php: Cleaning up code, formatting mostly. + + * NEWS: *** empty log message *** + +2001-10-25 Monte Ohrt + + * NEWS + docs.sgml: update documentation to current version + + * NEWS + Smarty.addons.php: + updated fetch to give proper warning when fetching unreadable or nonexistant files + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + fixed problem with newline at the end of compiled templates + + * NEWS + Smarty.class.php: recompile cache if config file gets modified too. + + * NEWS + Smarty.class.php: + added feature to regenerate cache if compile_check is enabled and an + involved template is modified + +2001-10-23 Monte Ohrt + + * Smarty.class.php: fix indent for insert tags in debug console + + * templates/debug.tpl: update debug.tpl file format + + * NEWS + Smarty.addons.php + Smarty.class.php + templates/debug.tpl: + update execution time debugging, move into include list + +2001-10-10 Monte Ohrt + + * NEWS + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: + fixed up execution time output in debug console + +2001-10-09 Andrei Zmievski + + * Config_File.class.php + NEWS + Smarty.class.php + TODO: Added support for hidden config vars. + +2001-10-04 Monte Ohrt + + * NEWS + Smarty.addons.php + Smarty.class.php + templates/debug.tpl: added execution times to debug console + +2001-10-02 Andrei Zmievski + + * Smarty_Compiler.class.php: Add space. + +2001-10-01 Andrei Zmievski + + * Smarty.class.php: Fix reference to compile_id. + +2001-09-28 Andrei Zmievski + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: Added postfilter functions. + +2001-09-26 Andrei Zmievski + + * NEWS + Smarty.class.php + docs.sgml: Rename to clear_compiled_tpl(). + +2001-09-25 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: + Fixed line number reporting when removing comments. + +2001-09-20 Monte Ohrt + + * NEWS + RELEASE_NOTES + Smarty.addons.php: made html_options output xhtml compatible + +2001-09-19 Monte Ohrt + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + templates/debug.tpl: updated version numbers + +2001-09-16 Monte Ohrt + + * FAQ + NEWS + docs.sgml: fix doc error with insert function + +2001-09-06 Andrei Zmievski + + * NEWS: *** empty log message *** + +2001-08-31 Monte Ohrt + + * NEWS: update ChangeLog + + * overlib.js + Smarty.addons.php + Smarty.class.php + docs.sgml: + update overlib to 3.50, adjust addon code so that the overlib.js file isn't modified + +2001-08-31 Andrei Zmievski + + * Smarty.class.php: - compile_id changes + + * NEWS + Smarty.addons.php: - compile_id support + - new options for html_select_date + +2001-08-23 Andrei Zmievski + + * TODO: *** empty log message *** + +2001-08-10 Andrei Zmievski + + * NEWS + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: + Modified to pass Smarty object as second parameter to insert functions. + Also moved _smarty_mod_handler() and _smarty_insert_handler() into the class. + + * NEWS + Smarty_Compiler.class.php: + Passing Smarty as second parameter to prefilter functions. + +2001-08-09 Andrei Zmievski + + * NEWS: *** empty log message *** + +2001-08-09 Monte Ohrt + + * templates/index.tpl + Smarty.class.php: add smarty.now variable to template + +2001-08-06 Monte Ohrt + + * templates/index.tpl: change config_load section back to setup + +2001-08-06 Andrei Zmievski + + * Smarty.addons.php: Optimize a bit. + +2001-08-04 Monte Ohrt + + * docs.sgml: update capture documentation + +2001-08-03 Monte Ohrt + + * FAQ + NEWS + Smarty.class.php: + fix bug with URL controlled debugging, works now (Monte) + +2001-08-01 Andrei Zmievski + + * Config_File.class.php: *** empty log message *** + + * Smarty_Compiler.class.php + Smarty.class.php: - Fixed some E_NOTICE stuff in compiler. + - Generalized assign_smarty_interface() a bit. + +2001-07-24 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php + TODO: See ChangeLog for details. + +2001-07-20 Andrei Zmievski + + * Config_File.class.php: Booleanize case-insensitively. + +2001-07-17 Monte Ohrt + + * NEWS: update ChangeLog + + * Smarty.class.php + docs.sgml: put SMARTY_DIR on Config_File require + +2001-07-11 Monte Ohrt + + * docs.sgml + FAQ + NEWS + Smarty.class.php: + updated security to not include insecure docs, only warning + +2001-07-10 Andrei Zmievski + + * Smarty.class.php: Adding 'sizeof' as an allowed {if} function. + +2001-07-06 Andrei Zmievski + + * NEWS: *** empty log message *** + +2001-07-06 Monte Ohrt + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: update version number to 1.4.4 + + * NEWS + Smarty.addons.php + Smarty_Compiler.class.php + docs.sgml + templates/header.tpl + templates/index.tpl: update documenatation, template examples + +2001-07-03 Andrei Zmievski + + * NEWS + Smarty.class.php: Implemented access to request vars via $smarty var. + + * NEWS + Smarty_Compiler.class.php: + Fixed a bug with parsing function arguments in {if} tags. + +2001-06-30 Monte Ohrt + + * NEWS: update ChangeLog + +2001-06-29 Monte Ohrt + + * Smarty.addons.php + Smarty.class.php + docs.sgml + overlib.js: + moved overlib to separate file, added SMARTY_DIR, documented. added much documentation + +2001-06-29 Andrei Zmievski + + * NEWS + RELEASE_NOTES + TODO: *** empty log message *** + +2001-06-29 Monte Ohrt + + * NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + docs.sgml + index.php + templates/debug.tpl + templates/header.tpl + templates/index.tpl: update release notes + +2001-06-27 Andrei Zmievski + + * Smarty_Compiler.class.php: *** empty log message *** + + * NEWS + Smarty_Compiler.class.php: Implemented 'step' section attribute. + + * Smarty_Compiler.class.php: Negative values of 'max' will mean no max. + + * AUTHORS + NEWS: *** empty log message *** + +2001-06-26 Andrei Zmievski + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + index.php: Added 'max' and 'start' section attributes. + Added 'total' and 'iteration' section properties. + +2001-06-25 Andrei Zmievski + + * Config_File.class.php + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: Update version numbers. + +2001-06-23 Andrei Zmievski + + * TODO: *** empty log message *** + +2001-06-21 Andrei Zmievski + + * Config_File.class.php + NEWS: Fixed booleanization bug. + +2001-06-20 Monte Ohrt + + * docs.sgml: + update documents to reflect changes to cached content & debugging + +2001-06-20 Andrei Zmievski + + * Smarty.addons.php + Smarty.class.php: Remove debug output for cached and fetched cases. + +2001-06-20 Monte Ohrt + + * Smarty.class.php: update include_info to false + + * Smarty.class.php + docs.sgml + index.php + templates/footer.tpl: + moved debug logic into Smarty completely, created flags for it + +2001-06-19 Andrei Zmievski + + * Smarty.addons.php + Smarty.class.php + templates/debug.tpl: *** empty log message *** + + * NEWS + Smarty.class.php: Remove unneeded debug functions. + +2001-06-19 Monte Ohrt + + * NEWS + Smarty.addons.php + Smarty.class.php + docs.sgml + templates/debug.tpl + templates/footer.tpl: commit updates, add debug template + +2001-06-19 Andrei Zmievski + + * Smarty.class.php + Smarty_Compiler.class.php + TODO: + Moved config loading code inside main class, the compiled template now + simply calls that method. + +2001-06-15 Andrei Zmievski + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + templates/index.tpl: * moved config array into class itself + * added 'scope' attribute for config_load + + * Smarty_Compiler.class.php + Smarty.addons.php + Smarty.class.php: Finishing up secure mode. + +2001-06-15 Monte Ohrt + + * NEWS: update ChangeLog + + * Smarty_Compiler.class.php: cleaned up logic of if statement security + + * Smarty_Compiler.class.php: update if logic to cover more situations + + * Smarty_Compiler.class.php + docs.sgml: update if statement security feature + +2001-06-14 Andrei Zmievski + + * Smarty.addons.php + Smarty.class.php: *** empty log message *** + + * NEWS + Smarty_Compiler.class.php: + Fixed a bug with quoted strings inside if statements. + +2001-06-13 Monte Ohrt + + * Smarty.addons.php + Smarty.class.php: added secure_dir array for multiple secure directories + + * Smarty.addons.php: update fetch funtion to respect security setting + + * NEWS + Smarty.addons.php + Smarty.class.php + docs.sgml: update documentation, changelog + + * Smarty.addons.php + Smarty.class.php: moved _extract setting to assign functions + + * Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: + added assign/unassign custom functions, ability to re-extract tpl_vars + + * Smarty.class.php + Smarty_Compiler.class.php + docs.sgml + index.php: commit security features + +2001-06-11 Andrei Zmievski + + * Smarty.class.php: Version variable typo. + +2001-06-05 Andrei Zmievski + + * Smarty.class.php: + Create config object in fetch() or just set the config path if it already + exists. + +2001-06-04 Andrei Zmievski + + * Smarty.class.php: *** empty log message *** + + * NEWS + Smarty_Compiler.class.php: + Fixed a problem with $ inside strip tags. + +2001-05-31 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Config_File.class.php: Allow empty config_path. + +2001-05-29 Monte Ohrt + + * Smarty_Compiler.class.php + docs.sgml + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php: update version numbers + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: moved version variable to internal variable + +2001-05-22 Andrei Zmievski + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + Moved $_smarty_sections and $_smarty_conf_obj into Smarty class. + +2001-05-18 Monte Ohrt + + * NEWS: update ChangeLog + + * FAQ + QUICKSTART: update FAQ, QUICKSTART for windows include_path setup + + * configs/test.conf: added configs directory to cvs + +2001-05-18 Andrei Zmievski + + * Smarty.class.php: Use compiler_class for including the file. + +2001-05-18 Monte Ohrt + + * docs.sgml: fix typo + +2001-05-16 Monte Ohrt + + * README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: update files to version 1.4.1 + + * NEWS: update ChangeLog + +2001-05-15 Andrei Zmievski + + * NEWS: *** empty log message *** + + * index.php: forget that! + + * NEWS + Smarty_Compiler.class.php + index.php: Fixed a few E_NOTICE warnings. + +2001-05-09 Monte Ohrt + + * NEWS + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + docs.sgml: update dates versions + +2001-05-09 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty.class.php: + Use absolute paths when requiring/including Smart components. + + * NEWS: *** empty log message *** + + * Smarty.class.php: Use write mode instead of append. + +2001-05-02 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: Fix indexing by section properties. + +2001-05-02 Monte Ohrt + + * NEWS: update changelog + + * Smarty.class.php: remove period from syntax error + +2001-05-02 Andrei Zmievski + + * Smarty_Compiler.class.php: Double-quote the attribute values by default. + +2001-04-30 Monte Ohrt + + * Smarty_Compiler.class.php + NEWS: added simple {capture} logic + +2001-04-30 Andrei Zmievski + + * TODO: *** empty log message *** + + * Smarty_Compiler.class.php + Smarty.class.php: Fix passing config vars to included files. + + * Smarty.class.php + Smarty_Compiler.class.php: Fix inclusion again. + +2001-04-30 Monte Ohrt + + * FAQ + RELEASE_NOTES + Smarty.class.php + misc/fix_vars.php + NEWS: update paths for windows (c:) + +2001-04-28 Andrei Zmievski + + * Smarty.class.php + Smarty_Compiler.class.php: Fix passing variables to included files. + + * templates/index.tpl: *** empty log message *** + +2001-04-27 Andrei Zmievski + + * Smarty_Compiler.class.php: Fix includes. + +2001-04-26 Andrei Zmievski + + * Smarty_Compiler.class.php + docs.sgml + Smarty.class.php: Formatting mostly. + + * Smarty_Compiler.class.php + Config_File.class.php: *** empty log message *** + +2001-04-26 Monte Ohrt + + * Smarty_Compiler.class.php + docs.sgml + FAQ + NEWS + QUICKSTART + RELEASE_NOTES + Smarty.class.php: update docs with new changes + +2001-04-26 Andrei Zmievski + + * RELEASE_NOTES: *** empty log message *** + + * docs.sgml + templates/index.tpl + NEWS + Smarty_Compiler.class.php: Added ability to reference object properties. + +2001-04-25 Andrei Zmievski + + * README + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml + AUTHORS + Config_File.class.php + CREDITS + RELEASE_NOTES + NEWS: *** empty log message *** + + * docs.sgml: Docs on new parameter to custom functions. + + * NEWS: *** empty log message *** + + * Smarty_Compiler.class.php: + Changing the way tpl vars are referenced and passing smarty object + to custom functions. + + * RELEASE_NOTES + docs.sgml: Fixing docs a bit. + +2001-04-24 Andrei Zmievski + + * docs.sgml: Docs for $compiler_class and compiler functions. + + * templates/index.tpl: *** empty log message *** + + * Smarty_Compiler.class.php: Remove debugging. + +2001-04-24 Monte Ohrt + + * docs.sgml: update compiler function docs + +2001-04-24 Andrei Zmievski + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + templates/index.tpl: Added compiler function support. + +2001-04-24 Monte Ohrt + + * RELEASE_NOTES + Smarty.class.php: + update notes, change show_info_header to false by default + + * Smarty.class.php + Smarty_Compiler.class.php + docs.sgml + CREDITS + FAQ + NEWS + README + RELEASE_NOTES: update documenation, bug fixes + +2001-04-24 Andrei Zmievski + + * misc/fix_vars.php: Hopefully fix for sure. + +2001-04-23 Monte Ohrt + + * misc/fix_vars.php: uncomment copy/unlink + +2001-04-23 Andrei Zmievski + + * misc/fix_vars.php: Do it more thoroughly. + + * misc/fix_vars.php: check for } + +2001-04-22 Andrei Zmievski + + * misc/fix_vars.php: Fix variable parsing. + +2001-04-20 Monte Ohrt + + * misc/fix_vars.php: fix problem with 4.0.5-dev and preg_replace_callback + +2001-04-19 Monte Ohrt + + * Smarty_Compiler.class.php + docs.sgml + misc/fix_vars.php + NEWS + RELEASE_NOTES + Smarty.class.php: update notes/documentation + + * NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: update files for 1.4.0 release + +2001-04-16 Andrei Zmievski + + * misc/fix_vars.php: Added fix_vars.php script. + +2001-04-16 Monte Ohrt + + * QUICKSTART + RELEASE_NOTES + docs.sgml + templates/index.tpl: + update RELEASE_NOTES & scripts with new section var syntax + +2001-04-13 Andrei Zmievski + + * Smarty_Compiler.class.php: * Implement new variable format parser. + * Optimizing config load a bit. + +2001-04-13 Monte Ohrt + + * FAQ + NEWS + RELEASE_NOTES + Smarty.class.php: + added $check_cached_insert_tags to speed up cached pages if + {insert ...} is not used (Monte) + +2001-04-12 Andrei Zmievski + + * NEWS + Smarty.class.php + RELEASE_NOTES: *** empty log message *** + + * Smarty_Compiler.class.php: Remove redundant functions. + + * Smarty.class.php: Formatting. + +2001-04-12 Monte Ohrt + + * Smarty.class.php: update file: parsing + + * Smarty.class.php + docs.sgml: update documentation + +2001-04-12 Andrei Zmievski + + * Smarty.class.php + Smarty_Compiler.class.php + TODO: *** empty log message *** + +2001-04-11 Monte Ohrt + + * FAQ + QUICKSTART + RELEASE_NOTES: added RELEASE_NOTES file to cvs + + * NEWS + docs.sgml: update ChangeLog, update documentation + + * Smarty.class.php + Smarty_Compiler.class.php + templates/index.tpl: + update Smarty to compile at run-time. added ability to get files from + absolute paths, added work around for LOCK_EX and windows, changed a few + file permissions to be more secure. + +2001-03-29 Monte Ohrt + + * NEWS + Smarty.addons.php: + allow arbitrary date strings instead of just timestamps + +2001-03-28 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php + docs.sgml + FAQ + NEWS + README + Smarty.addons.php: + update version in class, update docs for count_ and new vars + + * templates/index.tpl + docs.sgml: update docs, example template + +2001-03-28 Andrei Zmievski + + * Smarty_Compiler.class.php: Some variable renaming. + +2001-03-23 Andrei Zmievski + + * Smarty_Compiler.class.php + NEWS: Fixed nested include infinite repeat bug. + +2001-03-23 Monte Ohrt + + * Smarty.class.php: fix version number + + * Smarty.class.php + NEWS: added optional HTML header to output + +2001-03-22 Andrei Zmievski + + * Smarty_Compiler.class.php: Fixed inclusion of dynamic files. + +2001-03-16 Andrei Zmievski + + * Smarty_Compiler.class.php: Fixing the config_load scoping. + + * Smarty_Compiler.class.php: making config variables global for now. + +2001-03-15 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty_Compiler.class.php: + * Includes are now always done via generated function call to protect + namespace. + * config_load now always uses global config object to improve + performance. + +2001-03-13 Monte Ohrt + + * docs.sgml: update math documentation with format attribute + +2001-03-11 Monte Ohrt + + * docs.sgml + NEWS + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: update math function with format attribute + +2001-03-10 Andrei Zmievski + + * Smarty.addons.php: *** empty log message *** + + * NEWS + Smarty.addons.php + Smarty.class.php: Added html_select_time custom function. + +2001-03-08 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php + NEWS + README + Smarty.addons.php: rename 1.3.1b to 1.3.1pl1 + + * NEWS + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: update version numbers, changelog + + * Smarty.class.php + Smarty_Compiler.class.php: + moved _syntax_error to Smarty_Compiler.class.php + + * Smarty.class.php + docs.sgml: + missing _syntax_error function recovered. fixed minor syntax in docs + +2001-03-07 Monte Ohrt + + * QUICKSTART + README + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + BUGS + INSTALL + NEWS: update everything to 1.3.1 + +2001-03-03 Monte Ohrt + + * Smarty_Compiler.class.php + Smarty.class.php: fixed bug with cached insert tags + +2001-03-02 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php: + fix cache fuctions with separated compiled class + + * FAQ + NEWS + docs.sgml: update changelog + +2001-03-02 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: Added 'first' and 'last' section properties. + +2001-03-02 Monte Ohrt + + * TODO: remove compiling separation TODO + + * Smarty_Compiler.class.php + Smarty.addons.php + Smarty.class.php: update function headers + + * templates/index.tpl + NEWS + Smarty.class.php + Smarty_Compiler.class.php + index.php: split out compiling code for faster execution + + * Smarty.class.php: fixed a few warning messages + + * Smarty.addons.php + Smarty.class.php + docs.sgml + NEWS: added fetch, unregister mod/fun, updated docs + +2001-03-01 Monte Ohrt + + * Smarty.addons.php: added "int" to available list + + * docs.sgml + FAQ + Smarty.class.php: update FAQ, add math functions & update documetation + + * index.php + Smarty.addons.php + Smarty.class.php + docs.sgml: fixed literal tags and other optional delimiters + +2001-02-26 Andrei Zmievski + + * NEWS + Smarty.class.php: + Added index_prev, index_next section properties and ability to + index by them. + + * NEWS + Smarty.addons.php + Smarty.class.php: Reverting the plugins patch - needs more thought. + + * Smarty.class.php: Fixing plugin loading. + +2001-02-23 Andrei Zmievski + + * Smarty.addons.php + Smarty.class.php + plugins/standard.plugin.php + NEWS: Added plugin functionality. + +2001-02-22 Monte Ohrt + + * docs.sgml + templates/index.tpl + NEWS + README + Smarty.class.php: fixed issue with php tags executed in literal blocks + +2001-02-21 Monte Ohrt + + * NEWS: update changelog for LGPL change + + * Smarty.class.php + docs.sgml + README + Smarty.addons.php: updated version numbers to 1.3.0 + + * NEWS + templates/index.tpl: update changelog, rearrange index.tpl file + +2001-02-21 Andrei Zmievski + + * NEWS + Smarty.class.php: *** empty log message *** + +2001-02-21 Monte Ohrt + + * docs.sgml: update parameters for is_cached and fetch + +2001-02-21 Andrei Zmievski + + * NEWS + Smarty.class.php: *** empty log message *** + +2001-02-21 Monte Ohrt + + * NEWS + Smarty.addons.php + docs.sgml: update docs, remove header function from addons + +2001-02-20 Monte Ohrt + + * FAQ + NEWS: update changelog + + * TODO: update todo + + * TODO: update todo list + + * Smarty.class.php: update php tag handling logic + +2001-02-19 Monte Ohrt + + * index.php + Config_File.class.php + FAQ + Smarty.class.php + docs.sgml: fixed + + * Smarty.addons.php: *** empty log message *** + +2001-02-13 Andrei Zmievski + + * TODO: *** empty log message *** + +2001-02-12 Andrei Zmievski + + * templates/index.tpl + Smarty.class.php: *** empty log message *** + +2001-02-10 Monte Ohrt + + * Smarty.class.php: remove unneeded preg_match + + * Smarty.class.php: remove comment + + * Smarty.class.php: updated php escape to handle diff --git a/lib/smarty/libs/internals/core.assemble_plugin_filepath.php b/lib/smarty/libs/internals/core.assemble_plugin_filepath.php new file mode 100755 index 0000000..690d3dd --- /dev/null +++ b/lib/smarty/libs/internals/core.assemble_plugin_filepath.php @@ -0,0 +1,67 @@ +plugins_dir as $_plugin_dir) { + + $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; + + // see if path is relative + if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) { + $_relative_paths[] = $_plugin_dir; + // relative path, see if it is in the SMARTY_DIR + if (@is_readable(SMARTY_DIR . $_plugin_filepath)) { + $_return = SMARTY_DIR . $_plugin_filepath; + break; + } + } + // try relative to cwd (or absolute) + if (@is_readable($_plugin_filepath)) { + $_return = $_plugin_filepath; + break; + } + } + + if($_return === false) { + // still not found, try PHP include_path + if(isset($_relative_paths)) { + foreach ((array)$_relative_paths as $_plugin_dir) { + + $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; + + $_params = array('file_path' => $_plugin_filepath); + require_once(SMARTY_CORE_DIR . 'core.get_include_path.php'); + if(smarty_core_get_include_path($_params, $smarty)) { + $_return = $_params['new_file_path']; + break; + } + } + } + } + $_filepaths_cache[$_plugin_filename] = $_return; + return $_return; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.assign_smarty_interface.php b/lib/smarty/libs/internals/core.assign_smarty_interface.php new file mode 100755 index 0000000..7e65a73 --- /dev/null +++ b/lib/smarty/libs/internals/core.assign_smarty_interface.php @@ -0,0 +1,43 @@ + + * Name: assign_smarty_interface
          + * Purpose: assign the $smarty interface variable + * @param array Format: null + * @param Smarty + */ +function smarty_core_assign_smarty_interface($params, &$smarty) +{ + if (isset($smarty->_smarty_vars) && isset($smarty->_smarty_vars['request'])) { + return; + } + + $_globals_map = array('g' => 'HTTP_GET_VARS', + 'p' => 'HTTP_POST_VARS', + 'c' => 'HTTP_COOKIE_VARS', + 's' => 'HTTP_SERVER_VARS', + 'e' => 'HTTP_ENV_VARS'); + + $_smarty_vars_request = array(); + + foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) { + if (isset($_globals_map[$_c])) { + $_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]); + } + } + $_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']); + + $smarty->_smarty_vars['request'] = $_smarty_vars_request; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.create_dir_structure.php b/lib/smarty/libs/internals/core.create_dir_structure.php new file mode 100755 index 0000000..3eecc49 --- /dev/null +++ b/lib/smarty/libs/internals/core.create_dir_structure.php @@ -0,0 +1,79 @@ +_dir_perms) && !is_dir($_new_dir)) { + $smarty->trigger_error("problem creating directory '" . $_new_dir . "'"); + return false; + } + $_new_dir .= '/'; + } + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.display_debug_console.php b/lib/smarty/libs/internals/core.display_debug_console.php new file mode 100755 index 0000000..1a80f39 --- /dev/null +++ b/lib/smarty/libs/internals/core.display_debug_console.php @@ -0,0 +1,61 @@ + + * Name: display_debug_console
          + * Purpose: display the javascript debug console window + * @param array Format: null + * @param Smarty + */ +function smarty_core_display_debug_console($params, &$smarty) +{ + // we must force compile the debug template in case the environment + // changed between separate applications. + + if(empty($smarty->debug_tpl)) { + // set path to debug template from SMARTY_DIR + $smarty->debug_tpl = SMARTY_DIR . 'debug.tpl'; + if($smarty->security && is_file($smarty->debug_tpl)) { + $smarty->secure_dir[] = realpath($smarty->debug_tpl); + } + $smarty->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl'; + } + + $_ldelim_orig = $smarty->left_delimiter; + $_rdelim_orig = $smarty->right_delimiter; + + $smarty->left_delimiter = '{'; + $smarty->right_delimiter = '}'; + + $_compile_id_orig = $smarty->_compile_id; + $smarty->_compile_id = null; + + $_compile_path = $smarty->_get_compile_path($smarty->debug_tpl); + if ($smarty->_compile_resource($smarty->debug_tpl, $_compile_path)) + { + ob_start(); + $smarty->_include($_compile_path); + $_results = ob_get_contents(); + ob_end_clean(); + } else { + $_results = ''; + } + + $smarty->_compile_id = $_compile_id_orig; + + $smarty->left_delimiter = $_ldelim_orig; + $smarty->right_delimiter = $_rdelim_orig; + + return $_results; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.get_include_path.php b/lib/smarty/libs/internals/core.get_include_path.php new file mode 100755 index 0000000..4343241 --- /dev/null +++ b/lib/smarty/libs/internals/core.get_include_path.php @@ -0,0 +1,44 @@ + diff --git a/lib/smarty/libs/internals/core.get_microtime.php b/lib/smarty/libs/internals/core.get_microtime.php new file mode 100755 index 0000000..f1a28e0 --- /dev/null +++ b/lib/smarty/libs/internals/core.get_microtime.php @@ -0,0 +1,23 @@ + diff --git a/lib/smarty/libs/internals/core.get_php_resource.php b/lib/smarty/libs/internals/core.get_php_resource.php new file mode 100755 index 0000000..786d4e7 --- /dev/null +++ b/lib/smarty/libs/internals/core.get_php_resource.php @@ -0,0 +1,80 @@ +trusted_dir; + $smarty->_parse_resource_name($params, $smarty); + + /* + * Find out if the resource exists. + */ + + if ($params['resource_type'] == 'file') { + $_readable = false; + if(file_exists($params['resource_name']) && is_readable($params['resource_name'])) { + $_readable = true; + } else { + // test for file in include_path + $_params = array('file_path' => $params['resource_name']); + require_once(SMARTY_CORE_DIR . 'core.get_include_path.php'); + if(smarty_core_get_include_path($_params, $smarty)) { + $_include_path = $_params['new_file_path']; + $_readable = true; + } + } + } else if ($params['resource_type'] != 'file') { + $_template_source = null; + $_readable = is_callable($smarty->_plugins['resource'][$params['resource_type']][0][0]) + && call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][0], + array($params['resource_name'], &$_template_source, &$smarty)); + } + + /* + * Set the error function, depending on which class calls us. + */ + if (method_exists($smarty, '_syntax_error')) { + $_error_funcc = '_syntax_error'; + } else { + $_error_funcc = 'trigger_error'; + } + + if ($_readable) { + if ($smarty->security) { + require_once(SMARTY_CORE_DIR . 'core.is_trusted.php'); + if (!smarty_core_is_trusted($params, $smarty)) { + $smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted'); + return false; + } + } + } else { + $smarty->$_error_funcc($params['resource_type'] . ':' . $params['resource_name'] . ' is not readable'); + return false; + } + + if ($params['resource_type'] == 'file') { + $params['php_resource'] = $params['resource_name']; + } else { + $params['php_resource'] = $_template_source; + } + return true; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.is_secure.php b/lib/smarty/libs/internals/core.is_secure.php new file mode 100755 index 0000000..d54abd4 --- /dev/null +++ b/lib/smarty/libs/internals/core.is_secure.php @@ -0,0 +1,59 @@ +security || $smarty->security_settings['INCLUDE_ANY']) { + return true; + } + + if ($params['resource_type'] == 'file') { + $_rp = realpath($params['resource_name']); + if (isset($params['resource_base_path'])) { + foreach ((array)$params['resource_base_path'] as $curr_dir) { + if ( ($_cd = realpath($curr_dir)) !== false && + strncmp($_rp, $_cd, strlen($_cd)) == 0 && + substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) { + return true; + } + } + } + if (!empty($smarty->secure_dir)) { + foreach ((array)$smarty->secure_dir as $curr_dir) { + if ( ($_cd = realpath($curr_dir)) !== false) { + if($_cd == $_rp) { + return true; + } elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 && + substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR) { + return true; + } + } + } + } + } else { + // resource is not on local file system + return call_user_func_array( + $smarty->_plugins['resource'][$params['resource_type']][0][2], + array($params['resource_name'], &$smarty)); + } + + return false; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.is_trusted.php b/lib/smarty/libs/internals/core.is_trusted.php new file mode 100755 index 0000000..4299731 --- /dev/null +++ b/lib/smarty/libs/internals/core.is_trusted.php @@ -0,0 +1,47 @@ +trusted_dir)) { + $_rp = realpath($params['resource_name']); + foreach ((array)$smarty->trusted_dir as $curr_dir) { + if (!empty($curr_dir) && is_readable ($curr_dir)) { + $_cd = realpath($curr_dir); + if (strncmp($_rp, $_cd, strlen($_cd)) == 0 + && substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) { + $_smarty_trusted = true; + break; + } + } + } + } + + } else { + // resource is not on local file system + $_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3], + array($params['resource_name'], $smarty)); + } + + return $_smarty_trusted; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.load_plugins.php b/lib/smarty/libs/internals/core.load_plugins.php new file mode 100755 index 0000000..6db1dc5 --- /dev/null +++ b/lib/smarty/libs/internals/core.load_plugins.php @@ -0,0 +1,125 @@ +_plugins[$_type][$_name]; + + /* + * We do not load plugin more than once for each instance of Smarty. + * The following code checks for that. The plugin can also be + * registered dynamically at runtime, in which case template file + * and line number will be unknown, so we fill them in. + * + * The final element of the info array is a flag that indicates + * whether the dynamically registered plugin function has been + * checked for existence yet or not. + */ + if (isset($_plugin)) { + if (empty($_plugin[3])) { + if (!is_callable($_plugin[0])) { + $smarty->_trigger_fatal_error("[plugin] $_type '$_name' is not implemented", $_tpl_file, $_tpl_line, __FILE__, __LINE__); + } else { + $_plugin[1] = $_tpl_file; + $_plugin[2] = $_tpl_line; + $_plugin[3] = true; + if (!isset($_plugin[4])) $_plugin[4] = true; /* cacheable */ + } + } + continue; + } else if ($_type == 'insert') { + /* + * For backwards compatibility, we check for insert functions in + * the symbol table before trying to load them as a plugin. + */ + $_plugin_func = 'insert_' . $_name; + if (function_exists($_plugin_func)) { + $_plugin = array($_plugin_func, $_tpl_file, $_tpl_line, true, false); + continue; + } + } + + $_plugin_file = $smarty->_get_plugin_filepath($_type, $_name); + + if (! $_found = ($_plugin_file != false)) { + $_message = "could not load plugin file '$_type.$_name.php'\n"; + } + + /* + * If plugin file is found, it -must- provide the properly named + * plugin function. In case it doesn't, simply output the error and + * do not fall back on any other method. + */ + if ($_found) { + include_once $_plugin_file; + + $_plugin_func = 'smarty_' . $_type . '_' . $_name; + if (!function_exists($_plugin_func)) { + $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", $_tpl_file, $_tpl_line, __FILE__, __LINE__); + continue; + } + } + /* + * In case of insert plugins, their code may be loaded later via + * 'script' attribute. + */ + else if ($_type == 'insert' && $_delayed_loading) { + $_plugin_func = 'smarty_' . $_type . '_' . $_name; + $_found = true; + } + + /* + * Plugin specific processing and error checking. + */ + if (!$_found) { + if ($_type == 'modifier') { + /* + * In case modifier falls back on using PHP functions + * directly, we only allow those specified in the security + * context. + */ + if ($smarty->security && !in_array($_name, $smarty->security_settings['MODIFIER_FUNCS'])) { + $_message = "(secure mode) modifier '$_name' is not allowed"; + } else { + if (!function_exists($_name)) { + $_message = "modifier '$_name' is not implemented"; + } else { + $_plugin_func = $_name; + $_found = true; + } + } + } else if ($_type == 'function') { + /* + * This is a catch-all situation. + */ + $_message = "unknown tag - '$_name'"; + } + } + + if ($_found) { + $smarty->_plugins[$_type][$_name] = array($_plugin_func, $_tpl_file, $_tpl_line, true, true); + } else { + // output error + $smarty->_trigger_fatal_error('[plugin] ' . $_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__); + } + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.load_resource_plugin.php b/lib/smarty/libs/internals/core.load_resource_plugin.php new file mode 100755 index 0000000..a7d37d1 --- /dev/null +++ b/lib/smarty/libs/internals/core.load_resource_plugin.php @@ -0,0 +1,74 @@ +_plugins['resource'][$params['type']]; + if (isset($_plugin)) { + if (!$_plugin[1] && count($_plugin[0])) { + $_plugin[1] = true; + foreach ($_plugin[0] as $_plugin_func) { + if (!is_callable($_plugin_func)) { + $_plugin[1] = false; + break; + } + } + } + + if (!$_plugin[1]) { + $smarty->_trigger_fatal_error("[plugin] resource '" . $params['type'] . "' is not implemented", null, null, __FILE__, __LINE__); + } + + return; + } + + $_plugin_file = $smarty->_get_plugin_filepath('resource', $params['type']); + $_found = ($_plugin_file != false); + + if ($_found) { /* + * If the plugin file is found, it -must- provide the properly named + * plugin functions. + */ + include_once($_plugin_file); + + /* + * Locate functions that we require the plugin to provide. + */ + $_resource_ops = array('source', 'timestamp', 'secure', 'trusted'); + $_resource_funcs = array(); + foreach ($_resource_ops as $_op) { + $_plugin_func = 'smarty_resource_' . $params['type'] . '_' . $_op; + if (!function_exists($_plugin_func)) { + $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", null, null, __FILE__, __LINE__); + return; + } else { + $_resource_funcs[] = $_plugin_func; + } + } + + $smarty->_plugins['resource'][$params['type']] = array($_resource_funcs, true); + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.process_cached_inserts.php b/lib/smarty/libs/internals/core.process_cached_inserts.php new file mode 100755 index 0000000..1d78edd --- /dev/null +++ b/lib/smarty/libs/internals/core.process_cached_inserts.php @@ -0,0 +1,71 @@ +_smarty_md5.'{insert_cache (.*)}'.$smarty->_smarty_md5.'!Uis', + $params['results'], $match); + list($cached_inserts, $insert_args) = $match; + + for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) { + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $debug_start_time = smarty_core_get_microtime($_params, $smarty); + } + + $args = unserialize($insert_args[$i]); + $name = $args['name']; + + if (isset($args['script'])) { + $_params = array('resource_name' => $smarty->_dequote($args['script'])); + require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); + if(!smarty_core_get_php_resource($_params, $smarty)) { + return false; + } + $resource_type = $_params['resource_type']; + $php_resource = $_params['php_resource']; + + + if ($resource_type == 'file') { + $smarty->_include($php_resource, true); + } else { + $smarty->_eval($php_resource); + } + } + + $function_name = $smarty->_plugins['insert'][$name][0]; + if (empty($args['assign'])) { + $replace = $function_name($args, $smarty); + } else { + $smarty->assign($args['assign'], $function_name($args, $smarty)); + $replace = ''; + } + + $params['results'] = substr_replace($params['results'], $replace, strpos($params['results'], $cached_inserts[$i]), strlen($cached_inserts[$i])); + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $smarty->_smarty_debug_info[] = array('type' => 'insert', + 'filename' => 'insert_'.$name, + 'depth' => $smarty->_inclusion_depth, + 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $debug_start_time); + } + } + + return $params['results']; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.process_compiled_include.php b/lib/smarty/libs/internals/core.process_compiled_include.php new file mode 100755 index 0000000..904d597 --- /dev/null +++ b/lib/smarty/libs/internals/core.process_compiled_include.php @@ -0,0 +1,37 @@ +_cache_including; + $smarty->_cache_including = true; + + $_return = $params['results']; + + foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { + $smarty->_include($_include_file_path, true); + } + + foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { + $_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s', + array(&$smarty, '_process_compiled_include_callback'), + $_return); + } + $smarty->_cache_including = $_cache_including; + return $_return; +} + +?> diff --git a/lib/smarty/libs/internals/core.read_cache_file.php b/lib/smarty/libs/internals/core.read_cache_file.php new file mode 100755 index 0000000..c60e113 --- /dev/null +++ b/lib/smarty/libs/internals/core.read_cache_file.php @@ -0,0 +1,101 @@ +force_compile) { + // force compile enabled, always regenerate + return false; + } + + if (isset($content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']])) { + list($params['results'], $smarty->_cache_info) = $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']]; + return true; + } + + if (!empty($smarty->cache_handler_func)) { + // use cache_handler function + call_user_func_array($smarty->cache_handler_func, + array('read', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null)); + } else { + // use local cache file + $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']); + $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id); + $params['results'] = $smarty->_read_file($_cache_file); + } + + if (empty($params['results'])) { + // nothing to parse (error?), regenerate cache + return false; + } + + $_contents = $params['results']; + $_info_start = strpos($_contents, "\n") + 1; + $_info_len = (int)substr($_contents, 0, $_info_start - 1); + $_cache_info = unserialize(substr($_contents, $_info_start, $_info_len)); + $params['results'] = substr($_contents, $_info_start + $_info_len); + + if ($smarty->caching == 2 && isset ($_cache_info['expires'])){ + // caching by expiration time + if ($_cache_info['expires'] > -1 && (time() > $_cache_info['expires'])) { + // cache expired, regenerate + return false; + } + } else { + // caching by lifetime + if ($smarty->cache_lifetime > -1 && (time() - $_cache_info['timestamp'] > $smarty->cache_lifetime)) { + // cache expired, regenerate + return false; + } + } + + if ($smarty->compile_check) { + $_params = array('get_source' => false, 'quiet'=>true); + foreach (array_keys($_cache_info['template']) as $_template_dep) { + $_params['resource_name'] = $_template_dep; + if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) { + // template file has changed, regenerate cache + return false; + } + } + + if (isset($_cache_info['config'])) { + $_params = array('resource_base_path' => $smarty->config_dir, 'get_source' => false, 'quiet'=>true); + foreach (array_keys($_cache_info['config']) as $_config_dep) { + $_params['resource_name'] = $_config_dep; + if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) { + // config file has changed, regenerate cache + return false; + } + } + } + } + + $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $_cache_info); + + $smarty->_cache_info = $_cache_info; + return true; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.rm_auto.php b/lib/smarty/libs/internals/core.rm_auto.php new file mode 100755 index 0000000..b251f64 --- /dev/null +++ b/lib/smarty/libs/internals/core.rm_auto.php @@ -0,0 +1,71 @@ + $params['auto_base'], + 'level' => 0, + 'exp_time' => $params['exp_time'] + ); + require_once(SMARTY_CORE_DIR . 'core.rmdir.php'); + $_res = smarty_core_rmdir($_params, $smarty); + } else { + $_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']); + + if(isset($params['auto_source'])) { + if (isset($params['extensions'])) { + $_res = false; + foreach ((array)$params['extensions'] as $_extension) + $_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']); + } else { + $_res = $smarty->_unlink($_tname, $params['exp_time']); + } + } elseif ($smarty->use_sub_dirs) { + $_params = array( + 'dirname' => $_tname, + 'level' => 1, + 'exp_time' => $params['exp_time'] + ); + require_once(SMARTY_CORE_DIR . 'core.rmdir.php'); + $_res = smarty_core_rmdir($_params, $smarty); + } else { + // remove matching file names + $_handle = opendir($params['auto_base']); + $_res = true; + while (false !== ($_filename = readdir($_handle))) { + if($_filename == '.' || $_filename == '..') { + continue; + } elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) { + $_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']); + } + } + } + } + + return $_res; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.rmdir.php b/lib/smarty/libs/internals/core.rmdir.php new file mode 100755 index 0000000..2166c44 --- /dev/null +++ b/lib/smarty/libs/internals/core.rmdir.php @@ -0,0 +1,54 @@ + keep root) + * WARNING: no tests, it will try to remove what you tell it! + * + * @param string $dirname + * @param integer $level + * @param integer $exp_time + * @return boolean + */ + +// $dirname, $level = 1, $exp_time = null + +function smarty_core_rmdir($params, &$smarty) +{ + if(!isset($params['level'])) { $params['level'] = 1; } + if(!isset($params['exp_time'])) { $params['exp_time'] = null; } + + if($_handle = @opendir($params['dirname'])) { + + while (false !== ($_entry = readdir($_handle))) { + if ($_entry != '.' && $_entry != '..') { + if (@is_dir($params['dirname'] . DIRECTORY_SEPARATOR . $_entry)) { + $_params = array( + 'dirname' => $params['dirname'] . DIRECTORY_SEPARATOR . $_entry, + 'level' => $params['level'] + 1, + 'exp_time' => $params['exp_time'] + ); + smarty_core_rmdir($_params, $smarty); + } + else { + $smarty->_unlink($params['dirname'] . DIRECTORY_SEPARATOR . $_entry, $params['exp_time']); + } + } + } + closedir($_handle); + } + + if ($params['level']) { + return @rmdir($params['dirname']); + } + return (bool)$_handle; + +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.run_insert_handler.php b/lib/smarty/libs/internals/core.run_insert_handler.php new file mode 100755 index 0000000..71c3845 --- /dev/null +++ b/lib/smarty/libs/internals/core.run_insert_handler.php @@ -0,0 +1,71 @@ +debugging) { + $_params = array(); + $_debug_start_time = smarty_core_get_microtime($_params, $smarty); + } + + if ($smarty->caching) { + $_arg_string = serialize($params['args']); + $_name = $params['args']['name']; + if (!isset($smarty->_cache_info['insert_tags'][$_name])) { + $smarty->_cache_info['insert_tags'][$_name] = array('insert', + $_name, + $smarty->_plugins['insert'][$_name][1], + $smarty->_plugins['insert'][$_name][2], + !empty($params['args']['script']) ? true : false); + } + return $smarty->_smarty_md5."{insert_cache $_arg_string}".$smarty->_smarty_md5; + } else { + if (isset($params['args']['script'])) { + $_params = array('resource_name' => $smarty->_dequote($params['args']['script'])); + require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); + if(!smarty_core_get_php_resource($_params, $smarty)) { + return false; + } + + if ($_params['resource_type'] == 'file') { + $smarty->_include($_params['php_resource'], true); + } else { + $smarty->_eval($_params['php_resource']); + } + unset($params['args']['script']); + } + + $_funcname = $smarty->_plugins['insert'][$params['args']['name']][0]; + $_content = $_funcname($params['args'], $smarty); + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $smarty->_smarty_debug_info[] = array('type' => 'insert', + 'filename' => 'insert_'.$params['args']['name'], + 'depth' => $smarty->_inclusion_depth, + 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time); + } + + if (!empty($params['args']["assign"])) { + $smarty->assign($params['args']["assign"], $_content); + } else { + return $_content; + } + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.smarty_include_php.php b/lib/smarty/libs/internals/core.smarty_include_php.php new file mode 100755 index 0000000..30c6e76 --- /dev/null +++ b/lib/smarty/libs/internals/core.smarty_include_php.php @@ -0,0 +1,50 @@ + $params['smarty_file']); + require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); + smarty_core_get_php_resource($_params, $smarty); + $_smarty_resource_type = $_params['resource_type']; + $_smarty_php_resource = $_params['php_resource']; + + if (!empty($params['smarty_assign'])) { + ob_start(); + if ($_smarty_resource_type == 'file') { + $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']); + } else { + $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']); + } + $smarty->assign($params['smarty_assign'], ob_get_contents()); + ob_end_clean(); + } else { + if ($_smarty_resource_type == 'file') { + $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']); + } else { + $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']); + } + } +} + + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.write_cache_file.php b/lib/smarty/libs/internals/core.write_cache_file.php new file mode 100755 index 0000000..fa3cdd7 --- /dev/null +++ b/lib/smarty/libs/internals/core.write_cache_file.php @@ -0,0 +1,96 @@ +_cache_info['timestamp'] = time(); + if ($smarty->cache_lifetime > -1){ + // expiration set + $smarty->_cache_info['expires'] = $smarty->_cache_info['timestamp'] + $smarty->cache_lifetime; + } else { + // cache will never expire + $smarty->_cache_info['expires'] = -1; + } + + // collapse nocache.../nocache-tags + if (preg_match_all('!\{(/?)nocache\:[0-9a-f]{32}#\d+\}!', $params['results'], $match, PREG_PATTERN_ORDER)) { + // remove everything between every pair of outermost noache.../nocache-tags + // and replace it by a single nocache-tag + // this new nocache-tag will be replaced by dynamic contents in + // smarty_core_process_compiled_includes() on a cache-read + + $match_count = count($match[0]); + $results = preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_SPLIT_DELIM_CAPTURE); + + $level = 0; + $j = 0; + for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) { + if ($results[$i] == $match[0][$j]) { + // nocache tag + if ($match[1][$j]) { // closing tag + $level--; + unset($results[$i]); + } else { // opening tag + if ($level++ > 0) unset($results[$i]); + } + $j++; + } elseif ($level > 0) { + unset($results[$i]); + } + } + $params['results'] = implode('', $results); + } + $smarty->_cache_info['cache_serials'] = $smarty->_cache_serials; + + // prepend the cache header info into cache file + $_cache_info = serialize($smarty->_cache_info); + $params['results'] = strlen($_cache_info) . "\n" . $_cache_info . $params['results']; + + if (!empty($smarty->cache_handler_func)) { + // use cache_handler function + call_user_func_array($smarty->cache_handler_func, + array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], $smarty->_cache_info['expires'])); + } else { + // use local cache file + + if(!@is_writable($smarty->cache_dir)) { + // cache_dir not writable, see if it exists + if(!@is_dir($smarty->cache_dir)) { + $smarty->trigger_error('the $cache_dir \'' . $smarty->cache_dir . '\' does not exist, or is not a directory.', E_USER_ERROR); + return false; + } + $smarty->trigger_error('unable to write to $cache_dir \'' . realpath($smarty->cache_dir) . '\'. Be sure $cache_dir is writable by the web server user.', E_USER_ERROR); + return false; + } + + $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']); + $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id); + $_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true); + require_once(SMARTY_CORE_DIR . 'core.write_file.php'); + smarty_core_write_file($_params, $smarty); + return true; + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.write_compiled_include.php b/lib/smarty/libs/internals/core.write_compiled_include.php new file mode 100755 index 0000000..c14adb5 --- /dev/null +++ b/lib/smarty/libs/internals/core.write_compiled_include.php @@ -0,0 +1,91 @@ +caching && \!\$this->_cache_including\)\: echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\'; endif;'; + $_tag_end = 'if \(\$this->caching && \!\$this->_cache_including\)\: echo \'\{/nocache\:(\\2)#(\\3)\}\'; endif;'; + + preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us', + $params['compiled_content'], $_match_source, PREG_SET_ORDER); + + // no nocache-parts found: done + if (count($_match_source)==0) return; + + // convert the matched php-code to functions + $_include_compiled = "_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n"; + $_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n"; + + $_compile_path = $params['include_file_path']; + + $smarty->_cache_serials[$_compile_path] = $params['cache_serial']; + $_include_compiled .= "\$this->_cache_serials['".$_compile_path."'] = '".$params['cache_serial']."';\n\n?>"; + + $_include_compiled .= $params['plugins_code']; + $_include_compiled .= "= 5.0) ? '_smarty' : 'this'; + for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) { + $_match =& $_match_source[$_i]; + $source = $_match[4]; + if ($this_varname == '_smarty') { + /* rename $this to $_smarty in the sourcecode */ + $tokens = token_get_all('\n"; + + $_params = array('filename' => $_compile_path, + 'contents' => $_include_compiled, 'create_dirs' => true); + + require_once(SMARTY_CORE_DIR . 'core.write_file.php'); + smarty_core_write_file($_params, $smarty); + return true; +} + + +?> diff --git a/lib/smarty/libs/internals/core.write_compiled_resource.php b/lib/smarty/libs/internals/core.write_compiled_resource.php new file mode 100755 index 0000000..b902eff --- /dev/null +++ b/lib/smarty/libs/internals/core.write_compiled_resource.php @@ -0,0 +1,35 @@ +compile_dir)) { + // compile_dir not writable, see if it exists + if(!@is_dir($smarty->compile_dir)) { + $smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR); + return false; + } + $smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR); + return false; + } + + $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true); + require_once(SMARTY_CORE_DIR . 'core.write_file.php'); + smarty_core_write_file($_params, $smarty); + return true; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/internals/core.write_file.php b/lib/smarty/libs/internals/core.write_file.php new file mode 100755 index 0000000..8a3a3b3 --- /dev/null +++ b/lib/smarty/libs/internals/core.write_file.php @@ -0,0 +1,54 @@ + $_dirname); + require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php'); + smarty_core_create_dir_structure($_params, $smarty); + } + + // write to tmp file, then rename it to avoid file locking race condition + $_tmp_file = tempnam($_dirname, 'wrt'); + + if (!($fd = @fopen($_tmp_file, 'wb'))) { + $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt'); + if (!($fd = @fopen($_tmp_file, 'wb'))) { + $smarty->trigger_error("problem writing temporary file '$_tmp_file'"); + return false; + } + } + + fwrite($fd, $params['contents']); + fclose($fd); + + if (DIRECTORY_SEPARATOR == '\\' || !@rename($_tmp_file, $params['filename'])) { + // On platforms and filesystems that cannot overwrite with rename() + // delete the file before renaming it -- because windows always suffers + // this, it is short-circuited to avoid the initial rename() attempt + @unlink($params['filename']); + @rename($_tmp_file, $params['filename']); + } + @chmod($params['filename'], $smarty->_file_perms); + + return true; +} + +/* vim: set expandtab: */ + +?> \ No newline at end of file diff --git a/lib/smarty/libs/plugins/block.textformat.php b/lib/smarty/libs/plugins/block.textformat.php new file mode 100755 index 0000000..abf5449 --- /dev/null +++ b/lib/smarty/libs/plugins/block.textformat.php @@ -0,0 +1,110 @@ + + * Name: textformat
          + * Purpose: format text a certain way with preset styles + * or custom wrap/indent settings
          + * Params: + *
          + * - style         - string (email)
          + * - indent        - integer (0)
          + * - wrap          - integer (80)
          + * - wrap_char     - string ("\n")
          + * - indent_char   - string (" ")
          + * - wrap_boundary - boolean (true)
          + * 
          + * + * @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat} + * (Smarty online manual) + * + * @param array $params parameters + * @param string $content contents of the block + * @param Smarty_Internal_Template $template template object + * @param boolean &$repeat repeat flag + * + * @return string content re-formatted + * @author Monte Ohrt + */ +function smarty_block_textformat($params, $content, $template, &$repeat) +{ + if (is_null($content)) { + return; + } + + $style = null; + $indent = 0; + $indent_first = 0; + $indent_char = ' '; + $wrap = 80; + $wrap_char = "\n"; + $wrap_cut = false; + $assign = null; + + foreach ($params as $_key => $_val) { + switch ($_key) { + case 'style': + case 'indent_char': + case 'wrap_char': + case 'assign': + $$_key = (string) $_val; + break; + + case 'indent': + case 'indent_first': + case 'wrap': + $$_key = (int) $_val; + break; + + case 'wrap_cut': + $$_key = (bool) $_val; + break; + + default: + trigger_error("textformat: unknown attribute '$_key'"); + } + } + + if ($style == 'email') { + $wrap = 72; + } + // split into paragraphs + $_paragraphs = preg_split('![\r\n]{2}!', $content); + + foreach ($_paragraphs as &$_paragraph) { + if (!$_paragraph) { + continue; + } + // convert mult. spaces & special chars to single space + $_paragraph = preg_replace(array('!\s+!' . Smarty::$_UTF8_MODIFIER, '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER), array(' ', ''), $_paragraph); + // indent first line + if ($indent_first > 0) { + $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph; + } + // wordwrap sentences + if (Smarty::$_MBSTRING) { + require_once(SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php'); + $_paragraph = smarty_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut); + } else { + $_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut); + } + // indent lines + if ($indent > 0) { + $_paragraph = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraph); + } + } + $_output = implode($wrap_char . $wrap_char, $_paragraphs); + + if ($assign) { + $template->assign($assign, $_output); + } else { + return $_output; + } +} diff --git a/lib/smarty/libs/plugins/compiler.assign.php b/lib/smarty/libs/plugins/compiler.assign.php new file mode 100755 index 0000000..abef377 --- /dev/null +++ b/lib/smarty/libs/plugins/compiler.assign.php @@ -0,0 +1,40 @@ + + * Name: assign
          + * Purpose: assign a value to a template variable + * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign} + * (Smarty online manual) + * @author Monte Ohrt (initial author) + * @author messju mohr (conversion to compiler function) + * @param string containing var-attribute and value-attribute + * @param Smarty_Compiler + */ +function smarty_compiler_assign($tag_attrs, &$compiler) +{ + $_params = $compiler->_parse_attrs($tag_attrs); + + if (!isset($_params['var'])) { + $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING); + return; + } + + if (!isset($_params['value'])) { + $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING); + return; + } + + return "\$this->assign({$_params['var']}, {$_params['value']});"; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/plugins/function.assign_debug_info.php b/lib/smarty/libs/plugins/function.assign_debug_info.php new file mode 100755 index 0000000..6540498 --- /dev/null +++ b/lib/smarty/libs/plugins/function.assign_debug_info.php @@ -0,0 +1,40 @@ + + * Name: assign_debug_info
          + * Purpose: assign debug info to the template
          + * @author Monte Ohrt + * @param array unused in this plugin, this plugin uses {@link Smarty::$_config}, + * {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info} + * @param Smarty + */ +function smarty_function_assign_debug_info($params, &$smarty) +{ + $assigned_vars = $smarty->_tpl_vars; + ksort($assigned_vars); + if (@is_array($smarty->_config[0])) { + $config_vars = $smarty->_config[0]; + ksort($config_vars); + $smarty->assign("_debug_config_keys", array_keys($config_vars)); + $smarty->assign("_debug_config_vals", array_values($config_vars)); + } + + $included_templates = $smarty->_smarty_debug_info; + + $smarty->assign("_debug_keys", array_keys($assigned_vars)); + $smarty->assign("_debug_vals", array_values($assigned_vars)); + + $smarty->assign("_debug_tpls", $included_templates); +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/plugins/function.config_load.php b/lib/smarty/libs/plugins/function.config_load.php new file mode 100755 index 0000000..db89f63 --- /dev/null +++ b/lib/smarty/libs/plugins/function.config_load.php @@ -0,0 +1,142 @@ + + * Name: config_load
          + * Purpose: load config file vars + * @link http://smarty.php.net/manual/en/language.function.config.load.php {config_load} + * (Smarty online manual) + * @author Monte Ohrt + * @author messju mohr (added use of resources) + * @param array Format: + *
          + * array('file' => required config file name,
          + *       'section' => optional config file section to load
          + *       'scope' => local/parent/global
          + *       'global' => overrides scope, setting to parent if true)
          + * 
          + * @param Smarty + */ +function smarty_function_config_load($params, &$smarty) +{ + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $_debug_start_time = smarty_core_get_microtime($_params, $smarty); + } + + $_file = isset($params['file']) ? $smarty->_dequote($params['file']) : null; + $_section = isset($params['section']) ? $smarty->_dequote($params['section']) : null; + $_scope = isset($params['scope']) ? $smarty->_dequote($params['scope']) : 'global'; + $_global = isset($params['global']) ? $smarty->_dequote($params['global']) : false; + + if (!isset($_file) || strlen($_file) == 0) { + $smarty->trigger_error("missing 'file' attribute in config_load tag", E_USER_ERROR, __FILE__, __LINE__); + } + + if (isset($_scope)) { + if ($_scope != 'local' && + $_scope != 'parent' && + $_scope != 'global') { + $smarty->trigger_error("invalid 'scope' attribute value", E_USER_ERROR, __FILE__, __LINE__); + } + } else { + if ($_global) { + $_scope = 'parent'; + } else { + $_scope = 'local'; + } + } + + $_params = array('resource_name' => $_file, + 'resource_base_path' => $smarty->config_dir, + 'get_source' => false); + $smarty->_parse_resource_name($_params); + $_file_path = $_params['resource_type'] . ':' . $_params['resource_name']; + if (isset($_section)) + $_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section); + else + $_compile_file = $smarty->_get_compile_path($_file_path); + + if($smarty->force_compile || !file_exists($_compile_file)) { + $_compile = true; + } elseif ($smarty->compile_check) { + $_params = array('resource_name' => $_file, + 'resource_base_path' => $smarty->config_dir, + 'get_source' => false); + $_compile = $smarty->_fetch_resource_info($_params) && + $_params['resource_timestamp'] > filemtime($_compile_file); + } else { + $_compile = false; + } + + if($_compile) { + // compile config file + if(!is_object($smarty->_conf_obj)) { + require_once SMARTY_DIR . $smarty->config_class . '.class.php'; + $smarty->_conf_obj = new $smarty->config_class(); + $smarty->_conf_obj->overwrite = $smarty->config_overwrite; + $smarty->_conf_obj->booleanize = $smarty->config_booleanize; + $smarty->_conf_obj->read_hidden = $smarty->config_read_hidden; + $smarty->_conf_obj->fix_newlines = $smarty->config_fix_newlines; + } + + $_params = array('resource_name' => $_file, + 'resource_base_path' => $smarty->config_dir, + $_params['get_source'] = true); + if (!$smarty->_fetch_resource_info($_params)) { + return; + } + $smarty->_conf_obj->set_file_contents($_file, $_params['source_content']); + $_config_vars = array_merge($smarty->_conf_obj->get($_file), + $smarty->_conf_obj->get($_file, $_section)); + if(function_exists('var_export')) { + $_output = ''; + } else { + $_output = ''\\\'', '\\'=>'\\\\')) . '\'); ?>'; + } + $_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => $_params['resource_timestamp'])); + require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php'); + smarty_core_write_compiled_resource($_params, $smarty); + } else { + include($_compile_file); + } + + if ($smarty->caching) { + $smarty->_cache_info['config'][$_file] = true; + } + + $smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars); + $smarty->_config[0]['files'][$_file] = true; + + if ($_scope == 'parent') { + $smarty->_config[1]['vars'] = @array_merge($smarty->_config[1]['vars'], $_config_vars); + $smarty->_config[1]['files'][$_file] = true; + } else if ($_scope == 'global') { + for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) { + $smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars); + $smarty->_config[$i]['files'][$_file] = true; + } + } + + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $smarty->_smarty_debug_info[] = array('type' => 'config', + 'filename' => $_file.' ['.$_section.'] '.$_scope, + 'depth' => $smarty->_inclusion_depth, + 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time); + } + +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/plugins/function.counter.php b/lib/smarty/libs/plugins/function.counter.php new file mode 100755 index 0000000..4da85a1 --- /dev/null +++ b/lib/smarty/libs/plugins/function.counter.php @@ -0,0 +1,78 @@ + + * Name: counter
          + * Purpose: print out a counter value + * + * @author Monte Ohrt + * @link http://www.smarty.net/manual/en/language.function.counter.php {counter} + * (Smarty online manual) + * + * @param array $params parameters + * @param Smarty_Internal_Template $template template object + * + * @return string|null + */ +function smarty_function_counter($params, $template) +{ + static $counters = array(); + + $name = (isset($params['name'])) ? $params['name'] : 'default'; + if (!isset($counters[$name])) { + $counters[$name] = array( + 'start' => 1, + 'skip' => 1, + 'direction' => 'up', + 'count' => 1 + ); + } + $counter =& $counters[$name]; + + if (isset($params['start'])) { + $counter['start'] = $counter['count'] = (int) $params['start']; + } + + if (!empty($params['assign'])) { + $counter['assign'] = $params['assign']; + } + + if (isset($counter['assign'])) { + $template->assign($counter['assign'], $counter['count']); + } + + if (isset($params['print'])) { + $print = (bool) $params['print']; + } else { + $print = empty($counter['assign']); + } + + if ($print) { + $retval = $counter['count']; + } else { + $retval = null; + } + + if (isset($params['skip'])) { + $counter['skip'] = $params['skip']; + } + + if (isset($params['direction'])) { + $counter['direction'] = $params['direction']; + } + + if ($counter['direction'] == "down") { + $counter['count'] -= $counter['skip']; + } else { + $counter['count'] += $counter['skip']; + } + + return $retval; +} diff --git a/lib/smarty/libs/plugins/function.cycle.php b/lib/smarty/libs/plugins/function.cycle.php new file mode 100755 index 0000000..8dc5cd9 --- /dev/null +++ b/lib/smarty/libs/plugins/function.cycle.php @@ -0,0 +1,107 @@ + + * Name: cycle
          + * Date: May 3, 2002
          + * Purpose: cycle through given values
          + * Params: + *
          + * - name      - name of cycle (optional)
          + * - values    - comma separated list of values to cycle, or an array of values to cycle
          + *               (this can be left out for subsequent calls)
          + * - reset     - boolean - resets given var to true
          + * - print     - boolean - print var or not. default is true
          + * - advance   - boolean - whether or not to advance the cycle
          + * - delimiter - the value delimiter, default is ","
          + * - assign    - boolean, assigns to template var instead of printed.
          + * 
          + * Examples:
          + *
          + * {cycle values="#eeeeee,#d0d0d0d"}
          + * {cycle name=row values="one,two,three" reset=true}
          + * {cycle name=row}
          + * 
          + * + * @link http://www.smarty.net/manual/en/language.function.cycle.php {cycle} + * (Smarty online manual) + * @author Monte Ohrt + * @author credit to Mark Priatel + * @author credit to Gerard + * @author credit to Jason Sweat + * @version 1.3 + * + * @param array $params parameters + * @param Smarty_Internal_Template $template template object + * + * @return string|null + */ + +function smarty_function_cycle($params, $template) +{ + static $cycle_vars; + + $name = (empty($params['name'])) ? 'default' : $params['name']; + $print = (isset($params['print'])) ? (bool) $params['print'] : true; + $advance = (isset($params['advance'])) ? (bool) $params['advance'] : true; + $reset = (isset($params['reset'])) ? (bool) $params['reset'] : false; + + if (!isset($params['values'])) { + if (!isset($cycle_vars[$name]['values'])) { + trigger_error("cycle: missing 'values' parameter"); + + return; + } + } else { + if (isset($cycle_vars[$name]['values']) + && $cycle_vars[$name]['values'] != $params['values'] + ) { + $cycle_vars[$name]['index'] = 0; + } + $cycle_vars[$name]['values'] = $params['values']; + } + + if (isset($params['delimiter'])) { + $cycle_vars[$name]['delimiter'] = $params['delimiter']; + } elseif (!isset($cycle_vars[$name]['delimiter'])) { + $cycle_vars[$name]['delimiter'] = ','; + } + + if (is_array($cycle_vars[$name]['values'])) { + $cycle_array = $cycle_vars[$name]['values']; + } else { + $cycle_array = explode($cycle_vars[$name]['delimiter'], $cycle_vars[$name]['values']); + } + + if (!isset($cycle_vars[$name]['index']) || $reset) { + $cycle_vars[$name]['index'] = 0; + } + + if (isset($params['assign'])) { + $print = false; + $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); + } + + if ($print) { + $retval = $cycle_array[$cycle_vars[$name]['index']]; + } else { + $retval = null; + } + + if ($advance) { + if ($cycle_vars[$name]['index'] >= count($cycle_array) - 1) { + $cycle_vars[$name]['index'] = 0; + } else { + $cycle_vars[$name]['index'] ++; + } + } + + return $retval; +} diff --git a/lib/smarty/libs/plugins/function.debug.php b/lib/smarty/libs/plugins/function.debug.php new file mode 100755 index 0000000..4345230 --- /dev/null +++ b/lib/smarty/libs/plugins/function.debug.php @@ -0,0 +1,35 @@ + + * Name: debug
          + * Date: July 1, 2002
          + * Purpose: popup debug window + * @link http://smarty.php.net/manual/en/language.function.debug.php {debug} + * (Smarty online manual) + * @author Monte Ohrt + * @version 1.0 + * @param array + * @param Smarty + * @return string output from {@link Smarty::_generate_debug_output()} + */ +function smarty_function_debug($params, &$smarty) +{ + if (isset($params['output'])) { + $smarty->assign('_smarty_debug_output', $params['output']); + } + require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); + return smarty_core_display_debug_console(null, $smarty); +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/plugins/function.eval.php b/lib/smarty/libs/plugins/function.eval.php new file mode 100755 index 0000000..ff0472d --- /dev/null +++ b/lib/smarty/libs/plugins/function.eval.php @@ -0,0 +1,49 @@ + + * Name: eval
          + * Purpose: evaluate a template variable as a template
          + * @link http://smarty.php.net/manual/en/language.function.eval.php {eval} + * (Smarty online manual) + * @author Monte Ohrt + * @param array + * @param Smarty + */ +function smarty_function_eval($params, &$smarty) +{ + + if (!isset($params['var'])) { + $smarty->trigger_error("eval: missing 'var' parameter"); + return; + } + + if($params['var'] == '') { + return; + } + + $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled); + + ob_start(); + $smarty->_eval('?>' . $_var_compiled); + $_contents = ob_get_contents(); + ob_end_clean(); + + if (!empty($params['assign'])) { + $smarty->assign($params['assign'], $_contents); + } else { + return $_contents; + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty/libs/plugins/function.fetch.php b/lib/smarty/libs/plugins/function.fetch.php new file mode 100755 index 0000000..3506d4a --- /dev/null +++ b/lib/smarty/libs/plugins/function.fetch.php @@ -0,0 +1,221 @@ + + * Name: fetch
          + * Purpose: fetch file, web or ftp data and display results + * + * @link http://www.smarty.net/manual/en/language.function.fetch.php {fetch} + * (Smarty online manual) + * @author Monte Ohrt + * + * @param array $params parameters + * @param Smarty_Internal_Template $template template object + * + * @throws SmartyException + * @return string|null if the assign parameter is passed, Smarty assigns the result to a template variable + */ +function smarty_function_fetch($params, $template) +{ + if (empty($params['file'])) { + trigger_error("[plugin] fetch parameter 'file' cannot be empty", E_USER_NOTICE); + + return; + } + + // strip file protocol + if (stripos($params['file'], 'file://') === 0) { + $params['file'] = substr($params['file'], 7); + } + + $protocol = strpos($params['file'], '://'); + if ($protocol !== false) { + $protocol = strtolower(substr($params['file'], 0, $protocol)); + } + + if (isset($template->smarty->security_policy)) { + if ($protocol) { + // remote resource (or php stream, …) + if (!$template->smarty->security_policy->isTrustedUri($params['file'])) { + return; + } + } else { + // local file + if (!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) { + return; + } + } + } + + $content = ''; + if ($protocol == 'http') { + // http fetch + if ($uri_parts = parse_url($params['file'])) { + // set defaults + $host = $server_name = $uri_parts['host']; + $timeout = 30; + $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; + $agent = "Smarty Template Engine " . Smarty::SMARTY_VERSION; + $referer = ""; + $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; + $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; + $_is_proxy = false; + if (empty($uri_parts['port'])) { + $port = 80; + } else { + $port = $uri_parts['port']; + } + if (!empty($uri_parts['user'])) { + $user = $uri_parts['user']; + } + if (!empty($uri_parts['pass'])) { + $pass = $uri_parts['pass']; + } + // loop through parameters, setup headers + foreach ($params as $param_key => $param_value) { + switch ($param_key) { + case "file": + case "assign": + case "assign_headers": + break; + case "user": + if (!empty($param_value)) { + $user = $param_value; + } + break; + case "pass": + if (!empty($param_value)) { + $pass = $param_value; + } + break; + case "accept": + if (!empty($param_value)) { + $accept = $param_value; + } + break; + case "header": + if (!empty($param_value)) { + if (!preg_match('![\w\d-]+: .+!', $param_value)) { + trigger_error("[plugin] invalid header format '" . $param_value . "'", E_USER_NOTICE); + + return; + } else { + $extra_headers[] = $param_value; + } + } + break; + case "proxy_host": + if (!empty($param_value)) { + $proxy_host = $param_value; + } + break; + case "proxy_port": + if (!preg_match('!\D!', $param_value)) { + $proxy_port = (int) $param_value; + } else { + trigger_error("[plugin] invalid value for attribute '" . $param_key . "'", E_USER_NOTICE); + + return; + } + break; + case "agent": + if (!empty($param_value)) { + $agent = $param_value; + } + break; + case "referer": + if (!empty($param_value)) { + $referer = $param_value; + } + break; + case "timeout": + if (!preg_match('!\D!', $param_value)) { + $timeout = (int) $param_value; + } else { + trigger_error("[plugin] invalid value for attribute '" . $param_key . "'", E_USER_NOTICE); + + return; + } + break; + default: + trigger_error("[plugin] unrecognized attribute '" . $param_key . "'", E_USER_NOTICE); + + return; + } + } + if (!empty($proxy_host) && !empty($proxy_port)) { + $_is_proxy = true; + $fp = fsockopen($proxy_host, $proxy_port, $errno, $errstr, $timeout); + } else { + $fp = fsockopen($server_name, $port, $errno, $errstr, $timeout); + } + + if (!$fp) { + trigger_error("[plugin] unable to fetch: $errstr ($errno)", E_USER_NOTICE); + + return; + } else { + if ($_is_proxy) { + fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n"); + } else { + fputs($fp, "GET $uri HTTP/1.0\r\n"); + } + if (!empty($host)) { + fputs($fp, "Host: $host\r\n"); + } + if (!empty($accept)) { + fputs($fp, "Accept: $accept\r\n"); + } + if (!empty($agent)) { + fputs($fp, "User-Agent: $agent\r\n"); + } + if (!empty($referer)) { + fputs($fp, "Referer: $referer\r\n"); + } + if (isset($extra_headers) && is_array($extra_headers)) { + foreach ($extra_headers as $curr_header) { + fputs($fp, $curr_header . "\r\n"); + } + } + if (!empty($user) && !empty($pass)) { + fputs($fp, "Authorization: BASIC " . base64_encode("$user:$pass") . "\r\n"); + } + + fputs($fp, "\r\n"); + while (!feof($fp)) { + $content .= fgets($fp, 4096); + } + fclose($fp); + $csplit = preg_split("!\r\n\r\n!", $content, 2); + + $content = $csplit[1]; + + if (!empty($params['assign_headers'])) { + $template->assign($params['assign_headers'], preg_split("!\r\n!", $csplit[0])); + } + } + } else { + trigger_error("[plugin fetch] unable to parse URL, check syntax", E_USER_NOTICE); + + return; + } + } else { + $content = @file_get_contents($params['file']); + if ($content === false) { + throw new SmartyException("{fetch} cannot read resource '" . $params['file'] . "'"); + } + } + + if (!empty($params['assign'])) { + $template->assign($params['assign'], $content); + } else { + return $content; + } +} diff --git a/lib/smarty/libs/plugins/function.html_checkboxes.php b/lib/smarty/libs/plugins/function.html_checkboxes.php new file mode 100755 index 0000000..d786803 --- /dev/null +++ b/lib/smarty/libs/plugins/function.html_checkboxes.php @@ -0,0 +1,237 @@ + + * Type: function
          + * Name: html_checkboxes
          + * Date: 24.Feb.2003
          + * Purpose: Prints out a list of checkbox input types
          + * Examples: + *
          + * {html_checkboxes values=$ids output=$names}
          + * {html_checkboxes values=$ids name='box' separator='
          ' output=$names} + * {html_checkboxes values=$ids checked=$checked separator='
          ' output=$names} + *
          + * Params: + *
          + * - name       (optional) - string default "checkbox"
          + * - values     (required) - array
          + * - options    (optional) - associative array
          + * - checked    (optional) - array default not set
          + * - separator  (optional) - ie 
          or   + * - output (optional) - the output next to each checkbox + * - assign (optional) - assign the output as an array to this variable + * - escape (optional) - escape the content (not value), defaults to true + *
          + * + * @link http://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes} + * (Smarty online manual) + * @author Christopher Kvarme + * @author credits to Monte Ohrt + * @version 1.0 + * + * @param array $params parameters + * @param object $template template object + * + * @return string + * @uses smarty_function_escape_special_chars() + */ +function smarty_function_html_checkboxes($params, $template) +{ + require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); + + $name = 'checkbox'; + $values = null; + $options = null; + $selected = array(); + $separator = ''; + $escape = true; + $labels = true; + $label_ids = false; + $output = null; + + $extra = ''; + + foreach ($params as $_key => $_val) { + switch ($_key) { + case 'name': + case 'separator': + $$_key = (string) $_val; + break; + + case 'escape': + case 'labels': + case 'label_ids': + $$_key = (bool) $_val; + break; + + case 'options': + $$_key = (array) $_val; + break; + + case 'values': + case 'output': + $$_key = array_values((array) $_val); + break; + + case 'checked': + case 'selected': + if (is_array($_val)) { + $selected = array(); + foreach ($_val as $_sel) { + if (is_object($_sel)) { + if (method_exists($_sel, "__toString")) { + $_sel = smarty_function_escape_special_chars((string) $_sel->__toString()); + } else { + trigger_error("html_checkboxes: selected attribute contains an object of class '" . get_class($_sel) . "' without __toString() method", E_USER_NOTICE); + continue; + } + } else { + $_sel = smarty_function_escape_special_chars((string) $_sel); + } + $selected[$_sel] = true; + } + } elseif (is_object($_val)) { + if (method_exists($_val, "__toString")) { + $selected = smarty_function_escape_special_chars((string) $_val->__toString()); + } else { + trigger_error("html_checkboxes: selected attribute is an object of class '" . get_class($_val) . "' without __toString() method", E_USER_NOTICE); + } + } else { + $selected = smarty_function_escape_special_chars((string) $_val); + } + break; + + case 'checkboxes': + trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING); + $options = (array) $_val; + break; + + case 'assign': + break; + + case 'strict': + break; + + case 'disabled': + case 'readonly': + if (!empty($params['strict'])) { + if (!is_scalar($_val)) { + trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE); + } + + if ($_val === true || $_val === $_key) { + $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"'; + } + + break; + } + // omit break; to fall through! + + default: + if (!is_array($_val)) { + $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"'; + } else { + trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; + } + } + + if (!isset($options) && !isset($values)) { + return ''; + } /* raise error here? */ + + $_html_result = array(); + + if (isset($options)) { + foreach ($options as $_key => $_val) { + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape); + } + } else { + foreach ($values as $_i => $_key) { + $_val = isset($output[$_i]) ? $output[$_i] : ''; + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape); + } + } + + if (!empty($params['assign'])) { + $template->assign($params['assign'], $_html_result); + } else { + return implode("\n", $_html_result); + } +} + +function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape = true) +{ + $_output = ''; + + if (is_object($value)) { + if (method_exists($value, "__toString")) { + $value = (string) $value->__toString(); + } else { + trigger_error("html_options: value is an object of class '" . get_class($value) . "' without __toString() method", E_USER_NOTICE); + + return ''; + } + } else { + $value = (string) $value; + } + + if (is_object($output)) { + if (method_exists($output, "__toString")) { + $output = (string) $output->__toString(); + } else { + trigger_error("html_options: output is an object of class '" . get_class($output) . "' without __toString() method", E_USER_NOTICE); + + return ''; + } + } else { + $output = (string) $output; + } + + if ($labels) { + if ($label_ids) { + $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value)); + $_output .= '
\n"; + } + + return $status; + } +} diff --git a/lib/smarty/libs/sysplugins/smarty_internal_undefined.php b/lib/smarty/libs/sysplugins/smarty_internal_undefined.php new file mode 100755 index 0000000..93fca8e --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_internal_undefined.php @@ -0,0 +1,48 @@ +cached->valid = false; + } else { + $tpl->mustCompile = true; + } + return false; + } + + /** + * Call error handler for undefined method + * + * @param string $name unknown method-name + * @param array $args argument array + * + * @return mixed + * @throws SmartyException + */ + public function __call($name, $args) + { + throw new SmartyException(get_class($args[0]) . "->{$name}() undefined method"); + } +} \ No newline at end of file diff --git a/lib/smarty/libs/sysplugins/smarty_resource.php b/lib/smarty/libs/sysplugins/smarty_resource.php new file mode 100755 index 0000000..93d9fa7 --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_resource.php @@ -0,0 +1,270 @@ + 'smarty_internal_resource_file.php', + 'string' => 'smarty_internal_resource_string.php', + 'extends' => 'smarty_internal_resource_extends.php', + 'stream' => 'smarty_internal_resource_stream.php', + 'eval' => 'smarty_internal_resource_eval.php', + 'php' => 'smarty_internal_resource_php.php'); + + /** + * Flag if resource does implement populateCompiledFilepath() method + * + * @var bool + */ + public $hasCompiledHandler = false; + + /** + * Name of the Class to compile this resource's contents with + * + * @var string + */ + public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler'; + + /** + * Name of the Class to tokenize this resource's contents with + * + * @var string + */ + public $template_lexer_class = 'Smarty_Internal_Templatelexer'; + + /** + * Name of the Class to parse this resource's contents with + * + * @var string + */ + public $template_parser_class = 'Smarty_Internal_Templateparser'; + + /** + * Load template's source into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ + abstract public function getContent(Smarty_Template_Source $source); + + /** + * populate Source Object with meta data from Resource + * + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object + */ + abstract public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null); + + /** + * populate Source Object with timestamp and exists from Resource + * + * @param Smarty_Template_Source $source source object + */ + public function populateTimestamp(Smarty_Template_Source $source) + { + // intentionally left blank + } + + /** + * modify resource_name according to resource handlers specifications + * + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $isConfig flag for config resource + * + * @return string unique resource name + */ + public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false) + { + if ($isConfig) { + if (!isset($smarty->_joined_config_dir)) { + $smarty->getTemplateDir(null, true); + } + return get_class($this) . '#' . $smarty->_joined_config_dir . '#' . $resource_name; + } else { + if (!isset($smarty->_joined_template_dir)) { + $smarty->getTemplateDir(); + } + return get_class($this) . '#' . $smarty->_joined_template_dir . '#' . $resource_name; + } + } + + /** + * Determine basename for compiled filename + * + * @param Smarty_Template_Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Smarty_Template_Source $source) + { + return null; + } + + /** + * Load Resource Handler + * + * @param Smarty $smarty smarty object + * @param string $type name of the resource + * + * @throws SmartyException + * @return Smarty_Resource Resource Handler + */ + public static function load(Smarty $smarty, $type) + { + // try smarty's cache + if (isset($smarty->_cache['resource_handlers'][$type])) { + return $smarty->_cache['resource_handlers'][$type]; + } + + // try registered resource + if (isset($smarty->registered_resources[$type])) { + return $smarty->_cache['resource_handlers'][$type] = + $smarty->registered_resources[$type] instanceof Smarty_Resource ? $smarty->registered_resources[$type] : + new Smarty_Internal_Resource_Registered(); + } + + // try sysplugins dir + if (isset(self::$sysplugins[$type])) { + $_resource_class = 'Smarty_Internal_Resource_' . ucfirst($type); + return $smarty->_cache['resource_handlers'][$type] = new $_resource_class(); + } + + // try plugins dir + $_resource_class = 'Smarty_Resource_' . ucfirst($type); + if ($smarty->loadPlugin($_resource_class)) { + if (class_exists($_resource_class, false)) { + return $smarty->_cache['resource_handlers'][$type] = new $_resource_class(); + } else { + $smarty->registerResource($type, + array("smarty_resource_{$type}_source", "smarty_resource_{$type}_timestamp", + "smarty_resource_{$type}_secure", "smarty_resource_{$type}_trusted")); + // give it another try, now that the resource is registered properly + return self::load($smarty, $type); + } + } + + // try streams + $_known_stream = stream_get_wrappers(); + if (in_array($type, $_known_stream)) { + // is known stream + if (is_object($smarty->security_policy)) { + $smarty->security_policy->isTrustedStream($type); + } + return $smarty->_cache['resource_handlers'][$type] = new Smarty_Internal_Resource_Stream(); + } + + // TODO: try default_(template|config)_handler + + // give up + throw new SmartyException("Unknown resource type '{$type}'"); + } + + /** + * extract resource_type and resource_name from template_resource and config_resource + * @note "C:/foo.tpl" was forced to file resource up till Smarty 3.1.3 (including). + * + * @param string $resource_name template_resource or config_resource to parse + * @param string $default_resource the default resource_type defined in $smarty + * + * @return array with parsed resource name and type + */ + public static function parseResourceName($resource_name, $default_resource) + { + if (preg_match('/^([A-Za-z0-9_\-]{2,})[:]/', $resource_name, $match)) { + $type = $match[1]; + $name = substr($resource_name, strlen($match[0])); + } else { + // no resource given, use default + // or single character before the colon is not a resource type, but part of the filepath + $type = $default_resource; + $name = $resource_name; + } + return array($name, $type); + } + + /** + * modify template_resource according to resource handlers specifications + * + * @param \Smarty_Internal_Template|\Smarty $obj Smarty instance + * @param string $template_resource template_resource to extract resource handler and name of + * + * @return string unique resource name + */ + public static function getUniqueTemplateName($obj, $template_resource) + { + $smarty = $obj->_objType == 2 ? $obj->smarty : $obj; + list($name, $type) = self::parseResourceName($template_resource, $smarty->default_resource_type); + // TODO: optimize for Smarty's internal resource types + $resource = Smarty_Resource::load($smarty, $type); + // go relative to a given template? + $_file_is_dotted = $name[0] == '.' && ($name[1] == '.' || $name[1] == '/'); + if ($obj->_objType == 2 && $_file_is_dotted && + ($obj->source->type == 'file' || $obj->parent->source->type == 'extends') + ) { + $name = dirname($obj->source->filepath) . DS . $name; + } + return $resource->buildUniqueResourceName($smarty, $name); + } + + /* + * Check if resource must check time stamps when when loading complied or cached templates. + * Resources like 'extends' which use source components my disable timestamp checks on own resource. + * + * @return bool + */ + public function checkTimestamps() { + return true; + } + + /** + * initialize Source Object for given resource + * wrapper for backward compatibility to versions < 3.1.22 + * Either [$_template] or [$smarty, $template_resource] must be specified + * + * @param Smarty_Internal_Template $_template template object + * @param Smarty $smarty smarty object + * @param string $template_resource resource identifier + * + * @return Smarty_Template_Source Source Object + */ + public static function source(Smarty_Internal_Template $_template = null, Smarty $smarty = null, + $template_resource = null) + { + return Smarty_Template_Source::load($_template, $smarty, $template_resource); + } +} + diff --git a/lib/smarty/libs/sysplugins/smarty_resource_custom.php b/lib/smarty/libs/sysplugins/smarty_resource_custom.php new file mode 100755 index 0000000..619f2d6 --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_resource_custom.php @@ -0,0 +1,95 @@ +filepath = $source->type . ':' . $source->name; + $source->uid = sha1($source->type . ':' . $source->name); + + $mtime = $this->fetchTimestamp($source->name); + if ($mtime !== null) { + $source->timestamp = $mtime; + } else { + $this->fetch($source->name, $content, $timestamp); + $source->timestamp = isset($timestamp) ? $timestamp : false; + if (isset($content)) { + $source->content = $content; + } + } + $source->exists = !!$source->timestamp; + } + + /** + * Load template's source into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ + public function getContent(Smarty_Template_Source $source) + { + $this->fetch($source->name, $content, $timestamp); + if (isset($content)) { + return $content; + } + + throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); + } + + /** + * Determine basename for compiled filename + * + * @param Smarty_Template_Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Smarty_Template_Source $source) + { + return basename($source->name); + } +} diff --git a/lib/smarty/libs/sysplugins/smarty_resource_recompiled.php b/lib/smarty/libs/sysplugins/smarty_resource_recompiled.php new file mode 100755 index 0000000..cfd7340 --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_resource_recompiled.php @@ -0,0 +1,47 @@ +filepath = false; + $compiled->timestamp = false; + $compiled->exists = false; + } +} diff --git a/lib/smarty/libs/sysplugins/smarty_resource_uncompiled.php b/lib/smarty/libs/sysplugins/smarty_resource_uncompiled.php new file mode 100755 index 0000000..88d2bba --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_resource_uncompiled.php @@ -0,0 +1,79 @@ +filepath = false; + $compiled->timestamp = false; + $compiled->exists = false; + } + + /** + * render compiled template code + * + * @param Smarty_Internal_Template $_template + * + * @return string + * @throws Exception + */ + public function render($_template) + { + $level = ob_get_level(); + ob_start(); + try { + $this->renderUncompiled($_template->source, $_template); + return ob_get_clean(); + } + catch (Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + throw $e; + } + } +} diff --git a/lib/smarty/libs/sysplugins/smarty_security.php b/lib/smarty/libs/sysplugins/smarty_security.php new file mode 100755 index 0000000..9d48bcb --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_security.php @@ -0,0 +1,715 @@ +" tags in templates. + * possible values: + *
    + *
  • Smarty::PHP_PASSTHRU -> echo PHP tags as they are
  • + *
  • Smarty::PHP_QUOTE -> escape tags as entities
  • + *
  • Smarty::PHP_REMOVE -> remove php tags
  • + *
  • Smarty::PHP_ALLOW -> execute php tags
  • + *
+ * + * @var integer + */ + public $php_handling = Smarty::PHP_PASSTHRU; + + /** + * This is the list of template directories that are considered secure. + * $template_dir is in this list implicitly. + * + * @var array + */ + public $secure_dir = array(); + + /** + * This is an array of directories where trusted php scripts reside. + * {@link $security} is disabled during their inclusion/execution. + * + * @var array + */ + public $trusted_dir = array(); + + /** + * List of regular expressions (PCRE) that include trusted URIs + * + * @var array + */ + public $trusted_uri = array(); + + /** + * List of trusted constants names + * + * @var array + */ + public $trusted_constants = array(); + + /** + * This is an array of trusted static classes. + * If empty access to all static classes is allowed. + * If set to 'none' none is allowed. + * + * @var array + */ + public $static_classes = array(); + + /** + * This is an nested array of trusted classes and static methods. + * If empty access to all static classes and methods is allowed. + * Format: + * array ( + * 'class_1' => array('method_1', 'method_2'), // allowed methods listed + * 'class_2' => array(), // all methods of class allowed + * ) + * If set to null none is allowed. + * + * @var array + */ + public $trusted_static_methods = array(); + + /** + * This is an array of trusted static properties. + * If empty access to all static classes and properties is allowed. + * Format: + * array ( + * 'class_1' => array('prop_1', 'prop_2'), // allowed properties listed + * 'class_2' => array(), // all properties of class allowed + * ) + * If set to null none is allowed. + * + * @var array + */ + public $trusted_static_properties = array(); + + /** + * This is an array of trusted PHP functions. + * If empty all functions are allowed. + * To disable all PHP functions set $php_functions = null. + * + * @var array + */ + public $php_functions = array('isset', 'empty', 'count', 'sizeof', 'in_array', 'is_array', 'time',); + + /** + * This is an array of trusted PHP modifiers. + * If empty all modifiers are allowed. + * To disable all modifier set $php_modifiers = null. + * + * @var array + */ + public $php_modifiers = array('escape', 'count', 'nl2br',); + + /** + * This is an array of allowed tags. + * If empty no restriction by allowed_tags. + * + * @var array + */ + public $allowed_tags = array(); + + /** + * This is an array of disabled tags. + * If empty no restriction by disabled_tags. + * + * @var array + */ + public $disabled_tags = array(); + + /** + * This is an array of allowed modifier plugins. + * If empty no restriction by allowed_modifiers. + * + * @var array + */ + public $allowed_modifiers = array(); + + /** + * This is an array of disabled modifier plugins. + * If empty no restriction by disabled_modifiers. + * + * @var array + */ + public $disabled_modifiers = array(); + + /** + * This is an array of disabled special $smarty variables. + * + * @var array + */ + public $disabled_special_smarty_vars = array(); + + /** + * This is an array of trusted streams. + * If empty all streams are allowed. + * To disable all streams set $streams = null. + * + * @var array + */ + public $streams = array('file'); + + /** + * + flag if constants can be accessed from template + * + * @var boolean + */ + public $allow_constants = true; + + /** + * + flag if super globals can be accessed from template + * + * @var boolean + */ + public $allow_super_globals = true; + + /** + * max template nesting level + * + * @var int + */ + public $max_template_nesting = 0; + + /** + * current template nesting level + * + * @var int + */ + private $_current_template_nesting = 0; + + /** + * Cache for $resource_dir lookup + * + * @var array + */ + protected $_resource_dir = array(); + + /** + * Cache for $template_dir lookup + * + * @var array + */ + protected $_template_dir = array(); + + /** + * Cache for $config_dir lookup + * + * @var array + */ + protected $_config_dir = array(); + + /** + * Cache for $secure_dir lookup + * + * @var array + */ + protected $_secure_dir = array(); + + /** + * Cache for $php_resource_dir lookup + * + * @var array + */ + protected $_php_resource_dir = null; + + /** + * Cache for $trusted_dir lookup + * + * @var array + */ + protected $_trusted_dir = null; + + /** + * Cache for include path status + * + * @var bool + */ + protected $_include_path_status = false; + + /** + * Cache for $_include_array lookup + * + * @var array + */ + protected $_include_dir = array(); + + /** + * @param Smarty $smarty + */ + public function __construct($smarty) + { + $this->smarty = $smarty; + } + + /** + * Check if PHP function is trusted. + * + * @param string $function_name + * @param object $compiler compiler object + * + * @return boolean true if function is trusted + * @throws SmartyCompilerException if php function is not trusted + */ + public function isTrustedPhpFunction($function_name, $compiler) + { + if (isset($this->php_functions) && + (empty($this->php_functions) || in_array($function_name, $this->php_functions)) + ) { + return true; + } + + $compiler->trigger_template_error("PHP function '{$function_name}' not allowed by security setting"); + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if static class is trusted. + * + * @param string $class_name + * @param object $compiler compiler object + * + * @return boolean true if class is trusted + * @throws SmartyCompilerException if static class is not trusted + */ + public function isTrustedStaticClass($class_name, $compiler) + { + if (isset($this->static_classes) && + (empty($this->static_classes) || in_array($class_name, $this->static_classes)) + ) { + return true; + } + + $compiler->trigger_template_error("access to static class '{$class_name}' not allowed by security setting"); + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if static class method/property is trusted. + * + * @param string $class_name + * @param string $params + * @param object $compiler compiler object + * + * @return boolean true if class method is trusted + * @throws SmartyCompilerException if static class method is not trusted + */ + public function isTrustedStaticClassAccess($class_name, $params, $compiler) + { + if (!isset($params[2])) { + // fall back + return $this->isTrustedStaticClass($class_name, $compiler); + } + if ($params[2] == 'method') { + $allowed = $this->trusted_static_methods; + $name = substr($params[0], 0, strpos($params[0], '(')); + } else { + $allowed = $this->trusted_static_properties; + // strip '$' + $name = substr($params[0], 1); + } + if (isset($allowed)) { + if (empty($allowed)) { + // fall back + return $this->isTrustedStaticClass($class_name, $compiler); + } + if (isset($allowed[$class_name]) && + (empty($allowed[$class_name]) || in_array($name, $allowed[$class_name])) + ) { + return true; + } + } + $compiler->trigger_template_error("access to static class '{$class_name}' {$params[2]} '{$name}' not allowed by security setting"); + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if PHP modifier is trusted. + * + * @param string $modifier_name + * @param object $compiler compiler object + * + * @return boolean true if modifier is trusted + * @throws SmartyCompilerException if modifier is not trusted + */ + public function isTrustedPhpModifier($modifier_name, $compiler) + { + if (isset($this->php_modifiers) && + (empty($this->php_modifiers) || in_array($modifier_name, $this->php_modifiers)) + ) { + return true; + } + + $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting"); + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if tag is trusted. + * + * @param string $tag_name + * @param object $compiler compiler object + * + * @return boolean true if tag is trusted + * @throws SmartyCompilerException if modifier is not trusted + */ + public function isTrustedTag($tag_name, $compiler) + { + // check for internal always required tags + if (in_array($tag_name, array('assign', 'call', 'private_filter', 'private_block_plugin', + 'private_function_plugin', 'private_object_block_function', + 'private_object_function', 'private_registered_function', + 'private_registered_block', 'private_special_variable', + 'private_print_expression', 'private_modifier'))) { + return true; + } + // check security settings + if (empty($this->allowed_tags)) { + if (empty($this->disabled_tags) || !in_array($tag_name, $this->disabled_tags)) { + return true; + } else { + $compiler->trigger_template_error("tag '{$tag_name}' disabled by security setting", null, true); + } + } elseif (in_array($tag_name, $this->allowed_tags) && !in_array($tag_name, $this->disabled_tags)) { + return true; + } else { + $compiler->trigger_template_error("tag '{$tag_name}' not allowed by security setting", null, true); + } + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if special $smarty variable is trusted. + * + * @param string $var_name + * @param object $compiler compiler object + * + * @return boolean true if tag is trusted + * @throws SmartyCompilerException if modifier is not trusted + */ + public function isTrustedSpecialSmartyVar($var_name, $compiler) + { + if (!in_array($var_name, $this->disabled_special_smarty_vars)) { + return true; + } else { + $compiler->trigger_template_error("special variable '\$smarty.{$var_name}' not allowed by security setting", null, true); + } + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if modifier plugin is trusted. + * + * @param string $modifier_name + * @param object $compiler compiler object + * + * @return boolean true if tag is trusted + * @throws SmartyCompilerException if modifier is not trusted + */ + public function isTrustedModifier($modifier_name, $compiler) + { + // check for internal always allowed modifier + if (in_array($modifier_name, array('default'))) { + return true; + } + // check security settings + if (empty($this->allowed_modifiers)) { + if (empty($this->disabled_modifiers) || !in_array($modifier_name, $this->disabled_modifiers)) { + return true; + } else { + $compiler->trigger_template_error("modifier '{$modifier_name}' disabled by security setting", null, true); + } + } elseif (in_array($modifier_name, $this->allowed_modifiers) && + !in_array($modifier_name, $this->disabled_modifiers) + ) { + return true; + } else { + $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting", null, true); + } + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if constants are enabled or trusted + * + * @param string $const constant name + * @param object $compiler compiler object + * + * @return bool + */ + public function isTrustedConstant($const, $compiler) + { + if (in_array($const, array('true', 'false', 'null'))) { + return true; + } + if (!empty($this->trusted_constants)) { + if (!in_array($const, $this->trusted_constants)) { + $compiler->trigger_template_error("Security: access to constant '{$const}' not permitted"); + return false; + } + return true; + } + if ($this->allow_constants) { + return true; + } + $compiler->trigger_template_error("Security: access to constants not permitted"); + return false; + } + + /** + * Check if stream is trusted. + * + * @param string $stream_name + * + * @return boolean true if stream is trusted + * @throws SmartyException if stream is not trusted + */ + public function isTrustedStream($stream_name) + { + if (isset($this->streams) && (empty($this->streams) || in_array($stream_name, $this->streams))) { + return true; + } + + throw new SmartyException("stream '{$stream_name}' not allowed by security setting"); + } + + /** + * Check if directory of file resource is trusted. + * + * @param string $filepath + * @param null|bool $isConfig + * + * @return bool true if directory is trusted + * @throws \SmartyException if directory is not trusted + */ + public function isTrustedResourceDir($filepath, $isConfig = null) + { + if ($this->_include_path_status !== $this->smarty->use_include_path) { + foreach ($this->_include_dir as $directory) { + unset($this->_resource_dir[$directory]); + } + if ($this->smarty->use_include_path) { + $this->_include_dir = array(); + $_dirs = $this->smarty->ext->_getIncludePath->getIncludePathDirs($this->smarty); + foreach ($_dirs as $directory) { + $this->_include_dir[] = $directory; + $this->_resource_dir[$directory] = true; + } + } + $this->_include_path_status = $this->smarty->use_include_path; + } + if ($isConfig !== true && + (!isset($this->smarty->_cache['template_dir_new']) || $this->smarty->_cache['template_dir_new']) + ) { + $_dir = $this->smarty->getTemplateDir(); + if ($this->_template_dir !== $_dir) { + foreach ($this->_template_dir as $directory) { + unset($this->_resource_dir[$directory]); + } + foreach ($_dir as $directory) { + $this->_resource_dir[$directory] = true; + } + $this->_template_dir = $_dir; + } + $this->smarty->_cache['template_dir_new'] = false; + } + if ($isConfig !== false && + (!isset($this->smarty->_cache['config_dir_new']) || $this->smarty->_cache['config_dir_new']) + ) { + $_dir = $this->smarty->getConfigDir(); + if ($this->_config_dir !== $_dir) { + foreach ($this->_config_dir as $directory) { + unset($this->_resource_dir[$directory]); + } + foreach ($_dir as $directory) { + $this->_resource_dir[$directory] = true; + } + $this->_config_dir = $_dir; + } + $this->smarty->_cache['config_dir_new'] = false; + } + if ($this->_secure_dir !== (array) $this->secure_dir) { + foreach ($this->_secure_dir as $directory) { + unset($this->_resource_dir[$directory]); + } + foreach ((array) $this->secure_dir as $directory) { + $directory = $this->smarty->_realpath($directory . DS, true); + $this->_resource_dir[$directory] = true; + } + $this->_secure_dir = (array) $this->secure_dir; + } + $this->_resource_dir = $this->_checkDir($filepath, $this->_resource_dir); + return true; + } + + /** + * Check if URI (e.g. {fetch} or {html_image}) is trusted + * To simplify things, isTrustedUri() resolves all input to "{$PROTOCOL}://{$HOSTNAME}". + * So "http://username:password@hello.world.example.org:8080/some-path?some=query-string" + * is reduced to "http://hello.world.example.org" prior to applying the patters from {@link $trusted_uri}. + * + * @param string $uri + * + * @return boolean true if URI is trusted + * @throws SmartyException if URI is not trusted + * @uses $trusted_uri for list of patterns to match against $uri + */ + public function isTrustedUri($uri) + { + $_uri = parse_url($uri); + if (!empty($_uri['scheme']) && !empty($_uri['host'])) { + $_uri = $_uri['scheme'] . '://' . $_uri['host']; + foreach ($this->trusted_uri as $pattern) { + if (preg_match($pattern, $_uri)) { + return true; + } + } + } + + throw new SmartyException("URI '{$uri}' not allowed by security setting"); + } + + /** + * Check if directory of file resource is trusted. + * + * @param string $filepath + * + * @return boolean true if directory is trusted + * @throws SmartyException if PHP directory is not trusted + */ + public function isTrustedPHPDir($filepath) + { + if (empty($this->trusted_dir)) { + throw new SmartyException("directory '{$filepath}' not allowed by security setting (no trusted_dir specified)"); + } + + // check if index is outdated + if (!$this->_trusted_dir || $this->_trusted_dir !== $this->trusted_dir) { + $this->_php_resource_dir = array(); + + $this->_trusted_dir = $this->trusted_dir; + foreach ((array) $this->trusted_dir as $directory) { + $directory = $this->smarty->_realpath($directory . DS, true); + $this->_php_resource_dir[$directory] = true; + } + } + + $this->_php_resource_dir = $this->_checkDir($this->smarty->_realpath($filepath, true), $this->_php_resource_dir); + return true; + } + + /** + * Start template processing + * + * @param $template + * + * @throws SmartyException + */ + public function startTemplate($template) + { + if ($this->max_template_nesting > 0 && $this->_current_template_nesting ++ >= $this->max_template_nesting) { + throw new SmartyException("maximum template nesting level of '{$this->max_template_nesting}' exceeded when calling '{$template->template_resource}'"); + } + } + + /** + * Exit template processing + * + * @internal param $template + */ + public function exitTemplate() + { + if ($this->max_template_nesting > 0) { + $this->_current_template_nesting --; + } + } + + /** + * Check if file is inside a valid directory + * + * @param string $filepath + * @param array $dirs valid directories + * + * @return array + * @throws \SmartyException + */ + private function _checkDir($filepath, $dirs) + { + $directory = dirname($filepath) . DS; + $_directory = array(); + while (true) { + // remember the directory to add it to _resource_dir in case we're successful + $_directory[$directory] = true; + // test if the directory is trusted + if (isset($dirs[$directory])) { + // merge sub directories of current $directory into _resource_dir to speed up subsequent lookup + $dirs = array_merge($dirs, $_directory); + + return $dirs; + } + // abort if we've reached root + if (!preg_match('#[\\\/][^\\\/]+[\\\/]$#', $directory)) { + break; + } + // bubble up one level + $directory = preg_replace('#[\\\/][^\\\/]+[\\\/]$#', DS, $directory); + } + + // give up + throw new SmartyException("directory '{$filepath}' not allowed by security setting"); + } + + /** + * Loads security class and enables security + * + * @param \Smarty $smarty + * @param string|Smarty_Security $security_class if a string is used, it must be class-name + * + * @return \Smarty current Smarty instance for chaining + * @throws \SmartyException when an invalid class name is provided + */ + public static function enableSecurity(Smarty $smarty, $security_class) + { + if ($security_class instanceof Smarty_Security) { + $smarty->security_policy = $security_class; + return; + } elseif (is_object($security_class)) { + throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security."); + } + if ($security_class == null) { + $security_class = $smarty->security_class; + } + if (!class_exists($security_class)) { + throw new SmartyException("Security class '$security_class' is not defined"); + } elseif ($security_class !== 'Smarty_Security' && !is_subclass_of($security_class, 'Smarty_Security')) { + throw new SmartyException("Class '$security_class' must extend Smarty_Security."); + } else { + $smarty->security_policy = new $security_class($smarty); + } + return; + } +} diff --git a/lib/smarty/libs/sysplugins/smarty_template_cached.php b/lib/smarty/libs/sysplugins/smarty_template_cached.php new file mode 100755 index 0000000..cecf429 --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_template_cached.php @@ -0,0 +1,246 @@ +compile_id = $_template->compile_id; + $this->cache_id = $_template->cache_id; + $this->source = $_template->source; + if (!class_exists('Smarty_CacheResource', false)) { + require SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php'; + } + $this->handler = Smarty_CacheResource::load($_template->smarty); + } + + /** + * @param Smarty_Internal_Template $_template + * + * @return Smarty_Template_Cached + */ + static function load(Smarty_Internal_Template $_template) + { + $_template->cached = new Smarty_Template_Cached($_template); + $_template->cached->handler->populate($_template->cached, $_template); + // caching enabled ? + if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || + $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || $_template->source->handler->recompiled + ) { + $_template->cached->valid = false; + } + return $_template->cached; + } + + /** + * Render cache template + * + * @param \Smarty_Internal_Template $_template + * @param bool $no_output_filter + * + * @throws \Exception + */ + public function render(Smarty_Internal_Template $_template, $no_output_filter = true) + { + if ($this->isCached($_template)) { + if ($_template->smarty->debugging) { + $_template->smarty->_debug->start_cache($_template); + } + if (!$this->processed) { + $this->process($_template); + } + $this->getRenderedTemplateCode($_template); + if ($_template->smarty->debugging) { + $_template->smarty->_debug->end_cache($_template); + } + return; + } else { + $_template->smarty->ext->_updateCache->updateCache($this, $_template, $no_output_filter); + } + } + + /** + * Check if cache is valid, lock cache if required + * + * @param \Smarty_Internal_Template $_template + * + * @return bool flag true if cache is valid + */ + public function isCached(Smarty_Internal_Template $_template) + { + if ($this->valid !== null) { + return $this->valid; + } + while (true) { + while (true) { + if ($this->exists === false || $_template->smarty->force_compile || $_template->smarty->force_cache) { + $this->valid = false; + } else { + $this->valid = true; + } + if ($this->valid && $_template->caching == Smarty::CACHING_LIFETIME_CURRENT && + $_template->cache_lifetime >= 0 && time() > ($this->timestamp + $_template->cache_lifetime) + ) { + // lifetime expired + $this->valid = false; + } + if ($this->valid && $_template->smarty->compile_check == 1 && + $_template->source->getTimeStamp() > $this->timestamp + ) { + $this->valid = false; + } + if ($this->valid || !$_template->smarty->cache_locking) { + break; + } + if (!$this->handler->locked($_template->smarty, $this)) { + $this->handler->acquireLock($_template->smarty, $this); + break 2; + } + $this->handler->populate($this, $_template); + } + if ($this->valid) { + if (!$_template->smarty->cache_locking || $this->handler->locked($_template->smarty, $this) === null) { + // load cache file for the following checks + if ($_template->smarty->debugging) { + $_template->smarty->_debug->start_cache($_template); + } + if ($this->handler->process($_template, $this) === false) { + $this->valid = false; + } else { + $this->processed = true; + } + if ($_template->smarty->debugging) { + $_template->smarty->_debug->end_cache($_template); + } + } else { + $this->is_locked = true; + continue; + } + } else { + return $this->valid; + } + if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_SAVED && + $_template->cached->cache_lifetime >= 0 && + (time() > ($_template->cached->timestamp + $_template->cached->cache_lifetime)) + ) { + $this->valid = false; + } + if ($_template->smarty->cache_locking) { + if (!$this->valid) { + $this->handler->acquireLock($_template->smarty, $this); + } elseif ($this->is_locked) { + $this->handler->releaseLock($_template->smarty, $this); + } + } + return $this->valid; + } + return $this->valid; + } + + /** + * Process cached template + * + * @param Smarty_Internal_Template $_template template object + * @param bool $update flag if called because cache update + */ + public function process(Smarty_Internal_Template $_template, $update = false) + { + if ($this->handler->process($_template, $this, $update) === false) { + $this->valid = false; + } + if ($this->valid) { + $this->processed = true; + } else { + $this->processed = false; + } + } + + /** + * Read cache content from handler + * + * @param Smarty_Internal_Template $_template template object + * + * @return string content + */ + public function read(Smarty_Internal_Template $_template) + { + if (!$_template->source->handler->recompiled) { + return $this->handler->readCachedContent($_template); + } + return false; + } +} diff --git a/lib/smarty/libs/sysplugins/smarty_template_compiled.php b/lib/smarty/libs/sysplugins/smarty_template_compiled.php new file mode 100755 index 0000000..e7710f8 --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_template_compiled.php @@ -0,0 +1,297 @@ +source->handler->recompiled && + ($_template->smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) + ) { + $_cache_key = $_template->source->unique_resource . '#'; + if ($_template->caching) { + $_cache_key .= 'caching#'; + } + $_cache_key .= $_template->compile_id; + if (isset($_template->source->compileds[$_cache_key])) { + return $_template->source->compileds[$_cache_key]; + } + } + $compiled = new Smarty_Template_Compiled(); + if ($_template->source->handler->hasCompiledHandler) { + $_template->source->handler->populateCompiledFilepath($compiled, $_template); + } else { + $compiled->populateCompiledFilepath($_template); + } + // runtime cache + if (!$_template->source->handler->recompiled && + ($_template->smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) + ) { + $_template->source->compileds[$_cache_key] = $compiled; + } + return $compiled; + } + + /** + * populate Compiled Object with compiled filepath + * + * @param Smarty_Internal_Template $_template template object + **/ + public function populateCompiledFilepath(Smarty_Internal_Template $_template) + { + $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w]+!', '_', $_template->compile_id) : null; + if ($_template->source->isConfig) { + $_flag = '_' . + ((int) $_template->smarty->config_read_hidden + (int) $_template->smarty->config_booleanize * 2 + + (int) $_template->smarty->config_overwrite * 4); + } else { + $_flag = + '_' . ((int) $_template->smarty->merge_compiled_includes + (int) $_template->smarty->escape_html * 2); + } + $_filepath = $_template->source->uid . $_flag; + // if use_sub_dirs, break file into directories + if ($_template->smarty->use_sub_dirs) { + $_filepath = substr($_filepath, 0, 2) . DS . substr($_filepath, 2, 2) . DS . substr($_filepath, 4, 2) . DS . + $_filepath; + } + $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^'; + if (isset($_compile_id)) { + $_filepath = $_compile_id . $_compile_dir_sep . $_filepath; + } + // caching token + if ($_template->caching) { + $_cache = '.cache'; + } else { + $_cache = ''; + } + $_compile_dir = $_template->smarty->getCompileDir(); + // set basename if not specified + $_basename = $_template->source->handler->getBasename($_template->source); + if ($_basename === null) { + $_basename = basename(preg_replace('![^\w]+!', '_', $_template->source->name)); + } + // separate (optional) basename by dot + if ($_basename) { + $_basename = '.' . $_basename; + } + + $this->filepath = $_compile_dir . $_filepath . '.' . $_template->source->type . $_basename . $_cache . '.php'; + $this->exists = is_file($this->filepath); + if (!$this->exists) { + $this->timestamp = false; + } + } + + /** + * load compiled template or compile from source + * + * @param Smarty_Internal_Template $_template + * + * @throws Exception + */ + public function process(Smarty_Internal_Template $_template) + { + $_smarty_tpl = $_template; + if ($_template->source->handler->recompiled || !$_template->compiled->exists || + $_template->smarty->force_compile || ($_template->smarty->compile_check && + $_template->source->getTimeStamp() > $_template->compiled->getTimeStamp()) + ) { + $this->compileTemplateSource($_template); + $compileCheck = $_template->smarty->compile_check; + $_template->smarty->compile_check = false; + if ($_template->source->handler->recompiled) { + $level = ob_get_level(); + ob_start(); + try { + eval("?>" . $this->content); + } + catch (Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + throw $e; + } + ob_get_clean(); + $this->content = null; + } else { + $this->loadCompiledTemplate($_template); + } + $_template->smarty->compile_check = $compileCheck; + } else { + $_template->mustCompile = true; + @include($_template->compiled->filepath); + if ($_template->mustCompile) { + $this->compileTemplateSource($_template); + $compileCheck = $_template->smarty->compile_check; + $_template->smarty->compile_check = false; + $this->loadCompiledTemplate($_template); + $_template->smarty->compile_check = $compileCheck; + } + } + $_template->smarty->ext->_subTemplate->registerSubTemplates($_template); + + $this->processed = true; + } + + /** + * Load fresh compiled template by including the PHP file + * HHVM requires a work around because of a PHP incompatibility + * + * @param \Smarty_Internal_Template $_template + */ + private function loadCompiledTemplate(Smarty_Internal_Template $_template) + { + if (function_exists('opcache_invalidate')) { + opcache_invalidate($_template->compiled->filepath); + } + $_smarty_tpl = $_template; + if (defined('HHVM_VERSION')) { + $_template->smarty->ext->_hhvm->includeHhvm($_template, $_template->compiled->filepath); + } else { + include($_template->compiled->filepath); + } + } + + /** + * render compiled template code + * + * @param Smarty_Internal_Template $_template + * + * @return string + * @throws Exception + */ + public function render(Smarty_Internal_Template $_template) + { + if ($_template->smarty->debugging) { + $_template->smarty->_debug->start_render($_template); + } + if (!$this->processed) { + $this->process($_template); + } + if (isset($_template->cached)) { + $_template->cached->file_dependency = + array_merge($_template->cached->file_dependency, $this->file_dependency); + } + $this->getRenderedTemplateCode($_template); + if ($_template->caching && $this->has_nocache_code) { + $_template->cached->hashes[$this->nocache_hash] = true; + } + if (isset($_template->parent) && $_template->parent->_objType == 2 && !empty($_template->tpl_function)) { + $_template->parent->tpl_function = array_merge($_template->parent->tpl_function, $_template->tpl_function); + } + if ($_template->smarty->debugging) { + $_template->smarty->_debug->end_render($_template); + } + } + + /** + * compile template from source + * + * @param Smarty_Internal_Template $_template + * + * @return string + * @throws Exception + */ + public function compileTemplateSource(Smarty_Internal_Template $_template) + { + $_template->source->compileds = array(); + $this->file_dependency = array(); + $this->tpl_function = array(); + $this->includes = array(); + $this->nocache_hash = null; + $this->unifunc = null; + // compile locking + if (!$_template->source->handler->recompiled) { + if ($saved_timestamp = $_template->compiled->getTimeStamp()) { + touch($_template->compiled->filepath); + } + } + // call compiler + try { + $_template->loadCompiler(); + $code = $_template->compiler->compileTemplate($_template); + } + catch (Exception $e) { + // restore old timestamp in case of error + if (!$_template->source->handler->recompiled && $saved_timestamp) { + touch($_template->compiled->filepath, $saved_timestamp); + } + throw $e; + } + // compiling succeeded + if ($_template->compiler->write_compiled_code) { + // write compiled template + $this->write($_template, $code); + $code = ''; + } + // release compiler object to free memory + unset($_template->compiler); + return $code; + } + + /** + * Write compiled code by handler + * + * @param Smarty_Internal_Template $_template template object + * @param string $code compiled code + * + * @return boolean success + */ + public function write(Smarty_Internal_Template $_template, $code) + { + if (!$_template->source->handler->recompiled) { + if ($_template->smarty->ext->_writeFile->writeFile($this->filepath, $code, $_template->smarty) === true) { + $this->timestamp = $this->exists = is_file($this->filepath); + if ($this->exists) { + $this->timestamp = filemtime($this->filepath); + return true; + } + } + return false; + } else { + $this->content = $code; + } + $this->timestamp = time(); + $this->exists = true; + return true; + } + + /** + * Read compiled content from handler + * + * @param Smarty_Internal_Template $_template template object + * + * @return string content + */ + public function read(Smarty_Internal_Template $_template) + { + if (!$_template->source->handler->recompiled) { + return file_get_contents($this->filepath); + } + return isset($this->content) ? $this->content : false; + } +} diff --git a/lib/smarty/libs/sysplugins/smarty_template_config.php b/lib/smarty/libs/sysplugins/smarty_template_config.php new file mode 100755 index 0000000..f0fff50 --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_template_config.php @@ -0,0 +1,97 @@ +handler = clone $handler; // Note: prone to circular references + $this->handler->compiler_class = 'Smarty_Internal_Config_File_Compiler'; + $this->handler->template_lexer_class = 'Smarty_Internal_Configfilelexer'; + $this->handler->template_parser_class = 'Smarty_Internal_Configfileparser'; + $this->resource = $resource; + $this->type = $type; + $this->name = $name; + $this->smarty = $smarty; + } + + /** + * initialize Source Object for given resource + * Either [$_template] or [$smarty, $template_resource] must be specified + * + * @param Smarty_Internal_Template $_template template object + * @param Smarty $smarty smarty object + * @param string $template_resource resource identifier + * + * @return Smarty_Template_Config Source Object + * @throws SmartyException + */ + public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null, $template_resource = null) + { + static $_incompatible_resources = array('extends' => true, 'php' => true); + $template_resource = $_template->template_resource; + if (empty($template_resource)) { + throw new SmartyException('Missing config name'); + } + // parse resource_name, load resource handler + list($name, $type) = Smarty_Resource::parseResourceName($template_resource, $_template->smarty->default_config_type); + // make sure configs are not loaded via anything smarty can't handle + if (isset($_incompatible_resources[$type])) { + throw new SmartyException ("Unable to use resource '{$type}' for config"); + } + $resource = Smarty_Resource::load($_template->smarty, $type); + $source = new Smarty_Template_Config($resource, $_template->smarty, $template_resource, $type, $name); + $resource->populate($source, $_template); + if (!$source->exists && isset($_template->smarty->default_config_handler_func)) { + Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source); + } + $source->unique_resource = $resource->buildUniqueResourceName($_template->smarty, $name, true); + return $source; + } +} diff --git a/lib/smarty/libs/sysplugins/smarty_template_resource_base.php b/lib/smarty/libs/sysplugins/smarty_template_resource_base.php new file mode 100755 index 0000000..0911feb --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_template_resource_base.php @@ -0,0 +1,155 @@ +unifunc; + $level = ob_get_level(); + try { + if (empty($unifunc) || !is_callable($unifunc)) { + throw new SmartyException("Invalid compiled template for '{$_template->template_resource}'"); + } + if (isset($_template->smarty->security_policy)) { + $_template->smarty->security_policy->startTemplate($_template); + } + // + // render compiled or saved template code + // + if (!isset($_template->_cache['capture_stack'])) { + $_template->_cache['capture_stack'] = array(); + } + $_saved_capture_level = count($_template->_cache['capture_stack']); + $unifunc($_template); + // any unclosed {capture} tags ? + if ($_saved_capture_level != count($_template->_cache['capture_stack'])) { + $_template->capture_error(); + } + if (isset($_template->smarty->security_policy)) { + $_template->smarty->security_policy->exitTemplate(); + } + return null; + } + catch (Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + if (isset($_template->smarty->security_policy)) { + $_template->smarty->security_policy->exitTemplate(); + } + throw $e; + } + } + + /** + * Get compiled time stamp + * + * @return int + */ + public function getTimeStamp() + { + if ($this->exists && !isset($this->timestamp)) { + $this->timestamp = @filemtime($this->filepath); + } + return $this->timestamp; + } +} diff --git a/lib/smarty/libs/sysplugins/smarty_template_source.php b/lib/smarty/libs/sysplugins/smarty_template_source.php new file mode 100755 index 0000000..be5b628 --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_template_source.php @@ -0,0 +1,267 @@ +handler = $handler; // Note: prone to circular references + $this->smarty = $smarty; + $this->resource = $resource; + $this->type = $type; + $this->name = $name; + } + + /** + * initialize Source Object for given resource + * Either [$_template] or [$smarty, $template_resource] must be specified + * + * @param Smarty_Internal_Template $_template template object + * @param Smarty $smarty smarty object + * @param string $template_resource resource identifier + * + * @return Smarty_Template_Source Source Object + * @throws SmartyException + */ + public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null, + $template_resource = null) + { + if ($_template) { + $smarty = $_template->smarty; + $template_resource = $_template->template_resource; + } + if (empty($template_resource)) { + throw new SmartyException('Missing template name'); + } + // parse resource_name, load resource handler, identify unique resource name + if (preg_match('/^([A-Za-z0-9_\-]{2,})[:]([\s\S]*)$/', $template_resource, $match)) { + $type = $match[1]; + $name = $match[2]; + } else { + // no resource given, use default + // or single character before the colon is not a resource type, but part of the filepath + $type = $smarty->default_resource_type; + $name = $template_resource; + } + + $handler = isset($smarty->_cache['resource_handlers'][$type]) ? + $smarty->_cache['resource_handlers'][$type] : + Smarty_Resource::load($smarty, $type); + // if resource is not recompiling and resource name is not dotted we can check the source cache + if (($smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) && !$handler->recompiled && + !(isset($name[1]) && $name[0] == '.' && ($name[1] == '.' || $name[1] == '/')) + ) { + $unique_resource = $handler->buildUniqueResourceName($smarty, $name); + if (isset($smarty->_cache['source_objects'][$unique_resource])) { + return $smarty->_cache['source_objects'][$unique_resource]; + } + } else { + $unique_resource = null; + } + // create new source object + $source = new Smarty_Template_Source($handler, $smarty, $template_resource, $type, $name); + $handler->populate($source, $_template); + if (!$source->exists && isset($_template->smarty->default_template_handler_func)) { + Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source); + } + // on recompiling resources we are done + if (($smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) && !$handler->recompiled) { + // may by we have already $unique_resource + $is_relative = false; + if (!isset($unique_resource)) { + $is_relative = isset($name[1]) && $name[0] == '.' && ($name[1] == '.' || $name[1] == '/') && + ($type == 'file' || + (isset($_template->parent->source) && $_template->parent->source->type == 'extends')); + $unique_resource = + $handler->buildUniqueResourceName($smarty, $is_relative ? $source->filepath . $name : $name); + } + $source->unique_resource = $unique_resource; + // save in runtime cache if not relative + if (!$is_relative) { + $smarty->_cache['source_objects'][$unique_resource] = $source; + } + } + return $source; + } + + /** + * render the uncompiled source + * + * @param Smarty_Internal_Template $_template template object + * + * @return string + * @throws \Exception + */ + public function renderUncompiled(Smarty_Internal_Template $_template) + { + $this->handler->renderUncompiled($_template->source, $_template); + } + + /** + * Render uncompiled source + * + * @param \Smarty_Internal_Template $_template + */ + public function render(Smarty_Internal_Template $_template) + { + if ($_template->source->handler->uncompiled) { + if ($_template->smarty->debugging) { + $_template->smarty->_debug->start_render($_template); + } + $this->handler->renderUncompiled($_template->source, $_template); + if (isset($_template->parent) && $_template->parent->_objType == 2 && !empty($_template->tpl_function)) { + $_template->parent->tpl_function = + array_merge($_template->parent->tpl_function, $_template->tpl_function); + } + if ($_template->smarty->debugging) { + $_template->smarty->_debug->end_render($_template); + } + } + } + + /** + * Get source time stamp + * + * @return int + */ + public function getTimeStamp() + { + if (!isset($this->timestamp)) { + $this->handler->populateTimestamp($this); + } + return $this->timestamp; + } + + /** + * Get source content + * + * @return string + */ + public function getContent() + { + return isset($this->content) ? $this->content : $this->handler->getContent($this); + } +} diff --git a/lib/smarty/libs/sysplugins/smarty_undefined_variable.php b/lib/smarty/libs/sysplugins/smarty_undefined_variable.php new file mode 100755 index 0000000..88bc6f6 --- /dev/null +++ b/lib/smarty/libs/sysplugins/smarty_undefined_variable.php @@ -0,0 +1,37 @@ +value = $value; + $this->nocache = $nocache; + } + + /** + * <> String conversion + * + * @return string + */ + public function __toString() + { + return (string) $this->value; + } +} + diff --git a/lib/smarty/libs/sysplugins/smartycompilerexception.php b/lib/smarty/libs/sysplugins/smartycompilerexception.php new file mode 100755 index 0000000..4d5d778 --- /dev/null +++ b/lib/smarty/libs/sysplugins/smartycompilerexception.php @@ -0,0 +1,39 @@ + Smarty Compiler: ' . $this->message . ' <-- '; + } + + /** + * The line number of the template error + * + * @type int|null + */ + public $line = null; + /** + * The template source snippet relating to the error + * + * @type string|null + */ + public $source = null; + /** + * The raw text of the error message + * + * @type string|null + */ + public $desc = null; + /** + * The resource identifier or template name + * + * @type string|null + */ + public $template = null; +} diff --git a/lib/smarty/libs/sysplugins/smartyexception.php b/lib/smarty/libs/sysplugins/smartyexception.php new file mode 100755 index 0000000..3da16c2 --- /dev/null +++ b/lib/smarty/libs/sysplugins/smartyexception.php @@ -0,0 +1,15 @@ + Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- '; + } +} diff --git a/lib/smarty2/BUGS b/lib/smarty2/BUGS new file mode 100755 index 0000000..fcbe48a --- /dev/null +++ b/lib/smarty2/BUGS @@ -0,0 +1,7 @@ +Smarty is supported only in PHP 4.0.6 or later. + +Smarty versions previous to 2.0 require the PEAR libraries. Be sure to include +the path to the PEAR libraries in your php include_path. Config_file.class.php +uses the PEAR library for its error handling routines. PEAR comes with the PHP +distribution. Unix users check /usr/local/lib/php, windows users check +C:/php/pear. diff --git a/lib/smarty2/COPYING.lib b/lib/smarty2/COPYING.lib new file mode 100755 index 0000000..3b20440 --- /dev/null +++ b/lib/smarty2/COPYING.lib @@ -0,0 +1,458 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/lib/smarty2/ChangeLog b/lib/smarty2/ChangeLog new file mode 100755 index 0000000..bb394d1 --- /dev/null +++ b/lib/smarty2/ChangeLog @@ -0,0 +1,9197 @@ +2013-09-30 + + * Fixed old vulnerability bug https://bugs.gentoo.org/show_bug.cgi?id=356615 + +2013-07-16 Uwe Tews + + * Fixed made Smarty_Compiler.class.php compatible with PHP 5.5 + + +2012-09-24 Uwe Tews + + * Fixed escape Smarty error messages to avoid possible script execution + + +2010-04-17 Uwe Tews + + * Fixed security hole in {math} plugin + +2007-09-27 TAKAGI Masahiro + + * docs/ja/designers/language-custom-functions/language-function-html-checkboxes.xml: + sync with en. + +2007-09-27 Monte Ohrt + + * docs/en/designers/language-custom-functions/language-function-html-checkboxes.xml: + remove redundant attribute + +2007-09-18 Messju Mohr + + * docs/id/programmers/plugins/plugins-functions.xml: + removed errornous whitespace + +2007-09-18 Zaenal Mutaqin + + * docs/id/designers/language-basic-syntax/language-escaping.xml + docs/id/designers/language-basic-syntax/language-math.xml + docs/id/designers/language-basic-syntax/language-syntax-attributes.xml + docs/id/designers/language-basic-syntax/language-syntax-comments.xml + docs/id/designers/language-basic-syntax/language-syntax-functions.xml + docs/id/designers/language-basic-syntax/language-syntax-quotes.xml + docs/id/designers/language-basic-syntax/language-syntax-variables.xml + docs/id/designers/language-builtin-functions/language-function-capture.xml + docs/id/designers/language-builtin-functions/language-function-config-load.xml + docs/id/designers/language-builtin-functions/language-function-foreach.xml + docs/id/designers/language-builtin-functions/language-function-if.xml + docs/id/designers/language-builtin-functions/language-function-include-php.xml + docs/id/designers/language-builtin-functions/language-function-include.xml + docs/id/designers/language-builtin-functions/language-function-insert.xml + docs/id/designers/language-builtin-functions/language-function-ldelim.xml + docs/id/designers/language-builtin-functions/language-function-literal.xml + docs/id/designers/language-builtin-functions/language-function-php.xml + docs/id/designers/language-builtin-functions/language-function-section.xml + docs/id/designers/language-builtin-functions/language-function-strip.xml + docs/id/designers/language-custom-functions/language-function-assign.xml + docs/id/designers/language-custom-functions/language-function-counter.xml + docs/id/designers/language-custom-functions/language-function-cycle.xml + docs/id/designers/language-custom-functions/language-function-debug.xml + docs/id/designers/language-custom-functions/language-function-eval.xml + docs/id/designers/language-custom-functions/language-function-fetch.xml + docs/id/designers/language-custom-functions/language-function-html-checkboxes.xml + docs/id/designers/language-custom-functions/language-function-html-image.xml + docs/id/designers/language-custom-functions/language-function-html-options.xml + docs/id/designers/language-custom-functions/language-function-html-radios.xml + docs/id/designers/language-custom-functions/language-function-html-select-date.xml + docs/id/designers/language-custom-functions/language-function-html-select-time.xml + docs/id/designers/language-custom-functions/language-function-html-table.xml + docs/id/designers/language-custom-functions/language-function-mailto.xml + docs/id/designers/language-custom-functions/language-function-math.xml + docs/id/designers/language-custom-functions/language-function-popup-init.xml + docs/id/designers/language-custom-functions/language-function-popup.xml + docs/id/designers/language-custom-functions/language-function-textformat.xml + docs/id/designers/language-modifiers/language-modifier-capitalize.xml + docs/id/designers/language-modifiers/language-modifier-cat.xml + docs/id/designers/language-modifiers/language-modifier-count-characters.xml + docs/id/designers/language-modifiers/language-modifier-count-paragraphs.xml + docs/id/designers/language-modifiers/language-modifier-count-sentences.xml + docs/id/designers/language-modifiers/language-modifier-count-words.xml + docs/id/designers/language-modifiers/language-modifier-date-format.xml + docs/id/designers/language-modifiers/language-modifier-default.xml + docs/id/designers/language-modifiers/language-modifier-escape.xml + docs/id/designers/language-modifiers/language-modifier-indent.xml + docs/id/designers/language-modifiers/language-modifier-lower.xml + docs/id/designers/language-modifiers/language-modifier-nl2br.xml + docs/id/designers/language-modifiers/language-modifier-regex-replace.xml + docs/id/designers/language-modifiers/language-modifier-replace.xml + docs/id/designers/language-modifiers/language-modifier-spacify.xml + docs/id/designers/language-modifiers/language-modifier-string-format.xml + docs/id/designers/language-modifiers/language-modifier-strip-tags.xml + docs/id/designers/language-modifiers/language-modifier-strip.xml + docs/id/designers/language-modifiers/language-modifier-truncate.xml + docs/id/designers/language-modifiers/language-modifier-upper.xml + docs/id/designers/language-modifiers/language-modifier-wordwrap.xml + docs/id/designers/language-variables/language-assigned-variables.xml + docs/id/designers/language-variables/language-config-variables.xml + docs/id/designers/language-variables/language-variables-smarty.xml + docs/id/programmers/advanced-features/advanced-features-objects.xml + docs/id/programmers/advanced-features/advanced-features-outputfilters.xml + docs/id/programmers/advanced-features/advanced-features-postfilters.xml + docs/id/programmers/advanced-features/advanced-features-prefilters.xml + docs/id/programmers/advanced-features/section-template-cache-handler-func.xml + docs/id/programmers/advanced-features/template-resources.xml + docs/id/programmers/api-functions/api-append-by-ref.xml + docs/id/programmers/api-functions/api-append.xml + docs/id/programmers/api-functions/api-assign-by-ref.xml + docs/id/programmers/api-functions/api-assign.xml + docs/id/programmers/api-functions/api-clear-all-assign.xml + docs/id/programmers/api-functions/api-clear-all-cache.xml + docs/id/programmers/api-functions/api-clear-assign.xml + docs/id/programmers/api-functions/api-clear-cache.xml + docs/id/programmers/api-functions/api-clear-compiled-tpl.xml + docs/id/programmers/api-functions/api-clear-config.xml + docs/id/programmers/api-functions/api-config-load.xml + docs/id/programmers/api-functions/api-display.xml + docs/id/programmers/api-functions/api-fetch.xml + docs/id/programmers/api-functions/api-get-config-vars.xml + docs/id/programmers/api-functions/api-get-registered-object.xml + docs/id/programmers/api-functions/api-get-template-vars.xml + docs/id/programmers/api-functions/api-is-cached.xml + docs/id/programmers/api-functions/api-load-filter.xml + docs/id/programmers/api-functions/api-register-block.xml + docs/id/programmers/api-functions/api-register-compiler-function.xml + docs/id/programmers/api-functions/api-register-function.xml + docs/id/programmers/api-functions/api-register-modifier.xml + docs/id/programmers/api-functions/api-register-object.xml + docs/id/programmers/api-functions/api-register-outputfilter.xml + docs/id/programmers/api-functions/api-register-postfilter.xml + docs/id/programmers/api-functions/api-register-prefilter.xml + docs/id/programmers/api-functions/api-register-resource.xml + docs/id/programmers/api-functions/api-template-exists.xml + docs/id/programmers/api-functions/api-trigger-error.xml + docs/id/programmers/api-functions/api-unregister-block.xml + docs/id/programmers/api-functions/api-unregister-compiler-function.xml + docs/id/programmers/api-functions/api-unregister-function.xml + docs/id/programmers/api-functions/api-unregister-modifier.xml + docs/id/programmers/api-functions/api-unregister-object.xml + docs/id/programmers/api-functions/api-unregister-outputfilter.xml + docs/id/programmers/api-functions/api-unregister-postfilter.xml + docs/id/programmers/api-functions/api-unregister-prefilter.xml + docs/id/programmers/api-functions/api-unregister-resource.xml + docs/id/programmers/api-variables/variable-autoload-filters.xml + docs/id/programmers/api-variables/variable-cache-dir.xml + docs/id/programmers/api-variables/variable-cache-handler-func.xml + docs/id/programmers/api-variables/variable-cache-lifetime.xml + docs/id/programmers/api-variables/variable-cache-modified-check.xml + docs/id/programmers/api-variables/variable-caching.xml + docs/id/programmers/api-variables/variable-compile-check.xml + docs/id/programmers/api-variables/variable-compile-dir.xml + docs/id/programmers/api-variables/variable-compile-id.xml + docs/id/programmers/api-variables/variable-compiler-class.xml + docs/id/programmers/api-variables/variable-config-booleanize.xml + docs/id/programmers/api-variables/variable-config-dir.xml + docs/id/programmers/api-variables/variable-config-fix-newlines.xml + docs/id/programmers/api-variables/variable-config-overwrite.xml + docs/id/programmers/api-variables/variable-config-read-hidden.xml + docs/id/programmers/api-variables/variable-debug-tpl.xml + docs/id/programmers/api-variables/variable-debugging-ctrl.xml + docs/id/programmers/api-variables/variable-debugging.xml + docs/id/programmers/api-variables/variable-default-modifiers.xml + docs/id/programmers/api-variables/variable-default-resource-type.xml + docs/id/programmers/api-variables/variable-default-template-handler-func.xml + docs/id/programmers/api-variables/variable-error-reporting.xml + docs/id/programmers/api-variables/variable-force-compile.xml + docs/id/programmers/api-variables/variable-left-delimiter.xml + docs/id/programmers/api-variables/variable-php-handling.xml + docs/id/programmers/api-variables/variable-plugins-dir.xml + docs/id/programmers/api-variables/variable-request-use-auto-globals.xml + docs/id/programmers/api-variables/variable-request-vars-order.xml + docs/id/programmers/api-variables/variable-right-delimiter.xml + docs/id/programmers/api-variables/variable-secure-dir.xml + docs/id/programmers/api-variables/variable-security-settings.xml + docs/id/programmers/api-variables/variable-security.xml + docs/id/programmers/api-variables/variable-template-dir.xml + docs/id/programmers/api-variables/variable-trusted-dir.xml + docs/id/programmers/api-variables/variable-use-sub-dirs.xml + docs/id/programmers/caching/caching-cacheable.xml + docs/id/programmers/caching/caching-groups.xml + docs/id/programmers/caching/caching-multiple-caches.xml + docs/id/programmers/caching/caching-setting-up.xml + docs/id/programmers/plugins/plugins-block-functions.xml + docs/id/programmers/plugins/plugins-compiler-functions.xml + docs/id/programmers/plugins/plugins-functions.xml + docs/id/programmers/plugins/plugins-howto.xml + docs/id/programmers/plugins/plugins-inserts.xml + docs/id/programmers/plugins/plugins-modifiers.xml + docs/id/programmers/plugins/plugins-naming-conventions.xml + docs/id/programmers/plugins/plugins-outputfilters.xml + docs/id/programmers/plugins/plugins-prefilters-postfilters.xml + docs/id/programmers/plugins/plugins-resources.xml + docs/id/programmers/plugins/plugins-writing.xml: + Typos correction and all translated now. + +2007-09-17 Messju Mohr + + * docs/id/bookinfo.xml + docs/id/getting-started.xml + docs/id/language-defs.ent + docs/id/language-snippets.ent + docs/id/livedocs.ent + docs/id/preface.xml: + added indonesian docs - thanks Zaenal Mutaqin + + * docs/scripts/generate_web.php: + raise pcre.backtrack_limit - thanks to takagi + +2007-09-16 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + fix typo + +2007-08-22 George Miroshnikov + + * docs/ru/getting-started.xml + docs/ru/getting-started.xml: + Sync with EN. + +2007-08-01 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + add append feature to capture + +2007-06-24 TAKAGI Masahiro + + * docs/ja/getting-started.xml: + sync with en. + +2007-06-24 Messju Mohr + + * docs/Makefile.in: + reverted accidently modified file + + * docs/Makefile.in + docs/de/getting-started.xml: + sync with en + + * docs/en/getting-started.xml: + fixed link to ini_set(). thanks to Lee Yunyoung. + +2007-06-18 TAKAGI Masahiro + + * docs/ja/language-snippets.ent + docs/ja/programmers/api-functions/api-register-outputfilter.xml + docs/ja/programmers/api-functions/api-register-postfilter.xml + docs/ja/programmers/api-functions/api-register-prefilter.xml: + sync with en. + +2007-06-18 Danilo Buerger + + * docs/en/language-snippets.ent + docs/en/programmers/api-functions/api-register-outputfilter.xml + docs/en/programmers/api-functions/api-register-postfilter.xml + docs/en/programmers/api-functions/api-register-prefilter.xml: + Updated docs according to the changes from the previous commit + + * NEWS + libs/Smarty.class.php: + Added the ability to (un)register multiple filters of the same type with + the same method name but different class name. Before it was not possible + due to the fact that only the method name was used to distinguish between + different filters of the same type. This does however not allow (same as + before) to register multiple filters of the same type with the same method + and class name (i.e. different instances of the same class). + +2007-05-29 Messju Mohr + + * libs/plugins/compiler.assign.php: + fixed typo + +2007-05-11 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed calling registered objects' methods with an empty argument list. + thanks marcello + +2007-05-03 TAKAGI Masahiro + + * docs/ja/designers/language-variables.xml + docs/ja/designers/language-builtin-functions/language-function-config-load.xml + docs/ja/designers/language-builtin-functions/language-function-foreach.xml + docs/ja/designers/language-builtin-functions/language-function-if.xml + docs/ja/designers/language-modifiers/language-modifier-cat.xml + docs/ja/designers/language-modifiers/language-modifier-wordwrap.xml + docs/ja/designers/language-variables/language-variables-smarty.xml: + sync with en. + +2007-05-03 Monte Ohrt + + * docs/en/designers/language-variables.xml + docs/en/designers/language-builtin-functions/language-function-config-load.xml + docs/en/designers/language-builtin-functions/language-function-foreach.xml + docs/en/designers/language-builtin-functions/language-function-if.xml + docs/en/designers/language-modifiers/language-modifier-cat.xml + docs/en/designers/language-modifiers/language-modifier-wordwrap.xml + docs/en/designers/language-variables/language-variables-smarty.xml: + update documentation corrections from marcello in the forums. Thanks + marcello! + +2007-04-22 TAKAGI Masahiro + + * docs/ja/programmers/advanced-features.xml + docs/ja/programmers/api-functions.xml + docs/ja/programmers/api-variables.xml: + corrected the garbled text. + +2007-04-21 TAKAGI Masahiro + + * docs/ja/bookinfo.xml + docs/ja/getting-started.xml + docs/ja/language-defs.ent + docs/ja/language-snippets.ent + docs/ja/livedocs.ent + docs/ja/make_chm_index.html + docs/ja/preface.xml + docs/ja/translation.xml + docs/ja/appendixes/bugs.xml + docs/ja/appendixes/resources.xml + docs/ja/appendixes/tips.xml + docs/ja/appendixes/troubleshooting.xml + docs/ja/designers/chapter-debugging-console.xml + docs/ja/designers/config-files.xml + docs/ja/designers/language-basic-syntax.xml + docs/ja/designers/language-builtin-functions.xml + docs/ja/designers/language-combining-modifiers.xml + docs/ja/designers/language-custom-functions.xml + docs/ja/designers/language-modifiers.xml + docs/ja/designers/language-variables.xml + docs/ja/designers/language-basic-syntax/language-escaping.xml + docs/ja/designers/language-basic-syntax/language-math.xml + docs/ja/designers/language-basic-syntax/language-syntax-attributes.xml + docs/ja/designers/language-basic-syntax/language-syntax-comments.xml + docs/ja/designers/language-basic-syntax/language-syntax-functions.xml + docs/ja/designers/language-basic-syntax/language-syntax-quotes.xml + docs/ja/designers/language-basic-syntax/language-syntax-variables.xml + docs/ja/designers/language-builtin-functions/language-function-capture.xml + docs/ja/designers/language-builtin-functions/language-function-config-load.xml + docs/ja/designers/language-builtin-functions/language-function-foreach.xml + docs/ja/designers/language-builtin-functions/language-function-if.xml + docs/ja/designers/language-builtin-functions/language-function-include-php.xml + docs/ja/designers/language-builtin-functions/language-function-include.xml + docs/ja/designers/language-builtin-functions/language-function-insert.xml + docs/ja/designers/language-builtin-functions/language-function-ldelim.xml + docs/ja/designers/language-builtin-functions/language-function-literal.xml + docs/ja/designers/language-builtin-functions/language-function-php.xml + docs/ja/designers/language-builtin-functions/language-function-section.xml + docs/ja/designers/language-builtin-functions/language-function-strip.xml + docs/ja/designers/language-custom-functions/language-function-assign.xml + docs/ja/designers/language-custom-functions/language-function-counter.xml + docs/ja/designers/language-custom-functions/language-function-cycle.xml + docs/ja/designers/language-custom-functions/language-function-debug.xml + docs/ja/designers/language-custom-functions/language-function-eval.xml + docs/ja/designers/language-custom-functions/language-function-fetch.xml + docs/ja/designers/language-custom-functions/language-function-html-checkboxes.xml + docs/ja/designers/language-custom-functions/language-function-html-image.xml + docs/ja/designers/language-custom-functions/language-function-html-options.xml + docs/ja/designers/language-custom-functions/language-function-html-radios.xml + docs/ja/designers/language-custom-functions/language-function-html-select-date.xml + docs/ja/designers/language-custom-functions/language-function-html-select-time.xml + docs/ja/designers/language-custom-functions/language-function-html-table.xml + docs/ja/designers/language-custom-functions/language-function-mailto.xml + docs/ja/designers/language-custom-functions/language-function-math.xml + docs/ja/designers/language-custom-functions/language-function-popup-init.xml + docs/ja/designers/language-custom-functions/language-function-popup.xml + docs/ja/designers/language-custom-functions/language-function-textformat.xml + docs/ja/designers/language-modifiers/language-modifier-capitalize.xml + docs/ja/designers/language-modifiers/language-modifier-cat.xml + docs/ja/designers/language-modifiers/language-modifier-count-characters.xml + docs/ja/designers/language-modifiers/language-modifier-count-paragraphs.xml + docs/ja/designers/language-modifiers/language-modifier-count-sentences.xml + docs/ja/designers/language-modifiers/language-modifier-count-words.xml + docs/ja/designers/language-modifiers/language-modifier-date-format.xml + docs/ja/designers/language-modifiers/language-modifier-default.xml + docs/ja/designers/language-modifiers/language-modifier-escape.xml + docs/ja/designers/language-modifiers/language-modifier-indent.xml + docs/ja/designers/language-modifiers/language-modifier-lower.xml + docs/ja/designers/language-modifiers/language-modifier-nl2br.xml + docs/ja/designers/language-modifiers/language-modifier-regex-replace.xml + docs/ja/designers/language-modifiers/language-modifier-replace.xml + docs/ja/designers/language-modifiers/language-modifier-spacify.xml + docs/ja/designers/language-modifiers/language-modifier-string-format.xml + docs/ja/designers/language-modifiers/language-modifier-strip-tags.xml + docs/ja/designers/language-modifiers/language-modifier-strip.xml + docs/ja/designers/language-modifiers/language-modifier-truncate.xml + docs/ja/designers/language-modifiers/language-modifier-upper.xml + docs/ja/designers/language-modifiers/language-modifier-wordwrap.xml + docs/ja/designers/language-variables/language-assigned-variables.xml + docs/ja/designers/language-variables/language-config-variables.xml + docs/ja/designers/language-variables/language-variables-smarty.xml + docs/ja/programmers/advanced-features.xml + docs/ja/programmers/api-functions.xml + docs/ja/programmers/api-variables.xml + docs/ja/programmers/caching.xml + docs/ja/programmers/plugins.xml + docs/ja/programmers/smarty-constants.xml + docs/ja/programmers/advanced-features/advanced-features-objects.xml + docs/ja/programmers/advanced-features/advanced-features-outputfilters.xml + docs/ja/programmers/advanced-features/advanced-features-postfilters.xml + docs/ja/programmers/advanced-features/advanced-features-prefilters.xml + docs/ja/programmers/advanced-features/section-template-cache-handler-func.xml + docs/ja/programmers/advanced-features/template-resources.xml + docs/ja/programmers/api-functions/api-append-by-ref.xml + docs/ja/programmers/api-functions/api-append.xml + docs/ja/programmers/api-functions/api-assign-by-ref.xml + docs/ja/programmers/api-functions/api-assign.xml + docs/ja/programmers/api-functions/api-clear-all-assign.xml + docs/ja/programmers/api-functions/api-clear-all-cache.xml + docs/ja/programmers/api-functions/api-clear-assign.xml + docs/ja/programmers/api-functions/api-clear-cache.xml + docs/ja/programmers/api-functions/api-clear-compiled-tpl.xml + docs/ja/programmers/api-functions/api-clear-config.xml + docs/ja/programmers/api-functions/api-config-load.xml + docs/ja/programmers/api-functions/api-display.xml + docs/ja/programmers/api-functions/api-fetch.xml + docs/ja/programmers/api-functions/api-get-config-vars.xml + docs/ja/programmers/api-functions/api-get-registered-object.xml + docs/ja/programmers/api-functions/api-get-template-vars.xml + docs/ja/programmers/api-functions/api-is-cached.xml + docs/ja/programmers/api-functions/api-load-filter.xml + docs/ja/programmers/api-functions/api-register-block.xml + docs/ja/programmers/api-functions/api-register-compiler-function.xml + docs/ja/programmers/api-functions/api-register-function.xml + docs/ja/programmers/api-functions/api-register-modifier.xml + docs/ja/programmers/api-functions/api-register-object.xml + docs/ja/programmers/api-functions/api-register-outputfilter.xml + docs/ja/programmers/api-functions/api-register-postfilter.xml + docs/ja/programmers/api-functions/api-register-prefilter.xml + docs/ja/programmers/api-functions/api-register-resource.xml + docs/ja/programmers/api-functions/api-template-exists.xml + docs/ja/programmers/api-functions/api-trigger-error.xml + docs/ja/programmers/api-functions/api-unregister-block.xml + docs/ja/programmers/api-functions/api-unregister-compiler-function.xml + docs/ja/programmers/api-functions/api-unregister-function.xml + docs/ja/programmers/api-functions/api-unregister-modifier.xml + docs/ja/programmers/api-functions/api-unregister-object.xml + docs/ja/programmers/api-functions/api-unregister-outputfilter.xml + docs/ja/programmers/api-functions/api-unregister-postfilter.xml + docs/ja/programmers/api-functions/api-unregister-prefilter.xml + docs/ja/programmers/api-functions/api-unregister-resource.xml + docs/ja/programmers/api-variables/variable-autoload-filters.xml + docs/ja/programmers/api-variables/variable-cache-dir.xml + docs/ja/programmers/api-variables/variable-cache-handler-func.xml + docs/ja/programmers/api-variables/variable-cache-lifetime.xml + docs/ja/programmers/api-variables/variable-cache-modified-check.xml + docs/ja/programmers/api-variables/variable-caching.xml + docs/ja/programmers/api-variables/variable-compile-check.xml + docs/ja/programmers/api-variables/variable-compile-dir.xml + docs/ja/programmers/api-variables/variable-compile-id.xml + docs/ja/programmers/api-variables/variable-compiler-class.xml + docs/ja/programmers/api-variables/variable-config-booleanize.xml + docs/ja/programmers/api-variables/variable-config-dir.xml + docs/ja/programmers/api-variables/variable-config-fix-newlines.xml + docs/ja/programmers/api-variables/variable-config-overwrite.xml + docs/ja/programmers/api-variables/variable-config-read-hidden.xml + docs/ja/programmers/api-variables/variable-debug-tpl.xml + docs/ja/programmers/api-variables/variable-debugging-ctrl.xml + docs/ja/programmers/api-variables/variable-debugging.xml + docs/ja/programmers/api-variables/variable-default-modifiers.xml + docs/ja/programmers/api-variables/variable-default-resource-type.xml + docs/ja/programmers/api-variables/variable-default-template-handler-func.xml + docs/ja/programmers/api-variables/variable-error-reporting.xml + docs/ja/programmers/api-variables/variable-force-compile.xml + docs/ja/programmers/api-variables/variable-left-delimiter.xml + docs/ja/programmers/api-variables/variable-php-handling.xml + docs/ja/programmers/api-variables/variable-plugins-dir.xml + docs/ja/programmers/api-variables/variable-request-use-auto-globals.xml + docs/ja/programmers/api-variables/variable-request-vars-order.xml + docs/ja/programmers/api-variables/variable-right-delimiter.xml + docs/ja/programmers/api-variables/variable-secure-dir.xml + docs/ja/programmers/api-variables/variable-security-settings.xml + docs/ja/programmers/api-variables/variable-security.xml + docs/ja/programmers/api-variables/variable-template-dir.xml + docs/ja/programmers/api-variables/variable-trusted-dir.xml + docs/ja/programmers/api-variables/variable-use-sub-dirs.xml + docs/ja/programmers/caching/caching-cacheable.xml + docs/ja/programmers/caching/caching-groups.xml + docs/ja/programmers/caching/caching-multiple-caches.xml + docs/ja/programmers/caching/caching-setting-up.xml + docs/ja/programmers/plugins/plugins-block-functions.xml + docs/ja/programmers/plugins/plugins-compiler-functions.xml + docs/ja/programmers/plugins/plugins-functions.xml + docs/ja/programmers/plugins/plugins-howto.xml + docs/ja/programmers/plugins/plugins-inserts.xml + docs/ja/programmers/plugins/plugins-modifiers.xml + docs/ja/programmers/plugins/plugins-naming-conventions.xml + docs/ja/programmers/plugins/plugins-outputfilters.xml + docs/ja/programmers/plugins/plugins-prefilters-postfilters.xml + docs/ja/programmers/plugins/plugins-resources.xml + docs/ja/programmers/plugins/plugins-writing.xml: + added Japanese translation files. + + * docs/Makefile.in + docs/configure.in: + added the configuration for Japanese translation. + +2007-04-11 Messju Mohr + + * docs/en/programmers/smarty-constants.xml: + fixed typo + +2007-04-04 Messju Mohr + + * docs/ru/getting-started.xml: + fixed uri for Zend Accelerator + +2007-04-03 Messju Mohr + + * docs/de/getting-started.xml + docs/es/getting-started.xml + docs/it/getting-started.xml + docs/pt_BR/getting-started.xml: + fixed uris for php-accelerator + +2007-03-08 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + +2007-03-07 Monte Ohrt + + * (Smarty_2_6_18) + NEWS: + update NEWS file with patch + + * (Smarty_2_6_18) + docs/en/designers/language-builtin-functions/language-function-section.xml: + note the fact that section loop will accept an integer + +2007-03-06 Monte Ohrt + + * NEWS + libs/plugins/function.html_select_date.php: + fix html_select_date separator when parts are missing (thanks to kayk for + the patch) + +2007-03-06 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + bumped version number + + * NEWS: + added release headline + + * libs/internals/core.write_compiled_include.php: + fixed detection of non-cached block when writing compiled includes + +2007-03-01 Danilo Buerger + + * NEWS + libs/Smarty_Compiler.class.php: + Applied boots clean up patch and removed commented out code. + Updated NEWS file + +2007-02-27 Danilo Buerger + + * NEWS + docs/en/designers/language-modifiers/language-modifier-date-format.xml + libs/internals/core.write_file.php + libs/plugins/modifier.date_format.php: + Updated smarty_core_write_file() and smarty_modifier_date_format() to speed + up Windows detection. + Emulated more parameters for Windows in smarty_modifier_date_format() and + fixed some old ones. + Updated the docs to tell what parameters are emulated on Windows. + Updated NEWS file. + + * NEWS: + Updated NEWS file to reflect changes commited in the last revision + +2007-02-27 Monte Ohrt + + * docs/en/appendixes/troubleshooting.xml: + fix typo + +2007-02-27 Danilo Buerger + + * libs/Smarty_Compiler.class.php: + Modified _(push|pop)_cacheable_state() to embedd alternate syntax. See this + bug report: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=10502 + +2007-02-26 Peter 'Mash' Morgan + + * docs/en/designers/language-custom-functions/language-function-html-options.xml: + Fix incorrect var name + +2007-02-23 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + escape creating of language=php from interleaving + + * libs/Smarty_Compiler.class.php: + add removed line back in + + * libs/Smarty_Compiler.class.php: + fix up last patch, remove unnecessary lines + + * libs/Smarty_Compiler.class.php: + fix situation when no compiled tags are present + + * libs/Smarty_Compiler.class.php: + fix problem with php open tags generated from tag interleaving + +2007-02-06 boots + + * docs/en/programmers/advanced-features/template-resources.xml: + Correct default template handler function example. + +2007-01-17 Messju Mohr + + * NEWS + libs/plugins/modifier.truncate.php: + fixed handling of $etc in the truncate modifier when $etc is longer + than $length. + + thanks to Sylvinus! + +2007-01-10 boots + + * NEWS + libs/plugins/modifier.date_format.php + libs/plugins/modifier.date_format.php: + fix handling of %I with mysql timestamps + + Thanks to Danilo Buerger + + * NEWS + libs/internals/core.write_file.php: + Better recognize Windows filesystems to reduce warnings + + * NEWS + libs/plugins/modifier.date_format.php: + Emulate %R in the date_format modifier on Windows + + Thanks to Danilo Buerger + +2006-12-10 Yannick Torres + + * docs/fr/getting-started.xml: + fix build + + * docs/fr/language-snippets.ent + docs/fr/designers/language-builtin-functions/language-function-include-php.xml + docs/fr/designers/language-modifiers/language-modifier-truncate.xml + docs/fr/designers/language-variables/language-variables-smarty.xml: + sync with EN + +2006-12-02 Peter 'Mash' Morgan + + * docs/en/designers/language-builtin-functions/language-function-include-php.xml: + Tidy example, speeling andd add links + + * docs/en/getting-started.xml: + Add/correct entities + + * docs/entities/global.ent: + Fix entities (strange) + +2006-12-01 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update dev version numbers + +2006-12-01 boots + + * (Smarty_2_6_16) + NEWS: + Fixed replacement bug introduced in trimwhitespaces output filter that + was introduced in the last release. + + Thanks to Spuerhund from the forums. + + * (Smarty_2_6_16) + libs/plugins/outputfilter.trimwhitespace.php: + Fixed replacement bug introduced by last changes. + + Thanks to Spuerhund from the forums. + +2006-11-30 Monte Ohrt + + * NEWS + docs/en/designers/language-modifiers/language-modifier-truncate.xml + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update dev version numbers, fix manual typo + +2006-11-22 George Miroshnikov + + * docs/ru/getting-started.xml + docs/ru/language-snippets.ent: + sync with EN + + * docs/en/getting-started.xml: + replaced hardcoded path separator with PATH_SEPARATOR constant + +2006-11-20 boots + + * libs/plugins/modifier.debug_print_var.php: + fix depth formatting of arrays and objects in modifier debug_print_var + +2006-11-10 Messju Mohr + + * docs/en/designers/language-variables/language-variables-smarty.xml: + fixed typo. thanks jonez. + +2006-11-08 boots + + * NEWS + libs/internals/core.write_file.php: + change file writing semantics in smarty_core_write_file() + + This avoids unlink() unless rename() fails or a Windows system is detected + + see: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=6956 + + Thanks to c960657 from the forums. + +2006-11-07 boots + + * NEWS + libs/debug.tpl: + update debug.tpl to xhtml 1.1 compliance, fix javascript escaping in debug + output and apply a Smarty based color scheme + + see: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=7178 + + thanks to cybot from the forums! + + * NEWS + libs/plugins/modifier.debug_print_var.php: + enhance reporting precision of debug_print_var modifier + + see: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=9281 + + thanks to cybot from the forums + +2006-11-01 boots + + * NEWS + libs/plugins/function.html_select_date.php: + make html_select_date work consistently with 0000-00-00 00:00:00 and + 0000-00-00 inputs + + Thanks to cybot from forums + +2006-10-16 George Miroshnikov + + * docs/en/language-snippets.ent: + minor typo fix - &$class doesn't make sense. + +2006-10-14 Yannick Torres + + * docs/fr/designers/language-basic-syntax.xml + docs/fr/designers/language-builtin-functions.xml + docs/fr/designers/language-basic-syntax/language-syntax-attributes.xml + docs/fr/designers/language-basic-syntax/language-syntax-comments.xml + docs/fr/designers/language-basic-syntax/language-syntax-quotes.xml + docs/fr/designers/language-builtin-functions/language-function-capture.xml + docs/fr/designers/language-builtin-functions/language-function-php.xml + docs/fr/designers/language-builtin-functions/language-function-section.xml + docs/fr/designers/language-custom-functions/language-function-popup-init.xml + docs/fr/designers/language-modifiers/language-modifier-escape.xml + docs/fr/programmers/api-functions/api-display.xml + docs/fr/programmers/plugins/plugins-inserts.xml: + sync with EN + +2006-10-14 Fernando Correa da Conceio + + * docs/pt_BR/programmers/api-variables/variable-error-reporting.xml: + New Translation + + * docs/pt_BR/designers/language-basic-syntax/language-escaping.xml + docs/pt_BR/designers/language-basic-syntax/language-syntax-variables.xml: + New Translations + + * docs/pt_BR/translation.xml: + Used in revcheck + + * docs/pt_BR/getting-started.xml + docs/pt_BR/language-snippets.ent + docs/pt_BR/make_chm_index.html + docs/pt_BR/preface.xml + docs/pt_BR/appendixes/resources.xml + docs/pt_BR/appendixes/troubleshooting.xml + docs/pt_BR/designers/language-modifiers/language-modifier-capitalize.xml + docs/pt_BR/designers/language-modifiers/language-modifier-cat.xml + docs/pt_BR/designers/language-modifiers/language-modifier-count-characters.xml + docs/pt_BR/designers/language-modifiers/language-modifier-count-paragraphs.xml + docs/pt_BR/designers/language-modifiers/language-modifier-count-sentences.xml + docs/pt_BR/designers/language-modifiers/language-modifier-count-words.xml + docs/pt_BR/designers/language-modifiers/language-modifier-date-format.xml + docs/pt_BR/designers/language-modifiers/language-modifier-default.xml + docs/pt_BR/designers/language-modifiers/language-modifier-escape.xml + docs/pt_BR/designers/language-modifiers/language-modifier-indent.xml + docs/pt_BR/designers/language-modifiers/language-modifier-lower.xml + docs/pt_BR/designers/language-modifiers/language-modifier-nl2br.xml + docs/pt_BR/designers/language-modifiers/language-modifier-regex-replace.xml + docs/pt_BR/designers/language-modifiers/language-modifier-replace.xml + docs/pt_BR/designers/language-modifiers/language-modifier-spacify.xml + docs/pt_BR/designers/language-modifiers/language-modifier-string-format.xml + docs/pt_BR/designers/language-modifiers/language-modifier-strip-tags.xml + docs/pt_BR/designers/language-modifiers/language-modifier-strip.xml + docs/pt_BR/designers/language-modifiers/language-modifier-truncate.xml + docs/pt_BR/designers/language-modifiers/language-modifier-upper.xml + docs/pt_BR/designers/language-modifiers/language-modifier-wordwrap.xml + docs/pt_BR/designers/language-variables/language-assigned-variables.xml + docs/pt_BR/designers/language-variables/language-config-variables.xml + docs/pt_BR/designers/language-variables/language-variables-smarty.xml + docs/pt_BR/programmers/advanced-features.xml + docs/pt_BR/programmers/api-functions.xml + docs/pt_BR/programmers/api-variables.xml + docs/pt_BR/programmers/caching.xml + docs/pt_BR/programmers/plugins.xml + docs/pt_BR/programmers/smarty-constants.xml + docs/pt_BR/programmers/advanced-features/advanced-features-objects.xml + docs/pt_BR/programmers/advanced-features/advanced-features-outputfilters.xml + docs/pt_BR/programmers/advanced-features/advanced-features-postfilters.xml + docs/pt_BR/programmers/advanced-features/advanced-features-prefilters.xml + docs/pt_BR/programmers/advanced-features/section-template-cache-handler-func.xml + docs/pt_BR/programmers/advanced-features/template-resources.xml + docs/pt_BR/programmers/api-functions/api-append-by-ref.xml + docs/pt_BR/programmers/api-functions/api-append.xml + docs/pt_BR/programmers/api-functions/api-assign-by-ref.xml + docs/pt_BR/programmers/api-functions/api-assign.xml + docs/pt_BR/programmers/api-functions/api-clear-all-assign.xml + docs/pt_BR/programmers/api-functions/api-clear-all-cache.xml + docs/pt_BR/programmers/api-functions/api-clear-assign.xml + docs/pt_BR/programmers/api-functions/api-clear-cache.xml + docs/pt_BR/programmers/api-functions/api-clear-compiled-tpl.xml + docs/pt_BR/programmers/api-functions/api-clear-config.xml + docs/pt_BR/programmers/api-functions/api-config-load.xml + docs/pt_BR/programmers/api-functions/api-display.xml + docs/pt_BR/programmers/api-functions/api-fetch.xml + docs/pt_BR/programmers/api-functions/api-get-config-vars.xml + docs/pt_BR/programmers/api-functions/api-get-registered-object.xml + docs/pt_BR/programmers/api-functions/api-get-template-vars.xml + docs/pt_BR/programmers/api-functions/api-is-cached.xml + docs/pt_BR/programmers/api-functions/api-load-filter.xml + docs/pt_BR/programmers/api-functions/api-register-block.xml + docs/pt_BR/programmers/api-functions/api-register-compiler-function.xml + docs/pt_BR/programmers/api-functions/api-register-function.xml + docs/pt_BR/programmers/api-functions/api-register-modifier.xml + docs/pt_BR/programmers/api-functions/api-register-object.xml + docs/pt_BR/programmers/api-functions/api-register-outputfilter.xml + docs/pt_BR/programmers/api-functions/api-register-postfilter.xml + docs/pt_BR/programmers/api-functions/api-register-prefilter.xml + docs/pt_BR/programmers/api-functions/api-register-resource.xml + docs/pt_BR/programmers/api-functions/api-template-exists.xml + docs/pt_BR/programmers/api-functions/api-trigger-error.xml + docs/pt_BR/programmers/api-functions/api-unregister-block.xml + docs/pt_BR/programmers/api-functions/api-unregister-compiler-function.xml + docs/pt_BR/programmers/api-functions/api-unregister-function.xml + docs/pt_BR/programmers/api-functions/api-unregister-modifier.xml + docs/pt_BR/programmers/api-functions/api-unregister-object.xml + docs/pt_BR/programmers/api-functions/api-unregister-outputfilter.xml + docs/pt_BR/programmers/api-functions/api-unregister-postfilter.xml + docs/pt_BR/programmers/api-functions/api-unregister-prefilter.xml + docs/pt_BR/programmers/api-functions/api-unregister-resource.xml + docs/pt_BR/programmers/api-variables/variable-autoload-filters.xml + docs/pt_BR/programmers/api-variables/variable-cache-dir.xml + docs/pt_BR/programmers/api-variables/variable-cache-handler-func.xml + docs/pt_BR/programmers/api-variables/variable-cache-lifetime.xml + docs/pt_BR/programmers/api-variables/variable-cache-modified-check.xml + docs/pt_BR/programmers/api-variables/variable-caching.xml + docs/pt_BR/programmers/api-variables/variable-compile-check.xml + docs/pt_BR/programmers/api-variables/variable-compile-dir.xml + docs/pt_BR/programmers/api-variables/variable-compile-id.xml + docs/pt_BR/programmers/api-variables/variable-compiler-class.xml + docs/pt_BR/programmers/api-variables/variable-config-booleanize.xml + docs/pt_BR/programmers/api-variables/variable-config-dir.xml + docs/pt_BR/programmers/api-variables/variable-config-fix-newlines.xml + docs/pt_BR/programmers/api-variables/variable-config-overwrite.xml + docs/pt_BR/programmers/api-variables/variable-config-read-hidden.xml + docs/pt_BR/programmers/api-variables/variable-debug-tpl.xml + docs/pt_BR/programmers/api-variables/variable-debugging-ctrl.xml + docs/pt_BR/programmers/api-variables/variable-debugging.xml + docs/pt_BR/programmers/api-variables/variable-default-modifiers.xml + docs/pt_BR/programmers/api-variables/variable-default-resource-type.xml + docs/pt_BR/programmers/api-variables/variable-default-template-handler-func.xml + docs/pt_BR/programmers/api-variables/variable-force-compile.xml + docs/pt_BR/programmers/api-variables/variable-global-assign.xml + docs/pt_BR/programmers/api-variables/variable-left-delimiter.xml + docs/pt_BR/programmers/api-variables/variable-php-handling.xml + docs/pt_BR/programmers/api-variables/variable-plugins-dir.xml + docs/pt_BR/programmers/api-variables/variable-request-use-auto-globals.xml + docs/pt_BR/programmers/api-variables/variable-request-vars-order.xml + docs/pt_BR/programmers/api-variables/variable-right-delimiter.xml + docs/pt_BR/programmers/api-variables/variable-secure-dir.xml + docs/pt_BR/programmers/api-variables/variable-security-settings.xml + docs/pt_BR/programmers/api-variables/variable-security.xml + docs/pt_BR/programmers/api-variables/variable-template-dir.xml + docs/pt_BR/programmers/api-variables/variable-trusted-dir.xml + docs/pt_BR/programmers/api-variables/variable-undefined.xml + docs/pt_BR/programmers/api-variables/variable-use-sub-dirs.xml + docs/pt_BR/programmers/caching/caching-cacheable.xml + docs/pt_BR/programmers/caching/caching-groups.xml + docs/pt_BR/programmers/caching/caching-multiple-caches.xml + docs/pt_BR/programmers/caching/caching-setting-up.xml + docs/pt_BR/programmers/plugins/plugins-block-functions.xml + docs/pt_BR/programmers/plugins/plugins-compiler-functions.xml + docs/pt_BR/programmers/plugins/plugins-functions.xml + docs/pt_BR/programmers/plugins/plugins-howto.xml + docs/pt_BR/programmers/plugins/plugins-inserts.xml + docs/pt_BR/programmers/plugins/plugins-modifiers.xml + docs/pt_BR/programmers/plugins/plugins-naming-conventions.xml + docs/pt_BR/programmers/plugins/plugins-outputfilters.xml + docs/pt_BR/programmers/plugins/plugins-prefilters-postfilters.xml + docs/pt_BR/programmers/plugins/plugins-resources.xml + docs/pt_BR/programmers/plugins/plugins-writing.xml: + Big update. Revision tag for all files. Some updates. Now I can update it + +2006-10-09 Peter 'Mash' Morgan + + * docs/en/getting-started.xml + docs/en/designers/language-basic-syntax.xml + docs/en/designers/language-custom-functions/language-function-popup-init.xml + docs/en/designers/language-modifiers/language-modifier-escape.xml + docs/en/programmers/api-functions/api-display.xml + docs/en/programmers/plugins/plugins-inserts.xml: + Minor changes and corrections + + * docs/en/designers/language-basic-syntax.xml + docs/en/designers/language-builtin-functions.xml + docs/en/designers/language-basic-syntax/language-syntax-attributes.xml + docs/en/designers/language-basic-syntax/language-syntax-comments.xml + docs/en/designers/language-basic-syntax/language-syntax-quotes.xml + docs/en/designers/language-modifiers/language-modifier-escape.xml: + Minor formatting and error correction + + * docs/en/designers/language-builtin-functions/language-function-capture.xml + docs/en/designers/language-builtin-functions/language-function-php.xml + docs/en/designers/language-builtin-functions/language-function-section.xml: + minor formatting and changes + + * docs/en/getting-started.xml: + Tidied up formatting so more readable, tidied up the install to the paths + are more clear (ta jj) + +2006-10-09 Yannick Torres + + * docs/fr/designers/language-builtin-functions/language-function-section.xml: + sync with EN + +2006-10-08 Yannick Torres + + * docs/fr/designers/language-builtin-functions/language-function-php.xml + docs/fr/designers/language-modifiers/language-modifier-escape.xml + docs/fr/designers/language-variables/language-variables-smarty.xml + docs/fr/programmers/api-variables/variable-request-use-auto-globals.xml: + fix build + + * docs/fr/designers/language-builtin-functions/language-function-strip.xml + docs/fr/programmers/caching.xml + docs/fr/programmers/smarty-constants.xml + docs/fr/programmers/api-variables/variable-autoload-filters.xml + docs/fr/programmers/api-variables/variable-cache-dir.xml + docs/fr/programmers/api-variables/variable-cache-handler-func.xml + docs/fr/programmers/api-variables/variable-cache-lifetime.xml + docs/fr/programmers/api-variables/variable-cache-modified-check.xml + docs/fr/programmers/api-variables/variable-caching.xml + docs/fr/programmers/api-variables/variable-compile-check.xml + docs/fr/programmers/api-variables/variable-compile-dir.xml + docs/fr/programmers/api-variables/variable-compile-id.xml + docs/fr/programmers/api-variables/variable-compiler-class.xml + docs/fr/programmers/api-variables/variable-config-booleanize.xml + docs/fr/programmers/api-variables/variable-config-dir.xml + docs/fr/programmers/api-variables/variable-config-fix-newlines.xml + docs/fr/programmers/api-variables/variable-config-overwrite.xml + docs/fr/programmers/api-variables/variable-config-read-hidden.xml + docs/fr/programmers/api-variables/variable-debug-tpl.xml + docs/fr/programmers/api-variables/variable-debugging-ctrl.xml + docs/fr/programmers/api-variables/variable-debugging.xml + docs/fr/programmers/api-variables/variable-default-modifiers.xml + docs/fr/programmers/api-variables/variable-default-resource-type.xml + docs/fr/programmers/api-variables/variable-default-template-handler-func.xml + docs/fr/programmers/api-variables/variable-error-reporting.xml + docs/fr/programmers/api-variables/variable-force-compile.xml + docs/fr/programmers/api-variables/variable-left-delimiter.xml + docs/fr/programmers/api-variables/variable-php-handling.xml + docs/fr/programmers/api-variables/variable-plugins-dir.xml + docs/fr/programmers/api-variables/variable-request-use-auto-globals.xml + docs/fr/programmers/api-variables/variable-request-vars-order.xml + docs/fr/programmers/api-variables/variable-right-delimiter.xml + docs/fr/programmers/api-variables/variable-secure-dir.xml + docs/fr/programmers/api-variables/variable-security-settings.xml + docs/fr/programmers/api-variables/variable-security.xml + docs/fr/programmers/api-variables/variable-template-dir.xml + docs/fr/programmers/api-variables/variable-trusted-dir.xml + docs/fr/programmers/api-variables/variable-use-sub-dirs.xml + docs/fr/programmers/caching/caching-cacheable.xml + docs/fr/programmers/caching/caching-groups.xml + docs/fr/programmers/caching/caching-multiple-caches.xml + docs/fr/programmers/caching/caching-setting-up.xml + docs/fr/programmers/plugins/plugins-block-functions.xml + docs/fr/programmers/plugins/plugins-compiler-functions.xml + docs/fr/programmers/plugins/plugins-functions.xml + docs/fr/programmers/plugins/plugins-inserts.xml + docs/fr/programmers/plugins/plugins-modifiers.xml + docs/fr/programmers/plugins/plugins-naming-conventions.xml + docs/fr/programmers/plugins/plugins-outputfilters.xml + docs/fr/programmers/plugins/plugins-prefilters-postfilters.xml + docs/fr/programmers/plugins/plugins-resources.xml + docs/fr/programmers/plugins/plugins-writing.xml: + sync with EN + +2006-10-07 Yannick Torres + + * docs/fr/programmers/advanced-features/advanced-features-objects.xml + docs/fr/programmers/advanced-features/advanced-features-outputfilters.xml + docs/fr/programmers/advanced-features/advanced-features-postfilters.xml + docs/fr/programmers/advanced-features/advanced-features-prefilters.xml + docs/fr/programmers/advanced-features/section-template-cache-handler-func.xml + docs/fr/programmers/advanced-features/template-resources.xml + docs/fr/programmers/api-functions/api-append-by-ref.xml + docs/fr/programmers/api-functions/api-append.xml + docs/fr/programmers/api-functions/api-assign-by-ref.xml + docs/fr/programmers/api-functions/api-assign.xml + docs/fr/programmers/api-functions/api-clear-all-assign.xml + docs/fr/programmers/api-functions/api-clear-all-cache.xml + docs/fr/programmers/api-functions/api-clear-assign.xml + docs/fr/programmers/api-functions/api-clear-cache.xml + docs/fr/programmers/api-functions/api-clear-compiled-tpl.xml + docs/fr/programmers/api-functions/api-clear-config.xml + docs/fr/programmers/api-functions/api-config-load.xml + docs/fr/programmers/api-functions/api-display.xml + docs/fr/programmers/api-functions/api-fetch.xml + docs/fr/programmers/api-functions/api-get-config-vars.xml + docs/fr/programmers/api-functions/api-get-registered-object.xml + docs/fr/programmers/api-functions/api-get-template-vars.xml + docs/fr/programmers/api-functions/api-is-cached.xml + docs/fr/programmers/api-functions/api-load-filter.xml + docs/fr/programmers/api-functions/api-register-block.xml + docs/fr/programmers/api-functions/api-register-compiler-function.xml + docs/fr/programmers/api-functions/api-register-function.xml + docs/fr/programmers/api-functions/api-register-modifier.xml + docs/fr/programmers/api-functions/api-register-object.xml + docs/fr/programmers/api-functions/api-register-outputfilter.xml + docs/fr/programmers/api-functions/api-register-postfilter.xml + docs/fr/programmers/api-functions/api-register-prefilter.xml + docs/fr/programmers/api-functions/api-register-resource.xml + docs/fr/programmers/api-functions/api-template-exists.xml + docs/fr/programmers/api-functions/api-trigger-error.xml + docs/fr/programmers/api-functions/api-unregister-block.xml + docs/fr/programmers/api-functions/api-unregister-compiler-function.xml + docs/fr/programmers/api-functions/api-unregister-function.xml + docs/fr/programmers/api-functions/api-unregister-modifier.xml + docs/fr/programmers/api-functions/api-unregister-object.xml + docs/fr/programmers/api-functions/api-unregister-outputfilter.xml + docs/fr/programmers/api-functions/api-unregister-postfilter.xml + docs/fr/programmers/api-functions/api-unregister-prefilter.xml + docs/fr/programmers/api-functions/api-unregister-resource.xml: + sync with EN + +2006-10-03 Yannick Torres + + * docs/fr/designers/language-custom-functions/language-function-html-select-time.xml + docs/fr/designers/language-custom-functions/language-function-html-table.xml + docs/fr/designers/language-custom-functions/language-function-mailto.xml + docs/fr/designers/language-custom-functions/language-function-math.xml + docs/fr/designers/language-custom-functions/language-function-popup-init.xml + docs/fr/designers/language-custom-functions/language-function-popup.xml + docs/fr/designers/language-custom-functions/language-function-textformat.xml + docs/fr/designers/language-modifiers/language-modifier-capitalize.xml + docs/fr/designers/language-modifiers/language-modifier-cat.xml + docs/fr/designers/language-modifiers/language-modifier-count-characters.xml + docs/fr/designers/language-modifiers/language-modifier-count-paragraphs.xml + docs/fr/designers/language-modifiers/language-modifier-count-sentences.xml + docs/fr/designers/language-modifiers/language-modifier-count-words.xml + docs/fr/designers/language-modifiers/language-modifier-date-format.xml + docs/fr/designers/language-modifiers/language-modifier-default.xml + docs/fr/designers/language-modifiers/language-modifier-escape.xml + docs/fr/designers/language-modifiers/language-modifier-indent.xml + docs/fr/designers/language-modifiers/language-modifier-lower.xml + docs/fr/designers/language-modifiers/language-modifier-nl2br.xml + docs/fr/designers/language-modifiers/language-modifier-regex-replace.xml + docs/fr/designers/language-modifiers/language-modifier-replace.xml + docs/fr/designers/language-modifiers/language-modifier-spacify.xml + docs/fr/designers/language-modifiers/language-modifier-string-format.xml + docs/fr/designers/language-modifiers/language-modifier-strip-tags.xml + docs/fr/designers/language-modifiers/language-modifier-strip.xml + docs/fr/designers/language-modifiers/language-modifier-truncate.xml + docs/fr/designers/language-modifiers/language-modifier-upper.xml + docs/fr/designers/language-modifiers/language-modifier-wordwrap.xml + docs/fr/designers/language-variables/language-assigned-variables.xml + docs/fr/designers/language-variables/language-config-variables.xml + docs/fr/designers/language-variables/language-variables-smarty.xml: + sync with EN + +2006-10-01 Yannick Torres + + * docs/fr/designers/language-builtin-functions/language-function-include-php.xml + docs/fr/designers/language-builtin-functions/language-function-include.xml + docs/fr/designers/language-builtin-functions/language-function-insert.xml + docs/fr/designers/language-builtin-functions/language-function-ldelim.xml + docs/fr/designers/language-builtin-functions/language-function-literal.xml + docs/fr/designers/language-builtin-functions/language-function-php.xml + docs/fr/designers/language-custom-functions/language-function-assign.xml + docs/fr/designers/language-custom-functions/language-function-counter.xml + docs/fr/designers/language-custom-functions/language-function-cycle.xml + docs/fr/designers/language-custom-functions/language-function-debug.xml + docs/fr/designers/language-custom-functions/language-function-eval.xml + docs/fr/designers/language-custom-functions/language-function-fetch.xml + docs/fr/designers/language-custom-functions/language-function-html-checkboxes.xml + docs/fr/designers/language-custom-functions/language-function-html-image.xml + docs/fr/designers/language-custom-functions/language-function-html-options.xml + docs/fr/designers/language-custom-functions/language-function-html-radios.xml + docs/fr/designers/language-custom-functions/language-function-html-select-date.xml: + sync with EN + +2006-09-30 Yannick Torres + + * docs/fr/getting-started.xml: + fix build + + * docs/fr/designers/chapter-debugging-console.xml + docs/fr/designers/config-files.xml + docs/fr/designers/language-builtin-functions.xml + docs/fr/designers/language-modifiers.xml + docs/fr/designers/language-variables.xml + docs/fr/designers/language-basic-syntax/language-escaping.xml + docs/fr/designers/language-basic-syntax/language-math.xml + docs/fr/designers/language-basic-syntax/language-syntax-comments.xml + docs/fr/designers/language-basic-syntax/language-syntax-functions.xml + docs/fr/designers/language-basic-syntax/language-syntax-quotes.xml + docs/fr/designers/language-basic-syntax/language-syntax-variables.xml + docs/fr/designers/language-builtin-functions/language-function-capture.xml + docs/fr/designers/language-builtin-functions/language-function-config-load.xml + docs/fr/designers/language-builtin-functions/language-function-foreach.xml + docs/fr/designers/language-builtin-functions/language-function-if.xml: + sync with EN + + * docs/fr/getting-started.xml + docs/fr/language-snippets.ent + docs/fr/appendixes/resources.xml + docs/fr/appendixes/tips.xml + docs/fr/appendixes/troubleshooting.xml: + sync with EN + +2006-09-27 Peter 'Mash' Morgan + + * docs/en/designers/language-builtin-functions/language-function-section.xml: + Minor tweaks and corrections + + * docs/en/getting-started.xml + docs/en/designers/chapter-debugging-console.xml + docs/en/designers/language-basic-syntax/language-syntax-comments.xml + docs/en/designers/language-custom-functions/language-function-html-image.xml + docs/en/designers/language-custom-functions/language-function-html-options.xml + docs/en/designers/language-custom-functions/language-function-html-radios.xml + docs/en/designers/language-custom-functions/language-function-html-select-date.xml + docs/en/designers/language-custom-functions/language-function-html-select-time.xml + docs/en/designers/language-custom-functions/language-function-html-table.xml + docs/en/designers/language-custom-functions/language-function-mailto.xml + docs/en/designers/language-custom-functions/language-function-popup-init.xml + docs/en/designers/language-custom-functions/language-function-textformat.xml + docs/en/designers/language-variables/language-config-variables.xml + docs/en/designers/language-variables/language-variables-smarty.xml: + Add literal tags to html, general formatting + + * docs/en/getting-started.xml + docs/en/appendixes/resources.xml + docs/en/appendixes/tips.xml + docs/en/appendixes/troubleshooting.xml + docs/en/designers/config-files.xml + docs/en/programmers/caching.xml + docs/en/programmers/smarty-constants.xml + docs/en/programmers/advanced-features/advanced-features-objects.xml + docs/en/programmers/advanced-features/advanced-features-outputfilters.xml + docs/en/programmers/advanced-features/advanced-features-postfilters.xml + docs/en/programmers/advanced-features/advanced-features-prefilters.xml + docs/en/programmers/advanced-features/section-template-cache-handler-func.xml + docs/en/programmers/advanced-features/template-resources.xml + docs/en/programmers/api-variables/variable-autoload-filters.xml + docs/en/programmers/api-variables/variable-cache-dir.xml + docs/en/programmers/api-variables/variable-cache-handler-func.xml + docs/en/programmers/api-variables/variable-cache-lifetime.xml + docs/en/programmers/api-variables/variable-cache-modified-check.xml + docs/en/programmers/api-variables/variable-caching.xml + docs/en/programmers/api-variables/variable-compile-check.xml + docs/en/programmers/api-variables/variable-compile-dir.xml + docs/en/programmers/api-variables/variable-compile-id.xml + docs/en/programmers/api-variables/variable-config-booleanize.xml + docs/en/programmers/api-variables/variable-config-dir.xml + docs/en/programmers/api-variables/variable-config-fix-newlines.xml + docs/en/programmers/api-variables/variable-config-overwrite.xml + docs/en/programmers/api-variables/variable-config-read-hidden.xml + docs/en/programmers/api-variables/variable-debug-tpl.xml + docs/en/programmers/api-variables/variable-debugging-ctrl.xml + docs/en/programmers/api-variables/variable-debugging.xml + docs/en/programmers/api-variables/variable-default-modifiers.xml + docs/en/programmers/api-variables/variable-default-resource-type.xml + docs/en/programmers/api-variables/variable-error-reporting.xml + docs/en/programmers/api-variables/variable-force-compile.xml + docs/en/programmers/api-variables/variable-left-delimiter.xml + docs/en/programmers/api-variables/variable-php-handling.xml + docs/en/programmers/api-variables/variable-plugins-dir.xml + docs/en/programmers/api-variables/variable-request-use-auto-globals.xml + docs/en/programmers/api-variables/variable-request-vars-order.xml + docs/en/programmers/api-variables/variable-right-delimiter.xml + docs/en/programmers/api-variables/variable-secure-dir.xml + docs/en/programmers/api-variables/variable-security-settings.xml + docs/en/programmers/api-variables/variable-security.xml + docs/en/programmers/api-variables/variable-template-dir.xml + docs/en/programmers/api-variables/variable-trusted-dir.xml + docs/en/programmers/api-variables/variable-use-sub-dirs.xml + docs/en/programmers/caching/caching-cacheable.xml + docs/en/programmers/caching/caching-groups.xml + docs/en/programmers/caching/caching-multiple-caches.xml + docs/en/programmers/caching/caching-setting-up.xml: + Tidy up of formatting + + * docs/entities/global.ent: + Adding some more resources + + * docs/en/programmers/plugins/plugins-block-functions.xml + docs/en/programmers/plugins/plugins-compiler-functions.xml + docs/en/programmers/plugins/plugins-functions.xml + docs/en/programmers/plugins/plugins-inserts.xml + docs/en/programmers/plugins/plugins-modifiers.xml + docs/en/programmers/plugins/plugins-naming-conventions.xml + docs/en/programmers/plugins/plugins-outputfilters.xml + docs/en/programmers/plugins/plugins-prefilters-postfilters.xml + docs/en/programmers/plugins/plugins-resources.xml + docs/en/programmers/plugins/plugins-writing.xml: + Tidy up some formatting + +2006-09-26 Peter 'Mash' Morgan + + * docs/en/programmers/api-functions/api-append-by-ref.xml + docs/en/programmers/api-functions/api-append.xml + docs/en/programmers/api-functions/api-assign-by-ref.xml + docs/en/programmers/api-functions/api-assign.xml + docs/en/programmers/api-functions/api-clear-all-assign.xml + docs/en/programmers/api-functions/api-clear-all-cache.xml + docs/en/programmers/api-functions/api-clear-assign.xml + docs/en/programmers/api-functions/api-clear-cache.xml + docs/en/programmers/api-functions/api-clear-compiled-tpl.xml + docs/en/programmers/api-functions/api-clear-config.xml + docs/en/programmers/api-functions/api-config-load.xml + docs/en/programmers/api-functions/api-display.xml + docs/en/programmers/api-functions/api-fetch.xml + docs/en/programmers/api-functions/api-get-config-vars.xml + docs/en/programmers/api-functions/api-get-registered-object.xml + docs/en/programmers/api-functions/api-get-template-vars.xml + docs/en/programmers/api-functions/api-is-cached.xml + docs/en/programmers/api-functions/api-load-filter.xml + docs/en/programmers/api-functions/api-register-block.xml + docs/en/programmers/api-functions/api-register-compiler-function.xml + docs/en/programmers/api-functions/api-register-function.xml + docs/en/programmers/api-functions/api-register-modifier.xml + docs/en/programmers/api-functions/api-register-object.xml + docs/en/programmers/api-functions/api-register-outputfilter.xml + docs/en/programmers/api-functions/api-register-postfilter.xml + docs/en/programmers/api-functions/api-register-prefilter.xml + docs/en/programmers/api-functions/api-register-resource.xml + docs/en/programmers/api-functions/api-template-exists.xml + docs/en/programmers/api-functions/api-trigger-error.xml + docs/en/programmers/api-functions/api-unregister-block.xml + docs/en/programmers/api-functions/api-unregister-compiler-function.xml + docs/en/programmers/api-functions/api-unregister-function.xml + docs/en/programmers/api-functions/api-unregister-modifier.xml + docs/en/programmers/api-functions/api-unregister-object.xml + docs/en/programmers/api-functions/api-unregister-outputfilter.xml + docs/en/programmers/api-functions/api-unregister-postfilter.xml + docs/en/programmers/api-functions/api-unregister-prefilter.xml + docs/en/programmers/api-functions/api-unregister-resource.xml: + Tidy up formatting and examples + + * docs/en/language-snippets.ent: + Moved recurring para for register_* + + * docs/en/designers/language-modifiers.xml: + Spelling on modifiers + + * docs/en/designers/language-builtin-functions.xml + docs/en/designers/language-modifiers.xml + docs/en/designers/language-custom-functions/language-function-html-options.xml + docs/en/designers/language-modifiers/language-modifier-capitalize.xml + docs/en/designers/language-modifiers/language-modifier-cat.xml + docs/en/designers/language-modifiers/language-modifier-count-characters.xml + docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml + docs/en/designers/language-modifiers/language-modifier-count-sentences.xml + docs/en/designers/language-modifiers/language-modifier-count-words.xml + docs/en/designers/language-modifiers/language-modifier-date-format.xml + docs/en/designers/language-modifiers/language-modifier-default.xml + docs/en/designers/language-modifiers/language-modifier-escape.xml + docs/en/designers/language-modifiers/language-modifier-indent.xml + docs/en/designers/language-modifiers/language-modifier-lower.xml + docs/en/designers/language-modifiers/language-modifier-nl2br.xml + docs/en/designers/language-modifiers/language-modifier-regex-replace.xml + docs/en/designers/language-modifiers/language-modifier-replace.xml + docs/en/designers/language-modifiers/language-modifier-spacify.xml + docs/en/designers/language-modifiers/language-modifier-string-format.xml + docs/en/designers/language-modifiers/language-modifier-strip-tags.xml + docs/en/designers/language-modifiers/language-modifier-strip.xml + docs/en/designers/language-modifiers/language-modifier-truncate.xml + docs/en/designers/language-modifiers/language-modifier-upper.xml + docs/en/designers/language-modifiers/language-modifier-wordwrap.xml: + Tidying up some markup + + * docs/en/designers/language-variables.xml: + typo + + * docs/en/designers/language-variables.xml + docs/en/designers/language-variables/language-assigned-variables.xml + docs/en/designers/language-variables/language-config-variables.xml + docs/en/designers/language-variables/language-variables-smarty.xml: + Tidy up formatting on variables + + * docs/en/designers/language-basic-syntax/language-escaping.xml + docs/en/designers/language-basic-syntax/language-math.xml + docs/en/designers/language-basic-syntax/language-syntax-comments.xml + docs/en/designers/language-basic-syntax/language-syntax-functions.xml + docs/en/designers/language-basic-syntax/language-syntax-quotes.xml + docs/en/designers/language-basic-syntax/language-syntax-variables.xml: + Formatting of the basic-syntax dir + + * docs/en/designers/language-custom-functions/language-function-assign.xml + docs/en/designers/language-custom-functions/language-function-counter.xml + docs/en/designers/language-custom-functions/language-function-cycle.xml + docs/en/designers/language-custom-functions/language-function-debug.xml + docs/en/designers/language-custom-functions/language-function-eval.xml + docs/en/designers/language-custom-functions/language-function-fetch.xml + docs/en/designers/language-custom-functions/language-function-html-checkboxes.xml + docs/en/designers/language-custom-functions/language-function-html-image.xml + docs/en/designers/language-custom-functions/language-function-html-options.xml + docs/en/designers/language-custom-functions/language-function-html-radios.xml + docs/en/designers/language-custom-functions/language-function-html-select-date.xml + docs/en/designers/language-custom-functions/language-function-html-select-time.xml + docs/en/designers/language-custom-functions/language-function-html-table.xml + docs/en/designers/language-custom-functions/language-function-mailto.xml + docs/en/designers/language-custom-functions/language-function-math.xml + docs/en/designers/language-custom-functions/language-function-popup-init.xml + docs/en/designers/language-custom-functions/language-function-popup.xml + docs/en/designers/language-custom-functions/language-function-textformat.xml: + More formatting and cleaning up examples + +2006-09-25 Peter 'Mash' Morgan + + * docs/en/designers/language-builtin-functions/language-function-foreach.xml + docs/en/designers/language-builtin-functions/language-function-section.xml: + Doh! removing tabs + + * docs/en/designers/language-builtin-functions/language-function-capture.xml + docs/en/designers/language-builtin-functions/language-function-config-load.xml + docs/en/designers/language-builtin-functions/language-function-foreach.xml + docs/en/designers/language-builtin-functions/language-function-if.xml + docs/en/designers/language-builtin-functions/language-function-include-php.xml + docs/en/designers/language-builtin-functions/language-function-include.xml + docs/en/designers/language-builtin-functions/language-function-insert.xml + docs/en/designers/language-builtin-functions/language-function-ldelim.xml + docs/en/designers/language-builtin-functions/language-function-literal.xml + docs/en/designers/language-builtin-functions/language-function-php.xml + docs/en/designers/language-builtin-functions/language-function-section.xml + docs/en/designers/language-builtin-functions/language-function-strip.xml: + A lot of formatting, tagging and tidy up. Some consistency at last + + * docs/en/designers/language-builtin-functions/language-function-section.xml: + Major tidy up + + * docs/en/designers/language-builtin-functions/language-function-foreach.xml: + Major tidy up, added index property and some examples + +2006-09-03 Yannick Torres + + * docs/fr/designers/language-custom-functions/language-function-popup-init.xml + docs/fr/programmers/advanced-features/advanced-features-outputfilters.xml + docs/fr/programmers/advanced-features/advanced-features-postfilters.xml + docs/fr/programmers/advanced-features/advanced-features-prefilters.xml: + sync with EN + +2006-09-01 George Miroshnikov + + * docs/ru/programmers/api-functions/api-append-by-ref.xml + docs/ru/programmers/api-functions/api-append.xml + docs/ru/programmers/api-functions/api-assign-by-ref.xml + docs/ru/programmers/api-functions/api-assign.xml + docs/ru/programmers/api-functions/api-clear-all-assign.xml + docs/ru/programmers/api-functions/api-clear-all-cache.xml + docs/ru/programmers/api-functions/api-clear-assign.xml + docs/ru/programmers/api-functions/api-clear-cache.xml + docs/ru/programmers/api-functions/api-clear-compiled-tpl.xml + docs/ru/programmers/api-functions/api-clear-config.xml + docs/ru/programmers/api-functions/api-config-load.xml + docs/ru/programmers/api-functions/api-display.xml: + sync with EN + +2006-08-25 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed wrong handling of name attribute in {insert} + thanks to Ivan Kravets for reporting this + + * libs/Smarty_Compiler.class.php: + fixed typo + +2006-08-21 George Miroshnikov + + * docs/ru/designers/language-custom-functions/language-function-popup-init.xml + docs/ru/programmers/advanced-features/advanced-features-objects.xml + docs/ru/programmers/advanced-features/advanced-features-outputfilters.xml + docs/ru/programmers/advanced-features/advanced-features-postfilters.xml + docs/ru/programmers/advanced-features/advanced-features-prefilters.xml + docs/ru/programmers/advanced-features/section-template-cache-handler-func.xml + docs/ru/programmers/advanced-features/template-resources.xml: + sync with EN + + * docs/en/programmers/advanced-features/advanced-features-prefilters.xml: + another missing dot + + * docs/en/programmers/advanced-features/advanced-features-postfilters.xml: + missing dot + + * docs/en/programmers/advanced-features/advanced-features-outputfilters.xml: + missing comma + +2006-08-19 Peter 'Mash' Morgan + + * docs/en/designers/language-custom-functions/language-function-popup-init.xml: + avoid dupes and added remote paths + +2006-08-06 Yannick Torres + + * docs/fr/designers/language-custom-functions/language-function-html-table.xml + docs/fr/designers/language-custom-functions/language-function-mailto.xml: + sync with EN + +2006-08-03 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fix false replacement of "$t" inside double quotes + thanks to checat for reporting this + +2006-07-20 George Miroshnikov + + * docs/ru/designers/language-custom-functions/language-function-html-table.xml + docs/ru/designers/language-custom-functions/language-function-mailto.xml: + incrementing EN-Revision + + * docs/ru/designers/language-custom-functions/language-function-assign.xml + docs/ru/designers/language-custom-functions/language-function-eval.xml + docs/ru/designers/language-custom-functions/language-function-fetch.xml + docs/ru/designers/language-custom-functions/language-function-html-checkboxes.xml + docs/ru/designers/language-custom-functions/language-function-html-image.xml + docs/ru/designers/language-custom-functions/language-function-html-options.xml + docs/ru/designers/language-custom-functions/language-function-html-radios.xml + docs/ru/designers/language-custom-functions/language-function-html-table.xml + docs/ru/designers/language-custom-functions/language-function-mailto.xml + docs/ru/designers/language-custom-functions/language-function-popup-init.xml + docs/ru/designers/language-custom-functions/language-function-popup.xml + docs/ru/designers/language-modifiers/language-modifier-date-format.xml + docs/ru/designers/language-modifiers/language-modifier-default.xml + docs/ru/designers/language-modifiers/language-modifier-escape.xml + docs/ru/designers/language-modifiers/language-modifier-indent.xml + docs/ru/designers/language-modifiers/language-modifier-lower.xml + docs/ru/designers/language-modifiers/language-modifier-nl2br.xml + docs/ru/designers/language-modifiers/language-modifier-strip.xml + docs/ru/designers/language-modifiers/language-modifier-truncate.xml + docs/ru/designers/language-modifiers/language-modifier-upper.xml + docs/ru/designers/language-modifiers/language-modifier-wordwrap.xml + docs/ru/designers/language-variables/language-variables-smarty.xml: + sync with EN + + * docs/en/designers/language-custom-functions/language-function-mailto.xml: + typo + +2006-07-10 boots + + * libs/plugins/function.html_table.php: + fixed email address in comments + + * NEWS + libs/plugins/function.html_table.php: + html_table: fixed th/tr output, added hdir support for column + headings,update docs to reflect new features + +2006-07-08 Messju Mohr + + * libs/plugins/function.html_table.php: + fix occasional notices on undefined variables + +2006-07-08 boots + + * libs/plugins/function.html_table.php: + Added ability to specify column headings in {html_table} + + Added th_attrs attribute which works similary to td_attr and tr_attr but + for TH elements. Changes the cols attribute to allow mixed values; a + numeric still specifies the number of columns to render but now an array + of values can be used to specify TH column values. The number of columns + is determine from the size of the array. Further, a comma-separated + string of column names can be used which is internally coverted to an + array and used as if it was specified as a normal array. + + Thanks for lynlyn for the feature request. + +2006-06-23 boots + + * libs/plugins/outputfilter.trimwhitespace.php: + fix comments in outputfilter.trimwhitespace + + * NEWS + libs/plugins/outputfilter.trimwhitespace.php: + fixed ordering of replacements in trimwhitespace output filter + + Thanks to Getty from IRC for reporting this. + +2006-06-20 boots + + * NEWS + libs/plugins/function.mailto.php: + update mailto function plugin to work around a firefox/thunderbird escaping + bug + + Thanks to elijahlofgren from the forums for reporting this and providing + the necessary patch + + * NEWS + libs/plugins/modifier.date_format.php: + emulate %l in the date_format modifier on windows + + thanks to Gibberish from the forums for reporting this + +2006-06-14 boots + + * NEWS + libs/plugins/modifier.capitalize.php: + Fix handling of apostrophes in the capitalize modifier. + + Thanks to asmecher from the forums for reporting this and providing a + partial solution. + +2006-05-28 Monte Ohrt + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + +2006-05-25 boots + + * NEWS + libs/Smarty_Compiler.class.php: + un-hide hidden xml open tags + +2006-05-09 boots + + * NEWS + libs/Smarty_Compiler.class.php: + separate handling of comment blocks from "special blocks" + + * NEWS + libs/plugins/function.popup_init.php: + reverted {popup_init} as proposed change to insertion behviour was not BC + +2006-05-04 boots + + * NEWS + libs/plugins/function.popup_init.php: + changed {popup_init} to only emit code once during a request + + Thanks to TGKnIght from forums + +2006-04-22 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fix handling of block-methods of registered objects + thanks to El Hombre Gris + +2006-04-04 Monte Ohrt + + * libs/plugins/function.html_select_date.php: + fix typo + +2006-03-09 Monte Ohrt + + * (Smarty_2_6_13) + NEWS: + update for release + +2006-03-08 Monte Ohrt + + * libs/plugins/modifier.regex_replace.php: + remove delim quote + + * libs/plugins/modifier.regex_replace.php: + fix delimiter issue + +2006-03-03 Monte Ohrt + + * libs/plugins/modifier.regex_replace.php: + use preg_replace to cover any space chars + + * libs/plugins/modifier.regex_replace.php: + fix problem with allowing "e" modifier + +2006-01-29 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed possiblity for E_NOTICE on an undefined variable in + Smarty_Compiler::_compile_if_tag() - thanks to sbeh + +2006-01-18 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + + * (Smarty_2_6_12) + NEWS: + commit 2.6.12 release + +2006-01-15 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed use of references $cache_attrs and $repeat in Smarty_Compiler. + + php does not allow to pass an assigned by reference to a function. since + php-5.1.2 + the reference to the lval gets lost when passing an assignment. + +2005-12-31 Messju Mohr + + * NEWS + libs/Smarty.class.php: + fixed incompatible use of fread() in Smarty::_read_file() + it choke on php-5.1.1 and later. + thanks to andig for pointing this out. + +2005-12-21 boots + + * NEWS + libs/Smarty_Compiler.class.php: + Fix improper tokenization of certain inline math expressions. + + Thanks to gerard at forums for reporting this. + +2005-12-19 Messju Mohr + + * libs/plugins/function.math.php: + fixed problem with math in certain LC_NUMERIC locales. + thanks to wiebren for providing problem+solution. + +2005-12-14 Messju Mohr + + * NEWS: + fixed iso-latin1 special chars + +2005-12-14 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + + * (Smarty_2_6_11) + NEWS: + commit NEWS file for 2.6.11 + +2005-12-08 Messju Mohr + + * docs/de/getting-started.xml: + sync with en + +2005-11-29 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed code generation of non-cacheable blocks to play well with php's + "Alternative syntax" used for example in compiled {if}..{else}..{/if} + blocks. + + (see: http://php.net/manual/en/control-structures.alternative-syntax.php + on "Alternative syntax") + + thanks to kihara from the forum. + +2005-11-26 Messju Mohr + + * NEWS: + fixed handling of multiple identical calls to {insert}. + + the function was called multiple times, but all inserts where replaced + by the results of the first call to the insert function. + + * libs/plugins/compiler.assign.php + libs/plugins/function.config_load.php: + added credits + + * libs/plugins/function.popup.php: + added "closeclick" from + http://www.bosrup.com/web/overlib/?Command_Reference + +2005-11-23 boots + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/modifier.escape.php: + replace {} string access with equivalent substr() to avoid E_STRICT + warnings in PHP 5.1 + +2005-11-09 boots + + * NEWS + libs/Smarty.class.php: + return valid reference in get_config_vars() when given var is non-existant + +2005-10-11 Monte Ohrt + + * libs/plugins/block.textformat.php + libs/plugins/compiler.assign.php + libs/plugins/function.assign_debug_info.php + libs/plugins/function.config_load.php + libs/plugins/function.counter.php + libs/plugins/function.eval.php + libs/plugins/function.fetch.php + libs/plugins/function.html_options.php + libs/plugins/function.html_select_date.php + libs/plugins/function.html_select_time.php + libs/plugins/function.math.php + libs/plugins/function.popup.php + libs/plugins/function.popup_init.php + libs/plugins/modifier.capitalize.php + libs/plugins/modifier.count_characters.php + libs/plugins/modifier.count_paragraphs.php + libs/plugins/modifier.count_sentences.php + libs/plugins/modifier.count_words.php + libs/plugins/modifier.date_format.php + libs/plugins/modifier.debug_print_var.php + libs/plugins/modifier.default.php + libs/plugins/modifier.escape.php + libs/plugins/modifier.indent.php + libs/plugins/modifier.lower.php + libs/plugins/modifier.regex_replace.php + libs/plugins/modifier.replace.php + libs/plugins/modifier.spacify.php + libs/plugins/modifier.string_format.php + libs/plugins/modifier.strip_tags.php + libs/plugins/modifier.truncate.php + libs/plugins/modifier.upper.php + libs/plugins/modifier.wordwrap.php + libs/plugins/shared.escape_special_chars.php + libs/plugins/shared.make_timestamp.php: + Added author title to plugins where they don't exist. I put my name where I + was the original or co-author. If there needs to be more credit given + somewhere, speak up! + +2005-10-10 Monte Ohrt + + * NEWS + libs/plugins/function.html_image.php: + add path_prefix to html_image, fix incorrect secure_dir error when image + file is missing + +2005-10-04 Monte Ohrt + + * demo/templates/index.tpl: + remove popup example, update section var syntax + +2005-09-16 Nuno Lopes + + * docs/de/getting-started.xml: + more fixes + + * docs/de/getting-started.xml: + fix php bug #34520: broken example display (de only) + +2005-08-30 Monte Ohrt + + * libs/plugins/modifier.escape.php: + change default charset from utf8 to iso-8859-1 + + * NEWS + libs/plugins/modifier.escape.php: + add char_set param + +2005-08-17 Monte Ohrt + + * NEWS: + fix notice in debug security check + + * libs/Smarty.class.php: + fix typo + + * NEWS + libs/Smarty.class.php: + return valid reference in get_template_vars() when given var is + non-existant + +2005-08-12 Monte Ohrt + + * NEWS + libs/plugins/modifier.escape.php: + add "urlpathinfo" escape type to escape modifier. (apache does not like %2F + in the PATH_INFO) + +2005-08-05 Monte Ohrt + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + +2005-08-04 Monte Ohrt + + * NEWS: + update secure_dir notes + + * NEWS: + allow debug.tpl to work from arbitrary dir + +2005-08-04 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed proper escaping for literal strings passed to + Smarty_Compiler::_expand_quoted_text() by + Smarty_Compiler::_parse_var_props() + +2005-07-27 Messju Mohr + + * NEWS + libs/plugins/shared.make_timestamp.php: + removed ambiguity for numeric values passed to smarty_make_timestamp(). + numeric values are *always* treated as timestamps now. + +2005-07-18 Messju Mohr + + * libs/Config_File.class.php: + removed E_NOTICE from Config_File::get() + + * libs/Smarty.class.php: + removed E_NOTICE + +2005-07-10 Yannick Torres + + * docs/fr/getting-started.xml: + sync with EN + +2005-07-08 Monte Ohrt + + * NEWS: + correct username in NEWS file + + * NEWS + libs/plugins/function.html_select_date.php: + added passthru attribute feature to html_select_date + +2005-07-03 Yannick Torres + + * docs/fr/language-snippets.ent + docs/fr/preface.xml: + sync with EN + +2005-06-16 Messju Mohr + + * docs/de/preface.xml + docs/de/preface.xml: + sync with en + +2005-06-13 Monte Ohrt + + * NEWS + libs/plugins/modifier.truncate.php: + add "middle" parameter to truncate modifier + +2005-06-10 Messju Mohr + + * docs/de/livedocs.ent: + added german livedocs.ent + + * docs/de/language-snippets.ent + docs/de/preface.xml: + sync with en + +2005-06-09 Messju Mohr + + * docs/de/bookinfo.xml + docs/de/getting-started.xml + docs/de/getting-started.xml: + sync with en + +2005-05-24 Yannick Torres + + * docs/fr/getting-started.xml + docs/fr/language-snippets.ent: + sync with EN + +2005-05-20 Monte Ohrt + + * libs/plugins/function.html_radios.php: + fix allowable label id characters + +2005-05-06 Monte Ohrt + + * NEWS + libs/plugins/function.html_radios.php: + make form input label ids optional (monte) + +2005-05-02 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + add error message for empty if/elseif statements + +2005-04-15 Monte Ohrt + + * NEWS + libs/plugins/function.html_radios.php: + cast selected value to string for comparison in html_radios + +2005-04-07 Messju Mohr + + * NEWS + libs/plugins/function.html_select_date.php: + added xhtml compliance to html_select_date's year_as_text-feature + thanks to Mark West + + * NEWS + libs/plugins/function.html_select_date.php: + fixed handling of selected month html_select_date + thanks to Yuri Weseman for providing problem+solution + +2005-04-07 Nuno Lopes + + * docs/configure.in: + sync configure and file-entities scripts with phpdoc, for better + windows/cygwin support + +2005-03-31 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers + + * (Smarty_2_6_9) + NEWS: + update NEWS file + +2005-03-30 Messju Mohr + + * libs/plugins/function.math.php: + re-enabled hex-constant. i hope in a sane way this time. + +2005-03-30 Monte Ohrt + + * libs/plugins/function.math.php: + fix function testing logic + + * libs/Smarty_Compiler.class.php: + disable variable func calls completely + + * libs/Smarty_Compiler.class.php: + disallow variable func calls when security is enabled + +2005-03-22 Messju Mohr + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + bumped version-number to 2.6.9-dev + added headline of 2.6.6 release to NEWS file + +2005-03-21 Messju Mohr + + * (Smarty_2_6_8) + NEWS: + maybe even better this way. thanks monte :) + + * NEWS: + little more clear news-entry + +2005-03-21 Monte Ohrt + + * NEWS: + update NEWS with e-modifier removal + + * (Smarty_2_6_8) + libs/plugins/modifier.regex_replace.php: + remove e-modifier + +2005-03-19 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + objects don't get casted to arrays anymore in {foreach} + +2005-02-26 Messju Mohr + + * NEWS + libs/Smarty.class.php: + add "null" as a valid token for {if} when security is enabled + +2005-02-25 Monte Ohrt + + * NEWS + libs/plugins/function.mailto.php: + add javascript_charcode option to mailto + +2005-02-24 Monte Ohrt + + * NEWS: + update NEWS file + + * QUICK_START + libs/plugins/function.html_radios.php: + add label ids to html_radios + +2005-02-10 Monte Ohrt + + * QUICK_START: + update with directory structure + +2005-02-10 Nuno Lopes + + * docs/Makefile.in: + fix chm generation + +2005-02-10 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed too agressive {strip} around delimiters inside strip-blocks + +2005-02-10 Monte Ohrt + + * QUICK_START: + fix a couple errors + +2005-02-10 Nuno Lopes + + * docs/Makefile.in + docs/README: + commiting the new tools to make the CHM manual. + +2005-02-09 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed handling of strip-tags with non-default delimiters + +2005-02-04 Messju Mohr + + * libs/plugins/function.html_radios.php: + fixed syntax error. shame on me. + +2005-02-03 Monte Ohrt + + * QUICK_START: + fix example + + * QUICK_START: + initial commit + + * RELEASE_NOTES + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers in cvs + + * (Smarty_2_6_7) + NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + commit version numbers for new release + +2005-02-03 Messju Mohr + + * (Smarty_2_6_7) + libs/plugins/function.html_image.php: + fixed comment (thanks to CirTap) + +2005-02-01 Monte Ohrt + + * libs/plugins/function.html_image.php: + remove border tag + +2005-02-01 Messju Mohr + + * libs/Smarty.class.php: + fixed serialization of values containing newlines (like _cache_attrs) + in core_write_cache_file() + + bumped version to 2.6.6-dev-3 to indicate that the fileformat of cache + has changed + +2005-01-30 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed handling of hashed opening php-tags inside strip-blocks + (reported by titi_rafa) + +2005-01-30 Nuno Lopes + + * docs/fr/language-snippets.ent: + fix build + +2005-01-28 Messju Mohr + + * NEWS + libs/plugins/modifier.escape.php: + escape:url now uses the (RFC 1738 compliant) rawurlencode() + +2005-01-23 Messju Mohr + + * libs/Smarty.class.php: + replaced ? true : false and removed intermediate $_cookie_var in the + handling of the SMARTY_DEBUG-cookie + +2005-01-22 Yannick Torres + + * docs/fr/bookinfo.xml: + update EN-Revision tag + +2005-01-21 Monte Ohrt + + * README + RELEASE_NOTES + docs/de/bookinfo.xml + docs/fr/bookinfo.xml + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/function.cycle.php + libs/plugins/function.debug.php + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_table.php + libs/plugins/function.mailto.php + libs/plugins/modifier.cat.php + libs/plugins/modifier.nl2br.php + libs/plugins/modifier.strip.php + libs/plugins/outputfilter.trimwhitespace.php: + de-spammify e-mails + + * README + RELEASE_NOTES + docs/de/bookinfo.xml + docs/fr/bookinfo.xml + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/function.cycle.php + libs/plugins/function.debug.php + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_table.php + libs/plugins/function.mailto.php + libs/plugins/modifier.cat.php + libs/plugins/modifier.nl2br.php + libs/plugins/modifier.strip.php + libs/plugins/outputfilter.trimwhitespace.php: + update copyright notices, e-mail addresses + +2005-01-06 Messju Mohr + + * libs/Smarty_Compiler.class.php: + reduced the code that is generated on a {foreach}-block that has a + name. + + instead of pre-computing all foreach-properties (like first, last, + show) on each iteration, they are computed on demand as soon as + {$smarty.foreach.*}-variables are used. + + * NEWS + libs/Smarty_Compiler.class.php: + slight optimization in the compilation of $smarty.const.FOO . + + more complex consts like $smarty.const.$name still compile to + constant($this->_tpl_vars['name']) + +2005-01-05 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + make block functions and registered objects' block methods use a + local variable for block_content instead of $this->_block_content + + it's not necessary to have $smarty->_block_content accessible. + +2005-01-04 Yannick Torres + + * docs/fr/bookinfo.xml: + sync with EN + +2005-01-01 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + Happy new year from germany. + +2004-12-28 Monte Ohrt + + * libs/Smarty.class.php: + fix _read_file comments + +2004-12-26 Yannick Torres + + * docs/fr/getting-started.xml + docs/fr/preface.xml: + typo + + * docs/fr/language-defs.ent + docs/fr/language-snippets.ent + docs/fr/livedocs.ent: + sync with EN & typo + +2004-12-21 Yannick Torres + + * docs/fr/bookinfo.xml + docs/fr/getting-started.xml + docs/fr/translation.xml: + sync with EN + +2004-12-17 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed escaping of template-filenames in the generated code that loads + needed plugins + +2004-12-15 Monte Ohrt + + * NEWS + libs/plugins/function.popup.php: + fix invalid HTML issue with popup + +2004-12-06 boots + + * NEWS + libs/plugins/function.popup.php: + - fixed {popup} to properly handle inarray and function parameters and + added support for mouseoff and followmouse options + +2004-11-21 Mehdi Achour + + * docs/fr/livedocs.ent: + add livedocs specific entities files + +2004-11-16 Messju Mohr + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php: + cleaned up typecasting + +2004-11-15 Messju Mohr + + * libs/plugins/function.html_options.php: + fixed semantically misleading check for $options (use isset() instead + of is_array() because it is always an array). + + thanks to albert almeida. + +2004-11-08 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed unused code + +2004-10-25 Mehdi Achour + + * docs/fr/bookinfo.xml + docs/fr/getting-started.xml: + sync with en + +2004-10-13 Monte Ohrt + + * NEWS: + update header + +2004-10-02 Messju Mohr + + * NEWS: + fixed nocache-handling with nested includes. there was a logical error + in the replacement of internal nocache-tags to dynamic content that + lead to false results with deeply nested includes or with + nocache-blocks inside nocache-blocks. + + many thanks to Lars Jankowfsky for providing big help on reproducing + and tracking down this bug! + +2004-10-01 Messju Mohr + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + - better header for compiled includes (more in line with compiled + templates) + + - reuse cache_serials if a file is compiled more than once in one + process (force_compile) + + - don't print nocache-delimiters wenn already inside + process_cached_inserts() + +2004-09-29 Messju Mohr + + * libs/Smarty.class.php: + switched from @count() to !empty() . this was pointed out a few times + by a few people with buggy error-handlers + + * libs/Smarty_Compiler.class.php: + added some property declarations + +2004-09-28 Messju Mohr + + * libs/Smarty.class.php: + bumped up version number to reflect incompatibility in tempfiles of + 'core' vs. 'internals' + +2004-09-24 Messju Mohr + + * libs/plugins/function.html_select_date.php: + fixed $start_year when no value for the year in $time is given. + +2004-09-21 Messju Mohr + + * libs/plugins/function.html_table.php: + fixed handling of "inner"-attribute + + * libs/Smarty_Compiler.class.php: + fixed handling of object derefence inside backticks + +2004-09-20 Monte Ohrt + + * libs/debug.tpl: + add tags + +2004-09-18 boots + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/function.config_load.php + libs/plugins/function.debug.php + libs/plugins/function.fetch.php + libs/plugins/function.html_image.php: + Fixed \\r\\n line endings mistakenly introduced in last commit. d'oh. + +2004-09-16 boots + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.assemble_plugin_filepath.php + libs/core/core.assign_smarty_interface.php + libs/core/core.create_dir_structure.php + libs/core/core.display_debug_console.php + libs/core/core.get_include_path.php + libs/core/core.get_microtime.php + libs/core/core.get_php_resource.php + libs/core/core.is_secure.php + libs/core/core.is_trusted.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php + libs/core/core.process_cached_inserts.php + libs/core/core.process_compiled_include.php + libs/core/core.read_cache_file.php + libs/core/core.rm_auto.php + libs/core/core.rmdir.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include_php.php + libs/core/core.write_cache_file.php + libs/core/core.write_compiled_include.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php + libs/plugins/function.config_load.php + libs/plugins/function.debug.php + libs/plugins/function.fetch.php + libs/plugins/function.html_image.php: + Moved /libs/core to /libs/internals and created new constant, + SMARTY_CORE_DIR which defaults to SMARTY_DIR/internals. This should help + CVS and rsynch users butupgrades will require changes and this may affect + 3rd party plugins that use the /core dir. + +2004-09-15 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + moved $this->_num_const_regexp out of $this->_var_regexp and added it + to the places that affect $this->_var_regexp + + this should fix some problems parsing plugin-names endings with digits + +2004-09-14 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update files to 2.6.6-dev + +2004-09-13 Messju Mohr + + * NEWS: + fixed typo + +2004-09-13 Monte Ohrt + + * (Smarty_2_6_5) + NEWS: + update NEWS file with parsing correction note + +2004-09-11 Messju Mohr + + * libs/plugins/function.debug.php: + removed notice from {debug} + thanks to Peter Billen for pointing this one out! + +2004-09-11 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + fix more object calling syntax issues + +2004-09-10 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + added $smarty->security_settings['ALLOW_CONSTANTS'] + including test-cases for them + +2004-09-09 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + break down regex to digestable chunks, fix multiple param problem with + method calls, + add object method testing to unit_test cases + + * libs/Smarty_Compiler.class.php: + update code comment with more examples + + * libs/Smarty_Compiler.class.php: + allow objects in arbitrary param positions + + * libs/Smarty_Compiler.class.php: + fix object parameter regex, allow one level of object indirection + + * libs/Smarty_Compiler.class.php: + fix compile problem with numeric constants and math operator matching + +2004-09-07 Monte Ohrt + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update files to 2.6.5-dev + + * (Smarty_2_6_4) + NEWS: + update NEWS file with 2.6.4 header + +2004-08-31 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + fix preg_quote + + * libs/Smarty_Compiler.class.php: + fix math in object params, clean up some regex on the way, change + preg_ delimiters to ~ to avoid character clashes with ! and % + +2004-08-30 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + add $smarty.ldelim and $smarty.rdelim to smarty special var + +2004-08-29 Messju Mohr + + * NEWS + libs/core/core.write_file.php: + tempnam() seems to be borken on many installation. + + now we try tempnam first and if that fails we generate our own + temp-filename with uniqid() + +2004-08-23 Monte Ohrt + + * libs/plugins/modifier.capitalize.php: + dont use constant, use static var instead + + * libs/plugins/modifier.capitalize.php: + implement optional param to capitalize for digit behavior + + * libs/plugins/modifier.capitalize.php: + another commit to capitalize, taking special chars into account + +2004-08-23 Messju Mohr + + * libs/Smarty_Compiler.class.php: + cleaned up attribute-handling in Smarty_Compiler::_compile_foreach_start() + +2004-08-23 Monte Ohrt + + * NEWS + libs/plugins/function.html_select_date.php + libs/plugins/modifier.capitalize.php: + fix capitalize modifier to not rely on buggy ucwords() func + +2004-08-20 Monte Ohrt + + * libs/plugins/function.html_select_date.php: + update version + + * NEWS + libs/plugins/function.html_select_date.php: + make time param work with negative timestamps, force year range to include + given date unless explicitly set + +2004-08-19 Monte Ohrt + + * NEWS + libs/plugins/function.fetch.php: + fix bug with fetch, passing user/pass in url did not work + +2004-08-13 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed handling of {foreachelse} and {sectionelse} that got borked with + the latest commit (v 1.330) + +2004-08-12 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed occasional wrong error messages on mismatched tags when + {else}, {elseif}, {foreachelse} or {sectionelse} is involved + + thanks to Ooypunk for pointing me on this + +2004-08-12 Nuno Lopes + + * docs/.cvsignore + docs/Makefile.in + docs/configure.in: + enable russian PDF builds + +2004-07-30 Nuno Lopes + + * docs/configure.in: + typo + + * docs/Makefile.in + docs/README + docs/configure.in: + add make test_xml + this is usefull to detect XML problems + +2004-07-29 Nuno Lopes + + * docs/configure.in: + avoid warnings in head + + * docs/.cvsignore + docs/Makefile.in + docs/README + docs/configure.in: + build pdf files + just type make pdf + +2004-07-27 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed handling of methods arguments. + + thanks to Manfred Wischin for finding this one and providing the + conceptual fix. + +2004-07-23 Messju Mohr + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php: + there was little flaw in smarty_function_html_radios() and + smarty_function_html_checkboxes(): + + the newly introduced assign-attribute was still added to the + tag-output as an extra-attribute. + + fixed. + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_select_date.php + libs/plugins/function.html_select_time.php + libs/plugins/modifier.date_format.php: + backed out renaming of _get_plugin_filepath() to get_plugin_filepath() + + we'll stick to _get_plugin_filepath() and look for a more viable + solution to be exposed to plugin-writers. + +2004-07-20 Messju Mohr + + * libs/Smarty_Compiler.class.php + libs/core/core.is_trusted.php + libs/plugins/compiler.assign.php: + Some fixes on PhpDocumentor comments. Thanks go to Ruben Vermeersch. + +2004-07-16 andreas halter + + * docs/de/bookinfo.xml + docs/de/getting-started.xml + docs/de/language-defs.ent + docs/de/language-snippets.ent + docs/de/preface.xml: + - updated for 2.6.3 + - updates for new build system + - added missing files + - corrections from users + - revcheck comments for all files + - big up to didou and nuno, brilliant work + - make test: ok + - make: ok + +2004-07-16 Nuno Lopes + + * docs/de/getting-started.xml: + fix the revision tracking tag + the revision number might not be right. just check it, please + +2004-07-16 andreas halter + + * docs/de/getting-started.xml: + - updated version (incl revcheck comment) for revcheck testing + +2004-07-14 Monte Ohrt + + * libs/Smarty.class.php: + replace " with ' where literal strings are quoted (ever so slight speedup) + +2004-07-12 Messju Mohr + + * libs/plugins/modifier.date_format.php: + changed call from $smarty->_get_plugin_filepath() to + $smarty->get_plugin_filepath() + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_select_date.php + libs/plugins/function.html_select_time.php: + renamed calls to $smarty->_get_plugin_filepath() to + $smarty->get_plugin_filepath() + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php: + renamed Smarty::_get_plugin_filepath() to Smarty::get_plugin_filepath() + + * NEWS + libs/Smarty.class.php + libs/core/core.write_compiled_include.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php: + removed touch() call. changing the timestamp of the compiled-template + to the source template's may be irritating for certain + source-code-caches. now a newly compiled template gets the current + time as timestamp. + +2004-07-02 gerald croes + + * docs/fr/getting-started.xml + docs/fr/preface.xml: + Fixed missing tags to be able to make doc again + + * docs/fr/preface.xml: + added the "is a good thing [TM]" as in en docs + + * docs/fr/getting-started.xml: + added ctags, updated screen => programm listing. + added the technical note founded on the en doc + +2004-07-02 Monte Ohrt + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php + libs/plugins/function.mailto.php: + add assign attribute to html_checkboxes and html_radios + +2004-07-01 Messju Mohr + + * NEWS + libs/Smarty.class.php: + removed use of get_include_filepath() inside + get_auto_filename(). thanks go to c960657 + + * NEWS + libs/Smarty_Compiler.class.php: + enhanced error-reporting for {foreach} + + * NEWS + libs/Smarty_Compiler.class.php: + fixed handling of digits inside tagnames. this problem slipped into + the regexps by adding support for numeric contants next to string + constants as variables. + +2004-06-27 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed escaping of backslashes in Smarty_Compiler::_quote_replace() + +2004-06-23 Monte Ohrt + + * libs/plugins/modifier.date_format.php: + display date_format %e, %T and %D as expected for windows + +2004-06-17 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + changed version-number to 2.6.4-dev + +2004-06-16 Monte Ohrt + + * (Smarty_2_6_3) + NEWS: + update NEWS file with version number + +2004-06-09 Monte Ohrt + + * NEWS + libs/plugins/modifier.escape.php: + added escapement of ' + + * docs/fr/translation.xml: + Add other translators. + +2004-06-08 Messju Mohr + + * libs/Smarty.class.php: + made the correct value of "use_sub_dirs" available to the compiler. + (not worth a NEWS-entry, i think) + +2004-06-01 Messju Mohr + + * libs/plugins/function.fetch.php: + fix: proper initialistaion of $content. + thanks to Dmitry Koteroff for pointing this out. + +2004-05-29 Mehdi Achour + + * docs/fr/translation.xml: + oups :) + + * docs/fr/translation.xml: + added translation file + +2004-05-28 Nuno Lopes + + * docs/Makefile.in: + clean also file-entities.php + +2004-05-28 Messju Mohr + + * NEWS + libs/plugins/function.mailto.php: + added obfuscation of protocol-string in {mailto} when using + hex-encoding (thanks to bharat) + +2004-05-26 Messju Mohr + + * NEWS + libs/Smarty.class.php: + enhanced auto-generated filenames for templates_c and cache + + incremented Smarty::_version because the tempfiles' structure changed + a little + +2004-05-23 Mehdi Achour + + * docs/fr/bookinfo.xml + docs/fr/getting-started.xml + docs/fr/preface.xml: + WS and added revcheck + +2004-05-21 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed typo in error-messages + + * docs/de/language-snippets.ent + docs/fr/language-snippets.ent: + added empty language-snippets.ent to fix "make web" + +2004-05-12 Monte Ohrt + + * NEWS + libs/plugins/modifier.escape.php: + add 'nonstd' escape modifier + +2004-05-07 Monte Ohrt + + * NEWS + libs/plugins/block.textformat.php: + update textformat to not output wrap chars after last para + +2004-05-06 Messju Mohr + + * NEWS + libs/core/core.write_file.php: + use tempnam() instead of unqid() to create better temporary files in + smarty_core_write_file(). + + (thanks to xces for finding this race-condition and his work on + fixing it) + +2004-05-04 Messju Mohr + + * libs/Smarty.class.php: + added check if for file_exists() to Smarty::_read_file() + +2004-04-30 Monte Ohrt + + * NEWS + libs/plugins/modifier.escape.php: + add 'mail' attribute to escape modifier + +2004-04-20 Mehdi Achour + + * docs/manual.xml.in: + added the language-snippets.ent file and started using entities for notes + under en/programmers/api-functions + +2004-04-18 Mehdi Achour + + * docs/de/getting-started.xml + docs/fr/getting-started.xml: + new global entity for zend and php-accelerator + + * docs/fr/bookinfo.xml + docs/fr/getting-started.xml + docs/fr/preface.xml: + added myself as translator and added vim comments and xml tags + +2004-04-16 Messju Mohr + + * NEWS: + added entry for numeric constants + + * libs/Smarty_Compiler.class.php: + removed unused 2nd param in call to _parse_var() + + * libs/Smarty_Compiler.class.php: + added explanation for $this->_num_const_regexp + + * NEWS + libs/plugins/modifier.escape.php: + added escape type "decentity" to smarty_modifier_escape() + + * libs/Smarty_Compiler.class.php: + enabled numerical constants be parsed as statements. + (like {10} or {10|@range:12} ) + + * libs/Smarty_Compiler.class.php: + removed unused $smarty_compiler->_dvar_num_var_regexp + + * libs/Smarty.class.php: + reverted Stuff + + * libs/debug.tpl + libs/core/core.assemble_plugin_filepath.php + libs/core/core.read_cache_file.php + libs/core/core.write_file.php + libs/plugins/function.eval.php + libs/plugins/function.popup.php + libs/plugins/modifier.escape.php + libs/plugins/shared.make_timestamp.php: + reverted stuff + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/debug.tpl + libs/core/core.assemble_plugin_filepath.php + libs/core/core.read_cache_file.php + libs/core/core.write_file.php + libs/plugins/function.eval.php + libs/plugins/function.popup.php + libs/plugins/modifier.escape.php + libs/plugins/shared.make_timestamp.php: + Smarty_Compiler.class.php + +2004-04-15 Messju Mohr + + * NEWS + libs/core/core.write_compiled_include.php: + made smarty_core_write_compiled_include() php5-aware + + if someone knows a better way than patching the source with the + tokenizer, please stand up! + +2004-04-14 Nuno Lopes + + * docs/Makefile.in: + remove file-entities.ent also + + * docs/.cvsignore + docs/Makefile.in + docs/README: + allow make revcheck + +2004-04-13 Nuno Lopes + + * docs/configure.in: + do not need inipath + +2004-04-13 Mehdi Achour + + * docs/TODO: + done + + * docs/configure.in + docs/manual.xml.in: + now the files entites are generated dynamically + +2004-04-12 Messju Mohr + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php: + removed unused functionality to load a subset of lines from a file in + Smarty::_read_file() + + additionally removed a warning that is emitted since php-4.3.5 when + fread() is called on an empty file (with filesize()==0). thanks to + Andreas Streichardt who pointed this out. + + * NEWS + libs/core/core.is_secure.php: + smarty_core_is_secure() only checks the file for readability now, not + the directory where is in. + + * libs/Smarty.class.php: + removed unused security_setting 'ALLOW_CONSTANTS' + +2004-04-07 Messju Mohr + + * libs/plugins/function.assign_debug_info.php + libs/plugins/function.cycle.php + libs/plugins/function.mailto.php: + removed trailing spaces + + * libs/Smarty.class.php: + removed unused $smarty->_error_msg + +2004-04-04 Nuno Lopes + + * docs/configure.in: + fixing my crap + put build_date back on-line + +2004-04-03 Nuno Lopes + + * docs/Makefile.in + docs/configure.in + docs/manual.xml.in: + trying to fix ru problems + +2004-03-30 Monte Ohrt + + * libs/core/core.display_debug_console.php: + fix problem with debug_tpl path and security + + * NEWS + libs/core/core.display_debug_console.php: + fix problem displaying debug console when $default_resource_type is not + "file:" + +2004-03-29 Mehdi Achour + + * docs/TODO: + and finally, add a TODO here + + * docs/de/bookinfo.xml + docs/de/manual.sgml + docs/fr/bookinfo.xml + docs/fr/manual.xml: + translate bookinfo.xml and put back the translators + +2004-03-28 Mehdi Achour + + * docs/manual.xml.in: + add global.ent and define some general entities + + * docs/de/bookinfo.xml + docs/de/getting-started.xml + docs/de/language-defs.ent + docs/de/preface.xml: + add new de files + + * docs/de/appendixes.sgml + docs/de/designers.sgml + docs/de/getting-started.sgml + docs/de/html-common.dsl + docs/de/preface.sgml + docs/de/programmers.sgml: + drop old de files + + * docs/fr/bookinfo.xml + docs/fr/getting-started.xml + docs/fr/manual.xml + docs/fr/preface.xml: + add ommited files + + * docs/fr/language-defs.ent: + split the french dir + + * docs/fr/appendixes.sgml + docs/fr/designers.sgml + docs/fr/getting-started.sgml + docs/fr/html-common.dsl + docs/fr/manual.sgml + docs/fr/preface.sgml + docs/fr/programmers.sgml: + drop old french files + + * docs/manual.xml.in: + let's put the new build system + +2004-03-26 Mehdi Achour + + * docs/de/common.dsl + docs/de/html.dsl + docs/fr/common.dsl + docs/fr/html.dsl + docs/fr/php.dsl: + not needed anymore + +2004-03-24 Nuno Lopes + + * docs/Makefile.in: + updated stylesheets + highlight PHP automatically + + * docs/Makefile.in + docs/html.dsl: + remove unneeded file + +2004-03-23 Nuno Lopes + + * docs/version.ent.in: + remove this also + + * docs/getting-started.sgml: + remove this one too + + * docs/appendixes.sgml + docs/common.dsl + docs/designers.sgml + docs/html-common.dsl + docs/manual.sgml + docs/php.dsl + docs/preface.sgml + docs/programmers.sgml: + removing uneeded files + + * docs/.cvsignore: + commiting missing files for docbook + + * docs/.cvsignore + docs/Makefile.in + docs/configure.in + docs/manual.xml.in: + bundling docbook 4 + now make and make web works + +2004-03-23 Messju Mohr + + * NEWS + libs/plugins/function.config_load.php: + unrolled call to the is_compiled()-check to be able to supply the + correct resource_base_path for config_load. this avoids errors when + config-files are accessed where security is enabled. + + thanks to shuther for pointing out this bug. + +2004-03-20 Nuno Lopes + + * docs/manual.xml.in: + fix build date + +2004-03-18 Messju Mohr + + * libs/core/core.is_secure.php: + removed merging of $smarty->template_dir into $smarty->secure_dir + + the resource_base_path is considerd secure instead. this change should + have absolutely no impact on smarty's security's behaviour + +2004-03-18 Nuno Lopes + + * docs/configure.in: + correcting non-existent var + + * docs/.cvsignore + docs/Makefile.in + docs/configure.in + docs/manual.xml.in + docs/version.ent.in: + generate build date + + * docs/.cvsignore + docs/Makefile.in + docs/README + docs/configure.in + docs/manual.xml.in: + new build/test system + +2004-03-18 Messju Mohr + + * libs/Smarty.class.php: + moved setting of a default resource_base_path from + Smarty::_parse_resource_name() to Smarty::_fetch_resource_info() + + this shouldn't affect anything, since all calls to + _parse_resource_name() that are not done from within + _fetch_resource_info() all pass their own resource_base_path + +2004-03-17 Messju Mohr + + * NEWS + libs/Smarty.class.php: + removed '.' from the list of default resource_base_paths in + _parse_resource_name() + + this should only affect _parse_resource_name() for templates, not for + php-resources and not for config_files. the latter pass two their own + resource_base_path. + +2004-03-16 Mehdi Achour + + * docs/appendixes.sgml + docs/getting-started.sgml + docs/preface.sgml: + adding editor comments + + * docs/appendixes.sgml + docs/getting-started.sgml: + cleaning words spacing, killing tabulations, using roles for + programlisting.. + +2004-03-15 Messju Mohr + + * libs/Smarty.class.php: + simplified Smarty::clear_all_cache(); + +2004-03-12 boots + + * docs/programmers.sgml: + Updated is_cached prototype to indicate proper return type. (thanks to + Geoffrey Hoffman) + +2004-03-11 Messju Mohr + + * libs/core/core.assemble_plugin_filepath.php: + fixed little bug that prevented plugins filepaths that are found in + php's include_path (and not in one of the plugins_dirs) from being + cached in the internal plugins-filepath-cache + +2004-03-01 Monte Ohrt + + * docs/designers.sgml: + update include_php docs:wq + :q + + * docs/appendixes.sgml: + update componentized template example to something useful + +2004-02-24 Messju Mohr + + * NEWS + libs/Smarty.class.php: + _parse_resource_name() returned true on non-existant absolute + paths. This caused a warning on _fetch_resource_info() when used in + conjunction with template_exists(). It should be fixed now without + negative effects. + +2004-02-24 Monte Ohrt + + * docs/designers.sgml: + one more typo + + * docs/designers.sgml: + fix typo + +2004-02-24 Messju Mohr + + * NEWS + libs/core/core.is_secure.php: + smarty_resource_*_secure got &$smarty passed errornously as 3rd + parameter and not as 2nd. this is fixed. + +2004-02-23 Messju Mohr + + * NEWS: + fix handling of integer values like width and delay im + smarty_function_popup() + + * libs/plugins/function.popup.php: + fixed handling of integer-attributes + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + updated version to 2.6.3-dev + +2004-02-22 Messju Mohr + + * libs/plugins/function.html_select_date.php: + removed notice on html_select_date with the month_empty-attribute + + * libs/plugins/function.mailto.php: + removed 2 notices of undefined vars (thanks Cit) + +2004-02-17 Monte Ohrt + + * NEWS: + add header + + * (Smarty_2_6_2) + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + change some info in headers, remove fluff + +2004-02-13 Messju Mohr + + * NEWS + libs/plugins/function.html_select_date.php: + correctly handle partially empty dates (like "2004--" or "-12-"). + + * docs/programmers.sgml: + learned something about and sgml and applied this to the + use.sub.dirs-section :) + + * docs/designers.sgml: + changed attribute-name "checked" to "selected" in the docs for + html_radios and html_checkboxes. "checked" is deprecated for ages + AFAIK and selected is recommended for consistency with {html_options} + + * docs/programmers.sgml: + added note about use_sub_dirs and Smarty-2.6.2 . + fixed markup for section about clear_compiled_tpl() . + +2004-02-12 Messju Mohr + + * NEWS + libs/Config_File.class.php: + YES and NO should not be booleanized inside triple-quotes in a + config-file. this behaviour changed by accident in 2.6.1 and is now + reverted to pre-2.6.1 behaviour + +2004-02-10 Messju Mohr + + * NEWS + libs/Config_File.class.php: + fixed slurping of a the next line following a triple-quoted value in a + config-file + +2004-02-07 Messju Mohr + + * libs/Config_File.class.php: + avoid @-operator for handling empty lines in Config_File.class.php + + * libs/Smarty_Compiler.class.php: + removed two notices from Smarty_Compiler::_parse_is_expr() + (thanks shuther!) + + * NEWS + libs/Smarty.class.php: + changed default for use_sub_dirs to false + + * libs/plugins/function.mailto.php: + removed notice of undefined variable. (thanks shuther!) + +2004-01-29 Messju Mohr + + * libs/Smarty_Compiler.class.php: + added file and line-number-information to error-messages regarding + assigned objects an an error messages regarding modifiers with + security. + +2004-01-27 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed use of temporary var $_params in compiled code of block-plugins + + * NEWS + libs/plugins/function.popup.php: + fixed quoting of values in smarty_function_popup() + +2004-01-25 Messju Mohr + + * docs/programmers.sgml: + documented parameters of Smarty::clear_compiled_tpl() + + * libs/Smarty_Compiler.class.php: + Smarty_Compiler::_syntax_error() uses Smarty::_trigger_fatal_error() now + instead of the trigger_error()-function + + * libs/Smarty.class.php: + Smarty::_trigger_fatal_error() uses Smarty::trigger_error() now, + instead of the native trigger_error()-function + + * libs/Smarty_Compiler.class.php: + unrecognized custom-functions trigger an error at compile now, not at + display-time. + +2004-01-23 Monte Ohrt + + * docs/getting-started.sgml: + reword a paragraph + +2004-01-22 Messju Mohr + + * libs/plugins/function.config_load.php: + removed emission of unnecessary notices for unavailable config-files + in config_load() + + * NEWS + libs/Config_File.class.php: + fixed handling of hidden sections in Config_File + +2004-01-21 Messju Mohr + + * NEWS + libs/plugins/function.config_load.php: + added handling of resources for {config_load} + +2004-01-19 Messju Mohr + + * NEWS + libs/plugins/function.html_table.php: + fixed bug when using arrays with tr_attr and td_attr in {html_table} + +2004-01-16 Monte Ohrt + + * NEWS: + add unit testing + + * NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers, add initial unit test directory + + * (Smarty_2_6_1) + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers for 2.6.1 release + +2004-01-16 Messju Mohr + + * (Smarty_2_6_1) + NEWS + docs/programmers.sgml + libs/Smarty.class.php: + renamed $smarty->tpl_rror_reporting to $smarty->error_reporting + "tpl_" is a bit redundant here (it's a TemPLate-engine overall :) + +2004-01-15 Messju Mohr + + * libs/plugins/function.html_image.php: + forgot to remove duplicate is_secure()-check + + * NEWS + libs/plugins/function.html_image.php: + fix: $smarty->security is now correctly handled + + minor optimizations: + core/core.is_secure.php is only included when needed + $dpi_default is only determined when needed + +2004-01-14 Messju Mohr + + * docs/appendixes.sgml + docs/programmers.sgml: + removed suggestions to use extract() from the manual + + * docs/designers.sgml: + fixed typo + +2004-01-12 Messju Mohr + + * docs/designers.sgml: + mention SCRIPT_NAME below {$smarty} reserved variable because it got + lost in the docs for $smarty->global_assign + + * docs/designers.sgml: + added docs for {$smarty.version} special variable + + * docs/programmers.sgml: + removed docs for $global_assign + + * docs/programmers.sgml: + added docs for tpl_error_reporting + + * docs/designers.sgml: + added docs for year_empty-, month_empty- and day_emtpy-attributes of + html_select_date. maybe an example is needed to better explain empty + values in YYY-MM-DD. + +2004-01-10 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed handling of {php}-tags + +2004-01-10 Monte Ohrt + + * docs/designers.sgml: + fix html_checkboxes examples + +2004-01-08 Messju Mohr + + * NEWS + libs/core/core.assemble_plugin_filepath.php: + added caching of requested paths to smarty_core_assemble_plugin_filepath() + + * NEWS: + fix handling of comments inside {php}- and {literal}-blocks + + * libs/Smarty_Compiler.class.php: + fixed handling of comments inside {php} and {literal} + +2004-01-06 Messju Mohr + + * NEWS + libs/Config_File.class.php: + fixed bug handling triple-quotes in config-files + + * libs/Config_File.class.php: + fixed bugs with triple-quotes in config-files + thanks BRDude for finding them testing! + +2004-01-02 Messju Mohr + + * libs/Smarty.class.php: + removed unnecessary param in call to _fetch_resource_info() + +2003-12-30 Messju Mohr + + * libs/Smarty.class.php: + oops! removed tabs. + +2003-12-27 Messju Mohr + + * NEWS + libs/Smarty.class.php: + made $SCRIPT_NAME available again + changes default for request_use_auto_global to prefer autoglobals + + * libs/Smarty.class.php: + removed tabs and trailing spaces + + * NEWS + libs/Smarty_Compiler.class.php: + readded default_modifiers. who removed that? + +2003-12-23 Monte Ohrt + + * NEWS: + add portuguese docs + +2003-12-22 Monte Ohrt + + * docs/designers.sgml: + fix counter example + +2003-12-19 Monte Ohrt + + * libs/Smarty.class.php: + add debug console persistance feature + +2003-12-19 Messju Mohr + + * libs/plugins/block.textformat.php + libs/plugins/function.html_table.php + libs/plugins/function.popup.php: + removed extract(). enhanced parameter parsing. + + * libs/plugins/function.counter.php + libs/plugins/function.fetch.php + libs/plugins/function.popup_init.php + libs/plugins/modifier.capitalize.php + libs/plugins/modifier.cat.php + libs/plugins/modifier.date_format.php + libs/plugins/modifier.debug_print_var.php + libs/plugins/modifier.escape.php + libs/plugins/modifier.indent.php + libs/plugins/modifier.lower.php + libs/plugins/modifier.nl2br.php + libs/plugins/modifier.strip.php + libs/plugins/modifier.upper.php + libs/plugins/modifier.wordwrap.php + libs/plugins/outputfilter.trimwhitespace.php + libs/plugins/shared.escape_special_chars.php: + removed tabs. fixed indentiation. + + * libs/plugins/modifier.truncate.php: + removed tabs + + * libs/plugins/function.counter.php + libs/plugins/function.cycle.php: + removed extract() from parameter-parsing + +2003-12-17 Messju Mohr + + * libs/plugins/function.html_select_date.php: + fix plugin-name in error message + + * libs/plugins/function.html_select_time.php: + remove extract-call from {html_select_time} + + * NEWS + libs/plugins/function.html_select_date.php: + allow single-digit days and months without smarty_make_timestamp() + this makes dates like "1968-11-6" work correctly since no strtotime() + is involved + + add warning when unknown parameter is passed + +2003-12-16 Messju Mohr + + * NEWS + libs/Smarty.class.php: + fix headers sent erroneously with cache_modified_check and fetch() + +2003-12-12 Monte Ohrt + + * libs/plugins/function.config_load.php: + move set_path() call below the conditional bracket + + * NEWS + libs/plugins/function.config_load.php: + fix config_load filepath bug + +2003-12-12 boots + + * docs/designers.sgml: + Updated language.function.if with additional annotation and to fix error + that broke docs build process + +2003-12-11 Messju Mohr + + * libs/Smarty_Compiler.class.php: + little optimization for "is odd" and "is even" + +2003-12-11 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + fix 'is even by' and 'is odd by' logic + +2003-12-11 Messju Mohr + + * docs/designers.sgml: + update example-output of {mailto} + + * libs/plugins/function.mailto.php: + removed extract-call -> cleaner parameter-handling + + * libs/plugins/function.mailto.php: + fixed indentiation + + * TODO: + removed two done topics + +2003-12-11 boots + + * docs/designers.sgml: + Updated language.function.if to describe qualifiers (thanks andre) + +2003-12-10 Messju Mohr + + * NEWS + libs/plugins/function.html_select_date.php: + added day_empty, month_empty, year_empty and all_empty attributes + to pass an undefined date use {html_select_date time="--" ...} + + * libs/plugins/function.html_select_date.php: + removed extract()-call + + * libs/plugins/function.html_select_date.php: + fixed indetiation + +2003-12-10 boots + + * NEWS + docs/designers.sgml: + Added table to language.function.if to describe qualifiers + +2003-12-09 Messju Mohr + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_options.php: + strict comparason didn't work in all cases. use type-casting now. + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_options.php: + fix bug when comparing array-keys to "selected" in html_options and + html_checkboxes + + in_array() uses "strict" comparason now. + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php: + removed tabs, fixed indentiation + +2003-12-08 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + add better checks for correctly nested tags when compiling + +2003-12-04 Messju Mohr + + * libs/Smarty.class.php + libs/plugins/function.html_image.php: + fix: check $smarty->request_use_auto_globals at the last occurences of + HTTP_*_VARS + +2003-12-03 Messju Mohr + + * NEWS + libs/Smarty.class.php: + remove $global_assign property from Smarty and $global_assign-handling + from the constructor. the only visible change is, that $SCRIPT_NAME is + not available in the tempates anymore. $smarty.server.SCRIPT_NAME has + to be used from now. + +2003-12-03 boots + + * docs/designers.sgml: + Fixed example for count_characters + +2003-12-01 boots + + * docs/designers.sgml: + Added section "Escaping Smarty Parsing" under Basic Syntax. + +2003-12-01 Messju Mohr + + * libs/core/core.create_dir_structure.php: + thought again about my latest commit and backed it out. + + * libs/core/core.create_dir_structure.php: + fix root-dir-handling on windows filepath + +2003-11-29 boots + + * libs/plugins/function.config_load.php: + really make the fixes the last patch was supposed to do + + * libs/plugins/function.config_load.php: + removed tabs and killed trailing white-space + + * libs/plugins/function.config_load.php: + changed $smarty->_syntax_error to $smarty->trigger_error + +2003-11-27 Messju Mohr + + * NEWS + libs/plugins/modifier.debug_print_var.php: + remove warning in debug_print_var on php-resources + + * README: + fix version number + +2003-11-26 Messju Mohr + + * libs/Smarty_Compiler.class.php: + raise max_level for $smarty.config... to 3 to allow arrays of config-vars + +2003-11-25 Messju Mohr + + * libs/Smarty.class.php: + changed version-tag to indicate incompatibility to older compiled + templates + +2003-11-24 Messju Mohr + + * NEWS + libs/plugins/compiler.assign.php + libs/plugins/function.assign.php: + move function.assign.php to compiler.assign.php + + * libs/core/core.get_include_path.php: + silence occasional warnings of open_basedir- and + safe_mode-restrictions in core.get_include_path.php + +2003-11-23 Messju Mohr + + * libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php: + avoid touch()-ing of recently unlinked files by touch()-ing the + tempfile before rename instead of touch()-ing the resulting file after + rename. + + * NEWS + libs/Smarty.class.php: + add property $tpl_error_reporting + +2003-11-22 Messju Mohr + + * libs/plugins/function.assign.php: + remove use of extract() in smarty_function_assign() + + * NEWS + libs/Smarty.class.php: + remove property $undefined. "null" is used literally instead + +2003-11-21 Messju Mohr + + * libs/Smarty_Compiler.class.php: + remove two E_NOTICES + +2003-11-20 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + change version to 2.6.1-dev + +2003-11-19 Monte Ohrt + + * (Smarty_2_6_0) + NEWS: + update NEWS file + + * (Smarty_2_6_0) + docs/designers.sgml + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + change version numbers to 2.6.0 + +2003-11-19 Messju Mohr + + * docs/designers.sgml + docs/de/designers.sgml + docs/fr/designers.sgml: + fix examples of escape-modifier (in docs, docs/de and docs/fr !) + +2003-11-18 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + move Smarty::quote_replace() to Smarty_Compiler::_quote_replace() + + * libs/Smarty.class.php: + removed extract-calls from _include()- and _eval()-wrappers + variables passed with {include_php} have to accessed as members of $params + now + +2003-11-17 Messju Mohr + + * docs/designers.sgml: + fixed typo + +2003-11-13 Messju Mohr + + * libs/Config_File.class.php: + fix occasional notice + +2003-11-13 andreas halter + + * docs/de/designers.sgml: + - added cat modifier, thanks messju :-) + +2003-11-13 Monte Ohrt + + * (Smarty_2_6_0-RC3) + NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + commit RC3 tags + +2003-11-13 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fix handling of $var.key inside [] + + * libs/Smarty.class.php: + fix unnecessary loading of core.load_resource_plugin.php + + * (Smarty_2_6_0-RC3) + docs/fr/designers.sgml: + fixed example of html_table + +2003-11-11 Messju Mohr + + * NEWS + libs/core/core.process_cached_inserts.php: + fix handling of assign inside {insert}-tags + +2003-11-06 Messju Mohr + + * libs/core/core.read_cache_file.php: + added $exp_time-parameter + + * docs/programmers.sgml: + added $exp_time to cache_handler_func-example + + * libs/Smarty.class.php + libs/core/core.write_cache_file.php: + added $exp_time-parameter of clear_cache() and clear_all_cache() to + cache_handler_func. + +2003-11-05 Messju Mohr + + * NEWS + libs/Config_File.class.php: + fix handling if [...] inside triple-quotes in config-files + +2003-11-04 Messju Mohr + + * libs/Smarty.class.php: + fixed little bug in _parse_resource_name() (jlgunter, messju) + +2003-11-03 andreas halter + + * docs/designers.sgml + docs/de/designers.sgml + docs/fr/designers.sgml: + - changed Smarty.php.class occurences to Smarty.class.php + +2003-10-29 boots + + * docs/appendixes.sgml + docs/designers.sgml + docs/manual.sgml + docs/programmers.sgml + docs/de/appendixes.sgml + docs/de/designers.sgml + docs/de/programmers.sgml + docs/fr/appendixes.sgml + docs/fr/designers.sgml + docs/fr/getting-started.sgml + docs/fr/manual.sgml + docs/fr/preface.sgml + docs/fr/programmers.sgml: + Fixes to documentation syntax so that all content can be processed used + xsltproc docbook-xsl tools. In particular, fixes unescaped entities, + broken tags, unquoted attributes. + +2003-10-27 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fix handling of simple-math-operators inside modifiers + +2003-10-25 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed unused property _output_type + removed unused param $tag_attrs of _parse_var_props() + cleaned up alignment of class-properties + +2003-10-23 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed notice in php-tag handling in Smarty_Compiler::_compile_file() + + * libs/Smarty_Compiler.class.php: + removed two occasional E_NOTICES from + Smarty_Compiler::_compile_include_php_tag() + + * NEWS + libs/core/core.create_dir_structure.php: + fix handling of trailing-slashes in open_basedir in + smarty_core_create_dir_structure() + +2003-10-20 Messju Mohr + + * libs/Smarty_Compiler.class.php: + elements inside `` are bracketed now inside the compiled-tpl. this + fixes some issues with simple-math inside backticks. + +2003-10-16 Monte Ohrt + + * docs/designers.sgml: + update overlib docs, no working examples + +2003-10-12 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.is_secure.php: + move check for template_dir in secure_dir-array into core.is_secure.php + + this makes template_exists() work correctly with security=true even if + template_dir is not inside the secure_dir-array + +2003-10-11 Messju Mohr + + * libs/plugins/shared.make_timestamp.php: + tightened check for YYYYMMDDHHMMSS-format. thanks konstantin for + pointing this out. + + removed a few tabs. + + * libs/Smarty_Compiler.class.php: + fix precedence of simple-math-operators before modifiers. + thanks dominik! + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.assemble_plugin_filepath.php + libs/core/core.assign_smarty_interface.php + libs/core/core.create_dir_structure.php + libs/core/core.display_debug_console.php + libs/core/core.get_include_path.php + libs/core/core.get_microtime.php + libs/core/core.get_php_resource.php + libs/core/core.is_secure.php + libs/core/core.is_trusted.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php + libs/core/core.process_cached_inserts.php + libs/core/core.process_compiled_include.php + libs/core/core.read_cache_file.php + libs/core/core.rm_auto.php + libs/core/core.rmdir.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include_php.php + libs/core/core.write_compiled_include.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php: + removed tabs from the main and the core/*.php files + +2003-10-08 Monte Ohrt + + * (Smarty_2_6_0-RC2) + NEWS + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + update version numbers to RC2 + +2003-09-18 Messju Mohr + + * docs/designers.sgml + docs/de/designers.sgml: + fixed description of cycle's advance-attribute + +2003-09-16 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + apply modifiers only once to section-loop and foreach-from attributes + +2003-09-15 Messju Mohr + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.write_cache_paths_file.php: + backed out _smarty_cached_paths-file-handling + + * libs/Smarty.class.php + libs/core/core.rm_auto.php: + fixed clear_compiled_tpl with explicit $tpl_file given + fixed return value of smarty_core_rm_auto() + Smarty::_unlink() + + * libs/Smarty.class.php: + little fix in _get_auto_filename() + +2003-09-14 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.assemble_auto_filename.php: + removed auto-filenames from path-cache. merged assemble_auto_filename + back into Smarty::_get_auto_filename() + +2003-09-12 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed quoting of modifier parameters + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.get_php_resource.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php: + remove Smarty::_plugin_implementation_exists() - use php's native + is_callable() + +2003-09-11 Messju Mohr + + * libs/Smarty.class.php: + silenced two notices acces HTTP_SERVER_VARS + +2003-09-10 andreas halter + + * docs/de/designers.sgml + docs/de/getting-started.sgml + docs/de/programmers.sgml: + - minor fixes (2 rep), slight wording changes + - jade transform problem fixed + +2003-09-08 andreas halter + + * docs/de/designers.sgml + docs/de/getting-started.sgml + docs/de/manual.sgml + docs/de/preface.sgml + docs/de/programmers.sgml: + all updated for 2.6.0 release, translated everything from 2_5_0 branch to + 20030908 + +2003-09-04 Messju Mohr + + * libs/Smarty.class.php: + proper checking for files in _fetch_resource_info() + +2003-09-02 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + ignore {strip}/{/strip) inside {strip}-blocks + + * libs/plugins/function.mailto.php: + fixed 2 notices in smarty_function_mailto() + +2003-09-01 Messju Mohr + + * libs/Smarty.class.php: + re-include cache_paths on multiple calls to fetch() to avoid + inconsistencies + at multiple calls to fetch() in one script + + * libs/Smarty_Compiler.class.php: + fixed handling of \r in {strip} + renamed $_trailing_lf to $_additional_newline + + * libs/Smarty_Compiler.class.php: + the weekly fix for {strip} :) + + * docs/designers.sgml: + fixed example for simple math. + +2003-08-29 Messju Mohr + + * libs/core/core.assign_smarty_interface.php + libs/core/core.display_debug_console.php + libs/plugins/function.assign.php + libs/plugins/function.html_options.php + libs/plugins/function.html_table.php: + fixed PHPDocumentor-comments (thanks Konstantin) + + * libs/core/core.rmdir.php: + made rmdir a bit more optimistic. especially it now removes + directories correctly that where created accidently by "safe_mode=On + && $use_sub_dirs=true" + +2003-08-27 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed removal of leading/trailing newlines in {strip}-blocks + +2003-08-25 Messju Mohr + + * INSTALL: + added note emphasizing the introduction of "libs/" with 2.5.0 + + * NEWS + libs/plugins/modifier.escape.php: + fixed proper escaping of " and ' with escape:javascript + +2003-08-22 Messju Mohr + + * NEWS + libs/core/core.assemble_plugin_filepath.php: + fixed bug in traversal of $smarty->plugins_dir-array in + smarty_core_assemble_plugin_filepath(). the first matching plugin in + the path should be used, not the last one. + + * libs/core/core.read_cache_file.php: + discard $_cache_info when the cache should be regenerated + +2003-08-20 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php + libs/plugins/block.strip.php: + reverted {strip} from a block-plugin back into the compiler + + * docs/programmers.sgml: + fixed examples for register_function() and register_block() + + * libs/Smarty.class.php: + made template_exists() quiet when the template does not exist (thanks + to konstatin for pointing this out) + +2003-08-18 Monte Ohrt + + * docs/getting-started.sgml: + fix example title + + * docs/README + docs/getting-started.sgml: + change installation wording confusion + +2003-08-18 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.read_cache_file.php: + fixed unnecessary load of source in template_exists() and the + compile-check of smarty_core_read_cache_file() + + * libs/Smarty_Compiler.class.php: + allow section-, array- and object-dereference in $smarty-references + +2003-08-15 Messju Mohr + + * docs/designers.sgml: + added parameter-descriptions for count_characters (thanks Konstantin + A. Pelepelin) + + fixed docs for {html_checkboxes} + +2003-08-14 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.read_cache_file.php: + fixed timestamp-check of config-files in smarty_core_read_cache_file() + + * libs/Smarty.class.php: + fixed typecasting for arrays in _parse_resource_name() + + * NEWS + libs/plugins/function.config_load.php: + fixes in config_load: + - handling of section-attribute + - reusing the same config-file multiple times + - serialization of config-data for php<4.2.0 (no var_export) + + many thanks to atu for pointing this out and for testing + +2003-08-13 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.smarty_include_php.php: + fixed problem with vars as attributes in {include_php} + +2003-08-13 Monte Ohrt + + * docs/README: + commit README file for documentation compiling + +2003-08-13 Messju Mohr + + * libs/debug.tpl + libs/plugins/modifier.debug_print_var.php: + removed '\r' from debug_print_vars' output + properly escape vars in javascript-version of debug.tpl + +2003-08-11 Monte Ohrt + + * (Smarty_2_6_0_RC1) + NEWS + docs/designers.sgml + docs/html.dsl + docs/php.dsl + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + get ready for 2.6.0-RC1 release + +2003-08-10 Messju Mohr + + * NEWS + libs/Smarty.class.php: + fixed status-header for cache_modified_check under cgi-sapi + +2003-08-09 Messju Mohr + + * libs/core/core.is_secure.php + libs/core/core.is_trusted.php: + synced secure_dir-checking with trusted_dir-checking + + * libs/core/core.is_secure.php: + tightenend path checking in smarty_core_is_secure() + +2003-08-08 Messju Mohr + + * libs/Smarty.class.php: + fix: proper nesting of $smarty->_cache_including flag in cascaded + cached/not-cached/fetched/inserted/foo-templates + + * libs/debug.tpl: + better escaping for $_debug_tpls[templates].filenames + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + removed redundant $smarty from Smarty::_smarty_include() + + * libs/debug.tpl: + proper escaping of filenames in debug-console (thanks to prossel). + +2003-08-07 Messju Mohr + + * docs/programmers.sgml: + added docs for block-methods of registered objects + + * docs/programmers.sgml: + fixed typo in example for registered objects + + * docs/designers.sgml: + fixed exampls of html_image and html_checkboxes + + * libs/plugins/function.debug.php: + fixed {debug} and removed tabs in function.debug.php + + * docs/programmers.sgml: + fixed example for register_object + + * docs/designers.sgml + docs/programmers.sgml: + updated docs for capture, html_table, html_image and register_object + +2003-08-07 Monte Ohrt + + * docs/designers.sgml + docs/programmers.sgml: + add math and default_resource_type to docs + + * docs/getting-started.sgml: + add core to example, add tech note + +2003-08-07 Messju Mohr + + * docs/manual.sgml + docs/fr/manual.sgml: + upd copyright in the docs + +2003-08-07 Monte Ohrt + + * docs/getting-started.sgml: + added core directory to install instructions + +2003-08-07 Messju Mohr + + * docs/designers.sgml + docs/programmers.sgml: + added docs for php-functions as modifiers + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + better caching of attributes for $cacheable=false-plugins + + * docs/programmers.sgml: + added section "caching.cacheable" to the docs, explaining the usage of + the $cacheable-flag of the register_(block|compiler|function)-functions + + * libs/Smarty_Compiler.class.php: + fixed output of custom-functions with cached attributes + + * docs/programmers.sgml: + docs update on callbacks to the register_*-functions + +2003-08-06 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.process_compiled_include.php: + added optional parameter $cache_attrs to register_function() and + register_block(). $cache_attrs is an array containing attribute- names + that should be cached on calls to functions that have $cacheable set + to false. + + * libs/Smarty.class.php: + fixed bug in _run_mod_handler + + * libs/Smarty_Compiler.class.php: + fixed bug with autoload-handling of modifiers. thanks ndre. + +2003-08-05 Messju Mohr + + * libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + updated copyright notice + + * libs/Smarty.class.php + libs/core/core.load_plugins.php: + fixed bug that occurred when using the same not-cacheable plugin in + multiple includes + + * docs/programmers.sgml: + docs-update for plugins.writing + +2003-08-04 Messju Mohr + + * docs/designers.sgml + docs/programmers.sgml: + updated docs for register_block_function(), block-functions, + $request_use_auto_globals and html_checkboxes + +2003-07-31 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + enabled registration of class-methods as callbacks for the + register_*-functions + + use: array('classname', 'method_name')) as callback + +2003-07-29 Messju Mohr + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + modifiers are resolved at compile-time now. _run_mod_handler() is + still used for modifiers with map_array=true (== no preceeding '@') + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.smarty_include.php: + moved _smarty_include() back into Smarty.class.php + + * libs/Smarty.class.php + libs/core/core.load_plugins.php: + prevent unnecessary calls to _read_file() in _is_compiled() + converted method-call to internal function-call in + smarty_core_load_plugins() + +2003-07-28 Messju Mohr + + * libs/Smarty_Compiler.class.php: + quote smarty-header properly to prevent resource-names from escaping from + the comment + +2003-07-25 Messju Mohr + + * libs/core/core.create_dir_structure.php: + weakend race-condition and removed bogus error-message caused by that + in smarty_core_create_dir_structure(). + +2003-07-23 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.display_debug_console.php + libs/core/core.fetch_resource_info.php + libs/core/core.get_php_resource.php + libs/core/core.parse_resource_name.php + libs/core/core.process_cached_inserts.php + libs/core/core.read_cache_file.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include.php + libs/core/core.smarty_include_php.php + libs/plugins/function.eval.php: + moved _fetch_resource_info and _parse_resource_name back into + Smarty.class.php + renamed smarty_include and smarty_eval wrappers to _include and _eval + +2003-07-17 Messju Mohr + + * libs/core/core.process_compiled_include.php + libs/core/core.read_cache_file.php: + improved checking of compiled_include against cached-template with + non-cached-chunks + + * libs/core/core.write_compiled_include.php: + fixed too short open-tag + + * libs/plugins/function.eval.php: + fixed assign parameter for eval (must have gotton lost on its way to 2.5.0) + cleaned up indentiation + +2003-07-03 Messju Mohr + + * libs/Smarty_Compiler.class.php: + resurrected $foo->$bar syntax + + * libs/Smarty_Compiler.class.php: + i'm so stupid. kick me. + + * libs/Smarty_Compiler.class.php: + fixed initialisation of $this->_plugins in compile_block_tag() + +2003-07-03 Monte Ohrt + + * libs/Config_File.class.php: + add preg_quote delimiter + +2003-07-03 Messju Mohr + + * libs/Smarty_Compiler.class.php: + applied fix for {$var1->p1|modifier:$var2->p2}-syntax - thanks Dominik + +2003-07-02 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed duplicate generation of arg-list in _compile_block_tag() + + * libs/Smarty_Compiler.class.php: + fixed off-by-one-error in nocache-tag-handling + +2003-06-30 Messju Mohr + + * libs/Smarty_Compiler.class.php: + backed out errornously committed support for $foo->$bar + + * libs/core/core.write_file.php: + fixed indentiation, silenced occasional warning + + * libs/plugins/function.html_image.php: + match first character of file-attribute against "/" instead of + DIRECTORY_SEPARATOR since it is a url-path and not a file-path. + + * libs/Smarty_Compiler.class.php + libs/core/core.write_file.php + libs/plugins/function.html_image.php: + libs/plugins/function.html_image.php + + * libs/Smarty_Compiler.class.php: + re-fixed cacheable_state-handling + + * libs/core/core.display_debug_console.php + libs/core/core.process_cached_inserts.php + libs/core/core.process_compiled_include.php + libs/core/core.run_insert_handler.php: + extincting $this out of smarty_core_*-functions + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + fixed handling of nocache-state + +2003-06-29 Messju Mohr + + * libs/Smarty.class.php + libs/core/core.smarty_include.php + libs/core/core.smarty_include_php.php + libs/plugins/function.eval.php: + removed $this from smarty_include and smarty_include_php + added cleaner handling of $this to {eval} + + * libs/core/core.load_resource_plugin.php: + fixed inlude_once-call + + * docs/de/designers.sgml + docs/fr/designers.sgml: + fixed examples of html_radios and html_checkboxes in german and french docs + +2003-06-25 Monte Ohrt + + * libs/core/core.assemble_auto_filename.php + libs/core/core.write_cache_paths_file.php: + fix typo, fix write_cache_paths logic + + * libs/Smarty.class.php + libs/core/core.assemble_auto_filename.php: + fix SMARTY_COMPILE_DIR_SEP problem, make local var + +2003-06-24 Monte Ohrt + + * libs/Smarty.class.php + libs/core/core.assemble_auto_filename.php + libs/core/core.write_cache_paths_file.php: + fixed cache_paths bug, simplified filename assembly logic + +2003-06-24 Messju Mohr + + * libs/plugins/function.html_image.php: + added parsing of forgotton param "basedir" + + * libs/Smarty_Compiler.class.php: + fixed $smarty.get-reference + + * libs/plugins/block.textformat.php: + removed warning + + * libs/Smarty_Compiler.class.php: + fixed value of _cacheable_state on compiler-startup + +2003-06-23 Monte Ohrt + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.write_cache_paths_file.php: + make cache_path per resource, fix a couple directory path issues + +2003-06-23 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed warning when compiling empty template + + * libs/core/core.write_compiled_include.php: + fixed bug in write_compiled_include + + * libs/core/core.assemble_plugin_filepath.php: + fixed warning + +2003-06-22 Messju Mohr + + * libs/plugins/function.eval.php: + fixed propagation of $this into evald code in smarty_function_eval() + + * libs/core/core.write_cache_paths_file.php + libs/core/core.write_compiled_include.php: + fix in compiled-include-handling + + * libs/core/core.assemble_auto_filename.php + libs/core/core.assemble_plugin_filepath.php + libs/core/core.assign_smarty_interface.php + libs/core/core.create_dir_structure.php + libs/core/core.fetch_resource_info.php + libs/core/core.get_include_path.php + libs/core/core.get_microtime.php + libs/core/core.get_php_resource.php + libs/core/core.is_secure.php + libs/core/core.is_trusted.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php + libs/core/core.parse_resource_name.php + libs/core/core.read_cache_file.php + libs/core/core.rm_auto.php + libs/core/core.rmdir.php + libs/core/core.write_cache_file.php + libs/core/core.write_cache_paths_file.php + libs/core/core.write_compiled_include.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php + libs/plugins/modifier.date_format.php: + started moving from $this to $smarty in core.*.php + +2003-06-21 Monte Ohrt + + * libs/core/core.create_dir_structure.php + libs/core/core.write_file.php + libs/plugins/function.config_load.php: + fix more dir paths + + * NEWS + libs/Smarty.class.php + libs/core/core.assemble_auto_filename.php + libs/core/core.assemble_plugin_filepath.php + libs/core/core.fetch_resource_info.php + libs/core/core.get_php_resource.php + libs/core/core.parse_resource_name.php + libs/core/core.process_cached_inserts.php + libs/core/core.read_cache_file.php + libs/core/core.rm_auto.php + libs/core/core.rmdir.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include.php + libs/core/core.smarty_include_php.php + libs/core/core.write_cache_file.php + libs/core/core.write_cache_paths_file.php + libs/core/core.write_compiled_include.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_file.php + libs/plugins/function.config_load.php + libs/plugins/function.fetch.php + libs/plugins/function.html_image.php: + fix filepaths to core files to use DIRECTORY_SEPARATOR + +2003-06-21 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed {plugin|modifier} syntax + + * libs/Smarty.class.php + libs/core/core.write_compiled_include.php: + fixed compiled include handling + +2003-06-21 Monte Ohrt + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.assemble_auto_filename.php + libs/core/core.assemble_plugin_filepath.php + libs/core/core.write_cache_paths_file.php: + added filepath caching + +2003-06-20 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + update more varnames + + * libs/Smarty.class.php + libs/core/core.display_debug_console.php + libs/core/core.fetch_file_info.php + libs/core/core.fetch_resource_info.php + libs/core/core.get_php_resource.php + libs/core/core.parse_file_path.php + libs/core/core.parse_resource_name.php + libs/core/core.process_cached_inserts.php + libs/core/core.read_cache_file.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include.php + libs/core/core.smarty_include_php.php + libs/core/core.write_compiled_resource.php + libs/core/core.write_compiled_template.php + libs/plugins/function.config_load.php: + refactored var naming to better reflect "resource" instead of "file" where + appropriate + +2003-06-19 Messju Mohr + + * libs/Smarty.class.php: + updated version-number to 2.5.0-cvs + + * libs/core/core.write_cache_file.php: + omit is-cache_dir-writable-check if a cache_handler_function is in use + + * libs/core/core.smarty_include_php.php: + fixed comments in smarty_include_php + +2003-06-19 Monte Ohrt + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.display_debug_console.php + libs/core/core.smarty_include.php + libs/plugins/function.eval.php: + split up _compile_template to _compile_file and _compile_source, fix eval + function + VS: ---------------------------------------------------------------------- + + * libs/plugins/function.config_load.php: + fix logic for _is_compiled() + +2003-06-19 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + added optional assign-attribute to {capture}-tag + + * NEWS + libs/Smarty.class.php: + added $cacheable-parameter to register_compiler_function() + +2003-06-18 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.load_plugins.php + libs/core/core.process_compiled_include.php + libs/core/core.read_cache_file.php + libs/core/core.write_cache_file.php + libs/core/core.write_compiled_include.php: + added $cacheable-parameter to register_function() and register_block() + + * libs/Smarty.class.php: + append '.php' to all compiled templates regardless of the settings of + $use_sub_dirs + + * libs/Smarty.class.php + libs/core/core.read_cache_file.php: + fixed $file_path-parameters passed to smarty_core_fetch_file_info() + +2003-06-17 Monte Ohrt + + * NEWS: + fix name + + * libs/Smarty_Compiler.class.php: + change varnames to follow coding methods + + * NEWS + libs/Smarty_Compiler.class.php: + add math patch to core + +2003-06-17 Messju Mohr + + * libs/core/core.smarty_include.php: + switched _process_template() to _is_compiled()-logic + +2003-06-17 Monte Ohrt + + * libs/Smarty.class.php: + fix _is_compiled logic + + * NEWS: + update news file + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + fix _run_mod_handler routine + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.display_debug_console.php + libs/core/core.fetch_file_info.php + libs/core/core.parse_file_path.php + libs/core/core.write_compiled_template.php + libs/plugins/function.config_load.php: + fix path problems, rename some varibles from "template" to "file" + +2003-06-16 Monte Ohrt + + * libs/core/core.fetch_file_info.php + libs/core/core.fetch_template_info.php: + rename file, commit + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.parse_file_path.php + libs/core/core.read_cache_file.php + libs/plugins/block.strip.php + libs/plugins/block.textformat.php + libs/plugins/compiler.config_load.php + libs/plugins/function.config_load.php + libs/plugins/function.eval.php + libs/plugins/function.fetch.php + libs/plugins/function.html_image.php: + fix config_load, compile fetched arrays to compile_dir, switch display + back to runtime. clean up var names and function names, split up compile + testing and compiling to separate funcs, rename some template_* functions + to + file_* functions and update logic so they can be used for file resources + other than templates. + +2003-06-16 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed little bug in _compile_custom_tag() + +2003-06-16 Monte Ohrt + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/core/core.assign_smarty_interface.php + libs/core/core.create_dir_structure.php + libs/core/core.display_debug_console.php + libs/core/core.fetch_template_info.php + libs/core/core.get_include_path.php + libs/core/core.get_microtime.php + libs/core/core.get_php_resource.php + libs/core/core.is_secure.php + libs/core/core.is_trusted.php + libs/core/core.load_plugins.php + libs/core/core.load_resource_plugin.php + libs/core/core.parse_file_path.php + libs/core/core.process_cached_inserts.php + libs/core/core.read_cache_file.php + libs/core/core.rm_auto.php + libs/core/core.rmdir.php + libs/core/core.run_insert_handler.php + libs/core/core.smarty_include.php + libs/core/core.smarty_include_php.php + libs/core/core.write_cache_file.php + libs/core/core.write_compiled_template.php + libs/core/core.write_file.php + libs/plugins/core.assign_smarty_interface.php + libs/plugins/core.create_dir_structure.php + libs/plugins/core.display_debug_console.php + libs/plugins/core.fetch_template_info.php + libs/plugins/core.get_include_path.php + libs/plugins/core.get_microtime.php + libs/plugins/core.get_php_resource.php + libs/plugins/core.is_secure.php + libs/plugins/core.is_trusted.php + libs/plugins/core.load_plugins.php + libs/plugins/core.load_resource_plugin.php + libs/plugins/core.parse_file_path.php + libs/plugins/core.process_cached_inserts.php + libs/plugins/core.read_cache_file.php + libs/plugins/core.rm_auto.php + libs/plugins/core.rmdir.php + libs/plugins/core.run_insert_handler.php + libs/plugins/core.smarty_include.php + libs/plugins/core.smarty_include_php.php + libs/plugins/core.write_cache_file.php + libs/plugins/core.write_compiled_template.php + libs/plugins/core.write_file.php: + move core files into their own directory under SMARTY_DIR, + remove abstraction function _execute_core_function + + * libs/Smarty_Compiler.class.php: + fix newline handling for template for all template tags + +2003-06-11 Monte Ohrt + + * libs/plugins/compiler.config_load.php: + add compiler function to cvs repository + +2003-06-11 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + added config-option "request_use_auto_globals" to make auto-globals be + used as request vars instead of HTTP_*_VARS + +2003-06-11 Monte Ohrt + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/function.config_load.php: + make config vars compile statically + +2003-06-11 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + backed out newlines patch + + * NEWS + libs/Smarty_Compiler.class.php: + removed newlines in compiled templates after closing tags + +2003-06-10 Messju Mohr + + * docs/de/designers.sgml: + fixed german note on html_image and disk-access + +2003-06-10 Monte Ohrt + + * libs/plugins/core.parse_file_path.php: + fix bug with resource_type resolving + +2003-06-09 Monte Ohrt + + * docs/designers.sgml: + replace example with more practical one + +2003-06-08 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + added block-methods for registered objects + +2003-06-07 Messju Mohr + + * docs/programmers.sgml: + fixed bug in documentation for $smarty->default_modifiers + +2003-06-06 Monte Ohrt + + * libs/plugins/core.parse_file_path.php: + fix problem with new default_resource_type changes + + * NEWS: + update NEWS file info + + * NEWS + libs/Smarty.class.php + libs/plugins/core.parse_file_path.php: + add default_resource_type, ignore 1 char resource names + + * NEWS + libs/Config_File.class.php: + fix bug where config file starts with hidden section + +2003-06-04 Monte Ohrt + + * NEWS + libs/Smarty.class.php: + -** empty log message *** + +2003-06-03 Monte Ohrt + + * libs/plugins/function.html_image.php: + fix example in code comments + +2003-06-03 Messju Mohr + + * NEWS + libs/plugins/function.counter.php: + fixed behaviour of start=... for {counter} + +2003-06-02 Messju Mohr + + * NEWS + libs/plugins/function.counter.php: + fixed assign for {counter} + +2003-05-30 Monte Ohrt + + * libs/plugins/core.write_cache_file.php + libs/plugins/core.write_compiled_template.php: + add discrete error checking pertaining to $cache_dir + and $compile_dir, their existance and writability + +2003-05-28 Messju Mohr + + * NEWS + libs/plugins/function.html_table.php: + added params vdir, hdir and inner to html_table to allow looping over + the data in various directions + +2003-05-28 Monte Ohrt + + * libs/plugins/core.compile_template.php + libs/plugins/core.display_debug_console.php: + fix problem with security and debug.tpl file + +2003-05-23 Monte Ohrt + + * NEWS: + upd NEWS file + + * libs/Smarty_Compiler.class.php: + allow spaces in literal tags + +2003-05-22 Monte Ohrt + + * docs/fr/programmers.sgml: + fix special chars + +2003-05-19 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + speed up compiled templates, hardcode plugin filepaths instead of + recalculate at runtime + +2003-05-19 Messju Mohr + + * docs/designers.sgml: + fixed example of {html_image} + + * docs/designers.sgml: + fixed typo + +2003-05-12 Messju Mohr + + * libs/Smarty.class.php + libs/plugins/core.read_cache_file.php + libs/plugins/core.smarty_include.php + libs/plugins/function.config_load.php: + fixed multiple redundant occurrences for 'config' and 'template' in + $smarty->_cache_info + +2003-05-10 Messju Mohr + + * libs/plugins/core.create_dir_structure.php: + refurbished create_dir_structure to use '/' internally + + * libs/plugins/core.create_dir_structure.php: + fixed windows absolute-paths in smarty_core_create_dir_structure() + + * libs/plugins/core.create_dir_structure.php: + fixed error-message + +2003-05-09 Messju Mohr + + * libs/Smarty_Compiler.class.php: + fixed warning due to missing param to _execute_core_function() + + * libs/Smarty_Compiler.class.php: + fixed quoting in _compile_include_php + + * libs/Smarty_Compiler.class.php: + fixed quoting of "file"-parameter in _compile_include_tag() + +2003-05-08 Monte Ohrt + + * docs/programmers.sgml: + fix typo + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/core.compile_template.php + libs/plugins/core.create_dir_structure.php + libs/plugins/core.fetch_template_info.php + libs/plugins/core.get_include_path.php + libs/plugins/core.get_microtime.php + libs/plugins/core.get_php_resource.php + libs/plugins/core.is_secure.php + libs/plugins/core.is_trusted.php + libs/plugins/core.load_plugins.php + libs/plugins/core.load_resource_plugin.php + libs/plugins/core.parse_file_path.php + libs/plugins/core.process_cached_inserts.php + libs/plugins/core.read_cache_file.php + libs/plugins/core.rm_auto.php + libs/plugins/core.rmdir.php + libs/plugins/core.run_insert_handler.php + libs/plugins/core.smarty_include.php + libs/plugins/core.smarty_include_php.php + libs/plugins/core.write_cache_file.php + libs/plugins/core.write_compiled_template.php + libs/plugins/core.write_file.php + libs/plugins/function.config_load.php + libs/plugins/function.fetch.php + libs/plugins/function.html_image.php: + abstract more private functions to plugin directory + + * libs/Config_File.class.php: + only add DIRECTORY_SEPARATOR if it isn't already present + + * libs/Config_File.class.php: + fix directory separator code, use DIRECTORY_SEPARATOR + +2003-05-08 Messju Mohr + + * docs/designers.sgml: + fixed example of html_checkboxes + + * NEWS + libs/Smarty.class.php: + fixed bug in _create_dir_structure() when used with + open_basedir-restriction and relative paths + + * docs/designers.sgml: + fixed example for html_radios + +2003-05-07 Monte Ohrt + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php + libs/plugins/core.assign_smarty_interface.php + libs/plugins/core.display_debug_console.php + libs/plugins/function.display_debug_console.php: + abstracted display_debug_console and assign_smarty_interface to plugin dir + as a test + + * libs/Smarty.class.php + libs/plugins/function.display_debug_console.php: + correct misc varnames, abstract debug console display to plugin function + + * libs/plugins/modifier.escape.php: + fix typo + +2003-05-05 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + add % to math + + * libs/Smarty.class.php: + clean up comments, formatting + + * NEWS + libs/Smarty.class.php: + keep DIR_SEP for 3rd party compatability + + * NEWS + libs/Smarty.class.php: + remove DIR_SEP, use DIRECTORY_SEPARATOR exclusively + + * libs/Smarty_Compiler.class.php: + remove ++ and -- math operators on template vars + +2003-05-04 Messju Mohr + + * libs/Smarty_Compiler.class.php: + removed unused parameter $quote from Smarty_Compiler::_parse_attrs() + + * libs/plugins/function.html_image.php: + fixed DIR_SEP in html_image-plugin + +2003-05-04 Monte Ohrt + + * NEWS + libs/Smarty.class.php: + rename DIR_SEP to SMARTY_DIR_SEP to avoid varname collisions + +2003-05-04 Messju Mohr + + * NEWS + libs/plugins/function.html_image.php: + changed "link" to "href" in html_image. "link" is still working but + deprecated + html_image always renders an alt-tag now (default alt="") + cleaned up indentiation of function.html_image.php + +2003-05-03 Monte Ohrt + + * libs/debug.tpl: + fix typo + +2003-05-02 Messju Mohr + + * NEWS + libs/plugins/function.counter.php: + fixed assign attribute for multiple counters + +2003-05-02 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + allow math on negative number + + * NEWS + libs/Smarty_Compiler.class.php: + added simple math operators to variables + +2003-05-02 Messju Mohr + + * docs/designers.sgml: + fixed typos + +2003-04-30 Monte Ohrt + + * docs/fr/appendixes.sgml + docs/fr/common.dsl + docs/fr/designers.sgml + docs/fr/getting-started.sgml + docs/fr/html-common.dsl + docs/fr/html.dsl + docs/fr/manual.sgml + docs/fr/php.dsl + docs/fr/preface.sgml + docs/fr/programmers.sgml: + add frech docs to cvs repository + +2003-04-29 Messju Mohr + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + reverted patch for case-insensitive tag-names + +2003-04-28 Messju Mohr + + * docs/programmers.sgml: + reverted back to humerous redundancy in the docs :). although we all + know we are here to generate template-based output, and not to have + fun ;-) + + * docs/getting-started.sgml: + fixed default user and group for max os x installation + + * libs/Smarty.class.php: + made $function[2] and $function[3] options for register_resource + + * libs/Smarty.class.php: + fixed issue with object-callback when fetching a php-resource + + * NEWS + libs/Smarty.class.php: + enabled array(&$obj. 'source', 'timestamp', 'secure', 'trusted') as + callback for register_resource() + + enabled array(&$obj, 'method') as callback for + $default_template_handler_func + +2003-04-27 Messju Mohr + + * docs/designers.sgml + docs/programmers.sgml: + fixed some typos, thank to mehdi + + * libs/plugins/function.counter.php: + prevent assign from overruling print-attribute in function.counter.php + + * libs/plugins/function.counter.php: + fixed problem with counter and assign + + * libs/Smarty.class.php: + fixed notice in _load_plugins() + + * NEWS + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + made plugin-names case-insensitive. this affects + compiler/block/custom-functions and modifers. + +2003-04-26 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + remove unnecessary close/open tags from compiled templates + +2003-04-26 Messju Mohr + + * docs/designers.sgml: + added documentation for foreach.property.* + +2003-04-24 Messju Mohr + + * docs/designers.sgml: + fixed example table_attr and tr_attr in html_table-example + +2003-04-21 Greg Beaver + + * libs/Smarty.class.php: + fixed small bug in doc comments + +2003-04-21 Messju Mohr + + * NEWS + libs/plugins/function.html_image.php: + fixed errornous creation of '//' in image_path in html_image + +2003-04-21 Monte Ohrt + + * libs/plugins/modifier.debug_print_var.php: + fix htmlspecialchars() conflict + + * NEWS + libs/plugins/modifier.debug_print_var.php: + fix escapement of special chars in key values of debug console + + * NEWS + libs/plugins/function.config_load.php: + fixed debug timing logic for config_load + + * docs/designers.sgml: + fix example text + + +2003-04-20 Greg Beaver + * plugins/* + Smarty.class.php + Smarty_Compiler.class.php + Config_File.class.php: + updated all doc comments to phpDocumentor format (whew!) + +2003-04-06 Messju Mohr + + * libs/plugins/function.math.php: + allowed "_" in the name of variable-parameters to {math}-function + +2003-04-04 Monte Ohrt + + * NEWS + docs/designers.sgml + libs/Smarty_Compiler.class.php: + change backtic syntax from $`foo` to `$foo` + + * NEWS + libs/Smarty_Compiler.class.php: + recognize $foo[][] syntax in embedded quotes without backticks + +2003-04-03 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + name=123 is passed as an integer (not a string) to plugins now + +2003-04-01 Messju Mohr + + * libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + added CVS $Id: ChangeLog 4779 2013-09-30 19:14:32Z Uwe.Tews@googlemail.com $ + +2003-03-31 Messju Mohr + + * libs/Smarty.class.php: + added missing compile_id inside Smarty_Compiler + + * libs/Smarty_Compiler.class.php: + fixed flaw when generating an error for missing postfilter + +2003-03-31 Monte Ohrt + + * docs/getting-started.sgml + docs/programmers.sgml: + fix typos + +2003-03-27 Messju Mohr + + * NEWS + libs/plugins/modifier.debug_print_var.php: + $length is now propagated to sub-values in debug_print_var + +2003-03-26 Monte Ohrt + + * NEWS: + update header + + * RELEASE_NOTES: + commit changes to release notes + + * (Smarty_2_5_0_RC2) + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + committing RC2 + +2003-03-24 Messju Mohr + + * NEWS + libs/Smarty.class.php: + made clear_cache() ignore compile_id when clearing cache_groups + + * libs/plugins/function.popup.php: + made onmouseout XHTML-compatible in function.popup.php + +2003-03-21 Messju Mohr + + * NEWS + libs/Smarty.class.php: + applied new var-names to fetch() + + * NEWS + libs/Smarty.class.php: + renamed $localvars to $_localvars in cache-file-handling-functions, + added _get_auto_id()-function + +2003-03-21 Monte Ohrt + + * libs/plugins/function.mailto.php + libs/plugins/function.popup.php: + update functions for XHTML compatability + +2003-03-21 Messju Mohr + + * libs/Smarty.class.php: + fixed wrong $auto_id in _read_cache_file() + + * NEWS + libs/Smarty.class.php: + swapped compile_id and cache_id in read_cache_file and write_cache_file + + * libs/Smarty.class.php: + reverted patch for ignoring compile-id back to -r1.364, due to problems + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php: + html_radios and html_checkboxes accept "selected" instead of "checked" + optionally now + + * NEWS + libs/Smarty.class.php: + swapped compile_id and cache_id for cache-file-handling again + +2003-03-20 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + fix notice when no parameter is passed to default + +2003-03-20 Messju Mohr + + * NEWS + libs/Smarty.class.php: + removed notice of undefined var in _rm_auto() + +2003-03-19 Monte Ohrt + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_table.php: + fix a few error messages, follow consistancy format plugin_name: errormsg + + * libs/plugins/function.html_radios.php: + update error messages + + * NEWS + libs/plugins/function.html_radios.php: + add a warning when an array is passed as the 'checked' value of html_radios + +2003-03-19 Messju Mohr + + * NEWS + libs/Smarty_Compiler.class.php: + fixed errormessage in _compile_smarty_ref() + + * NEWS + docs/designers.sgml: + updated docs for html_image + +2003-03-18 Messju Mohr + + * NEWS + libs/Smarty.class.php: + cleaned up calls to readdir() + + * libs/plugins/function.html_options.php: + fixed label for optgroup in html_options + +2003-03-18 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + fix (newly introduced) bug with passing multiple modifiers to a parameter + +2003-03-18 Messju Mohr + + * NEWS + docs/designers.sgml: + updated docs for html_checkboxes, html_options and html_radios + + * libs/plugins/function.html_options.php: + fixed wrong default-"name" in function.html_options.php + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php: + renamed "checkbox" and "radios" to "options" in {html_checkboxes} and + {html_radios} + + * libs/plugins/outputfilter.trimwhitespace.php: + tried to optimize re-replacement in outputfilter.trimwhitespace.php a + little + + * libs/plugins/outputfilter.trimwhitespace.php: + fixed greedy str_replace in outputfilter.trimwhitespace.php + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php: + html_options, html_checkboxes and html_radios now pass-thru all unknown + paramters + +2003-03-17 Messju Mohr + + * NEWS + libs/plugins/function.html_options.php: + html_options passthru all unknown paramters now + +2003-03-17 Monte Ohrt + + * NEWS + libs/plugins/function.html_image.php: + Fix link bug in html_image function, also make output XHTML compatible + + * libs/Smarty_Compiler.class.php: + fix issue of embedded var and escaped double quotes + +2003-03-15 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + back out "@" logic, apply only to default modifier special case + + * libs/Smarty_Compiler.class.php: + fix @ logic, only use upon an echo + + * NEWS + libs/Smarty_Compiler.class.php: + append "@" to template var echoes to supress possible notices + + * NEWS + libs/Smarty_Compiler.class.php: + append "@" to _run_mod_handler to supress warnings + +2003-03-14 Monte Ohrt + + * NEWS + libs/Smarty_Compiler.class.php: + fix problem with escaped double quotes + + * NEWS + libs/plugins/function.html_radios.php: + fixed html_options to not return an array + +2003-03-12 Messju Mohr + + * NEWS + libs/plugins/modifier.truncate.php: + fixed length in modifier.truncate.php + + * NEWS + libs/plugins/outputfilter.trimwhitespace.php: + fixed handling of '$'-signs in trimwhitespace outputfilter (messju) + +2003-03-12 Monte Ohrt + + * docs/programmers.sgml: + update technical explanation of assign_by_ref and append_by_ref + +2003-03-11 Monte Ohrt + + * NEWS + libs/Smarty.class.php: + fix config file recompiling code + +2003-03-07 Monte Ohrt + + * libs/plugins/function.html_image.php: + change E_USER_ERROR to E_USER_NOTICE + + * libs/plugins/function.html_image.php: + suppress warning in html_image + + * NEWS + libs/plugins/function.html_image.php: + update changes to html_image + +2003-03-06 Monte Ohrt + + * docs/designers.sgml + docs/de/appendixes.sgml + docs/de/common.dsl + docs/de/designers.sgml + docs/de/getting-started.sgml + docs/de/html-common.dsl + docs/de/html.dsl + docs/de/manual.sgml + docs/de/preface.sgml + docs/de/programmers.sgml: + add german docs to dist + + * NEWS: + update news file + + * libs/plugins/function.html_image.php: + fix width/height parameter index + + * NEWS + libs/Smarty.class.php: + get rid of unsetting name and script attributes to insert tags + +2003-03-05 Monte Ohrt + + * NEWS + RELEASE_NOTES: + update NEWS file + + * libs/plugins/modifier.string_format.php: + fix argument order, erroneously swapped a while back + + * (Smarty_2_5_0_RC1) + NEWS + README + RELEASE_NOTES + libs/Config_File.class.php + libs/Smarty.class.php + libs/Smarty_Compiler.class.php: + commit final changes for 2.5.0-RC1 + +2003-03-04 Monte Ohrt + + * docs/programmers.sgml: + remove $show_info_header and $show_info_include property vars from docs + +2003-03-03 Monte Ohrt + + * NEWS + libs/plugins/function.popup.php: + fixed PHP notice + +2003-02-28 Monte Ohrt + + * libs/Smarty_Compiler.class.php: + simplify smarty.const.foo and smarty.const.$foo logic + + * libs/Smarty_Compiler.class.php: + only allow $foo syntax in embedded quotes, unless escaped with backticks + then allow any dollar var + + * NEWS + libs/Smarty_Compiler.class.php: + fix "once" var compiling to work with new attr compiling methods for + include_php + + * FAQ + NEWS + README + docs/designers.sgml + docs/getting-started.sgml + libs/Smarty_Compiler.class.php + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php + libs/plugins/function.html_select_date.php + libs/plugins/function.html_select_time.php + libs/plugins/function.html_table.php: + fix $smarty.const.foo compiling, clean up double quoted strings, + allow full dollar var syntax in quotes again + +2003-02-27 Monte Ohrt + + * docs/designers.sgml + docs/programmers.sgml + libs/Smarty_Compiler.class.php: + update docs, fix smarty var compiling, allow any $smarty.*.$foo syntax, + add $`foobar` for embedded variables + + * libs/plugins/function.html_image.php: + update functionality + +2003-02-26 Monte Ohrt + + * NEWS + libs/plugins/modifier.nl2br.php: + add nl2br modifier + + * libs/plugins/function.html_image.php: + add link parameter + +2003-02-24 Monte Ohrt + + * libs/Smarty.class.php + libs/plugins/function.html_image.php: + fix rename problem in windows, unlink first + + * libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_image.php + libs/plugins/function.html_options.php + libs/plugins/function.html_radios.php + libs/plugins/shared.escape_special_chars.php: + update functions with separate escape_special_chars routine + + * NEWS + libs/plugins/function.html_checkboxes.php + libs/plugins/function.html_radios.php: + commit checkboxes, update radios + + * NEWS + libs/Smarty.class.php + libs/plugins/function.html_image.php: + fix bug with get_registered_object + + * NEWS + libs/plugins/modifier.cat.php: + added cat modifier to distribution + + * NEWS + libs/Smarty_Compiler.class.php: + added << >> <> support to IF statements + + * libs/plugins/function.html_radios.php: + apply patch to initial html_radios function + + * NEWS + libs/Smarty.class.php: + fix _assign_smarty_interface to not overwrite keys other than 'request' + + * NEWS + libs/plugins/function.html_radios.php: + added html_radios to distribution + + * NEWS + libs/plugins/modifier.string_format.php: + fixed arg order of string_format + + * NEWS + libs/Smarty.class.php: + use tmp file for file writes, avoid race condition + + * NEWS + libs/Smarty_Compiler.class.php: + add $smarty.config.foo var, handle embedded smarty var correctly + + * NEWS + libs/plugins/function.fetch.php: + silence warnings in fetch plugin + +2003-02-21 Monte Ohrt + + * INSTALL: + update wording + + * INSTALL: + update install instructions + + * AUTHORS + BUGS + CREDITS + QUICKSTART + README + RESOURCES + TESTIMONIALS: + remove some files already in docs or elsewhere + + * demo/index.php: + add templates_c to repository + + * index.php: + move demo files to demo directory + + * Config_File.class.php + Smarty.class.php + Smarty_Compiler.class.php + debug.tpl: + moved lib files under libs directory + +2003-02-20 Monte Ohrt + + * NEWS + Smarty.class.php: + add get_config_vars() method, update get_template_vars() functionality + + * NEWS + Smarty.class.php: + fix minor logic in _fetch_template_info() + + * NEWS + Smarty.class.php: + support merging appended vars + + * NEWS + Smarty.class.php: + fix cache groups behavior with compile_id set + +2003-02-19 Monte Ohrt + + * Smarty.class.php: + back out third parameter, extend functionality of append + + * NEWS + Smarty_Compiler.class.php: + update imbedded vars, allow special $smarty vars + + * plugins/function.html_table.php: + add plugin html_table + + * NEWS + Smarty.class.php: + support appending key=>val pairs + + * NEWS + Smarty_Compiler.class.php: + change embedded variable logic to only recognize $foo and $foo[0][bar] + syntax + + * NEWS + Smarty_Compiler.class.php: + allow null as function attribute value + +2003-02-18 Monte Ohrt + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + support foo->bar[index] syntax + + * Smarty_Compiler.class.php: + allow $foo->bar[0] syntax + +2003-02-17 Monte Ohrt + + * plugins/modifier.escape.php: + fix syntax error from previous commit + + * NEWS + Smarty.class.php: + add error msgs to get_registered_object + + * Smarty.class.php: + add function for getting reference to registered object + + * Smarty_Compiler.class.php: + back out patches for object and objref calls on $smarty var + + * NEWS + Smarty_Compiler.class.php: + treat unrecognized param attribute syntax as a string + + * NEWS + Smarty_Compiler.class.php: + support $smarty.const.$foo syntax + + * NEWS + debug.tpl + plugins/modifier.count_words.php + plugins/modifier.escape.php: + fix E_NOTICE messages + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + add @ and === to if tokens, few param cleanups + +2003-02-16 Greg Beaver + + * ChangeLog + Smarty.class.php + Smarty_Compiler.class.php: + many more phpdoc comment upgrades + +2003-02-15 Greg Beaver + * Smarty.class.php + Smarty_Compiler.class.php + continue cleaning of phpdoc comments. All that is needed is the + addition of @return tags and perhaps a bit more verbose comments + and they are finished. + +2003-02-14 Monte Ohrt + + * NEWS + Smarty.class.php: + enable config_load error messages + + * NEWS + plugins/function.html_options.php: + fix html_options to not escape already escaped entities + + * NEWS + Smarty.class.php: + send Last-Modified header on cache creation, misc tab/spacing cleanup + +2003-02-13 Monte Ohrt + + * Smarty_Compiler.class.php + docs/designers.sgml: + allow dash in plain text + + * NEWS + Smarty_Compiler.class.php: + check strict syntax of function attributes + +2003-02-12 Monte Ohrt + + * NEWS + Smarty_Compiler.class.php: + dropped support for modifiers on object parameters, + added support for objects as modifier parameters + + * NEWS + Smarty_Compiler.class.php + docs/designers.sgml: + fix bug with decimal numbers in if statements, misc doc updates + +2003-02-11 Monte Ohrt + + * (Smarty_2_4_2) + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: + update version numbers + +2003-02-10 Monte Ohrt + + * NEWS + Smarty_Compiler.class.php: + add support for $foo->$bar syntax + + * NEWS: + update NEWS file + + * NEWS + Smarty_Compiler.class.php: + support full var syntax in quoted text, fix problem with const var access, + clean up some more regex code, fix object problem with no properties + +2003-02-06 Monte Ohrt + + * (Smarty_2_4_1) + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: + committed 2.4.1 changes + + * NEWS + Smarty_Compiler.class.php: + ignore case in IF statements + +2003-02-05 Monte Ohrt + + * NEWS + Smarty_Compiler.class.php: + treat undefined constants as null + + * NEWS + Smarty.class.php: + fix problem with inserts and nested fetches + + * Smarty_Compiler.class.php: + fix "if" regex for math tokens + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs/getting-started.sgml: + added support for extracting params to include_php + +2003-02-04 Monte Ohrt + + * RELEASE_NOTES: + reformat text + +2003-02-03 Monte Ohrt + + * NEWS: + update news file + +2003-02-03 Greg Beaver + + * ChangeLog + Smarty.class.php: + begin fixing phpdoc comments in Smarty.class.php + + * ChangeLog + Config_File.class.php: + fixed phpdoc comments + +2003-02-03 Monte Ohrt + + * Smarty_Compiler.class.php: + allow $foo->bar[$x].foo syntax + + * Smarty_Compiler.class.php + index.php + configs/test.conf + templates/index.tpl: + fix accidental commit + + * index.php + configs/test.conf + templates/index.tpl: + allow $foo->bar[$j].blah type of syntax + +2003-02-02 Greg Beaver + + * Smarty.class.php + begin fixing of phpdoc comments + + * Config_File.class.php + fix phpdoc comments, add phpDocumentor docblock templates + +2003-02-02 Monte Ohrt + + * Smarty.class.php + docs/html.dsl + docs/php.dsl: + fix version number + + * (Smarty_2_4_0) + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php + docs/appendixes.sgml + docs/designers.sgml + docs/programmers.sgml: + update Smarty version numbers + +2003-01-30 Monte Ohrt + + * NEWS + Smarty_Compiler.class.php + TODO: + fix order of php tag comparisons + + * NEWS + Smarty_Compiler.class.php: + fix known php tag handling problems + +2003-01-29 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php: + change comments to phpdoc style + +2003-01-28 Monte Ohrt + + * Smarty.class.php + docs/programmers.sgml: + make separate var for compiler file + + * plugins/function.fetch.php: + fix error call + +2003-01-25 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php: + add support for restriction to registered methods + + * plugins/outputfilter.trimwhitespace.php: + update with textarea support + +2003-01-24 Monte Ohrt + + * Smarty_Compiler.class.php: + fix compiling problem with {foreach} tags + + * Smarty.class.php + Smarty_Compiler.class.php: + put objects in own array, add object param format support, change + object syntax from foo.bar to foo->bar + +2003-01-23 Monte Ohrt + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + add support for object registration + +2003-01-22 Monte Ohrt + + * Smarty.class.php: + add file & line number of calling error to error message + +2003-01-21 Monte Ohrt + + * Smarty_Compiler.class.php: + put php style object syntax back in + +2003-01-20 Monte Ohrt + + * Smarty.class.php: + move security settings to fetch function for template_dir + + * NEWS + Smarty.class.php: + fix debug template and security, add template_dir to secure_dir at runtime + +2003-01-17 Monte Ohrt + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + added new object support without new template syntax + +2003-01-15 Monte Ohrt + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + fix if statement syntax for negative integers, fix issue with directories + named '0' + +2003-01-08 Monte Ohrt + + * Smarty.class.php + plugins/function.counter.php + plugins/function.cycle.php + plugins/function.debug.php + plugins/function.eval.php + plugins/function.fetch.php + plugins/function.html_options.php + plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/function.mailto.php + plugins/function.math.php + plugins/function.popup.php + plugins/function.popup_init.php: + update plugins to return values instead of echo, fix config file cache + to include global config variables in cache file + + * Smarty_Compiler.class.php: + fix bug with >= tests in if statements, comment out full object support + +2003-01-06 Monte Ohrt + + * NEWS + docs/html.dsl + plugins/modifier.escape.php: + add javascript escape parameter to escape modifier + +2003-01-02 Monte Ohrt + + * templates/header.tpl: + move the title into head where it should be + +2002-12-24 Monte Ohrt + + * Smarty_Compiler.class.php: + added correct line numbers to smarty syntax error messages + + * docs/programmers.sgml: + update append documentation, make more clear on its function + + * Smarty_Compiler.class.php: + fix modifier matching regexp + +2002-12-23 Monte Ohrt + + * Smarty_Compiler.class.php: + support nested function calls in IF statements + +2002-12-20 Monte Ohrt + + * Smarty_Compiler.class.php: + few more fixes, spaces around function parameters + + * Smarty_Compiler.class.php: + fix misc syntax issues with {if} tags + +2002-12-20 Monte Ohrt + + * Smarty_Compiler.class.php: + fix misc syntax issues with {if} tags + +2002-12-19 Monte Ohrt + + * Smarty_Compiler.class.php: + commit updates, passes all smoke tests + + * NEWS: + update NEWS file + + * Smarty_Compiler.class.php: + fixed literal string not in quotes as parameters + + * NEWS + Smarty_Compiler.class.php: + fix misc syntax issues, add ability to pass modifiers to functions + +2002-12-18 Monte Ohrt + + * NEWS: + update NEWS + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + update compiler code, clean up regex, add new syntax features + +2002-12-16 Monte Ohrt + + * NEWS: + update NEWS file + + * Smarty_Compiler.class.php: + commit updates for objects + +2002-12-14 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php: + fix bug with compiling config files with caching on + +2002-12-13 Monte Ohrt + + * Smarty_Compiler.class.php: + fix problem with matching single quoted strings + + * Smarty_Compiler.class.php: + update embedded variable logic, get rid of ."" at end of output + + * NEWS + docs/designers.sgml + plugins/function.html_select_date.php: + add day_value_format to html_select_date + +2002-12-12 Monte Ohrt + + * plugins/modifier.debug_print_var.php: + fix bug, double escaped values in display + + * Smarty.class.php: + move debug test back into fetch() + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + plugins/outputfilter.trimwhitespace.php: + assigned vars are no longer in global name space, few debug cleanups + +2002-12-11 Monte Ohrt + + * plugins/function.popup.php: + fix error in newline code + + * plugins/function.popup.php: + fix popup to allow newlines in text data + +2002-12-10 Monte Ohrt + + * Smarty.class.php: + fix plugin error logic + + * docs/designers.sgml + docs/programmers.sgml: + edit examples, make more verbose + + * NEWS + plugins/function.html_options.php: + escape html entities in the option values and output + + * NEWS + plugins/function.html_options.php: + fixed bug with label of html_options + +2002-12-09 Monte Ohrt + + * Smarty.class.php: + add support for var_export() + + * Config_File.class.php + Smarty.class.php: + clean up code, respect force_compile and compile_check flags + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs/designers.sgml + plugins/function.mailto.php: + add caching feature to config loading, document update, add mailto plugin + +2002-12-08 Monte Ohrt + + * plugins/function.fetch.php: + fix query part of URL + +2002-12-05 Monte Ohrt + + * docs/designers.sgml: + fix typos + +2002-11-22 Monte Ohrt + + * Smarty_Compiler.class.php: + patch for warning message + +2002-11-21 Monte Ohrt + + * RELEASE_NOTES + Smarty.class.php: + get rid of testing for a set value with assign function, just set to + whatever is passed into the template + + * docs/programmers.sgml: + fix typo + +2002-11-19 Monte Ohrt + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: + commit changes, ready for 2.3.1 release + +2002-11-01 Monte Ohrt + + * plugins/function.html_options.php: + added label attribute to all option outputs, cover w3c spec. + + * NEWS: update NEWS file + + * docs/designers.sgml: update docs for optgroup output + + * plugins/function.html_options.php: + make html_options work with optgroup, make func modular and recursive. + +2002-10-29 Monte Ohrt + + * NEWS + Smarty.class.php: set mtime on compile files so they match source files + +2002-10-18 Monte Ohrt + + * NEWS + Smarty.class.php: added proper support for open_basedir setting + + * docs/designers.sgml: clear up docs on index, iteration and rownum + +2002-10-16 Monte Ohrt + + * plugins/modifier.default.php: fix warning message in default modifier + +2002-09-25 Monte Ohrt + + * docs/designers.sgml + plugins/modifier.strip.php + NEWS: added strip variable modifier + +2002-09-24 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty_Compiler.class.php: + Fix to be able to use $smarty.x variables as arrays. + +2002-09-23 Monte Ohrt + + * Config_File.class.php: + add support for mac/dos formatted config files (fix newlines) + + * docs/programmers.sgml: add optional tags to clear_cache parameters + + * docs/designers.sgml: + fix error with include_php description, add $this to description + +2002-09-20 Monte Ohrt + + * NEWS + docs/getting-started.sgml: fixed errors with example setup docs + +2002-09-16 Monte Ohrt + + * plugins/block.textformat.php + docs/designers.sgml + NEWS: add textformat block function + +2002-09-10 Monte Ohrt + + * docs/designers.sgml: + add assign attribute to cycle function documentation + + * docs/designers.sgml + docs/programmers.sgml: fix typos + +2002-09-09 Monte Ohrt + + * plugins/function.debug.php + templates/header.tpl: + fix header in debug template, fix typo in header.tpl example + +2002-08-15 mohrt + + * docs/programmers.sgml: fix typos + +2002-08-08 mohrt + + * RELEASE_NOTES + Smarty.class.php: + supress warnings from unlink() and is_dir(), let error handler deal with it + +2002-08-07 mohrt + + * docs/appendixes.sgml + docs/designers.sgml + docs/programmers.sgml + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: update files with new version numbers + +2002-08-02 mohrt + + * NEWS: update NEWS file with credits + + * NEWS + Smarty.class.php: added assign_by_ref() and append_by_ref() functions + +2002-08-01 mohrt + + * TODO + NEWS + Smarty.class.php: + changed default warning type for plugin errors from E_USER_WARNING to E_USER_ERROR + +2002-07-29 mohrt + + * plugins/function.html_select_time.php + docs/designers.sgml + NEWS: added paramters to html_select_time plugin + +2002-07-25 Andrei Zmievski + + * TODO: *** empty log message *** + +2002-07-24 mohrt + + * QUICKSTART: update QUICKSTART guide + + * NEWS + debug.tpl + plugins/modifier.debug_print_var.php: + update debug console to show objects, fix warning in debug.tpl + +2002-07-23 mohrt + + * docs/programmers.sgml: fix load_filter examples + + * Config_File.class.php + NEWS: fix error when there are no sections in config file + +2002-07-19 mohrt + + * docs/getting-started.sgml: fix error in install guide + +2002-07-18 mohrt + + * Smarty_Compiler.class.php: + correct the expression match for smarty:nodefaults + +2002-07-17 mohrt + + * Smarty_Compiler.class.php: fix default modifier to work with config vars + + * Smarty_Compiler.class.php: got args to strstr backwards... + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + change default modifiers to array instead of string + + * Smarty_Compiler.class.php + docs/designers.sgml + Smarty.class.php: add default modifier logic, minor doc updates + + * NEWS + Smarty.class.php + plugins/function.popup_init.php: + make popup_init xhtml compliant, minor variable name changes for consistancy + +2002-07-16 mohrt + + * NEWS: update NEWS file + + * plugins/function.debug.php + Smarty.class.php + debug.tpl + NEWS: + fix problem with filenames on windows, add ability to supply expire time in seconds when clearing cache or compiled files + +2002-07-15 mohrt + + * Smarty.class.php: + fixed problem with insert tags when loading function from script attribute + and caching enabled (Monte) + +2002-07-14 mohrt + + * NEWS + Smarty.class.php: fix bug with debug_tpl file path for Windows + +2002-07-12 Monte Ohrt + + * Smarty.class.php: fix append function with array/string issue + +2002-07-11 Monte Ohrt + + * RELEASE_NOTES: update release notes + + * NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php + Config_File.class.php: update files to 2.2.0 tags, get ready for release + +2002-07-09 Monte Ohrt + + * NEWS + Smarty.class.php: make debug.tpl work with any delimiter + + * NEWS + Smarty.class.php: + change tests in append and assign to != '' instead of empty(), which is more accurate + +2002-07-08 Monte Ohrt + + * docs/designers.sgml: minor doc update + + * Smarty.class.php: + cast var as an array, simplify and get rid of PHP warning messages + +2002-07-03 Monte Ohrt + + * Smarty.class.php: one more N + + * Smarty.class.php: + prepend "N" to filenames to avoid possible OS issues with dir names starting with "-" + + * Smarty.class.php: only set $debug_tpl in constructor if empty + + * Smarty.class.php + docs/designers.sgml + docs/getting-started.sgml + docs/programmers.sgml: + make use_sub_dirs go back to crc32 for subdir separation + +2002-06-29 Monte Ohrt + + * plugins/function.eval.php: do nothing if $val is empty + + * TODO + plugins/function.eval.php + plugins/function.popup_init.php: + add zindex to popup init, fix error message for eval. + +2002-06-27 Monte Ohrt + + * Smarty.class.php: + only loop through relative paths for PHP include_path, remove $_relative variable + + * Smarty_Compiler.class.php: added {$smarty.version} variable + +2002-06-26 Monte Ohrt + + * docs/appendixes.sgml + docs/designers.sgml + docs/getting-started.sgml + docs/programmers.sgml + Smarty.class.php: + update plugin loading logic, look in SMARTY_DIR, then cwd. If all fail, then retry all with include_path + + * templates/header.tpl + Smarty.class.php: update get_include_path, get _path_array only once + + * Smarty.class.php: fix get_include_path function for windows + + * Smarty.class.php: update plugin search logic + + * Smarty.class.php: only search include_path if relative path + + * plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/modifier.date_format.php + Smarty_Compiler.class.php + NEWS + Smarty.class.php: allow plugins_dir to be an array of directories + +2002-06-25 Monte Ohrt + + * docs/programmers.sgml + docs/getting-started.sgml: update installation docs + + * debug.tpl + docs/getting-started.sgml + templates/debug.tpl + NEWS + Smarty.class.php: move debug.tpl to SMARTY_DIR, add to constructor + +2002-06-24 Monte Ohrt + + * plugins/function.assign_debug_info.php + NEWS: fixed warning message in function.assign_debug_info + + * Smarty.class.php: update include_path fixes + + * NEWS: + fixed $template_dir, $compile_dir, $cache_dir, $config_dir to respect include_path + +2002-06-23 Monte Ohrt + + * plugins/shared.make_timestamp.php: + update timestamp plugin to work when passed a timestamp + +2002-06-19 Monte Ohrt + + * NEWS: update NEWS file + + * plugins/modifier.date_format.php + docs/designers.sgml: + update date_format, allow optional 2nd paramater as default date if passed date is empty. update docs. + + * plugins/modifier.date_format.php: + fix date_format modifier, return nothing if given empty string + +2002-06-18 Monte Ohrt + + * NEWS + plugins/function.cycle.php: + gave $reset a default value in cycle function + + * plugins/function.html_select_date.php + plugins/shared.make_timestamp.php + NEWS: + corrected warnings in html_select_time function, made make timestamp always return a timestamp + +2002-06-17 Monte Ohrt + + * Smarty.class.php: swapped around cache_id and compile_id order + +2002-06-14 Monte Ohrt + + * docs/programmers.sgml + plugins/function.popup_init.php + Smarty.class.php: + change directory delimiter to "^" for cache and compile files + +2002-06-13 Andrei Zmievski + + * TODO: done. + + * Smarty_Compiler.class.php: + Optimize the calculation of section 'total' property. + +2002-06-11 Monte Ohrt + + * NEWS + Smarty.class.php: + added support for subdir exclusion, deletion by full or partial cache_id and compile_id, change file format to urlencoded values instead of crc32 + +2002-06-07 Monte Ohrt + + * Smarty.class.php: fix bug with last_modified_check code + + * NEWS + Smarty.class.php: + updated $GLOBALS refererence for HTTP_IF_MODIFIED_SINCE + +2002-06-06 Monte Ohrt + + * docs/designers.sgml + overlib.js: + remove overlib.js file from distribution, update plugin and docs + +2002-06-05 Monte Ohrt + + * docs/designers.sgml + NEWS + Smarty.class.php: fix 304 Not Modified, don't send content + +2002-06-03 Monte Ohrt + + * plugins/function.cycle.php: update version number + + * plugins/function.cycle.php + NEWS: + fixed cycle function to respect delimiter setting after initial setting + + * Smarty.class.php + NEWS: + update $GLOBALS references to work properly with track_globals settings + + * plugins/function.math.php: fixed bug with call $assign + + * docs/appendixes.sgml + docs/designers.sgml + plugins/function.html_options.php + plugins/function.html_select_time.php + NEWS + Smarty.class.php + Smarty_Compiler.class.php: + optimized for loops with count() function calls + +2002-06-01 Andrei Zmievski + + * TODO: *** empty log message *** + +2002-05-21 Monte Ohrt + + * NEWS: update NEWS file + + * plugins/function.html_select_date.php + RESOURCES + docs/designers.sgml + Config_File.class.php: + update html_select_date with month_value_format attribute for controlling the format of the month values. + +2002-05-17 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: + Made it possible to use simple variables inside [] for indexing. + +2002-05-16 Monte Ohrt + + * docs/designers.sgml + docs/getting-started.sgml + NEWS + Smarty.class.php + Smarty_Compiler.class.php + TESTIMONIALS: add "once" attribute to php_include, update docs + +2002-05-09 Andrei Zmievski + + * NEWS + TODO: *** empty log message *** + +2002-05-07 Monte Ohrt + + * plugins/function.cycle.php: remove \n from cycle function + + * docs/designers.sgml + plugins/function.cycle.php + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php + NEWS: + update cycle function to handle array as input, update files to 2.1.1 + +2002-05-06 Monte Ohrt + + * plugins/function.fetch.php: + update fetch function with more error checking + +2002-05-03 Monte Ohrt + + * docs/designers.sgml + plugins/function.counter.php: + update counter to use name instead of id (id still works though) + + * plugins/function.cycle.php + docs/designers.sgml: rename id to name for cycle function + + * plugins/function.cycle.php: + update cycle function to allow blank values parameter after initialized + + * plugins/function.cycle.php: fix syntax error + +2002-05-02 Monte Ohrt + + * plugins/function.cycle.php: ugh, another typo + + * plugins/function.cycle.php: update comments + + * docs/designers.sgml + plugins/function.cycle.php + NEWS: added function cycle + + * FAQ + Smarty.class.php: fix register_outputfilter function + +2002-05-01 Monte Ohrt + + * docs/designers.sgml + NEWS + Smarty.class.php: fixed bug with resource testing and include_path + +2002-04-30 Monte Ohrt + + * NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: update files for 2.1.0 release + +2002-04-30 Andrei Zmievski + + * plugins/function.fetch.php + docs/programmers.sgml + Smarty.class.php: Fix. + +2002-04-29 Andrei Zmievski + + * docs/programmers.sgml + docs/designers.sgml: A whole bunch of docs. + +2002-04-26 Monte Ohrt + + * FAQ + QUICKSTART + docs/programmers.sgml: update FAQ, QUICKSTART, small doc syntax fix + +2002-04-24 Monte Ohrt + + * docs/programmers.sgml + templates/debug.tpl + Smarty.class.php: changed doc structure a bit + +2002-04-16 Andrei Zmievski + + * Smarty.class.php: Add register/unregister API for output filters. + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + TODO: + Changed the way filters are loaded, which now has to be done explicitly, + either through load_filter() API or by filling in $autoload_filters variable. + Also renamed internal variable to avoid namespace pollution. + +2002-04-15 Andrei Zmievski + + * Smarty.class.php: + Fixed _get_php_resource() to take include_path into account. + +2002-04-15 Monte Ohrt + + * docs/designers.sgml: + update docs, get modifiers and functions into index for easy access + + * docs/programmers.sgml + NEWS + Smarty.class.php: update caching documentation + +2002-04-15 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty.class.php: Only turn down error notices if $debugging is false. + +2002-04-15 Monte Ohrt + + * NEWS: update NEWS file + + * plugins/function.html_select_date.php: + fixed logic so this works right when field_separator = "/" + + * plugins/function.html_select_date.php: + fix regular expression for matching date + +2002-04-13 Monte Ohrt + + * docs/designers.sgml: updated html_select_date docs to reflect changes + + * NEWS + plugins/function.html_select_date.php: + added YYYY-MM-DD support to html_select_date + +2002-04-12 Andrei Zmievski + + * TESTIMONIALS: New entry. + +2002-04-12 Monte Ohrt + + * plugins/modifier.strip_tags.php: back out changes to strip_tags + + * docs/programmers.sgml: update docs regarding cache_lifetime + + * plugins/modifier.strip_tags.php + Smarty.class.php: + update cache_lifetime logic: -1 = never expire, 0 = always expire + +2002-04-11 Andrei Zmievski + + * BUGS + FAQ + INSTALL + NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs/getting-started.sgml: + Fixed directory separtor issue. Requiring PHP 4.0.6 now. + + * NEWS + Smarty_Compiler.class.php: + Added ability to use simple variables for array indices or object properties. + + * TESTIMONIALS: Another one. + + * TESTIMONIALS: Adding one from Mark P. + +2002-04-05 Andrei Zmievski + + * Smarty_Compiler.class.php + NEWS + Smarty.class.php: Make it possible to unregister pre/postfilter plugins. + +2002-04-05 Monte Ohrt + + * INSTALL: Remove addons file from INSTALL instructions + +2002-04-04 Monte Ohrt + + * docs/designers.sgml: update doc error + + * docs/designers.sgml + plugins/modifier.escape.php + NEWS + Smarty.class.php: added htmlall attribute to escape modifier + +2002-04-03 Andrei Zmievski + + * Smarty_Compiler.class.php: Fixed undefined offset warning in {if} tag. + + * Smarty.class.php + NEWS: Added template_exists() API. + + * Smarty.class.php + Smarty_Compiler.class.php + NEWS: + - Added $smarty.template variable. + - Fixed {include_php} tag when dynamic values were used for 'file' attribute. + + * Config_File.class.php: Separator setting fix. + +2002-03-28 Monte Ohrt + + * FAQ + README: add digest address + + * FAQ + README + Smarty.class.php: update mailing list addresses + +2002-03-28 Andrei Zmievski + + * NEWS: *** empty log message *** + + * plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/modifier.date_format.php: + Fix for when plugins directory is not the default one. + +2002-03-28 Andrei Zmievski + + * NEWS: *** empty log message *** + + * plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/modifier.date_format.php: + Fix for when plugins directory is not the default one. + +2002-03-27 Monte Ohrt + + * FAQ: update FAQ page + +2002-03-26 Andrei Zmievski + + * CREDITS + NEWS + Smarty.class.php + Smarty_Compiler.class.php + TODO: Block functions changes. + + * Config_File.class.php: *** empty log message *** + +2002-03-25 Andrei Zmievski + + * Smarty.class.php + Smarty_Compiler.class.php: Initial implementation of block functions. + +2002-03-22 Monte Ohrt + + * docs/designers.sgml: fix documentation error in capture + +2002-03-22 Andrei Zmievski + + * Smarty.class.php: *** empty log message *** + + * Smarty.class.php: Turn off notices. + +2002-03-21 Andrei Zmievski + + * Smarty_Compiler.class.php: Make _current_file available to prefilters. + + * NEWS + Smarty.class.php: + Made is possible to assign variables in pre/postfilters. + +2002-03-20 Andrei Zmievski + + * plugins/function.html_select_date.php: Fixed +/- functionality. + + * NEWS: *** empty log message *** + +2002-03-20 Monte Ohrt + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.class.php + Smarty_Compiler.class.php: update version numbers + + * plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/modifier.date_format.php: + move .make_timestamp.php to shared.make_timestamp.php + + * NEWS + Smarty.class.php + docs/designers.sgml + plugins/function.fetch.php + plugins/function.html_select_date.php: + update file generation, replace crc32() '-' with 'N' + +2002-03-20 Andrei Zmievski + + * Smarty_Compiler.class.php: *** empty log message *** + +2002-03-19 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty.class.php + Smarty_Compiler.class.php: + Fix plugin behavior for inserts with script attribute. + + * NEWS: *** empty log message *** + + * Smarty_Compiler.class.php: Fix bug with $smarty.cookies. + + * TESTIMONIALS: *** empty log message *** + +2002-03-15 Monte Ohrt + + * NEWS + docs/designers.sgml: update Changelog + + * plugins/modifier.indent.php + plugins/modifier.wordwrap.php: add wordwrap and indent to repository + +2002-03-14 Monte Ohrt + + * Smarty.class.php: + remove show_info_include and show_info_header functions + +2002-03-13 Monte Ohrt + + * plugins/function.fetch.php: update fetch function + + * plugins/function.fetch.php: update fetch function with new parameters + +2002-03-12 Monte Ohrt + + * docs/designers.sgml: update doc tables + + * docs/designers.sgml: update docs columns + + * docs/getting-started.sgml + docs/appendixes.sgml: update docs + + * TESTIMONIALS + docs/appendixes.sgml: update syntax error in docs, add to testimonials + +2002-03-04 Monte Ohrt + + * FAQ + README: update FAQ, README with digest mode info + +2002-03-02 Monte Ohrt + + * QUICKSTART: update quickstart + + * Smarty.class.php: + change behavior so cache_lifetime = 0 never expires (instead of always regenerate) + +2002-03-01 Monte Ohrt + + * docs/designers.sgml: update doc example + +2002-03-01 Andrei Zmievski + + * CREDITS + RELEASE_NOTES + TODO + NEWS: *** empty log message *** + +2002-03-01 Monte Ohrt + + * docs/appendixes.sgml + docs/designers.sgml + docs/getting-started.sgml + docs/programmers.sgml: update document id tags + + * docs.sgml: remove docs.sgml + + * RESOURCES + Smarty.class.php: update resources + +2002-02-28 Andrei Zmievski + + * TESTIMONIALS + docs/appendixes.sgml + docs/designers.sgml + docs/programmers.sgml: *** empty log message *** + +2002-02-27 Andrei Zmievski + + * plugins/function.eval.php + docs/designers.sgml: *** empty log message *** + +2002-02-27 Monte Ohrt + + * plugins/function.eval.php: added eval function to plugin dir + +2002-02-27 Andrei Zmievski + + * NEWS: *** empty log message *** + +2002-02-27 Monte Ohrt + + * docs/designers.sgml: fix syntax error + + * docs/appendixes.sgml + docs/designers.sgml + docs/getting-started.sgml + docs/programmers.sgml: convert technical notes to docbook format + + * NEWS + docs/designers.sgml: added "eval" plugin docs + +2002-02-26 Andrei Zmievski + + * docs/programmers.sgml + docs/designers.sgml + docs/appendixes.sgml + docs/getting-started.sgml + docs/html-common.dsl + docs/.cvsignore: *** empty log message *** + + * docs/appendixes.sgml + docs/common.dsl + docs/designers.sgml + docs/getting-started.sgml + docs/html-common.dsl + docs/html.dsl + docs/manual.sgml + docs/preface.sgml + docs/programmers.sgml: Split up docs. + +2002-02-25 Andrei Zmievski + + * docs.sgml: *** empty log message *** + +2002-02-22 Monte Ohrt + + * docs.sgml: update docs + +2002-02-22 Andrei Zmievski + + * docs.sgml + AUTHORS + NEWS: *** empty log message *** + +2002-02-21 Monte Ohrt + + * Config_File.class.php + NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: update misc changes + +2002-02-21 Andrei Zmievski + + * docs.sgml: *** empty log message *** + +2002-02-20 Monte Ohrt + + * docs.sgml: misc updates + +2002-02-20 Andrei Zmievski + + * docs.sgml: *** empty log message *** + + * Smarty.class.php + plugins/function.assign.php + plugins/function.assign_debug_info.php + plugins/function.counter.php + plugins/function.fetch.php + plugins/function.math.php + plugins/function.popup.php + plugins/function.popup_init.php + plugins/modifier.escape.php: Fixup some naming. + +2002-02-20 Monte Ohrt + + * docs.sgml: update docs + +2002-02-20 Andrei Zmievski + + * docs.sgml: *** empty log message *** + +2002-02-20 Monte Ohrt + + * NEWS + docs.sgml + plugins/modifier.escape.php: + removed global vars from fetch function, added attrs to escape modifier + + * docs.sgml: add plugin chapter outline + +2002-02-19 Monte Ohrt + + * README + RELEASE_NOTES + RESOURCES + Smarty.class.php + docs.sgml + BUGS + FAQ + INSTALL + QUICKSTART: update docs + +2002-02-19 Andrei Zmievski + + * docs.sgml: Updated resources docs. + + * README: *** empty log message *** + + * docs.sgml: Updated description of {$smarty} variable. + + * BUGS + FAQ + INSTALL + QUICKSTART + RELEASE_NOTES + docs.sgml: Remove PEAR notes. + +2002-02-18 Andrei Zmievski + + * Config_File.class.php + NEWS: Removed dependency on PEAR. + +2002-02-18 Monte Ohrt + + * NEWS + docs.sgml + plugins/function.popup_init.php: add src attribute to popup_init + +2002-02-15 Andrei Zmievski + + * Smarty_Compiler.class.php + plugins/modifier.debug_print_var.php + NEWS + Smarty.class.php: Performance enhancements. + +2002-02-06 Andrei Zmievski + + * plugins/function.html_options.php: + Fix html_options output to be XHTML compatible. + +2002-02-05 Andrei Zmievski + + * Smarty.class.php + Smarty_Compiler.class.php: Fix up plugin inclusion. + + * Smarty.class.php + Smarty_Compiler.class.php + TODO + plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/modifier.date_format.php: Fix plugin directory access. + +2002-02-04 Andrei Zmievski + + * .cvsignore + Smarty_Compiler.class.php: *** empty log message *** + +2002-01-31 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + TODO + plugins/function.assign.php + plugins/function.assign_debug_info.php + plugins/function.counter.php + plugins/function.fetch.php + plugins/function.html_options.php + plugins/function.html_select_date.php + plugins/function.html_select_time.php + plugins/function.math.php + plugins/function.popup.php + plugins/function.popup_init.php + plugins/modifier.capitalize.php + plugins/modifier.count_characters.php + plugins/modifier.count_paragraphs.php + plugins/modifier.count_sentences.php + plugins/modifier.count_words.php + plugins/modifier.date_format.php + plugins/modifier.debug_print_var.php + plugins/modifier.default.php + plugins/modifier.escape.php + plugins/modifier.lower.php + plugins/modifier.regex_replace.php + plugins/modifier.replace.php + plugins/modifier.spacify.php + plugins/modifier.string_format.php + plugins/modifier.strip_tags.php + plugins/modifier.truncate.php + plugins/modifier.upper.php + plugins/shared.make_timestamp.php + templates/index.tpl + AUTHORS + CREDITS + Config_File.class.php + README: Implemented plugin architecture. + + * NEWS: *** empty log message *** + +2002-01-30 Monte Ohrt + + * NEWS + Smarty.addons.php + Smarty.class.php + docs.sgml: added modifiers wordwrap and indent + +2002-01-28 Monte Ohrt + + * Smarty.class.php + docs.sgml: + add support for is-modified-since headers, adjust a doc example + +2002-01-24 Monte Ohrt + + * Smarty.class.php: cleanup formatting + + * NEWS + Smarty.class.php + docs.sgml: update ChangeLog, remove insert_tag_check parameter + +2002-01-24 Andrei Zmievski + + * plugins/standard.plugin.php: *** empty log message *** + +2002-01-24 Monte Ohrt + + * Smarty.class.php: fix syntax error + + * Smarty.class.php: removed unneccesary test from fetch() + +2002-01-23 Monte Ohrt + + * Smarty.addons.php: update overlib fixes + + * NEWS: update changelog + + * FAQ + NEWS + RESOURCES + Smarty.addons.php: updated overlib fixes + +2001-12-31 Andrei Zmievski + + * NEWS + Smarty.class.php: Fixed compile_id problem. + +2001-12-28 Monte Ohrt + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + fixed problem with using assigned var with include_php filepath + +2001-12-21 Monte Ohrt + + * RESOURCES: update RESOURCES + +2001-12-20 Monte Ohrt + + * FAQ + README: update FAQ + +2001-12-18 Monte Ohrt + + * Smarty_Compiler.class.php + docs.sgml + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php: update version numbers + +2001-12-18 Andrei Zmievski + + * NEWS + Smarty.class.php: Fixed clear_cache(). + +2001-12-14 Monte Ohrt + + * NEWS + Smarty.addons.php: + fixed bug in smarty_make_timestamp introduced in PHP 4.1.0 + +2001-12-13 Monte Ohrt + + * NEWS + Smarty.class.php + docs.sgml: update default function args, fix cached insert debug timing + +2001-12-12 Monte Ohrt + + * docs.sgml: fix syntax error in documentation + + * Smarty.class.php: update default template handling functionality + +2001-12-11 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php: update file fetching logic + +2001-12-11 Andrei Zmievski + + * NEWS + Smarty.class.php: Added 'script' attribute to {insert..}. + +2001-12-10 Monte Ohrt + + * NEWS + Smarty.class.php: added default template function handler + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: update version numbers in files to 1.5.1 + +2001-12-10 Andrei Zmievski + + * NEWS + Smarty.class.php: Removed error message from the _read_file() method. + + * Smarty.class.php: Fix check for compile and cache IDs. + +2001-12-06 Monte Ohrt + + * QUICKSTART: fix spelling error in QUICKSTART + + * docs.sgml: fixed spelling errors in documenation + + * Smarty_Compiler.class.php + docs.sgml + Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php: commit 1.5.0 release + + * RESOURCES + docs.sgml: added RESOURCES file + +2001-12-05 Andrei Zmievski + + * Smarty_Compiler.class.php: Refactor. + +2001-12-05 Monte Ohrt + + * NEWS + Smarty_Compiler.class.php + docs.sgml: added assign to include and php_include + + * Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: *** empty log message *** + +2001-12-04 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: Formatting. + +2001-12-04 Monte Ohrt + + * Smarty_Compiler.class.php + NEWS + Smarty.class.php: update ChangeLog + +2001-12-04 Andrei Zmievski + + * NEWS + Smarty.class.php: Formatting. + +2001-12-04 Monte Ohrt + + * Smarty.class.php: removed SMARTY_DIR setting in constructor + + * Smarty.class.php: fix Smarty.class.php indention error + + * Smarty.class.php: update trusted logic + +2001-12-03 Monte Ohrt + + * Smarty.class.php: + fix up is_secure, is_trusted, make _parse_tpl_path function + + * Smarty.class.php: fix problem with testing SMARTY_DIR as empty + + * NEWS + docs.sgml: update documentation, change log + + * Smarty.class.php: + update constructor to check for SMARTY_DIR before assigning + +2001-12-03 Andrei Zmievski + + * NEWS + Smarty.class.php: *** empty log message *** + +2001-12-03 Monte Ohrt + + * FAQ + INSTALL + RELEASE_NOTES: update a few files + + * NEWS + QUICKSTART + Smarty.class.php + docs.sgml: added trusted_dir functionality, cleaned up secure_dir logic + +2001-12-03 Andrei Zmievski + + * NEWS: *** empty log message *** + + * NEWS + Smarty.class.php: - Introduced $compile_id class variable. + - Fixed a situation where if $cache_id and $compile_id were both null + they were passed to auto functions as empty string instead of null. + +2001-11-30 Monte Ohrt + + * NEWS + Smarty.class.php: + change variable names in fetch() fuction to smarty_* to avoid namespace conflicts + + * NEWS + Smarty.class.php: fixed bug in _rm_auto with catenated null values + +2001-11-29 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: Added $smarty.section.* syntax. + + * Smarty_Compiler.class.php: Made 'name' attribute optional for {foreach}. + +2001-11-29 Monte Ohrt + + * Smarty.class.php + index.php: remove assign "now" in index.tpl + +2001-11-29 Andrei Zmievski + + * NEWS + Smarty.addons.php + Smarty.class.php: Fix formatting. + +2001-11-28 Monte Ohrt + + * NEWS + Smarty.class.php + docs.sgml: + removed return statements from _read_cache_file (how did they get in there?) + +2001-11-27 Monte Ohrt + + * docs.sgml + NEWS + Smarty.addons.php + Smarty.class.php: + fixed bugs and added assign attribute to several functions + +2001-11-27 Andrei Zmievski + + * NEWS: Some rewording. + + * Smarty_Compiler.class.php: Fix $smarty.capture access. + + * TODO: *** empty log message *** + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + Made {config_load ..} merge globals from each config file only once per scope. + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: - Added {foreach ...}. + - Made certain $smarty.* references handled at compilation time. + +2001-11-26 Monte Ohrt + + * Config_File.class.php + NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: commit cache handler functionality + +2001-11-20 Andrei Zmievski + + * NEWS + Smarty.addons.php + Smarty_Compiler.class.php: Various fixes and additions. + + * NEWS + index.php: *** empty log message *** + +2001-11-05 Monte Ohrt + + * Smarty.class.php: changed _read_file parameter from $end to $lines + + * NEWS + Smarty.class.php: fixed is_cache, make cache reading more efficient + +2001-11-02 Monte Ohrt + + * FAQ + NEWS: update FAQ with mailing list Reply-To header FAQ + + * NEWS + Smarty.class.php + index.php: supress fopen errors, return false if cache file won't load + +2001-11-01 Monte Ohrt + + * QUICKSTART + docs.sgml + index.php: update QUICKSTART guide with index key example + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: commit all updates for 1.4.6 + +2001-11-01 Andrei Zmievski + + * NEWS: *** empty log message *** + +2001-10-30 Monte Ohrt + + * Smarty.addons.php: fix assign function problem with empty value passed + + * NEWS + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + templates/debug.tpl: + fixed bug in assign function when passing an empty value + +2001-10-26 Monte Ohrt + + * Smarty.addons.php + Smarty.class.php + index.php: fix minor typo in debug code + +2001-10-26 Andrei Zmievski + + * Smarty.class.php: Typo. + +2001-10-26 Monte Ohrt + + * Smarty.addons.php: + update debug console output, handle html encoding correctly + +2001-10-26 Andrei Zmievski + + * Smarty.addons.php + templates/debug.tpl: Debug formatting. + + * Smarty.class.php: Disable rmdir warning. + +2001-10-26 Monte Ohrt + + * Smarty.addons.php + Smarty.class.php + templates/debug.tpl: update debugging to expand array variables + + * Smarty.class.php + docs.sgml: + update docs for fetching only timestamp with custom template source functions + + * Smarty.addons.php: fix debug console error + +2001-10-26 Andrei Zmievski + + * docs.sgml: Typos. + + * Smarty.addons.php: Cleanup whitespace. + + * Smarty_Compiler.class.php: Clean up whitespace. + + * Smarty.class.php: Cleaning up code, formatting mostly. + + * NEWS: *** empty log message *** + +2001-10-25 Monte Ohrt + + * NEWS + docs.sgml: update documentation to current version + + * NEWS + Smarty.addons.php: + updated fetch to give proper warning when fetching unreadable or nonexistant files + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + fixed problem with newline at the end of compiled templates + + * NEWS + Smarty.class.php: recompile cache if config file gets modified too. + + * NEWS + Smarty.class.php: + added feature to regenerate cache if compile_check is enabled and an + involved template is modified + +2001-10-23 Monte Ohrt + + * Smarty.class.php: fix indent for insert tags in debug console + + * templates/debug.tpl: update debug.tpl file format + + * NEWS + Smarty.addons.php + Smarty.class.php + templates/debug.tpl: + update execution time debugging, move into include list + +2001-10-10 Monte Ohrt + + * NEWS + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: + fixed up execution time output in debug console + +2001-10-09 Andrei Zmievski + + * Config_File.class.php + NEWS + Smarty.class.php + TODO: Added support for hidden config vars. + +2001-10-04 Monte Ohrt + + * NEWS + Smarty.addons.php + Smarty.class.php + templates/debug.tpl: added execution times to debug console + +2001-10-02 Andrei Zmievski + + * Smarty_Compiler.class.php: Add space. + +2001-10-01 Andrei Zmievski + + * Smarty.class.php: Fix reference to compile_id. + +2001-09-28 Andrei Zmievski + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: Added postfilter functions. + +2001-09-26 Andrei Zmievski + + * NEWS + Smarty.class.php + docs.sgml: Rename to clear_compiled_tpl(). + +2001-09-25 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: + Fixed line number reporting when removing comments. + +2001-09-20 Monte Ohrt + + * NEWS + RELEASE_NOTES + Smarty.addons.php: made html_options output xhtml compatible + +2001-09-19 Monte Ohrt + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + templates/debug.tpl: updated version numbers + +2001-09-16 Monte Ohrt + + * FAQ + NEWS + docs.sgml: fix doc error with insert function + +2001-09-06 Andrei Zmievski + + * NEWS: *** empty log message *** + +2001-08-31 Monte Ohrt + + * NEWS: update ChangeLog + + * overlib.js + Smarty.addons.php + Smarty.class.php + docs.sgml: + update overlib to 3.50, adjust addon code so that the overlib.js file isn't modified + +2001-08-31 Andrei Zmievski + + * Smarty.class.php: - compile_id changes + + * NEWS + Smarty.addons.php: - compile_id support + - new options for html_select_date + +2001-08-23 Andrei Zmievski + + * TODO: *** empty log message *** + +2001-08-10 Andrei Zmievski + + * NEWS + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: + Modified to pass Smarty object as second parameter to insert functions. + Also moved _smarty_mod_handler() and _smarty_insert_handler() into the class. + + * NEWS + Smarty_Compiler.class.php: + Passing Smarty as second parameter to prefilter functions. + +2001-08-09 Andrei Zmievski + + * NEWS: *** empty log message *** + +2001-08-09 Monte Ohrt + + * templates/index.tpl + Smarty.class.php: add smarty.now variable to template + +2001-08-06 Monte Ohrt + + * templates/index.tpl: change config_load section back to setup + +2001-08-06 Andrei Zmievski + + * Smarty.addons.php: Optimize a bit. + +2001-08-04 Monte Ohrt + + * docs.sgml: update capture documentation + +2001-08-03 Monte Ohrt + + * FAQ + NEWS + Smarty.class.php: + fix bug with URL controlled debugging, works now (Monte) + +2001-08-01 Andrei Zmievski + + * Config_File.class.php: *** empty log message *** + + * Smarty_Compiler.class.php + Smarty.class.php: - Fixed some E_NOTICE stuff in compiler. + - Generalized assign_smarty_interface() a bit. + +2001-07-24 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php + TODO: See ChangeLog for details. + +2001-07-20 Andrei Zmievski + + * Config_File.class.php: Booleanize case-insensitively. + +2001-07-17 Monte Ohrt + + * NEWS: update ChangeLog + + * Smarty.class.php + docs.sgml: put SMARTY_DIR on Config_File require + +2001-07-11 Monte Ohrt + + * docs.sgml + FAQ + NEWS + Smarty.class.php: + updated security to not include insecure docs, only warning + +2001-07-10 Andrei Zmievski + + * Smarty.class.php: Adding 'sizeof' as an allowed {if} function. + +2001-07-06 Andrei Zmievski + + * NEWS: *** empty log message *** + +2001-07-06 Monte Ohrt + + * Config_File.class.php + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: update version number to 1.4.4 + + * NEWS + Smarty.addons.php + Smarty_Compiler.class.php + docs.sgml + templates/header.tpl + templates/index.tpl: update documenatation, template examples + +2001-07-03 Andrei Zmievski + + * NEWS + Smarty.class.php: Implemented access to request vars via $smarty var. + + * NEWS + Smarty_Compiler.class.php: + Fixed a bug with parsing function arguments in {if} tags. + +2001-06-30 Monte Ohrt + + * NEWS: update ChangeLog + +2001-06-29 Monte Ohrt + + * Smarty.addons.php + Smarty.class.php + docs.sgml + overlib.js: + moved overlib to separate file, added SMARTY_DIR, documented. added much documentation + +2001-06-29 Andrei Zmievski + + * NEWS + RELEASE_NOTES + TODO: *** empty log message *** + +2001-06-29 Monte Ohrt + + * NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + docs.sgml + index.php + templates/debug.tpl + templates/header.tpl + templates/index.tpl: update release notes + +2001-06-27 Andrei Zmievski + + * Smarty_Compiler.class.php: *** empty log message *** + + * NEWS + Smarty_Compiler.class.php: Implemented 'step' section attribute. + + * Smarty_Compiler.class.php: Negative values of 'max' will mean no max. + + * AUTHORS + NEWS: *** empty log message *** + +2001-06-26 Andrei Zmievski + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + index.php: Added 'max' and 'start' section attributes. + Added 'total' and 'iteration' section properties. + +2001-06-25 Andrei Zmievski + + * Config_File.class.php + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: Update version numbers. + +2001-06-23 Andrei Zmievski + + * TODO: *** empty log message *** + +2001-06-21 Andrei Zmievski + + * Config_File.class.php + NEWS: Fixed booleanization bug. + +2001-06-20 Monte Ohrt + + * docs.sgml: + update documents to reflect changes to cached content & debugging + +2001-06-20 Andrei Zmievski + + * Smarty.addons.php + Smarty.class.php: Remove debug output for cached and fetched cases. + +2001-06-20 Monte Ohrt + + * Smarty.class.php: update include_info to false + + * Smarty.class.php + docs.sgml + index.php + templates/footer.tpl: + moved debug logic into Smarty completely, created flags for it + +2001-06-19 Andrei Zmievski + + * Smarty.addons.php + Smarty.class.php + templates/debug.tpl: *** empty log message *** + + * NEWS + Smarty.class.php: Remove unneeded debug functions. + +2001-06-19 Monte Ohrt + + * NEWS + Smarty.addons.php + Smarty.class.php + docs.sgml + templates/debug.tpl + templates/footer.tpl: commit updates, add debug template + +2001-06-19 Andrei Zmievski + + * Smarty.class.php + Smarty_Compiler.class.php + TODO: + Moved config loading code inside main class, the compiled template now + simply calls that method. + +2001-06-15 Andrei Zmievski + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + templates/index.tpl: * moved config array into class itself + * added 'scope' attribute for config_load + + * Smarty_Compiler.class.php + Smarty.addons.php + Smarty.class.php: Finishing up secure mode. + +2001-06-15 Monte Ohrt + + * NEWS: update ChangeLog + + * Smarty_Compiler.class.php: cleaned up logic of if statement security + + * Smarty_Compiler.class.php: update if logic to cover more situations + + * Smarty_Compiler.class.php + docs.sgml: update if statement security feature + +2001-06-14 Andrei Zmievski + + * Smarty.addons.php + Smarty.class.php: *** empty log message *** + + * NEWS + Smarty_Compiler.class.php: + Fixed a bug with quoted strings inside if statements. + +2001-06-13 Monte Ohrt + + * Smarty.addons.php + Smarty.class.php: added secure_dir array for multiple secure directories + + * Smarty.addons.php: update fetch funtion to respect security setting + + * NEWS + Smarty.addons.php + Smarty.class.php + docs.sgml: update documentation, changelog + + * Smarty.addons.php + Smarty.class.php: moved _extract setting to assign functions + + * Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: + added assign/unassign custom functions, ability to re-extract tpl_vars + + * Smarty.class.php + Smarty_Compiler.class.php + docs.sgml + index.php: commit security features + +2001-06-11 Andrei Zmievski + + * Smarty.class.php: Version variable typo. + +2001-06-05 Andrei Zmievski + + * Smarty.class.php: + Create config object in fetch() or just set the config path if it already + exists. + +2001-06-04 Andrei Zmievski + + * Smarty.class.php: *** empty log message *** + + * NEWS + Smarty_Compiler.class.php: + Fixed a problem with $ inside strip tags. + +2001-05-31 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Config_File.class.php: Allow empty config_path. + +2001-05-29 Monte Ohrt + + * Smarty_Compiler.class.php + docs.sgml + NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php: update version numbers + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: moved version variable to internal variable + +2001-05-22 Andrei Zmievski + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php: + Moved $_smarty_sections and $_smarty_conf_obj into Smarty class. + +2001-05-18 Monte Ohrt + + * NEWS: update ChangeLog + + * FAQ + QUICKSTART: update FAQ, QUICKSTART for windows include_path setup + + * configs/test.conf: added configs directory to cvs + +2001-05-18 Andrei Zmievski + + * Smarty.class.php: Use compiler_class for including the file. + +2001-05-18 Monte Ohrt + + * docs.sgml: fix typo + +2001-05-16 Monte Ohrt + + * README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: update files to version 1.4.1 + + * NEWS: update ChangeLog + +2001-05-15 Andrei Zmievski + + * NEWS: *** empty log message *** + + * index.php: forget that! + + * NEWS + Smarty_Compiler.class.php + index.php: Fixed a few E_NOTICE warnings. + +2001-05-09 Monte Ohrt + + * NEWS + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + docs.sgml: update dates versions + +2001-05-09 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty.class.php: + Use absolute paths when requiring/including Smart components. + + * NEWS: *** empty log message *** + + * Smarty.class.php: Use write mode instead of append. + +2001-05-02 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: Fix indexing by section properties. + +2001-05-02 Monte Ohrt + + * NEWS: update changelog + + * Smarty.class.php: remove period from syntax error + +2001-05-02 Andrei Zmievski + + * Smarty_Compiler.class.php: Double-quote the attribute values by default. + +2001-04-30 Monte Ohrt + + * Smarty_Compiler.class.php + NEWS: added simple {capture} logic + +2001-04-30 Andrei Zmievski + + * TODO: *** empty log message *** + + * Smarty_Compiler.class.php + Smarty.class.php: Fix passing config vars to included files. + + * Smarty.class.php + Smarty_Compiler.class.php: Fix inclusion again. + +2001-04-30 Monte Ohrt + + * FAQ + RELEASE_NOTES + Smarty.class.php + misc/fix_vars.php + NEWS: update paths for windows (c:) + +2001-04-28 Andrei Zmievski + + * Smarty.class.php + Smarty_Compiler.class.php: Fix passing variables to included files. + + * templates/index.tpl: *** empty log message *** + +2001-04-27 Andrei Zmievski + + * Smarty_Compiler.class.php: Fix includes. + +2001-04-26 Andrei Zmievski + + * Smarty_Compiler.class.php + docs.sgml + Smarty.class.php: Formatting mostly. + + * Smarty_Compiler.class.php + Config_File.class.php: *** empty log message *** + +2001-04-26 Monte Ohrt + + * Smarty_Compiler.class.php + docs.sgml + FAQ + NEWS + QUICKSTART + RELEASE_NOTES + Smarty.class.php: update docs with new changes + +2001-04-26 Andrei Zmievski + + * RELEASE_NOTES: *** empty log message *** + + * docs.sgml + templates/index.tpl + NEWS + Smarty_Compiler.class.php: Added ability to reference object properties. + +2001-04-25 Andrei Zmievski + + * README + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml + AUTHORS + Config_File.class.php + CREDITS + RELEASE_NOTES + NEWS: *** empty log message *** + + * docs.sgml: Docs on new parameter to custom functions. + + * NEWS: *** empty log message *** + + * Smarty_Compiler.class.php: + Changing the way tpl vars are referenced and passing smarty object + to custom functions. + + * RELEASE_NOTES + docs.sgml: Fixing docs a bit. + +2001-04-24 Andrei Zmievski + + * docs.sgml: Docs for $compiler_class and compiler functions. + + * templates/index.tpl: *** empty log message *** + + * Smarty_Compiler.class.php: Remove debugging. + +2001-04-24 Monte Ohrt + + * docs.sgml: update compiler function docs + +2001-04-24 Andrei Zmievski + + * NEWS + Smarty.class.php + Smarty_Compiler.class.php + templates/index.tpl: Added compiler function support. + +2001-04-24 Monte Ohrt + + * RELEASE_NOTES + Smarty.class.php: + update notes, change show_info_header to false by default + + * Smarty.class.php + Smarty_Compiler.class.php + docs.sgml + CREDITS + FAQ + NEWS + README + RELEASE_NOTES: update documenation, bug fixes + +2001-04-24 Andrei Zmievski + + * misc/fix_vars.php: Hopefully fix for sure. + +2001-04-23 Monte Ohrt + + * misc/fix_vars.php: uncomment copy/unlink + +2001-04-23 Andrei Zmievski + + * misc/fix_vars.php: Do it more thoroughly. + + * misc/fix_vars.php: check for } + +2001-04-22 Andrei Zmievski + + * misc/fix_vars.php: Fix variable parsing. + +2001-04-20 Monte Ohrt + + * misc/fix_vars.php: fix problem with 4.0.5-dev and preg_replace_callback + +2001-04-19 Monte Ohrt + + * Smarty_Compiler.class.php + docs.sgml + misc/fix_vars.php + NEWS + RELEASE_NOTES + Smarty.class.php: update notes/documentation + + * NEWS + README + RELEASE_NOTES + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + docs.sgml: update files for 1.4.0 release + +2001-04-16 Andrei Zmievski + + * misc/fix_vars.php: Added fix_vars.php script. + +2001-04-16 Monte Ohrt + + * QUICKSTART + RELEASE_NOTES + docs.sgml + templates/index.tpl: + update RELEASE_NOTES & scripts with new section var syntax + +2001-04-13 Andrei Zmievski + + * Smarty_Compiler.class.php: * Implement new variable format parser. + * Optimizing config load a bit. + +2001-04-13 Monte Ohrt + + * FAQ + NEWS + RELEASE_NOTES + Smarty.class.php: + added $check_cached_insert_tags to speed up cached pages if + {insert ...} is not used (Monte) + +2001-04-12 Andrei Zmievski + + * NEWS + Smarty.class.php + RELEASE_NOTES: *** empty log message *** + + * Smarty_Compiler.class.php: Remove redundant functions. + + * Smarty.class.php: Formatting. + +2001-04-12 Monte Ohrt + + * Smarty.class.php: update file: parsing + + * Smarty.class.php + docs.sgml: update documentation + +2001-04-12 Andrei Zmievski + + * Smarty.class.php + Smarty_Compiler.class.php + TODO: *** empty log message *** + +2001-04-11 Monte Ohrt + + * FAQ + QUICKSTART + RELEASE_NOTES: added RELEASE_NOTES file to cvs + + * NEWS + docs.sgml: update ChangeLog, update documentation + + * Smarty.class.php + Smarty_Compiler.class.php + templates/index.tpl: + update Smarty to compile at run-time. added ability to get files from + absolute paths, added work around for LOCK_EX and windows, changed a few + file permissions to be more secure. + +2001-03-29 Monte Ohrt + + * NEWS + Smarty.addons.php: + allow arbitrary date strings instead of just timestamps + +2001-03-28 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php + docs.sgml + FAQ + NEWS + README + Smarty.addons.php: + update version in class, update docs for count_ and new vars + + * templates/index.tpl + docs.sgml: update docs, example template + +2001-03-28 Andrei Zmievski + + * Smarty_Compiler.class.php: Some variable renaming. + +2001-03-23 Andrei Zmievski + + * Smarty_Compiler.class.php + NEWS: Fixed nested include infinite repeat bug. + +2001-03-23 Monte Ohrt + + * Smarty.class.php: fix version number + + * Smarty.class.php + NEWS: added optional HTML header to output + +2001-03-22 Andrei Zmievski + + * Smarty_Compiler.class.php: Fixed inclusion of dynamic files. + +2001-03-16 Andrei Zmievski + + * Smarty_Compiler.class.php: Fixing the config_load scoping. + + * Smarty_Compiler.class.php: making config variables global for now. + +2001-03-15 Andrei Zmievski + + * NEWS: *** empty log message *** + + * Smarty_Compiler.class.php: + * Includes are now always done via generated function call to protect + namespace. + * config_load now always uses global config object to improve + performance. + +2001-03-13 Monte Ohrt + + * docs.sgml: update math documentation with format attribute + +2001-03-11 Monte Ohrt + + * docs.sgml + NEWS + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: update math function with format attribute + +2001-03-10 Andrei Zmievski + + * Smarty.addons.php: *** empty log message *** + + * NEWS + Smarty.addons.php + Smarty.class.php: Added html_select_time custom function. + +2001-03-08 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php + NEWS + README + Smarty.addons.php: rename 1.3.1b to 1.3.1pl1 + + * NEWS + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php: update version numbers, changelog + + * Smarty.class.php + Smarty_Compiler.class.php: + moved _syntax_error to Smarty_Compiler.class.php + + * Smarty.class.php + docs.sgml: + missing _syntax_error function recovered. fixed minor syntax in docs + +2001-03-07 Monte Ohrt + + * QUICKSTART + README + Smarty.addons.php + Smarty.class.php + Smarty_Compiler.class.php + BUGS + INSTALL + NEWS: update everything to 1.3.1 + +2001-03-03 Monte Ohrt + + * Smarty_Compiler.class.php + Smarty.class.php: fixed bug with cached insert tags + +2001-03-02 Monte Ohrt + + * Smarty.class.php + Smarty_Compiler.class.php: + fix cache fuctions with separated compiled class + + * FAQ + NEWS + docs.sgml: update changelog + +2001-03-02 Andrei Zmievski + + * NEWS + Smarty_Compiler.class.php: Added 'first' and 'last' section properties. + +2001-03-02 Monte Ohrt + + * TODO: remove compiling separation TODO + + * Smarty_Compiler.class.php + Smarty.addons.php + Smarty.class.php: update function headers + + * templates/index.tpl + NEWS + Smarty.class.php + Smarty_Compiler.class.php + index.php: split out compiling code for faster execution + + * Smarty.class.php: fixed a few warning messages + + * Smarty.addons.php + Smarty.class.php + docs.sgml + NEWS: added fetch, unregister mod/fun, updated docs + +2001-03-01 Monte Ohrt + + * Smarty.addons.php: added "int" to available list + + * docs.sgml + FAQ + Smarty.class.php: update FAQ, add math functions & update documetation + + * index.php + Smarty.addons.php + Smarty.class.php + docs.sgml: fixed literal tags and other optional delimiters + +2001-02-26 Andrei Zmievski + + * NEWS + Smarty.class.php: + Added index_prev, index_next section properties and ability to + index by them. + + * NEWS + Smarty.addons.php + Smarty.class.php: Reverting the plugins patch - needs more thought. + + * Smarty.class.php: Fixing plugin loading. + +2001-02-23 Andrei Zmievski + + * Smarty.addons.php + Smarty.class.php + plugins/standard.plugin.php + NEWS: Added plugin functionality. + +2001-02-22 Monte Ohrt + + * docs.sgml + templates/index.tpl + NEWS + README + Smarty.class.php: fixed issue with php tags executed in literal blocks + +2001-02-21 Monte Ohrt + + * NEWS: update changelog for LGPL change + + * Smarty.class.php + docs.sgml + README + Smarty.addons.php: updated version numbers to 1.3.0 + + * NEWS + templates/index.tpl: update changelog, rearrange index.tpl file + +2001-02-21 Andrei Zmievski + + * NEWS + Smarty.class.php: *** empty log message *** + +2001-02-21 Monte Ohrt + + * docs.sgml: update parameters for is_cached and fetch + +2001-02-21 Andrei Zmievski + + * NEWS + Smarty.class.php: *** empty log message *** + +2001-02-21 Monte Ohrt + + * NEWS + Smarty.addons.php + docs.sgml: update docs, remove header function from addons + +2001-02-20 Monte Ohrt + + * FAQ + NEWS: update changelog + + * TODO: update todo + + * TODO: update todo list + + * Smarty.class.php: update php tag handling logic + +2001-02-19 Monte Ohrt + + * index.php + Config_File.class.php + FAQ + Smarty.class.php + docs.sgml: fixed + + * Smarty.addons.php: *** empty log message *** + +2001-02-13 Andrei Zmievski + + * TODO: *** empty log message *** + +2001-02-12 Andrei Zmievski + + * templates/index.tpl + Smarty.class.php: *** empty log message *** + +2001-02-10 Monte Ohrt + + * Smarty.class.php: remove unneeded preg_match + + * Smarty.class.php: remove comment + + * Smarty.class.php: updated php escape to handle +{/if} \ No newline at end of file diff --git a/lib/smarty2/libs/internals/core.assemble_plugin_filepath.php b/lib/smarty2/libs/internals/core.assemble_plugin_filepath.php new file mode 100755 index 0000000..fc64b8c --- /dev/null +++ b/lib/smarty2/libs/internals/core.assemble_plugin_filepath.php @@ -0,0 +1,67 @@ +plugins_dir as $_plugin_dir) { + + $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; + + // see if path is relative + if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) { + $_relative_paths[] = $_plugin_dir; + // relative path, see if it is in the SMARTY_DIR + if (@is_readable(SMARTY_DIR . $_plugin_filepath)) { + $_return = SMARTY_DIR . $_plugin_filepath; + break; + } + } + // try relative to cwd (or absolute) + if (@is_readable($_plugin_filepath)) { + $_return = $_plugin_filepath; + break; + } + } + + if($_return === false) { + // still not found, try PHP include_path + if(isset($_relative_paths)) { + foreach ((array)$_relative_paths as $_plugin_dir) { + + $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; + + $_params = array('file_path' => $_plugin_filepath); + require_once(SMARTY_CORE_DIR . 'core.get_include_path.php'); + if(smarty_core_get_include_path($_params, $smarty)) { + $_return = $_params['new_file_path']; + break; + } + } + } + } + $_filepaths_cache[$_plugin_filename] = $_return; + return $_return; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.assign_smarty_interface.php b/lib/smarty2/libs/internals/core.assign_smarty_interface.php new file mode 100755 index 0000000..500ba9a --- /dev/null +++ b/lib/smarty2/libs/internals/core.assign_smarty_interface.php @@ -0,0 +1,43 @@ + + * Name: assign_smarty_interface
+ * Purpose: assign the $smarty interface variable + * @param array Format: null + * @param Smarty + */ +function smarty_core_assign_smarty_interface($params, &$smarty) +{ + if (isset($smarty->_smarty_vars) && isset($smarty->_smarty_vars['request'])) { + return; + } + + $_globals_map = array('g' => 'HTTP_GET_VARS', + 'p' => 'HTTP_POST_VARS', + 'c' => 'HTTP_COOKIE_VARS', + 's' => 'HTTP_SERVER_VARS', + 'e' => 'HTTP_ENV_VARS'); + + $_smarty_vars_request = array(); + + foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) { + if (isset($_globals_map[$_c])) { + $_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]); + } + } + $_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']); + + $smarty->_smarty_vars['request'] = $_smarty_vars_request; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.create_dir_structure.php b/lib/smarty2/libs/internals/core.create_dir_structure.php new file mode 100755 index 0000000..abc2850 --- /dev/null +++ b/lib/smarty2/libs/internals/core.create_dir_structure.php @@ -0,0 +1,79 @@ +_dir_perms) && !is_dir($_new_dir)) { + $smarty->trigger_error("problem creating directory '" . $_new_dir . "'"); + return false; + } + $_new_dir .= '/'; + } + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.display_debug_console.php b/lib/smarty2/libs/internals/core.display_debug_console.php new file mode 100755 index 0000000..5968676 --- /dev/null +++ b/lib/smarty2/libs/internals/core.display_debug_console.php @@ -0,0 +1,61 @@ + + * Name: display_debug_console
+ * Purpose: display the javascript debug console window + * @param array Format: null + * @param Smarty + */ +function smarty_core_display_debug_console($params, &$smarty) +{ + // we must force compile the debug template in case the environment + // changed between separate applications. + + if(empty($smarty->debug_tpl)) { + // set path to debug template from SMARTY_DIR + $smarty->debug_tpl = SMARTY_DIR . 'debug.tpl'; + if($smarty->security && is_file($smarty->debug_tpl)) { + $smarty->secure_dir[] = realpath($smarty->debug_tpl); + } + $smarty->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl'; + } + + $_ldelim_orig = $smarty->left_delimiter; + $_rdelim_orig = $smarty->right_delimiter; + + $smarty->left_delimiter = '{'; + $smarty->right_delimiter = '}'; + + $_compile_id_orig = $smarty->_compile_id; + $smarty->_compile_id = null; + + $_compile_path = $smarty->_get_compile_path($smarty->debug_tpl); + if ($smarty->_compile_resource($smarty->debug_tpl, $_compile_path)) + { + ob_start(); + $smarty->_include($_compile_path); + $_results = ob_get_contents(); + ob_end_clean(); + } else { + $_results = ''; + } + + $smarty->_compile_id = $_compile_id_orig; + + $smarty->left_delimiter = $_ldelim_orig; + $smarty->right_delimiter = $_rdelim_orig; + + return $_results; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.get_include_path.php b/lib/smarty2/libs/internals/core.get_include_path.php new file mode 100755 index 0000000..0cfdbdc --- /dev/null +++ b/lib/smarty2/libs/internals/core.get_include_path.php @@ -0,0 +1,44 @@ + diff --git a/lib/smarty2/libs/internals/core.get_microtime.php b/lib/smarty2/libs/internals/core.get_microtime.php new file mode 100755 index 0000000..3c998a7 --- /dev/null +++ b/lib/smarty2/libs/internals/core.get_microtime.php @@ -0,0 +1,23 @@ + diff --git a/lib/smarty2/libs/internals/core.get_php_resource.php b/lib/smarty2/libs/internals/core.get_php_resource.php new file mode 100755 index 0000000..8fa1da6 --- /dev/null +++ b/lib/smarty2/libs/internals/core.get_php_resource.php @@ -0,0 +1,80 @@ +trusted_dir; + $smarty->_parse_resource_name($params, $smarty); + + /* + * Find out if the resource exists. + */ + + if ($params['resource_type'] == 'file') { + $_readable = false; + if(file_exists($params['resource_name']) && is_readable($params['resource_name'])) { + $_readable = true; + } else { + // test for file in include_path + $_params = array('file_path' => $params['resource_name']); + require_once(SMARTY_CORE_DIR . 'core.get_include_path.php'); + if(smarty_core_get_include_path($_params, $smarty)) { + $_include_path = $_params['new_file_path']; + $_readable = true; + } + } + } else if ($params['resource_type'] != 'file') { + $_template_source = null; + $_readable = is_callable($smarty->_plugins['resource'][$params['resource_type']][0][0]) + && call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][0], + array($params['resource_name'], &$_template_source, &$smarty)); + } + + /* + * Set the error function, depending on which class calls us. + */ + if (method_exists($smarty, '_syntax_error')) { + $_error_funcc = '_syntax_error'; + } else { + $_error_funcc = 'trigger_error'; + } + + if ($_readable) { + if ($smarty->security) { + require_once(SMARTY_CORE_DIR . 'core.is_trusted.php'); + if (!smarty_core_is_trusted($params, $smarty)) { + $smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted'); + return false; + } + } + } else { + $smarty->$_error_funcc($params['resource_type'] . ':' . $params['resource_name'] . ' is not readable'); + return false; + } + + if ($params['resource_type'] == 'file') { + $params['php_resource'] = $params['resource_name']; + } else { + $params['php_resource'] = $_template_source; + } + return true; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.is_secure.php b/lib/smarty2/libs/internals/core.is_secure.php new file mode 100755 index 0000000..15c729e --- /dev/null +++ b/lib/smarty2/libs/internals/core.is_secure.php @@ -0,0 +1,59 @@ +security || $smarty->security_settings['INCLUDE_ANY']) { + return true; + } + + if ($params['resource_type'] == 'file') { + $_rp = realpath($params['resource_name']); + if (isset($params['resource_base_path'])) { + foreach ((array)$params['resource_base_path'] as $curr_dir) { + if ( ($_cd = realpath($curr_dir)) !== false && + strncmp($_rp, $_cd, strlen($_cd)) == 0 && + substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) { + return true; + } + } + } + if (!empty($smarty->secure_dir)) { + foreach ((array)$smarty->secure_dir as $curr_dir) { + if ( ($_cd = realpath($curr_dir)) !== false) { + if($_cd == $_rp) { + return true; + } elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 && + substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR) { + return true; + } + } + } + } + } else { + // resource is not on local file system + return call_user_func_array( + $smarty->_plugins['resource'][$params['resource_type']][0][2], + array($params['resource_name'], &$smarty)); + } + + return false; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.is_trusted.php b/lib/smarty2/libs/internals/core.is_trusted.php new file mode 100755 index 0000000..ecf703c --- /dev/null +++ b/lib/smarty2/libs/internals/core.is_trusted.php @@ -0,0 +1,47 @@ +trusted_dir)) { + $_rp = realpath($params['resource_name']); + foreach ((array)$smarty->trusted_dir as $curr_dir) { + if (!empty($curr_dir) && is_readable ($curr_dir)) { + $_cd = realpath($curr_dir); + if (strncmp($_rp, $_cd, strlen($_cd)) == 0 + && substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) { + $_smarty_trusted = true; + break; + } + } + } + } + + } else { + // resource is not on local file system + $_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3], + array($params['resource_name'], $smarty)); + } + + return $_smarty_trusted; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.load_plugins.php b/lib/smarty2/libs/internals/core.load_plugins.php new file mode 100755 index 0000000..6f412ec --- /dev/null +++ b/lib/smarty2/libs/internals/core.load_plugins.php @@ -0,0 +1,125 @@ +_plugins[$_type][$_name]; + + /* + * We do not load plugin more than once for each instance of Smarty. + * The following code checks for that. The plugin can also be + * registered dynamically at runtime, in which case template file + * and line number will be unknown, so we fill them in. + * + * The final element of the info array is a flag that indicates + * whether the dynamically registered plugin function has been + * checked for existence yet or not. + */ + if (isset($_plugin)) { + if (empty($_plugin[3])) { + if (!is_callable($_plugin[0])) { + $smarty->_trigger_fatal_error("[plugin] $_type '$_name' is not implemented", $_tpl_file, $_tpl_line, __FILE__, __LINE__); + } else { + $_plugin[1] = $_tpl_file; + $_plugin[2] = $_tpl_line; + $_plugin[3] = true; + if (!isset($_plugin[4])) $_plugin[4] = true; /* cacheable */ + } + } + continue; + } else if ($_type == 'insert') { + /* + * For backwards compatibility, we check for insert functions in + * the symbol table before trying to load them as a plugin. + */ + $_plugin_func = 'insert_' . $_name; + if (function_exists($_plugin_func)) { + $_plugin = array($_plugin_func, $_tpl_file, $_tpl_line, true, false); + continue; + } + } + + $_plugin_file = $smarty->_get_plugin_filepath($_type, $_name); + + if (! $_found = ($_plugin_file != false)) { + $_message = "could not load plugin file '$_type.$_name.php'\n"; + } + + /* + * If plugin file is found, it -must- provide the properly named + * plugin function. In case it doesn't, simply output the error and + * do not fall back on any other method. + */ + if ($_found) { + include_once $_plugin_file; + + $_plugin_func = 'smarty_' . $_type . '_' . $_name; + if (!function_exists($_plugin_func)) { + $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", $_tpl_file, $_tpl_line, __FILE__, __LINE__); + continue; + } + } + /* + * In case of insert plugins, their code may be loaded later via + * 'script' attribute. + */ + else if ($_type == 'insert' && $_delayed_loading) { + $_plugin_func = 'smarty_' . $_type . '_' . $_name; + $_found = true; + } + + /* + * Plugin specific processing and error checking. + */ + if (!$_found) { + if ($_type == 'modifier') { + /* + * In case modifier falls back on using PHP functions + * directly, we only allow those specified in the security + * context. + */ + if ($smarty->security && !in_array($_name, $smarty->security_settings['MODIFIER_FUNCS'])) { + $_message = "(secure mode) modifier '$_name' is not allowed"; + } else { + if (!function_exists($_name)) { + $_message = "modifier '$_name' is not implemented"; + } else { + $_plugin_func = $_name; + $_found = true; + } + } + } else if ($_type == 'function') { + /* + * This is a catch-all situation. + */ + $_message = "unknown tag - '$_name'"; + } + } + + if ($_found) { + $smarty->_plugins[$_type][$_name] = array($_plugin_func, $_tpl_file, $_tpl_line, true, true); + } else { + // output error + $smarty->_trigger_fatal_error('[plugin] ' . $_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__); + } + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.load_resource_plugin.php b/lib/smarty2/libs/internals/core.load_resource_plugin.php new file mode 100755 index 0000000..8a084f1 --- /dev/null +++ b/lib/smarty2/libs/internals/core.load_resource_plugin.php @@ -0,0 +1,74 @@ +_plugins['resource'][$params['type']]; + if (isset($_plugin)) { + if (!$_plugin[1] && count($_plugin[0])) { + $_plugin[1] = true; + foreach ($_plugin[0] as $_plugin_func) { + if (!is_callable($_plugin_func)) { + $_plugin[1] = false; + break; + } + } + } + + if (!$_plugin[1]) { + $smarty->_trigger_fatal_error("[plugin] resource '" . $params['type'] . "' is not implemented", null, null, __FILE__, __LINE__); + } + + return; + } + + $_plugin_file = $smarty->_get_plugin_filepath('resource', $params['type']); + $_found = ($_plugin_file != false); + + if ($_found) { /* + * If the plugin file is found, it -must- provide the properly named + * plugin functions. + */ + include_once($_plugin_file); + + /* + * Locate functions that we require the plugin to provide. + */ + $_resource_ops = array('source', 'timestamp', 'secure', 'trusted'); + $_resource_funcs = array(); + foreach ($_resource_ops as $_op) { + $_plugin_func = 'smarty_resource_' . $params['type'] . '_' . $_op; + if (!function_exists($_plugin_func)) { + $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", null, null, __FILE__, __LINE__); + return; + } else { + $_resource_funcs[] = $_plugin_func; + } + } + + $smarty->_plugins['resource'][$params['type']] = array($_resource_funcs, true); + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.process_cached_inserts.php b/lib/smarty2/libs/internals/core.process_cached_inserts.php new file mode 100755 index 0000000..046e2c4 --- /dev/null +++ b/lib/smarty2/libs/internals/core.process_cached_inserts.php @@ -0,0 +1,71 @@ +_smarty_md5.'{insert_cache (.*)}'.$smarty->_smarty_md5.'!Uis', + $params['results'], $match); + list($cached_inserts, $insert_args) = $match; + + for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) { + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $debug_start_time = smarty_core_get_microtime($_params, $smarty); + } + + $args = unserialize($insert_args[$i]); + $name = $args['name']; + + if (isset($args['script'])) { + $_params = array('resource_name' => $smarty->_dequote($args['script'])); + require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); + if(!smarty_core_get_php_resource($_params, $smarty)) { + return false; + } + $resource_type = $_params['resource_type']; + $php_resource = $_params['php_resource']; + + + if ($resource_type == 'file') { + $smarty->_include($php_resource, true); + } else { + $smarty->_eval($php_resource); + } + } + + $function_name = $smarty->_plugins['insert'][$name][0]; + if (empty($args['assign'])) { + $replace = $function_name($args, $smarty); + } else { + $smarty->assign($args['assign'], $function_name($args, $smarty)); + $replace = ''; + } + + $params['results'] = substr_replace($params['results'], $replace, strpos($params['results'], $cached_inserts[$i]), strlen($cached_inserts[$i])); + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $smarty->_smarty_debug_info[] = array('type' => 'insert', + 'filename' => 'insert_'.$name, + 'depth' => $smarty->_inclusion_depth, + 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $debug_start_time); + } + } + + return $params['results']; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.process_compiled_include.php b/lib/smarty2/libs/internals/core.process_compiled_include.php new file mode 100755 index 0000000..0d22d2c --- /dev/null +++ b/lib/smarty2/libs/internals/core.process_compiled_include.php @@ -0,0 +1,37 @@ +_cache_including; + $smarty->_cache_including = true; + + $_return = $params['results']; + + foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { + $smarty->_include($_include_file_path, true); + } + + foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { + $_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s', + array(&$smarty, '_process_compiled_include_callback'), + $_return); + } + $smarty->_cache_including = $_cache_including; + return $_return; +} + +?> diff --git a/lib/smarty2/libs/internals/core.read_cache_file.php b/lib/smarty2/libs/internals/core.read_cache_file.php new file mode 100755 index 0000000..2205b2a --- /dev/null +++ b/lib/smarty2/libs/internals/core.read_cache_file.php @@ -0,0 +1,101 @@ +force_compile) { + // force compile enabled, always regenerate + return false; + } + + if (isset($content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']])) { + list($params['results'], $smarty->_cache_info) = $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']]; + return true; + } + + if (!empty($smarty->cache_handler_func)) { + // use cache_handler function + call_user_func_array($smarty->cache_handler_func, + array('read', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null)); + } else { + // use local cache file + $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']); + $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id); + $params['results'] = $smarty->_read_file($_cache_file); + } + + if (empty($params['results'])) { + // nothing to parse (error?), regenerate cache + return false; + } + + $_contents = $params['results']; + $_info_start = strpos($_contents, "\n") + 1; + $_info_len = (int)substr($_contents, 0, $_info_start - 1); + $_cache_info = unserialize(substr($_contents, $_info_start, $_info_len)); + $params['results'] = substr($_contents, $_info_start + $_info_len); + + if ($smarty->caching == 2 && isset ($_cache_info['expires'])){ + // caching by expiration time + if ($_cache_info['expires'] > -1 && (time() > $_cache_info['expires'])) { + // cache expired, regenerate + return false; + } + } else { + // caching by lifetime + if ($smarty->cache_lifetime > -1 && (time() - $_cache_info['timestamp'] > $smarty->cache_lifetime)) { + // cache expired, regenerate + return false; + } + } + + if ($smarty->compile_check) { + $_params = array('get_source' => false, 'quiet'=>true); + foreach (array_keys($_cache_info['template']) as $_template_dep) { + $_params['resource_name'] = $_template_dep; + if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) { + // template file has changed, regenerate cache + return false; + } + } + + if (isset($_cache_info['config'])) { + $_params = array('resource_base_path' => $smarty->config_dir, 'get_source' => false, 'quiet'=>true); + foreach (array_keys($_cache_info['config']) as $_config_dep) { + $_params['resource_name'] = $_config_dep; + if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) { + // config file has changed, regenerate cache + return false; + } + } + } + } + + $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $_cache_info); + + $smarty->_cache_info = $_cache_info; + return true; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.rm_auto.php b/lib/smarty2/libs/internals/core.rm_auto.php new file mode 100755 index 0000000..5174f02 --- /dev/null +++ b/lib/smarty2/libs/internals/core.rm_auto.php @@ -0,0 +1,71 @@ + $params['auto_base'], + 'level' => 0, + 'exp_time' => $params['exp_time'] + ); + require_once(SMARTY_CORE_DIR . 'core.rmdir.php'); + $_res = smarty_core_rmdir($_params, $smarty); + } else { + $_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']); + + if(isset($params['auto_source'])) { + if (isset($params['extensions'])) { + $_res = false; + foreach ((array)$params['extensions'] as $_extension) + $_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']); + } else { + $_res = $smarty->_unlink($_tname, $params['exp_time']); + } + } elseif ($smarty->use_sub_dirs) { + $_params = array( + 'dirname' => $_tname, + 'level' => 1, + 'exp_time' => $params['exp_time'] + ); + require_once(SMARTY_CORE_DIR . 'core.rmdir.php'); + $_res = smarty_core_rmdir($_params, $smarty); + } else { + // remove matching file names + $_handle = opendir($params['auto_base']); + $_res = true; + while (false !== ($_filename = readdir($_handle))) { + if($_filename == '.' || $_filename == '..') { + continue; + } elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) { + $_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']); + } + } + } + } + + return $_res; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.rmdir.php b/lib/smarty2/libs/internals/core.rmdir.php new file mode 100755 index 0000000..3280ff7 --- /dev/null +++ b/lib/smarty2/libs/internals/core.rmdir.php @@ -0,0 +1,54 @@ + keep root) + * WARNING: no tests, it will try to remove what you tell it! + * + * @param string $dirname + * @param integer $level + * @param integer $exp_time + * @return boolean + */ + +// $dirname, $level = 1, $exp_time = null + +function smarty_core_rmdir($params, &$smarty) +{ + if(!isset($params['level'])) { $params['level'] = 1; } + if(!isset($params['exp_time'])) { $params['exp_time'] = null; } + + if($_handle = @opendir($params['dirname'])) { + + while (false !== ($_entry = readdir($_handle))) { + if ($_entry != '.' && $_entry != '..') { + if (@is_dir($params['dirname'] . DIRECTORY_SEPARATOR . $_entry)) { + $_params = array( + 'dirname' => $params['dirname'] . DIRECTORY_SEPARATOR . $_entry, + 'level' => $params['level'] + 1, + 'exp_time' => $params['exp_time'] + ); + smarty_core_rmdir($_params, $smarty); + } + else { + $smarty->_unlink($params['dirname'] . DIRECTORY_SEPARATOR . $_entry, $params['exp_time']); + } + } + } + closedir($_handle); + } + + if ($params['level']) { + return @rmdir($params['dirname']); + } + return (bool)$_handle; + +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.run_insert_handler.php b/lib/smarty2/libs/internals/core.run_insert_handler.php new file mode 100755 index 0000000..40e539f --- /dev/null +++ b/lib/smarty2/libs/internals/core.run_insert_handler.php @@ -0,0 +1,71 @@ +debugging) { + $_params = array(); + $_debug_start_time = smarty_core_get_microtime($_params, $smarty); + } + + if ($smarty->caching) { + $_arg_string = serialize($params['args']); + $_name = $params['args']['name']; + if (!isset($smarty->_cache_info['insert_tags'][$_name])) { + $smarty->_cache_info['insert_tags'][$_name] = array('insert', + $_name, + $smarty->_plugins['insert'][$_name][1], + $smarty->_plugins['insert'][$_name][2], + !empty($params['args']['script']) ? true : false); + } + return $smarty->_smarty_md5."{insert_cache $_arg_string}".$smarty->_smarty_md5; + } else { + if (isset($params['args']['script'])) { + $_params = array('resource_name' => $smarty->_dequote($params['args']['script'])); + require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); + if(!smarty_core_get_php_resource($_params, $smarty)) { + return false; + } + + if ($_params['resource_type'] == 'file') { + $smarty->_include($_params['php_resource'], true); + } else { + $smarty->_eval($_params['php_resource']); + } + unset($params['args']['script']); + } + + $_funcname = $smarty->_plugins['insert'][$params['args']['name']][0]; + $_content = $_funcname($params['args'], $smarty); + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $smarty->_smarty_debug_info[] = array('type' => 'insert', + 'filename' => 'insert_'.$params['args']['name'], + 'depth' => $smarty->_inclusion_depth, + 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time); + } + + if (!empty($params['args']["assign"])) { + $smarty->assign($params['args']["assign"], $_content); + } else { + return $_content; + } + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.smarty_include_php.php b/lib/smarty2/libs/internals/core.smarty_include_php.php new file mode 100755 index 0000000..de03f93 --- /dev/null +++ b/lib/smarty2/libs/internals/core.smarty_include_php.php @@ -0,0 +1,50 @@ + $params['smarty_file']); + require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); + smarty_core_get_php_resource($_params, $smarty); + $_smarty_resource_type = $_params['resource_type']; + $_smarty_php_resource = $_params['php_resource']; + + if (!empty($params['smarty_assign'])) { + ob_start(); + if ($_smarty_resource_type == 'file') { + $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']); + } else { + $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']); + } + $smarty->assign($params['smarty_assign'], ob_get_contents()); + ob_end_clean(); + } else { + if ($_smarty_resource_type == 'file') { + $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']); + } else { + $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']); + } + } +} + + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.write_cache_file.php b/lib/smarty2/libs/internals/core.write_cache_file.php new file mode 100755 index 0000000..230343d --- /dev/null +++ b/lib/smarty2/libs/internals/core.write_cache_file.php @@ -0,0 +1,96 @@ +_cache_info['timestamp'] = time(); + if ($smarty->cache_lifetime > -1){ + // expiration set + $smarty->_cache_info['expires'] = $smarty->_cache_info['timestamp'] + $smarty->cache_lifetime; + } else { + // cache will never expire + $smarty->_cache_info['expires'] = -1; + } + + // collapse nocache.../nocache-tags + if (preg_match_all('!\{(/?)nocache\:[0-9a-f]{32}#\d+\}!', $params['results'], $match, PREG_PATTERN_ORDER)) { + // remove everything between every pair of outermost noache.../nocache-tags + // and replace it by a single nocache-tag + // this new nocache-tag will be replaced by dynamic contents in + // smarty_core_process_compiled_includes() on a cache-read + + $match_count = count($match[0]); + $results = preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_SPLIT_DELIM_CAPTURE); + + $level = 0; + $j = 0; + for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) { + if ($results[$i] == $match[0][$j]) { + // nocache tag + if ($match[1][$j]) { // closing tag + $level--; + unset($results[$i]); + } else { // opening tag + if ($level++ > 0) unset($results[$i]); + } + $j++; + } elseif ($level > 0) { + unset($results[$i]); + } + } + $params['results'] = implode('', $results); + } + $smarty->_cache_info['cache_serials'] = $smarty->_cache_serials; + + // prepend the cache header info into cache file + $_cache_info = serialize($smarty->_cache_info); + $params['results'] = strlen($_cache_info) . "\n" . $_cache_info . $params['results']; + + if (!empty($smarty->cache_handler_func)) { + // use cache_handler function + call_user_func_array($smarty->cache_handler_func, + array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], $smarty->_cache_info['expires'])); + } else { + // use local cache file + + if(!@is_writable($smarty->cache_dir)) { + // cache_dir not writable, see if it exists + if(!@is_dir($smarty->cache_dir)) { + $smarty->trigger_error('the $cache_dir \'' . $smarty->cache_dir . '\' does not exist, or is not a directory.', E_USER_ERROR); + return false; + } + $smarty->trigger_error('unable to write to $cache_dir \'' . realpath($smarty->cache_dir) . '\'. Be sure $cache_dir is writable by the web server user.', E_USER_ERROR); + return false; + } + + $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']); + $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id); + $_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true); + require_once(SMARTY_CORE_DIR . 'core.write_file.php'); + smarty_core_write_file($_params, $smarty); + return true; + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.write_compiled_include.php b/lib/smarty2/libs/internals/core.write_compiled_include.php new file mode 100755 index 0000000..15c44d6 --- /dev/null +++ b/lib/smarty2/libs/internals/core.write_compiled_include.php @@ -0,0 +1,91 @@ +caching && \!\$this->_cache_including\)\: echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\'; endif;'; + $_tag_end = 'if \(\$this->caching && \!\$this->_cache_including\)\: echo \'\{/nocache\:(\\2)#(\\3)\}\'; endif;'; + + preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us', + $params['compiled_content'], $_match_source, PREG_SET_ORDER); + + // no nocache-parts found: done + if (count($_match_source)==0) return; + + // convert the matched php-code to functions + $_include_compiled = "_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n"; + $_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n"; + + $_compile_path = $params['include_file_path']; + + $smarty->_cache_serials[$_compile_path] = $params['cache_serial']; + $_include_compiled .= "\$this->_cache_serials['".$_compile_path."'] = '".$params['cache_serial']."';\n\n?>"; + + $_include_compiled .= $params['plugins_code']; + $_include_compiled .= "= 5.0) ? '_smarty' : 'this'; + for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) { + $_match =& $_match_source[$_i]; + $source = $_match[4]; + if ($this_varname == '_smarty') { + /* rename $this to $_smarty in the sourcecode */ + $tokens = token_get_all('\n"; + + $_params = array('filename' => $_compile_path, + 'contents' => $_include_compiled, 'create_dirs' => true); + + require_once(SMARTY_CORE_DIR . 'core.write_file.php'); + smarty_core_write_file($_params, $smarty); + return true; +} + + +?> diff --git a/lib/smarty2/libs/internals/core.write_compiled_resource.php b/lib/smarty2/libs/internals/core.write_compiled_resource.php new file mode 100755 index 0000000..d0e5648 --- /dev/null +++ b/lib/smarty2/libs/internals/core.write_compiled_resource.php @@ -0,0 +1,35 @@ +compile_dir)) { + // compile_dir not writable, see if it exists + if(!@is_dir($smarty->compile_dir)) { + $smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR); + return false; + } + $smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR); + return false; + } + + $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true); + require_once(SMARTY_CORE_DIR . 'core.write_file.php'); + smarty_core_write_file($_params, $smarty); + return true; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/internals/core.write_file.php b/lib/smarty2/libs/internals/core.write_file.php new file mode 100755 index 0000000..9f6ee5c --- /dev/null +++ b/lib/smarty2/libs/internals/core.write_file.php @@ -0,0 +1,54 @@ + $_dirname); + require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php'); + smarty_core_create_dir_structure($_params, $smarty); + } + + // write to tmp file, then rename it to avoid file locking race condition + $_tmp_file = tempnam($_dirname, 'wrt'); + + if (!($fd = @fopen($_tmp_file, 'wb'))) { + $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt'); + if (!($fd = @fopen($_tmp_file, 'wb'))) { + $smarty->trigger_error("problem writing temporary file '$_tmp_file'"); + return false; + } + } + + fwrite($fd, $params['contents']); + fclose($fd); + + if (DIRECTORY_SEPARATOR == '\\' || !@rename($_tmp_file, $params['filename'])) { + // On platforms and filesystems that cannot overwrite with rename() + // delete the file before renaming it -- because windows always suffers + // this, it is short-circuited to avoid the initial rename() attempt + @unlink($params['filename']); + @rename($_tmp_file, $params['filename']); + } + @chmod($params['filename'], $smarty->_file_perms); + + return true; +} + +/* vim: set expandtab: */ + +?> \ No newline at end of file diff --git a/lib/smarty2/libs/plugins/block.textformat.php b/lib/smarty2/libs/plugins/block.textformat.php new file mode 100755 index 0000000..2a37423 --- /dev/null +++ b/lib/smarty2/libs/plugins/block.textformat.php @@ -0,0 +1,103 @@ + + * Name: textformat
+ * Purpose: format text a certain way with preset styles + * or custom wrap/indent settings
+ * @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat} + * (Smarty online manual) + * @param array + *
+ * Params:   style: string (email)
+ *           indent: integer (0)
+ *           wrap: integer (80)
+ *           wrap_char string ("\n")
+ *           indent_char: string (" ")
+ *           wrap_boundary: boolean (true)
+ * 
+ * @author Monte Ohrt + * @param string contents of the block + * @param Smarty clever simulation of a method + * @return string string $content re-formatted + */ +function smarty_block_textformat($params, $content, &$smarty) +{ + if (is_null($content)) { + return; + } + + $style = null; + $indent = 0; + $indent_first = 0; + $indent_char = ' '; + $wrap = 80; + $wrap_char = "\n"; + $wrap_cut = false; + $assign = null; + + foreach ($params as $_key => $_val) { + switch ($_key) { + case 'style': + case 'indent_char': + case 'wrap_char': + case 'assign': + $$_key = (string)$_val; + break; + + case 'indent': + case 'indent_first': + case 'wrap': + $$_key = (int)$_val; + break; + + case 'wrap_cut': + $$_key = (bool)$_val; + break; + + default: + $smarty->trigger_error("textformat: unknown attribute '$_key'"); + } + } + + if ($style == 'email') { + $wrap = 72; + } + + // split into paragraphs + $_paragraphs = preg_split('![\r\n][\r\n]!',$content); + $_output = ''; + + for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) { + if ($_paragraphs[$_x] == '') { + continue; + } + // convert mult. spaces & special chars to single space + $_paragraphs[$_x] = preg_replace(array('!\s+!','!(^\s+)|(\s+$)!'), array(' ',''), $_paragraphs[$_x]); + // indent first line + if($indent_first > 0) { + $_paragraphs[$_x] = str_repeat($indent_char, $indent_first) . $_paragraphs[$_x]; + } + // wordwrap sentences + $_paragraphs[$_x] = wordwrap($_paragraphs[$_x], $wrap - $indent, $wrap_char, $wrap_cut); + // indent lines + if($indent > 0) { + $_paragraphs[$_x] = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraphs[$_x]); + } + } + $_output = implode($wrap_char . $wrap_char, $_paragraphs); + + return $assign ? $smarty->assign($assign, $_output) : $_output; + +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/plugins/compiler.assign.php b/lib/smarty2/libs/plugins/compiler.assign.php new file mode 100755 index 0000000..4d5f841 --- /dev/null +++ b/lib/smarty2/libs/plugins/compiler.assign.php @@ -0,0 +1,40 @@ + + * Name: assign
+ * Purpose: assign a value to a template variable + * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign} + * (Smarty online manual) + * @author Monte Ohrt (initial author) + * @author messju mohr (conversion to compiler function) + * @param string containing var-attribute and value-attribute + * @param Smarty_Compiler + */ +function smarty_compiler_assign($tag_attrs, &$compiler) +{ + $_params = $compiler->_parse_attrs($tag_attrs); + + if (!isset($_params['var'])) { + $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING); + return; + } + + if (!isset($_params['value'])) { + $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING); + return; + } + + return "\$this->assign({$_params['var']}, {$_params['value']});"; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/plugins/function.assign_debug_info.php b/lib/smarty2/libs/plugins/function.assign_debug_info.php new file mode 100755 index 0000000..cc2c14b --- /dev/null +++ b/lib/smarty2/libs/plugins/function.assign_debug_info.php @@ -0,0 +1,40 @@ + + * Name: assign_debug_info
+ * Purpose: assign debug info to the template
+ * @author Monte Ohrt + * @param array unused in this plugin, this plugin uses {@link Smarty::$_config}, + * {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info} + * @param Smarty + */ +function smarty_function_assign_debug_info($params, &$smarty) +{ + $assigned_vars = $smarty->_tpl_vars; + ksort($assigned_vars); + if (@is_array($smarty->_config[0])) { + $config_vars = $smarty->_config[0]; + ksort($config_vars); + $smarty->assign("_debug_config_keys", array_keys($config_vars)); + $smarty->assign("_debug_config_vals", array_values($config_vars)); + } + + $included_templates = $smarty->_smarty_debug_info; + + $smarty->assign("_debug_keys", array_keys($assigned_vars)); + $smarty->assign("_debug_vals", array_values($assigned_vars)); + + $smarty->assign("_debug_tpls", $included_templates); +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/plugins/function.config_load.php b/lib/smarty2/libs/plugins/function.config_load.php new file mode 100755 index 0000000..062c356 --- /dev/null +++ b/lib/smarty2/libs/plugins/function.config_load.php @@ -0,0 +1,142 @@ + + * Name: config_load
+ * Purpose: load config file vars + * @link http://smarty.php.net/manual/en/language.function.config.load.php {config_load} + * (Smarty online manual) + * @author Monte Ohrt + * @author messju mohr (added use of resources) + * @param array Format: + *
+ * array('file' => required config file name,
+ *       'section' => optional config file section to load
+ *       'scope' => local/parent/global
+ *       'global' => overrides scope, setting to parent if true)
+ * 
+ * @param Smarty + */ +function smarty_function_config_load($params, &$smarty) +{ + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $_debug_start_time = smarty_core_get_microtime($_params, $smarty); + } + + $_file = isset($params['file']) ? $smarty->_dequote($params['file']) : null; + $_section = isset($params['section']) ? $smarty->_dequote($params['section']) : null; + $_scope = isset($params['scope']) ? $smarty->_dequote($params['scope']) : 'global'; + $_global = isset($params['global']) ? $smarty->_dequote($params['global']) : false; + + if (!isset($_file) || strlen($_file) == 0) { + $smarty->trigger_error("missing 'file' attribute in config_load tag", E_USER_ERROR, __FILE__, __LINE__); + } + + if (isset($_scope)) { + if ($_scope != 'local' && + $_scope != 'parent' && + $_scope != 'global') { + $smarty->trigger_error("invalid 'scope' attribute value", E_USER_ERROR, __FILE__, __LINE__); + } + } else { + if ($_global) { + $_scope = 'parent'; + } else { + $_scope = 'local'; + } + } + + $_params = array('resource_name' => $_file, + 'resource_base_path' => $smarty->config_dir, + 'get_source' => false); + $smarty->_parse_resource_name($_params); + $_file_path = $_params['resource_type'] . ':' . $_params['resource_name']; + if (isset($_section)) + $_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section); + else + $_compile_file = $smarty->_get_compile_path($_file_path); + + if($smarty->force_compile || !file_exists($_compile_file)) { + $_compile = true; + } elseif ($smarty->compile_check) { + $_params = array('resource_name' => $_file, + 'resource_base_path' => $smarty->config_dir, + 'get_source' => false); + $_compile = $smarty->_fetch_resource_info($_params) && + $_params['resource_timestamp'] > filemtime($_compile_file); + } else { + $_compile = false; + } + + if($_compile) { + // compile config file + if(!is_object($smarty->_conf_obj)) { + require_once SMARTY_DIR . $smarty->config_class . '.class.php'; + $smarty->_conf_obj = new $smarty->config_class(); + $smarty->_conf_obj->overwrite = $smarty->config_overwrite; + $smarty->_conf_obj->booleanize = $smarty->config_booleanize; + $smarty->_conf_obj->read_hidden = $smarty->config_read_hidden; + $smarty->_conf_obj->fix_newlines = $smarty->config_fix_newlines; + } + + $_params = array('resource_name' => $_file, + 'resource_base_path' => $smarty->config_dir, + $_params['get_source'] = true); + if (!$smarty->_fetch_resource_info($_params)) { + return; + } + $smarty->_conf_obj->set_file_contents($_file, $_params['source_content']); + $_config_vars = array_merge($smarty->_conf_obj->get($_file), + $smarty->_conf_obj->get($_file, $_section)); + if(function_exists('var_export')) { + $_output = ''; + } else { + $_output = ''\\\'', '\\'=>'\\\\')) . '\'); ?>'; + } + $_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => $_params['resource_timestamp'])); + require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php'); + smarty_core_write_compiled_resource($_params, $smarty); + } else { + include($_compile_file); + } + + if ($smarty->caching) { + $smarty->_cache_info['config'][$_file] = true; + } + + $smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars); + $smarty->_config[0]['files'][$_file] = true; + + if ($_scope == 'parent') { + $smarty->_config[1]['vars'] = @array_merge($smarty->_config[1]['vars'], $_config_vars); + $smarty->_config[1]['files'][$_file] = true; + } else if ($_scope == 'global') { + for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) { + $smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars); + $smarty->_config[$i]['files'][$_file] = true; + } + } + + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $smarty->_smarty_debug_info[] = array('type' => 'config', + 'filename' => $_file.' ['.$_section.'] '.$_scope, + 'depth' => $smarty->_inclusion_depth, + 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time); + } + +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/plugins/function.counter.php b/lib/smarty2/libs/plugins/function.counter.php new file mode 100755 index 0000000..e8937d1 --- /dev/null +++ b/lib/smarty2/libs/plugins/function.counter.php @@ -0,0 +1,80 @@ + + * Name: counter
+ * Purpose: print out a counter value + * @author Monte Ohrt + * @link http://smarty.php.net/manual/en/language.function.counter.php {counter} + * (Smarty online manual) + * @param array parameters + * @param Smarty + * @return string|null + */ +function smarty_function_counter($params, &$smarty) +{ + static $counters = array(); + + $name = (isset($params['name'])) ? $params['name'] : 'default'; + if (!isset($counters[$name])) { + $counters[$name] = array( + 'start'=>1, + 'skip'=>1, + 'direction'=>'up', + 'count'=>1 + ); + } + $counter =& $counters[$name]; + + if (isset($params['start'])) { + $counter['start'] = $counter['count'] = (int)$params['start']; + } + + if (!empty($params['assign'])) { + $counter['assign'] = $params['assign']; + } + + if (isset($counter['assign'])) { + $smarty->assign($counter['assign'], $counter['count']); + } + + if (isset($params['print'])) { + $print = (bool)$params['print']; + } else { + $print = empty($counter['assign']); + } + + if ($print) { + $retval = $counter['count']; + } else { + $retval = null; + } + + if (isset($params['skip'])) { + $counter['skip'] = $params['skip']; + } + + if (isset($params['direction'])) { + $counter['direction'] = $params['direction']; + } + + if ($counter['direction'] == "down") + $counter['count'] -= $counter['skip']; + else + $counter['count'] += $counter['skip']; + + return $retval; + +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/plugins/function.cycle.php b/lib/smarty2/libs/plugins/function.cycle.php new file mode 100755 index 0000000..e171484 --- /dev/null +++ b/lib/smarty2/libs/plugins/function.cycle.php @@ -0,0 +1,106 @@ + + * Name: cycle
+ * Date: May 3, 2002
+ * Purpose: cycle through given values
+ * Input: + * - name = name of cycle (optional) + * - values = comma separated list of values to cycle, + * or an array of values to cycle + * (this can be left out for subsequent calls) + * - reset = boolean - resets given var to true + * - print = boolean - print var or not. default is true + * - advance = boolean - whether or not to advance the cycle + * - delimiter = the value delimiter, default is "," + * - assign = boolean, assigns to template var instead of + * printed. + * + * Examples:
+ *
+ * {cycle values="#eeeeee,#d0d0d0d"}
+ * {cycle name=row values="one,two,three" reset=true}
+ * {cycle name=row}
+ * 
+ * @link http://smarty.php.net/manual/en/language.function.cycle.php {cycle} + * (Smarty online manual) + * @author Monte Ohrt + * @author credit to Mark Priatel + * @author credit to Gerard + * @author credit to Jason Sweat + * @version 1.3 + * @param array + * @param Smarty + * @return string|null + */ +function smarty_function_cycle($params, &$smarty) +{ + static $cycle_vars; + + $name = (empty($params['name'])) ? 'default' : $params['name']; + $print = (isset($params['print'])) ? (bool)$params['print'] : true; + $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true; + $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false; + + if (!in_array('values', array_keys($params))) { + if(!isset($cycle_vars[$name]['values'])) { + $smarty->trigger_error("cycle: missing 'values' parameter"); + return; + } + } else { + if(isset($cycle_vars[$name]['values']) + && $cycle_vars[$name]['values'] != $params['values'] ) { + $cycle_vars[$name]['index'] = 0; + } + $cycle_vars[$name]['values'] = $params['values']; + } + + if (isset($params['delimiter'])) { + $cycle_vars[$name]['delimiter'] = $params['delimiter']; + } elseif (!isset($cycle_vars[$name]['delimiter'])) { + $cycle_vars[$name]['delimiter'] = ','; + } + + if(is_array($cycle_vars[$name]['values'])) { + $cycle_array = $cycle_vars[$name]['values']; + } else { + $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']); + } + + if(!isset($cycle_vars[$name]['index']) || $reset ) { + $cycle_vars[$name]['index'] = 0; + } + + if (isset($params['assign'])) { + $print = false; + $smarty->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); + } + + if($print) { + $retval = $cycle_array[$cycle_vars[$name]['index']]; + } else { + $retval = null; + } + + if($advance) { + if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) { + $cycle_vars[$name]['index'] = 0; + } else { + $cycle_vars[$name]['index']++; + } + } + + return $retval; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/plugins/function.debug.php b/lib/smarty2/libs/plugins/function.debug.php new file mode 100755 index 0000000..de09b30 --- /dev/null +++ b/lib/smarty2/libs/plugins/function.debug.php @@ -0,0 +1,35 @@ + + * Name: debug
+ * Date: July 1, 2002
+ * Purpose: popup debug window + * @link http://smarty.php.net/manual/en/language.function.debug.php {debug} + * (Smarty online manual) + * @author Monte Ohrt + * @version 1.0 + * @param array + * @param Smarty + * @return string output from {@link Smarty::_generate_debug_output()} + */ +function smarty_function_debug($params, &$smarty) +{ + if (isset($params['output'])) { + $smarty->assign('_smarty_debug_output', $params['output']); + } + require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); + return smarty_core_display_debug_console(null, $smarty); +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/plugins/function.eval.php b/lib/smarty2/libs/plugins/function.eval.php new file mode 100755 index 0000000..3bb8cbb --- /dev/null +++ b/lib/smarty2/libs/plugins/function.eval.php @@ -0,0 +1,49 @@ + + * Name: eval
+ * Purpose: evaluate a template variable as a template
+ * @link http://smarty.php.net/manual/en/language.function.eval.php {eval} + * (Smarty online manual) + * @author Monte Ohrt + * @param array + * @param Smarty + */ +function smarty_function_eval($params, &$smarty) +{ + + if (!isset($params['var'])) { + $smarty->trigger_error("eval: missing 'var' parameter"); + return; + } + + if($params['var'] == '') { + return; + } + + $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled); + + ob_start(); + $smarty->_eval('?>' . $_var_compiled); + $_contents = ob_get_contents(); + ob_end_clean(); + + if (!empty($params['assign'])) { + $smarty->assign($params['assign'], $_contents); + } else { + return $_contents; + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/plugins/function.fetch.php b/lib/smarty2/libs/plugins/function.fetch.php new file mode 100755 index 0000000..d0b3e00 --- /dev/null +++ b/lib/smarty2/libs/plugins/function.fetch.php @@ -0,0 +1,221 @@ + + * Name: fetch
+ * Purpose: fetch file, web or ftp data and display results + * @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch} + * (Smarty online manual) + * @author Monte Ohrt + * @param array + * @param Smarty + * @return string|null if the assign parameter is passed, Smarty assigns the + * result to a template variable + */ +function smarty_function_fetch($params, &$smarty) +{ + if (empty($params['file'])) { + $smarty->_trigger_fatal_error("[plugin] parameter 'file' cannot be empty"); + return; + } + + $content = ''; + if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) { + $_params = array('resource_type' => 'file', 'resource_name' => $params['file']); + require_once(SMARTY_CORE_DIR . 'core.is_secure.php'); + if(!smarty_core_is_secure($_params, $smarty)) { + $smarty->_trigger_fatal_error('[plugin] (secure mode) fetch \'' . $params['file'] . '\' is not allowed'); + return; + } + + // fetch the file + if($fp = @fopen($params['file'],'r')) { + while(!feof($fp)) { + $content .= fgets ($fp,4096); + } + fclose($fp); + } else { + $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] . '\''); + return; + } + } else { + // not a local file + if(preg_match('!^http://!i',$params['file'])) { + // http fetch + if($uri_parts = parse_url($params['file'])) { + // set defaults + $host = $server_name = $uri_parts['host']; + $timeout = 30; + $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; + $agent = "Smarty Template Engine ".$smarty->_version; + $referer = ""; + $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; + $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; + $_is_proxy = false; + if(empty($uri_parts['port'])) { + $port = 80; + } else { + $port = $uri_parts['port']; + } + if(!empty($uri_parts['user'])) { + $user = $uri_parts['user']; + } + if(!empty($uri_parts['pass'])) { + $pass = $uri_parts['pass']; + } + // loop through parameters, setup headers + foreach($params as $param_key => $param_value) { + switch($param_key) { + case "file": + case "assign": + case "assign_headers": + break; + case "user": + if(!empty($param_value)) { + $user = $param_value; + } + break; + case "pass": + if(!empty($param_value)) { + $pass = $param_value; + } + break; + case "accept": + if(!empty($param_value)) { + $accept = $param_value; + } + break; + case "header": + if(!empty($param_value)) { + if(!preg_match('![\w\d-]+: .+!',$param_value)) { + $smarty->_trigger_fatal_error("[plugin] invalid header format '".$param_value."'"); + return; + } else { + $extra_headers[] = $param_value; + } + } + break; + case "proxy_host": + if(!empty($param_value)) { + $proxy_host = $param_value; + } + break; + case "proxy_port": + if(!preg_match('!\D!', $param_value)) { + $proxy_port = (int) $param_value; + } else { + $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'"); + return; + } + break; + case "agent": + if(!empty($param_value)) { + $agent = $param_value; + } + break; + case "referer": + if(!empty($param_value)) { + $referer = $param_value; + } + break; + case "timeout": + if(!preg_match('!\D!', $param_value)) { + $timeout = (int) $param_value; + } else { + $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'"); + return; + } + break; + default: + $smarty->_trigger_fatal_error("[plugin] unrecognized attribute '".$param_key."'"); + return; + } + } + if(!empty($proxy_host) && !empty($proxy_port)) { + $_is_proxy = true; + $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout); + } else { + $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout); + } + + if(!$fp) { + $smarty->_trigger_fatal_error("[plugin] unable to fetch: $errstr ($errno)"); + return; + } else { + if($_is_proxy) { + fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n"); + } else { + fputs($fp, "GET $uri HTTP/1.0\r\n"); + } + if(!empty($host)) { + fputs($fp, "Host: $host\r\n"); + } + if(!empty($accept)) { + fputs($fp, "Accept: $accept\r\n"); + } + if(!empty($agent)) { + fputs($fp, "User-Agent: $agent\r\n"); + } + if(!empty($referer)) { + fputs($fp, "Referer: $referer\r\n"); + } + if(isset($extra_headers) && is_array($extra_headers)) { + foreach($extra_headers as $curr_header) { + fputs($fp, $curr_header."\r\n"); + } + } + if(!empty($user) && !empty($pass)) { + fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n"); + } + + fputs($fp, "\r\n"); + while(!feof($fp)) { + $content .= fgets($fp,4096); + } + fclose($fp); + $csplit = preg_split("!\r\n\r\n!",$content,2); + + $content = $csplit[1]; + + if(!empty($params['assign_headers'])) { + $smarty->assign($params['assign_headers'],preg_split("!\r\n!",$csplit[0])); + } + } + } else { + $smarty->_trigger_fatal_error("[plugin] unable to parse URL, check syntax"); + return; + } + } else { + // ftp fetch + if($fp = @fopen($params['file'],'r')) { + while(!feof($fp)) { + $content .= fgets ($fp,4096); + } + fclose($fp); + } else { + $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] .'\''); + return; + } + } + + } + + + if (!empty($params['assign'])) { + $smarty->assign($params['assign'],$content); + } else { + return $content; + } +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/plugins/function.html_checkboxes.php b/lib/smarty2/libs/plugins/function.html_checkboxes.php new file mode 100755 index 0000000..45a161b --- /dev/null +++ b/lib/smarty2/libs/plugins/function.html_checkboxes.php @@ -0,0 +1,143 @@ + + * Type: function
+ * Name: html_checkboxes
+ * Date: 24.Feb.2003
+ * Purpose: Prints out a list of checkbox input types
+ * Input:
+ * - name (optional) - string default "checkbox" + * - values (required) - array + * - options (optional) - associative array + * - checked (optional) - array default not set + * - separator (optional) - ie
or   + * - output (optional) - the output next to each checkbox + * - assign (optional) - assign the output as an array to this variable + * Examples: + *
+ * {html_checkboxes values=$ids output=$names}
+ * {html_checkboxes values=$ids name='box' separator='
' output=$names} + * {html_checkboxes values=$ids checked=$checked separator='
' output=$names} + *
+ * @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes} + * (Smarty online manual) + * @author Christopher Kvarme + * @author credits to Monte Ohrt + * @version 1.0 + * @param array + * @param Smarty + * @return string + * @uses smarty_function_escape_special_chars() + */ +function smarty_function_html_checkboxes($params, &$smarty) +{ + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + + $name = 'checkbox'; + $values = null; + $options = null; + $selected = null; + $separator = ''; + $labels = true; + $output = null; + + $extra = ''; + + foreach($params as $_key => $_val) { + switch($_key) { + case 'name': + case 'separator': + $$_key = $_val; + break; + + case 'labels': + $$_key = (bool)$_val; + break; + + case 'options': + $$_key = (array)$_val; + break; + + case 'values': + case 'output': + $$_key = array_values((array)$_val); + break; + + case 'checked': + case 'selected': + $selected = array_map('strval', array_values((array)$_val)); + break; + + case 'checkboxes': + $smarty->trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING); + $options = (array)$_val; + break; + + case 'assign': + break; + + default: + if(!is_array($_val)) { + $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + } else { + $smarty->trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; + } + } + + if (!isset($options) && !isset($values)) + return ''; /* raise error here? */ + + settype($selected, 'array'); + $_html_result = array(); + + if (isset($options)) { + + foreach ($options as $_key=>$_val) + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); + + + } else { + foreach ($values as $_i=>$_key) { + $_val = isset($output[$_i]) ? $output[$_i] : ''; + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); + } + + } + + if(!empty($params['assign'])) { + $smarty->assign($params['assign'], $_html_result); + } else { + return implode("\n",$_html_result); + } + +} + +function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) { + $_output = ''; + if ($labels) $_output .= ''; + $_output .= $separator; + + return $_output; +} + +?> diff --git a/lib/smarty2/libs/plugins/function.html_image.php b/lib/smarty2/libs/plugins/function.html_image.php new file mode 100755 index 0000000..d758ebe --- /dev/null +++ b/lib/smarty2/libs/plugins/function.html_image.php @@ -0,0 +1,142 @@ + + * Name: html_image
+ * Date: Feb 24, 2003
+ * Purpose: format HTML tags for the image
+ * Input:
+ * - file = file (and path) of image (required) + * - height = image height (optional, default actual height) + * - width = image width (optional, default actual width) + * - basedir = base directory for absolute paths, default + * is environment variable DOCUMENT_ROOT + * - path_prefix = prefix for path output (optional, default empty) + * + * Examples: {html_image file="/images/masthead.gif"} + * Output: + * @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image} + * (Smarty online manual) + * @author Monte Ohrt + * @author credits to Duda - wrote first image function + * in repository, helped with lots of functionality + * @version 1.0 + * @param array + * @param Smarty + * @return string + * @uses smarty_function_escape_special_chars() + */ +function smarty_function_html_image($params, &$smarty) +{ + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + + $alt = ''; + $file = ''; + $height = ''; + $width = ''; + $extra = ''; + $prefix = ''; + $suffix = ''; + $path_prefix = ''; + $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; + $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : ''; + foreach($params as $_key => $_val) { + switch($_key) { + case 'file': + case 'height': + case 'width': + case 'dpi': + case 'path_prefix': + case 'basedir': + $$_key = $_val; + break; + + case 'alt': + if(!is_array($_val)) { + $$_key = smarty_function_escape_special_chars($_val); + } else { + $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; + + case 'link': + case 'href': + $prefix = ''; + $suffix = ''; + break; + + default: + if(!is_array($_val)) { + $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + } else { + $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; + } + } + + if (empty($file)) { + $smarty->trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE); + return; + } + + if (substr($file,0,1) == '/') { + $_image_path = $basedir . $file; + } else { + $_image_path = $file; + } + + if(!isset($params['width']) || !isset($params['height'])) { + if(!$_image_data = @getimagesize($_image_path)) { + if(!file_exists($_image_path)) { + $smarty->trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE); + return; + } else if(!is_readable($_image_path)) { + $smarty->trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE); + return; + } else { + $smarty->trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE); + return; + } + } + if ($smarty->security && + ($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) && + (require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) && + (!smarty_core_is_secure($_params, $smarty)) ) { + $smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE); + } + + if(!isset($params['width'])) { + $width = $_image_data[0]; + } + if(!isset($params['height'])) { + $height = $_image_data[1]; + } + + } + + if(isset($params['dpi'])) { + if(strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) { + $dpi_default = 72; + } else { + $dpi_default = 96; + } + $_resize = $dpi_default/$params['dpi']; + $width = round($width * $_resize); + $height = round($height * $_resize); + } + + return $prefix . ''.$alt.'' . $suffix; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/plugins/function.html_options.php b/lib/smarty2/libs/plugins/function.html_options.php new file mode 100755 index 0000000..f84b631 --- /dev/null +++ b/lib/smarty2/libs/plugins/function.html_options.php @@ -0,0 +1,122 @@ + + * Name: html_options
+ * Input:
+ * - name (optional) - string default "select" + * - values (required if no options supplied) - array + * - options (required if no values supplied) - associative array + * - selected (optional) - string default not set + * - output (required if not options supplied) - array + * Purpose: Prints the list of
!is", $source, $match); + $_pre_blocks = $match[0]; + $source = preg_replace("!]*?>.*?
!is", + '@@@SMARTY:TRIM:PRE@@@', $source); + + // Pull out the textarea blocks + preg_match_all("!]*?>.*?!is", $source, $match); + $_textarea_blocks = $match[0]; + $source = preg_replace("!]*?>.*?!is", + '@@@SMARTY:TRIM:TEXTAREA@@@', $source); + + // remove all leading spaces, tabs and carriage returns NOT + // preceeded by a php close tag. + $source = trim(preg_replace('/((?)\n)[\s]+/m', '\1', $source)); + + // replace textarea blocks + smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:TEXTAREA@@@",$_textarea_blocks, $source); + + // replace pre blocks + smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:PRE@@@",$_pre_blocks, $source); + + // replace script blocks + smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:SCRIPT@@@",$_script_blocks, $source); + + return $source; +} + +function smarty_outputfilter_trimwhitespace_replace($search_str, $replace, &$subject) { + $_len = strlen($search_str); + $_pos = 0; + for ($_i=0, $_count=count($replace); $_i<$_count; $_i++) + if (($_pos=strpos($subject, $search_str, $_pos))!==false) + $subject = substr_replace($subject, $replace[$_i], $_pos, $_len); + else + break; + +} + +?> diff --git a/lib/smarty2/libs/plugins/shared.escape_special_chars.php b/lib/smarty2/libs/plugins/shared.escape_special_chars.php new file mode 100755 index 0000000..4ea0979 --- /dev/null +++ b/lib/smarty2/libs/plugins/shared.escape_special_chars.php @@ -0,0 +1,31 @@ + + * Purpose: used by other smarty functions to escape + * special chars except for already escaped ones + * @author Monte Ohrt + * @param string + * @return string + */ +function smarty_function_escape_special_chars($string) +{ + if(!is_array($string)) { + $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); + $string = htmlspecialchars($string); + $string = str_replace(array('%%%SMARTY_START%%%','%%%SMARTY_END%%%'), array('&',';'), $string); + } + return $string; +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty2/libs/plugins/shared.make_timestamp.php b/lib/smarty2/libs/plugins/shared.make_timestamp.php new file mode 100755 index 0000000..2673165 --- /dev/null +++ b/lib/smarty2/libs/plugins/shared.make_timestamp.php @@ -0,0 +1,46 @@ + + * Purpose: used by other smarty functions to make a timestamp + * from a string. + * @author Monte Ohrt + * @param string + * @return string + */ +function smarty_make_timestamp($string) +{ + if(empty($string)) { + // use "now": + $time = time(); + + } elseif (preg_match('/^\d{14}$/', $string)) { + // it is mysql timestamp format of YYYYMMDDHHMMSS? + $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2), + substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4)); + + } elseif (is_numeric($string)) { + // it is a numeric string, we handle it as timestamp + $time = (int)$string; + + } else { + // strtotime should handle it + $time = strtotime($string); + if ($time == -1 || $time === false) { + // strtotime() was not able to parse $string, use "now": + $time = time(); + } + } + return $time; + +} + +/* vim: set expandtab: */ + +?> diff --git a/lib/smarty_3/COPYING.lib b/lib/smarty_3/COPYING.lib new file mode 100755 index 0000000..02bbb60 --- /dev/null +++ b/lib/smarty_3/COPYING.lib @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/lib/smarty_3/README b/lib/smarty_3/README new file mode 100755 index 0000000..dbbce79 --- /dev/null +++ b/lib/smarty_3/README @@ -0,0 +1,574 @@ +Smarty 3.1.19 + +Author: Monte Ohrt +Author: Uwe Tews + +AN INTRODUCTION TO SMARTY 3 + +NOTICE FOR 3.1 release: + +Please see the SMARTY_3.1_NOTES.txt file that comes with the distribution. + +NOTICE for 3.0.5 release: + +Smarty now follows the PHP error_reporting level by default. If PHP does not mask E_NOTICE and you try to access an unset template variable, you will now get an E_NOTICE warning. To revert to the old behavior: + +$smarty->error_reporting = E_ALL & ~E_NOTICE; + +NOTICE for 3.0 release: + +IMPORTANT: Some API adjustments have been made between the RC4 and 3.0 release. +We felt it is better to make these now instead of after a 3.0 release, then have to +immediately deprecate APIs in 3.1. Online documentation has been updated +to reflect these changes. Specifically: + +---- API CHANGES RC4 -> 3.0 ---- + +$smarty->register->* +$smarty->unregister->* +$smarty->utility->* +$samrty->cache->* + +Have all been changed to local method calls such as: + +$smarty->clearAllCache() +$smarty->registerFoo() +$smarty->unregisterFoo() +$smarty->testInstall() +etc. + +Registration of function, block, compiler, and modifier plugins have been +consolidated under two API calls: + +$smarty->registerPlugin(...) +$smarty->unregisterPlugin(...) + +Registration of pre, post, output and variable filters have been +consolidated under two API calls: + +$smarty->registerFilter(...) +$smarty->unregisterFilter(...) + +Please refer to the online documentation for all specific changes: + +http://www.smarty.net/documentation + +---- + +The Smarty 3 API has been refactored to a syntax geared +for consistency and modularity. The Smarty 2 API syntax is still supported, but +will throw a deprecation notice. You can disable the notices, but it is highly +recommended to adjust your syntax to Smarty 3, as the Smarty 2 syntax must run +through an extra rerouting wrapper. + +Basically, all Smarty methods now follow the "fooBarBaz" camel case syntax. Also, +all Smarty properties now have getters and setters. So for example, the property +$smarty->cache_dir can be set with $smarty->setCacheDir('foo/') and can be +retrieved with $smarty->getCacheDir(). + +Some of the Smarty 3 APIs have been revoked such as the "is*" methods that were +just duplicate functions of the now available "get*" methods. + +Here is a rundown of the Smarty 3 API: + +$smarty->fetch($template, $cache_id = null, $compile_id = null, $parent = null) +$smarty->display($template, $cache_id = null, $compile_id = null, $parent = null) +$smarty->isCached($template, $cache_id = null, $compile_id = null) +$smarty->createData($parent = null) +$smarty->createTemplate($template, $cache_id = null, $compile_id = null, $parent = null) +$smarty->enableSecurity() +$smarty->disableSecurity() +$smarty->setTemplateDir($template_dir) +$smarty->addTemplateDir($template_dir) +$smarty->templateExists($resource_name) +$smarty->loadPlugin($plugin_name, $check = true) +$smarty->loadFilter($type, $name) +$smarty->setExceptionHandler($handler) +$smarty->addPluginsDir($plugins_dir) +$smarty->getGlobal($varname = null) +$smarty->getRegisteredObject($name) +$smarty->getDebugTemplate() +$smarty->setDebugTemplate($tpl_name) +$smarty->assign($tpl_var, $value = null, $nocache = false) +$smarty->assignGlobal($varname, $value = null, $nocache = false) +$smarty->assignByRef($tpl_var, &$value, $nocache = false) +$smarty->append($tpl_var, $value = null, $merge = false, $nocache = false) +$smarty->appendByRef($tpl_var, &$value, $merge = false) +$smarty->clearAssign($tpl_var) +$smarty->clearAllAssign() +$smarty->configLoad($config_file, $sections = null) +$smarty->getVariable($variable, $_ptr = null, $search_parents = true, $error_enable = true) +$smarty->getConfigVariable($variable) +$smarty->getStreamVariable($variable) +$smarty->getConfigVars($varname = null) +$smarty->clearConfig($varname = null) +$smarty->getTemplateVars($varname = null, $_ptr = null, $search_parents = true) +$smarty->clearAllCache($exp_time = null, $type = null) +$smarty->clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null) + +$smarty->registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = array()) + +$smarty->registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) + +$smarty->registerFilter($type, $function_name) +$smarty->registerResource($resource_type, $function_names) +$smarty->registerDefaultPluginHandler($function_name) +$smarty->registerDefaultTemplateHandler($function_name) + +$smarty->unregisterPlugin($type, $tag) +$smarty->unregisterObject($object_name) +$smarty->unregisterFilter($type, $function_name) +$smarty->unregisterResource($resource_type) + +$smarty->compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null) +$smarty->clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null) +$smarty->testInstall() + +// then all the getters/setters, available for all properties. Here are a few: + +$caching = $smarty->getCaching(); // get $smarty->caching +$smarty->setCaching(true); // set $smarty->caching +$smarty->setDeprecationNotices(false); // set $smarty->deprecation_notices +$smarty->setCacheId($id); // set $smarty->cache_id +$debugging = $smarty->getDebugging(); // get $smarty->debugging + + +FILE STRUCTURE + +The Smarty 3 file structure is similar to Smarty 2: + +/libs/ + Smarty.class.php +/libs/sysplugins/ + internal.* +/libs/plugins/ + function.mailto.php + modifier.escape.php + ... + +A lot of Smarty 3 core functionality lies in the sysplugins directory; you do +not need to change any files here. The /libs/plugins/ folder is where Smarty +plugins are located. You can add your own here, or create a separate plugin +directory, just the same as Smarty 2. You will still need to create your own +/cache/, /templates/, /templates_c/, /configs/ folders. Be sure /cache/ and +/templates_c/ are writable. + +The typical way to use Smarty 3 should also look familiar: + +require('Smarty.class.php'); +$smarty = new Smarty; +$smarty->assign('foo','bar'); +$smarty->display('index.tpl'); + + +However, Smarty 3 works completely different on the inside. Smarty 3 is mostly +backward compatible with Smarty 2, except for the following items: + +*) Smarty 3 is PHP 5 only. It will not work with PHP 4. +*) The {php} tag is disabled by default. Enable with $smarty->allow_php_tag=true. +*) Delimiters surrounded by whitespace are no longer treated as Smarty tags. + Therefore, { foo } will not compile as a tag, you must use {foo}. This change + Makes Javascript/CSS easier to work with, eliminating the need for {literal}. + This can be disabled by setting $smarty->auto_literal = false; +*) The Smarty 3 API is a bit different. Many Smarty 2 API calls are deprecated + but still work. You will want to update your calls to Smarty 3 for maximum + efficiency. + + +There are many things that are new to Smarty 3. Here are the notable items: + +LEXER/PARSER +============ + +Smarty 3 now uses a lexing tokenizer for its parser/compiler. Basically, this +means Smarty has some syntax additions that make life easier such as in-template +math, shorter/intuitive function parameter options, infinite function recursion, +more accurate error handling, etc. + + +WHAT IS NEW IN SMARTY TEMPLATE SYNTAX +===================================== + +Smarty 3 allows expressions almost anywhere. Expressions can include PHP +functions as long as they are not disabled by the security policy, object +methods and properties, etc. The {math} plugin is no longer necessary but +is still supported for BC. + +Examples: +{$x+$y} will output the sum of x and y. +{$foo = strlen($bar)} function in assignment +{assign var=foo value= $x+$y} in attributes +{$foo = myfunct( ($x+$y)*3 )} as function parameter +{$foo[$x+3]} as array index + +Smarty tags can be used as values within other tags. +Example: {$foo={counter}+3} + +Smarty tags can also be used inside double quoted strings. +Example: {$foo="this is message {counter}"} + +You can define arrays within templates. +Examples: +{assign var=foo value=[1,2,3]} +{assign var=foo value=['y'=>'yellow','b'=>'blue']} +Arrays can be nested. +{assign var=foo value=[1,[9,8],3]} + +There is a new short syntax supported for assigning variables. +Example: {$foo=$bar+2} + +You can assign a value to a specific array element. If the variable exists but +is not an array, it is converted to an array before the new values are assigned. +Examples: +{$foo['bar']=1} +{$foo['bar']['blar']=1} + +You can append values to an array. If the variable exists but is not an array, +it is converted to an array before the new values are assigned. +Example: {$foo[]=1} + +You can use a PHP-like syntax for accessing array elements, as well as the +original "dot" notation. +Examples: +{$foo[1]} normal access +{$foo['bar']} +{$foo['bar'][1]} +{$foo[$x+$x]} index may contain any expression +{$foo[$bar[1]]} nested index +{$foo[section_name]} smarty section access, not array access! + +The original "dot" notation stays, and with improvements. +Examples: +{$foo.a.b.c} => $foo['a']['b']['c'] +{$foo.a.$b.c} => $foo['a'][$b]['c'] with variable index +{$foo.a.{$b+4}.c} => $foo['a'][$b+4]['c'] with expression as index +{$foo.a.{$b.c}} => $foo['a'][$b['c']] with nested index + +note that { and } are used to address ambiguties when nesting the dot syntax. + +Variable names themselves can be variable and contain expressions. +Examples: +$foo normal variable +$foo_{$bar} variable name containing other variable +$foo_{$x+$y} variable name containing expressions +$foo_{$bar}_buh_{$blar} variable name with multiple segments +{$foo_{$x}} will output the variable $foo_1 if $x has a value of 1. + +Object method chaining is implemented. +Example: {$object->method1($x)->method2($y)} + +{for} tag added for looping (replacement for {section} tag): +{for $x=0, $y=count($foo); $x<$y; $x++} .... {/for} +Any number of statements can be used separated by comma as the first +inital expression at {for}. + +{for $x = $start to $end step $step} ... {/for}is in the SVN now . +You can use also +{for $x = $start to $end} ... {/for} +In this case the step value will be automaticall 1 or -1 depending on the start and end values. +Instead of $start and $end you can use any valid expression. +Inside the loop the following special vars can be accessed: +$x@iteration = number of iteration +$x@total = total number of iterations +$x@first = true on first iteration +$x@last = true on last iteration + + +The Smarty 2 {section} syntax is still supported. + +New shorter {foreach} syntax to loop over an array. +Example: {foreach $myarray as $var}...{/foreach} + +Within the foreach loop, properties are access via: + +$var@key foreach $var array key +$var@iteration foreach current iteration count (1,2,3...) +$var@index foreach current index count (0,1,2...) +$var@total foreach $var array total +$var@first true on first iteration +$var@last true on last iteration + +The Smarty 2 {foreach} tag syntax is still supported. + +NOTE: {$bar[foo]} still indicates a variable inside of a {section} named foo. +If you want to access an array element with index foo, you must use quotes +such as {$bar['foo']}, or use the dot syntax {$bar.foo}. + +while block tag is now implemented: +{while $foo}...{/while} +{while $x lt 10}...{/while} + +Direct access to PHP functions: +Just as you can use PHP functions as modifiers directly, you can now access +PHP functions directly, provided they are permitted by security settings: +{time()} + +There is a new {function}...{/function} block tag to implement a template function. +This enables reuse of code sequences like a plugin function. It can call itself recursively. +Template function must be called with the new {call name=foo...} tag. + +Example: + +Template file: +{function name=menu level=0} +
    + {foreach $data as $entry} + {if is_array($entry)} +
  • {$entry@key}
  • + {call name=menu data=$entry level=$level+1} + {else} +
  • {$entry}
  • + {/if} + {/foreach} +
+{/function} + +{$menu = ['item1','item2','item3' => ['item3-1','item3-2','item3-3' => + ['item3-3-1','item3-3-2']],'item4']} + +{call name=menu data=$menu} + + +Generated output: + * item1 + * item2 + * item3 + o item3-1 + o item3-2 + o item3-3 + + item3-3-1 + + item3-3-2 + * item4 + +The function tag itself must have the "name" attribute. This name is the tag +name when calling the function. The function tag may have any number of +additional attributes. These will be default settings for local variables. + +New {nocache} block function: +{nocache}...{/nocache} will declare a section of the template to be non-cached +when template caching is enabled. + +New nocache attribute: +You can declare variable/function output as non-cached with the nocache attribute. +Examples: + +{$foo nocache=true} +{$foo nocache} /* same */ + +{foo bar="baz" nocache=true} +{foo bar="baz" nocache} /* same */ + +{time() nocache=true} +{time() nocache} /* same */ + +Or you can also assign the variable in your script as nocache: +$smarty->assign('foo',$something,true); // third param is nocache setting +{$foo} /* non-cached */ + +$smarty.current_dir returns the directory name of the current template. + +You can use strings directly as templates with the "string" resource type. +Examples: +$smarty->display('string:This is my template, {$foo}!'); // php +{include file="string:This is my template, {$foo}!"} // template + + + +VARIABLE SCOPE / VARIABLE STORAGE +================================= + +In Smarty 2, all assigned variables were stored within the Smarty object. +Therefore, all variables assigned in PHP were accessible by all subsequent +fetch and display template calls. + +In Smarty 3, we have the choice to assign variables to the main Smarty object, +to user-created data objects, and to user-created template objects. +These objects can be chained. The object at the end of a chain can access all +variables belonging to that template and all variables within the parent objects. +The Smarty object can only be the root of a chain, but a chain can be isolated +from the Smarty object. + +All known Smarty assignment interfaces will work on the data and template objects. + +Besides the above mentioned objects, there is also a special storage area for +global variables. + +A Smarty data object can be created as follows: +$data = $smarty->createData(); // create root data object +$data->assign('foo','bar'); // assign variables as usual +$data->config_load('my.conf'); // load config file + +$data= $smarty->createData($smarty); // create data object having a parent link to +the Smarty object + +$data2= $smarty->createData($data); // create data object having a parent link to +the $data data object + +A template object can be created by using the createTemplate method. It has the +same parameter assignments as the fetch() or display() method. +Function definition: +function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null) + +The first parameter can be a template name, a smarty object or a data object. + +Examples: +$tpl = $smarty->createTemplate('mytpl.tpl'); // create template object not linked to any parent +$tpl->assign('foo','bar'); // directly assign variables +$tpl->config_load('my.conf'); // load config file + +$tpl = $smarty->createTemplate('mytpl.tpl',$smarty); // create template having a parent link to the Smarty object +$tpl = $smarty->createTemplate('mytpl.tpl',$data); // create template having a parent link to the $data object + +The standard fetch() and display() methods will implicitly create a template object. +If the $parent parameter is not specified in these method calls, the template object +is will link back to the Smarty object as it's parent. + +If a template is called by an {include...} tag from another template, the +subtemplate links back to the calling template as it's parent. + +All variables assigned locally or from a parent template are accessible. If the +template creates or modifies a variable by using the {assign var=foo...} or +{$foo=...} tags, these new values are only known locally (local scope). When the +template exits, none of the new variables or modifications can be seen in the +parent template(s). This is same behavior as in Smarty 2. + +With Smarty 3, we can assign variables with a scope attribute which allows the +availablility of these new variables or modifications globally (ie in the parent +templates.) + +Possible scopes are local, parent, root and global. +Examples: +{assign var=foo value='bar'} // no scope is specified, the default 'local' +{$foo='bar'} // same, local scope +{assign var=foo value='bar' scope='local'} // same, local scope + +{assign var=foo value='bar' scope='parent'} // Values will be available to the parent object +{$foo='bar' scope='parent'} // (normally the calling template) + +{assign var=foo value='bar' scope='root'} // Values will be exported up to the root object, so they can +{$foo='bar' scope='root'} // be seen from all templates using the same root. + +{assign var=foo value='bar' scope='global'} // Values will be exported to global variable storage, +{$foo='bar' scope='global'} // they are available to any and all templates. + + +The scope attribute can also be attached to the {include...} tag. In this case, +the specified scope will be the default scope for all assignments within the +included template. + + +PLUGINS +======= + +Smarty3 are following the same coding rules as in Smarty2. +The only difference is that the template object is passed as additional third parameter. + +smarty_plugintype_name (array $params, object $smarty, object $template) + +The Smarty 2 plugins are still compatible as long as they do not make use of specific Smarty2 internals. + + +TEMPLATE INHERITANCE: +===================== + +With template inheritance you can define blocks, which are areas that can be +overriden by child templates, so your templates could look like this: + +parent.tpl: + + + {block name='title'}My site name{/block} + + +

{block name='page-title'}Default page title{/block}

+
+ {block name='content'} + Default content + {/block} +
+ + + +child.tpl: +{extends file='parent.tpl'} +{block name='title'} +Child title +{/block} + +grandchild.tpl: +{extends file='child.tpl'} +{block name='title'}Home - {$smarty.block.parent}{/block} +{block name='page-title'}My home{/block} +{block name='content'} + {foreach $images as $img} + {$img.description} + {/foreach} +{/block} + +We redefined all the blocks here, however in the title block we used {$smarty.block.parent}, +which tells Smarty to insert the default content from the parent template in its place. +The content block was overriden to display the image files, and page-title has also be +overriden to display a completely different title. + +If we render grandchild.tpl we will get this: + + + Home - Child title + + +

My home

+
+ image + image + image +
+ + + +NOTE: In the child templates everything outside the {extends} or {block} tag sections +is ignored. + +The inheritance tree can be as big as you want (meaning you can extend a file that +extends another one that extends another one and so on..), but be aware that all files +have to be checked for modifications at runtime so the more inheritance the more overhead you add. + +Instead of defining the parent/child relationships with the {extends} tag in the child template you +can use the resource as follow: + +$smarty->display('extends:parent.tpl|child.tpl|grandchild.tpl'); + +Child {block} tags may optionally have a append or prepend attribute. In this case the parent block content +is appended or prepended to the child block content. + +{block name='title' append} My title {/block} + + +PHP STREAMS: +============ + +(see online documentation) + +VARIBLE FILTERS: +================ + +(see online documentation) + + +STATIC CLASS ACCESS AND NAMESPACE SUPPORT +========================================= + +You can register a class with optional namespace for the use in the template like: + +$smarty->register->templateClass('foo','name\name2\myclass'); + +In the template you can use it like this: +{foo::method()} etc. + + +======================= + +Please look through it and send any questions/suggestions/etc to the forums. + +http://www.phpinsider.com/smarty-forum/viewtopic.php?t=14168 + +Monte and Uwe diff --git a/lib/smarty_3/SMARTY_2_BC_NOTES.txt b/lib/smarty_3/SMARTY_2_BC_NOTES.txt new file mode 100755 index 0000000..18c68b4 --- /dev/null +++ b/lib/smarty_3/SMARTY_2_BC_NOTES.txt @@ -0,0 +1,109 @@ += Known incompatibilities with Smarty 2 = + +== Syntax == + +Smarty 3 API has a new syntax. Much of the Smarty 2 syntax is supported +by a wrapper but deprecated. See the README that comes with Smarty 3 for more +information. + +The {$array|@mod} syntax has always been a bit confusing, where an "@" is required +to apply a modifier to an array instead of the individual elements. Normally you +always want the modifier to apply to the variable regardless of its type. In Smarty 3, +{$array|mod} and {$array|@mod} behave identical. It is safe to drop the "@" and the +modifier will still apply to the array. If you really want the modifier to apply to +each array element, you must loop the array in-template, or use a custom modifier that +supports array iteration. Most smarty functions already escape values where necessary +such as {html_options} + +== PHP Version == +Smarty 3 is PHP 5 only. It will not work with PHP 4. + +== {php} Tag == +The {php} tag is disabled by default. The use of {php} tags is +deprecated. It can be enabled with $smarty->allow_php_tag=true. + +But if you scatter PHP code which belongs together into several +{php} tags it may not work any longer. + +== Delimiters and whitespace == +Delimiters surrounded by whitespace are no longer treated as Smarty tags. +Therefore, { foo } will not compile as a tag, you must use {foo}. This change +Makes Javascript/CSS easier to work with, eliminating the need for {literal}. +This can be disabled by setting $smarty->auto_literal = false; + +== Unquoted Strings == +Smarty 2 was a bit more forgiving (and ambiguous) when it comes to unquoted strings +in parameters. Smarty3 is more restrictive. You can still pass strings without quotes +so long as they contain no special characters. (anything outside of A-Za-z0-9_) + +For example filename strings must be quoted + +{include file='path/foo.tpl'} + + +== Extending the Smarty class == +Smarty 3 makes use of the __construct method for initialization. If you are extending +the Smarty class, its constructor is not called implicitly if the your child class defines +its own constructor. In order to run Smarty's constructor, a call to parent::__construct() +within your child constructor is required. + + +class MySmarty extends Smarty { + function __construct() { + parent::__construct(); + + // your initialization code goes here + + } +} + + +== Autoloader == +Smarty 3 does register its own autoloader with spl_autoload_register. If your code has +an existing __autoload function then this function must be explicitly registered on +the __autoload stack. See http://us3.php.net/manual/en/function.spl-autoload-register.php +for further details. + +== Plugin Filenames == +Smarty 3 optionally supports the PHP spl_autoloader. The autoloader requires filenames +to be lower case. Because of this, Smarty plugin file names must also be lowercase. +In Smarty 2, mixed case file names did work. + +== Scope of Special Smarty Variables == +In Smarty 2 the special Smarty variables $smarty.section... and $smarty.foreach... +had global scope. If you had loops with the same name in subtemplates you could accidentally +overwrite values of parent template. + +In Smarty 3 these special Smarty variable have only local scope in the template which +is defining the loop. If you need their value in a subtemplate you have to pass them +as parameter. + +{include file='path/foo.tpl' index=$smarty.section.foo.index} + + +== SMARTY_RESOURCE_CHAR_SET == +Smarty 3 sets the constant SMARTY_RESOURCE_CHAR_SET to utf-8 as default template charset. +This is now used also on modifiers like escape as default charset. If your templates use +other charsets make sure that you define the constant accordingly. Otherwise you may not +get any output. + +== newline at {if} tags == +A \n was added to the compiled code of the {if},{else},{elseif},{/if} tags to get output of newlines as expected by the template source. +If one of the {if} tags is at the line end you will now get a newline in the HTML output. + +== trigger_error() == +The API function trigger_error() has been removed because it did just map to PHP trigger_error. +However it's still included in the Smarty2 API wrapper. + +== Smarty constants == +The constants +SMARTY_PHP_PASSTHRU +SMARTY_PHP_QUOTE +SMARTY_PHP_REMOVE +SMARTY_PHP_ALLOW +have been replaced with class constants +Smarty::PHP_PASSTHRU +Smarty::PHP_QUOTE +Smarty::PHP_REMOVE +Smarty::PHP_ALLOW + diff --git a/lib/smarty_3/SMARTY_3.0_BC_NOTES.txt b/lib/smarty_3/SMARTY_3.0_BC_NOTES.txt new file mode 100755 index 0000000..e3dbcf5 --- /dev/null +++ b/lib/smarty_3/SMARTY_3.0_BC_NOTES.txt @@ -0,0 +1,24 @@ +== Smarty2 backward compatibility == +All Smarty2 specific API functions and deprecated functionallity has been moved +to the SmartyBC class. + +== {php} Tag == +The {php} tag is no longer available in the standard Smarty calls. +The use of {php} tags is deprecated and only available in the SmartyBC class. + +== {include_php} Tag == +The {include_php} tag is no longer available in the standard Smarty calls. +The use of {include_php} tags is deprecated and only available in the SmartyBC class. + +== php template resource == +The support of the php template resource is removed. + +== $cache_dir, $compile_dir, $config_dir, $template_dir access == +The mentioned properties can't be accessed directly any longer. You must use +corresponding getter/setters like addConfigDir(), setConfigDir(), getConfigDir() + +== obsolete Smarty class properties == +The following no longer used properties are removed: +$allow_php_tag +$allow_php_template +$deprecation_notices \ No newline at end of file diff --git a/lib/smarty_3/SMARTY_3.1_NOTES.txt b/lib/smarty_3/SMARTY_3.1_NOTES.txt new file mode 100755 index 0000000..45f340b --- /dev/null +++ b/lib/smarty_3/SMARTY_3.1_NOTES.txt @@ -0,0 +1,306 @@ +Smarty 3.1 Notes +================ + +Smarty 3.1 is a departure from 2.0 compatibility. Most notably, all +backward compatibility has been moved to a separate class file named +SmartyBC.class.php. If you require compatibility with 2.0, you will +need to use this class. + +Some differences from 3.0 are also present. 3.1 begins the journey of +requiring setters/getters for property access. So far this is only +implemented on the five directory properties: template_dir, +plugins_dir, configs_dir, compile_dir and cache_dir. These properties +are now protected, it is required to use the setters/getters instead. +That said, direct property access will still work, however slightly +slower since they will now fall through __set() and __get() and in +turn passed through the setter/getter methods. 3.2 will exhibit a full +list of setter/getter methods for all (currently) public properties, +so code-completion in your IDE will work as expected. + +There is absolutely no PHP allowed in templates any more. All +deprecated features of Smarty 2.0 are gone. Again, use the SmartyBC +class if you need any backward compatibility. + +Internal Changes + + Full UTF-8 Compatibility + +The plugins shipped with Smarty 3.1 have been rewritten to fully +support UTF-8 strings if Multibyte String is available. Without +MBString UTF-8 cannot be handled properly. For those rare cases where +templates themselves have to juggle encodings, the new modifiers +to_charset and from_charset may come in handy. + + Plugin API and Performance + +All Plugins (modifiers, functions, blocks, resources, +default_template_handlers, etc) are now receiving the +Smarty_Internal_Template instance, where they were supplied with the +Smarty instance in Smarty 3.0. *. As The Smarty_Internal_Template +mimics the behavior of Smarty, this API simplification should not +require any changes to custom plugins. + +The plugins shipped with Smarty 3.1 have been rewritten for better +performance. Most notably {html_select_date} and {html_select_time} +have been improved vastly. Performance aside, plugins have also been +reviewed and generalized in their API. {html_select_date} and +{html_select_time} now share almost all available options. + +The escape modifier now knows the $double_encode option, which will +prevent entities from being encoded again. + +The capitalize modifier now know the $lc_rest option, which makes sure +all letters following a captial letter are lower-cased. + +The count_sentences modifier now accepts (.?!) as +legitimate endings of a sentence - previously only (.) was +accepted + +The new unescape modifier is there to reverse the effects of the +escape modifier. This applies to the escape formats html, htmlall and +entity. + + default_template_handler_func + +The invocation of $smarty->$default_template_handler_func had to be +altered. Instead of a Smarty_Internal_Template, the fifth argument is +now provided with the Smarty instance. New footprint: + + +/** + * Default Template Handler + * + * called when Smarty's file: resource is unable to load a requested file + * + * @param string $type resource type (e.g. "file", "string", "eval", "resource") + * @param string $name resource name (e.g. "foo/bar.tpl") + * @param string &$content template's content + * @param integer &$modified template's modification time + * @param Smarty $smarty Smarty instance + * @return string|boolean path to file or boolean true if $content and $modified + * have been filled, boolean false if no default template + * could be loaded + */ +function default_template_handler_func($type, $name, &$content, &$modified, Smarty $smarty) { + if (false) { + // return corrected filepath + return "/tmp/some/foobar.tpl"; + } elseif (false) { + // return a template directly + $content = "the template source"; + $modified = time(); + return true; + } else { + // tell smarty that we failed + return false; + } +} + + Stuff done to the compiler + +Many performance improvements have happened internally. One notable +improvement is that all compiled templates are now handled as PHP +functions. This speeds up repeated templates tremendously, as each one +calls an (in-memory) PHP function instead of performing another file +include/scan. + +New Features + + Template syntax + + {block}..{/block} + +The {block} tag has a new hide option flag. It does suppress the block +content if no corresponding child block exists. +EXAMPLE: +parent.tpl +{block name=body hide} child content "{$smarty.block.child}" was +inserted {block} +In the above example the whole block will be suppressed if no child +block "body" is existing. + + {setfilter}..{/setfilter} + +The new {setfilter} block tag allows the definition of filters which +run on variable output. +SYNTAX: +{setfilter filter1|filter2|filter3....} +Smarty3 will lookup up matching filters in the following search order: +1. varibale filter plugin in plugins_dir. +2. a valid modifier. A modifier specification will also accept +additional parameter like filter2:'foo' +3. a PHP function +{/setfilter} will turn previous filter setting off again. +{setfilter} tags can be nested. +EXAMPLE: +{setfilter filter1} + {$foo} + {setfilter filter2} + {$bar} + {/setfilter} + {$buh} +{/setfilter} +{$blar} +In the above example filter1 will run on the output of $foo, filter2 +on $bar, filter1 again on $buh and no filter on $blar. +NOTES: +- {$foo nofilter} will suppress the filters +- These filters will run in addition to filters defined by +registerFilter('variable',...), autoLoadFilter('variable',...) and +defined default modifier. +- {setfilter} will effect only the current template, not included +subtemplates. + + Resource API + +Smarty 3.1 features a new approach to resource management. The +Smarty_Resource API allows simple, yet powerful integration of custom +resources for templates and configuration files. It offers simple +functions for loading data from a custom resource (e.g. database) as +well as define new template types adhering to the special +non-compiling (e,g, plain php) and non-compile-caching (e.g. eval: +resource type) resources. + +See demo/plugins/resource.mysql.php for an example custom database +resource. + +Note that old-fashioned registration of callbacks for resource +management has been deprecated but is still possible with SmartyBC. + + CacheResource API + +In line with the Resource API, the CacheResource API offers a more +comfortable handling of output-cache data. With the +Smarty_CacheResource_Custom accessing databases is made simple. With +the introduction of Smarty_CacheResource_KeyValueStore the +implementation of resources like memcache or APC became a no-brainer; +simple hash-based storage systems are now supporting hierarchical +output-caches. + +See demo/plugins/cacheresource.mysql.php for an example custom +database CacheResource. +See demo/plugins/cacheresource.memcache.php for an example custom +memcache CacheResource using the KeyValueStore helper. + +Note that old-fashioned registration of $cache_handler is not possible +anymore. As the functionality had not been ported to Smarty 3.0.x +properly, it has been dropped from 3.1 completely. + +Locking facilities have been implemented to avoid concurrent cache +generation. Enable cache locking by setting +$smarty->cache_locking = true; + + Relative Paths in Templates (File-Resource) + +As of Smarty 3.1 {include file="../foo.tpl"} and {include +file="./foo.tpl"} will resolve relative to the template they're in. +Relative paths are available with {include file="..."} and +{extends file="..."}. As $smarty->fetch('../foo.tpl') and +$smarty->fetch('./foo.tpl') cannot be relative to a template, an +exception is thrown. + + Addressing a specific $template_dir + +Smarty 3.1 introduces the $template_dir index notation. +$smarty->fetch('[foo]bar.tpl') and {include file="[foo]bar.tpl"} +require the template bar.tpl to be loaded from $template_dir['foo']; +Smarty::setTemplateDir() and Smarty::addTemplateDir() offer ways to +define indexes along with the actual directories. + + Mixing Resources in extends-Resource + +Taking the php extends: template resource one step further, it is now +possible to mix resources within an extends: call like +$smarty->fetch("extends:file:foo.tpl|db:bar.tpl"); + +To make eval: and string: resources available to the inheritance +chain, eval:base64:TPL_STRING and eval:urlencode:TPL_STRING have been +introduced. Supplying the base64 or urlencode flags will trigger +decoding the TPL_STRING in with either base64_decode() or urldecode(). + + extends-Resource in template inheritance + +Template based inheritance may now inherit from php's extends: +resource like {extends file="extends:foo.tpl|db:bar.tpl"}. + + New Smarty property escape_html + +$smarty->escape_html = true will autoescape all template variable +output by calling htmlspecialchars({$output}, ENT_QUOTES, +SMARTY_RESOURCE_CHAR_SET). +NOTE: +This is a compile time option. If you change the setting you must make +sure that the templates get recompiled. + + New option at Smarty property compile_check + +The automatic recompilation of modified templates can now be +controlled by the following settings: +$smarty->compile_check = COMPILECHECK_OFF (false) - template files +will not be checked +$smarty->compile_check = COMPILECHECK_ON (true) - template files will +always be checked +$smarty->compile_check = COMPILECHECK_CACHEMISS - template files will +be checked if caching is enabled and there is no existing cache file +or it has expired + + Automatic recompilation on Smarty version change + +Templates will now be automatically recompiled on Smarty version +changes to avoide incompatibillities in the compiled code. Compiled +template checked against the current setting of the SMARTY_VERSION +constant. + + default_config_handler_func() + +Analogous to the default_template_handler_func() +default_config_handler_func() has been introduced. + + default_plugin_handler_func() + +An optional default_plugin_handler_func() can be defined which gets called +by the compiler on tags which can't be resolved internally or by plugins. +The default_plugin_handler() can map tags to plugins on the fly. + +New getters/setters + +The following setters/getters will be part of the official +documentation, and will be strongly recommended. Direct property +access will still work for the foreseeable future... it will be +transparently routed through the setters/getters, and consequently a +bit slower. + +array|string getTemplateDir( [string $index] ) +replaces $smarty->template_dir; and $smarty->template_dir[$index]; +Smarty setTemplateDir( array|string $path ) +replaces $smarty->template_dir = "foo"; and $smarty->template_dir = +array("foo", "bar"); +Smarty addTemplateDir( array|string $path, [string $index]) +replaces $smarty->template_dir[] = "bar"; and +$smarty->template_dir[$index] = "bar"; + +array|string getConfigDir( [string $index] ) +replaces $smarty->config_dir; and $smarty->config_dir[$index]; +Smarty setConfigDir( array|string $path ) +replaces $smarty->config_dir = "foo"; and $smarty->config_dir = +array("foo", "bar"); +Smarty addConfigDir( array|string $path, [string $index]) +replaces $smarty->config_dir[] = "bar"; and +$smarty->config_dir[$index] = "bar"; + +array getPluginsDir() +replaces $smarty->plugins_dir; +Smarty setPluginsDir( array|string $path ) +replaces $smarty->plugins_dir = "foo"; +Smarty addPluginsDir( array|string $path ) +replaces $smarty->plugins_dir[] = "bar"; + +string getCompileDir() +replaces $smarty->compile_dir; +Smarty setCompileDir( string $path ) +replaces $smarty->compile_dir = "foo"; + +string getCacheDir() +replaces $smarty->cache_dir; +Smarty setCacheDir( string $path ) +replaces $smarty->cache_dir; diff --git a/lib/smarty_3/change_log.txt b/lib/smarty_3/change_log.txt new file mode 100755 index 0000000..6233374 --- /dev/null +++ b/lib/smarty_3/change_log.txt @@ -0,0 +1,2371 @@ + ===== 3.1.20-dev ===== (xx.xx.2014) + ===== 3.1.19 ===== (06.30.2014) + 20.06.2014 + - bugfix template variables could not be passed as paramter in {include} when the include was in a {nocache} section (topic 25131) + + 17.06.2014 + - bugfix large template text of some charsets could cause parsing errors (topic 24630) + + 08.06.2014 + - bugfix registered objects did not work after spelling fixes of 06.06.2014 + - bugfix {block} tags within {literal} .. {/literal} got not displayed correctly (topic 25024) + - bugfix UNC WINDOWS PATH like "\\psf\path\to\dir" did not work as template directory (Issue 192) + - bugfix {html_image} security check did fail on files relative to basedir (Issue 191) + + 06.06.2014 + - fixed PHPUnit outputFilterTrimWhitespaceTests.php assertion of test result + - fixed spelling, PHPDoc , minor errors, code cleanup + + 02.06.2014 + - using multiple cwd with relative template dirs could result in identical compiled file names. (issue 194 and topic 25099) + + 19.04.2014 + - bugfix calling createTemplate(template, data) with empty data array caused notice of array to string conversion (Issue 189) + - bugfix clearCompiledTemplate() did not delete files on WINDOWS when a compile_id was specified + + 18.04.2014 + - revert bugfix of 5.4.2014 because %-e date format is not supported on all operating systems + + ===== 3.1.18 ===== (07.04.2014) + 06.04.2014 + - bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187) + - bugfix update of composer file (Issue 168 and 184) + + 05.04.2014 + - bugfix default date format leads to extra spaces when displaying dates with single digit days (Issue 165) + + 26.03.2014 + - bugfix Smart_Resource_Custom should not lowercase the resource name (Issue 183) + + 24.03.2014 + - bugfix using a {foreach} property like @iteration could fail when used in inheritance parent templates (Issue 182) + + 20.03.2014 + - bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899) + + 18.03.2014 + - revert change of 17.03.2014 + +17.03.2014 + - bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899) + + 15.03.2014 + - bugfix Smarty_CacheResource_Keyvaluestore did use different keys on read/writes and clearCache() calls (Issue 169) + + 13.03.2014 + - bugfix clearXxx() change of 27.1.2014 did not work when specifing cache_id or compile_id (forum topic 24868 and 24867) + + ===== 3.1.17 ===== + 08.03.2014 + - bugfix relative file path {include} within {block} of child templates did throw exception on first call (Issue 177) + + 17.02.2014 + - bugfix Smarty failed when executing PHP on HHVM (Hip Hop 2.4) because uniqid('',true) does return string with ',' (forum topic 20343) + + 16.02.2014 + - bugfix a '//' or '\\' in template_dir path could produce wrong path on relative filepath in {include} (Issue 175) + + 05.02.2014 + - bugfix shared.literal_compiler_param.php did throw an exception when literal did contain a '-' (smarty-developers group) + + 27.01.2014 + - bugfix $smarty->debugging = true; did show the variable of the $smarty object not the variables used in display() call (forum topic 24764) + - bugfix clearCompiledTemplate(), clearAll() and clear() should use realpath to avoid possible exception from RecursiveDirectoryIterator (Issue 171) + + 26.01.2014 + - bugfix undo block nesting checks for {nocache} for reasons like forum topic 23280 (forum topic 24762) + + 18.01.2014 + - bugfix the compiler did fail when using template inheritance and recursive {include} (smarty-developers group) + + 11.01.2014 + - bugfix "* }" (spaces before right delimiter) was interpreted by mistake as comment end tag (Issue 170) + - internals content cache should be clear when updating cache file + + 08.01.2014 + - bugfix Smarty_CacheResource_Custom did not handle template resource type specifications on clearCache() calls (Issue 169) + - bugfix SmartyBC.class.php should use require_once to load Smarty.class.php (forum topic 24683) + + ===== 3.1.16 ===== + 15.12.2013 + - bugfix {include} with {block} tag handling (forum topic 24599, 24594, 24682) (Issue 161) + Read 3.1.16_RELEASE_NOTES for more details + - enhancement additional debug output at $smarty->_parserdebug = true; + + 07.11.2013 + - bugfix too restrictive handling of {include} within {block} tags. 3.1.15 did throw errors where 3.1.14 did not (forum topic 24599) + - bugfix compiler could fail if PHP mbstring.func_overload is enabled (Issue 164) + + 28.10.2013 + - bugfix variable resource name at custom resource plugin did not work within {block} tags (Issue 163) + - bugfix notice "Trying to get property of non-object" removed (Issue 163) + - bugfix correction of modifier capitalize fix from 3.10.2013 (issue 159) + - bugfix multiple {block}s with same name in parent did not work (forum topic 24631) + + 20.10.2013 + - bugfix a variable file name at {extends} tag did fail (forum topic 24618) + + 14.10.2013 + - bugfix yesterdays fix could result in an undefined variable + + 13.10.2013 + - bugfix variable names on {include} in template inheritance did unextepted error message (forum topic 24594) (Issue 161) +.- bugfix relative includes with same name like {include './foo.tpl'} from different folder failed (forum topic 24590)(Issue 161) + + 04.10.2013 + - bugfix variable file names at {extends} had been disbabled by mistake with the rewrite of + template inheritance of 24.08.2013 (forum topic 24585) + +03.10.2013 + - bugfix loops using modifier capitalize did eat up memory (issue 159) + + ===== Smarty 3.1.15 ===== +01.10.2013 + - use current delimiters in compiler error messages (issue 157) + - improvement on performance when using error handler and multiple template folders (issue 152) + +17.09.2013 + - improvement added patch for additional SmartyCompilerException properties for better access to scource information (forum topic 24559) + +16.09.2013 + - bugfix recompiled templates did not show on first request with zend opcache cache (forum topic 24320) + +13.09.2013 + - bugfix html_select_time defaulting error for the Meridian dropdown (forum topic 24549) + +09.09.2012 +- bugfix incorrect compiled code with array(object,method) callback at registered Variable Filter (forum topic 24542) + +27.08.2013 +- bugfix delimiter followed by linebreak did not work as auto literal after update from 24.08.2013 (forum topic 24518) + +24.08.2013 +- bugfix and enhancement + Because several recent problems with template inheritance the {block} tag compiler has been rewriten + - Error messages shown now the correct child template file and line number + - The compiler could fail on some larger UTF-8 text block (forum topic 24455) + - The {strip} tag can now be placed outside {block} tags in child templates (forum topic 24289) +- change SmartyException::$escape is now false by default +- change PHP traceback has been remove for SmartyException and SmartyCompilerException + +14.08.2013 +- bugfix compiled filepath of config file did not observe different config_dir (forum topic 24493) + +13.08.2013 +- bugfix the internal resource cache did not observe config_dir changes (forum topic 24493) + +12.08.2013 +- bugfix internal $tmpx variables must be unique over all inheritance templates (Issue 149) + +10.08.2013 +- bugfix a newline was eaten when a was passed by a Smarty variable and caching was enabled (forum topic 24482) + +29.07.2013 +- bugfix headers already send warning thrown when using 'SMARTY_DEBUG=on' from URL (Issue 148) + +27.07.2013 +- enhancement allow access to properties of registered opjects for Smarty2 BC (forum topic 24344) + +26.07.2013 +- bugfix template inheritance nesting problem (forum topic 24387) + +15.7.2013 +- update code generated by PSR-2 standards fixer which introduced PHP 5.4 incompatibilities of 14.7.2013 + +14.7.2013 +- bugfix increase of internal maximum parser stacksize to allow more complex tag code {forum topic 24426} +- update for PHP 5.4 compatibility +- reformat source to PSR-2 standard + +12.7.2013 +- bugfix Do not remove '//' from file path at normalization (Issue 142) + +2.7.2013 +- bugfix trimwhitespace would replace captured items in wrong order (forum topic 24387) + +===== Smarty-3.1.14 ===== +27.06.2013 +- bugfix removed PHP 5.5 deprecated preg_replace /e option in modifier capitalize (forum topic 24389) + +17.06.2013 +- fixed spelling in sources and documentation (from smarty-developers forum Veres Lajos) +- enhancement added constant SMARTY::CLEAR_EXPIRED for the change of 26.05.2013 (forum topic 24310) +- bugfix added smarty_security.php to composer.json (Issue 135) + +26.05.2013 +- enhancement an expire_time of -1 in clearCache() and clearAllCache() will delete outdated cache files + by their individual cache_lifetime used at creation (forum topic 24310) + +21.05.2013 +- bugfix modifier strip_tags:true was compiled into wrong code (Forum Topic 24287) +- bugfix /n after ?> in Smarty.class.php did start output buffering (Issue 138) + +25.04.2013 +- bugfix escape and wordrap modifier could be compiled into wrong code when used in {nocache}{/nocache} + section but caching is disabled (Forum Topic 24260) + +05.04.2013 +- bugfix post filter must not run when compiling inheritance child blocks (Forum Topic 24094) +- bugfix after the fix for Issue #130 compiler exceptions got double escaped (Forum Topic 24199) + +28.02.2013 +- bugfix nocache blocks could be lost when using CACHING_LIFETIME_SAVED (Issue #133) +- bugfix Compile ID gets nulled when compiling child blocks (Issue #134) + + +24.01.2013 +- bugfix wrong tag type in smarty_internal_templatecompilerbase.php could cause wrong plugin search order (Forum Topic 24028) + +===== Smarty-3.1.13 ===== +13.01.2013 +- enhancement allow to disable exception message escaping by SmartyException::$escape = false; (Issue #130) + +09.01.2013 +- bugfix compilation did fail when a prefilter did modify an {extends} tag c +- bugfix template inheritance could fail if nested {block} tags in childs did contain {$smarty.block.child} (Issue #127) +- bugfix template inheritance could fail if {block} tags in childs did have similar name as used plugins (Issue #128) +- added abstract method declaration doCompile() in Smarty_Internal_TemplateCompilerBase (Forum Topic 23969) + +06.01.2013 +- Allow '://' URL syntax in template names of stream resources (Issue #129) + +27.11.2012 +- bugfix wrong variable usage in smarty_internal_utility.php (Issue #125) + +26.11.2012 +- bugfix global variable assigned within template function are not seen after template function exit (Forum Topic 23800) + +24.11.2012 +- made SmartyBC loadable via composer (Issue #124) + +20.11.2012 +- bugfix assignGlobal() called from plugins did not work (Forum Topic 23771) + +13.11.2012 +- adding attribute "strict" to html_options, html_checkboxes, html_radios to only print disabled/readonly attributes if their values are true or "disabled"/"readonly" (Issue #120) + +01.11.2012 +- bugfix muteExcpetedErrors() would screw up for non-readable paths (Issue #118) + +===== Smarty-3.1.12 ===== +14.09.2012 +- bugfix template inheritance failed to compile with delimiters {/ and /} (Forum Topic 23008) + +11.09.2012 +- bugfix escape Smarty exception messages to avoid possible script execution + +10.09.2012 +- bugfix tag option flags and shorttag attributes did not work when rdel started with '=' (Forum Topic 22979) + +31.08.2012 +- bugfix resolving relative paths broke in some circumstances (Issue #114) + +22.08.2012 +- bugfix test MBString availability through mb_split, as it could've been compiled without regex support (--enable-mbregex). + Either we get MBstring's full package, or we pretend it's not there at all. + +21.08.2012 +- bugfix $auto_literal = false did not work with { block} tags in child templates + (problem was reintroduced after fix in 3.1.7)(Forum Topic 20581) + +17.08.2012 +- bugfix compiled code of nocache sections could contain wrong escaping (Forum Topic 22810) + +15.08.2012 +- bugfix template inheritance did produce wrong code if subtemplates with {block} was + included several times (from smarty-developers forum) + +14.08.2012 +- bugfix PHP5.2 compatibility compromised by SplFileInfo::getBasename() (Issue 110) + +01.08.2012 +- bugfix avoid PHP error on $smarty->configLoad(...) with invalid section specification (Forum Topic 22608) + +30.07.2012 +-bugfix {assign} in a nocache section should not overwrite existing variable values + during compilation (issue 109) + +28.07.2012 +- bugfix array access of config variables did not work (Forum Topic 22527) + +19.07.2012 +- bugfix the default plugin handler did create wrong compiled code for static class methods + from external script files (issue 108) + +===== Smarty-3.1.11 ===== +30.06.2012 +- bugfix {block.. hide} did not work as nested child (Forum Topic 22216) + +25.06.2012 +- bugfix the default plugin handler did not allow static class methods for modifier (issue 85) + +24.06.2012 +- bugfix escape modifier support for PHP < 5.2.3 (Forum Topic 21176) + +11.06.2012 +- bugfix the patch for Topic 21856 did break tabs between tag attributes (Forum Topic 22124) + +===== Smarty-3.1.10 ===== +09.06.2012 +- bugfix the compiler did ignore registered compiler plugins for closing tags (Forum Topic 22094) +- bugfix the patch for Topic 21856 did break multiline tags (Forum Topic 22124) + +===== Smarty-3.1.9 ===== +07.06.2012 +- bugfix fetch() and display() with relative paths (Issue 104) +- bugfix treat "0000-00-00" as 0 in modifier.date_format (Issue 103) + +24.05.2012 +- bugfix Smarty_Internal_Write_File::writeFile() could cause race-conditions on linux systems (Issue 101) +- bugfix attribute parameter names of plugins may now contain also "-" and ":" (Forum Topic 21856) +- bugfix add compile_id to cache key of of source (Issue 97) + +22.05.2012 +- bugfix recursive {include} within {section} did fail (Smarty developer group) + +12.05.2012 +- bugfix {html_options} did not properly escape values (Issue 98) + +03.05.2012 +- bugfix make HTTP protocall version variable (issue 96) + +02.05.2012 +- bugfix {nocache}{block}{plugin}... did produce wrong compiled code when caching is disabled (Forum Topic 21572, issue 95) + +12.04.2012 +- bugfix Smarty did eat the linebreak after the closing tag (Issue 93) +- bugfix concurrent cache updates could create a warning (Forum Topic 21403) + +08.04.2012 +- bugfix "\\" was not escaped correctly when generating nocache code (Forum Topic 21364) + +30.03.2012 +- bugfix template inheritance did not throw exception when a parent template was deleted (issue 90) + +27.03.2012 +- bugfix prefilter did run multiple times on inline subtemplates compiled into several main templates (Forum Topic 21325) +- bugfix implement Smarty2's behaviour of variables assigned by reference in SmartyBC. {assign} will affect all references. + (issue 88) + +21.03.2012 +- bugfix compileAllTemplates() and compileAllConfig() did not return the number of compiled files (Forum Topic 21286) + +13.03.2012 +- correction of yesterdays bugfix (Forum Topic 21175 and 21182) + +12.03.2012 +- bugfix a double quoted string of "$foo" did not compile into PHP "$foo" (Forum Topic 21175) +- bugfix template inheritance did set $merge_compiled_includes globally true + +03.03.2012 +- optimization of compiling speed when same modifier was used several times + +02.03.2012 +- enhancement the default plugin handler can now also resolve undefined modifier (Smarty::PLUGIN_MODIFIER) + (Issue 85) + +===== Smarty-3.1.8 ===== +19.02.2012 +- bugfix {include} could result in a fatal error if used in appended or prepended nested {block} tags + (reported by mh and Issue 83) +- enhancement added Smarty special variable $smarty.template_object to return the current template object (Forum Topic 20289) + + +07.02.2012 +- bugfix increase entropy of internal function names in compiled and cached template files (Forum Topic 20996) +- enhancement cacheable parameter added to default plugin handler, same functionality as in registerPlugin (request by calguy1000) + +06.02.2012 +- improvement stream_resolve_include_path() added to Smarty_Internal_Get_Include_Path (Forum Topic 20980) +- bugfix fetch('extends:foo.tpl') always yielded $source->exists == true (Forum Topic 20980) +- added modifier unescape:"url", fix (Forum Topic 20980) +- improvement replaced some calls of preg_replace with str_replace (Issue 73) + +30.01.2012 +- bugfix Smarty_Security internal $_resource_dir cache wasn't properly propagated + +27.01.2012 +- bugfix Smarty did not a template name of "0" (Forum Topic 20895) + +20.01.2012 +- bugfix typo in Smarty_Internal_Get_IncludePath did cause runtime overhead (Issue 74) +- improvment remove unneeded assigments (Issue 75 and 76) +- fixed typo in template parser +- bugfix output filter must not run before writing cache when template does contain nocache code (Issue 71) + +02.01.2012 +- bugfix {block foo nocache} did not load plugins within child {block} in nocache mode (Forum Topic 20753) + +29.12.2011 +- bugfix enable more entropy in Smarty_Internal_Write_File for "more uniqueness" and Cygwin compatibility (Forum Topic 20724) +- bugfix embedded quotes in single quoted strings did not compile correctly in {nocache} sections (Forum Topic 20730) + +28.12.2011 +- bugfix Smarty's internal header code must be excluded from postfilters (issue 71) + +22.12.2011 +- bugfix the new lexer of 17.12.2011 did fail if mbstring.func_overload != 0 (issue 70) (Forum Topic 20680) +- bugfix template inheritace did fail if mbstring.func_overload != 0 (issue 70) (Forum Topic 20680) + +20.12.2011 +- bugfix template inheritance: {$smarty.block.child} in nested child {block} tags did not return + content after {$smarty.block.child} (Forum Topic 20564) + +===== Smarty-3.1.7 ===== +18.12.2011 +- bugfix strings ending with " in multiline strings of config files failed to compile (issue #67) +- added chaining to Smarty_Internal_Templatebase +- changed unloadFilter() to not return a boolean in favor of chaining and API conformity +- bugfix unregisterObject() raised notice when object to unregister did not exist +- changed internals to use Smarty::$_MBSTRING ($_CHARSET, $_DATE_FORMAT) for better unit testing +- added Smarty::$_UTF8_MODIFIER for proper PCRE charset handling (Forum Topic 20452) +- added Smarty_Security::isTrustedUri() and Smarty_Security::$trusted_uri to validate + remote resource calls through {fetch} and {html_image} (Forum Topic 20627) + +17.12.2011 +- improvement of compiling speed by new handling of plain text blocks in the lexer/parser (issue #68) + +16.12.2011 +- bugfix the source exits flag and timestamp was not setup when template was in php include path (issue #69) + +9.12.2011 +- bugfix {capture} tags around recursive {include} calls did throw exception (Forum Topic 20549) +- bugfix $auto_literal = false did not work with { block} tags in child templates (Forum Topic 20581) +- bugfix template inheritance: do not include code of {include} in overloaded {block} into compiled + parent template (Issue #66} +- bugfix template inheritance: {$smarty.block.child} in nested child {block} tags did not return expected + result (Forum Topic 20564) + +===== Smarty-3.1.6 ===== +30.11.2011 +- bugfix is_cache() for individual cached subtemplates with $smarty->caching = CACHING_OFF did produce + an exception (Forum Topic 20531) + +29.11.2011 +- bugfix added exception if the default plugin handler did return a not static callback (Forum Topic 20512) + +25.11.2011 +- bugfix {html_select_date} and {html_slecet_time} did not default to current time if "time" was not specified + since r4432 (issue 60) + +24.11.2011 +- bugfix a subtemplate later used as main template did use old variable values + +21.11.2011 +- bugfix cache file could include unneeded modifier plugins under certain condition + +18.11.2011 +- bugfix declare all directory properties private to map direct access to getter/setter also on extended Smarty class + +16.11.2011 +- bugfix Smarty_Resource::load() did not always return a proper resource handler (Forum Topic 20414) +- added escape argument to html_checkboxes and html_radios (Forum Topic 20425) + +===== Smarty-3.1.5 ===== +14.11.2011 +- bugfix allow space between function name and open bracket (forum topic 20375) + +09.11.2011 +- bugfix different behaviour of uniqid() on cygwin. See https://bugs.php.net/bug.php?id=34908 + (forum topic 20343) + +01.11.2011 +- bugfix {if} and {while} tags without condition did not throw a SmartyCompilerException (Issue #57) +- bugfix multiline strings in config files could fail on longer strings (reopened Issue #55) + +22.10.2011 +- bugfix smarty_mb_from_unicode() would not decode unicode-points properly +- bugfix use catch Exception instead UnexpectedValueException in + clearCompiledTemplate to be PHP 5.2 compatible + +21.10.2011 +- bugfix apostrophe in plugins_dir path name failed (forum topic 20199) +- improvement sha1() for array keys longer than 150 characters +- add Smarty::$allow_ambiguous_resources to activate unique resource handling (Forum Topic 20128) + +20.10.2011 +- @silenced unlink() in Smarty_Internal_Write_File since debuggers go haywire without it. +- bugfix Smarty::clearCompiledTemplate() threw an Exception if $cache_id was not present in $compile_dir when $use_sub_dirs = true. +- bugfix {html_select_date} and {html_select_time} did not properly handle empty time arguments (Forum Topic 20190) +- improvement removed unnecessary sha1() + +19.10.2011 +- revert PHP4 constructor message +- fixed PHP4 constructor message + +===== Smarty-3.1.4 ===== +19.10.2011 +- added exception when using PHP4 style constructor + +16.10.2011 +- bugfix testInstall() did not propery check cache_dir and compile_dir + +15.10.2011 +- bugfix Smarty_Resource and Smarty_CacheResource runtime caching (Forum Post 75264) + +14.10.2011 +- bugfix unique_resource did not properly apply to compiled resources (Forum Topic 20128) +- add locking to custom resources (Forum Post 75252) +- add Smarty_Internal_Template::clearCache() to accompany isCached() fetch() etc. + +13.10.2011 +- add caching for config files in Smarty_Resource +- bugfix disable of caching after isCached() call did not work (Forum Topic 20131) +- add concept unique_resource to combat potentially ambiguous template_resource values when custom resource handlers are used (Forum Topic 20128) +- bugfix multiline strings in config files could fail on longer strings (Issue #55) + +11.10.2011 +- add runtime checks for not matching {capture}/{/capture} calls (Forum Topic 20120) + +10.10.2011 +- bugfix variable name typo in {html_options} and {html_checkboxes} (Issue #54) +- bugfix tag did create wrong output when caching enabled and the tag was in included subtemplate +- bugfix Smarty_CacheResource_mysql example was missing strtotime() calls + +===== Smarty-3.1.3 ===== +07.10.2011 +- improvement removed html comments from {mailto} (Forum Topic 20092) +- bugfix testInstall() would not show path to internal plugins_dir (Forum Post 74627) +- improvement testInstall() now showing resolved paths and checking the include_path if necessary +- bugfix html_options plugin did not handle object values properly (Issue #49, Forum Topic 20049) +- improvement html_checkboxes and html_radios to accept null- and object values, and label_ids attribute +- improvement removed some unnecessary count()s +- bugfix parent pointer was not set when fetch() for other template was called on template object + +06.10.2011 +- bugfix switch lexer internals depending on mbstring.func_overload +- bugfix start_year and end_year of {html_select_date} did not use current year as offset base (Issue #53) + +05.10.2011 +- bugfix of problem introduced with r4342 by replacing strlen() with isset() +- add environment configuration issue with mbstring.func_overload Smarty cannot compensate for (Issue #45) +- bugfix nofilter tag option did not disable default modifier +- bugfix html_options plugin did not handle null- and object values properly (Issue #49, Forum Topic 20049) + +04.10.2011 +- bugfix assign() in plugins called in subtemplates did change value also in parent template +- bugfix of problem introduced with r4342 on math plugin +- bugfix output filter should not run on individually cached subtemplates +- add unloadFilter() method +- bugfix has_nocache_code flag was not reset before compilation + +===== Smarty-3.1.2 ===== +03.10.2011 +- improvement add internal $joined_template_dir property instead computing it on the fly several times + +01.10.2011 +- improvement replaced most in_array() calls by more efficient isset() on array_flip()ed haystacks +- improvement replaced some strlen($foo) > 3 calls by isset($foo[3]) +- improvement Smarty_Internal_Utility::clearCompiledTemplate() removed redundant strlen()s + +29.09.2011 +- improvement of Smarty_Internal_Config::loadConfigVars() dropped the in_array for index look up + +28.09.2011 +- bugfix on template functions called nocache calling other template functions + +27.09.2011 +- bugfix possible warning "attempt to modify property of non-object" in {section} (issue #34) +- added chaining to Smarty_Internal_Data so $smarty->assign('a',1)->assign('b',2); is possible now +- bugfix remove race condition when a custom resource did change timestamp during compilation +- bugfix variable property did not work on objects variable in template +- bugfix smarty_make_timestamp() failed to process DateTime objects properly +- bugfix wrong resource could be used on compile check of custom resource + +26.09.2011 +- bugfix repeated calls to same subtemplate did not make use of cached template object + +24.09.2011 +- removed internal muteExpectedErrors() calls in favor of having the implementor call this once from his application +- optimized muteExpectedErrors() to pass errors to the latest registered error handler, if appliccable +- added compile_dir and cache_dir to list of muted directories +- improvment better error message for undefined templates at {include} + +23.09.2011 +- remove unused properties +- optimization use real function instead anonymous function for preg_replace_callback +- bugfix a relative {include} in child template blocks failed +- bugfix direct setting of $template_dir, $config_dir, $plugins_dir in __construct() of an + extended Smarty class created problems +- bugfix error muting was not implemented for cache locking + +===== Smarty 3.1.1 ===== +22.09.2011 +- bugfix {foreachelse} does fail if {section} was nested inside {foreach} +- bugfix debug.tpl did not display correctly when it was compiled with escape_html = true + +21.09.2011 +- bugfix look for mixed case plugin file names as in 3.0 if not found try all lowercase +- added $error_muting to suppress error messages even for badly implemented error_handlers +- optimized autoloader +- reverted ./ and ../ handling in fetch() and display() - they're allowed again + +20.09.2011 +- bugfix removed debug echo output while compiling template inheritance +- bugfix relative paths in $template_dir broke relative path resolving in {include "../foo.tpl"} +- bugfix {include} did not work inside nested {block} tags +- bugfix {assign} with scope root and global did not work in all cases + +19.09.2011 +- bugfix regression in Smarty_CacheReource_KeyValueStore introduced by r4261 +- bugfix output filter shall not run on included subtemplates + +18.09.2011 +- bugfix template caching did not care about file.tpl in different template_dir +- bugfix {include $file} was broken when merge_compiled_incluges = true +- bugfix {include} was broken when merge_compiled_incluges = true and same indluded template + was used in different main templates in one compilation run +- bugfix for Smarty2 style compiler plugins on unnamed attribute passing like {tag $foo $bar} +- bugfix debug.tpl did not display correctly when it was compiled with escape_html = true + +17.09.2011 +- bugfix lock_id for file resource would create invalid filepath +- bugfix resource caching did not care about file.tpl in different template_dir + +===== Smarty 3.1.0 ===== +15/09/2011 +- optimization of {foreach}; call internal _count() method only when "total" or "last" {foreach} properties are used + +11/09/2011 +- added unregisterObject() method + +06/09/2011 +- bugfix isset() did not work in templates on config variables + +03/09/2011 +- bugfix createTemplate() must default to cache_id and compile_id of Smarty object +- bugfix Smarty_CacheResource_KeyValueStore must include $source->uid in cache filepath to keep templates with same + name but different folders separated +- added cacheresource.apc.php example in demo folder + +02/09/2011 +- bugfix cache lock file must use absolute filepath + +01/09/2011 +- update of cache locking + +30/08/2011 +- added locking mechanism to CacheResource API (implemented with File and KeyValueStores) + +28/08/2011 +- bugfix clearCompileTemplate() did not work for specific template subfolder or resource + +27/08/2011 +- bugfix {$foo|bar+1} did create syntax error + +26/08/2011 +- bugfix when generating nocache code which contains double \ +- bugfix handle race condition if cache file was deleted between filemtime and include + +17/08/2011 +- bugfix CacheResource_Custom bad internal fetch() call + +15/08/2011 +- bugfix CacheResource would load content twice for KeyValueStore and Custom handlers + +06/08/2011 +- bugfix {include} with scope attribute could execute in wrong scope +- optimization of compile_check processing + +03/08/2011 +- allow comment tags to comment {block} tags out in child templates + +26/07/2011 +- bugfix experimental getTags() method did not work + +24/07/2011 +- sure opened output buffers are closed on exception +- bugfix {foreach} did not work on IteratorAggregate + +22/07/2011 +- clear internal caches on clearAllCache(), clearCache(), clearCompiledTemplate() + +21/07/2011 +- bugfix value changes of variable values assigned to Smarty object could not be seen on repeated $smarty->fetch() calls + +17/07/2011 +- bugfix {$smarty.block.child} did drop a notice at undefined child + +15/07/2011 +- bugfix individual cache_lifetime of {include} did not work correctly inside {block} tags +- added caches for Smarty_Template_Source and Smarty_Template_Compiled to reduce I/O for multiple cache_id rendering + +14/07/2011 +- made Smarty::loadPlugin() respect the include_path if required + +13/07/2011 +- optimized internal file write functionality +- bugfix PHP did eat line break on nocache sections +- fixed typo of Smarty_Security properties $allowed_modifiers and $disabled_modifiers + +06/07/2011 +- bugfix variable modifier must run befor gereral filtering/escaping + +04/07/2011 +- bugfix use (?P) syntax at preg_match as some pcre libraries failed on (?) +- some performance improvement when using generic getter/setter on template objects + +30/06/2011 +- bugfix generic getter/setter of Smarty properties used on template objects did throw exception +- removed is_dir and is_readable checks from directory setters for better performance + +28/06/2011 +- added back support of php template resource as undocumented feature +- bugfix automatic recompilation on version change could drop undefined index notice on old 3.0 cache and compiled files +- update of README_3_1_DEV.txt and moved into the distribution folder +- improvement show first characters of eval and string templates instead sha1 Uid in debug window + +===== Smarty 3.1-RC1 ===== +25/06/2011 +- revert change of 17/06/2011. $_smarty varibale removed. call loadPlugin() from inside plugin code if required +- code cleanup, remove no longer used properties and methods +- update of PHPdoc comments + +23/06/2011 +- bugfix {html_select_date} would not respect current time zone + +19/06/2011 +- added $errors argument to testInstall() functions to suppress output. +- added plugin-file checks to testInstall() + +18/06/2011 +- bugfix mixed use of same subtemplate inline and not inline in same script could cause a warning during compilation + +17/06/2011 +- bugfix/change use $_smarty->loadPlugin() when loading nested depending plugins via loadPlugin +- bugfix {include ... inline} within {block}...{/block} did fail + +16/06/2011 +- bugfix do not overwrite '$smarty' template variable when {include ... scope=parent} is called +- bugfix complete empty inline subtemplates did fail + +15/06/2011 +- bugfix template variables where not accessable within inline subtemplates + +12/06/2011 +- bugfix removed unneeded merging of template variable when fetching includled subtemplates + +10/06/2011 +- made protected properties $template_dir, $plugins_dir, $cache_dir, $compile_dir, $config_dir accessible via magic methods + +09/06/2011 +- fix smarty security_policy issue in plugins {html_image} and {fetch} + +05/06/2011 +- update of SMARTY_VERSION +- bugfix made getTags() working again + +04/06/2011 +- allow extends resource in file attribute of {extends} tag + +03/06/2011 +- added {setfilter} tag to set filters for variable output +- added escape_html property to control autoescaping of variable output + +27/05/2011 +- added allowed/disabled tags and modifiers in security for sandboxing + +23/05/2011 +- added base64: and urlencode: arguments to eval and string resource types + +22/05/2011 +- made time-attribute of {html_select_date} and {html_select_time} accept arrays as defined by attributes prefix and field_array + +13/05/2011 +- remove setOption / getOption calls from SamrtyBC class + +02/05/2011 +- removed experimental setOption() getOption() methods +- output returned content also on opening tag calls of block plugins +- rewrite of default plugin handler +- compile code of variable filters for better performance + +20/04/2011 +- allow {php} {include_php} tags and PHP_ALLOW handling only with the SmartyBC class +- removed support of php template resource + +20/04/2011 +- added extendsall resource example +- optimization of template variable access +- optimization of subtemplate handling {include} +- optimization of template class + +01/04/2011 +- bugfix quote handling in capitalize modifier + +28/03/2011 +- bugfix stripslashes() requried when using PCRE e-modifier + +04/03/2011 +- upgrade to new PHP_LexerGenerator version 0.4.0 for better performance + +27/02/2011 +- ignore .svn folders when clearing cache and compiled files +- string resources do not need a modify check + +26/02/2011 +- replaced smarty_internal_wrapper by SmartyBC class +- load utility functions as static methods instead through __call() +- bugfix in extends resource when subresources are used +- optimization of modify checks + +25/02/2011 +- use $smarty->error_unassigned to control NOTICE handling on unassigned variables + +21/02/2011 +- added new new compile_check mode COMPILECHECK_CACHEMISS +- corrected new cloning behaviour of createTemplate() +- do no longer store the compiler object as property in the compile_tag classes to avoid possible memory leaks + during compilation + +19/02/2011 +- optimizations on merge_compiled_includes handling +- a couple of optimizations and bugfixes related to new resource structure + +17/02/2011 +- changed ./ and ../ behaviour + +14/02/2011 +- added {block ... hide} option to suppress block if no child is defined + +13/02/2011 +- update handling of recursive subtemplate calls +- bugfix replace $smarty->triggerError() by exception in smarty_internal_resource_extends.php + +12/02/2011 +- new class Smarty_Internal_TemplateBase with shared methods of Smarty and Template objects +- optimizations of template processing +- made register... methods permanet +- code for default_plugin_handler +- add automatic recompilation at version change + +04/02/2011 +- change in Smarty_CacheResource_Custom +- bugfix cache_lifetime did not compile correctly at {include} after last update +- moved isCached processing into CacheResource class +- bugfix new CacheResource API did not work with disabled compile_check + +03/02/2011 +- handle template content as function to improve speed on multiple calls of same subtemplate and isCached()/display() calls +- bugfixes and improvents in the new resource API +- optimizations of template class code + +25/01/2011 +- optimized function html_select_time + +22/01/2011 +- added Smarty::$use_include_path configuration directive for Resource API + +21/01/2011 +- optimized function html_select_date + +19/01/2011 +- optimized outputfilter trimwhitespace + +18/01/2011 +- bugfix Config to use Smarty_Resource to fetch sources +- optimized Smarty_Security's isTrustedDir() and isTrustedPHPDir() + +17/01/2011 +- bugfix HTTP headers for CGI SAPIs + +16/01/2011 +- optimized internals of Smarty_Resource and Smarty_CacheResource + +14/01/2011 +- added modifiercompiler escape to improve performance of escaping html, htmlall, url, urlpathinfo, quotes, javascript +- added support to choose template_dir to load from: [index]filename.tpl + +12/01/2011 +- added unencode modifier to revert results of encode modifier +- added to_charset and from_charset modifier for character encoding + +11/01/2011 +- added SMARTY_MBSTRING to generalize MBString detection +- added argument $lc_rest to modifier.capitalize to lower-case anything but the first character of a word +- changed strip modifier to consider unicode white-space, too +- changed wordwrap modifier to accept UTF-8 strings +- changed count_sentences modifier to consider unicode characters and treat sequences delimited by ? and ! as sentences, too +- added argument $double_encode to modifier.escape (applies to html and htmlall only) +- changed escape modifier to be UTF-8 compliant +- changed textformat block to be UTF-8 compliant +- optimized performance of mailto function +- fixed spacify modifier so characters are not prepended and appended, made it unicode compatible +- fixed truncate modifier to properly use mb_string if possible +- removed UTF-8 frenzy from count_characters modifier +- fixed count_words modifier to treat "hello-world" as a single word like str_count_words() does +- removed UTF-8 frenzy from upper modifier +- removed UTF-8 frenzy from lower modifier + +01/01/2011 +- optimize smarty_modified_escape for hex, hexentity, decentity. + +28/12/2010 +- changed $tpl_vars, $config_vars and $parent to belong to Smarty_Internal_Data +- added Smarty::registerCacheResource() for dynamic cache resource object registration + +27/12/2010 +- added Smarty_CacheResource API and refactored existing cache resources accordingly +- added Smarty_CacheResource_Custom and Smarty_CacheResource_Mysql + +26/12/2010 +- added Smarty_Resource API and refactored existing resources accordingly +- added Smarty_Resource_Custom and Smarty_Resource_Mysql +- bugfix Smarty::createTemplate() to return properly cloned template instances + +24/12/2010 +- optimize smarty_function_escape_special_chars() for PHP >= 5.2.3 + +===== SVN 3.0 trunk ===== +14/05/2011 +- bugfix error handling at stream resources + +13/05/2011 +- bugfix condition starting with "-" did fail at {if} and {while} tags + +22/04/2011 +- bugfix allow only fixed string as file attribute at {extends} tag + +01/04/2011 +- bugfix do not run filters and default modifier when displaying the debug template +- bugfix of embedded double quotes within multi line strings (""") + +29/03/2011 +- bugfix on error message in smarty_internal_compile_block.php +- bugfix mb handling in strip modifier +- bugfix for Smarty2 style registered compiler function on unnamed attribute passing like {tag $foo $bar} + +17/03/2011 +- bugfix on default {function} parameters when {function} was used in nocache sections +- bugfix on compiler object destruction. compiler_object property was by mistake unset. + +09/03/2011 +-bugfix a variable filter should run before modifiers on an output tag (see change of 23/07/2010) + +08/03/2011 +- bugfix loading config file without section should load only defaults + +03/03/2011 +- bugfix "smarty" template variable was not recreated when cached templated had expired +- bugfix internal rendered_content must be cleared after subtemplate was included + +01/03/2011 +- bugfix replace modifier did not work in 3.0.7 on systems without multibyte support +- bugfix {$smarty.template} could return in 3.0.7 parent template name instead of + child name when it needed to compile + +25/02/2011 +- bugfix for Smarty2 style compiler plugins on unnamed attribute passing like {tag $foo $bar} + +24/02/2011 +- bugfix $smarty->clearCache('some.tpl') did by mistake cache the template object + +18/02/2011 +- bugfix removed possible race condition when isCached() was called for an individually cached subtemplate +- bugfix force default debug.tpl to be loaded by the file resource + +17/02/2011 +-improvement not to delete files starting with '.' from cache and template_c folders on clearCompiledTemplate() and clearCache() + +16/02/2011 +-fixed typo in exception message of Smarty_Internal_Template +-improvement allow leading spaces on } tag closing if auto_literal is enabled + +13/02/2011 +- bufix replace $smarty->triggerError() by exception +- removed obsolete {popup_init..} plugin from demo templates +- bugfix replace $smarty->triggerError() by exception in smarty_internal_resource_extends.php + +===== Smarty 3.0.7 ===== +09/02/2011 +- patched vulnerability when using {$smarty.template} + +01/02/2011 +- removed assert() from config and template parser + +31/01/2011 +- bugfix the lexer/parser did fail on special characters like VT + +16/01/2011 +-bugfix of ArrayAccess object handling in internal _count() method +-bugfix of Iterator object handling in internal _count() method + +14/01/2011 +-bugfix removed memory leak while processing compileAllTemplates + +12/01/2011 +- bugfix in {if} and {while} tag compiler when using assignments as condition and nocache mode + +10/01/2011 +- bugfix when using {$smarty.block.child} and name of {block} was in double quoted string +- bugfix updateParentVariables() was called twice when leaving {include} processing + +- bugfix mb_str_replace in replace and escape modifiers work with utf8 + +31/12/2010 +- bugfix dynamic configuration of $debugging_crtl did not work +- bugfix default value of $config_read_hidden changed to false +- bugfix format of attribute array on compiler plugins +- bugfix getTemplateVars() could return value from wrong scope + +28/12/2010 +- bugfix multiple {append} tags failed to compile. + +22/12/2010 +- update do not clone the Smarty object an internal createTemplate() calls to increase performance + +21/12/2010 +- update html_options to support class and id attrs + +17/12/2010 +- bugfix added missing support of $cache_attrs for registered plugins + +15/12/2010 +- bugfix assignment as condition in {while} did drop an E_NOTICE + +14/12/2010 +- bugfix when passing an array as default parameter at {function} tag + +13/12/2010 +- bugfix {$smarty.template} in child template did not return right content +- bugfix Smarty3 did not search the PHP include_path for template files + +===== Smarty 3.0.6 ===== + +12/12/2010 +- bugfix fixed typo regarding yesterdays change to allow streamWrapper + +11/12/2010 +- bugfix nested block tags in template inheritance child templates did not work correctly +- bugfix {$smarty.current_dir} in child template did not point to dir of child template +- bugfix changed code when writing temporary compiled files to allow stream_wrapper + +06/12/2010 +- bugfix getTemplateVars() should return 'null' instead dropping E_NOTICE on an unassigned variable + +05/12/2010 +- bugfix missing declaration of $smarty in Smarty class +- bugfix empty($foo) in {if} did drop a notice when $foo was not assigned + +01/12/2010 +- improvement of {debug} tag output + +27/11/2010 +-change run output filter before cache file is written. (same as in Smarty2) + +24/11/2011 +-bugfix on parser at !$foo|modifier +-change parser logic when assignments used as condition in {if] and {while} to allow assign to array element + +23/11/2011 +-bugfix allow integer as attribute name in plugin calls +-change trimm whitespace from error message, removed long list of expected tokens + +22/11/2010 +- bugfix on template inheritance when an {extends} tag was inserted by a prefilter +- added error message for illegal variable file attributes at {extends...} tags + +===== Smarty 3.0.5 ===== + + +19/11/2010 +- bugfix on block plugins with modifiers + +18/11/2010 +- change on handling of unassigned template variable -- default will drop E_NOTICE +- bugfix on Smarty2 wrapper load_filter() did not work + +17/11/2010 +- bugfix on {call} with variable function name +- bugfix on {block} if name did contain '-' +- bugfix in function.fetch.php , referece to undefined $smarty + +16/11/2010 +- bugfix whitespace in front of "fetch()/display() have been used in plugins + (introduced with 3.0.2) +- code cleanup + +===== Smarty 3.0.3 ===== + +13/11/2010 +- bugfix on {debug} +- reverted location of loadPlugin() to Smarty class +- fixed comments in plugins +- fixed internal_config (removed unwanted code line) +- improvement remove last linebreak from {function} definition + +===== Smarty 3.0.2 ===== + +12/11/2010 +- reactivated $error_reporting property handling +- fixed typo in compile_continue +- fixed security in {fetch} plugin +- changed back plugin parameters to two. second is template object + with transparent access to Smarty object +- fixed {config_load} scoping form compile time to run time + +===== Smarty 3.0.0 ===== + + + +11/11/2010 +- major update including some API changes + +10/11/2010 +- observe compile_id also for config files + +09/11/2010 +-bugfix on complex expressions as start value for {for} tag +request_use_auto_globals +04/11/2010 +- bugfix do not allow access of dynamic and private object members of assigned objects when + security is enabled. + +01/11/2010 +- bugfix related to E_NOTICE change. {if empty($foo)} did fail when $foo contained a string + +28/10/2010 +- bugfix on compiling modifiers within $smarty special vars like {$smarty.post.{$foo|lower}} + +27/10/2010 +- bugfix default parameter values did not work for template functions included with {include} + +25/10/2010 +- bugfix for E_NOTICE change, array elements did not work as modifier parameter + +20/10/2010 +- bugfix for the E_NOTICE change + +19/10/2010 +- change Smarty does no longer mask out E_NOTICE by default during template processing + +13/10/2010 +- bugfix removed ambiguity between ternary and stream variable in template syntax +- bugfix use caching properties of template instead of smarty object when compiling child {block} +- bugfix {*block}...{/block*} did throw an exception in template inheritance +- bugfix on template inheritance using nested eval or string resource in {extends} tags +- bugfix on output buffer handling in isCached() method + +===== RC4 ===== + +01/10/2010 +- added {break} and {continue} tags for flow control of {foreach},{section},{for} and {while} loops +- change of 'string' resource. It's no longer evaluated and compiled files are now stored +- new 'eval' resource which evaluates a template without saving the compiled file +- change in isCached() method to allow multiple calls for the same template + +25/09/2010 +- bugfix on some compiling modifiers + +24/09/2010 +- bugfix merge_compiled_includes flag was not restored correctly in {block} tag + +22/09/2010 +- bugfix on default modifier + +18/09/2010 +- bugfix untility compileAllConfig() did not create sha1 code for compiled template file names if template_dir was defined with no trailing DS +- bugfix on templateExists() for extends resource + +17/09/2010 +- bugfix {$smarty.template} and {$smarty.current_dir} did not compile correctly within {block} tags +- bugfix corrected error message on missing template files in extends resource +- bugfix untility compileAllTemplates() did not create sha1 code for compiled template file names if template_dir was defined with no trailing DS + +16/09/2010 +- bugfix when a doublequoted modifier parameter did contain Smarty tags and ':' + +15/09/2010 +- bugfix resolving conflict between '<%'/'%>' as custom Smarty delimiter and ASP tags +- use ucfirst for resource name on internal resource class names + +12/09/2010 +- bugfix for change of 08/09/2010 (final {block} tags in subtemplates did not produce correct results) + +10/09/2010 +- bugfix for change of 08/09/2010 (final {block} tags in subtemplates did not produce correct results) + +08/09/2010 +- allow multiple template inheritance branches starting in subtemplates + +07/09/2010 +- bugfix {counter} and {cycle} plugin assigned result to smarty variable not in local(template) scope +- bugfix templates containing just {strip} {/strip} tags did produce an error + + +23/08/2010 +- fixed E_STRICT errors for uninitialized variables + +22/08/2010 +- added attribute cache_id to {include} tag + +13/08/2010 +- remove exception_handler property from Smarty class +- added Smarty's own exceptions SmartyException and SmartyCompilerException + +09/08/2010 +- bugfix on modifier with doublequoted strings as parameter containing embedded tags + +06/08/2010 +- bugfix when cascading some modifier like |strip|strip_tags modifier + +05/08/2010 +- added plugin type modifiercompiler to produce compiled modifier code +- changed standard modifier plugins to the compiling versions whenever possible +- bugfix in nocache sections {include} must not cache the subtemplate + +02/08/2010 +- bugfix strip did not work correctly in conjunction with comment lines + +31/07/2010 +- bugfix on nocache attribute at {assign} and {append} + +30/07/2010 +- bugfix passing scope attributes in doublequoted strings did not work at {include} {assign} and {append} + +25/07/2010 +- another bugfix of change from 23/07/2010 when compiling modifier + +24/07/2010 +- bugfix of change from 23/07/2010 when compiling modifier + +23/07/2010 +- changed execution order. A variable filter does now run before modifiers on output of variables +- bugfix use always { and } as delimiter for debug.tpl + + +22/07/2010 +- bugfix in templateExists() method + +20/07/2010 +- fixed handling of { strip } tag with whitespaces + +15/07/2010 +- bufix {$smarty.template} does include now the relative path, not just filename + +===== RC3 ===== + + + + +15/07/2010 +- make the date_format modifier work also on objects of the DateTime class +- implementation of parsetrees in the parser to close security holes and remove unwanted empty line in HTML output + +08/07/2010 +- bugfix on assigning multidimensional arrays within templates +- corrected bugfix for truncate modifier + +07/07/2010 +- bugfix the truncate modifier needs to check if the string is utf-8 encoded or not +- bugfix support of script files relative to trusted_dir + +06/07/2010 +- create exception on recursive {extends} calls +- fixed reported line number at "unexpected closing tag " exception +- bugfix on escape:'mail' modifier +- drop exception if 'item' variable is equal 'from' variable in {foreach} tag + +01/07/2010 +- removed call_user_func_array calls for optimization of compiled code when using registered modifiers and plugins + +25/06/2010 +- bugfix escaping " when block tags are used within doublequoted strings + +24/06/2010 +- replace internal get_time() calls with standard PHP5 microtime(true) calls in Smarty_Internal_Utility +- added $smarty->register->templateClass() and $smarty->unregister->templateClass() methods for supporting static classes with namespace + + +22/06/2010 +- allow spaces between typecast and value in template syntax +- bugfix get correct count of traversables in {foreach} tag + +21/06/2010 +- removed use of PHP shortags SMARTY_PHP_PASSTHRU mode +- improved speed of cache->clear() when a compile_id was specified and use_sub_dirs is true + +20/06/2010 +- replace internal get_time() calls with standard PHP5 microtime(true) calls +- closed security hole when php.ini asp_tags = on + +18/06/2010 +- added __toString method to the Smarty_Variable class + + +14/06/2010 +- make handling of Smarty comments followed by newline BC to Smarty2 + + +===== RC2 ===== + + + +13/06/2010 +- bugfix Smarty3 did not handle hexadecimals like 0x0F as numerical value +- bugifx Smarty3 did not accept numerical constants like .1 or 2. (without a leading or trailing digit) + +11/06/2010 +- bugfix the lexer did fail on larger {literal} ... {/literal} sections + +03/06/2010 +- bugfix on calling template functions like Smarty tags + +01/06/2010 +- bugfix on template functions used with template inheritance +- removed /* vim: set expandtab: */ comments +- bugfix of auto literal problem introduce with fix of 31/05/2010 + +31/05/2010 +- bugfix the parser did not allow some smarty variables with special name like $for, $if, $else and others. + +27/05/2010 +- bugfix on object chaining using variable properties +- make scope of {counter} and {cycle} tags again global as in Smarty2 + +26/05/2010 +- bugfix removed decrepated register_resource call in smarty_internal_template.php + +25/05/2010 +- rewrite of template function handling to improve speed +- bugfix on file dependency when merge_compiled_includes = true + + +16/05/2010 +- bugfix when passing parameter with numeric name like {foo 1='bar' 2='blar'} + +14/05/2010 +- bugfix compile new config files if compile_check and force_compile = false +- added variable static classes names to template syntax + +11/05/2010 +- bugfix make sure that the cache resource is loaded in all conditions when template methods getCached... are called externally +- reverted the change 0f 30/04/2010. With the exception of forward references template functions can be again called by a standard tag. + +10/05/2010 +- bugfix on {foreach} and {for} optimizations of 27/04/2010 + +09/05/2010 +- update of template and config file parser because of minor parser generator bugs + +07/05/2010 +- bugfix on {insert} + +06/05/2010 +- bugfix when merging compiled templates and objects are passed as parameter of the {include} tag + +05/05/2010 +- bugfix on {insert} to cache parameter +- implementation of $smarty->default_modifiers as in Smarty2 +- bugfix on getTemplateVars method + +01/05/2010 +- bugfix on handling of variable method names at object chaning + +30/04/2010 +- bugfix when comparing timestamps in sysplugins/smarty_internal_config.php +- work around of a substr_compare bug in older PHP5 versions +- bugfix on template inheritance for tag names starting with "block" +- bugfix on {function} tag with name attribute in doublequoted strings +- fix to make calling of template functions unambiguously by madatory usage of the {call} tag + +===== RC1 ===== + +27/04/2010 +- change default of $debugging_ctrl to 'NONE' +- optimization of compiled code of {foreach} and {for} loops +- change of compiler for config variables + +27/04/2010 +- bugfix in $smarty->cache->clear() method. (do not cache template object) + + +17/04/2010 +- security fix in {math} plugin + + +12/04/2010 +- bugfix in smarty_internal_templatecompilerbase (overloaded property) +- removed parser restrictions in using true,false and null as ID + +07/04/2010 +- bugfix typo in smarty_internal_templatecompilerbase + +31/03/2010 +- compile locking by touching old compiled files to avoid concurrent compilations + +29/03/2010 +- bugfix allow array definitions as modifier parameter +- bugfix observe compile_check property when loading config files +- added the template object as third filter parameter + +25/03/2010 +- change of utility->compileAllTemplates() log messages +- bugfix on nocache code in {function} tags +- new method utility->compileAllConfig() to compile all config files + +24/03/2010 +- bugfix on register->modifier() error messages + +23/03/2010 +- bugfix on template inheritance when calling multiple child/parent relations +- bugfix on caching mode SMARTY_CACHING_LIFETIME_SAVED and cache_lifetime = 0 + +22/03/2010 +- bugfix make directory separator operating system independend in compileAllTemplates() + +21/03/2010 +- removed unused code in compileAllTemplates() + +19/03/2010 +- bugfix for multiple {/block} tags on same line + +17/03/2010 +- bugfix make $smarty->cache->clear() function independent from caching status + +16/03/2010 +- bugfix on assign attribute at registered template objects +- make handling of modifiers on expression BC to Smarty2 + +15/03/2010 +- bugfix on block plugin calls + +11/03/2010 +- changed parsing of back to Smarty2 behaviour + +08/03/2010 +- bugfix on uninitialized properties in smarty_internal_template +- bugfix on $smarty->disableSecurity() + +04/03/2010 +- bugfix allow uppercase chars in registered resource names +- bugfix on accessing chained objects of static classes + +01/03/2010 +- bugfix on nocache code in {block} tags if child template was included by {include} + +27/02/2010 +- allow block tags inside double quoted string + +26/02/2010 +- cache modified check implemented +- support of access to a class constant from an object (since PHP 5.3) + +24/02/2010 +- bugfix on expressions in doublequoted string enclosed in backticks +- added security property $static_classes for static class security + +18/02/2010 +- bugfix on parsing Smarty tags inside +- bugfix on truncate modifier + +17/02/2010 +- removed restriction that modifiers did require surrounding parenthesis in some cases +- added {$smarty.block.child} special variable for template inheritance + +16/02/2010 +- bugfix on tags for all php_handling modes +- bugfix on parameter of variablefilter.htmlspecialchars.php plugin + +14/02/2010 +- added missing _plugins property in smarty.class.php +- bugfix $smarty.const... inside doublequoted strings and backticks was compiled into wrong PHP code + +12/02/2010 +- bugfix on nested {block} tags +- changed Smarty special variable $smarty.parent to $smarty.block.parent +- added support of nested {bock} tags + +10/02/2010 +- avoid possible notice on $smarty->cache->clear(...), $smarty->clear_cache(....) +- allow Smarty tags inside tags in SMARTY_PHP_QUOTE and SMARTY_PHP_PASSTHRU mode +- bugfix at new "for" syntax like {for $x=1 to 10 step 2} + +09/02/2010 +- added $smarty->_tag_stack for tracing block tag hierarchy + +08/02/2010 +- bugfix use template fullpath at §smarty->cache->clear(...), $smarty->clear_cache(....) +- bugfix of cache filename on extended templates when force_compile=true + +07/02/2010 +- bugfix on changes of 05/02/2010 +- preserve line endings type form template source +- API changes (see README file) + +05/02/2010 +- bugfix on modifier and block plugins with same name + +02/02/2010 +- retaining newlines at registered functions and function plugins + +01/25/2010 +- bugfix cache resource was not loaded when caching was globally off but enabled at a template object +- added test that $_SERVER['SCRIPT_NAME'] does exist in Smarty.class.php + +01/22/2010 +- new method $smarty->createData([$parent]) for creating a data object (required for bugfixes below) +- bugfix config_load() method now works also on a data object +- bugfix get_config_vars() method now works also on a data and template objects +- bugfix clear_config() method now works also on a data and template objects + +01/19/2010 +- bugfix on plugins if same plugin was called from a nocache section first and later from a cached section + + +###beta 7### + + +01/17/2010 +- bugfix on $smarty.const... in double quoted strings + +01/16/2010 +- internal change of config file lexer/parser on handling of section names +- bugfix on registered objects (format parameter of register_object was not handled correctly) + +01/14/2010 +- bugfix on backslash within single quoted strings +- bugfix allow absolute filepath for config files +- bugfix on special Smarty variable $smarty.cookies +- revert handling of newline on no output tags like {if...} +- allow special characters in config file section names for Smarty2 BC + +01/13/2010 +- bugfix on {if} tags + +01/12/2010 +- changed back modifier handling in parser. Some restrictions still apply: + if modifiers are used in side {if...} expression or in mathematical expressions + parentheses must be used. +- bugfix the {function..} tag did not accept the name attribute in double quotes +- closed possible security hole at tags +- bugfix of config file parser on large config files + + +###beta 6#### + +01/11/2010 +- added \n to the compiled code of the {if},{else},{elseif},{/if} tags to get output of newlines as expected by the template source +- added missing support of insert plugins +- added optional nocache attribute to {block} tags in parent template +- updated handling supporting now heredocs and newdocs. (thanks to Thue Jnaus Kristensen) + +01/09/2010 +- bugfix on nocache {block} tags in parent templates + +01/08/2010 +- bugfix on variable filters. filter/nofilter attributes did not work on output statements + +01/07/2010 +- bugfix on file dependency at template inheritance +- bugfix on nocache code at template inheritance + +01/06/2010 +- fixed typo in smarty_internal_resource_registered +- bugfix for custom delimiter at extends resource and {extends} tag + +01/05/2010 +- bugfix sha1() calculations at extends resource and some general improvments on sha1() handling + + +01/03/2010 +- internal change on building cache files + +01/02/2010 +- update cached_timestamp at the template object after cache file is written to avoid possible side effects +- use internally always SMARTY_CACHING_LIFETIME_* constants + +01/01/2010 +- bugfix for obtaining plugins which must be included (related to change of 12/30/2009) +- bugfix for {php} tag (trow an exception if allow_php_tag = false) + +12/31/2009 +- optimization of generated code for doublequoted strings containing variables +- rewrite of {function} tag handling + - can now be declared in an external subtemplate + - can contain nocache sections (nocache_hash handling) + - can be called in noccache sections (nocache_hash handling) + - new {call..} tag to call template functions with a variable name {call name=$foo} +- fixed nocache_hash handling in merged compiled templates + +12/30/2009 +- bugfix for plugins defined in the script as smarty_function_foo + +12/29/2009 +- use sha1() for filepath encoding +- updates on nocache_hash handling +- internal change on merging some data +- fixed cache filename for custom resources + +12/28/2009 +- update for security fixes +- make modifier plugins always trusted +- fixed bug loading modifiers in child template at template inheritance + +12/27/2009 +--- this is a major update with a couple of internal changes --- +- new config file lexer/parser (thanks to Thue Jnaus Kristensen) +- template lexer/parser fixes for PHP and {literal} handing (thanks to Thue Jnaus Kristensen) +- fix on registered plugins with different type but same name +- rewrite of plugin handling (optimized execution speed) +- closed a security hole regarding PHP code injection into cache files +- fixed bug in clear cache handling +- Renamed a couple of internal classes +- code cleanup for merging compiled templates +- couple of runtime optimizations (still not all done) +- update of getCachedTimestamp() +- fixed bug on modifier plugins at nocache output + +12/19/2009 +- bugfix on comment lines in config files + +12/17/2009 +- bugfix of parent/global variable update at included/merged subtemplates +- encode final template filepath into filename of compiled and cached files +- fixed {strip} handling in auto literals + +12/16/2009 +- update of changelog +- added {include file='foo.tpl' inline} inline option to merge compiled code of subtemplate into the calling template + +12/14/2009 +- fixed sideefect of last modification (objects in array index did not work anymore) + +12/13/2009 +- allow boolean negation ("!") as operator on variables outside {if} tag + +12/12/2009 +- bugfix on single quotes inside {function} tag +- fix short append/prepend attributes in {block} tags + +12/11/2009 +- bugfix on clear_compiled_tpl (avoid possible warning) + +12/10/2009 +- bugfix on {function} tags and template inheritance + +12/05/2009 +- fixed problem when a cached file was fetched several times +- removed unneeded lexer code + +12/04/2009 +- added max attribute to for loop +- added security mode allow_super_globals + +12/03/2009 +- template inheritance: child templates can now call functions defined by the {function} tag in the parent template +- added {for $foo = 1 to 5 step 2} syntax +- bugfix for {$foo.$x.$y.$z} + +12/01/2009 +- fixed parsing of names of special formated tags like if,elseif,while,for,foreach +- removed direct access to constants in templates because of some syntax problems +- removed cache resource plugin for mysql from the distribution +- replaced most hard errors (exceptions) by softerrors(trigger_error) in plugins +- use $template_class property for template class name when compiling {include},{eval} and {extends} tags + +11/30/2009 +- map 'true' to SMARTY_CACHING_LIFETIME_CURRENT for the $smarty->caching parameter +- allow {function} tags within {block} tags + +11/28/2009 +- ignore compile_id at debug template +- added direct access to constants in templates +- some lexer/parser optimizations + +11/27/2009 +- added cache resource MYSQL plugin + +11/26/2009 +- bugfix on nested doublequoted strings +- correct line number on unknown tag error message +- changed {include} compiled code +- fix on checking dynamic varibales with error_unassigned = true + +11/25/2009 +- allow the following writing for boolean: true, TRUE, True, false, FALSE, False +- {strip} tag functionality rewritten + +11/24/2009 +- bugfix for $smarty->config_overwrite = false + +11/23/2009 +- suppress warnings on unlink caused by race conditions +- correct line number on unknown tag error message + +------- beta 5 +11/23/2009 +- fixed configfile parser for text starting with a numeric char +- the default_template_handler_func may now return a filepath to a template source + +11/20/2009 +- bugfix for empty config files +- convert timestamps of registered resources to integer + +11/19/2009 +- compiled templates are no longer touched with the filemtime of template source + +11/18/2009 +- allow integer as attribute name in plugin calls + +------- beta 4 +11/18/2009 +- observe umask settings when setting file permissions +- avoide unneeded cache file creation for subtemplates which did occur in some situations +- make $smarty->_current_file available during compilation for Smarty2 BC + +11/17/2009 +- sanitize compile_id and cache_id (replace illegal chars with _) +- use _dir_perms and _file_perms properties at file creation +- new constant SMARTY_RESOURCE_DATE_FORMAT (default '%b %e, %Y') which is used as default format in modifier date_format +- added {foreach $array as $key=>$value} syntax +- renamed extend tag and resource to extends: {extends file='foo.tol'} , $smarty->display('extends:foo.tpl|bar.tpl); +- bugfix cycle plugin + +11/15/2009 +- lexer/parser optimizations on quoted strings + +11/14/2009 +- bugfix on merging compiled templates when source files got removed or renamed. +- bugfix modifiers on registered object tags +- fixed locaion where outputfilters are running +- fixed config file definitions at EOF +- fix on merging compiled templates with nocache sections in nocache includes +- parser could run into a PHP error on wrong file attribute + +11/12/2009 +- fixed variable filenames in {include_php} and {insert} +- added scope to Smarty variables in the {block} tag compiler +- fix on nocache code in child {block} tags + +11/11/2009 +- fixed {foreachelse}, {forelse}, {sectionelse} compiled code at nocache variables +- removed checking for reserved variables +- changed debugging handling + +11/10/2009 +- fixed preg_qoute on delimiters + +11/09/2009 +- lexer/parser bugfix +- new SMARTY_SPL_AUTOLOAD constant to control the autoloader option +- bugfix for {function} block tags in included templates + +11/08/2009 +- fixed alphanumeric array index +- bugfix on complex double quoted strings + +11/05/2009 +- config_load method can now be called on data and template objects + +11/04/2009 +- added typecasting support for template variables +- bugfix on complex indexed special Smarty variables + +11/03/2009 +- fixed parser error on objects with special smarty vars +- fixed file dependency for {incude} inside {block} tag +- fixed not compiling on non existing compiled templates when compile_check = false +- renamed function names of autoloaded Smarty methods to Smarty_Method_.... +- new security_class property (default is Smarty_Security) + +11/02/2009 +- added neq,lte,gte,mod as aliases to if conditions +- throw exception on illegal Smarty() constructor calls + +10/31/2009 +- change of filenames in sysplugins folder for internal spl_autoload function +- lexer/parser changed for increased compilation speed + +10/27/2009 +- fixed missing quotes in include_php.php + +10/27/2009 +- fixed typo in method.register_resource +- pass {} through as literal + +10/26/2009 +- merge only compiled subtemplates into the compiled code of the main template + +10/24/2009 +- fixed nocache vars at internal block tags +- fixed merging of recursive includes + +10/23/2009 +- fixed nocache var problem + +10/22/2009 +- fix trimwhitespace outputfilter parameter + +10/21/2009 +- added {$foo++}{$foo--} syntax +- buxfix changed PHP "if (..):" to "if (..){" because of possible bad code when concenating PHP tags +- autoload Smarty internal classes +- fixed file dependency for config files +- some code optimizations +- fixed function definitions on some autoloaded methods +- fixed nocache variable inside if condition of {if} tag + +10/20/2009 +- check at compile time for variable filter to improve rendering speed if no filter is used +- fixed bug at combination of {elseif} tag and {...} in double quoted strings of static class parameter + +10/19/2009 +- fixed compiled template merging on variable double quoted strings as name +- fixed bug in caching mode 2 and cache_lifetime -1 +- fixed modifier support on block tags + +10/17/2009 +- remove ?>\n'bar','foo2'=>'blar'); + $smarty->display('my.tpl',$data); + +09/29/2009 +- changed {php} tag handling +- removed support of Smarty::instance() +- removed support of PHP resource type +- improved execution speed of {foreach} tags +- fixed bug in {section} tag + +09/23/2009 +- improvements and bugfix on {include} tag handling +NOTICE: existing compiled template and cache files must be deleted + +09/19/2009 +- replace internal "eval()" calls by "include" during rendering process +- speed improvment for templates which have included subtemplates + the compiled code of included templates is merged into the compiled code of the parent template +- added logical operator "xor" for {if} tag +- changed parameter ordering for Smarty2 BC + fetch($template, $cache_id = null, $compile_id = null, $parent = null) + display($template, $cache_id = null, $compile_id = null, $parent = null) + createTemplate($template, $cache_id = null, $compile_id = null, $parent = null) +- property resource_char_set is now replaced by constant SMARTY_RESOURCE_CHAR_SET +- fixed handling of classes in registered blocks +- speed improvement of lexer on text sections + +09/01/2009 +- dropped nl2br as plugin +- added '<>' as comparission operator in {if} tags +- cached caching_lifetime property to cache_liftime for backward compatibility with Smarty2. + {include} optional attribute is also now cache_lifetime +- fixed trigger_error method (moved into Smarty class) +- version is now Beta!!! + + +08/30/2009 +- some speed optimizations on loading internal plugins + + +08/29/2009 +- implemented caching of registered Resources +- new property 'auto_literal'. if true(default) '{ ' and ' }' interpreted as literal, not as Smarty delimiter + + +08/28/2009 +- Fix on line breaks inside {if} tags + +08/26/2009 +- implemented registered resources as in Smarty2. NOTE: caching does not work yet +- new property 'force_cache'. if true it forces the creation of a new cache file +- fixed modifiers on arrays +- some speed optimization on loading internal classes + + +08/24/2009 +- fixed typo in lexer definition for '!==' operator +- bugfix - the ouput of plugins was not cached +- added global variable SCRIPT_NAME + +08/21/2009 +- fixed problems whitespace in conjuction with custom delimiters +- Smarty tags can now be used as value anywhere + +08/18/2009 +- definition of template class name moded in internal.templatebase.php +- whitespace parser changes + +08/12/2009 +- fixed parser problems + +08/11/2009 +- fixed parser problems with custom delimiter + +08/10/2009 +- update of mb support in plugins + + +08/09/2009 +- fixed problems with doublequoted strings at name attribute of {block} tag +- bugfix at scope attribute of {append} tag + +08/08/2009 +- removed all internal calls of Smarty::instance() +- fixed code in double quoted strings + +08/05/2009 +- bugfix mb_string support +- bugfix of \n.\t etc in double quoted strings + +07/29/2009 +- added syntax for variable config vars like #$foo# + +07/28/2009 +- fixed parsing of $smarty.session vars containing objects + +07/22/2009 +- fix of "$" handling in double quoted strings + +07/21/2009 +- fix that {$smarty.current_dir} return correct value within {block} tags. + +07/20/2009 +- drop error message on unmatched {block} {/block} pairs + +07/01/2009 +- fixed smarty_function_html_options call in plugin function.html_select_date.php (missing ,) + +06/24/2009 +- fixed smarty_function_html_options call in plugin function.html_select_date.php + +06/22/2009 +- fix on \n and spaces inside smarty tags +- removed request_use_auto_globals propert as it is no longer needed because Smarty 3 will always run under PHP 5 + + +06/18/2009 +- fixed compilation of block plugins when caching enabled +- added $smarty.current_dir which returns the current working directory + +06/14/2009 +- fixed array access on super globals +- allow smarty tags within xml tags + +06/13/2009 +- bugfix at extend resource: create unique files for compiled template and cache for each combination of template files +- update extend resource to handle appen and prepend block attributes +- instantiate classes of plugins instead of calling them static + +06/03/2009 +- fixed repeat at block plugins + +05/25/2009 +- fixed problem with caching of compiler plugins + +05/14/2009 +- fixed directory separator handling + +05/09/2009 +- syntax change for stream variables +- fixed bug when using absolute template filepath and caching + +05/08/2009 +- fixed bug of {nocache} tag in included templates + +05/06/2009 +- allow that plugins_dir folder names can end without directory separator + +05/05/2009 +- fixed E_STRICT incompabilities +- {function} tag bug fix +- security policy definitions have been moved from plugins folder to file Security.class.php in libs folder +- added allow_super_global configuration to security + +04/30/2009 +- functions defined with the {function} tag now always have global scope + +04/29/2009 +- fixed problem with directory setter methods +- allow that cache_dir can end without directory separator + +04/28/2009 +- the {function} tag can no longer overwrite standard smarty tags +- inherit functions defined by the {fuction} tag into subtemplates +- added {while } sytax to while tag + +04/26/2009 +- added trusted stream checking to security +- internal changes at file dependency check for caching + +04/24/2009 +- changed name of {template} tag to {function} +- added new {template} tag + +04/23/2009 +- fixed access of special smarty variables from included template + +04/22/2009 +- unified template stream syntax with standard Smarty resource syntax $smarty->display('mystream:mytemplate') + +04/21/2009 +- change of new style syntax for forach. Now: {foreach $array as $var} like in PHP + +04/20/2009 +- fixed "$foo.bar ..." variable replacement in double quoted strings +- fixed error in {include} tag with variable file attribute + +04/18/2009 +- added stream resources ($smarty->display('mystream://mytemplate')) +- added stream variables {$mystream:myvar} + +04/14/2009 +- fixed compile_id handling on {include} tags +- fixed append/prepend attributes in {block} tag +- added {if 'expression' is in 'array'} syntax +- use crc32 as hash for compiled config files. + +04/13/2009 +- fixed scope problem with parent variables when appending variables within templates. +- fixed code for {block} without childs (possible sources for notice errors removed) + +04/12/2009 +- added append and prepend attribute to {block} tag + +04/11/2009 +- fixed variables in 'file' attribute of {extend} tag +- fixed problems in modifiers (if mb string functions not present) + +04/10/2009 +- check if mb string functions available otherwise fallback to normal string functions +- added global variable scope SMARTY_GLOBAL_SCOPE +- enable 'variable' filter by default +- fixed {$smarty.block.parent.foo} +- implementation of a 'variable' filter as replacement for default modifier + +04/09/2009 +- fixed execution of filters defined by classes +- compile the always the content of {block} tags to make shure that the filters are running over it +- syntax corrections on variable object property +- syntax corrections on array access in dot syntax + +04/08/2009 +- allow variable object property + +04/07/2009 +- changed variable scopes to SMARTY_LOCAL_SCOPE, SMARTY_PARENT_SCOPE, SMARTY_ROOT_SCOPE to avoid possible conflicts with user constants +- Smarty variable global attribute replaced with scope attribute + +04/06/2009 +- variable scopes LOCAL_SCOPE, PARENT_SCOPE, ROOT_SCOPE +- more getter/setter methods + +04/05/2009 +- replaced new array looping syntax {for $foo in $array} with {foreach $foo in $array} to avoid confusion +- added append array for short form of assign {$foo[]='bar'} and allow assignments to nested arrays {$foo['bla']['blue']='bar'} + +04/04/2009 +- make output of template default handlers cachable and save compiled source +- some fixes on yesterdays update + +04/03/2006 +- added registerDefaultTemplateHandler method and functionallity +- added registerDefaultPluginHandler method and functionallity +- added {append} tag to extend Smarty array variabled + +04/02/2009 +- added setter/getter methods +- added $foo@first and $foo@last properties at {for} tag +- added $set_timezone (true/false) property to setup optionally the default time zone + +03/31/2009 +- bugfix smarty.class and internal.security_handler +- added compile_check configuration +- added setter/getter methods + +03/30/2009 +- added all major setter/getter methods + +03/28/2009 +- {block} tags can be nested now +- md5 hash function replace with crc32 for speed optimization +- file order for exted resource inverted +- clear_compiled_tpl and clear_cache_all will not touch .svn folder any longer + +03/27/2009 +- added extend resource + +03/26/2009 +- fixed parser not to create error on `word` in double quoted strings +- allow PHP array(...) +- implemented $smarty.block.name.parent to access parent block content +- fixed smarty.class + + +03/23/2009 +- fixed {foreachelse} and {forelse} tags + +03/22/2009 +- fixed possible sources for notice errors +- rearrange SVN into distribution and development folders + +03/21/2009 +- fixed exceptions in function plugins +- fixed notice error in Smarty.class.php +- allow chained objects to span multiple lines +- fixed error in modifiers + +03/20/2009 +- moved /plugins folder into /libs folder +- added noprint modifier +- autoappend a directory separator if the xxxxx_dir definition have no trailing one + +03/19/2009 +- allow array definition as modifier parameter +- changed modifier to use multi byte string funktions. + +03/17/2009 +- bugfix + +03/15/2009 +- added {include_php} tag for BC +- removed @ error suppression +- bugfix fetch did always repeat output of first call when calling same template several times +- PHPunit tests extended + +03/13/2009 +- changed block syntax to be Smarty like {block:titel} -> {block name=titel} +- compiling of {block} and {extend} tags rewriten for better performance +- added special Smarty variable block ($smarty.block.foo} returns the parent definition of block foo +- optimization of {block} tag compiled code. +- fixed problem with escaped double quotes in double quoted strings + +03/12/2009 +- added support of template inheritance by {extend } and {block } tags. +- bugfix comments within literals +- added scope attribuie to {include} tag + +03/10/2009 +- couple of bugfixes and improvements +- PHPunit tests extended + +03/09/2009 +- added support for global template vars. {assign_global...} $smarty->assign_global(...) +- added direct_access_security +- PHPunit tests extended +- added missing {if} tag conditions like "is div by" etc. + +03/08/2009 +- splitted up the Compiler class to make it easier to use a coustom compiler +- made default plugins_dir relative to Smarty root and not current working directory +- some changes to make the lexer parser better configurable +- implemented {section} tag for Smarty2 BC + +03/07/2009 +- fixed problem with comment tags +- fixed problem with #xxxx in double quoted string +- new {while} tag implemented +- made lexer and paser class configurable as $smarty property +- Smarty method get_template_vars implemented +- Smarty method get_registered_object implemented +- Smarty method trigger_error implemented +- PHPunit tests extended + +03/06/2009 +- final changes on config variable handling +- parser change - unquoted strings will by be converted into single quoted strings +- PHPunit tests extended +- some code cleanup +- fixed problem on catenate strings with expression +- update of count_words modifier +- bugfix on comment tags + + +03/05/2009 +- bugfix on tag with caching enabled +- changes on exception handling (by Monte) + +03/04/2009 +- added support for config variables +- bugfix on tag + +03/02/2009 +- fixed unqouted strings within modifier parameter +- bugfix parsing of mofifier parameter + +03/01/2009 +- modifier chaining works now as in Smarty2 + +02/28/2009 +- changed handling of unqouted strings + +02/26/2009 +- bugfix +- changed $smarty.capture.foo to be global for Smarty2 BC. + +02/24/2009 +- bugfix {php} {/php} tags for backward compatibility +- bugfix for expressions on arrays +- fixed usage of "null" value +- added $smarty.foreach.foo.first and $smarty.foreach.foo.last + +02/06/2009 +- bugfix for request variables without index for example $smarty.get +- experimental solution for variable functions in static class + +02/05/2009 +- update of popup plugin +- added config variables to template parser (load config functions still missing) +- parser bugfix for empty quoted strings + +02/03/2009 +- allow array of objects as static class variabales. +- use htmlentities at source output at template errors. + +02/02/2009 +- changed search order on modifiers to look at plugins folder first +- parser bug fix for modifier on array elements $foo.bar|modifier +- parser bug fix on single quoted srings +- internal: splitted up compiler plugin files + +02/01/2009 +- allow method chaining on static classes +- special Smarty variables $smarty.... implemented +- added {PHP} {/PHP} tags for backward compatibility + +01/31/2009 +- added {math} plugin for Smarty2 BC +- added template_exists method +- changed Smarty3 method enable_security() to enableSecurity() to follow camelCase standards + +01/30/2009 +- bugfix in single quoted strings +- changed syntax for variable property access from $foo:property to $foo@property because of ambiguous syntax at modifiers + +01/29/2009 +- syntax for array definition changed from (1,2,3) to [1,2,3] to remove ambiguous syntax +- allow {for $foo in [1,2,3]} syntax +- bugfix in double quoted strings +- allow tags in template even if short_tags are enabled + +01/28/2009 +- fixed '!==' if condition. + +01/28/2009 +- added support of {strip} {/strip} tag. + +01/27/2009 +- bug fix on backticks in double quoted strings at objects + +01/25/2009 +- Smarty2 modfiers added to SVN + +01/25/2009 +- bugfix allow arrays at object properties in Smarty syntax +- the template object is now passed as additional parameter at plugin calls +- clear_compiled_tpl method completed + +01/20/2009 +- access to class constants implemented ( class::CONSTANT ) +- access to static class variables implemented ( class::$variable ) +- call of static class methods implemented ( class::method() ) + +01/16/2009 +- reallow leading _ in variable names {$_var} +- allow array of objects {$array.index->method()} syntax +- finished work on clear_cache and clear_cache_all methods + +01/11/2009 +- added support of {literal} tag +- added support of {ldelim} and {rdelim} tags +- make code compatible to run with E_STRICT error setting + +01/08/2009 +- moved clear_assign and clear_all_assign to internal.templatebase.php +- added assign_by_ref, append and append_by_ref methods + +01/02/2009 +- added load_filter method +- fished work on filter handling +- optimization of plugin loading + +12/30/2008 +- added compiler support of registered object +- added backtick support in doubled quoted strings for backward compatibility +- some minor bug fixes and improvments + +12/23/2008 +- fixed problem of not working "not" operator in if-expressions +- added handling of compiler function plugins +- finished work on (un)register_compiler_function method +- finished work on (un)register_modifier method +- plugin handling from plugins folder changed for modifier plugins + deleted - internal.modifier.php +- added modifier chaining to parser + +12/17/2008 +- finished (un)register_function method +- finished (un)register_block method +- added security checking for PHP functions in PHP templates +- plugin handling from plugins folder rewritten + new - internal.plugin_handler.php + deleted - internal.block.php + deleted - internal.function.php +- removed plugin checking from security handler + +12/16/2008 + +- new start of this change_log file diff --git a/lib/smarty_3/demo/configs/test.conf b/lib/smarty_3/demo/configs/test.conf new file mode 100755 index 0000000..22a8649 --- /dev/null +++ b/lib/smarty_3/demo/configs/test.conf @@ -0,0 +1,5 @@ +title = Welcome to Smarty! +cutoff_size = 40 + +[setup] +bold = true diff --git a/lib/smarty_3/demo/index.php b/lib/smarty_3/demo/index.php new file mode 100755 index 0000000..2d17cc3 --- /dev/null +++ b/lib/smarty_3/demo/index.php @@ -0,0 +1,30 @@ +force_compile = true; +$smarty->debugging = true; +$smarty->caching = true; +$smarty->cache_lifetime = 120; + +$smarty->assign("Name", "Fred Irving Johnathan Bradley Peppergill", true); +$smarty->assign("FirstName", array("John", "Mary", "James", "Henry")); +$smarty->assign("LastName", array("Doe", "Smith", "Johnson", "Case")); +$smarty->assign("Class", array(array("A", "B", "C", "D"), array("E", "F", "G", "H"), + array("I", "J", "K", "L"), array("M", "N", "O", "P"))); + +$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"), + array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234"))); + +$smarty->assign("option_values", array("NY", "NE", "KS", "IA", "OK", "TX")); +$smarty->assign("option_output", array("New York", "Nebraska", "Kansas", "Iowa", "Oklahoma", "Texas")); +$smarty->assign("option_selected", "NE"); + +$smarty->display('index.tpl'); diff --git a/lib/smarty_3/demo/plugins/cacheresource.apc.php b/lib/smarty_3/demo/plugins/cacheresource.apc.php new file mode 100755 index 0000000..d2b3380 --- /dev/null +++ b/lib/smarty_3/demo/plugins/cacheresource.apc.php @@ -0,0 +1,83 @@ + $v) { + $_res[$k] = $v; + } + + return $_res; + } + + /** + * Save values for a set of keys to cache + * + * @param array $keys list of values to save + * @param int $expire expiration time + * + * @return boolean true on success, false on failure + */ + protected function write(array $keys, $expire = null) + { + foreach ($keys as $k => $v) { + apc_store($k, $v, $expire); + } + + return true; + } + + /** + * Remove values from cache + * + * @param array $keys list of keys to delete + * + * @return boolean true on success, false on failure + */ + protected function delete(array $keys) + { + foreach ($keys as $k) { + apc_delete($k); + } + + return true; + } + + /** + * Remove *all* values from cache + * + * @return boolean true on success, false on failure + */ + protected function purge() + { + return apc_clear_cache('user'); + } +} diff --git a/lib/smarty_3/demo/plugins/cacheresource.memcache.php b/lib/smarty_3/demo/plugins/cacheresource.memcache.php new file mode 100755 index 0000000..15a93f3 --- /dev/null +++ b/lib/smarty_3/demo/plugins/cacheresource.memcache.php @@ -0,0 +1,97 @@ +memcache = new Memcache(); + $this->memcache->addServer('127.0.0.1', 11211); + } + + /** + * Read values for a set of keys from cache + * + * @param array $keys list of keys to fetch + * + * @return array list of values with the given keys used as indexes + * @return boolean true on success, false on failure + */ + protected function read(array $keys) + { + $_keys = $lookup = array(); + foreach ($keys as $k) { + $_k = sha1($k); + $_keys[] = $_k; + $lookup[$_k] = $k; + } + $_res = array(); + $res = $this->memcache->get($_keys); + foreach ($res as $k => $v) { + $_res[$lookup[$k]] = $v; + } + + return $_res; + } + + /** + * Save values for a set of keys to cache + * + * @param array $keys list of values to save + * @param int $expire expiration time + * + * @return boolean true on success, false on failure + */ + protected function write(array $keys, $expire = null) + { + foreach ($keys as $k => $v) { + $k = sha1($k); + $this->memcache->set($k, $v, 0, $expire); + } + + return true; + } + + /** + * Remove values from cache + * + * @param array $keys list of keys to delete + * + * @return boolean true on success, false on failure + */ + protected function delete(array $keys) + { + foreach ($keys as $k) { + $k = sha1($k); + $this->memcache->delete($k); + } + + return true; + } + + /** + * Remove *all* values from cache + * + * @return boolean true on success, false on failure + */ + protected function purge() + { + $this->memcache->flush(); + } +} diff --git a/lib/smarty_3/demo/plugins/cacheresource.mysql.php b/lib/smarty_3/demo/plugins/cacheresource.mysql.php new file mode 100755 index 0000000..f54620d --- /dev/null +++ b/lib/smarty_3/demo/plugins/cacheresource.mysql.php @@ -0,0 +1,162 @@ +CREATE TABLE IF NOT EXISTS `output_cache` ( + * `id` CHAR(40) NOT NULL COMMENT 'sha1 hash', + * `name` VARCHAR(250) NOT NULL, + * `cache_id` VARCHAR(250) NULL DEFAULT NULL, + * `compile_id` VARCHAR(250) NULL DEFAULT NULL, + * `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + * `content` LONGTEXT NOT NULL, + * PRIMARY KEY (`id`), + * INDEX(`name`), + * INDEX(`cache_id`), + * INDEX(`compile_id`), + * INDEX(`modified`) + * ) ENGINE = InnoDB;
+ * + * @package CacheResource-examples + * @author Rodney Rehm + */ +class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom +{ + // PDO instance + protected $db; + protected $fetch; + protected $fetchTimestamp; + protected $save; + + public function __construct() + { + try { + $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); + } + catch (PDOException $e) { + throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); + } + $this->fetch = $this->db->prepare('SELECT modified, content FROM output_cache WHERE id = :id'); + $this->fetchTimestamp = $this->db->prepare('SELECT modified FROM output_cache WHERE id = :id'); + $this->save = $this->db->prepare('REPLACE INTO output_cache (id, name, cache_id, compile_id, content) + VALUES (:id, :name, :cache_id, :compile_id, :content)'); + } + + /** + * fetch cached content and its modification time from data source + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $content cached content + * @param integer $mtime cache modification timestamp (epoch) + * + * @return void + */ + protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime) + { + $this->fetch->execute(array('id' => $id)); + $row = $this->fetch->fetch(); + $this->fetch->closeCursor(); + if ($row) { + $content = $row['content']; + $mtime = strtotime($row['modified']); + } else { + $content = null; + $mtime = null; + } + } + + /** + * Fetch cached content's modification timestamp from data source + * + * @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the complete cached content. + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * + * @return integer|boolean timestamp (epoch) the template was modified, or false if not found + */ + protected function fetchTimestamp($id, $name, $cache_id, $compile_id) + { + $this->fetchTimestamp->execute(array('id' => $id)); + $mtime = strtotime($this->fetchTimestamp->fetchColumn()); + $this->fetchTimestamp->closeCursor(); + + return $mtime; + } + + /** + * Save content to cache + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration time in seconds or null + * @param string $content content to cache + * + * @return boolean success + */ + protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content) + { + $this->save->execute(array( + 'id' => $id, + 'name' => $name, + 'cache_id' => $cache_id, + 'compile_id' => $compile_id, + 'content' => $content, + )); + + return !!$this->save->rowCount(); + } + + /** + * Delete content from cache + * + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration or null + * + * @return integer number of deleted caches + */ + protected function delete($name, $cache_id, $compile_id, $exp_time) + { + // delete the whole cache + if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) { + // returning the number of deleted caches would require a second query to count them + $query = $this->db->query('TRUNCATE TABLE output_cache'); + + return - 1; + } + // build the filter + $where = array(); + // equal test name + if ($name !== null) { + $where[] = 'name = ' . $this->db->quote($name); + } + // equal test compile_id + if ($compile_id !== null) { + $where[] = 'compile_id = ' . $this->db->quote($compile_id); + } + // range test expiration time + if ($exp_time !== null) { + $where[] = 'modified < DATE_SUB(NOW(), INTERVAL ' . intval($exp_time) . ' SECOND)'; + } + // equal test cache_id and match sub-groups + if ($cache_id !== null) { + $where[] = '(cache_id = ' . $this->db->quote($cache_id) + . ' OR cache_id LIKE ' . $this->db->quote($cache_id . '|%') . ')'; + } + // run delete query + $query = $this->db->query('DELETE FROM output_cache WHERE ' . join(' AND ', $where)); + + return $query->rowCount(); + } +} diff --git a/lib/smarty_3/demo/plugins/resource.extendsall.php b/lib/smarty_3/demo/plugins/resource.extendsall.php new file mode 100755 index 0000000..a1e4219 --- /dev/null +++ b/lib/smarty_3/demo/plugins/resource.extendsall.php @@ -0,0 +1,60 @@ +smarty->getTemplateDir() as $key => $directory) { + try { + $s = Smarty_Resource::source(null, $source->smarty, '[' . $key . ']' . $source->name); + if (!$s->exists) { + continue; + } + $sources[$s->uid] = $s; + $uid .= $s->filepath; + } + catch (SmartyException $e) { + } + } + + if (!$sources) { + $source->exists = false; + $source->template = $_template; + + return; + } + + $sources = array_reverse($sources, true); + reset($sources); + $s = current($sources); + + $source->components = $sources; + $source->filepath = $s->filepath; + $source->uid = sha1($uid); + $source->exists = $exists; + if ($_template && $_template->smarty->compile_check) { + $source->timestamp = $s->timestamp; + } + // need the template at getContent() + $source->template = $_template; + } +} diff --git a/lib/smarty_3/demo/plugins/resource.mysql.php b/lib/smarty_3/demo/plugins/resource.mysql.php new file mode 100755 index 0000000..a2ea2f2 --- /dev/null +++ b/lib/smarty_3/demo/plugins/resource.mysql.php @@ -0,0 +1,81 @@ +CREATE TABLE IF NOT EXISTS `templates` ( + * `name` varchar(100) NOT NULL, + * `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + * `source` text, + * PRIMARY KEY (`name`) + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ * Demo data: + *
INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');
+ * + * @package Resource-examples + * @author Rodney Rehm + */ +class Smarty_Resource_Mysql extends Smarty_Resource_Custom +{ + // PDO instance + protected $db; + // prepared fetch() statement + protected $fetch; + // prepared fetchTimestamp() statement + protected $mtime; + + public function __construct() + { + try { + $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); + } + catch (PDOException $e) { + throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); + } + $this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name'); + $this->mtime = $this->db->prepare('SELECT modified FROM templates WHERE name = :name'); + } + + /** + * Fetch a template and its modification time from database + * + * @param string $name template name + * @param string $source template source + * @param integer $mtime template modification timestamp (epoch) + * + * @return void + */ + protected function fetch($name, &$source, &$mtime) + { + $this->fetch->execute(array('name' => $name)); + $row = $this->fetch->fetch(); + $this->fetch->closeCursor(); + if ($row) { + $source = $row['source']; + $mtime = strtotime($row['modified']); + } else { + $source = null; + $mtime = null; + } + } + + /** + * Fetch a template's modification time from database + * + * @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the comple template source. + * + * @param string $name template name + * + * @return integer timestamp (epoch) the template was modified + */ + protected function fetchTimestamp($name) + { + $this->mtime->execute(array('name' => $name)); + $mtime = $this->mtime->fetchColumn(); + $this->mtime->closeCursor(); + + return strtotime($mtime); + } +} diff --git a/lib/smarty_3/demo/plugins/resource.mysqls.php b/lib/smarty_3/demo/plugins/resource.mysqls.php new file mode 100755 index 0000000..48df408 --- /dev/null +++ b/lib/smarty_3/demo/plugins/resource.mysqls.php @@ -0,0 +1,62 @@ +CREATE TABLE IF NOT EXISTS `templates` ( + * `name` varchar(100) NOT NULL, + * `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + * `source` text, + * PRIMARY KEY (`name`) + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ * Demo data: + *
INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');
+ * + * @package Resource-examples + * @author Rodney Rehm + */ +class Smarty_Resource_Mysqls extends Smarty_Resource_Custom +{ + // PDO instance + protected $db; + // prepared fetch() statement + protected $fetch; + + public function __construct() + { + try { + $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); + } + catch (PDOException $e) { + throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); + } + $this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name'); + } + + /** + * Fetch a template and its modification time from database + * + * @param string $name template name + * @param string $source template source + * @param integer $mtime template modification timestamp (epoch) + * + * @return void + */ + protected function fetch($name, &$source, &$mtime) + { + $this->fetch->execute(array('name' => $name)); + $row = $this->fetch->fetch(); + $this->fetch->closeCursor(); + if ($row) { + $source = $row['source']; + $mtime = strtotime($row['modified']); + } else { + $source = null; + $mtime = null; + } + } +} diff --git a/lib/smarty_3/demo/templates/footer.tpl b/lib/smarty_3/demo/templates/footer.tpl new file mode 100755 index 0000000..c9e0d2e --- /dev/null +++ b/lib/smarty_3/demo/templates/footer.tpl @@ -0,0 +1,2 @@ + + diff --git a/lib/smarty_3/demo/templates/header.tpl b/lib/smarty_3/demo/templates/header.tpl new file mode 100755 index 0000000..f697233 --- /dev/null +++ b/lib/smarty_3/demo/templates/header.tpl @@ -0,0 +1,5 @@ + + + {$title} - {$Name} + + diff --git a/lib/smarty_3/demo/templates/index.tpl b/lib/smarty_3/demo/templates/index.tpl new file mode 100755 index 0000000..e25aabd --- /dev/null +++ b/lib/smarty_3/demo/templates/index.tpl @@ -0,0 +1,87 @@ +{config_load file="test.conf" section="setup"} +{include file="header.tpl" title=foo} + +
+
+{* bold and title are read from the config file *}
+    {if #bold#}{/if}
+        {* capitalize the first letters of each word of the title *}
+        Title: {#title#|capitalize}
+        {if #bold#}{/if}
+
+    The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
+
+    The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
+
+    Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
+
+    The value of {ldelim}$Name{rdelim} is {$Name}
+
+variable modifier example of {ldelim}$Name|upper{rdelim}
+
+{$Name|upper}
+
+
+An example of a section loop:
+
+    {section name=outer
+    loop=$FirstName}
+        {if $smarty.section.outer.index is odd by 2}
+            {$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
+        {else}
+            {$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
+        {/if}
+        {sectionelse}
+        none
+    {/section}
+
+    An example of section looped key values:
+
+    {section name=sec1 loop=$contacts}
+        phone: {$contacts[sec1].phone}
+        
+ + fax: {$contacts[sec1].fax} +
+ + cell: {$contacts[sec1].cell} +
+ {/section} +

+ + testing strip tags + {strip} + + + + +
+ + This is a test + +
+ {/strip} + +

+ +This is an example of the html_select_date function: + +
+ {html_select_date start_year=1998 end_year=2010} +
+ +This is an example of the html_select_time function: + +
+ {html_select_time use_24_hours=false} +
+ +This is an example of the html_options function: + +
+ +
+ +{include file="footer.tpl"} diff --git a/lib/smarty_3/libs/Smarty.class.php b/lib/smarty_3/libs/Smarty.class.php new file mode 100755 index 0000000..7f29a6e --- /dev/null +++ b/lib/smarty_3/libs/Smarty.class.php @@ -0,0 +1,1674 @@ + + * @author Uwe Tews + * @author Rodney Rehm + * @package Smarty + * @version 3.1.19 + */ + +/** + * define shorthand directory separator constant + */ +if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); +} + +/** + * set SMARTY_DIR to absolute path to Smarty library files. + * Sets SMARTY_DIR only if user application has not already defined it. + */ +if (!defined('SMARTY_DIR')) { + define('SMARTY_DIR', dirname(__FILE__) . DS); +} + +/** + * set SMARTY_SYSPLUGINS_DIR to absolute path to Smarty internal plugins. + * Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it. + */ +if (!defined('SMARTY_SYSPLUGINS_DIR')) { + define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DS); +} +if (!defined('SMARTY_PLUGINS_DIR')) { + define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DS); +} +if (!defined('SMARTY_MBSTRING')) { + define('SMARTY_MBSTRING', function_exists('mb_split')); +} +if (!defined('SMARTY_RESOURCE_CHAR_SET')) { + // UTF-8 can only be done properly when mbstring is available! + /** + * @deprecated in favor of Smarty::$_CHARSET + */ + define('SMARTY_RESOURCE_CHAR_SET', SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1'); +} +if (!defined('SMARTY_RESOURCE_DATE_FORMAT')) { + /** + * @deprecated in favor of Smarty::$_DATE_FORMAT + */ + define('SMARTY_RESOURCE_DATE_FORMAT', '%b %e, %Y'); +} + +/** + * register the class autoloader + */ +if (!defined('SMARTY_SPL_AUTOLOAD')) { + define('SMARTY_SPL_AUTOLOAD', 0); +} + +if (SMARTY_SPL_AUTOLOAD && set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false) { + $registeredAutoLoadFunctions = spl_autoload_functions(); + if (!isset($registeredAutoLoadFunctions['spl_autoload'])) { + spl_autoload_register(); + } +} else { + spl_autoload_register('smartyAutoload'); +} + +/** + * Load always needed external class files + */ +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_resource_file.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_cacheresource_file.php'; + +/** + * This is the main Smarty class + * + * @package Smarty + */ +class Smarty extends Smarty_Internal_TemplateBase +{ + /**#@+ + * constant definitions + */ + + /** + * smarty version + */ + const SMARTY_VERSION = 'Smarty-3.1.19'; + + /** + * define variable scopes + */ + const SCOPE_LOCAL = 0; + const SCOPE_PARENT = 1; + const SCOPE_ROOT = 2; + const SCOPE_GLOBAL = 3; + /** + * define caching modes + */ + const CACHING_OFF = 0; + const CACHING_LIFETIME_CURRENT = 1; + const CACHING_LIFETIME_SAVED = 2; + /** + * define constant for clearing cache files be saved expiration datees + */ + const CLEAR_EXPIRED = - 1; + + /** + * define compile check modes + */ + const COMPILECHECK_OFF = 0; + const COMPILECHECK_ON = 1; + const COMPILECHECK_CACHEMISS = 2; + /** + * modes for handling of "" tags in templates. + */ + const PHP_PASSTHRU = 0; //-> print tags as plain text + const PHP_QUOTE = 1; //-> escape tags as entities + const PHP_REMOVE = 2; //-> escape tags as entities + const PHP_ALLOW = 3; //-> escape tags as entities + /** + * filter types + */ + const FILTER_POST = 'post'; + const FILTER_PRE = 'pre'; + const FILTER_OUTPUT = 'output'; + const FILTER_VARIABLE = 'variable'; + /** + * plugin types + */ + const PLUGIN_FUNCTION = 'function'; + const PLUGIN_BLOCK = 'block'; + const PLUGIN_COMPILER = 'compiler'; + const PLUGIN_MODIFIER = 'modifier'; + const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler'; + + /**#@-*/ + + /** + * assigned global tpl vars + */ + public static $global_tpl_vars = array(); + + /** + * error handler returned by set_error_hanlder() in Smarty::muteExpectedErrors() + */ + public static $_previous_error_handler = null; + /** + * contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors() + */ + public static $_muted_directories = array(); + /** + * Flag denoting if Multibyte String functions are available + */ + public static $_MBSTRING = SMARTY_MBSTRING; + /** + * The character set to adhere to (e.g. "UTF-8") + */ + public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET; + /** + * The date format to be used internally + * (accepts date() and strftime()) + */ + public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT; + /** + * Flag denoting if PCRE should run in UTF-8 mode + */ + public static $_UTF8_MODIFIER = 'u'; + + /** + * Flag denoting if operating system is windows + */ + public static $_IS_WINDOWS = false; + + /**#@+ + * variables + */ + + /** + * auto literal on delimiters with whitspace + * + * @var boolean + */ + public $auto_literal = true; + /** + * display error on not assigned variables + * + * @var boolean + */ + public $error_unassigned = false; + /** + * look up relative filepaths in include_path + * + * @var boolean + */ + public $use_include_path = false; + /** + * template directory + * + * @var array + */ + private $template_dir = array(); + /** + * joined template directory string used in cache keys + * + * @var string + */ + public $joined_template_dir = null; + /** + * joined config directory string used in cache keys + * + * @var string + */ + public $joined_config_dir = null; + /** + * default template handler + * + * @var callable + */ + public $default_template_handler_func = null; + /** + * default config handler + * + * @var callable + */ + public $default_config_handler_func = null; + /** + * default plugin handler + * + * @var callable + */ + public $default_plugin_handler_func = null; + /** + * compile directory + * + * @var string + */ + private $compile_dir = null; + /** + * plugins directory + * + * @var array + */ + private $plugins_dir = array(); + /** + * cache directory + * + * @var string + */ + private $cache_dir = null; + /** + * config directory + * + * @var array + */ + private $config_dir = array(); + /** + * force template compiling? + * + * @var boolean + */ + public $force_compile = false; + /** + * check template for modifications? + * + * @var boolean + */ + public $compile_check = true; + /** + * use sub dirs for compiled/cached files? + * + * @var boolean + */ + public $use_sub_dirs = false; + /** + * allow ambiguous resources (that are made unique by the resource handler) + * + * @var boolean + */ + public $allow_ambiguous_resources = false; + /** + * caching enabled + * + * @var boolean + */ + public $caching = false; + /** + * merge compiled includes + * + * @var boolean + */ + public $merge_compiled_includes = false; + /** + * template inheritance merge compiled includes + * + * @var boolean + */ + public $inheritance_merge_compiled_includes = true; + /** + * cache lifetime in seconds + * + * @var integer + */ + public $cache_lifetime = 3600; + /** + * force cache file creation + * + * @var boolean + */ + public $force_cache = false; + /** + * Set this if you want different sets of cache files for the same + * templates. + * + * @var string + */ + public $cache_id = null; + /** + * Set this if you want different sets of compiled files for the same + * templates. + * + * @var string + */ + public $compile_id = null; + /** + * template left-delimiter + * + * @var string + */ + public $left_delimiter = "{"; + /** + * template right-delimiter + * + * @var string + */ + public $right_delimiter = "}"; + /**#@+ + * security + */ + /** + * class name + * This should be instance of Smarty_Security. + * + * @var string + * @see Smarty_Security + */ + public $security_class = 'Smarty_Security'; + /** + * implementation of security class + * + * @var Smarty_Security + */ + public $security_policy = null; + /** + * controls handling of PHP-blocks + * + * @var integer + */ + public $php_handling = self::PHP_PASSTHRU; + /** + * controls if the php template file resource is allowed + * + * @var bool + */ + public $allow_php_templates = false; + /** + * Should compiled-templates be prevented from being called directly? + * {@internal + * Currently used by Smarty_Internal_Template only. + * }} + * + * @var boolean + */ + public $direct_access_security = true; + /**#@-*/ + /** + * debug mode + * Setting this to true enables the debug-console. + * + * @var boolean + */ + public $debugging = false; + /** + * This determines if debugging is enable-able from the browser. + *
    + *
  • NONE => no debugging control allowed
  • + *
  • URL => enable debugging when SMARTY_DEBUG is found in the URL.
  • + *
+ * + * @var string + */ + public $debugging_ctrl = 'NONE'; + /** + * Name of debugging URL-param. + * Only used when $debugging_ctrl is set to 'URL'. + * The name of the URL-parameter that activates debugging. + * + * @var type + */ + public $smarty_debug_id = 'SMARTY_DEBUG'; + /** + * Path of debug template. + * + * @var string + */ + public $debug_tpl = null; + /** + * When set, smarty uses this value as error_reporting-level. + * + * @var int + */ + public $error_reporting = null; + /** + * Internal flag for getTags() + * + * @var boolean + */ + public $get_used_tags = false; + + /**#@+ + * config var settings + */ + + /** + * Controls whether variables with the same name overwrite each other. + * + * @var boolean + */ + public $config_overwrite = true; + /** + * Controls whether config values of on/true/yes and off/false/no get converted to boolean. + * + * @var boolean + */ + public $config_booleanize = true; + /** + * Controls whether hidden config sections/vars are read from the file. + * + * @var boolean + */ + public $config_read_hidden = false; + + /**#@-*/ + + /**#@+ + * resource locking + */ + + /** + * locking concurrent compiles + * + * @var boolean + */ + public $compile_locking = true; + /** + * Controls whether cache resources should emply locking mechanism + * + * @var boolean + */ + public $cache_locking = false; + /** + * seconds to wait for acquiring a lock before ignoring the write lock + * + * @var float + */ + public $locking_timeout = 10; + + /**#@-*/ + + /** + * global template functions + * + * @var array + */ + public $template_functions = array(); + /** + * resource type used if none given + * Must be an valid key of $registered_resources. + * + * @var string + */ + public $default_resource_type = 'file'; + /** + * caching type + * Must be an element of $cache_resource_types. + * + * @var string + */ + public $caching_type = 'file'; + /** + * internal config properties + * + * @var array + */ + public $properties = array(); + /** + * config type + * + * @var string + */ + public $default_config_type = 'file'; + /** + * cached template objects + * + * @var array + */ + public $template_objects = array(); + /** + * check If-Modified-Since headers + * + * @var boolean + */ + public $cache_modified_check = false; + /** + * registered plugins + * + * @var array + */ + public $registered_plugins = array(); + /** + * plugin search order + * + * @var array + */ + public $plugin_search_order = array('function', 'block', 'compiler', 'class'); + /** + * registered objects + * + * @var array + */ + public $registered_objects = array(); + /** + * registered classes + * + * @var array + */ + public $registered_classes = array(); + /** + * registered filters + * + * @var array + */ + public $registered_filters = array(); + /** + * registered resources + * + * @var array + */ + public $registered_resources = array(); + /** + * resource handler cache + * + * @var array + */ + public $_resource_handlers = array(); + /** + * registered cache resources + * + * @var array + */ + public $registered_cache_resources = array(); + /** + * cache resource handler cache + * + * @var array + */ + public $_cacheresource_handlers = array(); + /** + * autoload filter + * + * @var array + */ + public $autoload_filters = array(); + /** + * default modifier + * + * @var array + */ + public $default_modifiers = array(); + /** + * autoescape variable output + * + * @var boolean + */ + public $escape_html = false; + /** + * global internal smarty vars + * + * @var array + */ + public static $_smarty_vars = array(); + /** + * start time for execution time calculation + * + * @var int + */ + public $start_time = 0; + /** + * default file permissions + * + * @var int + */ + public $_file_perms = 0644; + /** + * default dir permissions + * + * @var int + */ + public $_dir_perms = 0771; + /** + * block tag hierarchy + * + * @var array + */ + public $_tag_stack = array(); + /** + * self pointer to Smarty object + * + * @var Smarty + */ + public $smarty; + /** + * required by the compiler for BC + * + * @var string + */ + public $_current_file = null; + /** + * internal flag to enable parser debugging + * + * @var bool + */ + public $_parserdebug = false; + /** + * Saved parameter of merged templates during compilation + * + * @var array + */ + public $merged_templates_func = array(); + /**#@-*/ + + /** + * Initialize new Smarty object + + */ + public function __construct() + { + // selfpointer needed by some other class methods + $this->smarty = $this; + if (is_callable('mb_internal_encoding')) { + mb_internal_encoding(Smarty::$_CHARSET); + } + $this->start_time = microtime(true); + // set default dirs + $this->setTemplateDir('.' . DS . 'templates' . DS) + ->setCompileDir('.' . DS . 'templates_c' . DS) + ->setPluginsDir(SMARTY_PLUGINS_DIR) + ->setCacheDir('.' . DS . 'cache' . DS) + ->setConfigDir('.' . DS . 'configs' . DS); + + $this->debug_tpl = 'file:' . dirname(__FILE__) . '/debug.tpl'; + if (isset($_SERVER['SCRIPT_NAME'])) { + $this->assignGlobal('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']); + } + } + + /** + * Class destructor + */ + public function __destruct() + { + // intentionally left blank + } + + /** + * <> set selfpointer on cloned object + */ + public function __clone() + { + $this->smarty = $this; + } + + /** + * <> Generic getter. + * Calls the appropriate getter function. + * Issues an E_USER_NOTICE if no valid getter is found. + * + * @param string $name property name + * + * @return mixed + */ + public function __get($name) + { + $allowed = array( + 'template_dir' => 'getTemplateDir', + 'config_dir' => 'getConfigDir', + 'plugins_dir' => 'getPluginsDir', + 'compile_dir' => 'getCompileDir', + 'cache_dir' => 'getCacheDir', + ); + + if (isset($allowed[$name])) { + return $this->{$allowed[$name]}(); + } else { + trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); + } + } + + /** + * <> Generic setter. + * Calls the appropriate setter function. + * Issues an E_USER_NOTICE if no valid setter is found. + * + * @param string $name property name + * @param mixed $value parameter passed to setter + */ + public function __set($name, $value) + { + $allowed = array( + 'template_dir' => 'setTemplateDir', + 'config_dir' => 'setConfigDir', + 'plugins_dir' => 'setPluginsDir', + 'compile_dir' => 'setCompileDir', + 'cache_dir' => 'setCacheDir', + ); + + if (isset($allowed[$name])) { + $this->{$allowed[$name]}($value); + } else { + trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); + } + } + + /** + * Check if a template resource exists + * + * @param string $resource_name template name + * + * @return boolean status + */ + public function templateExists($resource_name) + { + // create template object + $save = $this->template_objects; + $tpl = new $this->template_class($resource_name, $this); + // check if it does exists + $result = $tpl->source->exists; + $this->template_objects = $save; + + return $result; + } + + /** + * Returns a single or all global variables + * + * @param string $varname variable name or null + * + * @return string variable value or or array of variables + */ + public function getGlobal($varname = null) + { + if (isset($varname)) { + if (isset(self::$global_tpl_vars[$varname])) { + return self::$global_tpl_vars[$varname]->value; + } else { + return ''; + } + } else { + $_result = array(); + foreach (self::$global_tpl_vars AS $key => $var) { + $_result[$key] = $var->value; + } + + return $_result; + } + } + + /** + * Empty cache folder + * + * @param integer $exp_time expiration time + * @param string $type resource type + * + * @return integer number of cache files deleted + */ + public function clearAllCache($exp_time = null, $type = null) + { + // load cache resource and call clearAll + $_cache_resource = Smarty_CacheResource::load($this, $type); + Smarty_CacheResource::invalidLoadedCache($this); + + return $_cache_resource->clearAll($this, $exp_time); + } + + /** + * Empty cache for a specific template + * + * @param string $template_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time + * @param string $type resource type + * + * @return integer number of cache files deleted + */ + public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null) + { + // load cache resource and call clear + $_cache_resource = Smarty_CacheResource::load($this, $type); + Smarty_CacheResource::invalidLoadedCache($this); + + return $_cache_resource->clear($this, $template_name, $cache_id, $compile_id, $exp_time); + } + + /** + * Loads security class and enables security + * + * @param string|Smarty_Security $security_class if a string is used, it must be class-name + * + * @return Smarty current Smarty instance for chaining + * @throws SmartyException when an invalid class name is provided + */ + public function enableSecurity($security_class = null) + { + if ($security_class instanceof Smarty_Security) { + $this->security_policy = $security_class; + + return $this; + } elseif (is_object($security_class)) { + throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security."); + } + if ($security_class == null) { + $security_class = $this->security_class; + } + if (!class_exists($security_class)) { + throw new SmartyException("Security class '$security_class' is not defined"); + } elseif ($security_class !== 'Smarty_Security' && !is_subclass_of($security_class, 'Smarty_Security')) { + throw new SmartyException("Class '$security_class' must extend Smarty_Security."); + } else { + $this->security_policy = new $security_class($this); + } + + return $this; + } + + /** + * Disable security + * + * @return Smarty current Smarty instance for chaining + */ + public function disableSecurity() + { + $this->security_policy = null; + + return $this; + } + + /** + * Set template directory + * + * @param string|array $template_dir directory(s) of template sources + * + * @return Smarty current Smarty instance for chaining + */ + public function setTemplateDir($template_dir) + { + $this->template_dir = array(); + foreach ((array) $template_dir as $k => $v) { + $this->template_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; + } + + $this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir); + + return $this; + } + + /** + * Add template directory(s) + * + * @param string|array $template_dir directory(s) of template sources + * @param string $key of the array element to assign the template dir to + * + * @return Smarty current Smarty instance for chaining + * @throws SmartyException when the given template directory is not valid + */ + public function addTemplateDir($template_dir, $key = null) + { + // make sure we're dealing with an array + $this->template_dir = (array) $this->template_dir; + + if (is_array($template_dir)) { + foreach ($template_dir as $k => $v) { + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; + if (is_int($k)) { + // indexes are not merged but appended + $this->template_dir[] = $v; + } else { + // string indexes are overridden + $this->template_dir[$k] = $v; + } + } + } else { + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($template_dir, '/\\')) . DS; + if ($key !== null) { + // override directory at specified index + $this->template_dir[$key] = $v; + } else { + // append new directory + $this->template_dir[] = $v; + } + } + $this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir); + + return $this; + } + + /** + * Get template directories + * + * @param mixed $index index of directory to get, null to get all + * + * @return array|string list of template directories, or directory of $index + */ + public function getTemplateDir($index = null) + { + if ($index !== null) { + return isset($this->template_dir[$index]) ? $this->template_dir[$index] : null; + } + + return (array) $this->template_dir; + } + + /** + * Set config directory + * + * @param $config_dir + * + * @return Smarty current Smarty instance for chaining + */ + public function setConfigDir($config_dir) + { + $this->config_dir = array(); + foreach ((array) $config_dir as $k => $v) { + $this->config_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; + } + + $this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir); + + return $this; + } + + /** + * Add config directory(s) + * + * @param string|array $config_dir directory(s) of config sources + * @param mixed $key key of the array element to assign the config dir to + * + * @return Smarty current Smarty instance for chaining + */ + public function addConfigDir($config_dir, $key = null) + { + // make sure we're dealing with an array + $this->config_dir = (array) $this->config_dir; + + if (is_array($config_dir)) { + foreach ($config_dir as $k => $v) { + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; + if (is_int($k)) { + // indexes are not merged but appended + $this->config_dir[] = $v; + } else { + // string indexes are overridden + $this->config_dir[$k] = $v; + } + } + } else { + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($config_dir, '/\\')) . DS; + if ($key !== null) { + // override directory at specified index + $this->config_dir[$key] = rtrim($v, '/\\') . DS; + } else { + // append new directory + $this->config_dir[] = rtrim($v, '/\\') . DS; + } + } + + $this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir); + + return $this; + } + + /** + * Get config directory + * + * @param mixed $index index of directory to get, null to get all + * + * @return array|string configuration directory + */ + public function getConfigDir($index = null) + { + if ($index !== null) { + return isset($this->config_dir[$index]) ? $this->config_dir[$index] : null; + } + + return (array) $this->config_dir; + } + + /** + * Set plugins directory + * + * @param string|array $plugins_dir directory(s) of plugins + * + * @return Smarty current Smarty instance for chaining + */ + public function setPluginsDir($plugins_dir) + { + $this->plugins_dir = array(); + foreach ((array) $plugins_dir as $k => $v) { + $this->plugins_dir[$k] = rtrim($v, '/\\') . DS; + } + + return $this; + } + + /** + * Adds directory of plugin files + * + * @param $plugins_dir + * + * @return Smarty current Smarty instance for chaining + */ + public function addPluginsDir($plugins_dir) + { + // make sure we're dealing with an array + $this->plugins_dir = (array) $this->plugins_dir; + + if (is_array($plugins_dir)) { + foreach ($plugins_dir as $k => $v) { + if (is_int($k)) { + // indexes are not merged but appended + $this->plugins_dir[] = rtrim($v, '/\\') . DS; + } else { + // string indexes are overridden + $this->plugins_dir[$k] = rtrim($v, '/\\') . DS; + } + } + } else { + // append new directory + $this->plugins_dir[] = rtrim($plugins_dir, '/\\') . DS; + } + + $this->plugins_dir = array_unique($this->plugins_dir); + + return $this; + } + + /** + * Get plugin directories + * + * @return array list of plugin directories + */ + public function getPluginsDir() + { + return (array) $this->plugins_dir; + } + + /** + * Set compile directory + * + * @param string $compile_dir directory to store compiled templates in + * + * @return Smarty current Smarty instance for chaining + */ + public function setCompileDir($compile_dir) + { + $this->compile_dir = rtrim($compile_dir, '/\\') . DS; + if (!isset(Smarty::$_muted_directories[$this->compile_dir])) { + Smarty::$_muted_directories[$this->compile_dir] = null; + } + + return $this; + } + + /** + * Get compiled directory + * + * @return string path to compiled templates + */ + public function getCompileDir() + { + return $this->compile_dir; + } + + /** + * Set cache directory + * + * @param string $cache_dir directory to store cached templates in + * + * @return Smarty current Smarty instance for chaining + */ + public function setCacheDir($cache_dir) + { + $this->cache_dir = rtrim($cache_dir, '/\\') . DS; + if (!isset(Smarty::$_muted_directories[$this->cache_dir])) { + Smarty::$_muted_directories[$this->cache_dir] = null; + } + + return $this; + } + + /** + * Get cache directory + * + * @return string path of cache directory + */ + public function getCacheDir() + { + return $this->cache_dir; + } + + /** + * Set default modifiers + * + * @param array|string $modifiers modifier or list of modifiers to set + * + * @return Smarty current Smarty instance for chaining + */ + public function setDefaultModifiers($modifiers) + { + $this->default_modifiers = (array) $modifiers; + + return $this; + } + + /** + * Add default modifiers + * + * @param array|string $modifiers modifier or list of modifiers to add + * + * @return Smarty current Smarty instance for chaining + */ + public function addDefaultModifiers($modifiers) + { + if (is_array($modifiers)) { + $this->default_modifiers = array_merge($this->default_modifiers, $modifiers); + } else { + $this->default_modifiers[] = $modifiers; + } + + return $this; + } + + /** + * Get default modifiers + * + * @return array list of default modifiers + */ + public function getDefaultModifiers() + { + return $this->default_modifiers; + } + + /** + * Set autoload filters + * + * @param array $filters filters to load automatically + * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types + * + * @return Smarty current Smarty instance for chaining + */ + public function setAutoloadFilters($filters, $type = null) + { + if ($type !== null) { + $this->autoload_filters[$type] = (array) $filters; + } else { + $this->autoload_filters = (array) $filters; + } + + return $this; + } + + /** + * Add autoload filters + * + * @param array $filters filters to load automatically + * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types + * + * @return Smarty current Smarty instance for chaining + */ + public function addAutoloadFilters($filters, $type = null) + { + if ($type !== null) { + if (!empty($this->autoload_filters[$type])) { + $this->autoload_filters[$type] = array_merge($this->autoload_filters[$type], (array) $filters); + } else { + $this->autoload_filters[$type] = (array) $filters; + } + } else { + foreach ((array) $filters as $key => $value) { + if (!empty($this->autoload_filters[$key])) { + $this->autoload_filters[$key] = array_merge($this->autoload_filters[$key], (array) $value); + } else { + $this->autoload_filters[$key] = (array) $value; + } + } + } + + return $this; + } + + /** + * Get autoload filters + * + * @param string $type type of filter to get autoloads for. Defaults to all autoload filters + * + * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified + */ + public function getAutoloadFilters($type = null) + { + if ($type !== null) { + return isset($this->autoload_filters[$type]) ? $this->autoload_filters[$type] : array(); + } + + return $this->autoload_filters; + } + + /** + * return name of debugging template + * + * @return string + */ + public function getDebugTemplate() + { + return $this->debug_tpl; + } + + /** + * set the debug template + * + * @param string $tpl_name + * + * @return Smarty current Smarty instance for chaining + * @throws SmartyException if file is not readable + */ + public function setDebugTemplate($tpl_name) + { + if (!is_readable($tpl_name)) { + throw new SmartyException("Unknown file '{$tpl_name}'"); + } + $this->debug_tpl = $tpl_name; + + return $this; + } + + /** + * creates a template object + * + * @param string $template the resource handle of the template file + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * @param boolean $do_clone flag is Smarty object shall be cloned + * + * @return object template object + */ + public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true) + { + if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) { + $parent = $cache_id; + $cache_id = null; + } + if ($parent !== null && is_array($parent)) { + $data = $parent; + $parent = null; + } else { + $data = null; + } + // default to cache_id and compile_id of Smarty object + $cache_id = $cache_id === null ? $this->cache_id : $cache_id; + $compile_id = $compile_id === null ? $this->compile_id : $compile_id; + // already in template cache? + if ($this->allow_ambiguous_resources) { + $_templateId = Smarty_Resource::getUniqueTemplateName($this, $template) . $cache_id . $compile_id; + } else { + $_templateId = $this->joined_template_dir . '#' . $template . $cache_id . $compile_id; + } + if (isset($_templateId[150])) { + $_templateId = sha1($_templateId); + } + if ($do_clone) { + if (isset($this->template_objects[$_templateId])) { + // return cached template object + $tpl = clone $this->template_objects[$_templateId]; + $tpl->smarty = clone $tpl->smarty; + $tpl->parent = $parent; + $tpl->tpl_vars = array(); + $tpl->config_vars = array(); + } else { + $tpl = new $this->template_class($template, clone $this, $parent, $cache_id, $compile_id); + } + } else { + if (isset($this->template_objects[$_templateId])) { + // return cached template object + $tpl = $this->template_objects[$_templateId]; + $tpl->parent = $parent; + $tpl->tpl_vars = array(); + $tpl->config_vars = array(); + } else { + $tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id); + } + } + // fill data if present + if (!empty($data) && is_array($data)) { + // set up variable values + foreach ($data as $_key => $_val) { + $tpl->tpl_vars[$_key] = new Smarty_variable($_val); + } + } + + return $tpl; + } + + /** + * Takes unknown classes and loads plugin files for them + * class name format: Smarty_PluginType_PluginName + * plugin filename format: plugintype.pluginname.php + * + * @param string $plugin_name class plugin name to load + * @param bool $check check if already loaded + * + * @throws SmartyException + * @return string |boolean filepath of loaded file or false + */ + public function loadPlugin($plugin_name, $check = true) + { + // if function or class exists, exit silently (already loaded) + if ($check && (is_callable($plugin_name) || class_exists($plugin_name, false))) { + return true; + } + // Plugin name is expected to be: Smarty_[Type]_[Name] + $_name_parts = explode('_', $plugin_name, 3); + // class name must have three parts to be valid plugin + // count($_name_parts) < 3 === !isset($_name_parts[2]) + if (!isset($_name_parts[2]) || strtolower($_name_parts[0]) !== 'smarty') { + throw new SmartyException("plugin {$plugin_name} is not a valid name format"); + } + // if type is "internal", get plugin from sysplugins + if (strtolower($_name_parts[1]) == 'internal') { + $file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php'; + if (file_exists($file)) { + require_once($file); + + return $file; + } else { + return false; + } + } + // plugin filename is expected to be: [type].[name].php + $_plugin_filename = "{$_name_parts[1]}.{$_name_parts[2]}.php"; + + $_stream_resolve_include_path = function_exists('stream_resolve_include_path'); + + // loop through plugin dirs and find the plugin + foreach ($this->getPluginsDir() as $_plugin_dir) { + $names = array( + $_plugin_dir . $_plugin_filename, + $_plugin_dir . strtolower($_plugin_filename), + ); + foreach ($names as $file) { + if (file_exists($file)) { + require_once($file); + + return $file; + } + if ($this->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) { + // try PHP include_path + if ($_stream_resolve_include_path) { + $file = stream_resolve_include_path($file); + } else { + $file = Smarty_Internal_Get_Include_Path::getIncludePath($file); + } + + if ($file !== false) { + require_once($file); + + return $file; + } + } + } + } + // no plugin loaded + return false; + } + + /** + * Compile all template files + * + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors + * + * @return integer number of template files recompiled + */ + public function compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null) + { + return Smarty_Internal_Utility::compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, $this); + } + + /** + * Compile all config files + * + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors + * + * @return integer number of template files recompiled + */ + public function compileAllConfig($extension = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null) + { + return Smarty_Internal_Utility::compileAllConfig($extension, $force_compile, $time_limit, $max_errors, $this); + } + + /** + * Delete compiled template file + * + * @param string $resource_name template name + * @param string $compile_id compile id + * @param integer $exp_time expiration time + * + * @return integer number of template files deleted + */ + public function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null) + { + return Smarty_Internal_Utility::clearCompiledTemplate($resource_name, $compile_id, $exp_time, $this); + } + + /** + * Return array of tag/attributes of all tags used by an template + * + * @param Smarty_Internal_Template $template + * + * @return array of tag/attributes + */ + public function getTags(Smarty_Internal_Template $template) + { + return Smarty_Internal_Utility::getTags($template); + } + + /** + * Run installation test + * + * @param array $errors Array to write errors into, rather than outputting them + * + * @return boolean true if setup is fine, false if something is wrong + */ + public function testInstall(&$errors = null) + { + return Smarty_Internal_Utility::testInstall($this, $errors); + } + + /** + * Error Handler to mute expected messages + * + * @link http://php.net/set_error_handler + * + * @param integer $errno Error level + * @param $errstr + * @param $errfile + * @param $errline + * @param $errcontext + * + * @return boolean + */ + public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext) + { + $_is_muted_directory = false; + + // add the SMARTY_DIR to the list of muted directories + if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) { + $smarty_dir = realpath(SMARTY_DIR); + if ($smarty_dir !== false) { + Smarty::$_muted_directories[SMARTY_DIR] = array( + 'file' => $smarty_dir, + 'length' => strlen($smarty_dir), + ); + } + } + + // walk the muted directories and test against $errfile + foreach (Smarty::$_muted_directories as $key => &$dir) { + if (!$dir) { + // resolve directory and length for speedy comparisons + $file = realpath($key); + if ($file === false) { + // this directory does not exist, remove and skip it + unset(Smarty::$_muted_directories[$key]); + continue; + } + $dir = array( + 'file' => $file, + 'length' => strlen($file), + ); + } + if (!strncmp($errfile, $dir['file'], $dir['length'])) { + $_is_muted_directory = true; + break; + } + } + + // pass to next error handler if this error did not occur inside SMARTY_DIR + // or the error was within smarty but masked to be ignored + if (!$_is_muted_directory || ($errno && $errno & error_reporting())) { + if (Smarty::$_previous_error_handler) { + return call_user_func(Smarty::$_previous_error_handler, $errno, $errstr, $errfile, $errline, $errcontext); + } else { + return false; + } + } + } + + /** + * Enable error handler to mute expected messages + * + * @return void + */ + public static function muteExpectedErrors() + { + /* + error muting is done because some people implemented custom error_handlers using + http://php.net/set_error_handler and for some reason did not understand the following paragraph: + + It is important to remember that the standard PHP error handler is completely bypassed for the + error types specified by error_types unless the callback function returns FALSE. + error_reporting() settings will have no effect and your error handler will be called regardless - + however you are still able to read the current value of error_reporting and act appropriately. + Of particular note is that this value will be 0 if the statement that caused the error was + prepended by the @ error-control operator. + + Smarty deliberately uses @filemtime() over file_exists() and filemtime() in some places. Reasons include + - @filemtime() is almost twice as fast as using an additional file_exists() + - between file_exists() and filemtime() a possible race condition is opened, + which does not exist using the simple @filemtime() approach. + */ + $error_handler = array('Smarty', 'mutingErrorHandler'); + $previous = set_error_handler($error_handler); + + // avoid dead loops + if ($previous !== $error_handler) { + Smarty::$_previous_error_handler = $previous; + } + } + + /** + * Disable error handler muting expected messages + * + * @return void + */ + public static function unmuteExpectedErrors() + { + restore_error_handler(); + } +} + +// Check if we're running on windows +Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; + +// let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8 +if (Smarty::$_CHARSET !== 'UTF-8') { + Smarty::$_UTF8_MODIFIER = ''; +} + +/** + * Smarty exception class + * + * @package Smarty + */ +class SmartyException extends Exception +{ + public static $escape = false; + + public function __toString() + { + return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- '; + } +} + +/** + * Smarty compiler exception class + * + * @package Smarty + */ +class SmartyCompilerException extends SmartyException +{ + public function __toString() + { + return ' --> Smarty Compiler: ' . $this->message . ' <-- '; + } + + /** + * The line number of the template error + * + * @type int|null + */ + public $line = null; + /** + * The template source snippet relating to the error + * + * @type string|null + */ + public $source = null; + /** + * The raw text of the error message + * + * @type string|null + */ + public $desc = null; + /** + * The resource identifier or template name + * + * @type string|null + */ + public $template = null; +} + +/** + * Autoloader + */ +function smartyAutoload($class) +{ + $_class = strtolower($class); + static $_classes = array( + 'smarty_config_source' => true, + 'smarty_config_compiled' => true, + 'smarty_security' => true, + 'smarty_cacheresource' => true, + 'smarty_cacheresource_custom' => true, + 'smarty_cacheresource_keyvaluestore' => true, + 'smarty_resource' => true, + 'smarty_resource_custom' => true, + 'smarty_resource_uncompiled' => true, + 'smarty_resource_recompiled' => true, + ); + + if (!strncmp($_class, 'smarty_internal_', 16) || isset($_classes[$_class])) { + include SMARTY_SYSPLUGINS_DIR . $_class . '.php'; + } +} diff --git a/lib/smarty_3/libs/SmartyBC.class.php b/lib/smarty_3/libs/SmartyBC.class.php new file mode 100755 index 0000000..04977a3 --- /dev/null +++ b/lib/smarty_3/libs/SmartyBC.class.php @@ -0,0 +1,467 @@ + + * @author Uwe Tews + * @author Rodney Rehm + * @package Smarty + */ +/** + * @ignore + */ +require_once(dirname(__FILE__) . '/Smarty.class.php'); + +/** + * Smarty Backward Compatability Wrapper Class + * + * @package Smarty + */ +class SmartyBC extends Smarty +{ + /** + * Smarty 2 BC + * + * @var string + */ + public $_version = self::SMARTY_VERSION; + + /** + * Initialize new SmartyBC object + * + * @param array $options options to set during initialization, e.g. array( 'forceCompile' => false ) + */ + public function __construct(array $options = array()) + { + parent::__construct($options); + // register {php} tag + $this->registerPlugin('block', 'php', 'smarty_php_tag'); + } + + /** + * wrapper for assign_by_ref + * + * @param string $tpl_var the template variable name + * @param mixed &$value the referenced value to assign + */ + public function assign_by_ref($tpl_var, &$value) + { + $this->assignByRef($tpl_var, $value); + } + + /** + * wrapper for append_by_ref + * + * @param string $tpl_var the template variable name + * @param mixed &$value the referenced value to append + * @param boolean $merge flag if array elements shall be merged + */ + public function append_by_ref($tpl_var, &$value, $merge = false) + { + $this->appendByRef($tpl_var, $value, $merge); + } + + /** + * clear the given assigned template variable. + * + * @param string $tpl_var the template variable to clear + */ + public function clear_assign($tpl_var) + { + $this->clearAssign($tpl_var); + } + + /** + * Registers custom function to be used in templates + * + * @param string $function the name of the template function + * @param string $function_impl the name of the PHP function to register + * @param bool $cacheable + * @param mixed $cache_attrs + */ + public function register_function($function, $function_impl, $cacheable = true, $cache_attrs = null) + { + $this->registerPlugin('function', $function, $function_impl, $cacheable, $cache_attrs); + } + + /** + * Unregisters custom function + * + * @param string $function name of template function + */ + public function unregister_function($function) + { + $this->unregisterPlugin('function', $function); + } + + /** + * Registers object to be used in templates + * + * @param string $object name of template object + * @param object $object_impl the referenced PHP object to register + * @param array $allowed list of allowed methods (empty = all) + * @param boolean $smarty_args smarty argument format, else traditional + * @param array $block_methods list of methods that are block format + * + * @throws SmartyException + * @internal param array $block_functs list of methods that are block format + */ + public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) + { + settype($allowed, 'array'); + settype($smarty_args, 'boolean'); + $this->registerObject($object, $object_impl, $allowed, $smarty_args, $block_methods); + } + + /** + * Unregisters object + * + * @param string $object name of template object + */ + public function unregister_object($object) + { + $this->unregisterObject($object); + } + + /** + * Registers block function to be used in templates + * + * @param string $block name of template block + * @param string $block_impl PHP function to register + * @param bool $cacheable + * @param mixed $cache_attrs + */ + public function register_block($block, $block_impl, $cacheable = true, $cache_attrs = null) + { + $this->registerPlugin('block', $block, $block_impl, $cacheable, $cache_attrs); + } + + /** + * Unregisters block function + * + * @param string $block name of template function + */ + public function unregister_block($block) + { + $this->unregisterPlugin('block', $block); + } + + /** + * Registers compiler function + * + * @param string $function name of template function + * @param string $function_impl name of PHP function to register + * @param bool $cacheable + */ + public function register_compiler_function($function, $function_impl, $cacheable = true) + { + $this->registerPlugin('compiler', $function, $function_impl, $cacheable); + } + + /** + * Unregisters compiler function + * + * @param string $function name of template function + */ + public function unregister_compiler_function($function) + { + $this->unregisterPlugin('compiler', $function); + } + + /** + * Registers modifier to be used in templates + * + * @param string $modifier name of template modifier + * @param string $modifier_impl name of PHP function to register + */ + public function register_modifier($modifier, $modifier_impl) + { + $this->registerPlugin('modifier', $modifier, $modifier_impl); + } + + /** + * Unregisters modifier + * + * @param string $modifier name of template modifier + */ + public function unregister_modifier($modifier) + { + $this->unregisterPlugin('modifier', $modifier); + } + + /** + * Registers a resource to fetch a template + * + * @param string $type name of resource + * @param array $functions array of functions to handle resource + */ + public function register_resource($type, $functions) + { + $this->registerResource($type, $functions); + } + + /** + * Unregisters a resource + * + * @param string $type name of resource + */ + public function unregister_resource($type) + { + $this->unregisterResource($type); + } + + /** + * Registers a prefilter function to apply + * to a template before compiling + * + * @param callable $function + */ + public function register_prefilter($function) + { + $this->registerFilter('pre', $function); + } + + /** + * Unregisters a prefilter function + * + * @param callable $function + */ + public function unregister_prefilter($function) + { + $this->unregisterFilter('pre', $function); + } + + /** + * Registers a postfilter function to apply + * to a compiled template after compilation + * + * @param callable $function + */ + public function register_postfilter($function) + { + $this->registerFilter('post', $function); + } + + /** + * Unregisters a postfilter function + * + * @param callable $function + */ + public function unregister_postfilter($function) + { + $this->unregisterFilter('post', $function); + } + + /** + * Registers an output filter function to apply + * to a template output + * + * @param callable $function + */ + public function register_outputfilter($function) + { + $this->registerFilter('output', $function); + } + + /** + * Unregisters an outputfilter function + * + * @param callable $function + */ + public function unregister_outputfilter($function) + { + $this->unregisterFilter('output', $function); + } + + /** + * load a filter of specified type and name + * + * @param string $type filter type + * @param string $name filter name + */ + public function load_filter($type, $name) + { + $this->loadFilter($type, $name); + } + + /** + * clear cached content for the given template and cache id + * + * @param string $tpl_file name of template file + * @param string $cache_id name of cache_id + * @param string $compile_id name of compile_id + * @param string $exp_time expiration time + * + * @return boolean + */ + public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null) + { + return $this->clearCache($tpl_file, $cache_id, $compile_id, $exp_time); + } + + /** + * clear the entire contents of cache (all templates) + * + * @param string $exp_time expire time + * + * @return boolean + */ + public function clear_all_cache($exp_time = null) + { + return $this->clearCache(null, null, null, $exp_time); + } + + /** + * test to see if valid cache exists for this template + * + * @param string $tpl_file name of template file + * @param string $cache_id + * @param string $compile_id + * + * @return boolean + */ + public function is_cached($tpl_file, $cache_id = null, $compile_id = null) + { + return $this->isCached($tpl_file, $cache_id, $compile_id); + } + + /** + * clear all the assigned template variables. + */ + public function clear_all_assign() + { + $this->clearAllAssign(); + } + + /** + * clears compiled version of specified template resource, + * or all compiled template files if one is not specified. + * This function is for advanced use only, not normally needed. + * + * @param string $tpl_file + * @param string $compile_id + * @param string $exp_time + * + * @return boolean results of {@link smarty_core_rm_auto()} + */ + public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null) + { + return $this->clearCompiledTemplate($tpl_file, $compile_id, $exp_time); + } + + /** + * Checks whether requested template exists. + * + * @param string $tpl_file + * + * @return boolean + */ + public function template_exists($tpl_file) + { + return $this->templateExists($tpl_file); + } + + /** + * Returns an array containing template variables + * + * @param string $name + * + * @return array + */ + public function get_template_vars($name = null) + { + return $this->getTemplateVars($name); + } + + /** + * Returns an array containing config variables + * + * @param string $name + * + * @return array + */ + public function get_config_vars($name = null) + { + return $this->getConfigVars($name); + } + + /** + * load configuration values + * + * @param string $file + * @param string $section + * @param string $scope + */ + public function config_load($file, $section = null, $scope = 'global') + { + $this->ConfigLoad($file, $section, $scope); + } + + /** + * return a reference to a registered object + * + * @param string $name + * + * @return object + */ + public function get_registered_object($name) + { + return $this->getRegisteredObject($name); + } + + /** + * clear configuration values + * + * @param string $var + */ + public function clear_config($var = null) + { + $this->clearConfig($var); + } + + /** + * trigger Smarty error + * + * @param string $error_msg + * @param integer $error_type + */ + public function trigger_error($error_msg, $error_type = E_USER_WARNING) + { + trigger_error("Smarty error: $error_msg", $error_type); + } +} + +/** + * Smarty {php}{/php} block function + * + * @param array $params parameter list + * @param string $content contents of the block + * @param object $template template object + * @param boolean &$repeat repeat flag + * + * @return string content re-formatted + */ +function smarty_php_tag($params, $content, $template, &$repeat) +{ + eval($content); + + return ''; +} diff --git a/lib/smarty_3/libs/debug.tpl b/lib/smarty_3/libs/debug.tpl new file mode 100755 index 0000000..64b192c --- /dev/null +++ b/lib/smarty_3/libs/debug.tpl @@ -0,0 +1,137 @@ +{capture name='_smarty_debug' assign=debug_output} + + + + Smarty Debug Console + + + + +

Smarty Debug Console + - {if isset($template_name)}{$template_name|debug_print_var nofilter}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}

+ + {if !empty($template_data)} +

included templates & config files (load time in seconds)

+
+ {foreach $template_data as $template} + {$template.name} + + (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"} + ) + +
+ {/foreach} +
+ {/if} + +

assigned template variables

+ + + {foreach $assigned_vars as $vars} + + + + + {/foreach} +
${$vars@key|escape:'html'}{$vars|debug_print_var nofilter}
+ +

assigned config file variables (outer template scope)

+ + + {foreach $config_vars as $vars} + + + + + {/foreach} + +
{$vars@key|escape:'html'}{$vars|debug_print_var nofilter}
+ + +{/capture} + diff --git a/lib/smarty_3/libs/plugins/block.textformat.php b/lib/smarty_3/libs/plugins/block.textformat.php new file mode 100755 index 0000000..2d30a82 --- /dev/null +++ b/lib/smarty_3/libs/plugins/block.textformat.php @@ -0,0 +1,110 @@ + + * Name: textformat
+ * Purpose: format text a certain way with preset styles + * or custom wrap/indent settings
+ * Params: + *
+ * - style         - string (email)
+ * - indent        - integer (0)
+ * - wrap          - integer (80)
+ * - wrap_char     - string ("\n")
+ * - indent_char   - string (" ")
+ * - wrap_boundary - boolean (true)
+ * 
+ * + * @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat} + * (Smarty online manual) + * + * @param array $params parameters + * @param string $content contents of the block + * @param Smarty_Internal_Template $template template object + * @param boolean &$repeat repeat flag + * + * @return string content re-formatted + * @author Monte Ohrt + */ +function smarty_block_textformat($params, $content, $template, &$repeat) +{ + if (is_null($content)) { + return; + } + + $style = null; + $indent = 0; + $indent_first = 0; + $indent_char = ' '; + $wrap = 80; + $wrap_char = "\n"; + $wrap_cut = false; + $assign = null; + + foreach ($params as $_key => $_val) { + switch ($_key) { + case 'style': + case 'indent_char': + case 'wrap_char': + case 'assign': + $$_key = (string) $_val; + break; + + case 'indent': + case 'indent_first': + case 'wrap': + $$_key = (int) $_val; + break; + + case 'wrap_cut': + $$_key = (bool) $_val; + break; + + default: + trigger_error("textformat: unknown attribute '$_key'"); + } + } + + if ($style == 'email') { + $wrap = 72; + } + // split into paragraphs + $_paragraphs = preg_split('![\r\n]{2}!', $content); + + foreach ($_paragraphs as &$_paragraph) { + if (!$_paragraph) { + continue; + } + // convert mult. spaces & special chars to single space + $_paragraph = preg_replace(array('!\s+!' . Smarty::$_UTF8_MODIFIER, '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER), array(' ', ''), $_paragraph); + // indent first line + if ($indent_first > 0) { + $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph; + } + // wordwrap sentences + if (Smarty::$_MBSTRING) { + require_once(SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php'); + $_paragraph = smarty_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut); + } else { + $_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut); + } + // indent lines + if ($indent > 0) { + $_paragraph = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraph); + } + } + $_output = implode($wrap_char . $wrap_char, $_paragraphs); + + if ($assign) { + $template->assign($assign, $_output); + } else { + return $_output; + } +} diff --git a/lib/smarty_3/libs/plugins/function.counter.php b/lib/smarty_3/libs/plugins/function.counter.php new file mode 100755 index 0000000..8d78a24 --- /dev/null +++ b/lib/smarty_3/libs/plugins/function.counter.php @@ -0,0 +1,78 @@ + + * Name: counter
+ * Purpose: print out a counter value + * + * @author Monte Ohrt + * @link http://www.smarty.net/manual/en/language.function.counter.php {counter} + * (Smarty online manual) + * + * @param array $params parameters + * @param Smarty_Internal_Template $template template object + * + * @return string|null + */ +function smarty_function_counter($params, $template) +{ + static $counters = array(); + + $name = (isset($params['name'])) ? $params['name'] : 'default'; + if (!isset($counters[$name])) { + $counters[$name] = array( + 'start' => 1, + 'skip' => 1, + 'direction' => 'up', + 'count' => 1 + ); + } + $counter =& $counters[$name]; + + if (isset($params['start'])) { + $counter['start'] = $counter['count'] = (int) $params['start']; + } + + if (!empty($params['assign'])) { + $counter['assign'] = $params['assign']; + } + + if (isset($counter['assign'])) { + $template->assign($counter['assign'], $counter['count']); + } + + if (isset($params['print'])) { + $print = (bool) $params['print']; + } else { + $print = empty($counter['assign']); + } + + if ($print) { + $retval = $counter['count']; + } else { + $retval = null; + } + + if (isset($params['skip'])) { + $counter['skip'] = $params['skip']; + } + + if (isset($params['direction'])) { + $counter['direction'] = $params['direction']; + } + + if ($counter['direction'] == "down") { + $counter['count'] -= $counter['skip']; + } else { + $counter['count'] += $counter['skip']; + } + + return $retval; +} diff --git a/lib/smarty_3/libs/plugins/function.cycle.php b/lib/smarty_3/libs/plugins/function.cycle.php new file mode 100755 index 0000000..ac42b2e --- /dev/null +++ b/lib/smarty_3/libs/plugins/function.cycle.php @@ -0,0 +1,107 @@ + + * Name: cycle
+ * Date: May 3, 2002
+ * Purpose: cycle through given values
+ * Params: + *
+ * - name      - name of cycle (optional)
+ * - values    - comma separated list of values to cycle, or an array of values to cycle
+ *               (this can be left out for subsequent calls)
+ * - reset     - boolean - resets given var to true
+ * - print     - boolean - print var or not. default is true
+ * - advance   - boolean - whether or not to advance the cycle
+ * - delimiter - the value delimiter, default is ","
+ * - assign    - boolean, assigns to template var instead of printed.
+ * 
+ * Examples:
+ *
+ * {cycle values="#eeeeee,#d0d0d0d"}
+ * {cycle name=row values="one,two,three" reset=true}
+ * {cycle name=row}
+ * 
+ * + * @link http://www.smarty.net/manual/en/language.function.cycle.php {cycle} + * (Smarty online manual) + * @author Monte Ohrt + * @author credit to Mark Priatel + * @author credit to Gerard + * @author credit to Jason Sweat + * @version 1.3 + * + * @param array $params parameters + * @param Smarty_Internal_Template $template template object + * + * @return string|null + */ + +function smarty_function_cycle($params, $template) +{ + static $cycle_vars; + + $name = (empty($params['name'])) ? 'default' : $params['name']; + $print = (isset($params['print'])) ? (bool) $params['print'] : true; + $advance = (isset($params['advance'])) ? (bool) $params['advance'] : true; + $reset = (isset($params['reset'])) ? (bool) $params['reset'] : false; + + if (!isset($params['values'])) { + if (!isset($cycle_vars[$name]['values'])) { + trigger_error("cycle: missing 'values' parameter"); + + return; + } + } else { + if (isset($cycle_vars[$name]['values']) + && $cycle_vars[$name]['values'] != $params['values'] + ) { + $cycle_vars[$name]['index'] = 0; + } + $cycle_vars[$name]['values'] = $params['values']; + } + + if (isset($params['delimiter'])) { + $cycle_vars[$name]['delimiter'] = $params['delimiter']; + } elseif (!isset($cycle_vars[$name]['delimiter'])) { + $cycle_vars[$name]['delimiter'] = ','; + } + + if (is_array($cycle_vars[$name]['values'])) { + $cycle_array = $cycle_vars[$name]['values']; + } else { + $cycle_array = explode($cycle_vars[$name]['delimiter'], $cycle_vars[$name]['values']); + } + + if (!isset($cycle_vars[$name]['index']) || $reset) { + $cycle_vars[$name]['index'] = 0; + } + + if (isset($params['assign'])) { + $print = false; + $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); + } + + if ($print) { + $retval = $cycle_array[$cycle_vars[$name]['index']]; + } else { + $retval = null; + } + + if ($advance) { + if ($cycle_vars[$name]['index'] >= count($cycle_array) - 1) { + $cycle_vars[$name]['index'] = 0; + } else { + $cycle_vars[$name]['index'] ++; + } + } + + return $retval; +} diff --git a/lib/smarty_3/libs/plugins/function.fetch.php b/lib/smarty_3/libs/plugins/function.fetch.php new file mode 100755 index 0000000..381355b --- /dev/null +++ b/lib/smarty_3/libs/plugins/function.fetch.php @@ -0,0 +1,221 @@ + + * Name: fetch
+ * Purpose: fetch file, web or ftp data and display results + * + * @link http://www.smarty.net/manual/en/language.function.fetch.php {fetch} + * (Smarty online manual) + * @author Monte Ohrt + * + * @param array $params parameters + * @param Smarty_Internal_Template $template template object + * + * @throws SmartyException + * @return string|null if the assign parameter is passed, Smarty assigns the result to a template variable + */ +function smarty_function_fetch($params, $template) +{ + if (empty($params['file'])) { + trigger_error("[plugin] fetch parameter 'file' cannot be empty", E_USER_NOTICE); + + return; + } + + // strip file protocol + if (stripos($params['file'], 'file://') === 0) { + $params['file'] = substr($params['file'], 7); + } + + $protocol = strpos($params['file'], '://'); + if ($protocol !== false) { + $protocol = strtolower(substr($params['file'], 0, $protocol)); + } + + if (isset($template->smarty->security_policy)) { + if ($protocol) { + // remote resource (or php stream, …) + if (!$template->smarty->security_policy->isTrustedUri($params['file'])) { + return; + } + } else { + // local file + if (!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) { + return; + } + } + } + + $content = ''; + if ($protocol == 'http') { + // http fetch + if ($uri_parts = parse_url($params['file'])) { + // set defaults + $host = $server_name = $uri_parts['host']; + $timeout = 30; + $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; + $agent = "Smarty Template Engine " . Smarty::SMARTY_VERSION; + $referer = ""; + $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; + $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; + $_is_proxy = false; + if (empty($uri_parts['port'])) { + $port = 80; + } else { + $port = $uri_parts['port']; + } + if (!empty($uri_parts['user'])) { + $user = $uri_parts['user']; + } + if (!empty($uri_parts['pass'])) { + $pass = $uri_parts['pass']; + } + // loop through parameters, setup headers + foreach ($params as $param_key => $param_value) { + switch ($param_key) { + case "file": + case "assign": + case "assign_headers": + break; + case "user": + if (!empty($param_value)) { + $user = $param_value; + } + break; + case "pass": + if (!empty($param_value)) { + $pass = $param_value; + } + break; + case "accept": + if (!empty($param_value)) { + $accept = $param_value; + } + break; + case "header": + if (!empty($param_value)) { + if (!preg_match('![\w\d-]+: .+!', $param_value)) { + trigger_error("[plugin] invalid header format '" . $param_value . "'", E_USER_NOTICE); + + return; + } else { + $extra_headers[] = $param_value; + } + } + break; + case "proxy_host": + if (!empty($param_value)) { + $proxy_host = $param_value; + } + break; + case "proxy_port": + if (!preg_match('!\D!', $param_value)) { + $proxy_port = (int) $param_value; + } else { + trigger_error("[plugin] invalid value for attribute '" . $param_key . "'", E_USER_NOTICE); + + return; + } + break; + case "agent": + if (!empty($param_value)) { + $agent = $param_value; + } + break; + case "referer": + if (!empty($param_value)) { + $referer = $param_value; + } + break; + case "timeout": + if (!preg_match('!\D!', $param_value)) { + $timeout = (int) $param_value; + } else { + trigger_error("[plugin] invalid value for attribute '" . $param_key . "'", E_USER_NOTICE); + + return; + } + break; + default: + trigger_error("[plugin] unrecognized attribute '" . $param_key . "'", E_USER_NOTICE); + + return; + } + } + if (!empty($proxy_host) && !empty($proxy_port)) { + $_is_proxy = true; + $fp = fsockopen($proxy_host, $proxy_port, $errno, $errstr, $timeout); + } else { + $fp = fsockopen($server_name, $port, $errno, $errstr, $timeout); + } + + if (!$fp) { + trigger_error("[plugin] unable to fetch: $errstr ($errno)", E_USER_NOTICE); + + return; + } else { + if ($_is_proxy) { + fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n"); + } else { + fputs($fp, "GET $uri HTTP/1.0\r\n"); + } + if (!empty($host)) { + fputs($fp, "Host: $host\r\n"); + } + if (!empty($accept)) { + fputs($fp, "Accept: $accept\r\n"); + } + if (!empty($agent)) { + fputs($fp, "User-Agent: $agent\r\n"); + } + if (!empty($referer)) { + fputs($fp, "Referer: $referer\r\n"); + } + if (isset($extra_headers) && is_array($extra_headers)) { + foreach ($extra_headers as $curr_header) { + fputs($fp, $curr_header . "\r\n"); + } + } + if (!empty($user) && !empty($pass)) { + fputs($fp, "Authorization: BASIC " . base64_encode("$user:$pass") . "\r\n"); + } + + fputs($fp, "\r\n"); + while (!feof($fp)) { + $content .= fgets($fp, 4096); + } + fclose($fp); + $csplit = preg_split("!\r\n\r\n!", $content, 2); + + $content = $csplit[1]; + + if (!empty($params['assign_headers'])) { + $template->assign($params['assign_headers'], preg_split("!\r\n!", $csplit[0])); + } + } + } else { + trigger_error("[plugin fetch] unable to parse URL, check syntax", E_USER_NOTICE); + + return; + } + } else { + $content = @file_get_contents($params['file']); + if ($content === false) { + throw new SmartyException("{fetch} cannot read resource '" . $params['file'] . "'"); + } + } + + if (!empty($params['assign'])) { + $template->assign($params['assign'], $content); + } else { + return $content; + } +} diff --git a/lib/smarty_3/libs/plugins/function.html_checkboxes.php b/lib/smarty_3/libs/plugins/function.html_checkboxes.php new file mode 100755 index 0000000..9fd5325 --- /dev/null +++ b/lib/smarty_3/libs/plugins/function.html_checkboxes.php @@ -0,0 +1,237 @@ + + * Type: function
+ * Name: html_checkboxes
+ * Date: 24.Feb.2003
+ * Purpose: Prints out a list of checkbox input types
+ * Examples: + *
+ * {html_checkboxes values=$ids output=$names}
+ * {html_checkboxes values=$ids name='box' separator='
' output=$names} + * {html_checkboxes values=$ids checked=$checked separator='
' output=$names} + *
+ * Params: + *
+ * - name       (optional) - string default "checkbox"
+ * - values     (required) - array
+ * - options    (optional) - associative array
+ * - checked    (optional) - array default not set
+ * - separator  (optional) - ie 
or   + * - output (optional) - the output next to each checkbox + * - assign (optional) - assign the output as an array to this variable + * - escape (optional) - escape the content (not value), defaults to true + *
+ * + * @link http://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes} + * (Smarty online manual) + * @author Christopher Kvarme + * @author credits to Monte Ohrt + * @version 1.0 + * + * @param array $params parameters + * @param object $template template object + * + * @return string + * @uses smarty_function_escape_special_chars() + */ +function smarty_function_html_checkboxes($params, $template) +{ + require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); + + $name = 'checkbox'; + $values = null; + $options = null; + $selected = array(); + $separator = ''; + $escape = true; + $labels = true; + $label_ids = false; + $output = null; + + $extra = ''; + + foreach ($params as $_key => $_val) { + switch ($_key) { + case 'name': + case 'separator': + $$_key = (string) $_val; + break; + + case 'escape': + case 'labels': + case 'label_ids': + $$_key = (bool) $_val; + break; + + case 'options': + $$_key = (array) $_val; + break; + + case 'values': + case 'output': + $$_key = array_values((array) $_val); + break; + + case 'checked': + case 'selected': + if (is_array($_val)) { + $selected = array(); + foreach ($_val as $_sel) { + if (is_object($_sel)) { + if (method_exists($_sel, "__toString")) { + $_sel = smarty_function_escape_special_chars((string) $_sel->__toString()); + } else { + trigger_error("html_checkboxes: selected attribute contains an object of class '" . get_class($_sel) . "' without __toString() method", E_USER_NOTICE); + continue; + } + } else { + $_sel = smarty_function_escape_special_chars((string) $_sel); + } + $selected[$_sel] = true; + } + } elseif (is_object($_val)) { + if (method_exists($_val, "__toString")) { + $selected = smarty_function_escape_special_chars((string) $_val->__toString()); + } else { + trigger_error("html_checkboxes: selected attribute is an object of class '" . get_class($_val) . "' without __toString() method", E_USER_NOTICE); + } + } else { + $selected = smarty_function_escape_special_chars((string) $_val); + } + break; + + case 'checkboxes': + trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING); + $options = (array) $_val; + break; + + case 'assign': + break; + + case 'strict': + break; + + case 'disabled': + case 'readonly': + if (!empty($params['strict'])) { + if (!is_scalar($_val)) { + trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE); + } + + if ($_val === true || $_val === $_key) { + $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"'; + } + + break; + } + // omit break; to fall through! + + default: + if (!is_array($_val)) { + $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"'; + } else { + trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; + } + } + + if (!isset($options) && !isset($values)) { + return ''; + } /* raise error here? */ + + $_html_result = array(); + + if (isset($options)) { + foreach ($options as $_key => $_val) { + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape); + } + } else { + foreach ($values as $_i => $_key) { + $_val = isset($output[$_i]) ? $output[$_i] : ''; + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape); + } + } + + if (!empty($params['assign'])) { + $template->assign($params['assign'], $_html_result); + } else { + return implode("\n", $_html_result); + } +} + +function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape = true) +{ + $_output = ''; + + if (is_object($value)) { + if (method_exists($value, "__toString")) { + $value = (string) $value->__toString(); + } else { + trigger_error("html_options: value is an object of class '" . get_class($value) . "' without __toString() method", E_USER_NOTICE); + + return ''; + } + } else { + $value = (string) $value; + } + + if (is_object($output)) { + if (method_exists($output, "__toString")) { + $output = (string) $output->__toString(); + } else { + trigger_error("html_options: output is an object of class '" . get_class($output) . "' without __toString() method", E_USER_NOTICE); + + return ''; + } + } else { + $output = (string) $output; + } + + if ($labels) { + if ($label_ids) { + $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value)); + $_output .= '