Subversion Repositories SmartDukaan

Rev

Rev 20022 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20022 Rev 20104
Line 17... Line 17...
17
	public $apihost;
17
	public $apihost;
18
	public $limit;
18
	public $limit;
19
 
19
 
20
	public function beforeFilter() {
20
	public function beforeFilter() {
21
		parent::beforeFilter();
21
		parent::beforeFilter();
22
		$this->Auth->allow('deals');
22
//		$this->Auth->allow('deals');
23
		$this->apihost = Configure::read('pythonapihost');
23
		$this->apihost = Configure::read('pythonapihost');
24
		$this->limit = Configure::read('dealsperpage');
24
		$this->limit = Configure::read('dealsperpage');
25
		$this->mobileapi = Configure::read('saholicapihost');
25
		$this->mobileapi = Configure::read('saholicapihost');
26
		setcookie("fresh", '1', null, '/');
26
		setcookie("fresh", '1', null, '/');
27
		
27
		
Line 123... Line 123...
123
	public function view($id = null) {
123
	public function view($id = null) {
124
		$arrSubCategory = Configure::read('arrSubCategory');
124
		$arrSubCategory = Configure::read('arrSubCategory');
125
		$userId = $this->request->query('user_id');
125
		$userId = $this->request->query('user_id');
126
// 		$dealpin = $this->getpin();
126
// 		$dealpin = $this->getpin();
127
// 		$this->set(compact('dealpin'));
127
// 		$this->set(compact('dealpin'));
128
	
128
 
129
		if(isset($userId) && !empty($userId)) {
-
 
130
			$this->loadModel('User');
-
 
131
			$dbuser = $this->User->findById($userId);
-
 
132
			$this->Auth->login($dbuser['User']);
-
 
133
		}
-
 
134
		$version = $this->request->query('version');
129
		$version = $this->request->query('version');
135
		if(isset($version) && !isset($_COOKIE['version'])){
130
		if(isset($version) && !isset($_COOKIE['version'])){
136
				setcookie('version', $version, time() + (86400 * 30), "/");
131
				setcookie('version', $version, time() + (86400 * 30), "/");
137
		}
132
		}
138
		
133