Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 313095 Details for
Bug 457393
fix admin group inheritance in bugzilla 3.2
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
v1 for admin group inheritcance fix script
group_inherit_fix.pl (text/plain), 2.53 KB, created by
Noura El hawary
on 2008-07-31 13:06:45 UTC
(
hide
)
Description:
v1 for admin group inheritcance fix script
Filename:
MIME Type:
Creator:
Noura El hawary
Created:
2008-07-31 13:06:45 UTC
Size:
2.53 KB
patch
obsolete
>#!/usr/bin/env perl >use strict; >use warnings; >use DBI; > ># script: group_inherit_fix.pl ># descr: script to fix admin group inheritance in bugzilla ># bz: https://bugzilla.redhat.com/show_bug.cgi?id=457393 > >############################################################################### ># connect to the database and open file to write output to >############################################################################### >my $user = 'bugs'; >my $pass = ''; >my $host = ''; > >my $dsn = "dbi:mysql:dbname=bugs;host=$host"; >my $dbh = DBI->connect( > $dsn, $user, $pass, > { PrintError => 0, > RaiseError => 1, > AutoCommit => 1, > } >) or die "Couldn't connect database: " . DBI->errstr; > >my $log_file = 'groups_log'; >open LOGFILE, '>>', $log_file > or die "couldn't open $log_file: $!"; > >################################################################# > >my $sth = $dbh->prepare("SELECT id FROM groups WHERE name = 'admin'"); >$sth->execute(); >my $admin_group_id = $sth->fetchrow; > > >my $select_groups = $dbh->prepare( > "SELECT id > FROM groups > WHERE isbuggroup = ?" >); > >$select_groups->execute(1); > >while (my $group_id = $select_groups->fetchrow) { > > my $grantor_id_1 = 0; > my $grantor_id_2 = 0; > my $query; > > my $select_grantor_id_1 = $dbh->prepare( > "SELECT grantor_id > FROM group_group_map > WHERE member_id = ? > AND grantor_id = ? > AND grant_type = ?"); > > $select_grantor_id_1->execute($admin_group_id, $group_id, 1); > $grantor_id_1 = $select_grantor_id_1->fetchrow; > > if (!$grantor_id_1){ > $query = "INSERT INTO group_group_map (member_id,grantor_id,grant_type) VALUES ($admin_group_id, $group_id, 1)"; > print LOGFILE "$query\n"; > $dbh->do($query); > } > > my $select_grantor_id_2 = $dbh->prepare( > "SELECT grantor_id > FROM group_group_map > WHERE member_id = ? > AND grantor_id = ? > AND grant_type = ?"); > > $select_grantor_id_2->execute($admin_group_id, $group_id, 0); > $grantor_id_2 = $select_grantor_id_2->fetchrow; > > if (!$grantor_id_2){ > $query = "INSERT INTO group_group_map (member_id,grantor_id,grant_type) VALUES ($admin_group_id, $group_id, 0)"; > print LOGFILE "$query\n"; > $dbh->do($query); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
dkl
: review+
Actions:
View
Attachments on
bug 457393
: 313095