make BUILTIN go away

This commit is contained in:
2025-11-10 16:12:34 -08:00
parent 84ca0907ef
commit 4386165c39
2 changed files with 8 additions and 3 deletions
+2 -2
View File
@@ -53,9 +53,9 @@ if (isset($_GET['group'])) {
if (isset($data['error'])) {
echo "<p>Error: {$data['error']}</p>";
} else {
echo "<table><tr><th>AD Group</th><th>GPO</th><th>Local Group</th></tr>";
echo "<table><tr><th>GPO</th><th>AD Group</th><th>Local Group</th></tr>";
foreach ($data as $item) {
echo "<tr><td>{$item['ad_group']}</td><td>{$item['gpo']}</td><td>{$item['local_group']}</td></tr>";
echo "<tr><td>{$item['gpo']}</td><td>{$item['ad_group']}</td><td>{$item['local_group']}</td></tr>";
}
echo "</table>";
}
+6 -1
View File
@@ -24,10 +24,15 @@ def get_groups():
for detail in details:
# Check if 'ad_group' exists and is not None before accessing it
ad_group = detail.get('ad_group')
# this allows for partial search
if isinstance(ad_group, str) and re.search(re.escape(group_name.lower()), ad_group.lower()):
# i don't like BUILTIN\ so I'm getting rid of it
local_group = detail.get('local_group')
if isinstance(local_group, str) and local_group.startswith("BUILTIN\\"):
local_group = local_group.split("\\", 1)[1]
gpos.append({
"gpo": gpo,
"local_group": detail['local_group'],
"local_group": local_group,
"ad_group": detail['ad_group']
})
return jsonify(gpos)