Exemple #1
0
 public function editAction($user_id)
 {
     // TODO : Check validate $user_id
     $this->_view->box_title = "Edit User";
     $this->_view->link_url = base_url() . 'dashboard/user/edit/' . $user_id;
     $objGroup = new Base_Group();
     $rsGroups = $objGroup->getRowset();
     $this->_view->rsGroups = $rsGroups;
     $oUser = new Base_User();
     if ($this->oParams->isPost()) {
         // TODO : Check validate
         $group_id = $this->oParams->varPost("group_id", array());
         $group_id = implode(",", $group_id);
         $data = array("display_name" => $this->oParams->varPost("display_name", ""), "email" => $this->oParams->varPost("email", ""), "group_id" => $group_id, "activated" => $this->oParams->varPost("activated", 0));
         $reset_password = $this->oParams->varPost('reset_password', NULL);
         if ($reset_password != NULL) {
             // TODO : Check validate password
             $data['password'] = md5($this->oParams->varPost("pw", ""));
         }
         // TODO : Notify save successfully
         $oUser->update($user_id, $data);
     }
     $rowUser = $oUser->get($user_id);
     $this->_view->rowUser = $rowUser;
     $this->_view->arrGroupIds = explode(",", $rowUser['group_id']);
     $this->renderView('dashboard/user/edit');
 }
Exemple #2
0
 public function deleteAction($group_id)
 {
     // TODO : Check validate
     $objGroup = new Base_Group();
     $rowGroup = $objGroup->delete($group_id);
     redirect("dashboard/group/list");
 }