64 Commits

Author SHA1 Message Date
ian%hixie.ch
0e1edf614f Also send default values to output.
git-svn-id: svn://10.0.0.236/trunk@107679 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 17:27:07 +00:00
ian%hixie.ch
738e081f7c Implement default values for arguments. getArgument() and createArgument() now take two parameters like setArgument(). Changed the CommandLine module's createArgument() method so that if the user hits enter at the prompt, the default value is used. Added some comments to clarify what is going on with the 'batch' argument. Changed setArgument() and createArgument() in the Arguments module and createArgument() in the CommandLine module to be more efficient (less array copying).
git-svn-id: svn://10.0.0.236/trunk@107678 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 17:09:11 +00:00
ian%hixie.ch
5741b48cad Adding comments to clearly indicate that no dump()s, warn()s or error()s should have a level lower than 5 unless they are not expected to occur during normal operation. Also changing the default level at which the user is notified of problems from 3 to 1.
git-svn-id: svn://10.0.0.236/trunk@107676 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 16:47:25 +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
97db51b03d Stop complaining about the configuration file missing -- if it is not there then just assume there is nothing to worry about. This makes the output of the initial run with the 'setup' argument a lot quieter.
git-svn-id: svn://10.0.0.236/trunk@107649 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 05:06:27 +00:00
ian%hixie.ch
04036664cd Make the STDOUT generic outputter flush everything it outputs -- this fixes a bug whereby sometimes prompts wouldn't appear until after the user had replied to them.
git-svn-id: svn://10.0.0.236/trunk@107648 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 05:03:57 +00:00
ian%hixie.ch
78c02b74a7 Disambiguate the names of the two methods 'hash' and 'sort'. They are now called 'genericHash' and 'genericSort' so as not to clash with the perl builtins 'CORE::hash' and 'CORE::sort'.
git-svn-id: svn://10.0.0.236/trunk@107539 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 02:49:21 +00:00
ian%hixie.ch
cbf27479f2 Correcting minor typo (extraneous ')'s).
git-svn-id: svn://10.0.0.236/trunk@104586 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-04 16:09:32 +00:00
ian%hixie.ch
a6aab56db7 The first ContactMethod, namely Email.
git-svn-id: svn://10.0.0.236/trunk@103212 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 18:56:05 +00:00
ian%hixie.ch
8458307437 Added a hook for installing new user fields so that setupInstall handlers don't have to go through the same process multiple times. Also corrected an obvious error (using a variable after checking that it couldn't be used...).
git-svn-id: svn://10.0.0.236/trunk@103208 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 18:43:06 +00:00
ian%hixie.ch
6e6fd80d50 Correcting the misspelling of the package names ('Components' not 'Component') to match the directory.
git-svn-id: svn://10.0.0.236/trunk@103207 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 18:29:39 +00:00
ian%hixie.ch
09011bc7ce Corrected the order of return values (newPassword) and removed the extraneous argument (output).
git-svn-id: svn://10.0.0.236/trunk@103206 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 18:11:03 +00:00
ian%hixie.ch
f841c45515 Cached the SMTP object to improve performance.
git-svn-id: svn://10.0.0.236/trunk@103205 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 18:05:28 +00:00
ian%hixie.ch
e857b66e93 Made the outputter be a simple service rather than a service instance to improve performance.
git-svn-id: svn://10.0.0.236/trunk@103204 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 18:01:23 +00:00
ian%hixie.ch
9c2608c334 Corrected an oversight in the service instance creation code: if a service acts as both a service instance and a normal service, it needs a special constructor to force the creation of the instance, otherwise if the service is created first it will be used again for the instances.
git-svn-id: svn://10.0.0.236/trunk@103203 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 17:56:15 +00:00
ian%hixie.ch
b17b61acb3 Fixed error messages to be more accurate.
git-svn-id: svn://10.0.0.236/trunk@102991 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 00:13:16 +00:00
ian%hixie.ch
d8bb2290c9 First stab at an e-mail output service. Also added support for checking addresses for validity and used that when creating a new account.
git-svn-id: svn://10.0.0.236/trunk@102623 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 21:02:33 +00:00
ian%hixie.ch
f2c4a72d49 Reduced the ErrorContext from 2 to 1. 2 is too much.
git-svn-id: svn://10.0.0.236/trunk@102620 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 19:48:14 +00:00
ian%hixie.ch
e4abc2ef8a corrected a comment, corrected the spelling of a method call, and added a placeholder in 'login.failed' which will eventually have to be replaced by code which finds the list of contact methods.
git-svn-id: svn://10.0.0.236/trunk@102619 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 19:47:04 +00:00
ian%hixie.ch
447d63ebe4 Added ErrorContext to the Expat arguments so that well formedness errors are easier to track down.
git-svn-id: svn://10.0.0.236/trunk@102618 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 19:38:24 +00:00
ian%hixie.ch
06727db199 Corrected and improved some comments.
Corrected a problem with scope and the 'escape' attribute of <text> elements.
Renamed 'shrink' and 'expand' to the slightly more accurate 'flatten' and 'rounden'. (ahem)
Changed the ordering of symbol unescaping in roundening to be less (not?) susceptible to incorrect expansion.
Changed the ordering of symbol escaping in flattening to be consistent with the unescape order when roundening.
Made <text> trim one leading and one trailing newline in text nodes if xml:space="default" (makes COSES files neater).
Added a 'coses: original keys' hash to values whose keys are sanitised
Made the 'escape' values be lower case instead of upper case (makes COSES files neater).


git-svn-id: svn://10.0.0.236/trunk@102617 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 19:36:23 +00:00
ian%hixie.ch
bf75d78321 Corrected the SQL for 'SHOW COLUMNS FROM' so that it actually works...
git-svn-id: svn://10.0.0.236/trunk@102616 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 19:21:17 +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
8c9220bbac Made the error message printed when no string expander can be found more explicit (it now mentions the name and type of the string).
git-svn-id: svn://10.0.0.236/trunk@102614 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 19:08:58 +00:00
ian%hixie.ch
37f35ccfe7 Added a comment clarification.
git-svn-id: svn://10.0.0.236/trunk@102613 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 19:06:13 +00:00
ian%hixie.ch
d14ad445fd Changed the magic piping array so that it is more consistent by removing the special casing of when there is only one return value.
git-svn-id: svn://10.0.0.236/trunk@102612 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 19:04:37 +00:00
ian%hixie.ch
03f038f0c1 Added the message level number to the debug output to help gauge what level is useful.
git-svn-id: svn://10.0.0.236/trunk@102611 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 17:55:21 +00:00
ian%hixie.ch
c6af0b8abd Added header and stylistic note.
Clarified some of the text.
Made the use of quotes more consistent.
Wrote Chapter 5, "USING GET SERVICE".
Added an empty Chapter 10, "THE SERVICE REFERENCE".


git-svn-id: svn://10.0.0.236/trunk@102610 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 17:48:07 +00:00
ian%hixie.ch
f8d7d98bf6 Added support for string escaping, and shrinking (flattening) and expanding of hashes of arrays (such as the data.input.arguments hash), to COSES. These features are necessary for making the UI layer of an application.
git-svn-id: svn://10.0.0.236/trunk@100003 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-30 06:29:25 +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
55545a8366 Added a hash of the user's rights to the user hash to make it easier to enable or disable UI elements
git-svn-id: svn://10.0.0.236/trunk@99936 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-26 03:40:56 +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
31afdd6c43 Stub implementation of a COSES editor component, plus added 'component.nameOfComponent' to the list of services provided by the other two components
git-svn-id: svn://10.0.0.236/trunk@96279 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-03 23:06:09 +00:00
ian%hixie.ch
a4e5deac24 Moved AdminCommands.pm and Login.pm to a Component directory
git-svn-id: svn://10.0.0.236/trunk@96278 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-03 22:45:37 +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
ian%hixie.ch
c054620213 Some more minor corrections to get it to run as well as compile... (removes some XXX comments and adds some error checking)
git-svn-id: svn://10.0.0.236/trunk@96275 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-03 15:27:16 +00:00
ian%hixie.ch
e283e3f98d Fixing a gazillion syntax, logic and XML errors and adding some debug code. It compiles!
git-svn-id: svn://10.0.0.236/trunk@96274 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-03 14:49:41 +00:00
ian%hixie.ch
1c4b9ea728 * Added some comments (including some XXX comments where I realised we had missing code)
* Added implicit data to the hash passed to the string expander from the generic output service
* To support the implicit data, added a |hash| stub method to the Session.pm module (and changed the already implemented version in the descendant user service to take this into account)
* To support the implicit data, added |hash| and |getArguments| methods to the Input.pm module (and implemented |getArguments| in the Arguments.pm module)
* To support the implicit data, made the Program.pm module keep track of the executing command
* To support the implicit data, added |hash| and |name| methods to the Program.pm module (actually, |name| was already assumed to exist in other parts of the codebase)
* Corrected trivial semantic mistake in Program.pm's |verifyInput| method
* Added a way to get a user not by username but by a specific address (modifies the user service and the user data source and it's MySQL implementation)
* Implemented GenericOutputs.pm, an implementation of 'dispatcher.output.generic' and 'dataSource.strings.default' for some strings used by other parts of PLIF (currently only supports 'stdout' and 'http' protocols, and minimally at that)
* Implemented Login.pm, a helper module that implements user authentication, user creation and the sending of a new password if it is forgotten, a utility method |hasRight| to ensure that the authenticated user has a particular right (resulting in a message if not), and various routines to support all this.


git-svn-id: svn://10.0.0.236/trunk@96268 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-03 10:11:58 +00:00
ian%hixie.ch
1e260d62d7 * fixing some syntactic errors
* added addUserGroup and removeUserGroup to the data source interface for users
* added some comments
* changed many double quotes |"| to single quotes |'| where double quotes were not needed
* implemented the remaining methods for the MySQL implementation of the user data source
* added a mode flag to user fields (idea from MattyT) so that fields can be disabled, hidden, etc


git-svn-id: svn://10.0.0.236/trunk@96152 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-01 00:32:35 +00:00
ian%hixie.ch
66a92ef424 Change the semantics of address changing, making it faster, smaller, simpler, and better. Aaah... :-) In the new system, instead of cloning the current $session object to pass it back to the output code, you pass the real $session object to the output code, just making sure that the relevant field has been warned to return a different address than found in the database.
git-svn-id: svn://10.0.0.236/trunk@96006 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-29 20:34:12 +00:00
ian%hixie.ch
7d520650d0 Adding some XXX comments regarding a known bug (when the user is changing their address, fields try to update the database before the new address has been authenticated)
git-svn-id: svn://10.0.0.236/trunk@95992 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-29 09:11:33 +00:00
ian%hixie.ch
10a6e949df * Fixing a minor bug in the MySQL implementation of the string data source
* Started implementing the MySQL version of the user data source (completed so far: database creation and a few of the SELECT calls)
* Changed the user property 'disabled' to 'mode' to enable extensibility
* Fix a potential bug with changing addresses (make sure the fake session object doesn't update the database -- this is an incomplete solution so far, fields still have the bug)


git-svn-id: svn://10.0.0.236/trunk@95991 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-29 09:07:10 +00:00