[prev in list] [next in list] [prev in thread] [next in thread] 

List:       spacewalk-commits
Subject:    Branch 'flex-guest' - schema/spacewalk web/html web/modules
From:       partha () fedoraproject ! org (Partha Aji)
Date:       2010-05-28 23:07:27
Message-ID: 20100528230727.7DA801201BE () lists ! fedorahosted ! org
[Download RAW message or body]

 schema/spacewalk/oracle/packages/rhn_channel.pkb     |   17 ---
 schema/spacewalk/oracle/packages/rhn_channel.pks     |    3 
 schema/spacewalk/postgres/packages/rhn_channel.pkb   |   29 ------
 web/html/network/software/channels/license.pxt       |   45 ----------
 web/html/network/systems/ssm/channels/index.pxt      |   79 -----------------
 web/html/network/systems/ssm/channels/license.pxt    |   60 -------------
 web/modules/rhn/RHN/DB/ServerActions.pm              |   42 ---------
 web/modules/sniglets/Sniglets/Channel.pm             |   68 ---------------
 web/modules/sniglets/Sniglets/ListView/SystemList.pm |   84 -------------------
 9 files changed, 427 deletions(-)

New commits:
commit 43d4eef4de901377bb61075fdbf44f3aed371d0d
Author: Partha Aji <paji at redhat.com>
Date:   Fri May 28 19:09:01 2010 -0400

    Removed the bulk-subscribe and unsubscribe which is not used anywhere

diff --git a/schema/spacewalk/oracle/packages/rhn_channel.pkb \
b/schema/spacewalk/oracle/packages/rhn_channel.pkb index 925dddd..f5d5c96 100644
--- a/schema/spacewalk/oracle/packages/rhn_channel.pkb
+++ b/schema/spacewalk/oracle/packages/rhn_channel.pkb
@@ -240,15 +240,6 @@ IS
     end;
 
 
-    PROCEDURE bulk_subscribe_server(channel_id_in IN NUMBER, set_label_in IN \
                VARCHAR2, set_uid_in IN NUMBER)
-    IS
-    BEGIN
-        FOR server IN rhn_set.set_iterator(set_label_in, set_uid_in)
-        LOOP
-            rhn_channel.subscribe_server(server.element, channel_id_in, 0, \
                set_uid_in);
-        END LOOP server;
-    END bulk_subscribe_server;
-
     PROCEDURE bulk_server_base_change(channel_id_in IN NUMBER, set_label_in IN \
VARCHAR2, set_uid_in IN NUMBER)  IS
     BEGIN
@@ -606,14 +597,6 @@ IS
         end if;
     END unsubscribe_server;
 
-    PROCEDURE bulk_unsubscribe_server(channel_id_in IN NUMBER, set_label_in IN \
                VARCHAR2, set_uid_in IN NUMBER)
-    IS
-    BEGIN
-        FOR server IN rhn_set.set_iterator(set_label_in, set_uid_in)
-        LOOP
-            rhn_channel.unsubscribe_server(server.element, channel_id_in, 0);
-        END LOOP server;
-    END bulk_unsubscribe_server;
 
     FUNCTION family_for_channel(channel_id_in IN NUMBER)
     RETURN NUMBER
diff --git a/schema/spacewalk/oracle/packages/rhn_channel.pks \
b/schema/spacewalk/oracle/packages/rhn_channel.pks index a6de86d..2036f9a 100644
--- a/schema/spacewalk/oracle/packages/rhn_channel.pks
+++ b/schema/spacewalk/oracle/packages/rhn_channel.pks
@@ -72,9 +72,6 @@ IS
 
     FUNCTION channel_priority(channel_id_in in number) RETURN number;
     
-    PROCEDURE bulk_subscribe_server(channel_id_in IN NUMBER, set_label_in IN \
                VARCHAR2, set_uid_in IN NUMBER);
-    PROCEDURE bulk_unsubscribe_server(channel_id_in IN NUMBER, set_label_in IN \
                VARCHAR2, set_uid_in IN NUMBER);
-    
     PROCEDURE bulk_server_base_change(channel_id_in IN NUMBER, set_label_in IN \
VARCHAR2, set_uid_in IN NUMBER);  procedure bulk_server_basechange_from(
 	set_label_in in varchar2,
diff --git a/schema/spacewalk/postgres/packages/rhn_channel.pkb \
b/schema/spacewalk/postgres/packages/rhn_channel.pkb index be74ba0..09f78f9 100644
--- a/schema/spacewalk/postgres/packages/rhn_channel.pkb
+++ b/schema/spacewalk/postgres/packages/rhn_channel.pkb
@@ -218,20 +218,6 @@ update pg_settings set setting = 'rhn_channel,' || setting where \
name = 'search_  end$$ language plpgsql;
 
 
-    CREATE OR REPLACE FUNCTION bulk_subscribe_server(channel_id_in IN NUMERIC, \
                set_label_in IN VARCHAR, set_uid_in IN NUMERIC) returns void
-    AS $$
-    DECLARE
-        server RECORD;
-    BEGIN
-        FOR server IN
-    	   SELECT user_id, label, element, element_two
-	     FROM rhnSet
-	    WHERE label = set_label_in
-	      AND user_id = set_uid_in
-        LOOP
-            perform rhn_channel.subscribe_server(server.element, channel_id_in, 0, \
                set_uid_in);
-        END LOOP;
-    END$$ language plpgsql;
 
     CREATE OR REPLACE FUNCTION bulk_server_base_change(channel_id_in IN NUMERIC, \
set_label_in IN VARCHAR, set_uid_in IN NUMERIC) returns void  AS $$
@@ -643,21 +629,6 @@ update pg_settings set setting = 'rhn_channel,' || setting where \
                name = 'search_
         perform rhn_channel.update_family_counts(channel_family_id_val, \
server_org_id_val);  END$$ language plpgsql;
 
-    CREATE OR REPLACE FUNCTION bulk_unsubscribe_server(channel_id_in IN NUMERIC, \
                set_label_in IN VARCHAR, set_uid_in IN NUMERIC) returns void
-    AS $$
-    DECLARE
-        server RECORD;
-    BEGIN
-        FOR server IN
-    	   SELECT user_id, label, element, element_two
-	     FROM rhnSet
-	    WHERE label = set_label_in
-	      AND user_id = set_uid_in
-        LOOP
-            perform rhn_channel.unsubscribe_server(server.element, channel_id_in, \
                0);
-        END LOOP;
-    END$$ language plpgsql;
-
     CREATE OR REPLACE FUNCTION family_for_channel(channel_id_in IN NUMERIC)
     RETURNS NUMERIC
     AS $$
diff --git a/web/html/network/software/channels/license.pxt \
b/web/html/network/software/channels/license.pxt deleted file mode 100644
index 2e4e7ee..0000000
--- a/web/html/network/software/channels/license.pxt
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
-  <pxt-use class="Grail::Frame" />
-  <pxt-use class="Sniglets::Channel" />
-  <pxt-use class="Sniglets::ChannelLicense" />
-  <pxt-use class="Sniglets::Users" />
-  <pxt-use class="Sniglets::HTML" />
-
-  <grail-canvas-template base="/templates/c.pxt" mode="main_canvas">
-
-<rhn-channel-details>
-    <h1><img src="/img/rhn-icon-channels.gif"  /> {channel_name} <rhn-help \
                href="s1-sm-channels-packages.jsp" /></h1>
-</rhn-channel-details>
-
-    <rhn-navi-nav prefix="channel_details" depth="0" file="/nav/channel_detail.xml" \
                style="contentnav" />
-
-    <h2>End User License Agreement</h2>
-
-<rhn-channel-license-dialog>
-    <div class="page-summary">
-      <p>Please read and accept the following End User Licensing Agreement (EULA) to \
                subscribe the selected systems to this channel.</p>
-      <br />
-      <pre>{channel_license}</pre>
-      <br />
-    </div>
-
-<pxt-include-late file="/network/components/message_queues/local.pxi" />
-
-    <pxt-form method="POST">
-      <div align="right">
-        <hr />
-        <input type="submit" name="cancel" value="Cancel" />
-        <input type="submit" name="accept" value="Accept" />
-        <input type="hidden" name="pxt:trap" value="rhn:channel_license_dialog_cb" \
                />
-        <input type="hidden" name="cdc" value="1" />
-        <input type="hidden" name="subscribe_to" value="{channel_id}" />
-        {additional_channels}
-        <pxt-hidden name="cid" />
-        <pxt-hidden name="set_label" />
-      </div>
-    </pxt-form>
-</rhn-channel-license-dialog>
-
-  </grail-canvas-template>
-</pxt-passthrough>
diff --git a/web/html/network/systems/ssm/channels/index.pxt \
b/web/html/network/systems/ssm/channels/index.pxt deleted file mode 100644
index 78139b7..0000000
--- a/web/html/network/systems/ssm/channels/index.pxt
+++ /dev/null
@@ -1,79 +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>Channel Subscriptions</h2>
-
-    <div class="page-summary">
-    <p>
-      Below is a list of channels in your organization.
-    </p>
-    <ul>
-      <li>To subscribe selected systems to a channel, check Subscribe for that \
                channel.</li>
-      <li>To unsubscribe selected systems from a channel, check Unsubscribe for that \
                channel.</li>
-      <li>Check No Change to leave the selected systems unaffected relative to that \
                channel.</li>
-    </ul>
-    <p>
-      <strong>Note:</strong> attempts to assign a system to an incompatible channel \
                will fail.
-    </p>
-    </div>
-
-<rhn-resubscribe-warning-ssm>
-<div class="resubscribe-warning-big">
-<p>
-	<img src="/img/rhn-icon-warning.gif" title="Resubscription Warning" /> You do not \
have subscription rights to the marked channels below.  You will not be able to \
                resubscribe any systems to such channels without administrator \
                intervention.
-</p>
-</div>
-</rhn-resubscribe-warning-ssm>
-
-
-<pxt-include-late file="/network/components/message_queues/local.pxi" />
-
-<rhn-fix-list list_type="channel">
-<empty_list_mesg>No relevant channels</empty_list_mesg>
-
-<pxt-form method="post" \
                action="/network/systems/ssm/channels/alter_subscriptions_conf.pxt">
-
-<table width="96%" cellspacing="0" cellpadding="0" class="list" align="center">
-  <thead>
-	<tr>
-		<th>Channel</th>
-		<th>Subscribe</th>
-		<th>Unsubscribe</th>
-		<th>No Change</th>
-	</tr>
-  </thead>
-<rhn-tri-state-channel-list>
-	<tr class="{class}">
-		<td class="first-column">{channel_name}</td>
-		<td align="center">{subscribe_column}</td>
-		<td align="center"><input type="radio" name="{channel_id}" value="unsubscribe" \
                /></td>
-		<td class="last-column" align="center"><input type="radio" name="{channel_id}" \
                value="do_nothing" checked="1" /></td>
-	</tr>
-</rhn-tri-state-channel-list>
-</table>
-
-<input type="hidden" name="pxt:trap" value="rhn:sscd_alter_channel_membership_cb" />
-
-<div align="right">
-<hr />
-<input type="submit" name="channel_actions" value="Alter Subscriptions" />
-</div>
-
-</pxt-form>
-</rhn-fix-list>
-
-
-  </grail-canvas-template>
-
-</pxt-passthrough>
diff --git a/web/html/network/systems/ssm/channels/license.pxt \
b/web/html/network/systems/ssm/channels/license.pxt deleted file mode 100644
index 3d4872b..0000000
--- a/web/html/network/systems/ssm/channels/license.pxt
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
-  <pxt-use class="Grail::Frame" />
-  <pxt-use class="Sniglets::ChannelLicense" />
-  <pxt-use class="Sniglets::Lists" />
-  <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>End User License Agreement</h2>
-
-<rhn-channel-license-dialog>
-<p><strong>{channel_name}</strong></p>
-
-<p>You must agree to the following EULA before you may subscribe the systems listed \
                at the bottom of the page:</p>
-
-<br />
-
-<pre>{channel_license}</pre>
-
-<br />
-
-
-<rhn-listview class="Sniglets::ListView::SystemList"
-mode="target_systems_for_channel_in_set">
-  <formvar>
-    <var>cid</var>
-    <var>additional_channel</var>
-  </formvar>
-  <column name="Name"  label="server_name" align="left" />
-</rhn-listview>
-
-
-<pxt-include-late file="/network/components/message_queues/local.pxi" />
-
-<pxt-form method="POST">
-<div align="right">
-<hr />
-<input type="submit" name="cancel" value="Cancel" />
-<input type="submit" name="accept" value="Accept" />
-</div>
-
-<input type="hidden" name="pxt:trap" value="rhn:channel_license_dialog_cb" />
-
-<input type="hidden" name="cid" value="{channel_id}" />
-{additional_channels}
-
-<input type="hidden" name="ssm" value="1" />
-</pxt-form>
-</rhn-channel-license-dialog>
-
-</grail-canvas-template>
-
-</pxt-passthrough>
diff --git a/web/modules/rhn/RHN/DB/ServerActions.pm \
b/web/modules/rhn/RHN/DB/ServerActions.pm index 7007c6d..ffe0007 100644
--- a/web/modules/rhn/RHN/DB/ServerActions.pm
+++ b/web/modules/rhn/RHN/DB/ServerActions.pm
@@ -92,46 +92,4 @@ sub remove_set_from_group {
 }
 
 
-sub subscribe_set_to_channel {
-  my $class = shift;
-  my $set = shift;
-  my $channel_id = shift;
-  my $transaction = shift;
-
-  my $query = <<EOQ;
-BEGIN
-  rhn_channel.bulk_subscribe_server(?, ?, ?);
-END;
-EOQ
-
-  my $dbh = $transaction || RHN::DB->connect();
-  my $sth = $dbh->prepare($query);
-  $sth->execute($channel_id, $set->label, $set->uid);
-
-  $dbh->commit unless $transaction;
-
-  return $dbh;
-}
-
-sub unsubscribe_set_from_channel {
-  my $class = shift;
-  my $set = shift;
-  my $channel_id = shift;
-  my $transaction = shift;
-
-  my $query = <<EOQ;
-BEGIN
-  rhn_channel.bulk_unsubscribe_server(?, ?, ?);
-END;
-EOQ
-
-  my $dbh = $transaction || RHN::DB->connect();
-  my $sth = $dbh->prepare($query);
-  $sth->execute($channel_id, $set->label, $set->uid);
-
-  $dbh->commit unless $transaction;
-
-  return $dbh;
-}
-
 1;
diff --git a/web/modules/sniglets/Sniglets/Channel.pm \
b/web/modules/sniglets/Sniglets/Channel.pm index 67bb5a2..4ca6b59 100644
--- a/web/modules/sniglets/Sniglets/Channel.pm
+++ b/web/modules/sniglets/Sniglets/Channel.pm
@@ -49,8 +49,6 @@ sub register_callbacks {
   my $class = shift;
   my $pxt = shift;
 
-  # sscd
-  $pxt->register_callback('rhn:sscd_alter_channel_membership_cb' => \
\&sscd_alter_channel_membership_cb);  \
$pxt->register_callback('rhn:globally_subscribable_cb' => \
\&globally_subscribable_cb);  }
 
@@ -99,72 +97,6 @@ sub channel_gpg_key {
   return PXT::Utils->perform_substitutions($block, \%subst);
 }
 
-sub sscd_alter_channel_membership_cb {
-  my $pxt = shift;
-
-
-  PXT::Debug->log(7, "in sscd_alter_channel_membership_cb...");
-
-  my @to_subscribe;
-  my @to_unsubscribe;
-  my $channel_set = new RHN::DB::Set 'channel_list', $pxt->user->id;
-
-  my @params = $pxt->param;
-
-  # warn "setting channel_list for un/subscriptions...";
-  PXT::Debug->log(7, "setting channel_list for un/subscriptions...");
-
-  $channel_set->empty;
-  $channel_set->commit;
-  foreach my $param (grep {m/(\d)+?/} @params) {
-    my $value = $pxt->dirty_param($param);
-
-    push @to_subscribe, $param if ($value eq 'subscribe');
-    push @to_unsubscribe, $param if ($value eq 'unsubscribe');
-  }
-
-
-  # see if any of the requested channels are no longer allowed to be subscribed,
-  # also protects against forged requests...
-  if (not $pxt->user->verify_channel_subscribe(@to_subscribe)) {
-    my $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
-    $pxt->push_message(local_alert => $error_msg);
-    $pxt->redirect("/network/systems/ssm/channels/index.pxt");
-  }
-
-  $channel_set->add( map { [ $_, $SUBSCRIBE ] } @to_subscribe );
-  $channel_set->add( map { [ $_, $UNSUBSCRIBE ] } @to_unsubscribe );
-  $channel_set->commit;
-
-  PXT::Debug->log(7, "channel set committed...");
-  PXT::Debug->log_dump(7, \$channel_set);
-
-  my @license_channels = \
                RHN::Channel->available_channels_with_license($pxt->user->org_id);
-  my %consent_required = map { $_->[0] => 1 } @license_channels;
-
-  my @channels_needing_consent;
-
-  foreach my $channel_to_subscribe (@to_subscribe) {
-    if ($consent_required{$channel_to_subscribe}) {
-      push @channels_needing_consent, $channel_to_subscribe;
-    }
-  }
-
-  my $cid;
-  if (@channels_needing_consent) {
-    my $cid = pop @channels_needing_consent;
-    my $params = $cid;
-
-    if (@channels_needing_consent) {
-      $params .= "&additional_channel=" . join("&additional_channel=", \
                @channels_needing_consent);
-    }
-    $pxt->redirect("/network/systems/ssm/channels/license.pxt?cid=$cid&current_channel=$params");
                
-  }
-}
-
 
 sub tri_state_channel_list {
   my $pxt = shift;
diff --git a/web/modules/sniglets/Sniglets/ListView/SystemList.pm \
b/web/modules/sniglets/Sniglets/ListView/SystemList.pm index 70f422a..647b058 100644
--- a/web/modules/sniglets/Sniglets/ListView/SystemList.pm
+++ b/web/modules/sniglets/Sniglets/ListView/SystemList.pm
@@ -85,11 +85,6 @@ sub _register_modes {
 			   -datasource => RHN::DataSource::System->new,
 			   -provider => \&visible_to_uid_provider);
 
-  Sniglets::ListView::List->add_mode(-mode => "ssm_channel_change_conf",
-			   -datasource => RHN::DataSource::System->new,
-			   -provider => \&ssm_channel_change_conf_provider,
-			   -action_callback => \&ssm_channel_change_conf_cb);
-
   Sniglets::ListView::List->add_mode(-mode => "systems_with_package_nvre_in_set",
 			   -datasource => RHN::DataSource::System->new);
 
@@ -663,85 +658,6 @@ sub ssm_channel_change_conf_provider {
   return %ret;
 }
 
-sub ssm_channel_change_conf_cb {
-  my $self = shift;
-  my $pxt = shift;
-
-  # think big red button
-  my %action = @_;
-
-  if ($action{label} eq 'ssm_change_channel_subscriptions') {
-
-    my $SUBSCRIBE = 1;
-    my $UNSUBSCRIBE = 2;
-
-    my @to_subscribe;
-    my @to_unsubscribe;
-    my $channel_set = new RHN::DB::Set 'channel_list', $pxt->user->id;
-
-    my $system_set = new RHN::DB::Set 'system_list', $pxt->user->id;
-
-    @to_subscribe = map { $_->[0] } grep { $_->[1] eq $SUBSCRIBE } \
                $channel_set->contents();
-    @to_unsubscribe = map { $_->[0] } grep { $_->[1] eq $UNSUBSCRIBE } \
                $channel_set->contents();
-
-    # for safety's sake, filter out any rhn-satellite or rhn-proxy id that might \
                have found their way in...
-    my %rhn_satellite_ids;
-    my %rhn_proxy_ids;
-
-    %rhn_proxy_ids = map { $_ => 1 } RHN::Channel->rhn_proxy_channels;
-    %rhn_satellite_ids = map { $_ => 1 } RHN::Channel->rhn_satellite_channels;
-
-    @to_subscribe = grep {!$rhn_proxy_ids{$_} and !$rhn_satellite_ids{$_}} \
                @to_subscribe;
-    @to_unsubscribe = grep {!$rhn_proxy_ids{$_} and !$rhn_satellite_ids{$_}} \
                @to_unsubscribe;
-
-    my $transaction = RHN::DB->connect;
-
-    eval {
-      foreach my $channel_to_subscribe_to (@to_subscribe) {
-        $transaction = RHN::ServerActions->subscribe_set_to_channel($system_set, \
                $channel_to_subscribe_to, $transaction);
-      }
-
-      foreach my $channel_to_unsubscribe_from (@to_unsubscribe) {
-        $transaction = RHN::ServerActions->unsubscribe_set_from_channel($system_set, \
                $channel_to_unsubscribe_from, $transaction);
-      }
-
-      # w/ groups, we're probably over-snapshotting a little bit, but we're
-      # likely to do far more here, due to more no-ops depending upon base-child \
                channel
-      # relationships...  therefore, fix this one first.
-      $transaction = RHN::Server->snapshot_set(-reason => "Channel subscription \
                alterations",
-					       -set_label => 'system_list',
-					       -user_id => $pxt->user->id,
-					       -transaction => $transaction);
-    };
-
-    if ($@ and catchable($@)) {
-      my $E = $@;
-
-      $transaction->rollback;
-
-      #  What could go here?  What exceptions might we run into?  Not enough \
                entitlements?
-      if ($E->is_rhn_exception('channel_family_no_subscriptions')) {
-        $pxt->push_message(local_alert => "Channel subscriptions would be exceeded, \
no systems subscribed.  Please contact Red Hat for more channel entitlements \
                (1-866-2-REDHAT).");
-      }
-      else {
-        throw $E;
-      }
-    }
-    elsif ($@) {
-      $transaction->rollback();
-      die $@;
-    }
-    else {
-      $transaction->commit;
-
-      $channel_set->empty;
-      $channel_set->commit;
-      $pxt->push_message(site_info => "Channel subscriptions changed.");
-      $pxt->redirect('/network/systems/ssm/channels/index.pxt');
-    }
-  }
-}
-
 sub row_callback {
   my $self = shift;
   my $row = shift;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic