mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 14:10:57 +08:00
fix more modcomment
This commit is contained in:
@@ -41,6 +41,12 @@ class IconResource extends Resource
|
|||||||
{
|
{
|
||||||
return $form
|
return $form
|
||||||
->schema([
|
->schema([
|
||||||
|
Forms\Components\Textarea::make('tip')
|
||||||
|
->default(nexus_trans('label.icon.desc'))
|
||||||
|
->disabled()
|
||||||
|
->columnSpanFull()
|
||||||
|
->rows(18)
|
||||||
|
,
|
||||||
Forms\Components\TextInput::make('name')
|
Forms\Components\TextInput::make('name')
|
||||||
->label(__('label.name'))
|
->label(__('label.name'))
|
||||||
->required()
|
->required()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use Filament\Resources\Pages\CreateRecord;
|
|||||||
|
|
||||||
class CreateIcon extends CreateRecord
|
class CreateIcon extends CreateRecord
|
||||||
{
|
{
|
||||||
protected static string $view = 'filament.resources.system.category-icon-resource.pages.create-record';
|
// protected static string $view = 'filament.resources.system.category-icon-resource.pages.create-record';
|
||||||
|
|
||||||
protected static string $resource = IconResource::class;
|
protected static string $resource = IconResource::class;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class EditIcon extends EditRecord
|
|||||||
|
|
||||||
protected static string $resource = IconResource::class;
|
protected static string $resource = IconResource::class;
|
||||||
|
|
||||||
protected static string $view = 'filament.resources.system.category-icon-resource.pages.edit-record';
|
// protected static string $view = 'filament.resources.system.category-icon-resource.pages.edit-record';
|
||||||
|
|
||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
@@ -22,6 +22,12 @@ class EditIcon extends EditRecord
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function mutateFormDataBeforeFill(array $data): array
|
||||||
|
{
|
||||||
|
$data['tip'] = nexus_trans('label.icon.desc');
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
protected function getViewData(): array
|
protected function getViewData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ use App\Repositories\HitAndRunRepository;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Infolists\Infolist;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
@@ -19,6 +20,8 @@ use Illuminate\Database\Eloquent\SoftDeletingScope;
|
|||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\HtmlString;
|
use Illuminate\Support\HtmlString;
|
||||||
|
use Filament\Infolists;
|
||||||
|
use Filament\Infolists\Components;
|
||||||
|
|
||||||
class ExamUserResource extends Resource
|
class ExamUserResource extends Resource
|
||||||
{
|
{
|
||||||
@@ -138,6 +141,96 @@ class ExamUserResource extends Resource
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function infolist(Infolist $infolist): Infolist
|
||||||
|
{
|
||||||
|
return $infolist
|
||||||
|
->schema([
|
||||||
|
Components\Grid::make(2)->schema([
|
||||||
|
Components\Group::make([
|
||||||
|
Infolists\Components\TextEntry::make('id'),
|
||||||
|
Infolists\Components\TextEntry::make('statusText')
|
||||||
|
->label(__("label.status"))
|
||||||
|
,
|
||||||
|
Infolists\Components\TextEntry::make('uid')
|
||||||
|
->formatStateUsing(fn ($record) => username_for_admin($record->uid))
|
||||||
|
->label(__("label.username"))
|
||||||
|
,
|
||||||
|
Infolists\Components\TextEntry::make('exam.name')
|
||||||
|
// ->formatStateUsing(fn ($record) => $record->torrent->name)
|
||||||
|
->label(__("label.exam.label"))
|
||||||
|
,
|
||||||
|
Infolists\Components\TextEntry::make('begin')
|
||||||
|
->label(__("label.begin"))
|
||||||
|
,
|
||||||
|
Infolists\Components\TextEntry::make('end')
|
||||||
|
->label(__("label.end"))
|
||||||
|
,
|
||||||
|
Infolists\Components\TextEntry::make('isDoneText')
|
||||||
|
->label(__("label.exam_user.is_done"))
|
||||||
|
,
|
||||||
|
Infolists\Components\TextEntry::make('created_at')
|
||||||
|
->label(__("label.created_at"))
|
||||||
|
,
|
||||||
|
Infolists\Components\TextEntry::make('updated_at')
|
||||||
|
->label(__("label.updated_at"))
|
||||||
|
,
|
||||||
|
])
|
||||||
|
->columnSpan(1)
|
||||||
|
->columns(2)
|
||||||
|
,
|
||||||
|
Components\Group::make([
|
||||||
|
Components\Grid::make(3) // 3 列的网格
|
||||||
|
->schema([
|
||||||
|
Infolists\Components\TextEntry::make('header1')->label('Header 1'),
|
||||||
|
Infolists\Components\TextEntry::make('header2')->label('Header 2'),
|
||||||
|
Infolists\Components\TextEntry::make('header3')->label('Header 3'),
|
||||||
|
]),
|
||||||
|
Components\Grid::make(3) // 数据行
|
||||||
|
->schema([
|
||||||
|
Infolists\Components\TextEntry::make('data1')->getStateUsing(fn ($record) => $record->data1),
|
||||||
|
Infolists\Components\TextEntry::make('data2')->getStateUsing(fn ($record) => $record->data2),
|
||||||
|
Infolists\Components\TextEntry::make('data3')->getStateUsing(fn ($record) => $record->data3),
|
||||||
|
]),
|
||||||
|
// 更多数据行...
|
||||||
|
Components\Grid::make(3) // 数据行
|
||||||
|
->schema([
|
||||||
|
Infolists\Components\TextEntry::make('data1')->getStateUsing(fn ($record) => $record->data4),
|
||||||
|
Infolists\Components\TextEntry::make('data2')->getStateUsing(fn ($record) => $record->data5),
|
||||||
|
Infolists\Components\TextEntry::make('data3')->getStateUsing(fn ($record) => $record->data6),
|
||||||
|
]),
|
||||||
|
])->columnSpan(1),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// private static function buildProgressTable(): array
|
||||||
|
// {
|
||||||
|
// $exam = $record->exam;
|
||||||
|
// $passTransKey = $exam->getPassResultTransKey('pass');
|
||||||
|
// $notPassTransKey = $exam->getPassResultTransKey('not_pass');
|
||||||
|
// $result = [];
|
||||||
|
// $result[] = Components\Grid::make(4) // 4 列的网格
|
||||||
|
// ->schema([
|
||||||
|
// Infolists\Components\TextEntry::make('index')->label(__('label.exam.index_required_label')),
|
||||||
|
// Infolists\Components\TextEntry::make('require')->label(__('label.exam.index_required_value')),
|
||||||
|
// Infolists\Components\TextEntry::make('current')->label(__('label.exam.index_current_value')),
|
||||||
|
// Infolists\Components\TextEntry::make('result')->label(__('label.exam.index_result')),
|
||||||
|
// ]);
|
||||||
|
// foreach($record->progressFormatted as $key => $index) {
|
||||||
|
// $result[] = Components\Grid::make(4) // 4 列的网格
|
||||||
|
// ->schema([
|
||||||
|
// Infolists\Components\TextEntry::make('index'.$key)->label($index['index_formatted']),
|
||||||
|
// Infolists\Components\TextEntry::make('require'.$key)->label($index['require_value_formatted']),
|
||||||
|
// Infolists\Components\TextEntry::make('current'.$key)->label($index['current_value_formatted']),
|
||||||
|
// Infolists\Components\TextEntry::make('result'.$key)->label($index['passed'] ? __($passTransKey) : __($notPassTransKey)),
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// return $result;
|
||||||
|
// }
|
||||||
|
|
||||||
public static function getEloquentQuery(): Builder
|
public static function getEloquentQuery(): Builder
|
||||||
{
|
{
|
||||||
return parent::getEloquentQuery()->with(['user', 'exam']);
|
return parent::getEloquentQuery()->with(['user', 'exam']);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ViewExamUser extends ViewRecord
|
|||||||
{
|
{
|
||||||
protected static string $resource = ExamUserResource::class;
|
protected static string $resource = ExamUserResource::class;
|
||||||
|
|
||||||
protected static string $view = 'filament.resources.user.exam-user-resource.pages.detail';
|
// protected static string $view = 'filament.resources.user.exam-user-resource.pages.detail';
|
||||||
|
|
||||||
private function getDetailCardData(): array
|
private function getDetailCardData(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ use App\Models\Snatch;
|
|||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\UserBanLog;
|
use App\Models\UserBanLog;
|
||||||
use App\Models\UserMeta;
|
use App\Models\UserMeta;
|
||||||
|
use App\Models\UserModifyLog;
|
||||||
use App\Models\UsernameChangeLog;
|
use App\Models\UsernameChangeLog;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
@@ -286,13 +287,11 @@ class UserRepository extends BaseRepository
|
|||||||
'new' => $formatSize ? mksize($new) : $new,
|
'new' => $formatSize ? mksize($new) : $new,
|
||||||
'reason' => $reason,
|
'reason' => $reason,
|
||||||
], 'en');
|
], 'en');
|
||||||
$modCommentText = date('Y-m-d') . " - $modCommentText";
|
|
||||||
do_log("user: $uid, $modCommentText", 'alert');
|
do_log("user: $uid, $modCommentText", 'alert');
|
||||||
$update = [
|
$update = [
|
||||||
$sourceField => $new,
|
$sourceField => $new,
|
||||||
'modcomment' => NexusDB::raw("if(modcomment = '', '$modCommentText', concat_ws('\n', '$modCommentText', modcomment))"),
|
// 'modcomment' => NexusDB::raw("if(modcomment = '', '$modCommentText', concat_ws('\n', '$modCommentText', modcomment))"),
|
||||||
];
|
];
|
||||||
|
|
||||||
$locale = $targetUser->locale;
|
$locale = $targetUser->locale;
|
||||||
$fieldLabel = nexus_trans("user.labels.$sourceField", [], $locale);
|
$fieldLabel = nexus_trans("user.labels.$sourceField", [], $locale);
|
||||||
$msg = nexus_trans('message.field_value_change_message_body', [
|
$msg = nexus_trans('message.field_value_change_message_body', [
|
||||||
@@ -309,7 +308,7 @@ class UserRepository extends BaseRepository
|
|||||||
'msg' => $msg,
|
'msg' => $msg,
|
||||||
'added' => Carbon::now(),
|
'added' => Carbon::now(),
|
||||||
];
|
];
|
||||||
NexusDB::transaction(function () use ($uid, $sourceField, $old, $new, $update, $message) {
|
NexusDB::transaction(function () use ($uid, $sourceField, $old, $new, $update, $message, $modCommentText) {
|
||||||
$affectedRows = User::query()
|
$affectedRows = User::query()
|
||||||
->where('id', $uid)
|
->where('id', $uid)
|
||||||
->where($sourceField, $old)
|
->where($sourceField, $old)
|
||||||
@@ -319,6 +318,12 @@ class UserRepository extends BaseRepository
|
|||||||
throw new \RuntimeException("Change fail, affected rows != 1($affectedRows)");
|
throw new \RuntimeException("Change fail, affected rows != 1($affectedRows)");
|
||||||
}
|
}
|
||||||
Message::query()->insert($message);
|
Message::query()->insert($message);
|
||||||
|
UserModifyLog::query()->insert([
|
||||||
|
'user_id' => $uid,
|
||||||
|
'content' => $modCommentText,
|
||||||
|
'created_at' => Carbon::now(),
|
||||||
|
'updated_at' => Carbon::now(),
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
$this->clearCache($targetUser);
|
$this->clearCache($targetUser);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.9.0');
|
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.9.0');
|
||||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-01-19');
|
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-02-06');
|
||||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||||
|
|||||||
@@ -2870,7 +2870,7 @@ if ($msgalert)
|
|||||||
$Cache->cache_value($cacheKey, $toApprovalCounts, 60);
|
$Cache->cache_value($cacheKey, $toApprovalCounts, 60);
|
||||||
}
|
}
|
||||||
if ($toApprovalCounts) {
|
if ($toApprovalCounts) {
|
||||||
msgalert('/nexusphp/seed-box-records?tableFilters[status][value]=0', sprintf($lang_functions['text_seed_box_record_to_approval'], is_or_are($toApprovalCounts), $toApprovalCounts, add_s($toApprovalCounts)), 'darkred');
|
msgalert('/nexusphp/system/seed-box-records?tableFilters[status][value]=0', sprintf($lang_functions['text_seed_box_record_to_approval'], is_or_are($toApprovalCounts), $toApprovalCounts, add_s($toApprovalCounts)), 'darkred');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ $lang_shoutbox = array
|
|||||||
'text_ago' => "前",
|
'text_ago' => "前",
|
||||||
'text_helpbox_disabled' => "求助区当前关闭中。你在搞什么鬼?",
|
'text_helpbox_disabled' => "求助区当前关闭中。你在搞什么鬼?",
|
||||||
'text_no_permission_to_shoutbox' => "你没有在群聊区发言的权力。你在搞什么鬼?",
|
'text_no_permission_to_shoutbox' => "你没有在群聊区发言的权力。你在搞什么鬼?",
|
||||||
|
"speaking_too_often" => "不要刷屏!",
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ $lang_shoutbox = array
|
|||||||
'text_ago' => "前",
|
'text_ago' => "前",
|
||||||
'text_helpbox_disabled' => "求助區當前關閉中。你在搞什麼鬼?",
|
'text_helpbox_disabled' => "求助區當前關閉中。你在搞什麼鬼?",
|
||||||
'text_no_permission_to_shoutbox' => "你沒有在群聊區發言的權力。你在搞什麼鬼?",
|
'text_no_permission_to_shoutbox' => "你沒有在群聊區發言的權力。你在搞什麼鬼?",
|
||||||
|
"speaking_too_often" => "不要刷屏!",
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ $lang_shoutbox = array
|
|||||||
'text_ago' => " ago",
|
'text_ago' => " ago",
|
||||||
'text_helpbox_disabled' => "Helpbox is currently disabled. How the hell do you get here?",
|
'text_helpbox_disabled' => "Helpbox is currently disabled. How the hell do you get here?",
|
||||||
'text_no_permission_to_shoutbox' => "You have no permission to send messages to shoutbox. How the hell do you get here?",
|
'text_no_permission_to_shoutbox' => "You have no permission to send messages to shoutbox. How the hell do you get here?",
|
||||||
|
"speaking_too_often" => "Speaking too often!",
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -88,11 +88,12 @@ if ($action == "edituser")
|
|||||||
$updateset[] = "supportfor = " . sqlesc($supportfor);
|
$updateset[] = "supportfor = " . sqlesc($supportfor);
|
||||||
$updateset[] = "supportlang = ".sqlesc($supportlang);
|
$updateset[] = "supportlang = ".sqlesc($supportlang);
|
||||||
$banLog = [];
|
$banLog = [];
|
||||||
|
$userModifyLogs = [];
|
||||||
|
|
||||||
if(!user_can('cruprfmanage'))
|
// if(!user_can('cruprfmanage'))
|
||||||
{
|
// {
|
||||||
$modcomment = $arr["modcomment"];
|
// $modcomment = $arr["modcomment"];
|
||||||
}
|
// }
|
||||||
if(user_can('cruprfmanage'))
|
if(user_can('cruprfmanage'))
|
||||||
{
|
{
|
||||||
$email = $_POST["email"];
|
$email = $_POST["email"];
|
||||||
@@ -108,15 +109,17 @@ if ($action == "edituser")
|
|||||||
$added = sqlesc(date("Y-m-d H:i:s"));
|
$added = sqlesc(date("Y-m-d H:i:s"));
|
||||||
if ($arr['email'] != $email){
|
if ($arr['email'] != $email){
|
||||||
$updateset[] = "email = " . sqlesc($email);
|
$updateset[] = "email = " . sqlesc($email);
|
||||||
$modcomment = date("Y-m-d") . " - Email changed from $arr[email] to $email by {$CURUSER['username']}.\n". $modcomment;
|
// $modcomment = date("Y-m-d") . " - Email changed from $arr[email] to $email by {$CURUSER['username']}.\n". $modcomment;
|
||||||
|
$userModifyLogs[] = "Email changed from $arr[email] to $email by {$CURUSER['username']}.";
|
||||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_email_change']);
|
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_email_change']);
|
||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_email_changed_from'].$arr['email'].$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . $email .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_email_changed_from'].$arr['email'].$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . $email .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
||||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
if ($arr['username'] != $username){
|
if ($arr['username'] != $username){
|
||||||
$updateset[] = "username = " . sqlesc($username);
|
$updateset[] = "username = " . sqlesc($username);
|
||||||
$modcomment = date("Y-m-d") . " - Username changed from {$arr['username']} to $username by {$CURUSER['username']}.\n". $modcomment;
|
// $modcomment = date("Y-m-d") . " - Username changed from {$arr['username']} to $username by {$CURUSER['username']}.\n". $modcomment;
|
||||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_username_change']);
|
$userModifyLogs[] = "Username changed from {$arr['username']} to $username by {$CURUSER['username']}";
|
||||||
|
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_username_change']);
|
||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_username_changed_from'].$arr['username'].$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . $username .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_username_changed_from'].$arr['username'].$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . $username .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
||||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||||
$changeLog = [
|
$changeLog = [
|
||||||
@@ -183,7 +186,8 @@ if ($action == "edituser")
|
|||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_donor_status_changed_by'].$CURUSER['username']);
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_donor_status_changed_by'].$CURUSER['username']);
|
||||||
$added = sqlesc(date("Y-m-d H:i:s"));
|
$added = sqlesc(date("Y-m-d H:i:s"));
|
||||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES (0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES (0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||||
$modcomment = date("Y-m-d") . " - donor status changed by {$CURUSER['username']}. Current donor status: $donor \n". $modcomment;
|
// $modcomment = date("Y-m-d") . " - donor status changed by {$CURUSER['username']}. Current donor status: $donor \n". $modcomment;
|
||||||
|
$userModifyLogs[] = "donor status changed by {$CURUSER['username']}. Current donor status: $donor";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +232,8 @@ if ($action == "edituser")
|
|||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_vip_status_changed_by'].$CURUSER['username']);
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_vip_status_changed_by'].$CURUSER['username']);
|
||||||
$added = sqlesc(date("Y-m-d H:i:s"));
|
$added = sqlesc(date("Y-m-d H:i:s"));
|
||||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES (0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES (0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||||
$modcomment = date("Y-m-d") . " - VIP status changed by {$CURUSER['username']}. VIP added: ".$vip_added.($vip_added == 'yes' ? "; VIP until: ".$vip_until : "").".\n". $modcomment;
|
// $modcomment = date("Y-m-d") . " - VIP status changed by {$CURUSER['username']}. VIP added: ".$vip_added.($vip_added == 'yes' ? "; VIP until: ".$vip_until : "").".\n". $modcomment;
|
||||||
|
$userModifyLogs[] = "VIP status changed by {$CURUSER['username']}. VIP added: ".$vip_added.($vip_added == 'yes' ? "; VIP until: ".$vip_until : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($warned && $curwarned != $warned)
|
if ($warned && $curwarned != $warned)
|
||||||
@@ -238,7 +243,8 @@ if ($action == "edituser")
|
|||||||
|
|
||||||
if ($warned == 'no')
|
if ($warned == 'no')
|
||||||
{
|
{
|
||||||
$modcomment = date("Y-m-d") . " - Warning removed by {$CURUSER['username']}.\n". $modcomment;
|
// $modcomment = date("Y-m-d") . " - Warning removed by {$CURUSER['username']}.\n". $modcomment;
|
||||||
|
$userModifyLogs[] = "Warning removed by {$CURUSER['username']}";
|
||||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_warn_removed']);
|
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_warn_removed']);
|
||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_warning_removed_by'] . $CURUSER['username'] . ".");
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_warning_removed_by'] . $CURUSER['username'] . ".");
|
||||||
}
|
}
|
||||||
@@ -250,14 +256,17 @@ if ($action == "edituser")
|
|||||||
{
|
{
|
||||||
if ($warnlength == 255)
|
if ($warnlength == 255)
|
||||||
{
|
{
|
||||||
$modcomment = date("Y-m-d") . " - Warned by " . $CURUSER['username'] . ".\nReason: $warnpm.\n". $modcomment;
|
// $modcomment = date("Y-m-d") . " - Warned by " . $CURUSER['username'] . ".\nReason: $warnpm.\n". $modcomment;
|
||||||
|
$userModifyLogs[] = "Warned by " . $CURUSER['username'] . ".\nReason: $warnpm.";
|
||||||
|
|
||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_you_are_warned_by'].$CURUSER['username']."." . ($warnpm ? $lang_modtask_target[get_user_lang($userid)]['msg_reason'].$warnpm : ""));
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_you_are_warned_by'].$CURUSER['username']."." . ($warnpm ? $lang_modtask_target[get_user_lang($userid)]['msg_reason'].$warnpm : ""));
|
||||||
$updateset[] = "warneduntil = null";
|
$updateset[] = "warneduntil = null";
|
||||||
}else{
|
}else{
|
||||||
$warneduntil = date("Y-m-d H:i:s",(strtotime(date("Y-m-d H:i:s")) + $warnlength * 604800));
|
$warneduntil = date("Y-m-d H:i:s",(strtotime(date("Y-m-d H:i:s")) + $warnlength * 604800));
|
||||||
$dur = $warnlength . $lang_modtask_target[get_user_lang($userid)]['msg_week'] . ($warnlength > 1 ? $lang_modtask_target[get_user_lang($userid)]['msg_s'] : "");
|
$dur = $warnlength . $lang_modtask_target[get_user_lang($userid)]['msg_week'] . ($warnlength > 1 ? $lang_modtask_target[get_user_lang($userid)]['msg_s'] : "");
|
||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_you_are_warned_for'].$dur.$lang_modtask_target[get_user_lang($userid)]['msg_by'] . $CURUSER['username'] . "." . ($warnpm ? $lang_modtask_target[get_user_lang($userid)]['msg_reason'].$warnpm : ""));
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_you_are_warned_for'].$dur.$lang_modtask_target[get_user_lang($userid)]['msg_by'] . $CURUSER['username'] . "." . ($warnpm ? $lang_modtask_target[get_user_lang($userid)]['msg_reason'].$warnpm : ""));
|
||||||
$modcomment = date("Y-m-d") . " - Warned for $dur by " . $CURUSER['username'] . ".\nReason: $warnpm.\n". $modcomment;
|
// $modcomment = date("Y-m-d") . " - Warned for $dur by " . $CURUSER['username'] . ".\nReason: $warnpm.\n". $modcomment;
|
||||||
|
$userModifyLogs[] = "Warned for $dur by " . $CURUSER['username'] . ".Reason: $warnpm";
|
||||||
$updateset[] = "warneduntil = '$warneduntil'";
|
$updateset[] = "warneduntil = '$warneduntil'";
|
||||||
}
|
}
|
||||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_you_are_warned']);
|
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_you_are_warned']);
|
||||||
@@ -290,11 +299,13 @@ if ($action == "edituser")
|
|||||||
// }
|
// }
|
||||||
if ($arr['noad'] != $noad){
|
if ($arr['noad'] != $noad){
|
||||||
$updateset[]='noad = '.sqlesc($noad);
|
$updateset[]='noad = '.sqlesc($noad);
|
||||||
$modcomment = date("Y-m-d") . " - No Ad set to ".$noad." by ". $CURUSER['username']. ".\n". $modcomment;
|
// $modcomment = date("Y-m-d") . " - No Ad set to ".$noad." by ". $CURUSER['username']. ".\n". $modcomment;
|
||||||
|
$userModifyLogs[] = "No Ad set to ".$noad." by ". $CURUSER['username'];
|
||||||
}
|
}
|
||||||
if ($arr['noaduntil'] != $noaduntil){
|
if ($arr['noaduntil'] != $noaduntil){
|
||||||
$updateset[]='noaduntil = '.sqlesc($noaduntil);
|
$updateset[]='noaduntil = '.sqlesc($noaduntil);
|
||||||
$modcomment = date("Y-m-d") . " - No Ad Until set to ".$noaduntil." by ". $CURUSER['username']. ".\n". $modcomment;
|
// $modcomment = date("Y-m-d") . " - No Ad Until set to ".$noaduntil." by ". $CURUSER['username']. ".\n". $modcomment;
|
||||||
|
$userModifyLogs[] = "No Ad Until set to ".$noaduntil." by ". $CURUSER['username'];
|
||||||
}
|
}
|
||||||
if ($privacy == "low" OR $privacy == "normal" OR $privacy == "strong")
|
if ($privacy == "low" OR $privacy == "normal" OR $privacy == "strong")
|
||||||
$updateset[] = "privacy = " . sqlesc($privacy);
|
$updateset[] = "privacy = " . sqlesc($privacy);
|
||||||
@@ -308,7 +319,8 @@ if ($action == "edituser")
|
|||||||
{
|
{
|
||||||
if ($forumpost == 'yes')
|
if ($forumpost == 'yes')
|
||||||
{
|
{
|
||||||
$modcomment = date("Y-m-d") . " - Posting enabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
// $modcomment = date("Y-m-d") . " - Posting enabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
||||||
|
$userModifyLogs[] = "Posting enabled by " . $CURUSER['username'];
|
||||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_posting_rights_restored']);
|
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_posting_rights_restored']);
|
||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_posting_rights_restored']. $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_you_can_post']);
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_posting_rights_restored']. $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_you_can_post']);
|
||||||
$added = sqlesc(date("Y-m-d H:i:s"));
|
$added = sqlesc(date("Y-m-d H:i:s"));
|
||||||
@@ -316,7 +328,8 @@ if ($action == "edituser")
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$modcomment = date("Y-m-d") . " - Posting disabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
// $modcomment = date("Y-m-d") . " - Posting disabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
||||||
|
$userModifyLogs[] = "Posting disabled by " . $CURUSER['username'];
|
||||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_posting_rights_removed']);
|
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_posting_rights_removed']);
|
||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_posting_rights_removed'] . $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_probable_reason']);
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_posting_rights_removed'] . $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_probable_reason']);
|
||||||
$added = sqlesc(date("Y-m-d H:i:s"));
|
$added = sqlesc(date("Y-m-d H:i:s"));
|
||||||
@@ -327,7 +340,8 @@ if ($action == "edituser")
|
|||||||
{
|
{
|
||||||
if ($uploadpos == 'yes')
|
if ($uploadpos == 'yes')
|
||||||
{
|
{
|
||||||
$modcomment = date("Y-m-d") . " - Upload enabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
// $modcomment = date("Y-m-d") . " - Upload enabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
||||||
|
$userModifyLogs[] = "Upload enabled by " . $CURUSER['username'];
|
||||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_upload_rights_restored']);
|
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_upload_rights_restored']);
|
||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_upload_rights_restored'] . $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_you_upload_can_upload']);
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_upload_rights_restored'] . $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_you_upload_can_upload']);
|
||||||
$added = sqlesc(date("Y-m-d H:i:s"));
|
$added = sqlesc(date("Y-m-d H:i:s"));
|
||||||
@@ -335,7 +349,8 @@ if ($action == "edituser")
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$modcomment = date("Y-m-d") . " - Upload disabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
// $modcomment = date("Y-m-d") . " - Upload disabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
||||||
|
$userModifyLogs[] = "Upload disabled by " . $CURUSER['username'];
|
||||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_upload_rights_removed']);
|
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_upload_rights_removed']);
|
||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_upload_rights_removed'] . $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_probably_reason_two']);
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_upload_rights_removed'] . $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_probably_reason_two']);
|
||||||
$added = sqlesc(date("Y-m-d H:i:s"));
|
$added = sqlesc(date("Y-m-d H:i:s"));
|
||||||
@@ -346,7 +361,8 @@ if ($action == "edituser")
|
|||||||
{
|
{
|
||||||
if ($downloadpos == 'yes')
|
if ($downloadpos == 'yes')
|
||||||
{
|
{
|
||||||
$modcomment = date("Y-m-d") . " - Download enabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
// $modcomment = date("Y-m-d") . " - Download enabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
||||||
|
$userModifyLogs[] = "Download enabled by " . $CURUSER['username'];
|
||||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_download_rights_restored']);
|
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_download_rights_restored']);
|
||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_download_rights_restored']. $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_you_can_download']);
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_download_rights_restored']. $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_you_can_download']);
|
||||||
$added = sqlesc(date("Y-m-d H:i:s"));
|
$added = sqlesc(date("Y-m-d H:i:s"));
|
||||||
@@ -354,7 +370,8 @@ if ($action == "edituser")
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$modcomment = date("Y-m-d") . " - Download disabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
// $modcomment = date("Y-m-d") . " - Download disabled by " . $CURUSER['username'] . ".\n" . $modcomment;
|
||||||
|
$userModifyLogs[] = "Download disabled by " . $CURUSER['username'];
|
||||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_download_rights_removed']);
|
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_download_rights_removed']);
|
||||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_download_rights_removed'] . $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_probably_reason_three']);
|
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_download_rights_removed'] . $CURUSER['username'] . $lang_modtask_target[get_user_lang($userid)]['msg_probably_reason_three']);
|
||||||
$added = sqlesc(date("Y-m-d H:i:s"));
|
$added = sqlesc(date("Y-m-d H:i:s"));
|
||||||
@@ -362,11 +379,23 @@ if ($action == "edituser")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$updateset[] = "modcomment = " . sqlesc($modcomment);
|
// $updateset[] = "modcomment = " . sqlesc($modcomment);
|
||||||
sql_query("UPDATE users SET " . implode(", ", $updateset) . " WHERE id=$userid") or sqlerr(__FILE__, __LINE__);
|
sql_query("UPDATE users SET " . implode(", ", $updateset) . " WHERE id=$userid") or sqlerr(__FILE__, __LINE__);
|
||||||
if (!empty($banLog)) {
|
if (!empty($banLog)) {
|
||||||
\App\Models\UserBanLog::query()->insert($banLog);
|
\App\Models\UserBanLog::query()->insert($banLog);
|
||||||
}
|
}
|
||||||
|
if (!empty($userModifyLogs)) {
|
||||||
|
$userModifyLogsInsert = [];
|
||||||
|
foreach ($userModifyLogs as $userModifyLog) {
|
||||||
|
$userModifyLogsInsert[] = [
|
||||||
|
"user_id" => $userid,
|
||||||
|
"content" => $userModifyLog,
|
||||||
|
"created_at" => date("Y-m-d H:i:s"),
|
||||||
|
"updated_at" => date("Y-m-d H:i:s"),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
\App\Models\UserModifyLog::query()->insert($userModifyLogsInsert);
|
||||||
|
}
|
||||||
clear_user_cache($userid, $userInfo->passkey);
|
clear_user_cache($userid, $userInfo->passkey);
|
||||||
$returnto = htmlspecialchars($_POST["returnto"]);
|
$returnto = htmlspecialchars($_POST["returnto"]);
|
||||||
header("Location: " . get_protocol_prefix() . "$BASEURL/$returnto");
|
header("Location: " . get_protocol_prefix() . "$BASEURL/$returnto");
|
||||||
|
|||||||
@@ -89,7 +89,12 @@ else
|
|||||||
}
|
}
|
||||||
$date=sqlesc(time());
|
$date=sqlesc(time());
|
||||||
$text=trim($_GET["shbox_text"]);
|
$text=trim($_GET["shbox_text"]);
|
||||||
|
if ($userid > 0) {
|
||||||
|
$lockRes = \Nexus\Database\NexusDB::redis()->set($userid, 1, ['nx', 'ex'=>60]);
|
||||||
|
if ($lockRes !== true){
|
||||||
|
die($lang_shoutbox['speaking_too_often']);
|
||||||
|
}
|
||||||
|
}
|
||||||
sql_query("INSERT INTO shoutbox (userid, date, text, type) VALUES (" . sqlesc($userid) . ", $date, " . sqlesc($text) . ", ".sqlesc($type).")") or sqlerr(__FILE__, __LINE__);
|
sql_query("INSERT INTO shoutbox (userid, date, text, type) VALUES (" . sqlesc($userid) . ", $date, " . sqlesc($text) . ", ".sqlesc($type).")") or sqlerr(__FILE__, __LINE__);
|
||||||
print "<script type=\"text/javascript\">parent.document.forms['shbox'].shbox_text.value='';</script>";
|
print "<script type=\"text/javascript\">parent.document.forms['shbox'].shbox_text.value='';</script>";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -501,6 +501,7 @@ if (user_can('prfmanage') && $user["class"] < get_user_class())
|
|||||||
->orderBy("id", "desc")
|
->orderBy("id", "desc")
|
||||||
->limit(20)
|
->limit(20)
|
||||||
->get()
|
->get()
|
||||||
|
->map(fn ($item) => sprintf("%s - %s", $item->created_at->format("Y-m-d"), $item->content))
|
||||||
->implode("content", "\n")
|
->implode("content", "\n")
|
||||||
;
|
;
|
||||||
tr($lang_userdetails['row_comment'], "<textarea cols=\"60\" rows=\"6\" name=\"modcomment\">".$modcomment."</textarea>", 1);
|
tr($lang_userdetails['row_comment'], "<textarea cols=\"60\" rows=\"6\" name=\"modcomment\">".$modcomment."</textarea>", 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user