Subversion Repositories SmartDukaan

Rev

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

Rev 20127 Rev 20139
Line 20... Line 20...
20
	public $apihost;	
20
	public $apihost;	
21
	public $livepriceurl;
21
	public $livepriceurl;
22
 
22
 
23
	public function beforeFilter() {
23
	public function beforeFilter() {
24
		parent::beforeFilter();
24
		parent::beforeFilter();
25
		$this->Auth->allow('bycategory','category','mine','getdeals','getliveprice','search','filter','skus');
25
// 		$this->Auth->allow('bycategory','category','mine','getdeals','getliveprice','search','filter','skus');
-
 
26
		$this->Auth->allow('bycategory','category','getdeals','getliveprice');
26
		$callback = $this->request->query('callback');	
27
		$callback = $this->request->query('callback');	
27
		$this->livepriceurl = Configure::read('livepriceurl');	
28
		$this->livepriceurl = Configure::read('livepriceurl');	
28
	}
29
	}
29
 
30
 
30
	public function filter($type='brand',$categoryId=3){
31
	public function filter($type='brand',$categoryId=3){
Line 510... Line 511...
510
	public function admin_genurl() {
511
	public function admin_genurl() {
511
 
512
 
512
	}
513
	}
513
 
514
 
514
	public function skus($bundleIds) {
515
	public function skus($bundleIds) {
515
		$userId = $this->request->query('user_id');
516
// 		$userId = $this->request->query('user_id');
516
		if(isset($userId) && !empty($userId)) {
517
// 		if(isset($userId) && !empty($userId)) {
517
			$this->loadModel('User');
518
// 			$this->loadModel('User');
518
			$this->User->recursive = -1;
519
// 			$this->User->recursive = -1;
519
			$dbuser = $this->User->findById($userId);
520
// 			$dbuser = $this->User->findById($userId);
520
			$this->Auth->login($dbuser['User']);
521
// 			$this->Auth->login($dbuser['User']);
521
		}
522
// 		}
522
		//Fetch list of bundleIds from api
523
		//Fetch list of bundleIds from api
523
		$url = $this->apihost.'getDealsForNotification/'.$bundleIds;
524
		$url = $this->apihost.'getDealsForNotification/'.$bundleIds;
524
		$response = $this->make_request($url,null);
525
		$response = $this->make_request($url,null);
525
		$deals = array();
526
		$deals = array();
526
		if(!empty($response)){
527
		if(!empty($response)){