Changeset 2473
- Timestamp:
- 06/04/21 17:25:13 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Cli.pm
r2464 r2473 238 238 ); 239 239 240 =head2 testpass 241 242 Test password for given user 243 244 =cut 245 246 $self->add_func('testpass', { 247 completion => sub { 248 if (! $_[2]) { 249 return $_[0]->base->list_objects('user'); 250 } 251 }, 252 code => sub { 253 my ($self, $user, @passwd) = @_; 254 my $uobj = $self->base->get_object('user', $user) or do { 255 $self->print("Cannot get user $user\n"); 240 =head3 rename 241 242 Rename an object 243 244 =cut 245 246 $self->add_func( 247 'rename', 248 { 249 help => 'Rename an object', 250 completion => sub { 251 if ($_[2] && !$_[3]) { 252 return $_[0]->base->list_objects($_[2]); 253 } else { 254 return $_[0]->base->list_supported_objects; 255 } 256 }, 257 code => sub { 258 my ($self, $otype, $from, $to) = @_; 259 if (!$to) { 260 $self->print('not enough arguments' . "\n"); 256 261 return; 257 }; 258 259 if (! $uobj->CheckAccountValidity ) { 260 $self->print("Account $user cannot currently log\n"); 261 } 262 263 foreach (@passwd) { 264 my $is = $uobj->ComparePassword( $_ ); 265 if ($is) { 266 $self->print("Passord for $user is $_\n"); 267 last; 268 } 269 } 270 }, 271 }); 262 } 263 if ( $self->base->rename_object($otype, $from, $to) ) { 264 $self->print("Object $otype/$from renamed to $to\n"); 265 $self->commit; 266 } else { 267 $self->rollback; 268 } 269 }, 270 } 271 ); 272 272 273 273 =head3 create … … 397 397 } 398 398 ); 399 399 400 $self->add_func('exchangeip', 400 401 {
Note: See TracChangeset
for help on using the changeset viewer.