Subversion Repositories SmartDukaan

Rev

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

Rev 11631 Rev 11677
Line 238... Line 238...
238
			$this->session->unset_userdata('captcha');
238
			$this->session->unset_userdata('captcha');
239
			redirect(base_url().'home');
239
			redirect(base_url().'home');
240
 
240
 
241
		}
241
		}
242
	}
242
	}
-
 
243
 
-
 
244
	function changePassword()
-
 
245
  {
-
 
246
    //standard array
-
 
247
    $data = array();
-
 
248
    $authorized = $this->session->userdata('authorized');
-
 
249
    // if(isset($authorized) && !empty($authorized) && $authorized['isLoggedIn'] == 1){
-
 
250
      // redirect(base_url().'home');
-
 
251
    // }
-
 
252
    //get cache 
-
 
253
    $authorized = $this->session->userdata('authorized');
-
 
254
    if(isset($_POST) && !empty($_POST)){
-
 
255
      // print_r($_POST);
-
 
256
      // die();
-
 
257
    if(isset($authorized) && !empty($authorized)){
-
 
258
      $_POST['userId'] = $authorized['Id'];
-
 
259
      $_POST['cartId'] = $authorized['cartId'];
-
 
260
      if($authorized['isLoggedIn'] == 1){
-
 
261
        $_POST['isLoggedIn'] = 'true';
-
 
262
      }
-
 
263
      elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
-
 
264
      $_POST['isLoggedIn'] = 'false';
-
 
265
      }
-
 
266
    }
-
 
267
      //end of get cache
-
 
268
      $configdata =array();
-
 
269
      $configdata = $this->config->item('change_password');
-
 
270
      unset($configdata['response'][0]);
-
 
271
      $data['response']=$this->oauth_model->getLogin($this->input->get(),$this->input->post(),$configdata);
-
 
272
      //set cache to output or renew cache
-
 
273
      if(isset($data['response']['response']['changePassword']))
-
 
274
      {
-
 
275
        $this->lessphp->object()->ccompile('assets/css/auth.less','assets/css/auth.css');
-
 
276
        $data['title'] = 'Saholic';
-
 
277
        $data['stylesheet'] = 'auth.css';
-
 
278
        $this->layout->view(strtolower(__CLASS__).'/oauth_view',$data);
-
 
279
 
-
 
280
      }
-
 
281
      else
-
 
282
      {
-
 
283
        $this->lessphp->object()->ccompile('assets/css/auth.less','assets/css/auth.css');
-
 
284
        $data['title'] = 'Saholic';
-
 
285
        $data['stylesheet'] = 'auth.css';
-
 
286
        $this->layout->view(strtolower(__CLASS__).'/oauth_view',$data);
-
 
287
      }
-
 
288
    }
-
 
289
    else{
-
 
290
      // echo 'inside else';
-
 
291
      // die();
-
 
292
      $configdata =array();
-
 
293
      $configdata = $this->config->item('change_password');
-
 
294
      unset($configdata['response'][1]);
-
 
295
      $cachemodule = array('header','footer','response');
-
 
296
      $configdata = getCache($configdata,$cachemodule);
-
 
297
      $data = array();
-
 
298
      $data['response']=$this->oauth_model->getLogin($this->input->get(),$this->input->post(),$configdata['module']);
-
 
299
      $this->lessphp->object()->ccompile('assets/css/auth.less','assets/css/auth.css');
-
 
300
      $data['title'] = 'Saholic';
-
 
301
      $data['stylesheet'] = 'auth.css';
-
 
302
      if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
-
 
303
      {
-
 
304
        foreach($cachemodule as $cm)
-
 
305
        {
-
 
306
          if(isset($configdata[$cm]) and !empty($configdata[$cm]))
-
 
307
          {
-
 
308
            $data['response'][$cm]=$configdata[$cm];
-
 
309
          }
-
 
310
        }
-
 
311
      }
-
 
312
      setCache($configdata['module'],$cachemodule,$data['response']);
-
 
313
      $this->layout->view(strtolower(__CLASS__).'/changePassword',$data);
-
 
314
    }
-
 
315
  }
-
 
316
  
243
	function forgotPassword($email)
317
	function forgotPassword($email)
244
	{
318
	{
245
 
319
 
246
		$authorized = $this->session->userdata('authorized');
320
		$authorized = $this->session->userdata('authorized');
247
		if(!isset($authorized['isLoggedIn']) || ($authorized['isLoggedIn'] != 1))
321
		if(!isset($authorized['isLoggedIn']) || ($authorized['isLoggedIn'] != 1))