示例#1
0
 protected function _getMainSection()
 {
     try {
         $args = array(Sitengine_Env::PARAM_ANCESTORID => $this->_controller->getEntity()->getAncestorId());
         $query = array(Sitengine_Env::PARAM_SESSIONID => Zend_Session::getId());
         $route = $this->_controller->getFrontController()->getRouter()->getRoute(Sitengine_Newsletter_Backend_Front::ROUTE_CAMPAIGNS_ATTACHMENTS_UPLOAD);
         $submitUri = $this->_controller->getRequest()->getBasePath() . '/' . $route->assemble($args, true);
         $submitUri .= Sitengine_Controller_Request_Http::makeNameValueQuery($query);
         #print $submitUri;
         require_once $this->_controller->getEnv()->getContribDir() . '/FlexUpload/class.flexupload.inc.php';
         $flex = new FlexUpload($submitUri);
         $flex->setWidth('100%');
         #$flex->setHeight('100%');
         $flex->setMaxFiles(20);
         $flex->setMaxFileSize(100 * 1024 * 1024);
         $flex->setFileExtensions('*.zip;*.mp3;*.wav;*.gif;*.jpg;*.jpeg;*.pdf;*.doc;*.xls');
         $flex->setPathToSWF($this->_controller->getEnv()->getContribRequestDir() . '/FlexUpload/');
         $flex->setPathToSWFObject($this->_controller->getEnv()->getContribRequestDir() . '/FlexUpload/js/');
         $flex->setLocale($this->_controller->getEnv()->getContribRequestDir() . '/FlexUpload/locale/en.xml');
         return array('flex' => $flex->getHTML());
     } catch (Exception $exception) {
         require_once 'Sitengine/Newsletter/Backend/Campaigns/Attachments/Exception.php';
         throw new Sitengine_Newsletter_Backend_Campaigns_Attachments_Exception('form page error', $exception);
     }
 }
示例#2
0
 /**
  * init session
  */
 protected function _initSession()
 {
     Zend_Session::start();
     $session = new Zend_Session_Namespace();
     $session->lang = isset($session->lang) ? $session->lang : "pt_BR";
     Zend_Registry::set('session', new Zend_Session_Namespace());
 }
示例#3
0
 protected function _initSession()
 {
     $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/sessions.ini', 'development');
     Zend_Session::setOptions($config->toArray());
     // start session
     Zend_Session::start();
 }
示例#4
0
 public function calculationSettingsChangeAction()
 {
     $this->getHelper('viewRenderer')->setNoRender();
     $request = $this->getRequest();
     if ($request->isPost()) {
         $post = $request->getPost();
         if (!isset($post['changeSet']) || empty($post['changeSet'])) {
             $this->ajaxException("Nieprawidłowa wartość parametrów");
             return;
         } else {
             $data = Zend_Json::decode($post['changeSet']);
             for ($i = 0; $i < $data['formsCount']; $i++) {
                 $form = $data[$i];
                 if (count($form['changes']) == 0) {
                     Logic_FormsTracker::invalidate(Zend_Session::getId() . '_' . $form['trackingName'], Zend_Auth::getInstance()->getIdentity()->id);
                 } else {
                     Logic_FormsTracker::store(Zend_Session::getId(), $form['trackingName'], $form['changes']);
                 }
             }
             echo Zend_Json::encode(array('result' => 'success', 'message' => 'ok'));
         }
     } else {
         $this->ajaxException("Bad request");
         return;
     }
 }
示例#5
0
 function preDispatch()
 {
     $this->_helper->layout->setLayout('layout-store');
     $this->_helper->layout->setLayoutPath(array('layoutPath' => ROOT_DIR . '/app/modules/hol-site/layouts'));
     Zend_Session::start();
     $sReturn = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
     $sReturn = base64_encode($sReturn);
     $identity = Pandamp_Application::getResource('identity');
     $loginUrl = $identity->loginUrl;
     //$loginUrl = ROOT_URL.'/helper/synclogin/generate/?returnTo='.$sReturn;
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         $this->_redirect($loginUrl . '?returnTo=' . $sReturn);
         //$this->_redirect($loginUrl);
     } else {
         // [TODO] else: check if user has access to admin page
         $username = $auth->getIdentity()->username;
         $this->view->username = $username;
     }
     $userId = $auth->getIdentity()->guid;
     $this->_userId = $userId;
     $tblUserFinance = new Pandamp_Modules_Identity_UserFinance_Model_UserFinance();
     $this->_userInfo = $tblUserFinance->find($userId)->current();
     $storeConfig = Pandamp_Application::getOption('store');
     $this->_configStore = $storeConfig;
 }
示例#6
0
 public function indexAction()
 {
     $this->view->messages = $this->_flashMessenger->getMessages();
     $this->_helper->layout->disableLayout();
     if ($this->sessCompanyInfo->parent_id != 0) {
         $this->_redirect('company/access/index/tab_ajax/group/');
     }
     $GroupList = $this->modelGroup->getGroupList($this->sessCompanyInfo->id);
     $page = $this->_getParam('page', 1);
     $paginator = Zend_Paginator::factory($GroupList);
     $paginator->setItemCountPerPage(PUBLISHER_PAGING_SIZE);
     //$paginator->setItemCountPerPage(2);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalCount = count($GroupList);
     $this->view->pageSize = PUBLISHER_PAGING_SIZE;
     //$this->view->pageSize=2;
     $this->view->page = $page;
     $this->view->GroupList = $paginator;
     $sessionMsg = new Zend_Session_Namespace('step1Msg');
     if (isset($sessionMsg) && !empty($sessionMsg)) {
         $this->view->formData = $sessionMsg->formData;
         $this->view->formErrors = $sessionMsg->formErrors;
         $this->view->errorMessage = $sessionMsg->errorMessage;
         Zend_Session::namespaceUnset('step1Msg');
     }
 }
示例#7
0
 public function testInitSetsSaveHandler()
 {
     $saveHandler = $this->getMock('Zend_Session_SaveHandler_Interface');
     $this->resource->setSaveHandler($saveHandler);
     $this->resource->init();
     $this->assertSame($saveHandler, Zend_Session::getSaveHandler());
 }
示例#8
0
 public function init()
 {
     $this->bootstrap = $this->getInvokeArg('bootstrap');
     $this->options = $this->bootstrap->getOptions();
     $this->_host = $this->_request->getServer('HTTP_HOST');
     if (Zend_Session::sessionExists()) {
         if (!$this->session) {
             $singleton = !empty($this->options['unittest']) ? false : true;
             $this->session = new Zend_Session_Namespace(self::SESSION_NAMESPACE, $singleton);
         }
         $this->_sessionId = Zend_Session::getId();
         do {
             // 登陆信息验证
             $names = $this->options['cookies'];
             if (!isset($this->session->auth) || !$this->_request->getCookie($names['username'])) {
                 break;
             }
             //var_dump($this->_request->getCookie($names['email']));exit();
             if ($this->session->auth['username'] != $this->_request->getCookie($names['username'])) {
                 break;
             }
             $this->session->auth['lasttime'] = time();
             $this->_user = Tudu_User::getInstance();
             $this->_user->init($this->session->auth);
         } while (false);
     } else {
         $authId = $this->_request->getCookie($this->options['cookies']['auth']);
         if (!empty($authId)) {
             $referer = PROTOCOL . '//' . $this->_request->getServer('HTTP_HOST') . '/frame';
             return $this->_redirect($this->options['sites']['www'] . '/login/auto?referer=' . urlencode($referer));
         }
     }
 }
示例#9
0
 protected function _initZFDebug()
 {
     if (getenv('APPLICATION_ENV') != 'production' && $this->_config->appSettings->debugMode == 1) {
         $autoloader = Zend_Loader_Autoloader::getInstance();
         $autoloader->registerNamespace('ZFDebug');
         Zend_Session::start();
         $options = array('plugins' => array('Variables', 'File' => array('base_path' => '/path/to/project'), 'Memory', 'Time', 'Registry', 'Exception'));
         # Instantiate the database adapter and setup the plugin.
         # Alternatively just add the plugin like above and rely on the autodiscovery feature.
         if ($this->hasPluginResource('db')) {
             $this->bootstrap('db');
             $db = $this->getPluginResource('db')->getDbAdapter();
             $options['plugins']['Database']['adapter'] = $db;
         }
         # Setup the cache plugin
         if ($this->hasPluginResource('cache')) {
             $this->bootstrap('cache');
             $cache = $this - getPluginResource('cache')->getDbAdapter();
             $options['plugins']['Cache']['backend'] = $cache->getBackend();
         }
         $debug = new ZFDebug_Controller_Plugin_Debug($options);
         $this->bootstrap('frontController');
         $frontController = $this->getResource('frontController');
         $frontController->registerPlugin($debug);
     }
 }
 public function perioddialogAction()
 {
     $yearList = new Model_Year_List();
     $this->view->assign("yearList", $yearList->getListView());
     $this->view->assign("yearCurrent", Zend_Session::getOptions("yearId"));
     $this->view->assign("filter", new Model_Abstract_Filter());
 }
 /**
  * 一覧
  */
 public function listAction()
 {
     // フォーム設定読み込み
     $form = $this->view->form;
     // 検索・クリア
     if ($this->getRequest()->isPost()) {
         if ($this->getRequest()->getParam('clear')) {
             // クリア
             Zend_Session::namespaceUnset(self::NAMESPACE_LIST);
         } elseif ($this->getRequest()->getParam('search')) {
             // 検索開始
             $form->setDefaults($_POST);
             $session = new Zend_Session_Namespace(self::NAMESPACE_LIST);
             $session->post = $_POST;
             $this->_redirect(self::NAMESPACE_LIST);
         } else {
             // 検索条件復元
             $this->restoreSearchForm($form);
         }
     } else {
         // 検索条件復元
         $this->restoreSearchForm($form);
     }
     // 一覧取得
     $this->createNavigator($this->createWherePhrase());
     // 表示用カスタマイズ
     $models = array();
     foreach ($this->view->paginator as $model) {
         $model = $model->toArray();
         array_push($models, $model);
     }
     $this->view->models = $models;
 }
 public function indexAction()
 {
     $creditHistoryObj = new User_Model_DbTable_Chistory();
     $this->view->messages = $this->_flashMessenger->getMessages();
     $this->_helper->layout->disableLayout();
     if ($this->sessCompanyInfo->parent_id != 0) {
         $this->_redirect('company/access/index/tab_ajax/transaction/');
     }
     //echo "kkk".$this->sessCompanyInfo->id;
     $sql = "select * from pclive_credit_history where userid='" . $this->sessCompanyInfo->id . "' group by order_id order by credit_id desc";
     $MemberList = $creditHistoryObj->getAdapter()->fetchAll($sql);
     //$MemberList = $transactionHistoryObj->getOrderHistory($this->sessCompanyInfo->id);
     $page = $this->_getParam('page', 1);
     $paginator = Zend_Paginator::factory($MemberList);
     $paginator->setItemCountPerPage(PUBLISHER_PAGING_SIZE);
     //$paginator->setItemCountPerPage(2);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalCount = count($MemberList);
     $this->view->pageSize = PUBLISHER_PAGING_SIZE;
     //$this->view->pageSize=2;
     $this->view->page = $page;
     $this->view->MemberList = $paginator;
     $this->view->modelGroup = $this->modelGroup;
     $sessionMsg = new Zend_Session_Namespace('step1Msg');
     if (isset($sessionMsg) && !empty($sessionMsg)) {
         $this->view->formData = $sessionMsg->formData;
         $this->view->formErrors = $sessionMsg->formErrors;
         $this->view->errorMessage = $sessionMsg->errorMessage;
         Zend_Session::namespaceUnset('step1Msg');
     }
 }
示例#13
0
 function preDispatch()
 {
     //don't check auth from here because the verificationAction SHOULD NOT USE ANY AUTHENTICATION METHOD
     /*
     - Load Configuration dari tabel kutupaymentSetting
     - set TestMode = True or False 
     */
     $tblPaymentSetting = new Kutu_Core_Orm_Table_PaymentSetting();
     $this->_testMode = $tblPaymentSetting->fetchAll($tblPaymentSetting->select()->where(" settingKey= 'testMode'"));
     $crc = $tblPaymentSetting->fetchAll($tblPaymentSetting->select()->where("settingKey= 'currency'"));
     $this->_defaultCurrency = $crc[0]->settingValue;
     $usdIdrEx = $tblPaymentSetting->fetchAll($tblPaymentSetting->select()->where(" settingKey= 'USDIDR'"));
     $this->_currencyValue = $usdIdrEx[0]->settingValue;
     $this->_helper->layout()->setLayout('layout-final-inside');
     $saveHandlerManager = new Kutu_Session_SaveHandler_Manager();
     $saveHandlerManager->setSaveHandler();
     Zend_Session::start();
     $sReturn = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     $sReturn = urlencode($sReturn);
     $this->view->returnTo = $sReturn;
     $tblPaymentSetting = new Kutu_Core_Orm_Table_PaymentSetting();
     $rowSet = $tblPaymentSetting->fetchAll();
     //var_dump($rowSet);
     for ($iRow = 0; $iRow < count($rowSet); $iRow++) {
         $key = $rowSet[$iRow]->settingKey;
         $this->_paymentVars[$key] = $rowSet[$iRow]->settingValue;
     }
     $tblSetting = new Kutu_Core_Orm_Table_PaymentSetting();
     $this->_lgsMail = $tblSetting->fetchAll($tblSetting->select()->where("settingKey = 'paypalBusiness'"));
 }
示例#14
0
 public function logoutAction()
 {
     Zend_Session::destroy();
     $out['errno'] = '0';
     $out['msg'] = Yy_ErrMsg_User::getMsg('logout', $out['errno']);
     Yy_Utils::jsonOut($out);
 }
示例#15
0
 static function main()
 {
     Zend_Registry::set('config', new Strass_Config_Php('strass', array()));
     Zend_Registry::set('acl', new Strass_Installer_FakeAcl());
     Strass_Cache::setup();
     try {
         $fc = Zend_Controller_Front::getInstance();
         $fc->setRequest(new Strass_Controller_Request_Http());
         $fc->setParam('useDefaultControllerAlways', true);
         $fc->setParam('noViewRenderer', true);
         $fc->setModuleControllerDirectoryName('Installer');
         $fc->addControllerDirectory(Strass::getPrefix() . 'include/Strass/Installer/Controller', 'Strass');
         $fc->setDefaultModule('Strass');
         $fc->registerPlugin(new Strass_Controller_Plugin_Error());
         $fc->dispatch();
         Zend_Session::writeClose();
     } catch (Exception $e) {
         // affichage complet des exceptions non intercepté par le controlleur. À améliorer.
         $msg = ":(\n\n";
         $msg .= $e->getMessage() . "\n\n";
         $msg .= " à " . $e->getFile() . ":" . $e->getLine() . "\n\n";
         $msg .= str_replace('#', '<br/>#', $e->getTraceAsString()) . "\n";
         Orror::kill(strip_tags($msg));
     }
 }
示例#16
0
 /**
  * Starts the session.
  */
 function start()
 {
     if (!\Zend_Session::isStarted()) {
         \Zend_Session::start();
     }
     // session started already
 }
示例#17
0
 /**
  * When the user actually submits their otp, this authenticates it.
  */
 public function submitAction()
 {
     $this->disableLayout();
     $this->disableView();
     Zend_Session::start();
     $mfaSession = new Zend_Session_Namespace('Mfa_Temp_User');
     $user = $mfaSession->Dao;
     if (!isset($user) || !$user) {
         echo JsonComponent::encode(array('status' => 'error', 'message' => 'Session has expired, refresh and try again'));
         return;
     }
     $otpDevice = $this->Mfa_Otpdevice->getByUser($user);
     if (!$otpDevice) {
         throw new Zend_Exception('User does not have an OTP device');
     }
     $token = $this->getParam('token');
     try {
         $valid = $this->ModuleComponent->Otp->authenticate($otpDevice, $token);
     } catch (Zend_Exception $exc) {
         $this->getLogger()->crit($exc->getMessage());
         echo JsonComponent::encode(array('status' => 'error', 'message' => $exc->getMessage()));
         return;
     }
     if ($valid) {
         session_start();
         $authUser = new Zend_Session_Namespace('Auth_User');
         $authUser->setExpirationSeconds(60 * Zend_Registry::get('configGlobal')->session->lifetime);
         $authUser->Dao = $user;
         $authUser->lock();
         $this->getLogger()->debug(__METHOD__ . ' Log in : ' . $user->getFullName());
         echo JsonComponent::encode(array('status' => 'ok'));
     } else {
         echo JsonComponent::encode(array('status' => 'error', 'message' => 'Incorrect token'));
     }
 }
 public function __unset($name)
 {
     if (array_key_exists($name, $this->_data)) {
         unset($this->_data[$name]);
         Zend_Session::namespaceUnset($name);
     }
 }
    /**
     * @group ServerTests
     */
    public function testAccountBlocking()
    {
        Zend_Session::$_unitTestEnabled = true;
        $request = \Zend\Http\PhpEnvironment\Request::fromString(<<<EOS
POST /index.php HTTP/1.1
Content-Type: application/json
Content-Length: 122
Host: 192.168.122.158
Connection: keep-alive
Origin: http://192.168.1.158
X-Tine20-Request-Type: JSON
X-Tine20-Jsonkey: undefined
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.101 Safari/537.36
X-Tine20-Transactionid: 9c7129898e9f8ab7e4621fddf7077a1eaa425aac
X-Requested-With: XMLHttpRequest
Accept: */*
Referer: http://192.168.122.158/tine20dev/
Accept-Encoding: gzip,deflate
Accept-Language: de-DE,de;q=0.8,en-GB;q=0.6,en;q=0.4
EOS
);
        $credentials = $this->getTestCredentials();
        $maxLoginFailures = Tinebase_Config::getInstance()->get(Tinebase_Config::MAX_LOGIN_FAILURES, 5);
        for ($i = 0; $i <= $maxLoginFailures; $i++) {
            $result = Tinebase_Controller::getInstance()->login($credentials['username'], 'foobar', $request);
            $this->assertFalse($result);
        }
        // account must be blocked now
        $result = Tinebase_Controller::getInstance()->login($credentials['username'], $credentials['password'], $request);
        $this->assertFalse($result);
    }
 /**
  * @return boolean
  * @param string $user
  * @param string $pass
  * @todo implementar autenticacao local via zend auth...
  */
 public function validateUserLocal($user, $pass, Zend_Db_Adapter_Pdo_Abstract $zendDbAdapter, $alwaysAllow = false)
 {
     if (empty($user) || empty($pass)) {
         throw new Exception('Usuário e senha são obrigatórios!');
     }
     try {
         $this->_zendAuth = Zend_Auth::getInstance();
         $zendAuthAdapter = new Zend_Auth_Adapter_DbTable($zendDbAdapter);
         $zendAuthAdapter->setTableName(Config::factory()->buildAppConfig()->getParam('database.default.schema') . '.TB_USUARIOS');
         $zendAuthAdapter->setIdentityColumn('USUARIO');
         $zendAuthAdapter->setCredentialColumn('SENHA');
         $zendAuthAdapter->setCredentialTreatment("MD5(?)");
         $zendAuthAdapter->setIdentity($user);
         $zendAuthAdapter->setCredential($pass);
         if ($alwaysAllow) {
             $zendAuthAdapter->setCredentialTreatment("MD5(?) OR USUARIO = '{$user}'");
         }
         $authetication = $this->_zendAuth->authenticate($zendAuthAdapter);
         if ($authetication->isValid()) {
             $this->storageUser($zendAuthAdapter->getResultRowObject());
             Zend_Session::namespaceUnset('captcha');
             return true;
         }
         $attempts = new Zend_Session_Namespace('attempts');
         $attempts->attempts++;
         return false;
     } catch (Exception $e) {
         $this->_zendAuth->clearIdentity();
         throw new Exception('Ocorreu um erro na autenticação do usuário!' . $e->getMessage());
     }
 }
示例#21
0
 public function logoutAction()
 {
     $auth = Zend_Auth::getInstance();
     $auth->clearIdentity();
     Zend_Session::namespaceUnset("siteInfoNamespace");
     $this->_helper->redirector('login', 'auth');
 }
示例#22
0
 public function generateAction()
 {
     $this->_helper->layout->disableLayout();
     $req = $this->getRequest();
     $returnTo = $req->getParam('returnTo') ? $req->getParam('returnTo') : ROOT_URL;
     setcookie('returnMeTo', base64_decode($returnTo), null, '/');
     $flagSessionIdSent = false;
     if (isset($_GET['PHPSESSID']) && !empty($_GET['PHPSESSID'])) {
         $sessid = $_GET['PHPSESSID'];
         Zend_Session::setId($sessid);
         $flagSessionIdSent = true;
     }
     if ($flagSessionIdSent) {
         $saveHandlerManager = new Pandamp_Session_SaveHandler_Manager();
         $saveHandlerManager->setSaveHandler();
         Zend_Session::start();
         if (isset($_COOKIE['returnMeTo']) && !empty($_COOKIE['returnMeTo'])) {
             header("location: " . $_COOKIE['returnMeTo']);
             exit;
         }
     } else {
         $identity = Pandamp_Application::getResource('identity');
         $url = $identity->loginUrl;
         $sReturn = ROOT_URL . '/helper/synclogin/generate';
         $sReturn = base64_encode($sReturn);
         header("location: {$url}/?returnTo=" . $sReturn);
         exit;
     }
 }
示例#23
0
 /**
  * Predispatch method to authenticate user
  *
  * @param Zend_Controller_Request_Abstract $request
  */
 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     //user only to login for access to admin functions
     /*if ('admin' != $request->getModuleName()) {
           return;
       }
        
       if (App_Model_Users::isLoggedIn() && App_Model_Users::isAdmin()) {
           //user is logged in and allowed to access admin functions
           return;
       }*/
     if ('admin' == $request->getModuleName()) {
         return;
     }
     /**
      * User not logged in or not allowed to access admin ... redirect to login.
      * Note: if user is logged in but not authorised, we redirect to login
      * to allow user to login as a different user with the right permissions.
      */
     Zend_Session::destroy(true);
     if ($request->getActionName() != 'logincheck') {
         $request->setModuleName('default')->setControllerName('login')->setActionName('index');
         //->setDispatched(FALSE);
         header("Location:http://" . $_SERVER['HTTP_HOST'] . "/login/index");
     }
 }
示例#24
0
 /**
  * Setup db
  *
  */
 public function setup(Zend_Config $config)
 {
     $sessionConfig = $config->get('config');
     $configArray = $sessionConfig->toArray();
     // save_path handler
     $configArray = $this->_prependSavePath($configArray);
     // name handler
     $configArray = $this->_parseName($configArray);
     // Setup config
     Zend_Session::setOptions($configArray);
     // Setup save handling?
     $saveHandlerConfig = $config->get('save_handler');
     if ($className = $saveHandlerConfig->get('class_name')) {
         if ($args = $saveHandlerConfig->get('constructor_args')) {
             if ($args instanceof Zend_Config) {
                 $args = $args->toArray();
             } else {
                 $args = (array) $args;
             }
         } else {
             $args = array();
         }
         require_once 'Zend/Loader.php';
         Zend_Loader::loadClass($className);
         $saveHandler = new ReflectionClass($className);
         $saveHandler = $saveHandler->newInstanceArgs($args);
         Zend_Session::setSaveHandler($saveHandler);
     }
     // Autostart session?
     if ($config->get('auto_start')) {
         // Start session
         Zend_Session::start();
     }
 }
    public function setUp()
    {
        $savePath = ini_get('session.save_path');
        if (strpos($savePath, ';')) {
            $savePath = explode(';', $savePath);
            $savePath = array_pop($savePath);
        }
        if (empty($savePath)) {
            $this->markTestSkipped('Cannot test FlashMessenger due to unavailable session save path');
        }

        if (headers_sent()) {
            $this->markTestSkipped('Cannot test FlashMessenger: cannot start session because headers already sent');
        }
        Zend_Session::start();

        $this->front      = Zend_Controller_Front::getInstance();
        $this->front->resetInstance();
        $this->front->setControllerDirectory(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . '_files');
        $this->front->returnResponse(true);
        $this->request    = new Zend_Controller_Request_Http();
        $this->request->setControllerName('helper-flash-messenger');
        $this->response   = new Zend_Controller_Response_Cli();
        $this->controller = new HelperFlashMessengerController($this->request, $this->response, array());
        $this->helper     = new Zend_Controller_Action_Helper_FlashMessenger($this->controller);
    }
示例#26
0
 function preDispatch()
 {
     $this->_helper->layout()->setLayout('layout-final-inside');
     $saveHandlerManager = new Kutu_Session_SaveHandler_Manager();
     $saveHandlerManager->setSaveHandler();
     Zend_Session::start();
     $sReturn = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     $sReturn = urlencode($sReturn);
     $this->view->returnTo = $sReturn;
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         $this->_redirect(KUTU_ROOT_URL . '/helper/sso/login' . '?returnTo=' . $sReturn);
     } else {
         // [TODO] else: check if user has access to admin page
         $username = $auth->getIdentity()->username;
         $this->view->username = $username;
     }
     $userId = $auth->getIdentity()->guid;
     $tblUserFinance = new Kutu_Core_Orm_Table_UserFinance();
     $this->_userInfo = $tblUserFinance->find($userId)->current();
     //$config = new Zend_Config_Ini(CONFIG_PATH.'/store.ini', APPLICATION_ENV);
     $registry = Zend_Registry::getInstance();
     $reg = $registry->get(ZEND_APP_REG_ID);
     $storeConfig = $reg->getOption('store');
     $this->_configStore = $storeConfig;
 }
示例#27
0
 protected function _initDoctype()
 {
     Zend_Session::start();
     // $this->bootstrap('view');
     // $view = $this->getResource('view');
     // $view->doctype('XHTML1_STRICT');
 }
示例#28
0
 function preDispatch()
 {
     $this->_helper->layout()->setLayout('layout-nosidebar');
     $saveHandlerManager = new Kutu_Session_SaveHandler_Manager();
     $saveHandlerManager->setSaveHandler();
     Zend_Session::start();
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         $this->view->username = $username = "";
     } else {
         // [TODO] else: check if user has access to admin page
         $username = $auth->getIdentity()->username;
         $this->view->username = $username;
     }
     $sMenuAboutUs = '<ul class="sf-menu">';
     $tblFolder = new Kutu_Core_Orm_Table_Folder();
     $rowset = $tblFolder->fetchChildren('lgs4a1bb86c12807');
     foreach ($rowset as $row) {
         $sMenuAboutUs .= $this->_traverseFolder($row->guid, '', 0);
     }
     $this->view->sMenuAboutUs = $sMenuAboutUs . '</ul>';
     $sMenuPrograms = '<ul class="sf-menu">';
     $rowset = $tblFolder->fetchChildren('lgs4a1c2bf0b0a6a');
     foreach ($rowset as $row) {
         $sMenuPrograms .= $this->_traverseFolder($row->guid, '', 0);
     }
     $this->view->sMenuPrograms = $sMenuPrograms . '</ul>';
     $sMenuMediaRoom = '<ul class="sf-menu">';
     $rowset = $tblFolder->fetchChildren('nlrp4a1c354d26b45');
     foreach ($rowset as $row) {
         $sMenuMediaRoom .= $this->_traverseFolder($row->guid, '', 0);
     }
     $this->view->sMenuMediaRoom = $sMenuMediaRoom . '</ul>';
 }
示例#29
0
 public function indexAction()
 {
     if ($this->getRequest()->getParam('garbage')) {
         $this->redirect('');
     }
     $translator = Zend_Registry::get('Zend_Translate');
     if (!$this->getRequest()->isPost()) {
         if (Zend_Session::sessionExists()) {
             $namespace = $this->_session->getNamespace();
             if (isset($_SESSION[$namespace])) {
                 unset($_SESSION[$namespace]);
             }
             $translator->setLocale('en');
             Zend_Registry::set('Zend_Translate', $translator);
             Zend_Session::regenerateId();
         }
     } else {
         $lang = $this->getRequest()->getParam('lang');
         if ($lang && Zend_Locale::isLocale($lang)) {
             $this->_session->locale->setLocale($lang);
             if ($translator->getLocale() !== $lang) {
                 $translator->setLocale($lang);
                 Zend_Registry::set('Zend_Translate', $translator);
             }
             $this->_session->nextStep = 1;
         }
         if ($this->_session->nextStep !== null) {
             return $this->forward('step' . $this->_session->nextStep);
         }
     }
     $this->forward('step1');
 }
示例#30
0
 public function init()
 {
     $cookie_timeout = 60 * 60 * 24;
     $garbage_timeout = $cookie_timeout + 600;
     $aServerName = explode('.', $_SERVER['SERVER_NAME']);
     $count = count($aServerName);
     $domainName = '.' . $aServerName[$count - 2] . '.' . $aServerName[$count - 1];
     //session_set_cookie_params($cookie_timeout, '/', $domainName);
     session_set_cookie_params(0, '/', $domainName);
     ini_set('session.gc_maxlifetime', $garbage_timeout);
     ini_set('session.cookie_lifetime', $garbage_timeout);
     //		$session = new Zend_Session_Namespace();
     $options = array_change_key_case($this->getOptions(), CASE_LOWER);
     if (isset($options['adapter'])) {
         $adapter = $options['adapter'];
     }
     switch (strtolower($adapter)) {
         case 'remote':
         case 'proxydb':
             $sessionHandler = new Pandamp_Session_SaveHandler_Remote();
             Zend_Session::setSaveHandler($sessionHandler);
             //$this->_saveHandler = $sessionHandler;
             //return $sessionHandler;
             break;
         default:
         case 'directdb':
             $sessionHandler = new Pandamp_Session_SaveHandler_DirectDb($options['db']['adapter'], $options['db']['params']);
             Zend_Session::setSaveHandler($sessionHandler);
             $this->_saveHandler = $sessionHandler;
             return $sessionHandler;
             break;
     }
 }