| Line 32... |
Line 32... |
| 32 |
function __oauthorization()
|
32 |
function __oauthorization()
|
| 33 |
{
|
33 |
{
|
| 34 |
//sample session storage.. later i will imporve security for login
|
34 |
//sample session storage.. later i will imporve security for login
|
| 35 |
$check =$this->session->userdata('fosauthorize');
|
35 |
$check =$this->session->userdata('fosauthorize');
|
| 36 |
// print_r($check);die;
|
36 |
// print_r($check);die;
|
| 37 |
if(1 || isset($check) and !empty($check) and $check['authority']='success')
|
37 |
if(isset($check) and !empty($check) and $check['authority']='success')
|
| 38 |
{
|
38 |
{
|
| 39 |
redirect(base_url().'fos/signupcounter');
|
39 |
redirect(base_url().'fos/signupcounter');
|
| 40 |
}
|
40 |
}
|
| 41 |
else
|
41 |
else
|
| 42 |
{
|
42 |
{
|
| Line 76... |
Line 76... |
| 76 |
}
|
76 |
}
|
| 77 |
|
77 |
|
| 78 |
}
|
78 |
}
|
| 79 |
}
|
79 |
}
|
| 80 |
$fosauthorized = $this->session->userdata('fosauthorized');
|
80 |
$fosauthorized = $this->session->userdata('fosauthorized');
|
| 81 |
if(1 || isset($fosauthorized) && !empty($fosauthorized) && $fosauthorized['isLoggedIn'] == 1){
|
81 |
if(isset($fosauthorized) && !empty($fosauthorized) && $fosauthorized['isLoggedIn'] == 1){
|
| 82 |
redirect(base_url().'fos/dashboard');
|
82 |
redirect(base_url().'fos/dashboard');
|
| 83 |
}
|
83 |
}
|
| 84 |
//get cache
|
84 |
//get cache
|
| 85 |
$fosauthorized = $this->session->userdata('fosauthorized');
|
85 |
$fosauthorized = $this->session->userdata('fosauthorized');
|
| 86 |
if(isset($_POST) && !empty($_POST)) {
|
86 |
if(isset($_POST) && !empty($_POST)) {
|
| Line 114... |
Line 114... |
| 114 |
}
|
114 |
}
|
| 115 |
} else {
|
115 |
} else {
|
| 116 |
$this->lessphp->object()->ccompile('assets/css/auth.less','assets/css/auth.css');
|
116 |
$this->lessphp->object()->ccompile('assets/css/auth.less','assets/css/auth.css');
|
| 117 |
$data['title'] = 'Saholic';
|
117 |
$data['title'] = 'Saholic';
|
| 118 |
$data['stylesheet'] = 'auth.css';
|
118 |
$data['stylesheet'] = 'auth.css';
|
| 119 |
$this->layout->view(strtolower(__CLASS__).'/fos_view',$data);
|
119 |
// $this->layout->view(strtolower(__CLASS__).'/fos_view',$data);
|
| - |
|
120 |
redirect(base_url().'fos/login');
|
| 120 |
}
|
121 |
}
|
| 121 |
} else{
|
122 |
} else{
|
| 122 |
$configdata =array();
|
123 |
$configdata =array();
|
| 123 |
$configdata = $this->config->item('fos_login');
|
124 |
$configdata = $this->config->item('fos_login');
|
| 124 |
unset($configdata['response'][1]);
|
125 |
unset($configdata['response'][1]);
|
| Line 273... |
Line 274... |
| 273 |
}
|
274 |
}
|
| 274 |
|
275 |
|
| 275 |
//get cache
|
276 |
//get cache
|
| 276 |
$fosauthorized = $this->session->userdata('fosauthorized');
|
277 |
$fosauthorized = $this->session->userdata('fosauthorized');
|
| 277 |
if(isset($_POST) && !empty($_POST)) {
|
278 |
if(isset($_POST) && !empty($_POST)) {
|
| 278 |
if(isset($fosauthorized) && !empty($fosauthorized)) {
|
279 |
/*if(isset($fosauthorized) && !empty($fosauthorized)) {
|
| 279 |
$_POST['userId'] = $fosauthorized['Id'];
|
280 |
$_POST['userId'] = $fosauthorized['Id'];
|
| 280 |
if($fosauthorized['isLoggedIn'] == 1){
|
281 |
if($fosauthorized['isLoggedIn'] == 1){
|
| 281 |
$_POST['isLoggedIn'] = 'true';
|
282 |
$_POST['isLoggedIn'] = 'true';
|
| 282 |
}
|
283 |
}
|
| 283 |
elseif(isset($fosauthorized['isLoggedIn']) && empty($fosauthorized['isLoggedIn'])) {
|
284 |
elseif(isset($fosauthorized['isLoggedIn']) && empty($fosauthorized['isLoggedIn'])) {
|
| 284 |
$_POST['isLoggedIn'] = 'false';
|
285 |
$_POST['isLoggedIn'] = 'false';
|
| 285 |
}
|
286 |
}
|
| 286 |
}
|
287 |
}*/
|
| 287 |
|
288 |
|
| 288 |
$configdata =array();
|
289 |
$configdata =array();
|
| 289 |
$configdata = $this->config->item('fos_signupcounter');
|
290 |
$configdata = $this->config->item('fos_signupcounter');
|
| 290 |
unset($configdata['response'][0]);
|
291 |
unset($configdata['response'][0]);
|
| 291 |
$data['response']=$this->fos_model->getSignup($this->input->get(),$this->input->post(),$configdata);
|
292 |
$data['response']=$this->fos_model->getSignup($this->input->get(),$this->input->post(),$configdata);
|
| 292 |
//set cache to output or renew cache
|
293 |
//set cache to output or renew cache
|
| 293 |
if(1 || isset($data['response']['response']['signup']['fosauthorized']))
|
294 |
if(isset($data['response']['response']['fossignup']['authorized']['id']))
|
| 294 |
{
|
295 |
{
|
| 295 |
$this->session->set_userdata('fosauthorized',$data['response']['response']['signup']['fosauthorized']);
|
296 |
$this->session->set_flashdata(array('msg'=>$data['response']['response']['fossignup']['msg']));
|
| 296 |
$this->session->set_flashdata(array('msg'=>$data['response']['response']['signup']['msg']));
|
297 |
$this->session->set_userdata('username',$data['response']['response']['fossignup']['authorized']['id']);
|
| 297 |
$location = $this->session->userdata('location');
|
- |
|
| 298 |
$location = base_url()."fos/thanks";//delete me
|
- |
|
| 299 |
if(isset($location) && !empty($location)){
|
- |
|
| 300 |
$this->session->unset_userdata('location');
|
298 |
$this->session->set_userdata('countercode',$data['response']['response']['fossignup']['authorized']['counterCode']);
|
| 301 |
redirect($location);
|
- |
|
| 302 |
}
|
- |
|
| 303 |
redirect(base_url().$data['response']['response']['signup']['redirect']);
|
299 |
redirect(base_url().$data['response']['response']['fossignup']['redirect']);
|
| 304 |
}
|
300 |
}
|
| 305 |
else
|
301 |
else
|
| 306 |
{
|
302 |
{
|
| 307 |
$this->lessphp->object()->ccompile('assets/css/shipping.less','assets/css/shipping.css');
|
303 |
$this->lessphp->object()->ccompile('assets/css/shipping.less','assets/css/shipping.css');
|
| 308 |
$data['title'] = 'Saholic';
|
304 |
$data['title'] = 'Saholic';
|
| 309 |
$data['stylesheet'] = 'auth.css';
|
305 |
$data['stylesheet'] = 'auth.css';
|
| 310 |
$this->layout->view(strtolower(__CLASS__).'/fos_view',$data);
|
306 |
$this->session->set_flashdata(array('msg'=>$data['response']['response']['messsage']));
|
| - |
|
307 |
redirect(base_url().$data['response']['response']['fossignup']['redirect']);
|
| 311 |
}
|
308 |
}
|
| 312 |
} else {
|
309 |
} else {
|
| 313 |
$configdata =array();
|
310 |
$configdata =array();
|
| 314 |
$configdata = $this->config->item('fossignup');
|
311 |
$configdata = $this->config->item('fossignup');
|
| 315 |
unset($configdata['response'][1]);
|
312 |
unset($configdata['response'][1]);
|
| Line 341... |
Line 338... |
| 341 |
$configdata = getCache($configdata,$cachemodule);
|
338 |
$configdata = getCache($configdata,$cachemodule);
|
| 342 |
//end of get cache
|
339 |
//end of get cache
|
| 343 |
$this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
340 |
$this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
| 344 |
$data['stylesheet'] = 'recharge.css';
|
341 |
$data['stylesheet'] = 'recharge.css';
|
| 345 |
$data['title'] = 'Dashboard';
|
342 |
$data['title'] = 'Dashboard';
|
| - |
|
343 |
$data['username'] = $this->session->userdata('username');
|
| - |
|
344 |
$data['countercode'] = $this->session->userdata('countercode');
|
| 346 |
$data['response']=$this->fos_model->getDashboard($this->input->get(),$this->input->post(),$this->config->item('fos_dashboard'));
|
345 |
$data['response']=$this->fos_model->getDashboard($this->input->get(),$this->input->post(),$this->config->item('fos_dashboard'));
|
| 347 |
$this->layout->view(strtolower(__CLASS__).'/thanks',$data);
|
346 |
$this->layout->view(strtolower(__CLASS__).'/thanks',$data);
|
| 348 |
}
|
347 |
}
|
| 349 |
}
|
348 |
}
|
| 350 |
|
349 |
|