Liz::UserPreferences - UserPreferences module
use Liz::UserPreferences;
$userpreferences = new Liz::UserPreferences;
#!/usr/local/bin/perl
use Liz::UserPreferences;
The Liz::UserPreferences allows for maintaining user settings in different contexts of a site.
The following methods can be called without an object specification, but as a class method such as Liz::UserPreferences->method().
Open the preferences of a user for a specific context, if no context is given, the standard global context is used
1 existing object 2 context 3 username, if there is no record for the user, it is created on the fly
1 instantiated object
$pref = new Liz::UserPreferences( $client,'',$ENV{'REMOTE_USER'} );
$pref = new Liz::UserPreferences( $client,'',$ENV{'REMOTE_USER'} );
Update UserPreferences object in the database.
$pref->update;
Delete the Liz::UserPreferences object from the database.
The following methods allow changes to information that is associated with an entire userpreferences.
Set one of more flags in the preferences field
1 new value for the options string
# Set the A, B, G, X and z - flags in the preferences field of this context # Set the C flag
$pref->Set( 'ABGX' ); $pref->Set( 'C' );
Return or set the Data field
1 new value for the Data field
1 current/old value of the Data field
Set one of more flags in the preferences field
1 new value to be added to the options string 2 Flags to be affected if absent (optional)
# Set the A, B, G, X and z - flags in the preferences field of this context # Set the C flag # Set the flags in $options, flags 'ABCDEFGabc' are used here...
$pref->Set( 'ABGX' ); $pref->Set( 'C' ); $pref->Set( $options,'ABCDEFGabc' );
See if flags in the preferences field is set
1 The flags to be tested
Return or set the options string for this user for this context
1 new value for the options string
1 current/old value of the options string
$pref->Options( $options ); $options = $pref->Options;
Sjoerd Lawende ( sjoerd@xxLINK.nl )
(C) 1999 International Network Consultants
Now no longer puts Exporter in ISA: it was not needed.
Changed CREATE TABLE to new Liz::SQL 'create' method format.
Changed from using method ``Exists'' to ``Count'' in method new to allow for a much quicker check on the existence of a table.
Fixed problem in method update which would not return the ID of the object if the object was not changed.
Options and Data now allowed...
First version of this true Perl module.