예제 #1
0
             case 'hard':
                 hard_ban_add($post['ip'], $post['ip']);
                 break;
         }
         // Delete posts or attachments.
         switch ($a['del_type']) {
             case 'post':
                 posts_delete($post['id']);
                 break;
             case 'file':
                 posts_attachments_delete_by_post($post['id']);
                 break;
             case 'last':
                 // Delete all posts posted from this IP-address in last
                 // hour.
                 posts_delete_last($post['id'], date(Config::DATETIME_FORMAT, time() - 60 * 60));
                 break;
         }
     }
 }
 if ($f['board'] != '' && ($f['date_time'] != '' || $f['number'] != '' || $f['ip'] != '')) {
     // Filter boards.
     if ($f['board'] == 'all') {
         if ($is_admin) {
             $filter_boards = $boards;
         } else {
             // Cleanup.
             DataExchange::releaseResources();
             Logging::close_log();
             display_error_page($smarty, new NotAdminError());
             exit(1);
예제 #2
0
             DataExchange::releaseResources();
             Logging::close_log();
             display_error_page($smarty, kotoba_last_error());
             exit(1);
         }
     }
     $new_untill = bans_check_untill($_POST['new_untill']);
     bans_add($new_range_beg, $new_range_end, $new_reason, date('Y-m-d H:i:s', time() + $new_untill));
     $reload_bans = true;
     if (isset($_POST['post'])) {
         if (isset($_POST['add_text'])) {
             posts_add_text_by_id(posts_check_id($_POST['post']), $smarty->fetch('uwb4tp.tpl'));
         } elseif (isset($_POST['del_post'])) {
             posts_delete(posts_check_id($_POST['post']));
         } elseif (isset($_POST['del_all'])) {
             posts_delete_last(posts_check_id($_POST['post']), date(Config::DATETIME_FORMAT, time() - 60 * 60));
         }
     }
 }
 // Delete bans.
 foreach ($bans as $ban) {
     if (isset($_POST['delete_' . $ban['id']])) {
         bans_delete_by_id($ban['id']);
         $reload_bans = true;
     }
 }
 // Unban specified ip.
 if (isset($_POST['unban']) && $_POST['unban'] !== '') {
     $ip = bans_check_range_beg($_POST['unban']);
     if ($ip === FALSE) {
         // Cleanup.