Subversion Repositories SmartDukaan

Rev

Rev 12763 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12763 Rev 12770
Line 54... Line 54...
54
 
54
 
55
	function login()
55
	function login()
56
	{
56
	{
57
		//standard array
57
		//standard array
58
		$data = array();
58
		$data = array();
59
/*
59
 
60
		 if (isset($_SERVER['HTTP_REFERER'])) {
-
 
61
			if ((strpos($_SERVER['HTTP_REFERER'],'login') == false) && (strpos($_SERVER['HTTP_REFERER'],'register') == false)) {
-
 
62
   				$redirect = $_SERVER['HTTP_REFERER'];   				
-
 
63
   				$location = $this->session->userdata('location');
-
 
64
   				if(isset($location) && $location == 'shipping'){
-
 
65
   					$data['location'] = 'shipping';
-
 
66
   					$location = base_url().$location;
-
 
67
   					$this->session->set_userdata('location',$location);
-
 
68
   				}elseif(isset($location) && ($location == 'my-recharges' || $location == 'my-wallet')){
-
 
69
   					$location = base_url().$location;
-
 
70
   					$this->session->set_userdata('location',$location);
-
 
71
   				}else{
-
 
72
   					$this->session->set_userdata('location',$redirect);	
-
 
73
   				}
-
 
74
   				
-
 
75
			}
-
 
76
		}
-
 
77
*/
-
 
78
		$fosauthorized = $this->session->userdata('fosauthorized');
60
		$fosauthorized = $this->session->userdata('fosauthorized');
79
		if(isset($fosauthorized) && !empty($fosauthorized) && $fosauthorized['isLoggedIn'] == 1){
61
		if(isset($fosauthorized) && !empty($fosauthorized) && $fosauthorized['isLoggedIn'] == 1){
80
			redirect(base_url().'fos/dashboard');
62
			redirect(base_url().'fos/dashboard');
81
		}
63
		}
82
		//get cache 
64
		//get cache 
Line 140... Line 122...
140
			}
122
			}
141
			setCache($configdata['module'],$cachemodule,$data['response']);
123
			setCache($configdata['module'],$cachemodule,$data['response']);
142
			$this->layout->view(strtolower(__CLASS__).'/login',$data);
124
			$this->layout->view(strtolower(__CLASS__).'/login',$data);
143
		}
125
		}
144
	}
126
	}
145
/*
127
 
146
	function logout() {
-
 
147
		$fosauthorized = $this->session->userdata('fosauthorized');
-
 
148
		if(isset($fosauthorized) and !empty($fosauthorized))
-
 
149
		{
-
 
150
			$this->session->unset_userdata('fosauthorized');
-
 
151
			$this->session->unset_userdata('authorized');
-
 
152
			$this->session->unset_userdata('addressId');
-
 
153
			$this->session->unset_userdata('hotspotId');
-
 
154
			$this->session->unset_userdata('cod');
-
 
155
			$this->session->unset_userdata('userId');
-
 
156
			$this->session->unset_userdata('captcha');
-
 
157
			redirect(base_url().'home');
-
 
158
		}
-
 
159
	}
-
 
160
*/
-
 
161
	function changeuser() {
128
	function changeuser() {
162
		$authorized = $this->session->userdata('authorized');
129
		$authorized = $this->session->userdata('authorized');
163
		if(isset($authorized) and !empty($authorized))
130
		if(isset($authorized) and !empty($authorized))
164
		{
131
		{
165
			$this->session->unset_userdata('authorized');
132
			$this->session->unset_userdata('authorized');
Line 183... Line 150...
183
		}
150
		}
184
 
151
 
185
		//get cache 
152
		//get cache 
186
		$fosauthorized = $this->session->userdata('fosauthorized');
153
		$fosauthorized = $this->session->userdata('fosauthorized');
187
		if(isset($_POST) && !empty($_POST)) {
154
		if(isset($_POST) && !empty($_POST)) {
188
			/*if(isset($fosauthorized) && !empty($fosauthorized)) {
-
 
189
				$_POST['userId'] = $fosauthorized['Id'];
-
 
190
				if($fosauthorized['isLoggedIn'] == 1){
-
 
191
					$_POST['isLoggedIn'] = 'true';
-
 
192
				}
-
 
193
				elseif(isset($fosauthorized['isLoggedIn']) && empty($fosauthorized['isLoggedIn'])) {
-
 
194
					$_POST['isLoggedIn'] = 'false';
-
 
195
				}
-
 
196
			}*/	
-
 
197
		
-
 
198
			$configdata =array();
155
			$configdata =array();
199
			$configdata = $this->config->item('fos_signupcounter');
156
			$configdata = $this->config->item('fos_signupcounter');
200
			unset($configdata['response'][0]);
157
			unset($configdata['response'][0]);
201
			$data['response']=$this->fos_model->getSignup($this->input->get(),$this->input->post(),$configdata);
158
			$data['response']=$this->fos_model->getSignup($this->input->get(),$this->input->post(),$configdata);
202
			//set cache to output or renew cache
159
			//set cache to output or renew cache
Line 210... Line 167...
210
			else
167
			else
211
			{
168
			{
212
				$this->lessphp->object()->ccompile('assets/css/shipping.less','assets/css/shipping.css');
169
				$this->lessphp->object()->ccompile('assets/css/shipping.less','assets/css/shipping.css');
213
				$data['title'] = 'Saholic';
170
				$data['title'] = 'Saholic';
214
				$data['stylesheet'] = 'auth.css';
171
				$data['stylesheet'] = 'auth.css';
215
				$this->session->set_flashdata(array('msg'=>$data['response']['response']['messsage']));
172
				$this->session->set_flashdata(array('msg'=>$data['response']['response']['fossignup']['msg']));
216
				redirect(base_url().$data['response']['response']['fossignup']['redirect']);	
173
				redirect(base_url().$data['response']['response']['fossignup']['redirect']);	
217
			}
174
			}
218
		} else {
175
		} else {
219
			$configdata =array();
176
			$configdata =array();
220
			$configdata = $this->config->item('fossignup');
177
			$configdata = $this->config->item('fossignup');
Line 234... Line 191...
234
					{
191
					{
235
						$data['response'][$cm]=$configdata[$cm];
192
						$data['response'][$cm]=$configdata[$cm];
236
					}
193
					}
237
				}
194
				}
238
			}
195
			}
-
 
196
			$data['response']['msg'] = $this->session->flashdata('msg');
239
			setCache($configdata['module'],$cachemodule,$data['response']);
197
			setCache($configdata['module'],$cachemodule,$data['response']);
240
			$this->layout->view(strtolower(__CLASS__).'/signupcounter',$data);
198
			$this->layout->view(strtolower(__CLASS__).'/signupcounter',$data);
241
		}
199
		}
242
    }
200
    }
243
 
201