Changeset 2285 for trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Cli/Object.pm
- Timestamp:
- 10/01/19 19:16:21 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Cli/Object.pm
r2267 r2285 422 422 423 423 if (lc($self->otype) eq 'user') { 424 425 =head2 USER OBJECT FUCNTION 426 427 =cut 428 424 429 $self->add_func('group', { 425 430 help => 'group add|remove|primary goupname', … … 476 481 }, 477 482 }); 483 484 =head3 lock 485 486 Lock user account making it not usable 487 488 =cut 489 490 $self->add_func('lock', { 491 code => sub { 492 my ( $env, $ban ) = @_; 493 foreach my $obj (@{$env->{_objects}}) { 494 $obj->set_c_fields('locked', 1); 495 if ($ban) { 496 $obj->banCurrentPassword; 497 } 498 } 499 $env->commit; 500 }, 501 completion => sub { 502 if (!$_[2]) { 503 return (qw(ban)); 504 } 505 }, 506 }); 507 508 =head3 unlock 509 510 Unlock user account making it usable again 511 512 =cut 513 514 $self->add_func('unlock', { 515 code => sub { 516 my ( $env, $ban ) = @_; 517 foreach my $obj (@{$env->{_objects}}) { 518 $obj->set_c_fields('locked', undef); 519 if ($ban) { 520 $obj->banCurrentPassword; 521 } 522 } 523 $env->commit; 524 }, 525 completion => sub { 526 if (!$_[2]) { 527 return (qw(ban)); 528 } 529 }, 530 }); 531 532 =head3 banpasswd 533 534 Ban current pasword making it not usable by user 535 536 =cut 537 538 $self->add_func('banpasswd', { 539 code => sub { 540 my ( $env, $ban ) = @_; 541 foreach my $obj (@{$env->{_objects}}) { 542 $obj->banCurrentPassword; 543 } 544 $env->commit; 545 }, 546 completion => sub {}, 547 }); 548 478 549 } elsif ($self->otype eq 'group') { 550 551 =head2 GROUP OBJECT FUNCTIONS 552 553 =cut 554 479 555 $self->add_func('member', { 480 556 help => 'member add|remove user',
Note: See TracChangeset
for help on using the changeset viewer.