| 395 | | |
| 396 | | $this->layout = 'admin'; |
| 397 | | |
| 398 | | $this->set('Groups', $this->User->Group->generateList()); |
| 399 | | |
| 400 | | if (empty($this->data)) |
| 401 | | { |
| 402 | | $this->User->id = $this->Auth->user('id'); |
| 403 | | $this->data = $this->User->read(); |
| | 395 | if ( empty($this->data['User']) ) |
| | 396 | { |
| | 397 | $this->layout = 'admin'; |
| | 398 | |
| | 399 | $this->set('Groups', Set::combine($this->User->Group->find('all', array('order' => 'name')), "{n}.Group.id","{n}.Group.name")); |
| | 400 | |
| | 401 | $this->User->unbindModel($this->User->notNow); |
| | 402 | |
| | 403 | $this->data = $this->User->read(null, $this->Auth->user('id')); |
| 482 | | |
| 483 | | /*** DELETE **/ |
| 484 | | public function delete($id) |
| 485 | | { |
| 486 | | $this->User->del($id); |
| 487 | | $this->msgFlash('User has been deleted.', '/admin/users/listing'); |
| 488 | | } |
| 489 | | |
| 490 | | /*** List user's blog entries **/ |
| 491 | | public function blogs($order = null) |
| 492 | | { |
| 493 | | |
| 494 | | $conditions = array("active" => 1 ); |
| 495 | | |
| 496 | | $data = $this->User->findAll($conditions, $order); |
| 497 | | |
| 498 | | $this->set('data', $data); |
| 499 | | |
| 500 | | } |
| 501 | | |
| | 482 | |
| | 483 | /*** DELETE **/ |
| | 484 | public function admin_delete($id) |
| | 485 | { |
| | 486 | if ($this->User->del($id)) |
| | 487 | { |
| | 488 | $this->msgFlash('User has been deleted.', '/admin/users/listing'); |
| | 489 | } |
| | 490 | } |
| | 491 | |