Subversion Repositories SmartDukaan

Rev

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

Rev 15188 Rev 15217
Line 532... Line 532...
532
 * @throws MethodNotAllowedException
532
 * @throws MethodNotAllowedException
533
 * @throws NotFoundException
533
 * @throws NotFoundException
534
 * @param string $id
534
 * @param string $id
535
 * @return void
535
 * @return void
536
 */
536
 */
-
 
537
/*
537
	public function admin_delete($id = null) {
538
	public function admin_delete($id = null) {
538
		if (!$this->request->is('post')) {
539
		if (!$this->request->is('post')) {
539
			throw new MethodNotAllowedException();
540
			throw new MethodNotAllowedException();
540
		}
541
		}
541
		$this->User->id = $id;
542
		$this->User->id = $id;
Line 547... Line 548...
547
			$this->redirect(array('action' => 'index'));
548
			$this->redirect(array('action' => 'index'));
548
		}
549
		}
549
		$this->Session->setFlash(__('User was not deleted'));
550
		$this->Session->setFlash(__('User was not deleted'));
550
		$this->redirect(array('action' => 'index'));
551
		$this->redirect(array('action' => 'index'));
551
	}
552
	}
-
 
553
*/
-
 
554
 
-
 
555
	public function admin_search() {
-
 
556
		$type = $this->request->query('type');
-
 
557
		$search = $this->request->query('search');
-
 
558
		$this->User->recursive = -1;
-
 
559
		$options = array('limit'=>100,'order'=>array('id'=>'desc'));
-
 
560
		if(!empty($type) && !empty($search)){
-
 
561
			$options['conditions'] = array($type.' LIKE '=>"%$search%");
-
 
562
			$this->Paginator->settings = $options;
-
 
563
			$users = $this->Paginator->paginate();
-
 
564
		}		
-
 
565
		// $groups = $this->User->Group->find('list');
-
 
566
		$this->set(compact('users'));	
-
 
567
	}
552
 
568
 
553
	public function dashboard() {
569
	public function dashboard() {
554
		App::uses('CakeTime', 'Utility');
570
		App::uses('CakeTime', 'Utility');
555
		$user = $this->User->read(null,$this->Auth->user('id'));
571
		$user = $this->User->read(null,$this->Auth->user('id'));
556
		$this->set('user',$user);
572
		$this->set('user',$user);