Skip to content

Commit

Permalink
Custom pseudos in admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
nivcoo authored and Eywek committed Apr 29, 2018
1 parent 2391b25 commit b48a057
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ function admin_edit_ajax()
if ($this->isConnected && $this->Permissions->can('MANAGE_USERS')) {
if ($this->request->is('post')) {
$this->loadModel('User');
if (!empty($this->request->data['id']) && !empty($this->request->data['email']) && (!empty($this->request->data['rank']) || $this->request->data['rank'] == 0)) {
if (!empty($this->request->data['id']) && !empty($this->request->data['email']) && !empty($this->request->data['pseudo']) && (!empty($this->request->data['rank']) || $this->request->data['rank'] == 0)) {

$findUser = $this->User->find('first', array('conditions' => array('id' => intval($this->request->data['id']))));

Expand All @@ -752,9 +752,11 @@ function admin_edit_ajax()

$data = array(
'email' => $this->request->data['email'],
'rank' => $this->request->data['rank']
'rank' => $this->request->data['rank'],
'pseudo' => $this->request->data['pseudo']
);


if (!empty($this->request->data['password'])) {
$data['password'] = $this->Util->password($this->request->data['password'], $findUser['User']['pseudo']);
$password_updated = true;
Expand Down
2 changes: 1 addition & 1 deletion app/View/User/admin_edit.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<div class="form-group">
<label><?= $Lang->get('USER__USERNAME') ?></label>
<input class="form-control" value="<?= $search_user['pseudo'] ?>" type="text" disabled="" autocomplete="off">
<input name="pseudo" class="form-control" value="<?= $search_user['pseudo'] ?>" type="text" autocomplete="off">
</div>

<?php if(!$Configuration->getKey('confirm_mail_signup')) { ?>
Expand Down

0 comments on commit b48a057

Please sign in to comment.