Changeset 499

Show
Ignore:
Timestamp:
05/16/08 23:33:41 (8 months ago)
Author:
aarkerio
Message:

Update

Location:
trunk/app
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/config/core.php

    r411 r499  
    1414 * In development mode, you need to click the flash message to continue. 
    1515 */ 
    16     Configure::write('debug', 1); 
     16    Configure::write('debug', 2); 
    1717/** 
    1818 * Application wide charset encoding 
  • trunk/app/controllers/groups_controller.php

    r394 r499  
    1818  public function isAuthorized()  
    1919  { 
    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  } 
    3228   
    33  /** 
    34     === ADMIN METHODS === 
    35   **/  
     29 /**   === ADMIN METHODS ===  **/  
    3630 public function admin_listing()  
    3731 { 
     
    7367    $this->layout = 'admin'; 
    7468 
    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'])): 
    8576            $this->msgFlash('Group has been updated.','/admin/groups/listing'); 
    86         } 
    87     } 
     77        endif; 
     78    endif; 
    8879 } 
    8980   
    90  public function admin_delete($id) 
     81 public function admin_delete($group_id) 
    9182 { 
    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; 
    9486 } 
    9587} 
  • trunk/app/models/news.php

    r407 r499  
    3333     public $validate = array( 
    3434           'title' => VALID_NOT_EMPTY, 
    35             'user_id' => VALID_NOT_EMPTY, 
     35           'user_id' => VALID_NOT_EMPTY, 
    3636           'body' => VALID_NOT_EMPTY, 
    37             'status' => VALID_NOT_EMPTY 
     37           'status' => VALID_NOT_EMPTY 
    3838     ); 
    3939  
  • trunk/app/views/news/display.ctp

    r496 r499  
    11<?php 
    2 // die(debug($data)); 
     2// die(debug($_SERVER)); 
    33 
    44echo $html->div('title_portal', 'News in campus');