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;
*
* @author Miroslav Fedeleš <[email protected]>r
* @author Mathias Gelhausen <[email protected]>
class RemoveController extends AbstractActionController
{
* @var Dependencies
protected $dependencies;
* @param Dependencies $dependencies
public function __construct(Dependencies $dependencies)
$this->dependencies = $dependencies;
}
public function indexAction()
/* @var \Auth\AuthenticationService $auth */
$auth = $this->serviceLocator->get('AuthenticationService');
$user = $auth->getUser();
$error = false;
if ($this->params()->fromPost('confirm'))
if ($this->dependencies->removeItems($user)) {
$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,
];