本文整理汇总了PHP中Zend_Session::namespaceUnset方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Session::namespaceUnset方法的具体用法?PHP Zend_Session::namespaceUnset怎么用?PHP Zend_Session::namespaceUnset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Session
的用法示例。
在下文中一共展示了Zend_Session::namespaceUnset方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateUserLocal
/**
* @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());
}
}
示例2: indexAction
public function indexAction()
{
// shares/avatar files are deleted by an off-line routine in crontab
$request = $this->getRequest();
$registry = Zend_Registry::getInstance();
$auth = Zend_Auth::getInstance();
$credential = Ml_Model_Credential::getInstance();
$peopleDelete = Ml_Model_PeopleDelete::getInstance();
$signedUserInfo = $registry->get("signedUserInfo");
$form = $peopleDelete->deleteAccountForm();
if ($request->isPost()) {
$credentialInfo = $credential->getByUid($auth->getIdentity());
if (!$credentialInfo) {
throw new Exception("Fatal error on checking credential in account delete controller.");
}
$registry->set('credentialInfoDataForPasswordChange', $credentialInfo);
if ($form->isValid($request->getPost())) {
$registry->set("canDeleteAccount", true);
$peopleDelete->deleteAccount($signedUserInfo, sha1(serialize($signedUserInfo)));
$auth->clearIdentity();
Zend_Session::namespaceUnset('Zend_Auth');
Zend_Session::regenerateId();
Zend_Session::destroy(true);
$this->_redirect("/account/terminated", array("exit"));
}
}
$this->view->deleteAccountForm = $form;
}
示例3: indexAction
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');
}
}
示例4: __unset
public function __unset($name)
{
if (array_key_exists($name, $this->_data)) {
unset($this->_data[$name]);
Zend_Session::namespaceUnset($name);
}
}
示例5: tearDown
public function tearDown()
{
if (isset($this->savePath)) {
Zend_Session::setOptions(array('save_path' => $this->savePath));
unset($this->savePath);
}
$old = error_reporting(E_ALL | E_STRICT);
$this->assertTrue($old === error_reporting(E_ALL | E_STRICT), 'something associated with a particular test altered error_reporting to something other than E_STRICT');
restore_error_handler();
Zend_Session_Namespace::unlockAll();
// @todo: cleanup
if (count($this->error_list)) {
echo "**** Errors: ";
print_r($this->error_list);
}
// unset all namespaces
foreach (Zend_Session::getIterator() as $space) {
try {
Zend_Session::namespaceUnset($space);
} catch (Zend_Session_Exception $e) {
$this->assertRegexp('/read.only/i', $e->getMessage());
return;
}
}
}
示例6: init
public function init()
{
parent::init();
$ns = new Zend_Session_Namespace('user');
$general = new Application_Model_General();
$statUser = $general->veriStatUser($ns->data);
if (!empty($ns->data)) {
$this->view->firstname = $ns->data['firstname_user'];
$this->view->lastname = $ns->data['lastname_user'];
$this->view->lvl = $ns->data['id_rank'];
}
if ($statUser == 1 or $statUser == 2) {
$this->view->isadmin = $statUser;
} else {
if ($statUser == 3) {
Zend_Session::namespaceUnset("user");
Zend_Session::destroy(true);
$this->_redirect($this->view->url(array('controller' => 'index', 'action' => 'acces'), null, true));
}
}
$this->category = new Application_Model_Category();
if ($this->_getParam('message') != null) {
$this->view->message = "Modification sauvegarder";
}
}
示例7: logoutAction
public function logoutAction()
{
Zend_Auth::getInstance()->clearIdentity();
Zend_Session::namespaceUnset('Catchpoint');
$this->_helper->redirector('index');
// back to login page
}
示例8: logoutAction
public function logoutAction()
{
$auth = Zend_Auth::getInstance();
$auth->clearIdentity();
Zend_Session::namespaceUnset("siteInfoNamespace");
$this->_helper->redirector('login', 'auth');
}
示例9: clear
public function clear()
{
if ($this->getAuth()->getIdentity()->Ruolo == 'staff') {
Zend_Session::namespaceUnset('staff');
}
$this->getAuth()->clearIdentity();
}
示例10: listAction
/**
* 一覧
*/
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;
}
示例11: indexAction
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');
}
}
示例12: _logout
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();
}
示例13: preDispatch
/**
* preDispatch
*
* @param Zend_Controller_Request_Abstract $request
*/
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$storage = new Zend_Auth_Storage_Session();
$data = $storage->read();
$this->_controller = $this->getRequest()->getControllerName();
$this->_module = $this->getRequest()->getModuleName();
$this->_action = $this->getRequest()->getActionName();
$withoutloginActionArr = array('index', 'login', 'loginsave', 'loginpopupsave', 'forgotpassword', 'editforgotpassword', 'sendpassword', 'popup');
if ($this->_module == self::MODULE && $data['employeeId']) {
if ($this->_controller == 'index' && $this->_module == 'default' && in_array($this->_action, $withoutloginActionArr)) {
$front = Zend_Controller_Front::getInstance();
//$this->_response->setRedirect($front->getBaseUrl().'/welcome');
$this->_response->setRedirect(BASE_URL . 'welcome');
}
}
$auth = Zend_Auth::getInstance();
$redirect = '';
$withoutloginArr = array('default_cronjob_logcron', 'default_cronjob_inactiveusers', 'default_cronjob_requisition', 'default_cronjob_leaveapprove', 'default_cronjob_empexpiry', 'default_cronjob_empdocsexpiry', 'default_cronjob_index', 'default_index_index', 'default_index_loginpopupsave', 'default_index_login', 'default_index_loginsave', 'default_index_browserfailure', 'default_index_forgotpassword', 'default_index_editforgotpassword', 'default_index_sendpassword', 'default_index_popup', 'services_index_index', 'services_index_post', 'services_index_get', 'services_index_login', 'timemanagement_cronjob_index', 'timemanagement_cronjob_mailreminder', 'timemanagement_cronjob_monthlyempblockremainder', 'timemanagement_cronjob_monthlyblockedemp');
$contolleractionstring = $this->_module . '_' . $this->_controller . '_' . $this->_action;
if (!in_array($contolleractionstring, $withoutloginArr)) {
if ($this->_isAuth($auth)) {
$user = $auth->getStorage()->read();
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
$db = $bootstrap->getResource('db');
$redirect = "session";
} else {
$redirect = "nosession";
}
}
if ($redirect == 'nosession') {
if ($this->getRequest()->isXmlHttpRequest()) {
$auth = Zend_Auth::getInstance();
Zend_Session::namespaceUnset('recentlyViewed');
Zend_Session::namespaceUnset('prevUrl');
$auth->clearIdentity();
$content = array('login' => 'failed');
$jsonData = Zend_Json::encode($content);
$this->getResponse()->setHeader('Content-Type', 'text/json')->setBody($jsonData)->sendResponse();
exit;
} else {
/*** Previous URL redirection after login - start ***/
$prevUrl = new Zend_Session_Namespace('prevUrl');
$prevUrl->prevUrlObject = array();
array_push($prevUrl->prevUrlObject, $_SERVER['REQUEST_URI']);
/*** Previous URL redirection after login - end ***/
Zend_Session::namespaceUnset('recentlyViewed');
$auth = Zend_Auth::getInstance();
$auth->clearIdentity();
$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
$redirector->gotoUrl('/')->redirectAndExit();
}
}
}
示例14: get
/**
* returns the saved data
* if persist false this deletes the data from the storage
*
* @param bool $persist
* @return array
*/
public function get($persist = false)
{
if (!empty($this->_storage->data)) {
$data = new stdClass();
foreach ($this->_storage->data as $k => $v) {
$data->{$k} = $v;
}
if (!$persist) {
Zend_Session::namespaceUnset('dataStorage');
}
return $data;
}
}
示例15: generatePageMessage
/**
* Generates the page messages to display on client browser
*
* Note: The default level for message is sets to 'info'.
* See the {@link set_page_message()} function for more information.
*
* @param iMSCP_pTemplate $tpl iMSCP_pTemplate instance
* @return void
*/
function generatePageMessage($tpl)
{
$namespace = new Zend_Session_Namespace('pageMessages');
if (Zend_Session::namespaceIsset('pageMessages')) {
foreach (array('success', 'error', 'warning', 'info', 'static_success', 'static_error', 'static_warning', 'static_info') as $level) {
if (isset($namespace->{$level})) {
$tpl->assign(array('MESSAGE_CLS' => $level, 'MESSAGE' => $namespace->{$level}));
$tpl->parse('PAGE_MESSAGE', '.page_message');
}
}
Zend_Session::namespaceUnset('pageMessages');
} else {
$tpl->assign('PAGE_MESSAGE', '');
}
}