diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index e63191f9..87d6e4ba 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -43,6 +43,9 @@ use JeroenG\Explorer\Infrastructure\Scout\ElasticEngine; use League\Flysystem\StorageAttributes; use Nexus\Database\NexusDB; use Nexus\Imdb\Imdb; +use NexusPlugin\Menu\Filament\MenuItemResource\Pages\ManageMenuItems; +use NexusPlugin\Menu\MenuRepository; +use NexusPlugin\Menu\Models\MenuItem; use NexusPlugin\PostLike\PostLikeRepository; use NexusPlugin\StickyPromotion\Models\StickyPromotion; use NexusPlugin\StickyPromotion\Models\StickyPromotionParticipator; @@ -83,14 +86,8 @@ class Test extends Command */ public function handle() { - $ip = '116.30.133.129'; -// $ip = '240e:3a1:680c:bb11:211:32ff:fe2c:a603'; -// $ipObj = IPBlock::create($ip); -// $ipObj = IP::create($ip); -// $r = $ipObj->getVersion(); - $r = isIPSeedBox('116.30.133.129', 1); -// $r = get_ip_location_from_geoip('116.30.133.129'); - dd($r); + $menuRep = new MenuRepository(); + $menuRep->filterBuildMenu(); } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 6313b4dc..18a6889e 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -11,6 +11,7 @@ use Illuminate\Http\Resources\Json\JsonResource; use Nexus\Nexus; use Filament\Facades\Filament; use Illuminate\Contracts\View\View; +use NexusPlugin\Menu\Filament\MenuItemResource; class AppServiceProvider extends ServiceProvider { @@ -21,7 +22,7 @@ class AppServiceProvider extends ServiceProvider */ public function register() { - // + do_action('nexus_register'); } /** @@ -47,5 +48,6 @@ class AppServiceProvider extends ServiceProvider // fn (): View => view('filament.footer'), // ); + do_action('nexus_boot'); } } diff --git a/include/constants.php b/include/constants.php index 523f1ffc..a02c9c21 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ "); - + $menu = apply_filter('nexus_menu'); + print ("
"); + if ($menu) { + print $menu; + } else { + print (""); + } + print ("
"); if ($CURUSER){ if ($where_tweak == 'yes') $USERUPDATESET[] = "page = ".sqlesc($selected); @@ -5641,9 +5649,13 @@ function get_smile($num) return $all[$num] ?? null; } -function username_under_torrent() +function get_filament_class_alias($class): string { - + return Str::of($class) + ->replace(['/', '\\'], '.') + ->explode('.') + ->map([Str::class, 'kebab']) + ->implode('.'); } /** diff --git a/public/confirm_resend.php b/public/confirm_resend.php index b2fc94a5..a64f58ba 100644 --- a/public/confirm_resend.php +++ b/public/confirm_resend.php @@ -32,35 +32,35 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") $email = unesc(htmlspecialchars(trim($_POST["email"]))); $wantpassword = unesc(htmlspecialchars(trim($_POST["wantpassword"]))); $passagain = unesc(htmlspecialchars(trim($_POST["passagain"]))); - + $email = safe_email($email); if (empty($wantpassword) || empty($passagain) || empty($email)) bark($lang_confirm_resend['std_fields_blank']); - + if (!check_email($email)) failedlogins($lang_confirm_resend['std_invalid_email_address'],true); $res = sql_query("SELECT * FROM users WHERE email=" . sqlesc($email) . " LIMIT 1") or sqlerr(__FILE__, __LINE__); $arr = mysql_fetch_assoc($res) or failedlogins($lang_confirm_resend['std_email_not_found'],true); if($arr["status"] != "pending") failedlogins($lang_confirm_resend['std_user_already_confirm'],true); - + if ($wantpassword != $passagain) bark($lang_confirm_resend['std_passwords_unmatched']); - + if (strlen($wantpassword) < 6) bark($lang_confirm_resend['std_password_too_short']); - + if (strlen($wantpassword) > 40) bark($lang_confirm_resend['std_password_too_long']); - + if ($wantpassword == $wantusername) bark($lang_confirm_resend['std_password_equals_username']); - + $secret = mksecret(); $wantpasshash = md5($secret . $wantpassword . $secret); $editsecret = ($verification == 'admin' ? '' : $secret); sql_query("UPDATE users SET passhash=" .sqlesc($wantpasshash) . ",secret=" . sqlesc($secret) . ",editsecret=" . sqlesc($editsecret) . " WHERE id=" . sqlesc($arr["id"])) or sqlerr(__FILE__, __LINE__); - + if (!mysql_affected_rows()) stderr($lang_confirm_resend['std_error'], $lang_confirm_resend['std_database_error']); @@ -69,29 +69,29 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") $usern = $arr["username"]; $id = $arr["id"]; $title = $SITENAME.$lang_confirm_resend['mail_title']; - + $baseUrl = getSchemeAndHttpHost(); $body = << + {$lang_confirm_resend['mail_this_link']}
-http://$BASEURL/confirm.php?id=$id&secret=$psecret +{$baseUrl}/confirm.php?id=$id&secret=$psecret {$lang_confirm_resend['mail_four_1']} -{$lang_confirm_resend['mail_here']}
-http://$BASEURL/confirm_resend.php +{$lang_confirm_resend['mail_here']}
+{$baseUrl}/confirm_resend.php
{$lang_confirm_resend['mail_five']} EOD; - + sent_mail($email,$SITENAME,$SITEEMAIL,$title,$body,"signup",false,false,''); - header("Location: " . get_protocol_prefix() . "$BASEURL/ok.php?type=signup&email=" . rawurlencode($email)); + header("Location: " . "{$baseUrl}/ok.php?type=signup&email=" . rawurlencode($email)); } else { stdhead(); $s = "