Commit Graph

66 Commits

Author SHA1 Message Date
ian%hixie.ch
20b2bde161 Don't add NULLs to the database when setting a field
git-svn-id: svn://10.0.0.236/trunk@153230 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-25 19:23:17 +00:00
ian%hixie.ch
d0e1d3a931 remove DESTROY code, rework the output system to use a single hash instead of passing arguments around, delay the loading of certain modules, fix some bugs with the removal of the built in property system, make the TemplateToolkit module only have one template object, and cache the precompiled documents, remove the HTTP output module, and other optimisations.
git-svn-id: svn://10.0.0.236/trunk@139517 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-15 14:14:21 +00:00
ian%hixie.ch
dcb58218de Improve the Exception class so it can work out what 'eval' numbers map to; remove the 'properties' stuff since it was taking a good 4% of the overall time of PLIF applications. THIS WILL CAUSE HUGE PROBLEMS WITH PLIF CONSUMERS. I REPEAT, THIS **WILL** BREAK YOUR CODE. DO NOT UPDATE TO THIS CODE IF YOU DON'T WANT TO SPEND A LOT OF TIME UPDATING YOUR CODE\!\!\!
git-svn-id: svn://10.0.0.236/trunk@139447 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-14 13:08:43 +00:00
ian%hixie.ch
4015b54a02 Stop perl parsing source files that aren't used. (Lazy loading using __DATA__ blocks)
git-svn-id: svn://10.0.0.236/trunk@139442 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-14 07:50:18 +00:00
ian%hixie.ch
c5c4e57fc9 Support compiled templates in a separate directory
git-svn-id: svn://10.0.0.236/trunk@139418 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-14 02:13:03 +00:00
ian%hixie.ch
6491fc1049 TemplateToolkit doesn't support .defined on objects. Also, stringify objects early to avoid trying to apply .replace, etc, on them.
git-svn-id: svn://10.0.0.236/trunk@136101 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-10 00:19:47 +00:00
ian%hixie.ch
e376750c1d Escape newlines in keys. Explicitly mention empty arrays and hashes. Quote string values. Support undefined values.
git-svn-id: svn://10.0.0.236/trunk@135864 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-05 23:47:15 +00:00
ian%hixie.ch
e6ec1b20e3 Oops, forgot to escape the backslashes when I pasted my TemplateToolkit file into Perl.
git-svn-id: svn://10.0.0.236/trunk@135801 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-03 00:47:32 +00:00
ian%hixie.ch
7f09c2f1fb Switch to a hopefully much faster debug.dumpVars template
git-svn-id: svn://10.0.0.236/trunk@135800 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-03 00:24:27 +00:00
ian%hixie.ch
d8f35b1b4a Update PLIF to take advantage of the new PLIF exception handling library
git-svn-id: svn://10.0.0.236/trunk@135638 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-26 04:37:22 +00:00
ian%hixie.ch
2a5ec84f5f To make debugging easier, move the level 9 output debugging dumps from failure cases in the datasources to always, in the generic output service. May need further tweaking later.
git-svn-id: svn://10.0.0.236/trunk@129333 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-12 11:45:17 +00:00
ian%hixie.ch
17e6ebaa70 Update the string data source to use the new input metadata APIs
git-svn-id: svn://10.0.0.236/trunk@124734 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-07 00:13:29 +00:00
ian%hixie.ch
a31edff424 Oops, forgot to make the primary key ID an auto_increment column.
git-svn-id: svn://10.0.0.236/trunk@120823 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-06 09:53:01 +00:00
ian%hixie.ch
b54f6a7738 Fixing the spelling of getRightsForGroups() where it is declared and used. Also fixing one of the SQL statements to use rights.rightID not rights.ID.
git-svn-id: svn://10.0.0.236/trunk@120813 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-06 04:36:42 +00:00
ian%hixie.ch
e93997dd50 Rename 'setting' to 'settings' throughout to be consistent. Also, make it so that someone with the right to change all groups gets to be the equivalent of an owner even in groups where he is only marked as administrator.
git-svn-id: svn://10.0.0.236/trunk@120810 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-06 03:54:14 +00:00
ian%hixie.ch
05037798ba Split the confused getRights API into two, one to get the list of rights, and one to get the list of rights applicable to a set of groups. Make the user's output hash list all rights if the user is an administrator (this mirrors the behaviour of the user hasRight API).
git-svn-id: svn://10.0.0.236/trunk@119516 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-21 14:11:41 +00:00
ian%hixie.ch
120f95a991 Updating built in COSES strings to match the new semantics (no 'data.' prefix required on variables)
git-svn-id: svn://10.0.0.236/trunk@118397 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-06 19:29:13 +00:00
ian%hixie.ch
c04aaeb1d7 Make the File string data source capable of looking for file-based templates in two locations, one specific to the app and one relative to the library. This allows PLIF to ship with default templates for various screens and thus makes it easier to bootstrap a simple app.
git-svn-id: svn://10.0.0.236/trunk@118280 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-05 20:17:34 +00:00
ian%hixie.ch
3e9ca21d73 * Added getGroupMembers() to the User data source.
* Fixed a bug in the MySQL implementation of User data source's getGroupName() method. It treated 'row' as an array ref instead of a normal array.
* Made the MySQL User data source automatically add a group with ID 1, named 'Administrators'.
* Special-cased the group with ID 1 in the user object so that if a user is in that group, he automatically is assumed to have all rights.
* Fixed a bug with the saving of the original groups in the user object (the backup object was simply a reference to the original object, which was later changed in place, causing the backup to change too).
* Fixed the handling of rights in the user object constructor to simply set the rights in one line instead of using indirection.
* Fixed the invalidateRights() method of the user object to correctly re-set the rights (previously it was not turning the generated array into a hashref).
* Added a setup.install implementation to the login component. It now queries the user for an administration username and creates the relevant user and puts it in the magic group 1.
* Fixed a call to checkAddress() in the login component.


git-svn-id: svn://10.0.0.236/trunk@113408 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-01 06:48:02 +00:00
ian%hixie.ch
8e82e0ec2a Fix a minor typo in some SQL code which was causing an error during the creation of the user table.
git-svn-id: svn://10.0.0.236/trunk@112824 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-25 03:18:15 +00:00
ian%hixie.ch
4612fcaf55 Moved the DBI module over to thew new more generic settings getting/saving API and removed the old DBI-specific one. Fixed an assert() call to check for the values being defined and not non-zero/non-blank. Fixed the password field to allow blank values (by making a blank value the default). Also fixed the calls to getArgument to not ever pass an undefined value as the default.
git-svn-id: svn://10.0.0.236/trunk@112822 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-25 03:17:05 +00:00
ian%hixie.ch
6b5cf00273 Fixing SQL error (DROP COLUMN not REMOVE COLUMN)
git-svn-id: svn://10.0.0.236/trunk@111183 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-31 06:04:30 +00:00
ian%hixie.ch
46053b778d Changing e-mail address now sends a confirmation mail to the old address too. Implemented by making changing fields a generic mechanism. Also fixed some minor nits.
git-svn-id: svn://10.0.0.236/trunk@111170 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-30 00:33:36 +00:00
ian%hixie.ch
acde38c21c Removing debug() calls.
git-svn-id: svn://10.0.0.236/trunk@111080 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-26 19:01:07 +00:00
ian%hixie.ch
149d647b08 Removing debug() calls, and removed the mention of a user 'logged out' state now that logging our is protocol specific.
git-svn-id: svn://10.0.0.236/trunk@111078 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-26 18:52:23 +00:00
ian%hixie.ch
0a0d76f22a Removed a redundant |scalar()| -- |if| implies a scalar context anyway.
git-svn-id: svn://10.0.0.236/trunk@111067 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-26 16:05:54 +00:00
ian%hixie.ch
5e76d0defd getFieldsHierarchically() will now return an even prettier result. Since it is mainly (currently only?) used for creating the data hash sent to the string expanders, this makes it a lot easier to author the templates. No silly numbers to remember. :-)
git-svn-id: svn://10.0.0.236/trunk@109622 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 12:51:48 +00:00
ian%hixie.ch
1fde83c771 Made all dependencies load their modules on demand rather than on startup (cuts down the page serving time by about 50%). Also removed some debugging statements in certain high profile areas.
git-svn-id: svn://10.0.0.236/trunk@109373 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 20:48:36 +00:00
ian%hixie.ch
9ea87b9464 Added support for easily getting the original key name of a munged key: added a virtual '.coses: original key' entry to all hashes in COSES (works similar to the virtual '.length' item that all arrays have). Edited the debug string to mention these virtual items.
git-svn-id: svn://10.0.0.236/trunk@109361 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 16:20:22 +00:00
ian%hixie.ch
9d60eadb89 Implemented logout and explicit new account creation in the login service. Had to add removeObject() to the Controller module (the opposite of the exisiting addObject()).
git-svn-id: svn://10.0.0.236/trunk@109357 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 13:31:29 +00:00
ian%hixie.ch
ced7a9ce15 Minor fixes to make the previous checkin actually compile...
git-svn-id: svn://10.0.0.236/trunk@109239 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-29 20:23:48 +00:00
ian%hixie.ch
d65266d7a4 * Corrected some inaccurate comments I came across.
* Added support for group membership levels (now you can be a normal member, as before, but also a group op or a group admin) -- this affected the user data source, the mysql data source, and the user service.
* Added a getFieldsHierarchically() method to the user data source.
* Added a getFieldsByCategory() method to the user data source.
* Fixed a typo in some of the SQL in the rights management part of the MySQL user data source.
* Added support in the arguments input module for treating the arguments as dot-delimited trees and returning a specific branch.
* Added support in the passwords service for encrypting a specific password.
* Added a getFieldByID() method to the user service.
* Made the groups in the user service be indexed by both ID and Name.
* Implemented the user preferences component.


git-svn-id: svn://10.0.0.236/trunk@109234 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-29 18:03:38 +00:00
ian%hixie.ch
90f855808b * Created service- and serviceInstance- specific constructors so that a single module can have distinct constructors depending on how it is invoked. These constructors are called serviceInit() and serviceInstanceInit(), and both chain to the existing init() constructor (so no change are required by this).
* Changed FileStrings so that it doesn't have to be updated every time the file string format changes. The format is now one line per piece of metadata, then a blank line, then the string data. If additional metadata is added later then this will automatically support it.
* Renamed the dataSource.strings service to dataSource.strings.customised, and renamed its get() method to getCustomisedString().
* Changed the semantics of dataSource.strings.customised so that it no longer looks for a default string if it can't find a customised one (and thus removed getDefaultString).
* Abstracted the Generic output module even more. It now consists of output.generic (a service instance with its own constructor) and dataSource.strings (a pure service), the latter of which is a wrapper around dataSource.strings.customised and dataSource.strings.defaults.
* Updated Coses to work with the new dataSource.strings insterface.
* Removed the test app DataSource::ConsoleStrings and DataSource::HTTPStrings files, since they were redundant with the default output files.
* Removed all the default strings in the CosesEditor and Login components since they are pretty pointless.
* Factored out the call to dump() in the GenericOutputs module.
* Changed setString in the MySQL string data source so that it will now add a blank string (it used to delete the string if it was blank, but that meant that it was not possible to customise strings away).
* Added a piece of metadata to strings: their version number.
* Updated the customised string data source stubs to mention the version data now stored with all strings
* Added a getAllStringVersions method to the customised strings data source which returns all the string names and their version numbers.
* Made the customised strings data source check the version number of every string in its database during setupInstall to make sure that they are all up to date, version-wise. If any are out of date, the user is notified.
* Added support for the new version column to the MySQL version of the customised string data source.
* Updated the increasingly misnamed CosesEditor to support the versioned strings stuff.
* Factored out some code in the CosesEditor.
* Added version information to all default strings. All default strings are now at version 1.
* Fixed a typo in a FileStrings dump statement.
* Fixed the calls to setProgress in the MySQL user and strings data sources and in the user field factory to use the correct syntax (a parsable dotted string instead of unlocalisable plain English).
* Updated the Generic output module's documentation to match what now happens.


git-svn-id: svn://10.0.0.236/trunk@108806 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-22 15:46:42 +00:00
ian%hixie.ch
b7cb0633c4 We should be able to access strings with uppercase letters -- oops. Changing regexp to include 'A-Z' as well as 'a-z'. Also adding a dump statement in the failure case to help when analysing the log looking for a bug.
git-svn-id: svn://10.0.0.236/trunk@107892 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 15:33:59 +00:00
ian%hixie.ch
6738fc00b6 Return the user ID even when the user exists, so that there is no need for callers to check the return value.
git-svn-id: svn://10.0.0.236/trunk@107839 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 20:43:44 +00:00
ian%hixie.ch
4b6476a5c9 implemented getFieldNamesByCategory() in the user data source, and used it to fill in the list of contact methods for the loginFailed output handler.
git-svn-id: svn://10.0.0.236/trunk@107830 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 10:55:33 +00:00
ian%hixie.ch
3443dd9f0e Adding support for generic saving and retrieving of settings.
git-svn-id: svn://10.0.0.236/trunk@107760 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 20:13:21 +00:00
ian%hixie.ch
822aa05814 Added two new hooks into the setup code: a start notification and an end notification. Added the ability to disable the string datasource (causes it to only use the default strings and not the database). Made the string datasource automatically disable itself during configuration, using the two hooks added to the setup code. This removes the warning messages that are output during a clean setup ('could not get string from database', etc).
git-svn-id: svn://10.0.0.236/trunk@107675 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 16:42:42 +00:00
ian%hixie.ch
9cc94f02cd Improved error handling for the case where the database configuration doesn't exist and therefore every output attempt raises database errors. Fatal database errors are now fatal, missing database configurations is not. This would be a lot cleaner if Perl exceptions were objects... Also improved some of the error messages.
git-svn-id: svn://10.0.0.236/trunk@107673 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 16:10:21 +00:00
ian%hixie.ch
f74c5a2421 Added a little more level 9 verbose debugging feedback to help track down where output is going wrong.
git-svn-id: svn://10.0.0.236/trunk@107651 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 05:07:42 +00:00
ian%hixie.ch
67dc277de0 Added a string data source which gets the strings from a file instead of from the database, useful as a fallback.
git-svn-id: svn://10.0.0.236/trunk@102615 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 19:19:05 +00:00
ian%hixie.ch
8232699993 * Abstracted out the string expander logic so that now strings have to say what string expanded they expect to be processed with (e.g., 'COSES', 'XSLT', 'Template' or whatever). This required one field 'type' to be added to every default string and a new field 'type' to be added to the string data source.
* Changed the COSES editor to support the abstracted logic mentioned above (note: maybe "COSES editor" is no longer an apt name...).
* Made the parseNS method of the XML service actually do something.
* Made the COSES processor namespace aware.
* Changed <coses:embed string=""> to <coses:include href="">. I was going to change it to an XInclude, but it turns out the processing model is wrong for that (XInclude, for instance, bans recursive nesting). Added support for a 'parse' attribute just like for XInclude (support three values: 'xml', 'text' and 'x-auto').
* Added columnExists() to the DBI database helper.
* Added string caching to the strings data source. Should be particularly helpful for Apache mod_perl installations.


git-svn-id: svn://10.0.0.236/trunk@99999 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-29 22:38:30 +00:00
ian%hixie.ch
8af7171695 Added better handling for error conditions in the Database code, and fixed the 'addRight' method to use it.
Pasted in excerpts from the DBI man pages with sections highlighted in order to keep track of what will need fixing.


git-svn-id: svn://10.0.0.236/trunk@99932 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-26 00:54:37 +00:00
ian%hixie.ch
24c472b7af * Added a section on common errors to Documentation.txt
* Added more comments to a few modules
* Changed the semantics of adding and removing user fields ("user data types")
* Implemented a factory service to perform those semantics ('registerField', 'removeField' and the convenience 'registerSetting')
* Added a missing return in the MySQL implementation of the user data source
* Added an assert in the MySQL version of 'addRight' to catch an easy error
* Added XXX comment in the MySQL version of 'addRight' (will fix this in the next patch)
* Fixed a case where sending an undefined value to the DBI database implementation would fail during the untainting
* Fixed MySQLID to actually work (in the DBI ResultsFrame)
* Fixed two typos in the user service ('settings' to 'setting')
* Added the requirement that a user must have certain rights to use the COSES editor
* Added a setupInstall implementation to the COSES editor


git-svn-id: svn://10.0.0.236/trunk@99929 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-25 23:54:32 +00:00
ian%hixie.ch
1b672eeb27 Mainly changes to make it compile and easier to debug:
* Made the start of an execution start clearer in the error log. This depends on the debug level; just makes it easier to determine what is a single execution block in a 70MB error log.
* Changed a stray semicolon into a comma, and fixed other misspellings or typos.
* Added the default strings to the CosesEditor component.


git-svn-id: svn://10.0.0.236/trunk@99910 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-25 09:32:28 +00:00
ian%hixie.ch
f23823c216 * Implemented dispatcher.output service in CosesEditor.pm
* Implemented dispatcher.output.generic service in CosesEditor.pm
* Fixed a semantic error in the string data source


git-svn-id: svn://10.0.0.236/trunk@97805 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 04:07:21 +00:00
ian%hixie.ch
618a97a5e3 (this checkin comment applies to the previous checkin on this file as well)
* Added some comments to various files indicating work to do and documenting some methods
* Fleshed out the Strings Data Source API (and implemented it in the MySQL version)
* Added the name "MySQL" to the MySQL-specific ID method of the Database Helper
* Factored out the XML parser dependency into an XML service
* Added a generic content sink implementation to the XML service
* Added a convenience method for manipulating user settings
* Added and implemented all the COSES commands
* Removed trailing spaces


git-svn-id: svn://10.0.0.236/trunk@97796 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 00:20:22 +00:00
ian%hixie.ch
b580592261 * Added some comments to various files indicating work to do and documenting some methods
*


git-svn-id: svn://10.0.0.236/trunk@97793 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 00:10:43 +00:00
ian%hixie.ch
c39644bda6 * Improved the helpfulness of the extremely verbose debugging information of PLIF.pm by quoting embedded variables
* Implemented MagicCollectingArray, which acts like MagicPipingArray except that the result is collected into one big array instead of multiple arrayrefs
* Added the relevant getCollecting*List methods to the Controller class
* Added DESTROY methods to the magic array to prevent DESTROY method calls from being propagated
* Made the debug.dumpVars string more robust when the data hash includes one of the three magic characters '(', '.' or ')'
* Implemented sanitation in COSES so that any keys in the data hash containing one of the three magic characters '(', '.' or ')' will have them transliterated to '[', ':' and ']' respectively (sanitation is optional and can be bypassed)
* Changed the API of the generic output module's 'output' method to take the optional $session argument last, thus simplifying the call sites a lot
* Implemented the 'dispatcher.output' service in several classes to return strings that must be support in variants (required for a good UI in the COSES editor)
* Renamed the Login module's strings so that they use the dot-notation separating significant parts


git-svn-id: svn://10.0.0.236/trunk@96296 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-04 06:13:22 +00:00
ian%hixie.ch
c77a5c18e0 Minor bug fixes required to make the code run without crashing...
git-svn-id: svn://10.0.0.236/trunk@96276 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-03 16:14:41 +00:00