NAME
MT::Author - Movable Type author record
SYNOPSIS
use MT::Author;
my $author = MT::Author->new;
$author->name('Foo Bar');
$author->set_password('secret');
$author->save
or die $author->errstr;
my $author = MT::Author->load($author_id);
DESCRIPTION
An MT::Author object represents a user in the Movable Type system. It contains profile information (name, nickname, email address, etc.), global permissions settings (blog creation, activity log viewing), and authentication information (password, public key). It does not contain any per-blog permissions settings--for those, look at the MT::Permission object.
USAGE
As a subclass of MT::Object, MT::Author inherits all of the data-management and -storage methods from that class; thus you should look at the MT::Object documentation for details about creating a new object, loading an existing object, saving an object, etc.
The following methods are unique to the MT::Author interface:
$author->set_password($pass)
One-way encrypts $pass with a randomly-generated salt, using the Unix crypt function, and sets the password data field in the MT::Author object $author.
Because the password is one-way encrypted, there is no way of recovering the initial password.
$author->is_valid_password($check_pass)
Tests whether $check_pass is a valid password for the MT::Author object $author (ie, whether it matches the password originally set using set_password). This check is done by one-way encrypting $check_pass, using the same salt used to encrypt the original password, then comparing the two encrypted strings for equality.
DATA ACCESS METHODS
The MT::Author object holds the following pieces of data. These fields can be accessed and set using the standard data access methods described in the MT::Object documentation.
- id
- name
- nickname
- password
- url
- hint
- can_create_blog
- can_view_log
- created_by
- public_key
The numeric ID of the author.
The username of the author. This is the username used to log in to the system.
The author nickname. This is not displayed anywhere in the system unless you use a <$MTEntryAuthorNickname$> tag.
The author's password, one-way encrypted. If you wish to check the validity of a password, you should use the is_valid_password method, above.
The author's email address.
The author's homepage URL.
The answer to the question used when recovering the user's password. Currently this is the birthplace of the author, though this may change in the future.
A boolean flag specifying whether the author has permission to create a new blog in the system.
A boolean flag specifying whether the author has permission to view the global system activity log.
The author ID of the author who created this author. For the initial author created by the mt-load.cgi program, this author ID is undefined.
The author's ASCII-armoured public key, to be used in the future for verifying incoming email messages.
DATA LOOKUP
In addition to numeric ID lookup, you can look up or sort records by any combination of the following fields. See the load documentation in MT::Object for more information.
- name
NOTES
- When you remove an author using MT::Author::remove, in addition to removing the author record, all of the author's permissions (MT::Permission objects) will be removed, as well.
AUTHOR & COPYRIGHTS
Please see the MT manpage for author, copyright, and license information.
