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 | |
namespace Admin\Form; | |
use Zend\Form\Form; | |
class Login extends Form | |
{ | |
public function __construct() | |
{ | |
parent::__construct('login'); |
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 | |
use Core\Test\ControllerTestCase; | |
use Admin\Controller\AuthController; | |
use Admin\Model\User; | |
use Zend\Http\Request; | |
use Zend\Stdlib\Parameters; | |
use Zend\View\Renderer\PhpRenderer; | |
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 | |
namespace Admin\Controller; | |
use Zend\View\Model\ViewModel; | |
use Core\Controller\ActionController; | |
use Admin\Form\Login; | |
/** | |
* Controlador que gerencia os posts | |
* |
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 | |
namespace Application\Form; | |
use Zend\Form\Form; | |
class Post extends Form | |
{ | |
public function __construct() | |
{ | |
parent::__construct('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 | |
use Core\Test\ControllerTestCase; | |
use Admin\Controller\IndexController; | |
use Application\Model\Post; | |
use Zend\Http\Request; | |
use Zend\Stdlib\Parameters; | |
use Zend\View\Renderer\PhpRenderer; | |
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 | |
namespace Admin\Controller; | |
use Zend\View\Model\ViewModel; | |
use Core\Controller\ActionController; | |
use Application\Model\Post; | |
use Application\Form\Post as PostForm; | |
/** | |
* Controlador que gerencia os posts |
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
/** | |
* Executada no bootstrap do módulo | |
* | |
* @param MvcEvent $e | |
*/ | |
public function onBootstrap($e) | |
{ | |
/** @var \Zend\ModuleManager\ModuleManager $moduleManager */ | |
$moduleManager = $e->getApplication()->getServiceManager()->get('modulemanager'); | |
/** @var \Zend\EventManager\SharedEventManager $sharedEvents */ |
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
/** | |
* Teste da autorização | |
* @return void | |
*/ | |
public function testAuthorize() | |
{ | |
$authService = $this->getService('Admin\Service\Auth'); | |
$result = $authService->authorize(); | |
$this->assertFalse($result); |
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
/** | |
* Faz a autorização do usuário para acessar o recurso | |
* @return boolean | |
*/ | |
public function authorize() | |
{ | |
$auth = new AuthenticationService(); | |
if ($auth->hasIdentity()) { | |
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
'acl' => array( | |
'roles' => array( | |
'visitante' => null, | |
'redator' => 'visitante', | |
'admin' => 'redator' | |
), | |
'resources' => array( | |
'Application\Controller\Index.index', | |
'Admin\Controller\Index.save', | |
'Admin\Controller\Index.delete', |