Subversion Repositories SmartDukaan

Rev

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

Rev 11108 Rev 11171
Line 81... Line 81...
81
				elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
81
				elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
82
				$_POST['isLoggedIn'] = 'false';
82
				$_POST['isLoggedIn'] = 'false';
83
				}
83
				}
84
			}
84
			}
85
			//end of get cache
85
			//end of get cache
-
 
86
			$configdata =array();
-
 
87
			$configdata = $this->config->item('oauth_login');
-
 
88
			unset($configdata['response'][0]);
86
			$data['response']=$this->oauth_model->getLogin($this->input->get(),$this->input->post(),$this->config->item('oauth_login'));
89
			$data['response']=$this->oauth_model->getLogin($this->input->get(),$this->input->post(),$configdata);
87
			//set cache to output or renew cache
90
			//set cache to output or renew cache
88
			if(isset($data['response']['response']['login']['authorized']))
91
			if(isset($data['response']['response']['login']['authorized']))
89
			{
92
			{
90
				$this->session->set_userdata('authorized',$data['response']['response']['login']['authorized']);
93
				$this->session->set_userdata('authorized',$data['response']['response']['login']['authorized']);
91
				//$this->session->set_flashdata(array('msg'=>$data['response']['response']['login']['msg']));
94
				//$this->session->set_flashdata(array('msg'=>$data['response']['response']['login']['msg']));
Line 107... Line 110...
107
				$data['stylesheet'] = 'auth.css';
110
				$data['stylesheet'] = 'auth.css';
108
				$this->layout->view(strtolower(__CLASS__).'/oauth_view',$data);
111
				$this->layout->view(strtolower(__CLASS__).'/oauth_view',$data);
109
			}
112
			}
110
		}
113
		}
111
		else{
114
		else{
-
 
115
			$configdata =array();
-
 
116
			$configdata = $this->config->item('oauth_login');
-
 
117
			unset($configdata['response'][1]);
-
 
118
			$cachemodule = array('header','footer','response');
-
 
119
			$configdata = getCache($configdata,$cachemodule);
112
			$data = array();
120
			$data = array();
113
			$data['response']=$this->oauth_model->getLogin($this->input->get(),$this->input->post(),$this->config->item('oauth_login'));
121
			$data['response']=$this->oauth_model->getLogin($this->input->get(),$this->input->post(),$configdata['module']);
114
			$this->lessphp->object()->ccompile('assets/css/auth.less','assets/css/auth.css');
122
			$this->lessphp->object()->ccompile('assets/css/auth.less','assets/css/auth.css');
115
			$data['title'] = 'Saholic';
123
			$data['title'] = 'Saholic';
116
			$data['stylesheet'] = 'auth.css';
124
			$data['stylesheet'] = 'auth.css';
-
 
125
			if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
-
 
126
			{
-
 
127
				foreach($cachemodule as $cm)
-
 
128
				{
-
 
129
					if(isset($configdata[$cm]) and !empty($configdata[$cm]))
-
 
130
					{
-
 
131
						$data['response'][$cm]=$configdata[$cm];
-
 
132
					}
-
 
133
				}
-
 
134
			}
-
 
135
			setCache($configdata['module'],$cachemodule,$data['response']);
117
			$this->layout->view(strtolower(__CLASS__).'/login',$data);
136
			$this->layout->view(strtolower(__CLASS__).'/login',$data);
118
		}
137
		}
119
	}
138
	}
120
	function signup()
139
	function signup()
121
	{
140
	{
Line 149... Line 168...
149
				elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
168
				elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
150
					$_POST['isLoggedIn'] = 'false';
169
					$_POST['isLoggedIn'] = 'false';
151
				}
170
				}
152
			}
171
			}
153
		
172
		
-
 
173
			$configdata =array();
-
 
174
			$configdata = $this->config->item('oauth_signup');
-
 
175
			unset($configdata['response'][0]);
154
			$data['response']=$this->oauth_model->getSignup($this->input->get(),$this->input->post(),$this->config->item('oauth_signup'));
176
			$data['response']=$this->oauth_model->getLogin($this->input->get(),$this->input->post(),$configdata);
155
			//set cache to output or renew cache
177
			//set cache to output or renew cache
156
			if(isset($data['response']['response']['signup']['authorized']))
178
			if(isset($data['response']['response']['signup']['authorized']))
157
			{
179
			{
158
				$this->session->set_userdata('authorized',$data['response']['response']['signup']['authorized']);
180
				$this->session->set_userdata('authorized',$data['response']['response']['signup']['authorized']);
159
				$this->session->set_flashdata(array('msg'=>$data['response']['response']['signup']['msg']));
181
				$this->session->set_flashdata(array('msg'=>$data['response']['response']['signup']['msg']));
Line 170... Line 192...
170
				$data['title'] = 'Saholic';
192
				$data['title'] = 'Saholic';
171
				$data['stylesheet'] = 'auth.css';
193
				$data['stylesheet'] = 'auth.css';
172
				$this->layout->view(strtolower(__CLASS__).'/oauth_view',$data);
194
				$this->layout->view(strtolower(__CLASS__).'/oauth_view',$data);
173
			}
195
			}
174
		}else{
196
		}else{
-
 
197
			$configdata =array();
-
 
198
			$configdata = $this->config->item('oauth_signup');
-
 
199
			unset($configdata['response'][1]);
-
 
200
			$cachemodule = array('header','footer','response');
-
 
201
			$configdata = getCache($configdata,$cachemodule);
175
			$data = array();
202
			$data = array();
176
			$data['response']=$this->oauth_model->getSignup($this->input->get(),$this->input->post(),$this->config->item('oauth_signup'));
203
			$data['response']=$this->oauth_model->getLogin($this->input->get(),$this->input->post(),$configdata['module']);
177
			$this->lessphp->object()->ccompile('assets/css/auth.less','assets/css/auth.css');
204
			$this->lessphp->object()->ccompile('assets/css/auth.less','assets/css/auth.css');
178
			$data['title'] = 'Saholic';
205
			$data['title'] = 'Saholic';
179
			$data['stylesheet'] = 'auth.css';
206
			$data['stylesheet'] = 'auth.css';
-
 
207
			if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
-
 
208
			{
-
 
209
				foreach($cachemodule as $cm)
-
 
210
				{
-
 
211
					if(isset($configdata[$cm]) and !empty($configdata[$cm]))
-
 
212
					{
-
 
213
						$data['response'][$cm]=$configdata[$cm];
-
 
214
					}
-
 
215
				}
-
 
216
			}
-
 
217
			setCache($configdata['module'],$cachemodule,$data['response']);
180
			$this->layout->view(strtolower(__CLASS__).'/signup',$data);
218
			$this->layout->view(strtolower(__CLASS__).'/signup',$data);
181
		}
219
		}
182
	}
220
	}
183
	function logout()
221
	function logout()
184
	{
222
	{