Ejemplo n.º 1
0
<?php

require_once "config.php";
$page = new AdminPage();
if (isset($_GET['id'])) {
    $rc = new ReleaseComments();
    $rc->deleteComment($_GET['id']);
}
$referrer = $_SERVER['HTTP_REFERER'];
header("Location: " . $referrer);
Ejemplo n.º 2
0
                                    $guid = $admin->settings->queryOneRow('SELECT site_guid FROM sharing');
                                    $guid = $guid === false ? '' : $guid['site_guid'];
                                    (new Sharing(['Settings' => $admin->settings]))->initSettings($guid);
                                    print 'Re-initiated sharing settings!';
                                } else {
                                    if (isset($_GET['purge_site'])) {
                                        $guid = $admin->settings->queryOneRow(sprintf('SELECT site_guid FROM sharing_sites WHERE id = %d', $_GET['purge_site']));
                                        if ($guid === false) {
                                            print 'Error purging site ' . $_GET['purge_site'] . '!';
                                        } else {
                                            $ids = $admin->settings->query(sprintf('SELECT id FROM releasecomment WHERE siteid = %s', $admin->settings->escapeString($guid['site_guid'])));
                                            $total = count($ids);
                                            if ($total > 0) {
                                                $rc = new ReleaseComments($admin->settings);
                                                foreach ($ids as $id) {
                                                    $rc->deleteComment($id['id']);
                                                }
                                            }
                                            $admin->settings->queryExec(sprintf('UPDATE sharing_sites SET comments = 0 WHERE id = %d', $_GET['purge_site']));
                                            print 'Deleted ' . $total . ' comments for site ' . $_GET['purge_site'];
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}