122 Commits

Author SHA1 Message Date
ian%hixie.ch
59fcb856a2 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.
git-svn-id: svn://10.0.0.236/trunk@109639 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 18:06:06 +00:00
ian%hixie.ch
10d64daec7 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.
git-svn-id: svn://10.0.0.236/trunk@109638 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 17:51:23 +00:00
ian%hixie.ch
2358cf13a4 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).
git-svn-id: svn://10.0.0.236/trunk@109626 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 14:34:54 +00:00
ian%hixie.ch
20b7ae1c79 Fixing copy/paste error -- the user prefs object isn't the application object...
git-svn-id: svn://10.0.0.236/trunk@109625 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 13:40:04 +00:00
ian%hixie.ch
1365aca89e 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 ''?).
git-svn-id: svn://10.0.0.236/trunk@109624 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 13:08:39 +00:00
ian%hixie.ch
4723ad814e Place a 5 second timeout on the SMTP object -- this makes running setup bearable without an SMTP server (the default timeout is 2 minutes).
git-svn-id: svn://10.0.0.236/trunk@109623 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 12:53:40 +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
e0683c5b96 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.
git-svn-id: svn://10.0.0.236/trunk@109441 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-01 04:37:26 +00:00
ian%hixie.ch
b2d7bfcb3f 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.
git-svn-id: svn://10.0.0.236/trunk@109439 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-01 04:29:20 +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
10f906b791 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.
git-svn-id: svn://10.0.0.236/trunk@109360 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 16:13:00 +00:00
ian%hixie.ch
5668befe73 Adding error handling for the case where the user prefs editor is called with bogus user IDs.
git-svn-id: svn://10.0.0.236/trunk@109359 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 16:06:45 +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
6c5b533a17 work in progress: a component that provides a way for users and admins to edit user preferences, settings, contact details, password, etc.
git-svn-id: svn://10.0.0.236/trunk@108829 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-23 00:16:44 +00:00
ian%hixie.ch
bb6b01bb43 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.
git-svn-id: svn://10.0.0.236/trunk@108819 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-22 20:15:45 +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
87506d5097 Missed a return statement in the setupInstall method. This was causing setup to fail every time, because the function returned a defined value.
git-svn-id: svn://10.0.0.236/trunk@107890 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 11:48:14 +00:00
ian%hixie.ch
3176c0d2a4 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().)
git-svn-id: svn://10.0.0.236/trunk@107889 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 11:47:02 +00:00
ian%hixie.ch
e1e5a2a6f1 Mute the Net::AIM warnings and add some null-checking code to the close() method.
git-svn-id: svn://10.0.0.236/trunk@107881 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 08:08:26 +00:00
ian%hixie.ch
7dc7a687d2 First stab at primitive AIM output support as an alternative to e-mail.
git-svn-id: svn://10.0.0.236/trunk@107872 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 04:18:09 +00:00
ian%hixie.ch
79a6f20984 Fix typo (PLIFF->PLIF)
git-svn-id: svn://10.0.0.236/trunk@107860 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 00:58:48 +00:00
ian%hixie.ch
52581f47aa Fix the DESTROY method to actually call the close() method like it was supposed to.
git-svn-id: svn://10.0.0.236/trunk@107858 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 00:14:07 +00:00
ian%hixie.ch
3a9a356b60 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.
git-svn-id: svn://10.0.0.236/trunk@107852 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 22:06:54 +00:00
ian%hixie.ch
30f7d9e23f 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.
git-svn-id: svn://10.0.0.236/trunk@107851 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 22:04:34 +00:00
ian%hixie.ch
38d0af9333 Switching to batch mode involves changing the 'batch' argument, not the one being requested... ahem.
git-svn-id: svn://10.0.0.236/trunk@107849 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 21:59:13 +00:00
ian%hixie.ch
e7f0b0e6e4 Bracket shuffling to fix a warning in Perl 5.0.x.
git-svn-id: svn://10.0.0.236/trunk@107848 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 21:57:07 +00:00
ian%hixie.ch
d793a48053 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.
git-svn-id: svn://10.0.0.236/trunk@107847 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 21:53:49 +00:00
ian%hixie.ch
c56420bdaf 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.
git-svn-id: svn://10.0.0.236/trunk@107846 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 21:44:28 +00:00
ian%hixie.ch
7d3015eda3 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.
git-svn-id: svn://10.0.0.236/trunk@107843 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 21:00:37 +00:00
ian%hixie.ch
6c7a644159 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).
git-svn-id: svn://10.0.0.236/trunk@107841 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 20:53:37 +00:00
ian%hixie.ch
1c45721015 s/smtp/email/go -- have to be consistent with the rest of the code\!
git-svn-id: svn://10.0.0.236/trunk@107840 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 20:46:29 +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
77fb90f83b Oops, syntax error.
git-svn-id: svn://10.0.0.236/trunk@107820 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 05:21:17 +00:00
ian%hixie.ch
7ba9f2d1c5 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.
git-svn-id: svn://10.0.0.236/trunk@107818 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 05:00:14 +00:00
ian%hixie.ch
76152f2135 Implement some primitive error handling for sending mail.
git-svn-id: svn://10.0.0.236/trunk@107776 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:59:21 +00:00
ian%hixie.ch
8429169df5 Removing unnecessary spammy debug output (this code works now... honest\!)
git-svn-id: svn://10.0.0.236/trunk@107770 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:22:32 +00:00
ian%hixie.ch
3d2d5f544f Decode %XX-encoded strings.
git-svn-id: svn://10.0.0.236/trunk@107769 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:19:59 +00:00
ian%hixie.ch
0b383c1d78 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.
git-svn-id: svn://10.0.0.236/trunk@107761 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 20:21:11 +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
7b02c6d19e Adding a comment on the use of assert()
git-svn-id: svn://10.0.0.236/trunk@107759 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 20:09:22 +00:00
ian%hixie.ch
de07b8d410 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).
git-svn-id: svn://10.0.0.236/trunk@107756 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:23:41 +00:00
ian%hixie.ch
64d32bc1a9 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).
git-svn-id: svn://10.0.0.236/trunk@107754 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:15:13 +00:00
ian%hixie.ch
ab6ec76c4d Changed the DESTROY method to make sure it calls its parent.
git-svn-id: svn://10.0.0.236/trunk@107753 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:13:27 +00:00
ian%hixie.ch
18252bc48b Added support for printing the default value for requests.
git-svn-id: svn://10.0.0.236/trunk@107752 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:12:18 +00:00
ian%hixie.ch
9ff7bb94ea 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').
git-svn-id: svn://10.0.0.236/trunk@107751 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:10:22 +00:00