Subversion Repositories SmartDukaan

Rev

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

Rev 13739 Rev 13740
Line 11... Line 11...
11
 
11
 
12
    public function beforeFilter() {
12
    public function beforeFilter() {
13
    	parent::beforeFilter();
13
    	parent::beforeFilter();
14
    	// $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'dashboard');
14
    	// $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'dashboard');
15
    	$this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 'display','home');
15
    	$this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 'display','home');
16
        $this->Auth->allow(array('migrate','login', 'forgotten_password', 'register', 'activate', 'checkemail','checkfbuser','registertwitteruser','skipmobileverification','reauthenticate')); 
16
        $this->Auth->allow(array('mine','login', 'forgotten_password', 'register', 'activate', 'checkemail','checkfbuser','registertwitteruser','skipmobileverification','reauthenticate')); 
17
		$this->Cookie->name = 'profittill';
17
		$this->Cookie->name = 'profittill';
18
		$this->Cookie->time = 86400*30; 
18
		$this->Cookie->time = 86400*30; 
19
		$this->Cookie->path = '/';
19
		$this->Cookie->path = '/';
20
		$this->Cookie->key = 'qSI232qs*&sXOw!adre@34SAv!@*(XSL#$%)asGb$@11~_+!@#H23s~#^';
20
		$this->Cookie->key = 'qSI232qs*&sXOw!adre@34SAv!@*(XSL#$%)asGb$@11~_+!@#H23s~#^';
21
		$this->Cookie->httpOnly = true;
21
		$this->Cookie->httpOnly = true;
Line 23... Line 23...
23
    
23
    
24
	public function bookmarklet() {
24
	public function bookmarklet() {
25
		$this->set('title_for_layout','Profittill Bookmarklet');
25
		$this->set('title_for_layout','Profittill Bookmarklet');
26
	}
26
	}
27
 
27
 
-
 
28
	public function mine() {
-
 
29
		$this->layout = 'innerpages';
-
 
30
		$userId = $this->request->query('user_id');
-
 
31
		if(isset($userId) && !empty($userId)){
-
 
32
			$this->loadModel('User');
-
 
33
			$dbuser = $this->User->findById($userId);
-
 
34
			$this->Auth->login($dbuser['User']);
-
 
35
		}
-
 
36
		$this->checkMobileNumber();
-
 
37
		$this->set('user',$dbuser);
-
 
38
	}
-
 
39
 
28
	function registertwitteruser(){
40
	function registertwitteruser(){
29
		$this->twitterObj->setToken($_GET['oauth_token']);
41
		$this->twitterObj->setToken($_GET['oauth_token']);
30
		$token = $this->twitterObj->getAccessToken();
42
		$token = $this->twitterObj->getAccessToken();
31
		$this->twitterObj->setToken($token->oauth_token, $token->oauth_token_secret);
43
		$this->twitterObj->setToken($token->oauth_token, $token->oauth_token_secret);
32
		$twitterInfo= $this->twitterObj->get_accountVerify_credentials();
44
		$twitterInfo= $this->twitterObj->get_accountVerify_credentials();