Граф коммитов

366 Коммитов

Автор SHA1 Сообщение Дата
ian%hixie.ch 34268809ac Added support for password-less installations. Also added some comments and made font-lock happier. 2002-04-06 19:23:24 +00:00
ian%hixie.ch 871763fcb5 change the name adminHostname to the more accurate localHostname 2002-04-06 19:16:09 +00:00
ian%hixie.ch f94e20287e Adding Template Toolkit support. See http://www.template-toolkit.org/ for documentation on the template toolkit format. 2002-04-05 22:39:59 +00:00
ian%hixie.ch 70f92fe612 Add getArgumentsBranch() virtual method declaration (for completeness). 2002-04-05 22:13:52 +00:00
ian%hixie.ch f8012497bf Update: Yet more things that need doing. 2002-04-05 20:25:11 +00:00
ian%hixie.ch 7c6fe87ed8 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. 2002-04-05 20:17:34 +00:00
ian%hixie.ch 1f3b041aaa Default error reporting page. 2002-04-05 20:15:27 +00:00
ian%hixie.ch 455922b478 Default templates for headers and footers that can be used by other templates. 2002-04-05 20:13:51 +00:00
ian%hixie.ch ad1ba85936 Update the parameter list so that the 'type' parameter is explicitly named (although it still isn't used since this expander only supports one type). Also change the semantics of the data hash: no longer replace the data into a one member hash. This is a minor optimisation that eases interaction between expanders but will require changes to all existing templates. 2002-04-05 19:16:14 +00:00
ian%hixie.ch b52700b1d2 Add a 'type' argument to the string expander interface so that string expanders can support multiple types. Also split getExpandedString so that callers can expand strings separately from getting strings, in case that is ever necessary. 2002-04-05 19:13:14 +00:00
ian%hixie.ch 5230bdd859 Minor typo correction: change 'import New::SMTP' to 'import Net::SMTP' 2002-04-05 19:11:21 +00:00
ian%hixie.ch a89dffc374 * 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.
2002-02-01 06:48:02 +00:00
ian%hixie.ch 1c49734d21 Commented out the call to Net::SMTP's verify() method and replaced it with a generic regexp sanity check. It appears that VRFY is not correctly implemented on all servers. (I may be mistaken on this; it might just be a bug somewhere in the PLIF code that is messing something up, but I couldn't find it if so.) 2002-02-01 06:38:55 +00:00
ian%hixie.ch 3a41393898 Added a check that ensures that the configuration file is not readable or writable by anyone except the user running the script. This closes a potential security hole on shared machines. Changed the umask during the creation of the configuration file so that the permission bits are set that way too. Added a comment to clarify the superficially recursive nature of the configuration database and the configuration data source. 2002-02-01 06:36:27 +00:00
ian%hixie.ch 2787ed1409 Another change that should be done at some point: Move PLIF/DataSource/*/MySQL.pm to PLIF/DataSource/MySQL/*.pm 2002-02-01 06:32:17 +00:00
ian%hixie.ch 7b34209a7b Removed an erroneous comment, which should be the last traces of the old problem of the lack of a configuration file being a fatal error. 2002-01-31 18:30:21 +00:00
ian%hixie.ch ed5ab39edd Theoretical nit: call inherited constructor just in case at some point in the future it does something useful... 2002-01-31 17:35:52 +00:00
ian%hixie.ch 551d3369d7 Fix a minor typo in some SQL code which was causing an error during the creation of the user table. 2002-01-25 03:18:15 +00:00
ian%hixie.ch 28d425cd54 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. 2002-01-25 03:17:05 +00:00
ian%hixie.ch 7ac3c80e5c More things that need doing on the long (and not so long) run. 2002-01-25 03:12:26 +00:00
ian%hixie.ch c80c11fad9 getting rid of the last traces of the newFieldXXX stuff 2001-12-31 06:28:59 +00:00
ian%hixie.ch 7674dacda9 abstracted out some common code. Made the flushing of pending text happen after each end tag as well as each start tag. (Not doing this was causing whitespace between sibling elements to be treated as trailing whitespace of the first element, resulting in excessive whitespace -- typically newlines -- in the output stream.) 2001-12-31 06:07:04 +00:00
ian%hixie.ch 1bb8d54c2c Fixing SQL error (DROP COLUMN not REMOVE COLUMN) 2001-12-31 06:04:30 +00:00
ian%hixie.ch fa701c948c delete() doesn't work with array references in old versions of perl5. 2001-12-31 02:40:49 +00:00
ian%hixie.ch eccb9aca1d Checking in a list of things that still need doing. 2001-12-30 01:03:45 +00:00
ian%hixie.ch 7bb48dfffc 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. 2001-12-30 00:33:36 +00:00
ian%hixie.ch 41564734e3 * Removed incorrect comments.
* Added some XXX comments.
* Changed the way text nodes are handled so that adjacent text nodes are merged.
* Changed the way original keys are kept so that they work across flattening, rounding, and that there is no 'coses: original keys' hash getting in the way.
* Fixed a bug whereby empty arrays and hashes caused extraneous iterations in <set> elements.
* Removed some redundant scalar()s.
2001-12-26 19:30:16 +00:00
ian%hixie.ch dc80936c17 Made debug() be level 6 instead of level 7. Added various comments. 2001-12-26 19:12:57 +00:00
ian%hixie.ch 6cf0f6394c Removed an unused variable. Made the selecting array always return an array even in scalar context. This makes using it in |if| statements a lot easier. 2001-12-26 19:03:07 +00:00
ian%hixie.ch 6415154def Removing debug() calls. 2001-12-26 19:01:07 +00:00
ian%hixie.ch ff47917188 Removing debug() calls, and removed the mention of a user 'logged out' state now that logging our is protocol specific. 2001-12-26 18:52:23 +00:00
ian%hixie.ch 0c63b62da7 Adding some error handling for the case where connecting to the AIM server fails. Also removing an extraneous dump() statement. 2001-12-26 18:35:16 +00:00
ian%hixie.ch caac55f5f3 An implementation of a logout service for HTTP. 2001-12-26 18:34:01 +00:00
ian%hixie.ch c869b6822d Since User.pm is now calling this object's 'hash' method instead of using 'data' directly, we had better implement 'hash'. Also make setting the property always check that the value being set is valid. 2001-12-26 18:19:15 +00:00
ian%hixie.ch f1129a6449 Since logout is now protocol specific, removing support for logging out from the user object. Also making the 'hash' method more generic by making it call the field 'hash' method instead of assuming it will never pass more than the data of a field. 2001-12-26 18:15:14 +00:00
ian%hixie.ch 25ba099600 Changed the implementation of cmdSetup to store the results of the selecting service lists in an array instead of a scalar. 2001-12-26 17:45:05 +00:00
ian%hixie.ch 39a7e0dafe Change from a hard-coded logout mechanism to a generic per-protocol logout mechanism. 2001-12-26 17:38:41 +00:00
ian%hixie.ch 763aa79b24 A new type of user field for strings that are in the form of integers. 2001-12-26 17:18:00 +00:00
ian%hixie.ch 8be4dec718 Removed some |scalar()|s where they were redundant, added some XXX comments, and fixed a couple of logic errors (>2 should have been >=2 and stuff like that -- this code really should use named constants) 2001-12-26 16:46:06 +00:00
ian%hixie.ch a8a4ffb711 |not| implies a scalar context, so there's no need for an explicit |scalar()| 2001-12-26 16:10:17 +00:00
ian%hixie.ch 6a8b581138 Removed a redundant |scalar()| -- |if| implies a scalar context anyway. 2001-12-26 16:05:54 +00:00
ian%hixie.ch 77fac412e2 Clarified a comment. 2001-12-26 16:03:55 +00:00
ian%hixie.ch 5bb8ed02a5 A few minor fixes: checked for a reference being defined rather than being true (twice), replaced some double quotes with single quotes, and removed a trailing dot on a call to error(). 2001-12-26 15:45:01 +00:00
ian%hixie.ch a75437cefb Removing a level 10 dump statement that was being hit a lot. 2001-12-26 15:42:21 +00:00
ian%hixie.ch 988853e179 Removing a bunch of dump(10, ...) calls. It turns out that dump() is actually quite expensive, and calling it 1000+ times just to do nothing isn't that useful. In addition, most of these dump()s were used to debug the core PLIF code which now works pretty well, so they aren't that useful any more. 2001-12-04 18:06:06 +00:00
ian%hixie.ch 0ac4b20d8e PLIF::Service::XML::Char() was the most expensive function in a typical profile. This takes it completely off the radar by not bothering to merge adjacent strings. 2001-12-04 17:51:23 +00:00
ian%hixie.ch 199ee1a91f Changed the groupsById and groupsByName hashes of arrays into hashes of hashes to make them friendlier to handle. Also fixed some typos (groupByID instead of groupsByID, and one case of groupsByID where groupsByName was meant) and optimised away a call to dataSource.user's getGroupName method (since we already know the name). 2001-12-04 14:34:54 +00:00
ian%hixie.ch a4d4cebebf Fixing copy/paste error -- the user prefs object isn't the application object... 2001-12-04 13:40:04 +00:00
ian%hixie.ch b382ef763c Make '0' and '' be equivalent to 'default' for the 'order' attribute of the <set> element. This makes defaulting actually work (missing attributes seem to get set to ''?). 2001-12-04 13:08:39 +00:00
ian%hixie.ch 9868c69a29 Place a 5 second timeout on the SMTP object -- this makes running setup bearable without an SMTP server (the default timeout is 2 minutes). 2001-12-04 12:53:40 +00:00
ian%hixie.ch 1454dc7651 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. :-) 2001-12-04 12:51:48 +00:00
ian%hixie.ch 09282c5818 Fixed a bug in the main run loop whereby the objects array wasn't freed until shutdown, which sometimes meant objects got destroyed after the application, which is bad when the objects use the application to find services, etc. (This doesn't happen with services since services are not allowed to store references to the application, either directly or indirectly through references to objects or service instances.) Fixed the logout code to wait until the user tries to do something that requires login before clearing the logging out flag. This fixes a bug with HTTP whereby if a user logged out then his UA wouldn't ever be sent a 401 so wouldn't ever lose the authentication info, because browsers send the authentication info regardless of whether a page needs it or not. Also took the opportunity to remove a potential bug in the input validator code: store the admin message instead of a reference to the user object which might end up with a lifetime longer than expected. 2001-12-01 04:37:26 +00:00
ian%hixie.ch ac14fa1708 Removed an outdated comment. It is now safe to have a single module be a service, one or more service instances, and one or more objects all at the same time. 2001-12-01 04:29:20 +00:00
ian%hixie.ch 79c1860606 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. 2001-11-30 20:48:36 +00:00
ian%hixie.ch 050ad60758 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. 2001-11-30 16:20:22 +00:00
ian%hixie.ch 389c6783a8 Fixing an inconsistency between getArgument() and peekArgument(). peekArgument() now returns an empty list in an array context if there is no such argument, instead of undef. This makes it act like getArgument(), which just returns the list of values in an array context. Similarly, made the default implementation of peekArgument() whine about not being implemented instead of returning undef, since by design peekArgument() should return the same as getArgument() if the argument is present. 2001-11-30 16:13:00 +00:00
ian%hixie.ch d7607585fc Adding error handling for the case where the user prefs editor is called with bogus user IDs. 2001-11-30 16:06:45 +00:00
ian%hixie.ch 004b78a163 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()). 2001-11-30 13:31:29 +00:00
ian%hixie.ch d0f1adf983 Minor fixes to make the previous checkin actually compile... 2001-11-29 20:23:48 +00:00
ian%hixie.ch ae996eb3e1 * 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.
2001-11-29 18:03:38 +00:00
ian%hixie.ch 002b60fd9c work in progress: a component that provides a way for users and admins to edit user preferences, settings, contact details, password, etc. 2001-11-23 00:16:44 +00:00
ian%hixie.ch d84431bbb0 changing the argument names from the cosesEditorXYZ form to the cosesEditor.x.y.z form. This will make them more consistent with how things work elsewhere in PLIF. 2001-11-22 20:15:45 +00:00
ian%hixie.ch ee423a9430 * 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.
2001-11-22 15:46:42 +00:00
ian%hixie.ch c1fbe83087 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. 2001-11-11 15:33:59 +00:00
ian%hixie.ch c2b7af4e48 Missed a return statement in the setupInstall method. This was causing setup to fail every time, because the function returned a defined value. 2001-11-11 11:48:14 +00:00
ian%hixie.ch 333b70e6e1 Should have been checking for a defined value, not a true value -- there is nothing to stop a failure from being '0', for instance. (The important thing is to be consistent with the SelectingServiceList code, really, and it uses defined().) 2001-11-11 11:47:02 +00:00
ian%hixie.ch ebf177c5db Mute the Net::AIM warnings and add some null-checking code to the close() method. 2001-11-11 08:08:26 +00:00
ian%hixie.ch c9fdcfec0f First stab at primitive AIM output support as an alternative to e-mail. 2001-11-11 04:18:09 +00:00
ian%hixie.ch fb9e84ff2d Fix typo (PLIFF->PLIF) 2001-11-11 00:58:48 +00:00
ian%hixie.ch a538c2a0cd Fix the DESTROY method to actually call the close() method like it was supposed to. 2001-11-11 00:14:07 +00:00
ian%hixie.ch 085c309f7d Change the order of the settings so as to match the order in which they are requested. This causes the error message to mention the setting that the user aborted on, instead of some random later setting. 2001-11-10 22:06:54 +00:00
ian%hixie.ch 65d308d967 Change createArgument so that we drop the default on the floor -- the default should only be used when explicitly requested (e.g. by the user in interactive mode), not in all cases. CommandLine.pm was in fact already assume that this was the case. 2001-11-10 22:04:34 +00:00
ian%hixie.ch 4c322128a7 Switching to batch mode involves changing the 'batch' argument, not the one being requested... ahem. 2001-11-10 21:59:13 +00:00
ian%hixie.ch 7c4f16563f Bracket shuffling to fix a warning in Perl 5.0.x. 2001-11-10 21:57:07 +00:00
ian%hixie.ch 2d3f1dc3de Handle the case where the user hits Ctrl+D during input, and the case where the user piped a file into us and the file was too short. 2001-11-10 21:53:49 +00:00
ian%hixie.ch 2f00ddd8dc Correct an error in the default handler of the namespaced XML walker: we have to shift out the first argument otherwise weird things will naturally happen. 2001-11-10 21:44:28 +00:00
ian%hixie.ch b9400f341d The User object was not saving anything if its userID started off as undef (i.e., new user) and the code never changed any properties (which is normal for a new user). Changed the code to automatically assume it is dirty if it starts with an undefined userID. Changed writeProperties to use the return value from the data source to save any changes to userID, so that when it is defined (by inserting a new record, probably) then we can remember it. Finally, changed propertySet so that when userID is changed from an undefined value to a defined value, the change is propagated to the fields and the groups are marked dirty, which will force them to be written out too. 2001-11-10 21:00:37 +00:00
ian%hixie.ch 503d696c7e Changed a comment in UserField.pm to be more accurate: it is actually safe to change the userID on the fly from an undefined value to a defined value because the code only uses it at two points: creation, if it was defined (used by the caller) and destruction (at which point it is passed to the data source to save any changes). 2001-11-10 20:53:37 +00:00
ian%hixie.ch ceb11d6d7f s/smtp/email/go -- have to be consistent with the rest of the code\! 2001-11-10 20:46:29 +00:00
ian%hixie.ch 760684e638 Return the user ID even when the user exists, so that there is no need for callers to check the return value. 2001-11-10 20:43:44 +00:00
ian%hixie.ch b5ef59ba98 implemented getFieldNamesByCategory() in the user data source, and used it to fill in the list of contact methods for the loginFailed output handler. 2001-11-10 10:55:33 +00:00
ian%hixie.ch 653db8eef9 Oops, syntax error. 2001-11-10 05:21:17 +00:00
ian%hixie.ch 4a03227913 Added another set of data to the data hash: the outputter hash. This will be useful for strings that have to embed things like the e-mail address of the application itself. Added hash methods to the Email and Stdout generic outputter modules to support this change. Renamed 'from' to 'address' in the Email outputter to make it easier to reuse the code (hehe). Also, in the same module, changed some of the comments, changed a double quote string literal to a single quote string literal, and added the word 'configure' where it was missing in one of the dump statements. 2001-11-10 05:00:14 +00:00
ian%hixie.ch d433d136be Implement some primitive error handling for sending mail. 2001-11-09 21:59:21 +00:00
ian%hixie.ch b6d1378fa1 Removing unnecessary spammy debug output (this code works now... honest\!) 2001-11-09 21:22:32 +00:00
ian%hixie.ch 91d903d8df Decode %XX-encoded strings. 2001-11-09 21:19:59 +00:00
ian%hixie.ch 197ee7192a Factored out the connect/disconnect code, added settings for the host and the from address and made them be handled by a setup.configure handler, wrapped the call to Net::SMTP->new() in a warning-free block. 2001-11-09 20:21:11 +00:00
ian%hixie.ch 4d542c9a80 Adding support for generic saving and retrieving of settings. 2001-11-09 20:13:21 +00:00
ian%hixie.ch 3ae1b10178 Adding a comment on the use of assert() 2001-11-09 20:09:22 +00:00
ian%hixie.ch e2ceae0e2f Refactored the Database::DBI code. Added support for default values in the setup code. Added support to create the database and the user (although some of this may need refactoring into separate MySQL submodules). 2001-11-09 17:23:41 +00:00
ian%hixie.ch 27c0a625e9 Added a missing 'return' statement so that the user.fields setup routine doesn't appear to have failed when it hasn't (without a return statement, the value of the last statement is the return value). 2001-11-09 17:15:13 +00:00
ian%hixie.ch df6f9d0b23 Changed the DESTROY method to make sure it calls its parent. 2001-11-09 17:13:27 +00:00
ian%hixie.ch d8ed08b9c5 Added support for printing the default value for requests. 2001-11-09 17:12:18 +00:00
ian%hixie.ch 2605f093c1 Added the ability to find the length of an array (array.length to go with array.0, array.1, etc). Added assertions to handle the case of invalid order or sort attributes on <set>. Added two new sort types ('default' and 'reverse default'). 2001-11-09 17:10:22 +00:00
ian%hixie.ch 2dc794285b Added two assertions to make sure the handle is defined before using it, and added a check that the handle is defined before releasing it. Also changed the DESTROY method to call its parent. 2001-11-09 17:07:18 +00:00
ian%hixie.ch d11f28591a Removing excess trailing spaces on one line, and moving a warn from level 5 ('important events') to level 8 ('frequent important events'). 2001-11-09 17:03:40 +00:00
ian%hixie.ch a5b875e7b1 Fixed DESTROY method to make sure it calls its parent. 2001-11-09 17:00:28 +00:00
ian%hixie.ch 2913cffeec Removing the @arguments array from a dump statement, because if any of the elements in the array are undef then a runtime warning is printed (undef elements is not always a bug). 2001-11-09 16:58:38 +00:00
ian%hixie.ch ac58840368 Added a level 5 dump indicating the completion of the PLIF program. 2001-11-09 16:56:49 +00:00
ian%hixie.ch 1f8a352b1d Fixed DESTROY method to make sure it called it's parent. 2001-11-09 16:52:08 +00:00
ian%hixie.ch fd84ee0b49 Change default DEBUG level from 9 to 4, which is what it should be in production releases. Added comments explaining debug levels 6 (reserved for personal use) and 8. Added level 10 debug info to the DESTROY method (makes it easier to track down bugs during shutdown). 2001-11-09 16:50:47 +00:00
ian%hixie.ch 90d2164530 Made it so the setupEnding event is sent out after the setup failure message is printed but before the setup success message is printed (reduces the number of error messages if you cancel during setup). Changed the semantics of the output.progress string's data.component data. It is now a dotted hierarchical string giving progressively more detail about what is being set up. e.g., 'database', 'database.default.settings', 'database.default.settings.connection.port'. If outputters are interpreting data.component then any trailing unknown levels of detail should be ignored. This allows the setup routines to potentially give much more useful output. Fixed the default stdout output string for setup (it has <text variable=""> instead of value=""). 2001-11-09 16:39:29 +00:00
ian%hixie.ch 0530fac9f3 Also send default values to output. 2001-11-08 17:27:07 +00:00
ian%hixie.ch 003293a088 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). 2001-11-08 17:09:11 +00:00
ian%hixie.ch a6fc410cbf 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. 2001-11-08 16:47:25 +00:00
ian%hixie.ch ade117cf45 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). 2001-11-08 16:42:42 +00:00
ian%hixie.ch a15a7b4506 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. 2001-11-08 16:10:21 +00:00
ian%hixie.ch 477622872e Added a little more level 9 verbose debugging feedback to help track down where output is going wrong. 2001-11-08 05:07:42 +00:00
ian%hixie.ch f9a76a2609 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. 2001-11-08 05:06:27 +00:00
ian%hixie.ch 10dc2574fd 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. 2001-11-08 05:03:57 +00:00
ian%hixie.ch d1d1fa4ac2 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'. 2001-11-07 02:49:21 +00:00
ian%hixie.ch 1a231e506c Correcting minor typo (extraneous ')'s). 2001-10-04 16:09:32 +00:00
ian%hixie.ch 49d7b16b9e The first ContactMethod, namely Email. 2001-09-19 18:56:05 +00:00
ian%hixie.ch a17ac495d6 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...). 2001-09-19 18:43:06 +00:00
ian%hixie.ch c9be1f1f46 Correcting the misspelling of the package names ('Components' not 'Component') to match the directory. 2001-09-19 18:29:39 +00:00
ian%hixie.ch 7f340633ab Corrected the order of return values (newPassword) and removed the extraneous argument (output). 2001-09-19 18:11:03 +00:00
ian%hixie.ch bd7993d9f4 Cached the SMTP object to improve performance. 2001-09-19 18:05:28 +00:00
ian%hixie.ch 49808c73e4 Made the outputter be a simple service rather than a service instance to improve performance. 2001-09-19 18:01:23 +00:00
ian%hixie.ch f21e5053e8 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. 2001-09-19 17:56:15 +00:00
ian%hixie.ch ad4943568c Fixed error messages to be more accurate. 2001-09-17 00:13:16 +00:00
ian%hixie.ch a5ef873568 First stab at an e-mail output service. Also added support for checking addresses for validity and used that when creating a new account. 2001-09-09 21:02:33 +00:00
ian%hixie.ch fe6a40f92d Reduced the ErrorContext from 2 to 1. 2 is too much. 2001-09-09 19:48:14 +00:00
ian%hixie.ch 09f44a550f 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. 2001-09-09 19:47:04 +00:00
ian%hixie.ch c20813d786 Added ErrorContext to the Expat arguments so that well formedness errors are easier to track down. 2001-09-09 19:38:24 +00:00
ian%hixie.ch a523f68b3d 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).
2001-09-09 19:36:23 +00:00
ian%hixie.ch 6508e86281 Corrected the SQL for 'SHOW COLUMNS FROM' so that it actually works... 2001-09-09 19:21:17 +00:00
ian%hixie.ch 799005658b Added a string data source which gets the strings from a file instead of from the database, useful as a fallback. 2001-09-09 19:19:05 +00:00
ian%hixie.ch b048fad7e3 Made the error message printed when no string expander can be found more explicit (it now mentions the name and type of the string). 2001-09-09 19:08:58 +00:00
ian%hixie.ch a72ec34741 Added a comment clarification. 2001-09-09 19:06:13 +00:00
ian%hixie.ch 2540bbbc43 Changed the magic piping array so that it is more consistent by removing the special casing of when there is only one return value. 2001-09-09 19:04:37 +00:00
ian%hixie.ch 6ba9034d6e Added the message level number to the debug output to help gauge what level is useful. 2001-09-09 17:55:21 +00:00
ian%hixie.ch f8e5797100 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".
2001-09-09 17:48:07 +00:00
ian%hixie.ch 961c90812c 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. 2001-07-30 06:29:25 +00:00
ian%hixie.ch fa1ccb0738 * 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.
2001-07-29 22:38:30 +00:00
ian%hixie.ch 7c0dbe2fe3 Added a hash of the user's rights to the user hash to make it easier to enable or disable UI elements 2001-07-26 03:40:56 +00:00
ian%hixie.ch 18956f9796 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.
2001-07-26 00:54:37 +00:00
ian%hixie.ch ef634e93bd * 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
2001-07-25 23:54:32 +00:00
ian%hixie.ch 9c45d94bfc 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.
2001-07-25 09:32:28 +00:00
ian%hixie.ch 8c97591eed * Implemented dispatcher.output service in CosesEditor.pm
* Implemented dispatcher.output.generic service in CosesEditor.pm
* Fixed a semantic error in the string data source
2001-06-23 04:07:21 +00:00
ian%hixie.ch 3f420d2309 (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
2001-06-23 00:20:22 +00:00
ian%hixie.ch 225d339cd5 * Added some comments to various files indicating work to do and documenting some methods
*
2001-06-23 00:10:43 +00:00
ian%hixie.ch 86e3bcd2ae * 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
2001-06-04 06:13:22 +00:00
ian%hixie.ch a6faa21a5f Stub implementation of a COSES editor component, plus added 'component.nameOfComponent' to the list of services provided by the other two components 2001-06-03 23:06:09 +00:00
ian%hixie.ch 15b9f89cde Moved AdminCommands.pm and Login.pm to a Component directory 2001-06-03 22:45:37 +00:00
ian%hixie.ch 407f43e493 Minor bug fixes required to make the code run without crashing... 2001-06-03 16:14:41 +00:00
ian%hixie.ch 02d609eb82 Some more minor corrections to get it to run as well as compile... (removes some XXX comments and adds some error checking) 2001-06-03 15:27:16 +00:00
ian%hixie.ch 5dd8af9c83 Fixing a gazillion syntax, logic and XML errors and adding some debug code. It compiles! 2001-06-03 14:49:41 +00:00
ian%hixie.ch 7daa595cd4 * 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.
2001-06-03 10:11:58 +00:00
ian%hixie.ch 07b4d3d583 * 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
2001-06-01 00:32:35 +00:00
ian%hixie.ch 76d1f38fb9 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. 2001-05-29 20:34:12 +00:00
ian%hixie.ch 1b89023d7a 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) 2001-05-29 09:11:33 +00:00
ian%hixie.ch 2411ff6005 * 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)
2001-05-29 09:07:10 +00:00
ian%hixie.ch fe6643848b * Moving 'type' to the front of the list of things returned by the User data source's 'getField*' methods so that they map more directly to the user field constructor arguments
* Moving 'typeData' around in the order of the user field constructor arguments to match the User data source's 'getField*' methods so that, again, they map more directly
* Renaming the 'getFieldFrom*' methods to 'getFieldBy*' to be consistent with 'getUserBy*'
* Implemented UserFieldFactory.pm
* Implemented Passwords.pm
2001-05-28 23:43:56 +00:00
ian%hixie.ch e60cd56ae6 * Correcting a typo in Input.pm
* Added a comment to DataSource/User.pm explaining how (typically) to search for a username
* Fleshed out the DataSource/User.pm API by adding some schema management methods
* Added notes on which fields in the database schema should be keys
* Added comment to Service/User.pm noting the difference between Objects, Services, and Service Instances
* Changed 'user.field.factory' to 'user.fieldFactory' to prevent a namespace collision with 'user.field.(type)'
* Calling 'insertField' in one case which I missed when adding the method
* Implemented 'hash', 'joinGroup', 'invalidateRights', 'writeProperties' and 'writeGroups'
* Changed Service/UserField.pm so that one user field class can be used for any category
* Added a 'username' convenience method and implemented 'write'
* Added a comment to Service/UserFieldFactory.pm explaining how it should work
* Removed the 'user.field.generic.generic' field implementation, replaced it with a simpler 'user.field.string' implementation
2001-05-28 20:09:23 +00:00
ian%hixie.ch 1ffb74226d Added some minor corrections and clarifications to the documentation.
Added some comments to various user-related files.
Factored out some code that started becoming common when inserting fields in Service/User.pm.
Added code to deal with adding new contact details.
Added code to support removing fields from a user.
2001-05-24 07:06:41 +00:00
ian%hixie.ch d9c627c0b9 Started work on fleshing out the user components. This is still work in progress. 2001-05-14 06:45:08 +00:00
ian%hixie.ch 76a1624abe Initial checkin of the Field part of the User work. Just ideas at the moment, nothing here is implemented, and much of it is likely to change. 2001-05-13 20:54:35 +00:00
ian%hixie.ch 57c85fb025 First pass at adding User objects (derived from Session). Lots of XXX code -- none of this works, it's basically all stubs.
In addition to the code that actually does stuff, I still need to add a MySQL implementation of the data source and the Field class and its associated Factory.
Also added Passwords.pm (stubs for a password generator and encryptor) and made Session objects store a pointer to the controller object.
2001-05-13 18:11:54 +00:00
ian%hixie.ch a47f424255 Added a bit more support for objects (as opposed to services): added a new objectCreate() constructor and an objectInit() method.
Added an optimisation to Controller.pm so that service names will be hashed once accessed. This should make multiple accesses of the same service a lot quicker. To go with this I added some diagnostics code (on exit) and moved the code around a little bit.
Fixed a minor transgression of the coding style guidelines in Magic*Array.pm. :-)
Neatened up the code in Output.pm.
Made it so Session objects assume they have an 'app' property, and so don't need to be passed $app all the time. (Sessions are objects now.)
Added an unimplemented getAddress() method to the Session class.
2001-05-13 18:04:52 +00:00
ian%hixie.ch b211b52c46 fixing two rather serious (albeit simple) bugs in the strings data source; adding a comment to Input.pm in preparation for doing the user authentication stuff 2001-05-13 05:52:24 +00:00
ian%hixie.ch 0ecf1d5628 adding some progress messages to the setup output; making COSES more resilient to invalid input 2001-05-08 00:05:42 +00:00
ian%hixie.ch 572285560e Slight changes to make output code more flexible 2001-05-07 07:04:17 +00:00
ian%hixie.ch b8a735d31d * fixed the methodMissing() method so that it actually is possible to use it to do method dispatching;
* factored out some of the method dispatching code by adding a dispatchMethod() method to the controller;
* turned the Dispatcher class into simply a function on the base Service class and removed Dispatcher.pm;
* made it possible for services to be both services and objects and provide different services depending on which context they were called in (and used this to make the AdminCommands module actually do what it was intended to in the first place, namely, only work for CommandLine access);
* fixed it so if a service is first created by getServiceList the constructed version will actually be cached;
* made output more generic by allowing services to implement arbitrary parts of the output API, used that to make AdminCommands usable without requiring additional code to support it;
* added some documentation;
* added some dump(10) statements to help debugging;
* fixed the string datasource SQL;
* fixed the DBI database so it can handle errors;
* added tableExists API to the DBI database helper.
Thanks to myk, justdave and zach for some ideas.
2001-05-06 06:26:24 +00:00
ian%hixie.ch aac5db9914 Made the lack of a configuration file be non-fatal (and factored out the low level code while I was at it). We need that so that the configuration data source can actually go in and create the configuration file if it is missing; otherwise the program exits with "no configuration file! waah!" before you get to the configuration-file-creation code! 2001-05-05 19:00:06 +00:00
ian%hixie.ch 1dc1d947ea Implementing (and documenting!) PLIF::debug() as suggested by zach. a=hixie 2001-05-05 18:28:08 +00:00
ian%hixie.ch 0baba2d269 work in progress 2001-05-05 07:12:56 +00:00