use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT :admin $datadir);
-use Bugzilla::User;
require "globals.pl";
-Bugzilla->login(LOGIN_REQUIRED);
+my $user = Bugzilla->login(LOGIN_REQUIRED);
my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
print $cgi->header();
-UserInGroup("tweakparams")
+$user->in_group('tweakparams')
|| ThrowUserError("auth_failure", {group => "tweakparams",
action => "modify",
object => "parameters"});
print $cgi->header();
-UserInGroup("editcomponents")
+$user->in_group('editcomponents')
|| ThrowUserError("auth_failure", {group => "editcomponents",
action => "edit",
object => "components"});
use Bugzilla::Flag;
use Bugzilla::FlagType;
use Bugzilla::Group;
-use Bugzilla::User;
use Bugzilla::Util;
use vars qw( $template $vars );
# Make sure the user is logged in and is an administrator.
-Bugzilla->login(LOGIN_REQUIRED);
-UserInGroup("editcomponents")
+my $user = Bugzilla->login(LOGIN_REQUIRED);
+$user->in_group('editcomponents')
|| ThrowUserError("auth_failure", {group => "editcomponents",
action => "edit",
object => "flagtypes"});
use Bugzilla;
use Bugzilla::Constants;
-use Bugzilla::User;
use Bugzilla::Group;
require "globals.pl";
use vars qw($template $vars);
-Bugzilla->login(LOGIN_REQUIRED);
+my $user = Bugzilla->login(LOGIN_REQUIRED);
print $cgi->header();
-UserInGroup("creategroups")
+$user->in_group('creategroups')
|| ThrowUserError("auth_failure", {group => "creategroups",
action => "edit",
object => "groups"});
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT $datadir);
-use Bugzilla::User;
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
# Preliminary checks:
#
-Bugzilla->login(LOGIN_REQUIRED);
+my $user = Bugzilla->login(LOGIN_REQUIRED);
print $cgi->header();
-UserInGroup("editkeywords")
+$user->in_group('editkeywords')
|| ThrowUserError("auth_failure", {group => "editkeywords",
action => "edit",
object => "keywords"});
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT $datadir);
-use Bugzilla::User;
use Bugzilla::Product;
use Bugzilla::Milestone;
use Bugzilla::Bug;
print $cgi->header();
-UserInGroup("editcomponents")
+$user->in_group('editcomponents')
|| ThrowUserError("auth_failure", {group => "editcomponents",
action => "edit",
object => "milestones"});
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT :admin);
-use Bugzilla::User;
require "globals.pl";
-Bugzilla->login(LOGIN_REQUIRED);
+my $user = Bugzilla->login(LOGIN_REQUIRED);
my $template = Bugzilla->template;
print Bugzilla->cgi->header();
-UserInGroup("tweakparams")
+$user->in_group('tweakparams')
|| ThrowUserError("auth_failure", {group => "tweakparams",
action => "modify",
object => "parameters"});
require "globals.pl";
use Bugzilla::Bug;
use Bugzilla::Series;
-use Bugzilla::User;
use Bugzilla::Config qw(:DEFAULT $datadir);
# Shut up misguided -w warnings about "used only once". "use vars" just
my $cgi = Bugzilla->cgi;
print $cgi->header();
-UserInGroup("editcomponents")
+$user->in_group('editcomponents')
|| ThrowUserError("auth_failure", {group => "editcomponents",
action => "edit",
object => "products"});
use Bugzilla;
use Bugzilla::Constants;
-use Bugzilla::User;
use Bugzilla::User::Setting;
require "globals.pl";
### Live code ###
###################
-Bugzilla->login(LOGIN_REQUIRED);
+my $user = Bugzilla->login(LOGIN_REQUIRED);
my $cgi = Bugzilla->cgi;
print $cgi->header;
-UserInGroup("tweakparams")
+$user->in_group('tweakparams')
|| ThrowUserError("auth_failure", {group => "tweakparams",
action => "modify",
object => "settings"});
# Reject access if there is no sense in continuing.
$editusers
- || Bugzilla->user->can_bless()
+ || $user->can_bless()
|| ThrowUserError("auth_failure", {group => "editusers",
reason => "cant_bless",
action => "edit",
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT $datadir);
-use Bugzilla::User;
use Bugzilla::Product;
use Bugzilla::Version;
# Preliminary checks:
#
-Bugzilla->login(LOGIN_REQUIRED);
+my $user = Bugzilla->login(LOGIN_REQUIRED);
print $cgi->header();
-UserInGroup("editcomponents")
+$user->in_group('editcomponents')
|| ThrowUserError("auth_failure", {group => "editcomponents",
action => "edit",
object => "versions"});
use Bugzilla::User;
use Bugzilla::Group;
# require the user to have logged in
-Bugzilla->login(LOGIN_REQUIRED);
+my $user = Bugzilla->login(LOGIN_REQUIRED);
###############################################################################
# Main Body Execution
my $template = Bugzilla->template;
my $dbh = Bugzilla->dbh;
-my $user = Bugzilla->user;
my $userid = $user->id;
my $sth; # database statement handle
my $events = get_events($userid);
# First see if this user may use whines
-UserInGroup("bz_canusewhines")
+$user->in_group('bz_canusewhines')
|| ThrowUserError("auth_failure", {group => "bz_canusewhines",
action => "schedule",
object => "reports"});