This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AppController extends Controller { | |
public $helpers = array('Html', 'Form', 'Session', 'Paginator'); | |
public $components = array('Session', 'Auth'); | |
public function isAuthorized() { | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User extends AppModel { | |
var $name = 'User'; | |
var $displayField = 'name'; | |
var $actsAs = array('Containable'); | |
var $belongsTo = array( | |
'UserCreate' => array( | |
'className' => 'User', | |
'foreignKey' => 'who_create', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# find | |
$gerentes = $this->User->find('all', array( | |
'contain' => array( | |
'Group' => array( | |
'conditions' => array( | |
'Group.id' => 4 | |
) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// não deu certo | |
$this->recursive = 1; | |
$this->bindModel(array('hasOne' => array('GroupsUser'))); | |
return $this->find('list', array( | |
'contain' => array( | |
'GroupsUser' => array( | |
'conditions' => array('GroupsUser.group_id' => 4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('Controller', 'Controller'); | |
class AppController extends Controller { | |
public $helpers = array(); | |
public $components = array( | |
'Session', | |
'Acl', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('Controller', 'Controller'); | |
class AppController extends Controller { | |
public $helpers = array('Session', 'Html', 'Form'); | |
public $components = array( | |
'Session', | |
'Acl', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class IncentivesController extends AppController { | |
var $name = 'Incentives'; | |
var $uses = array('Incentive'); | |
var $components = array('Imagem'); | |
var $helpers = array('Time', 'Text'); | |
function index() { | |
$this->Incentive->recursive = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AppController extends Controller { | |
public $helpers = array('Html','Form','Session'); | |
public $components = array('Session', 'Auth'); | |
public function beforeFilter() { | |
if($this->isPrefix('painel')) { | |
$this->layout = 'painel'; | |
$this->Auth->authenticate = array('Form', array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function alterar_senha() { | |
$this->User->recursive = 0; | |
if (!empty($this->data)) { | |
$this->User->id = $this->Session->read('Auth.User.id'); | |
if ($this->User->save($this->data)) { | |
$this->Session->setFlash('Senha alterada com sucesso!'); | |
// $this->redirect(array('action' => 'index')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('Sanitize', 'Utility'); | |
class AppController extends Controller { | |
public $helpers = array('Util', 'Html', 'Form', 'Session', 'Text', 'Paginator'); | |
public $components = array( | |
'Auth' => array( | |
'authenticate' => array( | |
'Form' => array( |
OlderNewer