| @@ 352-366 (lines=15) @@ | ||
| 349 | * |
|
| 350 | * @return void |
|
| 351 | */ |
|
| 352 | public function softDeleteAction($id = null) |
|
| 353 | { |
|
| 354 | if (!isset($id)) { |
|
| 355 | die("Missing id"); |
|
| 356 | } |
|
| 357 | ||
| 358 | $now = gmdate('Y-m-d H:i:s'); |
|
| 359 | ||
| 360 | $user = $this->users->find($id); |
|
| 361 | ||
| 362 | $user->deleted = $now; |
|
| 363 | $user->save(); |
|
| 364 | ||
| 365 | $this->redirectTo('users/list/'); |
|
| 366 | } |
|
| 367 | public function undoDeleteAction($id = null) |
|
| 368 | { |
|
| 369 | if (!isset($id)) { |
|
| @@ 367-379 (lines=13) @@ | ||
| 364 | ||
| 365 | $this->redirectTo('users/list/'); |
|
| 366 | } |
|
| 367 | public function undoDeleteAction($id = null) |
|
| 368 | { |
|
| 369 | if (!isset($id)) { |
|
| 370 | die("Missing id"); |
|
| 371 | } |
|
| 372 | ||
| 373 | $user = $this->users->find($id); |
|
| 374 | ||
| 375 | $user->deleted = null; |
|
| 376 | $user->save(); |
|
| 377 | ||
| 378 | $this->redirectTo('users/id/' . $id); |
|
| 379 | } |
|
| 380 | public function activateAction($id = null) |
|
| 381 | { |
|
| 382 | if (!isset($id)) { |
|
| @@ 380-392 (lines=13) @@ | ||
| 377 | ||
| 378 | $this->redirectTo('users/id/' . $id); |
|
| 379 | } |
|
| 380 | public function activateAction($id = null) |
|
| 381 | { |
|
| 382 | if (!isset($id)) { |
|
| 383 | die("Missing id"); |
|
| 384 | } |
|
| 385 | ||
| 386 | $user = $this->users->find($id); |
|
| 387 | ||
| 388 | $user->active = gmdate('Y-m-d H:i:s'); |
|
| 389 | $user->save(); |
|
| 390 | ||
| 391 | $this->redirectTo('users/id/' . $id); |
|
| 392 | } |
|
| 393 | public function deactivateAction($id = null) |
|
| 394 | { |
|
| 395 | if (!isset($id)) { |
|
| @@ 393-405 (lines=13) @@ | ||
| 390 | ||
| 391 | $this->redirectTo('users/id/' . $id); |
|
| 392 | } |
|
| 393 | public function deactivateAction($id = null) |
|
| 394 | { |
|
| 395 | if (!isset($id)) { |
|
| 396 | die("Missing id"); |
|
| 397 | } |
|
| 398 | ||
| 399 | $user = $this->users->find($id); |
|
| 400 | ||
| 401 | $user->active = null; |
|
| 402 | $user->save(); |
|
| 403 | ||
| 404 | $this->redirectTo('users/id/' . $id); |
|
| 405 | } |
|
| 406 | /** |
|
| 407 | * List all active and not deleted users. |
|
| 408 | * |
|