aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acm/acm_file.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2014-01-17 17:56:19 -0800
committerNathan Guse <nathaniel.guse@gmail.com>2014-01-17 17:56:19 -0800
commit6c8f217832d1a431a3c382d7de3ccad840d65d7a (patch)
tree7a81eab59c48130c6d01e9f0fb1f90ec75ef819a /phpBB/includes/acm/acm_file.php
parent6ae6dceb4785e40a1dc107588896f926612c6554 (diff)
parent86ee2a470da9592ebbf4df959f14fd5bad20ce7b (diff)
downloadforums-6c8f217832d1a431a3c382d7de3ccad840d65d7a.tar
forums-6c8f217832d1a431a3c382d7de3ccad840d65d7a.tar.gz
forums-6c8f217832d1a431a3c382d7de3ccad840d65d7a.tar.bz2
forums-6c8f217832d1a431a3c382d7de3ccad840d65d7a.tar.xz
forums-6c8f217832d1a431a3c382d7de3ccad840d65d7a.zip
Merge pull request #1949 from prototech/ticket/12110
[ticket/12110] Update Plupload to 2.1.1.
Diffstat (limited to 'phpBB/includes/acm/acm_file.php')
0 files changed, 0 insertions, 0 deletions
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
#!/usr/bin/perl -wT
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
#                 Stephan Niemz  <st.n@gmx.net>
#                 Christopher Aillon <christopher@aillon.com>
#                 Gervase Markham <gerv@gerv.net>

use strict;
use lib ".";

use Bugzilla;
use Bugzilla::Constants;

require "CGI.pl";

# Use global template variables
use vars qw($template $vars);

my $cgi = Bugzilla->cgi;

# If the action is show_bug, you need a bug_id.
# If the action is show_user, you can supply a userid to show the votes for
# another user, otherwise you see your own.
# If the action is vote, your votes are set to those encoded in the URL as 
# <bug_id>=<votes>.
#
# If no action is defined, we default to show_bug if a bug_id is given,
# otherwise to show_user.
my $bug_id = $cgi->param('bug_id');
my $action = $cgi->param('action') || ($bug_id ? "show_bug" : "show_user");

if ($action eq "show_bug" ||
    ($action eq "show_user" && defined $cgi->param('user')))
{
    Bugzilla->login();
}
else {
    Bugzilla->login(LOGIN_REQUIRED);
}

################################################################################
# Begin Data/Security Validation
################################################################################

# Make sure the bug ID is a positive integer representing an existing
# bug that the user is authorized to access.

ValidateBugID($bug_id) if defined $bug_id;

################################################################################
# End Data/Security Validation
################################################################################

if ($action eq "show_bug") {
    show_bug();
} 
elsif ($action eq "show_user") {
    show_user();
}
elsif ($action eq "vote") {
    record_votes();
    show_user();
}
else {
    ThrowCodeError("unknown_action", {action => $action});
}

exit;

# Display the names of all the people voting for this one bug.
sub show_bug {
    my $cgi = Bugzilla->cgi;

    ThrowCodeError("missing_bug_id") unless defined $bug_id;

    my $total = 0;
    my @users;
    
    SendSQL("SELECT profiles.login_name, votes.who, votes.vote_count 
             FROM votes, profiles 
             WHERE votes.bug_id = $bug_id 
               AND profiles.userid = votes.who");
                   
    while (MoreSQLData()) {
        my ($name, $userid, $count) = (FetchSQLData());