Script erstellt
This commit is contained in:
47
admin-check.php
Executable file
47
admin-check.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
// Einfacher Admin-User Check
|
||||
echo "<h1>🔍 Admin-User Check</h1>";
|
||||
|
||||
try {
|
||||
// Laravel laden
|
||||
require_once 'vendor/autoload.php';
|
||||
$app = require_once 'bootstrap/app.php';
|
||||
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
|
||||
|
||||
// User Model verwenden
|
||||
$users = \App\Models\User::all();
|
||||
|
||||
echo "<h2>Benutzer in der Datenbank:</h2>";
|
||||
if ($users->count() > 0) {
|
||||
echo "<p>✅ <strong>{$users->count()}</strong> Benutzer gefunden</p>";
|
||||
|
||||
foreach ($users as $user) {
|
||||
echo "<div style='border: 1px solid #ccc; padding: 10px; margin: 5px;'>";
|
||||
echo "<strong>ID:</strong> {$user->id}<br>";
|
||||
echo "<strong>Name:</strong> {$user->name}<br>";
|
||||
echo "<strong>Email:</strong> {$user->email}<br>";
|
||||
echo "<strong>Erstellt:</strong> {$user->created_at}<br>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
// Admin-User prüfen
|
||||
$admin = \App\Models\User::where('email', 'admin@neonail.com')->first();
|
||||
if ($admin) {
|
||||
echo "<h2>👑 Admin-User gefunden!</h2>";
|
||||
echo "<p>Sie können sich mit <strong>admin@neonail.com</strong> anmelden.</p>";
|
||||
echo "<p><a href='http://192.168.30.81' style='background: #007bff; color: white; padding: 10px; text-decoration: none; border-radius: 5px;'>🚀 Zur Anwendung</a></p>";
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "<p>❌ Keine Benutzer gefunden</p>";
|
||||
echo "<h3>Admin-User erstellen:</h3>";
|
||||
echo "<code>php artisan tinker</code><br>";
|
||||
echo "<code>use App\Models\User;</code><br>";
|
||||
echo "<code>User::create(['name' => 'Admin', 'email' => 'admin@neonail.com', 'password' => bcrypt('ihr_passwort')]);</code>";
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo "<h2>❌ Fehler:</h2>";
|
||||
echo "<p>{$e->getMessage()}</p>";
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user