예제 #1
0
 public function addUserAction()
 {
     $form = new RsvAcl_Form_FrmUser();
     $this->view->form = $form;
     if ($this->getRequest()->isPost()) {
         $db = new RsvAcl_Model_DbTable_DbUser();
         $post = $this->getRequest()->getPost();
         if (!$db->isUserExist($post['username'])) {
             $id = $db->insertUser($post);
             //write log file
             $userLog = new Application_Model_Log();
             $userLog->writeUserLog($id);
             //End write log file
             //Application_Form_FrmMessage::message('One row affected!');
             Application_Form_FrmMessage::redirector('/rsvAcl/user/index');
         } else {
             Application_Form_FrmMessage::message('User had existed already');
         }
     }
     Application_Model_Decorator::removeAllDecorator($form);
 }
 public function addUserAction()
 {
     if ($this->getRequest()->isPost()) {
         $db = new RsvAcl_Model_DbTable_DbUser();
         $post = $this->getRequest()->getPost();
         if (!$db->ifUserExist($post['username'])) {
             $id = $db->insertUser($post);
             $tr = Application_Form_FrmLanguages::getCurrentlanguage();
             $this->_redirect('/rsvAcl/user/index');
         } else {
             Application_Form_FrmMessage::message('User had existed already');
         }
     }
     $form = new RsvAcl_Form_FrmUser();
     $this->view->form = $form;
     Application_Model_Decorator::removeAllDecorator($form);
     $items = new Application_Model_GlobalClass();
     $locationRows = $items->getLocationAssign();
     $this->view->locations = $locationRows;
     $popup = new Application_Form_FrmPopup();
     $frm_poup = $popup->popuLocation(null);
     Application_Model_Decorator::removeAllDecorator($frm_poup);
     $this->view->popup_location = $frm_poup;
 }