Subversion Repositories SmartDukaan

Rev

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

Rev 20492 Rev 20493
Line 1552... Line 1552...
1552
		}
1552
		}
1553
		$this->set(compact('message'));
1553
		$this->set(compact('message'));
1554
	}
1554
	}
1555
 
1555
 
1556
	public function admin_usercalled($id){
1556
	public function admin_usercalled($id){
1557
		$this->User->id = $id;
-
 
1558
		if (!$this->User->exists()) {
1557
		if($this->User->updateAll(array('status' => 2),array('id' => $id))){
1559
			throw new NotFoundException(__('Invalid user'));
1558
			$this->Session->setFlash(__('User upadated'));
1560
		} else {
1559
		} else {
1561
			if($this->User->save(array('status'=>2))){
-
 
1562
				$this->Session->setFlash(__('User upadated'));
-
 
1563
			} else {
-
 
1564
				$this->Session->setFlash(__('User could not be updated'));
1560
			$this->Session->setFlash(__('User could not be updated'));
1565
			}		
-
 
1566
		}
1561
		}
1567
		return $this->redirect($this->referer());
1562
		return $this->redirect($this->referer());
1568
	}
1563
	}
1569
	public function admin_userunreachable($id){
1564
	public function admin_userunreachable($id){
1570
		$this->User->id = $id;
-
 
1571
		if (!$this->User->exists()) {
1565
		if($this->User->updateAll(array('status' => 3),array('id' => $id))){
1572
			throw new NotFoundException(__('Invalid user'));
1566
			$this->Session->setFlash(__('User upadated'));
1573
		} else {
1567
		} else {
1574
			if($this->User->save(array('status'=>3))){
-
 
1575
				$this->Session->setFlash(__('User upadated'));
-
 
1576
			} else {
-
 
1577
				$this->Session->setFlash(__('User could not be updated'));
1568
			$this->Session->setFlash(__('User could not be updated'));
1578
			}		
-
 
1579
		}
1569
		}
1580
		return $this->redirect($this->referer());
1570
		return $this->redirect($this->referer());
1581
	}
1571
	}
1582
 
1572
 
1583
	public function getlost(){
1573
	public function getlost(){