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

106 Коммитов

Автор SHA1 Сообщение Дата
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