Next:
Yawns::Users
Previous:
Yawns::Tags
 [Table of Contents]

Yawns::User



NAME

Yawns::User - A module for working with a single site user.

SYNOPSIS

    #!/usr/bin/perl -w

    use Yawns::User;
    use strict;

    my $user = Yawns::Users->new( username => 'Steve');

    my $modifier = $user->getModifier();

DESCRIPTION

This module contains code for dealing with a single registered site user.

new

  Create a new instance of this object.

get

  Return a hash containing all the information about this user.

getPasswordHash

  Get the password hash for the given user - only used for the 
 password forgotten link.

getModifier

  Return the modifier text displayed next to the user's name in any
 comments they leave.

getStyleSheet

  Return the custom URL, if any, the user has entered for their
 stylesheet.

getWeblogCount

  Return the number of weblog items the user has posted.

getComments

  Return all the comments this user has posted.

getArticles

  Return all the articles this user has posted.

getCommentCount

  Return the number of comments this user has posted.

getArticleCount

  Return the number of articles this user has posted.

create

  Create the given user with the given email address.

exists

  Does the user exist?

sendMail

  Send an email to a freshly created user informing them of their
 new account details.

setPassword

  Set the password for the current user.

delete

  Delete the given user.

suspend

  Suspend the given user.

    suspendUser( reason   => 'I dont like him' );

save

  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' );

savePreferences

  Update the given user preferences.

    savePreferences(
          view_headlines     => 1,
          view_polls         => 1,
          view_adverts       => 1,
          view_blogs         => 1,
          css_url            => '' );

login

  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.

invalidateCache

  Clean any cached content we might have.

AUTHOR

Steve Kemp

http://www.steve.org.uk/

LICENSE

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.


[Top] Generated by HTML::FromPod 0.49 on Fri Nov 21 03:03:58 2008