Ejemplo n.º 1
0
 function __construct()
 {
     Authentication::require_admin();
     $this->is_admin_page = true;
     // updates?
     $this->update_judge_status();
 }
Ejemplo n.º 2
0
 function __construct()
 {
     // find active entity
     parent::__construct();
     Authentication::require_admin();
     $this->is_admin_page = true;
 }
Ejemplo n.º 3
0
 function __construct()
 {
     Authentication::require_admin();
     $this->is_admin_page = true;
     // find active entity
     parent::__construct();
     // debugging
     $this->debug = false;
 }
Ejemplo n.º 4
0
 function __construct()
 {
     Authentication::require_admin();
     $this->is_admin_page = true;
     parent::__construct();
     // print?
     if (isset($_REQUEST['filled'])) {
         $this->write_print();
         exit;
     }
 }
Ejemplo n.º 5
0
 function __construct()
 {
     Authentication::require_admin();
     $this->is_admin_page = true;
     // find active entity
     parent::__construct();
     // find user
     if (!isset($_REQUEST['userid'])) {
         throw new NotFoundException("Missing parameter: userid");
     }
     $this->user = User::by_id(intval($_REQUEST['userid']));
 }
Ejemplo n.º 6
0
 function __construct()
 {
     Authentication::require_admin();
     $this->is_admin_page = true;
     // find submission
     if (!isset($_REQUEST['submissionid'])) {
         throw new NotFoundException("Missing parameter: submissionid");
     }
     $this->subm = Submission::by_id(intval($_REQUEST['submissionid']));
     $this->entity = $this->subm->entity();
     // rejudge?
     if (isset($_REQUEST['rejudge'])) {
         $this->subm->rejudge();
         // redirect to this page, so a refresh doesn't rejudge again
         Util::redirect('admin_view_submission.php?submissionid=' . $_REQUEST['submissionid']);
     }
     // delete?
     if (isset($_REQUEST['delete'], $_POST['confirm']) && $_POST['confirm'] == sha1('confirmed' . $this->subm->submissionid)) {
         $this->subm->delete();
         Util::redirect('index.php' . $this->entity->path());
     }
 }
Ejemplo n.º 7
0
 function __construct()
 {
     Authentication::require_admin();
     $this->is_admin_page = true;
 }
Ejemplo n.º 8
0
<?php

require_once 'lib/bootstrap.inc';
Authentication::require_admin();
// Show a list of all comments
$p = new Page('');
$p->title = "Re spam filter";
$p->body = '';
if (isset($_POST['confirm'])) {
    // Delete/hide spam
    $total_change = 0;
    foreach (Resolver::find_all_pages('blog') as $page) {
        $comments = Comments::get_all($page->url, true);
        $change = false;
        foreach ($comments as $comment) {
            if ($comment->is_spam() && $comment->visible) {
                $comment->visible = false;
                $change = true;
                $total_change++;
            }
        }
        Comments::set_all($page->url, $comments);
    }
    $p->body .= "Hidden {$total_change} comments";
}
$num_new_spam = 0;
$p->body .= '<table class="spam">';
foreach (Resolver::find_all_pages('blog') as $page) {
    $comments = Comments::get_all($page->url, true);
    $com_body = array();
    foreach ($comments as $comment) {