| Next: Yawns::Users | Previous: Yawns::Tags | [Table of Contents] |
Yawns::User - A module for working with a single site user.
#!/usr/bin/perl -w
use Yawns::User;
use strict;
my $user = Yawns::Users->new( username => 'Steve');
my $modifier = $user->getModifier();
This module contains code for dealing with a single registered site user.
Create a new instance of this object.
Return a hash containing all the information about this user.
Get the password hash for the given user - only used for the password forgotten link.
Return the modifier text displayed next to the user's name in any comments they leave.
Return the custom URL, if any, the user has entered for their stylesheet.
Return the number of weblog items the user has posted.
Return all the comments this user has posted.
Return all the articles this user has posted.
Return the number of comments this user has posted.
Return the number of articles this user has posted.
Create the given user with the given email address.
Does the user exist?
Send an email to a freshly created user informing them of their new account details.
Set the password for the current user.
Delete the given user.
Suspend the given user.
suspendUser( reason => 'I dont like him' );
Update the given user's details.
save( realname => "Steve Kemp",
realemail => 'foo@bar.com',
fakeemail => 'fooo /at/ bar.com',
url => 'http://www.steve.org.uk',
sig => 'My Sig',
bio => 'I wrote this' );
Update the given user preferences.
savePreferences(
view_headlines => 1,
view_polls => 1,
view_adverts => 1,
view_blogs => 1,
css_url => '' );
Attempt to login the given user.
Return ( $success, $suspended ) where:
success = 1 if the login was ok, 0 otherwise.
suspended = 1 if the user has been suspended.
Clean any cached content we might have.
Steve Kemp
http://www.steve.org.uk/
Copyright (c) 2005,2006 by Steve Kemp. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.