Subversion Repositories SmartDukaan

Rev

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

Rev 14163 Rev 14302
Line 16... Line 16...
16
	public $components = array('Paginator');
16
	public $components = array('Paginator');
17
	public $apihost;
17
	public $apihost;
18
 
18
 
19
	public function beforeFilter() {
19
	public function beforeFilter() {
20
		parent::beforeFilter();
20
		parent::beforeFilter();
21
		// $this->Auth->allow('add');
21
		$this->Auth->allow('redirecttosaholic');
22
		$this->apihost = Configure::read('pythonapihost');
22
		$this->apihost = Configure::read('pythonapihost');
23
	}
23
	}
24
/**
24
/**
25
 * index method
25
 * index method
26
 *
26
 *
Line 118... Line 118...
118
			$this->make_request($url,null);
118
			$this->make_request($url,null);
119
			$this->render('/Elements/jsonp');
119
			$this->render('/Elements/jsonp');
120
		}
120
		}
121
	}
121
	}
122
 
122
 
-
 
123
	public function redirecttosaholic() {
-
 
124
		$userId = $this->request->query('user_id');
-
 
125
		if(isset($userId) && !empty($userId)){	
-
 
126
			$next = "&next=/private-deals/1";					
-
 
127
			$redirectUrl = $this->getAutoLoginUrl($userId,$next);
-
 
128
			header('location:'.$redirectUrl);
-
 
129
			exit();
-
 
130
		}
-
 
131
	}	
-
 
132
 
123
/**
133
/**
124
 * edit method
134
 * edit method
125
 *
135
 *
126
 * @throws NotFoundException
136
 * @throws NotFoundException
127
 * @param string $id
137
 * @param string $id
Line 257... Line 267...
257
			$this->Session->setFlash(__('The click has been deleted.'));
267
			$this->Session->setFlash(__('The click has been deleted.'));
258
		} else {
268
		} else {
259
			$this->Session->setFlash(__('The click could not be deleted. Please, try again.'));
269
			$this->Session->setFlash(__('The click could not be deleted. Please, try again.'));
260
		}
270
		}
261
		return $this->redirect(array('action' => 'index'));
271
		return $this->redirect(array('action' => 'index'));
262
	}}
272
	}
-
 
273
}