diff --git a/Webperl/Auth.pm b/Webperl/Auth.pm index a070731..ca1bab8 100644 --- a/Webperl/Auth.pm +++ b/Webperl/Auth.pm @@ -334,7 +334,8 @@ sub require_activate { my $methodimpl = $self -> get_user_authmethod_module($username) or return undef; - return $methodimpl -> require_activate(); + return $methodimpl -> require_activate() + or return $self -> self_error($methodimpl -> errstr(); } @@ -372,7 +373,8 @@ sub activated { my $user = $self -> get_user($username) or return undef; - return $methodimpl -> activated($user -> {"user_id"}); + return $methodimpl -> activated($user -> {"user_id"}) + or return $self -> self_error($methodimpl -> errstr(); } @@ -396,7 +398,9 @@ sub activate_user { or return undef; # Activate the user, and return their data if successful. - return $methodimpl -> activate_user($user -> {"user_id"}); + return $user if($methodimpl -> activate_user($user -> {"user_id"})); + + return $self -> self_error($methodimpl -> errstr(); } @@ -413,7 +417,8 @@ sub supports_recovery { my $methodimpl = $self -> get_user_authmethod_module($username) or return undef; - return $methodimpl -> supports_recovery(); + return $methodimpl -> supports_recovery() + or return $self -> self_error($methodimpl -> errstr(); } @@ -430,7 +435,8 @@ sub norecover_message { my $methodimpl = $self -> get_user_authmethod_module($username) or return undef; - return $methodimpl -> norecover_message(); + return $methodimpl -> norecover_message() + or return $self -> self_error($methodimpl -> errstr(); } @@ -449,7 +455,8 @@ sub reset_password_actcode { my $user = $self -> get_user($username) or return undef; - return $methodimpl -> reset_password_actcode($user -> {"user_id"}); + return $methodimpl -> reset_password_actcode($user -> {"user_id"}) + or return $self -> self_error($methodimpl -> errstr(); } @@ -468,7 +475,8 @@ sub reset_password { my $user = $self -> get_user($username) or return undef; - return $methodimpl -> reset_password($user -> {"user_id"}); + return $methodimpl -> reset_password($user -> {"user_id"}) + or return $self -> self_error($methodimpl -> errstr(); } @@ -489,7 +497,8 @@ sub set_password { my $user = $self -> get_user($username) or return undef; - return $methodimpl -> set_password($user -> {"user_id"}, $password); + return $methodimpl -> set_password($user -> {"user_id"}, $password) + or return $self -> self_error($methodimpl -> errstr(); } @@ -508,7 +517,8 @@ sub generate_actcode { my $user = $self -> get_user($username) or return undef; - return $methodimpl -> generate_actcode($user -> {"user_id"}); + return $methodimpl -> generate_actcode($user -> {"user_id"}) + or return $self -> self_error($methodimpl -> errstr(); } diff --git a/Webperl/AuthMethod.pm b/Webperl/AuthMethod.pm index 0a5fd4c..a028a1d 100644 --- a/Webperl/AuthMethod.pm +++ b/Webperl/AuthMethod.pm @@ -129,7 +129,7 @@ sub activated { # activation code, and sets the activation timestamp. # # @param userid The ID of the user account to activate. -# @return true on success, undef on error. +# @return True on success, undef on error. sub activate_user { my $self = shift; my $userid = shift;