| 21 | | $this->Auth->allow(array('blog', 'entry','portfolio', 'about', 'register', 'directory', 'bloggers', 'insert', 'validate', 'logout')); |
| | 21 | $this->Auth->allow(array('blog', 'entry','portfolio', 'edit', 'about', 'register', 'directory', 'bloggers', 'insert', 'validate', 'logout')); |
| | 398 | |
| | 399 | public function edit() |
| | 400 | { |
| | 401 | if ( !$this->Auth->user() ): |
| | 402 | $this->redirect('/users/login'); |
| | 403 | return true; |
| | 404 | endif; |
| | 405 | |
| | 406 | if ( $this->Auth->user('group_id') != 3 && $this->Auth->user('group_id') != 4 ): |
| | 407 | $this->redirect('/users/edit'); |
| | 408 | return true; |
| | 409 | endif; |
| | 410 | |
| | 411 | if ( empty($this->data['User']) ): |
| | 412 | |
| | 413 | $this->layout = 'portal'; |
| | 414 | |
| | 415 | $this->Portal->statics(); // Using Portal components |
| | 416 | |
| | 417 | $this->User->unbindModel($this->User->notNow); |
| | 418 | |
| | 419 | $this->data = $this->User->read(null, $this->Auth->user('id')); |
| | 420 | |
| | 421 | else: |
| | 422 | |
| | 423 | if ($this->User->save($this->data['User'])): |
| | 424 | $this->msgFlash('User has been updated.','/users/edit/'); |
| | 425 | endif; |
| | 426 | |
| | 427 | endif; |
| | 428 | } |