Changeset 499
- Timestamp:
- 05/16/08 23:33:41 (8 months ago)
- Location:
- trunk/app
- Files:
-
- 4 modified
-
config/core.php (modified) (1 diff)
-
controllers/groups_controller.php (modified) (2 diffs)
-
models/news.php (modified) (1 diff)
-
views/news/display.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/core.php
r411 r499 14 14 * In development mode, you need to click the flash message to continue. 15 15 */ 16 Configure::write('debug', 1);16 Configure::write('debug', 2); 17 17 /** 18 18 * Application wide charset encoding -
trunk/app/controllers/groups_controller.php
r394 r499 18 18 public function isAuthorized() 19 19 { 20 if ($this->action == 'delete') 21 { 22 if ($this->Auth->user('group_id') == 1) 23 { 24 return true; 25 } else { 26 return false; 27 } 28 } 29 30 return true; 31 } 20 if (isset( $this->params[Configure::read('Routing.admin')] )): 21 if ($this->Auth->user('group_id') == 1 ): // admin 22 return true; 23 endif; 24 endif; 25 return false; // go away !! 26 27 } 32 28 33 /** 34 === ADMIN METHODS === 35 **/ 29 /** === ADMIN METHODS === **/ 36 30 public function admin_listing() 37 31 { … … 73 67 $this->layout = 'admin'; 74 68 75 if (empty($this->data['Group'])) 76 { 77 $this->Group->id = $id; 78 79 $this->data = $this->Group->read(); 80 } 81 else 82 { 83 if ($this->Group->save($this->data['Group'])) 84 { 69 if (empty($this->data['Group'])): 70 71 $this->data = $this->Group->read(null, $id); 72 73 else: 74 75 if ($this->Group->save($this->data['Group'])): 85 76 $this->msgFlash('Group has been updated.','/admin/groups/listing'); 86 }87 }77 endif; 78 endif; 88 79 } 89 80 90 public function admin_delete($ id)81 public function admin_delete($group_id) 91 82 { 92 $this->Group->del($id); 93 $this->msgFlash('Stuent has been deleted','/admin/vclassrooms/members/'.$vclassroom_id); 83 if ( $this->Group->del($group_id) ): 84 $this->msgFlash('Group deleted','/admin/groups/listing'); 85 endif; 94 86 } 95 87 } -
trunk/app/models/news.php
r407 r499 33 33 public $validate = array( 34 34 'title' => VALID_NOT_EMPTY, 35 'user_id' => VALID_NOT_EMPTY,35 'user_id' => VALID_NOT_EMPTY, 36 36 'body' => VALID_NOT_EMPTY, 37 'status' => VALID_NOT_EMPTY37 'status' => VALID_NOT_EMPTY 38 38 ); 39 39 -
trunk/app/views/news/display.ctp
r496 r499 1 1 <?php 2 // die(debug($ data));2 // die(debug($_SERVER)); 3 3 4 4 echo $html->div('title_portal', 'News in campus');
