Admin: Add password changer for user and password generator

localization coming soon (i hope @lumaeris will do this 4 me)
This commit is contained in:
veselcraft 2023-07-12 02:35:22 +03:00
parent ef7b4b6c3e
commit 2018131934
No known key found for this signature in database
GPG key ID: AED66BC1AC628A4E
2 changed files with 13 additions and 0 deletions

View file

@ -86,6 +86,9 @@ final class AdminPresenter extends OpenVKPresenter
$query = "INSERT INTO `ChandlerACLRelations` (`user`, `group`) VALUES ('" . $user->getChandlerGUID() . "', '" . $this->postParam("add-to-group") . "')"; $query = "INSERT INTO `ChandlerACLRelations` (`user`, `group`) VALUES ('" . $user->getChandlerGUID() . "', '" . $this->postParam("add-to-group") . "')";
DatabaseConnection::i()->getConnection()->query($query); DatabaseConnection::i()->getConnection()->query($query);
} }
if($this->postParam("password")) {
$user->getChandlerUser()->updatePassword($this->postParam("password"));
}
$user->save(); $user->save();

View file

@ -69,6 +69,16 @@
</select> </select>
</div> </div>
<hr/> <hr/>
<div class="field-group">
<label for="email">{_password}</label>
<input class="text medium-field" type="password" id="password" name="password" value="" />
</div>
<div class="buttons-container">
<div class="buttons">
<a class="button" onclick="let pswd = Math.random().toString(27).slice(2,12); alert('Сгенерированный пароль: ' + pswd + '\n\nНе забудьте сообщить пользователю, чтобы он сменил пароль на свой!'); $('input#password').val(pswd);">Сгенерировать пароль</a>
</div>
</div>
<hr/>
<h2>{_c_groups}</h2> <h2>{_c_groups}</h2>
<div> <div>
<div class="field-group"> <div class="field-group">