for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @filesource
* @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
* @license MIT
* @author Miroslav Fedeleš <[email protected]>
* @since 0.27
*/
namespace Auth\Controller;
use Auth\Entity\Status;
use Zend\Mvc\Controller\AbstractActionController;
use Auth\Dependency\Manager as Dependencies;
use Auth\AuthenticationService;
*
* @author Miroslav Fedeleš <[email protected]>r
* @author Mathias Gelhausen <[email protected]>
class RemoveController extends AbstractActionController
{
* @var Dependencies
protected $dependencies;
* @var AuthenticationService
protected $auth;
* @param Dependencies $dependencies
* @param AuthenticationService $auth
public function __construct(Dependencies $dependencies, AuthenticationService $auth)
$this->dependencies = $dependencies;
$this->auth = $auth;
}
public function indexAction()
$user = $this->auth->getUser();
$error = false;
if ($this->params()->fromPost('confirm'))
if ($this->dependencies->removeItems($user)) {
$this->auth->clearIdentity();
$user->setStatus(Status::INACTIVE);
return $this->redirect()->toRoute('lang');
} else {
$error = true;
return [
'lists' => $this->dependencies->getLists(),
'user' => $user,
'limit' => 20,
'error' => $error,
];