web/html/network/systems/ssm/channels/base_channel_alteration.pxt | 50 --
web/modules/rhn/RHN/Channel.pm | 22 -
web/modules/rhn/RHN/DB/Channel.pm | 32 -
web/modules/rhn/RHN/DB/Server.pm | 107 -----
web/modules/rhn/RHN/DB/ServerActions.pm | 40 -
web/modules/rhn/RHN/DB/Set.pm | 46 --
web/modules/rhn/RHN/SatInstall.pm | 17
web/modules/sniglets/Sniglets/Channel.pm | 211 ----------
web/modules/sniglets/Sniglets/Servers.pm | 40 -
9 files changed, 565 deletions(-)
New commits:
commit 7c018be53accfb901099dae94c93f84d51ec9388
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 22:03:29 2010 +0100
Removal of sscd_base_channel_alteration made user_subscribable_base_channels unused,
removing.
diff --git a/web/modules/rhn/RHN/DB/Channel.pm b/web/modules/rhn/RHN/DB/Channel.pm
index 19a9a2f..4403efa 100644
--- a/web/modules/rhn/RHN/DB/Channel.pm
+++ b/web/modules/rhn/RHN/DB/Channel.pm
@@ -575,38 +575,6 @@ EOQ
}
-sub user_subscribable_base_channels {
- my $self = shift;
- my %params = validate(@_, {user_id => 1, org_id => 1});
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- my $sth;
-
- $query = <<EOQ;
-SELECT C.id, C.name
- FROM rhnChannel C,
- rhnUserChannel UC
- WHERE UC.user_id = :user_id
- AND UC.role = 'subscribe'
- AND UC.channel_id = C.id
- AND C.parent_channel IS NULL
- AND C.org_id = :org_id
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute_h(user_id => $params{user_id}, org_id => $params{org_id});
-
- my @channels;
-
- while (my @row = $sth->fetchrow) {
- push @channels, [ @row ];
- }
-
- return @channels;
-}
-
sub package_groups {
my $class = shift;
my $channel_id = shift;
commit 21f29fa394037d8b9f9e9315f20f14043496f0ae
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 22:02:41 2010 +0100
Removal of sscd_base_channel_alteration made system_set_base_channels unused,
removing.
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index 58e326b..f4174cc 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -2107,39 +2107,6 @@ sub _blank_server {
}
-sub system_set_base_channels {
- my $class = shift;
- my $user_id = shift;
-
- my $dbh = RHN::DB->connect();
- my $query;
- my $sth;
-
- $query = <<EOQ;
-SELECT C.id, C.name, COUNT(C.id)
- FROM rhnChannel C,
- rhnServerChannel SC,
- rhnSet ST
- WHERE ST.user_id = ?
- AND ST.label = 'system_list'
- AND ST.element = SC.server_id
- AND SC.channel_id = C.id
- AND C.parent_channel IS NULL
-GROUP BY C.id, C.name
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute($user_id);
-
- my @ret;
- while (my @row = $sth->fetchrow) {
- push @ret, [ @row ];
- }
-
- return @ret;
-}
-
-
# retrieve a server given its unique id.
sub lookup {
commit 7d344b867a1186d81b452ca8b14a8bc9e9c5a7b1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 22:00:03 2010 +0100
Removal of sscd_change_base_channels_cb made schedule_errata_cache_update unused,
removing.
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index d3726bc..58e326b 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -2541,31 +2541,6 @@ EOS
return (\@p_added_rows, \@p_deleted_rows, $p_unchanged);
}
-sub schedule_errata_cache_update {
- my $class = shift;
-
- my $org_id = shift;
- my $sid = shift;
- my $delay = shift || 0;
-
- die "Org id and Server id required"
- unless ($org_id && $sid);
-
- my $now = RHN::Date->now->long_date;
- $delay = $delay / (24*60*60);
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare(<<EOQ);
-INSERT INTO rhnTaskQueue
- (org_id, task_name, task_data, priority, earliest)
-VALUES (?, 'update_server_errata_cache', ?, 0, TO_DATE(?, 'YYYY-MM-DD
HH24:MI:SS') + ?)
-EOQ
-
- $sth->execute($org_id, $sid, $now, $delay);
-
- $dbh->commit;
-}
-
# eids of applicable errata for which the server does not have a
# pending update action
#
commit 40806d8b96fcc2621dd8c9105f2a6a7d40b7efaa
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 21:57:36 2010 +0100
Removal of sscd_change_base_channels_cb made system_set_change_base_channels unused,
removing.
diff --git a/web/modules/rhn/RHN/DB/ServerActions.pm
b/web/modules/rhn/RHN/DB/ServerActions.pm
index 79de043..0ccceed 100644
--- a/web/modules/rhn/RHN/DB/ServerActions.pm
+++ b/web/modules/rhn/RHN/DB/ServerActions.pm
@@ -92,46 +92,6 @@ sub remove_set_from_group {
}
-sub system_set_change_base_channels {
- my $class = shift;
- my $user_id = shift;
- my $to_defaults_ref = shift; # array of base id's to go to default RH base
channel
- my $from_to_ref = shift; # array of [ from_id, to_id ]'s...
- my $transaction;
-
-
- my $dbh = $transaction || RHN::DB->connect();
-
- my $query = <<EOQ;
-BEGIN
- rhn_channel.bulk_guess_server_base_from(?, ?, ?);
-END;
-EOQ
-
- my $sth = $dbh->prepare($query);
-
- foreach my $from (@{$to_defaults_ref}) {
- $sth->execute('system_list', $user_id, $from);
- }
-
- $query = <<EOQ;
-BEGIN
- rhn_channel.bulk_server_basechange_from(?, ?, ?, ?);
-END;
-EOQ
-
- $sth = $dbh->prepare($query);
-
- foreach my $from_to (@{$from_to_ref}) {
- $sth->execute('system_list', $user_id, $from_to->[0],
$from_to->[1]);
- }
-
- $dbh->commit unless $transaction;
-
- return $dbh;
-}
-
-
sub subscribe_set_to_channel {
my $class = shift;
my $set = shift;
commit 19011f94b49a1c8a17ef2d8d6ae17fd3c6276985
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 21:53:44 2010 +0100
Removal of sscd_change_base_channels_cb made num_proxies_in_set and
num_satellites_in_set unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Set.pm b/web/modules/rhn/RHN/DB/Set.pm
index cebf2f0..98d89cd 100644
--- a/web/modules/rhn/RHN/DB/Set.pm
+++ b/web/modules/rhn/RHN/DB/Set.pm
@@ -253,52 +253,6 @@ EOQ
}
-sub num_proxies_in_set {
- my $self = shift;
-
- my $dbh = RHN::DB->connect;
- my $query;
-
- $query = <<EOQ;
-SELECT COUNT(ST.element)
- FROM rhnProxyInfo PI,
- rhnSet ST
- WHERE ST.user_id = ?
- AND ST.label = ?
- AND ST.element = PI.server_id
-EOQ
- my $sth = $dbh->prepare($query);
- $sth->execute($self->uid, $self->label);
-
- my ($count) = $sth->fetchrow;
- $sth->finish();
-
- return $count;
-}
-
-sub num_satellites_in_set {
- my $self = shift;
-
- my $dbh = RHN::DB->connect;
- my $query;
-
- $query = <<EOQ;
-SELECT COUNT(ST.element)
- FROM rhnSatelliteInfo SI,
- rhnSet ST
- WHERE ST.user_id = ?
- AND ST.label = ?
- AND ST.element = SI.server_id
-EOQ
- my $sth = $dbh->prepare($query);
- $sth->execute($self->uid, $self->label);
-
- my ($count) = $sth->fetchrow;
- $sth->finish();
-
- return $count;
-}
-
sub remove_scheduled_errata_for_system {
my $self = shift;
my $sid = shift;
commit 95f2dcb6c6582fc0fc201982d6fe7f110ad23597
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 21:51:46 2010 +0100
Removal of base_channel_alteration.pxt made rhn-sscd-base-channel-alteration and
sscd_base_channel_alteration unused, removing.
diff --git a/web/modules/sniglets/Sniglets/Channel.pm
b/web/modules/sniglets/Sniglets/Channel.pm
index 441b4fc..c118460 100644
--- a/web/modules/sniglets/Sniglets/Channel.pm
+++ b/web/modules/sniglets/Sniglets/Channel.pm
@@ -42,7 +42,6 @@ sub register_tags {
$pxt->register_tag('rhn-resubscribe-warning-ssm' =>
\&resubscribe_warning_ssm, 3);
- $pxt->register_tag('rhn-sscd-base-channel-alteration' =>
\&sscd_base_channel_alteration);
$pxt->register_tag('viewed_channel_name' => \&viewed_channel_name,
-10);
}
@@ -71,63 +70,6 @@ sub resubscribe_warning_ssm {
-sub sscd_base_channel_alteration {
- my $pxt = shift;
- my %params = @_;
-
- my $block = $params{__block__};
-
- my @system_set_base_channels =
RHN::Server->system_set_base_channels($pxt->user->id);
-
- my $ds = new RHN::DataSource::System (-mode =>
'systems_in_set_with_no_base_channel');
- my $systems_without_base_channel = $ds->execute_query(-user_id =>
$pxt->user->id);
-
- if (@{$systems_without_base_channel}) {
- unshift @system_set_base_channels, [ 0, '(none)', scalar
@{$systems_without_base_channel} ];
- }
-
- $block =~ m{<base_channel>(.*?)</base_channel>}ism;
- my $channel_block = $1;
-
- my @subscribable_base_channels =
RHN::Channel->user_subscribable_base_channels(user_id => $pxt->user->id,
- org_id => $pxt->user->org_id);
-
- my $no_change_opt = ['No Change', '__no_change__', 1];
- my $default_opt = [ 'Default RH Base Channel', '__default__', undef ];
- my @base_channels = map { [ $_->[1], $_->[0] ] } @subscribable_base_channels;
-
- my $channels = '';
- foreach my $base_channel (@system_set_base_channels) {
-
- my %current;
-
- my @options = ($no_change_opt);
-
- my $can_sub_ds = new RHN::DataSource::Channel(-mode =>
'can_subscribe_to_default_in_set');
- my $can_sub_results = $can_sub_ds->execute_full(-user_id =>
$pxt->user->id);
- if (@$can_sub_results and $can_sub_results->[0]->{CHANNEL_ID}) {
- push @options, $default_opt;
- }
-
- push @options, @base_channels;
-
- my @filtered_options = grep { $_->[1] ne $base_channel->[0] } @options;
- my $drop_down_box = PXT::HTML->select(-name =>
"desired_base_channel_from-" . $base_channel->[0],
- -options => \@filtered_options);
-
- $current{base_channel_id} = $base_channel->[0];
- $current{base_channel_name} = $base_channel->[1];
- $current{system_count} = $base_channel->[2];
- $current{drop_down_box} = $drop_down_box;
-
- $channels .= PXT::Utils->perform_substitutions($channel_block, \%current);
- }
-
- $block =~ s{<base_channel>.*?</base_channel>}{$channels}ism;
-
- return $block;
-}
-
sub channel_gpg_key {
my $pxt = shift;
my %params = @_;
commit 5fe5f38adae6addac2a91cb2fef20392147f9ed1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 21:49:44 2010 +0100
Removal of user_subscribable_bases_for_system made verify_channel_arch_compat unused,
removing.
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index 83ddca7..d3726bc 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -859,30 +859,6 @@ EOQ
return $columns[0];
}
-sub verify_channel_arch_compat {
- my $self = shift;
- my $cid = shift;
-
- throw "No cid" unless $cid;
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare(<<EOQ);
-SELECT 1
- FROM rhnChannel C, rhnServerChannelArchCompat SCAC, rhnServer S
- WHERE S.id = :sid
- AND SCAC.server_arch_id = S.server_arch_id
- AND C.id = :cid
- AND SCAC.channel_arch_id = C.channel_arch_id
-EOQ
-
- $sth->execute_h(sid => $self->id, cid => $cid);
- my ($compat) = $sth->fetchrow;
-
- $sth->finish;
-
- return ($compat ? 1 : 0);
-}
-
# given a channel family label and server_id, return the child channels
# the server could be subscribed to, if any
sub child_channel_candidates {
commit 86fcdd268bd4831b44100c8e3066c1b79481977a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 21:47:48 2010 +0100
Removal of user_subscribable_bases_for_system and sscd_change_base_channels_cb made
default_base_channel unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index 6632fba..83ddca7 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -859,31 +859,6 @@ EOQ
return $columns[0];
}
-#returns the default base channel, from rhnServer.arch, .os, and .release
-sub default_base_channel {
- my $self = shift;
- my $sid = (ref $self) ? $self->id : shift;
-
- my $dbh = RHN::DB->connect;
- my $default_base_id;
-
- eval {
- $default_base_id = $dbh->call_function('rhn_channel.guess_server_base',
$sid);
- };
-
- if ($@) {
- my $E = $@;
-
- # if it's anything other not function not returning a value, toss
- # the exception further up the chain...
- unless ($E =~ m/ORA-06503/) {
- throw $E;
- }
- }
-
- return $default_base_id;
-}
-
sub verify_channel_arch_compat {
my $self = shift;
my $cid = shift;
commit 18cb394bf46f1907f3f11359c4818c59c0088b92
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 21:44:00 2010 +0100
base_channel_alteration.pxt is now replaced by
/rhn/channel/ssm/BaseChannelSubscribe.do, removing.
Also removing sscd_change_base_channels_cb which was the only
place referencing base_channel_alteration.pxt, and
rhn:sscd_change_base_channels_cb which was only in base_channel_alteration.pxt,.
diff --git a/web/html/network/systems/ssm/channels/base_channel_alteration.pxt
b/web/html/network/systems/ssm/channels/base_channel_alteration.pxt
deleted file mode 100644
index 859078e..0000000
--- a/web/html/network/systems/ssm/channels/base_channel_alteration.pxt
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
- <pxt-use class="Grail::Frame" />
- <pxt-use class="Sniglets::ListUtils" />
- <pxt-use class="Sniglets::Channel" />
- <pxt-use class="Sniglets::HTML" />
-
- <grail-canvas-template base="/templates/c.pxt"
mode="main_canvas">
-
- <h1><img src="/img/rhn-icon-system_group.gif" alt="system
set" /> System Set Manager <rhn-help
href="s1-sm-systems.jsp#s2-sm-ssm" /></h1>
-
- <rhn-navi-nav prefix="system_set_manager" depth="0"
file="/nav/ssm.xml" style="contentnav" />
-
-
-<h2>Base Channel Alteration</h2>
-
-<p>As a Channel Administrator, you may change the base channels your systems are
subscribed to. Valid channels are either channels created by your organization, or the
default Red Hat base channel for your operating system version and processor type.
Systems will be unsubscribed from all channels, and subscribed to their new base
channels.</p>
-
-<p><strong>This operation can have a dramatic effect on the packages and
errata available to the systems, and should be used with
caution.</strong></p>
-
-<rhn-sscd-base-channel-alteration>
-<pxt-form method="post">
-<table width="100%" border="0" cellpadding="6"
cellspacing="0">
- <tr>
- <td><strong>Current Base Channel</strong></td>
- <td align="center"><strong>Systems</strong></td>
- <td><strong>Desired Base Channel</strong></td>
- </tr>
-<base_channel>
- <tr>
- <td>{base_channel_name}</td>
- <td align="center">{system_count}</td>
- <td>{drop_down_box}</td>
- </tr>
-</base_channel>
-</table>
-
-<div align="right">
-<hr />
-
-<input type="submit" value="Change Base Channels" />
-<input type="hidden" name="pxt:trap"
value="rhn:sscd_change_base_channels_cb" />
-</div>
-
-</pxt-form>
-</rhn-sscd-base-channel-alteration>
-
- </grail-canvas-template>
-
-</pxt-passthrough>
diff --git a/web/modules/sniglets/Sniglets/Channel.pm
b/web/modules/sniglets/Sniglets/Channel.pm
index 69e238a..441b4fc 100644
--- a/web/modules/sniglets/Sniglets/Channel.pm
+++ b/web/modules/sniglets/Sniglets/Channel.pm
@@ -51,7 +51,6 @@ sub register_callbacks {
my $pxt = shift;
# sscd
- $pxt->register_callback('rhn:sscd_change_base_channels_cb' =>
\&sscd_change_base_channels_cb);
$pxt->register_callback('rhn:sscd_alter_channel_membership_cb' =>
\&sscd_alter_channel_membership_cb);
$pxt->register_callback('rhn:globally_subscribable_cb' =>
\&globally_subscribable_cb);
}
@@ -72,158 +71,6 @@ sub resubscribe_warning_ssm {
-sub sscd_change_base_channels_cb {
- my $pxt = shift;
-
- my $set = new RHN::DB::Set 'system_list', $pxt->user->id;
-
- my $count_proxies = $set->num_proxies_in_set();
- my $count_sats = $set->num_satellites_in_set();
-
- my $sats_or_proxies_in_set;
-
- if ($count_proxies + $count_sats > 0 ) {
- $sats_or_proxies_in_set = 1;
- }
-
- my @dest_values = grep { /desired_base_channel_from-/ } $pxt->param();
-
- my @from_to;
- my @to_defaults;
-
- # all the non-default channel ids...
- my %ids = map { $pxt->dirty_param($_) =~ m/\d/ ? ($_ => $pxt->dirty_param($_))
: () } @dest_values;
-
- # make sure I'm allowed to see the destination channels (other than red hat
default...)
- die "no access to channels: " . join(", ", values %ids) unless
$pxt->user->verify_channel_access(values %ids);
-
- my $will_be_ignored = 0;
- my $orphan_destination;
- foreach my $dest (@dest_values) {
- my $from_id = (split( /[-]/, $dest))[-1];
-
- # verification of values happened above...
- my $to_id = $pxt->dirty_param($dest);
-
- next unless $to_id;
-
- # ignore __no_change__ and __default__ values for now...
- if ($from_id == 0 and ($to_id ne '__no_change__')) {
- $orphan_destination = $to_id;
- }
- elsif ($to_id =~ m/\d/) {
- push @from_to, [ $from_id, $to_id ];
- }
- elsif ($to_id eq '__default__') {
- push @to_defaults, $from_id;
- }
- }
-
- my $subscribe_perms_error_msg = <<EOM;
-You no longer have subscription access to some of the channels you selected.<br />
-Please review your selections and try again.
-EOM
-
- if (not $pxt->user->verify_channel_subscribe(map { $_->[1] } @from_to)) {
- $pxt->push_message(local_alert => $subscribe_perms_error_msg);
-
$pxt->redirect("/network/systems/ssm/channels/base_channel_alteration.pxt");
- }
-
- my $ds = new RHN::DataSource::System (-mode =>
'systems_in_set_with_no_base_channel');
- my $systems_without_base_channel = $ds->execute_query(-user_id =>
$pxt->user->id);
-
- my $base_not_found;
- my $incompatible_base = 0;
-
- my $transaction = RHN::DB->connect();
-
- eval {
- if (@{$systems_without_base_channel} and $orphan_destination) {
- foreach my $sid (map { $_->{ID} } @{$systems_without_base_channel}) {
- my $server = RHN::Server->lookup(-id => $sid);
-
- # don't mess w/ satellites or proxies...
- if ($server->is_satellite() or $server->is_proxy()) {
- next;
- }
-
- my $cid = $orphan_destination;
- if ($cid eq '__default__') {
- $cid = $server->default_base_channel;
- }
-
- if ($cid) {
-
- if ($pxt->user->verify_channel_subscribe($cid) and
$server->verify_channel_arch_compat($cid)) {
- $transaction = $server->subscribe_to_channel($cid, $transaction);
- }
- elsif (not $pxt->user->verify_channel_subscribe($cid)) {
- throw '(no_subscribe_permissions)';
- }
- else {
- $incompatible_base++;
- }
- }
- else {
- $base_not_found = 1;
- }
- }
- }
-
- RHN::ServerActions->system_set_change_base_channels($pxt->user->id,
- \@to_defaults,
- \@from_to,
- $transaction);
-
- # this probably snapshots some systems in the set that aren't needed.
- # it'll be nice if and when snapshot_server is smart enough to not do anything
- # if it's not needed...
- RHN::Server->snapshot_set(-reason => "Base channel change",
- -set_label => 'system_list',
- -user_id => $pxt->user->id);
- };
-
- if ($@) {
- my $E = $@;
- if (ref $E and $E->is_rhn_exception('channel_family_no_subscriptions')) {
- $transaction->rollback();
- $pxt->push_message(local_alert => "This operation would exceed your
allowed subscriptions in one or more channels; no changes made.");
-
$pxt->redirect('/network/systems/ssm/channels/base_channel_alteration.pxt');
- }
- elsif (ref $E and $E->is_rhn_exception('no_subscribe_permissions')) { ###
FIXME!!!!
- # whole transaction borks?
- $transaction->rollback();
- $pxt->push_message(local_alert => $subscribe_perms_error_msg);
-
$pxt->redirect('/network/systems/ssm/channels/base_channel_alteration.pxt');
- }
- else {
- $transaction->rollback();
- throw $E;
- }
- }
- else {
- $transaction->commit();
- }
-
- my $system_set = new RHN::DB::Set 'system_list', $pxt->user->id;
- my @servers = $system_set->contents;
-
- foreach my $sid (@servers) {
- RHN::Server->schedule_errata_cache_update($pxt->user->org_id, $sid, 0);
- }
-
- # message to the user...
- $pxt->push_message(site_info => "Channel changes submitted.");
-
- $pxt->push_message(site_info => 'Note: RHN Proxy and ' .
PXT::Config->get("product_name") . ' systems may not be changed from
their base channel.') if $sats_or_proxies_in_set;
-
- $pxt->push_message(site_info => 'Note: Some systems could not find their
default Red Hat base channel and remain unaltered.') if $base_not_found;
-
- $pxt->push_message(site_info => 'Note: Some systems did not change channel
subscription because the base channel selected was not compatible with their system
architecture.') if $incompatible_base;
-
-
$pxt->redirect('/network/systems/ssm/channels/base_channel_alteration.pxt');
-}
-
sub sscd_base_channel_alteration {
my $pxt = shift;
my %params = @_;
commit 08166f363f494199588e80c046a306402fda2863
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 21:34:29 2010 +0100
Removal of system_base_channel_select made user_subscribable_bases_for_system unused,
removing.
diff --git a/web/modules/rhn/RHN/Channel.pm b/web/modules/rhn/RHN/Channel.pm
index a7c6f56..e95d86f 100644
--- a/web/modules/rhn/RHN/Channel.pm
+++ b/web/modules/rhn/RHN/Channel.pm
@@ -36,26 +36,4 @@ sub lookup {
}
}
-sub user_subscribable_bases_for_system {
- my $class = shift;
- my $system = shift;
- my $user = shift;
-
- my $ds = new RHN::DataSource::Channel(-mode =>
'base_channels_owned_by_org');
- my $channels = $ds->execute_query(-org_id => $user->org_id);
- my @ret = @$channels;
-
- my $default_base = $system->default_base_channel;
- if (defined $default_base) {
- my $channel = RHN::Channel->lookup(-id => $default_base);
- unshift @ret, { map { uc $_ => $channel->$_() } qw/id name label/ };
- }
-
- # filter out the channels a user doesn't have access to...
- @ret = grep { $user->verify_channel_subscribe($_->{ID}) } @ret;
- @ret = grep { $system->verify_channel_arch_compat($_->{ID}) } @ret;
-
- return @ret;
-}
-
1;
commit 740456397fffb46847dfb2f3a2492ab521e9c497
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 21:32:54 2010 +0100
rhn-system-base-channel-select is not used, removing, as well as
system_base_channel_select.
diff --git a/web/modules/sniglets/Sniglets/Servers.pm
b/web/modules/sniglets/Sniglets/Servers.pm
index 0308b0c..d383b5e 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -72,8 +72,6 @@ sub register_tags {
$pxt->register_tag('rhn-server-history-event-details' =>
\&server_history_event_details);
- $pxt->register_tag('rhn-system-base-channel-select' =>
\&system_base_channel_select);
-
$pxt->register_tag('rhn-proxy-entitlement-form' =>
\&proxy_entitlement_form);
$pxt->register_tag('rhn-system-pending-actions-count' =>
\&system_pending_actions_count);
@@ -1050,44 +1048,6 @@ sub server_prefs_form_cb {
}
}
-sub system_base_channel_select {
- my $pxt = shift;
- my %params = @_;
-
- my $block = $params{__block__};
- my $sid = $pxt->param('sid');
-
- die "No Server id!"
- unless $sid;
-
- my $server = RHN::Server->lookup(-id => $sid);
-
- my $current_base_id = $server->base_channel_id || 0;
-
- if ($current_base_id and not
$pxt->user->verify_channel_subscribe($current_base_id)) {
- $pxt->pnotes(resubscribe_base_warning => 1);
- }
-
- my @channels = RHN::Channel->user_subscribable_bases_for_system($server,
$pxt->user);
-
- unshift @channels, { ID => 0, NAME => "(none, disable service)", LABEL
=> "(none)" };
-
- my @options;
-
- foreach my $channel (@channels) {
- my $selected = '';
-
- if ($channel->{ID} == $current_base_id) {
- $selected = '1';
- }
-
- push @options, [ PXT::Utils->escapeHTML($channel->{NAME} || ''),
$channel->{ID}, $selected ];
- }
-
- return PXT::HTML->select(-name => "system_base_channel",
- -options => \@options);
-}
-
sub delete_servers_cb {
my $pxt = shift;
commit 808db83e7a1e8d0684d1c445aa218852fef743fa
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 21:31:32 2010 +0100
enable_notification_cron and disable_notification_cron are not used in our code base,
removing.
diff --git a/web/modules/rhn/RHN/SatInstall.pm b/web/modules/rhn/RHN/SatInstall.pm
index 2d14241..814ee6a 100644
--- a/web/modules/rhn/RHN/SatInstall.pm
+++ b/web/modules/rhn/RHN/SatInstall.pm
@@ -128,21 +128,4 @@ sub generate_server_cert {
return $ret;
}
-sub enable_notification_cron {
- my $class = shift;
-
- my $ret = system('/usr/bin/sudo', 'ln', '-s',
'/opt/notification/cron/notification',
- '/etc/cron.d/notification');
-
- return;
-}
-
-sub disable_notification_cron {
- my $class = shift;
-
- my $ret = system('/usr/bin/sudo', 'rm',
'/etc/cron.d/notification');
-
- return;
-}
-
1;