Show
Ignore:
Timestamp:
03/25/08 01:03:27 (8 months ago)
Author:
aarkerio
Message:

eCourses fixes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/users_controller.php

    r339 r342  
    5555      
    5656     $limit      = 20; 
    57          
     57      
    5858     $this->set('data', $this->User->Entry->findAll($conditions, $fields, $order, $limit));  
    59          
     59      
    6060     $this->layout    = $this->Edublog->layout($user_id); 
    61          
     61      
    6262     $this->Edublog->blog($user_id); 
    6363 } 
     
    393393 public function admin_edit()  
    394394 { 
    395      
    396     $this->layout    = 'admin'; 
    397      
    398     $this->set('Groups', $this->User->Group->generateList());        
    399      
    400     if (empty($this->data)) 
    401     { 
    402         $this->User->id = $this->Auth->user('id'); 
    403         $this->data = $this->User->read(); 
     395    if ( empty($this->data['User']) ) 
     396    { 
     397        $this->layout    = 'admin'; 
     398         
     399        $this->set('Groups', Set::combine($this->User->Group->find('all', array('order' => 'name')), "{n}.Group.id","{n}.Group.name")); 
     400         
     401        $this->User->unbindModel($this->User->notNow); 
     402             
     403        $this->data = $this->User->read(null, $this->Auth->user('id')); 
    404404    } 
    405405    else 
     
    480480     } 
    481481 } 
    482  
    483   /*** DELETE  **/  
    484   public function delete($id) 
    485   { 
    486     $this->User->del($id); 
    487     $this->msgFlash('User has been deleted.', '/admin/users/listing'); 
    488   } 
    489    
    490   /*** List user's blog entries  **/  
    491   public function blogs($order = null) 
    492   { 
    493    
    494     $conditions = array("active" => 1 ); 
    495      
    496     $data = $this->User->findAll($conditions, $order); 
    497      
    498     $this->set('data', $data); 
    499     
    500   } 
    501  
     482  
     483 /*** DELETE  **/  
     484 public function admin_delete($id) 
     485 { 
     486    if ($this->User->del($id)) 
     487    { 
     488       $this->msgFlash('User has been deleted.', '/admin/users/listing'); 
     489    } 
     490 } 
     491  
    502492 /****   AVATAR   ***/ 
    503493 public function admin_avatar()  
     
    573563    } 
    574564         
    575     $extension   = $this->get_extension($type); 
     565    $extension   = $this->Adds->get_extension($type); 
    576566     
    577567    $Name        = $this->Auth->user('username') . "_avatar" . $extension; 
     
    607597    
    608598   } 
    609 } 
    610  
    611 public function admin_delete($id) 
    612 { 
    613     if ( $this->User->del($id) ) 
    614     { 
    615         $this->msgFlash('User has been deleted','/admin/users/listing'); 
    616     } 
    617599} 
    618600