[admin] add grant props

This commit is contained in:
xiaomlove
2022-08-11 17:12:36 +08:00
parent 72908e38f4
commit 9332b676b4
18 changed files with 156 additions and 18 deletions
+7 -5
View File
@@ -227,11 +227,13 @@ if ($compact == 1) {
}
//check ReAnnounce
$params = $_GET;
unset($params['key'], $params['ip'], $params['ipv4'], $params['ipv6']);
$reAnnounceQuery = http_build_query($params);
$lockKey = md5($reAnnounceQuery);
$log .= ", [CHECK_RE_ANNOUNCE], reAnnounceQuery: $reAnnounceQuery, lockKey: $lockKey";
$lockParams = [];
foreach(['info_hash', 'passkey', 'peer_id'] as $lockField) {
$lockParams[$lockField] = $_GET[$lockField];
}
$lockString = http_build_query($lockParams);
$lockKey = md5($lockString);
$log .= ", [CHECK_RE_ANNOUNCE], lockString: $lockString, lockKey: $lockKey";
$redis = $Cache->getRedis();
if (!$redis->set($lockKey, TIMENOW, ['nx', 'ex' => 5])) {
do_log("$log, [YES_RE_ANNOUNCE]");
+4 -4
View File
@@ -306,7 +306,7 @@ JS;
\Nexus\Nexus::js($warnMedalJs, 'footer', false);
}
//User meta
$metas = $userRep->listMetas($CURUSER['id']);
$metas = $userRep->listMetas($user['id']);
$props = [];
$metaKey = \App\Models\UserMeta::META_KEY_CHANGE_USERNAME;
if ($metas->has($metaKey)) {
@@ -358,14 +358,14 @@ if ($metas->has($metaKey)) {
$rainbowID = $metas->get($metaKey)->first();
if ($rainbowID->isValid()) {
$props[] = sprintf(
'<div><strong>[%s]</strong>(%s: %s)</div>',
$rainbowID->metaKeyText, nexus_trans('label.deadline'), $rainbowID->deadline
'<div><strong>[%s]</strong>(%s)</div>',
$rainbowID->metaKeyText, $rainbowID->getDeadlineText()
);
}
}
if (!empty($props)) {
tr_small($lang_userdetails['row_user_props'], sprintf('<div style="display: inline">%s</div>', implode('&nbsp;|&nbsp;', $props)), 1);
tr_small($lang_userdetails['row_user_props'], sprintf('<div style="display: flex;align-items: center">%s</div>', implode('&nbsp;|&nbsp;', $props)), 1);
}
tr_small($lang_userdetails['row_torrent_comment'], ($torrentcomments && ($user["id"] == $CURUSER["id"] || get_user_class() >= $viewhistory_class) ? "<a href=\"userhistory.php?action=viewcomments&amp;id=".$id."\" title=\"".$lang_userdetails['link_view_comments']."\">".$torrentcomments."</a>" : $torrentcomments), 1);