public static function _logout() { $sessionData = sapp_Global::_readSession(); Zend_Session::namespaceUnset('recentlyViewed'); Zend_Session::namespaceUnset('organizationinfo'); $auth = Zend_Auth::getInstance(); $auth->clearIdentity(); $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector'); $redirector->gotoUrl('/default')->redirectAndExit(); }
public function preDispatch() { $session = sapp_Global::_readSession(); if (!isset($session)) { if ($this->getRequest()->isXmlHttpRequest()) { echo Zend_Json::encode(array('login' => 'failed')); die; } else { $this->_redirect(''); } } }
public function preDispatch() { $session = sapp_Global::_readSession(); if (!isset($session)) { if ($this->getRequest()->isXmlHttpRequest()) { echo Zend_Json::encode(array('login' => 'failed')); die; } else { $this->_redirect(''); } } $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('getdatafromajaxcall', 'json')->initContext(); }
public function preDispatch() { $auth = Zend_Auth::getInstance(); $session = sapp_Global::_readSession(); if (!isset($session)) { if ($this->getRequest()->isXmlHttpRequest()) { echo Zend_Json::encode(array('login' => 'failed')); die; } else { $this->_redirect(''); } } $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('activitylogreport', 'html')->initContext(); }
public function preDispatch() { $session = sapp_Global::_readSession(); if (!isset($session)) { if ($this->getRequest()->isXmlHttpRequest()) { echo Zend_Json::encode(array('login' => 'failed')); die; } else { $this->_redirect(''); } } $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('getdepartments', 'json')->initContext(); $ajaxContext->addActionContext('getpositions', 'json')->initContext(); $ajaxContext->addActionContext('getapprreqdata', 'json')->initContext(); $ajaxContext->addActionContext('chkreqforclose', 'json')->initContext(); $ajaxContext->addActionContext('getemailcount', 'json')->initContext(); $ajaxContext->addActionContext('getapprovers', 'json')->initContext(); }
public function uploadsaveAction() { $user_id = sapp_Global::_readSession('id'); $filedata = array(); // Validate file with size greater than default(Upload Max Filesize)limit $default_max_upload_filesize = 2 * pow(10, 6); if ($_FILES["myfile"]["size"] == 0 || $_FILES["myfile"]["size"] > $default_max_upload_filesize) { $this->_helper->json(array('error' => 'filesize')); } else { if (isset($_FILES["myfile"])) { $fileName = $_FILES["myfile"]["name"]; $fileName = preg_replace('/[^a-zA-Z0-9.\']/', '_', $fileName); $newName = time() . '_' . $user_id . '_' . str_replace(' ', '_', $fileName); $filedata['original_name'] = $fileName; $filedata['new_name'] = $newName; if (isset($_POST["doc_id"]) && $_POST["doc_id"] != '') { move_uploaded_file($_FILES["myfile"]["tmp_name"], EMP_DOC_UPLOAD_PATH . $newName); } else { move_uploaded_file($_FILES["myfile"]["tmp_name"], EMP_DOC_TEMP_UPLOAD_PATH . $newName); } $this->_helper->json(array('filedata' => $filedata)); } } }
public function updatethemeAction() { $this->_helper->layout->disableLayout(); if ($this->getRequest()->isPost()) { $theme_name = $this->getRequest()->getParam('theme_name'); $usersModel = new Default_Model_Users(); $user_id = sapp_Global::_readSession('id'); $where = array('id = ?' => $user_id); $data = array('themes' => $theme_name, 'createddate' => gmdate("Y-m-d H:i:s"), 'modifieddate' => gmdate("Y-m-d H:i:s")); $usersModel->addOrUpdateUserModel($data, $where); sapp_Global::_writeSession('themes', $theme_name); $this->_helper->json(array('result' => 'success')); } }
/** * */ public function uploadsaveAction() { $user_id = sapp_Global::_readSession('id'); $filedata = array(); if (isset($_FILES["myfile"])) { $fileName = $_FILES["myfile"]["name"]; $newName = time() . '_' . $user_id . '_' . str_replace(' ', '_', $_FILES["myfile"]["name"]); move_uploaded_file($_FILES["myfile"]["tmp_name"], SD_TEMP_UPLOAD_PATH . $newName); $filedata['original_name'] = $fileName; $filedata['new_name'] = $newName; $this->_helper->json(array('filedata' => $filedata)); } }