Exemplo n.º 1
0
 public function isUserAllowedProduccition($production_id)
 {
     $table = $this->getTable();
     $select = $table->select(Zend_Db_Table::SELECT_WITH_FROM_PART)->setIntegrityCheck(false);
     $select->where('permission_production.acl_users_id = ' . $_SESSION["gpms"]["storage"]->id)->where('permission_production.productions_id = ' . $production_id);
     $data = $table->fetchAll($select)->toArray();
     $model = new User_Model_Roles();
     $role_name = $model->fetchName($data["0"]["acl_roles_id"]);
     //        Zend_Debug::dump($role_name);
     //        die();
     //Zend_Debug::dump( $_SESSION['gpms'],"antes de cambiar el role");
     //       die();
     if ($data) {
         $this->gpms = new Zend_Session_Namespace('gpms');
         $this->gpms->storage->out_production = 0;
         $this->gpms->storage->role_id = $data["0"]["acl_roles_id"];
         $this->gpms->role = $role_name;
         //   $_SESSION['gpms']['storage']->role_id=$data->acl_roles_id;
         // Zend_Debug::dump( $_SESSION['gpms'],"despues de cambiar el role");
         //     die("traga");
         return true;
     }
     //die("no traga");
     return false;
 }
Exemplo n.º 2
0
 /**
  * deleteAction for Permissions
  *
  * @return void
  */
 public function deleteAction()
 {
     if ($this->getRequest()->isPost()) {
         $del = $this->getRequest()->getPost('del');
         if ($del == 'Yes') {
             $id = $this->getRequest()->getPost('id');
             $model = new User_Model_Roles();
             $model->delete($id);
         }
         return $this->_helper->redirector('index');
     } else {
         $id = $this->_getParam('id', 0);
         if ($id > 0) {
             $model = new User_Model_Roles();
             $this->view->role = $model->fetchEntry($id);
         }
     }
 }