Changeset 2285 for trunk/LATMOS-Accounts/lib/LATMOS/Accounts
- Timestamp:
- 10/01/19 19:16:21 (5 years ago)
- Location:
- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Cli
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Cli/Base.pm
r2278 r2285 430 430 =cut 431 431 432 sub base { $_[0]->Context->base } 433 sub term { $_[0]->Context->Term } 434 sub print { shift->Context->print(@_) } 432 sub La { $_[0]->Context->La } 433 sub base { $_[0]->Context->base } 434 sub term { $_[0]->Context->Term } 435 sub Interractive { $_[0]->Context->Interactive } 436 sub print { shift->Context->print(@_) } 435 437 436 438 sub Top { -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Cli/Context.pm
r2245 r2285 33 33 has TransStarted => ( is => 'rw', isa => 'Bool', default => 0 ); 34 34 has base => ( is => 'ro' ); 35 has La => ( is => 'ro' ); 35 36 has Out => ( is => 'ro' ); 37 has Interractive => ( is => 'rw', isa => 'Bool', default => 1 ); 36 38 37 39 =head1 FUNCTIONS -
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.