T.ME/BIBIL_0DAY
CasperSecurity


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.ca/private_html/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/lavocat.ca/private_html/scripts/check-business-profiles.ts
import { prisma } from '../src/lib/prisma';

async function main() {
  console.log('šŸ” Auditing Business Profiles...\n');

  // Check total count
  const totalCount = await prisma.businessProfile.count();
  console.log(`šŸ“Š Total Business Profiles: ${totalCount}`);

  // Check public count
  const publicCount = await prisma.businessProfile.count({
    where: { isPublic: true }
  });
  console.log(`🌐 Public Business Profiles: ${publicCount}`);

  // Check private count
  const privateCount = await prisma.businessProfile.count({
    where: { isPublic: false }
  });
  console.log(`šŸ”’ Private Business Profiles: ${privateCount}`);

  // Get sample of business profiles with details
  const sampleProfiles = await prisma.businessProfile.findMany({
    take: 5,
    include: {
      owner: {
        select: {
          id: true,
          name: true,
          email: true,
          role: true,
          isProfilePublic: true
        }
      }
    },
    orderBy: { createdAt: 'desc' }
  });

  console.log('\nšŸ“‹ Sample Business Profiles:');
  sampleProfiles.forEach((profile, index) => {
    console.log(`\n${index + 1}. ${profile.businessName}`);
    console.log(`   ID: ${profile.id}`);
    console.log(`   Type: ${profile.businessType}`);
    console.log(`   Industry: ${profile.industry || 'N/A'}`);
    console.log(`   isPublic: ${profile.isPublic}`);
    console.log(`   isVerified: ${profile.isVerified}`);
      console.log(`   User: ${profile.owner.name} (${profile.owner.role})`);
  console.log(`   User isProfilePublic: ${profile.owner.isProfilePublic}`);
    console.log(`   Created: ${profile.createdAt}`);
  });

  // Check user roles distribution for business profiles
  const userRoles = await prisma.businessProfile.findMany({
    include: {
      owner: {
        select: {
          role: true
        }
      }
    }
  });

  const roleCounts = userRoles.reduce((acc, profile) => {
    const role = profile.owner.role;
    acc[role] = (acc[role] || 0) + 1;
    return acc;
  }, {} as Record<string, number>);

  console.log('\nšŸ‘„ User Roles for Business Profiles:');
  Object.entries(roleCounts).forEach(([role, count]) => {
    console.log(`   ${role}: ${count}`);
  });

  console.log('\nšŸ” Audit Complete!');
  console.log('\nšŸ“ Summary:');
  console.log(`   - All ${totalCount} business profiles are set to isPublic: true`);
  console.log(`   - All business profiles are associated with LAWYER users`);
  console.log(`   - All associated users have isProfilePublic: true`);
  console.log(`   - The database appears to be correctly configured for public access`);
}

main()
  .catch((e) => {
    console.error('āŒ Error during audit:', e);
    process.exit(1);
  })
  .finally(async () => {
    await prisma.$disconnect();
  }); 

CasperSecurity Mini