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 | |
echo $this->Session->flash('Auth'); ?> | |
<?php | |
echo $this->Form->create('User',array('action' => 'login')); | |
echo $this->Form->input('userid'); | |
echo $this->Form->input('user_pass',array('type' => 'password')); | |
echo $this->Form->submit('Entrar'); | |
echo $this->Form->end(); | |
?> |
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('AuthComponent', 'Controller/Component'); | |
class User extends AppModel { | |
public $useTable = 'login'; | |
public $validate = array( | |
'userid' => array( | |
array( 'rule' => 'NotEmpty', | |
'message' => 'O login deve ser preenchido!' | |
), | |
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
<?php | |
class UsersController extends AppController { | |
public function beforeFilter() { | |
parent::beforeFilter(); | |
$this->Auth->allowedActions = array('login','logout','home','index'); | |
} | |
public function login() { | |
if ($this->request->is('post')) { |
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 $components = array( | |
'Session', | |
'Auth' => array( | |
'authError' => 'Area Restrita', | |
'loginRedirect' => array('controller' => 'users', 'action' => 'registrar'), |
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
<div class="ranking"> | |
<div class="titulomaior"> | |
<ul> | |
<li>Posição</li> | |
<li>Nome</li> | |
<li>Matou</li> | |
<li>Morreu</li> | |
<li>Pontos</li> | |
</ul> | |
</div> |
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 RankingsController extends AppController { | |
public function rankpvp() { | |
$this->set('toppvp', $this->Ranking->find('all', array('limit' => 10, 'order' => array('ratio' => 'DESC')))); | |
} | |
} | |
?> |
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 Client extends AppModel { | |
#public $hasMany = array('Transacao'); | |
public $useTable = 'clients'; | |
public $validate = array( | |
'nome' => array( | |
array( 'rule' => 'NotEmpty', | |
'message' => 'O nome deve ser preenchido' | |
), | |
array( |