Subversion Repositories SmartDukaan

Rev

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

Rev 14787 Rev 14824
Line 14... Line 14...
14
 
14
 
15
    public function beforeFilter() {
15
    public function beforeFilter() {
16
    	parent::beforeFilter();
16
    	parent::beforeFilter();
17
    	// $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'dashboard');
17
    	// $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'dashboard');
18
    	$this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 'display','home');
18
    	$this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 'display','home');
19
        $this->Auth->allow(array('mine','login', 'forgotten_password', 'register', 'activate', 'checkemail','checkfbuser','registertwitteruser','skipmobileverification','reauthenticate','edit','mywallet','admin_index')); 
19
        $this->Auth->allow(array('mine','login', 'forgotten_password', 'register', 'activate', 'checkemail','checkfbuser','registertwitteruser','skipmobileverification','reauthenticate','edit','mywallet','admin_push')); 
20
		$this->Cookie->name = 'profittill';
20
		$this->Cookie->name = 'profittill';
21
		$this->Cookie->time = 86400*30; 
21
		$this->Cookie->time = 86400*30; 
22
		$this->Cookie->path = '/';
22
		$this->Cookie->path = '/';
23
		$this->Cookie->key = 'qSI232qs*&sXOw!adre@34SAv!@*(XSL#$%)asGb$@11~_+!@#H23s~#^';
23
		$this->Cookie->key = 'qSI232qs*&sXOw!adre@34SAv!@*(XSL#$%)asGb$@11~_+!@#H23s~#^';
24
		$this->Cookie->httpOnly = true;
24
		$this->Cookie->httpOnly = true;
Line 362... Line 362...
362
		if ($this->request->is('post')) {
362
		if ($this->request->is('post')) {
363
			if(empty($this->request->data['userIds'])){
363
			if(empty($this->request->data['userIds'])){
364
				$this->Session->setFlash(__('Please choose a few users'));
364
				$this->Session->setFlash(__('Please choose a few users'));
365
				$this->redirect(array('action' => 'admin_pushnotifications'));
365
				$this->redirect(array('action' => 'admin_pushnotifications'));
366
			}else{
366
			}else{
-
 
367
				$this->log(print_r($this->request->data,1),'pushnotifications');
367
				$message = $this->request->data['User'];
368
				$message = $this->request->data['User'];
368
				$this->loadModel('NotificationCampaign');
369
				$this->loadModel('NotificationCampaign');
369
				$this->NotificationCampaign->create();
370
				$this->NotificationCampaign->create();
370
				$data = array('name'=>$message['name'],'title'=>$message['title'],'type'=>$message['type'],'message'=>$message['message'],'url'=>$message['url'],'expiresat'=>$message['expiresat']);
371
				$data = array('name'=>$message['name'],'title'=>$message['title'],'type'=>$message['type'],'message'=>$message['message'],'url'=>$message['url'],'expiresat'=>$message['expiresat']);
371
				if($this->NotificationCampaign->save($data)){
372
				if($this->NotificationCampaign->save($data)){