public function fetchChildrenAction() { $parentGuid = $this->_getParam('node') ? $this->_getParam('node') : ''; $node = $this->_getParam('parentGuid'); $tblFolder = new Pandamp_Modules_Dms_Folder_Model_Folder(); $tblCatalogFolder = new Pandamp_Modules_Dms_Catalog_Model_CatalogFolder(); $modelAroGroup = new Pandamp_Modules_Identity_Group_Folder_AroGroup(); $auth = Zend_Auth::getInstance(); if (!$auth->hasIdentity()) { echo "You aren't login"; } $packageId = $auth->getIdentity()->packageId; // get group information $acl = Pandamp_Acl::manager(); //$aReturn = $acl->getUserGroupIds(Zend_Auth::getInstance()->getIdentity()->username); $aReturn = $modelAroGroup->getUserGroup($packageId); if (!empty($parentGuid)) { $aJson = array(); $rowset = $tblFolder->fetchChildren($parentGuid); $i = 0; foreach ($rowset as $row) { if ($aReturn['name'] == "Master" || $aReturn['name'] == "Super Admin") { $content = 'all-access'; } else { $content = $row->type; } if ($acl->getPermissionsOnContent('', $aReturn['name'], $content)) { if ($row->title == "Kategori" || $row->title == "Peraturan" || $row->title == "Putusan") { $title = "<font color=red><b>" . $row->title . "</b></font>"; } else { $title = $row->title; } $aJson[$i]['text'] = $title; //. ' ('.$tblCatalogFolder->countCatalogsInFolderAndChildren($row->guid).')'; $aJson[$i]['id'] = $row->guid; $checkLeaf = $tblFolder->fetchAll("path like '%{$row->guid}%'"); if ($checkLeaf->count() > 0) { $aJson[$i]['leaf'] = 0; $aJson[$i]['cls'] = 'folder'; } else { $aJson[$i]['leaf'] = 1; $aJson[$i]['cls'] = 'leaf'; } } else { continue; } $i++; } echo $json = Zend_Json::encode($aJson); } }
function indexAction() { $sReturn = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $sReturn = base64_encode($sReturn); $identity = Pandamp_Application::getResource('identity'); $logoutUrl = $identity->logoutUrl; //$logoutUrl = $identity->logoutUrl; $auth = Zend_Auth::getInstance(); $packageId = $auth->getIdentity()->packageId; //$this->view->logoutUrl = $logoutUrl.'/'.$sReturn; $this->view->logoutUrl = $logoutUrl . '/' . $sReturn; // get group information $acl = Pandamp_Acl::manager(); $modelAroGroup = new Pandamp_Modules_Identity_Group_Folder_AroGroup(); //$aReturn = $acl->getUserGroupIds(Zend_Auth::getInstance()->getIdentity()->username); $aReturn = $modelAroGroup->getUserGroup($packageId); //$this->view->group = (isset($aReturn[1]))? $aReturn[1] : '-'; $this->view->group = $aReturn['name']; }
public function fetchProfileInFolderAction() { $acl = Pandamp_Acl::manager(); $modelAroGroup = new Pandamp_Modules_Identity_Group_Folder_AroGroup(); $tblProfile = new Pandamp_Modules_Dms_Profile_Model_Profile(); $rowset = $tblProfile->fetchAll(); $a = array(); $a['totalCount'] = count($rowset); $i = 0; if ($a['totalCount'] != 0) { $auth = Zend_Auth::getInstance(); $packageId = $auth->getIdentity()->packageId; foreach ($rowset as $row) { //$aReturn = $acl->getUserGroupIds($auth->getIdentity()->username); $aReturn = $modelAroGroup->getUserGroup($packageId); if ($aReturn['name'] == "Master" || $aReturn['name'] == "Super Admin") { $content = 'all-access'; } else { $content = $row->profileType; } if ($acl->getPermissionsOnContent('', $aReturn['name'], $content)) { $a['profile'][$i]['guid'] = $row->guid; $a['profile'][$i]['title'] = $row->title; } else { continue; } $i++; } } echo Zend_Json::encode($a); }