| @@ 534-548 (lines=15) @@ | ||
| 531 | * |
|
| 532 | * @return void |
|
| 533 | */ |
|
| 534 | public function softDeleteAction($id = null) |
|
| 535 | { |
|
| 536 | if (!isset($id)) { |
|
| 537 | die("Missing id"); |
|
| 538 | } |
|
| 539 | ||
| 540 | $now = gmdate('Y-m-d H:i:s'); |
|
| 541 | ||
| 542 | $user = $this->users->find($id); |
|
| 543 | ||
| 544 | $user->deleted = $now; |
|
| 545 | $user->save(); |
|
| 546 | ||
| 547 | $this->redirectTo('users/list/'); |
|
| 548 | } |
|
| 549 | public function undoDeleteAction($id = null) |
|
| 550 | { |
|
| 551 | if (!isset($id)) { |
|
| @@ 549-561 (lines=13) @@ | ||
| 546 | ||
| 547 | $this->redirectTo('users/list/'); |
|
| 548 | } |
|
| 549 | public function undoDeleteAction($id = null) |
|
| 550 | { |
|
| 551 | if (!isset($id)) { |
|
| 552 | die("Missing id"); |
|
| 553 | } |
|
| 554 | ||
| 555 | $user = $this->users->find($id); |
|
| 556 | ||
| 557 | $user->deleted = null; |
|
| 558 | $user->save(); |
|
| 559 | ||
| 560 | $this->redirectTo('users/id/' . $id); |
|
| 561 | } |
|
| 562 | public function activateAction($id = null) |
|
| 563 | { |
|
| 564 | if (!isset($id)) { |
|
| @@ 562-574 (lines=13) @@ | ||
| 559 | ||
| 560 | $this->redirectTo('users/id/' . $id); |
|
| 561 | } |
|
| 562 | public function activateAction($id = null) |
|
| 563 | { |
|
| 564 | if (!isset($id)) { |
|
| 565 | die("Missing id"); |
|
| 566 | } |
|
| 567 | ||
| 568 | $user = $this->users->find($id); |
|
| 569 | ||
| 570 | $user->active = gmdate('Y-m-d H:i:s'); |
|
| 571 | $user->save(); |
|
| 572 | ||
| 573 | $this->redirectTo('users/id/' . $id); |
|
| 574 | } |
|
| 575 | public function deactivateAction($id = null) |
|
| 576 | { |
|
| 577 | if (!isset($id)) { |
|
| @@ 575-587 (lines=13) @@ | ||
| 572 | ||
| 573 | $this->redirectTo('users/id/' . $id); |
|
| 574 | } |
|
| 575 | public function deactivateAction($id = null) |
|
| 576 | { |
|
| 577 | if (!isset($id)) { |
|
| 578 | die("Missing id"); |
|
| 579 | } |
|
| 580 | ||
| 581 | $user = $this->users->find($id); |
|
| 582 | ||
| 583 | $user->active = null; |
|
| 584 | $user->save(); |
|
| 585 | ||
| 586 | $this->redirectTo('users/id/' . $id); |
|
| 587 | } |
|
| 588 | /** |
|
| 589 | * List all active and not deleted users. |
|
| 590 | * |
|