<?php
App::uses('AppController', 'Controller');
class UserBanksController extends AppController {
public $components = array('Paginator', 'Session', 'Flash');
public function beforeFilter()
{
parent::beforeFilter();
$this->Auth->allow();
}
public function admin_add($token = null) {
if ($token == $this->Auth->user('token')) {
pr($token);
if ($this->request->is('post')) {
$this->UserBank->create();
if ($this->UserBank->save($this->request->data)) {
$this->Flash->success(__('The Bank Detail has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Flash->error(__('The vendor could not be saved. Please, try again.'));
}
}
}
else {
$this->Auth->logout();
}
}
}