| 73 | | $this->Sanitize = new Sanitize; |
| 74 | | |
| 75 | | $this->Sanitize->html($this->data['Message']['title']); |
| 76 | | |
| 77 | | $this->Sanitize->html($this->data['Message']['body']); |
| 78 | | |
| 79 | | $this->data['Message']['sender'] = $this->Auth->user('id'); |
| 80 | | $this->data['Message']['username'] = $this->Auth->user('username'); |
| 81 | | |
| 82 | | if ( $this->Message->save($this->data) ): |
| 83 | | $this->__sendMail($this->data['Message']['user_id']); |
| | 75 | $this->Sanitize = new Sanitize; |
| | 76 | |
| | 77 | $this->Sanitize->html($this->data['Message']['title']); |
| | 78 | |
| | 79 | $this->Sanitize->html($this->data['Message']['body']); |
| | 80 | |
| | 81 | $this->data['Message']['sender'] = $this->Auth->user('id'); |
| | 82 | |
| | 83 | if ( !isset( $this->data['Message']['user_id'] ) ): |
| | 84 | $this->data['Message']['user_id'] = $this->Message->User->field('User.id',array('User.username'=>trim($this->data['Message']['sender']))); |
| | 85 | endif; |
| | 86 | |
| | 87 | if ( $this->Message->save($this->data) ): |
| | 88 | $this->__sendMail($this->data['Message']['user_id']); |
| | 89 | if ( isset($this->data['Message']['ajax']) ): |
| | 90 | $this->render('sent', 'ajax'); |
| | 91 | else: |