Changeset 480 for trunk/app/controllers/messages_controller.php
- Timestamp:
- 05/13/08 00:50:52 (8 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/messages_controller.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/messages_controller.php
r477 r480 14 14 public $components = array('Portal', 'Security', 'Email', 'Session', 'Edublog'); 15 15 16 public function beforeFilter()17 { 18 $this->Auth->allow(array('message', 'deliver' ));16 public function beforeFilter() 17 { 18 $this->Auth->allow(array('message', 'deliver', 'listing', 'compose')); 19 19 parent::beforeFilter(); 20 20 } … … 100 100 } 101 101 102 public function listing() 103 { 104 if ( !$this->Auth->user() ): 105 $this->redirect('/users/login'); 106 return false; 107 endif; 108 109 $this->layout = 'portal'; 110 111 $this->pageTitle = 'Messages'; 112 113 $conditions = array("Message.user_id" => $this->Auth->user('id')); 114 fields = array("Message.id", "Message.title", "Message.body", "Message.created", "Message.sender", "Message.status", "User.username"); 115 $order = "Message.id DESC"; 116 $limit = 20; 117 118 $this->set('data', $this->Message->findAll($conditions, $fields, $order, $limit)); 119 120 $this->Portal->statics(); // Charge Portal components aka Sidebars 121 } 122 123 102 124 /* == PRIVATE == **/ 103 125 private function __sendMail($email) … … 113 135 $this->Email->sendAs = 'text'; // because we like to send pretty mail 114 136 //Do not pass any args to send() 115 if ( $this->Email->send() ) 116 { 137 if ( $this->Email->send() ): 117 138 return true; 118 } 119 else 120 { 121 return false; 122 } 139 else: 140 return false; 141 endif; 123 142 } 124 143
