Changeset 5210
- Timestamp:
- 01/22/10 17:40:06 (2 months ago)
- Location:
- plugins/VWPass/trunk/plugins/VWPass
- Files:
-
- 2 modified
-
config.yaml (modified) (1 diff)
-
lib/VWPass.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/VWPass/trunk/plugins/VWPass/config.yaml
r5183 r5210 10 10 init_app: $VWPass::VWPass::init_app 11 11 12 callbacks:13 api_pre_save.author: $VWPass::VWPass::pre_save_author14 cms_pre_save.author: $VWPass::VWPass::pre_save_author15 16 17 -
plugins/VWPass/trunk/plugins/VWPass/lib/VWPass.pm
r5208 r5210 22 22 23 23 # password must be at least 8 characters long 24 unless (scalar(split("",$p )) >= 8) {24 unless (scalar(split("",$password)) >= 8) { 25 25 push(@errors, "Password must be at least 8 characters long."); 26 26 } … … 32 32 33 33 return $error_string; 34 }35 36 sub pre_save_author {37 my ($cb, $app, $author, $original) = @_;38 my $password = $app->param('pass') || $app->param('password');39 my $error_string = password_is_strong($password);40 $cb->error("$error_string") if ($error_string);41 return 1;42 34 } 43 35 … … 62 54 *MT::CMS::User::save_filter = sub { 63 55 my ($eh, $app) = @_; 64 my $password = $app->param('pass') || $app->param('password'); 65 if ($password) { 66 my $error_string = password_is_strong($password); 67 $app->error("$error_string") if ($error_string); 56 57 if ( !$app->param('id') ) { # it's a new object 58 return $app->error("User requires password") if ( !$app->param('pass') ); 59 } else { 60 my $password = $app->param('pass') || $app->param('password'); 61 if ($password) { 62 my $error_string = password_is_strong($password); 63 $app->error("$error_string") if ($error_string); 64 } 68 65 } 69 66 return $orig_method2->($eh, $app);
