本文整理汇总了PHP中Zend_Session_Namespace::__set方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Session_Namespace::__set方法的具体用法?PHP Zend_Session_Namespace::__set怎么用?PHP Zend_Session_Namespace::__set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Session_Namespace
的用法示例。
在下文中一共展示了Zend_Session_Namespace::__set方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __set
public function __set($name, $value)
{
if (is_object($value)) {
$value = serialize($value);
}
parent::__set($name, $value);
}
示例2: checkUserLogged
function checkUserLogged($id)
{
$model = new Model_User();
$woeid = $model->CheckWoeidUser($id);
//set the cookie woeid to ddb value
setcookie('location', $woeid, null, '/');
//set the woeid value into session
$aNamespace = new Zend_Session_Namespace('Nolotiro');
$aNamespace->__set(location, $woeid);
return $woeid;
}
示例3: getSplash
public static function getSplash()
{
$ss = new Zend_Session_Namespace('Splash');
$mesage = $ss->__get('splash');
if ($mesage['message']) {
$html = ' <div id="splash" class="response-msg ' . $mesage['code'] . ' ui-corner-all" style="width:40%;margin:0 auto;">' . $mesage['message'] . '</div>
<script>
setTimeout(\'$("#splash").fadeOut("slow")\',' . $mesage['timer'] . ');
</script>';
}
$ss->__set('splash', array());
return $html;
}
示例4: indexAction
/**
* Request to login a user comes to this method
*/
public function indexAction()
{
$auth = Zend_Auth::getInstance();
$auth->setStorage(new Zend_Auth_Storage_Session('user'));
//If user is already loged in redirect him to dash board.
if ($auth->hasIdentity()) {
$this->_redirect('patient/orders');
}
$this->_helper->layout->setLayout('login');
$forms = Zend_Registry::get('forms');
$form = new Zend_Form($forms->user->login);
$userManagement = new Application_Model_User();
if ($this->getRequest()->isPost()) {
$data = $this->getRequest()->getPost();
$error = array();
if ($form->isValid($data)) {
$userName = $form->username->getValue();
$password = $form->password->getValue();
$remember = $this->_request->getParam('remember', 0);
$userTable = new Application_Model_DbTable_User();
$userExits = $userTable->fetchRow('username = "' . $userName . '" AND password= "' . md5($password) . '" AND deleted_at IS NULL');
$magUser = false;
if (!empty($userExits)) {
$userExits = $userExits->toArray();
if ($userExits['id'] == 0 || $userExits['id'] == '') {
$magUser = true;
}
$session = new Zend_Session_Namespace('userObj');
$session->__set('userObj', $userExits);
}
if ($magUser) {
$form->username->setErrors(array('Invalid username or password'));
} else {
$response = $userManagement->login($userName, md5($password), $remember);
}
if ($response == 'success') {
$this->_redirect('patient/orders');
} else {
$form->username->setErrors(array('Invalid username or password'));
}
}
}
$this->view->form = $form;
}
示例5: changeAction
public function changeAction()
{
$request = $this->getRequest();
$form = $this->_getLocationChangeForm();
$this->view->page_title .= $this->view->translate('change location');
$this->view->suggestIP = $this->_helper->getLocationGeoIP->suggest();
if ($this->getRequest()->isPost()) {
if ($form->isValid($request->getPost())) {
$formulario = $form->getValues();
//convert to lowercase and clean spaces
$formulario['location'] = ucfirst(mb_convert_case(trim($formulario['location']), MB_CASE_LOWER, "UTF-8"));
$aNamespace = new Zend_Session_Namespace('Nolotiro');
$aNamespace->__set(locationTemp, $formulario['location']);
$this->_redirect('/' . $this->view->lang . '/location/change2');
}
}
// assign the form to the view
$this->view->form = $form;
}
示例6: resetSession
/**
* reset session with default values
* from config file
*
* @return void
*/
public function resetSession($usedatabase = false)
{
// get session object
$this->session = new Zend_Session_Namespace("base");
// get default values
$default = Zend_Registry::get('bootstrap')->getOptions();
$default = $default["session"]["default"];
// initialize values using values in database or default values
if ($usedatabase === false) {
foreach ($default as $key => $value) {
$this->session->__set($key, $value);
}
} else {
foreach ($default as $key => $value) {
$this->session->__set($key, $this->initializeSessionValue($key, $value));
}
}
// always load public value from database
$this->session->__set('public', $this->initializeSessionValue('public', 0));
// set language
$this->language->setLocale(new Zend_Locale($this->session->language));
// save session object for further use
Zend_Registry::set('session', $this->session);
}
示例7: groupaccountAction
public function groupaccountAction()
{
$dbobj = new Groupmdefault_Model_Groupdefault();
$result = "";
$member_id = $_POST['member_id'];
$group_head = $_POST['memberhead'];
$representative_id = $_POST['representatives'];
// $latitude = $this->_request->getParam('latitude');
// $longitude = $this->_request->getParam('longitude');
$grouptypeid = $this->_request->getParam('grouptype');
$membertypeid = $grouptypeid;
$office_id = $this->_request->getParam('office');
$groupname = $this->_request->getParam('groupname');
$createddate = $this->_request->getParam('Created_Date');
$savingamt = $this->_request->getParam('savingamt');
$bank = $this->_request->getParam('bank');
$branch = $this->_request->getParam('branch');
$penaltyabsence = $this->_request->getParam('penaltyabsence');
$penaltylate = $this->_request->getParam('penaltylate');
$interest = $this->_request->getParam('interest');
$place = $this->_request->getParam('place');
$times = $this->_request->getParam('times');
$day = $this->_request->getParam('day');
$sessionName = new Zend_Session_Namespace('groupsession');
if ($grouptypeid) {
$sessionName->__set('grouptype', $grouptypeid);
}
if ($office_id) {
$sessionName->__set('office', $office_id);
}
if ($groupname) {
$sessionName->__set('groupname', $groupname);
}
if ($bank) {
$sessionName->__set('bank', $bank);
}
if ($createddate) {
$sessionName->__set('Created_Date', $createddate);
}
// if($latitude){
// $sessionName->__set('latitude',$latitude);
// // }
// if($longitude){
// $sessionName->__set('longitude',$longitude);
// }
if ($savingamt) {
$sessionName->__set('savingamt', $savingamt);
}
if ($penaltyabsence) {
$sessionName->__set('penaltyabsence', $penaltyabsence);
}
if ($penaltylate) {
$sessionName->__set('penaltylate', $penaltylate);
}
if ($interest) {
$sessionName->__set('interest', $interest);
}
if ($place) {
$sessionName->__set('place', $place);
}
if ($times) {
$sessionName->__set('times', $times);
}
if ($day) {
$sessionName->__set('day', $day);
}
$headers = array('Absense', 'Late');
$description = array('Penalty for absense', 'Penalty for late');
$countreps = count($representative_id);
$memberids = array();
$famid = array();
$memid = array();
$countvalues = array();
foreach ($member_id as $memberid) {
$memberids[] = explode('_', $memberid);
}
foreach ($memberids as $Memberids) {
$famid[] = $Memberids[0];
$memid[] = $Memberids[1];
}
$results = array_diff($representative_id, $memid);
$error = 0;
if (in_array($group_head, $memid)) {
$result = "ok";
if ($results) {
$error = "3";
$result = "not ok";
}
if ($countreps > 3) {
$error = "4";
$result = "not ok";
}
if (!$branch) {
$error = "5";
$result = "not ok";
} else {
$countvalues[] = array_count_values($famid);
foreach ($countvalues[0] as $key => $value) {
if ($value > 1) {
$result = "not ok";
//.........这里部分代码省略.........
示例8: loginAction
function loginAction()
{
$this->_helper->layout->disableLayout();
Zend_Date_Cities::getCityList();
$form = new App_Form_Login();
$this->view->form = $form;
$this->view->message = '';
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_StripTags');
$filter = new Zend_Filter_StripTags();
$username = $filter->filter($this->_request->getPost('username'));
$password = $filter->filter($this->_request->getPost('password'));
if (empty($username)) {
$this->view->message = 'Please provide a username.';
} else {
// setup Zend_Auth adapter for a database table
Zend_Loader::loadClass('Zend_Auth_Adapter_DbTable');
$db = Zend_Db_Table::getDefaultAdapter();
$authAdapter = new Zend_Auth_Adapter_DbTable($db);
$authAdapter->setTableName('ourbank_user');
$authAdapter->setIdentityColumn('username');
$authAdapter->setCredentialColumn('password');
$authAdapter->setIdentity($username);
$authAdapter->setCredential($password);
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authAdapter);
if ($result->isValid()) {
$data = $authAdapter->getResultRowObject(null, 'password');
$auth->getStorage()->write($data);
$userinfo = new App_Model_Users();
$getresult = $userinfo->userinfo($username);
foreach ($getresult as $getdata) {
$user_id = $getdata["id"];
$username = $getdata["name"];
}
$sessionName = new Zend_Session_Namespace('ourbank');
$sessionName->__set('primaryuserid', $user_id);
$sessionName->primaryuserid;
$sessionName->__set('username', $username);
$sessionName->username;
$globalsession = new App_Model_Users();
$this->view->globalvalue = $globalsession->getSession();
$sessionName->__set('language', $this->view->globalvalue[1]);
$this->_redirect('/index/index');
} else {
$this->view->message = 'Login failed.';
}
}
}
$this->view->title = "Log in";
$this->render();
}
示例9: __set
/**
* @see Zend_Session_Namespace::applySet()
*/
public function __set($name, $value)
{
if ($this->_persistObject) {
if (isset(self::$_namespaceLocks[$this->_namespace])) {
/**
* @see Zend_Session_Exception
*/
require_once 'Zend/Session/Exception.php';
throw new Zend_Session_Exception('This session/namespace has been marked as read-only.');
}
if ($name === '') {
/**
* @see Zend_Session_Exception
*/
require_once 'Zend/Session/Exception.php';
throw new Zend_Session_Exception("The '{$name}' key must be a non-empty string");
}
if (parent::$_writable === false) {
/**
* @see Zend_Session_Exception
*/
require_once 'Zend/Session/Exception.php';
throw new Zend_Session_Exception(parent::_THROW_NOT_WRITABLE_MSG);
}
if (!isset($_SESSION[$this->_namespace])) {
$_SESSION[$this->_namespace] = new stdClass();
}
if (!is_object($_SESSION[$this->_namespace])) {
$_SESSION[$this->_namespace] = new stdClass();
}
$_SESSION[$this->_namespace]->{$name} = $value;
return;
}
parent::__set($name, $value);
}
示例10: loginAction
public function loginAction()
{
$this->_helper->layout->disableLayout();
if ($this->getRequest()->isPost()) {
$email = $this->getRequest()->getParam('username');
$password = $this->getRequest()->getParam('password');
if ($email && $password) {
$Members = Members::setLogin($email, $password);
if ($Members) {
$Members->setLastLogin();
$ss = new Zend_Session_Namespace('member');
$ss->__set('Member', $Members);
$ss->__set('Role', Zend_Json::decode(Groups::getById($Members->member_type)->role));
// $ss->Member = $Members;
// $ss->Role = Zend_Json::decode ( Groups::getById ( $Members->member_type )->role );
$this->_redirect('admin');
} else {
$this->view->error = 'Login incorrect';
}
} else {
$this->view->error = 'Login: usename and password is required!';
}
}
}