merging 8374
This commit is contained in:
parent
c9946708b5
commit
2f8869292f
4 changed files with 140 additions and 5 deletions
|
|
@ -18,6 +18,7 @@ use strict;
|
|||
use WebGUI::Cache;
|
||||
use WebGUI::Group;
|
||||
use WebGUI::DatabaseLink;
|
||||
use WebGUI::Exception;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Operation::Shared;
|
||||
|
||||
|
|
@ -61,6 +62,9 @@ These methods are available from this class:
|
|||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# TODO This stays like this until we can break API, just in case somebody
|
||||
# doesn't realize that _ means private.
|
||||
# After API unfreeze, put this in the WebGUI::User->create routine
|
||||
sub _create {
|
||||
my $session = shift;
|
||||
my $userId = shift || $session->id->generate();
|
||||
|
|
@ -157,6 +161,31 @@ sub authMethod {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 create ( session, [userId] )
|
||||
|
||||
Create a new user. C<userId> is an option user ID to give the new user.
|
||||
Returns the newly created WebGUI::User object.
|
||||
|
||||
=cut
|
||||
|
||||
sub create {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $userId = shift;
|
||||
|
||||
if ( !ref $session || !$session->isa( 'WebGUI::Session' ) ) {
|
||||
WebGUI::Error::InvalidObject->throw(
|
||||
expected => "WebGUI::Session",
|
||||
got => (ref $session),
|
||||
error => q{Must provide a session variable},
|
||||
);
|
||||
}
|
||||
|
||||
return WebGUI::User->new( $session, "new", $userId );
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 cache ( )
|
||||
|
||||
Saves the user object into the cache.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue