awl-0.53.orig/0000755000000000000000000000000011774765552010074 5ustar awl-0.53.orig/dba/0000755000000000000000000000000011774765552010622 5ustar awl-0.53.orig/dba/grant-minimum-permissions.sh0000755000000000000000000000162111167615735016307 0ustar #!/bin/sh # # Grant permissions to AWL tables for Web application and DBA users # # Since we don't know anything about the database connection we echo # the SQL for our caller to pipe into the database. # APPUSER=${1:-"general"} DBAUSER=${2} cat < patch) OR (schema_major = major AND schema_minor > minor) OR (schema_major > major) ; IF matching >= 1 THEN RAISE EXCEPTION ''Database revisions after %.%.% have already been applied.'', major, minor, patch; RETURN FALSE; END IF; SELECT COUNT(*) INTO matching FROM awl_db_revision WHERE schema_major = major AND schema_minor = minor AND schema_patch = patch; IF matching >= 1 THEN RETURN TRUE; END IF; RAISE EXCEPTION ''Database has not been upgraded to %.%.%'', major, minor, patch; RETURN FALSE; END; ' LANGUAGE 'plpgsql'; -- The schema_id should always be incremented. The major / minor / patch level should -- be incremented as seems appropriate... CREATE or REPLACE FUNCTION new_db_revision( INT, INT, INT, TEXT ) RETURNS VOID AS ' DECLARE major ALIAS FOR $1; minor ALIAS FOR $2; patch ALIAS FOR $3; blurb ALIAS FOR $4; new_id INT; BEGIN SELECT MAX(schema_id) + 1 INTO new_id FROM awl_db_revision; IF NOT FOUND OR new_id IS NULL THEN new_id := 1; END IF; INSERT INTO awl_db_revision (schema_id, schema_major, schema_minor, schema_patch, schema_name) VALUES( new_id, major, minor, patch, blurb ); RETURN; END; ' LANGUAGE 'plpgsql'; SELECT new_db_revision(1,1,0, 'Dawn' ); awl-0.53.orig/dba/awl-tables.sql0000644000000000000000000000403711167615735013373 0ustar -- Tables needed for AWL Libraries BEGIN; CREATE TABLE supported_locales ( locale TEXT PRIMARY KEY, locale_name_en TEXT, locale_name_locale TEXT ); -- This is the table of users for the system CREATE TABLE usr ( user_no SERIAL PRIMARY KEY, active BOOLEAN DEFAULT TRUE, email_ok TIMESTAMPTZ, joined TIMESTAMPTZ DEFAULT current_timestamp, updated TIMESTAMPTZ, last_used TIMESTAMPTZ, username TEXT NOT NULL, -- Note UNIQUE INDEX below constains case-insensitive uniqueness password TEXT, fullname TEXT, email TEXT, config_data TEXT, date_format_type TEXT DEFAULT 'E', -- default to english date format dd/mm/yyyy locale TEXT ); CREATE FUNCTION max_usr() RETURNS INT4 AS 'SELECT max(user_no) FROM usr' LANGUAGE 'sql'; CREATE UNIQUE INDEX usr_sk1_unique_username ON usr ( lower(username) ); CREATE TABLE usr_setting ( user_no INT4 REFERENCES usr ( user_no ) ON DELETE CASCADE, setting_name TEXT, setting_value TEXT, PRIMARY KEY ( user_no, setting_name ) ); CREATE FUNCTION get_usr_setting(INT4,TEXT) RETURNS TEXT AS 'SELECT setting_value FROM usr_setting WHERE usr_setting.user_no = $1 AND usr_setting.setting_name = $2 ' LANGUAGE 'sql'; CREATE TABLE roles ( role_no SERIAL PRIMARY KEY, role_name TEXT ); CREATE FUNCTION max_roles() RETURNS INT4 AS 'SELECT max(role_no) FROM roles' LANGUAGE 'sql'; CREATE TABLE role_member ( role_no INT4 REFERENCES roles ( role_no ), user_no INT4 REFERENCES usr ( user_no ) ON DELETE CASCADE ); CREATE TABLE session ( session_id SERIAL PRIMARY KEY, user_no INT4 REFERENCES usr ( user_no ) ON DELETE CASCADE, session_start TIMESTAMPTZ DEFAULT current_timestamp, session_end TIMESTAMPTZ DEFAULT current_timestamp, session_key TEXT, session_config TEXT ); CREATE FUNCTION max_session() RETURNS INT4 AS 'SELECT max(session_id) FROM session' LANGUAGE 'sql'; CREATE TABLE tmp_password ( user_no INT4 REFERENCES usr ( user_no ), password TEXT, valid_until TIMESTAMPTZ DEFAULT (current_timestamp + '1 day'::interval) ); COMMIT; awl-0.53.orig/dba/grant-on-all-tables.sh0000755000000000000000000000055710475146536014723 0ustar #!/bin/sh DATABASE="$1" USER="$2" PERMISSION="${3:-SELECT}" if [ "$USER" = "" ] ; then echo "Usage: $0 [permissions]" exit fi TABLES="`psql \"$DATABASE\" -qt -c \"select relname from pg_class where relowner > 50 AND relkind in( 'r', 'S');\"`" for T in ${TABLES} ; do psql "$DATABASE" -c "grant ${PERMISSION} on ${T} to ${USER};" done awl-0.53.orig/debian/0000755000000000000000000000000011774765552011316 5ustar awl-0.53.orig/debian/awl-doc.install0000644000000000000000000000000011167615735014213 0ustar awl-0.53.orig/debian/libawl-php.docs0000644000000000000000000000001411167615735014213 0ustar README TODO awl-0.53.orig/debian/libawl-php.postinst0000644000000000000000000000026110425456725015150 0ustar #!/bin/sh set -e [ -n "${DEBUG}" ] && set -o xtrace PACKAGE=::package:: [ -n "${DEBUG}" ] && echo "PostInst Parameters: $@" case $1 in configure) ;; esac #DEBHELPER# awl-0.53.orig/debian/libawl-php.prerm0000644000000000000000000000025310425457012014401 0ustar #!/bin/sh set -e [ -n "${DEBUG}" ] && set -o xtrace PACKAGE=::package:: [ -n "${DEBUG}" ] && echo "PreRM Parameters: $@" case $1 in remove) ;; esac #DEBHELPER# awl-0.53.orig/debian/copyright0000644000000000000000000000250711167615735013246 0ustar Andrew's Web Libraries are are licensed under the Gnu Public License version 2, or later. This package was debianized by Andrew McMillan since it's inception. The current Debian maintainer is Andrew McMillan It was downloaded from: http://debian.mcmillan.net.nz/packages/awl-libawl-php-0.30.tar.gz Upstream Authors: Andrew McMillan Copyright: 2006 - 2008 Catalyst IT Ltd 2006 - 2008 Andrew McMillan This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License with the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. On Debian systems, the complete text of the GNU General Public License, version 2, can be found in /usr/share/common-licenses/GPL-2. The licensed software includes the Debian packaging. awl-0.53.orig/debian/libawl-php.install0000644000000000000000000000002611167615735014734 0ustar dba inc usr/share/awl awl-0.53.orig/debian/control0000644000000000000000000000251411760653201012701 0ustar Source: awl Section: web Priority: extra Maintainer: Andrew McMillan Standards-Version: 3.9.2 Build-Depends: debhelper (>= 7) Vcs-git: git://repo.or.cz/awl.git Vcs-browser: http://repo.or.cz/w/awl.git Homepage: http://andrew.mcmillan.net.nz/projects/awl Package: libawl-php Architecture: all Depends: ${misc:Depends}, debconf (>= 1.0.32), perl Recommends: php5 (>= 5.1) Description: Andrew's Web Libraries - PHP Utility Libraries This package contains Andrew's Web Libraries. This is a set of hopefully lightweight libraries for handling a variety of useful things for web programming, including: - Session management - User management - DB Records - Simple reporting - DB Schema Updating - iCalendar parsing . There is some documentation in the awl-doc package. Package: awl-doc Section: doc Architecture: all Depends: ${misc:Depends}, debconf (>= 1.0.32) Description: Andrew's Web Libraries - API documentation This package documents Andrew's Web Libraries. This is a set of hopefully lightweight libraries for handling a variety of useful things for web programming, including: - Session management - User management - DB Records - Simple reporting - DB Schema Updating - iCalendar parsing . This package contains detailed technical documentation for the classes and methods in these libraries. awl-0.53.orig/debian/compat0000644000000000000000000000000211167615735012505 0ustar 5 awl-0.53.orig/debian/README.Debian0000644000000000000000000000130111167615735013343 0ustar libawl-php for Debian ------------------------------------------ This package includes a bunch of web libraries, mostly written by Andrew McMillan, and mostly used by PHP things that he wrote. They're supposed to be fairly lightweight, and they are intended to simplify things rather than complexify them. To use them, you will need to add the path into your PHP application. The recommended way is to do this inside the Apache virtual host, like so: php_value include_path ../inc:/usr/share/awl/inc Which would include your application's 'inc' directory first, allowing it to override any AWL functionality it wanted to. Andrew McMillan , Tue. 2 May 2006 07:11:22 +1200 awl-0.53.orig/debian/libawl-php.postrm0000644000000000000000000000025310425456774014616 0ustar #!/bin/sh set -e [ -n "${DEBUG}" ] && set -o xtrace PACKAGE=::package:: [ -n "${DEBUG}" ] && echo "PostRM Parameters: $@" case $1 in purge) ;; esac #DEBHELPER# awl-0.53.orig/debian/awl-doc.docs0000644000000000000000000000001211167615735013500 0ustar docs/api/ awl-0.53.orig/debian/rules0000755000000000000000000000357611760653201012367 0ustar #!/usr/bin/make -f # # rules for AWL # # This file allows you to build any of the binary packages independantly, via binary- targets. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This has to be exported to make some magic below work. export DH_OPTIONS build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: dh_testdir $(MAKE) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp $(MAKE) clean -rm -f build dh_clean install: DH_OPTIONS= install: build dh_testdir dh_testroot dh_prep dh_installdirs dh_install # This single target is used to build all the packages, all at once, or # one at a time. So keep in mind: any options passed to commands here will # affect _all_ packages. Anything you want to only affect one package # should be put in another target, such as the install target. binary-common: dh_testdir dh_testroot dh_installchangelogs dh_installdocs # dh_installexamples # dh_installmenu # dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installcatalogs # dh_installpam # dh_installmime # dh_installinit # dh_installman # dh_installcron # dh_installinfo # dh_installwm # dh_installudev # dh_lintian # dh_undocumented # dh_strip # dh_link dh_compress --exclude=.js dh_fixperms # dh_perl # dh_python # dh_makeshlibs dh_installdeb # dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb # Build architecture independant packages using the common target. binary-indep: build install $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common # Build architecture dependant packages using the common target. binary-arch: build install # Any other binary targets build just one binary package at a time. binary-%: build install make -f debian/rules binary-common DH_OPTIONS=-p$* binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary-common binary install awl-0.53.orig/debian/changelog0000644000000000000000000003246511774765533013201 0ustar awl (0.53-1) unstable; urgency=low * New upstream release. -- Andrew McMillan Wed, 04 Jul 2012 19:06:03 +1200 awl (0.52-1) unstable; urgency=low * New upstream release. -- Andrew McMillan Sun, 17 Jun 2012 22:00:07 +1200 awl (0.51-1) unstable; urgency=low * New upstream release. -- Andrew McMillan Fri, 13 Jan 2012 23:40:04 +1300 awl (0.50-1) unstable; urgency=low * New upstream release. * Fix lintian warnings. -- Andrew McMillan Wed, 04 Jan 2012 13:49:06 +1300 awl (0.49-1) unstable; urgency=low * New upstream release. -- Andrew McMillan Mon, 24 Oct 2011 20:10:02 +1300 awl (0.48-1) unstable; urgency=low * New upstream release. -- Andrew McMillan Sat, 24 Sep 2011 14:03:45 +1200 awl (0.47-1) unstable; urgency=low * New upstream release. -- Andrew McMillan Sat, 24 Sep 2011 13:56:27 +1200 awl (0.46-1) unstable; urgency=low * New upstream release. -- Andrew McMillan Sun, 11 Sep 2011 00:07:48 +1200 awl (0.45-0) unstable; urgency=low * New upstream release. -- Andrew McMillan Tue, 21 Sep 2010 14:19:43 +1200 awl (0.44-0) unstable; urgency=low * New upstream release. -- Andrew McMillan Mon, 13 Sep 2010 00:36:31 +1200 awl (0.43-0) unstable; urgency=low * New upstream release. (closes: #538598) -- Andrew McMillan Thu, 15 Apr 2010 20:22:55 +1200 awl (0.42-0) unstable; urgency=low * New upstream release. -- Andrew McMillan Mon, 08 Mar 2010 18:19:41 +1300 awl (0.41-0) unstable; urgency=low * New upstream release. -- Andrew McMillan Tue, 23 Feb 2010 23:12:33 +1300 awl (0.40-0) unstable; urgency=low * New upstream release. -- Andrew McMillan Fri, 05 Feb 2010 00:03:56 -0800 awl (0.39-0) unstable; urgency=low * New upstream release. -- Andrew McMillan Mon, 21 Dec 2009 23:33:23 +1300 awl (0.38-0) unstable; urgency=low * New upstream release. * Full change history no longer kept in Debian changelog. -- Andrew McMillan Tue, 06 Oct 2009 09:41:20 -0700 awl (0.37) unstable; urgency=low * [XMLDocument] href method now returns an array of hrefs. * [Browser] Allow forced result ordering. * [Browser] Add a method to retrieve total for a column. * [Browser] Add facility for DISTINCT to browser clauses. * [Session] Fix unset variables in temporary password requests. * [MenuSet] Default to not displaying empty menus. * [XMLElement] Return null on no value, rather than returning without a value. * [User] Display current record better. * [iCalendar] More efficient use of memory. * [Session] This isn't just a WRMS library any longer... * [PgQuery] Move DB version detection out of the DB. -- Andrew McMillan Mon, 22 Jun 2009 14:00:17 +1200 awl (0.36) unstable; urgency=low * [User] Add new changeusername/changeactive restrictions. * [MenuSet] Allow presentation as CSS styled menus. * [PgQuery] Get rid of ini_set/ini_get calls. * [classBrowser] Allow the enclosing div to be customised. * [AWMUtilities] New parameter cleaning function. * [MenuSet] Improve default sorting of menu options. * [iCalendar] Mask components and clone confidential events. * [classBrowser] Move column value replacement into the object. * [iCalendar] Correct an error appending components. * [DataUpdate] Use SSHA1 by preference on password updates. * [Session] local_index_not_logged_in is no longer preceded/followed by calls to page-header.php/page-footer.php. * [classBrowser] Add methods to SetLimit() and SetOffset() in the query. * [DataUpdate] Add a field type for 'interval'. * [DataUpdate] Explicitly return a null value for fields which are not set. * Various general bugfixes and warning removals. -- Andrew McMillan Fri, 10 Apr 2009 21:53:28 +1200 awl (0.34) unstable; urgency=low * [General] Use @todo: everywhere for phpdocumentor. * [iCalendar] Make iCalComponent usable in preference to iCalendar. * [classBrowser] A hook can display the row if it matches a pattern. * Better namespace handlin in XML processing. * [iCalendar] Add functions for attendee/organizer checking. -- Andrew McMillan Tue, 18 Nov 2008 18:05:38 +1300 awl (0.33) unstable; urgency=low * Remove a couple of uninitialised variable warnings. * [AWLUtilties] Add a quoted_printable_encode function * [XMLDocument] New object to assist with namespaced XML document creation. * [iCalendar] Remove the expectation that XML will be case folded. * [iCalendar] New iCalendar->Add method to add properties which occur multiply. * [iCalendar] Fix word wrapping. * [iCalendar] Add CALSCALE:GREGORIAN to response. * [PgQuery] Escaping for newer Postgres versions should be preceded with an 'E'. * [General] Remove lots of uninitialised variable warnings. -- Andrew McMillan Tue, 28 Oct 2008 20:23:20 +1300 awl (0.32) unstable; urgency=low * Include docs & don't compress classTree.js (closes: #493687) * Recommend php5|4 rather than depend (closes: #493686) * debian/compat should be in the source package. * Clean up minor lintian warnings. -- Andrew McMillan Tue, 16 Sep 2008 14:04:02 +1200 awl (0.31) unstable; urgency=low * Packaging changes for Debian upload. -- Andrew McMillan Mon, 14 Jul 2008 22:43:45 +1200 awl (0.30) unstable; urgency=low * Split API docs to separate package. * Add auth_external routine to acknowledge external authentication. * [iCalendar] Don't create a property called 'type' * Log when deprecated functions are called * Reduce uninitialised variable warnings. * Close Debian ITP bug (closes: #490438) -- Andrew McMillan Sat, 12 Jul 2008 23:08:11 +1200 awl (0.29) unstable; urgency=low * Minor code cleanup. -- Andrew McMillan Wed, 07 May 2008 21:16:28 +1200 awl (0.28) unstable; urgency=low * Remove references to the 'general' database user. * Add type cast to work correctly with PostgreSQL 8.3 -- Andrew McMillan Fri, 18 Apr 2008 17:32:01 +1200 awl (0.27) unstable; urgency=low * Changes to database creation scripts to separate table definitions from ownership definitions. -- Andrew McMillan Sun, 13 Apr 2008 00:21:46 +1200 awl (0.26) unstable; urgency=low * Improve translatability of interfaces. * [classBrowser] Provide a pre-formatting hook for column value manipulation. -- Andrew McMillan Sun, 13 Apr 2008 00:19:26 +1200 awl (0.25) unstable; urgency=low * [iCalendar] Fix naming of Set function. * [iCalendar] Fix wrapping of components. -- Andrew McMillan Sat, 09 Feb 2008 20:08:21 +1300 awl (0.24) unstable; urgency=low * Add the ability to open Database connections persistently. -- Andrew McMillan Wed, 23 Jan 2008 23:51:16 +1300 awl (0.23) unstable; urgency=low * [iCalendar] Fixes to timezone handling. * [iCalendar] Bugfix in SetComponents * [XMLElement] Method to return count of sub-elements. * [Session] Log detailed error when SSHA passwords are present but not supported. -- Andrew McMillan Wed, 16 Jan 2008 21:52:28 +1300 awl (0.22) unstable; urgency=low * Add a Salted SHA-1 password hashing algorithm compatible with OpenLDAP and make it the default. * iCalendar: ClearComponents should be recursive. * DataUpdate: Add a cache for the field names retrieved from the DB. * AuthPlugins: Add an optional 'where' clause to auth_other_awl -- Andrew McMillan Thu, 01 Nov 2007 21:22:00 +1300 awl (0.21) unstable; urgency=low * Add support for rendering a restricted set of properties. * Disallow login for inactive users in auth_other_awl -- Andrew McMillan Thu, 25 Oct 2007 15:11:17 +1300 awl (0.20) unstable; urgency=low * Rewrite of iCalendar.php to fully parse the structure. * Allow second-level ordering of Browse widgets. * Add optional parameters to PgQuery::BuildOptionList -- Andrew McMillan Tue, 16 Oct 2007 13:30:52 +1300 awl (0.19) unstable; urgency=low * More care when recording timezones. * New PHPDocumentor structure. * Various fixes and enhancements to XMLElement.php * New packaging layout. * Changes to iCalendar.php to implement CalDAV filters. -- Andrew McMillan Thu, 14 Jun 2007 20:31:55 +0100 awl (0.18) unstable; urgency=low * Improve formatting of default date. -- Andrew McMillan Wed, 18 Apr 2007 22:10:21 +1200 awl (0.17) unstable; urgency=low * Added a clone() function for forward compatibility with PHP5. -- Andrew McMillan Mon, 19 Mar 2007 12:48:35 +1200 awl (0.16) unstable; urgency=low * Fix some warnings under PHP5. * Minor change to query logging. -- Andrew McMillan Thu, 8 Mar 2007 11:02:51 +1300 awl (0.15) unstable; urgency=low * Release 0.15. -- Andrew McMillan Mon, 19 Feb 2007 21:04:22 +1300 awl (0.14) unstable; urgency=low * Add a function for UUID generation. * Record what locale we did successfully set. * Extended XML handling library to support easier building and querying of an internal structure. -- Andrew McMillan Sat, 23 Dec 2006 22:17:28 +1300 awl (0.13) unstable; urgency=low * Remove unassigned value warnings and others that show up when we enable E_NOTICE in php.ini. * Allow for something to hook into the authentication process. Include a simple example. -- Andrew McMillan Mon, 4 Dec 2006 07:42:53 +1300 awl (0.12) unstable; urgency=low * Add BuildConfirmationHash() and CheckConfirmationHash() methods to reduce vulnerability to some scripting attacks, when used. * Fix incorrect variable name in Translation.php (closes sf-600138) * Many enhancements to the iCalendar class. * Minor double-error niggle in PgQuery fixed. -- Andrew McMillan Wed, 22 Nov 2006 23:08:14 +1300 awl (0.11) unstable; urgency=low * Significantly better translation readiness. * New release. -- Andrew McMillan Fri, 10 Nov 2006 15:21:44 +1300 awl (0.10) unstable; urgency=low * The beginnings of a framework for doing internationalisation. * Fix the Forget Me Not functionality. * New release. -- Andrew McMillan Mon, 6 Nov 2006 10:35:30 +1300 awl (0.9) unstable; urgency=low * Actually save the user's roles when they are changed. * New release. -- Andrew McMillan Fri, 27 Oct 2006 12:20:29 +1300 awl (0.8) unstable; urgency=low * Fix date style handling and expose the date style on user maintenance. * New release. -- Andrew McMillan Mon, 23 Oct 2006 11:23:55 +1300 awl (0.7-0) unstable; urgency=low * Add ability for browser to have arbitrary extra rows. * Some code cleanups and documentation additions. * Fix minor XML collapse bug. * Use YYYY for backward compatibility with PostgreSQL 7.4. -- Andrew McMillan Wed, 18 Oct 2006 10:38:57 +1300 awl (0.6-0) unstable; urgency=low * Addition of iCalendar library to replace vEvent. * Warning removal cleanup. -- Andrew McMillan Sun, 8 Oct 2006 19:53:07 +1300 awl (0.5-0) unstable; urgency=low * Add a basic library for XML document output. * Various enhancements to Vevent. * Some changes so PgQuery logs with $c->dbg settings. -- Andrew McMillan Thu, 5 Oct 2006 00:40:39 +1300 awl (0.4-1) unstable; urgency=low * Logging changes. * Add object for VEVENT iCalendar files. * Improvements to User class to render roles. -- Andrew McMillan Sun, 1 Oct 2006 20:33:39 +1300 awl (0.4-0) unstable; urgency=low * A number of changes due to excessive work on the start of a simple CalDAV store. * New AWLUtilities.php location for utility functions for logging and other useful stuff. -- Andrew McMillan Sun, 24 Sep 2006 17:23:20 +1200 awl (0.3-2) unstable; urgency=low * Put changelog in the right place. -- Andrew McMillan Tue, 1 Aug 2006 08:21:46 +1200 awl (0.3-1) unstable; urgency=low * Various changes made for APMS. -- Andrew McMillan Wed, 28 Jun 2006 06:47:29 +1200 awl (0.3-0) unstable; urgency=low * Add URL escaping possibilities to field values replaced into output. -- Andrew McMillan Wed, 10 May 2006 22:10:55 +1200 awl (0.2-2) unstable; urgency=low * Some merges from WRMS. -- Andrew McMillan Mon, 8 May 2006 08:55:55 +1200 awl (0.2-1) unstable; urgency=low * Merges and fixes from WRMS codebase. -- Andrew McMillan Thu, 4 May 2006 22:31:37 +1200 awl (0.1-1) unstable; urgency=low * Initial release. -- Andrew McMillan Tue, 2 May 2006 07:43:59 +1200 awl-0.53.orig/README0000644000000000000000000000026211217565360010737 0ustar Andrew's Web Libraries are (c) Andrew McMillan, Catalyst IT Ltd and Morphoss Ltd and licensed under the GNU General Public License version 2, or at your option any later version.awl-0.53.orig/COPYING0000644000000000000000000004310311167615735011121 0ustar GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 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. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, 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 or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's 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 give any other recipients of the Program a copy of this License along with the Program. 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 Program or any portion of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, 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 Program, 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 Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) 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; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, 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 executable. However, as a special exception, the source code 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. If distribution of executable or 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 counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program 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. 5. 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 Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program 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 to this License. 7. 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 Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program 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 Program. 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. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program 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. 9. The Free Software Foundation may publish revised and/or new versions of the 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 Program 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 Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, 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 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. awl-0.53.orig/TODO0000644000000000000000000000000010425461577010542 0ustar awl-0.53.orig/Makefile0000755000000000000000000000265211632655132011525 0ustar #!/usr/bin/make -f # package=awl majorversion = $(shell sed -n 's:\([0-9\.]*\)[-a-f0-9-]*:\1:p' VERSION) gitrev = 0 version = $(majorversion) issnapshot = 0 snapshot : gitrev = $(shell git rev-parse --short HEAD) snapshot : version = $(majorversion)-git$(gitrev) snapshot : issnapshot = 1 all: built-docs built-docs: docs/api/phpdoc.ini inc/*.php phpdoc -c docs/api/phpdoc.ini || echo "WARNING: the docs could not be built" touch built-docs # # Insert the current version number into AWLUtilities.php # inc/AWLUtilities.php: scripts/build-AWLUtilities.sh VERSION inc/AWLUtilities.php.in scripts/build-AWLUtilities.sh inc/AWLUtilities.php # # Build a release .tar.gz file in the directory above us # release: built-docs -ln -s . $(package)-$(version) sed 's:@@VERSION@@:$(majorversion):' php-awl.spec.in | \ sed 's:@@ISSNAPSHOT@@:$(issnapshot):' | \ sed 's:@@GITREV@@:$(gitrev):' > php-awl.spec tar czf ../$(package)-$(version).tar.gz \ --no-recursion --dereference $(package)-$(version) \ $(shell git ls-files |grep -v '.git'|sed -e s:^:$(package)-$(version)/:) \ $(shell find $(package)-$(version)/docs/api/ ! -name "phpdoc.ini" ) php-awl.spec rm $(package)-$(version) snapshot: release clean: rm -f built-docs -find . -name "*~" -delete rm -f php-awl.spec clean-all: clean -find docs/api/* ! -name "phpdoc.ini" ! -name ".gitignore" -delete .PHONY: all clean release awl-0.53.orig/ChangeLog0000644000000000000000000004336411774765005011651 0ustar 2012-07-04 Andrew McMillan * Release 0.53 2012-06-26 Andrew McMillan * Correct replacement when 'mailto:' is not passed in as first part of match. 2012-06-25 Andrew McMillan * Fix name of CDO TZID property, avoid unassigned variable warning. * Fix typo in unlocking code. 2012-05-28 Andrew McMillan * For creating MIME messages. * Updated and modernized. 2012-06-17 Andrew McMillan * Release 0.52 2012-06-14 Andrew McMillan * [DataUpdate] Fix regular expression matching whether value is already a salted hash. 2012-05-20 Andrew McMillan * [XMLElement] Changes for more repeatable parsing. * [XMLDocument] If an href includes a space or @ then bug about it, but urlencode it also. 2012-05-15 Andrew McMillan * [Editor] Add support for labels on checkboxes. 2012-05-11 Andrew McMillan * [XMLElement] XML parsing / creating improvements / fixes. 2012-04-30 Andrew McMillan * [vComponent] We should use GetNSTag() rather than GetTag() in most cases. 2012-04-22 Andrew McMillan * [AwlQuery] Throw exception if the database is not connected when we try to query it. 2012-04-16 Andrew McMillan * [vCalendar] Log the actual VTIMEZONE which appears to be in error. 2012-03-22 Andrew McMillan * [vCalendar] New SetUID/GetUID methods used by POST add-member. 2012-03-12 Andrew McMillan * [Editor] The current row needs to be global so the hook might reference it. 2012-01-13 Andrew McMillan * [vComponent] Fix handling for vcard peculiarities. * [vComponent] Don't escape all ; in N or ADR. * [vComponent] Allow for property parameters to be multiply set. * [AwlDbDialect] Don't treat binary strings longer than 6 characters as numbers. * Release 0.51 2012-01-04 Andrew McMillan * Release 0.50 2011-11-09 Andrew McMillan * [AWLUtilities] Ensure we flush output buffers on abort. 2011-11-02 Andrew McMillan * [vCalendar] More support for scheduling-related actions. * [vComponent] Minor performance tweaks. 2011-10-31 Andrew McMillan * [vCalendar] Add method to scrub a confidential event. 2011-10-24 Andrew McMillan * [AwlDatabase] Throw an exception when we can't rollback a transaction. * [vCalendar] New functions for updating organizer/attendee status. 2011-10-20 Andrew McMillan * Release 0.49 * [vComponent] Allow re-rendering to be forced. * [AwlUtilities] Add a new trace_bug() function which logs a stacktrace. 2011-10-18 Andrew McMillan * [AwlUtilities] timezone_identifiers_list() is only PHP5.2 onwards :-( 2011-10-16 Andrew McMillan * [Session] Support array of server_auth_type since Kerberos can send different ones. 2011-10-13 Andrew McMillan * [various session things] Force cast to text() to handle integer usernames 2011-10-05 Andrew McMillan * [AwlUtilities] Support for gzdecode where PHP does not. 2011-09-24 Andrew McMillan * Release 0.48 2011-09-17 Andrew McMillan * [vCalendar] More ways to get an Olson Time Zone ID. 2011-09-15 Andrew McMillan * [vComponent] Cleaned up the filter handling. 2011-09-14 Andrew McMillan * [vCalendar] Support replacement the last few iCalendar cases that were missing. * Add TZ exception for America/Phoenix and config for doing these as config items. * See http://wiki.davical.org/w/Configuration/settings/timezone_translations 2011-09-13 Andrew McMillan * Fix handling of properties enclosed in double-quotes. * Release 0.47 2011-09-08 Andrew McMillan * [vCalendar] Developing this to be useful for scheduling. 2011-09-06 Andrew McMillan * [vComponent] add GetPValue() method and VCalendar class. * [iCalendar] Remove deprecated() function moved to AwlUtilities. * [AwlQuery] Change phpdoc to include possible values for TransactionState() * [AwlDatabase] Make attempt to nest transactions a fatal error. * [AWLUtlities] Add fatal() and deprecated() functions. 2011-06-04 Andrew McMillan * Fix some errors in filtering on arbitrary iCalendar properties. * Better fallback between pluggable authentication things. * Provide better logging when DB connection fails. 2011-02-23 Felix Möller * Add support for RPM packages. 2011-02-22 Andrew McMillan * The " character should not be escaped per RFC5545 3.3.11 * [AwlCache] Add facility to lock / release something arbitrary. 2011-01-21 Andrew McMillan * Ensure all lines of the output VComponent are \r\n terminated. 2011-01-06 Andrew McMillan * [AuthPlugins] Fix misspelled __LINE__ constant. * Add US/* as allowable timezone names. 2011-01-04 Andrew McMillan * [iCalendar] Add to the list of passed-through values on obfuscation. * [DataUpdate] Move strange character check until after password hashing. Well, well well. For some years it has been impossible to have ' or \ in a password... 2011-01-01 Andrew McMillan * [AwlCache] Added: A Simple Memcached wrapper supporting namespaces. 2010-12-28 Andrew McMillan * The real release 0.46 :-) * Really going to release 0.46 this time... * [classBrowser] Fix checking of ordering fieldname. * [Validation] Remove references to outdated ereg() functions. * [AWLUtlities] Rename regex checking function more appropriately. 2010-12-28 Andrew McMillan * Release 0.46 * [classBrowser] Fix checking of ordering fieldname. * [Validation] Remove references to outdated ereg() functions. * [AWLUtlities] Rename regex checking function more appropriately. * [Session] Don't use ereg() for parsing regex. * [XMLDocument] Use __construct style for constructor. 2010-12-24 Andrew McMillan * [AwlQuery] Make the quote() method public/static. 2010-12-23 Andrew McMillan * Convert everything except PgQuery to use AwlQuery * [AwlQuery] Add minor missing functionality so we can switch. * [vComponent] Improve parameter splitting to allow for escapes. * [classEditor] Avoid uninitialised variable warning. 2010-11-27 Andrew McMillan * [vComponent] Add __toString() methods. * [Session] If someone is made inactive then their long-term login should cease. 2010-10-15 Andrew McMillan * [AWLUtilities] Add an awl_version() function. 2010-10-10 Andrew McMillan * [vComponent] It is OK to SetComponents() to an empty set. 2010-09-20 Andrew McMillan * [AWLDbDialect] Quote hex numbers as strings. 2010-09-11 Andrew McMillan * [iCalendar/vComponent/vEvent] UTF8 mode for RFC5545 wrap regexes 2010-09-10 Andrew McMillan * [AWLUtilities] Undeclared globals in force_utf8. * [iCalendar,vEvent,vComponent] Fix the line wrapping in V* components. 2010-08-30 Andrew McMillan * [vComponent] Add a function to return a single property. * Slightly better TZname to Olson matching. 2010-08-28 Andrew McMillan * [vComponent] Various changes in use with VCard. - Enforce upercase property names. - Invert array sense for MaskComponents / MaskProperties to match the way it is with the GetProperties, GetComponents. 2010-08-26 Andrew McMillan * Add some basic filter processing for addressbook-query usage. * Wrap password logging in logs behind $c->dbg['password'] = 1; 2010-06-23 Andrew McMillan * [XMLDocument] Add helper for CardDAVElement. 2010-06-17 Andrew McMillan * [Session] Try and clarify the lost password text a little better. * Don't send multipart/form-data if the form is GET. 2010-05-28 Andrew McMillan * [AwlQuery] Fixing backward compatibility with PgQuery. * [AwlQuery] Fix handling of queries with no parameters. 2010-05-27 Andrew McMillan * [iCalendar] Apply correct wrapping for RFC5545. * [iCalendar] Don't add a trailling space when wrapping for RFC5545. 2010-05-19 Andrew McMillan * [vComponent] Generic base class for handling VCALENDAR, VCARD, etc. * Expose transaction state at query level. * No need to return anything from the schema update. 2010-05-09 Andrew McMillan * [Translation] If gettext is not installed, fall back to English. 2010-05-08 Andrew McMillan * Add Australia to the list of possible TZ continents. 2010-04-28 Andrew McMillan * [AwlQuery] Handle setting an alternative connection somewhat better. * [Session] _CheckLogin needs to access $c for external authentication. * Allow for multiple records to have somehow got into the DB. * Better parameter escaping, including escaping ? for older PHP::PDO. 2010-04-20 Andrew McMillan * Replace deprecated split() calls. 2010-04-17 Andrew McMillan * Release 0.43 2010-04-15 Andrew McMillan * [iCalendar] Add and use a new olson_from_tzstring() function. 2010-04-14 Andrew McMillan * We can close this bug now, since it was fixed a wee while ago. * [AwlQuery] Warn if named parameters are passed in incorrectly. * Fix strange alternate reality definition of aparche_read_header. 2010-04-12 Andrew McMillan * Preparing to release 0.43 * The new database libraries should be with the library code. Especially since they're being used for more than just DAViCal now. karora@dave:~/projects/awl$ gitlog-to-changelog --since=2010-04-13 2010-09-11 Andrew McMillan * [vComponent] Tweak wrapping one last time. * [iCalendar/vComponent/vEvent] UTF8 mode for RFC5545 wrap regexes The regexes used for wrapping to 72 characters in line with RFC5545 wrapping rules need to be UTF8 aware, otherwise they will break lines in the middle of UTF8 sequences and we get to fail to put both broken parts into the database. 2010-09-10 Andrew McMillan * [AWLUtilities] Undeclared globals in force_utf8. * Ignore Eclipse droppings. * [iCalendar,vEvent,vComponent] Fix the line wrapping in V* components. The wordwrap was not being done in a repeatably reversible manner due to a misguided effort to make it more readable. This gives up on readability in favour of reversability. 2010-09-02 Andrew McMillan * [vComponent] Revert that last change. 2010-08-30 Andrew McMillan * [vComponent] Add a function to return a single property. * Slightly better TZname to Olson matching. 2010-08-28 Andrew McMillan * [vComponent] Various changes in use with VCard. - Enforce upercase property names. - Invert array sense for MaskComponents / MaskProperties to match the way it is with the GetProperties, GetComponents. - Generally improve the consistency. 2010-08-26 Andrew McMillan * Add some basic filter processing for addressbook-query usage. * Wrap password logging in logs behind $c->dbg['password'] = 1; 2010-06-23 Andrew McMillan * [XMLDocument] Add helper for CardDAVElement. 2010-06-17 Andrew McMillan * [Session] Try and clarify the lost password text a little better. * Don't send multipart/form-data if the form is GET. 2010-05-28 Andrew McMillan * [AwlQuery] Fixing backward compatibility with PgQuery. * [AwlQuery] Fix handling of queries with no parameters. 2010-05-27 Andrew McMillan * [iCalendar] Apply correct wrapping for RFC5545. * [iCalendar] Don't add a trailling space when wrapping for RFC5545. 2010-05-19 Andrew McMillan * [vComponent] Generic base class for handling VCALENDAR, VCARD, etc. * Expose transaction state at query level. * No need to return anything from the schema update. 2010-05-09 Andrew McMillan * [Translation] If gettext is not installed, fall back to English. 2010-05-08 Andrew McMillan * Add Australia to the list of possible TZ continents. 2010-04-28 Andrew McMillan * [AwlQuery] Handle setting an alternative connection somewhat better. * [Session] _CheckLogin needs to access $c for external authentication. * Allow for multiple records to have somehow got into the DB. * Better parameter escaping, including escaping ? for older PHP::PDO. 2010-04-20 Andrew McMillan * Replace deprecated split() calls. 2010-04-17 Andrew McMillan * Release 0.43 2010-04-15 Andrew McMillan * [iCalendar] Add and use a new olson_from_tzstring() function. 2010-04-14 Andrew McMillan * We can close this bug now, since it was fixed a wee while ago. * [AwlQuery] Warn if named parameters are passed in incorrectly. * Fix strange alternate reality definition of aparche_read_header. 2010-04-12 Andrew McMillan * [AwlQuery] Move new database libraries into AWL 2010-04-01 Andrew McMillan * [classEditor] Tidy up logging. * [DataUpdate] Merge sql_from_post() and sql_from_object(). 2010-03-21 Andrew McMillan * [PgQuery] Add forward compatibility rows() method. 2010-03-18 Andrew McMillan * [iCalendar] Provide a better deprecation indication. * [iCalendar] Add explicit need for PgQuery and mark stuff deprecated. 2010-03-10 Andrew McMillan * Switch to LGPL v3 license. 2010-03-08 Andrew McMillan * Release 0.42 * [XMLDocument] Return any created node. Also parse namespace in tag. These functions are much more useful if we can actually use any returned reference as another location within a document, so we can have a hold of the root, and then add within each new tag we add, supporting outer -> inner construction approaches along with the existing inner -> outer approach used currently. 2010-03-07 Andrew McMillan * Note that the iCalendar class is DEPRECATED. * Don't try to translate null/empty strings. 2010-03-05 Andrew McMillan * Add a PostToValues() method to update form data from POST. 2010-02-23 Andrew McMillan * Release 0.41 * [classEditor] Make Create/Apply form translatable. * [User] Yes/No should be translatable. 2010-02-18 Andrew McMillan * [PgQuery] Don't log connection string on error as it may expose the password. 2010-02-17 Andrew McMillan * [DataUpdate] Translate empty string to NULL for bitfields. 2010-02-16 Andrew McMillan * [AWLUtilities] Add support for a legacy plain MD5 password hash 2010-02-01 Andrew McMillan * Move editor widget class into standard libraries. 2010-01-30 Andrew McMillan * [MenuSet] Remove deprecated backward compatibility with PHP4. * Comply with E_STRICT and friends. * [PgQuery] Make duration() conditional in case it is defined elsewhere. 2009-12-28 Andrew McMillan * [XMLElement] Make all properties protected, provide __tostring() 2009-12-27 Andrew McMillan * [XMLDocument] Fix for NS helpers assigning used NS alias. 2009-11-22 Andrew McMillan * [classBrowser] Add a Title() get/set method. * [AWLUtilties] Support precision in type names. 2009-11-17 Andrew McMillan * [XMLElement] Looking for the xmlns attribute should return it. 2009-11-14 Andrew McMillan * Remove opportunity for unassigned value warning. * [XMLElement] Allow the GetElements() method to be called with no tag. 2009-11-11 Andrew McMillan * [AWLUtilities] More generic implementation of request_headers. 2009-11-03 Andrew McMillan * [iCalendar] Comment a bunch of debugging messages. 2009-10-30 Matthias Mohr * Add translation features. 2009-10-20 Andrew McMillan * Restructure the external link handling. * Add an option for links to open in a new tab/page. 2009-10-16 Andrew McMillan * [Session] Allow username/e-mail for forgotten password to be case-insensitive. 2009-09-25 Andrew McMillan * [DataEntry] Remove uninitialised warning possibility. * [XMLDocument] Remove uninitialised warning possibilty. * [iCalendar] Remove deprecated function. Add some convenience methods. * [classBrowser] Add new replaceable variable for row even/odd ness. 2009-09-07 Andrew McMillan * [AWLUtilities] Add a fix_latin() function to convert mixed charset into UTF-8. 2008-08-25 Andrew McMillan * [PgQuery] Extend clean_string to recurse through an array. * [DataUpdate] When value for an integer is null or empty string, use db NULL. 2009-06-25 Andrew McMillan * [PgQuery] Add the ability for PgQuery to search a non-default schema. 2009-06-22 Andrew McMillan * Release 0.37 awl-0.53.orig/inc/0000755000000000000000000000000011774765552010645 5ustar awl-0.53.orig/inc/classBrowser.php0000644000000000000000000007020611760653201014012 0ustar * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later */ require_once("AWLUtilities.php"); /** * Ensure that this is not set elsewhere. */ $BrowserCurrentRow = (object) array(); /** * BrowserColumns are the basic building blocks. You can specify just the * field name, and the column header or you can get fancy and specify an * alignment, format string, SQL formula and cell CSS class. * @package awl */ class BrowserColumn { var $Field; var $Header; var $Format; var $Sql; var $Align; var $Class; var $Type; var $Translatable; var $Hook; var $current_row; /** * BrowserColumn constructor. Only the first parameter is mandatory. * * @param string field The name of the column in the SQL result. * @param string header The text to appear in the column header on output * (@see BrowserColumn::RenderHeader()). If this is not supplied then * a default of the field name will be used. * @param string align left|center|right - text alignment. Defaults to 'left'. * @param string format A format (a-la-printf) to render data values within. * (@see BrowserColumn::RenderValue()). If this is not supplied * then the default will ensure the column value is displayed as-is. * @param string sql Some SQL which will return the desired value to be presented as column 'field' of * the result. If this is blank then the column is assumed to be a real data column. * @param string class Additional classes to apply to the column header and column value cells. * @param string datatype This will allow 'date' or 'timestamp' to preformat the field correctly before * using it in replacements or display. Other types may be added in future. * @param string $hook The name of a global function which will preprocess the column value * * The hook function should be defined as follows: * function hookfunction( $column_value, $column_name, $database_row ) { * ... * return $value; * } */ function BrowserColumn( $field, $header="", $align="", $format="", $sql="", $class="", $datatype="", $hook=null ) { $this->Field = $field; $this->Sql = $sql; $this->Header = $header; $this->Format = $format; $this->Class = $class; $this->Align = $align; $this->Type = $datatype; $this->Translatable = false; $this->Hook = $hook; } /** * GetTarget * * Retrieves a 'field' or '...SQL... AS field' definition for the target list of the SQL. */ function GetTarget() { if ( $this->Sql == "" ) return $this->Field; return "$this->Sql AS $this->Field"; } /** * RenderHeader * Renders the column header cell for this column. This will be rendered as a ... * with class and alignment applied to it. Browser column headers are clickable, and the * ordering will also display an 'up' or 'down' triangle with the column header that the SQL * is sorted on at the moment. * * @param string order_field The name of the field currently being sorted on. * @param string order_direction Whether the sort is Ascending or Descending. * @param int browser_array_key Used this to help handle separate ordering of * multiple browsers on the same page. * @param string forced_order If true, then we don't allow order to be changed. */ function RenderHeader( $order_field, $order_direction, $browser_array_key=0, $forced_order=false ) { global $c; if ( $this->Align == "" ) $this->Align = "left"; $html = 'Class == "" ? "" : "class=\"$this->Class\"") . '>'; $direction = 'A'; $image = ""; if ( !$forced_order && $order_field == $this->Field ) { if ( strtoupper( substr( $order_direction, 0, 1) ) == 'A' ) { $image = 'down'; $direction = 'D'; } else { $image = 'up'; } $image = "images/$image.gif\" alt=\"$image\" />"; } if ( !isset($browser_array_key) || $browser_array_key == '' ) $browser_array_key = 0; if ( !$forced_order ) $html .= ' $this->Field, "d[$browser_array_key]" => $direction ) ).'" class="order">'; $html .= ($this->Header == "" ? $this->Field : $this->Header); if ( !$forced_order ) $html .= "$image"; $html .= "\n"; return $html; } function SetTranslatable() { $this->Translatable = true; } function RenderValue( $value, $extraclass = "" ) { global $session; if ( $this->Type == 'date' || $this->Type == 'timestamp') { $value = $session->FormattedDate( $value, $this->Type ); } if ( $this->Hook && function_exists($this->Hook) ) { dbg_error_log( "Browser", ":Browser: Hook for $this->Hook on column $this->Field"); $value = call_user_func( $this->Hook, $value, $this->Field, $this->current_row ); } if ( $this->Translatable ) { $value = translate($value); } $value = str_replace( "\n", "
", $value ); if ( substr(strtolower($this->Format),0,3) == "Format,$value); } else { // These quite probably don't work. The CSS standard for multiple classes is 'class="a b c"' but is lightly // implemented according to some web references. Perhaps modern browsers are better? $class = $this->Align . ($this->Class == "" ? "" : " $this->Class") . ($extraclass == "" ? "" : " $extraclass"); if ( $class != "" ) $class = ' class="'.$class.'"'; $html = sprintf('',$class); $html .= ($this->Format == "" ? $value : sprintf($this->Format,$value,$value)); $html .= "\n"; } return $html; } } /** * Start a new Browser, add columns, set a join and Render it to create a basic * list of records in a table. * You can, of course, get a lot fancier with setting ordering, where clauses * totalled columns and so forth. * @package awl */ class Browser { var $Title; var $SubTitle; var $FieldNames; var $Columns; var $HiddenColumns; var $Joins; var $Where; var $Distinct; var $Union; var $Order; var $OrderField; var $OrderDirection; var $OrderBrowserKey; var $ForcedOrder; var $Grouping; var $Limit; var $Offset; var $Query; var $BeginRow; var $CloseRow; var $BeginRowArgs; var $Totals; var $TotalFuncs; var $ExtraRows; var $match_column; var $match_value; var $match_function; var $DivOpen; var $DivClose; /** * The Browser class constructor * * @param string $title A title for the browser (optional). */ function Browser( $title = "" ) { global $c; $this->Title = $title; $this->SubTitle = ""; $this->Distinct = ""; $this->Order = ""; $this->Limit = ""; $this->Offset = ""; $this->BeginRow = "\n"; $this->CloseRow = "\n"; $this->BeginRowArgs = array('#even'); $this->Totals = array(); $this->Columns = array(); $this->HiddenColumns = array(); $this->FieldNames = array(); $this->DivOpen = '
'; $this->DivClose = '
'; $this->ForcedOrder = false; dbg_error_log( "Browser", ":Browser: New browser called $title"); } /** * Add a column to the Browser. * * This constructs a new BrowserColumn, appending it to the array of columns * in this Browser. * * Note that if the $format parameter starts with '' the format will replace * the column format, otherwise it will be used within '...' tags. * @see BrowserColumn * * @param string $field The name of the field. * @param string $header A column header for the field. * @param string $align An alignment for column values. * @param string $format A sprintf format for displaying column values. * @param string $sql An SQL fragment for calculating the value. * @param string $class A CSS class to apply to the cells of this column. * @param string $hook The name of a global function which will preprocess the column value * * The hook function should be defined as follows: * function hookfunction( $column_value, $column_name, $database_row ) { * ... * return $value; * } * */ function AddColumn( $field, $header="", $align="", $format="", $sql="", $class="", $datatype="", $hook=null ) { $this->Columns[] = new BrowserColumn( $field, $header, $align, $format, $sql, $class, $datatype, $hook ); $this->FieldNames[$field] = count($this->Columns) - 1; } /** * Add a hidden column - one that is present in the SQL result, but for * which there is no column displayed. * * This can be useful for including a value in (e.g.) clickable links or title * attributes which is not actually displayed as a visible column. * * @param string $field The name of the field. * @param string $sql An SQL fragment to calculate the field, if it is calculated. */ function AddHidden( $field, $sql="" ) { $this->HiddenColumns[] = new BrowserColumn( $field, "", "", "", $sql ); $this->FieldNames[$field] = count($this->Columns) - 1; } /** * Set the Title for the browse. * * This can also be set in the constructor but if you create a template Browser * and then clone it in a loop you may want to assign a different Title for each * instance. * * @param string $new_title The new title for the browser */ function SetTitle( $new_title ) { $this->Title = $new_title; } /** * Accessor for the Title for the browse, which could set the title also. * * @param string $new_title The new title for the browser * @return string The current title for the browser */ function Title( $new_title = null ) { if ( isset($new_title) ) $this->Title = $new_title; return $this->Title; } /** * Set the named columns to be translatable * * @param array $column_list The list of columns which are translatable */ function SetTranslatable( $column_list ) { $top = count($this->Columns); for( $i=0; $i < $top; $i++ ) { dbg_error_log( "Browser", "Comparing %s with column name list", $this->Columns[$i]->Field); if ( in_array($this->Columns[$i]->Field,$column_list) ) $this->Columns[$i]->SetTranslatable(); } $top = count($this->HiddenColumns); for( $i=0; $i < $top; $i++ ) { dbg_error_log( "Browser", "Comparing %s with column name list", $this->HiddenColumns[$i]->Field); if ( in_array($this->HiddenColumns[$i]->Field,$column_list) ) $this->HiddenColumns[$i]->SetTranslatable(); } } /** * Set a Sub Title for the browse. * * @param string $sub_title The sub title string */ function SetSubTitle( $sub_title ) { $this->SubTitle = $sub_title; } /** * Set a div for wrapping the browse. * * @param string $open_div The HTML to open the div * @param string $close_div The HTML to open the div */ function SetDiv( $open_div, $close_div ) { $this->DivOpen = $open_div; $this->DivClose = $close_div; } /** * Set the tables and joins for the SQL. * * For a single table this should just contain the name of that table, but for * multiple tables it should be the full content of the SQL 'FROM ...' clause * (excluding the actual 'FROM' keyword). * * @param string $join_list */ function SetJoins( $join_list ) { $this->Joins = $join_list; } /** * Set a Union SQL statement. * * In rare cases this might be useful. It's currently a fairly simple hack * which requires you to put an entire valid (& matching) UNION subclause * (although without the UNION keyword). * * @param string $union_select */ function SetUnion( $union_select ) { $this->Union = $union_select; } /** * Set the SQL Where clause to a specific value. * * The WHERE keyword should not be included. * * @param string $where_clause A valide SQL WHERE ... clause. */ function SetWhere( $where_clause ) { $this->Where = $where_clause; } /** * Set the SQL DISTINCT clause to a specific value. * * The whole clause (except the keyword) needs to be supplied * * @param string $distinct The whole clause, after 'DISTINCT' */ function SetDistinct( $distinct ) { $this->Distinct = "DISTINCT ".$distinct; } /** * Set the SQL LIMIT clause to a specific value. * * Only the limit number should be supplied. * * @param int $limit_n A number of rows to limit the SQL selection to */ function SetLimit( $limit_n ) { $this->Limit = "LIMIT ".intval($limit_n); } /** * Set the SQL OFFSET clause to a specific value. * * Only the offset number * * @param int $offset_n A number of rows to offset the SQL selection to, based from the start of the results. */ function SetOffset( $offset_n ) { $this->Offset = "OFFSET ".intval($offset_n); } /** * Add an [operator] ... to the SQL Where clause * * You will generally want to call OrWhere or AndWhere rather than * this function, but hey: who am I to tell you how to code! * * @param string $operator The operator to combine with previous where clause parts. * @param string $more_where The extra part of the where clause */ function MoreWhere( $operator, $more_where ) { if ( $this->Where == "" ) { $this->Where = $more_where; return; } $this->Where = "$this->Where $operator $more_where"; } /** * Add an OR ... to the SQL Where clause * * @param string $more_where The extra part of the where clause */ function AndWhere( $more_where ) { $this->MoreWhere("AND",$more_where); } /** * Add an OR ... to the SQL Where clause * * @param string $more_where The extra part of the where clause */ function OrWhere( $more_where ) { $this->MoreWhere("OR",$more_where); } function AddGrouping( $field, $browser_array_key=0 ) { if ( $this->Grouping == "" ) $this->Grouping = "GROUP BY "; else $this->Grouping .= ", "; $this->Grouping .= clean_string($field); } /** * Add an ordering to the browser widget. * * The ordering can be overridden by GET parameters which will be * rendered into the column headers so that a user can click on * the column headers to control the actual order. * * @param string $field The name of the field to be ordered by. * @param string $direction A for Ascending, otherwise it will be descending order. * @param string $browser_array_key Use this to distinguish between multiple * browser widgets on the same page. Leave it empty if you only * have a single browser instance. * @param string $secondary Use this to indicate a default secondary order * which shouldn't interfere with the default primary order. */ function AddOrder( $field, $direction, $browser_array_key=0, $secondary=0 ) { $field = check_by_regex($field,'/^[^\'"!\\\\()\[\]|*\/{}&%@~;:?<>]+$/'); if ( ! isset($this->FieldNames[$field]) ) return; if ( !isset($this->Order) || $this->Order == "" ) $this->Order = "ORDER BY "; else $this->Order .= ", "; if ( $secondary == 0 ) { $this->OrderField = $field; $this->OrderBrowserKey = $browser_array_key; } $this->Order .= $field; if ( preg_match( '/^A/i', $direction) ) { $this->Order .= " ASC"; if ( $secondary == 0) $this->OrderDirection = 'A'; } else { $this->Order .= " DESC"; if ( $secondary == 0) $this->OrderDirection = 'D'; } } /** * Force a particular ordering onto the browser widget. * * @param string $field The name of the field to be ordered by. * @param string $direction A for Ascending, otherwise it will be descending order. */ function ForceOrder( $field, $direction ) { $field = clean_string($field); if ( ! isset($this->FieldNames[$field]) ) return; if ( $this->Order == "" ) $this->Order = "ORDER BY "; else $this->Order .= ", "; $this->Order .= $field; if ( preg_match( '/^A/i', $direction) ) { $this->Order .= " ASC"; } else { $this->Order .= " DESC"; } $this->ForcedOrder = true; } /** * Set up the ordering for the browser. Generally you should call this with * the first parameter set as a field to order by default. Call with the second * parameter set to 'D' or 'DESCEND' if you want to reverse the default order. */ function SetOrdering( $default_fld=null, $default_dir='A' , $browser_array_key=0 ) { if ( isset( $_GET['o'][$browser_array_key] ) && isset($_GET['d'][$browser_array_key] ) ) { $this->AddOrder( $_GET['o'][$browser_array_key], $_GET['d'][$browser_array_key], $browser_array_key ); } else { if ( ! isset($default_fld) ) $default_fld = $this->Columns[0]; $this->AddOrder( $default_fld, $default_dir, $browser_array_key ); } } /** * Mark a column as something to be totalled. You can also specify the name of * a function which may modify the value before the actual totalling. * * The callback function will be called with each row, with the first argument * being the entire record object and the second argument being only the column * being totalled. The callback should return a number, to be added to the total. * * @param string $column_name The name of the column to be totalled. * @param string $total_function The name of the callback function. */ function AddTotal( $column_name, $total_function = false ) { $this->Totals[$column_name] = 0; if ( $total_function != false ) { $this->TotalFuncs[$column_name] = $total_function; } } /** * Retrieve the total from a totalled column * * @param string $column_name The name of the column to be totalled. */ function GetTotal( $column_name ) { return $this->Totals[$column_name]; } /** * Set the format for an output row. * * The row format is set as an sprintf format string for the start of the row, * and a plain text string for the close of the row. Subsequent arguments * are interpreted as names of fields, the values of which will be sprintf'd * into the beginrow string for each row. * * Some special field names exist beginning with the '#' character which have * 'magic' functionality, including '#even' which will insert '0' for even * rows and '1' for odd rows, allowing a nice colour alternation if the * beginrow format refers to it like: 'class="r%d"' so that even rows will * become 'class="r0"' and odd rows will be 'class="r1"'. * * At present only '#even' exists, although other magic values may be defined * in future. * * @param string $beginrow The new printf format for the start of the row. * @param string $closerow The new string for the close of the row. * @param string $rowargs ... The row arguments which will be sprintf'd into * the $beginrow format for each row */ function RowFormat( $beginrow, $closerow, $rowargs ) { $argc = func_num_args(); $this->BeginRow = func_get_arg(0); $this->CloseRow = func_get_arg(1); $this->BeginRowArgs = array(); for( $i=2; $i < $argc; $i++ ) { $this->BeginRowArgs[] = func_get_arg($i); } } /** * This method is used to build and execute the database query. * * You need not call this method, since Browser::Render() will call it for * you if you have not done so at that point. * * @return boolean The success / fail status of the AwlQuery::Exec() */ function DoQuery() { $target_fields = ""; foreach( $this->Columns AS $k => $column ) { if ( $target_fields != "" ) $target_fields .= ", "; $target_fields .= $column->GetTarget(); } if ( isset($this->HiddenColumns) ) { foreach( $this->HiddenColumns AS $k => $column ) { if ( $target_fields != "" ) $target_fields .= ", "; $target_fields .= $column->GetTarget(); } } $where_clause = ((isset($this->Where) && $this->Where != "") ? "WHERE $this->Where" : "" ); $sql = sprintf( "SELECT %s %s FROM %s %s %s ", $this->Distinct, $target_fields, $this->Joins, $where_clause, $this->Grouping ); if ( "$this->Union" != "" ) { $sql .= "UNION $this->Union "; } $sql .= $this->Order . ' ' . $this->Limit . ' ' . $this->Offset; $this->Query = new AwlQuery( $sql ); return $this->Query->Exec("Browse:$this->Title:DoQuery"); } /** * Add an extra arbitrary row onto the end of the browser. * * @var array $column_values Contains an array of named fields, hopefully matching the column names. */ function AddRow( $column_values ) { if ( !isset($this->ExtraRows) || typeof($this->ExtraRows) != 'array' ) $this->ExtraRows = array(); $this->ExtraRows[] = &$column_values; } /** * Replace a row where $column = $value with an extra arbitrary row, returned from calling $function * * @param string $column The name of a column to match * @param string $value The value to match in the column * @param string $function The name of the function to call for the matched row */ function MatchedRow( $column, $value, $function ) { $this->match_column = $column; $this->match_value = $value; $this->match_function = $function; } /** * Return values from the current row for replacing into a template. * * This is used to return values from the current row, so they can * be inserted into a row template. It is used as a callback * function for preg_replace_callback. * * @param array of string $matches An array containing a field name as offset 1 */ function ValueReplacement($matches) { // as usual: $matches[0] is the complete match // $matches[1] the match for the first subpattern // enclosed in '##...##' and so on $field_name = $matches[1]; if ( !isset($this->current_row->{$field_name}) && substr($field_name,0,4) == "URL:" ) { $field_name = substr($field_name,4); $replacement = urlencode($this->current_row->{$field_name}); } else { $replacement = (isset($this->current_row->{$field_name}) ? $this->current_row->{$field_name} : ''); } dbg_error_log( "Browser", ":ValueReplacement: Replacing %s with %s", $field_name, $replacement); return $replacement; } /** * This method is used to render the browser as HTML. If the query has * not yet been executed then this will call DoQuery to do so. * * The browser (including the title) will be displayed in a div with id="browser" so * that you can style '#browser tr.header', '#browser tr.totals' and so forth. * * @param string $title_tag The tag to use around the browser title (default 'h1') * @return string The rendered HTML fragment to display to the user. */ function Render( $title_tag = null, $subtitle_tag = null ) { global $c, $BrowserCurrentRow; if ( !isset($this->Query) ) $this->DoQuery(); // Ensure the query gets run before we render! dbg_error_log( "Browser", ":Render: browser $this->Title"); $html = $this->DivOpen; if ( $this->Title != "" ) { if ( !isset($title_tag) ) $title_tag = 'h1'; $html .= "<$title_tag>$this->Title\n"; } if ( $this->SubTitle != "" ) { if ( !isset($subtitle_tag) ) $subtitle_tag = 'h2'; $html .= "<$subtitle_tag>$this->SubTitle\n"; } $html .= "\n"; $html .= "\n"; foreach( $this->Columns AS $k => $column ) { $html .= $column->RenderHeader( $this->OrderField, $this->OrderDirection, $this->OrderBrowserKey, $this->ForcedOrder ); } $html .= "\n"; $rowanswers = array(); while( $BrowserCurrentRow = $this->Query->Fetch() ) { // Work out the answers to any stuff that may be being substituted into the row start /** @TODO: We should deprecate this approach in favour of simply doing the ValueReplacement on field names */ foreach( $this->BeginRowArgs AS $k => $fld ) { if ( isset($BrowserCurrentRow->{$fld}) ) { $rowanswers[$k] = $BrowserCurrentRow->{$fld}; } else { switch( $fld ) { case '#even': $rowanswers[$k] = ($this->Query->rownum() % 2); break; default: $rowanswers[$k] = $fld; } } } // Start the row $row_html = vsprintf( preg_replace("/#@even@#/", ($this->Query->rownum() % 2), $this->BeginRow), $rowanswers); if ( isset($this->match_column) && isset($this->match_value) && $BrowserCurrentRow->{$this->match_column} == $this->match_value ) { $row_html .= call_user_func( $this->match_function, $BrowserCurrentRow ); } else { // Each column foreach( $this->Columns AS $k => $column ) { $row_html .= $column->RenderValue( (isset($BrowserCurrentRow->{$column->Field})?$BrowserCurrentRow->{$column->Field}:'') ); if ( isset($this->Totals[$column->Field]) ) { if ( isset($this->TotalFuncs[$column->Field]) && function_exists($this->TotalFuncs[$column->Field]) ) { // Run the amount through the callback function $floatval = my_function( $row, $fieldval ); $this->Totals[$column->Field] += $this->TotalFuncs[$column->Field]( $BrowserCurrentRow, $BrowserCurrentRow->{$column->Field} ); } else { // Just add the amount $this->Totals[$column->Field] += doubleval( preg_replace( '/[^0-9.-]/', '', $BrowserCurrentRow->{$column->Field} )); } } } } // Finish the row $row_html .= preg_replace("/#@even@#/", ($this->Query->rownum() % 2), $this->CloseRow); $this->current_row = $BrowserCurrentRow; $html .= preg_replace_callback("/##([^#]+)##/", array( &$this, "ValueReplacement"), $row_html ); } if ( count($this->Totals) > 0 ) { $BrowserCurrentRow = (object) ""; $row_html = "\n"; foreach( $this->Columns AS $k => $column ) { if ( isset($this->Totals[$column->Field]) ) { $row_html .= $column->RenderValue( $this->Totals[$column->Field], "totals" ); } else { $row_html .= $column->RenderValue( "" ); } } $row_html .= "\n"; $this->current_row = $BrowserCurrentRow; $html .= preg_replace_callback("/##([^#]+)##/", array( &$this, "ValueReplacement"), $row_html ); } if ( count($this->ExtraRows) > 0 ) { foreach( $this->ExtraRows AS $k => $v ) { $BrowserCurrentRow = (object) $v; // Work out the answers to any stuff that may be being substituted into the row start foreach( $this->BeginRowArgs AS $k => $fld ) { if ( isset( $BrowserCurrentRow->{$fld} ) ) { $rowanswers[$k] = $BrowserCurrentRow->{$fld}; } else { switch( $fld ) { case '#even': $rowanswers[$k] = ($this->Query->rownum() % 2); break; default: $rowanswers[$k] = $fld; } } } // Start the row $row_html = vsprintf( preg_replace("/#@even@#/", ($this->Query->rownum() % 2), $this->BeginRow), $rowanswers); if ( isset($this->match_column) && isset($this->match_value) && $BrowserCurrentRow->{$this->match_column} == $this->match_value ) { $row_html .= call_user_func( $this->match_function, $BrowserCurrentRow ); } else { // Each column foreach( $this->Columns AS $k => $column ) { $row_html .= $column->RenderValue( (isset($BrowserCurrentRow->{$column->Field}) ? $BrowserCurrentRow->{$column->Field} : '') ); } } // Finish the row $row_html .= preg_replace("/#@even@#/", ($this->Query->rownum() % 2), $this->CloseRow); $this->current_row = $BrowserCurrentRow; $html .= preg_replace_callback("/##([^#]+)##/", array( &$this, "ValueReplacement"), $row_html ); } } $html .= "\n
\n"; $html .= $this->DivClose; return $html; } } awl-0.53.orig/inc/Validation.php0000644000000000000000000001406611632655132013440 0ustar * @copyright Catalyst IT Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later */ require_once("AWLUtilities.php"); /** * Rules used for validation of form fields. * @package awl */ class Validation { /**#@+ * @access private */ /** * List of rules for validation * @var rules */ var $rules = array(); /** * The javascript function name to call onsubmit of the form * @var func_name */ var $func_name = ""; /**#@-*/ /** * Initialise a new validation. * @param string $func_name The javascript function name to call onsubmit of the form */ function Validation($func_name) { $this->func_name = $func_name; } /** * Adds a validation rule for a specific field upon submission of the form. * You must call RenderRules below RenderFields when outputing the page * @param string $fieldname The name of the field. * @param string $error_message The message to display on unsuccessful validation. * @param string $function_name The function to call to validate the field */ function AddRule( $fieldname, $error_message, $function_name ) { $this->rules[] = array($fieldname, $error_message, $function_name ); } /** * Returns the javascript for form validation using the rules. * @param string $onsubmit The name of the function called on submission of the form. * @param string $prefix Optional prefix for form fields. * @return string HTML/Javascript for form validation. */ function RenderJavascript($prefix = "") { if(! count($this->rules) ) return ""; $html = << function $this->func_name(form) { var error_message = "";\n EOHTML; foreach($this->rules as $rule) { list($fieldname, $error_message, $function_name) = $rule; $html .= << EOHTML; return $html; } /** * Validates the form according to it's rules. * @param object $object The data object that requires form validation. * @return boolean True if the validation succeeded. */ function Validate($object) { global $c; if(! count($this->rules) ) return; $valid = true; foreach($this->rules as $rule) { list($fieldname, $error_message, $function_name) = $rule; if (!$this->$function_name($object->Get($fieldname))) { $valid = false; $c->messages[] = $error_message; } } return $valid; } /////////////////////////// // VALIDATION FUNCTIONS /////////////////////////// /** * Checks if a string is empty * @param string $field_string The field value that is being checked. * @return boolean True if the string is not empty. */ function not_empty($field_string) { return ($field_string != ""); } /** * Checks that a string is not empty or zero * @param string $select_string The select value that is being checked. * @return boolean True if the string is not empty or equal to 0. */ function selected($field_string) { return (!($field_string == "" || $field_string == "0")); } /** * Check that the given string is a positive dollar amount. * Use not_empty first if string is required. * @param string $field_string The amount to be checked. * @return boolean Returns true if the given string is a positive dollar amount. */ function positive_dollars($field_string) { if(!$field_string) return true; if( preg_match('/^\$?[0-9]*\.?[0-9]?[0-9]?$/', $field_string) ) { $field_string = preg_replace("/\$/", "", $field_string); $field_string = preg_replace("/\./", "", $field_string); if( intval($field_string) > 0 ) return true; } return false; } /** * Check that the given string is a positive integer. * Use not_empty first if string is required. * @param string $field_string The amount to be checked. * @return boolean Returns true if the given string is a positive integer. */ function positive_integer($field_string) { if(!$field_string) return true; return ( preg_match('/^[0-9]*$/', $field_string) ); } /** * Check that the given string is a valid email address. * Use not_empty first if string is required. * @param string $field_string The string to be checked. * @return boolean Returns true if the given string is a valid email address. */ function valid_email_format($field_string) { if(!$field_string) return true; // Anything printable, followed by between 1 & 5 valid domain components, with a TLD to finish $pattern = "/^[[:print:]]+@([a-z0-9][a-z0-9-]*\.){1,5}[a-z]{2,5}$/i"; return (preg_match($pattern, $field_string)); } /** * Check that the given string matches the user's date format. * Use not_empty first if string is required. * @param string $field_string The string to be checked. * @return boolean Returns true if the given string matches the user's date format from session. */ function valid_date_format($field_string) { global $session; if(!$field_string) return true; switch($session->date_format_type) { case 'J': if (!preg_match('/^([0-9]{4})[\/\-]([0-9]{1,2})[\/\-]([0-9]{1,2})$/', $field_string, $regs)) return false; $day = intval($regs[3]); $month = intval($regs[2]); $year = intval($regs[1]); break; case 'U': if (!preg_match('/^([0-9]{1,2})[\/\-]([0-9]{1,2})[\/\-]([0-9]{4})$/', $field_string, $regs)) return false; $day = intval($regs[2]); $month = intval($regs[1]); $year = intval($regs[3]); break; case 'E': default: if (!preg_match('/^([0-9]{1,2})[\/\-]([0-9]{1,2})[\/\-]([0-9]{4})$/', $field_string, $regs)) return false; $day = intval($regs[1]); $month = intval($regs[2]); $year = intval($regs[3]); } return (checkdate ($month, $day, $year)); } } awl-0.53.orig/inc/AWLUtilities.php.in0000644000000000000000000005753211651213100014261 0ustar * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL version 3 or later */ if ( !function_exists('dbg_error_log') ) { /** * Writes a debug message into the error log using printf syntax. If the first * parameter is "ERROR" then the message will _always_ be logged. * Otherwise, the first parameter is a "component" name, and will only be logged * if $c->dbg["component"] is set to some non-null value. * * If you want to see every log message then $c->dbg["ALL"] can be set, to * override the debugging status of the individual components. * * @var string $component The component to identify itself, or "ERROR", or "LOG:component" * @var string $format A format string for the log message * @var [string $parameter ...] Parameters for the format string. */ function dbg_error_log() { global $c; $args = func_get_args(); $type = "DBG"; $component = array_shift($args); if ( substr( $component, 0, 3) == "LOG" ) { // Special escape case for stuff that always gets logged. $type = 'LOG'; $component = substr($component,4); } else if ( $component == "ERROR" ) { $type = "***"; } else if ( isset($c->dbg["ALL"]) ) { $type = "ALL"; } else if ( !isset($c->dbg[strtolower($component)]) ) return; $argc = func_num_args(); if ( 2 <= $argc ) { $format = array_shift($args); } else { $format = "%s"; } @error_log( $c->sysabbr.": $type: $component:". vsprintf( $format, $args ) ); } } if ( !function_exists('fatal') ) { function fatal() { global $c; $args = func_get_args(); $argc = func_num_args(); if ( 2 <= $argc ) { $format = array_shift($args); } else { $format = "%s"; } @error_log( $c->sysabbr.": FATAL: $component:". vsprintf( $format, $args ) ); @error_log( "================= Stack Trace ===================" ); $trace = array_reverse(debug_backtrace()); array_pop($trace); foreach( $trace AS $k => $v ) { @error_log( sprintf(" ===> %s[%d] calls %s%s%s()", $v['file'], $v['line'], (isset($v['class'])?$v['class']:''), (isset($v['type'])?$v['type']:''), (isset($v['function'])?$v['function']:'') )); } echo "Fatal Error"; exit(); } } if ( !function_exists('trace_bug') ) { /** * Not as sever as a fatal() call, but we want to log and trace it */ function trace_bug() { global $c; $args = func_get_args(); $argc = func_num_args(); if ( 2 <= $argc ) { $format = array_shift($args); } else { $format = "%s"; } @error_log( $c->sysabbr.": BUG: $component:". vsprintf( $format, $args ) ); @error_log( "================= Stack Trace ===================" ); $trace = array_reverse(debug_backtrace()); array_pop($trace); foreach( $trace AS $k => $v ) { @error_log( sprintf(" ===> %s[%d] calls %s%s%s()", $v['file'], $v['line'], (isset($v['class'])?$v['class']:''), (isset($v['type'])?$v['type']:''), (isset($v['function'])?$v['function']:'') )); } } } if ( !function_exists('apache_request_headers') ) { /** * Compatibility so we can use the apache function name and still work with CGI * @package awl */ eval(' function apache_request_headers() { foreach($_SERVER as $key=>$value) { if (substr($key,0,5)=="HTTP_") { $key=str_replace(" ","-",ucwords(strtolower(str_replace("_"," ",substr($key,5))))); $out[$key]=$value; } } return $out; } '); } if ( !function_exists('dbg_log_array') ) { /** * Function to dump an array to the error log, possibly recursively * * @var string $component Which component should this log message identify itself from * @var string $name What name should this array dump identify itself as * @var array $arr The array to be dumped. * @var boolean $recursive Should the dump recurse into arrays/objects in the array */ function dbg_log_array( $component, $name, $arr, $recursive = false ) { if ( !isset($arr) || (gettype($arr) != 'array' && gettype($arr) != 'object') ) { dbg_error_log( $component, "%s: array is not set, or is not an array!", $name); return; } foreach ($arr as $key => $value) { dbg_error_log( $component, "%s: >>%s<< = >>%s<<", $name, $key, (gettype($value) == 'array' || gettype($value) == 'object' ? gettype($value) : $value) ); if ( $recursive && (gettype($value) == 'array' || (gettype($value) == 'object' && "$key" != 'self' && "$key" != 'parent') ) ) { dbg_log_array( $component, "$name"."[$key]", $value, $recursive ); } } } } if ( !function_exists("session_simple_md5") ) { /** * Make a plain MD5 hash of a string, identifying the type of hash it is * * @param string $instr The string to be salted and MD5'd * @return string The *MD5* and the MD5 of the string */ function session_simple_md5( $instr ) { global $c; if ( isset($c->dbg['password']) ) dbg_error_log( "Login", "Making plain MD5: instr=$instr, md5($instr)=".md5($instr) ); return ( '*MD5*'. md5($instr) ); } } if ( !function_exists("session_salted_md5") ) { /** * Make a salted MD5 string, given a string and (possibly) a salt. * * If no salt is supplied we will generate a random one. * * @param string $instr The string to be salted and MD5'd * @param string $salt Some salt to sprinkle into the string to be MD5'd so we don't get the same PW always hashing to the same value. * @return string The salt, a * and the MD5 of the salted string, as in SALT*SALTEDHASH */ function session_salted_md5( $instr, $salt = "" ) { if ( $salt == "" ) $salt = substr( md5(rand(100000,999999)), 2, 8); global $c; if ( isset($c->dbg['password']) ) dbg_error_log( "Login", "Making salted MD5: salt=$salt, instr=$instr, md5($salt$instr)=".md5($salt . $instr) ); return ( sprintf("*%s*%s", $salt, md5($salt . $instr) ) ); } } if ( !function_exists("session_salted_sha1") ) { /** * Make a salted SHA1 string, given a string and (possibly) a salt. PHP5 only (although it * could be made to work on PHP4 (@see http://www.openldap.org/faq/data/cache/347.html). The * algorithm used here is compatible with OpenLDAP so passwords generated through this function * should be able to be migrated to OpenLDAP by using the part following the second '*', i.e. * the '{SSHA}....' part. * * If no salt is supplied we will generate a random one. * * @param string $instr The string to be salted and SHA1'd * @param string $salt Some salt to sprinkle into the string to be SHA1'd so we don't get the same PW always hashing to the same value. * @return string A *, the salt, a * and the SHA1 of the salted string, as in *SALT*SALTEDHASH */ function session_salted_sha1( $instr, $salt = "" ) { if ( $salt == "" ) $salt = substr( str_replace('*','',base64_encode(sha1(rand(100000,9999999),true))), 2, 9); global $c; if ( isset($c->dbg['password']) ) dbg_error_log( "Login", "Making salted SHA1: salt=$salt, instr=$instr, encoded($instr$salt)=".base64_encode(sha1($instr . $salt, true).$salt) ); return ( sprintf("*%s*{SSHA}%s", $salt, base64_encode(sha1($instr.$salt, true) . $salt ) ) ); } } if ( !function_exists("session_validate_password") ) { /** * Checks what a user entered against the actual password on their account. * @param string $they_sent What the user entered. * @param string $we_have What we have in the database as their password. Which may (or may not) be a salted MD5. * @return boolean Whether or not the users attempt matches what is already on file. */ function session_validate_password( $they_sent, $we_have ) { if ( preg_match('/^\*\*.+$/', $we_have ) ) { // The "forced" style of "**plaintext" to allow easier admin setting return ( "**$they_sent" == $we_have ); } if ( preg_match('/^\*(.+)\*{[A-Z]+}.+$/', $we_have, $regs ) ) { if ( function_exists("session_salted_sha1") ) { // A nicely salted sha1sum like "**{SSHA}" $salt = $regs[1]; $sha1_sent = session_salted_sha1( $they_sent, $salt ) ; return ( $sha1_sent == $we_have ); } else { dbg_error_log( "ERROR", "Password is salted SHA-1 but you are using PHP4!" ); echo << Salted SHA1 Password format not supported with PHP4

Salted SHA1 Password format not supported with PHP4

At some point you have used PHP5 to set the password for this user and now you are using PHP4. You will need to assign a new password to this user using PHP4, or ensure you use PHP5 everywhere (recommended).

AWL has now switched to using salted SHA-1 passwords by preference in a format compatible with OpenLDAP.

EOERRMSG; exit; } } if ( preg_match('/^\*MD5\*.+$/', $we_have, $regs ) ) { // A crappy unsalted md5sum like "*MD5*" $md5_sent = session_simple_md5( $they_sent ) ; return ( $md5_sent == $we_have ); } else if ( preg_match('/^\*(.+)\*.+$/', $we_have, $regs ) ) { // A nicely salted md5sum like "**" $salt = $regs[1]; $md5_sent = session_salted_md5( $they_sent, $salt ) ; return ( $md5_sent == $we_have ); } // Anything else is bad return false; } } if ( !function_exists("replace_uri_params") ) { /** * Given a URL (presumably the current one) and a parameter, replace the value of parameter, * extending the URL as necessary if the parameter is not already there. * @param string $uri The URI we will be replacing parameters in. * @param array $replacements An array of replacement pairs array( "replace_this" => "with this" ) * @return string The URI with the replacements done. */ function replace_uri_params( $uri, $replacements ) { $replaced = $uri; foreach( $replacements AS $param => $new_value ) { $rxp = preg_replace( '/([\[\]])/', '\\\\$1', $param ); // Some parameters may be arrays. $regex = "/([&?])($rxp)=([^&]+)/"; dbg_error_log("core", "Looking for [%s] to replace with [%s] regex is %s and searching [%s]", $param, $new_value, $regex, $replaced ); if ( preg_match( $regex, $replaced ) ) $replaced = preg_replace( $regex, "\$1$param=$new_value", $replaced); else $replaced .= "&$param=$new_value"; } if ( ! preg_match( '/\?/', $replaced ) ) { $replaced = preg_replace("/&(.+)$/", "?\$1", $replaced); } $replaced = str_replace("&", "--AmPeRsAnD--", $replaced); $replaced = str_replace("&", "&", $replaced); $replaced = str_replace("--AmPeRsAnD--", "&", $replaced); dbg_error_log("core", "URI <<$uri>> morphed to <<$replaced>>"); return $replaced; } } if ( !function_exists("uuid") ) { /** * Generates a Universally Unique IDentifier, version 4. * * RFC 4122 (http://www.ietf.org/rfc/rfc4122.txt) defines a special type of Globally * Unique IDentifiers (GUID), as well as several methods for producing them. One * such method, described in section 4.4, is based on truly random or pseudo-random * number generators, and is therefore implementable in a language like PHP. * * We choose to produce pseudo-random numbers with the Mersenne Twister, and to always * limit single generated numbers to 16 bits (ie. the decimal value 65535). That is * because, even on 32-bit systems, PHP's RAND_MAX will often be the maximum *signed* * value, with only the equivalent of 31 significant bits. Producing two 16-bit random * numbers to make up a 32-bit one is less efficient, but guarantees that all 32 bits * are random. * * The algorithm for version 4 UUIDs (ie. those based on random number generators) * states that all 128 bits separated into the various fields (32 bits, 16 bits, 16 bits, * 8 bits and 8 bits, 48 bits) should be random, except : (a) the version number should * be the last 4 bits in the 3rd field, and (b) bits 6 and 7 of the 4th field should * be 01. We try to conform to that definition as efficiently as possible, generating * smaller values where possible, and minimizing the number of base conversions. * * @copyright Copyright (c) CFD Labs, 2006. This function may be used freely for * any purpose ; it is distributed without any form of warranty whatsoever. * @author David Holmes * * @return string A UUID, made up of 32 hex digits and 4 hyphens. */ function uuid() { // The field names refer to RFC 4122 section 4.1.2 return sprintf('%04x%04x-%04x-%03x4-%04x-%04x%04x%04x', mt_rand(0, 65535), mt_rand(0, 65535), // 32 bits for "time_low" mt_rand(0, 65535), // 16 bits for "time_mid" mt_rand(0, 4095), // 12 bits before the 0100 of (version) 4 for "time_hi_and_version" bindec(substr_replace(sprintf('%016b', mt_rand(0, 65535)), '01', 6, 2)), // 8 bits, the last two of which (positions 6 and 7) are 01, for "clk_seq_hi_res" // (hence, the 2nd hex digit after the 3rd hyphen can only be 1, 5, 9 or d) // 8 bits for "clk_seq_low" mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535) // 48 bits for "node" ); } } if ( !function_exists("translate") ) { require("Translation.php"); } if ( !function_exists("clone") && version_compare(phpversion(), '5.0') < 0) { /** * PHP5 screws with the assignment operator changing so that $a = $b means that * $a becomes a reference to $b. There is a clone() that we can use in PHP5, so * we have to emulate that for PHP4. Bleargh. */ eval( 'function clone($object) { return $object; }' ); } if ( !function_exists("quoted_printable_encode") ) { /** * Process a string to fit the requirements of RFC2045 section 6.7. Note that * this works, but replaces more characters than the minimum set. For readability * the spaces aren't encoded as =20 though. */ function quoted_printable_encode($string) { return preg_replace('/[^\r\n]{73}[^=\r\n]{2}/', "$0=\r\n", str_replace("%","=",str_replace("%20"," ",rawurlencode($string)))); } } if ( !function_exists("check_by_regex") ) { /** * Verify a value is OK by testing a regex against it. If it is an array apply it to * each element in the array recursively. If it is an object we don't mess * with it. */ function check_by_regex( $val, $regex ) { if ( is_null($val) ) return null; switch( $regex ) { case 'int': $regex = '#^\d+$#'; break; } if ( is_array($val) ) { foreach( $val AS $k => $v ) { $val[$k] = check_by_regex($v,$regex); } } else if ( ! is_object($val) ) { if ( preg_match( $regex, $val, $matches) ) { $val = $matches[0]; } else { $val = ''; } } return $val; } } if ( !function_exists("param_to_global") ) { /** * Convert a parameter to a global. We first look in _POST and then in _GET, * and if they passed in a bunch of valid characters, we will make sure the * incoming is cleaned to only match that set. * * @param string $varname The name of the global variable to put the answer in * @param string $match_regex The part of the parameter matching this regex will be returned * @param string $alias1 An alias for the name that we should look for first. * @param " ... More aliases, in the order which they should be examined. $varname will be appended to the end. */ function param_to_global( ) { $args = func_get_args(); $varname = array_shift($args); $GLOBALS[$varname] = null; $match_regex = null; $argc = func_num_args(); if ( $argc > 1 ) { $match_regex = array_shift($args); } $args[] = $varname; foreach( $args AS $k => $name ) { if ( isset($_POST[$name]) ) { $result = $_POST[$name]; break; } else if ( isset($_GET[$name]) ) { $result = $_GET[$name]; break; } } if ( !isset($result) ) return null; if ( isset($match_regex) ) { $result = check_by_regex( $result, $match_regex ); } $GLOBALS[$varname] = $result; return $result; } } if ( !function_exists("get_fields") ) { /** * @var array $_AWL_field_cache is a cache of the field names for a table */ $_AWL_field_cache = array(); /** * Get the names of the fields for a particular table * @param string $tablename The name of the table. * @return array of string The public fields in the table. */ function get_fields( $tablename ) { global $_AWL_field_cache; if ( !isset($_AWL_field_cache[$tablename]) ) { dbg_error_log( "core", ":get_fields: Loading fields for table '$tablename'" ); $qry = new AwlQuery(); $db = $qry->GetConnection(); $qry->SetSQL($db->GetFields($tablename)); $qry->Exec("core"); $fields = array(); while( $row = $qry->Fetch() ) { $fields[$row->fieldname] = $row->typename . ($row->precision >= 0 ? sprintf('(%d)',$row->precision) : ''); } $_AWL_field_cache[$tablename] = $fields; } return $_AWL_field_cache[$tablename]; } } if ( !function_exists("force_utf8") ) { function define_byte_mappings() { global $byte_map, $nibble_good_chars; # Needed for using Grant McLean's byte mappings code $ascii_char = '[\x00-\x7F]'; $cont_byte = '[\x80-\xBF]'; $utf8_2 = '[\xC0-\xDF]' . $cont_byte; $utf8_3 = '[\xE0-\xEF]' . $cont_byte . '{2}'; $utf8_4 = '[\xF0-\xF7]' . $cont_byte . '{3}'; $utf8_5 = '[\xF8-\xFB]' . $cont_byte . '{4}'; $nibble_good_chars = "/^($ascii_char+|$utf8_2|$utf8_3|$utf8_4|$utf8_5)(.*)$/s"; # From http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT $byte_map = array( "\x80" => "\xE2\x82\xAC", # EURO SIGN "\x82" => "\xE2\x80\x9A", # SINGLE LOW-9 QUOTATION MARK "\x83" => "\xC6\x92", # LATIN SMALL LETTER F WITH HOOK "\x84" => "\xE2\x80\x9E", # DOUBLE LOW-9 QUOTATION MARK "\x85" => "\xE2\x80\xA6", # HORIZONTAL ELLIPSIS "\x86" => "\xE2\x80\xA0", # DAGGER "\x87" => "\xE2\x80\xA1", # DOUBLE DAGGER "\x88" => "\xCB\x86", # MODIFIER LETTER CIRCUMFLEX ACCENT "\x89" => "\xE2\x80\xB0", # PER MILLE SIGN "\x8A" => "\xC5\xA0", # LATIN CAPITAL LETTER S WITH CARON "\x8B" => "\xE2\x80\xB9", # SINGLE LEFT-POINTING ANGLE QUOTATION MARK "\x8C" => "\xC5\x92", # LATIN CAPITAL LIGATURE OE "\x8E" => "\xC5\xBD", # LATIN CAPITAL LETTER Z WITH CARON "\x91" => "\xE2\x80\x98", # LEFT SINGLE QUOTATION MARK "\x92" => "\xE2\x80\x99", # RIGHT SINGLE QUOTATION MARK "\x93" => "\xE2\x80\x9C", # LEFT DOUBLE QUOTATION MARK "\x94" => "\xE2\x80\x9D", # RIGHT DOUBLE QUOTATION MARK "\x95" => "\xE2\x80\xA2", # BULLET "\x96" => "\xE2\x80\x93", # EN DASH "\x97" => "\xE2\x80\x94", # EM DASH "\x98" => "\xCB\x9C", # SMALL TILDE "\x99" => "\xE2\x84\xA2", # TRADE MARK SIGN "\x9A" => "\xC5\xA1", # LATIN SMALL LETTER S WITH CARON "\x9B" => "\xE2\x80\xBA", # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK "\x9C" => "\xC5\x93", # LATIN SMALL LIGATURE OE "\x9E" => "\xC5\xBE", # LATIN SMALL LETTER Z WITH CARON "\x9F" => "\xC5\xB8", # LATIN CAPITAL LETTER Y WITH DIAERESIS ); for( $i=160; $i < 256; $i++ ) { $ch = chr($i); $byte_map[$ch] = iconv('ISO-8859-1', 'UTF-8', $ch); } } define_byte_mappings(); function force_utf8( $input ) { global $byte_map, $nibble_good_chars; $output = ''; $char = ''; $rest = ''; while( $input != '' ) { if ( preg_match( $nibble_good_chars, $input, $matches ) ) { $output .= $matches[1]; $rest = $matches[2]; } else { preg_match( '/^(.)(.*)$/s', $input, $matches ); $char = $matches[1]; $rest = $matches[2]; if ( isset($byte_map[$char]) ) { $output .= $byte_map[$char]; } else { # Must be valid UTF8 already $output .= $char; } } $input = $rest; } return $output; } } /** * Try and extract something like "Pacific/Auckland" or "America/Indiana/Indianapolis" if possible. */ function olson_from_tzstring( $tzstring ) { global $c; if ( function_exists('timezone_identifiers_list') && in_array($tzstring,timezone_identifiers_list()) ) return $tzstring; if ( preg_match( '{((Antarctica|America|Africa|Atlantic|Asia|Australia|Indian|Europe|Pacific)/(([^/]+)/)?[^/]+)$}', $tzstring, $matches ) ) { // dbg_error_log( 'INFO', 'Found timezone "%s" from string "%s"', $matches[1], $tzstring ); return $matches[1]; } switch( $tzstring ) { case 'New Zealand Standard Time': case 'New Zealand Daylight Time': return 'Pacific/Auckland'; break; case 'Central Standard Time': case 'Central Daylight Time': case 'US/Central': return 'America/Chicago'; break; case 'Eastern Standard Time': case 'Eastern Daylight Time': case 'US/Eastern': case '(UTC-05:00) Eastern Time (US & Canada)': return 'America/New_York'; break; case 'Pacific Standard Time': case 'Pacific Daylight Time': case 'US/Pacific': return 'America/Los_Angeles'; break; case 'Mountain Standard Time': case 'Mountain Daylight Time': case 'US/Mountain': case 'Mountain Time': return 'America/Denver'; // The US 'Mountain Time' can in fact be America/(Denver|Boise|Phoenix|Shiprock) which // all vary to some extent due to differing DST rules. break; case '(GMT-07.00) Arizona': return 'America/Phoenix'; break; default: if ( isset($c->timezone_translations) && is_array($c->timezone_translations) && !empty($c->timezone_translations[$tzstring]) ) return $c->timezone_translations[$tzstring]; } return null; } if ( !function_exists("deprecated") ) { function deprecated( $method ) { global $c; if ( isset($c->dbg['ALL']) || isset($c->dbg['deprecated']) ) { $stack = debug_backtrace(); array_shift($stack); if ( preg_match( '{/inc/iCalendar.php$}', $stack[0]['file'] ) && $stack[0]['line'] > __LINE__ ) return; @error_log( sprintf( $c->sysabbr.':DEPRECATED: Call to deprecated method "%s"', $method)); foreach( $stack AS $k => $v ) { @error_log( sprintf( $c->sysabbr.': ==> called from line %4d of %s', $v['line'], $v['file'])); } } } } if ( !function_exists("gzdecode") ) { function gzdecode( $instring ) { global $c; if ( !isset($c->use_pipe_gunzip) || $c->use_pipe_gunzip ) { $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("file", "/dev/null", "a") // stderr is discarded ); $process = proc_open('gunzip',$descriptorspec, $pipes); if ( is_resource($process) ) { fwrite($pipes[0],$instring); fclose($pipes[0]); $outstring = stream_get_contents($pipes[1]); fclose($pipes[1]); proc_close($process); return $outstring; } return ''; } else { $g=tempnam('./','gz'); file_put_contents($g,$instring); ob_start(); readgzfile($g); $d=ob_get_clean(); unlink($g); return $d; } } } /** * Return the AWL version */ function awl_version() { global $c; $c->awl_library_version = 0.46; return $c->awl_library_version; }awl-0.53.orig/inc/DataEntry.php0000644000000000000000000006051311632655132013237 0ustar * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 */ require_once("AWLUtilities.php"); /** * Individual fields used for data entry / viewing. * * This object is not really intended to be used directly. The more normal * interface is to instantiate an {@link EntryForm} and then issue calls * to {@link DataEntryLine()} and other {@link EntryForm} methods. * * Understanding the operation of this class (and possibly auditing the source * code, particularly {@link EntryField::Render}) will however convey valuable * understanding of some of the more * esoteric features. * * @todo This class doesn't really provide a huge amount of utility between construct * and render, but there must be good things possible there. Perhaps one EntryField * is created and used repeatedly as a template (e.g.). That might be useful to * support... Why is this a Class anyway? Maybe we should have just done half a * dozen functions (one per major field type) and just used those... Maybe we should * build a base class for this and extend it to make EntryField in a better way. * * EntryField is only useful at present if you desperately want to use it's simple * field interface, but want to intimately control the layout (or parts of the layout), * otherwise you should be using {@link EntryForm} as the main class. * * @package awl */ class EntryField { /**#@+ * @access private */ /** * The name of the field * @var string */ var $fname; /** * The type of entry field * @var string */ var $ftype; /**#@-*/ /**#@+ * @access public */ /** * The current value * @var string */ var $current; /** * An array of key value pairs * @var string */ var $attributes; /** * Once it actually is... * @var string */ var $rendered; /**#@-*/ /** * Initialise an EntryField, used for data entry. * * The following types of fields are possible: *
    *
  • select - Will display a select list of the keys/values in $attributes where the * key starts with an underscore. The key will have the '_' removed before being used * as the key in the list. All the $attributes with keys not beginning with '_' will * be used in the normal manner as HTML attributes within the <select ...> tag.
  • *
  • lookup - Will display a select list of values from the database. * If $attributes defines a '_sql' attibute then that will be used to make * the list, otherwise the database values will be from the 'codes' table * as in "SELECT code_id, code_value FROM codes WHERE code_type = '_type' ORDER BY code_seq, code_id" * using the value of $attributes['_type'] as the code_type.
  • *
  • date - Will be a text field, expecting a date value which might be * javascript validated at some point in the future.
  • *
  • checkbox - Will display a checkbox for an on-off value.
  • *
  • textarea - Will display an HTML textarea.
  • *
  • file - Will display a file browse / enter field.
  • *
  • button - Will display a button field.
  • *
  • password - Password entry. This will display entered data as asterisks.
  • *
* * The $attributes array is useful to set specific HTML attributes within the HTML tag * used for the entry field however $attribute keys named starting with an underscore ('_') * affect the field operation rather than the HTML. For the 'select' field type, these are * simply used as the keys / values for the selection (with the '_' removed), but other * cases are more complex: *
    *
  • _help - While this will be ignored by the EntryField::Render() method the _help * should be assigned (or will be assigned the same value as the 'title' attribute) and * will (depending on the data-entry line format in force) be displayed as help for the * field by the EntryForm::DataEntryLine() method.
  • *
  • _sql - When used in a 'lookup' field this controls the SQL to return keys/values * for the list. The actual SQL should return two columns, the first will be used for * the key and the second for the displayed value.
  • *
  • _type - When used in a 'lookup' field this defines the codes type used.
  • *
  • _null - When used in a 'lookup' field this will control the description for an * option using a '' key value which will precede the list of values from the database.
  • *
  • _zero - When used in a 'lookup' field this will control the description for an * option using a '0' key value which will precede the list of values from the database.
  • *
  • _label - When used in a 'radio' or 'checkbox' field this will wrap the field * with an HTML label tag as
  • *
  • -
  • *
* * @param text $intype The type of field: * select | lookup | date | checkbox | textarea | file | button | password * (anything else is dealt with as "text") * * @param text $inname The name of the field. * * @param text $attributes An associative array of extra attributes to be applied * to the field. Optional, but generally important. Some $attribute keys have * special meaning, while others are simply added as HTML attributes to the field. * * @param text $current_value The current value to use to initialise the * field. Optional. */ function EntryField( $intype, $inname, $attributes="", $current_value="" ) { $this->ftype = $intype; $this->fname = $inname; $this->current = $current_value; if ( isset($this->{"new_$intype"}) && function_exists($this->{"new_$intype"}) ) { // Optionally call a function within this object called "new_" for setup $this->{"new_$intype"}( $attributes ); } else if ( is_array($attributes) ) { $this->attributes = $attributes; } else { } $this->rendered = ""; } /** * Render an EntryField into HTML * @see EntryField::EntryField(), EntryForm::DataEntryLine() * * @return text An HTML fragment for the data-entry field. */ function Render() { global $session; $r = "<"; dbg_error_log( "EntryField", ":Render: Name: %s, Type: %s, Current: %s", $this->fname, $this->ftype, $this->current ); $size = ""; switch ( $this->ftype ) { case "select": $r .= "select name=\"$this->fname\"%%attributes%%>"; reset( $this->attributes ); while( list($k,$v) = each( $this->attributes ) ) { if ( substr($k, 0, 1) != '_' ) continue; if ( $k == '_help' ) continue; $k = substr($k,1); $r .= "" ; } $r .= ""; break; case "lookup": $r .= "select name=\"$this->fname\"%%attributes%%>"; reset( $this->attributes ); while( list($k,$v) = each( $this->attributes ) ) { if ( substr($k, 0, 1) != '_' ) continue; $k = substr($k,1); if ( $k == 'help' || $k == "sql" || $k == "type" ) continue; if ( $k == "null" ) $k = ""; if ( $k == "zero" ) $k = "0"; $r .= "" ; } if ( isset($this->attributes["_sql"]) ) { $qry = new PgQuery( $this->attributes["_sql"] ); } else { $qry = new PgQuery( "SELECT code_id, code_value FROM codes WHERE code_type = ? ORDER BY code_seq, code_id", $this->attributes['_type'] ); } $r .= EntryField::BuildOptionList( $qry, $this->current, "rndr:$this->fname", array('translate'=>1) ); $r .= ""; break; case "date": case "timestamp": $size = ''; if ( !isset($this->attributes['size']) || $this->attributes['size'] == "" ) $size = " size=" . ($this->ftype == 'date' ? "12" : "18"); $r .= "input type=\"text\" name=\"$this->fname\"$size value=\"".$session->FormattedDate(htmlspecialchars($this->current))."\"%%attributes%%>"; break; case "checkbox": // We send a hidden field with a false value, which will be overridden by the real // field with a true value (if true) or not overridden (if false). $r .= "input type=\"hidden\" name=\"$this->fname\" value=\"off\"><"; case "radio": $checked = ""; if ( $this->current === true || $this->current == 't' || intval($this->current) == 1 || $this->current == 'on' || (isset($this->attributes['value']) && $this->current == $this->attributes['value'] ) ) $checked = " checked"; $id = "id_$this->fname" . ( $this->ftype == "radio" ? "_".$this->attributes['value'] : ""); if ( isset($this->attributes['_label']) ) { $r .= "label for=\"$id\""; if ( isset($this->attributes['class']) ) $r .= ' class="'. $this->attributes['class'] . '"'; $r .= "><"; } $r .= "input type=\"$this->ftype\" name=\"$this->fname\" id=\"$id\"$checked%%attributes%%>"; if ( isset($this->attributes['_label']) ) { $r .= " " . $this->attributes['_label']; $r .= ""; } break; case "button": $r .= "input type=\"button\" name=\"$this->fname\"%%attributes%%>"; break; case "submit": $r .= "input type=\"submit\" name=\"$this->fname\" value=\"".htmlspecialchars($this->current)."\"%%attributes%%>"; break; case "textarea": $r .= "textarea name=\"$this->fname\"%%attributes%%>$this->current"; break; case "file": if ( !isset($this->attributes['size']) || $this->attributes['size'] == "" ) $size = " size=25"; $r .= "input type=\"file\" name=\"$this->fname\"$size value=\"".htmlspecialchars($this->current)."\"%%attributes%%>"; break; case "password": $r .= "input type=\"password\" name=\"$this->fname\" value=\"".htmlspecialchars($this->current)."\"%%attributes%%>"; break; default: $r .= "input type=\"text\" name=\"$this->fname\" value=\"".htmlspecialchars($this->current)."\"%%attributes%%>"; break; } // Now process the generic attributes reset( $this->attributes ); $attribute_values = ""; while( list($k,$v) = each( $this->attributes ) ) { if ( $k == '_readonly' ) $attribute_values .= " readonly"; else if ( $k == '_disabled' ) $attribute_values .= " disabled"; if ( substr($k, 0, 1) == '_' ) continue; $attribute_values .= " $k=\"".htmlspecialchars($v)."\""; } $r = str_replace( '%%attributes%%', $attribute_values, $r ); $this->rendered = $r; return $r; } /** * Function called indirectly when a new EntryField of type 'lookup' is created. * @param array $attributes The attributes array that was passed in to the new EntryField() * constructor. */ function new_lookup( $attributes ) { $this->attributes = $attributes; } /** * Build an option list from the query. * @param string $current Default selection of drop down box (optional) * @param string $location for debugging purposes * @param array $parameters an array further parameters, including 'maxwidth' => 20 to set a maximum width * @return string Select box HTML */ static function BuildOptionList( $qry, $current = '', $location = 'options', $parameters = false ) { global $debuggroups; $result = ''; $translate = false; if ( isset($maxwidth) ) unset($maxwidth); if ( is_array($parameters) ) { if ( isset($parameters['maxwidth']) ) $maxwidth = max(4,intval($parameters['maxwidth'])); if ( isset($parameters['translate']) ) $translate = true; } // The query may not have already been executed if ( $qry->rows() > 0 || $qry->Exec($location) ) { while( $row = $qry->Fetch(true) ) { if (is_array($current)) { $selected = ( ( in_array($row[0],$current,true) || in_array($row[1],$current,true)) ? ' selected="selected"' : '' ); } else { $selected = ( ( "$row[0]" == "$current" || "$row[1]" == "$current" ) ? ' selected="selected"' : '' ); } $display_value = $row[1]; if ( isset($translate) ) $display_value = translate( $display_value ); if ( isset($maxwidth) ) $display_value = substr( $display_value, 0, $maxwidth); $nextrow = ""; $result .= $nextrow; } } return $result; } } /** * A class to handle displaying a form on the page (for editing) or a structured * layout of non-editable content (for viewing), with a simple switch to flip from * view mode to edit mode. * * @package awl */ class EntryForm { /**#@+ * @access private */ /** * The submit action for the form * @var string */ var $action; /** * The record that the form is dealing with * @var string */ var $record; /** * Whether we are editing, or not * @var string */ var $EditMode; /** * The name of the form * @var string */ var $name; /** * The CSS class of the form * @var string */ var $class; /** * Format string for lines that are breaks in the data entry field groupings * @var string */ var $break_line_format; /** * Format string for normal data entry field lines. * @var string */ var $table_line_format; /** * Format string that has been temporarily saved so we can restore it later * @var string */ var $saved_line_format; /**#@-*/ /** * Initialise a new data-entry form. * @param string $action The action when the form is submitted. * @param objectref $record A reference to the database object we are displaying / editing. * @param boolean $editmode Whether we are editing. */ function EntryForm( $action, &$record, $editing=false ) { $this->action = $action; $this->record = &$record; $this->EditMode = $editing; $this->break_line_format = '%s'."\n"; $this->table_line_format = '%s%s%s'."\n"; } /** * Initialise some more of the forms fields, possibly with a prefix * @param objectref $record A reference to the database object we are displaying / editing. * @param string $prefix A prefix to prepend to the field name. */ function PopulateForm( &$record, $prefix="" ) { foreach( $record AS $k => $v ) { $this->record->{"$prefix$k"} = $v; } } /** * Set the line format to have no help display */ function NoHelp( ) { $this->break_line_format = '%s'."\n"; $this->table_line_format = '%s%s'."\n"; } /** * Set the line format to have help displayed in the same cell as the entry field. */ function HelpInLine( ) { $this->break_line_format = '%s'."\n"; $this->table_line_format = '%s%s%s'."\n"; } /** * Set the line format to have help displayed in it's own separate cell */ function HelpInCell( ) { $this->break_line_format = '%s'."\n"; $this->table_line_format = '%s%s%s'."\n"; } /** * Set the line format to an extremely simple CSS based prompt / field layout. */ function SimpleForm( $new_format = '%s: %s' ) { $this->break_line_format = '%s'."\n"; $this->table_line_format = $new_format."\n"; } /** * Set the line format to a temporary one that we can revert from. * @param string $new_format The (optional) new format we will temporarily use. */ function TempLineFormat( $new_format = '%s: %s' ) { $this->saved_line_format = $this->table_line_format; $this->table_line_format = $new_format ."\n"; } /** * Revert the line format to what was in place before the last TempLineFormat call. */ function RevertLineFormat( ) { if ( isset($this->saved_line_format) ) { $this->table_line_format = $this->saved_line_format; } } /** * Start the actual HTML form. Return the fragment to do this. * @param array $extra_attributes Extra key/value pairs for the FORM tag. * @return string The HTML fragment for the start of the form. */ function StartForm( $extra_attributes='' ) { if ( !is_array($extra_attributes) && $extra_attributes != '' ) { list( $k, $v ) = explode( '=', $extra_attributes ); $extra_attributes = array( $k => $v ); } $extra_attributes['action'] = $this->action; if ( !isset($extra_attributes['method']) ) $extra_attributes['method'] = 'post'; if ( strtolower($extra_attributes['method']) != 'get' ) if ( !isset($extra_attributes['enctype']) ) $extra_attributes['enctype'] = 'multipart/form-data'; if ( !isset($extra_attributes['name']) ) $extra_attributes['name'] = 'form'; if ( !isset($extra_attributes['class']) ) $extra_attributes['class'] = 'formdata'; if ( !isset($extra_attributes['id']) ) $extra_attributes['id'] = $extra_attributes['name']; // Now process the generic attributes reset( $extra_attributes ); $attribute_values = ""; while( list($k,$v) = each( $extra_attributes ) ) { $attribute_values .= " $k=\"".htmlspecialchars($v)."\""; } return "\n"; } /** * Return the HTML fragment to end the form. * @return string The HTML fragment to end the form. */ function EndForm( ) { return "\n"; } /** * A utility function for a heading line within a data entry table * @return string The HTML fragment to end the form. */ function BreakLine( $text = '' ) { return sprintf( $this->break_line_format, translate($text)); } /** * A utility function for a hidden field within a data entry table * * @param string $fname The name of the field. * @param string $fvalue The value of the field. * @return string The HTML fragment for the hidden field. */ function HiddenField($fname,$fvaluei,$fid = null) { return sprintf( '%s', $fname, htmlspecialchars($fvalue), (isset($id) ? 'id="$id" ' : ''), "\n" ); } /** * Internal function for parsing the type extra on a field. * * If the '_help' attribute is not set it will be assigned the value of * the 'title' attribute, if there is one. * * If the 'class' attribute is not set it will be assigned to 'flookup', * 'fselect', etc, according to the field type. * @static * @return string The parsed type extra. */ function _ParseAttributes( $ftype = '', $attributes = '' ) { if ( !is_array($attributes) ) { if ( strpos( $attributes, '=' ) === false ) { $attributes = array(); } else { list( $k, $v ) = explode( '=', $attributes ); $attributes = array( $k => $v ); } } // Default the help to the title, or to blank if ( !isset($attributes['_help']) ) { $attributes['_help'] = ""; if ( isset($attributes['title']) ) $attributes['_help'] = $attributes['title']; } // Default the style to fdate, ftext, fcheckbox etc. if ( !isset($attributes['class']) ) { $attributes['class'] = "f$ftype"; } return $attributes; } /** * A utility function for a data entry line within a table * @return string The HTML fragment to display the data entry field */ function DataEntryField( $format, $ftype='', $base_fname='', $attributes='', $prefix='' ) { global $session; if ( ($base_fname == '' || $ftype == '') ) { // Displaying never-editable values return $format; } $fname = $prefix . $base_fname; dbg_error_log( "DataEntry", ":DataEntryField: fmt='%s', fname='%s', fvalue='%s'", $format, $fname, (isset($this->record->{$fname})?$this->record->{$fname}:'value not set') ); if ( !$this->EditMode ) { /** For some forms we prefix the field name with xxxx so it doesn't collide with the real DB field name. */ if ( !isset($this->record->{$fname}) && substr($fname,0,4) == 'xxxx' && isset($this->record->{substr($fname,4)}) ) $fname = substr($fname,4); if ( !isset($this->record->{$fname}) ) return ''; /** If it is a date, then format it according to the current user's date format type */ if ($ftype == "date" || $ftype == "timestamp") return sprintf($format, $session->FormattedDate($this->record->{$fname}) ); dbg_error_log( "DataEntry", ":DataEntryField: fmt='%s', fname='%s', fvalue='%s'", $format, $fname, (isset($this->record->{$fname})?$this->record->{$fname}:'value not set') ); return sprintf($format, $this->record->{$fname} ); } $currval = ''; // Get the default value, preferably from $_POST if ( preg_match("/^(.+)\[(.+)\]$/", $fname, $parts) ) { $p1 = $parts[1]; $p2 = $parts[2]; @dbg_error_log( "DataEntry", ":DataEntryField: fname=%s, p1=%s, p2=%s, POSTVAL=%s, \$this->record->{'%s'}['%s']=%s", $fname, $p1, $p2, $_POST[$p1][$p2], $p1, $p2, $this->record->{"$p1"}["$p2"] ); // @todo This could be changed to handle more dimensions on submitted variable names if ( isset($_POST[$p1]) ) { if ( isset($_POST[$p1][$p2]) ) { $currval = $_POST[$p1][$p2]; } } else if ( isset($this->record) && is_object($this->record) && isset($this->record->{"$p1"}["$p2"]) ) { $currval = $this->record->{"$p1"}["$p2"]; } } else { if ( isset($_POST[$fname]) ) { $currval = $_POST[$fname]; } else if ( isset($this->record) && is_object($this->record) && isset($this->record->{"$base_fname"}) ) { $currval = $this->record->{"$base_fname"}; } else if ( isset($this->record) && is_object($this->record) && isset($this->record->{"$fname"}) ) { $currval = $this->record->{"$fname"}; } } if ( $ftype == "date" ) $currval = $session->FormattedDate($currval); else if ( $ftype == "timestamp" ) $currval = $session->FormattedDate($currval, $ftype); // Now build the entry field and render it $field = new EntryField( $ftype, $fname, $this->_ParseAttributes($ftype,$attributes), $currval ); return $field->Render(); } /** * A utility function for a submit button within a data entry table * @return string The HTML fragment to display a submit button for the form. */ function SubmitButton( $fname, $fvalue, $attributes = '' ) { $field = new EntryField( 'submit', $fname, $this->_ParseAttributes('submit', $attributes), $fvalue ); return $field->Render(); } /** * A utility function for a data entry line within a table * @return string The HTML fragment to display the prompt and field. */ function DataEntryLine( $prompt, $field_format, $ftype='', $fname='', $attributes='', $prefix = '' ) { $attributes = $this->_ParseAttributes( $ftype, $attributes ); return sprintf( $this->table_line_format, $prompt, $this->DataEntryField( $field_format, $ftype, $fname, $attributes, $prefix ), $attributes['_help'] ); } /** * A utility function for a data entry line, where the prompt is a drop-down. * @return string The HTML fragment for the drop-down prompt and associated entry field. */ function MultiEntryLine( $prompt_options, $prompt_name, $default_prompt, $format, $ftype='', $fname='', $attributes='', $prefix ) { $prompt = ""; return $this->DataEntryLine( $prompt, $format, $ftype, $fname, $attributes, $prefix ); } } awl-0.53.orig/inc/AwlCache.php0000644000000000000000000001156011767730526013023 0ustar memcache_servers) && class_exists('Memcached') ) { dbg_error_log('Cache', 'Using Memcached interface connection'); self::$servers = $c->memcache_servers; self::$m = new Memcached(); foreach( self::$servers AS $v ) { dbg_error_log('Cache', 'Adding server '.$v); $server = explode(',',$v); if ( isset($server[2]) ) self::$m->addServer($server[0],$server[1],$server[2]); else self::$m->addServer($server[0],$server[1]); } self::$working = true; // Hack to allow the regression tests to flush the cache at start if ( isset($_SERVER['HTTP_X_DAVICAL_FLUSH_CACHE'])) $this->flush(); } else { dbg_error_log('Cache', 'Using NoCache dummy interface'); } } /** * So we can find out if we are actually using the cache. */ function isActive() { return self::$working; } /** * Construct a string from the namespace & key * @param unknown_type $namespace * @param unknown_type $key */ private function nskey( $namespace, $key ) { return str_replace(' ', '%20', $namespace . (isset($key) ? '~~' . $key: '')); // for now. } /** * get a value from the specified namespace / key * @param $namespace * @param $key */ function get( $namespace, $key ) { if ( !self::$working ) return false; $ourkey = self::nskey($namespace,$key); $value = self::$m->get($ourkey); // var_dump($value); // if ( $value !== false ) dbg_error_log('Cache', 'Got value for cache key "'.$ourkey.'" - '.strlen(serialize($value)).' bytes'); return $value; } /** * Set a value for the specified namespace/key, perhaps with an expiry (default 10 days) * @param $namespace * @param $key * @param $value * @param $expiry */ function set( $namespace, $key, $value, $expiry=864000 ) { if ( !self::$working ) return false; $ourkey = self::nskey($namespace,$key); $nskey = self::nskey($namespace,null); $keylist = self::$m->get( $nskey, null, $cas_token ); if ( isset($keylist) && is_array($keylist) ) { if ( !isset($keylist[$ourkey]) ) { $keylist[$ourkey] = 1; $success = self::$m->cas( $cas_token, $nskey, $keylist ); $i=0; while( !$success && $i++ < 10 && self::$m->getResultCode() == Memcached::RES_DATA_EXISTS ) { $keylist = self::$m->get( $nskey, null, $cas_token ); if ( $keylist === false ) return false; if ( isset($keylist[$ourkey]) ) break; $keylist[$ourkey] = 1; $success = self::$m->cas( $cas_token, $nskey, $keylist ); } if ( !$success ) return false; } } else { $keylist = array( $ourkey => 1 ); self::$m->set( $nskey, $keylist ); } // var_dump($value); // dbg_error_log('Cache', 'Setting value for cache key "'.$ourkey.'" - '.strlen(serialize($value)).' bytes'); return self::$m->set( $ourkey, $value, $expiry ); } /** * Delete a value from a namespace/key, or for everything in a namespace if a 'null' key is supplied. * @param $namespace * @param $key */ function delete( $namespace, $key ) { if ( !self::$working ) return false; $nskey = self::nskey($namespace,$key); dbg_error_log('Cache', 'Deleting from cache key "'.$nskey.'"'); if ( isset($key) ) { self::$m->delete( $nskey ); } else { $keylist = self::$m->get( $nskey, null, $cas_token ); if ( isset($keylist) ) { self::$m->delete( $nskey ); if ( is_array($keylist) ) { foreach( $keylist AS $k => $v ) self::$m->delete( $k ); } } } } /** * Flush the entire cache */ function flush( ) { if ( !self::$working ) return false; dbg_error_log('Cache', 'Flushing cache'); self::$m->flush(); } /** * Acquire a lock on something */ function acquireLock( $something, $wait_for = 5 ) { if ( !self::$working ) return $something; $wait_until = time() + $wait_for; while( self::$m->add('_lock_'+$something,1,5) === false && time() < $wait_until ) { usleep(10000); } return $something; } /** * Release a lock */ function releaseLock( $something ) { if ( !self::$working ) return; self::$m->delete('_lock_'+$something); } } function getCacheInstance() { static $ourCacheInstance; if ( !isset($ourCacheInstance) ) $ourCacheInstance = new AWLCache('Memcached'); return $ourCacheInstance; } awl-0.53.orig/inc/XMLDocument.php0000644000000000000000000002550311760653201013500 0ustar * @copyright Morphoss Ltd - http://www.morphoss.com/ * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL version 3 or later * */ require_once("XMLElement.php"); /** * A class for XML Documents which will contain namespaced XML elements * * @package awl */ class XMLDocument { /**#@+ * @access private */ /** * holds the namespaces which this document has been configured for. * @var namespaces */ private $namespaces; /** * holds the prefixes which are shorthand for the namespaces. * @var prefixes */ private $prefixes; /** * Holds the root document for the tree * @var root */ private $root; /** * Simple XMLDocument constructor * * @param array $namespaces An array of 'namespace' => 'prefix' pairs, where the prefix is used as a short form for the namespace. */ function __construct( $namespaces = null ) { $this->namespaces = array(); $this->prefixes = array(); if ( $namespaces != null ) { foreach( $namespaces AS $ns => $prefix ) { $this->namespaces[$ns] = $prefix; $this->prefixes[$prefix] = $prefix; } } $this->next_prefix = 0; } /** * Add a new namespace to the document, optionally specifying it's short prefix * * @param string $namespace The full namespace name to be added * @param string $prefix An optional short form for the namespace. */ function AddNamespace( $namespace, $prefix = null ) { if ( !isset($this->namespaces[$namespace]) ) { if ( isset($prefix) && ($prefix == "" || isset($this->prefixes[$prefix])) ) $prefix = null; if ( $prefix == null ) { // Try and build a prefix based on the first alphabetic character of the last element of the namespace if ( preg_match('/^(.*):([^:]+)$/', $namespace, $matches) ) { $alpha = preg_replace( '/[^a-z]/i', '', $matches[2] ); $prefix = strtoupper(substr($alpha,0,1)); } else { $prefix = 'X'; } $i = ""; if ( isset($this->prefixes[$prefix]) ) { for ( $i=1; $i<10 && isset($this->prefixes["$prefix$i"]); $i++ ) { } } if ( isset($this->prefixes["$prefix$i"]) ) { dbg_error_log("ERROR", "Cannot find a free prefix for this namespace"); exit; } $prefix = "$prefix$i"; dbg_error_log("XMLDocument", "auto-assigning prefix of '%s' for ns of '%s'", $prefix, $namespace ); } else if ( $prefix == "" || isset($this->prefixes[$prefix]) ) { dbg_error_log("ERROR", "Cannot assign the same prefix to two different namespaces"); exit; } $this->prefixes[$prefix] = $prefix; $this->namespaces[$namespace] = $prefix; } else { if ( isset($this->namespaces[$namespace]) && $this->namespaces[$namespace] != $prefix ) { dbg_error_log("ERROR", "Cannot use the same namespace with two different prefixes"); exit; } $this->prefixes[$prefix] = $prefix; $this->namespaces[$namespace] = $prefix; } } /** * Return the default namespace for this document */ function DefaultNamespace() { foreach( $this->namespaces AS $k => $v ) { if ( $v == '' ) { return $k; } } return ''; } /** * Return a tag with namespace stripped and replaced with a short form, and the ns added to the document. * */ function GetXmlNsArray() { $ns = array(); foreach( $this->namespaces AS $n => $p ) { if ( $p == "" ) $ns["xmlns"] = $n; else $ns["xmlns:$p"] = $n; } return $ns; } /** * Return a tag with namespace stripped and replaced with a short form, and the ns added to the document. * * @param string $in_tag The tag we want a namespace prefix on. * @param string $namespace The namespace we want it in (which will be parsed from $in_tag if not present * @param string $prefix The prefix we would like to use. Leave it out and one will be assigned. * * @return string The tag with a namespace prefix consistent with previous tags in this namespace. */ function Tag( $in_tag, $namespace=null, $prefix=null ) { if ( $namespace == null ) { // Attempt to split out from namespace:tag if ( preg_match('/^(.*):([^:]+)$/', $in_tag, $matches) ) { $namespace = $matches[1]; $tag = $matches[2]; } else { // There is nothing we can do here return $in_tag; } } else { $tag = $in_tag; } if ( !isset($this->namespaces[$namespace]) ) { $this->AddNamespace( $namespace, $prefix ); } $prefix = $this->namespaces[$namespace]; return $prefix . ($prefix == "" ? "" : ":") . $tag; } static public $ns_dav = 'DAV:'; static public $ns_caldav = 'urn:ietf:params:xml:ns:caldav'; static public $ns_carddav = 'urn:ietf:params:xml:ns:carddav'; static public $ns_calendarserver = 'http://calendarserver.org/ns/'; /** * Special helper for namespaced tags. * * @param object $element The tag are adding a new namespaced element to * @param string $tag the tag name, possibly prefixed with the namespace * @param mixed $content The content of the tag * @param array $attributes An array of key/value pairs of attributes. * @param string $namespace The namespace for the tag * */ function NSElement( &$element, $in_tag, $content=false, $attributes=false, $namespace=null ) { if ( $namespace == null && preg_match('/^(.*):([^:]+)$/', $in_tag, $matches) ) { $namespace = $matches[1]; if ( preg_match('{^[A-Z][A-Z0-9]*$}', $namespace ) ) { throw new Exception("Dodgy looking namespace from '".$in_tag."'!"); } $tag = $matches[2]; } else { $tag = $in_tag; if ( isset($namespace) ) { $tag = str_replace($namespace.':', '', $tag); } } if ( isset($namespace) && !isset($this->namespaces[$namespace]) ) $this->AddNamespace( $namespace ); return $element->NewElement( $tag, $content, $attributes, $namespace ); } /** * Special helper for tags in the DAV: namespace. * * @param object $element The tag are adding a new namespaced element to * @param string $tag the tag name * @param mixed $content The content of the tag * @param array $attributes An array of key/value pairs of attributes. */ function DAVElement( &$element, $tag, $content=false, $attributes=false ) { if ( !isset($this->namespaces[self::$ns_dav]) ) $this->AddNamespace( self::$ns_dav, '' ); return $this->NSElement( $element, $tag, $content, $attributes, self::$ns_dav ); } /** * Special helper for tags in the urn:ietf:params:xml:ns:caldav namespace. * * @param object $element The tag are adding a new namespaced element to * @param string $tag the tag name * @param mixed $content The content of the tag * @param array $attributes An array of key/value pairs of attributes. */ function CalDAVElement( &$element, $tag, $content=false, $attributes=false ) { if ( !isset($this->namespaces[self::$ns_caldav]) ) $this->AddNamespace( self::$ns_caldav, 'C' ); return $this->NSElement( $element, $tag, $content, $attributes, self::$ns_caldav ); } /** * Special helper for tags in the urn:ietf:params:xml:ns:carddav namespace. * * @param object $element The tag are adding a new namespaced element to * @param string $tag the tag name * @param mixed $content The content of the tag * @param array $attributes An array of key/value pairs of attributes. */ function CardDAVElement( &$element, $tag, $content=false, $attributes=false ) { if ( !isset($this->namespaces[self::$ns_carddav]) ) $this->AddNamespace( self::$ns_carddav, 'VC' ); return $this->NSElement( $element, $tag, $content, $attributes, self::$ns_carddav ); } /** * Special helper for tags in the urn:ietf:params:xml:ns:caldav namespace. * * @param object $element The tag are adding a new namespaced element to * @param string $tag the tag name * @param mixed $content The content of the tag * @param array $attributes An array of key/value pairs of attributes. */ function CalendarserverElement( &$element, $tag, $content=false, $attributes=false ) { if ( !isset($this->namespaces[self::$ns_calendarserver]) ) $this->AddNamespace( self::$ns_calendarserver, 'A' ); return $this->NSElement( $element, $tag, $content, $attributes, self::$ns_calendarserver ); } /** * @param string $in_tag The tag name of the new element, possibly namespaced * @param mixed $content Either a string of content, or an array of sub-elements * @param array $attributes An array of attribute name/value pairs * @param array $xmlns An XML namespace specifier */ function NewXMLElement( $in_tag, $content=false, $attributes=false, $xmlns=null ) { if ( $xmlns == null && preg_match('/^(.*):([^:]+)$/', $in_tag, $matches) ) { $xmlns = $matches[1]; $tagname = $matches[2]; } else { $tagname = $in_tag; } if ( isset($xmlns) && !isset($this->namespaces[$xmlns]) ) $this->AddNamespace( $xmlns ); return new XMLElement($tagname, $content, $attributes, $xmlns ); } /** * Render the document tree into (nicely formatted) XML * * @param mixed $root A root XMLElement or a tagname to create one with the remaining parameters. * @param mixed $content Either a string of content, or an array of sub-elements * @param array $attributes An array of attribute name/value pairs * @param array $xmlns An XML namespace specifier * * @return A rendered namespaced XML document. */ function Render( $root, $content=false, $attributes=false, $xmlns=null ) { if ( is_object($root) ) { /** They handed us a pre-existing object. We'll just use it... */ $this->root = $root; } else { /** We got a tag name, so we need to create the root element */ $this->root = $this->NewXMLElement( $root, $content, $attributes, $xmlns ); } /** * Add our namespace attributes here. */ foreach( $this->namespaces AS $n => $p ) { $this->root->SetAttribute( 'xmlns'.($p == '' ? '' : ':') . $p, $n); } /** And render... */ return $this->root->Render(0,''); } /** * Return a DAV::href XML element, or an array of them * @param mixed $url The URL (or array of URLs) to be wrapped in DAV::href tags * * @return XMLElement The newly created XMLElement object. */ function href($url) { if ( is_array($url) ) { $set = array(); foreach( $url AS $href ) { $set[] = $this->href( $href ); } return $set; } if ( preg_match('[@+ ]',$url) ) { trace_bug('URL "%s" was not encoded before call to XMLDocument::href()', $url ); $url = str_replace( '%2F', '/', rawurlencode($url)); } return $this->NewXMLElement('href', $url, false, 'DAV:'); } } awl-0.53.orig/inc/AwlUpgrader.php0000644000000000000000000000131111362230663013546 0ustar * @copyright Morphoss Ltd * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL version 3 or later * @compatibility Requires PHP 5.1 or later */ require_once('AwlQuery.php'); /** * Database upgrader class and associated functions * * This subpackage provides some functions that are useful around database * schema creation and changes. * */ /** * The AwlUpgrader Class. * * This class updates an Awl database to a newer schema version. * * * @package awl */ class AwlUpgrader { /** * Constructor * @return The AwlUpgrader object */ function __construct() { return $this; } } awl-0.53.orig/inc/User.php0000644000000000000000000003326411632655132012265 0ustar * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later */ require_once("AWLUtilities.php"); /** * We need to access some session information. */ require_once("Session.php"); /** * We use the DataEntry class for data display and updating */ require_once("DataEntry.php"); /** * We use the DataUpdate class and inherit from DBRecord */ require_once("DataUpdate.php"); /** * A class to handle reading, writing, viewing, editing and validating * usr records. * @package awl * @subpackage User */ class User extends DBRecord { /**#@+ * @access private */ /** * A unique user number that is auto assigned on creation and invariant thereafter * @var string */ var $user_no; /** * Something to prefix all field names with before rendering them. * @var string */ var $prefix; /**#@-*/ /** * The constructor initialises a new record, potentially reading it from the database. * @param int $id The user_no, or 0 if we are creating a new one * @param string $prefix The prefix for entry fields */ function User( $id , $prefix = "") { global $session; // Call the parent constructor $this->DBRecord(); $this->prefix = $prefix; $this->user_no = 0; $keys = array(); $id = intval("$id"); if ( $id > 0 ) { // Initialise $keys['user_no'] = $id; $this->user_no = $id; } // Initialise the record, possibly from the file. $this->Initialise('usr',$keys); $this->Read(); $this->GetRoles(); $this->EditMode = ( (isset($_GET['edit']) && $_GET['edit'] && $this->AllowedTo($this->WriteType)) || (0 == $this->user_no && $this->AllowedTo("insert") ) ); if ( $this->user_no == 0 ) { dbg_error_log("User", "Initialising new user values"); // Initialise to standard default values $this->active = true; } } /** * Can the user do this? * @param string $whatever What the user wants to do * @return boolean Whether they are allowed to. */ function AllowedTo ( $whatever ) { global $session; $rc = false; /** * First we globally short-circuit the 'admin can do anything' */ if ( $session->AllowedTo("Admin") ) { $rc = true; dbg_error_log("User",":AllowedTo: Admin is always allowed to %s", $whatever ); return $rc; } switch( strtolower($whatever) ) { case 'view': $rc = ( $this->user_no > 0 && $session->user_no == $this->user_no ); break; case 'update': $rc = ( $this->user_no > 0 && $session->user_no == $this->user_no ); break; case 'changepassword': $rc = ( ($this->user_no > 0 && $session->user_no == $this->user_no) || ("insert" == $this->WriteType) ); break; case 'changeusername': // Administrator only case 'changeactive': // Administrator only case 'admin': case 'create': case 'insert': $rc = false; break; default: $rc = ( isset($session->roles[$whatever]) && $session->roles[$whatever] ); } dbg_error_log("User",":AllowedTo: %s is%s allowed to %s", (isset($this->username)?$this->username:null), ($rc?"":" not"), $whatever ); return $rc; } /** * Get the group memberships for the user */ function GetRoles () { $this->roles = array(); $qry = new AwlQuery( 'SELECT role_name FROM role_member JOIN roles USING (role_no) WHERE user_no = ? ', $this->user_no ); if ( $qry->Exec("User") && $qry->rows() > 0 ) { while( $role = $qry->Fetch() ) { $this->roles[$role->role_name] = 't'; } } } /** * Render the form / viewer as HTML to show the user * @return string An HTML fragment to display in the page. */ function Render( ) { $html = ""; dbg_error_log("User", ":Render: type=$this->WriteType, edit_mode=$this->EditMode" ); $ef = new EntryForm( $REQUEST_URI, $this->Values, $this->EditMode ); $ef->NoHelp(); // Prefer this style, for the moment if ( $ef->EditMode ) { $html .= $ef->StartForm( array("autocomplete" => "off" ) ); if ( $this->user_no > 0 ) $html .= $ef->HiddenField( "user_no", $this->user_no ); } $html .= "\n"; $html .= $this->RenderFields($ef); $html .= $this->RenderRoles($ef); $html .= "
\n"; if ( $ef->EditMode ) { $html .= ''; $html .= $ef->EndForm(); } return $html; } /** * Render the core details to show to the user * @param object $ef The entry form. * @param string $title The title to display above the entry fields. * @return string An HTML fragment to display in the page. */ function RenderFields($ef , $title = null ) { global $session, $c; if ( $title == null ) $title = i18n("User Details"); $html = ( $title == "" ? "" : $ef->BreakLine(translate($title)) ); if ( $this->AllowedTo('ChangeUsername') ) { $html .= $ef->DataEntryLine( translate("User Name"), "%s", "text", "username", array( "size" => 20, "title" => translate("The name this user can log into the system with.")), $this->prefix ); } else { $html .= $ef->DataEntryLine( translate("User Name"), $this->Get('username') ); } if ( $ef->EditMode && $this->AllowedTo('ChangePassword') ) { $this->Set('new_password','******'); unset($_POST['new_password']); $html .= $ef->DataEntryLine( translate("New Password"), "%s", "password", "new_password", array( "size" => 20, "title" => translate("The user's password for logging in.")), $this->prefix ); $this->Set('confirm_password', '******'); unset($_POST['confirm_password']); $html .= $ef->DataEntryLine( translate("Confirm"), "%s", "password", "confirm_password", array( "size" => 20, "title" => translate("Confirm the new password.")), $this->prefix ); } $html .= $ef->DataEntryLine( translate("Full Name"), "%s", "text", "fullname", array( "size" => 50, "title" => translate("The user's full name.")), $this->prefix ); $html .= $ef->DataEntryLine( translate("EMail"), "%s", "text", "email", array( "size" => 50, "title" => translate("The user's e-mail address.")), $this->prefix ); if ( $this->AllowedTo('ChangeActive') ) { $html .= $ef->DataEntryLine( translate("Active"), ($this->Get('active') == 't'? translate('Yes') : translate('No')), "checkbox", "active", array( "_label" => translate("User is active"), "title" => translate("Is this user active?")), $this->prefix ); } else { $html .= $ef->DataEntryLine( translate("Active"), ($this->Get('active') == 't'? translate('Yes') : translate('No')) ); } $html .= $ef->DataEntryLine( translate("Date Style"), ($this->Get('date_format_type') == 'E' ? 'European' : ($this->Get('date_format_type') == 'U' ? 'US of A' : 'ISO 8861')), "select", "date_format_type", array( "title" => translate("The style of dates used for this person."), "_E" => translate("European (d/m/y)"), "_U" => translate("United States of America (m/d/y)"), "_I" => translate("ISO Format (YYYY-MM-DD)") ), $this->prefix ); if ( isset($c->default_locale) ) { if ( $this->Get('locale') == '' ) { $this->Set('locale',$c->default_locale); } $html .= $ef->DataEntryLine( translate("Language"), "%s", "lookup", "locale", array( "title" => translate("The preferred language for this person."), "_sql" => "SELECT locale, locale_name_locale FROM supported_locales ORDER BY locale ASC;" ), $this->prefix ); } $html .= $ef->DataEntryLine( translate("EMail OK"), $session->FormattedDate($this->Get('email_ok'),'timestamp'), "timestamp", "email_ok", array( "title" => translate("When the user's e-mail account was validated.")), $this->prefix ); $html .= $ef->DataEntryLine( translate("Joined"), $session->FormattedDate($this->Get('joined'),'timestamp') ); $html .= $ef->DataEntryLine( translate("Updated"), $session->FormattedDate($this->Get('updated'),'timestamp') ); $html .= $ef->DataEntryLine( translate("Last used"), $session->FormattedDate($this->Get('last_used'),'timestamp') ); return $html; } /** * Render the user's administrative roles * * @return string The string of html to be output */ function RenderRoles( $ef, $title = null ) { global $session; $html = ""; if ( $title == null ) $title = i18n("User Roles"); $html = ( $title == "" ? "" : $ef->BreakLine(translate($title)) ); $html .= ''.translate("User Roles").''; if ( $ef->EditMode ) { $sql = "SELECT role_name FROM roles "; if ( ! ($session->AllowedTo('Admin') ) ) { $sql .= "NATURAL JOIN role_member WHERE user_no=$session->user_no "; } $sql .= "ORDER BY roles.role_no"; $ef->record->roles = array(); // Select the records $q = new AwlQuery($sql); if ( $q && $q->Exec("User") && $q->rows() ) { $i=0; while( $row = $q->Fetch() ) { @dbg_error_log("User", ":RenderRoles: Is a member of '%s': %s", $row->role_name, $this->roles[$row->role_name] ); $ef->record->roles[$row->role_name] = ( isset($this->roles[$row->role_name]) ? $this->roles[$row->role_name] : 'f'); $html .= $ef->DataEntryField( "", "checkbox", "roles[$row->role_name]", array("title" => translate("Does the user have the right to perform this role?"), "_label" => translate($row->role_name) ) ); } } } else { $i = 0; foreach( $this->roles AS $k => $v ) { if ( $i++ > 0 ) $html .= ", "; $html .= $k; } } $html .= ''."\n"; return $html; } /** * Validate the information the user submitted * @return boolean Whether the form data validated OK. */ function Validate( ) { global $session, $c; dbg_error_log("User", ":Validate: Validating user"); $valid = true; if ( $this->Get('fullname') == "" ) { $c->messages[] = i18n('ERROR: The full name may not be blank.'); $valid = false; } // Password changing is a little special... unset($_POST['password']); if ( $_POST['new_password'] != "******" && $_POST['new_password'] != "" ) { if ( $_POST['new_password'] == $_POST['confirm_password'] ) { $this->Set('password',$_POST['new_password']); } else { $c->messages[] = i18n('ERROR: The new password must match the confirmed password.'); $valid = false; } } else { $this->Undefine('password'); } dbg_error_log("User", ":Validate: User %s validation", ($valid ? "passed" : "failed")); return $valid; } /** * Write the User record. * @return Success. */ function Write() { global $c, $session; if ( parent::Write() ) { $c->messages[] = i18n('User record written.'); if ( $this->WriteType == 'insert' ) { $qry = new AwlQuery( "SELECT currval('usr_user_no_seq');" ); $qry->Exec("User::Write"); $sequence_value = $qry->Fetch(true); // Fetch as an array $this->user_no = $sequence_value[0]; } else { if ( $this->user_no == $session->user_no && $this->Get("date_format_type") != $session->date_format_type ) { // Ensure we match the date style setting $session->date_format_type = $this->Get("date_format_type"); unset($_POST['email_ok']); $qry = new AwlQuery( "SET DATESTYLE TO ?;", ($this->Get("date_format_type") == 'E' ? 'European,ISO' : ($this->Get("date_format_type") == 'U' ? 'US,ISO' : 'ISO')) ); $qry->Exec(); } } return $this->WriteRoles(); } return false; } /** * Write the roles associated with the user * @return Success. */ function WriteRoles() { global $c, $session; if ( isset($_POST['roles']) && is_array($_POST['roles']) ) { $roles = ""; $params = array(); foreach( $_POST['roles'] AS $k => $v ) { if ( $v && $v != "off" ) { $roles .= ( $roles == '' ? '' : ', ' ); $roles .= AwlQuery::quote($k); } } $qry = new AwlQuery(); if ( $roles == '' ) $succeeded = $qry->QDo('DELETE FROM role_member WHERE user_no = '.$this->user_no); else { $succeeded = $qry->Begin(); $sql = 'DELETE FROM role_member WHERE user_no = '.$this->user_no; $sql .= ' AND role_no NOT IN (SELECT role_no FROM roles WHERE role_name IN ('.$roles.') )'; if ( $succeeded ) $succeeded = $qry->QDo($sql); $sql = 'INSERT INTO role_member (role_no, user_no)'; $sql .= ' SELECT role_no, '.$this->user_no.' FROM roles WHERE role_name IN ('.$roles.')'; $sql .= ' EXCEPT SELECT role_no, user_no FROM role_member'; if ( $succeeded ) $succeeded = $qry->QDo($sql); if ( $succeeded ) $qry->Commit(); else $qry->Rollback(); } if ( ! $succeeded ) { $c->messages[] = i18n('ERROR: There was a database error writing the roles information!'); $c->messages[] = i18n('Please note the time and advise the administrator of your system.'); return false; } } return true; } } awl-0.53.orig/inc/AuthPlugins.php0000644000000000000000000000625011651213100013567 0ustar authenticate_hook['config'], which might be an array, or whatever is needed. * * In order to be called: * - This file should be included * - $c->authenticate_hook['call'] should be set to the name of the plugin * - $c->authenticate_hook['config'] should be set up with any configuration data for the plugin * * @package awl * @subpackage AuthPlugin * @author Andrew McMillan * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later */ require_once('AWLUtilities.php'); require_once('DataUpdate.php'); /** * Authenticate against a different PostgreSQL database which contains a usr table in * the AWL format. * * @package awl */ function auth_other_awl( $username, $password ) { global $c; $authconn = pg_Connect($c->authenticate_hook['config']['connection']); if ( ! $authconn ) { echo <<Database Connection Failure

Database Error

Could not connect to PostgreSQL database

EOERRMSG; exit(1); } if ( isset($c->authenticate_hook['config']['columns']) ) $cols = $c->authenticate_hook['config']['columns']; else $cols = "*"; if ( isset($c->authenticate_hook['config']['where']) ) $andwhere = " AND ".$c->authenticate_hook['config']['where']; else $andwhere = ""; $qry = new AwlQuery("SELECT $cols FROM usr WHERE lower(username) = text(?) $andwhere", strtolower($username) ); $qry->SetConnection($authconn); if ( $qry->Exec('Login',__LINE,__FILE__) && $qry->rows() == 1 ) { $usr = $qry->Fetch(); if ( session_validate_password( $password, $usr->password ) ) { $qry = new AwlQuery("SELECT * FROM usr WHERE user_no = $usr->user_no;" ); if ( $qry->Exec('Login',__LINE,__FILE__) && $qry->rows() == 1 ) $type = "UPDATE"; else $type = "INSERT"; $qry = new AwlQuery( sql_from_object( $usr, $type, 'usr', "WHERE user_no=$usr->user_no" ) ); $qry->Exec('Login',__LINE__,__FILE__); /** * We disallow login by inactive users _after_ we have updated the local copy */ if ( isset($usr->active) && $usr->active == 'f' ) return false; return $usr; } } return false; } /** * Authentication has already happened. We know the username, we just need * to do the authorisation / access control. The password is ignored. * * @package awl */ function auth_external( $username, $password ) { global $c; $qry = new AwlQuery("SELECT * FROM usr WHERE active AND lower(username) = text(?) ", strtolower($username) ); if ( $qry->Exec('Login',__LINE__,__FILE__) && $qry->rows() == 1 ) { $usr = $qry->Fetch(); return $usr; } return false; } awl-0.53.orig/inc/AwlQuery.php0000644000000000000000000004602511760653201013114 0ustar * @copyright Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v3 or later * @compatibility Requires PHP 5.1 or later */ require_once('AwlDatabase.php'); /** * Database query class and associated functions * * This subpackage provides some functions that are useful around database * activity and an AwlQuery class to simplify handling of database queries. * * The class is intended to be a very lightweight wrapper with no pretentions * towards database independence, but it does include some features that have * proved useful in developing and debugging web-based applications: * - All queries are timed, and an expected time can be provided. * - Parameters replaced into the SQL will be escaped correctly in order to * minimise the chances of SQL injection errors. * - Queries which fail, or which exceed their expected execution time, will * be logged for potential further analysis. * - Debug logging of queries may be enabled globally, or restricted to * particular sets of queries. * - Simple syntax for iterating through a result set. * * This class is intended as a transitional mechanism for moving from the * PostgreSQL-specific Pg Query class to something which uses PDO in a more * replaceable manner. * */ /** * Connect to the database defined in the $c->db_connect[] (or $c->pg_connect) arrays */ function _awl_connect_configured_database() { global $c, $_awl_dbconn; /** * Attempt to connect to the configured connect strings */ $_awl_dbconn = false; if ( isset($c->db_connect) ) { $connection_strings = $c->db_connect; } elseif ( isset($c->pg_connect) ) { $connection_strings = $c->pg_connect; } foreach( $connection_strings AS $k => $v ) { $dbuser = null; $dbpass = null; if ( is_array($v) ) { $dsn = $v['dsn']; if ( isset($v['dbuser']) ) $dbuser = $v['dbuser']; if ( isset($v['dbpass']) ) $dbpass = $v['dbpass']; } elseif ( preg_match( '/^(\S+:)?(.*)( user=(\S+))?( password=(\S+))?$/', $v, $matches ) ) { $dsn = $matches[2]; if ( isset($matches[1]) && $matches[1] != '' ) { $dsn = $matches[1] . $dsn; } else { $dsn = 'pgsql:' . $dsn; } if ( isset($matches[4]) && $matches[4] != '' ) $dbuser = $matches[4]; if ( isset($matches[6]) && $matches[6] != '' ) $dbpass = $matches[6]; } if ( $_awl_dbconn = new AwlDatabase( $dsn, $dbuser, $dbpass, (isset($c->use_persistent) && $c->use_persistent ? array(PDO::ATTR_PERSISTENT => true) : null) ) ) break; } if ( ! $_awl_dbconn ) { echo <<Database Connection Failure

Database Error

Could not connect to database

EOERRMSG; exit; } if ( isset($c->db_schema) && $c->db_schema != '' ) { $_awl_dbconn->SetSearchPath( $c->db_schema . ',public' ); } $c->_awl_dbversion = $_awl_dbconn->GetVersion(); } /** * The AwlQuery Class. * * This class builds and executes SQL Queries and traverses the * set of results returned from the query. * * Example usage * * $sql = "SELECT * FROM mytable WHERE mytype = ?"; * $qry = new AwlQuery( $sql, $myunsanitisedtype ); * if ( $qry->Exec("typeselect", __line__, __file__ ) * && $qry->rows > 0 ) * { * while( $row = $qry->Fetch() ) { * do_something_with($row); * } * } * * * @package awl */ class AwlQuery { /**#@+ * @access private */ /** * Our database connection, normally copied from a global one * @var resource */ protected $connection; /** * The original query string * @var string */ protected $querystring; /** * The actual query string, after we've replaced parameters in it * @var string */ protected $bound_querystring; /** * The current array of bound parameters * @var array */ protected $bound_parameters; /** * The PDO statement handle, or null if we don't have one yet. * @var string */ protected $sth; /** * Result of the last execution * @var resource */ protected $result; /** * number of current row - use accessor to get/set * @var int */ protected $rownum = null; /** * number of rows from pg_numrows - use accessor to get value * @var int */ protected $rows; /** * The Database error information, if the query fails. * @var string */ protected $error_info; /** * Stores the query execution time - used to deal with long queries. * should be read-only * @var string */ protected $execution_time; /**#@-*/ /**#@+ * @access public */ /** * Where we called this query from so we can find it in our code! * Debugging may also be selectively enabled for a $location. * @var string */ public $location; /** * How long the query should take before a warning is issued. * * This is writable, but a method to set it might be a better interface. * The default is 0.3 seconds. * @var double */ public $query_time_warning = 0.3; /**#@-*/ /** * Constructor * @param string The query string in PDO syntax with replacable '?' characters or bindable parameters. * @param mixed The values to replace into the SQL string. * @return The AwlQuery object */ function __construct() { global $_awl_dbconn; $this->rows = null; $this->execution_time = 0; $this->error_info = null; $this->rownum = -1; if ( isset($_awl_dbconn) ) $this->connection = $_awl_dbconn; else $this->connection = null; $argc = func_num_args(); $args = func_get_args(); $this->querystring = array_shift($args); if ( 1 < $argc ) { if ( is_array($args[0]) ) $this->bound_parameters = $args[0]; else $this->bound_parameters = $args; // print_r( $this->bound_parameters ); } return $this; } /** * Use a different database connection for this query * @param resource $new_connection The database connection to use. */ function SetConnection( $new_connection, $options = null ) { if ( is_string($new_connection) || is_array($new_connection) ) { $dbuser = null; $dbpass = null; if ( is_array($new_connection) ) { $dsn = $new_connection['dsn']; if ( isset($new_connection['dbuser']) ) $dbuser = $new_connection['dbuser']; if ( isset($new_connection['dbpass']) ) $dbpass = $new_connection['dbpass']; } elseif ( preg_match( '/^(\S+:)?(.*)( user=(\S+))?( password=(\S+))?$/', $new_connection, $matches ) ) { $dsn = $matches[2]; if ( isset($matches[1]) && $matches[1] != '' ) { $dsn = $matches[1] . $dsn; } else { $dsn = 'pgsql:' . $dsn; } if ( isset($matches[4]) && $matches[4] != '' ) $dbuser = $matches[4]; if ( isset($matches[6]) && $matches[6] != '' ) $dbpass = $matches[6]; } if ( $new_connection = new AwlDatabase( $dsn, $dbuser, $dbpass, $options ) ) break; } $this->connection = $new_connection; return $new_connection; } /** * Get the current database connection for this query */ function GetConnection() { return $this->connection; } /** * Log query, optionally with file and line location of the caller. * * This function should not really be used outside of AwlQuery. For a more * useful generic logging interface consider calling dbg_error_log(...); * * @param string $locn A string identifying the calling location. * @param string $tag A tag string, e.g. identifying the type of event. * @param string $string The information to be logged. * @param int $line The line number where the logged event occurred. * @param string $file The file name where the logged event occurred. */ function _log_query( $locn, $tag, $string, $line = 0, $file = "") { // replace more than one space with one space $string = preg_replace('/\s+/', ' ', $string); if ( ($tag == 'QF' || $tag == 'SQ') && ( $line != 0 && $file != "" ) ) { dbg_error_log( "LOG-$locn", " Query: %s: %s in '%s' on line %d", ($tag == 'QF' ? 'Error' : 'Possible slow query'), $tag, $file, $line ); } while( strlen( $string ) > 0 ) { dbg_error_log( "LOG-$locn", " Query: %s: %s", $tag, substr( $string, 0, 240) ); $string = substr( "$string", 240 ); } } /** * Quote the given string so it can be safely used within string delimiters * in a query. To be avoided, in general. * * @param mixed $str Data to be converted to a string suitable for including as a value in SQL. * @return string NULL, TRUE, FALSE, a plain number, or the original string quoted and with ' and \ characters escaped */ public static function quote($str = null) { global $_awl_dbconn; if ( !isset($_awl_dbconn) ) { _awl_connect_configured_database(); } return $_awl_dbconn->Quote($str); } /** * Bind some parameters. This can be called in three ways: * 1) As Bind(':key','value), when using named parameters * 2) As Bind('value'), when using ? placeholders * 3) As Bind(array()), to overwrite the existing bound parameters. The array may * be ':name' => 'value' pairs or ordinal values, depending on whether the SQL * is using ':name' or '?' style placeholders. * * @param mixed $args See details above. */ function Bind() { $argc = func_num_args(); $args = func_get_args(); if ( $argc == 1 ) { if ( gettype($args[0]) == 'array' ) { $this->bound_parameters = $args[0]; } else { $this->bound_parameters[] = $args[0]; } } else { $this->bound_parameters[$args[0]] = $args[1]; } } /** * Tell the database to prepare the query that we will execute */ function Prepare() { global $c; if ( isset($this->sth) ) return; // Already prepared if ( isset($c->expand_pdo_parameters) && $c->expand_pdo_parameters ) return; // No-op if we're expanding internally if ( !isset($this->connection) ) { _awl_connect_configured_database(); $this->connection = $GLOBALS['_awl_dbconn']; } $this->sth = $this->connection->prepare( $this->querystring ); if ( ! $this->sth ) { $this->error_info = $this->connection->errorInfo(); } else $this->error_info = null; } /** * Tell the database to execute the query */ function Execute() { global $c; if ( !isset($this->connection) ) { _awl_connect_configured_database(); $this->connection = $GLOBALS['_awl_dbconn']; } if ( !is_object($this->connection) ) throw new Exception('Database not connected.'); if ( isset($c->expand_pdo_parameters) && $c->expand_pdo_parameters ) { $this->bound_querystring = $this->querystring; if ( isset($this->bound_parameters) ) { $this->bound_querystring = $this->connection->ReplaceParameters($this->querystring,$this->bound_parameters); // printf( "\n=============================================================== OQ\n%s\n", $this->querystring); // printf( "\n=============================================================== QQ\n%s\n", $this->bound_querystring); // print_r( $this->bound_parameters ); } $t1 = microtime(true); // get start time $this->sth = $this->connection->query($this->bound_querystring); } else { $t1 = microtime(true); // get start time $this->sth = $this->connection->prepare($this->querystring); if ( $this->sth ) $this->sth->execute($this->bound_parameters); // printf( "\n=============================================================== OQ\n%s\n", $this->querystring); // print_r( $this->bound_parameters ); } $this->bound_querystring = null; if ( ! $this->sth ) { $this->error_info = $this->connection->errorInfo(); return false; } $this->rows = $this->sth->rowCount(); $i_took = microtime(true) - $t1; $c->total_query_time += $i_took; $this->execution_time = sprintf( "%2.06lf", $i_took); $this->error_info = null; return true; } /** * Return the query string we are planning to execute */ function QueryString() { return $this->querystring; } /** * Return the parameters we are planning to substitute into the query string */ function Parameters() { return $this->bound_parameters; } /** * Return the count of rows retrieved/affected */ function rows() { return $this->rows; } /** * Return the current rownum in the retrieved set */ function rownum() { return $this->rownum; } /** * Returns the current state of a transaction, indicating if we have begun a transaction, whether the transaction * has failed, or if we are not in a transaction. * @return int 0 = not started, 1 = in progress, -1 = error pending rollback/commit */ function TransactionState() { global $_awl_dbconn; if ( !isset($this->connection) ) { if ( !isset($_awl_dbconn) ) _awl_connect_configured_database(); $this->connection = $_awl_dbconn; } return $this->connection->TransactionState(); } /** * Wrap the parent DB class Begin() so we can $qry->Begin() sometime before we $qry->Exec() */ public function Begin() { global $_awl_dbconn; if ( !isset($this->connection) ) { if ( !isset($_awl_dbconn) ) _awl_connect_configured_database(); $this->connection = $_awl_dbconn; } return $this->connection->Begin(); } /** * Wrap the parent DB class Commit() so we can $qry->Commit() sometime after we $qry->Exec() */ public function Commit() { if ( !isset($this->connection) ) { trigger_error("Cannot commit a transaction without an active statement.", E_USER_ERROR); } return $this->connection->Commit(); } /** * Wrap the parent DB class Rollback() so we can $qry->Rollback() sometime after we $qry->Exec() */ public function Rollback() { if ( !isset($this->connection) ) { trigger_error("Cannot rollback a transaction without an active statement.", E_USER_ERROR); } return $this->connection->Rollback(); } /** * Simple SetSql() class which will reset the object with the querystring from the first argument. * @param string The query string in PDO syntax with replacable '?' characters or bindable parameters. */ public function SetSql( $sql ) { $this->rows = null; $this->execution_time = 0; $this->error_info = null; $this->rownum = -1; $this->bound_parameters = null; $this->bound_querystring = null; $this->sth = null; $this->querystring = $sql; } /** * Simple QDo() class which will re-use this query for whatever was passed in, and execute it * returning the result of the Exec() call. We can't call it Do() since that's a reserved word... * @param string The query string in PDO syntax with replacable '?' characters or bindable parameters. * @param mixed The values to replace into the SQL string. * @return boolean Success (true) or Failure (false) */ public function QDo() { $argc = func_num_args(); $args = func_get_args(); $this->SetSql( array_shift($args) ); if ( 1 < $argc ) { if ( is_array($args[0]) ) $this->bound_parameters = $args[0]; else $this->bound_parameters = $args; } return $this->Exec(); } /** * Execute the query, logging any debugging. * * Example * So that you can nicely enable/disable the queries for a particular class, you * could use some of PHPs magic constants in your call. * * $qry->Exec(__CLASS__, __LINE__, __FILE__); * * * * @param string $location The name of the location for enabling debugging or just * to help our children find the source of a problem. * @param int $line The line number where Exec was called * @param string $file The file where Exec was called * @return boolean Success (true) or Failure (false) */ function Exec( $location = null, $line = null, $file = null ) { global $c; if ( isset($location) ) $this->location = trim($location); if ( !isset($this->location) || $this->location == "" ) $this->location = substr($_SERVER['PHP_SELF'],1); if ( isset($line) ) $this->location_line = intval($line); else if ( isset($this->location_line) ) $line = $this->location_line; if ( isset($file) ) $this->location_file = trim($file); else if ( isset($this->location_file) ) $file = $this->location_file; if ( isset($c->dbg['querystring']) || isset($c->dbg['ALL']) ) { $this->_log_query( $this->location, 'DBGQ', $this->querystring, $line, $file ); if ( isset($this->bound_parameters) && !isset($this->sth) ) { foreach( $this->bound_parameters AS $k => $v ) { $this->_log_query( $this->location, 'DBGQ', sprintf(' "%s" => "%s"', $k, $v), $line, $file ); } } } if ( isset($this->bound_parameters) ) { $this->Prepare(); } $success = $this->Execute(); if ( ! $success ) { // query failed $this->errorstring = sprintf( 'SQL error "%s" - %s"', $this->error_info[0], (isset($this->error_info[2]) ? $this->error_info[2] : '')); if ( isset($c->dbg['print_query_errors']) && $c->dbg['print_query_errors'] ) { printf( "\n=====================\n" ); printf( "%s[%d] QF: %s\n", $file, $line, $this->errorstring); printf( "%s\n", $this->querystring ); if ( isset($this->bound_parameters) ) { foreach( $this->bound_parameters AS $k => $v ) { printf( " %-18s \t=> '%s'\n", "'$k'", $v ); } } printf( ".....................\n" ); } $this->_log_query( $this->location, 'QF', $this->errorstring, $line, $file ); $this->_log_query( $this->location, 'QF', $this->querystring, $line, $file ); if ( isset($this->bound_parameters) && ! ( isset($c->dbg['querystring']) || isset($c->dbg['ALL']) ) ) { foreach( $this->bound_parameters AS $k => $v ) { dbg_error_log( 'LOG-'.$this->location, ' Query: QF: "%s" => "%s"', $k, $v); } } } elseif ( $this->execution_time > $this->query_time_warning ) { // if execution time is too long $this->_log_query( $this->location, 'SQ', "Took: $this->execution_time for $this->querystring", $line, $file ); // SQ == Slow Query :-) } elseif ( isset($c->dbg['querystring']) || isset($c->dbg[strtolower($this->location)]) || isset($c->dbg['ALL']) ) { // query successful, but we're debugging and want to know how long it took anyway $this->_log_query( $this->location, 'DBGQ', "Took: $this->execution_time to find $this->rows rows.", $line, $file ); } return $success; } /** * Fetch the next row from the query results * @param boolean $as_array True if thing to be returned is array * @return mixed query row */ function Fetch($as_array = false) { if ( ! $this->sth || $this->rows == 0 ) return false; // no results if ( $this->rownum == null ) $this->rownum = -1; if ( ($this->rownum + 1) >= $this->rows ) return false; // reached the end of results $this->rownum++; $row = $this->sth->fetch( ($as_array ? PDO::FETCH_NUM : PDO::FETCH_OBJ) ); return $row; } } awl-0.53.orig/inc/vComponent.php0000644000000000000000000010565211760653201013475 0ustar * @copyright Morphoss Ltd * @license http://gnu.org/copyleft/lgpl.html GNU LGPL v2 or later * */ require_once('XMLElement.php'); /** * A Class for representing properties within a vComponent (VCALENDAR or VCARD) * * @package awl */ class vProperty { /**#@+ * @access private */ /** * The name of this property * * @var string */ protected $name; /** * An array of parameters to this property, represented as key/value pairs. * * @var array */ protected $parameters; /** * The value of this property. * * @var string */ protected $content; /** * The original value that this was parsed from, if that's the way it happened. * * @var string */ protected $rendered; /**#@-*/ /** * The constructor parses the incoming string, which is formatted as per RFC2445 as a * propname[;param1=pval1[; ... ]]:propvalue * however we allow ourselves to assume that the RFC2445 content unescaping has already * happened when vComponent::ParseFrom() called vComponent::UnwrapComponent(). * * @param string $propstring The string from the vComponent which contains this property. */ function __construct( $propstring = null ) { $this->name = ""; $this->content = ""; $this->parameters = array(); unset($this->rendered); if ( $propstring != null && gettype($propstring) == 'string' ) { $this->ParseFrom($propstring); } } /** * The constructor parses the incoming string, which is formatted as per RFC2445 as a * propname[;param1=pval1[; ... ]]:propvalue * however we allow ourselves to assume that the RFC2445 content unescaping has already * happened when vComponent::ParseFrom() called vComponent::UnwrapComponent(). * * @param string $propstring The string from the vComponent which contains this property. */ function ParseFrom( $propstring ) { $this->rendered = (strlen($propstring) < 73 ? $propstring : null); // Only pre-rendered if we didn't unescape it $unescaped = preg_replace( '{\\\\[nN]}', "\n", $propstring); // Split into two parts on : which is not preceded by a \, or within quotes like "str:ing". $offset = 0; do { $splitpos = strpos($unescaped,':',$offset); $start = substr($unescaped,0,$splitpos); if ( substr($start,-1) == '\\' ) { $offset = $splitpos + 1; continue; } $quotecount = strlen(preg_replace('{[^"]}', '', $start )); if ( ($quotecount % 2) != 0 ) { $offset = $splitpos + 1; continue; } break; } while( true ); $values = substr($unescaped,$splitpos+1); $this->content = preg_replace( "/\\\\([,;:\"\\\\])/", '$1', $values); // Split on ; which is not preceded by a \ $parameters = preg_split( '{(?name = strtoupper(array_shift( $parameters )); $this->parameters = array(); foreach( $parameters AS $k => $v ) { $pos = strpos($v,'='); $name = strtoupper(substr( $v, 0, $pos)); $value = substr( $v, $pos + 1); if ( preg_match( '{^"(.*)"$}', $value, $matches) ) { $value = $matches[1]; } if ( isset($this->parameters[$name]) && is_array($this->parameters[$name]) ) { $this->parameters[$name][] = $value; } elseif ( isset($this->parameters[$name]) ) { $this->parameters[$name] = array( $this->parameters[$name], $value); } else $this->parameters[$name] = $value; } // dbg_error_log('vComponent', " vProperty::ParseFrom found '%s' = '%s' with %d parameters", $this->name, substr($this->content,0,200), count($this->parameters) ); } /** * Get/Set name property * * @param string $newname [optional] A new name for the property * * @return string The name for the property. */ function Name( $newname = null ) { if ( $newname != null ) { $this->name = strtoupper($newname); if ( isset($this->rendered) ) unset($this->rendered); // dbg_error_log('vComponent', " vProperty::Name(%s)", $this->name ); } return $this->name; } /** * Get/Set the content of the property * * @param string $newvalue [optional] A new value for the property * * @return string The value of the property. */ function Value( $newvalue = null ) { if ( $newvalue != null ) { $this->content = $newvalue; if ( isset($this->rendered) ) unset($this->rendered); } return $this->content; } /** * Get/Set parameters in their entirety * * @param array $newparams An array of new parameter key/value pairs. The 'value' may be an array of values. * * @return array The current array of parameters for the property. */ function Parameters( $newparams = null ) { if ( $newparams != null ) { $this->parameters = array(); foreach( $newparams AS $k => $v ) { $this->parameters[strtoupper($k)] = $v; } if ( isset($this->rendered) ) unset($this->rendered); } return $this->parameters; } /** * Test if our value contains a string * * @param string $search The needle which we shall search the haystack for. * * @return string The name for the property. */ function TextMatch( $search ) { if ( isset($this->content) ) return strstr( $this->content, $search ); return false; } /** * Get the value of a parameter * * @param string $name The name of the parameter to retrieve the value for * * @return string The value of the parameter */ function GetParameterValue( $name ) { $name = strtoupper($name); if ( isset($this->parameters[$name]) ) return $this->parameters[$name]; return null; } /** * Set the value of a parameter * * @param string $name The name of the parameter to set the value for * * @param string $value The value of the parameter */ function SetParameterValue( $name, $value ) { if ( isset($this->rendered) ) unset($this->rendered); $this->parameters[strtoupper($name)] = $value; // dbg_error_log('PUT', $this->name.$this->RenderParameters().':'.$this->content ); } private static function escapeParameter($p) { if ( strpos($p, ';') === false && strpos($p, ':') === false ) return $p; return '"'.str_replace('"','\\"',$p).'"'; } /** * Render the set of parameters as key1=value1[;key2=value2[; ...]] with * any colons or semicolons escaped. */ function RenderParameters() { $rendered = ""; foreach( $this->parameters AS $k => $v ) { if ( is_array($v) ) { foreach( $v AS $vv ) { $rendered .= sprintf( ';%s=%s', $k, vProperty::escapeParameter($vv) ); } } else { $rendered .= sprintf( ';%s=%s', $k, vProperty::escapeParameter($v) ); } } return $rendered; } /** * Render a suitably escaped RFC2445 content string. */ function Render( $force = false ) { // If we still have the string it was parsed in from, it hasn't been screwed with // and we can just return that without modification. if ( $force === false && isset($this->rendered) ) return $this->rendered; $property = preg_replace( '/[;].*$/', '', $this->name ); $escaped = $this->content; switch( $property ) { /** Content escaping does not apply to these properties culled from RFC2445 */ case 'ATTACH': case 'GEO': case 'PERCENT-COMPLETE': case 'PRIORITY': case 'DURATION': case 'FREEBUSY': case 'TZOFFSETFROM': case 'TZOFFSETTO': case 'TZURL': case 'ATTENDEE': case 'ORGANIZER': case 'RECURRENCE-ID': case 'URL': case 'EXRULE': case 'SEQUENCE': case 'CREATED': case 'RRULE': case 'REPEAT': case 'TRIGGER': case 'RDATE': case 'COMPLETED': case 'DTEND': case 'DUE': case 'DTSTART': case 'DTSTAMP': case 'LAST-MODIFIED': case 'CREATED': case 'EXDATE': break; /** Content escaping does not apply to these properties culled from RFC6350 / RFC2426 */ case 'ADR': case 'N': // escaping for ';' for these fields also needs to happen to the components they are built from. $escaped = str_replace( '\\', '\\\\', $escaped); $escaped = preg_replace( '/\r?\n/', '\\n', $escaped); $escaped = str_replace( ',', '\\,', $escaped); break; /** Content escaping applies by default to other properties */ default: $escaped = str_replace( '\\', '\\\\', $escaped); $escaped = preg_replace( '/\r?\n/', '\\n', $escaped); $escaped = preg_replace( "/([,;])/", '\\\\$1', $escaped); } $property = sprintf( "%s%s:", $this->name, $this->RenderParameters() ); if ( (strlen($property) + strlen($escaped)) <= 72 ) { $this->rendered = $property . $escaped; } else if ( (strlen($property) <= 72) && (strlen($escaped) <= 72) ) { $this->rendered = $property . "\r\n " . $escaped; } else { $this->rendered = preg_replace( '/(.{72})/u', '$1'."\r\n ", $property.$escaped ); } // trace_bug( 'Re-rendered "%s" property.', $this->name ); return $this->rendered; } public function __toString() { return $this->Render(); } /** * Test a PROP-FILTER or PARAM-FILTER and return a true/false * PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*)) * PARAM-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*)) * * @param array $filter An array of XMLElement defining the filter * * @return boolean Whether or not this vProperty passes the test */ function TestFilter( $filters ) { foreach( $filters AS $k => $v ) { $tag = $v->GetNSTag(); // dbg_error_log( 'vCalendar', "vProperty:TestFilter: '%s'='%s' => '%s'", $this->name, $tag, $this->content ); switch( $tag ) { case 'urn:ietf:params:xml:ns:caldav:is-defined': case 'urn:ietf:params:xml:ns:carddav:is-defined': if ( empty($this->content) ) return false; break; case 'urn:ietf:params:xml:ns:caldav:is-not-defined': case 'urn:ietf:params:xml:ns:carddav:is-not-defined': if ( ! empty($this->content) ) return false; break; case 'urn:ietf:params:xml:ns:caldav:time-range': /** @todo: While this is unimplemented here at present, most time-range tests should occur at the SQL level. */ break; case 'urn:ietf:params:xml:ns:carddav:text-match': case 'urn:ietf:params:xml:ns:caldav:text-match': $search = $v->GetContent(); $match = $this->TextMatch($search); $negate = $v->GetAttribute("negate-condition"); if ( isset($negate) && strtolower($negate) == "yes" ) { $match = !$match; } if ( ! $match ) return false; break; case 'urn:ietf:params:xml:ns:carddav:param-filter': case 'urn:ietf:params:xml:ns:caldav:param-filter': $subfilter = $v->GetContent(); $parameter = $this->GetParameterValue($v->GetAttribute("name")); if ( ! $this->TestParamFilter($subfilter,$parameter) ) return false; break; default: dbg_error_log( 'vComponent', ' vProperty::TestFilter: unhandled tag "%s"', $tag ); break; } } return true; } function TestParamFilter( $filters, $parameter_value ) { foreach( $filters AS $k => $v ) { $subtag = $v->GetNSTag(); // dbg_error_log( 'vCalendar', "vProperty:TestParamFilter: '%s'='%s' => '%s'", $this->name, $subtag, $parameter_value ); switch( $subtag ) { case 'urn:ietf:params:xml:ns:caldav:is-defined': case 'urn:ietf:params:xml:ns:carddav:is-defined': if ( empty($parameter_value) ) return false; break; case 'urn:ietf:params:xml:ns:caldav:is-not-defined': case 'urn:ietf:params:xml:ns:carddav:is-not-defined': if ( ! empty($parameter_value) ) return false; break; case 'urn:ietf:params:xml:ns:caldav:time-range': /** @todo: While this is unimplemented here at present, most time-range tests should occur at the SQL level. */ break; case 'urn:ietf:params:xml:ns:carddav:text-match': case 'urn:ietf:params:xml:ns:caldav:text-match': $search = $v->GetContent(); $match = false; if ( !empty($parameter_value) ) $match = strstr( $this->content, $search ); $negate = $v->GetAttribute("negate-condition"); if ( isset($negate) && strtolower($negate) == "yes" ) { $match = !$match; } if ( ! $match ) return false; break; default: dbg_error_log( 'vComponent', ' vProperty::TestParamFilter: unhandled tag "%s"', $tag ); break; } } return true; } } /** * A Class for representing components within an vComponent * * @package awl */ class vComponent { /**#@+ * @access private */ /** * The type of this component, such as 'VEVENT', 'VTODO', 'VTIMEZONE', 'VCARD', etc. * * @var string */ protected $type; /** * An array of properties, which are vProperty objects * * @var array */ protected $properties; /** * An array of (sub-)components, which are vComponent objects * * @var array */ protected $components; /** * The rendered result (or what was originally parsed, if there have been no changes) * * @var array */ protected $rendered; /**#@-*/ /** * A basic constructor */ function __construct( $content = null ) { $this->type = ""; $this->properties = array(); $this->components = array(); $this->rendered = ""; if ( $content != null && (gettype($content) == 'string' || gettype($content) == 'array') ) { $this->ParseFrom($content); } } /** * Collect an array of all parameters of our properties which are the specified type * Mainly used for collecting the full variety of references TZIDs */ function CollectParameterValues( $parameter_name ) { $values = array(); foreach( $this->components AS $k => $v ) { $also = $v->CollectParameterValues($parameter_name); $values = array_merge( $values, $also ); } foreach( $this->properties AS $k => $v ) { $also = $v->GetParameterValue($parameter_name); if ( isset($also) && $also != "" ) { // dbg_error_log( 'vComponent', "::CollectParameterValues(%s) : Found '%s'", $parameter_name, $also); $values[$also] = 1; } } return $values; } /** * Parse the text $content into sets of vProperty & vComponent within this vComponent * @param string $content The raw RFC2445-compliant vComponent component, including BEGIN:TYPE & END:TYPE */ function ParseFrom( $content ) { $this->rendered = $content; $content = $this->UnwrapComponent($content); $type = false; $subtype = false; $finish = null; $subfinish = null; $length = strlen($content); $linefrom = 0; while( $linefrom < $length ) { $lineto = strpos( $content, "\n", $linefrom ); if ( $lineto === false ) { $lineto = strpos( $content, "\r", $linefrom ); } if ( $lineto > 0 ) { $line = substr( $content, $linefrom, $lineto - $linefrom); $linefrom = $lineto + 1; } else { $line = substr( $content, $linefrom ); $linefrom = $length; } if ( preg_match('/^\s*$/', $line ) ) continue; $line = rtrim( $line, "\r\n" ); // dbg_error_log( 'vComponent', "::ParseFrom: Parsing line: $line"); if ( $type === false ) { if ( preg_match( '/^BEGIN:(.+)$/i', $line, $matches ) ) { // We have found the start of the main component $type = strtoupper($matches[1]); $finish = 'END:'.$type; $this->type = $type; // dbg_error_log( 'vComponent', "::ParseFrom: Start component of type '%s'", $type); } else { dbg_error_log( 'vComponent', "::ParseFrom: Ignoring crap before start of component: $line"); // unset($lines[$k]); // The content has crap before the start if ( $line != "" ) $this->rendered = null; } } else if ( $type == null ) { dbg_error_log( 'vComponent', "::ParseFrom: Ignoring crap after end of component"); if ( $line != "" ) $this->rendered = null; } else if ( strtoupper($line) == $finish ) { // dbg_error_log( 'vComponent', "::ParseFrom: End of component"); $type = null; // We have reached the end of our component } else { if ( $subtype === false && preg_match( '/^BEGIN:(.+)$/i', $line, $matches ) ) { // We have found the start of a sub-component $subtype = strtoupper($matches[1]); $subfinish = "END:$subtype"; $subcomponent = $line . "\r\n"; // dbg_error_log( 'vComponent', "::ParseFrom: Found a subcomponent '%s'", $subtype); } else if ( $subtype ) { // We are inside a sub-component $subcomponent .= $this->WrapComponent($line); if ( strtoupper($line) == $subfinish ) { // dbg_error_log( 'vComponent', "::ParseFrom: End of subcomponent '%s'", $subtype); // We have found the end of a sub-component $this->components[] = new vComponent($subcomponent); $subtype = false; } // else // dbg_error_log( 'vComponent', "::ParseFrom: Inside a subcomponent '%s'", $subtype ); } else { // dbg_error_log( 'vComponent', "::ParseFrom: Parse property of component"); // It must be a normal property line within a component. $this->properties[] = new vProperty($line); } } } } /** * This unescapes the (CRLF + linear space) wrapping specified in RFC2445. According * to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising * XML parsers often muck with it and may remove the CR. We accept either case. */ function UnwrapComponent( $content ) { return preg_replace('/\r?\n[ \t]/', '', $content ); } /** * This imposes the (CRLF + linear space) wrapping specified in RFC2445. According * to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising * XML parsers often muck with it and may remove the CR. We output RFC2445 compliance. * * In order to preserve pre-existing wrapping in the component, we split the incoming * string on line breaks before running wordwrap over each component of that. */ function WrapComponent( $content ) { $strs = preg_split( "/\r?\n/", $content ); $wrapped = ""; foreach ($strs as $str) { $wrapped .= preg_replace( '/(.{72})/u', '$1'."\r\n ", $str ) ."\r\n"; } return $wrapped; } /** * Return the type of component which this is */ function GetType() { return $this->type; } /** * Set the type of component which this is */ function SetType( $type ) { if ( isset($this->rendered) ) unset($this->rendered); $this->type = strtoupper($type); return $this->type; } /** * Return the first instance of a property of this name */ function GetProperty( $type ) { foreach( $this->properties AS $k => $v ) { if ( is_object($v) && $v->Name() == $type ) { return $v; } else if ( !is_object($v) ) { debug_error_log("ERROR", 'vComponent::GetProperty(): Trying to get %s on %s which is not an object!', $type, $v ); } } /** So we can call methods on the result of this, make sure we always return a vProperty of some kind */ return null; } /** * Return the value of the first instance of a property of this name, or null */ function GetPValue( $type ) { $p = $this->GetProperty($type); if ( isset($p) ) return $p->Value(); return null; } /** * Get all properties, or the properties matching a particular type, or matching an * array associating property names with true values: array( 'PROPERTY' => true, 'PROPERTY2' => true ) */ function GetProperties( $type = null ) { $properties = array(); $testtypes = (gettype($type) == 'string' ? array( $type => true ) : $type ); foreach( $this->properties AS $k => $v ) { if ( $type == null || (isset($testtypes[$v->Name()]) && $testtypes[$v->Name()]) ) { $properties[] = $v; } } return $properties; } /** * Clear all properties, or the properties matching a particular type * @param string|array $type The type of property - omit for all properties - or an * array associating property names with true values: array( 'PROPERTY' => true, 'PROPERTY2' => true ) */ function ClearProperties( $type = null ) { if ( $type != null ) { $testtypes = (gettype($type) == 'string' ? array( $type => true ) : $type ); // First remove all the existing ones of that type foreach( $this->properties AS $k => $v ) { if ( isset($testtypes[$v->Name()]) && $testtypes[$v->Name()] ) { unset($this->properties[$k]); if ( isset($this->rendered) ) unset($this->rendered); } } $this->properties = array_values($this->properties); } else { if ( isset($this->rendered) ) unset($this->rendered); $this->properties = array(); } } /** * Set all properties, or the ones matching a particular type */ function SetProperties( $new_properties, $type = null ) { if ( isset($this->rendered) && count($new_properties) > 0 ) unset($this->rendered); $this->ClearProperties($type); foreach( $new_properties AS $k => $v ) { $this->properties[] = $v; } } /** * Adds a new property * * @param vProperty $new_property The new property to append to the set, or a string with the name * @param string $value The value of the new property (default: param 1 is an vProperty with everything * @param array $parameters The key/value parameter pairs (default: none, or param 1 is an vProperty with everything) */ function AddProperty( $new_property, $value = null, $parameters = null ) { if ( isset($this->rendered) ) unset($this->rendered); if ( isset($value) && gettype($new_property) == 'string' ) { $new_prop = new vProperty(); $new_prop->Name($new_property); $new_prop->Value($value); if ( $parameters != null ) $new_prop->Parameters($parameters); // dbg_error_log('vComponent'," Adding new property '%s'", $new_prop->Render() ); $this->properties[] = $new_prop; } else if ( $new_property instanceof vProperty ) { $this->properties[] = $new_property; } } /** * Return number of components */ function ComponentCount() { return count($this->components); } /** * Get all sub-components, or at least get those matching a type, or failling to match, * should the second parameter be set to false. Component types may be a string or an array * associating property names with true values: array( 'TYPE' => true, 'TYPE2' => true ) * * @param mixed $type The type(s) to match (default: All) * @param boolean $normal_match Set to false to invert the match (default: true) * @return array an array of the sub-components */ function GetComponents( $type = null, $normal_match = true ) { $components = $this->components; if ( $type != null ) { $testtypes = (gettype($type) == 'string' ? array( $type => true ) : $type ); foreach( $components AS $k => $v ) { // printf( "Type: %s, %s, %s\n", $v->GetType(), // ($normal_match && isset($testtypes[$v->GetType()]) && $testtypes[$v->GetType()] ? 'true':'false'), // ( !$normal_match && (!isset($testtypes[$v->GetType()]) || !$testtypes[$v->GetType()]) ? 'true':'false') // ); if ( !($normal_match && isset($testtypes[$v->GetType()]) && $testtypes[$v->GetType()] ) && !( !$normal_match && (!isset($testtypes[$v->GetType()]) || !$testtypes[$v->GetType()])) ) { unset($components[$k]); } } $components = array_values($components); } // print_r($components); return $components; } /** * Clear all components, or the components matching a particular type * @param string $type The type of component - omit for all components */ function ClearComponents( $type = null ) { if ( $type != null ) { $testtypes = (gettype($type) == 'string' ? array( $type => true ) : $type ); // First remove all the existing ones of that type foreach( $this->components AS $k => $v ) { if ( isset($testtypes[$v->GetType()]) && $testtypes[$v->GetType()] ) { unset($this->components[$k]); if ( isset($this->rendered) ) unset($this->rendered); } else { if ( ! $this->components[$k]->ClearComponents($testtypes) ) { if ( isset($this->rendered) ) unset($this->rendered); } } } return isset($this->rendered); } else { if ( isset($this->rendered) ) unset($this->rendered); $this->components = array(); return false; } } /** * Sets some or all sub-components of the component to the supplied new components * * @param array of vComponent $new_components The new components to replace the existing ones * @param string $type The type of components to be replaced. Defaults to null, which means all components will be replaced. */ function SetComponents( $new_component, $type = null ) { if ( isset($this->rendered) ) unset($this->rendered); $this->ClearComponents($type); foreach( $new_component AS $k => $v ) { $this->components[] = $v; } } /** * Adds a new subcomponent * * @param vComponent $new_component The new component to append to the set */ function AddComponent( $new_component ) { if ( is_array($new_component) && count($new_component) == 0 ) return; if ( isset($this->rendered) ) unset($this->rendered); if ( is_array($new_component) ) { foreach( $new_component AS $k => $v ) { $this->components[] = $v; } } else { $this->components[] = $new_component; } } /** * Mask components, removing any that are not of the types in the list * @param array $keep An array of component types to be kept * @param boolean $recursive (default true) Whether to recursively MaskComponents on the ones we find */ function MaskComponents( $keep, $recursive = true ) { foreach( $this->components AS $k => $v ) { if ( !isset($keep[$v->GetType()]) ) { unset($this->components[$k]); if ( isset($this->rendered) ) unset($this->rendered); } else if ( $recursive ) { $v->MaskComponents($keep); } } } /** * Mask properties, removing any that are not in the list * @param array $keep An array of property names to be kept * @param array $component_list An array of component types to check within */ function MaskProperties( $keep, $component_list=null ) { if ( !isset($component_list) || isset($component_list[$this->type]) ) { foreach( $this->properties AS $k => $v ) { if ( !isset($keep[$v->Name()]) || !$keep[$v->Name()] ) { unset($this->properties[$k]); if ( isset($this->rendered) ) unset($this->rendered); } } } foreach( $this->components AS $k => $v ) { $v->MaskProperties($keep, $component_list); } } /** * Renders the component, possibly restricted to only the listed properties */ function Render( $restricted_properties = null, $force_rendering = false ) { $unrestricted = (!isset($restricted_properties) || count($restricted_properties) == 0); if ( !$force_rendering && isset($this->rendered) && $unrestricted ) return $this->rendered; $rendered = "BEGIN:$this->type\r\n"; foreach( $this->properties AS $k => $v ) { if ( method_exists($v, 'Render') ) { if ( $unrestricted || isset($restricted_properties[$v]) ) $rendered .= $v->Render() . "\r\n"; } } foreach( $this->components AS $v ) { $rendered .= $v->Render( $restricted_properties, $force_rendering ); } $rendered .= "END:$this->type\r\n"; $rendered = preg_replace('{(?rendered = $rendered; return $rendered; } public function __toString() { return $this->Render(); } /** * Return an array of properties matching the specified path * * @return array An array of vProperty within the tree which match the path given, in the form * [/]COMPONENT[/...]/PROPERTY in a syntax kind of similar to our poor man's XML queries. We * also allow COMPONENT and PROPERTY to be !COMPONENT and !PROPERTY for ++fun. * * @note At some point post PHP4 this could be re-done with an iterator, which should be more efficient for common use cases. */ function GetPropertiesByPath( $path ) { $properties = array(); dbg_error_log( 'vComponent', "GetPropertiesByPath: Querying within '%s' for path '%s'", $this->type, $path ); if ( !preg_match( '#(/?)(!?)([^/]+)(/?.*)$#', $path, $matches ) ) return $properties; $anchored = ($matches[1] == '/'); $inverted = ($matches[2] == '!'); $ourtest = $matches[3]; $therest = $matches[4]; dbg_error_log( 'vComponent', "GetPropertiesByPath: Matches: %s -- %s -- %s -- %s\n", $matches[1], $matches[2], $matches[3], $matches[4] ); if ( $ourtest == '*' || (($ourtest == $this->type) !== $inverted) && $therest != '' ) { if ( preg_match( '#^/(!?)([^/]+)$#', $therest, $matches ) ) { $normmatch = ($matches[1] ==''); $proptest = $matches[2]; foreach( $this->properties AS $k => $v ) { if ( $proptest == '*' || (($v->Name() == $proptest) === $normmatch ) ) { $properties[] = $v; } } } else { /** * There is more to the path, so we recurse into that sub-part */ foreach( $this->components AS $k => $v ) { $properties = array_merge( $properties, $v->GetPropertiesByPath($therest) ); } } } if ( ! $anchored ) { /** * Our input $path was not rooted, so we recurse further */ foreach( $this->components AS $k => $v ) { $properties = array_merge( $properties, $v->GetPropertiesByPath($path) ); } } dbg_error_log('vComponent', "GetPropertiesByPath: Found %d within '%s' for path '%s'\n", count($properties), $this->type, $path ); return $properties; } /** * Test a PROP-FILTER or COMP-FILTER and return a true/false * COMP-FILTER (is-defined | is-not-defined | (time-range?, prop-filter*, comp-filter*)) * PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*)) * * @param array $filter An array of XMLElement defining the filter * * @return boolean Whether or not this vComponent passes the test */ function TestFilter( $filters ) { foreach( $filters AS $k => $v ) { $tag = $v->GetNSTag(); // dbg_error_log( 'vCalendar', ":TestFilter: '%s' ", $tag ); switch( $tag ) { case 'urn:ietf:params:xml:ns:caldav:is-defined': case 'urn:ietf:params:xml:ns:carddav:is-defined': if ( count($this->properties) == 0 && count($this->components) == 0 ) return false; break; case 'urn:ietf:params:xml:ns:caldav:is-not-defined': case 'urn:ietf:params:xml:ns:carddav:is-not-defined': if ( count($this->properties) > 0 || count($this->components) > 0 ) return false; break; case 'urn:ietf:params:xml:ns:caldav:comp-filter': case 'urn:ietf:params:xml:ns:carddav:comp-filter': $subcomponents = $this->GetComponents($v->GetAttribute('name')); $subfilter = $v->GetContent(); // dbg_error_log( 'vCalendar', ":TestFilter: Found '%d' (of %d) subs of type '%s'", // count($subcomponents), count($this->components), $v->GetAttribute('name') ); $subtag = $subfilter[0]->GetNSTag(); if ( $subtag == 'urn:ietf:params:xml:ns:caldav:is-not-defined' || $subtag == 'urn:ietf:params:xml:ns:carddav:is-not-defined' ) { if ( count($properties) > 0 ) { // dbg_error_log( 'vComponent', ":TestFilter: Wanted none => false" ); return false; } } else if ( count($subcomponents) == 0 ) { if ( $subtag == 'urn:ietf:params:xml:ns:caldav:is-defined' || $subtag == 'urn:ietf:params:xml:ns:carddav:is-defined' ) { // dbg_error_log( 'vComponent', ":TestFilter: Wanted some => false" ); return false; } else { // dbg_error_log( 'vCalendar', ":TestFilter: Wanted something from missing sub-components => false" ); $negate = $subfilter[0]->GetAttribute("negate-condition"); if ( empty($negate) || strtolower($negate) != 'yes' ) return false; } } else { foreach( $subcomponents AS $kk => $subcomponent ) { if ( ! $subcomponent->TestFilter($subfilter) ) return false; } } break; case 'urn:ietf:params:xml:ns:carddav:prop-filter': case 'urn:ietf:params:xml:ns:caldav:prop-filter': $subfilter = $v->GetContent(); $properties = $this->GetProperties($v->GetAttribute("name")); dbg_error_log( 'vCalendar', ":TestFilter: Found '%d' props of type '%s'", count($properties), $v->GetAttribute('name') ); $subtag = $subfilter[0]->GetNSTag(); if ( $subtag == 'urn:ietf:params:xml:ns:caldav:is-not-defined' || $subtag == 'urn:ietf:params:xml:ns:carddav:is-not-defined' ) { if ( count($properties) > 0 ) { // dbg_error_log( 'vCalendar', ":TestFilter: Wanted none => false" ); return false; } } else if ( count($properties) == 0 ) { if ( $subtag == 'urn:ietf:params:xml:ns:caldav:is-defined' || $subtag == 'urn:ietf:params:xml:ns:carddav:is-defined' ) { // dbg_error_log( 'vCalendar', ":TestFilter: Wanted some => false" ); return false; } else { // dbg_error_log( 'vCalendar', ":TestFilter: Wanted '%s' from missing sub-properties => false", $subtag ); $negate = $subfilter[0]->GetAttribute("negate-condition"); if ( empty($negate) || strtolower($negate) != 'yes' ) return false; } } else { foreach( $properties AS $kk => $property ) { if ( !$property->TestFilter($subfilter) ) return false; } } break; } } return true; } } awl-0.53.orig/inc/vCalendar.php0000644000000000000000000003405011770573067013251 0ustar * @copyright Morphoss Ltd * @license http://gnu.org/copyleft/lgpl.html GNU LGPL v3 or later * */ require_once('vComponent.php'); class vCalendar extends vComponent { /** * These variables are mostly used to improve efficiency by caching values as they are * retrieved to speed any subsequent access. * @var string $contained_type * @var vComponent $primary_component * @var array $timezones * @var string $organizer * @var array $attendees */ private $contained_type; private $primary_component; private $timezones; private $organizer; private $attendees; private $schedule_agent; /** * Constructor. If a string is passed it will be parsed as if it was an iCalendar object, * otherwise a new vCalendar will be initialised with basic content. If an array of key value * pairs is provided they will also be used as top-level properties. * * Typically this will be used to set a METHOD property on the VCALENDAR as something like: * $shinyCalendar = new vCalendar( array('METHOD' => 'REQUEST' ) ); * * @param mixed $content Can be a string to be parsed, or an array of key value pairs. */ function __construct($content=null) { $this->contained_type = null; $this->primary_component = null; $this->timezones = array(); if ( empty($content) || is_array($content) ) { parent::__construct(); $this->SetType('VCALENDAR'); $this->AddProperty('PRODID', '-//davical.org//NONSGML AWL Calendar//EN'); $this->AddProperty('VERSION', '2.0'); $this->AddProperty('CALSCALE', 'GREGORIAN'); if ( !empty($content) ) { foreach( $content AS $k => $v ) { $this->AddProperty($k,$v); } } } else { parent::__construct($content); foreach( $this->components AS $k => $comp ) { if ( $comp->GetType() == 'VTIMEZONE' ) { $this->AddTimeZone($comp, true); } else if ( empty($this->contained_type) ) { $this->contained_type = $comp->GetType(); $this->primary_component = $comp; } } if ( !isset($this->contained_type) && !empty($this->timezones) ) $this->contained_type = 'VTIMEZONE'; } } /** * Add a timezone component to this vCalendar. */ function AddTimeZone(vComponent $vtz, $in_components=false) { $tzid = $vtz->GetPValue('TZID'); if ( empty($tzid) ) { dbg_error_log('ERROR','Ignoring invalid VTIMEZONE with no TZID parameter!'); dbg_log_array('LOG', 'vTimezone', $vtz, true); return; } $this->timezones[$tzid] = $vtz; if ( !$in_components ) $this->AddComponent($vtz); } /** * Get a timezone component for a specific TZID in this calendar. * @param string $tzid The TZID for the timezone to be retrieved. * @return vComponent The timezone as a vComponent. */ function GetTimeZone( $tzid ) { if ( empty($this->timezones[$tzid]) ) return null; return $this->timezones[$tzid]; } /** * Get the organizer of this VEVENT/VTODO * @return vProperty The Organizer property. */ function GetOrganizer() { if ( !isset($this->organizer) ) { $organizers = $this->GetPropertiesByPath('/VCALENDAR/*/ORGANIZER'); $organizer = (count($organizers) > 0 ? $organizers[0] : false); $this->organizer = (empty($organizer) ? false : $organizer ); if ( $this->organizer ) { $this->schedule_agent = $organizer->GetParameterValue('SCHEDULE-AGENT'); if ( empty($schedule_agent) ) $this->schedule_agent = 'SERVER'; } } return $this->organizer; } /** * Get the schedule-agent from the organizer * @return vProperty The schedule-agent parameter */ function GetScheduleAgent() { if ( !isset($this->schedule_agent) ) $this->GetOrganizer(); return $this->schedule_agent; } /** * Get the attendees of this VEVENT/VTODO */ function GetAttendees() { if ( !isset($this->attendees) ) { $attendees = $this->GetPropertiesByPath('/VCALENDAR/*/ATTENDEE'); $wr_attendees = $this->GetPropertiesByPath('/VCALENDAR/*/X-WR-ATTENDEE'); if ( count ( $wr_attendees ) > 0 ) { dbg_error_log( 'PUT', 'Non-compliant iCal request. Using X-WR-ATTENDEE property' ); foreach( $wr_attendees AS $k => $v ) { $attendees[] = $v; } } $this->attendees = $attendees; } return $this->attendees; } /** * Update the attendees of this VEVENT/VTODO * @param string $email The e-mail address of the attendee to be updated. * @param vProperty $statusProperty A replacement property. */ function UpdateAttendeeStatus( $email, vProperty $statusProperty ) { foreach($this->components AS $ck => $v ) { if ($v->GetType() == 'VEVENT' || $v->GetType() == 'VTODO' ) { $new_attendees = array(); foreach( $v->properties AS $p ) { if ( $p->Name() == 'ATTENDEE' ) { if ( $p->Value() == $email || $p->Value() == 'mailto:'.$email ) { $new_attendees[] = $statusProperty; } else { $new_attendees[] = clone($p); } } } $v->SetProperties($new_attendees,'ATTENDEE'); $this->attendees = null; $this->rendered = null; } } } /** * Update the ORGANIZER of this VEVENT/VTODO * @param vProperty $statusProperty A replacement property. */ function UpdateOrganizerStatus( vProperty $statusProperty ) { $this->rendered = null; foreach($this->components AS $ck => $v ) { if ($v->GetType() == 'VEVENT' || $v->GetType() == 'VTODO' ) { foreach( $v->properties AS $pk => $p ) { if ( $p->Name() == 'ORGANIZER' ) { $v->properties[$pk] = $statusProperty; $v->rendered = null; unset($this->organizer); } } } } } /** * Test a PROP-FILTER or COMP-FILTER and return a true/false * COMP-FILTER (is-defined | is-not-defined | (time-range?, prop-filter*, comp-filter*)) * PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*)) * * @param array $filter An array of XMLElement defining the filter * * @return boolean Whether or not this vCalendar passes the test */ function StartFilter( $filters ) { dbg_error_log('vCalendar', ':StartFilter we have %d filters to test', count($filters) ); if ( count($filters) != 1 ) return false; $tag = $filters[0]->GetNSTag(); $name = $filters[0]->GetAttribute("name"); if ( $tag != "urn:ietf:params:xml:ns:caldav:comp-filter" || $name != 'VCALENDAR' ) return false; return $this->TestFilter($filters[0]->GetContent()); } /** * Work out what Olson timezone this VTIMEZONE really is. Perhaps we should put this * into a vTimezone class. * @param vComponent $vtz The VTIMEZONE component. * @return string The Olson name for the timezone. */ function GetOlsonName( vComponent $vtz ) { $tzstring = $vtz->GetProperty('TZID'); $tzid = olson_from_tzstring($tzstring); if ( !empty($tzid) ) return $tzid; $tzstring = $vtz->GetProperty('X-LIC-LOCATION'); $tzid = olson_from_tzstring($tzstring); if ( !empty($tzid) ) return $tzid; $tzcdo = $vtz->GetProperty('X-MICROSOFT-CDO-TZID'); if ( empty($tzcdo) ) return null; switch( $tzcdo ) { /** * List of Microsoft CDO Timezone IDs from here: * http://msdn.microsoft.com/en-us/library/aa563018%28loband%29.aspx */ case 0: return('UTC'); case 1: return('Europe/London'); case 2: return('Europe/Lisbon'); case 3: return('Europe/Paris'); case 4: return('Europe/Berlin'); case 5: return('Europe/Bucharest'); case 6: return('Europe/Prague'); case 7: return('Europe/Athens'); case 8: return('America/Brasilia'); case 9: return('America/Halifax'); case 10: return('America/New_York'); case 11: return('America/Chicago'); case 12: return('America/Denver'); case 13: return('America/Los_Angeles'); case 14: return('America/Anchorage'); case 15: return('Pacific/Honolulu'); case 16: return('Pacific/Apia'); case 17: return('Pacific/Auckland'); case 18: return('Australia/Brisbane'); case 19: return('Australia/Adelaide'); case 20: return('Asia/Tokyo'); case 21: return('Asia/Singapore'); case 22: return('Asia/Bangkok'); case 23: return('Asia/Kolkata'); case 24: return('Asia/Muscat'); case 25: return('Asia/Tehran'); case 26: return('Asia/Baghdad'); case 27: return('Asia/Jerusalem'); case 28: return('America/St_Johns'); case 29: return('Atlantic/Azores'); case 30: return('America/Noronha'); case 31: return('Africa/Casablanca'); case 32: return('America/Argentina/Buenos_Aires'); case 33: return('America/La_Paz'); case 34: return('America/Indiana/Indianapolis'); case 35: return('America/Bogota'); case 36: return('America/Regina'); case 37: return('America/Tegucigalpa'); case 38: return('America/Phoenix'); case 39: return('Pacific/Kwajalein'); case 40: return('Pacific/Fiji'); case 41: return('Asia/Magadan'); case 42: return('Australia/Hobart'); case 43: return('Pacific/Guam'); case 44: return('Australia/Darwin'); case 45: return('Asia/Shanghai'); case 46: return('Asia/Novosibirsk'); case 47: return('Asia/Karachi'); case 48: return('Asia/Kabul'); case 49: return('Africa/Cairo'); case 50: return('Africa/Harare'); case 51: return('Europe/Moscow'); case 53: return('Atlantic/Cape_Verde'); case 54: return('Asia/Yerevan'); case 55: return('America/Panama'); case 56: return('Africa/Nairobi'); case 58: return('Asia/Yekaterinburg'); case 59: return('Europe/Helsinki'); case 60: return('America/Godthab'); case 61: return('Asia/Rangoon'); case 62: return('Asia/Kathmandu'); case 63: return('Asia/Irkutsk'); case 64: return('Asia/Krasnoyarsk'); case 65: return('America/Santiago'); case 66: return('Asia/Colombo'); case 67: return('Pacific/Tongatapu'); case 68: return('Asia/Vladivostok'); case 69: return('Africa/Ndjamena'); case 70: return('Asia/Yakutsk'); case 71: return('Asia/Dhaka'); case 72: return('Asia/Seoul'); case 73: return('Australia/Perth'); case 74: return('Asia/Riyadh'); case 75: return('Asia/Taipei'); case 76: return('Australia/Sydney'); case 57: // null case 52: // null default: // null } return null; } /** * Morph this component (and subcomponents) into a confidential version of it. A confidential * event will be scrubbed of any identifying characteristics other than time/date, repeat, uid * and a summary which is just a translated 'Busy'. */ function Confidential() { static $keep_properties = array( 'DTSTAMP'=>1, 'DTSTART'=>1, 'RRULE'=>1, 'DURATION'=>1, 'DTEND'=>1, 'DUE'=>1, 'UID'=>1, 'CLASS'=>1, 'TRANSP'=>1, 'CREATED'=>1, 'LAST-MODIFIED'=>1 ); static $resource_components = array( 'VEVENT'=>1, 'VTODO'=>1, 'VJOURNAL'=>1 ); $this->MaskComponents(array( 'VTIMEZONE'=>1, 'VEVENT'=>1, 'VTODO'=>1, 'VJOURNAL'=>1 ), false); $this->MaskProperties($keep_properties, $resource_components ); if ( isset($this->rendered) ) unset($this->rendered); foreach( $this->components AS $comp ) { if ( isset($resource_components[$comp->GetType()] ) ) { if ( isset($comp->rendered) ) unset($comp->rendered); $comp->AddProperty( 'SUMMARY', translate('Busy') ); } } return $this; } /** * Clone this component (and subcomponents) into a minimal iTIP version of it. */ function GetItip($method, $attendee_value ) { $iTIP = clone($this); static $keep_properties = array( 'DTSTART'=>1, 'DURATION'=>1, 'DTEND'=>1, 'DUE'=>1, 'UID'=>1, 'SEQUENCE'=>1, 'ORGANIZER'=>1, 'ATTENDEE'=>1 ); static $resource_components = array( 'VEVENT'=>1, 'VTODO'=>1, 'VJOURNAL'=>1 ); $iTIP->MaskComponents($resource_components, false); $iTIP->MaskProperties($keep_properties, $resource_components ); $iTIP->AddProperty('METHOD',$method); if ( isset($iTIP->rendered) ) unset($iTIP->rendered); if ( !empty($attendee_value) ) { $iTIP->attendees = array(); foreach( $iTIP->components AS $comp ) { if ( isset($resource_components[$comp->type] ) ) { foreach( $comp->properties AS $k=> $property ) { switch( $property->Name() ) { case 'ATTENDEE': if ( $property->Value() == $attendee_value ) $iTIP->attendees[] = $property; else unset($comp->properties[$k]); break; case 'SEQUENCE': $property->Value( $property->Value() + 1); break; } } $comp->AddProperty('DTSTAMP', date('Ymd\THis\Z')); } } } return $iTIP; } /** * Get the UID from the primary component. */ function GetUID() { if ( empty($this->primary_component) ) return null; return $this->primary_component->GetPValue('UID'); } /** * Set the UID on the primary component. * @param string newUid */ function SetUID( $newUid ) { if ( empty($this->primary_component) ) return; $this->primary_component->SetProperties( array( new vProperty('UID', $newUid) ), 'UID'); } } awl-0.53.orig/inc/AWLUtilities.php0000644000000000000000000005753211774765534013711 0ustar * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL version 3 or later */ if ( !function_exists('dbg_error_log') ) { /** * Writes a debug message into the error log using printf syntax. If the first * parameter is "ERROR" then the message will _always_ be logged. * Otherwise, the first parameter is a "component" name, and will only be logged * if $c->dbg["component"] is set to some non-null value. * * If you want to see every log message then $c->dbg["ALL"] can be set, to * override the debugging status of the individual components. * * @var string $component The component to identify itself, or "ERROR", or "LOG:component" * @var string $format A format string for the log message * @var [string $parameter ...] Parameters for the format string. */ function dbg_error_log() { global $c; $args = func_get_args(); $type = "DBG"; $component = array_shift($args); if ( substr( $component, 0, 3) == "LOG" ) { // Special escape case for stuff that always gets logged. $type = 'LOG'; $component = substr($component,4); } else if ( $component == "ERROR" ) { $type = "***"; } else if ( isset($c->dbg["ALL"]) ) { $type = "ALL"; } else if ( !isset($c->dbg[strtolower($component)]) ) return; $argc = func_num_args(); if ( 2 <= $argc ) { $format = array_shift($args); } else { $format = "%s"; } @error_log( $c->sysabbr.": $type: $component:". vsprintf( $format, $args ) ); } } if ( !function_exists('fatal') ) { function fatal() { global $c; $args = func_get_args(); $argc = func_num_args(); if ( 2 <= $argc ) { $format = array_shift($args); } else { $format = "%s"; } @error_log( $c->sysabbr.": FATAL: $component:". vsprintf( $format, $args ) ); @error_log( "================= Stack Trace ===================" ); $trace = array_reverse(debug_backtrace()); array_pop($trace); foreach( $trace AS $k => $v ) { @error_log( sprintf(" ===> %s[%d] calls %s%s%s()", $v['file'], $v['line'], (isset($v['class'])?$v['class']:''), (isset($v['type'])?$v['type']:''), (isset($v['function'])?$v['function']:'') )); } echo "Fatal Error"; exit(); } } if ( !function_exists('trace_bug') ) { /** * Not as sever as a fatal() call, but we want to log and trace it */ function trace_bug() { global $c; $args = func_get_args(); $argc = func_num_args(); if ( 2 <= $argc ) { $format = array_shift($args); } else { $format = "%s"; } @error_log( $c->sysabbr.": BUG: $component:". vsprintf( $format, $args ) ); @error_log( "================= Stack Trace ===================" ); $trace = array_reverse(debug_backtrace()); array_pop($trace); foreach( $trace AS $k => $v ) { @error_log( sprintf(" ===> %s[%d] calls %s%s%s()", $v['file'], $v['line'], (isset($v['class'])?$v['class']:''), (isset($v['type'])?$v['type']:''), (isset($v['function'])?$v['function']:'') )); } } } if ( !function_exists('apache_request_headers') ) { /** * Compatibility so we can use the apache function name and still work with CGI * @package awl */ eval(' function apache_request_headers() { foreach($_SERVER as $key=>$value) { if (substr($key,0,5)=="HTTP_") { $key=str_replace(" ","-",ucwords(strtolower(str_replace("_"," ",substr($key,5))))); $out[$key]=$value; } } return $out; } '); } if ( !function_exists('dbg_log_array') ) { /** * Function to dump an array to the error log, possibly recursively * * @var string $component Which component should this log message identify itself from * @var string $name What name should this array dump identify itself as * @var array $arr The array to be dumped. * @var boolean $recursive Should the dump recurse into arrays/objects in the array */ function dbg_log_array( $component, $name, $arr, $recursive = false ) { if ( !isset($arr) || (gettype($arr) != 'array' && gettype($arr) != 'object') ) { dbg_error_log( $component, "%s: array is not set, or is not an array!", $name); return; } foreach ($arr as $key => $value) { dbg_error_log( $component, "%s: >>%s<< = >>%s<<", $name, $key, (gettype($value) == 'array' || gettype($value) == 'object' ? gettype($value) : $value) ); if ( $recursive && (gettype($value) == 'array' || (gettype($value) == 'object' && "$key" != 'self' && "$key" != 'parent') ) ) { dbg_log_array( $component, "$name"."[$key]", $value, $recursive ); } } } } if ( !function_exists("session_simple_md5") ) { /** * Make a plain MD5 hash of a string, identifying the type of hash it is * * @param string $instr The string to be salted and MD5'd * @return string The *MD5* and the MD5 of the string */ function session_simple_md5( $instr ) { global $c; if ( isset($c->dbg['password']) ) dbg_error_log( "Login", "Making plain MD5: instr=$instr, md5($instr)=".md5($instr) ); return ( '*MD5*'. md5($instr) ); } } if ( !function_exists("session_salted_md5") ) { /** * Make a salted MD5 string, given a string and (possibly) a salt. * * If no salt is supplied we will generate a random one. * * @param string $instr The string to be salted and MD5'd * @param string $salt Some salt to sprinkle into the string to be MD5'd so we don't get the same PW always hashing to the same value. * @return string The salt, a * and the MD5 of the salted string, as in SALT*SALTEDHASH */ function session_salted_md5( $instr, $salt = "" ) { if ( $salt == "" ) $salt = substr( md5(rand(100000,999999)), 2, 8); global $c; if ( isset($c->dbg['password']) ) dbg_error_log( "Login", "Making salted MD5: salt=$salt, instr=$instr, md5($salt$instr)=".md5($salt . $instr) ); return ( sprintf("*%s*%s", $salt, md5($salt . $instr) ) ); } } if ( !function_exists("session_salted_sha1") ) { /** * Make a salted SHA1 string, given a string and (possibly) a salt. PHP5 only (although it * could be made to work on PHP4 (@see http://www.openldap.org/faq/data/cache/347.html). The * algorithm used here is compatible with OpenLDAP so passwords generated through this function * should be able to be migrated to OpenLDAP by using the part following the second '*', i.e. * the '{SSHA}....' part. * * If no salt is supplied we will generate a random one. * * @param string $instr The string to be salted and SHA1'd * @param string $salt Some salt to sprinkle into the string to be SHA1'd so we don't get the same PW always hashing to the same value. * @return string A *, the salt, a * and the SHA1 of the salted string, as in *SALT*SALTEDHASH */ function session_salted_sha1( $instr, $salt = "" ) { if ( $salt == "" ) $salt = substr( str_replace('*','',base64_encode(sha1(rand(100000,9999999),true))), 2, 9); global $c; if ( isset($c->dbg['password']) ) dbg_error_log( "Login", "Making salted SHA1: salt=$salt, instr=$instr, encoded($instr$salt)=".base64_encode(sha1($instr . $salt, true).$salt) ); return ( sprintf("*%s*{SSHA}%s", $salt, base64_encode(sha1($instr.$salt, true) . $salt ) ) ); } } if ( !function_exists("session_validate_password") ) { /** * Checks what a user entered against the actual password on their account. * @param string $they_sent What the user entered. * @param string $we_have What we have in the database as their password. Which may (or may not) be a salted MD5. * @return boolean Whether or not the users attempt matches what is already on file. */ function session_validate_password( $they_sent, $we_have ) { if ( preg_match('/^\*\*.+$/', $we_have ) ) { // The "forced" style of "**plaintext" to allow easier admin setting return ( "**$they_sent" == $we_have ); } if ( preg_match('/^\*(.+)\*{[A-Z]+}.+$/', $we_have, $regs ) ) { if ( function_exists("session_salted_sha1") ) { // A nicely salted sha1sum like "**{SSHA}" $salt = $regs[1]; $sha1_sent = session_salted_sha1( $they_sent, $salt ) ; return ( $sha1_sent == $we_have ); } else { dbg_error_log( "ERROR", "Password is salted SHA-1 but you are using PHP4!" ); echo << Salted SHA1 Password format not supported with PHP4

Salted SHA1 Password format not supported with PHP4

At some point you have used PHP5 to set the password for this user and now you are using PHP4. You will need to assign a new password to this user using PHP4, or ensure you use PHP5 everywhere (recommended).

AWL has now switched to using salted SHA-1 passwords by preference in a format compatible with OpenLDAP.

EOERRMSG; exit; } } if ( preg_match('/^\*MD5\*.+$/', $we_have, $regs ) ) { // A crappy unsalted md5sum like "*MD5*" $md5_sent = session_simple_md5( $they_sent ) ; return ( $md5_sent == $we_have ); } else if ( preg_match('/^\*(.+)\*.+$/', $we_have, $regs ) ) { // A nicely salted md5sum like "**" $salt = $regs[1]; $md5_sent = session_salted_md5( $they_sent, $salt ) ; return ( $md5_sent == $we_have ); } // Anything else is bad return false; } } if ( !function_exists("replace_uri_params") ) { /** * Given a URL (presumably the current one) and a parameter, replace the value of parameter, * extending the URL as necessary if the parameter is not already there. * @param string $uri The URI we will be replacing parameters in. * @param array $replacements An array of replacement pairs array( "replace_this" => "with this" ) * @return string The URI with the replacements done. */ function replace_uri_params( $uri, $replacements ) { $replaced = $uri; foreach( $replacements AS $param => $new_value ) { $rxp = preg_replace( '/([\[\]])/', '\\\\$1', $param ); // Some parameters may be arrays. $regex = "/([&?])($rxp)=([^&]+)/"; dbg_error_log("core", "Looking for [%s] to replace with [%s] regex is %s and searching [%s]", $param, $new_value, $regex, $replaced ); if ( preg_match( $regex, $replaced ) ) $replaced = preg_replace( $regex, "\$1$param=$new_value", $replaced); else $replaced .= "&$param=$new_value"; } if ( ! preg_match( '/\?/', $replaced ) ) { $replaced = preg_replace("/&(.+)$/", "?\$1", $replaced); } $replaced = str_replace("&", "--AmPeRsAnD--", $replaced); $replaced = str_replace("&", "&", $replaced); $replaced = str_replace("--AmPeRsAnD--", "&", $replaced); dbg_error_log("core", "URI <<$uri>> morphed to <<$replaced>>"); return $replaced; } } if ( !function_exists("uuid") ) { /** * Generates a Universally Unique IDentifier, version 4. * * RFC 4122 (http://www.ietf.org/rfc/rfc4122.txt) defines a special type of Globally * Unique IDentifiers (GUID), as well as several methods for producing them. One * such method, described in section 4.4, is based on truly random or pseudo-random * number generators, and is therefore implementable in a language like PHP. * * We choose to produce pseudo-random numbers with the Mersenne Twister, and to always * limit single generated numbers to 16 bits (ie. the decimal value 65535). That is * because, even on 32-bit systems, PHP's RAND_MAX will often be the maximum *signed* * value, with only the equivalent of 31 significant bits. Producing two 16-bit random * numbers to make up a 32-bit one is less efficient, but guarantees that all 32 bits * are random. * * The algorithm for version 4 UUIDs (ie. those based on random number generators) * states that all 128 bits separated into the various fields (32 bits, 16 bits, 16 bits, * 8 bits and 8 bits, 48 bits) should be random, except : (a) the version number should * be the last 4 bits in the 3rd field, and (b) bits 6 and 7 of the 4th field should * be 01. We try to conform to that definition as efficiently as possible, generating * smaller values where possible, and minimizing the number of base conversions. * * @copyright Copyright (c) CFD Labs, 2006. This function may be used freely for * any purpose ; it is distributed without any form of warranty whatsoever. * @author David Holmes * * @return string A UUID, made up of 32 hex digits and 4 hyphens. */ function uuid() { // The field names refer to RFC 4122 section 4.1.2 return sprintf('%04x%04x-%04x-%03x4-%04x-%04x%04x%04x', mt_rand(0, 65535), mt_rand(0, 65535), // 32 bits for "time_low" mt_rand(0, 65535), // 16 bits for "time_mid" mt_rand(0, 4095), // 12 bits before the 0100 of (version) 4 for "time_hi_and_version" bindec(substr_replace(sprintf('%016b', mt_rand(0, 65535)), '01', 6, 2)), // 8 bits, the last two of which (positions 6 and 7) are 01, for "clk_seq_hi_res" // (hence, the 2nd hex digit after the 3rd hyphen can only be 1, 5, 9 or d) // 8 bits for "clk_seq_low" mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535) // 48 bits for "node" ); } } if ( !function_exists("translate") ) { require("Translation.php"); } if ( !function_exists("clone") && version_compare(phpversion(), '5.0') < 0) { /** * PHP5 screws with the assignment operator changing so that $a = $b means that * $a becomes a reference to $b. There is a clone() that we can use in PHP5, so * we have to emulate that for PHP4. Bleargh. */ eval( 'function clone($object) { return $object; }' ); } if ( !function_exists("quoted_printable_encode") ) { /** * Process a string to fit the requirements of RFC2045 section 6.7. Note that * this works, but replaces more characters than the minimum set. For readability * the spaces aren't encoded as =20 though. */ function quoted_printable_encode($string) { return preg_replace('/[^\r\n]{73}[^=\r\n]{2}/', "$0=\r\n", str_replace("%","=",str_replace("%20"," ",rawurlencode($string)))); } } if ( !function_exists("check_by_regex") ) { /** * Verify a value is OK by testing a regex against it. If it is an array apply it to * each element in the array recursively. If it is an object we don't mess * with it. */ function check_by_regex( $val, $regex ) { if ( is_null($val) ) return null; switch( $regex ) { case 'int': $regex = '#^\d+$#'; break; } if ( is_array($val) ) { foreach( $val AS $k => $v ) { $val[$k] = check_by_regex($v,$regex); } } else if ( ! is_object($val) ) { if ( preg_match( $regex, $val, $matches) ) { $val = $matches[0]; } else { $val = ''; } } return $val; } } if ( !function_exists("param_to_global") ) { /** * Convert a parameter to a global. We first look in _POST and then in _GET, * and if they passed in a bunch of valid characters, we will make sure the * incoming is cleaned to only match that set. * * @param string $varname The name of the global variable to put the answer in * @param string $match_regex The part of the parameter matching this regex will be returned * @param string $alias1 An alias for the name that we should look for first. * @param " ... More aliases, in the order which they should be examined. $varname will be appended to the end. */ function param_to_global( ) { $args = func_get_args(); $varname = array_shift($args); $GLOBALS[$varname] = null; $match_regex = null; $argc = func_num_args(); if ( $argc > 1 ) { $match_regex = array_shift($args); } $args[] = $varname; foreach( $args AS $k => $name ) { if ( isset($_POST[$name]) ) { $result = $_POST[$name]; break; } else if ( isset($_GET[$name]) ) { $result = $_GET[$name]; break; } } if ( !isset($result) ) return null; if ( isset($match_regex) ) { $result = check_by_regex( $result, $match_regex ); } $GLOBALS[$varname] = $result; return $result; } } if ( !function_exists("get_fields") ) { /** * @var array $_AWL_field_cache is a cache of the field names for a table */ $_AWL_field_cache = array(); /** * Get the names of the fields for a particular table * @param string $tablename The name of the table. * @return array of string The public fields in the table. */ function get_fields( $tablename ) { global $_AWL_field_cache; if ( !isset($_AWL_field_cache[$tablename]) ) { dbg_error_log( "core", ":get_fields: Loading fields for table '$tablename'" ); $qry = new AwlQuery(); $db = $qry->GetConnection(); $qry->SetSQL($db->GetFields($tablename)); $qry->Exec("core"); $fields = array(); while( $row = $qry->Fetch() ) { $fields[$row->fieldname] = $row->typename . ($row->precision >= 0 ? sprintf('(%d)',$row->precision) : ''); } $_AWL_field_cache[$tablename] = $fields; } return $_AWL_field_cache[$tablename]; } } if ( !function_exists("force_utf8") ) { function define_byte_mappings() { global $byte_map, $nibble_good_chars; # Needed for using Grant McLean's byte mappings code $ascii_char = '[\x00-\x7F]'; $cont_byte = '[\x80-\xBF]'; $utf8_2 = '[\xC0-\xDF]' . $cont_byte; $utf8_3 = '[\xE0-\xEF]' . $cont_byte . '{2}'; $utf8_4 = '[\xF0-\xF7]' . $cont_byte . '{3}'; $utf8_5 = '[\xF8-\xFB]' . $cont_byte . '{4}'; $nibble_good_chars = "/^($ascii_char+|$utf8_2|$utf8_3|$utf8_4|$utf8_5)(.*)$/s"; # From http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT $byte_map = array( "\x80" => "\xE2\x82\xAC", # EURO SIGN "\x82" => "\xE2\x80\x9A", # SINGLE LOW-9 QUOTATION MARK "\x83" => "\xC6\x92", # LATIN SMALL LETTER F WITH HOOK "\x84" => "\xE2\x80\x9E", # DOUBLE LOW-9 QUOTATION MARK "\x85" => "\xE2\x80\xA6", # HORIZONTAL ELLIPSIS "\x86" => "\xE2\x80\xA0", # DAGGER "\x87" => "\xE2\x80\xA1", # DOUBLE DAGGER "\x88" => "\xCB\x86", # MODIFIER LETTER CIRCUMFLEX ACCENT "\x89" => "\xE2\x80\xB0", # PER MILLE SIGN "\x8A" => "\xC5\xA0", # LATIN CAPITAL LETTER S WITH CARON "\x8B" => "\xE2\x80\xB9", # SINGLE LEFT-POINTING ANGLE QUOTATION MARK "\x8C" => "\xC5\x92", # LATIN CAPITAL LIGATURE OE "\x8E" => "\xC5\xBD", # LATIN CAPITAL LETTER Z WITH CARON "\x91" => "\xE2\x80\x98", # LEFT SINGLE QUOTATION MARK "\x92" => "\xE2\x80\x99", # RIGHT SINGLE QUOTATION MARK "\x93" => "\xE2\x80\x9C", # LEFT DOUBLE QUOTATION MARK "\x94" => "\xE2\x80\x9D", # RIGHT DOUBLE QUOTATION MARK "\x95" => "\xE2\x80\xA2", # BULLET "\x96" => "\xE2\x80\x93", # EN DASH "\x97" => "\xE2\x80\x94", # EM DASH "\x98" => "\xCB\x9C", # SMALL TILDE "\x99" => "\xE2\x84\xA2", # TRADE MARK SIGN "\x9A" => "\xC5\xA1", # LATIN SMALL LETTER S WITH CARON "\x9B" => "\xE2\x80\xBA", # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK "\x9C" => "\xC5\x93", # LATIN SMALL LIGATURE OE "\x9E" => "\xC5\xBE", # LATIN SMALL LETTER Z WITH CARON "\x9F" => "\xC5\xB8", # LATIN CAPITAL LETTER Y WITH DIAERESIS ); for( $i=160; $i < 256; $i++ ) { $ch = chr($i); $byte_map[$ch] = iconv('ISO-8859-1', 'UTF-8', $ch); } } define_byte_mappings(); function force_utf8( $input ) { global $byte_map, $nibble_good_chars; $output = ''; $char = ''; $rest = ''; while( $input != '' ) { if ( preg_match( $nibble_good_chars, $input, $matches ) ) { $output .= $matches[1]; $rest = $matches[2]; } else { preg_match( '/^(.)(.*)$/s', $input, $matches ); $char = $matches[1]; $rest = $matches[2]; if ( isset($byte_map[$char]) ) { $output .= $byte_map[$char]; } else { # Must be valid UTF8 already $output .= $char; } } $input = $rest; } return $output; } } /** * Try and extract something like "Pacific/Auckland" or "America/Indiana/Indianapolis" if possible. */ function olson_from_tzstring( $tzstring ) { global $c; if ( function_exists('timezone_identifiers_list') && in_array($tzstring,timezone_identifiers_list()) ) return $tzstring; if ( preg_match( '{((Antarctica|America|Africa|Atlantic|Asia|Australia|Indian|Europe|Pacific)/(([^/]+)/)?[^/]+)$}', $tzstring, $matches ) ) { // dbg_error_log( 'INFO', 'Found timezone "%s" from string "%s"', $matches[1], $tzstring ); return $matches[1]; } switch( $tzstring ) { case 'New Zealand Standard Time': case 'New Zealand Daylight Time': return 'Pacific/Auckland'; break; case 'Central Standard Time': case 'Central Daylight Time': case 'US/Central': return 'America/Chicago'; break; case 'Eastern Standard Time': case 'Eastern Daylight Time': case 'US/Eastern': case '(UTC-05:00) Eastern Time (US & Canada)': return 'America/New_York'; break; case 'Pacific Standard Time': case 'Pacific Daylight Time': case 'US/Pacific': return 'America/Los_Angeles'; break; case 'Mountain Standard Time': case 'Mountain Daylight Time': case 'US/Mountain': case 'Mountain Time': return 'America/Denver'; // The US 'Mountain Time' can in fact be America/(Denver|Boise|Phoenix|Shiprock) which // all vary to some extent due to differing DST rules. break; case '(GMT-07.00) Arizona': return 'America/Phoenix'; break; default: if ( isset($c->timezone_translations) && is_array($c->timezone_translations) && !empty($c->timezone_translations[$tzstring]) ) return $c->timezone_translations[$tzstring]; } return null; } if ( !function_exists("deprecated") ) { function deprecated( $method ) { global $c; if ( isset($c->dbg['ALL']) || isset($c->dbg['deprecated']) ) { $stack = debug_backtrace(); array_shift($stack); if ( preg_match( '{/inc/iCalendar.php$}', $stack[0]['file'] ) && $stack[0]['line'] > __LINE__ ) return; @error_log( sprintf( $c->sysabbr.':DEPRECATED: Call to deprecated method "%s"', $method)); foreach( $stack AS $k => $v ) { @error_log( sprintf( $c->sysabbr.': ==> called from line %4d of %s', $v['line'], $v['file'])); } } } } if ( !function_exists("gzdecode") ) { function gzdecode( $instring ) { global $c; if ( !isset($c->use_pipe_gunzip) || $c->use_pipe_gunzip ) { $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("file", "/dev/null", "a") // stderr is discarded ); $process = proc_open('gunzip',$descriptorspec, $pipes); if ( is_resource($process) ) { fwrite($pipes[0],$instring); fclose($pipes[0]); $outstring = stream_get_contents($pipes[1]); fclose($pipes[1]); proc_close($process); return $outstring; } return ''; } else { $g=tempnam('./','gz'); file_put_contents($g,$instring); ob_start(); readgzfile($g); $d=ob_get_clean(); unlink($g); return $d; } } } /** * Return the AWL version */ function awl_version() { global $c; $c->awl_library_version = 0.53; return $c->awl_library_version; }awl-0.53.orig/inc/Multipart.php0000644000000000000000000000350011767325527013331 0ustar content = $content; $this->type = $type; $this->otherHeaders = $otherHeaders; } function render() { $result = 'Content-Type: '.$this->type.self::$crlf; $encoded = false; foreach( $this->otherHeaders AS $header => $value ) { $result .= $header.': '.$value.self::$crlf; if ( $header == 'Content-Transfer-Encoding' ) $encoded = true; } if ( $encoded ) return $result . self::$crlf . $content; return $result . 'Content-Transfer-Encoding: base64' . self::$crlf . self::$crlf . base64_encode($content); } } class Multipart { private $parts; // Always good for a giggle :-) private $boundary; function __construct() { $this->parts = array(); $this->boundary = uuid(); } function addPart() { $args = func_get_args(); if ( is_string($args[0]) ) { $newPart = new SinglePart( $args[0], (isset($args[1])?$args[1]:'text/plain'), (isset($args[2])?$args[2]:array())); } else $newPart = $args[0]; $this->parts[] = $newPart; return $newPart; } function getMimeHeaders() { return 'MIME-Version: 1.0' . SinglePart::$crlf .'Content-Type: multipart/mixed; boundary='.$this->boundary . SinglePart::$crlf ; } function getMimeParts() { $result = '--' . $this->boundary . SinglePart::$crlf; foreach( $this->parts AS $part ) { $result .= $part->render() . SinglePart::$crlf . '--' . $this->boundary; } $result .= '--' . SinglePart::$crlf; return $result; } }awl-0.53.orig/inc/AwlDBDialect.php0000644000000000000000000003034111760653201013554 0ustar * @copyright Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v3 or later * @compatibility Requires PHP 5.1 or later */ if ( !defined('E_USER_ERROR') ) define('E_USER_ERROR',256); /** * The AwlDBDialect class handles support for different SQL dialects * * This subpackage provides dialect specific support for PostgreSQL, and * may, over time, be extended to provide support for other SQL dialects. * * If you are looking for the place to add support for other SQL dialects, * this is the class that you should be looking at. You might also look at * the AwlDatabase class which extends this one, but these are the core * capabilities which most probably need attention. * * @package awl */ class AwlDBDialect { /**#@+ * @access private */ /** * Holds the name of the database dialect */ protected $dialect; /** * Holds the PDO database connection */ protected $db; /** * Holds the version */ private $version; /**#@-*/ /** * Parses the connection string to ascertain the database dialect. Returns true if the dialect is supported * and fails if the dialect is not supported. All code to support any given database should be within in an * external include. * * The database will be opened. * * @param string $connection_string The PDO connection string, in all it's glory * @param string $dbuser The database username to connect as * @param string $dbpass The database password to connect with * @param array $options An array of driver options */ function __construct( $connection_string, $dbuser=null, $dbpass=null, $options=null ) { if ( preg_match( '/^(pgsql):/', $connection_string, $matches ) ) { $this->dialect = $matches[1]; } else { error_log("Unable to connect to database: ". $e->getMessage() ); trigger_error("Unsupported database connection '".$connection_string."'",E_USER_ERROR); } try { $this->db = new PDO( $connection_string, $dbuser, $dbpass, $options ); } catch (PDOException $e) { error_log("Unable to connect to database: ". $e->getMessage() ); if ( function_exists('trigger_error') ) trigger_error("PDO connection error '".$connection_string."': ".$e->getMessage(),E_USER_ERROR); throw $e; } } /** * Sets the current search path for the database. */ function SetSearchPath( $search_path = null ) { if ( !isset($this->dialect) ) { trigger_error("Unsupported database dialect",E_USER_ERROR); } switch ( $this->dialect ) { case 'pgsql': if ( $search_path == null ) $search_path = 'public'; $sql = "SET search_path TO " . $this->Quote( $search_path, 'identifier' ); return $sql; } } /** * Sets the current search path for the database. * @param handle $pdo A handle to an opened database */ function GetVersion( ) { if ( isset($this->version) ) return $this->version; if ( !isset($this->dialect) ) { trigger_error("Unsupported database dialect", E_USER_ERROR); } $version = $this->dialect.':'; switch ( $this->dialect ) { case 'pgsql': $sql = "SELECT version()"; if ( $sth = $this->db->query($sql) ) { $row = $sth->fetch(PDO::FETCH_NUM); $version .= preg_replace( '/^PostgreSQL (\d+\.\d+)\..*$/i', '$1', $row[0]); } break; default: return null; } $this->version = $version; return $version; } /** * Returns the SQL for the current database dialect which will return a two-column resultset containing a * list of fields and their associated data types. * @param string $tablename_string The name of the table we want fields from */ function GetFields( $tablename_string ) { if ( !isset($this->dialect) ) { trigger_error("Unsupported database dialect", E_USER_ERROR); } switch ( $this->dialect ) { case 'pgsql': $tablename_string = $this->Quote($tablename_string,PDO::PARAM_STR); $sql = 'SELECT f.attname AS fieldname, t.typname AS typename, f.atttypmod AS precision FROM pg_attribute f'; $sql .= ' JOIN pg_class c ON ( f.attrelid = c.oid )'; $sql .= ' JOIN pg_type t ON ( f.atttypid = t.oid )'; $sql .= ' WHERE relname = '.$tablename_string.' AND attnum >= 0 order by f.attnum'; return $sql; } } /** * Translates the given SQL string into a form that will hopefully work for this database dialect. This hook * is intended to be used by developers to provide support for differences in database operation by translating * the query string in an arbitrary way, such as through a file or database lookup. * * The actual translation to other SQL dialects will be application-specific, so that any routines * called by this will be external to this library, or will use resources loaded from some source * external to this library. * * The application developer is expected to use this functionality to solve harder translation problems, * but is less likely to call this directly, hopefully switching ->Prepare to ->PrepareTranslated in those * cases, and then adding that statement to whatever SQL translation infrastructure is in place. */ function TranslateSQL( $sql_string ) { // Noop for the time being... return $sql_string; } /** * Returns $value escaped in an appropriate way for this database dialect. * @param mixed $value The value to be escaped * @param string $value_type The type of escaping desired. If blank this will * be worked out from the type of the $value. The special type * of 'identifier' can also be used for escaping of SQL identifiers. */ function Quote( $value, $value_type = null ) { if ( isset($value_type) && $value_type == 'identifier' ) { if ( $this->dialect == 'mysql' ) { /** @TODO: Someone should confirm this is correct for MySql */ $rv = '`' . str_replace('`', '\\`', $value ) . '`'; } else { $rv = '"' . str_replace('"', '\\"', $value ) . '"'; } return $rv; } if ( !isset($value_type) ) { if ( !isset($value) ) $value_type = PDO::PARAM_NULL; elseif ( is_bool($value) ) $value_type = PDO::PARAM_BOOL; elseif ( is_float($value) ) $value_type = PDO::PARAM_INT; elseif ( is_numeric($value)) { if ( preg_match('{^(19|20)\d\d(0[1-9]|1[012])([012]\d|30|31)$}', $value) ) $value_type = PDO::PARAM_STR; // YYYYMMDD elseif ( preg_match('{^0x}i', $value) ) $value_type = PDO::PARAM_STR; // Any hex numbers will need to be explicitly cast in SQL elseif ( preg_match('{^[0-9+-]+e[0-9+-]+$}i', $value) ) $value_type = PDO::PARAM_STR; // 72e57650 could easily be a string and will need an explicit cast also elseif ( preg_match('/^[01]{6,}$/i', $value) ) $value_type = PDO::PARAM_STR; // Binary numbers will need to be explicitly cast in SQL else $value_type = PDO::PARAM_INT; } else $value_type = PDO::PARAM_STR; } if ( is_string($value_type) ) { switch( $value_type ) { case 'null': $value_type = PDO::PARAM_NULL; break; case 'integer': case 'double' : $value_type = PDO::PARAM_INT; break; case 'boolean': $value_type = PDO::PARAM_BOOL; break; case 'string': $value_type = PDO::PARAM_STR; break; } } switch ( $value_type ) { case PDO::PARAM_NULL: $rv = 'NULL'; break; case PDO::PARAM_INT: $rv = $value; break; case PDO::PARAM_BOOL: $rv = ($value ? 'TRUE' : 'FALSE'); break; case PDO::PARAM_STR: default: /** * PDO handling of \ seems unreliable. We can't use $$string$$ syntax because it also doesn't * work. We need to replace ':' so no other named parameters accidentally rewrite the content * inside this string(!), and since we're using ' to delimit the string we need SQL92-compliant * '' to replace it. */ $rv = "'".str_replace("'", "''", str_replace(':', '\\x3a', str_replace('\\', '\\x5c', $value)))."'"; if ( $this->dialect == 'pgsql' && strpos( $rv, '\\' ) !== false ) { /** * PostgreSQL wants to know when a string might contain escapes, and if this * happens old versions of PHP::PDO need the ? escaped as well... */ $rv = 'E'.str_replace('?', '\\x3f', $rv); } } return $rv; } /** * Replaces query parameters with appropriately escaped substitutions. * * The function takes a variable number of arguments, the first is the * SQL string, with replaceable '?' characters (a la DBI). The subsequent * parameters being the values to replace into the SQL string. * * The values passed to the routine are analyzed for type, and quoted if * they appear to need quoting. This can go wrong for (e.g.) NULL or * other special SQL values which are not straightforwardly identifiable * as needing quoting (or not). In such cases the parameter can be forced * to be inserted unquoted by passing it as "array( 'plain' => $param )". * * @param string The query string with replacable '?' characters. * @param mixed The values to replace into the SQL string. * @return The built query string */ function ReplaceParameters() { $argc = func_num_args(); $args = func_get_args(); if ( is_array($args[0]) ) { /** * If the first argument is an array we treat that as our arguments instead */ $args = $args[0]; $argc = count($args); } $qry = array_shift($args); if ( is_array($args[0]) ) { $args = $args[0]; $argc = count($args); } if ( ! isset($args[0]) ) return $this->ReplaceNamedParameters($qry,$args); /** * We only split into a maximum of $argc chunks. Any leftover ? will remain in * the string and may be replaced at Exec rather than Prepare. Scary! */ $parts = explode( '?', $qry, $argc + 1 ); $querystring = $parts[0]; $z = count($parts); for( $i = 0; $i < $argc; $i++ ) { $arg = $args[$i]; $querystring .= $this->Quote($arg); //parameter $z = $i+1; if ( isset($parts[$z]) ) $querystring .= $parts[$z]; } return $querystring; } /** * Replaces named query parameters of the form :name with appropriately * escaped substitutions. * * The function takes a variable number of arguments, the first is the * SQL string, with replaceable ':name' characters (a la DBI). The * subsequent parameters being the values to replace into the SQL string. * * The values passed to the routine are analyzed for type, and quoted if * they appear to need quoting. This can go wrong for (e.g.) NULL or * other special SQL values which are not straightforwardly identifiable * as needing quoting (or not). * * @param string The query string with replacable ':name' identifiers * @param mixed A ':name' => 'value' hash of values to replace into the * SQL string. * @return The built query string */ function ReplaceNamedParameters() { $argc = func_num_args(); $args = func_get_args(); if ( is_array($args[0]) ) { /** * If the first argument is an array we treat that as our arguments instead */ $args = $args[0]; $argc = count($args); } $querystring = array_shift($args); if ( is_array($args[0]) ) { $args = $args[0]; $argc = count($args); } foreach( $args AS $name => $value ) { if ( substr($name, 0, 1) != ':' ) { dbg_error_log( "ERROR", "AwlDBDialect: Named parameter '%s' does not begin with a colon.", $name); } $replacement = str_replace('$', '\\$', $this->Quote($value)); // No positional replacement in $replacement! $querystring = preg_replace( '{\Q'.$name.'\E\b}s', $replacement, $querystring ); } return $querystring; } } awl-0.53.orig/inc/DataUpdate.php0000644000000000000000000003057311767325412013367 0ustar * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later */ require_once('AWLUtilities.php'); require_once('AwlQuery.php'); /** * Build SQL INSERT/UPDATE statement from an associative array of fieldnames => values. * @param array $obj The object of fieldnames => values. * @param string $type The word "update" or something else (which implies "insert"). * @param string $tablename The name of the table being updated. * @param string $where What the "WHERE ..." clause needs to be for an UPDATE statement. * @param string $fprefix An optional string which all fieldnames in $assoc are prefixed with. * @return string An SQL Update or Insert statement with all fields/values from the array. */ function sql_from_object( $obj, $type, $tablename, $where, $fprefix = "" ) { $fields = get_fields($tablename); $update = strtolower($type) == "update"; if ( $update ) $sql = "UPDATE $tablename SET "; else $sql = "INSERT INTO $tablename ("; $flst = ""; $vlst = ""; foreach( $fields as $fn => $typ ) { // $prefixed_fn = $fprefix . $fn; dbg_error_log( "DataUpdate", ":sql_from_object: %s => %s (%s)", $fn, $typ, (isset($obj->{$fn})?$obj->{$fn}:"[undefined value]")); if ( !isset($obj->{$fn}) && isset($obj->{"xxxx$fn"}) ) { // Sometimes we will have prepended 'xxxx' to the field name so that the field // name differs from the column name in the database. $obj->{$fn} = $obj->{"xxxx$fn"}; } if ( !isset($obj->{$fn}) ) continue; $value = $obj->{$fn}; if ( $fn == "password" ) { if ( $value == "******" || $value == "" ) continue; if ( !preg_match('/^\*[0-9a-z+\/=]+\*({SSHA})?[0-9a-z+\/=]+$/i', $value ) ) { $value = (function_exists("session_salted_sha1") ? session_salted_sha1($value) : (function_exists('session_salted_md5') ? session_salted_md5($value) : md5($value) ) ); } } $value = str_replace( "'", "''", str_replace("\\", "\\\\", $value)); if ( preg_match('{^(time|date|interval)}i', $typ ) && $value == "" ) { $value = "NULL"; } else if ( preg_match('{^bool}i', $typ) ) { $value = ( $value == false || $value == "f" || $value == "off" || $value == "no" ? "FALSE" : ( $value == true || $value == "t" || $value == "on" || $value == "yes" ? "TRUE" : "NULL" )); } else if ( preg_match('{^interval}i', $typ) ) { $value = "'$value'::$typ"; } else if ( preg_match('{^int}i', $typ) ) { $value = ($value == '' || $value === null ? 'NULL' : intval( $value )); } else if ( preg_match('{^bit}i', $typ) ) { $value = ($value == '' || $value === null ? 'NULL' : "'$value'"); } else if ( preg_match('{^(text|varchar)}i', $typ) ) { $value = "'$value'"; } else $value = "'$value'::$typ"; if ( $update ) $flst .= ", $fn = $value"; else { $flst .= ", $fn"; $vlst .= ", $value"; } } $flst = substr($flst,2); $vlst = substr($vlst,2); $sql .= $flst; if ( $update ) { $sql .= " $where; "; } else { $sql .= ") VALUES( $vlst ); "; } return $sql; } /** * Build SQL INSERT/UPDATE statement from the $_POST associative array * @param string $type The word "update" or something else (which implies "insert"). * @param string $tablename The name of the table being updated. * @param string $where What the "WHERE ..." clause needs to be for an UPDATE statement. * @param string $fprefix An optional string which all fieldnames in $assoc are prefixed with. * @return string An SQL Update or Insert statement with all fields/values from the array. */ function sql_from_post( $type, $tablename, $where, $fprefix = "" ) { $fakeobject = (object) $_POST; return sql_from_object( $fakeobject, $type, $tablename, $where, $fprefix ); } /** * A Base class to use for records which will be read/written from the database. * @package awl */ class DBRecord { /**#@+ * @access private */ /** * The database table that this record goes in * @var string */ var $Table; /** * The field names for the record. The array index is the field name * and the array value is the field type. * @var array */ var $Fields; /** * The keys for the record as an array of key => value pairs * @var array */ var $Keys; /** * The field values for the record * @var object */ var $Values; /** * The type of database write we will want: either "update" or "insert" * @var object */ var $WriteType; /** * A list of associated other tables. * @var array of string */ var $OtherTable; /** * The field names for each of the other tables associated. The array index * is the table name, the string is a list of field names (and perhaps aliases) * to stuff into the target list for the SELECT. * @var array of string */ var $OtherTargets; /** * An array of JOIN ... clauses. The first array index is the table name and the array value * is the JOIN clause like "LEFT JOIN tn t1 USING (myforeignkey)". * @var array of string */ var $OtherJoin; /** * An array of partial WHERE clauses. These will be combined (if present) with the key * where clause on the main table. * @var array of string */ var $OtherWhere; /**#@-*/ /**#@+ * @access public */ /** * The mode we are in for any form * @var object */ var $EditMode; /**#@-*/ /** * Really numbingly simple construction. */ function DBRecord( ) { dbg_error_log( "DBRecord", ":Constructor: called" ); $this->WriteType = "insert"; $this->EditMode = false; $this->prefix = ""; $values = (object) array(); $this->Values = &$values; } /** * This will read the record from the database if it's available, and * the $keys parameter is a non-empty array. * @param string $table The name of the database table * @param array $keys An associative array containing fieldname => value pairs for the record key. */ function Initialise( $table, $keys = array() ) { dbg_error_log( "DBRecord", ":Initialise: called" ); $this->Table = $table; $this->Fields = get_fields($this->Table); $this->Keys = $keys; $this->WriteType = "insert"; } /** * This will join an additional table to the maintained set * @param string $table The name of the database table * @param array $keys An associative array containing fieldname => value pairs for the record key. * @param string $join A PostgreSQL join clause. * @param string $prefix A field prefix to use for these fields to distinguish them from fields * in other joined tables with the same name. */ function AddTable( $table, $target_list, $join_clause, $and_where ) { dbg_error_log( "DBRecord", ":AddTable: $table called" ); $this->OtherTable[] = $table; $this->OtherTargets[$table] = $target_list; $this->OtherJoin[$table] = $join_clause; $this->OtherWhere[$table] = $and_where; } /** * This will assign $_POST values to the internal Values object for each * field that exists in the Fields array. */ function PostToValues( $prefix = "" ) { foreach ( $this->Fields AS $fname => $ftype ) { @dbg_error_log( "DBRecord", ":PostToValues: %s => %s", $fname, $_POST["$prefix$fname"] ); if ( isset($_POST["$prefix$fname"]) ) { $this->Set($fname, $_POST["$prefix$fname"]); @dbg_error_log( "DBRecord", ":PostToValues: %s => %s", $fname, $_POST["$prefix$fname"] ); } } } /** * Builds a table join clause * @return string A simple SQL target join clause excluding the primary table. */ function _BuildJoinClause() { $clause = ""; foreach( $this->OtherJoins AS $t => $join ) { if ( ! preg_match( '/^\s*$/', $join ) ) { $clause .= ( $clause == "" ? "" : " " ) . $join; } } return $clause; } /** * Builds a field target list * @return string A simple SQL target field list for each field, possibly including prefixes. */ function _BuildFieldList() { $list = ""; foreach( $this->Fields AS $fname => $ftype ) { $list .= ( $list == "" ? "" : ", " ); $list .= "$fname" . ( $this->prefix == "" ? "" : " AS \"$this->prefix$fname\"" ); } foreach( $this->OtherTargets AS $t => $targets ) { if ( ! preg_match( '/^\s*$/', $targets ) ) { $list .= ( $list == "" ? "" : ", " ) . $targets; } } return $list; } /** * Builds a where clause to match the supplied keys * @param boolean $overwrite_values Controls whether the data values for the key fields will be forced to match the key values * @return string A simple SQL where clause, including the initial "WHERE", for each key / value. */ function _BuildWhereClause($overwrite_values=false) { $where = ""; foreach( $this->Keys AS $k => $v ) { // At least assign the key fields... if ( $overwrite_values ) $this->Values->{$k} = $v; // And build the WHERE clause $where .= ( $where == '' ? 'WHERE ' : ' AND ' ); $where .= $k . '=' . AwlQuery::quote($v); } if ( isset($this->OtherWhere) && is_array($this->OtherWhere) ) { foreach( $this->OtherWhere AS $t => $and_where ) { if ( ! preg_match( '/^\s*$/', $and_where ) ) { $where .= ($where == '' ? 'WHERE ' : ' AND (' ) . $and_where . ')'; } } } return $where; } /** * Sets a single field in the record * @param string $fname The name of the field to set the value for * @param string $fval The value to set the field to * @return mixed The new value of the field (i.e. $fval). */ function Set($fname, $fval) { dbg_error_log( "DBRecord", ":Set: %s => %s", $fname, $fval ); $this->Values->{$fname} = $fval; return $fval; } /** * Returns a single field from the record * @param string $fname The name of the field to set the value for * @return mixed The current value of the field. */ function Get($fname) { @dbg_error_log( "DBRecord", ":Get: %s => %s", $fname, $this->Values->{$fname} ); return (isset($this->Values->{$fname}) ? $this->Values->{$fname} : null); } /** * Unsets a single field from the record * @param string $fname The name of the field to unset the value for * @return mixed The current value of the field. */ function Undefine($fname) { if ( !isset($this->Values->{$fname}) ) return null; $current = $this->Values->{$fname}; dbg_error_log( 'DBRecord', ': Unset: %s =was> %s', $fname, $current ); unset($this->Values->{$fname}); return $current; } /** * To write the record to the database * @return boolean Success. */ function Write() { dbg_error_log( "DBRecord", ":Write: %s record as %s.", $this->Table, $this->WriteType ); $sql = sql_from_object( $this->Values, $this->WriteType, $this->Table, $this->_BuildWhereClause(), $this->prefix ); $qry = new AwlQuery($sql); return $qry->Exec( "DBRecord", __LINE__, __FILE__ ); } /** * To read the record from the database. * If we don't have any keys then the record will be blank. * @return boolean Whether we actually read a record. */ function Read() { $i_read_the_record = false; $values = (object) array(); $this->EditMode = true; $where = $this->_BuildWhereClause(true); if ( "" != $where ) { // $fieldlist = $this->_BuildFieldList(); $fieldlist = "*"; // $join = $this->_BuildJoinClause(true); $sql = "SELECT $fieldlist FROM $this->Table $where"; $qry = new AwlQuery($sql); if ( $qry->Exec( "DBRecord", __LINE__, __FILE__ ) && $qry->rows() > 0 ) { $i_read_the_record = true; $values = $qry->Fetch(); $this->EditMode = false; // Default to not editing if we read the record. dbg_error_log( "DBRecord", ":Read: Read %s record from table.", $this->Table, $this->WriteType ); } } $this->Values = &$values; $this->WriteType = ( $i_read_the_record ? "update" : "insert" ); dbg_error_log( "DBRecord", ":Read: Record %s write type is %s.", $this->Table, $this->WriteType ); return $i_read_the_record; } } awl-0.53.orig/inc/EMail.php0000644000000000000000000001567611767325527012360 0ustar * @copyright Catalyst IT Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later */ require_once("AWLUtilities.php"); /** * Lightweight class for sending an e-mail. * @package awl */ class EMail { /**#@+ * @access private */ /** * A comma-separated list of addresses to send To * @var string */ private $To; // To: /** * The visible sender of the e-mail. * @var string */ private $From; // etc... /** * A comma-separated list of addresses to carbon-copy to * @var string */ private $Cc; /** * A comma-separated list of addresses to blind carbon-copy to * @var string */ private $Bcc; /** * A comma-separated list of addresses to set as the Errors-to: header * @var string */ private $ErrorsTo; /** * A comma-separated list of addresses to set as the Reply-to: header * @var string */ private $ReplyTo; /** * The address to set as the sender of the e-mail. * @var string */ private $Sender; /** * The subject line of the email. * @var string */ private $Subject; /** * The body of the email. * @var string */ private $Body; /**#@-*/ /** * Create the e-mail, optionally assigning the subject and primary recipient. * @param string $subject The subject line of the email. * @param string $to A comma-separated list of addresses for the primary recipient(s). */ function __construct( $subject = "", $to = "" ) { // Initialise with some defaults $this->From = ""; $this->Subject = $subject; $this->To = $to; $this->Cc = ""; $this->Bcc = ""; $this->ErrorsTo = ""; $this->ReplyTo = ""; $this->Sender = ""; $this->Body = ""; } /** * Append something with a comma delimter onto the existing referenced string * @param stringref &$onto The string we will be appending to. * @param string $extra What we will be appending * @return string The new string. */ private function _AppendDelimited( &$onto, $extra ) { if ( !isset($extra) || $extra == "" ) return false; if ( $onto != "" ) $onto .= ", "; $onto .= $extra; return $onto; } /** * Add another recipient to the email * @param string $recipient The email address to append. * @return string The new recipient list. */ function AddTo( $recipient ) { return $this->_AppendDelimited($this->To, $recipient); } /** * Add another Cc recipient to the email * @param string $recipient The email address to append. * @return string The new Cc recipient list. */ function AddCc( $recipient ) { return $this->_AppendDelimited($this->Cc, $recipient); } /** * Add another Bcc recipient to the email * @param string $recipient The email address to append. * @return string The new Bcc recipient list. */ function AddBcc( $recipient ) { return $this->_AppendDelimited($this->Bcc, $recipient); } /** * Add another Reply-to address to the email * @param string $recipient The email address to append. * @return string The new Reply-to list. */ function AddReplyTo( $recipient ) { return $this->_AppendDelimited($this->ReplyTo, $recipient); } /** * Add another Error recipient to the email * @param string $recipient The email address to append. * @return string The new Error recipient list. */ function AddErrorsTo( $recipient ) { return $this->_AppendDelimited($this->ErrorsTo, $recipient); } /** * Set the visible From address for the e-mail. * @param string $recipient The visible From address * @return string The new From address */ function SetFrom( $sender ) { $this->From = $sender; return $sender; } /** * Set the envelope sender address for the e-mail. * @param string $recipient The e-mail address for the sender * @return string The new envelope sender address. */ function SetSender( $sender ) { $this->Sender = $sender; return $sender; } /** * Set the subject line for the email * @param string $recipient The new subject line. * @return string The new subject line. */ function SetSubject( $subject ) { $this->Subject = $subject; return $subject; } /** * Set the body of the e-mail. * @param string $recipient The email address to append. * @return string The new body of the e-mail. */ function SetBody( $body ) { $this->Body = $body; return $body; } /** * Actually send the email * @param string $additional_headers Any additional headers that are needed. */ function Send( $additional_headers = "" ) { if ( !empty($this->From) ) $additional_headers .= "From: $this->From\r\n"; if ( !empty($this->Cc) ) $additional_headers .= "Cc: $this->Cc\r\n"; if ( !empty($this->Bcc) ) $additional_headers .= "Bcc: $this->Bcc\r\n"; if ( !empty($this->ReplyTo) ) $additional_headers .= "Reply-To: $this->ReplyTo\r\n"; if ( !empty($this->ErrorsTo) ) $additional_headers .= "Errors-To: $this->ErrorsTo\r\n"; $additional_parameters = ""; if ( !empty($this->Sender) ) $additional_parameters = "-f$this->Sender"; mail( $this->To, $this->Subject, $this->Body, $additional_headers, $additional_parameters ); } /** * Don't actually send the email, just log it. * @param string $additional_headers Any additional headers that are needed. */ function PretendLog( $additional_headers = "" ) { if ( !empty($this->From) ) dbg_error_log('LOG', "From: $this->From"); if ( !empty($this->Cc) ) dbg_error_log('LOG', "Cc: $this->Cc"); if ( !empty($this->Bcc) ) dbg_error_log('LOG', "Bcc: $this->Bcc"); if ( !empty($this->ReplyTo) ) dbg_error_log('LOG', "Reply-To: $this->ReplyTo"); if ( !empty($this->ErrorsTo) ) dbg_error_log('LOG', "Errors-To: $this->ErrorsTo"); $additional_parameters = ""; if ( !empty($this->Sender) ) dbg_error_log('LOG', "Envelope Sender set to: $this->Sender"); dbg_error_log('LOG', "To: $this->To"); dbg_error_log('LOG', "Subject: $this->Subject"); dbg_error_log('LOG', "Body: $this->Body"); } /** * Don't actually send the email, just output it directly in the stream(!). We use this method * when we're doing regression testing. * @param string $additional_headers Any additional headers that are needed. */ function Pretend( $additional_headers = "" ) { if ( !empty($this->From) ) print("From: $this->From\r\n"); if ( !empty($this->Cc) ) print("Cc: $this->Cc\r\n"); if ( !empty($this->Bcc) ) print("Bcc: $this->Bcc\r\n"); if ( !empty($this->ReplyTo) ) print("Reply-To: $this->ReplyTo\r\n"); if ( !empty($this->ErrorsTo) ) print("Errors-To: $this->ErrorsTo\r\n"); $additional_parameters = ""; if ( !empty($this->Sender) ) print("Envelope Sender set to: $this->Sender\r\n"); print("To: $this->To\r\n"); print("Subject: $this->Subject\r\n"); print("Body: $this->Body\r\n"); } } awl-0.53.orig/inc/Translation.php0000644000000000000000000001015211511256742013634 0ustar * @copyright Catalyst IT Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later */ if ( !function_exists('i18n') ) { /** * Mark a string as being internationalized. This is a semaphore method; it * does nothing but it allows us to easily identify strings that require * translation. Generally this is used to mark strings that will be stored * in the database (like descriptions of permissions). * * AWL uses GNU gettext for internationalization (i18n) and localization (l10n) of * text presented to the user. Gettext needs to know about all places involving strings, * that must be translated. Mark any place, where localization at runtime shall take place * by using the function translate(). * * In the help I have used 'xlate' rather than 'translate' and 'x18n' rather than 'i18n' * so that the tools skip this particular file for translation :-) * * E.g. instead of: * print 'TEST to be displayed in different languages'; * use: * print xlate('TEST to be displayed in different languages'); * and you are all set for pure literals. The translation teams will receive that literal * string as a job to translate and will translate it (when the message is clear enough). * At runtime the message is then localized when printed. * The input string can contain a hint to assist translators: * print xlate('TT '); * The hint portion of the string will not be printed. * * But consider this case: * $message_to_be_localized = 'TEST to be displayed in different languages'; * print xlate($message_to_be_localized); * * The translate() function is called in the right place for runtime handling, but there * is no message at gettext preprocessing time to be given to the translation teams, * just a variable name. Translation of the variable name would break the code! So all * places potentially feeding this variable have to be marked to be given to translation * teams, but not translated at runtime! * * This method resolves all such cases. Simply mark the candidates: * $message_to_be_localized = x18n('TEST to be displayed in different languages'); * print xlate($message_to_be_localized); * * @param string the value * @return string the same value */ function i18n($value) { return $value; /* Just pass the value through */ } } if ( !function_exists('translate') ) { /** * Convert a string in English to whatever this user's locale is */ if ( function_exists('gettext') ) { function translate( $en ) { if ( ! isset($en) || $en == '' ) return $en; $xl = gettext($en); dbg_error_log('I18N','Translated =%s= into =%s=', $en, $xl ); return $xl; } } else { function translate( $en ) { return $en; } } } if ( !function_exists('init_gettext') ) { /** * Initialise our use of Gettext */ function init_gettext( $domain, $location ) { if ( !function_exists('bindtextdomain') ) return; bindtextdomain( $domain, $location ); $codeset = bind_textdomain_codeset( $domain, 'UTF-8' ); textdomain( $domain ); dbg_error_log('I18N','Bound domain =%s= to location =%s= using character set =%s=', $domain, $location, $codeset ); } } if ( !function_exists('awl_set_locale') ) { /** * Set the translation to the user's locale. At this stage all we do is * call the gettext function. */ function awl_set_locale( $locale ) { global $c; if ( !is_array($locale) && ! preg_match('/^[a-z]{2}(_[A-Z]{2})?\./', $locale ) ) { $locale = array( $locale, $locale.'.UTF-8'); } if ( !function_exists('setlocale') ) { dbg_log_array('WARN','No "setlocale()" function? PHP gettext support missing?' ); return; } if ( $newlocale = setlocale( LC_ALL, $locale) ) { dbg_error_log('I18N','Set locale to =%s=', $newlocale ); $c->current_locale = $newlocale; } else { dbg_log_array('I18N','Unsupported locale: ', $locale, false ); } } } awl-0.53.orig/inc/XMLElement.php0000644000000000000000000002601411760653201013311 0ustar * @copyright Catalyst .Net Ltd, Morphoss Ltd * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL version 3 or later */ require_once('AWLUtilities.php'); /** * A class for XML elements which may have attributes, or contain * other XML sub-elements * * @package awl */ class XMLElement { protected $tagname; protected $xmlns; protected $attributes; protected $content; protected $_parent; /** * Constructor - nothing fancy as yet. * * @param string $tagname The tag name of the new element * @param mixed $content Either a string of content, or an array of sub-elements * @param array $attributes An array of attribute name/value pairs * @param string $xmlns An XML namespace specifier */ function __construct( $tagname, $content=false, $attributes=false, $xmlns=null ) { $this->tagname=$tagname; if ( gettype($content) == "object" ) { // Subtree to be parented here $this->content = array(&$content); } else { // Array or text $this->content = $content; } $this->attributes = $attributes; if ( isset($xmlns) ) { $this->xmlns = $xmlns; } else { if ( preg_match( '{^(.*):([^:]*)$}', $tagname, $matches) ) { $prefix = $matches[1]; $tag = $matches[2]; if ( isset($this->attributes['xmlns:'.$prefix]) ) { $this->xmlns = $this->attributes['xmlns:'.$prefix]; } } else if ( isset($this->attributes['xmlns']) ) { $this->xmlns = $this->attributes['xmlns']; } } } /** * Count the number of elements * @return int The number of elements */ function CountElements( ) { if ( $this->content === false ) return 0; if ( is_array($this->content) ) return count($this->content); if ( $this->content == '' ) return 0; return 1; } /** * Set an element attribute to a value * * @param string The attribute name * @param string The attribute value */ function SetAttribute($k,$v) { if ( gettype($this->attributes) != "array" ) $this->attributes = array(); $this->attributes[$k] = $v; if ( strtolower($k) == 'xmlns' ) { $this->xmlns = $v; } } /** * Set the whole content to a value * * @param mixed The element content, which may be text, or an array of sub-elements */ function SetContent($v) { $this->content = $v; } /** * Accessor for the tag name * * @return string The tag name of the element */ function GetTag() { return $this->tagname; } /** * Accessor for the full-namespaced tag name * * @return string The tag name of the element, prefixed by the namespace */ function GetNSTag() { return (empty($this->xmlns) ? '' : $this->xmlns . ':') . $this->tagname; } /** * Accessor for a single attribute * @param string $attr The name of the attribute. * @return string The value of that attribute of the element */ function GetAttribute( $attr ) { if ( $attr == 'xmlns' ) return $this->xmlns; if ( isset($this->attributes[$attr]) ) return $this->attributes[$attr]; return null; } /** * Accessor for the attributes * * @return array The attributes of this element */ function GetAttributes() { return $this->attributes; } /** * Accessor for the content * * @return array The content of this element */ function GetContent() { return $this->content; } /** * Return an array of elements matching the specified tag, or all elements if no tag is supplied. * Unlike GetContent() this will always return an array. * * @return array The XMLElements within the tree which match this tag */ function GetElements( $tag=null, $recursive=false ) { $elements = array(); if ( gettype($this->content) == "array" ) { foreach( $this->content AS $k => $v ) { if ( empty($tag) || $v->GetNSTag() == $tag ) { $elements[] = $v; } if ( $recursive ) { $elements = $elements + $v->GetElements($tag,true); } } } else if ( empty($tag) || (isset($v->content->tagname) && $v->content->GetNSTag() == $tag) ) { $elements[] = $this->content; } return $elements; } /** * Return an array of elements matching the specified path * * @return array The XMLElements within the tree which match this tag */ function GetPath( $path ) { $elements = array(); // printf( "Querying within '%s' for path '%s'\n", $this->tagname, $path ); if ( !preg_match( '#(/)?([^/]+)(/?.*)$#', $path, $matches ) ) return $elements; // printf( "Matches: %s -- %s -- %s\n", $matches[1], $matches[2], $matches[3] ); if ( $matches[2] == '*' || $matches[2] == $this->GetNSTag()) { if ( $matches[3] == '' ) { /** * That is the full path */ $elements[] = $this; } else if ( gettype($this->content) == "array" ) { /** * There is more to the path, so we recurse into that sub-part */ foreach( $this->content AS $k => $v ) { $elements = array_merge( $elements, $v->GetPath($matches[3]) ); } } } if ( $matches[1] != '/' && gettype($this->content) == "array" ) { /** * If our input $path was not rooted, we recurse further */ foreach( $this->content AS $k => $v ) { $elements = array_merge( $elements, $v->GetPath($path) ); } } // printf( "Found %d within '%s' for path '%s'\n", count($elements), $this->tagname, $path ); return $elements; } /** * Add a sub-element * * @param object An XMLElement to be appended to the array of sub-elements */ function AddSubTag(&$v) { if ( gettype($this->content) != "array" ) $this->content = array(); $this->content[] =& $v; return count($this->content); } /** * Add a new sub-element * * @param string The tag name of the new element * @param mixed Either a string of content, or an array of sub-elements * @param array An array of attribute name/value pairs * * @return objectref A reference to the new XMLElement */ function &NewElement( $tagname, $content=false, $attributes=false, $xmlns=null ) { if ( gettype($this->content) != "array" ) $this->content = array(); $element = new XMLElement($tagname,$content,$attributes,$xmlns); $this->content[] =& $element; return $element; } /** * Render just the internal content * * @return string The content of this element, as a string without this element wrapping it. */ function RenderContent($indent=0, $nslist=null, $force_xmlns=false ) { $r = ""; if ( is_array($this->content) ) { /** * Render the sub-elements with a deeper indent level */ $r .= "\n"; foreach( $this->content AS $k => $v ) { if ( is_object($v) ) { $r .= $v->Render($indent+1, "", $nslist, $force_xmlns); } } $r .= substr(" ",0,$indent); } else { /** * Render the content, with special characters escaped * */ $r .= htmlspecialchars($this->content, ENT_NOQUOTES ); } return $r; } /** * Render the document tree into (nicely formatted) XML * * @param int The indenting level for the pretty formatting of the element */ function Render($indent=0, $xmldef="", $nslist=null, $force_xmlns=false) { $r = ( $xmldef == "" ? "" : $xmldef."\n"); $attr = ""; $tagname = $this->tagname; $xmlns_done = false; if ( gettype($this->attributes) == "array" ) { /** * Render the element attribute values */ foreach( $this->attributes AS $k => $v ) { if ( preg_match('#^xmlns(:?(.+))?$#', $k, $matches ) ) { // if ( $force_xmlns ) printf( "1: %s: %s\n", $this->tagname, $this->xmlns ); if ( !isset($nslist) ) $nslist = array(); $prefix = (isset($matches[2]) ? $matches[2] : ''); if ( isset($nslist[$v]) && $nslist[$v] == $prefix ) continue; // No need to include in list as it's in a wrapping element $nslist[$v] = $prefix; if ( !isset($this->xmlns) ) $this->xmlns = $v; $xmlns_done = true; } $attr .= sprintf( ' %s="%s"', $k, htmlspecialchars($v) ); } } if ( isset($this->xmlns) && isset($nslist[$this->xmlns]) && $nslist[$this->xmlns] != '' ) { // if ( $force_xmlns ) printf( "2: %s: %s\n", $this->tagname, $this->xmlns ); $tagname = $nslist[$this->xmlns] . ':' . $tagname; if ( $force_xmlns ) $attr .= sprintf( ' xmlns="%s"', $this->xmlns); } else if ( isset($this->xmlns) && !isset($nslist[$this->xmlns]) && gettype($this->attributes) == 'array' && !isset($this->attributes[$this->xmlns]) ) { // if ( $force_xmlns ) printf( "3: %s: %s\n", $this->tagname, $this->xmlns ); $attr .= sprintf( ' xmlns="%s"', $this->xmlns); } else if ( $force_xmlns && isset($this->xmlns) && ! $xmlns_done ) { // printf( "4: %s: %s\n", $this->tagname, $this->xmlns ); $attr .= sprintf( ' xmlns="%s"', $this->xmlns); } $r .= substr(" ",0,$indent) . '<' . $tagname . $attr; if ( (is_array($this->content) && count($this->content) > 0) || (!is_array($this->content) && strlen($this->content) > 0) ) { $r .= ">"; $r .= $this->RenderContent($indent,$nslist,$force_xmlns); $r .= '\n"; } else { $r .= "/>\n"; } return $r; } function __tostring() { return $this->Render(); } } /** * Rebuild an XML tree in our own style from the parsed XML tags using * a tail-recursive approach. * * @param array $xmltags An array of XML tags we get from using the PHP XML parser * @param intref &$start_from A pointer to our current integer offset into $xmltags * @return mixed Either a single XMLElement, or an array of XMLElement objects. */ function BuildXMLTree( $xmltags, &$start_from ) { $content = array(); if ( !isset($start_from) ) $start_from = 0; for( $i=0; $i < 50000 && isset($xmltags[$start_from]); $i++) { $tagdata = $xmltags[$start_from++]; if ( !isset($tagdata) || !isset($tagdata['tag']) || !isset($tagdata['type']) ) break; if ( $tagdata['type'] == "close" ) break; $xmlns = null; $tag = $tagdata['tag']; if ( preg_match( '{^(.*):([^:]*)$}', $tag, $matches) ) { $xmlns = $matches[1]; $tag = $matches[2]; } $attributes = ( isset($tagdata['attributes']) ? $tagdata['attributes'] : false ); if ( $tagdata['type'] == "open" ) { $subtree = BuildXMLTree( $xmltags, $start_from ); $content[] = new XMLElement($tag, $subtree, $attributes, $xmlns ); } else if ( $tagdata['type'] == "complete" ) { $value = ( isset($tagdata['value']) ? $tagdata['value'] : false ); $content[] = new XMLElement($tag, $value, $attributes, $xmlns ); } } /** * If there is only one element, return it directly, otherwise return the * array of them */ if ( count($content) == 1 ) { return $content[0]; } return $content; } awl-0.53.orig/inc/AwlDatabase.php0000644000000000000000000001207711651213100013500 0ustar pdo_connect. * * We will die if the database is not currently connected and we fail to find * a working connection. * * @package awl * @subpackage AwlDatabase * @author Andrew McMillan * @copyright Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v3 or later * @compatibility Requires PHP 5.1 or later */ require_once('AwlDBDialect.php'); if ( !defined('E_USER_ERROR') ) define('E_USER_ERROR',256); /** * Methods in the AwlDBDialect class which we inherit, include: * __construct() * SetSearchPath( $search_path ) * GetVersion() * GetFields( $tablename_string ) * TranslateSQL( $sql_string ) * Quote( $value, $value_type = null ) * ReplaceParameters( $query_string [, param [, ...]] ) */ /** * Typically there will only be a single instance of the database level class in an application. * @package awl */ class AwlDatabase extends AwlDBDialect { /**#@+ * @access private */ /** * Holds the state of the transaction 0 = not started, 1 = in progress, -1 = error pending rollback/commit */ protected $txnstate = 0; /** * Holds whether we are translating all statements. */ protected $translate_all = false; /**#@-*/ /** * Returns a PDOStatement object created using this database, the supplied SQL string, and any parameters given. * @param string $sql_query_string The SQL string containing optional variable replacements * @param array $driver_options PDO driver options to the prepare statement, commonly to do with cursors */ function prepare( $statement, $driver_options = array() ) { if ( isset($this->translate_all) && $this->translate_all ) { $statement = $this->TranslateSQL( $statement ); } return $this->db->prepare( $statement, $driver_options ); } /** * Returns a PDOStatement object created using this database, the supplied SQL string, and any parameters given. * @param string $sql_query_string The SQL string containing optional variable replacements * @param mixed ... Subsequent arguments are positionally replaced into the $sql_query_string */ function query( $statement ) { return $this->db->query( $statement ); } /** * Begin a transaction. */ function Begin() { if ( $this->txnstate == 0 ) { $this->db->beginTransaction(); $this->txnstate = 1; } else { fatal("Cannot begin a transaction while a transaction is already active."); } return true; } /** * Complete a transaction. */ function Commit() { if ( $this->txnstate != 0 ) { $this->db->commit(); $this->txnstate = 0; } return true; } /** * Cancel a transaction in progress. */ function Rollback() { if ( $this->txnstate != 0 ) { $this->db->rollBack(); $this->txnstate = 0; } else { throw new Exception("Cannot rollback unless a transaction is already active."); } return true; } /** * Returns the current state of a transaction, indicating if we have begun a transaction, whether the transaction * has failed, or if we are not in a transaction. * @return int 0 = not started, 1 = in progress, -1 = error pending rollback/commit */ function TransactionState() { return $this->txnstate; } /** * Operates identically to AwlDatabase::Prepare, except that $this->Translate() will be called on the query * before any processing. */ function PrepareTranslated( $statement, $driver_options = array() ) { $statement = $this->TranslateSQL( $statement ); return $this->prepare( $statement, $driver_options ); } /** * Switches on or off the processing flag controlling whether subsequent calls to AwlDatabase::Prepare are translated * as if PrepareTranslated() had been called. */ function TranslateAll( $onoff_boolean ) { $this->translate_all = $onoff_boolean; return $onoff_boolean; } /** * */ function ErrorInfo() { return $this->db->errorInfo(); } } awl-0.53.orig/inc/MenuSet.php0000644000000000000000000003670011333044760012722 0ustar * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later */ require_once("AWLUtilities.php"); /** * Each menu option is an object. * @package awl */ class MenuOption { /**#@+ * @access private */ /** * The label for the menu item * @var string */ var $label; /** * The target URL for the menu * @var string */ var $target; /** * The title for the item when moused over, which should be displayed as a tooltip. * @var string */ var $title; /** * Whether the menu option is active * @var string */ var $active; /** * For sorting menu options * @var string */ var $sortkey; /** * Style to render the menu option with. * @var string */ var $style; /** * The MenuSet that this menu is a parent of * @var string */ var $submenu_set; /**#@-*/ /** * A reference to this menu option itself * @var reference */ var $self; /**#@+ * @access public */ /** * The rendered HTML fragment (once it has been). * @var string */ var $rendered; /**#@-*/ /** * The thing we click * @param string $label The label to display for this option. * @param string $target The URL to target for this option. * @param string $title Some tooltip help for the title tag. * @param string $style A base class name for this option. * @param int $sortkey An (optional) value to allow option ordering. */ function MenuOption( $label, $target, $title="", $style="menu", $sortkey=1000 ) { $this->label = $label; $this->target = $target; $this->title = $title; $this->style = $style; $this->attributes = array(); $this->active = false; $this->sortkey = $sortkey; $this->rendered = ""; $this->self =& $this; } /** * Convert the menu option into an HTML string * @return string The HTML fragment for the menu option. */ function Render( ) { $r = sprintf('%s', $this->target, $this->style, htmlspecialchars($this->title), "%%attributes%%", htmlspecialchars($this->label), $this->style ); // Now process the generic attributes $attribute_values = ""; foreach( $this->attributes AS $k => $v ) { if ( substr($k, 0, 1) == '_' ) continue; $attribute_values .= ' '.$k.'="'.htmlspecialchars($v).'"'; } $r = str_replace( '%%attributes%%', $attribute_values, $r ); $this->rendered = $r; return "$r"; } /** * Set arbitrary attributes of the menu option * @param string $attribute An arbitrary attribute to be set in the hyperlink. * @param string $value A value for this attribute. */ function Set( $attribute, $value ) { $this->attributes[$attribute] = $value; } /** * Mark it as active, with a fancy style to distinguish that * @param string $style A style used to highlight that the option is active. */ function Active( $style=false ) { $this->active = true; if ( $style ) $this->style = $style; } /** * This menu option is now promoted to the head of a tree */ function AddSubmenu( &$submenu_set ) { $this->submenu_set = &$submenu_set; } /** * Whether this option is currently active. * @return boolean The value of the active flag. */ function IsActive( ) { return ( $this->active ); } /** * Whether this option is currently active. * @return boolean The value of the active flag. */ function MaybeActive( $test_pattern, $active_style ) { if ( is_string($test_pattern) && preg_match($test_pattern,$_SERVER['REQUEST_URI']) ) { $this->Active($active_style); } return ( $this->active ); } } /** * _CompareMenuSequence is used in sorting the menu options into the sequence order * * @param objectref $a The first menu option * @param objectref $b The second menu option * @return int ( $a == b ? 0 ( $a > b ? 1 : -1 )) */ function _CompareMenuSequence( $a, $b ) { dbg_error_log("MenuSet", ":_CompareMenuSequence: Comparing %d with %d", $a->sortkey, $b->sortkey); return ($a->sortkey - $b->sortkey); } /** * A MenuSet is a hierarchy of MenuOptions, some of which might be * MenuSet objects themselves. * * The menu options are presented in HTML span tags, and the menus * themselves are presented inside HTML div tags. All layout and * styling is expected to be provide by CSS. * * A non-trivial example would look something like this: * *require("MenuSet.php"); *$main_menu = new MenuSet('menu', 'menu', 'menu_active'); * ... *$other_menu = new MenuSet('submenu', 'submenu', 'submenu_active'); *$other_menu->AddOption("Extra Other","/extraother.php","Submenu option to do extra things."); *$other_menu->AddOption("Super Other","/superother.php","Submenu option to do super things."); *$other_menu->AddOption("Meta Other","/metaother.php","Submenu option to do meta things."); * ... *$main_menu->AddOption("Do This","/dothis.php","Option to do this thing."); *$main_menu->AddOption("Do That","/dothat.php","Option to do all of that."); *$main_menu->AddSubMenu( $other_menu, "Do The Other","/dotheother.php","Submenu to do all of the other things.", true); * ... *if ( isset($main_menu) && is_object($main_menu) ) { * $main_menu->AddOption("Home","/","Go back to the home page"); * echo $main_menu->Render(); *} * * In a hierarchical menu tree, like the example above, only one sub-menu will be * shown, which will be the first one that is found to have active menu options. * * The menu display will generally recognise the current URL and mark as active the * menu option that matches it, but in some cases it might be desirable to force one * or another option to be marked as active using the appropriate parameter to the * AddOption or AddSubMenu call. * @package awl */ class MenuSet { /**#@+ * @access private */ /** * CSS style to use for the div around the options * @var string */ var $div_id; /** * CSS style to use for normal menu option * @var string */ var $main_class; /** * CSS style to use for active menu option * @var string */ var $active_class; /** * An array of MenuOption objects * @var array */ var $options; /** * Any menu option that happens to parent this set * @var reference */ var $parent; /** * The sortkey used by any previous option * @var last_sortkey */ var $last_sortkey; /** * Will be set to true or false when we link active sub-menus, but will be * unset until we do that. * @var reference */ var $has_active_options; /**#@-*/ /** * Start a new MenuSet with no options. * @param string $div_id An ID for the HTML div that the menu will be presented in. * @param string $main_class A CSS class for most menu options. * @param string $active_class A CSS class for active menu options. */ function MenuSet( $div_id, $main_class = '', $active_class = 'active' ) { $this->options = array(); $this->main_class = $main_class; $this->active_class = $active_class; $this->div_id = $div_id; } /** * Add an option, which is a link. * The call will attempt to work out whether the option should be marked as * active, and will sometimes get it wrong. * @param string $label A Label for the new menu option * @param string $target The URL to target for this option. * @param string $title Some tooltip help for the title tag. * @param string $active Whether this option should be marked as Active. * @param int $sortkey An (optional) value to allow option ordering. * @param external open this link in a new window/tab. * @return mixed A reference to the MenuOption that was added, or false if none were added. */ function &AddOption( $label, $target, $title="", $active=false, $sortkey=null, $external=false ) { if ( !isset($sortkey) ) { $sortkey = (isset($this->last_sortkey) ? $this->last_sortkey + 100 : 1000); } $this->last_sortkey = $sortkey; if ( version_compare(phpversion(), '5.0') < 0) { $new_option = new MenuOption( $label, $target, $title, $this->main_class, $sortkey ); } else { $new_option = new MenuOption( $label, $target, $title, $this->main_class, $sortkey ); } if ( ($old_option = $this->_OptionExists( $label )) === false ) { $this->options[] = &$new_option ; } else { dbg_error_log("MenuSet",":AddOption: Replacing existing option # $old_option ($label)"); $this->options[$old_option] = &$new_option; // Overwrite the existing option } if ( is_bool($active) && $active == false && $_SERVER['REQUEST_URI'] == $target ) { // If $active is not set, then we look for an exact match to the current URL $new_option->Active( $this->active_class ); } else if ( is_bool($active) && $active ) { // When active is specified as a boolean, the recognition has been done externally $new_option->Active( $this->active_class ); } else if ( is_string($active) && preg_match($active,$_SERVER['REQUEST_URI']) ) { // If $active is a string, then we match the current URL to that as a Perl regex $new_option->Active( $this->active_class ); } if ( $external == true ) $new_option->Set('target', '_blank'); return $new_option ; } /** * Add an option, which is a submenu * @param object &$submenu_set A reference to a menu tree * @param string $label A Label for the new menu option * @param string $target The URL to target for this option. * @param string $title Some tooltip help for the title tag. * @param string $active Whether this option should be marked as Active. * @param int $sortkey An (optional) value to allow option ordering. * @return mixed A reference to the MenuOption that was added, or false if none were added. */ function &AddSubMenu( &$submenu_set, $label, $target, $title="", $active=false, $sortkey=2000 ) { $new_option =& $this->AddOption( $label, $target, $title, $active, $sortkey ); $submenu_set->parent = &$new_option ; $new_option->AddSubmenu( $submenu_set ); return $new_option ; } /** * Does the menu have any options that are active. * Most likely used so that we can then set the parent menu as active. * @param string $label A Label for the new menu option * @return boolean Whether the menu has options that are active. */ function _HasActive( ) { if ( isset($this->has_active_options) ) { return $this->has_active_options; } foreach( $this->options AS $k => $v ) { if ( $v->IsActive() ) { $rc = true; return $rc; } } $rc = false; return $rc; } /** * Find out how many options the menu has. * @return int The number of options in the menu. */ function Size( ) { return count($this->options); } /** * See if a menu already has this option * @return boolean Whether the option already exists in the menu. */ function _OptionExists( $newlabel ) { $rc = false; foreach( $this->options AS $k => $v ) { if ( $newlabel == $v->label ) return $k; } return $rc; } /** * Mark each MenuOption as active that has an active sub-menu entry. * * Currently needs to be called manually before rendering but * really should probably be called as part of the render now, * and then this could be a private routine. */ function LinkActiveSubMenus( ) { $this->has_active_options = false; foreach( $this->options AS $k => $v ) { if ( isset($v->submenu_set) && $v->submenu_set->_HasActive() ) { // Note that we need to do it this way, since $v is a copy, not a reference $this->options[$k]->Active( $this->active_class ); $this->has_active_options = true; } } } /** * Mark each MenuOption as active that has an active sub-menu entry. * * Currently needs to be called manually before rendering but * really should probably be called as part of the render now, * and then this could be a private routine. */ function MakeSomethingActive( $test_pattern ) { if ( $this->has_active_options ) return; // Already true. foreach( $this->options AS $k => $v ) { if ( isset($v->submenu_set) && $v->submenu_set->_HasActive() ) { // Note that we need to do it this way, since $v is a copy, not a reference $this->options[$k]->Active( $this->active_class ); $this->has_active_options = true; return $this->has_active_options; } } foreach( $this->options AS $k => $v ) { if ( isset($v->submenu_set) && $v->submenu_set->MakeSomethingActive($test_pattern) ) { // Note that we need to do it this way, since $v is a copy, not a reference $this->options[$k]->Active( $this->active_class ); $this->has_active_options = true; return $this->has_active_options; } else { if ( $this->options[$k]->MaybeActive( $test_pattern, $this->active_class ) ) { $this->has_active_options = true; return $this->has_active_options; } } } return false; } /** * _CompareSequence is used in sorting the menu options into the sequence order * * @param objectref $a The first menu option * @param objectref $b The second menu option * @return int ( $a == b ? 0 ( $a > b ? 1 : -1 )) */ function _CompareSequence( $a, $b ) { dbg_error_log("MenuSet",":_CompareSequence: Comparing %d with %d", $a->sortkey, $b->sortkey); return ($a->sortkey - $b->sortkey); } /** * Render the menu tree to an HTML fragment. * * @param boolean $submenus_inline Indicate whether to render the sub-menus within * the menus, or render them entirely separately after we finish rendering the * top level ones. * @return string The HTML fragment. */ function Render( $submenus_inline = false ) { if ( !isset($this->has_active_options) ) { $this->LinkActiveSubMenus(); } $options = $this->options; usort($options,"_CompareMenuSequence"); $render_sub_menus = false; $r = "
div_id\">\n"; foreach( $options AS $k => $v ) { $r .= $v->Render(); if ( $v->IsActive() && isset($v->submenu_set) && $v->submenu_set->Size() > 0 ) { $render_sub_menus = $v->submenu_set; if ( $submenus_inline ) $r .= $render_sub_menus->Render(); } } $r .="
\n"; if ( !$submenus_inline && $render_sub_menus != false ) { $r .= $render_sub_menus->Render(); } return $r; } /** * Render the menu tree to an HTML fragment. * * @param boolean $submenus_inline Indicate whether to render the sub-menus within * the menus, or render them entirely separately after we finish rendering the * top level ones. * @return string The HTML fragment. */ function RenderAsCSS( $depth = 0, $skip_empty = true ) { $this->LinkActiveSubMenus(); if ( $depth > 0 ) $class = "submenu" . $depth; else $class = "menu"; $options = $this->options; usort($options,"_CompareMenuSequence"); $r = "
div_id\" class=\"$class\">\n
    \n"; foreach( $options AS $k => $v ) { if ( $skip_empty && isset($v->submenu_set) && $v->submenu_set->Size() < 1 ) continue; $r .= "
  • ".$v->Render(); if ( isset($v->submenu_set) && $v->submenu_set->Size() > 0 ) { $r .= $v->submenu_set->RenderAsCSS($depth+1); } $r .= "
  • \n"; } $r .="
\n"; return $r; } } awl-0.53.orig/inc/AuthPlugin.php0000644000000000000000000000357611313647654013440 0ustar * @copyright Catalyst IT Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later */ /** * A class for authenticating and retrieving user information * * @package awl */ class AuthPlugin { /**#@+ * @access private */ var $usr; var $success; /**#@-*/ /**#@+ * @access public */ /**#@-*/ /** * Create a new AuthPlugin object. This is as lightweight as possible. * * @param array $authparams An array of parameters used for this authentication method. */ function AuthPlugin( $authparams ) { $this->success = false; } /** * Authenticate. Do whatever we need to authenticate a username / password. * * @param string $username The username of the person attempting to log in * @param string $password The password the person is trying to log in with * @return object The "user" object, containing fields matching the 'usr' database table */ function Authenticate( $username, $password ) { } } /** * Notes: * This could also be done as a process of "registering" functions to perform the authentication, * so in the Session we call something to (e.g.) do the authentication and that looks in (e.g.) * $c->authenticate_hook for a function to be called, or it just does the normal thing if * that is not set. * It might be a better way. I think I need to bounce these two ideas off some other people... * * In either case Session will need to split the fetching of session data from the fetching of * usr data. So I'll look at doing that first. */ awl-0.53.orig/inc/iCalendar.php0000644000000000000000000016372411772157546013251 0ustar component will point to the wrapping VCALENDAR component of * the iCalendar. This will be fine for simple iCalendar usage as sampled below, * but more complex iCalendar such as a VEVENT with RRULE which has repeat overrides * will need quite a bit more thought to process correctly. * * @example * To create a new iCalendar from several data values: * $ical = new iCalendar( array('DTSTART' => $dtstart, 'SUMMARY' => $summary, 'DURATION' => $duration ) ); * * @example * To render it as an iCalendar string: * echo $ical->Render(); * * @example * To render just the VEVENTs in the iCalendar with a restricted list of properties: * echo $ical->Render( false, 'VEVENT', array( 'DTSTART', 'DURATION', 'DTEND', 'RRULE', 'SUMMARY') ); * * @example * To parse an existing iCalendar string for manipulation: * $ical = new iCalendar( array('icalendar' => $icalendar_text ) ); * * @example * To clear any 'VALARM' components in an iCalendar object * $ical->component->ClearComponents('VALARM'); * * @example * To replace any 'RRULE' property in an iCalendar object * $ical->component->SetProperties( 'RRULE', $rrule_definition ); * * @package awl * @subpackage iCalendar * @author Andrew McMillan * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later * */ require_once('XMLElement.php'); require_once('AwlQuery.php'); /** * A Class for representing properties within an iCalendar * * @package awl */ class iCalProp { /**#@+ * @access private */ /** * The name of this property * * @var string */ var $name; /** * An array of parameters to this property, represented as key/value pairs. * * @var array */ var $parameters; /** * The value of this property. * * @var string */ var $content; /** * The original value that this was parsed from, if that's the way it happened. * * @var string */ var $rendered; /**#@-*/ /** * The constructor parses the incoming string, which is formatted as per RFC2445 as a * propname[;param1=pval1[; ... ]]:propvalue * however we allow ourselves to assume that the RFC2445 content unescaping has already * happened when iCalComponent::ParseFrom() called iCalComponent::UnwrapComponent(). * * @param string $propstring The string from the iCalendar which contains this property. */ function iCalProp( $propstring = null ) { $this->name = ""; $this->content = ""; $this->parameters = array(); unset($this->rendered); if ( $propstring != null && gettype($propstring) == 'string' ) { $this->ParseFrom($propstring); } } /** * The constructor parses the incoming string, which is formatted as per RFC2445 as a * propname[;param1=pval1[; ... ]]:propvalue * however we allow ourselves to assume that the RFC2445 content unescaping has already * happened when iCalComponent::ParseFrom() called iCalComponent::UnwrapComponent(). * * @param string $propstring The string from the iCalendar which contains this property. */ function ParseFrom( $propstring ) { $this->rendered = (strlen($propstring) < 72 ? $propstring : null); // Only pre-rendered if we didn't unescape it $unescaped = preg_replace( '{\\\\[nN]}', "\n", $propstring); // Split into two parts on : which is not preceded by a \ list( $start, $values) = preg_split( '{(?content = preg_replace( "/\\\\([,;:\"\\\\])/", '$1', $values); // Split on ; which is not preceded by a \ $parameters = preg_split( '{(?name = array_shift( $parameters ); $this->parameters = array(); foreach( $parameters AS $k => $v ) { $pos = strpos($v,'='); $name = substr( $v, 0, $pos); $value = substr( $v, $pos + 1); $this->parameters[$name] = $value; } // dbg_error_log('iCalendar', " iCalProp::ParseFrom found '%s' = '%s' with %d parameters", $this->name, substr($this->content,0,200), count($this->parameters) ); } /** * Get/Set name property * * @param string $newname [optional] A new name for the property * * @return string The name for the property. */ function Name( $newname = null ) { if ( $newname != null ) { $this->name = $newname; if ( isset($this->rendered) ) unset($this->rendered); // dbg_error_log('iCalendar', " iCalProp::Name(%s)", $this->name ); } return $this->name; } /** * Get/Set the content of the property * * @param string $newvalue [optional] A new value for the property * * @return string The value of the property. */ function Value( $newvalue = null ) { if ( $newvalue != null ) { $this->content = $newvalue; if ( isset($this->rendered) ) unset($this->rendered); } return $this->content; } /** * Get/Set parameters in their entirety * * @param array $newparams An array of new parameter key/value pairs * * @return array The current array of parameters for the property. */ function Parameters( $newparams = null ) { if ( $newparams != null ) { $this->parameters = $newparams; if ( isset($this->rendered) ) unset($this->rendered); } return $this->parameters; } /** * Test if our value contains a string * * @param string $search The needle which we shall search the haystack for. * * @return string The name for the property. */ function TextMatch( $search ) { if ( isset($this->content) ) { return (stristr( $this->content, $search ) !== false); } return false; } /** * Get the value of a parameter * * @param string $name The name of the parameter to retrieve the value for * * @return string The value of the parameter */ function GetParameterValue( $name ) { if ( isset($this->parameters[$name]) ) return $this->parameters[$name]; } /** * Set the value of a parameter * * @param string $name The name of the parameter to set the value for * * @param string $value The value of the parameter */ function SetParameterValue( $name, $value ) { if ( isset($this->rendered) ) unset($this->rendered); $this->parameters[$name] = $value; } /** * Render the set of parameters as key1=value1[;key2=value2[; ...]] with * any colons or semicolons escaped. */ function RenderParameters() { $rendered = ""; foreach( $this->parameters AS $k => $v ) { $escaped = preg_replace( "/([;:])/", '\\\\$1', $v); $rendered .= sprintf( ";%s=%s", $k, $escaped ); } return $rendered; } /** * Render a suitably escaped RFC2445 content string. */ function Render() { // If we still have the string it was parsed in from, it hasn't been screwed with // and we can just return that without modification. if ( isset($this->rendered) ) return $this->rendered; $property = preg_replace( '/[;].*$/', '', $this->name ); $escaped = $this->content; switch( $property ) { /** Content escaping does not apply to these properties culled from RFC2445 */ case 'ATTACH': case 'GEO': case 'PERCENT-COMPLETE': case 'PRIORITY': case 'DURATION': case 'FREEBUSY': case 'TZOFFSETFROM': case 'TZOFFSETTO': case 'TZURL': case 'ATTENDEE': case 'ORGANIZER': case 'RECURRENCE-ID': case 'URL': case 'EXRULE': case 'SEQUENCE': case 'CREATED': case 'RRULE': case 'REPEAT': case 'TRIGGER': break; case 'COMPLETED': case 'DTEND': case 'DUE': case 'DTSTART': case 'DTSTAMP': case 'LAST-MODIFIED': case 'CREATED': case 'EXDATE': case 'RDATE': if ( isset($this->parameters['VALUE']) && $this->parameters['VALUE'] == 'DATE' ) { $escaped = substr( $escaped, 0, 8); } break; /** Content escaping applies by default to other properties */ default: $escaped = str_replace( '\\', '\\\\', $escaped); $escaped = preg_replace( '/\r?\n/', '\\n', $escaped); $escaped = preg_replace( "/([,;])/", '\\\\$1', $escaped); } $property = sprintf( "%s%s:", $this->name, $this->RenderParameters() ); if ( (strlen($property) + strlen($escaped)) <= 72 ) { $this->rendered = $property . $escaped; } else if ( (strlen($property) + strlen($escaped)) > 72 && (strlen($property) < 72) && (strlen($escaped) < 72) ) { $this->rendered = $property . "\r\n " . $escaped; } else { $this->rendered = preg_replace( '/(.{72})/u', '$1'."\r\n ", $property . $escaped ); } return $this->rendered; } } /** * A Class for representing components within an iCalendar * * @package awl */ class iCalComponent { /**#@+ * @access private */ /** * The type of this component, such as 'VEVENT', 'VTODO', 'VTIMEZONE', etc. * * @var string */ var $type; /** * An array of properties, which are iCalProp objects * * @var array */ var $properties; /** * An array of (sub-)components, which are iCalComponent objects * * @var array */ var $components; /** * The rendered result (or what was originally parsed, if there have been no changes) * * @var array */ var $rendered; /**#@-*/ /** * A basic constructor */ function iCalComponent( $content = null ) { $this->type = ""; $this->properties = array(); $this->components = array(); $this->rendered = ""; if ( $content != null && (gettype($content) == 'string' || gettype($content) == 'array') ) { $this->ParseFrom($content); } } /** * Apply standard properties for a VCalendar * @param array $extra_properties Key/value pairs of additional properties */ function VCalendar( $extra_properties = null ) { $this->SetType('VCALENDAR'); $this->AddProperty('PRODID', '-//davical.org//NONSGML AWL Calendar//EN'); $this->AddProperty('VERSION', '2.0'); $this->AddProperty('CALSCALE', 'GREGORIAN'); if ( is_array($extra_properties) ) { foreach( $extra_properties AS $k => $v ) { $this->AddProperty($k,$v); } } } /** * Collect an array of all parameters of our properties which are the specified type * Mainly used for collecting the full variety of references TZIDs */ function CollectParameterValues( $parameter_name ) { $values = array(); foreach( $this->components AS $k => $v ) { $also = $v->CollectParameterValues($parameter_name); $values = array_merge( $values, $also ); } foreach( $this->properties AS $k => $v ) { $also = $v->GetParameterValue($parameter_name); if ( isset($also) && $also != "" ) { // dbg_error_log( 'iCalendar', "::CollectParameterValues(%s) : Found '%s'", $parameter_name, $also); $values[$also] = 1; } } return $values; } /** * Parse the text $content into sets of iCalProp & iCalComponent within this iCalComponent * @param string $content The raw RFC2445-compliant iCalendar component, including BEGIN:TYPE & END:TYPE */ function ParseFrom( $content ) { $this->rendered = $content; $content = $this->UnwrapComponent($content); $type = false; $subtype = false; $finish = null; $subfinish = null; $length = strlen($content); $linefrom = 0; while( $linefrom < $length ) { $lineto = strpos( $content, "\n", $linefrom ); if ( $lineto === false ) { $lineto = strpos( $content, "\r", $linefrom ); } if ( $lineto > 0 ) { $line = substr( $content, $linefrom, $lineto - $linefrom); $linefrom = $lineto + 1; } else { $line = substr( $content, $linefrom ); $linefrom = $length; } if ( preg_match('/^\s*$/', $line ) ) continue; $line = rtrim( $line, "\r\n" ); // dbg_error_log( 'iCalendar', "::ParseFrom: Parsing line: $line"); if ( $type === false ) { if ( preg_match( '/^BEGIN:(.+)$/', $line, $matches ) ) { // We have found the start of the main component $type = $matches[1]; $finish = "END:$type"; $this->type = $type; dbg_error_log( 'iCalendar', "::ParseFrom: Start component of type '%s'", $type); } else { dbg_error_log( 'iCalendar', "::ParseFrom: Ignoring crap before start of component: $line"); // unset($lines[$k]); // The content has crap before the start if ( $line != "" ) $this->rendered = null; } } else if ( $type == null ) { dbg_error_log( 'iCalendar', "::ParseFrom: Ignoring crap after end of component"); if ( $line != "" ) $this->rendered = null; } else if ( $line == $finish ) { dbg_error_log( 'iCalendar', "::ParseFrom: End of component"); $type = null; // We have reached the end of our component } else { if ( $subtype === false && preg_match( '/^BEGIN:(.+)$/', $line, $matches ) ) { // We have found the start of a sub-component $subtype = $matches[1]; $subfinish = "END:$subtype"; $subcomponent = $line . "\r\n"; dbg_error_log( 'iCalendar', "::ParseFrom: Found a subcomponent '%s'", $subtype); } else if ( $subtype ) { // We are inside a sub-component $subcomponent .= $this->WrapComponent($line); if ( $line == $subfinish ) { dbg_error_log( 'iCalendar', "::ParseFrom: End of subcomponent '%s'", $subtype); // We have found the end of a sub-component $this->components[] = new iCalComponent($subcomponent); $subtype = false; } // else // dbg_error_log( 'iCalendar', "::ParseFrom: Inside a subcomponent '%s'", $subtype ); } else { // dbg_error_log( 'iCalendar', "::ParseFrom: Parse property of component"); // It must be a normal property line within a component. $this->properties[] = new iCalProp($line); } } } } /** * This unescapes the (CRLF + linear space) wrapping specified in RFC2445. According * to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising * XML parsers often muck with it and may remove the CR. We accept either case. */ function UnwrapComponent( $content ) { return preg_replace('/\r?\n[ \t]/', '', $content ); } /** * This imposes the (CRLF + linear space) wrapping specified in RFC2445. According * to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising * XML parsers often muck with it and may remove the CR. We output RFC2445 compliance. * * In order to preserve pre-existing wrapping in the component, we split the incoming * string on line breaks before running wordwrap over each component of that. */ function WrapComponent( $content ) { $strs = preg_split( "/\r?\n/", $content ); $wrapped = ""; foreach ($strs as $str) { $wrapped .= preg_replace( '/(.{72})/u', '$1'."\r\n ", $str ) ."\r\n"; } return $wrapped; } /** * Return the type of component which this is */ function GetType() { return $this->type; } /** * Set the type of component which this is */ function SetType( $type ) { if ( isset($this->rendered) ) unset($this->rendered); $this->type = $type; return $this->type; } /** * Get all properties, or the properties matching a particular type */ function GetProperties( $type = null ) { $properties = array(); foreach( $this->properties AS $k => $v ) { if ( $type == null || $v->Name() == $type ) { $properties[$k] = $v; } } return $properties; } /** * Get the value of the first property matching the name. Obviously this isn't * so useful for properties which may occur multiply, but most don't. * * @param string $type The type of property we are after. * @return string The value of the property, or null if there was no such property. */ function GetPValue( $type ) { foreach( $this->properties AS $k => $v ) { if ( $v->Name() == $type ) return $v->Value(); } return null; } /** * Get the value of the specified parameter for the first property matching the * name. Obviously this isn't so useful for properties which may occur multiply, but most don't. * * @param string $type The type of property we are after. * @param string $type The name of the parameter we are after. * @return string The value of the parameter for the property, or null in the case that there was no such property, or no such parameter. */ function GetPParamValue( $type, $parameter_name ) { foreach( $this->properties AS $k => $v ) { if ( $v->Name() == $type ) return $v->GetParameterValue($parameter_name); } return null; } /** * Clear all properties, or the properties matching a particular type * @param string $type The type of property - omit for all properties */ function ClearProperties( $type = null ) { if ( $type != null ) { // First remove all the existing ones of that type foreach( $this->properties AS $k => $v ) { if ( $v->Name() == $type ) { unset($this->properties[$k]); if ( isset($this->rendered) ) unset($this->rendered); } } $this->properties = array_values($this->properties); } else { if ( isset($this->rendered) ) unset($this->rendered); $this->properties = array(); } } /** * Set all properties, or the ones matching a particular type */ function SetProperties( $new_properties, $type = null ) { if ( isset($this->rendered) && count($new_properties) > 0 ) unset($this->rendered); $this->ClearProperties($type); foreach( $new_properties AS $k => $v ) { $this->AddProperty($v); } } /** * Adds a new property * * @param iCalProp $new_property The new property to append to the set, or a string with the name * @param string $value The value of the new property (default: param 1 is an iCalProp with everything * @param array $parameters The key/value parameter pairs (default: none, or param 1 is an iCalProp with everything) */ function AddProperty( $new_property, $value = null, $parameters = null ) { if ( isset($this->rendered) ) unset($this->rendered); if ( isset($value) && gettype($new_property) == 'string' ) { $new_prop = new iCalProp(); $new_prop->Name($new_property); $new_prop->Value($value); if ( $parameters != null ) $new_prop->Parameters($parameters); dbg_error_log('iCalendar'," Adding new property '%s'", $new_prop->Render() ); $this->properties[] = $new_prop; } else if ( gettype($new_property) ) { $this->properties[] = $new_property; } } /** * Get all sub-components, or at least get those matching a type * @return array an array of the sub-components */ function &FirstNonTimezone( $type = null ) { foreach( $this->components AS $k => $v ) { if ( $v->GetType() != 'VTIMEZONE' ) return $this->components[$k]; } $result = false; return $result; } /** * Return true if the person identified by the email address is down as an * organizer for this meeting. * @param string $email The e-mail address of the person we're seeking. * @return boolean true if we found 'em, false if we didn't. */ function IsOrganizer( $email ) { if ( !preg_match( '#^mailto:#', $email ) ) $email = 'mailto:'.$email; $props = $this->GetPropertiesByPath('!VTIMEZONE/ORGANIZER'); foreach( $props AS $k => $prop ) { if ( $prop->Value() == $email ) return true; } return false; } /** * Return true if the person identified by the email address is down as an * attendee or organizer for this meeting. * @param string $email The e-mail address of the person we're seeking. * @return boolean true if we found 'em, false if we didn't. */ function IsAttendee( $email ) { if ( !preg_match( '#^mailto:#', $email ) ) $email = 'mailto:'.$email; if ( $this->IsOrganizer($email) ) return true; /** an organizer is an attendee, as far as we're concerned */ $props = $this->GetPropertiesByPath('!VTIMEZONE/ATTENDEE'); foreach( $props AS $k => $prop ) { if ( $prop->Value() == $email ) return true; } return false; } /** * Get all sub-components, or at least get those matching a type, or failling to match, * should the second parameter be set to false. * * @param string $type The type to match (default: All) * @param boolean $normal_match Set to false to invert the match (default: true) * @return array an array of the sub-components */ function GetComponents( $type = null, $normal_match = true ) { $components = $this->components; if ( $type != null ) { foreach( $components AS $k => $v ) { if ( ($v->GetType() != $type) === $normal_match ) { unset($components[$k]); } } $components = array_values($components); } return $components; } /** * Clear all components, or the components matching a particular type * @param string $type The type of component - omit for all components */ function ClearComponents( $type = null ) { if ( $type != null ) { // First remove all the existing ones of that type foreach( $this->components AS $k => $v ) { if ( $v->GetType() == $type ) { unset($this->components[$k]); if ( isset($this->rendered) ) unset($this->rendered); } else { if ( ! $this->components[$k]->ClearComponents($type) ) { if ( isset($this->rendered) ) unset($this->rendered); } } } return isset($this->rendered); } else { if ( isset($this->rendered) ) unset($this->rendered); $this->components = array(); } } /** * Sets some or all sub-components of the component to the supplied new components * * @param array of iCalComponent $new_components The new components to replace the existing ones * @param string $type The type of components to be replaced. Defaults to null, which means all components will be replaced. */ function SetComponents( $new_component, $type = null ) { if ( isset($this->rendered) ) unset($this->rendered); if ( count($new_component) > 0 ) $this->ClearComponents($type); foreach( $new_component AS $k => $v ) { $this->components[] = $v; } } /** * Adds a new subcomponent * * @param iCalComponent $new_component The new component to append to the set */ function AddComponent( $new_component ) { if ( is_array($new_component) && count($new_component) == 0 ) return; if ( isset($this->rendered) ) unset($this->rendered); if ( is_array($new_component) ) { foreach( $new_component AS $k => $v ) { $this->components[] = $v; } } else { $this->components[] = $new_component; } } /** * Mask components, removing any that are not of the types in the list * @param array $keep An array of component types to be kept */ function MaskComponents( $keep ) { foreach( $this->components AS $k => $v ) { if ( ! in_array( $v->GetType(), $keep ) ) { unset($this->components[$k]); if ( isset($this->rendered) ) unset($this->rendered); } else { $v->MaskComponents($keep); } } } /** * Mask properties, removing any that are not in the list * @param array $keep An array of property names to be kept * @param array $component_list An array of component types to check within */ function MaskProperties( $keep, $component_list=null ) { foreach( $this->components AS $k => $v ) { $v->MaskProperties($keep, $component_list); } if ( !isset($component_list) || in_array($this->GetType(),$component_list) ) { foreach( $this->components AS $k => $v ) { if ( ! in_array( $v->GetType(), $keep ) ) { unset($this->components[$k]); if ( isset($this->rendered) ) unset($this->rendered); } } } } /** * Clone this component (and subcomponents) into a confidential version of it. A confidential * event will be scrubbed of any identifying characteristics other than time/date, repeat, uid * and a summary which is just a translated 'Busy'. */ function CloneConfidential() { $confidential = clone($this); $keep_properties = array( 'DTSTAMP', 'DTSTART', 'RRULE', 'DURATION', 'DTEND', 'DUE', 'UID', 'CLASS', 'TRANSP', 'CREATED', 'LAST-MODIFIED' ); $resource_components = array( 'VEVENT', 'VTODO', 'VJOURNAL' ); $confidential->MaskComponents(array( 'VTIMEZONE', 'VEVENT', 'VTODO', 'VJOURNAL' )); $confidential->MaskProperties($keep_properties, $resource_components ); if ( in_array( $confidential->GetType(), $resource_components ) ) { $confidential->AddProperty( 'SUMMARY', translate('Busy') ); } foreach( $confidential->components AS $k => $v ) { if ( in_array( $v->GetType(), $resource_components ) ) { $v->AddProperty( 'SUMMARY', translate('Busy') ); } } return $confidential; } /** * Renders the component, possibly restricted to only the listed properties */ function Render( $restricted_properties = null) { $unrestricted = (!isset($restricted_properties) || count($restricted_properties) == 0); if ( isset($this->rendered) && $unrestricted ) return $this->rendered; $rendered = "BEGIN:$this->type\r\n"; foreach( $this->properties AS $k => $v ) { if ( method_exists($v, 'Render') ) { if ( $unrestricted || isset($restricted_properties[$v]) ) $rendered .= $v->Render() . "\r\n"; } } foreach( $this->components AS $v ) { $rendered .= $v->Render(); } $rendered .= "END:$this->type\r\n"; $rendered = preg_replace('{(?rendered = $rendered; return $rendered; } /** * Return an array of properties matching the specified path * * @return array An array of iCalProp within the tree which match the path given, in the form * [/]COMPONENT[/...]/PROPERTY in a syntax kind of similar to our poor man's XML queries. We * also allow COMPONENT and PROPERTY to be !COMPONENT and !PROPERTY for ++fun. * * @note At some point post PHP4 this could be re-done with an iterator, which should be more efficient for common use cases. */ function GetPropertiesByPath( $path ) { $properties = array(); dbg_error_log( 'iCalendar', "GetPropertiesByPath: Querying within '%s' for path '%s'", $this->type, $path ); if ( !preg_match( '#(/?)(!?)([^/]+)(/?.*)$#', $path, $matches ) ) return $properties; $adrift = ($matches[1] == ''); $normal = ($matches[2] == ''); $ourtest = $matches[3]; $therest = $matches[4]; dbg_error_log( 'iCalendar', "GetPropertiesByPath: Matches: %s -- %s -- %s -- %s\n", $matches[1], $matches[2], $matches[3], $matches[4] ); if ( $ourtest == '*' || (($ourtest == $this->type) === $normal) && $therest != '' ) { if ( preg_match( '#^/(!?)([^/]+)$#', $therest, $matches ) ) { $normmatch = ($matches[1] ==''); $proptest = $matches[2]; foreach( $this->properties AS $k => $v ) { if ( $proptest == '*' || (($v->Name() == $proptest) === $normmatch ) ) { $properties[] = $v; } } } else { /** * There is more to the path, so we recurse into that sub-part */ foreach( $this->components AS $k => $v ) { $properties = array_merge( $properties, $v->GetPropertiesByPath($therest) ); } } } if ( $adrift ) { /** * Our input $path was not rooted, so we recurse further */ foreach( $this->components AS $k => $v ) { $properties = array_merge( $properties, $v->GetPropertiesByPath($path) ); } } dbg_error_log('iCalendar', "GetPropertiesByPath: Found %d within '%s' for path '%s'\n", count($properties), $this->type, $path ); return $properties; } } /** ************************************************************************************ * Everything below here is deprecated and should be avoided in favour * of using, improving and enhancing the more sensible structures above. ************************************************************************************ */ /** * A Class for handling Events on a calendar (DEPRECATED) * * @package awl */ class iCalendar { // DEPRECATED /**#@+ * @access private */ /** * The component-ised version of the iCalendar * @var component iCalComponent */ var $component; /** * An array of arbitrary properties, containing arbitrary arrays of arbitrary properties * @var properties array */ var $properties; /** * An array of the lines of this iCalendar resource * @var lines array */ var $lines; /** * The typical location name for the standard timezone such as "Pacific/Auckland" * @var tz_locn string */ var $tz_locn; /** * The type of iCalendar data VEVENT/VTODO/VJOURNAL * @var type string */ var $type; /**#@-*/ /** * @DEPRECATED: This class will be removed soon. * The constructor takes an array of args. If there is an element called 'icalendar' * then that will be parsed into the iCalendar object. Otherwise the array elements * are converted into properties of the iCalendar object directly. */ function iCalendar( $args ) { global $c; deprecated('iCalendar::iCalendar'); $this->tz_locn = ""; if ( !isset($args) || !(is_array($args) || is_object($args)) ) return; if ( is_object($args) ) { settype($args,'array'); } $this->component = new iCalComponent(); if ( isset($args['icalendar']) ) { $this->component->ParseFrom($args['icalendar']); $this->lines = preg_split('/\r?\n/', $args['icalendar'] ); $this->SaveTimeZones(); $first =& $this->component->FirstNonTimezone(); if ( $first ) { $this->type = $first->GetType(); $this->properties = $first->GetProperties(); } else { $this->properties = array(); } $this->properties['VCALENDAR'] = array('***ERROR*** This class is being referenced in an unsupported way!'); return; } if ( isset($args['type'] ) ) { $this->type = $args['type']; unset( $args['type'] ); } else { $this->type = 'VEVENT'; // Default to event } $this->component->SetType('VCALENDAR'); $this->component->SetProperties( array( new iCalProp('PRODID:-//davical.org//NONSGML AWL Calendar//EN'), new iCalProp('VERSION:2.0'), new iCalProp('CALSCALE:GREGORIAN') ) ); $first = new iCalComponent(); $first->SetType($this->type); $this->properties = array(); foreach( $args AS $k => $v ) { dbg_error_log( 'iCalendar', ":Initialise: %s to >>>%s<<<", $k, $v ); $property = new iCalProp(); $property->Name($k); $property->Value($v); $this->properties[] = $property; } $first->SetProperties($this->properties); $this->component->SetComponents( array($first) ); $this->properties['VCALENDAR'] = array('***ERROR*** This class is being referenced in an unsupported way!'); /** * @todo Need to handle timezones!!! */ if ( $this->tz_locn == "" ) { $this->tz_locn = $this->Get("tzid"); if ( (!isset($this->tz_locn) || $this->tz_locn == "") && isset($c->local_tzid) ) { $this->tz_locn = $c->local_tzid; } } } /** * @DEPRECATED: This class will be removed soon. * Save any timezones by TZID in the PostgreSQL database for future re-use. */ function SaveTimeZones() { global $c; deprecated('iCalendar::SaveTimeZones'); $this->tzid_list = array_keys($this->component->CollectParameterValues('TZID')); if ( ! isset($this->tzid) && count($this->tzid_list) > 0 ) { dbg_error_log( 'iCalendar', "::TZID_List[0] = '%s', count=%d", $this->tzid_list[0], count($this->tzid_list) ); $this->tzid = $this->tzid_list[0]; } $timezones = $this->component->GetComponents('VTIMEZONE'); if ( $timezones === false || count($timezones) == 0 ) return; $this->vtimezone = $timezones[0]->Render(); // Backward compatibility $tzid = $this->Get('TZID'); if ( isset($c->save_time_zone_defs) && $c->save_time_zone_defs ) { foreach( $timezones AS $k => $tz ) { $tzid = $tz->GetPValue('TZID'); $qry = new AwlQuery( "SELECT tz_locn FROM time_zone WHERE tz_id = ?;", $tzid ); if ( $qry->Exec('iCalendar') && $qry->rows() == 1 ) { $row = $qry->Fetch(); if ( !isset($first_tzid) ) $first_tzid = $row->tz_locn; continue; } if ( $tzid != "" && $qry->rows() == 0 ) { $tzname = $tz->GetPValue('X-LIC-LOCATION'); if ( !isset($tzname) ) $tzname = olson_from_tzstring($tzid); $qry2 = new AwlQuery( "INSERT INTO time_zone (tz_id, tz_locn, tz_spec) VALUES( ?, ?, ? );", $tzid, $tzname, $tz->Render() ); $qry2->Exec('iCalendar'); } } } if ( ! isset($this->tzid) && isset($first_tzid) ) $this->tzid = $first_tzid; if ( (!isset($this->tz_locn) || $this->tz_locn == '') && isset($first_tzid) && $first_tzid != '' ) { $tzname = preg_replace('#^(.*[^a-z])?([a-z]+/[a-z]+)$#i','$2', $first_tzid ); if ( preg_match( '#\S+/\S+#', $tzname) ) { $this->tz_locn = $tzname; } dbg_error_log( 'iCalendar', " TZCrap1: TZID '%s', Location '%s', Perhaps: %s", $tzid, $this->tz_locn, $tzname ); } if ( (!isset($this->tz_locn) || $this->tz_locn == "") && isset($c->local_tzid) ) { $this->tz_locn = $c->local_tzid; } if ( ! isset($this->tzid) && isset($this->tz_locn) ) $this->tzid = $this->tz_locn; } /** * An array of property names that we should always want when rendering an iCalendar * * @DEPRECATED: This class will be removed soon. * @todo Remove this function. */ function DefaultPropertyList() { dbg_error_log( "LOG", " iCalendar: Call to deprecated method '%s'", 'DefaultPropertyList' ); return array( "UID" => 1, "DTSTAMP" => 1, "DTSTART" => 1, "DURATION" => 1, "LAST-MODIFIED" => 1,"CLASS" => 1, "TRANSP" => 1, "SEQUENCE" => 1, "DUE" => 1, "SUMMARY" => 1, "RRULE" => 1 ); } /** * A function to extract the contents of a BEGIN:SOMETHING to END:SOMETHING (perhaps multiply) * and return just that bit (or, of course, those bits :-) * * @var string The type of thing(s) we want returned. * @var integer The number of SOMETHINGS we want to get. * * @return string A string from BEGIN:SOMETHING to END:SOMETHING, possibly multiple of these * * @DEPRECATED: This class will be removed soon. * @todo Remove this function. */ function JustThisBitPlease( $type, $count=1 ) { deprecated('iCalendar::JustThisBitPlease' ); $answer = ""; $intags = false; $start = "BEGIN:$type"; $finish = "END:$type"; dbg_error_log( 'iCalendar', ":JTBP: Looking for %d subsets of type %s", $count, $type ); reset($this->lines); foreach( $this->lines AS $k => $v ) { if ( !$intags && $v == $start ) { $answer .= $v . "\n"; $intags = true; } else if ( $intags && $v == $finish ) { $answer .= $v . "\n"; $intags = false; } else if ( $intags ) { $answer .= $v . "\n"; } } return $answer; } /** * Function to parse lines from BEGIN:SOMETHING to END:SOMETHING into a nested array structure * * @var string The "SOMETHING" from the BEGIN:SOMETHING line we just met * @return arrayref An array of the things we found between (excluding) the BEGIN & END, some of which might be sub-arrays * * @DEPRECATED: This class will be removed soon. * @todo Remove this function. */ function &ParseSomeLines( $type ) { deprecated('iCalendar::ParseSomeLines' ); $props = array(); $properties =& $props; while( isset($this->lines[$this->_current_parse_line]) ) { $i = $this->_current_parse_line++; $line =& $this->lines[$i]; dbg_error_log( 'iCalendar', ":Parse:%s LINE %03d: >>>%s<<<", $type, $i, $line ); if ( $this->parsing_vtimezone ) { $this->vtimezone .= $line."\n"; } if ( preg_match( '/^(BEGIN|END):([^:]+)$/', $line, $matches ) ) { if ( $matches[1] == 'END' && $matches[2] == $type ) { if ( $type == 'VTIMEZONE' ) { $this->parsing_vtimezone = false; } return $properties; } else if( $matches[1] == 'END' ) { dbg_error_log("ERROR"," iCalendar: parse error: Unexpected END:%s when we were looking for END:%s", $matches[2], $type ); return $properties; } else if( $matches[1] == 'BEGIN' ) { $subtype = $matches[2]; if ( $subtype == 'VTIMEZONE' ) { $this->parsing_vtimezone = true; $this->vtimezone = $line."\n"; } if ( !isset($properties['INSIDE']) ) $properties['INSIDE'] = array(); $properties['INSIDE'][] = $subtype; if ( !isset($properties[$subtype]) ) $properties[$subtype] = array(); $properties[$subtype][] = $this->ParseSomeLines($subtype); } } else { // Parse the property @list( $property, $value ) = explode(':', $line, 2 ); if ( strpos( $property, ';' ) > 0 ) { $parameterlist = explode(';', $property ); $property = array_shift($parameterlist); foreach( $parameterlist AS $pk => $pv ) { if ( $pv == "VALUE=DATE" ) { $value .= 'T000000'; } elseif ( preg_match('/^([^;:=]+)=([^;:=]+)$/', $pv, $matches) ) { switch( $matches[1] ) { case 'TZID': $properties['TZID'] = $matches[2]; break; default: dbg_error_log( 'iCalendar', " FYI: Ignoring Resource '%s', Property '%s', Parameter '%s', Value '%s'", $type, $property, $matches[1], $matches[2] ); } } } } if ( $this->parsing_vtimezone && (!isset($this->tz_locn) || $this->tz_locn == "") && $property == 'X-LIC-LOCATION' ) { $this->tz_locn = $value; } $properties[strtoupper($property)] = $this->RFC2445ContentUnescape($value); } } return $properties; } /** * Build the iCalendar object from a text string which is a single iCalendar resource * * @var string The RFC2445 iCalendar resource to be parsed * * @DEPRECATED: This class will be removed soon. * @todo Remove this function. */ function BuildFromText( $icalendar ) { deprecated('iCalendar::BuildFromText' ); /** * This unescapes the (CRLF + linear space) wrapping specified in RFC2445. According * to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising * XML parsers often muck with it and may remove the CR. */ $icalendar = preg_replace('/\r?\n[ \t]/', '', $icalendar ); $this->lines = preg_split('/\r?\n/', $icalendar ); $this->_current_parse_line = 0; $this->properties = $this->ParseSomeLines(''); /** * Our 'type' is the type of non-timezone inside a VCALENDAR */ if ( isset($this->properties['VCALENDAR'][0]['INSIDE']) ) { foreach ( $this->properties['VCALENDAR'][0]['INSIDE'] AS $k => $v ) { if ( $v == 'VTIMEZONE' ) continue; $this->type = $v; break; } } } /** * Returns a content string with the RFC2445 escaping removed * * @param string $escaped The incoming string to be escaped. * @return string The string with RFC2445 content escaping removed. * * @DEPRECATED: This class will be removed soon. * @todo Remove this function. */ function RFC2445ContentUnescape( $escaped ) { deprecated( 'RFC2445ContentUnescape' ); $unescaped = str_replace( '\\n', "\n", $escaped); $unescaped = str_replace( '\\N', "\n", $unescaped); $unescaped = preg_replace( "/\\\\([,;:\"\\\\])/", '$1', $unescaped); return $unescaped; } /** * Do what must be done with time zones from on file. Attempt to turn * them into something that PostgreSQL can understand... * * @DEPRECATED: This class will be removed soon. * @todo Remove this function. */ function DealWithTimeZones() { global $c; deprecated('iCalendar::DealWithTimeZones' ); $tzid = $this->Get('TZID'); if ( isset($c->save_time_zone_defs) && $c->save_time_zone_defs ) { $qry = new AwlQuery( "SELECT tz_locn FROM time_zone WHERE tz_id = ?;", $tzid ); if ( $qry->Exec('iCalendar') && $qry->rows() == 1 ) { $row = $qry->Fetch(); $this->tz_locn = $row->tz_locn; } dbg_error_log( 'iCalendar', " TZCrap2: TZID '%s', DB Rows=%d, Location '%s'", $tzid, $qry->rows(), $this->tz_locn ); } if ( (!isset($this->tz_locn) || $this->tz_locn == '') && $tzid != '' ) { /** * In case there was no X-LIC-LOCATION defined, let's hope there is something in the TZID * that we can use. We are looking for a string like "Pacific/Auckland" if possible. */ $tzname = preg_replace('#^(.*[^a-z])?([a-z]+/[a-z]+)$#i','$1',$tzid ); /** * Unfortunately this kind of thing will never work well :-( * if ( strstr( $tzname, ' ' ) ) { $words = preg_split('/\s/', $tzname ); $tzabbr = ''; foreach( $words AS $i => $word ) { $tzabbr .= substr( $word, 0, 1); } $this->tz_locn = $tzabbr; } */ if ( preg_match( '#\S+/\S+#', $tzname) ) { $this->tz_locn = $tzname; } dbg_error_log( 'iCalendar', " TZCrap3: TZID '%s', Location '%s', Perhaps: %s", $tzid, $this->tz_locn, $tzname ); } if ( $tzid != '' && isset($c->save_time_zone_defs) && $c->save_time_zone_defs && $qry->rows() != 1 && isset($this->vtimezone) && $this->vtimezone != "" ) { $qry2 = new AwlQuery( "INSERT INTO time_zone (tz_id, tz_locn, tz_spec) VALUES( ?, ?, ? );", $tzid, $this->tz_locn, $this->vtimezone ); $qry2->Exec('iCalendar'); } if ( (!isset($this->tz_locn) || $this->tz_locn == "") && isset($c->local_tzid) ) { $this->tz_locn = $c->local_tzid; } } /** * Get the value of a property in the first non-VTIMEZONE * @DEPRECATED: This class will be removed soon. */ function Get( $key ) { deprecated('iCalendar::Get' ); if ( strtoupper($key) == 'TZID' ) { // backward compatibility hack dbg_error_log( 'iCalendar', " Get(TZID): TZID '%s', Location '%s'", (isset($this->tzid)?$this->tzid:"[not set]"), $this->tz_locn ); if ( isset($this->tzid) ) return $this->tzid; return $this->tz_locn; } /** * The property we work on is the first non-VTIMEZONE we find. */ $component =& $this->component->FirstNonTimezone(); if ( $component === false ) return null; return $component->GetPValue(strtoupper($key)); } /** * Set the value of a property * @DEPRECATED: This class will be removed soon. */ function Set( $key, $value ) { deprecated('iCalendar::Set' ); if ( $value == "" ) return; $key = strtoupper($key); $property = new iCalProp(); $property->Name($key); $property->Value($value); if (isset($this->component->rendered) ) unset( $this->component->rendered ); $component =& $this->component->FirstNonTimezone(); $component->SetProperties( array($property), $key); return $this->Get($key); } /** * @DEPRECATED: This class will be removed soon. * Add a new property/value, regardless of whether it exists already * * @param string $key The property key * @param string $value The property value * @param string $parameters Any parameters to set for the property, as an array of key/value pairs */ function Add( $key, $value, $parameters = null ) { deprecated('iCalendar::Add' ); if ( $value == "" ) return; $key = strtoupper($key); $property = new iCalProp(); $property->Name($key); $property->Value($value); if ( isset($parameters) && is_array($parameters) ) { $property->parameters = $parameters; } $component =& $this->component->FirstNonTimezone(); $component->AddProperty($property); if (isset($this->component->rendered) ) unset( $this->component->rendered ); } /** * @DEPRECATED: This class will be removed soon. * Get all sub-components, or at least get those matching a type, or failling to match, * should the second parameter be set to false. * * @param string $type The type to match (default: All) * @param boolean $normal_match Set to false to invert the match (default: true) * @return array an array of the sub-components */ function GetComponents( $type = null, $normal_match = true ) { deprecated('iCalendar::GetComponents' ); return $this->component->GetComponents($type,$normal_match); } /** * @DEPRECATED: This class will be removed soon. * Clear all components, or the components matching a particular type * @param string $type The type of component - omit for all components */ function ClearComponents( $type = null ) { deprecated('iCalendar::ClearComponents' ); $this->component->ClearComponents($type); } /** * @DEPRECATED: This class will be removed soon. * Sets some or all sub-components of the component to the supplied new components * * @param array of iCalComponent $new_components The new components to replace the existing ones * @param string $type The type of components to be replaced. Defaults to null, which means all components will be replaced. */ function SetComponents( $new_component, $type = null ) { deprecated('iCalendar::SetComponents' ); $this->component->SetComponents( $new_component, $type ); } /** * @DEPRECATED: This class will be removed soon. * Adds a new subcomponent * * @param iCalComponent $new_component The new component to append to the set */ function AddComponent( $new_component ) { deprecated('iCalendar::AddComponent' ); $this->component->AddComponent($new_component); } /** * @DEPRECATED: This class will be removed soon. * Mask components, removing any that are not of the types in the list * @param array $keep An array of component types to be kept */ function MaskComponents( $keep ) { deprecated('iCalendar::MaskComponents' ); $this->component->MaskComponents($keep); } /** * @DEPRECATED: This class will be removed soon. * Returns a PostgreSQL Date Format string suitable for returning HTTP (RFC2068) dates * Preferred is "Sun, 06 Nov 1994 08:49:37 GMT" so we do that. */ static function HttpDateFormat() { return "'Dy, DD Mon IYYY HH24:MI:SS \"GMT\"'"; } /** * @DEPRECATED: This class will be removed soon. * Returns a PostgreSQL Date Format string suitable for returning iCal dates */ static function SqlDateFormat() { return "'YYYYMMDD\"T\"HH24MISS'"; } /** * @DEPRECATED: This class will be removed soon. * Returns a PostgreSQL Date Format string suitable for returning dates which * have been cast to UTC */ static function SqlUTCFormat() { return "'YYYYMMDD\"T\"HH24MISS\"Z\"'"; } /** * @DEPRECATED: This class will be removed soon. * Returns a PostgreSQL Date Format string suitable for returning iCal durations * - this doesn't work for negative intervals, but events should not have such! */ static function SqlDurationFormat() { return "'\"PT\"HH24\"H\"MI\"M\"'"; } /** * @DEPRECATED: This class will be removed soon. * Returns a suitably escaped RFC2445 content string. * * @param string $name The incoming name[;param] prefixing the string. * @param string $value The incoming string to be escaped. * * @deprecated This function is deprecated and will be removed eventually. * @todo Remove this function. */ function RFC2445ContentEscape( $name, $value ) { deprecated('iCalendar::RFC2445ContentEscape' ); $property = preg_replace( '/[;].*$/', '', $name ); switch( $property ) { /** Content escaping does not apply to these properties culled from RFC2445 */ case 'ATTACH': case 'GEO': case 'PERCENT-COMPLETE': case 'PRIORITY': case 'COMPLETED': case 'DTEND': case 'DUE': case 'DTSTART': case 'DURATION': case 'FREEBUSY': case 'TZOFFSETFROM': case 'TZOFFSETTO': case 'TZURL': case 'ATTENDEE': case 'ORGANIZER': case 'RECURRENCE-ID': case 'URL': case 'EXDATE': case 'EXRULE': case 'RDATE': case 'RRULE': case 'REPEAT': case 'TRIGGER': case 'CREATED': case 'DTSTAMP': case 'LAST-MODIFIED': case 'SEQUENCE': break; /** Content escaping applies by default to other properties */ default: $value = str_replace( '\\', '\\\\', $value); $value = preg_replace( '/\r?\n/', '\\n', $value); $value = preg_replace( "/([,;:\"])/", '\\\\$1', $value); } $result = preg_replace( '/(.{72})/u', '$1'."\r\n ", $name.':'.$value ) ."\r\n"; return $result; } /** * @DEPRECATED: This class will be removed soon. * Return all sub-components of the given type, which are part of the * component we pass in as an array of lines. * * @param array $component The component to be parsed * @param string $type The type of sub-components to be extracted * @param int $count The number of sub-components to extract (default: 9999) * * @return array The sub-component lines */ function ExtractSubComponent( $component, $type, $count=9999 ) { deprecated('iCalendar::ExtractSubComponent' ); $answer = array(); $intags = false; $start = "BEGIN:$type"; $finish = "END:$type"; dbg_error_log( 'iCalendar', ":ExtractSubComponent: Looking for %d subsets of type %s", $count, $type ); reset($component); foreach( $component AS $k => $v ) { if ( !$intags && $v == $start ) { $answer[] = $v; $intags = true; } else if ( $intags && $v == $finish ) { $answer[] = $v; $intags = false; } else if ( $intags ) { $answer[] = $v; } } return $answer; } /** * @DEPRECATED: This class will be removed soon. * Extract a particular property from the provided component. In doing so we * assume that the content was unescaped when iCalComponent::ParseFrom() * called iCalComponent::UnwrapComponent(). * * @param array $component An array of lines of this component * @param string $type The type of parameter * * @return array An array of iCalProperty objects */ function ExtractProperty( $component, $type, $count=9999 ) { deprecated('iCalendar::ExtractProperty' ); $answer = array(); dbg_error_log( 'iCalendar', ":ExtractProperty: Looking for %d properties of type %s", $count, $type ); reset($component); foreach( $component AS $k => $v ) { if ( preg_match( "/$type"."[;:]/i", $v ) ) { $answer[] = new iCalProp($v); dbg_error_log( 'iCalendar', ":ExtractProperty: Found property %s", $type ); if ( --$count < 1 ) return $answer; } } return $answer; } /** * @DEPRECATED: This class will be removed soon. * Applies the filter conditions, possibly recursively, to the value which will be either * a single property, or an array of lines of the component under test. * * @todo Eventually we need to handle all of these possibilities, which will mean writing * several routines: * - Get Property from Component * - Get Parameter from Property * - Test TimeRange * For the moment we will leave these, until there is a perceived need. * * @param array $filter An array of XMLElement defining the filter(s) * @param mixed $value Either a string which is the single property, or an array of lines, for the component. * @return boolean Whether the filter passed / failed. */ function ApplyFilter( $filter, $value ) { deprecated('iCalendar::ApplyFilter' ); foreach( $filter AS $k => $v ) { $tag = $v->GetNSTag(); $value_type = gettype($value); $value_defined = (isset($value) && $value_type == 'string') || ($value_type == 'array' && count($value) > 0 ); if ( $tag == 'urn:ietf:params:xml:ns:caldav:is-not-defined' && $value_defined ) { dbg_error_log( 'iCalendar', ":ApplyFilter: Value is set ('%s'), want unset, for filter %s", count($value), $tag ); return false; } elseif ( $tag == 'urn:ietf:params:xml:ns:caldav:is-defined' && !$value_defined ) { dbg_error_log( 'iCalendar', ":ApplyFilter: Want value, but it is not set for filter %s", $tag ); return false; } else { dbg_error_log( 'iCalendar', ":ApplyFilter: Have values for '%s' filter", $tag ); switch( $tag ) { case 'urn:ietf:params:xml:ns:caldav:time-range': /** todo:: While this is unimplemented here at present, most time-range tests should occur at the SQL level. */ break; case 'urn:ietf:params:xml:ns:caldav:text-match': $search = $v->GetContent(); // In this case $value will either be a string, or an array of iCalProp objects // since TEXT-MATCH does not apply to COMPONENT level - only property/parameter if ( !is_string($value) ) { if ( is_array($value) ) { $match = false; foreach( $value AS $k1 => $v1 ) { // $v1 MUST be an iCalProp object if ( $match = $v1->TextMatch($search)) break; } } else { dbg_error_log( 'iCalendar', ":ApplyFilter: TEXT-MATCH will only work on strings or arrays of iCalProp. %s unsupported", gettype($value) ); return true; // We return _true_ in this case, so the client sees the item } } else { $match = (stristr( $value, $search ) !== false); } $negate = $v->GetAttribute("negate-condition"); if ( isset($negate) && strtolower($negate) == "yes" ) $match = !$match; // dbg_error_log( 'iCalendar', ":ApplyFilter: TEXT-MATCH returning %s", ($match?"yes":"no") ); return $match; break; case 'urn:ietf:params:xml:ns:caldav:comp-filter': $subfilter = $v->GetContent(); $component = $this->ExtractSubComponent($value,$v->GetAttribute("name")); if ( ! $this->ApplyFilter($subfilter,$component) ) return false; break; case 'urn:ietf:params:xml:ns:caldav:prop-filter': $subfilter = $v->GetContent(); $properties = $this->ExtractProperty($value,$v->GetAttribute("name")); if ( ! $this->ApplyFilter($subfilter,$properties) ) return false; break; case 'urn:ietf:params:xml:ns:caldav:param-filter': $subfilter = $v->GetContent(); $parameter = $this->ExtractParameter($value,$v->GetAttribute("NAME")); if ( ! $this->ApplyFilter($subfilter,$parameter) ) return false; break; } } } return true; } /** * @DEPRECATED: This class will be removed soon. * Test a PROP-FILTER or COMP-FILTER and return a true/false * COMP-FILTER (is-defined | is-not-defined | (time-range?, prop-filter*, comp-filter*)) * PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*)) * * @param array $filter An array of XMLElement defining the filter * * @return boolean Whether or not this iCalendar passes the test */ function TestFilter( $filters ) { deprecated('iCalendar::TestFilter' ); // dbg_error_log('iCalendar', ':TestFilter we have %d filters to test', count($filters) ); foreach( $filters AS $k => $v ) { $tag = $v->GetNSTag(); // dbg_error_log('iCalendar', ':TestFilter working on tag "%s" %s"', $k, $tag ); $name = $v->GetAttribute("name"); $filter = $v->GetContent(); if ( $tag == "urn:ietf:params:xml:ns:caldav:prop-filter" ) { $value = $this->ExtractProperty($this->lines,$name); } else { $value = $this->ExtractSubComponent($this->lines,$v->GetAttribute("name")); } if ( count($value) == 0 ) unset($value); if ( ! $this->ApplyFilter($filter,$value) ) return false; } return true; } /** * @DEPRECATED: This class will be removed soon. * Returns the header we always use at the start of our iCalendar resources * * @todo Remove this function. */ static function iCalHeader() { deprecated('iCalendar::iCalHeader' ); return <<component->Render(); } else { $components = $this->component->GetComponents($type); $rendered = ""; foreach( $components AS $k => $v ) { $rendered .= $v->Render($restrict_properties); } return $rendered; } } } awl-0.53.orig/inc/classEditor.php0000644000000000000000000004262711760653201013623 0ustar * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 */ require_once("DataUpdate.php"); require_once("DataEntry.php"); /** * A class for the fields in the editor * @package awl */ class EditorField { var $Field; var $Sql; var $Value; var $Attributes; var $LookupSql; var $OptionList; function __construct( $field, $sql="", $lookup_sql="" ) { global $session; $this->Field = $field; $this->Sql = $sql; $this->LookupSql = $lookup_sql; $this->Attributes = array(); } function Set($value) { $this->Value = $value; } function SetSql( $sql ) { $this->Sql = $sql; } function SetLookup( $lookup_sql ) { $this->LookupSql = $lookup_sql; } function SetOptionList( $options, $current = null, $parameters = null) { if ( gettype($options) == 'array' ) { $this->OptionList = ''; if ( is_array($parameters) ) { if ( isset($parameters['maxwidth']) ) $maxwidth = max(4,intval($parameters['maxwidth'])); if ( isset($parameters['translate']) ) $translate = true; } foreach( $options AS $k => $v ) { if (is_array($current)) { $selected = ( ( in_array($k,$current,true) || in_array($v,$current,true)) ? ' selected="selected"' : '' ); } else { $selected = ( ( "$k" == "$current" || "$v" == "$current" ) ? ' selected="selected"' : '' ); } if ( isset($translate) ) $v = translate( $v ); if ( isset($maxwidth) ) $v = substr( $v, 0, $maxwidth); $this->OptionList .= ""; } } else { $this->OptionList = $options; } } function GetTarget() { if ( $this->Sql == "" ) return $this->Field; return "$this->Sql AS $this->Field"; } function AddAttribute( $k, $v ) { $this->Attributes[$k] = $v; } function RenderLabel( $wrapme ) { if ( !isset($this->Attributes['_label']) || !isset($this->Attributes['id'])) return $wrapme; $class = (isset($this->Attributes['class']) ? $this->Attributes['class'] : 'entry'); $title = (isset($this->Attributes['title']) ? ' title="'.str_replace('"', ''', $this->Attributes['title']) . '"' : ''); return( sprintf( '', $this->Attributes['id'], $class, $title, $wrapme, $this->Attributes['_label']) ); } function RenderAttributes() { $attributes = ""; if ( count($this->Attributes) == 0 ) return $attributes; foreach( $this->Attributes AS $k => $v ) { if ( $k == '_label' ) continue; $attributes .= " $k=\"" . str_replace('"', ''', $v) . '"'; } return $attributes; } } /** * The class for the Editor form in full * @package awl */ class Editor { var $Title; var $Action; var $Fields; var $OrderedFields; var $BaseTable; var $Joins; var $Where; var $NewWhere; var $Order; var $Limit; var $Query; var $Template; var $RecordAvailable; var $Record; var $SubmitName; var $Id; function __construct( $title = "", $fields = null ) { global $c, $session, $form_id_increment; $this->Title = $title; $this->Order = ""; $this->Limit = ""; $this->Template = ""; $this->RecordAvailable = false; $this->SubmitName = 'submit'; $form_id_increment = (isset($form_id_increment)? ++$form_id_increment : 1); $this->Id = 'editor_'.$form_id_increment; if ( isset($fields) ) { if ( is_array($fields) ) { foreach( $fields AS $k => $v ) { $this->AddField($v); } } else if ( is_string($fields) ) { // We've been given a table name, so get all fields for it. $this->BaseTable = $fields; $field_list = get_fields($fields); foreach( $field_list AS $k => $v ) { $this->AddField($k); } } } @dbg_error_log( 'editor', 'DBG: New editor called %s', $title); } function &AddField( $field, $sql="", $lookup_sql="" ) { $this->Fields[$field] = new EditorField( $field, $sql, $lookup_sql ); $this->OrderedFields[] = $field; return $this->Fields[$field]; } function SetSql( $field, $sql ) { $this->Fields[$field]->SetSql( $sql ); } function SetLookup( $field, $lookup_sql ) { if (is_object($this->Fields[$field])) { $this->Fields[$field]->SetLookup( $lookup_sql ); } } /** * Gets the value of a field in the record currently assigned to this editor. * @param string $value_field_name */ function Value( $value_field_name ) { if ( !isset($this->Record->{$value_field_name}) ) return null; return $this->Record->{$value_field_name}; } /** * Assigns the value of a field in the record currently associated with this editor. * @param string $value_field_name * @param string $new_value */ function Assign( $value_field_name, $new_value ) { if ( !isset($this->Record) ) $this->Record = (object) array(); $this->Record->{$value_field_name} = $new_value; } /** * Sets or returns the form ID used for differentiating this form from others in the page. * @param string $id */ function Id( $id = null ) { if ( isset($id) ) $this->Id = preg_replace( '#[^a-z0-9_+-]#', '', $id); return $this->Id; } function SetOptionList( $field, $options, $current = null, $parameters = null) { $this->Fields[$field]->SetOptionList( $options, $current, $parameters ); } function AddAttribute( $field, $k, $v ) { $this->Fields[$field]->AddAttribute($k,$v); } function SetBaseTable( $base_table ) { $this->BaseTable = $base_table; } function SetJoins( $join_list ) { $this->Joins = $join_list; } /** * Accessor for the Title for the browse, which could set the title also. * * @param string $new_title The new title for the browser * @return string The current title for the browser */ function Title( $new_title = null ) { if ( isset($new_title) ) $this->Title = $new_title; return $this->Title; } function SetSubmitName( $new_submit ) { $this->SubmitName = $new_submit; } function IsSubmit() { return isset($_POST[$this->SubmitName]); } function IsUpdate() { $is_update = $this->Available(); if ( isset( $_POST['_editor_action']) && isset( $_POST['_editor_action'][$this->Id]) ) { $is_update = ( $_POST['_editor_action'][$this->Id] == 'update' ); @dbg_error_log( 'editor', 'Checking update: %s => %d', $_POST['_editor_action'][$this->Id], $is_update ); } return $is_update; } function IsCreate() { return ! $this->IsUpdate(); } function SetWhere( $where_clause ) { $this->Where = $where_clause; } function WhereNewRecord( $where_clause ) { $this->NewWhere = $where_clause; } function MoreWhere( $operator, $more_where ) { if ( $this->Where == "" ) { $this->Where = $more_where; return; } $this->Where = "$this->Where $operator $more_where"; } function AndWhere( $more_where ) { $this->MoreWhere("AND",$more_where); } function OrWhere( $more_where ) { $this->MoreWhere("OR",$more_where); } function SetTemplate( $template ) { $this->Template = $template; } function Layout( $template ) { if ( strstr( $template, '##form##' ) === false && stristr( $template, 'Template = $template; } function Available( ) { return $this->RecordAvailable; } function SetRecord( $row ) { $this->Record = $row; $this->RecordAvailable = is_object($this->Record); return $this->Record; } /** * Set some particular values to the ones from the array. * * @param array $values An array of fieldname / value pairs */ function Initialise( $values ) { $this->RecordAvailable = false; if ( !isset($this->Record) ) $this->Record = (object) array(); foreach( $values AS $fname => $value ) { $this->Record->{$fname} = $value; } } /** * This will assign $_POST values to the internal Values object for each * field that exists in the Fields array. */ function PostToValues( $prefix = '' ) { foreach ( $this->Fields AS $fname => $fld ) { @dbg_error_log( 'editor', ":PostToValues: %s => %s", $fname, $_POST["$prefix$fname"] ); if ( isset($_POST[$prefix.$fname]) ) { $this->Record->{$fname} = $_POST[$prefix.$fname]; @dbg_error_log( 'editor', ":PostToValues: %s => %s", $fname, $_POST["$prefix$fname"] ); } } } function GetRecord( $where = "" ) { global $session; $target_fields = ""; foreach( $this->Fields AS $k => $column ) { if ( $target_fields != "" ) $target_fields .= ", "; $target_fields .= $column->GetTarget(); } if ( $where == "" ) $where = $this->Where; $sql = sprintf( "SELECT %s FROM %s %s WHERE %s %s %s", $target_fields, $this->BaseTable, $this->Joins, $where, $this->Order, $this->Limit); $this->Query = new AwlQuery( $sql ); @dbg_error_log( 'editor', "DBG: EditorGetQry: %s", $sql ); if ( $this->Query->Exec("Browse:$this->Title:DoQuery") ) { $this->Record = $this->Query->Fetch(); $this->RecordAvailable = is_object($this->Record); } if ( !$this->RecordAvailable ) { $this->Record = (object) array(); } return $this->Record; } /** * Replace parts into the form template. * @param array $matches The matches found which preg_replace_callback is calling us for. * @return string What we want to replace this match with. */ function ReplaceEditorPart($matches) { global $session; // $matches[0] is the complete match switch( $matches[0] ) { case "##form##": /** @todo It might be nice to construct a form ID */ return sprintf('
', $this->Id); case "##submit##": $action = ( $this->RecordAvailable ? 'update' : 'insert' ); $submittype = ($this->RecordAvailable ? translate('Apply Changes') : translate('Create')); return sprintf('', $this->Id, $action, $this->SubmitName, $submittype ); } // $matches[1] the match for the first subpattern // enclosed in '(...)' and so on $field_name = $matches[1]; $what_part = $matches[3]; $part3 = (isset($matches[5]) ? $matches[5] : null); $value_field_name = $field_name; if ( substr($field_name,0,4) == 'xxxx' ) { // Sometimes we will prepend 'xxxx' to the field name so that the field // name differs from the column name in the database. We also remove it // when it's submitted. $value_field_name = substr($field_name,4); } $attributes = ""; if ( isset($this->Fields[$field_name]) && is_object($this->Fields[$field_name]) ) { $field = $this->Fields[$field_name]; $attributes = $field->RenderAttributes(); } $field_value = (isset($this->Record->{$value_field_name}) ? $this->Record->{$value_field_name} : null); switch( $what_part ) { case "options": $currval = $part3; if ( ! isset($currval) && isset($field_value) ) $currval = $field_value; if ( isset($field->OptionList) && $field->OptionList != "" ) { $option_list = $field->OptionList; } else { @dbg_error_log( 'editor', "DBG: Current=%s, OptionQuery: %s", $currval, $field->LookupSql ); $opt_qry = new AwlQuery( $field->LookupSql ); $option_list = EntryField::BuildOptionList($opt_qry, $currval, "FieldOptions: $field_name" ); $field->OptionList = $option_list; } return $option_list; case "select": $currval = $part3; if ( ! isset($currval) && isset($field_value) ) $currval = $field_value; if ( isset($field->OptionList) && $field->OptionList != "" ) { $option_list = $field->OptionList; } else { @dbg_error_log( 'editor', 'DBG: Current=%s, OptionQuery: %s', $currval, $field->LookupSql ); $opt_qry = new AwlQuery( $field->LookupSql ); $option_list = EntryField::BuildOptionList($opt_qry, $currval, 'FieldOptions: '.$field_name ); $field->OptionList = $option_list; } return ''; case "checkbox": if ( $field_value === true ) { $checked = ' CHECKED'; } else { switch ( $field_value ) { case 'f': case 'off': case 'false': case '': case '0': $checked = ""; break; default: $checked = ' CHECKED'; } } return $field->RenderLabel('' ); case "input": $size = (isset($part3) ? $part3 : 6); return ""; case "file": $size = (isset($part3) ? $part3 : 30); return ""; case "money": $size = (isset($part3) ? $part3 : 8); return ""; case "date": $size = (isset($part3) ? $part3 : 10); return ""; case "textarea": list( $cols, $rows ) = explode( 'x', $part3); return ""; case "hidden": return sprintf( "", htmlspecialchars($field_value) ); case "password": return sprintf( "", htmlspecialchars($part3) ); case "encval": case "enc": return htmlspecialchars($field_value); case "submit": $action = ( $this->RecordAvailable ? 'update' : 'insert' ); return sprintf('', $this->Id, $action, $this->SubmitName, $value_field_name ); default: return str_replace( "\n", "
", $field_value ); } } /** * Render the templated component. The heavy lifting is done by the callback... */ function Render( $title_tag = null ) { @dbg_error_log( 'editor', "classEditor", "Rendering editor $this->Title" ); if ( $this->Template == "" ) $this->DefaultTemplate(); $html = sprintf('
', $this->Id); if ( isset($this->Title) && $this->Title != "" ) { if ( !isset($title_tag) ) $title_tag = 'h1'; $html = "<$title_tag>$this->Title\n"; } // Stuff like "##fieldname.part## gets converted to the appropriate value $replaced = preg_replace_callback("/##([^#.]+)(\.([^#.]+))?(\.([^#.]+))?##/", array(&$this, "ReplaceEditorPart"), $this->Template ); $html .= $replaced; $html .= '
'; return $html; } /** * Write the record * @param boolean $is_update Tell the write whether it's an update or insert. Hopefully it * should be able to figure it out though. */ function Write( $is_update = null ) { global $c, $component; @dbg_error_log( 'editor', 'DBG: Writing editor %s', $this->Title); if ( !isset($is_update) ) { if ( isset( $_POST['_editor_action']) && isset( $_POST['_editor_action'][$this->Id]) ) { $is_update = ( $_POST['_editor_action'][$this->Id] == 'update' ); } else { /** @todo Our old approach will not work for translation. We need to have a hidden field * containing the submittype. Probably we should add placeholders like ##form##, ##script## etc. * which the editor can use for internal purposes. */ // Then we dvine the action by looking at the submit button value... $is_update = preg_match( '/(save|update|apply)/i', $_POST[$this->SubmitName] ); dbg_error_log('WARN', $_SERVER['REQUEST_URI']. " is using a deprecated method for controlling insert/update" ); } } $this->Action = ( $is_update ? "update" : "create" ); $qry = new AwlQuery( sql_from_post( $this->Action, $this->BaseTable, "WHERE ".$this->Where ) ); if ( !$qry->Exec("Editor::Write") ) { $c->messages[] = "ERROR: $qry->errorstring"; return 0; } if ( $this->Action == "create" && isset($this->NewWhere) ) { $this->GetRecord($this->NewWhere); } else { $this->GetRecord($this->Where); } return $this->Record; } } awl-0.53.orig/inc/Session.php0000644000000000000000000010361111704372265012767 0ustar * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later */ require_once('AWLUtilities.php'); require_once('AwlQuery.php'); require_once('EMail.php'); /** * Checks what a user entered against any currently valid temporary passwords on their account. * @param string $they_sent What the user entered. * @param int $user_no Which user is attempting to log on. * @return boolean Whether or not the user correctly guessed a temporary password within the necessary window of opportunity. */ function check_temporary_passwords( $they_sent, $user_no ) { $sql = 'SELECT 1 AS ok FROM tmp_password WHERE user_no = ? AND password = ? AND valid_until > current_timestamp'; $qry = new AwlQuery( $sql, $user_no, $they_sent ); if ( $qry->Exec('Session::check_temporary_passwords') ) { dbg_error_log( "Login", " check_temporary_passwords: Rows = ".$qry->rows()); if ( $row = $qry->Fetch() ) { dbg_error_log( "Login", " check_temporary_passwords: OK = $row->ok"); // Remove all the temporary passwords for that user... $sql = 'DELETE FROM tmp_password WHERE user_no = ? '; $qry = new AwlQuery( $sql, $user_no ); $qry->Exec('Login',__LINE__,__FILE__); return true; } } return false; } /** * A class for creating and holding session information. * * @package awl */ class Session { /**#@+ * @access private */ var $roles; var $cause = ''; /**#@-*/ /**#@+ * @access public */ /** * The user_no of the logged in user. * @var int */ var $user_no; /** * A unique id for this user's logged-in session. * @var int */ var $session_id = 0; /** * The user's username used to log in. * @var int */ var $username = 'guest'; /** * The user's full name from their usr record. * @var int */ var $fullname = 'Guest'; /** * The user's email address from their usr record. * @var int */ var $email = ''; /** * Whether this user has actually logged in. * @var int */ var $logged_in = false; /** * Whether the user logged in to view the current page. Perhaps some details on the * login form might pollute an editable form and result in an unplanned submit. This * can be used to program around such a problem. * @var boolean */ var $just_logged_in = false; /** * The date and time that the user logged on during their last session. * @var string */ var $last_session_start; /** * The date and time that the user requested their last page during their last * session. * @var string */ var $last_session_end; /**#@-*/ /** * Create a new Session object. * * If a session identifier is supplied, or we can find one in a cookie, we validate it * and consider the person logged in. We read some useful session and user data in * passing as we do this. * * The session identifier contains a random value, hashed, to provide validation. This * could be hijacked if the traffic was sniffable so sites who are paranoid about security * should only do this across SSL. * * A worthwhile enhancement would be to add some degree of external configurability to * that read. * * @param string $sid A session identifier. */ function Session( $sid="" ) { global $sid, $sysname; $this->roles = array(); $this->logged_in = false; $this->just_logged_in = false; $this->login_failed = false; if ( $sid == "" ) { if ( ! isset($_COOKIE['sid']) ) return; $sid = $_COOKIE['sid']; } list( $session_id, $session_key ) = explode( ';', $sid, 2 ); /** * We regularly want to override the SQL for joining against the session record. * so the calling application can define a function local_session_sql() which * will return the SQL to join (up to and excluding the WHERE clause. The standard * SQL used if this function is not defined is: * * SELECT session.*, usr.* FROM session JOIN usr ON ( user_no ) * */ if ( function_exists('local_session_sql') ) { $sql = local_session_sql(); } else { $sql = "SELECT session.*, usr.* FROM session JOIN usr USING ( user_no )"; } $sql .= " WHERE session.session_id = ? AND (md5(session.session_start::text) = ? OR session.session_key = ?) ORDER BY session.session_start DESC LIMIT 2"; $qry = new AwlQuery($sql, $session_id, $session_key, $session_key); if ( $qry->Exec('Session') && 1 == $qry->rows() ) { $this->AssignSessionDetails( $qry->Fetch() ); $qry = new AwlQuery('UPDATE session SET session_end = current_timestamp WHERE session_id=?', $session_id); $qry->Exec('Session'); } else { // Kill the existing cookie, which appears to be bogus setcookie('sid', '', 0,'/'); $this->cause = 'ERR: Other than one session record matches. ' . $qry->rows(); $this->Log( "WARN: Login $this->cause" ); } } /** * DEPRECATED Utility function to log stuff with printf expansion. * * This function could be expanded to log something identifying the session, but * somewhat strangely this has not yet been done. * * @param string $whatever A log string * @param mixed $whatever... Further parameters to be replaced into the log string a la printf */ function Log( $whatever ) { global $c; $argc = func_num_args(); $format = func_get_arg(0); if ( $argc == 1 || ($argc == 2 && func_get_arg(1) == "0" ) ) { error_log( "$c->sysabbr: $format" ); } else { $args = array(); for( $i=1; $i < $argc; $i++ ) { $args[] = func_get_arg($i); } error_log( "$c->sysabbr: " . vsprintf($format,$args) ); } } /** * DEPRECATED Utility function to log debug stuff with printf expansion, and the ability to * enable it selectively. * * The enabling is done by setting a variable "$debuggroups[$group] = 1" * * @param string $group The name of an arbitrary debug group. * @param string $whatever A log string * @param mixed $whatever... Further parameters to be replaced into the log string a la printf */ function Dbg( $whatever ) { global $debuggroups, $c; $argc = func_num_args(); $dgroup = func_get_arg(0); if ( ! (isset($debuggroups[$dgroup]) && $debuggroups[$dgroup]) ) return; $format = func_get_arg(1); if ( $argc == 2 || ($argc == 3 && func_get_arg(2) == "0" ) ) { error_log( "$c->sysabbr: DBG: $dgroup: $format" ); } else { $args = array(); for( $i=2; $i < $argc; $i++ ) { $args[] = func_get_arg($i); } error_log( "$c->sysabbr: DBG: $dgroup: " . vsprintf($format,$args) ); } } /** * Checks whether a user is allowed to do something. * * The check is performed to see if the user has that role. * * @param string $whatever The role we want to know if the user has. * @return boolean Whether or not the user has the specified role. */ function AllowedTo ( $whatever ) { return ( $this->logged_in && isset($this->roles[$whatever]) && $this->roles[$whatever] ); } /** * Internal function used to get the user's roles from the database. */ function GetRoles () { $this->roles = array(); $qry = new AwlQuery( 'SELECT role_name FROM role_member m join roles r ON r.role_no = m.role_no WHERE user_no = ? ', $this->user_no ); if ( $qry->Exec('Session::GetRoles') && $qry->rows() > 0 ) { while( $role = $qry->Fetch() ) { $this->roles[$role->role_name] = true; } } } /** * Internal function used to assign the session details to a user's new session. * @param object $u The user+session object we (probably) read from the database. */ function AssignSessionDetails( $u ) { // Assign each field in the selected record to the object foreach( $u AS $k => $v ) { $this->{$k} = $v; } $qry = new AwlQuery( "SET DATESTYLE TO ?", ($this->date_format_type == 'E' ? 'European,ISO' : ($this->date_format_type == 'U' ? 'US,ISO' : 'ISO')) ); $qry->Exec(); $this->GetRoles(); $this->logged_in = true; } /** * Attempt to perform a login action. * * This will validate the user's username and password. If they are OK then a new * session id will be created and the user will be cookied with it for subsequent * pages. A logged in session will be created, and the $_POST array will be cleared * of the username, password and submit values. submit will also be cleared from * $_GET and $GLOBALS, just in case. * * @param string $username The user's login name, or at least what they entered it as. * @param string $password The user's password, or at least what they entered it as. * @param string $authenticated If true, then authentication has already happened and the password is not checked, though the user must still exist. * @return boolean Whether or not the user correctly guessed a temporary password within the necessary window of opportunity. */ function Login( $username, $password, $authenticated = false ) { global $c; $rc = false; dbg_error_log( "Login", " Login: Attempting login for $username" ); if ( isset($usr) ) unset($usr); /** In case someone is running with register_globals on */ /** * @todo In here we will need to put code to call the auth plugin, in order to * ensure the 'usr' table has current valid data. At this stage we are just * thinking it through... like ... * */ if ( !$authenticated && isset($c->authenticate_hook) && isset($c->authenticate_hook['call']) && function_exists($c->authenticate_hook['call']) ) { /** * The authenticate hook needs to: * - Accept a username / password * - Confirm the username / password are correct * - Create (or update) a 'usr' record in our database * - Return the 'usr' record as an object * - Return === false when authentication fails * It can expect that: * - Configuration data will be in $c->authenticate_hook['config'], which might be an array, or whatever is needed. */ $usr = call_user_func( $c->authenticate_hook['call'], $username, $password ); if ( $usr === false ) unset($usr); else $authenticated = true; } $sql = "SELECT * FROM usr WHERE lower(username) = text(?) AND active"; $qry = new AwlQuery( $sql, strtolower($username) ); if ( isset($usr) || ($qry->Exec('Login',__LINE__,__FILE__) && $qry->rows() == 1 && $usr = $qry->Fetch() ) ) { $user_no = ( method_exists( $usr, 'user_no' ) ? $usr->user_no() : $usr->user_no ); if ( $authenticated || session_validate_password( $password, $usr->password ) || check_temporary_passwords( $password, $user_no ) ) { // Now get the next session ID to create one from... $qry = new AwlQuery( "SELECT nextval('session_session_id_seq')" ); if ( $qry->Exec('Login') && $qry->rows() == 1 ) { $seq = $qry->Fetch(); $session_id = $seq->nextval; $session_key = md5( rand(1010101,1999999999) . microtime() ); // just some random shite dbg_error_log( "Login", " Login: Valid username/password for $username ($user_no)" ); // Set the last_used timestamp to match the previous login. $qry = new AwlQuery('UPDATE usr SET last_used = (SELECT session_start FROM session WHERE session.user_no = ? ORDER BY session_id DESC LIMIT 1) WHERE user_no = ?;', $usr->user_no, $usr->user_no); $qry->Exec('Session'); // And create a session $sql = "INSERT INTO session (session_id, user_no, session_key) VALUES( ?, ?, ? )"; $qry = new AwlQuery( $sql, $session_id, $user_no, $session_key ); if ( $qry->Exec('Login') ) { // Assign our session ID variable $sid = "$session_id;$session_key"; // Create a cookie for the sesssion setcookie('sid',$sid, 0,'/'); // Recognise that we have started a session now too... $this->Session($sid); dbg_error_log( "Login", " Login: New session $session_id started for $username ($user_no)" ); if ( isset($_POST['remember']) && intval($_POST['remember']) > 0 ) { $cookie = md5( $user_no ) . ";"; $cookie .= session_salted_md5($user_no . $usr->username . $usr->password); $GLOBALS['lsid'] = $cookie; setcookie( "lsid", $cookie, time() + (86400 * 3600), "/" ); // will expire in ten or so years } $this->just_logged_in = true; // Unset all of the submitted values, so we don't accidentally submit an unexpected form. unset($_POST['username']); unset($_POST['password']); unset($_POST['submit']); unset($_GET['submit']); unset($GLOBALS['submit']); if ( function_exists('local_session_sql') ) { $sql = local_session_sql(); } else { $sql = "SELECT session.*, usr.* FROM session JOIN usr USING ( user_no )"; } $sql .= " WHERE session.session_id = ? AND (md5(session.session_start::text) = ? OR session.session_key = ?) ORDER BY session.session_start DESC LIMIT 2"; $qry = new AwlQuery($sql, $session_id, $session_key, $session_key); if ( $qry->Exec('Session') && 1 == $qry->rows() ) { $this->AssignSessionDetails( $qry->Fetch() ); } $rc = true; return $rc; } // else ... $this->cause = 'ERR: Could not create new session.'; } else { $this->cause = 'ERR: Could not increment session sequence.'; } } else { $c->messages[] = i18n('Invalid username or password.'); if ( isset($c->dbg['Login']) || isset($c->dbg['ALL']) ) $this->cause = 'WARN: Invalid password.'; else $this->cause = 'WARN: Invalid username or password.'; } } else { $c->messages[] = i18n('Invalid username or password.'); if ( isset($c->dbg['Login']) || isset($c->dbg['ALL']) ) $this->cause = 'WARN: Invalid username.'; else $this->cause = 'WARN: Invalid username or password.'; } $this->Log( "Login failure: $this->cause" ); $this->login_failed = true; $rc = false; return $rc; } /** * Attempts to logs in using a long-term session ID * * This is all horribly insecure, but its hard not to be. * * @param string $lsid The user's value of the lsid cookie. * @return boolean Whether or not the user's lsid cookie got them in the door. */ function LSIDLogin( $lsid ) { global $c; dbg_error_log( "Login", " LSIDLogin: Attempting login for $lsid" ); list($md5_user_no,$validation_string) = explode( ';', $lsid ); $qry = new AwlQuery( "SELECT * FROM usr WHERE md5(user_no::text)=? AND active", $md5_user_no ); if ( $qry->Exec('Login') && $qry->rows() == 1 ) { $usr = $qry->Fetch(); list( $x, $salt, $y) = explode('*', $validation_string); $my_validation = session_salted_md5($usr->user_no . $usr->username . $usr->password, $salt); if ( $validation_string == $my_validation ) { // Now get the next session ID to create one from... $qry = new AwlQuery( "SELECT nextval('session_session_id_seq')" ); if ( $qry->Exec('Login') && $qry->rows() == 1 ) { $seq = $qry->Fetch(); $session_id = $seq->nextval; $session_key = md5( rand(1010101,1999999999) . microtime() ); // just some random shite dbg_error_log( "Login", " LSIDLogin: Valid username/password for $username ($usr->user_no)" ); // And create a session $sql = "INSERT INTO session (session_id, user_no, session_key) VALUES( ?, ?, ? )"; $qry = new AwlQuery( $sql, $session_id, $usr->user_no, $session_key ); if ( $qry->Exec('Login') ) { // Assign our session ID variable $sid = "$session_id;$session_key"; // Create a cookie for the sesssion setcookie('sid',$sid, 0,'/'); // Recognise that we have started a session now too... $this->Session($sid); dbg_error_log( "Login", " LSIDLogin: New session $session_id started for $this->username ($usr->user_no)" ); $this->just_logged_in = true; // Unset all of the submitted values, so we don't accidentally submit an unexpected form. unset($_POST['username']); unset($_POST['password']); unset($_POST['submit']); unset($_GET['submit']); unset($GLOBALS['submit']); if ( function_exists('local_session_sql') ) { $sql = local_session_sql(); } else { $sql = "SELECT session.*, usr.* FROM session JOIN usr USING ( user_no )"; } $sql .= " WHERE session.session_id = ? AND (md5(session.session_start::text) = ? OR session.session_key = ?) ORDER BY session.session_start DESC LIMIT 2"; $qry = new AwlQuery($sql, $session_id, $session_key, $session_key); if ( $qry->Exec('Session') && 1 == $qry->rows() ) { $this->AssignSessionDetails( $qry->Fetch() ); } $rc = true; return $rc; } // else ... $this->cause = 'ERR: Could not create new session.'; } else { $this->cause = 'ERR: Could not increment session sequence.'; } } else { dbg_error_log( "Login", " LSIDLogin: $validation_string != $my_validation ($salt - $usr->user_no, $usr->username, $usr->password)"); $client_messages[] = i18n('Invalid username or password.'); if ( isset($c->dbg['Login']) || isset($c->dbg['ALL']) ) $this->cause = 'WARN: Invalid password.'; else $this->cause = 'WARN: Invalid username or password.'; } } else { $client_messages[] = i18n('Invalid username or password.'); if ( isset($c->dbg['Login']) || isset($c->dbg['ALL']) ) $this->cause = 'WARN: Invalid username.'; else $this->cause = 'WARN: Invalid username or password.'; } dbg_error_log( "Login", " LSIDLogin: $this->cause" ); return false; } /** * Renders some HTML for a basic login panel * * @return string The HTML to display a login panel. */ function RenderLoginPanel() { $action_target = htmlspecialchars(preg_replace('/\?logout.*$/','',$_SERVER['REQUEST_URI'])); dbg_error_log( "Login", " RenderLoginPanel: action_target='%s'", $action_target ); $userprompt = translate("User Name"); $pwprompt = translate("Password"); $rememberprompt = str_replace( ' ', ' ', translate("forget me not")); $gobutton = htmlspecialchars(translate("GO!")); $gotitle = htmlspecialchars(translate("Enter your username and password then click here to log in.")); $temppwprompt = translate("If you have forgotten your password then"); $temppwbutton = htmlspecialchars(translate("Help! I've forgotten my password!")); $temppwtitle = htmlspecialchars(translate("Enter a username, if you know it, and click here, to be e-mailed a temporary password.")); $html = <<
$userprompt:
$pwprompt:  
 

$temppwprompt:

EOTEXT; return $html; } /** * Checks that this user is logged in, and presents a login screen if they aren't. * * The function can optionally confirm whether they are a member of one of a list * of groups, and deny access if they are not a member of any of them. * * @param string $groups The list of groups that the user must be a member of one of to be allowed to proceed. * @return boolean Whether or not the user is logged in and is a member of one of the required groups. */ function LoginRequired( $groups = "" ) { global $c, $session; if ( $this->logged_in && $groups == "" ) return; if ( ! $this->logged_in ) { $c->messages[] = i18n("You must log in to use this system."); if ( function_exists("local_index_not_logged_in") ) { local_index_not_logged_in(); } else { $login_html = translate( "

Log On Please

For access to the %s you should log on withthe username and password that have been issued to you.

If you would like to request access, please e-mail %s.

"); $page_content = sprintf( $login_html, $c->system_name, $c->admin_email ); $page_content .= $this->RenderLoginPanel(); if ( isset($page_elements) && gettype($page_elements) == 'array' ) { $page_elements[] = $page_content; @include("page-renderer.php"); exit(0); } @include("page-header.php"); echo $page_content; @include("page-footer.php"); } } else { $valid_groups = explode(",", $groups); foreach( $valid_groups AS $k => $v ) { if ( $this->AllowedTo($v) ) return; } $c->messages[] = i18n("You are not authorised to use this function."); if ( isset($page_elements) && gettype($page_elements) == 'array' ) { @include("page-renderer.php"); exit(0); } @include("page-header.php"); @include("page-footer.php"); } exit; } /** * E-mails a temporary password in response to a request from a user. * * This could be called from somewhere within the application that allows * someone to set up a user and invite them. * * This function includes EMail.php to actually send the password. */ function EmailTemporaryPassword( $username, $email_address, $body_template="" ) { global $c; $password_sent = false; $where = ""; $params = array(); if ( isset($username) && $username != "" ) { $where = 'WHERE active AND lower(usr.username) = :lcusername'; $params[':lcusername'] = strtolower($username); } else if ( isset($email_address) && $email_address != "" ) { $where = 'WHERE active AND lower(usr.email) = :lcemail'; $params[':lcemail'] = strtolower($email_address); } if ( $where != '' ) { if ( !isset($body_template) || $body_template == "" ) { $body_template = <<Exec('Session::EmailTemporaryPassword'); if ( $qry->rows() > 0 ) { $q2 = new AwlQuery(); $q2->Begin(); while ( $row = $qry->Fetch() ) { $mail = new EMail( "Access to $c->system_name" ); $mail->SetFrom($c->admin_email ); $usernames = ""; $debug_to = ""; if ( isset($c->debug_email) ) { $debug_to = "This e-mail would normally be sent to:\n "; $mail->AddTo( "Tester <$c->debug_email>" ); } $tmp_passwd = ''; for ( $i=0; $i < 8; $i++ ) { $tmp_passwd .= substr( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ+#.-=*%@0123456789abcdefghijklmnopqrstuvwxyz', rand(0,69), 1); } $q2->QDo('INSERT INTO tmp_password (user_no, password) VALUES(?,?)', array($row->user_no, $tmp_passwd)); if ( isset($c->debug_email) ) { $debug_to .= "$row->fullname <$row->email> "; } else { $mail->AddTo( "$row->fullname <$row->email>" ); } $usernames .= " $row->username\n"; if ( $mail->To != "" ) { if ( isset($c->debug_email) ) { $debug_to .= "\n============================================================\n"; } $sql .= "COMMIT;"; $qry = new AwlQuery( $sql ); $qry->Exec("Session::SendTemporaryPassword"); $body = str_replace( '@@system_name@@', $c->system_name, $body_template); $body = str_replace( '@@password@@', $tmp_passwd, $body); $body = str_replace( '@@usernames@@', $usernames, $body); $body = str_replace( '@@debugging@@', $debug_to, $body); $mail->SetBody($body); $mail->Send(); $password_sent = true; } } } } return $password_sent; } /** * Sends a temporary password in response to a request from a user. * * This is probably only going to be called from somewhere internal. An external * caller will probably just want the e-mail, without the HTML that this displays. * */ function SendTemporaryPassword( ) { global $c, $page_elements; $password_sent = $this->EmailTemporaryPassword( (isset($_POST['username'])?$_POST['username']:null), (isset($_POST['email_address'])?$_POST['email_address']:null) ); if ( ! $password_sent && ((isset($_POST['username']) && $_POST['username'] != "" ) || (isset($_POST['email_address']) && $_POST['email_address'] != "" )) ) { // Username or EMail were non-null, but we didn't find that user. $page_content = <<

Unable to Reset Password

We were unable to reset your password at this time. Please contact $c->admin_email to arrange for an administrator to reset your password.

Thank you.

EOTEXT; } if ( $password_sent ) { $page_content = <<

Temporary Password Sent

A temporary password has been e-mailed to you. This password will be valid for 24 hours and you will be required to change your password after logging in.

Click here to return to the login page.

EOTEXT; } else { $page_content = <<

Temporary Password

Enter your User Name:
Or your EMail Address:
and click on ->

Note: If you have multiple accounts with the same e-mail address, they will all be assigned a new temporary password, but only the one(s) that you use that temporary password on will have the existing password invalidated.

The temporary password will only be valid for 24 hours.

You will need to log on and change your password during this time.

EOTEXT; } if ( isset($page_elements) && gettype($page_elements) == 'array' ) { $page_elements[] = $page_content; @include("page-renderer.php"); exit(0); } @include("page-header.php"); echo $page_content; @include("page-footer.php"); exit(0); } static function _CheckLogout() { if ( isset($_GET['logout']) ) { dbg_error_log( "Login", ":_CheckLogout: Logging out"); setcookie( 'sid', '', 0,'/'); unset($_COOKIE['sid']); unset($GLOBALS['sid']); unset($_COOKIE['lsid']); // Allow a cookied person to be un-logged-in for one page view. unset($GLOBALS['lsid']); if ( isset($_GET['forget']) ) setcookie( 'lsid', '', 0,'/'); } } function _CheckLogin() { global $c; if ( isset($_POST['lostpass']) ) { dbg_error_log( "Login", ":_CheckLogin: User '$_POST[username]' has lost the password." ); $this->SendTemporaryPassword(); } else if ( isset($_POST['username']) && isset($_POST['password']) ) { // Try and log in if we have a username and password $this->Login( $_POST['username'], $_POST['password'] ); @dbg_error_log( "Login", ":_CheckLogin: User %s(%s) - %s (%d) login status is %d", $_POST['username'], $this->fullname, $this->user_no, $this->logged_in ); } else if ( !isset($_COOKIE['sid']) && isset($_COOKIE['lsid']) && $_COOKIE['lsid'] != "" ) { // Validate long-term session details $this->LSIDLogin( $_COOKIE['lsid'] ); dbg_error_log( "Login", ":_CheckLogin: User $this->username - $this->fullname ($this->user_no) login status is $this->logged_in" ); } else if ( !isset($_COOKIE['sid']) && isset($c->authenticate_hook['server_auth_type']) ) { /** * The authentication should have happened in the server, and we should accept it if so. */ if ( is_array($c->authenticate_hook['server_auth_type']) ) { if ( in_array($_SERVER['AUTH_TYPE'], $c->authenticate_hook['server_auth_type'])) { $this->Login($_SERVER['REMOTE_USER'], "", true); // Password will not be checked. } } else if ( $c->authenticate_hook['server_auth_type'] == $_SERVER['AUTH_TYPE'] ) { /** * Perhaps this 'split' is not a good idea though. People may want to use the * full ID as the username. A further option may be desirable. */ list($username) = explode('@', $_SERVER['REMOTE_USER']); $this->Login($username, "", true); // Password will not be checked. } } } /** * Function to reformat an ISO date to something nicer and possibly more localised * @param string $indate The ISO date to be formatted. * @param string $type If 'timestamp' then the time will also be shown. * @return string The nicely formatted date. */ function FormattedDate( $indate, $type='date' ) { $out = ""; if ( preg_match( '#^\s*$#', $indate ) ) { // Looks like it's empty - just return empty return $indate; } if ( preg_match( '#^\d{1,2}[/-]\d{1,2}[/-]\d{2,4}#', $indate ) ) { // Looks like it's nice already - don't screw with it! return $indate; } $yr = substr($indate,0,4); $mo = substr($indate,5,2); $dy = substr($indate,8,2); switch ( $this->date_format_type ) { case 'U': $out = sprintf( "%d/%d/%d", $mo, $dy, $yr ); break; case 'E': $out = sprintf( "%d/%d/%d", $dy, $mo, $yr ); break; default: $out = sprintf( "%d-%02d-%02d", $yr, $mo, $dy ); break; } if ( $type == 'timestamp' ) { $out .= substr($indate,10,6); } return $out; } /** * Build a hash which we can use for confirmation that we didn't get e-mailed * a bogus link by someone, and that we actually got here by traversing the * website. * * @param string $method Either 'GET' or 'POST' depending on the way we will use this. * @param string $varname The name of the variable which we will confirm * @return string A string we can use as either a GET or POST value (i.e. a hidden field, or a varname=hash pair. */ function BuildConfirmationHash( $method, $varname ) { /** * We include session_start in this because it is never passed to the client * and since it includes microseconds would be very hard to predict. */ $confirmation_hash = session_salted_md5( $this->session_start.$varname.$this->session_key, "" ); if ( $method == 'GET' ) { $confirm = $varname .'='. urlencode($confirmation_hash); } else { $confirm = sprintf( '', $varname, htmlspecialchars($confirmation_hash) ); } return $confirm; } /** * Check a hash which we created through BuildConfirmationHash * * @param string $method Either 'GET' or 'POST' depending on the way we will use this. * @param string $varname The name of the variable which we will confirm * @return string A string we can use as either a GET or POST value (i.e. a hidden field, or a varname=hash pair. */ function CheckConfirmationHash( $method, $varname ) { if ( $method == 'GET' && isset($_GET[$varname])) { $hashwegot = $_GET[$varname]; dbg_error_log('Session',':CheckConfirmationHash: We got "%s" from GET', $hashwegot ); } else if ( isset($_POST[$varname]) ) { $hashwegot = $_POST[$varname]; dbg_error_log('Session',':CheckConfirmationHash: We got "%s" from POST', $hashwegot ); } else { return false; } if ( preg_match('{^\*(.+)\*.+$}i', $hashwegot, $regs ) ) { // A nicely salted md5sum like "**" $salt = $regs[1]; dbg_error_log('Session',':CheckConfirmationHash: Salt "%s"', $salt ); $test_against = session_salted_md5( $this->session_start.$varname.$this->session_key, $salt ) ; dbg_error_log('Session',':CheckConfirmationHash: Testing against "%s"', $test_against ); return ($hashwegot == $test_against); } return false; } } /** * @global resource $session * @name $session * The session object is global. */ if ( !isset($session) ) { Session::_CheckLogout(); $session = new Session(); $session->_CheckLogin(); } awl-0.53.orig/inc/PgQuery.php0000644000000000000000000005072211362230664012740 0ustar pg_connect. * * We will die if the database is not currently connected and we fail to find * a working connection. * * @package awl * @subpackage PgQuery * @author Andrew McMillan * @copyright Catalyst IT Ltd, Morphoss Ltd * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later */ if ( ! function_exists('pg_Connect') ) { echo << PostgreSQL Support Not Present

PostgreSQL Support Not Present

PHP is not configured to support the PostgreSQL database

You need to ensure that the PostgreSQL support module is installed, and then to configure it in your php.ini file by adding a line like this:

extension=pgsql.so
EOERRMSG; exit; } require_once("AWLUtilities.php"); /** * Connect to the database defined in the $c->dbconn[] array */ function connect_configured_database() { global $c, $dbconn; if ( isset($dbconn) ) return; /** * Attempt to connect to the configured connect strings */ $dbconn = false; dbg_error_log('pgquery', 'Attempting to connect to database'); if ( isset($c->pg_connect) && is_array($c->pg_connect) ) { foreach( $c->pg_connect AS $k => $v ) { if ( !$dbconn ) { if ( $dbconn = ((isset($c->use_persistent) && $c->use_persistent) ? pg_pConnect($v) : pg_Connect($v) ) ) break; } } } if ( ! $dbconn ) { echo <<Database Connection Failure

Database Error

Could not connect to PostgreSQL database

EOERRMSG; if ( isset($c->pg_connect) && is_array($c->pg_connect) ) { dbg_error_log("ERROR", "Failed to connect to database" ); } exit; } if ( isset($c->db_schema) && $c->db_schema != '' ) { $result = pg_exec( $dbconn, "SET Search_path TO ".$c->db_schema.",public;" ); $row = pg_fetch_array($result, 0); } $result = pg_exec( $dbconn, "SELECT version()" ); $row = pg_fetch_array($result, 0); $c->found_dbversion = preg_replace( '/^PostgreSQL (\d+\.\d+)\..*$/i', '$1', $row[0]); } /** * @global resource $dbconn * @name $dbconn * The database connection. */ $dbconn = null; if ( !function_exists('duration') ) { /** * A duration (in decimal seconds) between two times which are the result of calls to microtime() * * This simple function is used by the PgQuery class because the * microtime function doesn't return a decimal time, so a simple * subtraction is not sufficient. * * @param microtime $t1 start time * @param microtime $t2 end time * @return double difference */ function duration( $t1, $t2 ) { list ( $ms1, $s1 ) = explode ( " ", $t1 ); // Format times - by spliting seconds and microseconds list ( $ms2, $s2 ) = explode ( " ", $t2 ); $s1 = $s2 - $s1; $s1 = $s1 + ( $ms2 -$ms1 ); return $s1; // Return duration of time } } /** * Quote the given string (depending on its type) so that it can be used * safely in a PostgreSQL query without fear of SQL injection errors. * * Although this function effectively achieves a similar goal to the pg_escape_string() * function, it is needed for older versions of PHP (< 4.2.0) and older versions * of PostgreSQL (< 7.2.0), however. PgQuery does not attempt to use the newer * pg_escape_string() function at this stage. * * This function is outside the PgQuery class because it is sometimes * desirable to quote values for SQL command strings in circumstances * where there is no benefit to using the class. * * @param mixed $str Data to be converted to a string suitable for including as a value in SQL. * @return string NULL, TRUE, FALSE, a plain number, or the original string quoted and with ' and \ characters escaped */ function qpg($str = null) { global $c; switch (strtolower(gettype($str))) { case 'null': $rv = 'NULL'; break; case 'integer': case 'double' : return $str; case 'boolean': $rv = $str ? 'TRUE' : 'FALSE'; break; case 'string': default: $str = str_replace("'", "''", $str); //PostgreSQL treats a backslash as an escape character. $str = str_replace('\\', '\\\\', $str); $rv = "'$str'"; if ( !isset($c->found_dbversion) || $c->found_dbversion > 8.0 ) $rv = 'E'.$rv; } return $rv; } /** * Clean a string of many suspicious characters * * While this is a fairly aggressive approach, it applies in many circumstances * where various strings should not contain things that might screw up (e.g.) * filesystem semantics. Although not strictly a PgQuery function it's here * for the time being until I invent a new "generally useful functions" include. * * @param string $unclean The dirty filthy string needing washing. * @return string The pristine uncontaminated string we can safely use for Just About Anything(tm). */ function clean_string( $unclean, $type = 'full' ) { if ( ! isset($unclean) ) return null; if ( is_array($unclean) ) { $result = array(); foreach( $unclean AS $k => $v ) { $result[$k] = clean_string( $v, $type ); } return $result; } if ( $type != 'basic' ) $cleaned = strtolower($unclean); else $cleaned = &$unclean; $cleaned = preg_replace( "/['\"!\\\\()\[\]|*\/{}&%@~;:?<>]/", '', $cleaned ); //"// Stupid Bluefish Syntax highlighting... dbg_error_log( "PgQuery", "clean_string: Cleaned string from <<%s>> to <<%s>>", $unclean, $cleaned ); return $cleaned; } /** * Replaces PostgreSQL query with escaped parameters in preparation * for execution. * * The function takes a variable number of arguments, the first is the * SQL string, with replaceable '?' characters (a la DBI). The subsequent * parameters being the values to replace into the SQL string. * * The values passed to the routine are analyzed for type, and quoted if * they appear to need quoting. This can go wrong for (e.g.) NULL or * other special SQL values which are not straightforwardly identifiable * as needing quoting (or not). In such cases the parameter can be forced * to be inserted unquoted by passing it as "array( 'plain' => $param )". * * This function is outside the PgQuery class because it is sometimes * desirable to build SQL command strings in circumstances where there * is no benefit to using the class. * * @param string The query string with replacable '?' characters. * @param mixed The values to replace into the SQL string. * @return The built query string */ function awl_replace_sql_args() { $argc = func_num_args(); //number of arguments passed to the function $qry = func_get_arg(0); //first argument $args = func_get_args(); //all argument in an array if ( is_array($qry) ) { $qry = $args[0][0]; $args = $args[0]; $argc = count($args); } // building query string by replacing ? with // escaped parameters $parts = explode( '?', $qry ); $querystring = $parts[0]; $z = min( count($parts), $argc ); for( $i = 1; $i < $z; $i++ ) { $arg = $args[$i]; if ( !isset($arg) ) { $querystring .= 'NULL'; } elseif ( is_array($arg) && $arg['plain'] != '' ) { // We abuse this, but people should access it through the PgQuery::Plain($v) function $querystring .= $arg['plain']; } else { $querystring .= qpg($arg); //parameter } $querystring .= $parts[$i]; //extras eg. "," } if ( isset($parts[$z]) ) $querystring .= $parts[$z]; //puts last part on the end return $querystring; } /** * The PgQuery Class. * * This class builds and executes PostgreSQL Queries and traverses the * set of results returned from the query. * * Example usage * * $sql = "SELECT * FROM mytable WHERE mytype = ?"; * $qry = new PgQuery( $sql, $myunsanitisedtype ); * if ( $qry->Exec("typeselect", __line__, __file__ ) * && $qry->rows() > 0 ) * { * while( $row = $qry->Fetch() ) { * do_something_with($row); * } * } * * * @package awl */ class PgQuery { /**#@+ * @access private */ /** * holds the connection to the database * should be internal * @var resource */ var $connection; /** * stores a query string * should be read-only * @var string */ var $querystring; /** * stores a resource result * should be internal * @var resource */ var $result; /** * number of current row * should be internal, or at least read-only * @var int */ var $rownum = -1; /** * Where we called this query from so we can find it in our code! * Debugging may also be selectively enabled for a $location. * @var string */ var $location; /** * The row most recently fetched by a call to Fetch() or FetchBackwards * which will either be an array or an object (depending on the Fetch call). * @var mixed */ var $object; /**#@-*/ /**#@+ * @access public */ /** * number of rows from pg_numrows - for fetching result * should be read-only * @var int */ var $rows; /** * The PostgreSQL error message, if the query fails. * Should be read-only, although any successful Exec should clear it * @var string */ var $errorstring; /** * Stores the query execution time - used to deal with long queries. * should be read-only * @var string */ var $execution_time; /** * How long the query should take before a warning is issued. * * This is writable, but a method to set it might be a better interface. * The default is 0.3 seconds. * @var double */ var $query_time_warning = 0.3; /**#@-*/ /** * Constructor * @param string The query string with replacable '?' characters. * @param mixed The values to replace into the SQL string. * @return The PgQuery object */ function __construct() { global $dbconn; $this->result = 0; $this->rows = 0; $this->execution_time = 0; $this->rownum = -1; $this->connection = $dbconn; $argc = func_num_args(); if ( 1 < $argc ) { $this->querystring = awl_replace_sql_args( func_get_args() ); } else { // If we are only called with a single argument, we do // nothing special with any question marks. $this->querystring = func_get_arg(0); } return $this; } /** * Use a different database connection for this query * @param resource $new_connection The database connection to use. */ function SetConnection( $new_connection ) { $this->connection = $new_connection; } /** * Log error, optionally with file and line location of the caller. * * This function should not really be used outside of PgQuery. For a more * useful generic logging interface consider calling dbg_error_log(...); * * @param string $locn A string identifying the calling location. * @param string $tag A tag string, e.g. identifying the type of event. * @param string $string The information to be logged. * @param int $line The line number where the logged event occurred. * @param string $file The file name where the logged event occurred. */ function _log_error( $locn, $tag, $string, $line = 0, $file = "") { // replace more than one space with one space $string = preg_replace('/\s+/', ' ', $string); if ( ($tag == 'QF' || $tag == 'SQ') && ( $line != 0 && $file != "" ) ) { dbg_error_log( "LOG-$locn", " Query: %s: Error in '%s' on line %d", $tag, $file, $line ); } while( strlen( $string ) > 0 ) { dbg_error_log( "LOG-$locn", " Query: %s: %s", $tag, substr( $string, 0, 240) ); $string = substr( "$string", 240 ); } } /** * Provide a rows() method for forward compatibility with AwlQuery. */ function rows() { return $this->rows; } /** * Quote the given string so it can be safely used within string delimiters * in a query. * * @see qpg() * which is where this is really done. * * @param mixed $str Data to be converted to a string suitable for including as a value in SQL. * @return string NULL, TRUE, FALSE, a plain number, or the original string quoted and with ' and \ characters escaped */ function quote($str = null) { return qpg($str); } /** * Convert a string which has already been quoted and escaped for PostgreSQL * into a magic array so that it will be inserted unmodified into the SQL * string. Use with care! * * @param string $field The value which has alread been quoted and escaped. * @return array An array with the value associated with a key of 'plain' */ function Plain( $field ) { // Abuse the array type to extend our ability to avoid \\ and ' replacement $rv = array( 'plain' => $field ); return $rv; } /** * Execute the query, logging any debugging. * * Example * So that you can nicely enable/disable the queries for a particular class, you * could use some of PHPs magic constants in your call. * * $qry->Exec(__CLASS__, __LINE__, __FILE__); * * * * @param string $location The name of the location for enabling debugging or just * to help our children find the source of a problem. * @param int $line The line number where Exec was called * @param string $file The file where Exec was called * @return resource The actual result of the query (FWIW) */ function Exec( $location = '', $line = 0, $file = '' ) { global $debuggroups, $c, $dbconn; if ( !isset($this->connection) ) { if ( !isset($dbconn) ) { connect_configured_database(); } $this->connection = $dbconn; } $this->location = trim($location); if ( $this->location == "" ) $this->location = substr($_SERVER['PHP_SELF'],1); if ( isset($debuggroups['querystring']) || isset($c->dbg['querystring']) || isset($c->dbg['ALL']) ) { $this->_log_error( $this->location, 'DBGQ', $this->querystring, $line, $file ); } $t1 = microtime(); // get start time $this->result = @pg_exec( $this->connection, $this->querystring ); // execute the query $this->rows = ($this->result ? pg_numrows($this->result) : -1); // number of rows returned $t2 = microtime(); // get end time $i_took = duration( $t1, $t2 ); // calculate difference $c->total_query_time += $i_took; $this->execution_time = sprintf( "%2.06lf", $i_took); if ( !$this->result ) { // query simply failed $this->errorstring = @pg_errormessage(); // returns database error message $this->_log_error( $this->location, 'QF', $this->querystring, $line, $file ); $this->_log_error( $this->location, 'QF', $this->errorstring, $line, $file ); } elseif ( $this->execution_time > $this->query_time_warning ) { // if execution time is too long $this->_log_error( $this->location, 'SQ', "Took: $this->execution_time for $this->querystring", $line, $file ); // SQ == Slow Query :-) } elseif ( isset($debuggroups[$this->location]) || isset($c->dbg[strtolower($this->location)]) || isset($c->dbg['ALL']) ) { // query successful, but we're debugging and want to know how long it took anyway $this->_log_error( $this->location, 'DBGQ', "Took: $this->execution_time for $this->querystring to find $this->rows rows.", $line, $file ); } return $this->result; } /** * Fetch the next row from the query results * @param boolean $as_array True if thing to be returned is array * @return mixed query row */ function Fetch($as_array = false) { global $c, $debuggroups; if ( ( isset($debuggroups["$this->location"]) && $debuggroups["$this->location"] > 2 ) || (isset($c) && is_object($c) && ( isset($c->dbg[strtolower($this->location)]) && isset($c->dbg[strtolower($this->location)]) ) || isset($c->dbg['ALL']) ) ) { $this->_log_error( $this->location, "Fetch", "$this->result Rows: $this->rows, Rownum: $this->rownum"); } if ( ! $this->result ) return false; // no results if ( ($this->rownum + 1) >= $this->rows ) return false; // reached the end of results $this->rownum++; if ( isset($debuggroups["$this->location"]) && $debuggroups["$this->location"] > 1 ) { $this->_log_error( $this->location, "Fetch", "Fetching row $this->rownum" ); } if ( $as_array ) { $this->object = pg_fetch_array($this->result, $this->rownum); } else { $this->object = pg_fetch_object($this->result, $this->rownum); } return $this->object; } /** * Set row counter back one * * In the case that you may like to fetch the same row twice, for example * if your SQL returns some columns that are the same for each row, and you * want to display them cleanly before displaying the other data repeatedly * for each row. * * Example * * $master_row = $qry->Fetch(); * $qry->UnFetch(); * do_something_first($master_row); * while( $row = $qry->Fetch() ) { * do_something_repeatedly($row); * } * */ function UnFetch() { global $debuggroups; $this->rownum--; if ( $this->rownum < -1 ) $this->rownum = -1; } /** * Fetch backwards from the result resource * @param boolean $as_array True if thing to be returned is array (default: False * @return mixed query row */ function FetchBackwards($as_array = false) { global $debuggroups; if ( isset($debuggroups["$this->location"]) && $debuggroups["$this->location"] > 2 ) { $this->_log_error( $this->location, "FetchBackwards", "$this->result Rows: $this->rows, Rownum: $this->rownum"); } if ( ! $this->result ) return false; if ( ($this->rownum - 1) == -1 ) return false; if ( $this->rownum == -1 ) $this->rownum = $this->rows; $this->rownum--; if ( isset($debuggroups["$this->location"]) && $debuggroups["$this->location"] > 1 ) { $this->_log_error( $this->location, "Fetch", "Fetching row $this->rownum" ); } if ( $as_array ) { $this->object = pg_fetch_array($this->result, $this->rownum); } else { $this->object = pg_fetch_object($this->result, $this->rownum); } return $this->object; } /** * Build an option list from the query. * @param string $current Default selection of drop down box (optional) * @param string $location for debugging purposes * @param array $parameters an array further parameters, including 'maxwidth' => 20 to set a maximum width * @return string Select box HTML */ function BuildOptionList( $current = '', $location = 'options', $parameters = false ) { global $debuggroups; $result = ''; $translate = false; if ( isset($maxwidth) ) unset($maxwidth); if ( is_array($parameters) ) { if ( isset($parameters['maxwidth']) ) $maxwidth = max(4,intval($parameters['maxwidth'])); if ( isset($parameters['translate']) ) $translate = true; } // The query may already have been executed if ( $this->rows > 0 || $this->Exec($location) ) { $this->rownum = -1; while( $row = $this->Fetch(true) ) { if (is_array($current)) { $selected = ( ( in_array($row[0],$current,true) || in_array($row[1],$current,true)) ? ' selected="selected"' : '' ); } else { $selected = ( ( "$row[0]" == "$current" || "$row[1]" == "$current" ) ? ' selected="selected"' : '' ); } $display_value = $row[1]; if ( isset($translate) ) $display_value = translate( $display_value ); if ( isset($maxwidth) ) $display_value = substr( $display_value, 0, $maxwidth); $nextrow = ""; $result .= $nextrow; } } return $result; } } awl-0.53.orig/VERSION0000644000000000000000000000000511774765031011127 0ustar 0.53 awl-0.53.orig/scripts/0000755000000000000000000000000011774765552011563 5ustar awl-0.53.orig/scripts/build-AWLUtilities.sh0000755000000000000000000000036411632655132015522 0ustar #!/bin/sh # # Apply the current version numbers into always.php from always.php.in # AWL_VERSION="`head -n1 VERSION`" sed -e "/^ *.c->awl_library_version *=.*$/ s/^ *.c->awl_library_version *=.*$/\$c->awl_library_version = ${AWL_VERSION};/" awl-0.53.orig/docs/0000755000000000000000000000000011774765552011024 5ustar awl-0.53.orig/docs/api/0000755000000000000000000000000011774765552011575 5ustar awl-0.53.orig/docs/api/classtrees_awl.html0000644000000000000000000000777611774765543015517 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Root class AuthPlugin

Root class AwlCache

Root class AwlDBDialect

Root class AwlQuery

Root class AwlUpgrader

Root class Browser

Root class BrowserColumn

Root class DBRecord

Root class Editor

Root class EditorField

Root class EMail

Root class EntryField

Root class EntryForm

Root class iCalComponent

Root class iCalendar

Root class iCalProp

Root class MenuOption

Root class MenuSet

Root class Multipart

Root class PgQuery

Root class Session

Root class SinglePart

Root class Validation

Root class vComponent

Root class vProperty

Root class XMLDocument

Root class XMLElement

Documentation generated on Wed, 04 Jul 2012 07:06:11 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/packages.html0000644000000000000000000000304411774765543014242 0ustar Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 awl-0.53.orig/docs/api/elementindex_awl.html0000644000000000000000000075571211774765543016030 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

[awl] element index

All elements
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
a b c d e f g h i j l m n o p q r s t u v w x _
_
Method __construct
SinglePart::__construct() in Multipart.php
Method __construct
Multipart::__construct() in Multipart.php
Method __construct
AwlCache::__construct() in AwlCache.php
Initialise the cache connection. We use getpid() to give us a persistent connection.
Function _awl_connect_configured_database
Connect to the database defined in the $c->db_connect[] (or $c->pg_connect) arrays
Method _log_query
AwlQuery::_log_query() in AwlQuery.php
Log query, optionally with file and line location of the caller.
Method __construct
AwlUpgrader::__construct() in AwlUpgrader.php
Constructor
Method __construct
AwlQuery::__construct() in AwlQuery.php
Constructor
Method __construct
AwlDBDialect::__construct() in AwlDBDialect.php
Parses the connection string to ascertain the database dialect. Returns true if the dialect is supported and fails if the dialect is not supported. All code to support any given database should be within in an external include.
Method __construct
EditorField::__construct() in classEditor.php
Method __construct
Editor::__construct() in classEditor.php
Method _ParseAttributes
Internal function for parsing the type extra on a field.
Method _BuildFieldList
DBRecord::_BuildFieldList() in DataUpdate.php
Builds a field target list
Method _BuildJoinClause
Builds a table join clause
Method _BuildWhereClause
Builds a where clause to match the supplied keys
Method __construct
Create the e-mail, optionally assigning the subject and primary recipient.
Function _CompareMenuSequence
_CompareMenuSequence() in MenuSet.php
_CompareMenuSequence is used in sorting the menu options into the sequence order
Method _CompareSequence
_CompareSequence is used in sorting the menu options into the sequence order
Method _HasActive
MenuSet::_HasActive() in MenuSet.php
Does the menu have any options that are active.
Method _OptionExists
See if a menu already has this option
Method _log_error
PgQuery::_log_error() in PgQuery.php
Log error, optionally with file and line location of the caller.
Method __construct
PgQuery::__construct() in PgQuery.php
Constructor
Method _CheckLogin
Session::_CheckLogin() in Session.php
Method _CheckLogout
Method __construct
vCalendar::__construct() in vCalendar.php
Constructor. If a string is passed it will be parsed as if it was an iCalendar object, otherwise a new vCalendar will be initialised with basic content. If an array of key value pairs is provided they will also be used as top-level properties.
Method __construct
vProperty::__construct() in vComponent.php
The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when vComponent::ParseFrom() called vComponent::UnwrapComponent().
Method __construct
vComponent::__construct() in vComponent.php
A basic constructor
Method __toString
vProperty::__toString() in vComponent.php
Method __toString
vComponent::__toString() in vComponent.php
Variable $_parent
XMLElement::$_parent in XMLElement.php
Method __construct
XMLElement::__construct() in XMLElement.php
Constructor - nothing fancy as yet.
Method __tostring
XMLElement::__tostring() in XMLElement.php
a
Method acquireLock
AwlCache::acquireLock() in AwlCache.php
Acquire a lock on something
Method addPart
Multipart::addPart() in Multipart.php
Class AwlCache
AwlCache in AwlCache.php
A simple Memcached wrapper supporting namespacing of stored values.
Page AwlCache.php
AwlCache.php in AwlCache.php
Method Authenticate
AuthPlugin::Authenticate() in AuthPlugin.php
Authenticate. Do whatever we need to authenticate a username / password.
Method AuthPlugin
AuthPlugin::AuthPlugin() in AuthPlugin.php
Create a new AuthPlugin object. This is as lightweight as possible.
Class AuthPlugin
AuthPlugin in AuthPlugin.php
A class for authenticating and retrieving user information
Page AuthPlugin.php
AuthPlugin.php in AuthPlugin.php
Page AuthPlugins.php
AuthPlugins.php in AuthPlugins.php
Function auth_external
auth_external() in AuthPlugins.php
Authentication has already happened. We know the username, we just need to do the authorisation / access control. The password is ignored.
Function auth_other_awl
auth_other_awl() in AuthPlugins.php
Authenticate against a different PostgreSQL database which contains a usr table in the AWL format.
Class AwlDatabase
AwlDatabase in AwlDatabase.php
Typically there will only be a single instance of the database level class in an application.
Page AwlDatabase.php
AwlDatabase.php in AwlDatabase.php
Class AwlDBDialect
AwlDBDialect in AwlDBDialect.php
The AwlDBDialect class handles support for different SQL dialects
Page AwlDBDialect.php
AwlDBDialect.php in AwlDBDialect.php
Class AwlQuery
AwlQuery in AwlQuery.php
The AwlQuery Class.
Page AwlQuery.php
AwlQuery.php in AwlQuery.php
Class AwlUpgrader
AwlUpgrader in AwlUpgrader.php
The AwlUpgrader Class.
Page AwlUpgrader.php
AwlUpgrader.php in AwlUpgrader.php
Variable $Align
BrowserColumn::$Align in classBrowser.php
Method AddColumn
Browser::AddColumn() in classBrowser.php
Add a column to the Browser.
Method AddGrouping
Browser::AddGrouping() in classBrowser.php
Method AddHidden
Browser::AddHidden() in classBrowser.php
Add a hidden column - one that is present in the SQL result, but for which there is no column displayed.
Method AddOrder
Browser::AddOrder() in classBrowser.php
Add an ordering to the browser widget.
Method AddRow
Browser::AddRow() in classBrowser.php
Add an extra arbitrary row onto the end of the browser.
Method AddTotal
Browser::AddTotal() in classBrowser.php
Mark a column as something to be totalled. You can also specify the name of a function which may modify the value before the actual totalling.
Method AndWhere
Browser::AndWhere() in classBrowser.php
Add an OR ... to the SQL Where clause
Variable $Action
Editor::$Action in classEditor.php
Variable $Attributes
EditorField::$Attributes in classEditor.php
Method AddAttribute
Editor::AddAttribute() in classEditor.php
Method AddAttribute
EditorField::AddAttribute() in classEditor.php
Method AddField
Editor::AddField() in classEditor.php
Method AndWhere
Editor::AndWhere() in classEditor.php
Method Assign
Editor::Assign() in classEditor.php
Assigns the value of a field in the record currently associated with this editor.
Method Available
Editor::Available() in classEditor.php
Variable $attributes
EntryField::$attributes in DataEntry.php
An array of key value pairs
Method AddTable
DBRecord::AddTable() in DataUpdate.php
This will join an additional table to the maintained set
Method AddBcc
EMail::AddBcc() in EMail.php
Add another Bcc recipient to the email
Method AddCc
EMail::AddCc() in EMail.php
Add another Cc recipient to the email
Method AddErrorsTo
Add another Error recipient to the email
Method AddReplyTo
EMail::AddReplyTo() in EMail.php
Add another Reply-to address to the email
Method AddTo
EMail::AddTo() in EMail.php
Add another recipient to the email
Method Add
iCalendar::Add() in iCalendar.php
Method AddComponent
iCalendar::AddComponent() in iCalendar.php
Method AddComponent
Adds a new subcomponent
Method AddProperty
Adds a new property
Method ApplyFilter
iCalendar::ApplyFilter() in iCalendar.php
Method Active
MenuOption::Active() in MenuSet.php
Mark it as active, with a fancy style to distinguish that
Method AddOption
MenuSet::AddOption() in MenuSet.php
Add an option, which is a link.
Method AddSubMenu
MenuSet::AddSubMenu() in MenuSet.php
Add an option, which is a submenu
Method AddSubmenu
This menu option is now promoted to the head of a tree
Function awl_replace_sql_args
awl_replace_sql_args() in PgQuery.php
Replaces PostgreSQL query with escaped parameters in preparation for execution.
Method AllowedTo
Session::AllowedTo() in Session.php
Checks whether a user is allowed to do something.
Method AssignSessionDetails
Internal function used to assign the session details to a user's new session.
Function awl_set_locale
awl_set_locale() in Translation.php
Set the translation to the user's locale. At this stage all we do is call the gettext function.
Method AllowedTo
User::AllowedTo() in User.php
Can the user do this?
Page AWLUtilities.php
AWLUtilities.php in AWLUtilities.php
Function awl_version
awl_version() in AWLUtilities.php
Return the AWL version
Method AddRule
Validation::AddRule() in Validation.php
Adds a validation rule for a specific field upon submission of the form.
Method AddTimeZone
vCalendar::AddTimeZone() in vCalendar.php
Add a timezone component to this vCalendar.
Method AddComponent
vComponent::AddComponent() in vComponent.php
Adds a new subcomponent
Method AddProperty
vComponent::AddProperty() in vComponent.php
Adds a new property
Variable $attributes
XMLElement::$attributes in XMLElement.php
Method AddSubTag
XMLElement::AddSubTag() in XMLElement.php
Add a sub-element
b
Variable $bound_parameters
The current array of bound parameters
Variable $bound_querystring
The actual query string, after we've replaced parameters in it
Method Begin
AwlDatabase::Begin() in AwlDatabase.php
Begin a transaction.
Method Begin
AwlQuery::Begin() in AwlQuery.php
Wrap the parent DB class Begin() so we can $qry->Begin() sometime before we $qry->Exec()
Method Bind
AwlQuery::Bind() in AwlQuery.php
Bind some parameters. This can be called in three ways:
Variable $BeginRow
Browser::$BeginRow in classBrowser.php
Variable $BeginRowArgs
Browser::$BeginRowArgs in classBrowser.php
Class Browser
Browser in classBrowser.php
Start a new Browser, add columns, set a join and Render it to create a basic list of records in a table.
Method Browser
Browser::Browser() in classBrowser.php
The Browser class constructor
Method BrowserColumn
BrowserColumn::BrowserColumn() in classBrowser.php
BrowserColumn constructor. Only the first parameter is mandatory.
Class BrowserColumn
BrowserColumn in classBrowser.php
BrowserColumns are the basic building blocks. You can specify just the field name, and the column header or you can get fancy and specify an alignment, format string, SQL formula and cell CSS class.
Variable $BaseTable
Editor::$BaseTable in classEditor.php
Method BreakLine
EntryForm::BreakLine() in DataEntry.php
A utility function for a heading line within a data entry table
Method BuildOptionList
Build an option list from the query.
Method BuildFromText
Build the iCalendar object from a text string which is a single iCalendar resource
Method BuildOptionList
Build an option list from the query.
Method BuildConfirmationHash
Build a hash which we can use for confirmation that we didn't get e-mailed a bogus link by someone, and that we actually got here by traversing the website.
Function BuildXMLTree
BuildXMLTree() in XMLElement.php
Rebuild an XML tree in our own style from the parsed XML tags using a tail-recursive approach.
c
Variable $crlf
SinglePart::$crlf in Multipart.php
Variable $connection
AwlQuery::$connection in AwlQuery.php
Our database connection, normally copied from a global one
Method Commit
AwlQuery::Commit() in AwlQuery.php
Wrap the parent DB class Commit() so we can $qry->Commit() sometime after we $qry->Exec()
Method Commit
AwlDatabase::Commit() in AwlDatabase.php
Complete a transaction.
Variable $Class
BrowserColumn::$Class in classBrowser.php
Variable $CloseRow
Browser::$CloseRow in classBrowser.php
Variable $Columns
Browser::$Columns in classBrowser.php
Variable $current_row
BrowserColumn::$current_row in classBrowser.php
Page classBrowser.php
classBrowser.php in classBrowser.php
Page classEditor.php
classEditor.php in classEditor.php
Variable $current
EntryField::$current in DataEntry.php
The current value
Method ClearComponents
Method ClearComponents
Clear all components, or the components matching a particular type
Method ClearProperties
Clear all properties, or the properties matching a particular type
Method CloneConfidential
Clone this component (and subcomponents) into a confidential version of it. A confidential event will be scrubbed of any identifying characteristics other than time/date, repeat, uid and a summary which is just a translated 'Busy'.
Method CollectParameterValues
Collect an array of all parameters of our properties which are the specified type
Function clean_string
clean_string() in PgQuery.php
Clean a string of many suspicious characters
Function connect_configured_database
Connect to the database defined in the $c->dbconn[] array
Method CheckConfirmationHash
Check a hash which we created through BuildConfirmationHash
Function check_temporary_passwords
Checks what a user entered against any currently valid temporary passwords on their account.
Function check_by_regex
check_by_regex() in AWLUtilities.php
Verify a value is OK by testing a regex against it. If it is an array apply it to each element in the array recursively. If it is an object we don't mess with it.
Method Confidential
vCalendar::Confidential() in vCalendar.php
Morph this component (and subcomponents) into a confidential version of it. A confidential event will be scrubbed of any identifying characteristics other than time/date, repeat, uid and a summary which is just a translated 'Busy'.
Variable $components
vComponent::$components in vComponent.php
An array of (sub-)components, which are vComponent objects
Variable $content
vProperty::$content in vComponent.php
The value of this property.
Method ClearComponents
Clear all components, or the components matching a particular type
Method ClearProperties
Clear all properties, or the properties matching a particular type
Method CollectParameterValues
Collect an array of all parameters of our properties which are the specified type
Method ComponentCount
Return number of components
Variable $content
XMLElement::$content in XMLElement.php
Method CountElements
XMLElement::CountElements() in XMLElement.php
Count the number of elements
d
Method delete
AwlCache::delete() in AwlCache.php
Delete a value from a namespace/key, or for everything in a namespace if a 'null' key is supplied.
Variable $db
AwlDBDialect::$db in AwlDBDialect.php
Holds the PDO database connection
Variable $dialect
AwlDBDialect::$dialect in AwlDBDialect.php
Holds the name of the database dialect
Variable $Distinct
Browser::$Distinct in classBrowser.php
Variable $DivClose
Browser::$DivClose in classBrowser.php
Variable $DivOpen
Browser::$DivOpen in classBrowser.php
Method DoQuery
Browser::DoQuery() in classBrowser.php
This method is used to build and execute the database query.
Page DataEntry.php
DataEntry.php in DataEntry.php
Method DataEntryField
A utility function for a data entry line within a table
Method DataEntryLine
A utility function for a data entry line within a table
Page DataUpdate.php
DataUpdate.php in DataUpdate.php
Method DBRecord
DBRecord::DBRecord() in DataUpdate.php
Really numbingly simple construction.
Class DBRecord
DBRecord in DataUpdate.php
A Base class to use for records which will be read/written from the database.
Method DealWithTimeZones
Do what must be done with time zones from on file. Attempt to turn them into something that PostgreSQL can understand...
Method DefaultPropertyList
An array of property names that we should always want when rendering an iCalendar
Global $dbconn The database connection.
Function duration
duration() in PgQuery.php
A duration (in decimal seconds) between two times which are the result of calls to microtime()
Method Dbg
Session::Dbg() in Session.php
DEPRECATED Utility function to log debug stuff with printf expansion, and the ability to enable it selectively.
Function dbg_error_log
dbg_error_log() in AWLUtilities.php
Writes a debug message into the error log using printf syntax. If the first parameter is "ERROR" then the message will _always_ be logged.
Function dbg_log_array
dbg_log_array() in AWLUtilities.php
Function to dump an array to the error log, possibly recursively
Function define_byte_mappings
define_byte_mappings() in AWLUtilities.php
Function deprecated
deprecated() in AWLUtilities.php
e
Variable $error_info
AwlQuery::$error_info in AwlQuery.php
The Database error information, if the query fails.
Variable $execution_time
Stores the query execution time - used to deal with long queries.
Method ErrorInfo
AwlDatabase::ErrorInfo() in AwlDatabase.php
Method Exec
AwlQuery::Exec() in AwlQuery.php
Execute the query, logging any debugging.
Method Execute
AwlQuery::Execute() in AwlQuery.php
Tell the database to execute the query
Constant E_USER_ERROR
E_USER_ERROR in AwlDBDialect.php
Variable $ExtraRows
Browser::$ExtraRows in classBrowser.php
Class Editor
Editor in classEditor.php
The class for the Editor form in full
Class EditorField
EditorField in classEditor.php
A class for the fields in the editor
Method EndForm
EntryForm::EndForm() in DataEntry.php
Return the HTML fragment to end the form.
Class EntryField
EntryField in DataEntry.php
Individual fields used for data entry / viewing.
Method EntryField
EntryField::EntryField() in DataEntry.php
Initialise an EntryField, used for data entry.
Class EntryForm
EntryForm in DataEntry.php
A class to handle displaying a form on the page (for editing) or a structured layout of non-editable content (for viewing), with a simple switch to flip from view mode to edit mode.
Method EntryForm
EntryForm::EntryForm() in DataEntry.php
Initialise a new data-entry form.
Variable $EditMode
DBRecord::$EditMode in DataUpdate.php
The mode we are in for any form
Class EMail
EMail in EMail.php
Lightweight class for sending an e-mail.
Page EMail.php
EMail.php in EMail.php
Method ExtractProperty
Method ExtractSubComponent
Variable $errorstring
PgQuery::$errorstring in PgQuery.php
The PostgreSQL error message, if the query fails.
Variable $execution_time
Stores the query execution time - used to deal with long queries.
Method Exec
PgQuery::Exec() in PgQuery.php
Execute the query, logging any debugging.
Variable $email
Session::$email in Session.php
The user's email address from their usr record.
Method EmailTemporaryPassword
E-mails a temporary password in response to a request from a user.
f
Method flush
AwlCache::flush() in AwlCache.php
Flush the entire cache
Method Fetch
AwlQuery::Fetch() in AwlQuery.php
Fetch the next row from the query results
Variable $Field
BrowserColumn::$Field in classBrowser.php
Variable $FieldNames
Browser::$FieldNames in classBrowser.php
Variable $ForcedOrder
Browser::$ForcedOrder in classBrowser.php
Variable $Format
BrowserColumn::$Format in classBrowser.php
Method ForceOrder
Browser::ForceOrder() in classBrowser.php
Force a particular ordering onto the browser widget.
Variable $Field
EditorField::$Field in classEditor.php
Variable $Fields
Editor::$Fields in classEditor.php
Method FirstNonTimezone
Get all sub-components, or at least get those matching a type
Method Fetch
PgQuery::Fetch() in PgQuery.php
Fetch the next row from the query results
Method FetchBackwards
Fetch backwards from the result resource
Variable $fullname
Session::$fullname in Session.php
The user's full name from their usr record.
Method FormattedDate
Function to reformat an ISO date to something nicer and possibly more localised
Function fatal
fatal() in AWLUtilities.php
Function force_utf8
force_utf8() in AWLUtilities.php
g
Method get
AwlCache::get() in AwlCache.php
get a value from the specified namespace / key
Function getCacheInstance
getCacheInstance() in AwlCache.php
Method getMimeHeaders
Method getMimeParts
Multipart::getMimeParts() in Multipart.php
Method GetConnection
Get the current database connection for this query
Method GetFields
AwlDBDialect::GetFields() in AwlDBDialect.php
Returns the SQL for the current database dialect which will return a two-column resultset containing a list of fields and their associated data types.
Method GetVersion
AwlDBDialect::GetVersion() in AwlDBDialect.php
Sets the current search path for the database.
Variable $Grouping
Browser::$Grouping in classBrowser.php
Method GetTarget
BrowserColumn::GetTarget() in classBrowser.php
GetTarget
Method GetTotal
Browser::GetTotal() in classBrowser.php
Retrieve the total from a totalled column
Method GetRecord
Editor::GetRecord() in classEditor.php
Method GetTarget
EditorField::GetTarget() in classEditor.php
Method Get
DBRecord::Get() in DataUpdate.php
Returns a single field from the record
Method Get
iCalendar::Get() in iCalendar.php
Get the value of a property in the first non-VTIMEZONE
Method GetComponents
Get all sub-components, or at least get those matching a type, or failling to match, should the second parameter be set to false.
Method GetComponents
Method GetParameterValue
Get the value of a parameter
Method GetPParamValue
Get the value of the specified parameter for the first property matching the name. Obviously this isn't so useful for properties which may occur multiply, but most don't.
Method GetProperties
Get all properties, or the properties matching a particular type
Method GetPropertiesByPath
Return an array of properties matching the specified path
Method GetPValue
Get the value of the first property matching the name. Obviously this isn't so useful for properties which may occur multiply, but most don't.
Method GetType
iCalComponent::GetType() in iCalendar.php
Return the type of component which this is
Method GetRoles
Session::GetRoles() in Session.php
Internal function used to get the user's roles from the database.
Method GetRoles
User::GetRoles() in User.php
Get the group memberships for the user
Function get_fields
get_fields() in AWLUtilities.php
Get the names of the fields for a particular table
Function gzdecode
gzdecode() in AWLUtilities.php
Method GetAttendees
vCalendar::GetAttendees() in vCalendar.php
Get the attendees of this VEVENT/VTODO
Method GetItip
vCalendar::GetItip() in vCalendar.php
Clone this component (and subcomponents) into a minimal iTIP version of it.
Method GetOlsonName
vCalendar::GetOlsonName() in vCalendar.php
Work out what Olson timezone this VTIMEZONE really is. Perhaps we should put this into a vTimezone class.
Method GetOrganizer
vCalendar::GetOrganizer() in vCalendar.php
Get the organizer of this VEVENT/VTODO
Method GetScheduleAgent
Get the schedule-agent from the organizer
Method GetTimeZone
vCalendar::GetTimeZone() in vCalendar.php
Get a timezone component for a specific TZID in this calendar.
Method GetUID
vCalendar::GetUID() in vCalendar.php
Get the UID from the primary component.
Method GetComponents
vComponent::GetComponents() in vComponent.php
Get all sub-components, or at least get those matching a type, or failling to match, should the second parameter be set to false. Component types may be a string or an array associating property names with true values: array( 'TYPE' => true, 'TYPE2' => true )
Method GetParameterValue
Get the value of a parameter
Method GetProperties
vComponent::GetProperties() in vComponent.php
Get all properties, or the properties matching a particular type, or matching an
Method GetPropertiesByPath
Return an array of properties matching the specified path
Method GetProperty
vComponent::GetProperty() in vComponent.php
Return the first instance of a property of this name
Method GetPValue
vComponent::GetPValue() in vComponent.php
Return the value of the first instance of a property of this name, or null
Method GetType
vComponent::GetType() in vComponent.php
Return the type of component which this is
Method GetAttribute
XMLElement::GetAttribute() in XMLElement.php
Accessor for a single attribute
Method GetAttributes
XMLElement::GetAttributes() in XMLElement.php
Accessor for the attributes
Method GetContent
XMLElement::GetContent() in XMLElement.php
Accessor for the content
Method GetElements
XMLElement::GetElements() in XMLElement.php
Return an array of elements matching the specified tag, or all elements if no tag is supplied.
Method GetNSTag
XMLElement::GetNSTag() in XMLElement.php
Accessor for the full-namespaced tag name
Method GetPath
XMLElement::GetPath() in XMLElement.php
Return an array of elements matching the specified path
Method GetTag
XMLElement::GetTag() in XMLElement.php
Accessor for the tag name
h
Variable $Header
BrowserColumn::$Header in classBrowser.php
Variable $HiddenColumns
Browser::$HiddenColumns in classBrowser.php
Variable $Hook
BrowserColumn::$Hook in classBrowser.php
Method HelpInCell
EntryForm::HelpInCell() in DataEntry.php
Set the line format to have help displayed in it's own separate cell
Method HelpInLine
EntryForm::HelpInLine() in DataEntry.php
Set the line format to have help displayed in the same cell as the entry field.
Method HiddenField
EntryForm::HiddenField() in DataEntry.php
A utility function for a hidden field within a data entry table
Method HttpDateFormat
i
Method isActive
AwlCache::isActive() in AwlCache.php
So we can find out if we are actually using the cache.
Variable $Id
Editor::$Id in classEditor.php
Method Id
Editor::Id() in classEditor.php
Sets or returns the form ID used for differentiating this form from others in the page.
Method Initialise
Editor::Initialise() in classEditor.php
Set some particular values to the ones from the array.
Method IsCreate
Editor::IsCreate() in classEditor.php
Method IsSubmit
Editor::IsSubmit() in classEditor.php
Method IsUpdate
Editor::IsUpdate() in classEditor.php
Method Initialise
DBRecord::Initialise() in DataUpdate.php
This will read the record from the database if it's available, and the $keys parameter is a non-empty array.
Method iCalComponent
A basic constructor
Class iCalComponent
iCalComponent in iCalendar.php
A Class for representing components within an iCalendar
Method iCalendar
iCalendar::iCalendar() in iCalendar.php
Class iCalendar
iCalendar in iCalendar.php
A Class for handling Events on a calendar (DEPRECATED)
Page iCalendar.php
iCalendar.php in iCalendar.php
Method iCalFooter
iCalendar::iCalFooter() in iCalendar.php
Method iCalHeader
iCalendar::iCalHeader() in iCalendar.php
Method iCalProp
iCalProp::iCalProp() in iCalendar.php
The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when iCalComponent::ParseFrom() called iCalComponent::UnwrapComponent().
Class iCalProp
iCalProp in iCalendar.php
A Class for representing properties within an iCalendar
Method IsAttendee
Return true if the person identified by the email address is down as an attendee or organizer for this meeting.
Method IsOrganizer
Return true if the person identified by the email address is down as an organizer for this meeting.
Method IsActive
MenuOption::IsActive() in MenuSet.php
Whether this option is currently active.
Function i18n
i18n() in Translation.php
Mark a string as being internationalized. This is a semaphore method; it does nothing but it allows us to easily identify strings that require translation. Generally this is used to mark strings that will be stored in the database (like descriptions of permissions).
Function init_gettext
init_gettext() in Translation.php
Initialise our use of Gettext
j
Variable $Joins
Browser::$Joins in classBrowser.php
Variable $Joins
Editor::$Joins in classEditor.php
Method JustThisBitPlease
A function to extract the contents of a BEGIN:SOMETHING to END:SOMETHING (perhaps multiply) and return just that bit (or, of course, those bits :-)
Variable $just_logged_in
Whether the user logged in to view the current page. Perhaps some details on the login form might pollute an editable form and result in an unplanned submit. This can be used to program around such a problem.
l
Variable $location
AwlQuery::$location in AwlQuery.php
Where we called this query from so we can find it in our code! Debugging may also be selectively enabled for a $location.
Variable $Limit
Browser::$Limit in classBrowser.php
Variable $Limit
Editor::$Limit in classEditor.php
Variable $LookupSql
EditorField::$LookupSql in classEditor.php
Method Layout
Editor::Layout() in classEditor.php
Method LinkActiveSubMenus
Mark each MenuOption as active that has an active sub-menu entry.
Variable $last_session_end
The date and time that the user requested their last page during their last session.
Variable $last_session_start
The date and time that the user logged on during their last session.
Variable $logged_in
Session::$logged_in in Session.php
Whether this user has actually logged in.
Method Log
Session::Log() in Session.php
DEPRECATED Utility function to log stuff with printf expansion.
Method Login
Session::Login() in Session.php
Attempt to perform a login action.
Method LoginRequired
Checks that this user is logged in, and presents a login screen if they aren't.
Method LSIDLogin
Session::LSIDLogin() in Session.php
Attempts to logs in using a long-term session ID
m
Class Multipart
Multipart in Multipart.php
Page Multipart.php
Multipart.php in Multipart.php
Variable $match_column
Browser::$match_column in classBrowser.php
Variable $match_function
Browser::$match_function in classBrowser.php
Variable $match_value
Browser::$match_value in classBrowser.php
Method MatchedRow
Browser::MatchedRow() in classBrowser.php
Replace a row where $column = $value with an extra arbitrary row, returned from calling $function
Method MoreWhere
Browser::MoreWhere() in classBrowser.php
Add an [operator] ... to the SQL Where clause
Method MoreWhere
Editor::MoreWhere() in classEditor.php
Method MultiEntryLine
A utility function for a data entry line, where the prompt is a drop-down.
Method MaskComponents
Mask components, removing any that are not of the types in the list
Method MaskComponents
Method MaskProperties
Mask properties, removing any that are not in the list
Method MakeSomethingActive
Mark each MenuOption as active that has an active sub-menu entry.
Method MaybeActive
Whether this option is currently active.
Method MenuOption
The thing we click
Class MenuOption
MenuOption in MenuSet.php
Each menu option is an object.
Method MenuSet
MenuSet::MenuSet() in MenuSet.php
Start a new MenuSet with no options.
Class MenuSet
MenuSet in MenuSet.php
A MenuSet is a hierarchy of MenuOptions, some of which might be MenuSet objects themselves.
Page MenuSet.php
MenuSet.php in MenuSet.php
Method MaskComponents
Mask components, removing any that are not of the types in the list
Method MaskProperties
Mask properties, removing any that are not in the list
n
Variable $NewWhere
Editor::$NewWhere in classEditor.php
Method new_lookup
EntryField::new_lookup() in DataEntry.php
Function called indirectly when a new EntryField of type 'lookup' is created.
Method NoHelp
EntryForm::NoHelp() in DataEntry.php
Set the line format to have no help display
Method Name
iCalProp::Name() in iCalendar.php
Get/Set name property
Method not_empty
Validation::not_empty() in Validation.php
Checks if a string is empty
Variable $name
vProperty::$name in vComponent.php
The name of this property
Method Name
vProperty::Name() in vComponent.php
Get/Set name property
Variable $ns_caldav
XMLDocument::$ns_caldav in XMLDocument.php
Variable $ns_calendarserver
Variable $ns_carddav
XMLDocument::$ns_carddav in XMLDocument.php
Variable $ns_dav
XMLDocument::$ns_dav in XMLDocument.php
Method NewElement
XMLElement::NewElement() in XMLElement.php
Add a new sub-element
o
Variable $Offset
Browser::$Offset in classBrowser.php
Variable $Order
Browser::$Order in classBrowser.php
Variable $OrderBrowserKey
Browser::$OrderBrowserKey in classBrowser.php
Variable $OrderDirection
Browser::$OrderDirection in classBrowser.php
Variable $OrderField
Browser::$OrderField in classBrowser.php
Method OrWhere
Browser::OrWhere() in classBrowser.php
Add an OR ... to the SQL Where clause
Variable $OptionList
EditorField::$OptionList in classEditor.php
Variable $Order
Editor::$Order in classEditor.php
Variable $OrderedFields
Editor::$OrderedFields in classEditor.php
Method OrWhere
Editor::OrWhere() in classEditor.php
Function olson_from_tzstring
olson_from_tzstring() in AWLUtilities.php
Try and extract something like "Pacific/Auckland" or "America/Indiana/Indianapolis" if possible.
p
Method Parameters
AwlQuery::Parameters() in AwlQuery.php
Return the parameters we are planning to substitute into the query string
Method prepare
AwlDatabase::prepare() in AwlDatabase.php
Returns a PDOStatement object created using this database, the supplied SQL string, and any parameters given.
Method Prepare
AwlQuery::Prepare() in AwlQuery.php
Tell the database to prepare the query that we will execute
Method PrepareTranslated
Operates identically to AwlDatabase::Prepare, except that $this->Translate() will be called on the query before any processing.
Method PostToValues
Editor::PostToValues() in classEditor.php
This will assign $_POST values to the internal Values object for each field that exists in the Fields array.
Method PopulateForm
EntryForm::PopulateForm() in DataEntry.php
Initialise some more of the forms fields, possibly with a prefix
Method PostToValues
DBRecord::PostToValues() in DataUpdate.php
This will assign $_POST values to the internal Values object for each field that exists in the Fields array.
Method Pretend
EMail::Pretend() in EMail.php
Don't actually send the email, just output it directly in the stream(!). We use this method when we're doing regression testing.
Method PretendLog
EMail::PretendLog() in EMail.php
Don't actually send the email, just log it.
Method Parameters
iCalProp::Parameters() in iCalendar.php
Get/Set parameters in their entirety
Method ParseFrom
Parse the text $content into sets of iCalProp & iCalComponent within this iCalComponent
Method ParseFrom
iCalProp::ParseFrom() in iCalendar.php
The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when iCalComponent::ParseFrom() called iCalComponent::UnwrapComponent().
Method ParseSomeLines
Function to parse lines from BEGIN:SOMETHING to END:SOMETHING into a nested array structure
Class PgQuery
PgQuery in PgQuery.php
The PgQuery Class.
Page PgQuery.php
PgQuery.php in PgQuery.php
Method Plain
PgQuery::Plain() in PgQuery.php
Convert a string which has already been quoted and escaped for PostgreSQL into a magic array so that it will be inserted unmodified into the SQL string. Use with care!
Function param_to_global
param_to_global() in AWLUtilities.php
Convert a parameter to a global. We first look in _POST and then in _GET, and if they passed in a bunch of valid characters, we will make sure the incoming is cleaned to only match that set.
Method positive_dollars
Check that the given string is a positive dollar amount.
Method positive_integer
Check that the given string is a positive integer.
Variable $parameters
vProperty::$parameters in vComponent.php
An array of parameters to this property, represented as key/value pairs.
Variable $properties
vComponent::$properties in vComponent.php
An array of properties, which are vProperty objects
Method Parameters
vProperty::Parameters() in vComponent.php
Get/Set parameters in their entirety
Method ParseFrom
vProperty::ParseFrom() in vComponent.php
The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when vComponent::ParseFrom() called vComponent::UnwrapComponent().
Method ParseFrom
vComponent::ParseFrom() in vComponent.php
Parse the text $content into sets of vProperty & vComponent within this vComponent
q
Variable $querystring
AwlQuery::$querystring in AwlQuery.php
The original query string
Variable $query_time_warning
How long the query should take before a warning is issued.
Method QDo
AwlQuery::QDo() in AwlQuery.php
Simple QDo() class which will re-use this query for whatever was passed in, and execute it returning the result of the Exec() call. We can't call it Do() since that's a reserved word...
Method query
AwlDatabase::query() in AwlDatabase.php
Returns a PDOStatement object created using this database, the supplied SQL string, and any parameters given.
Method QueryString
AwlQuery::QueryString() in AwlQuery.php
Return the query string we are planning to execute
Method quote
AwlQuery::quote() in AwlQuery.php
Quote the given string so it can be safely used within string delimiters in a query. To be avoided, in general.
Method Quote
AwlDBDialect::Quote() in AwlDBDialect.php
Returns $value escaped in an appropriate way for this database dialect.
Variable $Query
Browser::$Query in classBrowser.php
Variable $Query
Editor::$Query in classEditor.php
Variable $query_time_warning
How long the query should take before a warning is issued.
Function qpg
qpg() in PgQuery.php
Quote the given string (depending on its type) so that it can be used safely in a PostgreSQL query without fear of SQL injection errors.
Method quote
PgQuery::quote() in PgQuery.php
Quote the given string so it can be safely used within string delimiters in a query.
Function quoted_printable_encode
quoted_printable_encode() in AWLUtilities.php
Process a string to fit the requirements of RFC2045 section 6.7. Note that this works, but replaces more characters than the minimum set. For readability the spaces aren't encoded as =20 though.
r
Method releaseLock
AwlCache::releaseLock() in AwlCache.php
Release a lock
Method render
SinglePart::render() in Multipart.php
Variable $result
AwlQuery::$result in AwlQuery.php
Result of the last execution
Variable $rownum
AwlQuery::$rownum in AwlQuery.php
number of current row - use accessor to get/set
Variable $rows
AwlQuery::$rows in AwlQuery.php
number of rows from pg_numrows - use accessor to get value
Method ReplaceNamedParameters
Replaces named query parameters of the form :name with appropriately escaped substitutions.
Method ReplaceParameters
Replaces query parameters with appropriately escaped substitutions.
Method Rollback
AwlDatabase::Rollback() in AwlDatabase.php
Cancel a transaction in progress.
Method Rollback
AwlQuery::Rollback() in AwlQuery.php
Wrap the parent DB class Rollback() so we can $qry->Rollback() sometime after we $qry->Exec()
Method rownum
AwlQuery::rownum() in AwlQuery.php
Return the current rownum in the retrieved set
Method rows
AwlQuery::rows() in AwlQuery.php
Return the count of rows retrieved/affected
Method Render
Browser::Render() in classBrowser.php
This method is used to render the browser as HTML. If the query has not yet been executed then this will call DoQuery to do so.
Method RenderHeader
BrowserColumn::RenderHeader() in classBrowser.php
RenderHeader
Method RenderValue
BrowserColumn::RenderValue() in classBrowser.php
Method RowFormat
Browser::RowFormat() in classBrowser.php
Set the format for an output row.
Variable $Record
Editor::$Record in classEditor.php
Variable $RecordAvailable
Editor::$RecordAvailable in classEditor.php
Method Render
Editor::Render() in classEditor.php
Render the templated component. The heavy lifting is done by the callback...
Method RenderAttributes
Method RenderLabel
EditorField::RenderLabel() in classEditor.php
Method ReplaceEditorPart
Editor::ReplaceEditorPart() in classEditor.php
Replace parts into the form template.
Variable $rendered
EntryField::$rendered in DataEntry.php
Once it actually is...
Method Render
EntryField::Render() in DataEntry.php
Render an EntryField into HTML
Method RevertLineFormat
Revert the line format to what was in place before the last TempLineFormat call.
Method Read
DBRecord::Read() in DataUpdate.php
To read the record from the database.
Method Render
iCalProp::Render() in iCalendar.php
Render a suitably escaped RFC2445 content string.
Method Render
iCalComponent::Render() in iCalendar.php
Renders the component, possibly restricted to only the listed properties
Method Render
iCalendar::Render() in iCalendar.php
Method RenderParameters
Render the set of parameters as key1=value1[;key2=value2[; ...]] with any colons or semicolons escaped.
Method RFC2445ContentEscape
Method RFC2445ContentUnescape
Returns a content string with the RFC2445 escaping removed
Variable $rendered
MenuOption::$rendered in MenuSet.php
The rendered HTML fragment (once it has been).
Method Render
MenuSet::Render() in MenuSet.php
Render the menu tree to an HTML fragment.
Method Render
MenuOption::Render() in MenuSet.php
Convert the menu option into an HTML string
Method RenderAsCSS
MenuSet::RenderAsCSS() in MenuSet.php
Render the menu tree to an HTML fragment.
Variable $rows
PgQuery::$rows in PgQuery.php
number of rows from pg_numrows - for fetching result
Method rows
PgQuery::rows() in PgQuery.php
Provide a rows() method for forward compatibility with AwlQuery.
Method RenderLoginPanel
Renders some HTML for a basic login panel
Method Render
User::Render() in User.php
Render the form / viewer as HTML to show the user
Method RenderFields
Render the core details to show to the user
Method RenderRoles
Render the user's administrative roles
Function replace_uri_params
replace_uri_params() in AWLUtilities.php
Given a URL (presumably the current one) and a parameter, replace the value of parameter, extending the URL as necessary if the parameter is not already there.
Method RenderJavascript
Returns the javascript for form validation using the rules.
Variable $rendered
vProperty::$rendered in vComponent.php
The original value that this was parsed from, if that's the way it happened.
Variable $rendered
vComponent::$rendered in vComponent.php
The rendered result (or what was originally parsed, if there have been no changes)
Method Render
vProperty::Render() in vComponent.php
Render a suitably escaped RFC2445 content string.
Method Render
vComponent::Render() in vComponent.php
Renders the component, possibly restricted to only the listed properties
Method RenderParameters
Render the set of parameters as key1=value1[;key2=value2[; ...]] with any colons or semicolons escaped.
Method Render
XMLElement::Render() in XMLElement.php
Render the document tree into (nicely formatted) XML
Method RenderContent
XMLElement::RenderContent() in XMLElement.php
Render just the internal content
s
Method set
AwlCache::set() in AwlCache.php
Set a value for the specified namespace/key, perhaps with an expiry (default 10 days)
Class SinglePart
SinglePart in Multipart.php
Variable $sth
AwlQuery::$sth in AwlQuery.php
The PDO statement handle, or null if we don't have one yet.
Method SetConnection
Use a different database connection for this query
Method SetSearchPath
AwlDBDialect::SetSearchPath() in AwlDBDialect.php
Sets the current search path for the database.
Method SetSql
AwlQuery::SetSql() in AwlQuery.php
Simple SetSql() class which will reset the object with the querystring from the first argument.
Variable $Sql
BrowserColumn::$Sql in classBrowser.php
Variable $SubTitle
Browser::$SubTitle in classBrowser.php
Method SetDistinct
Browser::SetDistinct() in classBrowser.php
Set the SQL DISTINCT clause to a specific value.
Method SetDiv
Browser::SetDiv() in classBrowser.php
Set a div for wrapping the browse.
Method SetJoins
Browser::SetJoins() in classBrowser.php
Set the tables and joins for the SQL.
Method SetLimit
Browser::SetLimit() in classBrowser.php
Set the SQL LIMIT clause to a specific value.
Method SetOffset
Browser::SetOffset() in classBrowser.php
Set the SQL OFFSET clause to a specific value.
Method SetOrdering
Browser::SetOrdering() in classBrowser.php
Set up the ordering for the browser. Generally you should call this with the first parameter set as a field to order by default. Call with the second parameter set to 'D' or 'DESCEND' if you want to reverse the default order.
Method SetSubTitle
Browser::SetSubTitle() in classBrowser.php
Set a Sub Title for the browse.
Method SetTitle
Browser::SetTitle() in classBrowser.php
Set the Title for the browse.
Method SetTranslatable
Method SetTranslatable
Browser::SetTranslatable() in classBrowser.php
Set the named columns to be translatable
Method SetUnion
Browser::SetUnion() in classBrowser.php
Set a Union SQL statement.
Method SetWhere
Browser::SetWhere() in classBrowser.php
Set the SQL Where clause to a specific value.
Variable $Sql
EditorField::$Sql in classEditor.php
Variable $SubmitName
Editor::$SubmitName in classEditor.php
Method Set
EditorField::Set() in classEditor.php
Method SetBaseTable
Editor::SetBaseTable() in classEditor.php
Method SetJoins
Editor::SetJoins() in classEditor.php
Method SetLookup
Editor::SetLookup() in classEditor.php
Method SetLookup
EditorField::SetLookup() in classEditor.php
Method SetOptionList
Editor::SetOptionList() in classEditor.php
Method SetOptionList
EditorField::SetOptionList() in classEditor.php
Method SetRecord
Editor::SetRecord() in classEditor.php
Method SetSql
Editor::SetSql() in classEditor.php
Method SetSql
EditorField::SetSql() in classEditor.php
Method SetSubmitName
Editor::SetSubmitName() in classEditor.php
Method SetTemplate
Editor::SetTemplate() in classEditor.php
Method SetWhere
Editor::SetWhere() in classEditor.php
Method SimpleForm
EntryForm::SimpleForm() in DataEntry.php
Set the line format to an extremely simple CSS based prompt / field layout.
Method StartForm
EntryForm::StartForm() in DataEntry.php
Start the actual HTML form. Return the fragment to do this.
Method SubmitButton
EntryForm::SubmitButton() in DataEntry.php
A utility function for a submit button within a data entry table
Method Set
DBRecord::Set() in DataUpdate.php
Sets a single field in the record
Function sql_from_object
sql_from_object() in DataUpdate.php
Build SQL INSERT/UPDATE statement from an associative array of fieldnames => values.
Function sql_from_post
sql_from_post() in DataUpdate.php
Build SQL INSERT/UPDATE statement from the $_POST associative array
Method Send
EMail::Send() in EMail.php
Actually send the email
Method SetBody
EMail::SetBody() in EMail.php
Set the body of the e-mail.
Method SetFrom
EMail::SetFrom() in EMail.php
Set the visible From address for the e-mail.
Method SetSender
EMail::SetSender() in EMail.php
Set the envelope sender address for the e-mail.
Method SetSubject
EMail::SetSubject() in EMail.php
Set the subject line for the email
Method SaveTimeZones
Method Set
iCalendar::Set() in iCalendar.php
Set the value of a property
Method SetComponents
Sets some or all sub-components of the component to the supplied new components
Method SetComponents
Method SetParameterValue
Set the value of a parameter
Method SetProperties
Set all properties, or the ones matching a particular type
Method SetType
iCalComponent::SetType() in iCalendar.php
Set the type of component which this is
Method SqlDateFormat
Method SqlDurationFormat
Method SqlUTCFormat
iCalendar::SqlUTCFormat() in iCalendar.php
Variable $self
MenuOption::$self in MenuSet.php
A reference to this menu option itself
Method Set
MenuOption::Set() in MenuSet.php
Set arbitrary attributes of the menu option
Method Size
MenuSet::Size() in MenuSet.php
Find out how many options the menu has.
Method SetConnection
Use a different database connection for this query
Global $session The session object is global.
Variable $session_id
Session::$session_id in Session.php
A unique id for this user's logged-in session.
Method SendTemporaryPassword
Sends a temporary password in response to a request from a user.
Method Session
Session::Session() in Session.php
Create a new Session object.
Class Session
Session in Session.php
A class for creating and holding session information.
Page Session.php
Session.php in Session.php
Function session_salted_md5
session_salted_md5() in AWLUtilities.php
Make a salted MD5 string, given a string and (possibly) a salt.
Function session_salted_sha1
session_salted_sha1() in AWLUtilities.php
Make a salted SHA1 string, given a string and (possibly) a salt. PHP5 only (although it could be made to work on PHP4 (@see http://www.openldap.org/faq/data/cache/347.html). The algorithm used here is compatible with OpenLDAP so passwords generated through this function should be able to be migrated to OpenLDAP by using the part following the second '*', i.e.
Function session_simple_md5
session_simple_md5() in AWLUtilities.php
Make a plain MD5 hash of a string, identifying the type of hash it is
Function session_validate_password
session_validate_password() in AWLUtilities.php
Checks what a user entered against the actual password on their account.
Method selected
Validation::selected() in Validation.php
Checks that a string is not empty or zero
Method SetUID
vCalendar::SetUID() in vCalendar.php
Set the UID on the primary component.
Method StartFilter
vCalendar::StartFilter() in vCalendar.php
Test a PROP-FILTER or COMP-FILTER and return a true/false COMP-FILTER (is-defined | is-not-defined | (time-range?, prop-filter*, comp-filter*)) PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*))
Method SetComponents
vComponent::SetComponents() in vComponent.php
Sets some or all sub-components of the component to the supplied new components
Method SetParameterValue
Set the value of a parameter
Method SetProperties
vComponent::SetProperties() in vComponent.php
Set all properties, or the ones matching a particular type
Method SetType
vComponent::SetType() in vComponent.php
Set the type of component which this is
Method SetAttribute
XMLElement::SetAttribute() in XMLElement.php
Set an element attribute to a value
Method SetContent
XMLElement::SetContent() in XMLElement.php
Set the whole content to a value
t
Variable $translate_all
AwlDatabase::$translate_all in AwlDatabase.php
Holds whether we are translating all statements.
Variable $txnstate
AwlDatabase::$txnstate in AwlDatabase.php
Holds the state of the transaction 0 = not started, 1 = in progress, -1 = error pending rollback/commit
Method TransactionState
Returns the current state of a transaction, indicating if we have begun a transaction, whether the transaction has failed, or if we are not in a transaction.
Method TransactionState
Returns the current state of a transaction, indicating if we have begun a transaction, whether the transaction has failed, or if we are not in a transaction.
Method TranslateAll
AwlDatabase::TranslateAll() in AwlDatabase.php
Switches on or off the processing flag controlling whether subsequent calls to AwlDatabase::Prepare are translated as if PrepareTranslated() had been called.
Method TranslateSQL
AwlDBDialect::TranslateSQL() in AwlDBDialect.php
Translates the given SQL string into a form that will hopefully work for this database dialect. This hook is intended to be used by developers to provide support for differences in database operation by translating the query string in an arbitrary way, such as through a file or database lookup.
Variable $Title
Browser::$Title in classBrowser.php
Variable $TotalFuncs
Browser::$TotalFuncs in classBrowser.php
Variable $Totals
Browser::$Totals in classBrowser.php
Variable $Translatable
BrowserColumn::$Translatable in classBrowser.php
Variable $Type
BrowserColumn::$Type in classBrowser.php
Method Title
Browser::Title() in classBrowser.php
Accessor for the Title for the browse, which could set the title also.
Variable $Template
Editor::$Template in classEditor.php
Variable $Title
Editor::$Title in classEditor.php
Method Title
Editor::Title() in classEditor.php
Accessor for the Title for the browse, which could set the title also.
Method TempLineFormat
Set the line format to a temporary one that we can revert from.
Method TestFilter
iCalendar::TestFilter() in iCalendar.php
Method TextMatch
iCalProp::TextMatch() in iCalendar.php
Test if our value contains a string
Function translate
translate() in Translation.php
Convert a string in English to whatever this user's locale is
Page Translation.php
Translation.php in Translation.php
Function trace_bug
trace_bug() in AWLUtilities.php
Not as sever as a fatal() call, but we want to log and trace it
Variable $type
vComponent::$type in vComponent.php
The type of this component, such as 'VEVENT', 'VTODO', 'VTIMEZONE', 'VCARD', etc.
Method TestFilter
vProperty::TestFilter() in vComponent.php
Test a PROP-FILTER or PARAM-FILTER and return a true/false PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*)) PARAM-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*))
Method TestFilter
vComponent::TestFilter() in vComponent.php
Test a PROP-FILTER or COMP-FILTER and return a true/false COMP-FILTER (is-defined | is-not-defined | (time-range?, prop-filter*, comp-filter*)) PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*))
Method TestParamFilter
Method TextMatch
vProperty::TextMatch() in vComponent.php
Test if our value contains a string
Variable $tagname
XMLElement::$tagname in XMLElement.php
u
Variable $Union
Browser::$Union in classBrowser.php
Method Undefine
DBRecord::Undefine() in DataUpdate.php
Unsets a single field from the record
Method UnwrapComponent
This unescapes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We accept either case.
Method UnFetch
PgQuery::UnFetch() in PgQuery.php
Set row counter back one
Variable $username
Session::$username in Session.php
The user's username used to log in.
Variable $user_no
Session::$user_no in Session.php
The user_no of the logged in user.
Method User
User::User() in User.php
The constructor initialises a new record, potentially reading it from the database.
Class User
User in User.php
A class to handle reading, writing, viewing, editing and validating usr records.
Page User.php
User.php in User.php
Function uuid
uuid() in AWLUtilities.php
Generates a Universally Unique IDentifier, version 4.
Method UpdateAttendeeStatus
Update the attendees of this VEVENT/VTODO
Method UpdateOrganizerStatus
Update the ORGANIZER of this VEVENT/VTODO
Method UnwrapComponent
This unescapes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We accept either case.
v
Method ValueReplacement
Browser::ValueReplacement() in classBrowser.php
Return values from the current row for replacing into a template.
Variable $Value
EditorField::$Value in classEditor.php
Method Value
Editor::Value() in classEditor.php
Gets the value of a field in the record currently assigned to this editor.
Method Value
iCalProp::Value() in iCalendar.php
Get/Set the content of the property
Method VCalendar
Apply standard properties for a VCalendar
Method Validate
User::Validate() in User.php
Validate the information the user submitted
Method Validate
Validation::Validate() in Validation.php
Validates the form according to it's rules.
Method Validation
Validation::Validation() in Validation.php
Initialise a new validation.
Class Validation
Validation in Validation.php
Rules used for validation of form fields.
Page Validation.php
Validation.php in Validation.php
Method valid_date_format
Check that the given string matches the user's date format.
Method valid_email_format
Check that the given string is a valid email address.
Class vCalendar
vCalendar in vCalendar.php
A Class for representing components within an vComponent
Page vCalendar.php
vCalendar.php in vCalendar.php
Method Value
vProperty::Value() in vComponent.php
Get/Set the content of the property
Class vComponent
vComponent in vComponent.php
A Class for representing components within an vComponent
Page vComponent.php
vComponent.php in vComponent.php
Class vProperty
vProperty in vComponent.php
A Class for representing properties within a vComponent (VCALENDAR or VCARD)
w
Variable $Where
Browser::$Where in classBrowser.php
Variable $Where
Editor::$Where in classEditor.php
Method WhereNewRecord
Editor::WhereNewRecord() in classEditor.php
Method Write
Editor::Write() in classEditor.php
Write the record
Method Write
DBRecord::Write() in DataUpdate.php
To write the record to the database
Method WrapComponent
This imposes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We output RFC2445 compliance.
Method Write
User::Write() in User.php
Write the User record.
Method WriteRoles
User::WriteRoles() in User.php
Write the roles associated with the user
Method WrapComponent
vComponent::WrapComponent() in vComponent.php
This imposes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We output RFC2445 compliance.
x
Class XMLDocument
XMLDocument in XMLDocument.php
A class for XML Documents which will contain namespaced XML elements
Page XMLDocument.php
XMLDocument.php in XMLDocument.php
Variable $xmlns
XMLElement::$xmlns in XMLElement.php
Class XMLElement
XMLElement in XMLElement.php
A class for XML elements which may have attributes, or contain other XML sub-elements
Page XMLElement.php
XMLElement.php in XMLElement.php
a b c d e f g h i j l m n o p q r s t u v w x _
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 awl-0.53.orig/docs/api/errors.html0000644000000000000000000003173111774765551014003 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 phpDocumentor Parser Errors and Warnings Post-parsing
AwlCache.php
AwlDatabase.php
AwlDBDialect.php
AwlQuery.php
AwlUpgrader.php
AWLUtilities.php
classBrowser.php
classEditor.php
DataEntry.php
DataUpdate.php
EMail.php
iCalendar.php
MenuSet.php
Multipart.php
PgQuery.php
Session.php
Translation.php
User.php
Validation.php
vCalendar.php
vComponent.php
XMLDocument.php
XMLElement.php

Post-parsing

Warnings:


Warning - duplicate define element "E_USER_ERROR" in file /home/karora/projects/awl/inc/AwlDatabase.php will be ignored. Use an @ignore tag on the original if you want this case to be documented.

AuthPlugins.php

Warnings:


Warning on line 27 - Page-level DocBlock precedes "require_once 'AWLUtilities.php'", use another DocBlock to document the source element

Errors:


Error on line 87 - DocBlock has multiple @package tags, illegal. ignoring additional tag "@package awl"
Error on line 107 - DocBlock has multiple @package tags, illegal. ignoring additional tag "@package awl"

AwlCache.php

Warnings:


Warning on line 9 - no @package tag was used in a DocBlock for class AwlCache
Warning on line 172 - File "/home/karora/projects/awl/inc/AwlCache.php" has no page-level DocBlock, use @package in the first DocBlock to create one

AwlDatabase.php

Warnings:


Warning on line 36 - Page-level DocBlock precedes "require_once 'AwlDBDialect.php'", use another DocBlock to document the source element
Warning on line 36 - Unknown tag "@compatibility" used

AwlDBDialect.php

Warnings:


Warning on line 17 - Page-level DocBlock precedes "define E_USER_ERROR", use another DocBlock to document the source element
Warning on line 17 - Unknown tag "@compatibility" used

AwlQuery.php

Warnings:


Warning on line 10 - Page-level DocBlock precedes "require_once 'AwlDatabase.php'", use another DocBlock to document the source element
Warning on line 10 - Unknown tag "@compatibility" used

AwlUpgrader.php

Warnings:


Warning on line 10 - Unknown tag "@compatibility" used
Warning on line 10 - Page-level DocBlock precedes "require_once 'AwlQuery.php'", use another DocBlock to document the source element

classBrowser.php

Warnings:


Warning on line 16 - Page-level DocBlock precedes "require_once "AWLUtilities.php"", use another DocBlock to document the source element

classEditor.php

Warnings:


Warning on line 11 - Page-level DocBlock precedes "require_once "DataUpdate.php"", use another DocBlock to document the source element

DataEntry.php

Warnings:


Warning on line 10 - Page-level DocBlock precedes "require_once "AWLUtilities.php"", use another DocBlock to document the source element

DataUpdate.php

Warnings:


Warning on line 14 - Page-level DocBlock precedes "require_once 'AWLUtilities.php'", use another DocBlock to document the source element

EMail.php

Warnings:


Warning on line 10 - Page-level DocBlock precedes "require_once "AWLUtilities.php"", use another DocBlock to document the source element

iCalendar.php

Warnings:


Warning on line 48 - Page-level DocBlock precedes "require_once 'XMLElement.php'", use another DocBlock to document the source element
Warning on line 48 - example file "To render it as an iCalendar string: echo $ical->Render();" does not exist
Warning on line 48 - example file "To clear any 'VALARM' components in an iCalendar object $ical->component->ClearComponents('VALARM');" does not exist
Warning on line 48 - example file "To parse an existing iCalendar string for manipulation: $ical = new iCalendar( array('icalendar' => $icalendar_text ) );" does not exist
Warning on line 48 - example file "To render just the VEVENTs in the iCalendar with a restricted list of properties: echo $ical->Render( false, 'VEVENT', array( 'DTSTART', 'DURATION', 'DTEND', 'RRULE', 'SUMMARY') );" does not exist
Warning on line 48 - example file "To create a new iCalendar from several data values: $ical = new iCalendar( array('DTSTART' => $dtstart, 'SUMMARY' => $summary, 'DURATION' => $duration ) );" does not exist
Warning on line 48 - example file "To replace any 'RRULE' property in an iCalendar object $ical->component->SetProperties( 'RRULE', $rrule_definition );" does not exist
Warning on line 842 - Unknown tag "@note" used
Warning on line 941 - Unknown tag "@DEPRECATED:" used
Warning on line 1015 - Unknown tag "@DEPRECATED:" used
Warning on line 1075 - Unknown tag "@DEPRECATED:" used
Warning on line 1094 - Unknown tag "@DEPRECATED:" used
Warning on line 1128 - Unknown tag "@DEPRECATED:" used
Warning on line 1199 - Unknown tag "@DEPRECATED:" used
Warning on line 1236 - Unknown tag "@DEPRECATED:" used
Warning on line 1253 - Unknown tag "@DEPRECATED:" used
Warning on line 1307 - Unknown tag "@DEPRECATED:" used
Warning on line 1328 - Unknown tag "@DEPRECATED:" used
Warning on line 1350 - Unknown tag "@DEPRECATED:" used
Warning on line 1375 - Unknown tag "@DEPRECATED:" used
Warning on line 1386 - Unknown tag "@DEPRECATED:" used
Warning on line 1399 - Unknown tag "@DEPRECATED:" used
Warning on line 1411 - Unknown tag "@DEPRECATED:" used
Warning on line 1422 - Unknown tag "@DEPRECATED:" used
Warning on line 1433 - Unknown tag "@DEPRECATED:" used
Warning on line 1442 - Unknown tag "@DEPRECATED:" used
Warning on line 1452 - Unknown tag "@DEPRECATED:" used
Warning on line 1462 - Unknown tag "@DEPRECATED:" used
Warning on line 1476 - Unknown tag "@DEPRECATED:" used
Warning on line 1511 - Unknown tag "@DEPRECATED:" used
Warning on line 1547 - Unknown tag "@DEPRECATED:" used
Warning on line 1579 - Unknown tag "@DEPRECATED:" used
Warning on line 1655 - Unknown tag "@DEPRECATED:" used
Warning on line 1682 - Unknown tag "@DEPRECATED:" used
Warning on line 1700 - Unknown tag "@DEPRECATED:" used
Warning on line 1714 - Unknown tag "@DEPRECATED:" used

Errors:


Error on line 1094 - DocBlock has multiple @var tags, illegal. ignoring additional tag "@var integer The number of SOMETHINGS we want to get."

MenuSet.php

Warnings:


Warning on line 14 - Page-level DocBlock precedes "require_once "AWLUtilities.php"", use another DocBlock to document the source element

Multipart.php

Warnings:


Warning on line 4 - no @package tag was used in a DocBlock for class SinglePart
Warning on line 37 - no @package tag was used in a DocBlock for class Multipart
Warning on line 75 - File "/home/karora/projects/awl/inc/Multipart.php" has no page-level DocBlock, use @package in the first DocBlock to create one

PgQuery.php

Warnings:


Warning on line 55 - Page-level DocBlock precedes "require_once "AWLUtilities.php"", use another DocBlock to document the source element

Session.php

Warnings:


Warning on line 24 - Page-level DocBlock precedes "require_once 'AWLUtilities.php'", use another DocBlock to document the source element

Translation.php

Warnings:


Warning on line 74 - duplicate function element "translate" in file /home/karora/projects/awl/inc/Translation.php will be ignored. Use an @ignore tag on the original if you want this case to be documented.

User.php

Warnings:


Warning on line 10 - Page-level DocBlock precedes "require_once "AWLUtilities.php"", use another DocBlock to document the source element

Validation.php

Warnings:


Warning on line 10 - Page-level DocBlock precedes "require_once "AWLUtilities.php"", use another DocBlock to document the source element

vCalendar.php

Warnings:


Warning on line 20 - Page-level DocBlock precedes "require_once 'vComponent.php'", use another DocBlock to document the source element
Warning on line 22 - no @package tag was used in a DocBlock for class vCalendar

Errors:


Error on line 33 - DocBlock has multiple @var tags, illegal. ignoring additional tag "@var array "
Error on line 33 - DocBlock has multiple @var tags, illegal. ignoring additional tag "@var vComponent "
Error on line 33 - DocBlock has multiple @var tags, illegal. ignoring additional tag "@var array "
Error on line 33 - DocBlock has multiple @var tags, illegal. ignoring additional tag "@var string "

vComponent.php

Warnings:


Warning on line 15 - Page-level DocBlock precedes "require_once 'XMLElement.php'", use another DocBlock to document the source element
Warning on line 888 - Unknown tag "@note" used

XMLDocument.php

Warnings:


Warning on line 12 - Page-level DocBlock precedes "require_once "XMLElement.php"", use another DocBlock to document the source element
Warning on line 329 - docblock template never terminated with /**#@-*/

XMLElement.php

Warnings:


Warning on line 11 - Page-level DocBlock precedes "require_once 'AWLUtilities.php'", use another DocBlock to document the source element

AWLUtilities.php

Errors:


Error on line 26 - DocBlock has multiple @var tags, illegal. ignoring additional tag "@var string A format string for the log message"
Error on line 26 - DocBlock has multiple @var tags, illegal. ignoring additional tag "@var [string ...] Parameters for the format string."
Error on line 150 - DocBlock has multiple @var tags, illegal. ignoring additional tag "@var boolean Should the dump recurse into arrays/objects in the array"
Error on line 150 - DocBlock has multiple @var tags, illegal. ignoring additional tag "@var array The array to be dumped."
Error on line 150 - DocBlock has multiple @var tags, illegal. ignoring additional tag "@var string What name should this array dump identify itself as"

Documentation generated on Wed, 04 Jul 2012 07:06:17 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/li_awl.html0000644000000000000000000012246211774765543013741 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

awl

Generated by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/elementindex.html0000644000000000000000000075545211774765543015166 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Full index

Package indexes


Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
a b c d e f g h i j l m n o p q r s t u v w x _
a
Variable $Action
Editor::$Action in classEditor.php
Variable $Align
BrowserColumn::$Align in classBrowser.php
Variable $Attributes
EditorField::$Attributes in classEditor.php
Variable $attributes
EntryField::$attributes in DataEntry.php
An array of key value pairs
Variable $attributes
XMLElement::$attributes in XMLElement.php
Method acquireLock
AwlCache::acquireLock() in AwlCache.php
Acquire a lock on something
Method Active
MenuOption::Active() in MenuSet.php
Mark it as active, with a fancy style to distinguish that
Method Add
iCalendar::Add() in iCalendar.php
Method AddAttribute
EditorField::AddAttribute() in classEditor.php
Method AddAttribute
Editor::AddAttribute() in classEditor.php
Method AddBcc
EMail::AddBcc() in EMail.php
Add another Bcc recipient to the email
Method AddCc
EMail::AddCc() in EMail.php
Add another Cc recipient to the email
Method AddColumn
Browser::AddColumn() in classBrowser.php
Add a column to the Browser.
Method AddComponent
iCalendar::AddComponent() in iCalendar.php
Method AddComponent
Adds a new subcomponent
Method AddComponent
vComponent::AddComponent() in vComponent.php
Adds a new subcomponent
Method AddErrorsTo
Add another Error recipient to the email
Method AddField
Editor::AddField() in classEditor.php
Method AddGrouping
Browser::AddGrouping() in classBrowser.php
Method AddHidden
Browser::AddHidden() in classBrowser.php
Add a hidden column - one that is present in the SQL result, but for which there is no column displayed.
Method AddOption
MenuSet::AddOption() in MenuSet.php
Add an option, which is a link.
Method AddOrder
Browser::AddOrder() in classBrowser.php
Add an ordering to the browser widget.
Method addPart
Multipart::addPart() in Multipart.php
Method AddProperty
vComponent::AddProperty() in vComponent.php
Adds a new property
Method AddProperty
Adds a new property
Method AddReplyTo
EMail::AddReplyTo() in EMail.php
Add another Reply-to address to the email
Method AddRow
Browser::AddRow() in classBrowser.php
Add an extra arbitrary row onto the end of the browser.
Method AddRule
Validation::AddRule() in Validation.php
Adds a validation rule for a specific field upon submission of the form.
Method AddSubmenu
This menu option is now promoted to the head of a tree
Method AddSubMenu
MenuSet::AddSubMenu() in MenuSet.php
Add an option, which is a submenu
Method AddSubTag
XMLElement::AddSubTag() in XMLElement.php
Add a sub-element
Method AddTable
DBRecord::AddTable() in DataUpdate.php
This will join an additional table to the maintained set
Method AddTimeZone
vCalendar::AddTimeZone() in vCalendar.php
Add a timezone component to this vCalendar.
Method AddTo
EMail::AddTo() in EMail.php
Add another recipient to the email
Method AddTotal
Browser::AddTotal() in classBrowser.php
Mark a column as something to be totalled. You can also specify the name of a function which may modify the value before the actual totalling.
Method AllowedTo
Session::AllowedTo() in Session.php
Checks whether a user is allowed to do something.
Method AllowedTo
User::AllowedTo() in User.php
Can the user do this?
Method AndWhere
Editor::AndWhere() in classEditor.php
Method AndWhere
Browser::AndWhere() in classBrowser.php
Add an OR ... to the SQL Where clause
Method ApplyFilter
iCalendar::ApplyFilter() in iCalendar.php
Method Assign
Editor::Assign() in classEditor.php
Assigns the value of a field in the record currently associated with this editor.
Method AssignSessionDetails
Internal function used to assign the session details to a user's new session.
Method Authenticate
AuthPlugin::Authenticate() in AuthPlugin.php
Authenticate. Do whatever we need to authenticate a username / password.
Class AuthPlugin
AuthPlugin in AuthPlugin.php
A class for authenticating and retrieving user information
Method AuthPlugin
AuthPlugin::AuthPlugin() in AuthPlugin.php
Create a new AuthPlugin object. This is as lightweight as possible.
Page AuthPlugin.php
AuthPlugin.php in AuthPlugin.php
Page AuthPlugins.php
AuthPlugins.php in AuthPlugins.php
Function auth_external
auth_external() in AuthPlugins.php
Authentication has already happened. We know the username, we just need to do the authorisation / access control. The password is ignored.
Function auth_other_awl
auth_other_awl() in AuthPlugins.php
Authenticate against a different PostgreSQL database which contains a usr table in the AWL format.
Method Available
Editor::Available() in classEditor.php
Class AwlCache
AwlCache in AwlCache.php
A simple Memcached wrapper supporting namespacing of stored values.
Page AwlCache.php
AwlCache.php in AwlCache.php
Class AwlDatabase
AwlDatabase in AwlDatabase.php
Typically there will only be a single instance of the database level class in an application.
Page AwlDatabase.php
AwlDatabase.php in AwlDatabase.php
Class AwlDBDialect
AwlDBDialect in AwlDBDialect.php
The AwlDBDialect class handles support for different SQL dialects
Page AwlDBDialect.php
AwlDBDialect.php in AwlDBDialect.php
Class AwlQuery
AwlQuery in AwlQuery.php
The AwlQuery Class.
Page AwlQuery.php
AwlQuery.php in AwlQuery.php
Class AwlUpgrader
AwlUpgrader in AwlUpgrader.php
The AwlUpgrader Class.
Page AwlUpgrader.php
AwlUpgrader.php in AwlUpgrader.php
Page AWLUtilities.php
AWLUtilities.php in AWLUtilities.php
Function awl_replace_sql_args
awl_replace_sql_args() in PgQuery.php
Replaces PostgreSQL query with escaped parameters in preparation for execution.
Function awl_set_locale
awl_set_locale() in Translation.php
Set the translation to the user's locale. At this stage all we do is call the gettext function.
Function awl_version
awl_version() in AWLUtilities.php
Return the AWL version
b
Variable $BaseTable
Editor::$BaseTable in classEditor.php
Variable $BeginRow
Browser::$BeginRow in classBrowser.php
Variable $BeginRowArgs
Browser::$BeginRowArgs in classBrowser.php
Variable $bound_parameters
The current array of bound parameters
Variable $bound_querystring
The actual query string, after we've replaced parameters in it
Method Begin
AwlQuery::Begin() in AwlQuery.php
Wrap the parent DB class Begin() so we can $qry->Begin() sometime before we $qry->Exec()
Method Begin
AwlDatabase::Begin() in AwlDatabase.php
Begin a transaction.
Method Bind
AwlQuery::Bind() in AwlQuery.php
Bind some parameters. This can be called in three ways:
Method BreakLine
EntryForm::BreakLine() in DataEntry.php
A utility function for a heading line within a data entry table
Method Browser
Browser::Browser() in classBrowser.php
The Browser class constructor
Class Browser
Browser in classBrowser.php
Start a new Browser, add columns, set a join and Render it to create a basic list of records in a table.
Class BrowserColumn
BrowserColumn in classBrowser.php
BrowserColumns are the basic building blocks. You can specify just the field name, and the column header or you can get fancy and specify an alignment, format string, SQL formula and cell CSS class.
Method BrowserColumn
BrowserColumn::BrowserColumn() in classBrowser.php
BrowserColumn constructor. Only the first parameter is mandatory.
Method BuildConfirmationHash
Build a hash which we can use for confirmation that we didn't get e-mailed a bogus link by someone, and that we actually got here by traversing the website.
Method BuildFromText
Build the iCalendar object from a text string which is a single iCalendar resource
Method BuildOptionList
Build an option list from the query.
Method BuildOptionList
Build an option list from the query.
Function BuildXMLTree
BuildXMLTree() in XMLElement.php
Rebuild an XML tree in our own style from the parsed XML tags using a tail-recursive approach.
c
Variable $Class
BrowserColumn::$Class in classBrowser.php
Variable $CloseRow
Browser::$CloseRow in classBrowser.php
Variable $Columns
Browser::$Columns in classBrowser.php
Variable $components
vComponent::$components in vComponent.php
An array of (sub-)components, which are vComponent objects
Variable $connection
AwlQuery::$connection in AwlQuery.php
Our database connection, normally copied from a global one
Variable $content
XMLElement::$content in XMLElement.php
Variable $content
vProperty::$content in vComponent.php
The value of this property.
Variable $crlf
SinglePart::$crlf in Multipart.php
Variable $current
EntryField::$current in DataEntry.php
The current value
Variable $current_row
BrowserColumn::$current_row in classBrowser.php
Method CheckConfirmationHash
Check a hash which we created through BuildConfirmationHash
Function check_by_regex
check_by_regex() in AWLUtilities.php
Verify a value is OK by testing a regex against it. If it is an array apply it to each element in the array recursively. If it is an object we don't mess with it.
Function check_temporary_passwords
Checks what a user entered against any currently valid temporary passwords on their account.
Page classBrowser.php
classBrowser.php in classBrowser.php
Page classEditor.php
classEditor.php in classEditor.php
Function clean_string
clean_string() in PgQuery.php
Clean a string of many suspicious characters
Method ClearComponents
Clear all components, or the components matching a particular type
Method ClearComponents
Method ClearComponents
Clear all components, or the components matching a particular type
Method ClearProperties
Clear all properties, or the properties matching a particular type
Method ClearProperties
Clear all properties, or the properties matching a particular type
Method CloneConfidential
Clone this component (and subcomponents) into a confidential version of it. A confidential event will be scrubbed of any identifying characteristics other than time/date, repeat, uid and a summary which is just a translated 'Busy'.
Method CollectParameterValues
Collect an array of all parameters of our properties which are the specified type
Method CollectParameterValues
Collect an array of all parameters of our properties which are the specified type
Method Commit
AwlQuery::Commit() in AwlQuery.php
Wrap the parent DB class Commit() so we can $qry->Commit() sometime after we $qry->Exec()
Method Commit
AwlDatabase::Commit() in AwlDatabase.php
Complete a transaction.
Method ComponentCount
Return number of components
Method Confidential
vCalendar::Confidential() in vCalendar.php
Morph this component (and subcomponents) into a confidential version of it. A confidential event will be scrubbed of any identifying characteristics other than time/date, repeat, uid and a summary which is just a translated 'Busy'.
Function connect_configured_database
Connect to the database defined in the $c->dbconn[] array
Method CountElements
XMLElement::CountElements() in XMLElement.php
Count the number of elements
d
Variable $db
AwlDBDialect::$db in AwlDBDialect.php
Holds the PDO database connection
Global $dbconn The database connection.
Variable $dialect
AwlDBDialect::$dialect in AwlDBDialect.php
Holds the name of the database dialect
Variable $Distinct
Browser::$Distinct in classBrowser.php
Variable $DivClose
Browser::$DivClose in classBrowser.php
Variable $DivOpen
Browser::$DivOpen in classBrowser.php
Page DataEntry.php
DataEntry.php in DataEntry.php
Method DataEntryField
A utility function for a data entry line within a table
Method DataEntryLine
A utility function for a data entry line within a table
Page DataUpdate.php
DataUpdate.php in DataUpdate.php
Method Dbg
Session::Dbg() in Session.php
DEPRECATED Utility function to log debug stuff with printf expansion, and the ability to enable it selectively.
Function dbg_error_log
dbg_error_log() in AWLUtilities.php
Writes a debug message into the error log using printf syntax. If the first parameter is "ERROR" then the message will _always_ be logged.
Function dbg_log_array
dbg_log_array() in AWLUtilities.php
Function to dump an array to the error log, possibly recursively
Method DBRecord
DBRecord::DBRecord() in DataUpdate.php
Really numbingly simple construction.
Class DBRecord
DBRecord in DataUpdate.php
A Base class to use for records which will be read/written from the database.
Method DealWithTimeZones
Do what must be done with time zones from on file. Attempt to turn them into something that PostgreSQL can understand...
Method DefaultPropertyList
An array of property names that we should always want when rendering an iCalendar
Function define_byte_mappings
define_byte_mappings() in AWLUtilities.php
Method delete
AwlCache::delete() in AwlCache.php
Delete a value from a namespace/key, or for everything in a namespace if a 'null' key is supplied.
Function deprecated
deprecated() in AWLUtilities.php
Method DoQuery
Browser::DoQuery() in classBrowser.php
This method is used to build and execute the database query.
Function duration
duration() in PgQuery.php
A duration (in decimal seconds) between two times which are the result of calls to microtime()
e
Variable $EditMode
DBRecord::$EditMode in DataUpdate.php
The mode we are in for any form
Variable $email
Session::$email in Session.php
The user's email address from their usr record.
Variable $errorstring
PgQuery::$errorstring in PgQuery.php
The PostgreSQL error message, if the query fails.
Variable $error_info
AwlQuery::$error_info in AwlQuery.php
The Database error information, if the query fails.
Variable $execution_time
Stores the query execution time - used to deal with long queries.
Variable $execution_time
Stores the query execution time - used to deal with long queries.
Variable $ExtraRows
Browser::$ExtraRows in classBrowser.php
Class Editor
Editor in classEditor.php
The class for the Editor form in full
Class EditorField
EditorField in classEditor.php
A class for the fields in the editor
Class EMail
EMail in EMail.php
Lightweight class for sending an e-mail.
Page EMail.php
EMail.php in EMail.php
Method EmailTemporaryPassword
E-mails a temporary password in response to a request from a user.
Method EndForm
EntryForm::EndForm() in DataEntry.php
Return the HTML fragment to end the form.
Class EntryField
EntryField in DataEntry.php
Individual fields used for data entry / viewing.
Method EntryField
EntryField::EntryField() in DataEntry.php
Initialise an EntryField, used for data entry.
Class EntryForm
EntryForm in DataEntry.php
A class to handle displaying a form on the page (for editing) or a structured layout of non-editable content (for viewing), with a simple switch to flip from view mode to edit mode.
Method EntryForm
EntryForm::EntryForm() in DataEntry.php
Initialise a new data-entry form.
Method ErrorInfo
AwlDatabase::ErrorInfo() in AwlDatabase.php
Method Exec
AwlQuery::Exec() in AwlQuery.php
Execute the query, logging any debugging.
Method Exec
PgQuery::Exec() in PgQuery.php
Execute the query, logging any debugging.
Method Execute
AwlQuery::Execute() in AwlQuery.php
Tell the database to execute the query
Method ExtractProperty
Method ExtractSubComponent
Constant E_USER_ERROR
E_USER_ERROR in AwlDBDialect.php
f
Variable $Field
EditorField::$Field in classEditor.php
Variable $Field
BrowserColumn::$Field in classBrowser.php
Variable $FieldNames
Browser::$FieldNames in classBrowser.php
Variable $Fields
Editor::$Fields in classEditor.php
Variable $ForcedOrder
Browser::$ForcedOrder in classBrowser.php
Variable $Format
BrowserColumn::$Format in classBrowser.php
Variable $fullname
Session::$fullname in Session.php
The user's full name from their usr record.
Function fatal
fatal() in AWLUtilities.php
Method Fetch
PgQuery::Fetch() in PgQuery.php
Fetch the next row from the query results
Method Fetch
AwlQuery::Fetch() in AwlQuery.php
Fetch the next row from the query results
Method FetchBackwards
Fetch backwards from the result resource
Method FirstNonTimezone
Get all sub-components, or at least get those matching a type
Method flush
AwlCache::flush() in AwlCache.php
Flush the entire cache
Method ForceOrder
Browser::ForceOrder() in classBrowser.php
Force a particular ordering onto the browser widget.
Function force_utf8
force_utf8() in AWLUtilities.php
Method FormattedDate
Function to reformat an ISO date to something nicer and possibly more localised
g
Variable $Grouping
Browser::$Grouping in classBrowser.php
Method Get
iCalendar::Get() in iCalendar.php
Get the value of a property in the first non-VTIMEZONE
Method Get
DBRecord::Get() in DataUpdate.php
Returns a single field from the record
Method get
AwlCache::get() in AwlCache.php
get a value from the specified namespace / key
Method GetAttendees
vCalendar::GetAttendees() in vCalendar.php
Get the attendees of this VEVENT/VTODO
Method GetAttribute
XMLElement::GetAttribute() in XMLElement.php
Accessor for a single attribute
Method GetAttributes
XMLElement::GetAttributes() in XMLElement.php
Accessor for the attributes
Function getCacheInstance
getCacheInstance() in AwlCache.php
Method GetComponents
Method GetComponents
vComponent::GetComponents() in vComponent.php
Get all sub-components, or at least get those matching a type, or failling to match, should the second parameter be set to false. Component types may be a string or an array associating property names with true values: array( 'TYPE' => true, 'TYPE2' => true )
Method GetComponents
Get all sub-components, or at least get those matching a type, or failling to match, should the second parameter be set to false.
Method GetConnection
Get the current database connection for this query
Method GetContent
XMLElement::GetContent() in XMLElement.php
Accessor for the content
Method GetElements
XMLElement::GetElements() in XMLElement.php
Return an array of elements matching the specified tag, or all elements if no tag is supplied.
Method GetFields
AwlDBDialect::GetFields() in AwlDBDialect.php
Returns the SQL for the current database dialect which will return a two-column resultset containing a list of fields and their associated data types.
Method GetItip
vCalendar::GetItip() in vCalendar.php
Clone this component (and subcomponents) into a minimal iTIP version of it.
Method getMimeHeaders
Method getMimeParts
Multipart::getMimeParts() in Multipart.php
Method GetNSTag
XMLElement::GetNSTag() in XMLElement.php
Accessor for the full-namespaced tag name
Method GetOlsonName
vCalendar::GetOlsonName() in vCalendar.php
Work out what Olson timezone this VTIMEZONE really is. Perhaps we should put this into a vTimezone class.
Method GetOrganizer
vCalendar::GetOrganizer() in vCalendar.php
Get the organizer of this VEVENT/VTODO
Method GetParameterValue
Get the value of a parameter
Method GetParameterValue
Get the value of a parameter
Method GetPath
XMLElement::GetPath() in XMLElement.php
Return an array of elements matching the specified path
Method GetPParamValue
Get the value of the specified parameter for the first property matching the name. Obviously this isn't so useful for properties which may occur multiply, but most don't.
Method GetProperties
vComponent::GetProperties() in vComponent.php
Get all properties, or the properties matching a particular type, or matching an
Method GetProperties
Get all properties, or the properties matching a particular type
Method GetPropertiesByPath
Return an array of properties matching the specified path
Method GetPropertiesByPath
Return an array of properties matching the specified path
Method GetProperty
vComponent::GetProperty() in vComponent.php
Return the first instance of a property of this name
Method GetPValue
vComponent::GetPValue() in vComponent.php
Return the value of the first instance of a property of this name, or null
Method GetPValue
Get the value of the first property matching the name. Obviously this isn't so useful for properties which may occur multiply, but most don't.
Method GetRecord
Editor::GetRecord() in classEditor.php
Method GetRoles
User::GetRoles() in User.php
Get the group memberships for the user
Method GetRoles
Session::GetRoles() in Session.php
Internal function used to get the user's roles from the database.
Method GetScheduleAgent
Get the schedule-agent from the organizer
Method GetTag
XMLElement::GetTag() in XMLElement.php
Accessor for the tag name
Method GetTarget
EditorField::GetTarget() in classEditor.php
Method GetTarget
BrowserColumn::GetTarget() in classBrowser.php
GetTarget
Method GetTimeZone
vCalendar::GetTimeZone() in vCalendar.php
Get a timezone component for a specific TZID in this calendar.
Method GetTotal
Browser::GetTotal() in classBrowser.php
Retrieve the total from a totalled column
Method GetType
iCalComponent::GetType() in iCalendar.php
Return the type of component which this is
Method GetType
vComponent::GetType() in vComponent.php
Return the type of component which this is
Method GetUID
vCalendar::GetUID() in vCalendar.php
Get the UID from the primary component.
Method GetVersion
AwlDBDialect::GetVersion() in AwlDBDialect.php
Sets the current search path for the database.
Function get_fields
get_fields() in AWLUtilities.php
Get the names of the fields for a particular table
Function gzdecode
gzdecode() in AWLUtilities.php
h
Variable $Header
BrowserColumn::$Header in classBrowser.php
Variable $HiddenColumns
Browser::$HiddenColumns in classBrowser.php
Variable $Hook
BrowserColumn::$Hook in classBrowser.php
Method HelpInCell
EntryForm::HelpInCell() in DataEntry.php
Set the line format to have help displayed in it's own separate cell
Method HelpInLine
EntryForm::HelpInLine() in DataEntry.php
Set the line format to have help displayed in the same cell as the entry field.
Method HiddenField
EntryForm::HiddenField() in DataEntry.php
A utility function for a hidden field within a data entry table
Method HttpDateFormat
i
Variable $Id
Editor::$Id in classEditor.php
Function i18n
i18n() in Translation.php
Mark a string as being internationalized. This is a semaphore method; it does nothing but it allows us to easily identify strings that require translation. Generally this is used to mark strings that will be stored in the database (like descriptions of permissions).
Class iCalComponent
iCalComponent in iCalendar.php
A Class for representing components within an iCalendar
Method iCalComponent
A basic constructor
Method iCalendar
iCalendar::iCalendar() in iCalendar.php
Class iCalendar
iCalendar in iCalendar.php
A Class for handling Events on a calendar (DEPRECATED)
Page iCalendar.php
iCalendar.php in iCalendar.php
Method iCalFooter
iCalendar::iCalFooter() in iCalendar.php
Method iCalHeader
iCalendar::iCalHeader() in iCalendar.php
Class iCalProp
iCalProp in iCalendar.php
A Class for representing properties within an iCalendar
Method iCalProp
iCalProp::iCalProp() in iCalendar.php
The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when iCalComponent::ParseFrom() called iCalComponent::UnwrapComponent().
Method Id
Editor::Id() in classEditor.php
Sets or returns the form ID used for differentiating this form from others in the page.
Method Initialise
Editor::Initialise() in classEditor.php
Set some particular values to the ones from the array.
Method Initialise
DBRecord::Initialise() in DataUpdate.php
This will read the record from the database if it's available, and the $keys parameter is a non-empty array.
Function init_gettext
init_gettext() in Translation.php
Initialise our use of Gettext
Method isActive
AwlCache::isActive() in AwlCache.php
So we can find out if we are actually using the cache.
Method IsActive
MenuOption::IsActive() in MenuSet.php
Whether this option is currently active.
Method IsAttendee
Return true if the person identified by the email address is down as an attendee or organizer for this meeting.
Method IsCreate
Editor::IsCreate() in classEditor.php
Method IsOrganizer
Return true if the person identified by the email address is down as an organizer for this meeting.
Method IsSubmit
Editor::IsSubmit() in classEditor.php
Method IsUpdate
Editor::IsUpdate() in classEditor.php
j
Variable $Joins
Browser::$Joins in classBrowser.php
Variable $Joins
Editor::$Joins in classEditor.php
Variable $just_logged_in
Whether the user logged in to view the current page. Perhaps some details on the login form might pollute an editable form and result in an unplanned submit. This can be used to program around such a problem.
Method JustThisBitPlease
A function to extract the contents of a BEGIN:SOMETHING to END:SOMETHING (perhaps multiply) and return just that bit (or, of course, those bits :-)
l
Variable $last_session_end
The date and time that the user requested their last page during their last session.
Variable $last_session_start
The date and time that the user logged on during their last session.
Variable $Limit
Editor::$Limit in classEditor.php
Variable $Limit
Browser::$Limit in classBrowser.php
Variable $location
AwlQuery::$location in AwlQuery.php
Where we called this query from so we can find it in our code! Debugging may also be selectively enabled for a $location.
Variable $logged_in
Session::$logged_in in Session.php
Whether this user has actually logged in.
Variable $LookupSql
EditorField::$LookupSql in classEditor.php
Method Layout
Editor::Layout() in classEditor.php
Method LinkActiveSubMenus
Mark each MenuOption as active that has an active sub-menu entry.
Method Log
Session::Log() in Session.php
DEPRECATED Utility function to log stuff with printf expansion.
Method Login
Session::Login() in Session.php
Attempt to perform a login action.
Method LoginRequired
Checks that this user is logged in, and presents a login screen if they aren't.
Method LSIDLogin
Session::LSIDLogin() in Session.php
Attempts to logs in using a long-term session ID
m
Variable $match_column
Browser::$match_column in classBrowser.php
Variable $match_function
Browser::$match_function in classBrowser.php
Variable $match_value
Browser::$match_value in classBrowser.php
Method MakeSomethingActive
Mark each MenuOption as active that has an active sub-menu entry.
Method MaskComponents
Method MaskComponents
Mask components, removing any that are not of the types in the list
Method MaskComponents
Mask components, removing any that are not of the types in the list
Method MaskProperties
Mask properties, removing any that are not in the list
Method MaskProperties
Mask properties, removing any that are not in the list
Method MatchedRow
Browser::MatchedRow() in classBrowser.php
Replace a row where $column = $value with an extra arbitrary row, returned from calling $function
Method MaybeActive
Whether this option is currently active.
Method MenuOption
The thing we click
Class MenuOption
MenuOption in MenuSet.php
Each menu option is an object.
Class MenuSet
MenuSet in MenuSet.php
A MenuSet is a hierarchy of MenuOptions, some of which might be MenuSet objects themselves.
Method MenuSet
MenuSet::MenuSet() in MenuSet.php
Start a new MenuSet with no options.
Page MenuSet.php
MenuSet.php in MenuSet.php
Method MoreWhere
Editor::MoreWhere() in classEditor.php
Method MoreWhere
Browser::MoreWhere() in classBrowser.php
Add an [operator] ... to the SQL Where clause
Method MultiEntryLine
A utility function for a data entry line, where the prompt is a drop-down.
Class Multipart
Multipart in Multipart.php
Page Multipart.php
Multipart.php in Multipart.php
n
Variable $name
vProperty::$name in vComponent.php
The name of this property
Variable $NewWhere
Editor::$NewWhere in classEditor.php
Variable $ns_caldav
XMLDocument::$ns_caldav in XMLDocument.php
Variable $ns_calendarserver
Variable $ns_carddav
XMLDocument::$ns_carddav in XMLDocument.php
Variable $ns_dav
XMLDocument::$ns_dav in XMLDocument.php
Method Name
vProperty::Name() in vComponent.php
Get/Set name property
Method Name
iCalProp::Name() in iCalendar.php
Get/Set name property
Method NewElement
XMLElement::NewElement() in XMLElement.php
Add a new sub-element
Method new_lookup
EntryField::new_lookup() in DataEntry.php
Function called indirectly when a new EntryField of type 'lookup' is created.
Method NoHelp
EntryForm::NoHelp() in DataEntry.php
Set the line format to have no help display
Method not_empty
Validation::not_empty() in Validation.php
Checks if a string is empty
o
Variable $Offset
Browser::$Offset in classBrowser.php
Variable $OptionList
EditorField::$OptionList in classEditor.php
Variable $Order
Editor::$Order in classEditor.php
Variable $Order
Browser::$Order in classBrowser.php
Variable $OrderBrowserKey
Browser::$OrderBrowserKey in classBrowser.php
Variable $OrderDirection
Browser::$OrderDirection in classBrowser.php
Variable $OrderedFields
Editor::$OrderedFields in classEditor.php
Variable $OrderField
Browser::$OrderField in classBrowser.php
Function olson_from_tzstring
olson_from_tzstring() in AWLUtilities.php
Try and extract something like "Pacific/Auckland" or "America/Indiana/Indianapolis" if possible.
Method OrWhere
Editor::OrWhere() in classEditor.php
Method OrWhere
Browser::OrWhere() in classBrowser.php
Add an OR ... to the SQL Where clause
p
Variable $parameters
vProperty::$parameters in vComponent.php
An array of parameters to this property, represented as key/value pairs.
Variable $properties
vComponent::$properties in vComponent.php
An array of properties, which are vProperty objects
Method Parameters
vProperty::Parameters() in vComponent.php
Get/Set parameters in their entirety
Method Parameters
AwlQuery::Parameters() in AwlQuery.php
Return the parameters we are planning to substitute into the query string
Method Parameters
iCalProp::Parameters() in iCalendar.php
Get/Set parameters in their entirety
Function param_to_global
param_to_global() in AWLUtilities.php
Convert a parameter to a global. We first look in _POST and then in _GET, and if they passed in a bunch of valid characters, we will make sure the incoming is cleaned to only match that set.
Method ParseFrom
vProperty::ParseFrom() in vComponent.php
The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when vComponent::ParseFrom() called vComponent::UnwrapComponent().
Method ParseFrom
iCalProp::ParseFrom() in iCalendar.php
The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when iCalComponent::ParseFrom() called iCalComponent::UnwrapComponent().
Method ParseFrom
Parse the text $content into sets of iCalProp & iCalComponent within this iCalComponent
Method ParseFrom
vComponent::ParseFrom() in vComponent.php
Parse the text $content into sets of vProperty & vComponent within this vComponent
Method ParseSomeLines
Function to parse lines from BEGIN:SOMETHING to END:SOMETHING into a nested array structure
Class PgQuery
PgQuery in PgQuery.php
The PgQuery Class.
Page PgQuery.php
PgQuery.php in PgQuery.php
Method Plain
PgQuery::Plain() in PgQuery.php
Convert a string which has already been quoted and escaped for PostgreSQL into a magic array so that it will be inserted unmodified into the SQL string. Use with care!
Method PopulateForm
EntryForm::PopulateForm() in DataEntry.php
Initialise some more of the forms fields, possibly with a prefix
Method positive_dollars
Check that the given string is a positive dollar amount.
Method positive_integer
Check that the given string is a positive integer.
Method PostToValues
Editor::PostToValues() in classEditor.php
This will assign $_POST values to the internal Values object for each field that exists in the Fields array.
Method PostToValues
DBRecord::PostToValues() in DataUpdate.php
This will assign $_POST values to the internal Values object for each field that exists in the Fields array.
Method Prepare
AwlQuery::Prepare() in AwlQuery.php
Tell the database to prepare the query that we will execute
Method prepare
AwlDatabase::prepare() in AwlDatabase.php
Returns a PDOStatement object created using this database, the supplied SQL string, and any parameters given.
Method PrepareTranslated
Operates identically to AwlDatabase::Prepare, except that $this->Translate() will be called on the query before any processing.
Method Pretend
EMail::Pretend() in EMail.php
Don't actually send the email, just output it directly in the stream(!). We use this method when we're doing regression testing.
Method PretendLog
EMail::PretendLog() in EMail.php
Don't actually send the email, just log it.
q
Variable $Query
Editor::$Query in classEditor.php
Variable $Query
Browser::$Query in classBrowser.php
Variable $querystring
AwlQuery::$querystring in AwlQuery.php
The original query string
Variable $query_time_warning
How long the query should take before a warning is issued.
Variable $query_time_warning
How long the query should take before a warning is issued.
Method QDo
AwlQuery::QDo() in AwlQuery.php
Simple QDo() class which will re-use this query for whatever was passed in, and execute it returning the result of the Exec() call. We can't call it Do() since that's a reserved word...
Function qpg
qpg() in PgQuery.php
Quote the given string (depending on its type) so that it can be used safely in a PostgreSQL query without fear of SQL injection errors.
Method query
AwlDatabase::query() in AwlDatabase.php
Returns a PDOStatement object created using this database, the supplied SQL string, and any parameters given.
Method QueryString
AwlQuery::QueryString() in AwlQuery.php
Return the query string we are planning to execute
Method quote
PgQuery::quote() in PgQuery.php
Quote the given string so it can be safely used within string delimiters in a query.
Method quote
AwlQuery::quote() in AwlQuery.php
Quote the given string so it can be safely used within string delimiters in a query. To be avoided, in general.
Method Quote
AwlDBDialect::Quote() in AwlDBDialect.php
Returns $value escaped in an appropriate way for this database dialect.
Function quoted_printable_encode
quoted_printable_encode() in AWLUtilities.php
Process a string to fit the requirements of RFC2045 section 6.7. Note that this works, but replaces more characters than the minimum set. For readability the spaces aren't encoded as =20 though.
r
Variable $Record
Editor::$Record in classEditor.php
Variable $RecordAvailable
Editor::$RecordAvailable in classEditor.php
Variable $rendered
MenuOption::$rendered in MenuSet.php
The rendered HTML fragment (once it has been).
Variable $rendered
vProperty::$rendered in vComponent.php
The original value that this was parsed from, if that's the way it happened.
Variable $rendered
EntryField::$rendered in DataEntry.php
Once it actually is...
Variable $rendered
vComponent::$rendered in vComponent.php
The rendered result (or what was originally parsed, if there have been no changes)
Variable $result
AwlQuery::$result in AwlQuery.php
Result of the last execution
Variable $rownum
AwlQuery::$rownum in AwlQuery.php
number of current row - use accessor to get/set
Variable $rows
AwlQuery::$rows in AwlQuery.php
number of rows from pg_numrows - use accessor to get value
Variable $rows
PgQuery::$rows in PgQuery.php
number of rows from pg_numrows - for fetching result
Method Read
DBRecord::Read() in DataUpdate.php
To read the record from the database.
Method releaseLock
AwlCache::releaseLock() in AwlCache.php
Release a lock
Method Render
MenuSet::Render() in MenuSet.php
Render the menu tree to an HTML fragment.
Method render
SinglePart::render() in Multipart.php
Method Render
EntryField::Render() in DataEntry.php
Render an EntryField into HTML
Method Render
MenuOption::Render() in MenuSet.php
Convert the menu option into an HTML string
Method Render
iCalProp::Render() in iCalendar.php
Render a suitably escaped RFC2445 content string.
Method Render
iCalComponent::Render() in iCalendar.php
Renders the component, possibly restricted to only the listed properties
Method Render
iCalendar::Render() in iCalendar.php
Method Render
User::Render() in User.php
Render the form / viewer as HTML to show the user
Method Render
Editor::Render() in classEditor.php
Render the templated component. The heavy lifting is done by the callback...
Method Render
vProperty::Render() in vComponent.php
Render a suitably escaped RFC2445 content string.
Method Render
XMLElement::Render() in XMLElement.php
Render the document tree into (nicely formatted) XML
Method Render
vComponent::Render() in vComponent.php
Renders the component, possibly restricted to only the listed properties
Method Render
Browser::Render() in classBrowser.php
This method is used to render the browser as HTML. If the query has not yet been executed then this will call DoQuery to do so.
Method RenderAsCSS
MenuSet::RenderAsCSS() in MenuSet.php
Render the menu tree to an HTML fragment.
Method RenderAttributes
Method RenderContent
XMLElement::RenderContent() in XMLElement.php
Render just the internal content
Method RenderFields
Render the core details to show to the user
Method RenderHeader
BrowserColumn::RenderHeader() in classBrowser.php
RenderHeader
Method RenderJavascript
Returns the javascript for form validation using the rules.
Method RenderLabel
EditorField::RenderLabel() in classEditor.php
Method RenderLoginPanel
Renders some HTML for a basic login panel
Method RenderParameters
Render the set of parameters as key1=value1[;key2=value2[; ...]] with any colons or semicolons escaped.
Method RenderParameters
Render the set of parameters as key1=value1[;key2=value2[; ...]] with any colons or semicolons escaped.
Method RenderRoles
Render the user's administrative roles
Method RenderValue
BrowserColumn::RenderValue() in classBrowser.php
Method ReplaceEditorPart
Editor::ReplaceEditorPart() in classEditor.php
Replace parts into the form template.
Method ReplaceNamedParameters
Replaces named query parameters of the form :name with appropriately escaped substitutions.
Method ReplaceParameters
Replaces query parameters with appropriately escaped substitutions.
Function replace_uri_params
replace_uri_params() in AWLUtilities.php
Given a URL (presumably the current one) and a parameter, replace the value of parameter, extending the URL as necessary if the parameter is not already there.
Method RevertLineFormat
Revert the line format to what was in place before the last TempLineFormat call.
Method RFC2445ContentEscape
Method RFC2445ContentUnescape
Returns a content string with the RFC2445 escaping removed
Method Rollback
AwlDatabase::Rollback() in AwlDatabase.php
Cancel a transaction in progress.
Method Rollback
AwlQuery::Rollback() in AwlQuery.php
Wrap the parent DB class Rollback() so we can $qry->Rollback() sometime after we $qry->Exec()
Method RowFormat
Browser::RowFormat() in classBrowser.php
Set the format for an output row.
Method rownum
AwlQuery::rownum() in AwlQuery.php
Return the current rownum in the retrieved set
Method rows
PgQuery::rows() in PgQuery.php
Provide a rows() method for forward compatibility with AwlQuery.
Method rows
AwlQuery::rows() in AwlQuery.php
Return the count of rows retrieved/affected
s
Variable $self
MenuOption::$self in MenuSet.php
A reference to this menu option itself
Global $session The session object is global.
Variable $session_id
Session::$session_id in Session.php
A unique id for this user's logged-in session.
Variable $Sql
BrowserColumn::$Sql in classBrowser.php
Variable $Sql
EditorField::$Sql in classEditor.php
Variable $sth
AwlQuery::$sth in AwlQuery.php
The PDO statement handle, or null if we don't have one yet.
Variable $SubmitName
Editor::$SubmitName in classEditor.php
Variable $SubTitle
Browser::$SubTitle in classBrowser.php
Method SaveTimeZones
Method selected
Validation::selected() in Validation.php
Checks that a string is not empty or zero
Method Send
EMail::Send() in EMail.php
Actually send the email
Method SendTemporaryPassword
Sends a temporary password in response to a request from a user.
Method Session
Session::Session() in Session.php
Create a new Session object.
Class Session
Session in Session.php
A class for creating and holding session information.
Page Session.php
Session.php in Session.php
Function session_salted_md5
session_salted_md5() in AWLUtilities.php
Make a salted MD5 string, given a string and (possibly) a salt.
Function session_salted_sha1
session_salted_sha1() in AWLUtilities.php
Make a salted SHA1 string, given a string and (possibly) a salt. PHP5 only (although it could be made to work on PHP4 (@see http://www.openldap.org/faq/data/cache/347.html). The algorithm used here is compatible with OpenLDAP so passwords generated through this function should be able to be migrated to OpenLDAP by using the part following the second '*', i.e.
Function session_simple_md5
session_simple_md5() in AWLUtilities.php
Make a plain MD5 hash of a string, identifying the type of hash it is
Function session_validate_password
session_validate_password() in AWLUtilities.php
Checks what a user entered against the actual password on their account.
Method Set
DBRecord::Set() in DataUpdate.php
Sets a single field in the record
Method Set
MenuOption::Set() in MenuSet.php
Set arbitrary attributes of the menu option
Method Set
EditorField::Set() in classEditor.php
Method Set
iCalendar::Set() in iCalendar.php
Set the value of a property
Method set
AwlCache::set() in AwlCache.php
Set a value for the specified namespace/key, perhaps with an expiry (default 10 days)
Method SetAttribute
XMLElement::SetAttribute() in XMLElement.php
Set an element attribute to a value
Method SetBaseTable
Editor::SetBaseTable() in classEditor.php
Method SetBody
EMail::SetBody() in EMail.php
Set the body of the e-mail.
Method SetComponents
Method SetComponents
vComponent::SetComponents() in vComponent.php
Sets some or all sub-components of the component to the supplied new components
Method SetComponents
Sets some or all sub-components of the component to the supplied new components
Method SetConnection
Use a different database connection for this query
Method SetConnection
Use a different database connection for this query
Method SetContent
XMLElement::SetContent() in XMLElement.php
Set the whole content to a value
Method SetDistinct
Browser::SetDistinct() in classBrowser.php
Set the SQL DISTINCT clause to a specific value.
Method SetDiv
Browser::SetDiv() in classBrowser.php
Set a div for wrapping the browse.
Method SetFrom
EMail::SetFrom() in EMail.php
Set the visible From address for the e-mail.
Method SetJoins
Editor::SetJoins() in classEditor.php
Method SetJoins
Browser::SetJoins() in classBrowser.php
Set the tables and joins for the SQL.
Method SetLimit
Browser::SetLimit() in classBrowser.php
Set the SQL LIMIT clause to a specific value.
Method SetLookup
EditorField::SetLookup() in classEditor.php
Method SetLookup
Editor::SetLookup() in classEditor.php
Method SetOffset
Browser::SetOffset() in classBrowser.php
Set the SQL OFFSET clause to a specific value.
Method SetOptionList
EditorField::SetOptionList() in classEditor.php
Method SetOptionList
Editor::SetOptionList() in classEditor.php
Method SetOrdering
Browser::SetOrdering() in classBrowser.php
Set up the ordering for the browser. Generally you should call this with the first parameter set as a field to order by default. Call with the second parameter set to 'D' or 'DESCEND' if you want to reverse the default order.
Method SetParameterValue
Set the value of a parameter
Method SetParameterValue
Set the value of a parameter
Method SetProperties
Set all properties, or the ones matching a particular type
Method SetProperties
vComponent::SetProperties() in vComponent.php
Set all properties, or the ones matching a particular type
Method SetRecord
Editor::SetRecord() in classEditor.php
Method SetSearchPath
AwlDBDialect::SetSearchPath() in AwlDBDialect.php
Sets the current search path for the database.
Method SetSender
EMail::SetSender() in EMail.php
Set the envelope sender address for the e-mail.
Method SetSql
AwlQuery::SetSql() in AwlQuery.php
Simple SetSql() class which will reset the object with the querystring from the first argument.
Method SetSql
EditorField::SetSql() in classEditor.php
Method SetSql
Editor::SetSql() in classEditor.php
Method SetSubject
EMail::SetSubject() in EMail.php
Set the subject line for the email
Method SetSubmitName
Editor::SetSubmitName() in classEditor.php
Method SetSubTitle
Browser::SetSubTitle() in classBrowser.php
Set a Sub Title for the browse.
Method SetTemplate
Editor::SetTemplate() in classEditor.php
Method SetTitle
Browser::SetTitle() in classBrowser.php
Set the Title for the browse.
Method SetTranslatable
Browser::SetTranslatable() in classBrowser.php
Set the named columns to be translatable
Method SetTranslatable
Method SetType
iCalComponent::SetType() in iCalendar.php
Set the type of component which this is
Method SetType
vComponent::SetType() in vComponent.php
Set the type of component which this is
Method SetUID
vCalendar::SetUID() in vCalendar.php
Set the UID on the primary component.
Method SetUnion
Browser::SetUnion() in classBrowser.php
Set a Union SQL statement.
Method SetWhere
Editor::SetWhere() in classEditor.php
Method SetWhere
Browser::SetWhere() in classBrowser.php
Set the SQL Where clause to a specific value.
Method SimpleForm
EntryForm::SimpleForm() in DataEntry.php
Set the line format to an extremely simple CSS based prompt / field layout.
Class SinglePart
SinglePart in Multipart.php
Method Size
MenuSet::Size() in MenuSet.php
Find out how many options the menu has.
Method SqlDateFormat
Method SqlDurationFormat
Method SqlUTCFormat
iCalendar::SqlUTCFormat() in iCalendar.php
Function sql_from_object
sql_from_object() in DataUpdate.php
Build SQL INSERT/UPDATE statement from an associative array of fieldnames => values.
Function sql_from_post
sql_from_post() in DataUpdate.php
Build SQL INSERT/UPDATE statement from the $_POST associative array
Method StartFilter
vCalendar::StartFilter() in vCalendar.php
Test a PROP-FILTER or COMP-FILTER and return a true/false COMP-FILTER (is-defined | is-not-defined | (time-range?, prop-filter*, comp-filter*)) PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*))
Method StartForm
EntryForm::StartForm() in DataEntry.php
Start the actual HTML form. Return the fragment to do this.
Method SubmitButton
EntryForm::SubmitButton() in DataEntry.php
A utility function for a submit button within a data entry table
t
Variable $tagname
XMLElement::$tagname in XMLElement.php
Variable $Template
Editor::$Template in classEditor.php
Variable $Title
Browser::$Title in classBrowser.php
Variable $Title
Editor::$Title in classEditor.php
Variable $TotalFuncs
Browser::$TotalFuncs in classBrowser.php
Variable $Totals
Browser::$Totals in classBrowser.php
Variable $Translatable
BrowserColumn::$Translatable in classBrowser.php
Variable $translate_all
AwlDatabase::$translate_all in AwlDatabase.php
Holds whether we are translating all statements.
Variable $txnstate
AwlDatabase::$txnstate in AwlDatabase.php
Holds the state of the transaction 0 = not started, 1 = in progress, -1 = error pending rollback/commit
Variable $Type
BrowserColumn::$Type in classBrowser.php
Variable $type
vComponent::$type in vComponent.php
The type of this component, such as 'VEVENT', 'VTODO', 'VTIMEZONE', 'VCARD', etc.
Method TempLineFormat
Set the line format to a temporary one that we can revert from.
Method TestFilter
vComponent::TestFilter() in vComponent.php
Test a PROP-FILTER or COMP-FILTER and return a true/false COMP-FILTER (is-defined | is-not-defined | (time-range?, prop-filter*, comp-filter*)) PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*))
Method TestFilter
iCalendar::TestFilter() in iCalendar.php
Method TestFilter
vProperty::TestFilter() in vComponent.php
Test a PROP-FILTER or PARAM-FILTER and return a true/false PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*)) PARAM-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*))
Method TestParamFilter
Method TextMatch
vProperty::TextMatch() in vComponent.php
Test if our value contains a string
Method TextMatch
iCalProp::TextMatch() in iCalendar.php
Test if our value contains a string
Method Title
Editor::Title() in classEditor.php
Accessor for the Title for the browse, which could set the title also.
Method Title
Browser::Title() in classBrowser.php
Accessor for the Title for the browse, which could set the title also.
Function trace_bug
trace_bug() in AWLUtilities.php
Not as sever as a fatal() call, but we want to log and trace it
Method TransactionState
Returns the current state of a transaction, indicating if we have begun a transaction, whether the transaction has failed, or if we are not in a transaction.
Method TransactionState
Returns the current state of a transaction, indicating if we have begun a transaction, whether the transaction has failed, or if we are not in a transaction.
Function translate
translate() in Translation.php
Convert a string in English to whatever this user's locale is
Method TranslateAll
AwlDatabase::TranslateAll() in AwlDatabase.php
Switches on or off the processing flag controlling whether subsequent calls to AwlDatabase::Prepare are translated as if PrepareTranslated() had been called.
Method TranslateSQL
AwlDBDialect::TranslateSQL() in AwlDBDialect.php
Translates the given SQL string into a form that will hopefully work for this database dialect. This hook is intended to be used by developers to provide support for differences in database operation by translating the query string in an arbitrary way, such as through a file or database lookup.
Page Translation.php
Translation.php in Translation.php
u
Variable $Union
Browser::$Union in classBrowser.php
Variable $username
Session::$username in Session.php
The user's username used to log in.
Variable $user_no
Session::$user_no in Session.php
The user_no of the logged in user.
Method Undefine
DBRecord::Undefine() in DataUpdate.php
Unsets a single field from the record
Method UnFetch
PgQuery::UnFetch() in PgQuery.php
Set row counter back one
Method UnwrapComponent
This unescapes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We accept either case.
Method UnwrapComponent
This unescapes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We accept either case.
Method UpdateAttendeeStatus
Update the attendees of this VEVENT/VTODO
Method UpdateOrganizerStatus
Update the ORGANIZER of this VEVENT/VTODO
Class User
User in User.php
A class to handle reading, writing, viewing, editing and validating usr records.
Method User
User::User() in User.php
The constructor initialises a new record, potentially reading it from the database.
Page User.php
User.php in User.php
Function uuid
uuid() in AWLUtilities.php
Generates a Universally Unique IDentifier, version 4.
v
Variable $Value
EditorField::$Value in classEditor.php
Method Validate
Validation::Validate() in Validation.php
Validates the form according to it's rules.
Method Validate
User::Validate() in User.php
Validate the information the user submitted
Class Validation
Validation in Validation.php
Rules used for validation of form fields.
Method Validation
Validation::Validation() in Validation.php
Initialise a new validation.
Page Validation.php
Validation.php in Validation.php
Method valid_date_format
Check that the given string matches the user's date format.
Method valid_email_format
Check that the given string is a valid email address.
Method Value
iCalProp::Value() in iCalendar.php
Get/Set the content of the property
Method Value
vProperty::Value() in vComponent.php
Get/Set the content of the property
Method Value
Editor::Value() in classEditor.php
Gets the value of a field in the record currently assigned to this editor.
Method ValueReplacement
Browser::ValueReplacement() in classBrowser.php
Return values from the current row for replacing into a template.
Class vCalendar
vCalendar in vCalendar.php
A Class for representing components within an vComponent
Method VCalendar
Apply standard properties for a VCalendar
Page vCalendar.php
vCalendar.php in vCalendar.php
Class vComponent
vComponent in vComponent.php
A Class for representing components within an vComponent
Page vComponent.php
vComponent.php in vComponent.php
Class vProperty
vProperty in vComponent.php
A Class for representing properties within a vComponent (VCALENDAR or VCARD)
w
Variable $Where
Editor::$Where in classEditor.php
Variable $Where
Browser::$Where in classBrowser.php
Method WhereNewRecord
Editor::WhereNewRecord() in classEditor.php
Method WrapComponent
vComponent::WrapComponent() in vComponent.php
This imposes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We output RFC2445 compliance.
Method WrapComponent
This imposes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We output RFC2445 compliance.
Method Write
User::Write() in User.php
Write the User record.
Method Write
DBRecord::Write() in DataUpdate.php
To write the record to the database
Method Write
Editor::Write() in classEditor.php
Write the record
Method WriteRoles
User::WriteRoles() in User.php
Write the roles associated with the user
x
Variable $xmlns
XMLElement::$xmlns in XMLElement.php
Class XMLDocument
XMLDocument in XMLDocument.php
A class for XML Documents which will contain namespaced XML elements
Page XMLDocument.php
XMLDocument.php in XMLDocument.php
Class XMLElement
XMLElement in XMLElement.php
A class for XML elements which may have attributes, or contain other XML sub-elements
Page XMLElement.php
XMLElement.php in XMLElement.php
_
Variable $_parent
XMLElement::$_parent in XMLElement.php
Function _awl_connect_configured_database
Connect to the database defined in the $c->db_connect[] (or $c->pg_connect) arrays
Method _BuildFieldList
DBRecord::_BuildFieldList() in DataUpdate.php
Builds a field target list
Method _BuildJoinClause
Builds a table join clause
Method _BuildWhereClause
Builds a where clause to match the supplied keys
Method _CheckLogin
Session::_CheckLogin() in Session.php
Method _CheckLogout
Function _CompareMenuSequence
_CompareMenuSequence() in MenuSet.php
_CompareMenuSequence is used in sorting the menu options into the sequence order
Method _CompareSequence
_CompareSequence is used in sorting the menu options into the sequence order
Method _HasActive
MenuSet::_HasActive() in MenuSet.php
Does the menu have any options that are active.
Method _log_error
PgQuery::_log_error() in PgQuery.php
Log error, optionally with file and line location of the caller.
Method _log_query
AwlQuery::_log_query() in AwlQuery.php
Log query, optionally with file and line location of the caller.
Method _OptionExists
See if a menu already has this option
Method _ParseAttributes
Internal function for parsing the type extra on a field.
Method __construct
vCalendar::__construct() in vCalendar.php
Constructor. If a string is passed it will be parsed as if it was an iCalendar object, otherwise a new vCalendar will be initialised with basic content. If an array of key value pairs is provided they will also be used as top-level properties.
Method __construct
AwlUpgrader::__construct() in AwlUpgrader.php
Constructor
Method __construct
vComponent::__construct() in vComponent.php
A basic constructor
Method __construct
vProperty::__construct() in vComponent.php
The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when vComponent::ParseFrom() called vComponent::UnwrapComponent().
Method __construct
XMLElement::__construct() in XMLElement.php
Constructor - nothing fancy as yet.
Method __construct
AwlDBDialect::__construct() in AwlDBDialect.php
Parses the connection string to ascertain the database dialect. Returns true if the dialect is supported and fails if the dialect is not supported. All code to support any given database should be within in an external include.
Method __construct
Create the e-mail, optionally assigning the subject and primary recipient.
Method __construct
AwlQuery::__construct() in AwlQuery.php
Constructor
Method __construct
Editor::__construct() in classEditor.php
Method __construct
AwlCache::__construct() in AwlCache.php
Initialise the cache connection. We use getpid() to give us a persistent connection.
Method __construct
EditorField::__construct() in classEditor.php
Method __construct
Multipart::__construct() in Multipart.php
Method __construct
PgQuery::__construct() in PgQuery.php
Constructor
Method __construct
SinglePart::__construct() in Multipart.php
Method __tostring
XMLElement::__tostring() in XMLElement.php
Method __toString
vProperty::__toString() in vComponent.php
Method __toString
vComponent::__toString() in vComponent.php
a b c d e f g h i j l m n o p q r s t u v w x _
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 awl-0.53.orig/docs/api/phpdoc.ini0000644000000000000000000000634511442407600013536 0ustar ;; phpDocumentor configuration file for awl API documentation ;; [Parse Data] ;; title of all the documentation ;; legal values: any string title = awl ;; parse files that start with a . like .bash_profile ;; legal values: true, false hidden = false ;; show elements marked @access private in documentation by setting this to on ;; legal values: on, off parseprivate = off ;; parse with javadoc-like description (first sentence is always the short description) ;; legal values: on, off javadocdesc = off ;; add any custom @tags separated by commas here ;; legal values: any legal tagname separated by commas. ;customtags = mytag1,mytag2 ;; This is only used by the XML:DocBook/peardoc2 converter defaultcategoryname = Documentation ;; what is the main package? ;; legal values: alphanumeric string plus - and _ defaultpackagename = awl ;; output any parsing information? set to on for cron jobs ;; legal values: on quiet = on ;; parse a PEAR-style repository. Do not turn this on if your project does ;; not have a parent directory named "pear" ;; legal values: on/off ;pear = on ;; where should the documentation be written? ;; legal values: a legal path target = docs/api ;; Which files should be parsed out as special documentation files, such as README, ;; INSTALL and CHANGELOG? This overrides the default files found in ;; phpDocumentor.ini (this file is not a user .ini file, but the global file) readmeinstallchangelog = README, INSTALL, CHANGELOG, NEWS, FAQ, LICENSE ;; limit output to the specified packages, even if others are parsed ;; legal values: package names separated by commas ;packageoutput = package1,package2 packageoutput = awl,AWL ;; comma-separated list of files to parse ;; legal values: paths separated by commas ;filename = /path/to/file1,/path/to/file2,fileincurrentdirectory ;; comma-separated list of directories to parse ;; legal values: directory paths separated by commas ;directory = /path1,/path2,.,..,subdirectory ;directory = /home/jeichorn/cvs/pear directory = inc ;; template base directory (the equivalent directory of /phpDocumentor) ;templatebase = /path/to/my/templates ;; directory to find any example files in through @example and {@example} tags ;examplesdir = /path/to/my/templates examplesdir = examples ;; comma-separated list of files, directories or wildcards ? and * (any wildcard) to ignore ;; legal values: any wildcard strings separated by commas ;ignore = /path/to/ignore*,*list.php,myfile.php,subdirectory/ ignore = ;; comma-separated list of Converters to use in outputformat:Convertername:templatedirectory format ;; legal values: HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib, ;; HTML:frames:earthli, ;; HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de, ;; HTML:frames:DOM/phphtmllib,HTML:frames:DOM/earthli ;; HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS ;; PDF:default:default,CHM:default:default,XML:DocBook/peardoc2:default output=HTML:frames:DOM/earthli ;; turn this option on if you want highlighted source code for every file ;; legal values: on/off sourcecode = off awl-0.53.orig/docs/api/media/0000755000000000000000000000000011774765552012654 5ustar awl-0.53.orig/docs/api/media/banner.css0000644000000000000000000000061411774765542014633 0ustar body { background-color: #EEEEEE; margin: 0px; padding: 0px; } /* Banner (top bar) classes */ .banner { } .banner-menu { clear: both; padding: .5em; border-top: 2px solid #AAAAAA; } .banner-title { text-align: right; font-size: 20pt; font-weight: bold; margin: .2em; } .package-selector { background-color: #DDDDDD; border: 1px solid #AAAAAA; color: #000090; } awl-0.53.orig/docs/api/media/stylesheet.css0000644000000000000000000001364111774765542015563 0ustar a { color: #000090; text-decoration: none; } a:hover, a:active, a:focus { color: highlighttext; background-color: highlight; text-decoration: none; } body { background : #FFFFFF; } body, table { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; } a img { border: 0px; } /* Page layout/boxes */ .info-box { } .info-box-title { margin: 1em 0em 0em 0em; font-weight: normal; font-size: 14pt; color: #999999; border-bottom: 2px solid #999999; } .info-box-body { border: 1px solid #999999; padding: .5em; } .nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; } .oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} .evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} .page-body { max-width: 800px; margin: auto; } .tree { } /* Index formatting classes */ .index-item-body { margin-top: .5em; margin-bottom: .5em} .index-item-description { margin-top: .25em } .index-item-details { font-weight: normal; font-style: italic; font-size: 8pt } .index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em} .index-letter-title { font-size: 12pt; font-weight: bold } .index-letter-menu { text-align: center; margin: 1em } .index-letter { font-size: 12pt } /* Docbook classes */ .description {} .short-description { font-weight: bold; color: #666666; } .tags { padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; } .parameters { padding-left: 0em; margin-left: 3em; color: #014fbe; list-style-type: square; } .redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; } .package { font-weight: bold; } .package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black } .sub-package { font-weight: bold; } .tutorial { border-width: thin; border-color: #0066ff; } .tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; } /* Generic formatting */ .field { font-weight: bold; } .detail { font-size: 8pt; } .notes { font-style: italic; font-size: 8pt; } .separator { background-color: #999999; height: 2px; } .warning { color: #FF6600; } .disabled { font-style: italic; color: #999999; } /* Code elements */ .line-number { } .class-table { width: 100%; } .class-table-header { border-bottom: 1px dotted #666666; text-align: left} .class-name { color: #0000AA; font-weight: bold; } .method-summary { color: #009000; padding-left: 1em; font-size: 8pt; } .method-header { } .method-definition { margin-bottom: .2em } .method-title { color: #009000; font-weight: bold; } .method-name { font-weight: bold; } .method-signature { font-size: 85%; color: #666666; margin: .5em 0em } .method-result { font-style: italic; } .var-summary { padding-left: 1em; font-size: 8pt; } .var-header { } .var-title { color: #014fbe; margin-bottom: .3em } .var-type { font-style: italic; } .var-name { font-weight: bold; } .var-default {} .var-description { font-weight: normal; color: #000000; } .include-title { color: #014fbe;} .include-type { font-style: italic; } .include-name { font-weight: bold; } .const-title { color: #FF6600; } .const-name { font-weight: bold; } /* Syntax highlighting */ .src-code { font-family: 'Courier New', Courier, monospace; font-weight: normal; } .src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; } .src-code a:link { padding: 1px; text-decoration: underline; color: #0000DD; } .src-code a:visited { text-decoration: underline; color: #0000DD; } .src-code a:active { background-color: #FFFF66; color: #008000; } .src-code a:hover { background-color: #FFFF66; text-decoration: overline underline; color: #008000; } .src-comm { color: #666666; } .src-id { color: #FF6600; font-style: italic; } .src-inc { color: #0000AA; font-weight: bold; } .src-key { color: #0000AA; font-weight: bold; } .src-num { color: #CC0000; } .src-str { color: #CC0000; } .src-sym { } .src-var { } .src-php { font-weight: bold; } .src-doc { color: #666666; } .src-doc-close-template { color: #666666 } .src-doc-coretag { color: #008000; } .src-doc-inlinetag {} .src-doc-internal {} .src-doc-tag { color: #0080CC; } .src-doc-template { color: #666666 } .src-doc-type { font-style: italic; color: #444444 } .src-doc-var { color: #444444 } .tute-tag { color: #009999 } .tute-attribute-name { color: #0000FF } .tute-attribute-value { color: #0099FF } .tute-entity { font-weight: bold; } .tute-comment { font-style: italic } .tute-inline-tag { color: #636311; font-weight: bold } /* tutorial */ .authors { } .author { font-style: italic; font-weight: bold } .author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } .example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } .listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } .release-info { font-size: 85%; font-style: italic; margin: 1em 0em } .ref-title-box { } .ref-title { } .ref-purpose { font-style: italic; color: #666666 } .ref-synopsis { } .title { font-weight: bold; border-bottom: 1px solid #999999; color: #999999; } .cmd-synopsis { margin: 1em 0em } .cmd-title { font-weight: bold } .toc { margin-left: 2em; padding-left: 0em } /*------------------------------------------------------------------------------ webfx-tree ------------------------------------------------------------------------------*/ .webfx-tree-container { margin: 0px; padding: 0px; white-space: nowrap; font: icon; } .webfx-tree-item { padding: 0px; margin: 0px; color: black; white-space: nowrap; font: icon; } .webfx-tree-item a { margin-left: 3px; padding: 1px 2px 1px 2px; color: black; text-decoration: none; } .webfx-tree-item a:hover, .webfx-tree-item a:active { color: highlighttext; background: highlight; text-decoration: none } .webfx-tree-item img { vertical-align: middle; border: 0px; } .webfx-tree-icon { width: 16px; height: 16px; } awl-0.53.orig/docs/api/media/lib/0000755000000000000000000000000011774765552013422 5ustar awl-0.53.orig/docs/api/media/lib/classTree.js0000644000000000000000000004170711774765542015715 0ustar /*----------------------------------------\ | Cross Browser Tree Widget 1.1 | |-----------------------------------------| | Created by Emil A. Eklund (eae@eae.net) | | For WebFX (http://webfx.eae.net/) | |-----------------------------------------| | This script is provided as is without | | any warranty whatsoever. It may be used | | free of charge for non commerical sites | | For commerical use contact the author | | of this script for further details. | |-----------------------------------------| | Created 2000-12-11 | Updated 2001-09-06 | \----------------------------------------*/ var webFXTreeConfig = { rootIcon : 'media/images/empty.png', openRootIcon : 'media/images/empty.png', folderIcon : 'media/images/empty.png', openFolderIcon : 'media/images/empty.png', fileIcon : 'media/images/empty.png', iIcon : 'media/images/I.png', lIcon : 'media/images/L.png', lMinusIcon : 'media/images/Lminus.png', lPlusIcon : 'media/images/Lplus.png', tIcon : 'media/images/T.png', tMinusIcon : 'media/images/Tminus.png', tPlusIcon : 'media/images/Tplus.png', blankIcon : 'media/images/blank.png', defaultText : 'Tree Item', defaultAction : 'javascript:void(0);', defaultTarget : 'right', defaultBehavior : 'classic' }; var webFXTreeHandler = { idCounter : 0, idPrefix : "webfx-tree-object-", all : {}, behavior : null, selected : null, getId : function() { return this.idPrefix + this.idCounter++; }, toggle : function (oItem) { this.all[oItem.id.replace('-plus','')].toggle(); }, select : function (oItem) { this.all[oItem.id.replace('-icon','')].select(); }, focus : function (oItem) { this.all[oItem.id.replace('-anchor','')].focus(); }, blur : function (oItem) { this.all[oItem.id.replace('-anchor','')].blur(); }, keydown : function (oItem) { return this.all[oItem.id].keydown(window.event.keyCode); }, cookies : new WebFXCookie() }; /* * WebFXCookie class */ function WebFXCookie() { if (document.cookie.length) { this.cookies = ' ' + document.cookie; } } WebFXCookie.prototype.setCookie = function (key, value) { document.cookie = key + "=" + escape(value); } WebFXCookie.prototype.getCookie = function (key) { if (this.cookies) { var start = this.cookies.indexOf(' ' + key + '='); if (start == -1) { return null; } var end = this.cookies.indexOf(";", start); if (end == -1) { end = this.cookies.length; } end -= start; var cookie = this.cookies.substr(start,end); return unescape(cookie.substr(cookie.indexOf('=') + 1, cookie.length - cookie.indexOf('=') + 1)); } else { return null; } } /* * WebFXTreeAbstractNode class */ function WebFXTreeAbstractNode(sText, sAction, sTarget) { this.childNodes = []; this.id = webFXTreeHandler.getId(); this.text = sText || webFXTreeConfig.defaultText; this.action = sAction || webFXTreeConfig.defaultAction; this.targetWindow = sTarget || webFXTreeConfig.defaultTarget; this._last = false; webFXTreeHandler.all[this.id] = this; } WebFXTreeAbstractNode.prototype.add = function (node) { node.parentNode = this; this.childNodes[this.childNodes.length] = node; var root = this; if (this.childNodes.length >=2) { this.childNodes[this.childNodes.length -2]._last = false; } while (root.parentNode) { root = root.parentNode; } if (root.rendered) { if (this.childNodes.length >= 2) { document.getElementById(this.childNodes[this.childNodes.length -2].id + '-plus').src = ((this.childNodes[this.childNodes.length -2].folder)?webFXTreeConfig.tMinusIcon:webFXTreeConfig.tIcon); if (this.childNodes[this.childNodes.length -2].folder) { this.childNodes[this.childNodes.length -2].plusIcon = webFXTreeConfig.tPlusIcon; this.childNodes[this.childNodes.length -2].minusIcon = webFXTreeConfig.tMinusIcon; } this.childNodes[this.childNodes.length -2]._last = false; } this._last = true; var foo = this; while (foo.parentNode) { for (var i = 0; i < foo.parentNode.childNodes.length; i++) { if (foo.id == foo.parentNode.childNodes[i].id) { break; } } if (++i == foo.parentNode.childNodes.length) { foo.parentNode._last = true; } else { foo.parentNode._last = false; } foo = foo.parentNode; } document.getElementById(this.id + '-cont').insertAdjacentHTML("beforeEnd", node.toString()); if ((!this.folder) && (!this.openIcon)) { this.icon = webFXTreeConfig.folderIcon; this.openIcon = webFXTreeConfig.openFolderIcon; } this.folder = true; this.indent(); this.expand(); } return node; } WebFXTreeAbstractNode.prototype.toggle = function() { if (this.folder) { if (this.open) { this.collapse(); } else { this.expand(); } } } WebFXTreeAbstractNode.prototype.select = function() { document.getElementById(this.id + '-anchor').focus(); } WebFXTreeAbstractNode.prototype.focus = function() { webFXTreeHandler.selected = this; if ((this.openIcon) && (webFXTreeHandler.behavior != 'classic')) { document.getElementById(this.id + '-icon').src = this.openIcon; } document.getElementById(this.id + '-anchor').style.backgroundColor = 'highlight'; document.getElementById(this.id + '-anchor').style.color = 'highlighttext'; document.getElementById(this.id + '-anchor').focus(); } WebFXTreeAbstractNode.prototype.blur = function() { if ((this.openIcon) && (webFXTreeHandler.behavior != 'classic')) { document.getElementById(this.id + '-icon').src = this.icon; } document.getElementById(this.id + '-anchor').style.backgroundColor = 'transparent'; document.getElementById(this.id + '-anchor').style.color = 'menutext'; } WebFXTreeAbstractNode.prototype.doExpand = function() { if (webFXTreeHandler.behavior == 'classic') { document.getElementById(this.id + '-icon').src = this.openIcon; } if (this.childNodes.length) { document.getElementById(this.id + '-cont').style.display = 'block'; } this.open = true; webFXTreeHandler.cookies.setCookie(this.id.substr(18,this.id.length - 18), '1'); } WebFXTreeAbstractNode.prototype.doCollapse = function() { if (webFXTreeHandler.behavior == 'classic') { document.getElementById(this.id + '-icon').src = this.icon; } if (this.childNodes.length) { document.getElementById(this.id + '-cont').style.display = 'none'; } this.open = false; webFXTreeHandler.cookies.setCookie(this.id.substr(18,this.id.length - 18), '0'); } WebFXTreeAbstractNode.prototype.expandAll = function() { this.expandChildren(); if ((this.folder) && (!this.open)) { this.expand(); } } WebFXTreeAbstractNode.prototype.expandChildren = function() { for (var i = 0; i < this.childNodes.length; i++) { this.childNodes[i].expandAll(); } } WebFXTreeAbstractNode.prototype.collapseAll = function() { if ((this.folder) && (this.open)) { this.collapse(); } this.collapseChildren(); } WebFXTreeAbstractNode.prototype.collapseChildren = function() { for (var i = 0; i < this.childNodes.length; i++) { this.childNodes[i].collapseAll(); } } WebFXTreeAbstractNode.prototype.indent = function(lvl, del, last, level) { /* * Since we only want to modify items one level below ourself, * and since the rightmost indentation position is occupied by * the plus icon we set this to -2 */ if (lvl == null) { lvl = -2; } var state = 0; for (var i = this.childNodes.length - 1; i >= 0 ; i--) { state = this.childNodes[i].indent(lvl + 1, del, last, level); if (state) { return; } } if (del) { if (level >= this._level) { if (this.folder) { document.getElementById(this.id + '-plus').src = (this.open)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.lPlusIcon; this.plusIcon = webFXTreeConfig.lPlusIcon; this.minusIcon = webFXTreeConfig.lMinusIcon; } else { document.getElementById(this.id + '-plus').src = webFXTreeConfig.lIcon; } return 1; } } var foo = document.getElementById(this.id + '-indent-' + lvl); if (foo) { if ((del) && (last)) { foo._last = true; } if (foo._last) { foo.src = webFXTreeConfig.blankIcon; } else { foo.src = webFXTreeConfig.iIcon; } } return 0; } /* * WebFXTree class */ function WebFXTree(sText, sAction, sBehavior, sIcon, sOpenIcon) { this.base = WebFXTreeAbstractNode; this.base(sText, sAction); this.icon = sIcon || webFXTreeConfig.rootIcon; this.openIcon = sOpenIcon || webFXTreeConfig.openRootIcon; /* Defaults to open */ this.open = (webFXTreeHandler.cookies.getCookie(this.id.substr(18,this.id.length - 18)) == '0')?false:true; this.folder = true; this.rendered = false; if (!webFXTreeHandler.behavior) { webFXTreeHandler.behavior = sBehavior || webFXTreeConfig.defaultBehavior; } this.targetWindow = 'right'; } WebFXTree.prototype = new WebFXTreeAbstractNode; WebFXTree.prototype.setBehavior = function (sBehavior) { webFXTreeHandler.behavior = sBehavior; }; WebFXTree.prototype.getBehavior = function (sBehavior) { return webFXTreeHandler.behavior; }; WebFXTree.prototype.getSelected = function() { if (webFXTreeHandler.selected) { return webFXTreeHandler.selected; } else { return null; } } WebFXTree.prototype.remove = function() { } WebFXTree.prototype.expand = function() { this.doExpand(); } WebFXTree.prototype.collapse = function() { this.focus(); this.doCollapse(); } WebFXTree.prototype.getFirst = function() { return null; } WebFXTree.prototype.getLast = function() { return null; } WebFXTree.prototype.getNextSibling = function() { return null; } WebFXTree.prototype.getPreviousSibling = function() { return null; } WebFXTree.prototype.keydown = function(key) { if (key == 39) { this.expand(); return false; } if (key == 37) { this.collapse(); return false; } if ((key == 40) && (this.open)) { this.childNodes[0].select(); return false; } return true; } WebFXTree.prototype.toString = function() { var str = ""; str += "
"; for (var i = 0; i < this.childNodes.length; i++) { str += this.childNodes[i].toString(i, this.childNodes.length); } str += "
"; this.rendered = true; return str; }; /* * WebFXTreeItem class */ function WebFXTreeItem(sText, sAction, eParent, sIcon, sOpenIcon) { this.base = WebFXTreeAbstractNode; this.base(sText, sAction); /* Defaults to close */ this.open = (webFXTreeHandler.cookies.getCookie(this.id.substr(18,this.id.length - 18)) == '1')?true:false; if (eParent) { eParent.add(this); } if (sIcon) { this.icon = sIcon; } if (sOpenIcon) { this.openIcon = sOpenIcon; } } WebFXTreeItem.prototype = new WebFXTreeAbstractNode; WebFXTreeItem.prototype.remove = function() { var parentNode = this.parentNode; var prevSibling = this.getPreviousSibling(true); var nextSibling = this.getNextSibling(true); var folder = this.parentNode.folder; var last = ((nextSibling) && (nextSibling.parentNode) && (nextSibling.parentNode.id == parentNode.id))?false:true; this.getPreviousSibling().focus(); this._remove(); if (parentNode.childNodes.length == 0) { parentNode.folder = false; parentNode.open = false; } if (last) { if (parentNode.id == prevSibling.id) { document.getElementById(parentNode.id + '-icon').src = webFXTreeConfig.fileIcon; } else { } } if ((!prevSibling.parentNode) || (prevSibling.parentNode != parentNode)) { parentNode.indent(null, true, last, this._level); } if (document.getElementById(prevSibling.id + '-plus')) { if (nextSibling) { if ((parentNode == prevSibling) && (parentNode.getNextSibling)) { document.getElementById(prevSibling.id + '-plus').src = webFXTreeConfig.tIcon; } else if (nextSibling.parentNode != prevSibling) { document.getElementById(prevSibling.id + '-plus').src = webFXTreeConfig.lIcon; } } else { document.getElementById(prevSibling.id + '-plus').src = webFXTreeConfig.lIcon; } } } WebFXTreeItem.prototype._remove = function() { for (var i = this.childNodes.length - 1; i >= 0; i--) { this.childNodes[i]._remove(); } for (var i = 0; i < this.parentNode.childNodes.length; i++) { if (this.id == this.parentNode.childNodes[i].id) { for (var j = i; j < this.parentNode.childNodes.length; j++) { this.parentNode.childNodes[i] = this.parentNode.childNodes[i+1] } this.parentNode.childNodes.length = this.parentNode.childNodes.length - 1; if (i + 1 == this.parentNode.childNodes.length) { this.parentNode._last = true; } } } webFXTreeHandler.all[this.id] = null; if (document.getElementById(this.id)) { document.getElementById(this.id).innerHTML = ""; document.getElementById(this.id).removeNode(); } } WebFXTreeItem.prototype.expand = function() { this.doExpand(); document.getElementById(this.id + '-plus').src = this.minusIcon; } WebFXTreeItem.prototype.collapse = function() { this.focus(); this.doCollapse(); document.getElementById(this.id + '-plus').src = this.plusIcon; } WebFXTreeItem.prototype.getFirst = function() { return this.childNodes[0]; } WebFXTreeItem.prototype.getLast = function() { if (this.childNodes[this.childNodes.length - 1].open) { return this.childNodes[this.childNodes.length - 1].getLast(); } else { return this.childNodes[this.childNodes.length - 1]; } } WebFXTreeItem.prototype.getNextSibling = function() { for (var i = 0; i < this.parentNode.childNodes.length; i++) { if (this == this.parentNode.childNodes[i]) { break; } } if (++i == this.parentNode.childNodes.length) { return this.parentNode.getNextSibling(); } else { return this.parentNode.childNodes[i]; } } WebFXTreeItem.prototype.getPreviousSibling = function(b) { for (var i = 0; i < this.parentNode.childNodes.length; i++) { if (this == this.parentNode.childNodes[i]) { break; } } if (i == 0) { return this.parentNode; } else { if ((this.parentNode.childNodes[--i].open) || (b && this.parentNode.childNodes[i].folder)) { return this.parentNode.childNodes[i].getLast(); } else { return this.parentNode.childNodes[i]; } } } WebFXTreeItem.prototype.keydown = function(key) { if ((key == 39) && (this.folder)) { if (!this.open) { this.expand(); return false; } else { this.getFirst().select(); return false; } } else if (key == 37) { if (this.open) { this.collapse(); return false; } else { this.parentNode.select(); return false; } } else if (key == 40) { if (this.open) { this.getFirst().select(); return false; } else { var sib = this.getNextSibling(); if (sib) { sib.select(); return false; } } } else if (key == 38) { this.getPreviousSibling().select(); return false; } return true; } WebFXTreeItem.prototype.toString = function (nItem, nItemCount) { var foo = this.parentNode; var indent = ''; if (nItem + 1 == nItemCount) { this.parentNode._last = true; } var i = 0; while (foo.parentNode) { foo = foo.parentNode; indent = "" + indent; i++; } this._level = i; if (this.childNodes.length) { this.folder = 1; } else { this.open = false; } if ((this.folder) || (webFXTreeHandler.behavior != 'classic')) { if (!this.icon) { this.icon = webFXTreeConfig.folderIcon; } if (!this.openIcon) { this.openIcon = webFXTreeConfig.openFolderIcon; } } else if (!this.icon) { this.icon = webFXTreeConfig.fileIcon; } var label = this.text; label = label.replace('<', '<'); label = label.replace('>', '>'); var str = "
"; str += indent; str += "" str += "" + label + "
"; str += "
"; for (var i = 0; i < this.childNodes.length; i++) { str += this.childNodes[i].toString(i,this.childNodes.length); } str += "
"; this.plusIcon = ((this.parentNode._last)?webFXTreeConfig.lPlusIcon:webFXTreeConfig.tPlusIcon); this.minusIcon = ((this.parentNode._last)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.tMinusIcon); return str; }awl-0.53.orig/docs/api/media/images/0000755000000000000000000000000011774765552014121 5ustar awl-0.53.orig/docs/api/media/images/Constructor.png0000644000000000000000000000154111774765542017154 0ustar ‰PNG  IHDR(-SsBITÛáOàePLTEÿÿÿLŠÎL<©è9¨î?§è:¹:Užär¢mn¢fP”ß ²9f™fa‰×1—ä4•Ý+ª+DŸ-HŒÚ>ŒÙYƒÖ*ž*.†×O|Ôž>7ƒÑ-ƒÐ.Ð/å £:X!û œ“½EËÙ:·Ã0œ’ÎJkÒè®XjYUÕ[a±•!` é„Rµ»X€VOɬôÁ[Õ±°èŠÌþë3³´T-áM^ü•5^ï­_;^Cfq:³>B6\lýÈ: µéüý;YìÊŠ«¼¢5––̬3†—˜ë%ÔŸ[ .ÖˆÑZ| KÛ$ùÚýNù¬Ÿc‡ SÛ–8™¶ákÇsh΀oOéÅ–ÔÜÝ9¡×¸§ýž‘Ú(èf¤rÕ‹ÖŸB¥ á&âph¬¼‰¦Ôį—¹Ð&Ýî ‹ÓÑñ^1Œ°€œà³µD@š4CW¶@ˆ½PÙ<ú‰äŠÎ‘vŠþ2ÀF¦Õ².IEND®B`‚awl-0.53.orig/docs/api/media/images/PrivateClass_logo.png0000644000000000000000000000345411774765542020254 0ustar ‰PNG  IHDR D¤ŠÆsBITÛáOà©PLTEÿÿÿ¨Îî8r®JJJªÍëžÅå”¾à‰¶Û|®Øs­Öq¥Õm Ôf™ÌXÊH€½JJJ:::|||8tÇ333)))"""………Š¯æ€¨äy¨ãr¢ál›ßf›Þa”ÜZŽÚT‰ØMƒÔCzÍ3h½*d°'Z®(W¤BBB:::2kÞÞÞÖÖÖãÿ…áÿÌÌÌzÞÿtÜÿkÚÿ–ËòcØÿZÖÿ½½½_Óú‹ÆñRÔÿfÌÿWÎýJÒÿžºéIÐþÁðµµµUÌõŽ¿ÐuÃÝHÌøBÎü•·è`Äù›¶ÀWÄùNÅû@Êø®®®]¿÷•³½EÅûr¹îНæk¶íP¿çM½øE¾ùQ¸ö¥¥¥9¾î›¨­’©³j­êD·÷€¨äJµõ;¶ô9µíŒ¢­d§èr¢á:°õ‰Ÿ«@­ô™™™H©ì]¢æ†œ¨l›ß<§ñ4©î2¨ïh—Û1¥å^œºUšãƒ 3Œ;œäƒ–d‘Õ/›ß-›Ù`щ™KÛ………1”å+—Ð1’ÝW…Î-Ô1ŒÔ0‹àfƒ’MƒÔ|||)‹Ã0…Þ.„Õ,ƒÍsss%ƒ²/|Ö-|Ï*{Äbq‚DtÂPu8tÇ#}ª1y¢-sÌ)t¼fff*pÁZfu8m‡*j¾(lµ qœ3h½$l©9eµTalm‘*d°*b¼J`r>btZZZ(`´h‹"cOXd'Z®@Ze)X´5[l$Z£`€LT`RRR(T®KQ[%T¤\yX'Q¨$R IMU!Q”JJJ%K¡#M’TmEIR$I!JŒBBB!BŠ"B’!@†:::9†:z8p7s3}3332k-r-d))))U"""ÃýuËãtRNS"3DUUfffwwwwwwwwwwwwˆ™ªª»»ÌÌÌÌÌÝîîîîîîîîîîîîîîîîîîÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿñÆþ pHYs  ÒÝ~ü tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBÝIDATxœmÓùSaÀq®(:ìD;Íîû–¢4ų-µ<ð¨Ì53ËR×òÈ < :¤DY“N] Ls­Ì,µÒ< dÕH´¿¤}w1Ñúþ°»3ÏgÞywæ} ó1è&-_±rÕê5kÇ·ný†Kh4õÀÞ}##vtþâÕ7±Y@L;²s×î=^T>ûÉŽ†…E§d½ØÂå°H0ý˜{yyƒ$Ippptt|JVAõV—M‚gÀÜÛ[,ûúù…„DEEÅǧehÛù\6‹ÁpºæÔ40""âd\\rršì–¦¼­Ë™GT0÷ ‰9Gv6111M¦,ÐV´w;óÀ&œRÉõ}CýOÉŠì+y™éé2¥JSnèr†X*‰ô®:W&£0t;‚ÃRÅ1Lc€Pk+A,ÅZ¾|Ž*ä˜A£TªŠuã€ÄQ4}yõ¤ä) ãµå*¥ªTWí…#Øû7%7óÔÙöÚ Q•êÿ*Õ™¹IVõV[TT¦¯o>'Âa¬¶R—{'A«¾V”Þ§@¯\‚a‘C r† +ÓÕÔ·õŽ‘»@( wòC„>kÔëkê;ÿ‚œpH`à aUíu5uÍÆQ03'V æB|%ŸžRì]w}]CëÈO ÁoÛOò)’bŸÌŸš;Mf;˜•ŸP8bëÆZck«Ñd1Ó`öm;°Ùzì ¿×HÎ ;˜s/i"°ZL&Ë`?Aƒ¹/Á` ðˆ­ƒ|A0þmˆ°X Ð`ÞËkÚzÈ¿ð`ØJÖ¡a+}ä&o¾Žò´Š ‚üÇp?a&¬;èCËd/C}왬ņãMö:zú¶»ðy .}qÌ)󺺺.µçæ¶€Ïå±ÙôÕ#—àpyŽq9lÕè g2Yr¼þ1@_›ÔZóúIEND®B`‚awl-0.53.orig/docs/api/media/images/next_button_disabled.png0000644000000000000000000000103711774765542021027 0ustar ‰PNG  IHDR%leIsBITÛáOàBPLTEQQQïïïÌÌÌ¥¥¥™™™æææÿÿÿ{{{µµµÖÖÖsss÷÷÷½½½ÞÞÞfff­­­ÅÅŃƒƒ\\\fff™™™–_Æÿ pHYsÃÃÇo¨d tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/12/03äòsò&IDATxœ}“I–„ @1ªî×f*Œ­ÝáÂü’@ŒNÉßà5ýË¥ÀÑI Ëà°Ø4^‡ µ#,fN‘J·úéHµZwøj%o—åÓ/‰“"kBÙÎTB1ݬøàÎ"ÐWë s)½Y—.½Œ>0ZO8­âp7.XÝ"¸éQÔ–\­ø›Ð-ºY½îx±änÝsÅ f›„…•å6e=úÕc·"[=ûÙžšW·Šÿwö "¾wÃN•.8ÒœVk1¿õýéŒ×Õfz|¢±€:¤î¹ßa•òÞ^!"/Òd,GqBG6ܬ Æßs/J£&¢÷Çı›k$6ÜBÝd^›ôêìrþdTûØ6Rð;ø…ó3ú¶ýpëm‹ìIEND®B`‚awl-0.53.orig/docs/api/media/images/tutorial_folder.png0000644000000000000000000000107411774765542020026 0ustar ‰PNG  IHDR —esBITÛáOàäPLTE‹^3ÌóÅ2ffføøøÀÍò¶’ ™™™ÅÀ…Ž‹‚€™æöáZÿÜC¥v ±§‚ÖÖÖzzw=cÖðÕCÌ®/±»×ßÈÂÂÂÿåLãÃRÿñX«}àæùrrr×»f½¶† ˆÆ£'óÍ:¹’ä±&„„~ÿÕ<ãÑk­­­ÿÿÿ­¥Œÿø_÷ÞR™fÿíTããã˺sÚÒ|×Ãn¹­~fff£££ÿÌ3ÿô[ÞÞÞÌÌÌÿØ?ÿáHzzzÿèO¼—(Ç·zÉ­/€€€´°‰¬‚Ï´3×¾j÷ÖB÷ÎBÿÿfªwŠŠŠµ¥„¡Ÿ‰pŽÝ pHYs  ÒÝ~ütEXtCreation Time04/02/03Ù’ZB tEXtSoftwareMacromedia Fireworks MX»‘*$¡IDATxœUÌÛ@€áU9VZǔͱز!Ó¬I!r¡ñþïcwþËïâ¸AX:þ"p/й¾xŽ3äY°+[¤@‚  -W†¾jš—¥úIǽaéî.Ð#ÚãÎTÉ}Mã@飉q­Ž XeÍcgYK$á,W8ÄíD@ªhËŠ>§@@®00™33HHH˜**¢ Œ*3vVV333™ŒÌÌÌÄÄÄ·³³´ªª¨¡¡™™™‹‹‹ƒƒƒ½kk{{{§ooÀaasss™ffÅPPfff“[[ºPP‹UUÿ33ÁBBhZZaZZZZZÍ;;¸@@ÿ''½88[SSQQQ»11ÿPLLŠ::ÿ®00ñ¹))©,,ûCCCµ""›((ñõ×é ¯ôS00ß333în""×ßåÖžÌý'''¶­¥™Œ„zrf­ã(øgtRNS""3DDUffwwwˆˆˆˆˆˆˆˆˆˆˆˆ™»Ìîîîÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿãç‡÷ pHYs  ÒÝ~ü tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBñIDATxœ-ÏÛZ‚@…á™@ÉrWÙ«Ic&”Ä6bjR&¶1+Ô DËû¿„þ‡üߣµÐÊZ<‘LAé­ÝUŒÑz±tÕÐu½Ýî¾~òÅÏ/ë·¦iv:ϽɑÀ¡D­þô>öú}{äÏcì$€£Ì ùrH¿ ù@¨Ó,yo\|Ч,ߨÁ _¦e+zÃuÀÃT¸Tû»ûš¡´a¹ 0>ˆvæ8NqóÔÓž’§ªh €[]öWI@ ÿ‘'`D‘ôõ.,IEND®B`‚awl-0.53.orig/docs/api/media/images/Function.png0000644000000000000000000000112411774765542016411 0ustar ‰PNG  IHDR(-SsBITÛáOàüPLTEAÝÝÝwww+Á4#Ÿ)»»»8J6aÉCÿÿÿ {ÎrJ¥!Râ5,H'™™™vÀ[DÉ7ªªªUBîîîfffBšYWÀC1މ‰ÃÒ¿£½žYäEBÛ3Q¥53Ì3I×<k "NáðÛ%ª,l»PFOEˆ^¡T5—zÃ[*¯,ÌÌÌA§&KË&R<Î9jÓCW¯28Ç;2Z(SÞE–(UUU§Ëœj§TM¿.^·4"±/:˜\<Õ3M(¡(eÎCƒ\ÆCLÝ9rèöâB­#¿Æ½.½0PÚ8A¡ÅœIÔE ­3 ‰!.¯)^°:_¤Ç¦í pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZB¡IDATxœcàpWæ@ \AžÂ(ZÖ–Â(†z¶ÜÂHN<ÞVÜrRÂW[!F˜»Œ¬½q ¦¯0TÀÔ^^žÙÆ_WTƒ$Àïb*ï¥b¦ÌÀ&©# ðÓfqVÔç‘d…¨w p³S2gÔ˜Á/멕ʮÄÇ ³…ßH ¬îUIˆj¨€´$ŸŠ_„u‘} ˜y,½IEND®B`‚awl-0.53.orig/docs/api/media/images/minus.gif0000644000000000000000000000006611774765542015744 0ustar GIF89a €ÿÿÿ, @„ˬÝ\r¦[aŽ `ßMT(;awl-0.53.orig/docs/api/media/images/Index.png0000644000000000000000000000111011774765542015666 0ustar ‰PNG  IHDR ú} sBITÛáOàçPLTEI–¸Úu”³Oi–Çãÿ>a¦ÇÒæ™™™ˆˆˆîîîÌÌÌ/‡”¥Ö¨Æär–ÐfffÝÝÝ#F€øüÿÝîÿ»»»d…ª5n²ÁÛ†§È¾Úõ}›½Jl°:z¬½Û‘§ÁðóøÄáÿÕçú†¢Ó*[/VŸªªª²Îë›°Ø¥µÞæòÿ}œÒ9rµÂÛ‡¢¿ÿÿÿÙìÿx–¸nµPw¹éôÿ¬ÇáÎçÿWu—”«Ñ»Çßž¿àœ¤¸._»Ðæ¡Àà6n‹¤Óðøÿ… ½ÔéÿÆÙíz’¼1Š¢½„ ÓާÇ<„œµÖ»Ýÿ•ªÕMæ` pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBªIDATxœ=Éë@@ᕤu+-r)Ƶ(;±ƒ´å>¼ÿóØ­áüû怲÷}ÓŒc ”Èv§ÒÛ68ÁÞÁ†ÁH¡œ/A üÁ!“[¹^‚ÀŒ˜Æ^žVQç"!”œúgUh.ÝÜSø TÞÄ©HK[ لʲü3-höbË­ufÕ0̵¥×nýì´jnÇ\×—å‰ÎGÀꯩ0ÔÿÁ/¥ J§vîIEND®B`‚awl-0.53.orig/docs/api/media/images/previous_button_disabled.png0000644000000000000000000000103511774765542021723 0ustar ‰PNG  IHDR%leIsBITÛáOàBPLTEQQQïïïÌÌÌ¥¥¥™™™æææÿÿÿ{{{½½½ÖÖÖsss÷÷÷µµµÞÞÞfff­­­ÅÅŃƒƒ\\\fff™™™SÊÜð pHYsÃÃÇo¨d tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/12/03äòsò$IDATxœu“Y–… Cßþ÷ÚLâ€]~H7–†ïÍ„ôU¨_I ?Ð.&;,D±uÇD’fYôåÈKD¼æT­zú?R®Öí&[Þ,7ë4°Iâ 2/`“š¶’Ä|YzE¼KÅ2ŽyX’­áYºU‰˜_¯ð80ߨ㆕màì(û6L(êiÅËêŽöWÕâÙŠ¸Š?¬i/ý²Lüª«ZNÝ¢MÓ«¥eydJ•Ì;ûÚÙ!Ôtl îæŒ>Òi•+†–(“UšÙ^WÉtÿiXD½=ÌRØÊ+$’ï´áH¹ò=€Kaû{ÍE*äøønÓ¡âN:¯èŠ;‰‘ö ‚ŒIC^+Ûƒ~nóX&2Ò™ûÀ™¾úÌþŒ?Í9¾IEND®B`‚awl-0.53.orig/docs/api/media/images/file.png0000644000000000000000000000071611774765542015551 0ustar ‰PNG  IHDRhaö,tEXtCreation TimeTue 29 Jan 2002 20:17:29 +0100žu‡PtIMEÒ„«½  pHYsÃÃÇo¨dgAMA± üa%IDATxÚcüÿÿ?Ñ€ˆñ¨¨¯¯Gp€f744üÿý+:pàH˜Ú^_]€°¿Ù`§BP% ~ƒÿÿ~a0²Š€H Žå§?Â¥]Û’Þ¶ìð1¸H¤!Tõÿÿ¿YàJêà*f¯Úg/뺰yyáZÉ‘ã~p!ÄG—{ ÎØºfHuj˜ƒÐì…WXöOnÂêz †ÿŸ²­Ùr(ôUh€ŒcnOƒÂûш+e°)xòhÍN”˜— ñ€øÃ©rG¼ÎŸ„‚9 …r!î(f# Ó?Üûÿz a±É'¤ˆ 1§Ç`DŒ RðˆdaPa`à€°1ŠƒÚ[àTHì€T32²2€ª³õÄz2œŠIEND®B`‚awl-0.53.orig/docs/api/media/images/package_folder.png0000644000000000000000000000106411774765542017555 0ustar ‰PNG  IHDR —esBITÛáOàÛPLTE`BÏ´3ÿÿÿ¡y$ÿÌ3Ð×»f¥.™fóÅ2ÿíTÍ£#¹’Œ`ìÉ?ñ£œsßÈÉ­/ÿáHõÚGX´•QóÍ:°xÆ!Ùµ.ÿñXà› ¥v ÿø_uPÿØ?±†«ˆ=™fß—óÒ?ä±&¹*«}Ì®/ûâOýîiðÕCÆ£'”g×ÃnÿÕ<ÿô[½”!Ûµ1Ù“ñË:äº/¼—(×¾j¬‚÷ÖBô¥ÿÜCÿÿfªwសw!{T­‹BÿæM‹^ÿèO¤}+¶’ ß¼3ÙÃwc pHYs  ÒÝ~ütEXtCreation Time04/02/03Ù’ZB tEXtSoftwareMacromedia Fireworks MX»‘*$¢IDATxœUÍ[`Æñ·Œl±&§:aŠŠ(Êa2Máû"Ûk\øßíïâY&¾€2Å_l[tÁ‡ã©J’: ζ–32eYñ*Ïïj;z.M{&Iß—a±]#€&‡8žgHÇÓ t½‘eˆ™@QjŒî¢/¨´°1Ðf{eYö'öà¦QÄaM¹îÁOej̃¿®³.púJIEND®B`‚awl-0.53.orig/docs/api/media/images/blank.png0000644000000000000000000000022011774765542015707 0ustar ‰PNG  IHDRÎ Ö!tIMEÐ +‰Tº pHYs ð ðB¬4˜PLTEÿÿÿ¥ÙŸÝtRNSÿå·0JIDATxÚcøÿÿ¾{-áý×=KIEND®B`‚awl-0.53.orig/docs/api/media/images/AbstractPrivateMethod.png0000644000000000000000000000155211774765542021070 0ustar ‰PNG  IHDR(-SsBITÛáOàePLTEÿÿÿXtU y°GˆR )_d¨f8 )^Iƒƒƒ4}1Ì‚‚Aˆ}Àjj·HH¶BB´<@€DfffZZZA<ÌÌÌÂÂÂUè4Iá3DÝ3«««OÑ8HÒ.=Ô2<Ï1¨££<Í=3Ì3^¸K?Á+™™™+Ã2*½12¹-°‡‡:²3%³1ŠŠŠ0®05ª'ƒƒƒ:Ÿ>%¦5…~’||_O¯sC{{{XŠSC‘<ÂffÛ\Etttme"Ž+H{EæK;CzCIwI¹÷Ç•ºG³îi§æ\¡å3ªô?§è9¨îUžäP”ßÏt¤Îs­a‰×1—ä4•ݽr¡Ém£HŒÚ¼oŸ>ŒÙYƒÖÌf™O|Ô7ƒÑÄ\—À\›çTd™f™IvÐApÍåI[.sÄ”W‘åDS8lÃö>GäBBã<ù‰tRNSDffff™™™™™™™™™™™™™™™»»»»»»ÌÝÝÝÝÝÝÝÝÝîîîîîÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿI pHYs  ÒÝ~ütEXtCreation Time04/02/03Ù’ZB tEXtSoftwareMacromedia Fireworks MX»‘*$ÕIDATxœc—”bd€;SS3+kg&¸€Ž–¶¾¡E3LÀMW[ßÈÒ!‚&à¡§odnïÄ dsÈ‚ -í½ã¤ؼ¢üL,\ÜC“«¸9bü]=}£«ó²#ƒÃkZTÕÔ54s*2ÒâbjÛD`Fs%Ååæ7 Âø œQ ¹™ 0>»MpLiqzY=„ÏaëVÛÒ\–RXÏI­¬í¨Ï*iS‚(‘¯kšÏ[Þ¡3DNDò(30^4-nÊ#IEND®B`‚awl-0.53.orig/docs/api/media/images/next_button.png0000644000000000000000000000122111774765542017173 0ustar ‰PNG  IHDR%leIsBITÛáOàPLTEQQQÏØëÂÏè™™™3fÌy™Ùæææÿÿÿ½½½W€Ó{{{­­­ËÔè÷÷÷sss¦ºà½ÉãÞÞÞïïï?nÎÅÅÅfffµµµ©Ü¥¥¥ÌÌÌÚà탃ƒÖÖÖ³Ââ\\\†¢Ûo’ØJwÐ×Ýêfff™™™¬¿ædŠÖ{›ÛÙàìäçî”­àßâèÎÞ٭½Þ»,ûØÞé3›W´”_Mµk7ä˜=¨7Yé]uÙ,ï1´¨ˆò~¶ÚÍêu…™Ö CÔY(W¤;ä¶ÖEx…ÖBBþ—C •×A|Ñ»ñï¼*ÀŒÅDZq;J^[6DXÄLp>d+†´iï"Å­m³} É-^cüýWò4è/ƒ*eIEND®B`‚awl-0.53.orig/docs/api/media/images/Variable.png0000644000000000000000000000126011774765542016352 0ustar ‰PNG  IHDR(-SsBITÛáOà)PLTEƒl1/­å(m°öÖUÿÿÿÌÌÌîîîгEz§Ó@w¯¦ŒÿßyÐŤeº­‹D„²¿ˆu3™Ì2ÅùÿåfܼkøØŒ¸Á©5tÍ®­«Æ¢JO™ãëЉ”€LeÙÝÝÝõÇmúåmñävÿåŽHÎû­ÈáB—ÆÞ²Yè× ÿïyo¨¿…vQCŒÞõÙcÿítÒ¿Š­”V‘´Ö“zB6c©.ªáÿÝ•LyÏI”áë¿a"E‰úêw?·êf™Ìÿ…@ÿß]»»»ÿô†Õ¶Ke§æOÓÿæ¿Zr¡Ñùàoÿä‚m“Û/Ü6aº;Îÿ…¤áÿ÷ŒÎ¨NøÍk1´ðµ«Ú»Qûß_ÿÞšÿèkÿêp¡†HײRÿ݇ðÔßÀrWžäÿê“´˜Pÿò”WÕÿΫJùÎr/Rd£ pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBÐIDATxœc`aS1àààpµæec9§)3mq#9˜€G‚·w€'§=T@ÖYˆQU,*JšGŽ " lÌéîÎÍÊ°Ò ‰uÐÐÐpó‘ ˜ ª+9(jh(„ê¨q±¼,BâòaaÂÁ.úr ,lrö&¾–ºº¡ÂÂvá@Ö0_˜ÙO, 'Êä Û9ò °Øxäu€\fvIC- %zæ.Aމ¶ l¹À8>¾p-V°KÁ€M ~AKÅ‘ÍIEND®B`‚awl-0.53.orig/docs/api/media/images/Class.png0000644000000000000000000000107211774765542015673 0ustar ‰PNG  IHDR(-SsBITÛáOàÛPLTE1fªªª3å-…шˆˆ&NŸ3­õÝÝÝ(k²3ÃüX‰ØîîîÂØí3œïDÂúA}­ÂÖ-qËL×ÌÌÌi•Ü(R®;z3µ÷ÿÿÿ™™™3ë!H†NÓÿÛêöK~Õ3fÌ@¶÷/–ß5¤ê(c«³Ìå_×ÿ'Y¥HÑÿ3†èXŒÛ$F”Ìàñ3Ìÿ!/S~ ß3»ù+`¿-ŽÖ+xÂ3•íU‰Ú'R£6kÄ4©ìÆÜî ?ƒEÍþ5d«5gÁ3£ñ]‘Ü-}Ï'[ªD¿ù1ŒæEÉü)J¥U†Øi™ß/šà.‹ÖûÛÅ¢ pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZB¨IDATxœMÊi@…áÑ¢(*‘R)J©,áD &DZüÿ_dÔXî·÷9¨f”âñ®È©À\ÝÏA½Þ¾9õg†ïûy~±§[]c@ ´ÖzØœ°… íã>=/TÝ!¿P÷~÷–YWÜs©¬]Ü„•Tp³q1ý~|xlH%+„ ÷È:¥çyIB‡@ ºPOQÀ'kÔo ¨ó?õx,„p›Ø”IEND®B`‚awl-0.53.orig/docs/api/media/images/Class_logo.png0000644000000000000000000000310011774765542016705 0ustar ‰PNG  IHDR ±ˆ?¾sBITÛáOàOPLTEÿÿÿ5Sr¨ÎîªÍëžÅå”¾à‰¶Û±Ú|®Øq¥Õm Ôf™ÌXÊH€½*[”Cs5\ '(F#@: 2 . '8tÇŠ³è€­äy¨ãr¢ál›ßf›Þb“ÜZŽÚT‰ØMƒÔCyÍ1n¾'[®$Y£ãÿ…áÿzÞÿtÜÿkÚÿ–ÏôcØÿ‹ÊóZÖÿRÔÿÆòfÌÿJÒÿWÎýž»éIÑÿBÐÿWÉûxÁñ=Ïÿ•·èZÆúr¿ñ`ÃøMÇüEÇü3ÌÿSÄúk¼ðMÄû]¿÷<ÅüP¿øŠ¯æ3Åýi¶îC¾ùI½øX¹öQ¶ö3½ú;»øh¯ì€¨äD¶öJµõ:·÷Q²òd«ê3µ÷C±ðF¯ô@°òr¢á8¯õ]¥ê@­ô3­õH¨ìpà@§îl›ß<¦ð3§ói˜ßUžå:¤æ3¤ð:¢áb“Ü9œæ3œï1žæ<™àK“Þ1šàZŽÚ3•í/–à1”æ0”Ö3ëS†Ö0à2‹ç1Ø,ŒÏ3„ç-†Ó0ƒÜ.ƒÔH{Í,ƒÍ2~ã*‚Æ2{á0zØ-zÎ)|¿>vÇ*yÄ1uÜ0rÕ-tÍ*sÂ)t¼-nÊ'q¶1n¾º$y‚éóW£(°÷ƒ[”oè˜0} Šk?$ùšæŽ s1 äš;¦Í]±nB»G²|[?PÁ†]»G@=”)˜¹Y•ƒOpl*’|ÏÔ‹Ön…+È·r‰F–o뛺`9B¾‹PÜþ¶ž¾) ­Ú¸® ÄÅ?:µ¨¼¼®¶©£££¿êÔ™@¶íÜ Wà’\T^ÛÒÒÞ9a´i3,X´|ͦ»öì†(¨öO,¬ªoížbtZZZ(`´h‹"cOXd'Z®@Ze)X´5[l$Z£`€LT`RRR(T®KQ[%T¤\yX'Q¨$R IMU!Q”JJJ%K¡#M’TmEIR$I!JŒBBB!BŠ"B’!@†:::9†:z8p7s3}3332k-r-d))))U"""ÃýuËãtRNS"3DUUfffwwwwwwwwwwwwˆ™ªª»»ÌÌÌÌÌÝîîîîîîîîîîîîîîîîîîÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿñÆþ pHYs  ÒÝ~ü tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBÝIDATxœmÓùSaÀq®(:ìD;Íîû–¢4ų-µ<ð¨Ì53ËR×òÈ < :¤DY“N] Ls­Ì,µÒ< dÕH´¿¤}w1Ñúþ°»3ÏgÞywæ} ó1è&-_±rÕê5kÇ·ný†Kh4õÀÞ}##vtþâÕ7±Y@L;²s×î=^T>ûÉŽ†…E§d½ØÂå°H0ý˜{yyƒ$Ippptt|JVAõV—M‚gÀÜÛ[,ûúù…„DEEÅǧehÛù\6‹ÁpºæÔ40""âd\\rršì–¦¼­Ë™GT0÷ ‰9Gv6111M¦,ÐV´w;óÀ&œRÉõ}CýOÉŠì+y™éé2¥JSnèr†X*‰ô®:W&£0t;‚ÃRÅ1Lc€Pk+A,ÅZ¾|Ž*ä˜A£TªŠuã€ÄQ4}yõ¤ä) ãµå*¥ªTWí…#Øû7%7óÔÙöÚ Q•êÿ*Õ™¹IVõV[TT¦¯o>'Âa¬¶R—{'A«¾V”Þ§@¯\‚a‘C r† +ÓÕÔ·õŽ‘»@( wòC„>kÔëkê;ÿ‚œpH`à aUíu5uÍÆQ03'V æB|%ŸžRì]w}]CëÈO ÁoÛOò)’bŸÌŸš;Mf;˜•ŸP8bëÆZck«Ñd1Ó`öm;°Ùzì ¿×HÎ ;˜s/i"°ZL&Ë`?Aƒ¹/Á` ðˆ­ƒ|A0þmˆ°X Ð`ÞËkÚzÈ¿ð`ØJÖ¡a+}ä&o¾Žò´Š ‚üÇp?a&¬;èCËd/C}왬ņãMö:zú¶»ðy .}qÌ)󺺺.µçæ¶€Ïå±ÙôÕ#—àpyŽq9lÕè g2Yr¼þ1@_›ÔZóúIEND®B`‚awl-0.53.orig/docs/api/media/images/previous_button.png0000644000000000000000000000120411774765542020072 0ustar ‰PNG  IHDR%leIsBITÛáOàPLTEQQQÄÑëÁÎç™™™3f̵µµæææÿÿÿzšÚ{{{³ÂâXÔ÷÷÷Í×ésss¥¥¥³ßèëñ?nÎÖÜéfff½½½ÅÅÅ’¬ß­­­âåëÌÌÌÖÖÖJwÐlÖƒƒƒ¦ºàÑÛí\\\fff™™™ÞÞÞc‰Ö­ÀæïïïKxÑ{›Û ·äåèï×ÞëµÅå,°´“ pHYsÃÃÇo¨dtEXtCreation Time04/12/03äòsò tEXtSoftwareMacromedia Fireworks MX»‘*$@IDATxœu“íVà @£”tS,Û,0„9Ý9hïÿxò%mi½?ú£¹'„@›`èœ]€9 ñ‹J™$ÕŠËdS†‚Õ“ÅŒ G®8ˆè$QÑŠ§ÿ#ùjio½ål;µ²ñ’$tÖÒSÃ"Õ÷ñÐŒ–Ü@3“¼öóÜx²…Þê T¥ïMSYd ³o®Mæ¹XŠò(+Åæ4Íi÷4Ì-=ZI9lÆFD‹,­·¯i»‚¥W¬E.YYï÷¥®ÇÊšTÏØëõ°¸c´$Îh¿«û-eëÞßn&–3’Ÿ;@:sò;žþ¬pEq†V¯Nà]š®ÐÓþ"¡5‡ Äò†^]˜Bαà2i9Õ¤€q¢ 1éï¸*à‘ódÚŽA÷\úˆ Ђּï@`Ù4C¶‘n†Á'û6RsRCmŽþ>‘<ò7øIEND®B`‚awl-0.53.orig/docs/api/media/images/PrivateVariable.png0000644000000000000000000000140411774765542017705 0ustar ‰PNG  IHDRþˆÕ6sBITÛáOàhPLTE333ïÕ[2Y«OÓÿ¥…@­­­ÝÝÝ~{heºÐ³Eÿÿÿfffîîî.ªá¥fŒŒ„îáuοŽB—ÆQQQ­Èá“zBZkr¡Ñ» B+Âÿ݇ƒl1@wÐŤ2ÅùÛÇ\ÿåf¬¨ ˆueÙðÔ£Ÿ‘ëЉ»»»­”VO™ã„²¿õÙc5tÍÌÌ̯¦Œws^KxÍܼktttÿÚy‘ˆEEEüߟ/Üe§æXXXßÀrCŒÞêÛoo¨¿µµµ×²R‘´ÖøÍkHÎûÿß]?·êÿítÆ¢JI”á—YùÎrÿô†idTúåm(m°f™Ì…¤ázzzš};¤šX®§m™™™m“Û1´ð®ŒD…vQâË~===ŒŒŒóßjãºY;Îÿz§Ó`[Q¸Á©ÿê“ΨNöÖUýêsûádÿïyÿèk6c©Ö·Gïä~”€LÞ²Y­¢[äÉR¡†H`]Wÿä‚WÕÿ/­å‘ŒWžäΫJÚÒºÌ pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBåIDATxœcàqˆ÷ãàá6‹2MwkL6(?´8..ÌÜWFÂWf–+JTQQ“eãóxµÌ¤ŠŠŒ=­ty@|[³$¯ôôtGC6 ß@R02[ÈÍÐÎÕãa`cS4 ¶IMÍHsŽÕ`càQ.äæÎ‹ÉPPp¶/`c`c-ä a—OSPHIÎacÐ(Uåð`TpÎ WâaP7Š6 0ÒÏOátšo eªà-QÎ"ÍÊæ30è$Dè‚ÜÇ ÎÍ­nÄ­Îq?«¥0˜rC¼Ë×a,?zþ¬IEND®B`‚awl-0.53.orig/docs/api/media/images/plus.gif0000644000000000000000000000007011774765542015567 0ustar GIF89a €ÿÿÿ, @„ÀíX\J¾JoÚóÑ:tiÞU;awl-0.53.orig/docs/api/media/images/L.png0000644000000000000000000000023111774765542015015 0ustar ‰PNG  IHDRÎ Ö!tIMEÐ %"Õ!xg pHYs ð ðB¬4˜PLTE—Ž{ÿÿÿRHtRNSÿå·0JIDATxÚcø_ÿ€áÿ ÆE‡:@hì4o*—OkckIEND®B`‚awl-0.53.orig/docs/api/media/images/Method.png0000644000000000000000000000122511774765542016046 0ustar ‰PNG  IHDR(-SsBITÛáOà#PLTEC ßìá3fÌ"Ž+|³é=Ô2EŽÞt¦rDfGXVÎæÍ§Æ¨^¸KðõðJ‚JC‘PLTEC ÌÌÌÙ%¦5Ãhhг>>#,eet¦r%h(ÿÿÿo Â\AºÑ·?Ø3N…Läåä÷¾YYJ‚J‚•„𽮸¯OÑ8§§$_(3Ì3¢ ÎæÍ™£sC+Ã2Jã3DfG:l:Ë??o‡rè:²3ÞÞÞÌ33ïïïï·HHœÉ€€ÉãÉ*½1^¸KIwIÕ˜˜&›*¸X<—X<õ##(M*TŠPæ<Í=† öööÿ £Wï5™ff'*a›[ÙÙÙÂffDÝ3%³1ßìáC‘<×K;H{EÆ##õ--?q@»Ø»"K#ÿÉ\EZU=Ô2ðõðIá3u =s<á™"Ž+1Ä1Pé3¯J{J^W pHYs  ÒÝ~ütEXtCreation Time04/02/03Ù’ZB tEXtSoftwareMacromedia Fireworks MX»‘*$ÃIDATxœc°µ`3iwn0`ð×3 ã•Ðð6… ˜…{D ›¸hpÀØ££MB4Y‘„…]blbáâ&&ÉJ±Ö¡¾ñU&{g/©à$N°€œr†§§ƒ`zB€aRh$PÀÜ-‘‡‡OP; .NV-Ô9ˆAÈøÒ´´˜å#À&© ¸¦²G9IÂâ\­Reôf@Òì¸t„¸a–¢> NŒw€ÉHÝ(1nn$!(Ÿòw$j䄬ñIEND®B`‚awl-0.53.orig/docs/api/media/images/AbstractClass_logo.png0000644000000000000000000000232011774765542020374 0ustar ‰PNG  IHDR D¤ŠÆsBITÛáOà•PLTEÿÿÿÈ‘‘@{!!uÀqq¹ll³cc¯[[«TT¨OO§KK¤BB ::™33’$$TÀqqK¾eeA:’3*!½ZZµQQ·JJ… :¯DD«;;§11£))Ÿ""tfZRKÿffÊssÝiiÄllÌffÛ``ÂddÿTTÇ^^ÙWWÿJJ½ZZÄUUÿCC×OO»TTÕHHµQQÿ<<·JJÔBB¾FFÿ33½AAÒ::´AAÿ))»;;ú**²<<Ì33«;;ÿ!!÷ ·11É))¬00ÿµ,,ñøª++Å""øÿ£))î® ÿ¤ ¾÷ äâñè §ÿ÷Ûï¤æÞÖ•̬ žµ ”­¥™‹ƒ{tfZR¼pó‡tRNS"33DDUUffwˆˆˆˆˆˆˆˆˆˆˆˆ™™ªªªª»»»»ÌÌÌÌÌÝÝÝÝÝÝÝÝîîîîÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿxB…Þ pHYs  ÒÝ~ü tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBñIDATxœm“ù_Ò`€·‰kavØa–YiXythtØ¡r$’™èlІ&Âb³lþÝ}ß½›LÜóãžgïûýlïKtÝzôx䩟h4::úìùý‹$I—bS±™¯ñx:ëcie}sç°ñ„¢HâöÔë7o?|™M$¾·ùñs÷Ïñ :D½±éWï>~žOµÉd2ÜZá×_}Œ¡)âòÌ{ðð˜es.Ç󅽊jŒ…™qeîxyž¡°_5s¼‚«ñ$òù —"¢TªÕE­å×ÒÉùøíß.år¹Z­‰’ŽšèKƒ:|8 ²‹)6¿ÑáêM90ÀÞÙA6ÚAÎ \ïJ@pêÑAÙÛFåóAÛ;¸FhvÛgýù xÖÃŒ²jâàzv‘Í EŸÇâ8ø¼X8XZfyü h^°²ÌñBÉÛÞ®×E4‚Ö²&p°ÊñðÿkžCH°€ÜX_]+ìçÁ®Ù”$I–UÓÝàææœ/°ØŠZÓ ËÆÁÎÁ^•£¨ yÓ²'Qpë°ñO7 ³åDz,Û>9y‰Îä…Æ±ašø¡ìatìÉîþ»ƒ:‰D"ïõ„i¨Í„ƒa¸z$*h𠀆«I¨ BÁÀå&ÿN®@*-Ó©IEND®B`‚awl-0.53.orig/docs/api/media/images/function_folder.png0000644000000000000000000000113511774765542020006 0ustar ‰PNG  IHDR —esBITÛáOàùPLTE*l ä±&¥v äÑ—™f9¸Ì®/ÿÿÿR›#ñÚJ°š/^³8•Œ(‹^4¦ ðÕCßÄ=ÿñX>Ð=0Ÿ c™̯XÅ¡%èÆ;°€r¿J²AÙÎLÿáH×»:ìÞµÿÕ<º ,A£7½2)|my ÿèOóÅ2ÐÄGÿØ?«}¡9õÐ=T°)ÿø_=Ö3âÚR«°B¹’äÖN¤!È­0½«4ÿÜCúÓ=CÀÿíTïË9ÙÅCÿô[3©¼@ÿåLc¶84k9œ±†:Æ*X¯0DÛ2¬‚Ï´3*}ÖÅJøÖA=¼ÞÀ:ÜÆBïßP0¨¼¡,k‚a˜L pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZB­IDATxœ=Ïi@†áÁ%ûš"I‰ìMQöœ„ãÿÿ3ãp{¯ó|y3„¸(ó ,²†ï'`5ö­ àÕ7:Ú|@‹BÇã)·ë?’ Sà9iÔ´S®+˜ÞÛÜ¥åì˜&Âผ¶‡ä* P,ÚÞ}Rê–å·®©,;/½ä}º¾ Xr2`C]ÓèBQç[¯…OQ¤‹|¾PaC„Š‹@pÄŸdá¿Æ:¢=TuÕÏIEND®B`‚awl-0.53.orig/docs/api/media/images/Tplus.png0000644000000000000000000000033611774765542015737 0ustar ‰PNG  IHDRêYQtIMEÐ 'ÁÎ*I pHYs ð ðB¬4˜0PLTEÿÿÿ—Ž{y8ÇtRNSÿå·0J3IDATxÚcE!À &6Q% P„0!J LFlLFEEEÜ & ™‹ß ¹ àÔIEND®B`‚awl-0.53.orig/docs/api/media/images/class_folder.png0000644000000000000000000000117111774765542017266 0ustar ‰PNG  IHDR(-SsBITÛáOàPLTE‹^3fÌä±&ÿÿÿ#GŽ£äÑ—_°3›ïpkFÿñXÌ®/ðÕCK‚ÊUƒ£™™f¿¢+ÜÓO„«¼—p3zâïÄ23µ÷¤½«ÙÁ?w‚aÿáH¿Ÿ:s¢×äÅ;ìÞµÿÕ<3z×3Äü¥v ,X¯É®Y\“ÒÖ·7·•#óÍ:3ŒêÿèOÿÜCâÀ8rtRÿø_™f'Nl›¶äÖ¨|ÙÈF3¦ïïØHܹ5®…ßËEXŽÐ÷Å1zqBÉ­/3ƒÛÿØ?ÿô[t¢¹ç¾2¬‚Ï´3ÿíTéáUÖ¼<ÙÎL(P 1¥÷3‡æ÷ÖBÿãJt3Ìÿc–Ó«}ssJŨ,ìÅ83’êrxUÞ½1æÏE°€ºŸ:[ pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZB´IDATxœeÏÙP€ác²ëØ—¢PS*ÛPdL»÷Šƒÿò»ûï'ðEôŒþ@L Gà« @ ?&štz+Ë2êt–ÙÔL’B±›m·\H–jš¦Õê¹ï‚níᎂØzÅ» ë)¨žÅ7D" ¡ŠmD–Ÿ’˜ÊHU±vFd§.˜æ0êqò÷«U8®Ï_.‡ðøô‚ ÊeA®s’$½ ÐW÷¿Û›- £X¨»¢IEND®B`‚awl-0.53.orig/docs/api/media/images/Page.png0000644000000000000000000000112011774765542015474 0ustar ‰PNG  IHDR(-SsBITÛáOàêPLTEI²Îë}œÒu”³d…ª»ÐæøüÿOi–‘§ÁÖëÿž¿à/‡»»»ˆˆˆîîî#F€Çãÿ5n”¥Ö… ½ÝÝݲÁÛ™™™æòÿ>a¦µÚÿ:zÌÌ̬½Ûr–ЪªªÕçú*[/VŸÄáÿŠ¢½Pw¹—¸Ù†¢Óðøÿœ¤¸§Äá9rµÂÛz’¼ßïÿÿÿÿÆÙ픫ÑÎçÿ‡¢¿¾Úõéôÿðóø›°Ønµ¦¹ÚJl°¬ÇáWu—ÇÒæ»Çßx–¸._Ÿ²Ù6n‹¤ÓÔéÿ¾ßÿ†§È1„ Ó<„Ž§Ç¡Àà•ªÕ¨Æä}›½ÖO%4 pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZB¯IDATxœ=Èé@@álÑIc¨ìë!Q"mÊáý_ÇL£î¿û1í]O×eY\„cr/Ç '§ (xbYÕjóåH@³ªjY“_ÂA¾à5ŒÑúÕmJÈs\© h‘7íi s²&´Å"ãjB—Û?ô#ÿíg'ßé(¢Fá8Øå>q¬Ü u ›Ùëëû…CÑSX=»)<3@UH&€€”м%u-\IEND®B`‚awl-0.53.orig/docs/api/media/images/Lminus.png0000644000000000000000000000033311774765542016074 0ustar ‰PNG  IHDRêYQtIMEÐ %ý#Àù pHYs ð ðB¬4˜0PLTEÿÿÿ—Ž{y8ÇtRNSÿå·0J0IDATxÚcE!À &6Q% P„0!Jð0ˆQ‹d.Š0˜4i 7g¤»­IEND®B`‚awl-0.53.orig/docs/api/media/images/Constant.png0000644000000000000000000000136011774765542016417 0ustar ‰PNG  IHDR(-SsBITÛáOàSPLTEy5ÌÌÌwwwÿ™Ó}ÿ¥uö|I·hûàΪªªæ`2VNF÷ºM÷€@ÿÏs¶†dèŒîîî´N»»»yK,þ̵™™™ÿ§i_WøšGØ\)ÿÿÿð™ä·™ÿ³4ì¶“ªQÝ’eÿÅXˆˆˆÝÝÝŸ\2ŒI#ŸoOûÕ¾ÿ¢ú®1ÿˆQý÷òäzEÿ™fËV%Í{ù»˜ÿÓŠèÑÁÜtÿ¸?ÿ²í”+ÿʄۊ¨D!’=ÇU%ñsA÷œÿ¯+ÿÃeÿŽda[Vÿ®z^Jö³L§mE|xù±:ý¿OÝ…U/ÿ¤ƒê‚Pý¿¡÷™ îÿÑyìö¯@–?ÿ¦†9ÿ«#ÿ¦YZOFºe Ö`!ö³Œ°XÎS(ÿ»‡þ¼IÔÏËÿÌfæŽÿþ´9ïœ܆ ÿÕ¶Oß{îš(ÃXÿ ÿ¯‘ÿÔ”B!全 pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBæIDATxœc†A(ƒDˆúè9j;Ê BtòX-òù"Ø|A:Îñ|IJJžÁ¼ºŒ‚@?³Œ$%ÏÓT­l)7Fi#>_Î><ÍDŸSAC/0‰Ì—IsWa0tL‚ȇ†ú Ĺ02Äh+%x€øš)V Æl®¦>³W”5“0ƒ ­¤P¿¦&sK¦š2#ƒ´¬­yPš]J€—Alˆ“˜ ƒ´ "W–e² »BX¤²° Ðé*ü66Ñ9B! Ü@>Øs*œêªÞ"‘L >Ä·‚ŒœbbœÂ* ï¶¥.Þï©IEND®B`‚awl-0.53.orig/docs/api/media/images/Page_logo.png0000644000000000000000000000253111774765542016523 0ustar ‰PNG  IHDR D¤ŠÆsBITÛáOàPLTEÿÿÿÑØÞ=== vvv333Zw¥ ÍÖéÀÌä¸ÅݳÀÚ¬»Ø¥¸ØŸµØ’¬Õ„ÎnйˆÅo„±3Z2U“.N†(G{&Ey#Cy!Au;j5bÿÿÿøüÿõùÿï÷ÿçôÿäñÿÞïÿØìÿÔéÿÖåöÎæÿÆãÿÊâûÅáþÃßú½ÞÿÅÚð½ÛùÑØÞµÚÿ½×ï´Øû·ÖõÅÔâÈÑݯÕú¸ÓïµÒïÅÏÙ¾Ïà«ÐöÀÌØ±Íé¬Íï´ÊߥÊî¥Éí©Æå¬ÅÞ¦ÂÞ°ÀÐÃè¤ÀÞª»Ý›½Þ–»à¢·Í•¸ÛŸµØ¥µÅµÍ’µÙ´×•²Î’°Í‹¯Òš¬¿’¬Õ­Í•©¼ˆªË˜¨¹“§¼Œ§Ã‹¤¼‚¥ÇŠ¢Ð†¢½ƒŸ»„Î~ Âœ¬{›»{˜Íy–Ít“Íu”¿u‘Éq’³lÊtŒ§pнk‹«k‰Än‰§h†Ãs‡ b‰Äj‡®b…Æg…¦d„¢c a~£h{”Uz¼]z˜Zw”Xt™Tq—UnNn—SnŠLl”Hh=i¯;b¨9a°B`…7^¬>[.[ª’<…;|;”9w8›5o2ˆ,dÅ^¶°¬tRNS""33DDUUUfffffffffffwˆ™îîîîîîîîîîîÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿö\°ù pHYs  ÒÝ~ü tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBæIDATxœc`ÀŒ˜B|ÙÅ¥•Õ PY\.ÍÆ„®€7P ÔÕÕ5ì&Êp°0£™•×ÐÐд˜>¹‹›U…Zɾ¥Ýž–j ö¹9줛t!ª†9ÖÖÖâ¬;™føøøª ŠæææÀÀÀ¨„6ᘿ¤j˜mÏŒö´+U:¢{(à¨2uP™f¿§xØÉ¨ŒZ’lõ«䚤/´•Qó¨ ¦¥¡cD÷»?¥y˶‡ÅŒ«s­Š@ÿ»~ß—¢nÔÑʈ` ô¥I2åµQߤ)—mqM÷µ!ȶàšö·2Þ­1ySˆ^õ¯¦1®öfó pHYs  ÒÝ~ü tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZB×IDATxœ]ÏaO‚PÆñcZ—#ÕEÊ›i]v¢fˆnµ"ÊÊ” ±µ™}ÿ/R¢m®çճ߻?lÿü¢Mà(ãXrZq9ît‚Ñô„œ€œøÄ0>t»ŸöÎÛ×@×m;Ýmf_€Fppõ6³ì´"´¹óÜê½\³Ð4·ÂÈZB«»HSJ¹Ú&÷IÂf35\Ãçâ±VcÊm4Vp~Üö}_ ÷(bž<|w7×"Ó´/ò<Ùžð¼£K$X†Ô÷‚rSÄ‘#ož?ò ;{Éã†IEND®B`‚awl-0.53.orig/docs/api/media/images/Interface_logo.png0000644000000000000000000000310011774765542017540 0ustar ‰PNG  IHDR ±ˆ?¾sBITÛáOàOPLTEÿÿÿ5Sr¨ÎîªÍëžÅå”¾à‰¶Û±Ú|®Øq¥Õm Ôf™ÌXÊH€½*[”Cs5\ '(F#@: 2 . '8tÇŠ³è€­äy¨ãr¢ál›ßf›Þb“ÜZŽÚT‰ØMƒÔCyÍ1n¾'[®$Y£ãÿ…áÿzÞÿtÜÿkÚÿ–ÏôcØÿ‹ÊóZÖÿRÔÿÆòfÌÿJÒÿWÎýž»éIÑÿBÐÿWÉûxÁñ=Ïÿ•·èZÆúr¿ñ`ÃøMÇüEÇü3ÌÿSÄúk¼ðMÄû]¿÷<ÅüP¿øŠ¯æ3Åýi¶îC¾ùI½øX¹öQ¶ö3½ú;»øh¯ì€¨äD¶öJµõ:·÷Q²òd«ê3µ÷C±ðF¯ô@°òr¢á8¯õ]¥ê@­ô3­õH¨ìpà@§îl›ß<¦ð3§ói˜ßUžå:¤æ3¤ð:¢áb“Ü9œæ3œï1žæ<™àK“Þ1šàZŽÚ3•í/–à1”æ0”Ö3ëS†Ö0à2‹ç1Ø,ŒÏ3„ç-†Ó0ƒÜ.ƒÔH{Í,ƒÍ2~ã*‚Æ2{á0zØ-zÎ)|¿>vÇ*yÄ1uÜ0rÕ-tÍ*sÂ)t¼-nÊ'q¶1n¾º$y‚éóW£(°÷ƒ[”oè˜0} Šk?$ùšæŽ s1 äš;¦Í]±nB»G²|[?PÁ†]»G@=”)˜¹Y•ƒOpl*’|ÏÔ‹Ön…+È·r‰F–o뛺`9B¾‹PÜþ¶ž¾) ­Ú¸® ÄÅ?:µ¨¼¼®¶©£££¿êÔ™@¶íÜ Wà’\T^ÛÒÒÞ9a´i3,X´|ͦ»öì†(¨öO,¬ªoížR¨É TІ›ÐC9˜ÊÄùq‰"Ç21h¾‹ûÁ1È´œÙY§Ó¹äå„h´µ4¶B?—ÎÏ8.—ÛÃD ÔîÃc³u'-VëéÛq»½\0º N”ÒF’$ÛØÀ §À#§Œ”EÈbBO} ð ¡4Ð3l2¢þ_áOµV Ësn|ÂzPÍXŸD„PpÑF³o^·ç?ÐkfÐ{1Èy¸s zÉsž  ŒA_ÎíòT0¨Sðyð;òkÀþÂL£wòzcë„­¼ëÙD“d«²ZŰ콇A$úJÉb½Á`ÐëõÅð@Úò_ ˜)}à;…à@ ÄG¤xì(3âÞÀ®ØàZbDÏÄ!úå ðÛÿ®$€0 ò´2pŒ”ÓT­øç1 Q?üg!^ˆ&ÁÈdEøýã 0x^S`rfDAÃR,f*hü ¦ÿÜ(š’"¢ŽH1 –ÏËÀà‡_QB™Ø×¤hT’âqüÉ-ÿ¼Ä@_K-IQͰ£ã1)‹ÇŠd°µà SB4މa,Ý£'ŽkµZ®h‹&G¡RïEˆe»“Ÿ?º-+SŽF±y{vöîÕääìÈ‚J޹÷Jµ÷b´Ÿ3Ì3‘¢¬i§æ^¸K?Á+™™™+Ã2\¡å?§è>¨Ü*½1Užä2¹-U¡­:²3O›ÅŒŒŒ%³1P”ß0®05ª'qŠ®‰a‰×3™Ì………‡‰4“ÝHŒÚ%¦5:Ÿ>W‘VYƒÖm…{{{XŠSC‘¡Éù6¾ÕÊœ É*¦ª†…þn)Uµü 3’U*êU K³Ëk¤˜ ¥ :%¨;’}J}*`e“——/­f†ñ o.kß’^™IEND®B`‚awl-0.53.orig/docs/api/media/images/StaticVariable.png0000644000000000000000000000126011774765542017522 0ustar ‰PNG  IHDR(-SsBITÛáOà)PLTEƒl1/­å(m°öÖUÿÿÿÌÌÌîîîгEz§Ó@w¯¦ŒÿßyÐŤeº­‹D„²¿ˆu3™Ì2ÅùÿåfܼkøØŒ¸Á©5tÍ®­«Æ¢JO™ãëЉ”€LeÙÝÝÝõÇmúåmñävÿåŽHÎû­ÈáB—ÆÞ²Yè× ÿïyo¨¿…vQCŒÞõÙcÿítÒ¿Š­”V‘´Ö“zB6c©.ªáÿÝ•LyÏI”áë¿a"E‰úêw?·êf™Ìÿ…@ÿß]»»»ÿô†Õ¶Ke§æOÓÿæ¿Zr¡Ñùàoÿä‚m“Û/Ü6aº;Îÿ…¤áÿ÷ŒÎ¨NøÍk1´ðµ«Ú»Qûß_ÿÞšÿèkÿêp¡†HײRÿ݇ðÔßÀrWžäÿê“´˜Pÿò”WÕÿΫJùÎr/Rd£ pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBÐIDATxœc`aS1àààpµæec9§)3mq#9˜€G‚·w€'§=T@ÖYˆQU,*JšGŽ " lÌéîÎÍÊ°Ò ‰uÐÐÐpó‘ ˜ ª+9(jh(„ê¨q±¼,BâòaaÂÁ.úr ,lrö&¾–ºº¡ÂÂvá@Ö0_˜ÙO, 'Êä Û9ò °Øxäu€\fvIC- %zæ.Aމ¶ l¹À8>¾p-V°KÁ€M ~AKÅ‘ÍIEND®B`‚awl-0.53.orig/docs/api/media/images/StaticMethod.png0000644000000000000000000000122511774765542017216 0ustar ‰PNG  IHDR(-SsBITÛáOà#PLTEC ßìá3fÌ"Ž+|³é=Ô2EŽÞt¦rDfGXVÎæÍ§Æ¨^¸KðõðJ‚JC‘¶¤|ðÕZßJÿî‰ÝÅ…ÝÀJøÛuÿö›¨†Cüúôöäxúäl÷ÙYæÊRÎ¥Ra^YÿíuŒu>ÿë£îÆoÿã—ÿá`èáË~zf–y;ܺUÿèk·œÿèžßÀWæÉOðÑS™sÿ  pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBåIDATxœcpƒEN(ƒD°ÆÊÇÉpBt£-\]=Õ}™œ½8A‚ÑfÚž"22¼zLþüœ@ïm^ Õr æwcŒ ÷qCõ…TíüÄ9b=edMBCíí…TùŒ¬¥¸}D@ò@¾A’‘?ƒ› D^(ÌPBG‘ÁŠIÊÓ badà4×Òׂ0HaSI~7s99U©°dMæx[c.i7N ŽD>C÷HežIFN Ó¥UüŒ\Ô„mE€|°ç¤ÅmØ•#X@|ˆo9ùʏÄ¥AÞk©/øÓ6€úIEND®B`‚awl-0.53.orig/docs/api/media/images/tutorial.png0000644000000000000000000000065711774765542016501 0ustar ‰PNG  IHDR(-SsBITÛáOàWPLTERRR¿Ìò½½½ŒŒŒ3Ìÿÿÿ@fÙÕÕÕsssîî¦oŒâæææÌÌÌfff¬¬¬™™™„„„ïòüÞÞÞÏÙõÅÅÅYYYµµµfff{{{™™™÷÷÷pâöÍ] pHYs  ÒÝ~ü tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/03/03a.='¡IDATxœ]ÏÑà Pª£(«£¶1îÿ¿sØ4[2L<‘‹þ\§ºótBñ†!-!ÆVXÇ„!v}®;R)4 HíÕÛ Rõ e¦ìË˺¸Ÿ€DÖ…ëcAL.À6³oà ÒZÎòÝŽ([¼!’ÏÕ¦°Œ+4 `¡CJKIU¥l,Fç=;ÇŽPtî’¸çYÐùúúÜ‹}­µ8[î÷ îƒ òIEND®B`‚awl-0.53.orig/docs/api/media/images/AbstractClass.png0000644000000000000000000000115411774765542017360 0ustar ‰PNG  IHDR(-SsBITÛáOàºPLTEÿÿÿË¢¢ŽÔ}}Ñ{{Ìff¾YYºPP¸KK·BB¶<<®00£ ™ŒfÁaaÃPPÿ33¾BB·BBÿ''º88ÿ´11®00ÿµ))°''ÿõ­!!ÿé «ÿ¦øðçßלÌý´¯¦™Œ„{rfŽV?>tRNS""3DUfffwwwˆˆˆˆˆˆˆîîîÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿã pHYs  ÒÝ~ü tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZB±IDATxœMÈkB0Æá­­•¢#I¤3¦¥0úþ_«gò«îW÷ÿB­žn †°Ñx2í`ŒúóÅÊq]ß÷ç›I1ÒK{ãÁ‚ý)µAÆÚŽXñ§Ô(8›O‡Q’•C×k: ×°õšæ ø  c~¯a´ šNÒBÁø°¯“'âQT“ë ¾÷ô‘• ¦·,Ï ˜”ÕëÐ5-YªUÐ3F¦Lû޵ ˜Ðß~? ?¥æ IEND®B`‚awl-0.53.orig/docs/api/media/images/folder.png0000644000000000000000000000075411774765542016107 0ustar ‰PNG  IHDR(-SsBITÛáOà¨PLTES9ªªªõÉ6²‡ ˆˆˆÿÿÿΩ+¢x!þçOšræÝ¾Ú¼8³?úíWÛÈ“þàHÝÝÝ¿›0ÿñkmIÕÌ®¸ U̯6ÿÜCÒǨ­„2òí×ÿ÷q|SÿÕ<ÿíTή1ÿäKÅ£+ÿñXîîîåÌDÏ´<ÿÙ@ÿø_ϳ2ÿô[¬…´‹(Ã'°‰9»šVàԮʯ@ÿÿsϵ@Z<¡tË¥*®†,½œZùOå` pHYs ð ðB¬4˜ tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time04/02/03Ù’ZBIDATxœeÈk0€á×i¢M16‡j‰®m*‡üÿÆÂex¾Ý ~‚ÿ1¹a¼ºú»÷Xç²dõb>6–pÌR¥Ôvš™zuø"¥&$Š'Ž=—ÞH­õË\™a™ 3’¤µ÷p;f–92Ãrø‡ …‚Xîæ†{7eLjòC£€ZU~§ÿÕ¸&€G:çIEND®B`‚awl-0.53.orig/docs/api/index.html0000644000000000000000000000164011774765543013573 0ustar awl <H2>Frame Alert</H2> <P>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.</P> awl-0.53.orig/docs/api/awl/0000755000000000000000000000000011774765552012360 5ustar awl-0.53.orig/docs/api/awl/User/0000755000000000000000000000000011774765552013276 5ustar awl-0.53.orig/docs/api/awl/User/_User.php.html0000644000000000000000000002034311774765550016027 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page User.php

File/User.php

Description

A class to handle reading, writing, viewing, editing and validating usr records.

Classes
Class Description
 class User A class to handle reading, writing, viewing, editing and validating usr records.
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ("AWLUtilities.php") (line 11)
 require_once ("Session.php") (line 16)

We need to access some session information.

 require_once ("DataEntry.php") (line 21)

We use the DataEntry class for data display and updating

 require_once ("DataUpdate.php") (line 26)

We use the DataUpdate class and inherit from DBRecord

Documentation generated on Wed, 04 Jul 2012 07:06:16 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/User/User.html0000644000000000000000000005263111774765550015107 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class User

 Class User

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A class to handle reading, writing, viewing, editing and validating usr records.

Located in /User.php (line 34)

DBRecord
   |
   --User
Method Summary
 User User (int $id, [string $prefix = ""])
 boolean AllowedTo (string $whatever)
 void GetRoles ()
 string Render ()
 string RenderFields (object $ef, [string $title = null])
 string RenderRoles ( $ef, [ $title = null])
 boolean Validate ()
 Success. Write ()
 Success. WriteRoles ()
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Inherited Variables

Inherited from DBRecord

DBRecord::$EditMode
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor User (line 57)

The constructor initialises a new record, potentially reading it from the database.

User User (int $id, [string $prefix = ""])
  • int $id: The user_no, or 0 if we are creating a new one
  • string $prefix: The prefix for entry fields
AllowedTo (line 98)

Can the user do this?

  • return: Whether they are allowed to.
boolean AllowedTo (string $whatever)
  • string $whatever: What the user wants to do
GetRoles (line 149)

Get the group memberships for the user

void GetRoles ()
Render (line 164)

Render the form / viewer as HTML to show the user

  • return: An HTML fragment to display in the page.
string Render ()
RenderFields (line 198)

Render the core details to show to the user

  • return: An HTML fragment to display in the page.
string RenderFields (object $ef, [string $title = null])
  • object $ef: The entry form.
  • string $title: The title to display above the entry fields.
RenderRoles (line 269)

Render the user's administrative roles

  • return: The string of html to be output
string RenderRoles ( $ef, [ $title = null])
  • $ef
  • $title
Validate (line 315)

Validate the information the user submitted

  • return: Whether the form data validated OK.
boolean Validate ()
Write (line 349)

Write the User record.

Success. Write ()

Redefinition of:
DBRecord::Write()
To write the record to the database
WriteRoles (line 377)

Write the roles associated with the user

Success. WriteRoles ()

Inherited Methods

Inherited From DBRecord

 DBRecord::DBRecord()
 DBRecord::AddTable()
 DBRecord::Get()
 DBRecord::Initialise()
 DBRecord::PostToValues()
 DBRecord::Read()
 DBRecord::Set()
 DBRecord::Undefine()
 DBRecord::Write()
 DBRecord::_BuildFieldList()
 DBRecord::_BuildJoinClause()
 DBRecord::_BuildWhereClause()
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:16 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/classEditor/0000755000000000000000000000000011774765552014634 5ustar awl-0.53.orig/docs/api/awl/classEditor/_classEditor.php.html0000644000000000000000000001663411774765545020737 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page classEditor.php

File/classEditor.php

Description

Class for editing a record using a templated form.

Classes
Class Description
 class EditorField A class for the fields in the editor
 class Editor The class for the Editor form in full
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ("DataUpdate.php") (line 12)
 require_once ("DataEntry.php") (line 13)

Documentation generated on Wed, 04 Jul 2012 07:06:13 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/classEditor/Editor.html0000644000000000000000000014610111774765545016755 0ustar Docs For Class Editor

 Class Editor

Description

The class for the Editor form in full

Located in /classEditor.php (line 111)


	
			
Variable Summary
 mixed $Action
 mixed $BaseTable
 mixed $Fields
 mixed $Id
 mixed $Joins
 mixed $Limit
 mixed $NewWhere
 mixed $Order
 mixed $Query
 mixed $Record
 mixed $SubmitName
 mixed $Template
 mixed $Title
 mixed $Where
Method Summary
 Editor __construct ([ $title = ""], [ $fields = null])
 void AddAttribute ( $field,  $k,  $v)
 void &AddField ( $field, [ $sql = ""], [ $lookup_sql = ""])
 void AndWhere ( $more_where)
 void Assign (string $value_field_name, string $new_value)
 void Available ()
 void GetRecord ([ $where = ""])
 void Id ([string $id = null])
 void Initialise (array $values)
 void IsCreate ()
 void IsSubmit ()
 void IsUpdate ()
 void Layout ( $template)
 void MoreWhere ( $operator,  $more_where)
 void OrWhere ( $more_where)
 void PostToValues ([ $prefix = ''])
 void Render ([ $title_tag = null])
 string ReplaceEditorPart (array $matches)
 void SetBaseTable ( $base_table)
 void SetJoins ( $join_list)
 void SetLookup ( $field,  $lookup_sql)
 void SetOptionList ( $field,  $options, [ $current = null], [ $parameters = null])
 void SetRecord ( $row)
 void SetSql ( $field,  $sql)
 void SetSubmitName ( $new_submit)
 void SetTemplate ( $template)
 void SetWhere ( $where_clause)
 string Title ([string $new_title = null])
 void Value (string $value_field_name)
 void WhereNewRecord ( $where_clause)
 void Write ([boolean $is_update = null])
Variables
mixed $Action (line 114)
mixed $BaseTable (line 117)
mixed $Fields (line 115)
mixed $Id (line 128)
mixed $Joins (line 118)
mixed $Limit (line 122)
mixed $NewWhere (line 120)
mixed $Order (line 121)
mixed $OrderedFields (line 116)
mixed $Query (line 123)
mixed $Record (line 126)
mixed $RecordAvailable (line 125)
mixed $SubmitName (line 127)
mixed $Template (line 124)
mixed $Title (line 113)
mixed $Where (line 119)
Methods
Constructor __construct (line 130)
Editor __construct ([ $title = ""], [ $fields = null])
  • $title
  • $fields
AddAttribute (line 207)
void AddAttribute ( $field,  $k,  $v)
  • $field
  • $k
  • $v
AddField (line 159)
void &AddField ( $field, [ $sql = ""], [ $lookup_sql = ""])
  • $field
  • $sql
  • $lookup_sql
AndWhere (line 270)
void AndWhere ( $more_where)
  • $more_where
Assign (line 189)

Assigns the value of a field in the record currently associated with this editor.

void Assign (string $value_field_name, string $new_value)
  • string $value_field_name
  • string $new_value
Available (line 288)
void Available ()
GetRecord (line 326)
void GetRecord ([ $where = ""])
  • $where
Id (line 198)

Sets or returns the form ID used for differentiating this form from others in the page.

void Id ([string $id = null])
  • string $id
Initialise (line 303)

Set some particular values to the ones from the array.

void Initialise (array $values)
  • array $values: An array of fieldname / value pairs
IsCreate (line 250)
void IsCreate ()
IsSubmit (line 237)
void IsSubmit ()
IsUpdate (line 241)
void IsUpdate ()
Layout (line 282)
void Layout ( $template)
  • $template
MoreWhere (line 262)
void MoreWhere ( $operator,  $more_where)
  • $operator
  • $more_where
OrWhere (line 274)
void OrWhere ( $more_where)
  • $more_where
PostToValues (line 316)

This will assign $_POST values to the internal Values object for each field that exists in the Fields array.

void PostToValues ([ $prefix = ''])
  • $prefix
Render (line 472)

Render the templated component. The heavy lifting is done by the callback...

void Render ([ $title_tag = null])
  • $title_tag
ReplaceEditorPart (line 354)

Replace parts into the form template.

  • return: What we want to replace this match with.
string ReplaceEditorPart (array $matches)
  • array $matches: The matches found which preg_replace_callback is calling us for.
SetBaseTable (line 212)
void SetBaseTable ( $base_table)
  • $base_table
SetJoins (line 216)
void SetJoins ( $join_list)
  • $join_list
SetLookup (line 169)
void SetLookup ( $field,  $lookup_sql)
  • $field
  • $lookup_sql
SetOptionList (line 203)
void SetOptionList ( $field,  $options, [ $current = null], [ $parameters = null])
  • $field
  • $options
  • $current
  • $parameters
SetRecord (line 292)
void SetRecord ( $row)
  • $row
SetSql (line 165)
void SetSql ( $field,  $sql)
  • $field
  • $sql
SetSubmitName (line 233)
void SetSubmitName ( $new_submit)
  • $new_submit
SetTemplate (line 278)
void SetTemplate ( $template)
  • $template
SetWhere (line 254)
void SetWhere ( $where_clause)
  • $where_clause
Title (line 227)

Accessor for the Title for the browse, which could set the title also.

  • return: The current title for the browser
string Title ([string $new_title = null])
  • string $new_title: The new title for the browser
Value (line 179)

Gets the value of a field in the record currently assigned to this editor.

void Value (string $value_field_name)
  • string $value_field_name
WhereNewRecord (line 258)
void WhereNewRecord ( $where_clause)
  • $where_clause
Write (line 495)

Write the record

void Write ([boolean $is_update = null])
  • boolean $is_update: Tell the write whether it's an update or insert. Hopefully it should be able to figure it out though.

Documentation generated on Wed, 04 Jul 2012 07:06:13 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/classEditor/EditorField.html0000644000000000000000000005421211774765545017722 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class EditorField

 Class EditorField

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A class for the fields in the editor

Located in /classEditor.php (line 19)


	
			
Variable Summary
 mixed $Attributes
 mixed $Field
 mixed $LookupSql
 mixed $OptionList
 mixed $Sql
 mixed $Value
Method Summary
 EditorField __construct ( $field, [ $sql = ""], [ $lookup_sql = ""])
 void AddAttribute ( $k,  $v)
 void GetTarget ()
 void RenderLabel ( $wrapme)
 void Set ( $value)
 void SetLookup ( $lookup_sql)
 void SetOptionList ( $options, [ $current = null], [ $parameters = null])
 void SetSql ( $sql)
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
mixed $Attributes (line 24)
mixed $Field (line 21)
mixed $LookupSql (line 25)
mixed $OptionList (line 26)
mixed $Sql (line 22)
mixed $Value (line 23)
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor __construct (line 28)
EditorField __construct ( $field, [ $sql = ""], [ $lookup_sql = ""])
  • $field
  • $sql
  • $lookup_sql
AddAttribute (line 79)
void AddAttribute ( $k,  $v)
  • $k
  • $v
GetTarget (line 74)
void GetTarget ()
RenderAttributes (line 91)
void RenderAttributes ()
RenderLabel (line 83)
void RenderLabel ( $wrapme)
  • $wrapme
Set (line 36)
void Set ( $value)
  • $value
SetLookup (line 44)
void SetLookup ( $lookup_sql)
  • $lookup_sql
SetOptionList (line 48)
void SetOptionList ( $options, [ $current = null], [ $parameters = null])
  • $options
  • $current
  • $parameters
SetSql (line 40)
void SetSql ( $sql)
  • $sql
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:13 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/EMail/0000755000000000000000000000000011774765552013347 5ustar awl-0.53.orig/docs/api/awl/EMail/_EMail.php.html0000644000000000000000000001511211774765546016154 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page EMail.php

File/EMail.php

Description

Lightweight class for sending an e-mail.

Classes
Class Description
 class EMail Lightweight class for sending an e-mail.
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ("AWLUtilities.php") (line 11)

Documentation generated on Wed, 04 Jul 2012 07:06:14 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/EMail/EMail.html0000644000000000000000000006110111774765546015226 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class EMail

 Class EMail

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Lightweight class for sending an e-mail.

Located in /EMail.php (line 16)


	
			
Method Summary
 EMail __construct ([string $subject = ""], [string $to = ""])
 string AddBcc (string $recipient)
 string AddCc (string $recipient)
 string AddErrorsTo (string $recipient)
 string AddReplyTo (string $recipient)
 string AddTo (string $recipient)
 void Pretend ([string $additional_headers = ""])
 void PretendLog ([string $additional_headers = ""])
 void Send ([string $additional_headers = ""])
 string SetBody ( $body, string $recipient)
 string SetFrom ( $sender, string $recipient)
 string SetSender ( $sender, string $recipient)
 string SetSubject ( $subject, string $recipient)
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor __construct (line 82)

Create the e-mail, optionally assigning the subject and primary recipient.

EMail __construct ([string $subject = ""], [string $to = ""])
  • string $subject: The subject line of the email.
  • string $to: A comma-separated list of addresses for the primary recipient(s).
AddBcc (line 131)

Add another Bcc recipient to the email

  • return: The new Bcc recipient list.
string AddBcc (string $recipient)
  • string $recipient: The email address to append.
AddCc (line 122)

Add another Cc recipient to the email

  • return: The new Cc recipient list.
string AddCc (string $recipient)
  • string $recipient: The email address to append.
AddErrorsTo (line 149)

Add another Error recipient to the email

  • return: The new Error recipient list.
string AddErrorsTo (string $recipient)
  • string $recipient: The email address to append.
AddReplyTo (line 140)

Add another Reply-to address to the email

  • return: The new Reply-to list.
string AddReplyTo (string $recipient)
  • string $recipient: The email address to append.
AddTo (line 113)

Add another recipient to the email

  • return: The new recipient list.
string AddTo (string $recipient)
  • string $recipient: The email address to append.
Pretend (line 238)

Don't actually send the email, just output it directly in the stream(!). We use this method when we're doing regression testing.

void Pretend ([string $additional_headers = ""])
  • string $additional_headers: Any additional headers that are needed.
PretendLog (line 219)

Don't actually send the email, just log it.

void PretendLog ([string $additional_headers = ""])
  • string $additional_headers: Any additional headers that are needed.
Send (line 202)

Actually send the email

void Send ([string $additional_headers = ""])
  • string $additional_headers: Any additional headers that are needed.
SetBody (line 192)

Set the body of the e-mail.

  • return: The new body of the e-mail.
string SetBody ( $body, string $recipient)
  • string $recipient: The email address to append.
  • $body
SetFrom (line 159)

Set the visible From address for the e-mail.

  • return: The new From address
string SetFrom ( $sender, string $recipient)
  • string $recipient: The visible From address
  • $sender
SetSender (line 170)

Set the envelope sender address for the e-mail.

  • return: The new envelope sender address.
string SetSender ( $sender, string $recipient)
  • string $recipient: The e-mail address for the sender
  • $sender
SetSubject (line 181)

Set the subject line for the email

  • return: The new subject line.
string SetSubject ( $subject, string $recipient)
  • string $recipient: The new subject line.
  • $subject
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:14 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/Session/0000755000000000000000000000000011774765552014003 5ustar awl-0.53.orig/docs/api/awl/Session/Session.html0000644000000000000000000012300511774765547016321 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class Session

 Class Session

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A class for creating and holding session information.

Located in /Session.php (line 58)


	
			
Method Summary
 static void _CheckLogout ()
 Session Session ([string $sid = ""])
 boolean AllowedTo (string $whatever)
 void AssignSessionDetails (object $u)
 string BuildConfirmationHash (string $method, string $varname)
 string CheckConfirmationHash (string $method, string $varname)
 void Dbg (string $whatever, string $group, mixed $whatever...)
 void EmailTemporaryPassword ( $username,  $email_address, [ $body_template = ""])
 string FormattedDate (string $indate, [string $type = 'date'])
 void GetRoles ()
 void Log (string $whatever, mixed $whatever...)
 boolean Login (string $username, string $password, [string $authenticated = false])
 boolean LoginRequired ([string $groups = ""])
 boolean LSIDLogin (string $lsid)
 string RenderLoginPanel ()
 void _CheckLogin ()
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
int $email = '' (line 99)

The user's email address from their usr record.

  • access: public
int $fullname = 'Guest' (line 93)

The user's full name from their usr record.

  • access: public
boolean $just_logged_in = false (line 113)

Whether the user logged in to view the current page. Perhaps some details on the login form might pollute an editable form and result in an unplanned submit. This can be used to program around such a problem.

  • access: public
string $last_session_end (line 126)

The date and time that the user requested their last page during their last session.

  • access: public
string $last_session_start (line 119)

The date and time that the user logged on during their last session.

  • access: public
int $logged_in = false (line 105)

Whether this user has actually logged in.

  • access: public
int $session_id = 0 (line 81)

A unique id for this user's logged-in session.

  • access: public
int $username = 'guest' (line 87)

The user's username used to log in.

  • access: public
int $user_no (line 75)

The user_no of the logged in user.

  • access: public
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
static _CheckLogout (line 796)
static void _CheckLogout ()
Constructor Session (line 145)

Create a new Session object.

If a session identifier is supplied, or we can find one in a cookie, we validate it and consider the person logged in. We read some useful session and user data in passing as we do this.

The session identifier contains a random value, hashed, to provide validation. This could be hijacked if the traffic was sniffable so sites who are paranoid about security should only do this across SSL.

A worthwhile enhancement would be to add some degree of external configurability to that read.

Session Session ([string $sid = ""])
  • string $sid: A session identifier.
AllowedTo (line 260)

Checks whether a user is allowed to do something.

The check is performed to see if the user has that role.

  • return: Whether or not the user has the specified role.
boolean AllowedTo (string $whatever)
  • string $whatever: The role we want to know if the user has.
AssignSessionDetails (line 283)

Internal function used to assign the session details to a user's new session.

void AssignSessionDetails (object $u)
  • object $u: The user+session object we (probably) read from the database.
BuildConfirmationHash (line 892)

Build a hash which we can use for confirmation that we didn't get e-mailed a bogus link by someone, and that we actually got here by traversing the website.

  • return: A string we can use as either a GET or POST value (i.e. a hidden field, or a varname=hash pair.
string BuildConfirmationHash (string $method, string $varname)
  • string $method: Either 'GET' or 'POST' depending on the way we will use this.
  • string $varname: The name of the variable which we will confirm
CheckConfirmationHash (line 915)

Check a hash which we created through BuildConfirmationHash

  • return: A string we can use as either a GET or POST value (i.e. a hidden field, or a varname=hash pair.
string CheckConfirmationHash (string $method, string $varname)
  • string $method: Either 'GET' or 'POST' depending on the way we will use this.
  • string $varname: The name of the variable which we will confirm
Dbg (line 230)

DEPRECATED Utility function to log debug stuff with printf expansion, and the ability to enable it selectively.

The enabling is done by setting a variable "$debuggroups[$group] = 1"

void Dbg (string $whatever, string $group, mixed $whatever...)
  • string $group: The name of an arbitrary debug group.
  • string $whatever: A log string
  • mixed $whatever...: Further parameters to be replaced into the log string a la printf
EmailTemporaryPassword (line 632)

E-mails a temporary password in response to a request from a user.

This could be called from somewhere within the application that allows someone to set up a user and invite them.

This function includes EMail.php to actually send the password.

void EmailTemporaryPassword ( $username,  $email_address, [ $body_template = ""])
  • $username
  • $email_address
  • $body_template
FormattedDate (line 852)

Function to reformat an ISO date to something nicer and possibly more localised

  • return: The nicely formatted date.
string FormattedDate (string $indate, [string $type = 'date'])
  • string $indate: The ISO date to be formatted.
  • string $type: If 'timestamp' then the time will also be shown.
GetRoles (line 268)

Internal function used to get the user's roles from the database.

void GetRoles ()
Log (line 202)

DEPRECATED Utility function to log stuff with printf expansion.

This function could be expanded to log something identifying the session, but somewhat strangely this has not yet been done.

void Log (string $whatever, mixed $whatever...)
  • string $whatever: A log string
  • mixed $whatever...: Further parameters to be replaced into the log string a la printf
Login (line 311)

Attempt to perform a login action.

This will validate the user's username and password. If they are OK then a new session id will be created and the user will be cookied with it for subsequent pages. A logged in session will be created, and the $_POST array will be cleared of the username, password and submit values. submit will also be cleared from $_GET and $GLOBALS, just in case.

  • return: Whether or not the user correctly guessed a temporary password within the necessary window of opportunity.
boolean Login (string $username, string $password, [string $authenticated = false])
  • string $username: The user's login name, or at least what they entered it as.
  • string $password: The user's password, or at least what they entered it as.
  • string $authenticated: If true, then authentication has already happened and the password is not checked, though the user must still exist.
LoginRequired (line 582)

Checks that this user is logged in, and presents a login screen if they aren't.

The function can optionally confirm whether they are a member of one of a list of groups, and deny access if they are not a member of any of them.

  • return: Whether or not the user is logged in and is a member of one of the required groups.
boolean LoginRequired ([string $groups = ""])
  • string $groups: The list of groups that the user must be a member of one of to be allowed to proceed.
LSIDLogin (line 437)

Attempts to logs in using a long-term session ID

This is all horribly insecure, but its hard not to be.

  • return: Whether or not the user's lsid cookie got them in the door.
boolean LSIDLogin (string $lsid)
  • string $lsid: The user's value of the lsid cookie.
RenderLoginPanel (line 528)

Renders some HTML for a basic login panel

  • return: The HTML to display a login panel.
string RenderLoginPanel ()
SendTemporaryPassword (line 724)

Sends a temporary password in response to a request from a user.

This is probably only going to be called from somewhere internal. An external caller will probably just want the e-mail, without the HTML that this displays.

void SendTemporaryPassword ()
_CheckLogin (line 809)
void _CheckLogin ()
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:15 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/Session/_Session.php.html0000644000000000000000000003075711774765550017253 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page Session.php

File/Session.php

Description

Session handling class and associated functions

This subpackage provides some functions that are useful around web application session management.

The class is intended to be as lightweight as possible while holding all session data in the database:

  • Session hash is not predictable.
  • No clear text information is held in cookies.
  • Passwords are generally salted MD5 hashes, but individual users may have plain text passwords set by an administrator.
  • Temporary passwords are supported.
  • Logout is supported
  • "Remember me" cookies are supported, and will result in a new Session for each browser session.

Classes
Class Description
 class Session A class for creating and holding session information.
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ('AWLUtilities.php') (line 25)
 require_once ('EMail.php') (line 27)
 require_once ('AwlQuery.php') (line 26)
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
resource $session The session object is global. (line 949)
  • name: $session The session object is global.
Functions
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
check_temporary_passwords (line 36)

Checks what a user entered against any currently valid temporary passwords on their account.

  • return: Whether or not the user correctly guessed a temporary password within the necessary window of opportunity.
boolean check_temporary_passwords (string $they_sent, int $user_no)
  • string $they_sent: What the user entered.
  • int $user_no: Which user is attempting to log on.

Documentation generated on Wed, 04 Jul 2012 07:06:15 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/Utilities/0000755000000000000000000000000011774765552014333 5ustar awl-0.53.orig/docs/api/awl/Utilities/_AWLUtilities.php.html0000644000000000000000000006424711774765544020503 0ustar Docs for page AWLUtilities.php

File/AWLUtilities.php

Description

Utility functions of a general nature which are used by most AWL library classes.

Includes
 require ("Translation.php") (line 367)
Functions
awl_version (line 675)

Return the AWL version

void awl_version ()
check_by_regex (line 397)

Verify a value is OK by testing a regex against it. If it is an array apply it to each element in the array recursively. If it is an object we don't mess with it.

void check_by_regex ( $val,  $regex)
  • $val
  • $regex
dbg_error_log (line 27)

Writes a debug message into the error log using printf syntax. If the first parameter is "ERROR" then the message will _always_ be logged.

Otherwise, the first parameter is a "component" name, and will only be logged if $c->dbg["component"] is set to some non-null value.

If you want to see every log message then $c->dbg["ALL"] can be set, to override the debugging status of the individual components.

  • var: The component to identify itself, or "ERROR", or "LOG:component"
void dbg_error_log ()
dbg_log_array (line 151)

Function to dump an array to the error log, possibly recursively

  • var: Which component should this log message identify itself from
void dbg_log_array ( $component,  $name,  $arr, [ $recursive = false])
  • $component
  • $name
  • $arr
  • $recursive
define_byte_mappings (line 498)
void define_byte_mappings ()
deprecated (line 623)
void deprecated ( $method)
  • $method
fatal (line 58)
void fatal ()
force_utf8 (line 550)
void force_utf8 ( $input)
  • $input
get_fields (line 477)

Get the names of the fields for a particular table

  • return: of string The public fields in the table.
array get_fields (string $tablename)
  • string $tablename: The name of the table.
gzdecode (line 639)
void gzdecode ( $instring)
  • $instring
olson_from_tzstring (line 584)

Try and extract something like "Pacific/Auckland" or "America/Indiana/Indianapolis" if possible.

void olson_from_tzstring ( $tzstring)
  • $tzstring
param_to_global (line 431)

Convert a parameter to a global. We first look in _POST and then in _GET, and if they passed in a bunch of valid characters, we will make sure the incoming is cleaned to only match that set.

void param_to_global (string $varname, string $match_regex, string $alias1, " 3)
  • string $varname: The name of the global variable to put the answer in
  • string $match_regex: The part of the parameter matching this regex will be returned
  • string $alias1: An alias for the name that we should look for first.
  • " 3: ... More aliases, in the order which they should be examined. $varname will be appended to the end.
quoted_printable_encode (line 385)

Process a string to fit the requirements of RFC2045 section 6.7. Note that this works, but replaces more characters than the minimum set. For readability the spaces aren't encoded as =20 though.

void quoted_printable_encode ( $string)
  • $string
replace_uri_params (line 296)

Given a URL (presumably the current one) and a parameter, replace the value of parameter, extending the URL as necessary if the parameter is not already there.

  • return: The URI with the replacements done.
string replace_uri_params (string $uri, array $replacements)
  • string $uri: The URI we will be replacing parameters in.
  • array $replacements: An array of replacement pairs array( "replace_this" => "with this" )
session_salted_md5 (line 194)

Make a salted MD5 string, given a string and (possibly) a salt.

If no salt is supplied we will generate a random one.

  • return: The salt, a * and the MD5 of the salted string, as in SALT*SALTEDHASH
string session_salted_md5 (string $instr, [string $salt = &quot;&quot;])
  • string $instr: The string to be salted and MD5'd
  • string $salt: Some salt to sprinkle into the string to be MD5'd so we don't get the same PW always hashing to the same value.
session_salted_sha1 (line 218)

Make a salted SHA1 string, given a string and (possibly) a salt. PHP5 only (although it could be made to work on PHP4 (@see http://www.openldap.org/faq/data/cache/347.html). The algorithm used here is compatible with OpenLDAP so passwords generated through this function should be able to be migrated to OpenLDAP by using the part following the second '*', i.e.

the '{SSHA}....' part.

If no salt is supplied we will generate a random one.

  • return: A *, the salt, a * and the SHA1 of the salted string, as in *SALT*SALTEDHASH
string session_salted_sha1 (string $instr, [string $salt = &quot;&quot;])
  • string $instr: The string to be salted and SHA1'd
  • string $salt: Some salt to sprinkle into the string to be SHA1'd so we don't get the same PW always hashing to the same value.
session_simple_md5 (line 175)

Make a plain MD5 hash of a string, identifying the type of hash it is

  • return: The *MD5* and the MD5 of the string
string session_simple_md5 (string $instr)
  • string $instr: The string to be salted and MD5'd
session_validate_password (line 234)

Checks what a user entered against the actual password on their account.

  • return: Whether or not the users attempt matches what is already on file.
boolean session_validate_password (string $they_sent, string $we_have)
  • string $they_sent: What the user entered.
  • string $we_have: What we have in the database as their password. Which may (or may not) be a salted MD5.
trace_bug (line 93)

Not as sever as a fatal() call, but we want to log and trace it

void trace_bug ()
uuid (line 349)

Generates a Universally Unique IDentifier, version 4.

RFC 4122 (http://www.ietf.org/rfc/rfc4122.txt) defines a special type of Globally Unique IDentifiers (GUID), as well as several methods for producing them. One such method, described in section 4.4, is based on truly random or pseudo-random number generators, and is therefore implementable in a language like PHP.

We choose to produce pseudo-random numbers with the Mersenne Twister, and to always limit single generated numbers to 16 bits (ie. the decimal value 65535). That is because, even on 32-bit systems, PHP's RAND_MAX will often be the maximum *signed* value, with only the equivalent of 31 significant bits. Producing two 16-bit random numbers to make up a 32-bit one is less efficient, but guarantees that all 32 bits are random.

The algorithm for version 4 UUIDs (ie. those based on random number generators) states that all 128 bits separated into the various fields (32 bits, 16 bits, 16 bits, 8 bits and 8 bits, 48 bits) should be random, except : (a) the version number should be the last 4 bits in the 3rd field, and (b) bits 6 and 7 of the 4th field should be 01. We try to conform to that definition as efficiently as possible, generating smaller values where possible, and minimizing the number of base conversions.

  • return: A UUID, made up of 32 hex digits and 4 hyphens.
  • author: David Holmes <dholmes@cfdsoftware.net>
  • copyright: Copyright (c) CFD Labs, 2006. This function may be used freely for any purpose ; it is distributed without any form of warranty whatsoever.
string uuid ()

Documentation generated on Wed, 04 Jul 2012 07:06:12 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/Browser/0000755000000000000000000000000011774765552014003 5ustar awl-0.53.orig/docs/api/awl/Browser/Browser.html0000644000000000000000000022327311774765544016326 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class Browser

 Class Browser

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Start a new Browser, add columns, set a join and Render it to create a basic list of records in a table.

You can, of course, get a lot fancier with setting ordering, where clauses totalled columns and so forth.

Located in /classBrowser.php (line 174)


	
			
Variable Summary
 mixed $BeginRow
 mixed $CloseRow
 mixed $Columns
 mixed $Distinct
 mixed $DivClose
 mixed $DivOpen
 mixed $ExtraRows
 mixed $FieldNames
 mixed $ForcedOrder
 mixed $Grouping
 mixed $Joins
 mixed $Limit
 mixed $match_value
 mixed $Offset
 mixed $Order
 mixed $OrderField
 mixed $Query
 mixed $SubTitle
 mixed $Title
 mixed $TotalFuncs
 mixed $Totals
 mixed $Union
 mixed $Where
Method Summary
 Browser Browser ([string $title = ""])
 void AddColumn (string $field, [string $header = ""], [string $align = ""], [string $format = ""], [string $sql = ""], [string $class = ""], [ $datatype = ""], [string $hook = null])
 void AddGrouping ( $field, [ $browser_array_key = 0])
 void AddHidden (string $field, [string $sql = ""])
 void AddOrder (string $field, string $direction, [string $browser_array_key = 0], [string $secondary = 0])
 void AddRow ( $column_values)
 void AddTotal (string $column_name, [string $total_function = false])
 void AndWhere (string $more_where)
 boolean DoQuery ()
 void ForceOrder (string $field, string $direction)
 void GetTotal (string $column_name)
 void MatchedRow (string $column, string $value, string $function)
 void MoreWhere (string $operator, string $more_where)
 void OrWhere (string $more_where)
 string Render ([string $title_tag = null], [ $subtitle_tag = null])
 void RowFormat (string $beginrow, string $closerow, string $rowargs)
 void SetDistinct (string $distinct)
 void SetDiv (string $open_div, string $close_div)
 void SetJoins (string $join_list)
 void SetLimit (int $limit_n)
 void SetOffset (int $offset_n)
 void SetOrdering ([ $default_fld = null], [ $default_dir = 'A'], [ $browser_array_key = 0])
 void SetSubTitle (string $sub_title)
 void SetTitle (string $new_title)
 void SetTranslatable (array $column_list)
 void SetUnion (string $union_select)
 void SetWhere (string $where_clause)
 string Title ([string $new_title = null])
 void ValueReplacement (array $matches)
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
mixed $BeginRow (line 194)
mixed $BeginRowArgs (line 196)
mixed $CloseRow (line 195)
mixed $Columns (line 179)
mixed $Distinct (line 183)
mixed $DivClose (line 204)
mixed $DivOpen (line 203)
mixed $ExtraRows (line 199)
mixed $FieldNames (line 178)
mixed $ForcedOrder (line 189)
mixed $Grouping (line 190)
mixed $HiddenColumns (line 180)
mixed $Joins (line 181)
mixed $Limit (line 191)
mixed $match_column (line 200)
mixed $match_function (line 202)
mixed $match_value (line 201)
mixed $Offset (line 192)
mixed $Order (line 185)
mixed $OrderBrowserKey (line 188)
mixed $OrderDirection (line 187)
mixed $OrderField (line 186)
mixed $Query (line 193)
mixed $SubTitle (line 177)
mixed $Title (line 176)
mixed $TotalFuncs (line 198)
mixed $Totals (line 197)
mixed $Union (line 184)
mixed $Where (line 182)
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor Browser (line 211)

The Browser class constructor

Browser Browser ([string $title = ""])
  • string $title: A title for the browser (optional).
AddColumn (line 257)

Add a column to the Browser.

This constructs a new BrowserColumn, appending it to the array of columns in this Browser.

Note that if the $format parameter starts with '<td>' the format will replace the column format, otherwise it will be used within '<td>...</td>' tags.

void AddColumn (string $field, [string $header = ""], [string $align = ""], [string $format = ""], [string $sql = ""], [string $class = ""], [ $datatype = ""], [string $hook = null])
  • string $field: The name of the field.
  • string $header: A column header for the field.
  • string $align: An alignment for column values.
  • string $format: A sprintf format for displaying column values.
  • string $sql: An SQL fragment for calculating the value.
  • string $class: A CSS class to apply to the cells of this column.
  • string $hook:

    The name of a global function which will preprocess the column value

    The hook function should be defined as follows: function hookfunction( $column_value, $column_name, $database_row ) { ... return $value; }

  • $datatype
AddGrouping (line 446)
void AddGrouping ( $field, [ $browser_array_key = 0])
  • $field
  • $browser_array_key
AddHidden (line 272)

Add a hidden column - one that is present in the SQL result, but for which there is no column displayed.

This can be useful for including a value in (e.g.) clickable links or title attributes which is not actually displayed as a visible column.

void AddHidden (string $field, [string $sql = ""])
  • string $field: The name of the field.
  • string $sql: An SQL fragment to calculate the field, if it is calculated.
AddOrder (line 471)

Add an ordering to the browser widget.

The ordering can be overridden by GET parameters which will be rendered into the column headers so that a user can click on the column headers to control the actual order.

void AddOrder (string $field, string $direction, [string $browser_array_key = 0], [string $secondary = 0])
  • string $field: The name of the field to be ordered by.
  • string $direction: A for Ascending, otherwise it will be descending order.
  • string $browser_array_key: Use this to distinguish between multiple browser widgets on the same page. Leave it empty if you only have a single browser instance.
  • string $secondary: Use this to indicate a default secondary order which shouldn't interfere with the default primary order.
AddRow (line 644)

Add an extra arbitrary row onto the end of the browser.

  • var: Contains an array of named fields, hopefully matching the column names.
void AddRow ( $column_values)
  • $column_values
AddTotal (line 554)

Mark a column as something to be totalled. You can also specify the name of a function which may modify the value before the actual totalling.

The callback function will be called with each row, with the first argument being the entire record object and the second argument being only the column being totalled. The callback should return a number, to be added to the total.

void AddTotal (string $column_name, [string $total_function = false])
  • string $column_name: The name of the column to be totalled.
  • string $total_function: The name of the callback function.
AndWhere (line 433)

Add an OR ... to the SQL Where clause

void AndWhere (string $more_where)
  • string $more_where: The extra part of the where clause
DoQuery (line 615)

This method is used to build and execute the database query.

You need not call this method, since Browser::Render() will call it for you if you have not done so at that point.

  • return: The success / fail status of the AwlQuery::Exec()
boolean DoQuery ()
ForceOrder (line 505)

Force a particular ordering onto the browser widget.

void ForceOrder (string $field, string $direction)
  • string $field: The name of the field to be ordered by.
  • string $direction: A for Ascending, otherwise it will be descending order.
GetTotal (line 567)

Retrieve the total from a totalled column

void GetTotal (string $column_name)
  • string $column_name: The name of the column to be totalled.
MatchedRow (line 657)

Replace a row where $column = $value with an extra arbitrary row, returned from calling $function

void MatchedRow (string $column, string $value, string $function)
  • string $column: The name of a column to match
  • string $value: The value to match in the column
  • string $function: The name of the function to call for the matched row
MoreWhere (line 420)

Add an [operator] ... to the SQL Where clause

You will generally want to call OrWhere or AndWhere rather than this function, but hey: who am I to tell you how to code!

void MoreWhere (string $operator, string $more_where)
  • string $operator: The operator to combine with previous where clause parts.
  • string $more_where: The extra part of the where clause
OrWhere (line 442)

Add an OR ... to the SQL Where clause

void OrWhere (string $more_where)
  • string $more_where: The extra part of the where clause
Render (line 702)

This method is used to render the browser as HTML. If the query has not yet been executed then this will call DoQuery to do so.

The browser (including the title) will be displayed in a div with id="browser" so that you can style '#browser tr.header', '#browser tr.totals' and so forth.

  • return: The rendered HTML fragment to display to the user.
string Render ([string $title_tag = null], [ $subtitle_tag = null])
  • string $title_tag: The tag to use around the browser title (default 'h1')
  • $subtitle_tag
RowFormat (line 594)

Set the format for an output row.

The row format is set as an sprintf format string for the start of the row, and a plain text string for the close of the row. Subsequent arguments are interpreted as names of fields, the values of which will be sprintf'd into the beginrow string for each row.

Some special field names exist beginning with the '#' character which have 'magic' functionality, including '#even' which will insert '0' for even rows and '1' for odd rows, allowing a nice colour alternation if the beginrow format refers to it like: 'class="r%d"' so that even rows will become 'class="r0"' and odd rows will be 'class="r1"'.

At present only '#even' exists, although other magic values may be defined in future.

void RowFormat (string $beginrow, string $closerow, string $rowargs)
  • string $beginrow: The new printf format for the start of the row.
  • string $closerow: The new string for the close of the row.
  • string $rowargs: ... The row arguments which will be sprintf'd into the $beginrow format for each row
SetDistinct (line 385)

Set the SQL DISTINCT clause to a specific value.

The whole clause (except the keyword) needs to be supplied

void SetDistinct (string $distinct)
  • string $distinct: The whole clause, after 'DISTINCT'
SetDiv (line 336)

Set a div for wrapping the browse.

void SetDiv (string $open_div, string $close_div)
  • string $open_div: The HTML to open the div
  • string $close_div: The HTML to open the div
SetJoins (line 350)

Set the tables and joins for the SQL.

For a single table this should just contain the name of that table, but for multiple tables it should be the full content of the SQL 'FROM ...' clause (excluding the actual 'FROM' keyword).

void SetJoins (string $join_list)
  • string $join_list
SetLimit (line 396)

Set the SQL LIMIT clause to a specific value.

Only the limit number should be supplied.

void SetLimit (int $limit_n)
  • int $limit_n: A number of rows to limit the SQL selection to
SetOffset (line 407)

Set the SQL OFFSET clause to a specific value.

Only the offset number

void SetOffset (int $offset_n)
  • int $offset_n: A number of rows to offset the SQL selection to, based from the start of the results.
SetOrdering (line 532)

Set up the ordering for the browser. Generally you should call this with the first parameter set as a field to order by default. Call with the second parameter set to 'D' or 'DESCEND' if you want to reverse the default order.

void SetOrdering ([ $default_fld = null], [ $default_dir = 'A'], [ $browser_array_key = 0])
  • $default_fld
  • $default_dir
  • $browser_array_key
SetSubTitle (line 326)

Set a Sub Title for the browse.

void SetSubTitle (string $sub_title)
  • string $sub_title: The sub title string
SetTitle (line 286)

Set the Title for the browse.

This can also be set in the constructor but if you create a template Browser and then clone it in a loop you may want to assign a different Title for each instance.

void SetTitle (string $new_title)
  • string $new_title: The new title for the browser
SetTranslatable (line 308)

Set the named columns to be translatable

void SetTranslatable (array $column_list)
  • array $column_list: The list of columns which are translatable
SetUnion (line 363)

Set a Union SQL statement.

In rare cases this might be useful. It's currently a fairly simple hack which requires you to put an entire valid (& matching) UNION subclause (although without the UNION keyword).

void SetUnion (string $union_select)
  • string $union_select
SetWhere (line 374)

Set the SQL Where clause to a specific value.

The WHERE keyword should not be included.

void SetWhere (string $where_clause)
  • string $where_clause: A valide SQL WHERE ... clause.
Title (line 297)

Accessor for the Title for the browse, which could set the title also.

  • return: The current title for the browser
string Title ([string $new_title = null])
  • string $new_title: The new title for the browser
ValueReplacement (line 673)

Return values from the current row for replacing into a template.

This is used to return values from the current row, so they can be inserted into a row template. It is used as a callback function for preg_replace_callback.

void ValueReplacement (array $matches)
  • array $matches: of string $matches An array containing a field name as offset 1
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:12 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/Browser/_classBrowser.php.html0000644000000000000000000001670311774765545020300 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page classBrowser.php

File/classBrowser.php

Description

Table browser / lister class

Browsers are constructed from BrowserColumns and can support sorting and other interactive behaviour. Cells may contain data which is formatted as a link, or the entire row may be linked through an onclick action.

Classes
Class Description
 class BrowserColumn BrowserColumns are the basic building blocks. You can specify just the field name, and the column header or you can get fancy and specify an alignment, format string, SQL formula and cell CSS class.
 class Browser Start a new Browser, add columns, set a join and Render it to create a basic list of records in a table.
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ("AWLUtilities.php") (line 17)

Documentation generated on Wed, 04 Jul 2012 07:06:12 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/Browser/BrowserColumn.html0000644000000000000000000006320511774765545017502 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class BrowserColumn

 Class BrowserColumn

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

BrowserColumns are the basic building blocks. You can specify just the field name, and the column header or you can get fancy and specify an alignment, format string, SQL formula and cell CSS class.

Located in /classBrowser.php (line 32)


	
			
Variable Summary
 mixed $Align
 mixed $Class
 mixed $current_row
 mixed $Field
 mixed $Format
 mixed $Header
 mixed $Hook
 mixed $Sql
 mixed $Type
Method Summary
 BrowserColumn BrowserColumn (string $field, [string $header = ""], [string $align = ""], [string $format = ""], [string $sql = ""], [string $class = ""], [string $datatype = ""], [string $hook = null])
 void GetTarget ()
 void RenderHeader (string $order_field, string $order_direction, [int $browser_array_key = 0], [string $forced_order = false])
 void RenderValue ( $value, [ $extraclass = ""])
 void SetTranslatable ()
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
mixed $Align (line 38)
mixed $Class (line 39)
mixed $current_row (line 43)
mixed $Field (line 34)
mixed $Format (line 36)
mixed $Header (line 35)
mixed $Hook (line 42)
mixed $Sql (line 37)
mixed $Translatable (line 41)
mixed $Type (line 40)
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor BrowserColumn (line 69)

BrowserColumn constructor. Only the first parameter is mandatory.

BrowserColumn BrowserColumn (string $field, [string $header = ""], [string $align = ""], [string $format = ""], [string $sql = ""], [string $class = ""], [string $datatype = ""], [string $hook = null])
  • string $hook:

    The name of a global function which will preprocess the column value

    The hook function should be defined as follows: function hookfunction( $column_value, $column_name, $database_row ) { ... return $value; }

  • string $field: field The name of the column in the SQL result.
  • string $header: header The text to appear in the column header on output (@see BrowserColumn::RenderHeader()). If this is not supplied then a default of the field name will be used.
  • string $align: align left|center|right - text alignment. Defaults to 'left'.
  • string $format: format A format (a-la-printf) to render data values within. (@see BrowserColumn::RenderValue()). If this is not supplied then the default will ensure the column value is displayed as-is.
  • string $sql: sql Some SQL which will return the desired value to be presented as column 'field' of the result. If this is blank then the column is assumed to be a real data column.
  • string $class: class Additional classes to apply to the column header and column value cells.
  • string $datatype: datatype This will allow 'date' or 'timestamp' to preformat the field correctly before using it in replacements or display. Other types may be added in future.
GetTarget (line 86)

GetTarget

Retrieves a 'field' or '...SQL... AS field' definition for the target list of the SQL.

void GetTarget ()
RenderHeader (line 104)

RenderHeader

Renders the column header cell for this column. This will be rendered as a <th>...</th> with class and alignment applied to it. Browser column headers are clickable, and the ordering will also display an 'up' or 'down' triangle with the column header that the SQL is sorted on at the moment.

void RenderHeader (string $order_field, string $order_direction, [int $browser_array_key = 0], [string $forced_order = false])
  • string $order_field: order_field The name of the field currently being sorted on.
  • string $order_direction: order_direction Whether the sort is Ascending or Descending.
  • int $browser_array_key: browser_array_key Used this to help handle separate ordering of multiple browsers on the same page.
  • string $forced_order: forced_order If true, then we don't allow order to be changed.
RenderValue (line 133)
void RenderValue ( $value, [ $extraclass = ""])
  • $value
  • $extraclass
SetTranslatable (line 129)
void SetTranslatable ()
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:12 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AwlCache.html0000644000000000000000000003645611774765543014733 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class AwlCache

 Class AwlCache

Description

A simple Memcached wrapper supporting namespacing of stored values.

  • author: Andrew McMillan
  • license: LGPL

Located in /AwlCache.php (line 10)


	
			
Method Summary
 AwlCache __construct ()
 void acquireLock ( $something, [ $wait_for = 5])
 void delete ($namespace $namespace, $key $key)
 void flush ()
 void get ($namespace $namespace, $key $key)
 void isActive ()
 void releaseLock ( $something)
 void set ($namespace $namespace, $key $key, $value $value, [$expiry $expiry = 864000])
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor __construct (line 18)

Initialise the cache connection. We use getpid() to give us a persistent connection.

AwlCache __construct ()
acquireLock (line 147)

Acquire a lock on something

void acquireLock ( $something, [ $wait_for = 5])
  • $something
  • $wait_for
delete (line 116)

Delete a value from a namespace/key, or for everything in a namespace if a 'null' key is supplied.

void delete ($namespace $namespace, $key $key)
  • $namespace $namespace
  • $key $key
flush (line 137)

Flush the entire cache

void flush ()
get (line 66)

get a value from the specified namespace / key

void get ($namespace $namespace, $key $key)
  • $namespace $namespace
  • $key $key
isActive (line 48)

So we can find out if we are actually using the cache.

void isActive ()
releaseLock (line 160)

Release a lock

void releaseLock ( $something)
  • $something
set (line 82)

Set a value for the specified namespace/key, perhaps with an expiry (default 10 days)

void set ($namespace $namespace, $key $key, $value $value, [$expiry $expiry = 864000])
  • $namespace $namespace
  • $key $key
  • $value $value
  • $expiry $expiry

Documentation generated on Wed, 04 Jul 2012 07:06:11 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/iCalendar/0000755000000000000000000000000011774765552014242 5ustar awl-0.53.orig/docs/api/awl/iCalendar/_iCalendar.php.html0000644000000000000000000002136511774765546017751 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page iCalendar.php

File/iCalendar.php

Description

A Class for handling iCalendar data.

When parsed the underlying structure is roughly as follows:

iCalendar( array(iCalComponent), array(iCalProp) )

each iCalComponent is similarly structured:

iCalComponent( array(iCalComponent), array(iCalProp) )

Once parsed, $ical->component will point to the wrapping VCALENDAR component of the iCalendar. This will be fine for simple iCalendar usage as sampled below, but more complex iCalendar such as a VEVENT with RRULE which has repeat overrides will need quite a bit more thought to process correctly.

  • author: Andrew McMillan <andrew@mcmillan.net.nz>
  • copyright: Catalyst IT Ltd, Morphoss Ltd <http://www.morphoss.com/>
  • license: GNU GPL v2 or later
  • example: example not found
  • example: example not found
  • example: example not found
  • example: example not found
  • example: example not found
  • example: example not found
Classes
Class Description
 class iCalProp A Class for representing properties within an iCalendar
 class iCalComponent A Class for representing components within an iCalendar
 class iCalendar A Class for handling Events on a calendar (DEPRECATED)
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ('XMLElement.php') (line 49)
 require_once ('AwlQuery.php') (line 50)

Documentation generated on Wed, 04 Jul 2012 07:06:14 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/iCalendar/iCalendar.html0000644000000000000000000012711011774765546017017 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class iCalendar

 Class iCalendar

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A Class for handling Events on a calendar (DEPRECATED)

Located in /iCalendar.php (line 899)


	
			
Method Summary
 static void HttpDateFormat ()
 static void iCalFooter ()
 static void iCalHeader ()
 static void SqlDateFormat ()
 static void SqlDurationFormat ()
 static void SqlUTCFormat ()
 iCalendar iCalendar ( $args)
 void Add (string $key, string $value, [string $parameters = null])
 void AddComponent (iCalComponent $new_component)
 boolean ApplyFilter (array $filter, mixed $value)
 void BuildFromText ( $icalendar)
 void ClearComponents ([string $type = null])
 array ExtractProperty (array $component, string $type, [ $count = 9999])
 array ExtractSubComponent (array $component, string $type, [int $count = 9999])
 void Get ( $key)
 array GetComponents ([string $type = null], [boolean $normal_match = true])
 string JustThisBitPlease ( $type, [ $count = 1])
 void MaskComponents (array $keep)
 arrayref &ParseSomeLines ( $type)
 void Render ([boolean $as_calendar = true], [string $type = null], [array $restrict_properties = null])
 void RFC2445ContentEscape (string $name, string $value)
 string RFC2445ContentUnescape (string $escaped)
 void SaveTimeZones ()
 void Set ( $key,  $value)
 void SetComponents (array $new_component, [string $type = null])
 boolean TestFilter ( $filters, array $filter)
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
static HttpDateFormat (line 1434)
static void HttpDateFormat ()
static iCalFooter (line 1701)
  • todo: Remove this function.
static void iCalFooter ()
static iCalHeader (line 1683)
  • todo: Remove this function.
static void iCalHeader ()
static SqlDateFormat (line 1443)
static void SqlDateFormat ()
static SqlDurationFormat (line 1463)
static void SqlDurationFormat ()
static SqlUTCFormat (line 1453)
static void SqlUTCFormat ()
Constructor iCalendar (line 942)
iCalendar iCalendar ( $args)
  • $args
Add (line 1351)
void Add (string $key, string $value, [string $parameters = null])
  • string $key: The property key
  • string $value: The property value
  • string $parameters: Any parameters to set for the property, as an array of key/value pairs
AddComponent (line 1412)
void AddComponent (iCalComponent $new_component)
  • iCalComponent $new_component: The new component to append to the set
ApplyFilter (line 1580)
  • return: Whether the filter passed / failed.
  • todo: Eventually we need to handle all of these possibilities, which will mean writing several routines:
    • Get Property from Component
    • Get Parameter from Property
    • Test TimeRange
    For the moment we will leave these, until there is a perceived need.
boolean ApplyFilter (array $filter, mixed $value)
  • array $filter: An array of XMLElement defining the filter(s)
  • mixed $value: Either a string which is the single property, or an array of lines, for the component.
BuildFromText (line 1200)

Build the iCalendar object from a text string which is a single iCalendar resource

  • var: The RFC2445 iCalendar resource to be parsed
  • todo: Remove this function.
void BuildFromText ( $icalendar)
  • $icalendar
ClearComponents (line 1387)
void ClearComponents ([string $type = null])
  • string $type: The type of component - omit for all components
DealWithTimeZones (line 1254)

Do what must be done with time zones from on file. Attempt to turn them into something that PostgreSQL can understand...

  • todo: Remove this function.
void DealWithTimeZones ()
DefaultPropertyList (line 1076)

An array of property names that we should always want when rendering an iCalendar

  • todo: Remove this function.
void DefaultPropertyList ()
ExtractProperty (line 1548)
  • return: An array of iCalProperty objects
array ExtractProperty (array $component, string $type, [ $count = 9999])
  • array $component: An array of lines of this component
  • string $type: The type of parameter
  • $count
ExtractSubComponent (line 1512)
  • return: The sub-component lines
array ExtractSubComponent (array $component, string $type, [int $count = 9999])
  • array $component: The component to be parsed
  • string $type: The type of sub-components to be extracted
  • int $count: The number of sub-components to extract (default: 9999)
Get (line 1308)

Get the value of a property in the first non-VTIMEZONE

void Get ( $key)
  • $key
GetComponents (line 1376)
  • return: an array of the sub-components
array GetComponents ([string $type = null], [boolean $normal_match = true])
  • string $type: The type to match (default: All)
  • boolean $normal_match: Set to false to invert the match (default: true)
JustThisBitPlease (line 1095)

A function to extract the contents of a BEGIN:SOMETHING to END:SOMETHING (perhaps multiply) and return just that bit (or, of course, those bits :-)

  • var: The type of thing(s) we want returned.
  • return: A string from BEGIN:SOMETHING to END:SOMETHING, possibly multiple of these
  • todo: Remove this function.
string JustThisBitPlease ( $type, [ $count = 1])
  • $type
  • $count
MaskComponents (line 1423)
void MaskComponents (array $keep)
  • array $keep: An array of component types to be kept
ParseSomeLines (line 1129)

Function to parse lines from BEGIN:SOMETHING to END:SOMETHING into a nested array structure

  • var: The "SOMETHING" from the BEGIN:SOMETHING line we just met
  • return: An array of the things we found between (excluding) the BEGIN & END, some of which might be sub-arrays
  • todo: Remove this function.
arrayref &ParseSomeLines ( $type)
  • $type
Render (line 1715)
void Render ([boolean $as_calendar = true], [string $type = null], [array $restrict_properties = null])
  • boolean $as_calendar: Whether or not to wrap the event in a VCALENDAR
  • string $type: The type of iCalendar object (VEVENT, VTODO, VFREEBUSY etc.)
  • array $restrict_properties: The names of the properties we want in our rendered result.
RFC2445ContentEscape (line 1477)
  • deprecated: This function is deprecated and will be removed eventually.
  • todo: Remove this function.
void RFC2445ContentEscape (string $name, string $value)
  • string $name: The incoming name[;param] prefixing the string.
  • string $value: The incoming string to be escaped.
RFC2445ContentUnescape (line 1237)

Returns a content string with the RFC2445 escaping removed

  • return: The string with RFC2445 content escaping removed.
  • todo: Remove this function.
string RFC2445ContentUnescape (string $escaped)
  • string $escaped: The incoming string to be escaped.
SaveTimeZones (line 1016)
void SaveTimeZones ()
Set (line 1329)

Set the value of a property

void Set ( $key,  $value)
  • $key
  • $value
SetComponents (line 1400)
void SetComponents (array $new_component, [string $type = null])
  • string $type: The type of components to be replaced. Defaults to null, which means all components will be replaced.
  • array $new_component: of iCalComponent $new_components The new components to replace the existing ones
TestFilter (line 1656)
  • return: Whether or not this iCalendar passes the test
boolean TestFilter ( $filters, array $filter)
  • array $filter: An array of XMLElement defining the filter
  • $filters
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:14 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/iCalendar/iCalComponent.html0000644000000000000000000012527011774765546017675 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class iCalComponent

 Class iCalComponent

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A Class for representing components within an iCalendar

Located in /iCalendar.php (line 301)


	
			
Method Summary
 iCalComponent iCalComponent ([ $content = null])
 void AddComponent (iCalComponent $new_component)
 void AddProperty (iCalProp $new_property, [string $value = null], [array $parameters = null])
 void ClearComponents ([string $type = null])
 void ClearProperties ([string $type = null])
 void CollectParameterValues ( $parameter_name)
 array &FirstNonTimezone ([ $type = null])
 array GetComponents ([string $type = null], [boolean $normal_match = true])
 string GetPParamValue (string $type,  $parameter_name)
 void GetProperties ([ $type = null])
 array GetPropertiesByPath ( $path)
 string GetPValue (string $type)
 void GetType ()
 boolean IsAttendee (string $email)
 boolean IsOrganizer (string $email)
 void MaskComponents (array $keep)
 void MaskProperties (array $keep, [array $component_list = null])
 void ParseFrom (string $content)
 void Render ([ $restricted_properties = null])
 void SetComponents (array $new_component, [string $type = null])
 void SetProperties ( $new_properties, [ $type = null])
 void SetType ( $type)
 void UnwrapComponent ( $content)
 void VCalendar ([array $extra_properties = null])
 void WrapComponent ( $content)
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor iCalComponent (line 339)

A basic constructor

iCalComponent iCalComponent ([ $content = null])
  • $content
AddComponent (line 732)

Adds a new subcomponent

void AddComponent (iCalComponent $new_component)
  • iCalComponent $new_component: The new component to append to the set
AddProperty (line 601)

Adds a new property

void AddProperty (iCalProp $new_property, [string $value = null], [array $parameters = null])
  • iCalProp $new_property: The new property to append to the set, or a string with the name
  • string $value: The value of the new property (default: param 1 is an iCalProp with everything
  • array $parameters: The key/value parameter pairs (default: none, or param 1 is an iCalProp with everything)
ClearComponents (line 689)

Clear all components, or the components matching a particular type

void ClearComponents ([string $type = null])
  • string $type: The type of component - omit for all components
ClearProperties (line 564)

Clear all properties, or the properties matching a particular type

void ClearProperties ([string $type = null])
  • string $type: The type of property - omit for all properties
CloneConfidential (line 789)

Clone this component (and subcomponents) into a confidential version of it. A confidential event will be scrubbed of any identifying characteristics other than time/date, repeat, uid and a summary which is just a translated 'Busy'.

void CloneConfidential ()
CollectParameterValues (line 370)

Collect an array of all parameters of our properties which are the specified type

Mainly used for collecting the full variety of references TZIDs

void CollectParameterValues ( $parameter_name)
  • $parameter_name
FirstNonTimezone (line 621)

Get all sub-components, or at least get those matching a type

  • return: an array of the sub-components
array &FirstNonTimezone ([ $type = null])
  • $type
GetComponents (line 671)

Get all sub-components, or at least get those matching a type, or failling to match, should the second parameter be set to false.

  • return: an array of the sub-components
array GetComponents ([string $type = null], [boolean $normal_match = true])
  • string $type: The type to match (default: All)
  • boolean $normal_match: Set to false to invert the match (default: true)
GetPParamValue (line 552)

Get the value of the specified parameter for the first property matching the name. Obviously this isn't so useful for properties which may occur multiply, but most don't.

  • return: The value of the parameter for the property, or null in the case that there was no such property, or no such parameter.
string GetPParamValue (string $type,  $parameter_name)
  • string $type: The name of the parameter we are after.
  • $parameter_name
GetProperties (line 518)

Get all properties, or the properties matching a particular type

void GetProperties ([ $type = null])
  • $type
GetPropertiesByPath (line 843)

Return an array of properties matching the specified path

  • return: An array of iCalProp within the tree which match the path given, in the form [/]COMPONENT[/...]/PROPERTY in a syntax kind of similar to our poor man's XML queries. We also allow COMPONENT and PROPERTY to be !COMPONENT and !PROPERTY for ++fun.
array GetPropertiesByPath ( $path)
  • $path
GetPValue (line 536)

Get the value of the first property matching the name. Obviously this isn't so useful for properties which may occur multiply, but most don't.

  • return: The value of the property, or null if there was no such property.
string GetPValue (string $type)
  • string $type: The type of property we are after.
GetType (line 500)

Return the type of component which this is

void GetType ()
IsAttendee (line 652)

Return true if the person identified by the email address is down as an attendee or organizer for this meeting.

  • return: true if we found 'em, false if we didn't.
boolean IsAttendee (string $email)
  • string $email: The e-mail address of the person we're seeking.
IsOrganizer (line 636)

Return true if the person identified by the email address is down as an organizer for this meeting.

  • return: true if we found 'em, false if we didn't.
boolean IsOrganizer (string $email)
  • string $email: The e-mail address of the person we're seeking.
MaskComponents (line 750)

Mask components, removing any that are not of the types in the list

void MaskComponents (array $keep)
  • array $keep: An array of component types to be kept
MaskProperties (line 768)

Mask properties, removing any that are not in the list

void MaskProperties (array $keep, [array $component_list = null])
  • array $keep: An array of property names to be kept
  • array $component_list: An array of component types to check within
ParseFrom (line 391)

Parse the text $content into sets of iCalProp & iCalComponent within this iCalComponent

void ParseFrom (string $content)
  • string $content: The raw RFC2445-compliant iCalendar component, including BEGIN:TYPE & END:TYPE
Render (line 811)

Renders the component, possibly restricted to only the listed properties

void Render ([ $restricted_properties = null])
  • $restricted_properties
SetComponents (line 718)

Sets some or all sub-components of the component to the supplied new components

void SetComponents (array $new_component, [string $type = null])
  • string $type: The type of components to be replaced. Defaults to null, which means all components will be replaced.
  • array $new_component: of iCalComponent $new_components The new components to replace the existing ones
SetProperties (line 585)

Set all properties, or the ones matching a particular type

void SetProperties ( $new_properties, [ $type = null])
  • $new_properties
  • $type
SetType (line 508)

Set the type of component which this is

void SetType ( $type)
  • $type
UnwrapComponent (line 476)

This unescapes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We accept either case.

void UnwrapComponent ( $content)
  • $content
VCalendar (line 354)

Apply standard properties for a VCalendar

void VCalendar ([array $extra_properties = null])
  • array $extra_properties: Key/value pairs of additional properties
WrapComponent (line 488)

This imposes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We output RFC2445 compliance.

In order to preserve pre-existing wrapping in the component, we split the incoming string on line breaks before running wordwrap over each component of that.

void WrapComponent ( $content)
  • $content
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:14 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/iCalendar/iCalProp.html0000644000000000000000000004245711774765546016660 0ustar Docs For Class iCalProp

 Class iCalProp

Description

A Class for representing properties within an iCalendar

Located in /iCalendar.php (line 57)


	
			
Method Summary
 iCalProp iCalProp ([string $propstring = null])
 string GetParameterValue (string $name)
 string Name ([string $newname = null])
 array Parameters ([array $newparams = null])
 void ParseFrom (string $propstring)
 void Render ()
 void SetParameterValue (string $name, string $value)
 string TextMatch (string $search)
 string Value ([string $newvalue = null])
Methods
Constructor iCalProp (line 100)

The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when iCalComponent::ParseFrom() called iCalComponent::UnwrapComponent().

iCalProp iCalProp ([string $propstring = null])
  • string $propstring: The string from the iCalendar which contains this property.
GetParameterValue (line 215)

Get the value of a parameter

  • return: The value of the parameter
string GetParameterValue (string $name)
  • string $name: The name of the parameter to retrieve the value for
Name (line 151)

Get/Set name property

  • return: The name for the property.
string Name ([string $newname = null])
  • string $newname: [optional] A new name for the property
Parameters (line 184)

Get/Set parameters in their entirety

  • return: The current array of parameters for the property.
array Parameters ([array $newparams = null])
  • array $newparams: An array of new parameter key/value pairs
ParseFrom (line 119)

The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when iCalComponent::ParseFrom() called iCalComponent::UnwrapComponent().

void ParseFrom (string $propstring)
  • string $propstring: The string from the iCalendar which contains this property.
Render (line 248)

Render a suitably escaped RFC2445 content string.

void Render ()
RenderParameters (line 235)

Render the set of parameters as key1=value1[;key2=value2[; ...]] with any colons or semicolons escaped.

void RenderParameters ()
SetParameterValue (line 226)

Set the value of a parameter

void SetParameterValue (string $name, string $value)
  • string $name: The name of the parameter to set the value for
  • string $value: The value of the parameter
TextMatch (line 200)

Test if our value contains a string

  • return: The name for the property.
string TextMatch (string $search)
  • string $search: The needle which we shall search the haystack for.
Value (line 168)

Get/Set the content of the property

  • return: The value of the property.
string Value ([string $newvalue = null])
  • string $newvalue: [optional] A new value for the property

Documentation generated on Wed, 04 Jul 2012 07:06:14 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/PgQuery/0000755000000000000000000000000011774765552013754 5ustar awl-0.53.orig/docs/api/awl/PgQuery/_PgQuery.php.html0000644000000000000000000004136511774765547017200 0ustar Docs for page PgQuery.php

File/PgQuery.php

Description

PostgreSQL query class and associated functions

This subpackage provides some functions that are useful around database activity and a PgQuery class to simplify handling of database queries.

The class is intended to be a very lightweight wrapper with no pretentions towards database independence, but it does include some features that have proved useful in developing and debugging web-based applications:

  • All queries are timed, and an expected time can be provided.
  • Parameters replaced into the SQL will be escaped correctly in order to minimise the chances of SQL injection errors.
  • Queries which fail, or which exceed their expected execution time, will be logged for potential further analysis.
  • Debug logging of queries may be enabled globally, or restricted to particular sets of queries.
  • Simple syntax for iterating through a result set.
The database should be connected in a variable $dbconn before PgQuery.php is included. If not already connected, PgQuery will attempt to connect to the database, successively applying connection parameters from the array in $c->pg_connect.

We will die if the database is not currently connected and we fail to find a working connection.

Classes
Class Description
 class PgQuery The PgQuery Class.
Includes
 require_once ("AWLUtilities.php") (line 56)
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
resource $dbconn The database connection. (line 107)
  • name: $dbconn The database connection.
Functions
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
awl_replace_sql_args (line 219)

Replaces PostgreSQL query with escaped parameters in preparation for execution.

The function takes a variable number of arguments, the first is the SQL string, with replaceable '?' characters (a la DBI). The subsequent parameters being the values to replace into the SQL string.

The values passed to the routine are analyzed for type, and quoted if they appear to need quoting. This can go wrong for (e.g.) NULL or other special SQL values which are not straightforwardly identifiable as needing quoting (or not). In such cases the parameter can be forced to be inserted unquoted by passing it as "array( 'plain' => $param )".

This function is outside the PgQuery class because it is sometimes desirable to build SQL command strings in circumstances where there is no benefit to using the class.

  • return: built query string
The awl_replace_sql_args (string 0, mixed 1)
  • string 0: The query string with replacable '?' characters.
  • mixed 1: The values to replace into the SQL string.
clean_string (line 182)

Clean a string of many suspicious characters

While this is a fairly aggressive approach, it applies in many circumstances where various strings should not contain things that might screw up (e.g.) filesystem semantics. Although not strictly a PgQuery function it's here for the time being until I invent a new "generally useful functions" include.

  • return: The pristine uncontaminated string we can safely use for Just About Anything(tm).
string clean_string (string $unclean, [ $type = 'full'])
  • string $unclean: The dirty filthy string needing washing.
  • $type
connect_configured_database (line 61)

Connect to the database defined in the $c->dbconn[] array

void connect_configured_database ()
duration (line 121)

A duration (in decimal seconds) between two times which are the result of calls to microtime()

This simple function is used by the PgQuery class because the microtime function doesn't return a decimal time, so a simple subtraction is not sufficient.

  • return: difference
double duration (microtime $t1, microtime $t2)
  • microtime $t1: start time
  • microtime $t2: end time
qpg (line 147)

Quote the given string (depending on its type) so that it can be used safely in a PostgreSQL query without fear of SQL injection errors.

Although this function effectively achieves a similar goal to the pg_escape_string() function, it is needed for older versions of PHP (< 4.2.0) and older versions of PostgreSQL (< 7.2.0), however. PgQuery does not attempt to use the newer pg_escape_string() function at this stage.

This function is outside the PgQuery class because it is sometimes desirable to quote values for SQL command strings in circumstances where there is no benefit to using the class.

  • return: NULL, TRUE, FALSE, a plain number, or the original string quoted and with ' and \ characters escaped
string qpg ([mixed $str = null])
  • mixed $str: Data to be converted to a string suitable for including as a value in SQL.

Documentation generated on Wed, 04 Jul 2012 07:06:15 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/PgQuery/PgQuery.html0000644000000000000000000007666111774765547016262 0ustar Docs For Class PgQuery

 Class PgQuery

Description

The PgQuery Class.

This class builds and executes PostgreSQL Queries and traverses the set of results returned from the query.

Example usage

  1.  $sql "SELECT * FROM mytable WHERE mytype = ?";
  2.  $qry new PgQuery$sql$myunsanitisedtype );
  3.  if $qry->Exec("typeselect"__line____file__ )
  4.       && $qry->rows()
  5.  {
  6.    while$row $qry->Fetch() ) {
  7.      do_something_with($row);
  8.    }
  9.  }

Located in /PgQuery.php (line 277)


	
			
Variable Summary
Method Summary
 The __construct (string 0, mixed 1)
 string BuildOptionList ([string $current = ''], [string $location = 'options'], [array $parameters = false])
 resource Exec ([string $location = ''], [int $line = 0], [string $file = ''])
 mixed Fetch ([boolean $as_array = false])
 mixed FetchBackwards ([boolean $as_array = false])
 array Plain (string $field)
 string quote ([mixed $str = null])
 void rows ()
 void SetConnection (resource $new_connection)
 void UnFetch ()
 void _log_error (string $locn, string $tag, string $string, [int $line = 0], [string $file = ""])
Variables
string $errorstring (line 341)

The PostgreSQL error message, if the query fails.

Should be read-only, although any successful Exec should clear it

  • access: public
string $execution_time (line 348)

Stores the query execution time - used to deal with long queries.

should be read-only

  • access: public
double $query_time_warning = 0.3 (line 357)

How long the query should take before a warning is issued.

This is writable, but a method to set it might be a better interface. The default is 0.3 seconds.

  • access: public
int $rows (line 334)

number of rows from pg_numrows - for fetching result

should be read-only

  • access: public
Methods
Constructor __construct (line 367)

Constructor

  • return: PgQuery object
The __construct (string 0, mixed 1)
  • string 0: The query string with replacable '?' characters.
  • mixed 1: The values to replace into the SQL string.
BuildOptionList (line 615)

Build an option list from the query.

  • return: Select box HTML
string BuildOptionList ([string $current = ''], [string $location = 'options'], [array $parameters = false])
  • string $current: Default selection of drop down box (optional)
  • string $location: for debugging purposes
  • array $parameters: an array further parameters, including 'maxwidth' => 20 to set a maximum width
Exec (line 478)

Execute the query, logging any debugging.

Example So that you can nicely enable/disable the queries for a particular class, you could use some of PHPs magic constants in your call.

  1.  $qry->Exec(__CLASS____LINE____FILE__);

  • return: The actual result of the query (FWIW)
resource Exec ([string $location = ''], [int $line = 0], [string $file = ''])
  • string $location: The name of the location for enabling debugging or just to help our children find the source of a problem.
  • int $line: The line number where Exec was called
  • string $file: The file where Exec was called
Fetch (line 525)

Fetch the next row from the query results

  • return: query row
mixed Fetch ([boolean $as_array = false])
  • boolean $as_array: True if thing to be returned is array
FetchBackwards (line 581)

Fetch backwards from the result resource

  • return: query row
mixed FetchBackwards ([boolean $as_array = false])
  • boolean $as_array: True if thing to be returned is array (default: False
Plain (line 455)

Convert a string which has already been quoted and escaped for PostgreSQL into a magic array so that it will be inserted unmodified into the SQL string. Use with care!

  • return: An array with the value associated with a key of 'plain'
array Plain (string $field)
  • string $field: The value which has alread been quoted and escaped.
quote (line 443)

Quote the given string so it can be safely used within string delimiters in a query.

  • return: NULL, TRUE, FALSE, a plain number, or the original string quoted and with ' and \ characters escaped
  • see: qpg() which is where this is really done.
string quote ([mixed $str = null])
  • mixed $str: Data to be converted to a string suitable for including as a value in SQL.
rows (line 429)

Provide a rows() method for forward compatibility with AwlQuery.

void rows ()
SetConnection (line 394)

Use a different database connection for this query

void SetConnection (resource $new_connection)
  • resource $new_connection: The database connection to use.
UnFetch (line 570)

Set row counter back one

In the case that you may like to fetch the same row twice, for example if your SQL returns some columns that are the same for each row, and you want to display them cleanly before displaying the other data repeatedly for each row.

Example

  1.  $master_row $qry->Fetch();
  2.  $qry->UnFetch();
  3.  do_something_first($master_row);
  4.  while$row $qry->Fetch() ) {
  5.    do_something_repeatedly($row);
  6.  }

void UnFetch ()
_log_error (line 412)

Log error, optionally with file and line location of the caller.

This function should not really be used outside of PgQuery. For a more useful generic logging interface consider calling dbg_error_log(...);

void _log_error (string $locn, string $tag, string $string, [int $line = 0], [string $file = ""])
  • string $locn: A string identifying the calling location.
  • string $tag: A tag string, e.g. identifying the type of event.
  • string $string: The information to be logged.
  • int $line: The line number where the logged event occurred.
  • string $file: The file name where the logged event occurred.

Documentation generated on Wed, 04 Jul 2012 07:06:15 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/Validation/0000755000000000000000000000000011774765552014452 5ustar awl-0.53.orig/docs/api/awl/Validation/Validation.html0000644000000000000000000005302111774765550017431 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class Validation

 Class Validation

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Rules used for validation of form fields.

Located in /Validation.php (line 17)


	
			
Method Summary
 Validation Validation (string $func_name)
 void AddRule (string $fieldname, string $error_message, string $function_name)
 boolean not_empty (string $field_string)
 boolean positive_dollars (string $field_string)
 boolean positive_integer (string $field_string)
 string RenderJavascript ([string $prefix = ""], string $onsubmit)
 boolean selected ( $field_string, string $select_string)
 boolean Validate (object $object)
 boolean valid_date_format (string $field_string)
 boolean valid_email_format (string $field_string)
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor Validation (line 40)

Initialise a new validation.

Validation Validation (string $func_name)
  • string $func_name: The javascript function name to call onsubmit of the form
AddRule (line 53)

Adds a validation rule for a specific field upon submission of the form.

You must call RenderRules below RenderFields when outputing the page

void AddRule (string $fieldname, string $error_message, string $function_name)
  • string $fieldname: The name of the field.
  • string $error_message: The message to display on unsuccessful validation.
  • string $function_name: The function to call to validate the field
not_empty (line 129)

Checks if a string is empty

  • return: True if the string is not empty.
boolean not_empty (string $field_string)
  • string $field_string: The field value that is being checked.
positive_dollars (line 150)

Check that the given string is a positive dollar amount.

Use not_empty first if string is required.

  • return: Returns true if the given string is a positive dollar amount.
boolean positive_dollars (string $field_string)
  • string $field_string: The amount to be checked.
positive_integer (line 167)

Check that the given string is a positive integer.

Use not_empty first if string is required.

  • return: Returns true if the given string is a positive integer.
boolean positive_integer (string $field_string)
  • string $field_string: The amount to be checked.
RenderJavascript (line 64)

Returns the javascript for form validation using the rules.

  • return: HTML/Javascript for form validation.
string RenderJavascript ([string $prefix = ""], string $onsubmit)
  • string $onsubmit: The name of the function called on submission of the form.
  • string $prefix: Optional prefix for form fields.
selected (line 139)

Checks that a string is not empty or zero

  • return: True if the string is not empty or equal to 0.
boolean selected ( $field_string, string $select_string)
  • string $select_string: The select value that is being checked.
  • $field_string
Validate (line 99)

Validates the form according to it's rules.

  • return: True if the validation succeeded.
boolean Validate (object $object)
  • object $object: The data object that requires form validation.
valid_date_format (line 193)

Check that the given string matches the user's date format.

Use not_empty first if string is required.

  • return: Returns true if the given string matches the user's date format from session.
boolean valid_date_format (string $field_string)
  • string $field_string: The string to be checked.
valid_email_format (line 179)

Check that the given string is a valid email address.

Use not_empty first if string is required.

  • return: Returns true if the given string is a valid email address.
boolean valid_email_format (string $field_string)
  • string $field_string: The string to be checked.
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:16 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/Validation/_Validation.php.html0000644000000000000000000001514111774765550020357 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page Validation.php

File/Validation.php

Description

Classes to handle validation of form data.

Classes
Class Description
 class Validation Rules used for validation of form fields.
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ("AWLUtilities.php") (line 11)

Documentation generated on Wed, 04 Jul 2012 07:06:16 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/Translation/0000755000000000000000000000000011774765552014656 5ustar awl-0.53.orig/docs/api/awl/Translation/_Translation.php.html0000644000000000000000000002663611774765550021002 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page Translation.php

File/Translation.php

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Functions involved in translating with gettext

Functions
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
awl_set_locale (line 99)

Set the translation to the user's locale. At this stage all we do is call the gettext function.

void awl_set_locale ( $locale)
  • $locale
i18n (line 54)

Mark a string as being internationalized. This is a semaphore method; it does nothing but it allows us to easily identify strings that require translation. Generally this is used to mark strings that will be stored in the database (like descriptions of permissions).

AWL uses GNU gettext for internationalization (i18n) and localization (l10n) of text presented to the user. Gettext needs to know about all places involving strings, that must be translated. Mark any place, where localization at runtime shall take place by using the function translate().

In the help I have used 'xlate' rather than 'translate' and 'x18n' rather than 'i18n' so that the tools skip this particular file for translation :-)

E.g. instead of: print 'TEST to be displayed in different languages'; use: print xlate('TEST to be displayed in different languages'); and you are all set for pure literals. The translation teams will receive that literal string as a job to translate and will translate it (when the message is clear enough). At runtime the message is then localized when printed. The input string can contain a hint to assist translators: print xlate('TT <!-- abbreviation for Translation Test -->'); The hint portion of the string will not be printed.

But consider this case: $message_to_be_localized = 'TEST to be displayed in different languages'; print xlate($message_to_be_localized);

The translate() function is called in the right place for runtime handling, but there is no message at gettext preprocessing time to be given to the translation teams, just a variable name. Translation of the variable name would break the code! So all places potentially feeding this variable have to be marked to be given to translation teams, but not translated at runtime!

This method resolves all such cases. Simply mark the candidates: $message_to_be_localized = x18n('TEST to be displayed in different languages'); print xlate($message_to_be_localized);

  • return: the same value
string i18n (string $value)
  • string $value: the value
init_gettext (line 84)

Initialise our use of Gettext

void init_gettext ( $domain,  $location)
  • $domain
  • $location
translate (line 65)

Convert a string in English to whatever this user's locale is

void translate ( $en)
  • $en
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:16 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/MenuSet/0000755000000000000000000000000011774765552013740 5ustar awl-0.53.orig/docs/api/awl/MenuSet/MenuSet.html0000644000000000000000000010210111774765547016205 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class MenuSet

 Class MenuSet

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A MenuSet is a hierarchy of MenuOptions, some of which might be MenuSet objects themselves.

The menu options are presented in HTML span tags, and the menus themselves are presented inside HTML div tags. All layout and styling is expected to be provide by CSS.

A non-trivial example would look something like this:

  1. require("MenuSet.php");
  2. $main_menu new MenuSet('menu''menu''menu_active');
  3.   ...
  4. $other_menu new MenuSet('submenu''submenu''submenu_active');
  5. $other_menu->AddOption("Extra Other","/extraother.php","Submenu option to do extra things.");
  6. $other_menu->AddOption("Super Other","/superother.php","Submenu option to do super things.");
  7. $other_menu->AddOption("Meta Other","/metaother.php","Submenu option to do meta things.");
  8.   ...
  9. $main_menu->AddOption("Do This","/dothis.php","Option to do this thing.");
  10. $main_menu->AddOption("Do That","/dothat.php","Option to do all of that.");
  11. $main_menu->AddSubMenu$other_menu"Do The Other","/dotheother.php","Submenu to do all of the other things."true);
  12.   ...
  13. if isset($main_menu&& is_object($main_menu) ) {
  14.   $main_menu->AddOption("Home","/","Go back to the home page");
  15.   echo $main_menu->Render();
  16. }
In a hierarchical menu tree, like the example above, only one sub-menu will be shown, which will be the first one that is found to have active menu options.

The menu display will generally recognise the current URL and mark as active the menu option that matches it, but in some cases it might be desirable to force one or another option to be marked as active using the appropriate parameter to the AddOption or AddSubMenu call.

Located in /MenuSet.php (line 222)


	
			
Method Summary
 MenuSet MenuSet (string $div_id, [string $main_class = ''], [string $active_class = 'active'])
 mixed &AddOption (string $label, string $target, [string $title = ""], [string $active = false], [int $sortkey = null], [external $external = false])
 mixed &AddSubMenu (object &$submenu_set, string $label, string $target, [string $title = ""], [string $active = false], [int $sortkey = 2000])
 void MakeSomethingActive ( $test_pattern)
 string Render ([boolean $submenus_inline = false])
 string RenderAsCSS ([ $depth = 0], [ $skip_empty = true], boolean $submenus_inline)
 int Size ()
 int _CompareSequence (objectref $a, objectref $b)
 boolean _HasActive (string $label)
 boolean _OptionExists ( $newlabel)
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor MenuSet (line 276)

Start a new MenuSet with no options.

MenuSet MenuSet (string $div_id, [string $main_class = ''], [string $active_class = 'active'])
  • string $div_id: An ID for the HTML div that the menu will be presented in.
  • string $main_class: A CSS class for most menu options.
  • string $active_class: A CSS class for active menu options.
AddOption (line 295)

Add an option, which is a link.

The call will attempt to work out whether the option should be marked as active, and will sometimes get it wrong.

  • return: A reference to the MenuOption that was added, or false if none were added.
mixed &AddOption (string $label, string $target, [string $title = ""], [string $active = false], [int $sortkey = null], [external $external = false])
  • string $label: A Label for the new menu option
  • string $target: The URL to target for this option.
  • string $title: Some tooltip help for the title tag.
  • string $active: Whether this option should be marked as Active.
  • int $sortkey: An (optional) value to allow option ordering.
  • external $external: open this link in a new window/tab.
AddSubMenu (line 341)

Add an option, which is a submenu

  • return: A reference to the MenuOption that was added, or false if none were added.
mixed &AddSubMenu (object &$submenu_set, string $label, string $target, [string $title = ""], [string $active = false], [int $sortkey = 2000])
  • object &$submenu_set: A reference to a menu tree
  • string $label: A Label for the new menu option
  • string $target: The URL to target for this option.
  • string $title: Some tooltip help for the title tag.
  • string $active: Whether this option should be marked as Active.
  • int $sortkey: An (optional) value to allow option ordering.
LinkActiveSubMenus (line 395)

Mark each MenuOption as active that has an active sub-menu entry.

Currently needs to be called manually before rendering but really should probably be called as part of the render now, and then this could be a private routine.

void LinkActiveSubMenus ()
MakeSomethingActive (line 413)

Mark each MenuOption as active that has an active sub-menu entry.

Currently needs to be called manually before rendering but really should probably be called as part of the render now, and then this could be a private routine.

void MakeSomethingActive ( $test_pattern)
  • $test_pattern
Render (line 462)

Render the menu tree to an HTML fragment.

  • return: The HTML fragment.
string Render ([boolean $submenus_inline = false])
  • boolean $submenus_inline: Indicate whether to render the sub-menus within the menus, or render them entirely separately after we finish rendering the top level ones.
RenderAsCSS (line 494)

Render the menu tree to an HTML fragment.

  • return: The HTML fragment.
string RenderAsCSS ([ $depth = 0], [ $skip_empty = true], boolean $submenus_inline)
  • boolean $submenus_inline: Indicate whether to render the sub-menus within the menus, or render them entirely separately after we finish rendering the top level ones.
  • $depth
  • $skip_empty
Size (line 372)

Find out how many options the menu has.

  • return: The number of options in the menu.
int Size ()
_CompareSequence (line 448)

_CompareSequence is used in sorting the menu options into the sequence order

  • return: ( $a == b ? 0 ( $a > b ? 1 : -1 ))
int _CompareSequence (objectref $a, objectref $b)
  • objectref $a: The first menu option
  • objectref $b: The second menu option
_HasActive (line 354)

Does the menu have any options that are active.

Most likely used so that we can then set the parent menu as active.

  • return: Whether the menu has options that are active.
boolean _HasActive (string $label)
  • string $label: A Label for the new menu option
_OptionExists (line 380)

See if a menu already has this option

  • return: Whether the option already exists in the menu.
boolean _OptionExists ( $newlabel)
  • $newlabel
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:15 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/MenuSet/_MenuSet.php.html0000644000000000000000000002316111774765547017142 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page MenuSet.php

File/MenuSet.php

Description

Some intelligence and standardisation around presenting a menu hierarchy.

See the MenuSet class for examples as that is the primary interface.

Classes
Class Description
 class MenuOption Each menu option is an object.
 class MenuSet A MenuSet is a hierarchy of MenuOptions, some of which might be MenuSet objects themselves.
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ("AWLUtilities.php") (line 15)
Functions
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
_CompareMenuSequence (line 179)

_CompareMenuSequence is used in sorting the menu options into the sequence order

  • return: ( $a == b ? 0 ( $a > b ? 1 : -1 ))
int _CompareMenuSequence (objectref $a, objectref $b)
  • objectref $a: The first menu option
  • objectref $b: The second menu option

Documentation generated on Wed, 04 Jul 2012 07:06:14 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/MenuSet/MenuOption.html0000644000000000000000000004313511774765547016735 0ustar Docs For Class MenuOption

 Class MenuOption

Description

Each menu option is an object.

Located in /MenuSet.php (line 21)


	
			
Variable Summary
 string $rendered
 reference $self
Method Summary
 MenuOption MenuOption (string $label, string $target, [string $title = ""], [string $style = "menu"], [int $sortkey = 1000])
 void Active ([string $style = false])
 void AddSubmenu ( &$submenu_set)
 boolean IsActive ()
 boolean MaybeActive ( $test_pattern,  $active_style)
 string Render ()
 void Set (string $attribute, string $value)
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
string $rendered (line 81)

The rendered HTML fragment (once it has been).

  • access: public
reference $self (line 72)

A reference to this menu option itself

Methods
Constructor MenuOption (line 92)

The thing we click

MenuOption MenuOption (string $label, string $target, [string $title = ""], [string $style = "menu"], [int $sortkey = 1000])
  • string $label: The label to display for this option.
  • string $target: The URL to target for this option.
  • string $title: Some tooltip help for the title tag.
  • string $style: A base class name for this option.
  • int $sortkey: An (optional) value to allow option ordering.
Active (line 139)

Mark it as active, with a fancy style to distinguish that

void Active ([string $style = false])
  • string $style: A style used to highlight that the option is active.
AddSubmenu (line 147)

This menu option is now promoted to the head of a tree

void AddSubmenu ( &$submenu_set)
  • &$submenu_set
IsActive (line 155)

Whether this option is currently active.

  • return: The value of the active flag.
boolean IsActive ()
MaybeActive (line 163)

Whether this option is currently active.

  • return: The value of the active flag.
boolean MaybeActive ( $test_pattern,  $active_style)
  • $test_pattern
  • $active_style
Render (line 109)

Convert the menu option into an HTML string

  • return: The HTML fragment for the menu option.
string Render ()
Set (line 131)

Set arbitrary attributes of the menu option

void Set (string $attribute, string $value)
  • string $attribute: An arbitrary attribute to be set in the hyperlink.
  • string $value: A value for this attribute.

Documentation generated on Wed, 04 Jul 2012 07:06:14 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/XMLElement/0000755000000000000000000000000011774765552014332 5ustar awl-0.53.orig/docs/api/awl/XMLElement/_XMLElement.php.html0000644000000000000000000002227111774765551020122 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page XMLElement.php

File/XMLElement.php

Description

A class to assist with construction of XML documents

Classes
Class Description
 class XMLElement A class for XML elements which may have attributes, or contain other XML sub-elements
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ('AWLUtilities.php') (line 12)
Functions
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
BuildXMLTree (line 338)

Rebuild an XML tree in our own style from the parsed XML tags using a tail-recursive approach.

  • return: Either a single XMLElement, or an array of XMLElement objects.
mixed BuildXMLTree (array $xmltags, intref &$start_from)
  • array $xmltags: An array of XML tags we get from using the PHP XML parser
  • intref &$start_from: A pointer to our current integer offset into $xmltags

Documentation generated on Wed, 04 Jul 2012 07:06:17 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/XMLElement/XMLElement.html0000644000000000000000000010447111774765551017200 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class XMLElement

 Class XMLElement

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A class for XML elements which may have attributes, or contain other XML sub-elements

Located in /XMLElement.php (line 20)


	
			
Variable Summary
 mixed $attributes
 mixed $content
 mixed $tagname
 mixed $xmlns
 mixed $_parent
Method Summary
 XMLElement __construct (string $tagname, [mixed $content = false], [array $attributes = false], [string $xmlns = null])
 void AddSubTag (object An &$v)
 int CountElements ()
 string GetAttribute (string $attr)
 array GetAttributes ()
 array GetContent ()
 array GetElements ([ $tag = null], [ $recursive = false])
 string GetNSTag ()
 array GetPath ( $path)
 string GetTag ()
 objectref &NewElement (string $tagname, [mixed $content = false], [array $attributes = false], [ $xmlns = null])
 void Render ([int $indent = 0], [ $xmldef = ""], [ $nslist = null], [ $force_xmlns = false])
 string RenderContent ([ $indent = 0], [ $nslist = null], [ $force_xmlns = false])
 void SetAttribute (string $k, string $v)
 void SetContent (mixed $v)
 void __tostring ()
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
mixed $attributes (line 23)
  • access: protected
mixed $content (line 24)
  • access: protected
mixed $tagname (line 21)
  • access: protected
mixed $xmlns (line 22)
  • access: protected
mixed $_parent (line 25)
  • access: protected
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor __construct (line 35)

Constructor - nothing fancy as yet.

XMLElement __construct (string $tagname, [mixed $content = false], [array $attributes = false], [string $xmlns = null])
  • string $tagname: The tag name of the new element
  • mixed $content: Either a string of content, or an array of sub-elements
  • array $attributes: An array of attribute name/value pairs
  • string $xmlns: An XML namespace specifier
AddSubTag (line 215)

Add a sub-element

void AddSubTag (object An &$v)
  • object An &$v: XMLElement to be appended to the array of sub-elements
CountElements (line 68)

Count the number of elements

  • return: The number of elements
int CountElements ()
GetAttribute (line 121)

Accessor for a single attribute

  • return: The value of that attribute of the element
string GetAttribute (string $attr)
  • string $attr: The name of the attribute.
GetAttributes (line 132)

Accessor for the attributes

  • return: The attributes of this element
array GetAttributes ()
GetContent (line 141)

Accessor for the content

  • return: The content of this element
array GetContent ()
GetElements (line 151)

Return an array of elements matching the specified tag, or all elements if no tag is supplied.

Unlike GetContent() this will always return an array.

  • return: The XMLElements within the tree which match this tag
array GetElements ([ $tag = null], [ $recursive = false])
  • $tag
  • $recursive
GetNSTag (line 112)

Accessor for the full-namespaced tag name

  • return: The tag name of the element, prefixed by the namespace
string GetNSTag ()
GetPath (line 175)

Return an array of elements matching the specified path

  • return: The XMLElements within the tree which match this tag
array GetPath ( $path)
  • $path
GetTag (line 103)

Accessor for the tag name

  • return: The tag name of the element
string GetTag ()
NewElement (line 230)

Add a new sub-element

  • return: A reference to the new XMLElement
objectref &NewElement (string $tagname, [mixed $content = false], [array $attributes = false], [ $xmlns = null])
  • string $tagname: The tag name of the new element
  • mixed $content: Either a string of content, or an array of sub-elements
  • array $attributes: An array of attribute name/value pairs
  • $xmlns
Render (line 273)

Render the document tree into (nicely formatted) XML

void Render ([int $indent = 0], [ $xmldef = ""], [ $nslist = null], [ $force_xmlns = false])
  • int $indent: The indenting level for the pretty formatting of the element
  • $xmldef
  • $nslist
  • $force_xmlns
RenderContent (line 243)

Render just the internal content

  • return: The content of this element, as a string without this element wrapping it.
string RenderContent ([ $indent = 0], [ $nslist = null], [ $force_xmlns = false])
  • $indent
  • $nslist
  • $force_xmlns
SetAttribute (line 81)

Set an element attribute to a value

void SetAttribute (string $k, string $v)
  • string $k: The attribute name
  • string $v: The attribute value
SetContent (line 94)

Set the whole content to a value

void SetContent (mixed $v)
  • mixed $v: The element content, which may be text, or an array of sub-elements
__tostring (line 324)
void __tostring ()
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:17 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/DataEntry/0000755000000000000000000000000011774765552014253 5ustar awl-0.53.orig/docs/api/awl/DataEntry/EntryField.html0000644000000000000000000004706411774765545017223 0ustar Docs For Class EntryField

 Class EntryField

Description

Individual fields used for data entry / viewing.

This object is not really intended to be used directly. The more normal interface is to instantiate an EntryForm and then issue calls to DataEntryLine() and other EntryForm methods.

Understanding the operation of this class (and possibly auditing the source code, particularly EntryField::Render) will however convey valuable understanding of some of the more esoteric features.

  • todo:

    This class doesn't really provide a huge amount of utility between construct and render, but there must be good things possible there. Perhaps one EntryField is created and used repeatedly as a template (e.g.). That might be useful to support... Why is this a Class anyway? Maybe we should have just done half a dozen functions (one per major field type) and just used those... Maybe we should build a base class for this and extend it to make EntryField in a better way.

    EntryField is only useful at present if you desperately want to use it's simple field interface, but want to intimately control the layout (or parts of the layout), otherwise you should be using EntryForm as the main class.

Located in /DataEntry.php (line 38)


	
			
Variable Summary
 string $attributes
 string $current
 string $rendered
Method Summary
 static string BuildOptionList ( $qry, [string $current = ''], [string $location = 'options'], [array $parameters = false])
 EntryField EntryField (text $intype, text $inname, [text $attributes = ""], [text $current_value = ""])
 void new_lookup (array $attributes)
 text Render ()
Variables
string $attributes (line 69)

An array of key value pairs

  • access: public
string $current (line 63)

The current value

  • access: public
string $rendered (line 75)

Once it actually is...

  • access: public
Methods
static BuildOptionList (line 294)

Build an option list from the query.

  • return: Select box HTML
static string BuildOptionList ( $qry, [string $current = ''], [string $location = 'options'], [array $parameters = false])
  • string $current: Default selection of drop down box (optional)
  • string $location: for debugging purposes
  • array $parameters: an array further parameters, including 'maxwidth' => 20 to set a maximum width
  • $qry
Constructor EntryField (line 137)

Initialise an EntryField, used for data entry.

The following types of fields are possible:

  • select - Will display a select list of the keys/values in $attributes where the key starts with an underscore. The key will have the '_' removed before being used as the key in the list. All the $attributes with keys not beginning with '_' will be used in the normal manner as HTML attributes within the &lt;select ...&gt; tag.
  • lookup - Will display a select list of values from the database. If $attributes defines a '_sql' attibute then that will be used to make the list, otherwise the database values will be from the 'codes' table as in "SELECT code_id, code_value FROM codes WHERE code_type = '_type' ORDER BY code_seq, code_id" using the value of $attributes['_type'] as the code_type.
  • date - Will be a text field, expecting a date value which might be javascript validated at some point in the future.
  • checkbox - Will display a checkbox for an on-off value.
  • textarea - Will display an HTML textarea.
  • file - Will display a file browse / enter field.
  • button - Will display a button field.
  • password - Password entry. This will display entered data as asterisks.

The $attributes array is useful to set specific HTML attributes within the HTML tag used for the entry field however $attribute keys named starting with an underscore ('_') affect the field operation rather than the HTML. For the 'select' field type, these are simply used as the keys / values for the selection (with the '_' removed), but other cases are more complex:

  • _help - While this will be ignored by the EntryField::Render() method the _help should be assigned (or will be assigned the same value as the 'title' attribute) and will (depending on the data-entry line format in force) be displayed as help for the field by the EntryForm::DataEntryLine() method.
  • _sql - When used in a 'lookup' field this controls the SQL to return keys/values for the list. The actual SQL should return two columns, the first will be used for the key and the second for the displayed value.
  • _type - When used in a 'lookup' field this defines the codes type used.
  • _null - When used in a 'lookup' field this will control the description for an option using a '' key value which will precede the list of values from the database.
  • _zero - When used in a 'lookup' field this will control the description for an option using a '0' key value which will precede the list of values from the database.
  • _label - When used in a 'radio' or 'checkbox' field this will wrap the field with an HTML label tag as <label ...><input field...>$attributes['_label']</label>
  • -

EntryField EntryField (text $intype, text $inname, [text $attributes = ""], [text $current_value = ""])
  • text $intype: The type of field: select | lookup | date | checkbox | textarea | file | button | password (anything else is dealt with as "text")
  • text $inname: The name of the field.
  • text $attributes: An associative array of extra attributes to be applied to the field. Optional, but generally important. Some $attribute keys have special meaning, while others are simply added as HTML attributes to the field.
  • text $current_value: The current value to use to initialise the field. Optional.
new_lookup (line 283)

Function called indirectly when a new EntryField of type 'lookup' is created.

void new_lookup (array $attributes)
  • array $attributes: The attributes array that was passed in to the new EntryField() constructor.
Render (line 162)

Render an EntryField into HTML

text Render ()

Documentation generated on Wed, 04 Jul 2012 07:06:13 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/DataEntry/_DataEntry.php.html0000644000000000000000000001621211774765545017765 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page DataEntry.php

File/DataEntry.php

Description

Classes to handle entry and viewing of field-based data.

Classes
Class Description
 class EntryField Individual fields used for data entry / viewing.
 class EntryForm A class to handle displaying a form on the page (for editing) or a structured layout of non-editable content (for viewing), with a simple switch to flip from view mode to edit mode.
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ("AWLUtilities.php") (line 11)

Documentation generated on Wed, 04 Jul 2012 07:06:13 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/DataEntry/EntryForm.html0000644000000000000000000010675111774765545017102 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class EntryForm

 Class EntryForm

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A class to handle displaying a form on the page (for editing) or a structured layout of non-editable content (for viewing), with a simple switch to flip from view mode to edit mode.

Located in /DataEntry.php (line 334)


	
			
Method Summary
 static string _ParseAttributes ([ $ftype = ''], [ $attributes = ''])
 EntryForm EntryForm (string $action,  &$record, [ $editing = false], objectref $record, boolean $editmode)
 string BreakLine ([ $text = ''])
 string DataEntryField ( $format, [ $ftype = ''], [ $base_fname = ''], [ $attributes = ''], [ $prefix = ''])
 string DataEntryLine ( $prompt,  $field_format, [ $ftype = ''], [ $fname = ''], [ $attributes = ''], [ $prefix = ''])
 string EndForm ()
 void HelpInCell ()
 void HelpInLine ()
 string HiddenField (string $fname,  $fvaluei, [ $fid = null], string $fvalue)
 string MultiEntryLine ( $prompt_options,  $prompt_name,  $default_prompt,  $format, [ $ftype = ''], [ $fname = ''], [ $attributes = ''],  $prefix)
 void NoHelp ()
 void PopulateForm ( &$record, [string $prefix = ""], objectref $record)
 void SimpleForm ([ $new_format = '<span class="prompt">%s:</span>&nbsp;<span class="entry">%s</span>'])
 string StartForm ([array $extra_attributes = ''])
 string SubmitButton ( $fname,  $fvalue, [ $attributes = ''])
 void TempLineFormat ([string $new_format = '<span class="prompt">%s:</span>&nbsp;<span class="entry">%s</span>'])
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
static _ParseAttributes (line 532)

Internal function for parsing the type extra on a field.

If the '_help' attribute is not set it will be assigned the value of the 'title' attribute, if there is one.

If the 'class' attribute is not set it will be assigned to 'flookup', 'fselect', etc, according to the field type.

  • return: The parsed type extra.
static string _ParseAttributes ([ $ftype = ''], [ $attributes = ''])
  • $ftype
  • $attributes
Constructor EntryForm (line 394)

Initialise a new data-entry form.

EntryForm EntryForm (string $action,  &$record, [ $editing = false], objectref $record, boolean $editmode)
  • string $action: The action when the form is submitted.
  • objectref $record: A reference to the database object we are displaying / editing.
  • boolean $editmode: Whether we are editing.
  • &$record
  • $editing
BreakLine (line 504)

A utility function for a heading line within a data entry table

  • return: The HTML fragment to end the form.
string BreakLine ([ $text = ''])
  • $text
DataEntryField (line 563)

A utility function for a data entry line within a table

  • return: The HTML fragment to display the data entry field
string DataEntryField ( $format, [ $ftype = ''], [ $base_fname = ''], [ $attributes = ''], [ $prefix = ''])
  • $format
  • $ftype
  • $base_fname
  • $attributes
  • $prefix
DataEntryLine (line 639)

A utility function for a data entry line within a table

  • return: The HTML fragment to display the prompt and field.
string DataEntryLine ( $prompt,  $field_format, [ $ftype = ''], [ $fname = ''], [ $attributes = ''], [ $prefix = ''])
  • $prompt
  • $field_format
  • $ftype
  • $fname
  • $attributes
  • $prefix
EndForm (line 496)

Return the HTML fragment to end the form.

  • return: The HTML fragment to end the form.
string EndForm ()
HelpInCell (line 434)

Set the line format to have help displayed in it's own separate cell

void HelpInCell ()
HelpInLine (line 426)

Set the line format to have help displayed in the same cell as the entry field.

void HelpInLine ()
HiddenField (line 516)

A utility function for a hidden field within a data entry table

  • return: The HTML fragment for the hidden field.
string HiddenField (string $fname,  $fvaluei, [ $fid = null], string $fvalue)
  • string $fname: The name of the field.
  • string $fvalue: The value of the field.
  • $fvaluei
  • $fid
MultiEntryLine (line 652)

A utility function for a data entry line, where the prompt is a drop-down.

  • return: The HTML fragment for the drop-down prompt and associated entry field.
string MultiEntryLine ( $prompt_options,  $prompt_name,  $default_prompt,  $format, [ $ftype = ''], [ $fname = ''], [ $attributes = ''],  $prefix)
  • $prompt_options
  • $prompt_name
  • $default_prompt
  • $format
  • $ftype
  • $fname
  • $attributes
  • $prefix
NoHelp (line 418)

Set the line format to have no help display

void NoHelp ()
PopulateForm (line 408)

Initialise some more of the forms fields, possibly with a prefix

void PopulateForm ( &$record, [string $prefix = ""], objectref $record)
  • objectref $record: A reference to the database object we are displaying / editing.
  • string $prefix: A prefix to prepend to the field name.
  • &$record
RevertLineFormat (line 459)

Revert the line format to what was in place before the last TempLineFormat call.

void RevertLineFormat ()
SimpleForm (line 442)

Set the line format to an extremely simple CSS based prompt / field layout.

void SimpleForm ([ $new_format = '<span class="prompt">%s:</span>&nbsp;<span class="entry">%s</span>'])
  • $new_format
StartForm (line 470)

Start the actual HTML form. Return the fragment to do this.

  • return: The HTML fragment for the start of the form.
string StartForm ([array $extra_attributes = ''])
  • array $extra_attributes: Extra key/value pairs for the FORM tag.
SubmitButton (line 629)

A utility function for a submit button within a data entry table

  • return: The HTML fragment to display a submit button for the form.
string SubmitButton ( $fname,  $fvalue, [ $attributes = ''])
  • $fname
  • $fvalue
  • $attributes
TempLineFormat (line 451)

Set the line format to a temporary one that we can revert from.

void TempLineFormat ([string $new_format = '<span class="prompt">%s:</span>&nbsp;<span class="entry">%s</span>'])
  • string $new_format: The (optional) new format we will temporarily use.
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:13 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AuthPlugin/0000755000000000000000000000000011774765552014440 5ustar awl-0.53.orig/docs/api/awl/AuthPlugin/_AuthPlugins.php.html0000644000000000000000000002565011774765543020526 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page AuthPlugins.php

File/AuthPlugins.php

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

The authentication handling plugins can be used by the Session class to provide authentication.

Each authenticate hook needs to:

  • Accept a username / password
  • Confirm the username / password are correct
  • Create (or update) a 'usr' record in our database
  • Return the 'usr' record as an object
  • Return === false when authentication fails
It can expect that:
  • Configuration data will be in $c->authenticate_hook['config'], which might be an array, or whatever is needed.
In order to be called:
  • This file should be included
  • $c->authenticate_hook['call'] should be set to the name of the plugin
  • $c->authenticate_hook['config'] should be set up with any configuration data for the plugin

Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ('AWLUtilities.php') (line 28)
 require_once ('DataUpdate.php') (line 29)
Functions
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
auth_external (line 97)

Authentication has already happened. We know the username, we just need to do the authorisation / access control. The password is ignored.

void auth_external ( $username,  $password)
  • $username
  • $password
auth_other_awl (line 37)

Authenticate against a different PostgreSQL database which contains a usr table in the AWL format.

void auth_other_awl ( $username,  $password)
  • $username
  • $password
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:11 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AuthPlugin/AuthPlugin.html0000644000000000000000000002214511774765543017412 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class AuthPlugin

 Class AuthPlugin

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A class for authenticating and retrieving user information

Located in /AuthPlugin.php (line 23)


	
			
Method Summary
 AuthPlugin AuthPlugin (array $authparams)
 object The Authenticate (string $username, string $password)
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor AuthPlugin (line 43)

Create a new AuthPlugin object. This is as lightweight as possible.

AuthPlugin AuthPlugin (array $authparams)
  • array $authparams: An array of parameters used for this authentication method.
Authenticate (line 54)

Authenticate. Do whatever we need to authenticate a username / password.

  • return: "user" object, containing fields matching the 'usr' database table
object The Authenticate (string $username, string $password)
  • string $username: The username of the person attempting to log in
  • string $password: The password the person is trying to log in with

Documentation generated on Wed, 04 Jul 2012 07:06:11 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AuthPlugin/_AuthPlugin.php.html0000644000000000000000000001257111774765543020341 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page AuthPlugin.php

File/AuthPlugin.php

Description

Authentication handling class

This class provides a basic set of methods which are used by the Session class to provide authentication.

This class is expected to be replaced, overridden or extended in some instances to enable different pluggable authentication methods.

Classes
Class Description
 class AuthPlugin A class for authenticating and retrieving user information

Documentation generated on Wed, 04 Jul 2012 07:06:11 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/DataUpdate/0000755000000000000000000000000011774765552014374 5ustar awl-0.53.orig/docs/api/awl/DataUpdate/_DataUpdate.php.html0000644000000000000000000003105311774765546020230 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page DataUpdate.php

File/DataUpdate.php

Description

Some functions and a base class to help with updating records.

This subpackage provides some functions that are useful around single record database activities such as insert and update.

Classes
Class Description
 class DBRecord A Base class to use for records which will be read/written from the database.
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ('AwlQuery.php') (line 16)
 require_once ('AWLUtilities.php') (line 15)
Functions
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
sql_from_object (line 28)

Build SQL INSERT/UPDATE statement from an associative array of fieldnames => values.

  • return: An SQL Update or Insert statement with all fields/values from the array.
string sql_from_object (array $obj, string $type, string $tablename, string $where, [string $fprefix = &quot;&quot;])
  • array $obj: The object of fieldnames => values.
  • string $type: The word "update" or something else (which implies "insert").
  • string $tablename: The name of the table being updated.
  • string $where: What the "WHERE ..." clause needs to be for an UPDATE statement.
  • string $fprefix: An optional string which all fieldnames in $assoc are prefixed with.
sql_from_post (line 112)

Build SQL INSERT/UPDATE statement from the $_POST associative array

  • return: An SQL Update or Insert statement with all fields/values from the array.
string sql_from_post (string $type, string $tablename, string $where, [string $fprefix = &quot;&quot;])
  • string $type: The word "update" or something else (which implies "insert").
  • string $tablename: The name of the table being updated.
  • string $where: What the "WHERE ..." clause needs to be for an UPDATE statement.
  • string $fprefix: An optional string which all fieldnames in $assoc are prefixed with.

Documentation generated on Wed, 04 Jul 2012 07:06:13 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/DataUpdate/DBRecord.html0000644000000000000000000006144611774765546016724 0ustar Docs For Class DBRecord

 Class DBRecord

Description

A Base class to use for records which will be read/written from the database.

Located in /DataUpdate.php (line 122)


	
			
Direct descendents
Class Description
 class User A class to handle reading, writing, viewing, editing and validating usr records.
Variable Summary
 object $EditMode
Method Summary
 DBRecord DBRecord ()
 void AddTable (string $table,  $target_list,  $join_clause,  $and_where, array $keys, string $join, string $prefix)
 mixed Get (string $fname)
 void Initialise (string $table, [array $keys = array()])
 void PostToValues ([ $prefix = ""])
 boolean Read ()
 mixed Set (string $fname, string $fval)
 mixed Undefine (string $fname)
 boolean Write ()
 string _BuildFieldList ()
 string _BuildJoinClause ()
 string _BuildWhereClause ([boolean $overwrite_values = false])
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
object $EditMode (line 195)

The mode we are in for any form

  • access: public
Methods
Constructor DBRecord (line 202)

Really numbingly simple construction.

DBRecord DBRecord ()
AddTable (line 233)

This will join an additional table to the maintained set

void AddTable (string $table,  $target_list,  $join_clause,  $and_where, array $keys, string $join, string $prefix)
  • string $table: The name of the database table
  • array $keys: An associative array containing fieldname => value pairs for the record key.
  • string $join: A PostgreSQL join clause.
  • string $prefix: A field prefix to use for these fields to distinguish them from fields in other joined tables with the same name.
  • $target_list
  • $join_clause
  • $and_where
Get (line 333)

Returns a single field from the record

  • return: The current value of the field.
mixed Get (string $fname)
  • string $fname: The name of the field to set the value for
Initialise (line 217)

This will read the record from the database if it's available, and the $keys parameter is a non-empty array.

void Initialise (string $table, [array $keys = array()])
  • string $table: The name of the database table
  • array $keys: An associative array containing fieldname => value pairs for the record key.
PostToValues (line 245)

This will assign $_POST values to the internal Values object for each field that exists in the Fields array.

void PostToValues ([ $prefix = ""])
  • $prefix
Read (line 367)

To read the record from the database.

If we don't have any keys then the record will be blank.

  • return: Whether we actually read a record.
boolean Read ()
Set (line 322)

Sets a single field in the record

  • return: The new value of the field (i.e. $fval).
mixed Set (string $fname, string $fval)
  • string $fname: The name of the field to set the value for
  • string $fval: The value to set the field to
Undefine (line 343)

Unsets a single field from the record

  • return: The current value of the field.
mixed Undefine (string $fname)
  • string $fname: The name of the field to unset the value for
Write (line 355)

To write the record to the database

  • return: Success.
boolean Write ()

Redefined in descendants as:
_BuildFieldList (line 274)

Builds a field target list

  • return: A simple SQL target field list for each field, possibly including prefixes.
string _BuildFieldList ()
_BuildJoinClause (line 259)

Builds a table join clause

  • return: A simple SQL target join clause excluding the primary table.
string _BuildJoinClause ()
_BuildWhereClause (line 295)

Builds a where clause to match the supplied keys

  • return: A simple SQL where clause, including the initial "WHERE", for each key / value.
string _BuildWhereClause ([boolean $overwrite_values = false])
  • boolean $overwrite_values: Controls whether the data values for the key fields will be forced to match the key values

Documentation generated on Wed, 04 Jul 2012 07:06:13 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/XMLDocument/0000755000000000000000000000000011774765552014517 5ustar awl-0.53.orig/docs/api/awl/XMLDocument/_XMLDocument.php.html0000644000000000000000000001524111774765551020473 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page XMLDocument.php

File/XMLDocument.php

Description

Handling of namespacing for XML documents

Classes
Class Description
 class XMLDocument A class for XML Documents which will contain namespaced XML elements
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ("XMLElement.php") (line 13)

Documentation generated on Wed, 04 Jul 2012 07:06:17 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/XMLDocument/XMLDocument.html0000644000000000000000000001707111774765551017551 0ustar Docs For Class XMLDocument

 Class XMLDocument

Description

A class for XML Documents which will contain namespaced XML elements

Located in /XMLDocument.php (line 20)


	
			
Variable Summary
 static mixed $ns_caldav
 static mixed $ns_calendarserver
 static mixed $ns_carddav
 static mixed $ns_dav
Variables
static mixed $ns_caldav = 'urn:ietf:params:xml:ns:caldav' (line 170)
  • access: public
static mixed $ns_calendarserver = 'http://calendarserver.org/ns/' (line 172)
  • access: public
static mixed $ns_carddav = 'urn:ietf:params:xml:ns:carddav' (line 171)
  • access: public
static mixed $ns_dav = 'DAV:' (line 169)
  • access: public

Documentation generated on Wed, 04 Jul 2012 07:06:17 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/_AwlCache.php.html0000644000000000000000000001206511774765543015646 0ustar Docs for page AwlCache.php

File/AwlCache.php

Description
Classes
Class Description
 class AwlCache A simple Memcached wrapper supporting namespacing of stored values.
Functions
getCacheInstance (line 167)
void getCacheInstance ()

Documentation generated on Wed, 04 Jul 2012 07:06:11 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/vComponent/0000755000000000000000000000000011774765552014510 5ustar awl-0.53.orig/docs/api/awl/vComponent/vComponent.html0000644000000000000000000013525411774765551017537 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class vComponent

 Class vComponent

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A Class for representing components within an vComponent

Located in /vComponent.php (line 409)


	
			
Direct descendents
Class Description
 class vCalendar A Class for representing components within an vComponent
Variable Summary
 array $components
 array $properties
 array $rendered
 string $type
Method Summary
 vComponent __construct ([ $content = null])
 void AddComponent (vComponent $new_component)
 void AddProperty (vProperty $new_property, [string $value = null], [array $parameters = null])
 void ClearComponents ([string $type = null])
 void ClearProperties ([string|array $type = null])
 void CollectParameterValues ( $parameter_name)
 void ComponentCount ()
 array GetComponents ([mixed $type = null], [boolean $normal_match = true])
 void GetProperties ([ $type = null])
 array GetPropertiesByPath ( $path)
 void GetProperty ( $type)
 void GetPValue ( $type)
 void GetType ()
 void MaskComponents (array $keep, [boolean $recursive = true])
 void MaskProperties (array $keep, [array $component_list = null])
 void ParseFrom (string $content)
 void Render ([ $restricted_properties = null], [ $force_rendering = false])
 void SetComponents (array $new_component, [string $type = null])
 void SetProperties ( $new_properties, [ $type = null])
 void SetType ( $type)
 boolean TestFilter ( $filters, array $filter)
 void UnwrapComponent ( $content)
 void WrapComponent ( $content)
 void __toString ()
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
array $components (line 433)

An array of (sub-)components, which are vComponent objects

  • access: protected
array $properties (line 426)

An array of properties, which are vProperty objects

  • access: protected
array $rendered (line 440)

The rendered result (or what was originally parsed, if there have been no changes)

  • access: protected
string $type (line 419)

The type of this component, such as 'VEVENT', 'VTODO', 'VTIMEZONE', 'VCARD', etc.

  • access: protected
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor __construct (line 447)

A basic constructor

vComponent __construct ([ $content = null])
  • $content

Redefined in descendants as:
  • vCalendar::__construct() : Constructor. If a string is passed it will be parsed as if it was an iCalendar object, otherwise a new vCalendar will be initialised with basic content. If an array of key value pairs is provided they will also be used as top-level properties.
AddComponent (line 796)

Adds a new subcomponent

void AddComponent (vComponent $new_component)
  • vComponent $new_component: The new component to append to the set
AddProperty (line 693)

Adds a new property

void AddProperty (vProperty $new_property, [string $value = null], [array $parameters = null])
  • vProperty $new_property: The new property to append to the set, or a string with the name
  • string $value: The value of the new property (default: param 1 is an vProperty with everything
  • array $parameters: The key/value parameter pairs (default: none, or param 1 is an vProperty with everything)
ClearComponents (line 751)

Clear all components, or the components matching a particular type

void ClearComponents ([string $type = null])
  • string $type: The type of component - omit for all components
ClearProperties (line 655)

Clear all properties, or the properties matching a particular type

void ClearProperties ([string|array $type = null])
  • string|array $type: The type of property - omit for all properties - or an array associating property names with true values: array( 'PROPERTY' => true, 'PROPERTY2' => true )
CollectParameterValues (line 462)

Collect an array of all parameters of our properties which are the specified type

Mainly used for collecting the full variety of references TZIDs

void CollectParameterValues ( $parameter_name)
  • $parameter_name
ComponentCount (line 712)

Return number of components

void ComponentCount ()
GetComponents (line 726)

Get all sub-components, or at least get those matching a type, or failling to match, should the second parameter be set to false. Component types may be a string or an array associating property names with true values: array( 'TYPE' => true, 'TYPE2' => true )

  • return: an array of the sub-components
array GetComponents ([mixed $type = null], [boolean $normal_match = true])
  • mixed $type: The type(s) to match (default: All)
  • boolean $normal_match: Set to false to invert the match (default: true)
GetProperties (line 638)

Get all properties, or the properties matching a particular type, or matching an

array associating property names with true values: array( 'PROPERTY' => true, 'PROPERTY2' => true )

void GetProperties ([ $type = null])
  • $type
GetPropertiesByPath (line 889)

Return an array of properties matching the specified path

  • return: An array of vProperty within the tree which match the path given, in the form [/]COMPONENT[/...]/PROPERTY in a syntax kind of similar to our poor man's XML queries. We also allow COMPONENT and PROPERTY to be !COMPONENT and !PROPERTY for ++fun.
array GetPropertiesByPath ( $path)
  • $path
GetProperty (line 610)

Return the first instance of a property of this name

void GetProperty ( $type)
  • $type
GetPValue (line 627)

Return the value of the first instance of a property of this name, or null

void GetPValue ( $type)
  • $type
GetType (line 592)

Return the type of component which this is

void GetType ()
MaskComponents (line 815)

Mask components, removing any that are not of the types in the list

void MaskComponents (array $keep, [boolean $recursive = true])
  • array $keep: An array of component types to be kept
  • boolean $recursive: (default true) Whether to recursively MaskComponents on the ones we find
MaskProperties (line 833)

Mask properties, removing any that are not in the list

void MaskProperties (array $keep, [array $component_list = null])
  • array $keep: An array of property names to be kept
  • array $component_list: An array of component types to check within
ParseFrom (line 483)

Parse the text $content into sets of vProperty & vComponent within this vComponent

void ParseFrom (string $content)
  • string $content: The raw RFC2445-compliant vComponent component, including BEGIN:TYPE & END:TYPE
Render (line 851)

Renders the component, possibly restricted to only the listed properties

void Render ([ $restricted_properties = null], [ $force_rendering = false])
  • $restricted_properties
  • $force_rendering
SetComponents (line 782)

Sets some or all sub-components of the component to the supplied new components

void SetComponents (array $new_component, [string $type = null])
  • string $type: The type of components to be replaced. Defaults to null, which means all components will be replaced.
  • array $new_component: of vComponent $new_components The new components to replace the existing ones
SetProperties (line 677)

Set all properties, or the ones matching a particular type

void SetProperties ( $new_properties, [ $type = null])
  • $new_properties
  • $type
SetType (line 600)

Set the type of component which this is

void SetType ( $type)
  • $type
TestFilter (line 942)

Test a PROP-FILTER or COMP-FILTER and return a true/false COMP-FILTER (is-defined | is-not-defined | (time-range?, prop-filter*, comp-filter*)) PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*))

  • return: Whether or not this vComponent passes the test
boolean TestFilter ( $filters, array $filter)
  • array $filter: An array of XMLElement defining the filter
  • $filters
UnwrapComponent (line 568)

This unescapes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We accept either case.

void UnwrapComponent ( $content)
  • $content
WrapComponent (line 580)

This imposes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We output RFC2445 compliance.

In order to preserve pre-existing wrapping in the component, we split the incoming string on line breaks before running wordwrap over each component of that.

void WrapComponent ( $content)
  • $content
__toString (line 875)
  • access: public
void __toString ()
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:16 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/vComponent/vProperty.html0000644000000000000000000007120311774765551017412 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class vProperty

 Class vProperty

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A Class for representing properties within a vComponent (VCALENDAR or VCARD)

Located in /vComponent.php (line 23)


	
			
Variable Summary
 string $content
 string $name
 array $parameters
 string $rendered
Method Summary
 vProperty __construct ([string $propstring = null])
 string GetParameterValue (string $name)
 string Name ([string $newname = null])
 array Parameters ([array $newparams = null])
 void ParseFrom (string $propstring)
 void Render ([ $force = false])
 void SetParameterValue (string $name, string $value)
 boolean TestFilter ( $filters, array $filter)
 void TestParamFilter ( $filters,  $parameter_value)
 string TextMatch (string $search)
 string Value ([string $newvalue = null])
 void __toString ()
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
string $content (line 47)

The value of this property.

  • access: protected
string $name (line 33)

The name of this property

  • access: protected
array $parameters (line 40)

An array of parameters to this property, represented as key/value pairs.

  • access: protected
string $rendered (line 54)

The original value that this was parsed from, if that's the way it happened.

  • access: protected
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor __construct (line 66)

The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when vComponent::ParseFrom() called vComponent::UnwrapComponent().

vProperty __construct ([string $propstring = null])
  • string $propstring: The string from the vComponent which contains this property.
GetParameterValue (line 207)

Get the value of a parameter

  • return: The value of the parameter
string GetParameterValue (string $name)
  • string $name: The name of the parameter to retrieve the value for
Name (line 142)

Get/Set name property

  • return: The name for the property.
string Name ([string $newname = null])
  • string $newname: [optional] A new name for the property
Parameters (line 175)

Get/Set parameters in their entirety

  • return: The current array of parameters for the property.
array Parameters ([array $newparams = null])
  • array $newparams: An array of new parameter key/value pairs. The 'value' may be an array of values.
ParseFrom (line 85)

The constructor parses the incoming string, which is formatted as per RFC2445 as a propname[;param1=pval1[; ... ]]:propvalue however we allow ourselves to assume that the RFC2445 content unescaping has already happened when vComponent::ParseFrom() called vComponent::UnwrapComponent().

void ParseFrom (string $propstring)
  • string $propstring: The string from the vComponent which contains this property.
Render (line 255)

Render a suitably escaped RFC2445 content string.

void Render ([ $force = false])
  • $force
RenderParameters (line 236)

Render the set of parameters as key1=value1[;key2=value2[; ...]] with any colons or semicolons escaped.

void RenderParameters ()
SetParameterValue (line 220)

Set the value of a parameter

void SetParameterValue (string $name, string $value)
  • string $name: The name of the parameter to set the value for
  • string $value: The value of the parameter
TestFilter (line 317)

Test a PROP-FILTER or PARAM-FILTER and return a true/false PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*)) PARAM-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*))

  • return: Whether or not this vProperty passes the test
boolean TestFilter ( $filters, array $filter)
  • array $filter: An array of XMLElement defining the filter
  • $filters
TestParamFilter (line 363)
void TestParamFilter ( $filters,  $parameter_value)
  • $filters
  • $parameter_value
TextMatch (line 194)

Test if our value contains a string

  • return: The name for the property.
string TextMatch (string $search)
  • string $search: The needle which we shall search the haystack for.
Value (line 159)

Get/Set the content of the property

  • return: The value of the property.
string Value ([string $newvalue = null])
  • string $newvalue: [optional] A new value for the property
__toString (line 303)
  • access: public
void __toString ()
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:17 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/vComponent/_vComponent.php.html0000644000000000000000000001625711774765551020465 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page vComponent.php

File/vComponent.php

Description

A Class for handling vCalendar & vCard data.

When parsed the underlying structure is roughly as follows:

vComponent( array(vComponent), array(vProperty) )

Classes
Class Description
 class vProperty A Class for representing properties within a vComponent (VCALENDAR or VCARD)
 class vComponent A Class for representing components within an vComponent
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ('XMLElement.php') (line 16)

Documentation generated on Wed, 04 Jul 2012 07:06:16 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/vCalendar/0000755000000000000000000000000011774765552014257 5ustar awl-0.53.orig/docs/api/awl/vCalendar/_vCalendar.php.html0000644000000000000000000001577011774765550020001 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page vCalendar.php

File/vCalendar.php

Description

A Class for handling vCalendar data.

When parsed the underlying structure is roughly as follows:

vCalendar( array(vComponent), array(vProperty), array(vTimezone) )

with the TIMEZONE data still currently included in the component array (likely to change in the future) and the timezone array only containing vComponent objects (which is also likely to change).

Classes
Class Description
 class vCalendar A Class for representing components within an vComponent
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ('vComponent.php') (line 21)

Documentation generated on Wed, 04 Jul 2012 07:06:16 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/vCalendar/VCalendar.html0000644000000000000000000004323011633634573016776 0ustar Docs For Class VCalendar

 Class VCalendar

Description

A Class for representing components within an vComponent

Located in /vCalendar.php (line 23)

vComponent
   |
   --VCalendar
Method Summary
 VCalendar __construct ([mixed $content = null])
 void AddTimeZone (vComponent $vtz, [ $in_components = false])
 void GetAttendees ()
 void GetOrganizer ()
 void GetTimeZone ( $tzid)
Methods
Constructor __construct (line 48)

Constructor. If a string is passed it will be parsed as if it was an iCalendar object, otherwise a new vCalendar will be initialised with basic content. If an array of key value pairs is provided they will also be used as top-level properties.

Typically this will be used to set a METHOD property on the VCALENDAR as something like: $shinyCalendar = new vCalendar( array('METHOD' => 'REQUEST' ) );

VCalendar __construct ([mixed $content = null])
  • mixed $content: Can be a string to be parsed, or an array of key value pairs.

Redefinition of:
vComponent::__construct()
A basic constructor
AddTimeZone (line 80)

Add a timezone component to this vCalendar.

void AddTimeZone (vComponent $vtz, [ $in_components = false])
GetAttendees (line 116)

Get the attendees of this VEVENT/VTODO

void GetAttendees ()
GetOrganizer (line 103)

Get the organizer of this VEVENT/VTODO

void GetOrganizer ()
GetTimeZone (line 94)

Get a timezone component for a specific TZID in this calendar.

void GetTimeZone ( $tzid)
  • $tzid

Inherited Methods

Inherited From vComponent

 vComponent::__construct()
 vComponent::AddComponent()
 vComponent::AddProperty()
 vComponent::ClearComponents()
 vComponent::ClearProperties()
 vComponent::CollectParameterValues()
 vComponent::ComponentCount()
 vComponent::GetComponents()
 vComponent::GetProperties()
 vComponent::GetPropertiesByPath()
 vComponent::GetProperty()
 vComponent::GetPValue()
 vComponent::GetType()
 vComponent::MaskComponents()
 vComponent::MaskProperties()
 vComponent::ParseFrom()
 vComponent::Render()
 vComponent::SetComponents()
 vComponent::SetProperties()
 vComponent::SetType()
 vComponent::TestFilter()
 vComponent::UnwrapComponent()
 vComponent::WrapComponent()
 vComponent::__toString()

Documentation generated on Sun, 11 Sep 2011 00:31:50 +1200 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/vCalendar/vCalendar.html0000644000000000000000000010122011774765550017036 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class vCalendar

 Class vCalendar

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

A Class for representing components within an vComponent

Located in /vCalendar.php (line 23)

vComponent
   |
   --vCalendar
Method Summary
 vCalendar __construct ([mixed $content = null])
 void AddTimeZone (vComponent $vtz, [ $in_components = false])
 void Confidential ()
 void GetAttendees ()
 void GetItip ( $method,  $attendee_value)
 string GetOlsonName (vComponent $vtz)
 vComponent GetTimeZone (string $tzid)
 void GetUID ()
 void SetUID (string $newUid)
 boolean StartFilter ( $filters, array $filter)
 void UpdateAttendeeStatus (string $email, vProperty $statusProperty)
 void UpdateOrganizerStatus (vProperty $statusProperty)
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Inherited Variables

Inherited from vComponent

vComponent::$components
vComponent::$properties
vComponent::$rendered
vComponent::$type
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor __construct (line 51)

Constructor. If a string is passed it will be parsed as if it was an iCalendar object, otherwise a new vCalendar will be initialised with basic content. If an array of key value pairs is provided they will also be used as top-level properties.

Typically this will be used to set a METHOD property on the VCALENDAR as something like: $shinyCalendar = new vCalendar( array('METHOD' => 'REQUEST' ) );

vCalendar __construct ([mixed $content = null])
  • mixed $content: Can be a string to be parsed, or an array of key value pairs.

Redefinition of:
vComponent::__construct()
A basic constructor
AddTimeZone (line 87)

Add a timezone component to this vCalendar.

void AddTimeZone (vComponent $vtz, [ $in_components = false])
Confidential (line 339)

Morph this component (and subcomponents) into a confidential version of it. A confidential event will be scrubbed of any identifying characteristics other than time/date, repeat, uid and a summary which is just a translated 'Busy'.

void Confidential ()
GetAttendees (line 141)

Get the attendees of this VEVENT/VTODO

void GetAttendees ()
GetItip (line 359)

Clone this component (and subcomponents) into a minimal iTIP version of it.

void GetItip ( $method,  $attendee_value)
  • $method
  • $attendee_value
GetOlsonName (line 234)

Work out what Olson timezone this VTIMEZONE really is. Perhaps we should put this into a vTimezone class.

  • return: The Olson name for the timezone.
string GetOlsonName (vComponent $vtz)
GetOrganizer (line 114)

Get the organizer of this VEVENT/VTODO

  • return: The Organizer property.
vProperty GetOrganizer ()
GetScheduleAgent (line 132)

Get the schedule-agent from the organizer

  • return: The schedule-agent parameter
vProperty GetScheduleAgent ()
GetTimeZone (line 104)

Get a timezone component for a specific TZID in this calendar.

  • return: The timezone as a vComponent.
vComponent GetTimeZone (string $tzid)
  • string $tzid: The TZID for the timezone to be retrieved.
GetUID (line 397)

Get the UID from the primary component.

void GetUID ()
SetUID (line 408)

Set the UID on the primary component.

void SetUID (string $newUid)
  • string $newUid: newUid
StartFilter (line 216)

Test a PROP-FILTER or COMP-FILTER and return a true/false COMP-FILTER (is-defined | is-not-defined | (time-range?, prop-filter*, comp-filter*)) PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*))

  • return: Whether or not this vCalendar passes the test
boolean StartFilter ( $filters, array $filter)
  • array $filter: An array of XMLElement defining the filter
  • $filters
UpdateAttendeeStatus (line 163)

Update the attendees of this VEVENT/VTODO

void UpdateAttendeeStatus (string $email, vProperty $statusProperty)
  • string $email: The e-mail address of the attendee to be updated.
  • vProperty $statusProperty: A replacement property.
UpdateOrganizerStatus (line 190)

Update the ORGANIZER of this VEVENT/VTODO

void UpdateOrganizerStatus (vProperty $statusProperty)
  • vProperty $statusProperty: A replacement property.

Inherited Methods

Inherited From vComponent

 vComponent::__construct()
 vComponent::AddComponent()
 vComponent::AddProperty()
 vComponent::ClearComponents()
 vComponent::ClearProperties()
 vComponent::CollectParameterValues()
 vComponent::ComponentCount()
 vComponent::GetComponents()
 vComponent::GetProperties()
 vComponent::GetPropertiesByPath()
 vComponent::GetProperty()
 vComponent::GetPValue()
 vComponent::GetType()
 vComponent::MaskComponents()
 vComponent::MaskProperties()
 vComponent::ParseFrom()
 vComponent::Render()
 vComponent::SetComponents()
 vComponent::SetProperties()
 vComponent::SetType()
 vComponent::TestFilter()
 vComponent::UnwrapComponent()
 vComponent::WrapComponent()
 vComponent::__toString()
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:16 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AwlDatabase/0000755000000000000000000000000011774765552014530 5ustar awl-0.53.orig/docs/api/awl/AwlDatabase/AwlUpgrader.html0000644000000000000000000001265611774765544017646 0ustar Docs For Class AwlUpgrader

 Class AwlUpgrader

Description

The AwlUpgrader Class.

This class updates an Awl database to a newer schema version.

Located in /AwlUpgrader.php (line 29)


	
			
Method Summary
 The __construct ()
Methods
Constructor __construct (line 35)

Constructor

  • return: AwlUpgrader object
The __construct ()

Documentation generated on Wed, 04 Jul 2012 07:06:12 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AwlDatabase/AwlDatabase.html0000644000000000000000000005725411774765544017604 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class AwlDatabase

 Class AwlDatabase

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Typically there will only be a single instance of the database level class in an application.

Located in /AwlDatabase.php (line 58)

AwlDBDialect
   |
   --AwlDatabase
Variable Summary
Method Summary
 void Begin ()
 void Commit ()
 void ErrorInfo ()
 void prepare ( $statement, [array $driver_options = array()], string $sql_query_string)
 void PrepareTranslated ( $statement, [ $driver_options = array()])
 void query ( $statement, string $sql_query_string, mixed 1)
 void Rollback ()
 void TranslateAll ( $onoff_boolean)
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
mixed $translate_all = false (line 71)

Holds whether we are translating all statements.

  • access: protected
mixed $txnstate = 0 (line 66)

Holds the state of the transaction 0 = not started, 1 = in progress, -1 = error pending rollback/commit

  • access: protected

Inherited Variables

Inherited from AwlDBDialect

AwlDBDialect::$db
AwlDBDialect::$dialect
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Begin (line 101)

Begin a transaction.

void Begin ()
Commit (line 116)

Complete a transaction.

void Commit ()
ErrorInfo (line 173)
void ErrorInfo ()
prepare (line 80)

Returns a PDOStatement object created using this database, the supplied SQL string, and any parameters given.

void prepare ( $statement, [array $driver_options = array()], string $sql_query_string)
  • string $sql_query_string: The SQL string containing optional variable replacements
  • array $driver_options: PDO driver options to the prepare statement, commonly to do with cursors
  • $statement
PrepareTranslated (line 154)

Operates identically to AwlDatabase::Prepare, except that $this->Translate() will be called on the query before any processing.

void PrepareTranslated ( $statement, [ $driver_options = array()])
  • $statement
  • $driver_options
query (line 93)

Returns a PDOStatement object created using this database, the supplied SQL string, and any parameters given.

void query ( $statement, string $sql_query_string, mixed 1)
  • string $sql_query_string: The SQL string containing optional variable replacements
  • mixed 1: ... Subsequent arguments are positionally replaced into the $sql_query_string
  • $statement
Rollback (line 128)

Cancel a transaction in progress.

void Rollback ()
TransactionState (line 145)

Returns the current state of a transaction, indicating if we have begun a transaction, whether the transaction has failed, or if we are not in a transaction.

  • return: 0 = not started, 1 = in progress, -1 = error pending rollback/commit
int TransactionState ()
TranslateAll (line 164)

Switches on or off the processing flag controlling whether subsequent calls to AwlDatabase::Prepare are translated as if PrepareTranslated() had been called.

void TranslateAll ( $onoff_boolean)
  • $onoff_boolean

Inherited Methods

Inherited From AwlDBDialect

 AwlDBDialect::__construct()
 AwlDBDialect::GetFields()
 AwlDBDialect::GetVersion()
 AwlDBDialect::Quote()
 AwlDBDialect::ReplaceNamedParameters()
 AwlDBDialect::ReplaceParameters()
 AwlDBDialect::SetSearchPath()
 AwlDBDialect::TranslateSQL()
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:11 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AwlDatabase/AwlDBDialect.html0000644000000000000000000006426211774765544017650 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs For Class AwlDBDialect

 Class AwlDBDialect

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

The AwlDBDialect class handles support for different SQL dialects

This subpackage provides dialect specific support for PostgreSQL, and may, over time, be extended to provide support for other SQL dialects.

If you are looking for the place to add support for other SQL dialects, this is the class that you should be looking at. You might also look at the AwlDatabase class which extends this one, but these are the core capabilities which most probably need attention.

Located in /AwlDBDialect.php (line 33)


	
			
Direct descendents
Class Description
 class AwlDatabase Typically there will only be a single instance of the database level class in an application.
Variable Summary
 mixed $db
 mixed $dialect
Method Summary
 AwlDBDialect __construct (string $connection_string, [string $dbuser = null], [string $dbpass = null], [array $options = null])
 void GetFields (string $tablename_string)
 void GetVersion (handle $pdo)
 void Quote (mixed $value, [string $value_type = null])
 The ReplaceNamedParameters (string 0, mixed 1)
 The ReplaceParameters (string 0, mixed 1)
 void SetSearchPath ([ $search_path = null])
 void TranslateSQL ( $sql_string)
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
mixed $db (line 46)

Holds the PDO database connection

  • access: protected
mixed $dialect (line 41)

Holds the name of the database dialect

  • access: protected
Methods
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Constructor __construct (line 68)

Parses the connection string to ascertain the database dialect. Returns true if the dialect is supported and fails if the dialect is not supported. All code to support any given database should be within in an external include.

The database will be opened.

AwlDBDialect __construct (string $connection_string, [string $dbuser = null], [string $dbpass = null], [array $options = null])
  • string $connection_string: The PDO connection string, in all it's glory
  • string $dbuser: The database username to connect as
  • string $dbpass: The database password to connect with
  • array $options: An array of driver options
GetFields (line 138)

Returns the SQL for the current database dialect which will return a two-column resultset containing a list of fields and their associated data types.

void GetFields (string $tablename_string)
  • string $tablename_string: The name of the table we want fields from
GetVersion (line 109)

Sets the current search path for the database.

void GetVersion (handle $pdo)
  • handle $pdo: A handle to an opened database
Quote (line 182)

Returns $value escaped in an appropriate way for this database dialect.

void Quote (mixed $value, [string $value_type = null])
  • mixed $value: The value to be escaped
  • string $value_type: The type of escaping desired. If blank this will be worked out from the type of the $value. The special type of 'identifier' can also be used for escaping of SQL identifiers.
ReplaceNamedParameters (line 340)

Replaces named query parameters of the form :name with appropriately escaped substitutions.

The function takes a variable number of arguments, the first is the SQL string, with replaceable ':name' characters (a la DBI). The subsequent parameters being the values to replace into the SQL string.

The values passed to the routine are analyzed for type, and quoted if they appear to need quoting. This can go wrong for (e.g.) NULL or other special SQL values which are not straightforwardly identifiable as needing quoting (or not).

  • return: built query string
The ReplaceNamedParameters (string 0, mixed 1)
  • string 0: The query string with replacable ':name' identifiers
  • mixed 1: A ':name' => 'value' hash of values to replace into the SQL string.
ReplaceParameters (line 284)

Replaces query parameters with appropriately escaped substitutions.

The function takes a variable number of arguments, the first is the SQL string, with replaceable '?' characters (a la DBI). The subsequent parameters being the values to replace into the SQL string.

The values passed to the routine are analyzed for type, and quoted if they appear to need quoting. This can go wrong for (e.g.) NULL or other special SQL values which are not straightforwardly identifiable as needing quoting (or not). In such cases the parameter can be forced to be inserted unquoted by passing it as "array( 'plain' => $param )".

  • return: built query string
The ReplaceParameters (string 0, mixed 1)
  • string 0: The query string with replacable '?' characters.
  • mixed 1: The values to replace into the SQL string.
SetSearchPath (line 91)

Sets the current search path for the database.

void SetSearchPath ([ $search_path = null])
  • $search_path
TranslateSQL (line 168)

Translates the given SQL string into a form that will hopefully work for this database dialect. This hook is intended to be used by developers to provide support for differences in database operation by translating the query string in an arbitrary way, such as through a file or database lookup.

The actual translation to other SQL dialects will be application-specific, so that any routines called by this will be external to this library, or will use resources loaded from some source external to this library.

The application developer is expected to use this functionality to solve harder translation problems, but is less likely to call this directly, hopefully switching ->Prepare to ->PrepareTranslated in those cases, and then adding that statement to whatever SQL translation infrastructure is in place.

void TranslateSQL ( $sql_string)
  • $sql_string
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:12 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AwlDatabase/_AwlQuery.php.html0000644000000000000000000001747511774765544020133 0ustar Docs for page AwlQuery.php

File/AwlQuery.php

Description
Classes
Class Description
 class AwlQuery The AwlQuery Class.
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ('AwlDatabase.php') (line 11)
Functions
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
_awl_connect_configured_database (line 40)

Connect to the database defined in the $c->db_connect[] (or $c->pg_connect) arrays

void _awl_connect_configured_database ()

Documentation generated on Wed, 04 Jul 2012 07:06:12 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AwlDatabase/AwlQuery.html0000644000000000000000000012731011774765544017174 0ustar Docs For Class AwlQuery

 Class AwlQuery

Description

The AwlQuery Class.

This class builds and executes SQL Queries and traverses the set of results returned from the query.

Example usage

  1.  $sql "SELECT * FROM mytable WHERE mytype = ?";
  2.  $qry new AwlQuery$sql$myunsanitisedtype );
  3.  if $qry->Exec("typeselect"__line____file__ )
  4.       && $qry->rows > )
  5.  {
  6.    while$row $qry->Fetch() ) {
  7.      do_something_with($row);
  8.    }
  9.  }

Located in /AwlQuery.php (line 117)


	
			
Variable Summary
 resource $connection
 string $error_info
 string $location
 string $querystring
 resource $result
 int $rownum
 int $rows
 string $sth
Method Summary
 static string quote ([mixed $str = null])
 The __construct (string 0, mixed 1)
 void Begin ()
 void Bind (mixed $args)
 void Commit ()
 boolean Exec ([string $location = null], [int $line = null], [string $file = null])
 void Execute ()
 mixed Fetch ([boolean $as_array = false])
 void GetConnection ()
 void Parameters ()
 void Prepare ()
 boolean QDo (string 0, mixed 1)
 void QueryString ()
 void Rollback ()
 void rownum ()
 void rows ()
 void SetConnection (resource $new_connection, [ $options = null])
 void SetSql (string $sql)
 void _log_query (string $locn, string $tag, string $string, [int $line = 0], [string $file = ""])
Variables
array $bound_parameters (line 144)

The current array of bound parameters

  • access: protected
string $bound_querystring (line 138)

The actual query string, after we've replaced parameters in it

  • access: protected
resource $connection (line 126)

Our database connection, normally copied from a global one

  • access: protected
string $error_info (line 174)

The Database error information, if the query fails.

  • access: protected
string $execution_time (line 181)

Stores the query execution time - used to deal with long queries.

should be read-only

  • access: protected
string $location (line 193)

Where we called this query from so we can find it in our code! Debugging may also be selectively enabled for a $location.

  • access: public
string $querystring (line 132)

The original query string

  • access: protected
double $query_time_warning = 0.3 (line 202)

How long the query should take before a warning is issued.

This is writable, but a method to set it might be a better interface. The default is 0.3 seconds.

  • access: public
resource $result (line 156)

Result of the last execution

  • access: protected
int $rownum = null (line 162)

number of current row - use accessor to get/set

  • access: protected
int $rows (line 168)

number of rows from pg_numrows - use accessor to get value

  • access: protected
string $sth (line 150)

The PDO statement handle, or null if we don't have one yet.

  • access: protected
Methods
static quote (line 311)

Quote the given string so it can be safely used within string delimiters in a query. To be avoided, in general.

  • return: NULL, TRUE, FALSE, a plain number, or the original string quoted and with ' and \ characters escaped
  • access: public
static string quote ([mixed $str = null])
  • mixed $str: Data to be converted to a string suitable for including as a value in SQL.
Constructor __construct (line 212)

Constructor

  • return: AwlQuery object
The __construct (string 0, mixed 1)
  • string 0: The query string in PDO syntax with replacable '?' characters or bindable parameters.
  • mixed 1: The values to replace into the SQL string.
Begin (line 468)

Wrap the parent DB class Begin() so we can $qry->Begin() sometime before we $qry->Exec()

  • access: public
void Begin ()
Bind (line 330)

Bind some parameters. This can be called in three ways:

1) As Bind(':key','value), when using named parameters 2) As Bind('value'), when using ? placeholders 3) As Bind(array()), to overwrite the existing bound parameters. The array may be ':name' => 'value' pairs or ordinal values, depending on whether the SQL is using ':name' or '?' style placeholders.

void Bind (mixed $args)
  • mixed $args: See details above.
Commit (line 481)

Wrap the parent DB class Commit() so we can $qry->Commit() sometime after we $qry->Exec()

  • access: public
void Commit ()
Exec (line 557)

Execute the query, logging any debugging.

Example So that you can nicely enable/disable the queries for a particular class, you could use some of PHPs magic constants in your call.

  1.  $qry->Exec(__CLASS____LINE____FILE__);

  • return: Success (true) or Failure (false)
boolean Exec ([string $location = null], [int $line = null], [string $file = null])
  • string $location: The name of the location for enabling debugging or just to help our children find the source of a problem.
  • int $line: The line number where Exec was called
  • string $file: The file where Exec was called
Execute (line 374)

Tell the database to execute the query

void Execute ()
Fetch (line 623)

Fetch the next row from the query results

  • return: query row
mixed Fetch ([boolean $as_array = false])
  • boolean $as_array: True if thing to be returned is array
GetConnection (line 272)

Get the current database connection for this query

void GetConnection ()
Parameters (line 429)

Return the parameters we are planning to substitute into the query string

void Parameters ()
Prepare (line 351)

Tell the database to prepare the query that we will execute

void Prepare ()
QDo (line 524)

Simple QDo() class which will re-use this query for whatever was passed in, and execute it returning the result of the Exec() call. We can't call it Do() since that's a reserved word...

  • return: Success (true) or Failure (false)
  • access: public
boolean QDo (string 0, mixed 1)
  • string 0: The query string in PDO syntax with replacable '?' characters or bindable parameters.
  • mixed 1: The values to replace into the SQL string.
QueryString (line 421)

Return the query string we are planning to execute

void QueryString ()
Rollback (line 492)

Wrap the parent DB class Rollback() so we can $qry->Rollback() sometime after we $qry->Exec()

  • access: public
void Rollback ()
rownum (line 445)

Return the current rownum in the retrieved set

void rownum ()
rows (line 437)

Return the count of rows retrieved/affected

void rows ()
SetConnection (line 241)

Use a different database connection for this query

void SetConnection (resource $new_connection, [ $options = null])
  • resource $new_connection: The database connection to use.
  • $options
SetSql (line 504)

Simple SetSql() class which will reset the object with the querystring from the first argument.

  • access: public
void SetSql (string $sql)
  • string $sql: The query string in PDO syntax with replacable '?' characters or bindable parameters.
TransactionState (line 455)

Returns the current state of a transaction, indicating if we have begun a transaction, whether the transaction has failed, or if we are not in a transaction.

  • return: 0 = not started, 1 = in progress, -1 = error pending rollback/commit
int TransactionState ()
_log_query (line 289)

Log query, optionally with file and line location of the caller.

This function should not really be used outside of AwlQuery. For a more useful generic logging interface consider calling dbg_error_log(...);

void _log_query (string $locn, string $tag, string $string, [int $line = 0], [string $file = ""])
  • string $locn: A string identifying the calling location.
  • string $tag: A tag string, e.g. identifying the type of event.
  • string $string: The information to be logged.
  • int $line: The line number where the logged event occurred.
  • string $file: The file name where the logged event occurred.

Documentation generated on Wed, 04 Jul 2012 07:06:12 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AwlDatabase/_AwlDBDialect.php.html0000644000000000000000000001544011774765544020567 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page AwlDBDialect.php

File/AwlDBDialect.php

Description

AwlDatabase - support for different SQL dialects

This subpackage provides dialect specific support for PostgreSQL, and may, over time, be extended to provide support for other SQL dialects.

See http://wiki.davical.org/w/Coding/AwlQuery for design and usage information.

Classes
Class Description
 class AwlDBDialect The AwlDBDialect class handles support for different SQL dialects
Constants
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
E_USER_ERROR = 256 (line 18)

Documentation generated on Wed, 04 Jul 2012 07:06:12 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AwlDatabase/_AwlUpgrader.php.html0000644000000000000000000001256411774765544020571 0ustar Docs for page AwlUpgrader.php

File/AwlUpgrader.php

Description
Classes
Class Description
 class AwlUpgrader The AwlUpgrader Class.
Includes
 require_once ('AwlQuery.php') (line 11)

Documentation generated on Wed, 04 Jul 2012 07:06:12 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/awl/AwlDatabase/_AwlDatabase.php.html0000644000000000000000000001770011774765544020521 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Docs for page AwlDatabase.php

File/AwlDatabase.php

Description

AwlDatabase query/statement class and associated functions

This subpackage provides some functions that are useful around database activity and a AwlDBDialect, AwlDatabase and AwlStatement classes to simplify handling of database queries and provide some access for a limited ability to handle varying database dialects.

The class is intended to be a very lightweight wrapper with some features that have proved useful in developing and debugging web-based applications:

  • All queries are timed, and an expected time can be provided.
  • Parameters replaced into the SQL will be escaped correctly in order to minimise the chances of SQL injection errors.
  • Queries which fail, or which exceed their expected execution time, will be logged for potential further analysis.
  • Debug logging of queries may be enabled globally, or restricted to particular sets of queries.
  • Simple syntax for iterating through a result set.
See http://wiki.davical.org/w/AwlDatabase for design and usage information.

If not already connected, AwlDatabase will attempt to connect to the database, successively applying connection parameters from the array in $c->pdo_connect.

We will die if the database is not currently connected and we fail to find a working connection.

Classes
Class Description
 class AwlDatabase Typically there will only be a single instance of the database level class in an application.
Includes
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
 require_once ('AwlDBDialect.php') (line 37)

Documentation generated on Wed, 04 Jul 2012 07:06:11 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/docs/api/blank.html0000644000000000000000000000155311774765543013556 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 awl

awl

Welcome to awl!

This documentation was generated by phpDocumentor v1.4.3
awl-0.53.orig/docs/api/todolist.html0000644000000000000000000001022611774765551014324 0ustar Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370 Todo List

Todo List

awl

iCalendar::ApplyFilter()

  • Eventually we need to handle all of these possibilities, which will mean writing several routines:
    • Get Property from Component
    • Get Parameter from Property
    • Test TimeRange
    For the moment we will leave these, until there is a perceived need.

iCalendar::BuildFromText()

  • Remove this function.

iCalendar::DealWithTimeZones()

  • Remove this function.

iCalendar::DefaultPropertyList()

  • Remove this function.

EntryField

  • This class doesn't really provide a huge amount of utility between construct and render, but there must be good things possible there. Perhaps one EntryField is created and used repeatedly as a template (e.g.). That might be useful to support... Why is this a Class anyway? Maybe we should have just done half a dozen functions (one per major field type) and just used those... Maybe we should build a base class for this and extend it to make EntryField in a better way.

    EntryField is only useful at present if you desperately want to use it's simple field interface, but want to intimately control the layout (or parts of the layout), otherwise you should be using EntryForm as the main class.

iCalendar::iCalFooter()

  • Remove this function.

iCalendar::iCalHeader()

  • Remove this function.

iCalendar::JustThisBitPlease()

  • Remove this function.

iCalendar::ParseSomeLines()

  • Remove this function.

iCalendar::RFC2445ContentEscape()

  • Remove this function.

iCalendar::RFC2445ContentUnescape()

  • Remove this function.
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370

Documentation generated on Wed, 04 Jul 2012 07:06:17 +0000 by phpDocumentor 1.4.3

awl-0.53.orig/php-awl.spec.in0000644000000000000000000000237511632655132012715 0ustar %define snapshot @@ISSNAPSHOT@@ %define gitrev @@GITREV@@ %if %{snapshot} %define snapshotversionstring .%{gitrev}git %define snapshotpackagestring -git%{gitrev} %endif %define realname awl Name: php-%{realname} Summary: Andrew's Web Libraries - PHP Utility Libraries Version: @@VERSION@@ Release: 9%{?snapshotversionstring}%{?dist} Group: Development/Libraries License: GPL Source: http://debian.mcmillan.net.nz/packages/awl/awl-%{version}%{?snapshotpackagestring}.tar.gz URL: http://andrew.mcmillan.net.nz/projects/awl BuildArch: noarch %description This package contains Andrew's Web Libraries. This is a set of hopefully lightweight libraries for handling a variety of useful things for web programming, including: - Session management - User management - DB Records - Simple reporting - DB Schema Updating - iCalendar parsing %prep %setup -q -n "%{realname}-%{version}%{?snapshotpackagestring}" %build make %install rm inc/AWLUtilities.php.in mkdir -p %{buildroot}/%{_datadir}/php/%{realname} cp -a dba inc %{buildroot}/%{_datadir}/php/%{realname} %files %defattr(-,root,root) %{_datadir}/php/%{realname} %doc README %changelog * Tue Feb 22 2011 Felix Möller - 0.46 - Initial version of AWL package