parent
4870dc04b2
commit
9eeaabc6fe
364 changed files with 51722 additions and 987 deletions
|
|
@ -49,7 +49,7 @@ class UserController extends Controller
|
|||
$users = $this->userStore->getWhere(array(), 1000, 0, array(), array('email' => 'ASC'));
|
||||
$this->view->users = $users;
|
||||
|
||||
$this->config->set('page_title', 'Users');
|
||||
$this->layout->title = 'Users';
|
||||
|
||||
return $this->view->render();
|
||||
}
|
||||
|
|
@ -58,6 +58,8 @@ class UserController extends Controller
|
|||
{
|
||||
$user = $_SESSION['phpci_user'];
|
||||
|
||||
$this->layout->title = 'Edit Profile';
|
||||
|
||||
if ($this->request->getMethod() == 'POST') {
|
||||
$name = $this->getParam('name', null);
|
||||
$email = $this->getParam('email', null);
|
||||
|
|
@ -65,6 +67,8 @@ class UserController extends Controller
|
|||
|
||||
$_SESSION['phpci_user'] = $this->userService->updateUser($user, $name, $email, $password);
|
||||
$user = $_SESSION['phpci_user'];
|
||||
|
||||
$this->view->updated = 1;
|
||||
}
|
||||
|
||||
$values = $user->getDataArray();
|
||||
|
|
@ -111,11 +115,9 @@ class UserController extends Controller
|
|||
*/
|
||||
public function add()
|
||||
{
|
||||
if (!$_SESSION['phpci_user']->getIsAdmin()) {
|
||||
throw new ForbiddenException('You do not have permission to do that.');
|
||||
}
|
||||
$this->requireAdmin();
|
||||
|
||||
$this->config->set('page_title', 'Add User');
|
||||
$this->layout->title = 'Add User';
|
||||
|
||||
$method = $this->request->getMethod();
|
||||
|
||||
|
|
@ -153,9 +155,7 @@ class UserController extends Controller
|
|||
*/
|
||||
public function edit($userId)
|
||||
{
|
||||
if (!$_SESSION['phpci_user']->getIsAdmin()) {
|
||||
throw new ForbiddenException('You do not have permission to do that.');
|
||||
}
|
||||
$this->requireAdmin();
|
||||
|
||||
$method = $this->request->getMethod();
|
||||
$user = $this->userStore->getById($userId);
|
||||
|
|
@ -164,6 +164,9 @@ class UserController extends Controller
|
|||
throw new NotFoundException('User with ID: ' . $userId . ' does not exist.');
|
||||
}
|
||||
|
||||
$this->layout->title = $user->getName();
|
||||
$this->layout->subtitle = 'Edit User';
|
||||
|
||||
$values = array_merge($user->getDataArray(), $this->getParams());
|
||||
$form = $this->userForm($values, 'edit/' . $userId);
|
||||
|
||||
|
|
@ -246,10 +249,8 @@ class UserController extends Controller
|
|||
*/
|
||||
public function delete($userId)
|
||||
{
|
||||
if (!$_SESSION['phpci_user']->getIsAdmin()) {
|
||||
throw new ForbiddenException('You do not have permission to do that.');
|
||||
}
|
||||
|
||||
$this->requireAdmin();
|
||||
|
||||
$user = $this->userStore->getById($userId);
|
||||
|
||||
if (empty($user)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue