Example #1
0
 public function getdataobjectsAction()
 {
     $auth = Zend_Auth::getInstance();
     $lic = $_REQUEST['lic'];
     if ($lic != $_SESSION['OPENZISKEYHOLE']) {
         $this->view->msg = 'Not Ajax Request';
         $this->_forward('error', 'error');
     } else {
         if ($auth->hasIdentity()) {
             if (!$this->getRequest()->isXmlHttpRequest()) {
                 $this->view->msg = 'Not Ajax Request';
                 $this->_forward('index', 'error');
             } else {
                 $filterChain = new Zend_Filter();
                 $filterChain->addFilter(new Zend_Filter_StripTags())->addFilter(new Zend_Filter_Digits());
                 $id = $filterChain->filter($_REQUEST['ID']);
                 $dataObjects = DataObject::getAllDataObjects($id);
                 if (count($dataObjects) > 0) {
                     $json = Zend_Json::encode($dataObjects);
                     $this->view->json = $json;
                 }
                 $this->render('ajaxsuccessjson');
             }
         } else {
             if (!$this->getRequest()->isXmlHttpRequest()) {
                 $this->view->msg = 'Not Ajax Request';
                 $this->_forward('error', 'error');
             } else {
                 $this->view->msg = 'Invalid User';
                 $this->_forward('error', 'error');
             }
         }
     }
 }