mirror of
https://github.com/elyby/chrly.git
synced 2024-11-23 05:33:18 +05:30
Переписан функционал установки скина в пользу поиска по нику, а не по id пользователя
This commit is contained in:
parent
84cfe9afa0
commit
800523aef2
8
app.php
8
app.php
@ -70,16 +70,18 @@ $app->post('/system/setSkin', function() use ($app) {
|
||||
}
|
||||
|
||||
$request = $app->request;
|
||||
$nickname = mb_convert_case($request->getPost('nickname', 'string'), MB_CASE_LOWER, ENCODING);
|
||||
|
||||
$skin = Skins::findFirst(array(array(
|
||||
'userId' => (int) $request->getPost('userId', 'int')
|
||||
'nickname' => $nickname
|
||||
)));
|
||||
|
||||
if (!$skin) {
|
||||
$skin = new Skins();
|
||||
$skin->userId = (int) $request->getPost('userId', 'int');
|
||||
$skin->nickname = $nickname;
|
||||
}
|
||||
|
||||
$skin->nickname = mb_convert_case($request->getPost('nickname', 'string'), MB_CASE_LOWER, ENCODING);
|
||||
$skin->userId = (int) $request->getPost('userId', 'int');
|
||||
$skin->skinId = (int) $request->getPost('skinId', 'int');
|
||||
$skin->hash = $request->getPost('hash', 'string');
|
||||
$skin->is1_8 = (bool) $request->getPost('is1_8', 'int');
|
||||
|
Loading…
Reference in New Issue
Block a user