mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
fix listUserClassPermissions()
This commit is contained in:
@@ -368,10 +368,8 @@ class ToolRepository extends BaseRepository
|
|||||||
{
|
{
|
||||||
$userInfo = get_user_row($uid);
|
$userInfo = get_user_row($uid);
|
||||||
$prefix = "authority";
|
$prefix = "authority";
|
||||||
$excludes = collect(Setting::$permissionMustHaveClass)->map(fn ($p) => "$prefix.$p")->toArray();
|
|
||||||
return Setting::query()
|
return Setting::query()
|
||||||
->where("name", "like", "$prefix.%")
|
->where("name", "like", "$prefix.%")
|
||||||
->whereNotIn('name', $excludes)
|
|
||||||
->where('value', '<=', $userInfo['class'])
|
->where('value', '<=', $userInfo['class'])
|
||||||
->where('value', '>=', User::CLASS_PEASANT)
|
->where('value', '>=', User::CLASS_PEASANT)
|
||||||
->pluck('name')
|
->pluck('name')
|
||||||
@@ -379,7 +377,6 @@ class ToolRepository extends BaseRepository
|
|||||||
->toArray();
|
->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function listUserAllPermissions($uid): array
|
public static function listUserAllPermissions($uid): array
|
||||||
{
|
{
|
||||||
return NexusDB::remember("user_{$uid}_permissions", 600, function () use ($uid) {
|
return NexusDB::remember("user_{$uid}_permissions", 600, function () use ($uid) {
|
||||||
|
|||||||
@@ -352,8 +352,7 @@ if ($action == "edituser")
|
|||||||
if (!empty($banLog)) {
|
if (!empty($banLog)) {
|
||||||
\App\Models\UserBanLog::query()->insert($banLog);
|
\App\Models\UserBanLog::query()->insert($banLog);
|
||||||
}
|
}
|
||||||
\Nexus\Database\NexusDB::cache_del("user_{$userid}_content");
|
clear_user_cache($userid, $userInfo->passkey);
|
||||||
\Nexus\Database\NexusDB::cache_del('user_passkey_'.$userInfo->passkey.'_content');
|
|
||||||
$returnto = htmlspecialchars($_POST["returnto"]);
|
$returnto = htmlspecialchars($_POST["returnto"]);
|
||||||
header("Location: " . get_protocol_prefix() . "$BASEURL/$returnto");
|
header("Location: " . get_protocol_prefix() . "$BASEURL/$returnto");
|
||||||
die;
|
die;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ sql_query("INSERT INTO staffmessages (sender, added, msg, subject) VALUES($useri
|
|||||||
sql_query("UPDATE users SET last_staffmsg = NOW() WHERE id = ".sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__);
|
sql_query("UPDATE users SET last_staffmsg = NOW() WHERE id = ".sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__);
|
||||||
$Cache->delete_value('staff_message_count');
|
$Cache->delete_value('staff_message_count');
|
||||||
$Cache->delete_value('staff_new_message_count');
|
$Cache->delete_value('staff_new_message_count');
|
||||||
|
clear_staff_message_cache();
|
||||||
if ($_POST["returnto"])
|
if ($_POST["returnto"])
|
||||||
{
|
{
|
||||||
header("Location: " . htmlspecialchars($_POST["returnto"]));
|
header("Location: " . htmlspecialchars($_POST["returnto"]));
|
||||||
|
|||||||
Reference in New Issue
Block a user