mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
fix bannedemails no effect
This commit is contained in:
@@ -72,7 +72,8 @@ class TagResource extends Resource
|
|||||||
Tables\Columns\TextColumn::make('border_radius')->label(__('label.tag.border_radius')),
|
Tables\Columns\TextColumn::make('border_radius')->label(__('label.tag.border_radius')),
|
||||||
Tables\Columns\TextColumn::make('priority')->label(__('label.priority'))->sortable(),
|
Tables\Columns\TextColumn::make('priority')->label(__('label.priority'))->sortable(),
|
||||||
Tables\Columns\TextColumn::make('torrents_count')->label(__('label.tag.torrents_count')),
|
Tables\Columns\TextColumn::make('torrents_count')->label(__('label.tag.torrents_count')),
|
||||||
Tables\Columns\TextColumn::make('updated_at')->dateTime()->label(__('label.updated_at')),
|
Tables\Columns\TextColumn::make('torrents_sum_size')->label(__('label.tag.torrents_sum_size'))->formatStateUsing(fn ($state) => mksize($state)),
|
||||||
|
// Tables\Columns\TextColumn::make('updated_at')->dateTime()->label(__('label.updated_at')),
|
||||||
])
|
])
|
||||||
->defaultSort('priority', 'desc')
|
->defaultSort('priority', 'desc')
|
||||||
->filters([
|
->filters([
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class ListTags extends PageList
|
|||||||
|
|
||||||
protected function getTableQuery(): Builder
|
protected function getTableQuery(): Builder
|
||||||
{
|
{
|
||||||
return Tag::query()->withCount('torrents');
|
return Tag::query()->withCount('torrents')->withSum('torrents', 'size');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,6 +151,11 @@ class TorrentResource extends Resource
|
|||||||
Tables\Filters\SelectFilter::make('hr')
|
Tables\Filters\SelectFilter::make('hr')
|
||||||
->options(self::getYesNoOptions())
|
->options(self::getYesNoOptions())
|
||||||
->label(__('label.torrent.hr')),
|
->label(__('label.torrent.hr')),
|
||||||
|
|
||||||
|
Tables\Filters\SelectFilter::make('tags')
|
||||||
|
->relationship('tags', 'name')
|
||||||
|
->label(__('label.tag.label'))
|
||||||
|
,
|
||||||
])
|
])
|
||||||
->actions(self::getActions())
|
->actions(self::getActions())
|
||||||
->bulkActions(self::getBulkActions());
|
->bulkActions(self::getBulkActions());
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ class UserResource extends Resource
|
|||||||
Tables\Columns\BadgeColumn::make('status')->colors(['success' => 'confirmed', 'warning' => 'pending'])->label(__("label.user.status")),
|
Tables\Columns\BadgeColumn::make('status')->colors(['success' => 'confirmed', 'warning' => 'pending'])->label(__("label.user.status")),
|
||||||
Tables\Columns\BadgeColumn::make('enabled')->colors(['success' => 'yes', 'danger' => 'no'])->label(__("label.user.enabled")),
|
Tables\Columns\BadgeColumn::make('enabled')->colors(['success' => 'yes', 'danger' => 'no'])->label(__("label.user.enabled")),
|
||||||
Tables\Columns\BadgeColumn::make('downloadpos')->colors(['success' => 'yes', 'danger' => 'no'])->label(__("label.user.downloadpos")),
|
Tables\Columns\BadgeColumn::make('downloadpos')->colors(['success' => 'yes', 'danger' => 'no'])->label(__("label.user.downloadpos")),
|
||||||
|
Tables\Columns\BadgeColumn::make('parked')->colors(['success' => 'yes', 'danger' => 'no'])->label(__("label.user.parked")),
|
||||||
Tables\Columns\TextColumn::make('added')->sortable()->dateTime('Y-m-d H:i')->label(__("label.added")),
|
Tables\Columns\TextColumn::make('added')->sortable()->dateTime('Y-m-d H:i')->label(__("label.added")),
|
||||||
Tables\Columns\TextColumn::make('last_access')->dateTime()->label(__("label.last_access")),
|
Tables\Columns\TextColumn::make('last_access')->dateTime()->label(__("label.last_access")),
|
||||||
])
|
])
|
||||||
@@ -93,6 +94,7 @@ class UserResource extends Resource
|
|||||||
Tables\Filters\SelectFilter::make('status')->options(['confirmed' => 'confirmed', 'pending' => 'pending'])->label(__('label.user.status')),
|
Tables\Filters\SelectFilter::make('status')->options(['confirmed' => 'confirmed', 'pending' => 'pending'])->label(__('label.user.status')),
|
||||||
Tables\Filters\SelectFilter::make('enabled')->options(self::$yesOrNo)->label(__('label.user.enabled')),
|
Tables\Filters\SelectFilter::make('enabled')->options(self::$yesOrNo)->label(__('label.user.enabled')),
|
||||||
Tables\Filters\SelectFilter::make('downloadpos')->options(self::$yesOrNo)->label(__('label.user.downloadpos')),
|
Tables\Filters\SelectFilter::make('downloadpos')->options(self::$yesOrNo)->label(__('label.user.downloadpos')),
|
||||||
|
Tables\Filters\SelectFilter::make('parked')->options(self::$yesOrNo)->label(__('label.user.parked')),
|
||||||
])
|
])
|
||||||
->actions([
|
->actions([
|
||||||
Tables\Actions\ViewAction::make(),
|
Tables\Actions\ViewAction::make(),
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
|
|
||||||
|
|
||||||
class Taxonomy extends NexusModel
|
|
||||||
{
|
|
||||||
protected $fillable = [
|
|
||||||
'mode', 'name', 'torrent_field', 'image', 'class_name', 'priority',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::create('taxonomies', function (Blueprint $table) {
|
|
||||||
$table->id();
|
|
||||||
$table->integer('mode')->default(0);
|
|
||||||
$table->string('name');
|
|
||||||
$table->string('torrent_field');
|
|
||||||
$table->string('image')->nullable(true);
|
|
||||||
$table->string('class_name')->nullable(true);
|
|
||||||
$table->integer('priority')->default(0);
|
|
||||||
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('taxonomies');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.0');
|
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.0');
|
||||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-11-23');
|
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-11-24');
|
||||||
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");
|
||||||
|
|||||||
+20
-3
@@ -1481,10 +1481,21 @@ function safe_email($email) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function check_email ($email) {
|
function check_email ($email) {
|
||||||
if(preg_match('/^[A-Za-z0-9][A-Za-z0-9_.+\-]*@[A-Za-z0-9][A-Za-z0-9_+\-]*(\.[A-Za-z0-9][A-Za-z0-9_+\-]*)+$/', $email))
|
if(!preg_match('/^[A-Za-z0-9][A-Za-z0-9_.+\-]*@[A-Za-z0-9][A-Za-z0-9_+\-]*(\.[A-Za-z0-9][A-Za-z0-9_+\-]*)+$/', $email)) {
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
$bannedEmails = mysql_fetch_assoc(sql_query('select * from bannedemails'));
|
||||||
|
$bannedEmailsArr = preg_split('/[\s]+/', $bannedEmails['value'] ?? '');
|
||||||
|
if (empty($bannedEmailsArr)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
foreach ($bannedEmailsArr as $ban) {
|
||||||
|
if (str_ends_with($email, $ban)) {
|
||||||
|
do_log("[BANNED_EMAIL] email: $email is banned by record: $ban");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sent_mail($to,$fromname,$fromemail,$subject,$body,$type = "confirmation",$showmsg=true,$multiple=false,$multiplemail='',$hdr_encoding = 'UTF-8', $specialcase = '') {
|
function sent_mail($to,$fromname,$fromemail,$subject,$body,$type = "confirmation",$showmsg=true,$multiple=false,$multiplemail='',$hdr_encoding = 'UTF-8', $specialcase = '') {
|
||||||
@@ -6011,6 +6022,7 @@ function calculate_harem_addition($uid)
|
|||||||
|
|
||||||
function build_search_box_category_table($mode, $checkboxValue, $categoryHrefPrefix, $taxonomyHrefPrefix, $taxonomyNameLength, $checkedValues = '', array $options = [])
|
function build_search_box_category_table($mode, $checkboxValue, $categoryHrefPrefix, $taxonomyHrefPrefix, $taxonomyNameLength, $checkedValues = '', array $options = [])
|
||||||
{
|
{
|
||||||
|
// dd($checkedValues, $taxonomyNameLength);
|
||||||
$searchBox = \App\Models\SearchBox::query()->with(['categories', 'categories.icon'])->findOrFail($mode);
|
$searchBox = \App\Models\SearchBox::query()->with(['categories', 'categories.icon'])->findOrFail($mode);
|
||||||
$lang = get_langfolder_cookie();
|
$lang = get_langfolder_cookie();
|
||||||
$withTaxonomies = [];
|
$withTaxonomies = [];
|
||||||
@@ -6115,6 +6127,11 @@ TD;
|
|||||||
$checked = '';
|
$checked = '';
|
||||||
if (str_contains($checkedValues, "[{$namePrefix}{$item->id}]") || str_contains($checkedValues, "{$namePrefix}{$item->id}=1")) {
|
if (str_contains($checkedValues, "[{$namePrefix}{$item->id}]") || str_contains($checkedValues, "{$namePrefix}{$item->id}=1")) {
|
||||||
$checked = ' checked';
|
$checked = ' checked';
|
||||||
|
} elseif (!empty($options['user_notifs'])) {
|
||||||
|
$userNotifsKey = sprintf('[%s%s]', substr($torrentField, 0, 3), $item->id);
|
||||||
|
if (str_contains($options['user_notifs'], $userNotifsKey)) {
|
||||||
|
$checked = ' checked';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$tdContent = <<<TDCONTENT
|
$tdContent = <<<TDCONTENT
|
||||||
<label><input type="checkbox" id="{$namePrefix}{$item->id}" name="{$namePrefix}{$item->id}" value="{$checkboxValue}"{$checked} />$afterInput</label>
|
<label><input type="checkbox" id="{$namePrefix}{$item->id}" name="{$namePrefix}{$item->id}" value="{$checkboxValue}"{$checked} />$afterInput</label>
|
||||||
|
|||||||
+1
-1
@@ -983,7 +983,7 @@ if ($allsec != 1 || $enablespecial != 'yes'){ //do not print searchbox if showin
|
|||||||
// }
|
// }
|
||||||
// ?>
|
// ?>
|
||||||
<!-- </table>-->
|
<!-- </table>-->
|
||||||
<?php echo build_search_box_category_table($sectiontype, '1', '?', '?', 0, $_SERVER['QUERY_STRING'], ['select_unselect' => true])?>
|
<?php echo build_search_box_category_table($sectiontype, '1', '?', '?', 0, $_SERVER['QUERY_STRING'], ['select_unselect' => true, 'user_notifs' => $CURUSER['notifs']])?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="rowfollow" valign="middle">
|
<td class="rowfollow" valign="middle">
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ return [
|
|||||||
'two_step_authentication' => 'Two-step authentication',
|
'two_step_authentication' => 'Two-step authentication',
|
||||||
'seed_points' => 'Seed points',
|
'seed_points' => 'Seed points',
|
||||||
'downloadpos' => 'Download privileges',
|
'downloadpos' => 'Download privileges',
|
||||||
|
'parked' => 'Parked',
|
||||||
|
'offer_allowed_count' => 'Offer allowed count',
|
||||||
],
|
],
|
||||||
'medal' => [
|
'medal' => [
|
||||||
'label' => 'Medal',
|
'label' => 'Medal',
|
||||||
@@ -174,6 +176,7 @@ return [
|
|||||||
'padding' => 'Padding',
|
'padding' => 'Padding',
|
||||||
'border_radius' => 'Border radius',
|
'border_radius' => 'Border radius',
|
||||||
'torrents_count' => 'Torrents count',
|
'torrents_count' => 'Torrents count',
|
||||||
|
'torrents_sum_size' => 'Torrents size',
|
||||||
],
|
],
|
||||||
'agent_allow' => [
|
'agent_allow' => [
|
||||||
'label' => 'Agent allow',
|
'label' => 'Agent allow',
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ return [
|
|||||||
'two_step_authentication' => '两步验证',
|
'two_step_authentication' => '两步验证',
|
||||||
'seed_points' => '做种积分',
|
'seed_points' => '做种积分',
|
||||||
'downloadpos' => '下载权限',
|
'downloadpos' => '下载权限',
|
||||||
|
'parked' => '挂起',
|
||||||
|
'offer_allowed_count' => '候选通过数',
|
||||||
],
|
],
|
||||||
'medal' => [
|
'medal' => [
|
||||||
'label' => '勋章',
|
'label' => '勋章',
|
||||||
@@ -174,6 +176,7 @@ return [
|
|||||||
'padding' => '内边距',
|
'padding' => '内边距',
|
||||||
'border_radius' => '边框圆角',
|
'border_radius' => '边框圆角',
|
||||||
'torrents_count' => '种子数',
|
'torrents_count' => '种子数',
|
||||||
|
'torrents_sum_size' => '种子体积',
|
||||||
],
|
],
|
||||||
'agent_allow' => [
|
'agent_allow' => [
|
||||||
'label' => '允许客户端',
|
'label' => '允许客户端',
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ return [
|
|||||||
'two_step_authentication' => '兩步驗證',
|
'two_step_authentication' => '兩步驗證',
|
||||||
'seed_points' => '做種積分',
|
'seed_points' => '做種積分',
|
||||||
'downloadpos' => '下載權限',
|
'downloadpos' => '下載權限',
|
||||||
|
'parked' => '掛起',
|
||||||
|
'offer_allowed_count' => '候選通過數',
|
||||||
],
|
],
|
||||||
'medal' => [
|
'medal' => [
|
||||||
'label' => '勛章',
|
'label' => '勛章',
|
||||||
@@ -174,6 +176,7 @@ return [
|
|||||||
'padding' => '內邊距',
|
'padding' => '內邊距',
|
||||||
'border_radius' => '邊框圓角',
|
'border_radius' => '邊框圓角',
|
||||||
'torrents_count' => '種子數',
|
'torrents_count' => '種子數',
|
||||||
|
'torrents_sum_size' => '種子體積',
|
||||||
],
|
],
|
||||||
'agent_allow' => [
|
'agent_allow' => [
|
||||||
'label' => '允許客戶端',
|
'label' => '允許客戶端',
|
||||||
|
|||||||
@@ -65,6 +65,16 @@
|
|||||||
<td>{{$record->downloadpos}}</td>
|
<td>{{$record->downloadpos}}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{{__('label.user.parked')}}</th>
|
||||||
|
<td>{{$record->parked}}</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{{__('label.user.offer_allowed_count')}}</th>
|
||||||
|
<td>{{$record->offer_allowed_count}}</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{__('label.user.seed_points')}}</th>
|
<th>{{__('label.user.seed_points')}}</th>
|
||||||
<td>{{$record->seed_points}}</td>
|
<td>{{$record->seed_points}}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user