![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.quebec/public_html/ |
const mysql = require('mysql2/promise');
async function checkUsers() {
const connection = await mysql.createConnection({
host: 'localhost',
user: 'gositeme_avocat',
password: 'TDZEMAwNvFznSKQeDkjY',
database: 'gositeme_avocat'
});
try {
console.log('Checking users in database...\n');
// Check if users table exists
const [tables] = await connection.execute('SHOW TABLES LIKE "users"');
if (tables.length === 0) {
console.log('❌ Users table does not exist!');
return;
}
// Get all users
const [users] = await connection.execute('SELECT id, email, name, role, password FROM users LIMIT 10');
if (users.length === 0) {
console.log('❌ No users found in database!');
} else {
console.log(`✅ Found ${users.length} users:`);
users.forEach((user, index) => {
console.log(`${index + 1}. ID: ${user.id}`);
console.log(` Email: ${user.email}`);
console.log(` Name: ${user.name}`);
console.log(` Role: ${user.role}`);
console.log(` Password: ${user.password.substring(0, 20)}...`);
console.log('');
});
}
// Check for admin users specifically
const [admins] = await connection.execute('SELECT id, email, name, role FROM users WHERE role = "ADMIN" OR role = "SUPERADMIN"');
if (admins.length === 0) {
console.log('❌ No admin users found!');
} else {
console.log(`✅ Found ${admins.length} admin users:`);
admins.forEach((admin, index) => {
console.log(`${index + 1}. ${admin.email} (${admin.role})`);
});
}
} catch (error) {
console.error('Database error:', error.message);
} finally {
await connection.end();
}
}
checkUsers();