Changes to 'refs/tags/spacewalk-web-0.8.4-1'
by Jan Pazdziora
Tag 'spacewalk-web-0.8.4-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2009-12-22 15:07 +0000
Tagging package [spacewalk-web] version [0.8.4-1] in directory [web/].
Changes since spacewalk-web-0.8.3-1:
Jan Pazdziora (91):
rhn:delete_probe_cb is not used, removing, as well as delete_probe_cb.
rhn:system_probe_creation_cb and rhn:system_probe_edit_cb not used, removing, as well as other dependant functions.
Removal of rhn:system_probe_*cb made list_commands_by_group unused, removing as dead code.
Removal of list_commands_by_group made enabled_commands_for_group unused, removing as dead query.
Removal of rhn:system_probe_*cb made list_by_command unused, removing as dead code.
Removal of list_by_command made RHN::DB::CommandParameter and RHN::CommandParameter empty, removing as dead packages.
Removal of rhn:system_probe_*cb made insert_check_probe and insert_probe_params unused, removing as dead code.
Removal of rhn:system_probe_*cb made update_probe_param_values unused, removing as dead code.
Removal of build_system_probe_edit_form and system_probe_edit_cb made list_probe_param_values unused, removing as dead code.
Previous removals made RHN::ProbeParam and RHN::DB::ProbeParam not needed, removing as dead packages.
rhn:cert_text_cb not used, removing, as well as cert_text_cb.
register_tags without content can be removed as well.
Previous removals made get_service_map unused, removing as dead code.
Removal of get_service_map made server_group_type_details_from_set unused, removing as dead code.
Previous removals made get_channel_family_map unused, removing as dead code.
Removal of get_channel_family_map made family_details_from_set unused, removing as dead code.
Previous removals made reset_form unused, removing as dead code.
Removal of reset_form made reset_and_commit_set unused, removing as dead code.
Previous removals made Sniglets::Org empty package, dropping.
rhn:bar_search_cb not used, removing, as well as bar_search_cb.
register_tags without content can be removed as well.
Removal of bar_search_cb made system_search_handler unused, removing as dead code.
The rest of System Searching can be removed as well.
Removal of bar_search_cb made errata_search_handler unused, removing as dead code.
The rest of Errata Searching can be removed as well.
Removal of bar_search_cb made package_search_handler unused, removing as dead code.
The rest of Package Searching can be removed as well.
Previous removals made validate_search_string unused, removing as dead code.
rhn:channel_delete_cb not used, removing, as well as channel_delete_cb.
Removal of channel_delete_cb made delete_channel unused, removing as dead code.
rhn:schedule_config_action_cb not used, removing, as well as schedule_config_action_cb.
Removal of schedule_config_action_cb made schedule_config_upload unused, removing as dead code.
rhn:add_managed_files_to_set_cb not used, removing, as well as add_managed_files_to_set_cb.
rhn:add_managed_filenames_to_set_cb not used, removing, as well as add_managed_filenames_to_set_cb.
rhn:schedule_ssm_config_action_cb not used, removing, as well as schedule_ssm_config_action_cb.
Removal of schedule_ssm_config_action_cb made _schedule_config_action_schedule_config_action and thus %config_actions unused, removing as dead code.
rhn:configfile_copy_files_cb not used, removing (configfile_copy_files_cb kept as still referenced).
rhn:admin_server_edit_cb not used, removing, as well as admin_server_edit_cb.
Removal of admin_server_edit_cb made set_server_pref unused, removing as dead code.
Removal of admin_server_edit_cb made handle_system_entitlement_change unused, removing as dead code.
Removal of admin_server_edit_cb made server_edit_location_cb unused, removing as dead code.
Removal of handle_system_entitlement_change made schedule_sat_cluster_push unused, removing as dead code.
server_location not used, removing.
rhn:system_update_brb_cb not used anywhere; system_update_brb_cb even does not exist.
rhn:system_package_list_refresh_cb not used, removing, as well as system_package_list_refresh_cb.
Removal of system_package_list_refresh_cb made schedule_package_refresh unused, removing as dead code.
rhn:add-filenames-to-set-cb not used, removing, as well as add_filenames_to_set_cb.
Removal of add_filenames_to_set_cb made validate_path_name unused, removing as dead code.
rhn:server_lock_cb not used, removing, as well as server_lock_cb.
rhn:osa-ping not used, removing, as well as osa_ping_cb.
rhn:profile_delete_cb not used, removing, as well as profile_delete_cb.
Removal of profile_delete_cb made delete_profile unused, removing as dead code.
rhn:profile_edit_cb not used, removing, as well as profile_edit_cb.
register_tags without content can be removed as well.
rhn:create_profile_from_system_cb not used, removing, as well as create_profile_from_system_cb.
Removal of create_profile_from_system_cb made base_channel_list unused, removing as dead code.
rhn:education_cb not used, removing, as well as education_cb.
Removal of education_cb made enter_edu_holding_pen unused, removing as dead code.
rhn:logout_cb not used, removing, as well as rhn_logout_cb.
Since web/html/network/account/details.pxt is no longer present, /forms is not referenced, removing.
Removal of user_details.xml made rhn:admin_user_edit_cb, as well as admin_user_edit_cb unused, removing as dead code.
Removal of Sniglets::Inspector made group_checkboxes unused, removing as dead code.
Removal of group_checkboxes and admin_user_edit_cb made group_list_for_user unused, removing as dead code.
Removal of admin_user_edit_cb made remove_users_from_groups unused, removing as dead code.
Removal of admin_user_edit_cb made add_users_to_groups unused, removing as dead code.
Removal of add_users_to_groups made org_applicant_group_from_ugid unused, removing as dead code.
rhn:admin_user_site_edit_cb not used, removing, as well as admin_user_site_edit_cb.
Removal of admin_user_site_edit_cb made update_site_record unused, removing as dead code.
Removal of update_site_record made associated_with_order unused, removing as dead code.
default_bill_address not used anywhere, removing.
Removal of update_site_record and default_bill_address made new_site unused, removing as dead code.
Removal of toggle_pref makes rhn:toggle_pref_cb as well as toggle_pref_cb not used, removing.
rhn:delete_user_cb not used, removing, as well as delete_user_cb.
rhn:request_account_deactivation_cb not used, removing, as well as request_account_deactivation_cb.
Removal of request_account_deactivation_cb made request_deactivation unused, removing as dead code.
rhn:user_default_system_groups_cb not used, removing, as well as default_system_groups_cb and build_default_system_groups_form.
Removal of default_system_groups_cb made default_system_groups unused, removing as dead code.
Removal of default_system_groups_cb made set_default_system_groups unused, removing as dead code.
rhn:accepted not used, removing, as well as tnc_accepted_cb.
validate_user not used, removing as dead code.
Removal of validate_user made variables @required* and %required* unused, removing.
timezone_sort not used, removing.
grail:canvas_trap_handler not used, removing, as well as canvas_trap_handler.
Removal of RHN::Message also allows the other *Message packages to be removed.
Removals of previous use of register_type makes it dead code.
satellite/fedora seems not to be used in Satellite 5.3 / Spacewalk 0.7.
Removing render_dynamic_canvas as only render_canvas is used in Grail::Frame.
Drop spacewalk-cypress -- previous commit removed the last reference to Cypress.
Drop cypress directory from Makefile.
Drop spacewalk-cypress from spacewalks's Requires as we no longer want to ship it.
Automatic commit of package [spacewalk-web] release [0.8.4-1].
---
java/buildconf/build-webapp.xml | 3
rel-eng/packages/spacewalk-web | 2
satellite/fedora/config/etc/rhn/satellite-httpd/conf.d/satellite.conf | 5
satellite/fedora/config/etc/rhn/satellite-httpd/conf/rhnweb.conf | 67
satellite/fedora/setup-symlinks.sh | 134 -
satellite/setup-symlinks.sh | 1
spacewalk/package/spacewalk.spec | 1
web/html/forms/.htaccess | 8
web/html/forms/user_details.xml | 54
web/html/forms/user_prefixes.xml | 10
web/html/network/keys/key_list.pxt | 1
web/html/network/systems/custominfo/index.pxt | 1
web/html/network/systems/ssm/misc/choose_value_to_remove.pxt | 1
web/html/network/systems/ssm/misc/choose_value_to_set.pxt | 1
web/modules/Makefile | 2
web/modules/cypress/Changes | 5
web/modules/cypress/Cypress.pm | 23
web/modules/cypress/Cypress/Channel.pm | 54
web/modules/cypress/Cypress/Package.pm | 102 -
web/modules/cypress/Cypress/Search.pm | 73 -
web/modules/cypress/Cypress/ServerActions.pm | 164 --
web/modules/cypress/Cypress/ServerGroupList.pm | 106 -
web/modules/cypress/Cypress/Slashdot.pm | 67
web/modules/cypress/Cypress/User.pm | 73 -
web/modules/cypress/Cypress/UserActions.pm | 45
web/modules/cypress/Cypress/UserGroupList.pm | 90 -
web/modules/cypress/MANIFEST | 19
web/modules/cypress/Makefile | 8
web/modules/cypress/Makefile.PL | 24
web/modules/cypress/test.pl | 20
web/modules/grail/Grail/Canvas.pm | 33
web/modules/grail/Grail/Frame.pm | 16
web/modules/rhn/RHN/CommandParameter.pm | 46
web/modules/rhn/RHN/DB/Channel.pm | 54
web/modules/rhn/RHN/DB/ChannelEditor.pm | 26
web/modules/rhn/RHN/DB/Command.pm | 19
web/modules/rhn/RHN/DB/CommandParameter.pm | 142 --
web/modules/rhn/RHN/DB/ConfigFile.pm | 21
web/modules/rhn/RHN/DB/DataSource/xml/probe_queries.xml | 12
web/modules/rhn/RHN/DB/Message.pm | 248 ---
web/modules/rhn/RHN/DB/Message/ServerMessage.pm | 154 --
web/modules/rhn/RHN/DB/Message/TextMessage.pm | 152 --
web/modules/rhn/RHN/DB/Org.pm | 40
web/modules/rhn/RHN/DB/Probe.pm | 60
web/modules/rhn/RHN/DB/ProbeParam.pm | 146 --
web/modules/rhn/RHN/DB/Profile.pm | 19
web/modules/rhn/RHN/DB/Scheduler.pm | 104 -
web/modules/rhn/RHN/DB/Server.pm | 41
web/modules/rhn/RHN/DB/User.pm | 225 ---
web/modules/rhn/RHN/ProbeParam.pm | 47
web/modules/rhn/RHN/SearchTypes.pm | 9
web/modules/rhn/RHN/ServerMessage.pm | 24
web/modules/sniglets/Sniglets/ChannelEditor.pm | 75 -
web/modules/sniglets/Sniglets/ConfigManagement.pm | 6
web/modules/sniglets/Sniglets/Org.pm | 113 -
web/modules/sniglets/Sniglets/Probes.pm | 684 ----------
web/modules/sniglets/Sniglets/Profiles.pm | 97 -
web/modules/sniglets/Sniglets/Search.pm | 279 ----
web/modules/sniglets/Sniglets/ServerActions.pm | 226 ---
web/modules/sniglets/Sniglets/Servers.pm | 319 ----
web/modules/sniglets/Sniglets/Users.pm | 674 ---------
web/spacewalk-web.spec | 27
62 files changed, 6 insertions(+), 5296 deletions(-)
---
14 years, 4 months
rel-eng/packages web/spacewalk-web.spec
by Jan Pazdziora
rel-eng/packages/spacewalk-web | 2 +-
web/spacewalk-web.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 2dc611798fe383a8d5d1d1deabfc3af1ba2e4cc0
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 16:07:57 2009 +0100
Automatic commit of package [spacewalk-web] release [0.8.4-1].
diff --git a/rel-eng/packages/spacewalk-web b/rel-eng/packages/spacewalk-web
index 132caad..8c42e6d 100644
--- a/rel-eng/packages/spacewalk-web
+++ b/rel-eng/packages/spacewalk-web
@@ -1 +1 @@
-0.8.3-1 web/
+0.8.4-1 web/
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index 12dfd18..56ef35d 100644
--- a/web/spacewalk-web.spec
+++ b/web/spacewalk-web.spec
@@ -2,7 +2,7 @@ Name: spacewalk-web
Summary: Spacewalk Web site packages
Group: Applications/Internet
License: GPLv2
-Version: 0.8.3
+Version: 0.8.4
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -277,6 +277,9 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Tue Dec 22 2009 Jan Pazdziora 0.8.4-1
+- Removed more dead code, including spacewalk-cypress.
+
* Mon Dec 21 2009 Jan Pazdziora <jpazdziora(a)redhat.com> 0.8.3-1
- removed a lot of dead code
- modified to fit sha256 schema changes (michael.mraka(a)redhat.com)
14 years, 4 months
2 commits - spacewalk/package web/modules
by Jan Pazdziora
spacewalk/package/spacewalk.spec | 1 -
web/modules/Makefile | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
New commits:
commit 814c4ea8d36bf00328cb28a54be19f69e00a0961
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 15:49:47 2009 +0100
Drop spacewalk-cypress from spacewalks's Requires as we no longer want to ship it.
diff --git a/spacewalk/package/spacewalk.spec b/spacewalk/package/spacewalk.spec
index 1e6f38a..14a55c4 100644
--- a/spacewalk/package/spacewalk.spec
+++ b/spacewalk/package/spacewalk.spec
@@ -33,7 +33,6 @@ Requires: spacewalk-search
# Perl
Requires: spacewalk-html
Requires: spacewalk-base
-Requires: spacewalk-cypress
Requires: spacewalk-grail
Requires: spacewalk-pxt
Requires: spacewalk-sniglets
commit 0837c56f444589527d94ff3d37726693a1a4dd57
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 15:49:16 2009 +0100
Drop cypress directory from Makefile.
diff --git a/web/modules/Makefile b/web/modules/Makefile
index 5e59102..4562953 100644
--- a/web/modules/Makefile
+++ b/web/modules/Makefile
@@ -4,7 +4,7 @@
TOP = ..
-SUBDIRS = cypress grail pxt rhn sniglets dobby
+SUBDIRS = grail pxt rhn sniglets dobby
include $(TOP)/Makefile.defs
# whitespace change to test checkin
14 years, 4 months
2 commits - java/buildconf satellite/setup-symlinks.sh web/modules web/spacewalk-web.spec
by Jan Pazdziora
java/buildconf/build-webapp.xml | 3
satellite/setup-symlinks.sh | 1
web/modules/cypress/Changes | 5
web/modules/cypress/Cypress.pm | 23 ---
web/modules/cypress/Cypress/Channel.pm | 54 --------
web/modules/cypress/Cypress/Package.pm | 102 ---------------
web/modules/cypress/Cypress/Search.pm | 73 -----------
web/modules/cypress/Cypress/ServerActions.pm | 164 -------------------------
web/modules/cypress/Cypress/ServerGroupList.pm | 106 ----------------
web/modules/cypress/Cypress/Slashdot.pm | 67 ----------
web/modules/cypress/Cypress/User.pm | 73 -----------
web/modules/cypress/Cypress/UserActions.pm | 45 ------
web/modules/cypress/Cypress/UserGroupList.pm | 90 -------------
web/modules/cypress/MANIFEST | 19 --
web/modules/cypress/Makefile | 8 -
web/modules/cypress/Makefile.PL | 24 ---
web/modules/cypress/test.pl | 20 ---
web/modules/grail/Grail/Canvas.pm | 33 -----
web/spacewalk-web.spec | 14 --
19 files changed, 924 deletions(-)
New commits:
commit 46d171a80c8b59350bb8b4dd39b178aa5b65ef83
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 15:47:38 2009 +0100
Drop spacewalk-cypress -- previous commit removed the last reference to Cypress.
diff --git a/java/buildconf/build-webapp.xml b/java/buildconf/build-webapp.xml
index f931b06..cedc65c 100644
--- a/java/buildconf/build-webapp.xml
+++ b/java/buildconf/build-webapp.xml
@@ -168,8 +168,6 @@
<symlink link="/var/www/html" resource="${git.home}/web/html"/>
<mkdir dir="/var/www/lib"/>
<mkdir dir="/var/www/html/nav"/>
- <symlink link="/var/www/lib/Cypress"
- resource="${git.home}/web/modules/cypress/Cypress"/>
<symlink link="/var/www/lib/Dobby" resource="${git.home}/web/modules/dobby/Dobby"/>
<symlink link="/var/www/lib/Grail" resource="${git.home}/web/modules/grail/Grail"/>
<symlink link="/var/www/lib/PXT" resource="${git.home}/web/modules/pxt/PXT"/>
@@ -184,7 +182,6 @@
<target name="uninstall-web"
description="Used to uninstall the perl side of spacewalk devel environment">
- <symlink action="delete" link="/var/www/lib/Cypress"/>
<symlink action="delete" link="/var/www/lib/Dobby"/>
<symlink action="delete" link="/var/www/lib/Grail"/>
<symlink action="delete" link="/var/www/lib/PXT"/>
diff --git a/satellite/setup-symlinks.sh b/satellite/setup-symlinks.sh
index b7473fa..d9bbdac 100755
--- a/satellite/setup-symlinks.sh
+++ b/satellite/setup-symlinks.sh
@@ -124,7 +124,6 @@ chdir /var/www
symlink $SVNDIR/eng/web/html
chdir /var/www/lib
-symlink $SVNDIR/eng/web/modules/cypress/Cypress
symlink $SVNDIR/eng/web/modules/dobby/Dobby
symlink $SVNDIR/eng/web/modules/grail/Grail
symlink $SVNDIR/eng/web/modules/rhn/RHN
diff --git a/web/modules/cypress/Changes b/web/modules/cypress/Changes
deleted file mode 100644
index 37c8f17..0000000
--- a/web/modules/cypress/Changes
+++ /dev/null
@@ -1,5 +0,0 @@
-Revision history for Perl extension Cypress.
-
-0.01 Mon Apr 23 17:29:56 2001
- - original version; created by h2xs 1.19
-
diff --git a/web/modules/cypress/Cypress.pm b/web/modules/cypress/Cypress.pm
deleted file mode 100644
index fd570fd..0000000
--- a/web/modules/cypress/Cypress.pm
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-# stub module, mainly for $VERSION and any C stuff for later
-package Cypress;
-
-use strict;
-
-our $VERSION = '0.01';
-
-1;
diff --git a/web/modules/cypress/Cypress/Channel.pm b/web/modules/cypress/Cypress/Channel.pm
deleted file mode 100644
index 7d0003d..0000000
--- a/web/modules/cypress/Cypress/Channel.pm
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-package Cypress::Channel;
-use Grail::Component;
-
-@Cypress::Channel::ISA = qw/Grail::Component/;
-
-my @component_modes =
- (
- [ 'package_list', 'package_list', undef, undef ]
- );
-
-sub component_modes {
- return @component_modes;
-}
-
-sub package_list {
- my $self = shift;
- my $pxt = shift;
-
- $pxt->context(package_installable_list_view_mode => 'channel');
- $pxt->context(package_installable_list_view_mode_param => $pxt->param('cid'));
-
- # put this in a pxi?
- my $channel = RHN::Channel->lookup(-id => $pxt->param('cid'));
- my $channel_name = $channel->name;
-
- my $header = <<EOH;
-<table width="100%" border="0" cellspacing="0" cellpadding="6">
- <tr>
- <td class="redbar" align="left">Channel Packages for $channel_name</td>
- <td class="redbar" align="right"><a href="/help/basic/sm-channels-packages.html#SM-CHANNEL-LIST"><img src="/img/icon_help.gif" border="0"></a></td>
- </tr>
-</table>
-EOH
-
- return $header . $pxt->include('/network/components/packages/installable_package_list.pxi');
-}
-
-1;
diff --git a/web/modules/cypress/Cypress/Package.pm b/web/modules/cypress/Cypress/Package.pm
deleted file mode 100644
index 04f6188..0000000
--- a/web/modules/cypress/Cypress/Package.pm
+++ /dev/null
@@ -1,102 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-package Cypress::Package;
-use Grail::Component;
-
-@Cypress::Package::ISA = qw/Grail::Component/;
-
-
-# the search modes ought to be pushed to the search component i think...
-my @component_modes =
- (
-
- # this segment is where I'm starting to do the newer, better Cypress coding
-# [ 'details', 'details', undef, undef ],
-# [ 'dependencies', 'dependencies', undef, undef ],
-# [ 'change_log', 'change_log', undef, undef ],
-# [ 'file_list', 'file_list', undef, undef ],
-# [ 'system_list', 'system_list', undef, undef ],
-
-
- # older stuff that should eventually be pushed to other components
- [ 'package_list', 'package_list', undef, undef ],
- [ 'package_installable_search_list', 'package_installable_search_list', undef, undef ],
- [ 'package_installable_list', 'package_installable_list', undef, undef ],
-# [ 'package_installable_list_no_search', 'package_installable_list_no_search', undef, undef ],
- [ 'package_removable_list', 'package_removable_list', undef, undef ],
- [ 'package_removal_search_list', 'package_removal_search_list', undef, undef ]
- );
-
-sub component_modes {
- return @component_modes;
-}
-
-
-sub package_list {
- my $self = shift;
- my $pxt = shift;
-
- return $pxt->include('/network/components/packages/package_list.pxi');
-}
-
-sub package_installable_search_list {
- my $self = shift;
- my $pxt = shift;
-
- $pxt->context(package_installable_list_view_mode => 'search_set');
- $pxt->context(package_installable_list_view_mode_param => 'package_install_search');
- return $pxt->include('/network/components/packages/installable_package_list.pxi');
-}
-
-sub package_installable_list {
- my $self = shift;
- my $pxt = shift;
-
- $pxt->context(package_installable_list_view_mode => 'set');
- $pxt->context(package_installable_list_view_mode_param => 'package_installable_list');
- return $pxt->include('/network/components/packages/installable_package_list.pxi');
-}
-
-#sub package_installable_list_no_search {
-# my $self = shift;
-# my $pxt = shift;
-#
-# $pxt->context(package_installable_list_view_no_search => 1);
-# $pxt->context(package_installable_list_view_mode => 'set');
-# $pxt->context(package_installable_list_view_mode_param => 'package_installable_list');
-# return $pxt->include('/network/components/packages/installable_package_list.pxi');
-#}
-
-sub package_removable_list {
- my $self = shift;
- my $pxt = shift;
-
- $pxt->context(package_removable_list_view_mode => 'set');
- $pxt->context(package_removable_list_view_mode_param => 'package_removable_list');
- return $pxt->include('/network/components/packages/removable_package_list.pxi');
-}
-
-sub package_removal_search_list {
- my $self = shift;
- my $pxt = shift;
-
- $pxt->context(package_removable_list_view_mode => 'search_set');
- $pxt->context(package_removable_list_view_mode_param => 'package_removal_search');
- return $pxt->include('/network/components/packages/removable_package_list.pxi');
-}
-
-1;
diff --git a/web/modules/cypress/Cypress/Search.pm b/web/modules/cypress/Cypress/Search.pm
deleted file mode 100644
index a71a3fc..0000000
--- a/web/modules/cypress/Cypress/Search.pm
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-package Cypress::Search;
-use Grail::Component;
-
-@Cypress::Search::ISA = qw/Grail::Component/;
-
-# sigh. because of the stuff we're doing w/ parameters, there's almost no sense
-# in having multiple modes. :(
-my @component_modes =
- (
- [ 'server_search', 'server_search', undef, undef ],
- [ 'user_search', 'user_search', undef, undef ],
- [ 'package_install_search', 'package_install_search', undef, undef ],
- [ 'package_removal_search', 'package_removal_search', undef, undef ],
-# [ 'errata_search', 'errata_search', undef, undef ],
- );
-
-sub component_modes {
- return @component_modes;
-}
-
-sub server_search {
- my $self = shift;
- my $pxt = shift;
-
- return $pxt->include('/network/components/search/server_search.pxi');
-}
-
-sub user_search {
- my $self = shift;
- my $pxt = shift;
-
- return $pxt->include('/network/components/search/user_search.pxi');
-}
-
-sub package_install_search {
- my $self = shift;
- my $pxt = shift;
-
- return $pxt->include('/network/components/search/package_install_search.pxi');
-}
-
-sub package_removal_search {
- my $self = shift;
- my $pxt = shift;
-
- return $pxt->include('/network/components/search/package_removal_search.pxi');
-}
-
-
-#sub errata_search {
-# my $self = shift;
-# my $pxt = shift;
-#
-# return $pxt->include('/network/components/search/errata_search.pxi');
-#}
-
-1;
diff --git a/web/modules/cypress/Cypress/ServerActions.pm b/web/modules/cypress/Cypress/ServerActions.pm
deleted file mode 100644
index 7270c72..0000000
--- a/web/modules/cypress/Cypress/ServerActions.pm
+++ /dev/null
@@ -1,164 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-package Cypress::ServerActions;
-use Grail::Component;
-
-use Carp;
-
-@Cypress::ServerActions::ISA = qw/Grail::Component/;
-
-my @component_modes =
- (
- [ 'servergroup_add_remove', 'add_remove_servers_to_groups', undef, undef ],
- [ 'system_set_package_set_actions', 'system_set_package_set_actions', undef, undef],
- [ 'system_set_errata_set_actions', 'system_set_errata_set_actions', undef, undef],
- [ 'package_install_details', 'package_install_details', undef, undef ],
- [ 'package_install_package_list', 'package_install_package_list', undef, undef ],
- [ 'package_install_system_list', 'package_install_system_list', undef, undef ],
- [ 'package_removal_details', 'package_removal_details', undef, undef ],
- [ 'package_removal_package_list', 'package_removal_package_list', undef, undef ],
- [ 'package_removal_system_list', 'package_removal_system_list', undef, undef ],
- [ 'errata_update_details', 'errata_update_details', undef, undef ],
- [ 'errata_update_errata_list', 'errata_update_errata_list', undef, undef ],
- [ 'errata_update_system_list', 'errata_update_system_list', undef, undef ]
- );
-
-sub component_modes {
- return @component_modes;
-}
-
-sub add_remove_servers_to_groups {
- my $self = shift;
- my $pxt = shift;
-
- my $user = $pxt->user;
-
- # what are the rules about adding/removing servers to a group?
- croak "attempt to add/remove servers from servergroups by a non-orgadmin " unless $user->is('org_admin');
-
- return $pxt->include('/network/components/systemactions/system_set_group_assign.pxi');
-}
-
-# speedy interface when you have a set of systems and a set of packages...
-sub system_set_package_set_actions {
- my $self = shift;
- my $pxt = shift;
-
- # hrm. what priviledge checking should we do here?
-
- return $pxt->include('/network/components/systemactions/system_set_package_set_actions.pxi');
-}
-
-# speedy interface when you have a set of systems and a set of packages...
-sub system_set_errata_set_actions {
- my $self = shift;
- my $pxt = shift;
-
- # hrm. what priviledge checking should we do here?
-
- return $pxt->include('/network/components/systemactions/system_set_errata_set_actions.pxi');
-}
-
-sub package_install_details {
- my $self = shift;
- my $pxt = shift;
-
-
- return $pxt->include('/network/components/systemactions/package_install_details.pxi');
-}
-
-sub package_install_package_list {
- my $self = shift;
- my $pxt = shift;
-
- # faking out the ServerList sniglet. woot!
- $pxt->context(package_installable_list_view_mode => 'install_action');
- $pxt->context(package_installable_list_view_mode_param => $pxt->param('aid'));
- return $pxt->include('/network/components/systemactions/package_install_package_list.pxi');
-}
-
-sub package_install_system_list {
- my $self = shift;
- my $pxt = shift;
-
- # faking out the ServerList sniglet. woot!
- $pxt->context(system_list_view_mode => 'action');
- $pxt->context(system_list_view_mode_param => $pxt->param('aid'));
-
- return $pxt->include('/network/components/systemactions/package_install_system_list.pxi');
-}
-
-sub package_removal_details {
- my $self = shift;
- my $pxt = shift;
-
-
- return $pxt->include('/network/components/systemactions/package_removal_details.pxi');
-}
-
-sub package_removal_package_list {
- my $self = shift;
- my $pxt = shift;
-
- # faking out the ServerList sniglet. woot!
- $pxt->context(package_removable_list_view_mode => 'remove_action');
- $pxt->context(package_removable_list_view_mode_param => $pxt->param('aid'));
- return $pxt->include('/network/components/systemactions/package_removal_package_list.pxi');
-}
-
-sub package_removal_system_list {
- my $self = shift;
- my $pxt = shift;
-
- # faking out the ServerList sniglet. woot!
- $pxt->context(system_list_view_mode => 'action');
- $pxt->context(system_list_view_mode_param => $pxt->param('aid'));
-
- return $pxt->include('/network/components/systemactions/package_removal_system_list.pxi');
-}
-
-sub errata_update_details {
- my $self = shift;
- my $pxt = shift;
-
-
- return $pxt->include('/network/components/systemactions/errata_update_details.pxi');
-}
-
-sub errata_update_errata_list {
- my $self = shift;
- my $pxt = shift;
-
- $pxt->context(errata_list_view_mode => 'action');
- $pxt->context(errata_list_view_mode_param => $pxt->param('aid'));
-
- #return $pxt->include('/network/components/errata/errata_list.pxi');
- return $pxt->include('/network/components/systemactions/errata_update_errata_list.pxi');
-}
-
-sub errata_update_system_list {
- my $self = shift;
- my $pxt = shift;
-
- # faking out the ServerList sniglet. woot!
- $pxt->context(system_list_view_mode => 'action');
- $pxt->context(system_list_view_mode_param => $pxt->param('aid'));
-
- return $pxt->include('/network/components/systemactions/errata_update_system_list.pxi');
-}
-
-1;
diff --git a/web/modules/cypress/Cypress/ServerGroupList.pm b/web/modules/cypress/Cypress/ServerGroupList.pm
deleted file mode 100644
index 8120c50..0000000
--- a/web/modules/cypress/Cypress/ServerGroupList.pm
+++ /dev/null
@@ -1,106 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-package Cypress::ServerGroupList;
-use Grail::Component;
-
-@Cypress::ServerGroupList::ISA = qw/Grail::Component/;
-
-my @component_modes =
- (
- [ 'sgroups_in_org_full', 'sgroups_in_org_full', undef, undef ],
- [ 'sgroups_in_org_partial', 'sgroups_in_org_partial', 'System Group List Summary', undef ],
- [ 'groups_for_a_server', 'groups_for_a_server', undef, undef ],
- [ 'groups_for_a_user_group', 'groups_for_a_user_group', undef, undef ],
- [ 'groups_for_a_user', 'groups_for_a_user', undef, undef ],
- [ 'sgroups_in_org_no_header', 'sgroups_in_org_no_header', undef, undef],
- [ 'sgroups_set_no_header', 'sgroups_set_no_header', undef, undef]
- );
-
-sub component_modes {
- return @component_modes;
-}
-
-sub groups_for_a_user_group {
- my $self = shift;
- my $pxt = shift;
-
- $pxt->context(server_group_list_view_mode => 'ugroup');
- $pxt->context(server_group_list_view_mode_param => $pxt->param('ugid'));
- return $pxt->include('/network/components/systemgroups/system_group_list_no_header.pxi');
-}
-
-sub sgroups_set_no_header {
- my $self = shift;
- my $pxt = shift;
-
- $pxt->context(server_group_list_view_mode => 'set');
- $pxt->context(server_group_list_view_mode_param => 'server_group_list');
- return $pxt->include('/network/components/systemgroups/system_group_list_no_header.pxi');
-}
-
-sub groups_for_a_user {
- my $self = shift;
- my $pxt = shift;
-
- $pxt->context(server_group_list_view_mode => 'user');
- $pxt->context(server_group_list_view_mode_param => $pxt->param('uid'));
- return $pxt->include('/network/components/systemgroups/system_group_list_no_header.pxi');
-}
-
-sub sgroups_in_org_no_header {
- my $self = shift;
- my $pxt = shift;
-
- return $pxt->include('/network/components/systemgroups/system_group_list_no_header.pxi');
-}
-
-sub sgroups_in_org_full {
- my $self = shift;
- my $pxt = shift;
-
- return guts($pxt);
-}
-
-sub sgroups_in_org_partial {
- my $self = shift;
- my $pxt = shift;
-
- # this is going to the ServerList sniglet...
- $pxt->context(server_group_lower => 1);
- $pxt->context(server_group_upper => 5);
-
- return windowed_guts($pxt);
-}
-
-sub groups_for_a_server {
- my $self = shift;
- my $pxt = shift;
-
- return guts($pxt);
-}
-
-sub guts {
- my $pxt = shift;
- return $pxt->include("/network/components/systemgroups/system_group_list.pxi");
-}
-
-sub windowed_guts {
- my $pxt = shift;
- return $pxt->include("/network/components/systemgroups/system_group_list_partial.pxi");
-}
-
-1;
diff --git a/web/modules/cypress/Cypress/Slashdot.pm b/web/modules/cypress/Cypress/Slashdot.pm
deleted file mode 100644
index 208380a..0000000
--- a/web/modules/cypress/Cypress/Slashdot.pm
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-package Cypress::Slashdot;
-use Grail::Component;
-
-use LWP::UserAgent;
-use HTTP::Request;
-
-@Cypress::Slashdot::ISA = qw/Grail::Component/;
-
-my @component_modes =
- (
- [ 'nav_canvas', 'slashdot_headlines', 'Slashdot Headlines', undef ],
- [ 'main_canvas_partial', 'slashdot_headlines', 'Slashdot Headlines', undef ],
- );
-
-sub component_modes {
- return @component_modes;
-}
-
-sub slashdot_headlines {
- my $self = shift;
- my $pxt = shift;
- my %params = @_;
- my $num = $params{num} || 100;
-
- my $ua = new LWP::UserAgent;
- my $req = new HTTP::Request GET => "http://minbar.devel.redhat.com/network/slashdot.rdf";
- my $response = $ua->request($req);
-
- if ($response->is_success) {
- my $rdf = $response->content;
-
- my @bullets;
- my @items = $rdf =~ m(<item>(.*?)</item>)gsm;
-
- $#items = $num - 1 if $#items > $num - 1;
-
- foreach my $item (@items) {
- my ($title) = $item =~ m(<title>(.*?)</title>)gms;
- my ($link) = $item =~ m(<link>(.*?)</link>)gms;
-
- push @bullets, qq{<A HREF="$link">$title</A>};
- }
-
- return "<UL>" . join("", map { "<LI>$_</LI>\n" } @bullets) . "</UL>";
- }
- else {
- return "<pre>Error reading from slashdot: " . $response->status_line . "</pre>\n";
- }
-}
-
-1;
diff --git a/web/modules/cypress/Cypress/User.pm b/web/modules/cypress/Cypress/User.pm
deleted file mode 100644
index bb95993..0000000
--- a/web/modules/cypress/Cypress/User.pm
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-package Cypress::User;
-use Grail::Component;
-
-@Cypress::User::ISA = qw/Grail::Component/;
-
-my @component_modes =
- (
-
- # revised modes:
- [ 'need_more_info', 'need_more_info', undef, undef ],
-
- [ 'user_search', 'user_search', undef, undef ],
- [ 'selection_list', 'selection_list', undef, undef ]
- );
-
-sub component_modes {
- return @component_modes;
-}
-
-sub check_access_or_die {
- my $pxt = shift;
-
- my $user = $pxt->user;
- if(!$user->is('org_admin') and $pxt->param('uid') and $user->id != $pxt->param('uid')) {
- die "Insufficinet access rights";
- }
-}
-
-sub need_more_info {
- my $self = shift;
- my $pxt = shift;
-
- check_access_or_die($pxt);
-
- $pxt->redirect('/network/user/user_addresses.pxt?uid=' . $pxt->user->id);
-}
-
-
-sub selection_list {
- my $self = shift;
- my $pxt = shift;
-
- return '' unless $pxt->user;
-
- return $pxt->include('/network/components/user/user_selections.pxi') . $pxt->include('/network/components/user/recent_wizards.pxi');
-
- #return "Current Selections:<br><ul>" . join("", map { exists $pretty{$_->[0]} ? "<li>$_->[1] $pretty{$_->[0]}</li>" : () } $pxt->user->selection_details) . "</ul>";
-}
-
-sub user_search {
- my $self = shift;
- my $pxt = shift;
-
- return $pxt->include('/network/components/search/user_search.pxi');
-}
-
-1;
diff --git a/web/modules/cypress/Cypress/UserActions.pm b/web/modules/cypress/Cypress/UserActions.pm
deleted file mode 100644
index 6d44599..0000000
--- a/web/modules/cypress/Cypress/UserActions.pm
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-package Cypress::UserActions;
-use Grail::Component;
-
-use Carp;
-
-@Cypress::UserActions::ISA = qw/Grail::Component/;
-
-my @component_modes =
- (
- [ 'usergroup_add_remove', 'add_remove_to_groups', undef, undef ]
- );
-
-sub component_modes {
- return @component_modes;
-}
-
-sub add_remove_to_groups {
- my $self = shift;
- my $pxt = shift;
-
- my $user = $pxt->user;
-
- # what are the rules about adding/removing servers to a group?
- croak "attempt to add/remove users from usergroups by a non-orgadmin " unless $user->is('org_admin');
-
- return $pxt->include('/network/components/useractions/user_set_group_assign.pxi');
-}
-
-1;
diff --git a/web/modules/cypress/Cypress/UserGroupList.pm b/web/modules/cypress/Cypress/UserGroupList.pm
deleted file mode 100644
index 16f789b..0000000
--- a/web/modules/cypress/Cypress/UserGroupList.pm
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-package Cypress::UserGroupList;
-use Grail::Component;
-
-@Cypress::UserGroupList::ISA = qw/Grail::Component/;
-
-my @component_modes =
- (
- [ 'user_group_list', 'ugroups_in_org', undef, undef ],
- [ 'user_group_list_windowed', 'ugroups_in_org_partial', 'User Group List Summary', undef ],
- [ 'groups_for_a_user', 'groups_for_a_user', undef, undef ],
- [ 'ugroups_in_org_no_header', 'ugroups_in_org_no_header', undef, undef],
- [ 'ugroups_set_no_header', 'ugroups_set_no_header', undef, undef]
- );
-
-sub component_modes {
- return @component_modes;
-}
-
-sub ugroups_set_no_header {
- my $self = shift;
- my $pxt = shift;
-
- $pxt->context(user_group_list_view_mode => 'set');
- $pxt->context(user_group_list_view_mode_param => 'user_group_list');
- return $pxt->include('/network/components/usergroups/user_group_list_no_header.pxi');
-}
-
-sub ugroups_in_org_no_header {
- my $self = shift;
- my $pxt = shift;
-
- return $pxt->include('/network/components/usergroups/user_group_list_no_header.pxi');
-}
-
-
-sub ugroups_in_org {
- my $self = shift;
- my $pxt = shift;
-
- return guts($pxt);
-}
-
-sub ugroups_in_org_partial {
- my $self = shift;
- my $pxt = shift;
-
- # this is going to the UserList sniglet...
- $pxt->context(user_group_lower => 1);
- $pxt->context(user_group_upper => 5);
-
- return windowed_guts($pxt);
-}
-
-sub groups_for_a_user {
- my $self = shift;
- my $pxt = shift;
-
- $pxt->context(user_group_list_view_mode => 'user');
- $pxt->context(user_group_list_view_mode_param => $pxt->param('uid'));
- return $pxt->include('/network/components/usergroups/user_group_list_no_header.pxi');
-}
-
-
-sub guts {
- my $pxt = shift;
- return $pxt->include("/network/components/usergroups/user_group_list.pxi");
-}
-
-sub windowed_guts {
- my $pxt = shift;
- $pxt->include("/network/components/usergroups/user_group_list_partial.pxi");
-}
-
-1;
diff --git a/web/modules/cypress/MANIFEST b/web/modules/cypress/MANIFEST
deleted file mode 100644
index 4b8af2e..0000000
--- a/web/modules/cypress/MANIFEST
+++ /dev/null
@@ -1,19 +0,0 @@
-Changes
-Makefile.PL
-MANIFEST
-test.pl
-cypress.spec
-Cypress/Alerts.pm
-Cypress/Channel.pm
-Cypress/Errata.pm
-Cypress/EventsAndTraining.pm
-Cypress/Package.pm
-Cypress.pm
-Cypress/RhnServices.pm
-Cypress/Search.pm
-Cypress/ServerActions.pm
-Cypress/ServerGroupList.pm
-Cypress/Slashdot.pm
-Cypress/UserActions.pm
-Cypress/UserGroupList.pm
-Cypress/User.pm
diff --git a/web/modules/cypress/Makefile b/web/modules/cypress/Makefile
deleted file mode 100644
index 392f26c..0000000
--- a/web/modules/cypress/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# dummy Makefile for perl module
-#
-# $Id$
-
-TOP = ../..
-export TOP
-
-include $(TOP)/Makefile.defs
diff --git a/web/modules/cypress/Makefile.PL b/web/modules/cypress/Makefile.PL
deleted file mode 100644
index 3101155..0000000
--- a/web/modules/cypress/Makefile.PL
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/perl
-# perl makefile for the cypress module
-#
-# $Id$
-
-use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
-
-my $file = qx|ls $ENV{'TOP'}/*.spec|;
-chomp $file;
-my $version = qx|grep '^Version: ' $file|;
-chomp $version;
-$version = (split /\s*:\s*/, $version)[-1];
-
-die "No version or name from $file spec" unless $version;
-
-WriteMakefile('NAME' => "Cypress",
- 'VERSION' => $version,
- 'LIBS' => [''], # e.g., '-lm'
- 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
- 'INC' => '', # e.g., '-I/usr/include/other'
- 'MAKEFILE' => "Makefile.perl", # the name of the output Makefile file
-);
diff --git a/web/modules/cypress/test.pl b/web/modules/cypress/test.pl
deleted file mode 100644
index b897f20..0000000
--- a/web/modules/cypress/test.pl
+++ /dev/null
@@ -1,20 +0,0 @@
-# Before `make install' is performed this script should be runnable with
-# `make test'. After `make install' it should work as `perl test.pl'
-
-######################### We start with some black magic to print on failure.
-
-# Change 1..1 below to 1..last_test_to_print .
-# (It may become useful if the test is moved to ./t subdirectory.)
-
-BEGIN { $| = 1; print "1..1\n"; }
-END {print "not ok 1\n" unless $loaded;}
-use Cypress;
-$loaded = 1;
-print "ok 1\n";
-
-######################### End of black magic.
-
-# Insert your test code below (better if it prints "ok 13"
-# (correspondingly "not ok 13") depending on the success of chunk 13
-# of the test code):
-
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index 0e7db68..12dfd18 100644
--- a/web/spacewalk-web.spec
+++ b/web/spacewalk-web.spec
@@ -68,15 +68,6 @@ Dobby is collection of perl modules and scripts to administer an Oracle
database.
-%package -n spacewalk-cypress
-Summary: Cypress, a collection of Grail applications for Red Hat Network
-Group: Applications/Internet
-Obsoletes: rhn-cypress < 5.3.0
-Provides: rhn-cypress = 5.3.0
-
-%description -n spacewalk-cypress
-Cypress is a collection of Components for Grail.
-
%package -n spacewalk-grail
Summary: Grail, a component framework for Red Hat Network
Requires: spacewalk-base
@@ -253,11 +244,6 @@ rm -rf $RPM_BUILD_ROOT
%{perl_vendorlib}/PXT/Config.pm
%attr(640,root,apache) %config %{_sysconfdir}/rhn/default/rhn_web.conf
-%files -n spacewalk-cypress
-%defattr(644,root,root,755)
-%{perl_vendorlib}/Cypress.pm
-%{perl_vendorlib}/Cypress/
-
%files -n spacewalk-dobby
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/db-control
commit 827ff2e3e18040f355013d8054f281cdf7e27318
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 15:45:07 2009 +0100
Removing render_dynamic_canvas as only render_canvas is used in Grail::Frame.
diff --git a/web/modules/grail/Grail/Canvas.pm b/web/modules/grail/Grail/Canvas.pm
index 533b3b4..e40c93b 100644
--- a/web/modules/grail/Grail/Canvas.pm
+++ b/web/modules/grail/Grail/Canvas.pm
@@ -25,7 +25,6 @@ use Carp;
my @component_modes =
(
[ 'render_canvas', 'render_canvas', undef, undef ],
- [ 'render_dynamic_canvas', 'render_dynamic_canvas', undef, undef ]
);
sub component_modes {
@@ -81,38 +80,6 @@ sub render_canvas {
return $self->render_components($pxt, $mode, $block, @components);
}
-sub render_dynamic_canvas {
- my $self = shift;
- my $pxt = shift;
- my $mode = shift;
- my $block = shift;
-
- my @component_list;
- if (not $pxt->user or $pxt->user->id < 0) {
- @component_list = map { [ $_, $mode ] } qw/Cypress::Slashdot/;
- }
- else {
- @component_list = RHN::Grail->components_for_user($pxt->user->id);
- }
-
-# warn "Component list: " . Data::Dumper->Dump(\@component_list);
-
- my @components;
- foreach (@component_list) {
- my $file = $_->[0];
- $file =~ s/::/\//g;
- $file =~ /(.*)/; # clear taint, grr
- $file = $1;
-
- require "$file.pm";
-
-
- push @components, [ $_->[0]->new(), $_->[1], [ ] ];
- }
-
- return $self->render_components($pxt, $mode, $block, @components);
-}
-
sub render_components {
my $self = shift;
14 years, 4 months
3 commits - satellite/fedora web/modules web/spacewalk-web.spec
by Jan Pazdziora
satellite/fedora/config/etc/rhn/satellite-httpd/conf.d/satellite.conf | 5
satellite/fedora/config/etc/rhn/satellite-httpd/conf/rhnweb.conf | 67 --
satellite/fedora/setup-symlinks.sh | 134 -----
web/modules/rhn/RHN/DB/Message.pm | 248 ----------
web/modules/rhn/RHN/DB/Message/ServerMessage.pm | 154 ------
web/modules/rhn/RHN/DB/Message/TextMessage.pm | 152 ------
web/modules/rhn/RHN/SearchTypes.pm | 9
web/modules/rhn/RHN/ServerMessage.pm | 24
web/spacewalk-web.spec | 2
9 files changed, 795 deletions(-)
New commits:
commit 9b70aa7d51b3cf7bb8b73cc3b680f7c599555355
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 14:27:37 2009 +0100
satellite/fedora seems not to be used in Satellite 5.3 / Spacewalk 0.7.
diff --git a/satellite/fedora/config/etc/rhn/satellite-httpd/conf.d/satellite.conf b/satellite/fedora/config/etc/rhn/satellite-httpd/conf.d/satellite.conf
deleted file mode 100644
index 4da2bb6..0000000
--- a/satellite/fedora/config/etc/rhn/satellite-httpd/conf.d/satellite.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-ServerRoot "/etc/rhn/satellite-httpd"
-
-Include conf/rhnweb.conf
-Include conf/rhn_server.conf
-
diff --git a/satellite/fedora/config/etc/rhn/satellite-httpd/conf/rhnweb.conf b/satellite/fedora/config/etc/rhn/satellite-httpd/conf/rhnweb.conf
deleted file mode 100644
index 74ccd16..0000000
--- a/satellite/fedora/config/etc/rhn/satellite-httpd/conf/rhnweb.conf
+++ /dev/null
@@ -1,67 +0,0 @@
-<IfModule !perl_module>
-LoadModule perl_module modules/mod_perl.so
-</IfModule>
-
-PerlTaintCheck Off
-
-PerlFixupHandler Apache2::SizeLimit
-
-PerlRequire /etc/rhn/satellite-httpd/conf/startup.pl
-
-# these will be set via /etc/sysconfig/satellite-httpd
-PerlPassEnv ORACLE_HOME
-PerlPassEnv NLS_LANG
-
-PerlOptions +GlobalRequest
-
-ErrorDocument 403 /errors/permission.pxt
-ErrorDocument 404 /errors/404.pxt
-ErrorDocument 413 /errors/413.pxt
-ErrorDocument 500 /errors/500.pxt
-
-AddType text/pxt .pxt
-<Files *.pxt>
- SetHandler perl-script
- PerlHandler PXT::ApacheHandler
-</Files>
-
-<Files *.pxi>
- Order allow,deny
- Deny from all
- Satisfy All
-</Files>
-
-LoadModule jk_module modules/mod_jk.so
-
-# <IfDefine HAVE_JK>
- JkWorkersFile /etc/rhn/satellite-httpd/conf/workers.properties
- JkLogLevel info
- JkLogFile /var/log/httpd/mod_jk.log
- JkMount /rhn/* ajp13
- JkMount /rhn ajp13
- JkMount /*.do ajp13
- JkMount /*.jsp ajp13
- JkHTTPSIndicator HTTPS
-# </IfDefine>
-
-RedirectMatch ^/renew/.* http://rhn.redhat.com
-RedirectMatch ^/index\.html$ /rhn/Login.do
-
-# Turn rewrite engine on so we can use it for
-# kickstart requests.
-RewriteEngine on
-
-# Disable TRACE and TRACK
-RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
-RewriteRule .* - [F]
-
-# This rule handles incoming kickstart file requests from
-# machines actually performing a kickstart. This rule
-# processes the incoming URL and converts it into something
-# slightly more Struts friendly.
-RewriteRule ^/kickstart/ks([-a-zA-Z0-9\._/\%\ ]*)$ /rhn/kickstart/DownloadFile.do?ksurl=$1 [P]
-RewriteRule ^/download/([-a-zA-Z0-9\._/\%\ ]*)$ /rhn/common/DownloadFile.do?url=$1 [P]
-RewriteRule ^/rpc/api /rhn/rpc/api [P]
-
-# For rhn-custom-info
-RewriteRule ^/WEBRPC /rhn/rpc/api [P]
diff --git a/satellite/fedora/setup-symlinks.sh b/satellite/fedora/setup-symlinks.sh
deleted file mode 100755
index 024e40f..0000000
--- a/satellite/fedora/setup-symlinks.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/bash
-
-let errors=0
-
-makedir()
-{
- echo ""
- if [ -d $1 ]
- then
- echo "directory ( $1 ) already exists"
- else
- echo "making directory ( $1 ) ..."
- mkdir -p $1
- fi
-}
-
-symlink()
-{
- echo ""
- if [ ! -e $1 ]
- then
- echo "( $1 ) NOT-LINKED, file not found"
- let errors+=1
- return
- fi
- DIR=`pwd`
- if [ -z $2 ]
- then
- NAME=`basename $1`
- else
- NAME=$2
- fi
- if [ -L $NAME ]
- then
- echo "( $DIR/$NAME ) already linked, unlinking..."
- rm -f $NAME
- else
- if [ -e $NAME ]
- then
- echo "( $DIR/$NAME ) already exists, saving ..."
- mv $NAME $NAME.save
- fi
- fi
- echo "linking ( $DIR/$NAME ) as:"
- echo " ( $1 ) ..."
- ln -s $1 $NAME
-}
-
-if [ -z $GITDIR ] ; then
- echo "Please set GITDIR to the root of your GIT checkout"
- exit 1
-fi
-
-makedir /etc/rhn
-makedir /etc/rhn/search
-makedir /etc/rhn/default
-makedir /etc/rhn/satellite-httpd
-makedir /etc/rhn/satellite-httpd/conf
-makedir /etc/rhn/satellite-httpd/conf.d
-makedir /etc/rhn/satellite-httpd/conf/rhn
-makedir /etc/sysconfig/rhn
-makedir /var/www/lib
-
-cd /etc
-symlink $GITDIR/satellite/config/etc/webapp-keyring.gpg
-
-cd /etc/rhn
-symlink $GITDIR/web/conf/rhn.conf
-
-cd /etc/rhn/default
-symlink $GITDIR/web/conf/rhn_web.conf
-symlink $GITDIR/java/conf/default/rhn_hibernate.conf
-
-cd /etc/rhn/satellite-httpd
-symlink /var/log/httpd logs
-symlink /usr/lib/httpd/modules
-symlink /var/run
-
-cd /etc/rhn/satellite-httpd/conf
-symlink $GITDIR/backend/httpd-conf/rhn_server.conf
-symlink $GITDIR/satellite/fedora/config/etc/rhn/satellite-httpd/conf/rhnweb.conf
-symlink $GITDIR/satellite/config/etc/rhn/satellite-httpd/conf/satidmap.pl
-symlink $GITDIR/satellite/config/etc/rhn/satellite-httpd/conf/startup.pl
-symlink $GITDIR/satellite/config/etc/rhn/satellite-httpd/conf/workers.properties
-
-cd /etc/rhn/satellite-httpd/conf.d
-symlink $GITDIR/satellite/fedora/config/etc/rhn/satellite-httpd/conf.d/satellite.conf
-
-cd /etc/httpd/conf.d
-symlink /etc/rhn/satellite-httpd/conf.d/satellite.conf
-
-#Note...not symlinking here since we'll be modifying this file and
-#don't want to checkin the change.
-cp $GITDIR/satellite/config/etc/sysconfig/satellite-httpd /etc/sysconfig
-sudo sed -i 's/@@serverDOTnls_lang@(a)/english.UTF8/g' /etc/sysconfig/satellite-httpd
-
-cd /var/www
-symlink $GITDIR/web/html
-
-cd /var/www/html
-symlink $GITDIR/branding/css
-symlink $GITDIR/branding/img
-symlink $GITDIR/branding/templates
-
-cd /var/www/html/nav
-symlink $GITDIR/branding/styles
-
-cd /var/www/lib
-symlink $GITDIR/web/modules/cypress/Cypress
-symlink $GITDIR/web/modules/dobby/Dobby
-symlink $GITDIR/web/modules/grail/Grail
-symlink $GITDIR/web/modules/rhn/RHN
-symlink $GITDIR/web/modules/pxt/PXT
-symlink $GITDIR/web/modules/
-symlink $GITDIR/web/modules/sniglets/Sniglets
-
-
-cd /var/lib/tomcat5/webapps
-symlink $GITDIR/java/rhnwebapp rhn
-
-cd /etc/tomcat5/Catalina/localhost
-symlink $GITDIR/java/conf/rhn.xml
-
-cd /etc/rhn/search
-symlink $GITDIR/search-server/src/config/search/rhn_search.conf
-
-cd $GITDIR/java
-symlink conf/eclipse/.project
-
-echo ""
-echo "Finished: errors = $errors"
-echo ""
-
-exit $errors
commit f694d433ba01c6ccccc214f23ee5ecc7db5ce6f0
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 14:00:16 2009 +0100
Removals of previous use of register_type makes it dead code.
diff --git a/web/modules/rhn/RHN/SearchTypes.pm b/web/modules/rhn/RHN/SearchTypes.pm
index 3b2d0f8..10d5988 100644
--- a/web/modules/rhn/RHN/SearchTypes.pm
+++ b/web/modules/rhn/RHN/SearchTypes.pm
@@ -31,15 +31,6 @@ sub find_type {
return $ret;
}
-sub register_type {
- my $class = shift;
- my $label = shift;
- my $type = shift;
- die "invalid search type $type" unless $type->isa("RHN::SearchType");
-
- $search_types{$label} = $type;
-}
-
package RHN::SearchType;
use Params::Validate qw/validate/;
commit fb3b025a9f81205295ab2ae9d7ba579ed9ebe8f8
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:58:08 2009 +0100
Removal of RHN::Message also allows the other *Message packages to be removed.
diff --git a/web/modules/rhn/RHN/DB/Message.pm b/web/modules/rhn/RHN/DB/Message.pm
deleted file mode 100644
index 3d52d65..0000000
--- a/web/modules/rhn/RHN/DB/Message.pm
+++ /dev/null
@@ -1,248 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-
-package RHN::DB::Message;
-
-use RHN::DB;
-use RHN::DB::TableClass;
-
-use Carp;
-
-my @message_fields = qw/ID MESSAGE_TYPE PRIORITY CREATED:longdate MODIFIED:longdate/;
-
-my $m = new RHN::DB::TableClass("rhnMessage", "M", "", @message_fields);
-
-#class methods
-
-sub lookup_message {
- my $class = shift;
- my $id = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- my $sth;
-
- $query = $m->select_query("M.id = ?");
- $sth = $dbh->prepare($query);
- $sth->execute($id);
-
- my @columns = $sth->fetchrow;
- $sth->finish;
-
- my $ret;
- if ($columns[0]) {
- $ret = $class->_blank_message();
- foreach ($m->method_names) {
- $ret->{"__${_}__"} = shift @columns;
- }
-
- delete $ret->{":modified:"};
- }
-
- return $ret;
-}
-
-sub _blank_message {
- my $class = shift;
-
- my $self = bless { }, $class;
-
- return $self;
-}
-
-sub create_message {
- my $class = shift;
-
- my $mes = $class->_blank_message;
- $mes->{__id__} = -1;
-
- return $mes;
-}
-
-# build some accessors
-foreach my $field ($m->method_names) {
- my $sub = q {
- sub [[field]] {
- my $self = shift;
- if (@_ and "[[field]]" ne "id") {
- $self->{":modified:"}->{[[field]]} = 1;
- $self->{__[[field]]__} = shift;
- }
- return $self->{__[[field]]__};
- }
- };
-
- $sub =~ s/\[\[field\]\]/$field/g;
- eval $sub;
-
- if ($@) {
- die $@;
- }
-}
-
-sub commit {
- my $self = shift;
- my $mode = 'update';
-
- if ($self->id == -1) {
- my $dbh = RHN::DB->connect;
-
- my $sth = $dbh->prepare("SELECT rhn_m_id_seq.nextval FROM DUAL");
- $sth->execute;
- my ($id) = $sth->fetchrow;
- die "No new message id from seq rhn_m_id_seq (possible error: " . $sth->errstr . ")" unless $id;
- $sth->finish;
-
- $self->{":modified:"}->{id} = 1;
- $self->{__id__} = $id;
- $mode = 'insert';
- }
-
- die "$self->commit called on message without valid id" unless $self->id and $self->id > 0;
-
- my @modified = keys %{$self->{":modified:"}};
- my %modified = map { $_ => 1 } @modified;
-
- return unless @modified;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- if ($mode eq 'update') {
- $query = $m->update_query($m->methods_to_columns(@modified));
- $query .= "M.ID = ?";
- }
- else {
- $query = $m->insert_query($m->methods_to_columns(@modified));
- }
-
- my $sth = $dbh->prepare($query);
- $sth->execute((map { $self->$_() } grep { $modified{$_} } $m->method_names), ($mode eq 'update') ? ($self->id) : ());
-
- $dbh->commit;
- delete $self->{":modified:"};
-}
-
-sub tc {
- return $m;
-}
-
-sub user_messages {
- my $class = shift;
- my %attr = @_;
-
- my ($uid, $lower, $upper, $total_ref, $mode, $mode_params, $all_ids) = map { $attr{"-" . $_} } qw/uid lower upper total_rows mode mode_params all_ids/;
-
- $lower ||= 1;
- $upper ||= 100000;
-
- die "user_messages called without uid" unless defined $uid;
-
- my $query;
-
- if ($mode eq 'all') {
-
- $query =<<EOQ;
-SELECT DISTINCT M.id, M.modified
- FROM rhnMessage M, rhnUserMessage UM, rhnUserMessageStatus UMS
- WHERE UM.user_id = ?
- AND M.id = UM.message_id
-ORDER BY M.modified DESC
-EOQ
-}
- elsif ($mode eq 'status') {
-
- $query =<<EOQ;
-SELECT DISTINCT M.id, M.modified
- FROM rhnMessage M, rhnUserMessage UM, rhnUserMessageStatus UMS
- WHERE UM.user_id = ?
- AND M.id = UM.message_id
- AND UM.status = UMS.id
- AND UMS.label = ?
-ORDER BY M.modified DESC
-EOQ
-}
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare($query);
- $sth->execute(@{$mode_params});
-
- my @ids;
- my $i = 0;
-
- while (my ($id) = $sth->fetchrow) {
- push @{$all_ids}, $id if $all_ids;
-
- $i++;
- if ($i >= $lower and $i <= $upper) {
- push @ids, $id;
- }
- }
-
- $$total_ref = $i;
-
- if (@ids) {
- $sth = $dbh->prepare(sprintf(<<EOQ, join(", ", ('?') x (scalar @ids))));
- SELECT distinct M.id, M.message_type, M.priority, UMS.label,
- (SELECT SM.server_id FROM rhnServerMessage SM WHERE SM.message_id = M.id),
- (SELECT S.name FROM rhnServer S, rhnServerMessage SM WHERE SM.message_id = M.id AND S.id = SM.server_id),
- (SELECT SE.details FROM rhnServerEvent SE, rhnServerMessage SM WHERE SM.message_id = M.id AND SE.id = SM.server_event),
- (SELECT TM.message_body FROM rhnTextMessage TM WHERE TM.message_id = M.id),
- TO_CHAR(M.created, 'YYYY-MM-DD HH24:MI:SS'), TO_CHAR(M.modified, 'YYYY-MM-DD HH24:MI:SS')
- FROM rhnMessage M, rhnUserMessage UM, rhnUserMessageStatus UMS
- WHERE M.id IN (%s)
- AND UM.message_id = M.id
- AND UMS.id = UM.status
-ORDER BY TO_CHAR(M.modified, 'YYYY-MM-DD HH24:MI:SS') DESC
-EOQ
-
- $sth->execute(@ids);
-
- my @ret;
-
- while (my @row = $sth->fetchrow) {
- push @ret, [ @row ];
- }
- return @ret;
- }
- return ();
-}
-
-sub update_status_from_set {
- my $class = shift;
- my $status = shift;
- my $set = shift;
-
-
- my $dbh = RHN::DB->connect;
- my $query = <<EOQ;
-UPDATE rhnUserMessage UM
- SET UM.status = (SELECT UMS.id FROM rhnUserMessageStatus UMS WHERE UMS.label = ?)
- WHERE UM.message_id IN(SELECT element FROM rhnSet S WHERE S.user_id = ? AND S.label = ?)
-EOQ
-
- my $sth = $dbh->prepare($query);
-
- $sth->execute($status, $set->uid, $set->label);
-
- $dbh->commit;
-
- return 1;
-}
-
-1;
diff --git a/web/modules/rhn/RHN/DB/Message/ServerMessage.pm b/web/modules/rhn/RHN/DB/Message/ServerMessage.pm
deleted file mode 100644
index e7ac5f8..0000000
--- a/web/modules/rhn/RHN/DB/Message/ServerMessage.pm
+++ /dev/null
@@ -1,154 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-
-package RHN::DB::Message::ServerMessage;
-
-use RHN::DB;
-use RHN::DB::TableClass;
-use RHN::DB::Message;
-
-use Data::Dumper;
-
-use Carp;
-
-our @ISA = qw/RHN::DB::Message/;
-
-my @server_message_fields = qw/MESSAGE_ID SERVER_ID SERVER_EVENT/;
-my @user_message_fields = qw/MESSAGE_ID USER_ID STATUS/;
-
-my $s = new RHN::DB::TableClass("rhnServerMessage", "SM", "", @server_message_fields);
-my $u = new RHN::DB::TableClass("rhnUserMessage", "UM", "user", @user_message_fields);
-
-my $sm = RHN::DB::Message->tc->create_join([ $s, $u ], { "rhnMessage" => { "rhnServerMessage" => [ "ID", "MESSAGE_ID" ],
- "rhnUserMessage" => [ "ID", "MESSAGE_ID" ] } });
-
-#class methods
-
-sub lookup_message {
- my $class = shift;
- my $id = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- my $sth;
-
- $query = $sm->select_query("M.id = ?");
- $sth = $dbh->prepare($query);
- $sth->execute($id);
-
- my @columns = $sth->fetchrow;
- $sth->finish;
-
- my $ret;
- if ($columns[0]) {
- $ret = $class->_blank_message();
- foreach ($sm->method_names) {
- $ret->{"__${_}__"} = shift @columns;
- }
-
- delete $ret->{":modified:"};
- }
- return $ret;
-}
-
-sub _blank_message {
- my $class = shift;
-
- my $self = bless { }, $class;
-
- return $self;
-}
-
-sub create_message {
- my $class = shift;
-
- my $mes = $class->_blank_message;
- $mes->{__id__} = -1;
-
- return $mes;
-}
-
-# build some accessors
-foreach my $field ($sm->method_names) {
- my $sub = q {
- sub [[field]] {
- my $self = shift;
- if (@_ and "[[field]]" ne "id") {
- $self->{":modified:"}->{[[field]]} = 1;
- $self->{__[[field]]__} = shift;
- }
- return $self->{__[[field]]__};
- }
- };
-
- $sub =~ s/\[\[field\]\]/$field/g;
- eval $sub;
-
- if ($@) {
- die $@;
- }
-}
-
-sub commit {
- my $self = shift;
- my $mode = 'update';
-
- if ($self->id == -1) {
- my $dbh = RHN::DB->connect;
-
- my $sth = $dbh->prepare("SELECT rhn_m_id_seq.nextval FROM DUAL");
- $sth->execute;
- my ($id) = $sth->fetchrow;
- die "No new message id from seq rhn_m_id_seq (possible error: " . $sth->errstr . ")" unless $id;
- $sth->finish;
-
- $self->{":modified:"}->{id} = 1;
- $self->{__id__} = $id;
- $self->{":modified:"}->{message_id} = 1;
- $self->{__message_id__} = $id;
- $mode = 'insert';
- }
-
- die "$self->commit called on message without valid id" unless $self->id and $self->id > 0;
-
- my @modified = keys %{$self->{":modified:"}};
- my %modified = map { $_ => 1 } @modified;
-
- return unless @modified;
-
- my $dbh = RHN::DB->connect;
-
- my @queries;
- if ($mode eq 'update') {
- @queries = $sm->update_queries($sm->methods_to_columns(@modified));
- }
- else {
- @queries = $sm->insert_queries($sm->methods_to_columns(@modified));
- }
-
- foreach my $query (@queries) {
- my $sth = $dbh->prepare($query->[0]);
- my @vars = ((map { $self->$_() } grep { exists $modified{$_} } @{$query->[1]}), $modified{id} ? () : $self->id);
- $sth->execute(@vars);
- }
-
- $dbh->commit;
- delete $self->{":modified:"};
-}
-
-1;
diff --git a/web/modules/rhn/RHN/DB/Message/TextMessage.pm b/web/modules/rhn/RHN/DB/Message/TextMessage.pm
deleted file mode 100644
index 1184003..0000000
--- a/web/modules/rhn/RHN/DB/Message/TextMessage.pm
+++ /dev/null
@@ -1,152 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-
-package RHN::DB::Message::TextMessage;
-
-use RHN::DB;
-use RHN::DB::TableClass;
-use RHN::DB::Message;
-
-use Carp;
-
-our @ISA = qw/RHN::DB::Message/;
-
-my @text_message_fields = qw/MESSAGE_ID MESSAGE_BODY/;
-my @user_message_fields = qw/MESSAGE_ID USER_ID STATUS/;
-
-my $t = new RHN::DB::TableClass("rhnTextMessage", "TM", "", @text_message_fields);
-my $u = new RHN::DB::TableClass("rhnUserMessage", "UM", "user", @user_message_fields);
-
-my $tm = RHN::DB::Message->tc->create_join([ $t, $u ], { "rhnMessage" => { "rhnTextMessage" => [ "ID", "MESSAGE_ID" ],
- "rhnUserMessage" => [ "ID", "MESSAGE_ID" ] } });
-
-#class methods
-
-sub lookup_message {
- my $class = shift;
- my $id = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- my $sth;
-
- $query = $tm->select_query("M.id = ?");
- $sth = $dbh->prepare($query);
- $sth->execute($id);
-
- my @columns = $sth->fetchrow;
- $sth->finish;
-
- my $ret;
- if ($columns[0]) {
- $ret = $class->_blank_message();
- foreach ($tm->method_names) {
- $ret->{"__${_}__"} = shift @columns;
- }
-
- delete $ret->{":modified:"};
- }
- return $ret;
-}
-
-sub _blank_message {
- my $class = shift;
-
- my $self = bless { }, $class;
-
- return $self;
-}
-
-sub create_message {
- my $class = shift;
-
- my $mes = $class->_blank_message;
- $mes->{__id__} = -1;
-
- return $mes;
-}
-
-# build some accessors
-foreach my $field ($tm->method_names) {
- my $sub = q {
- sub [[field]] {
- my $self = shift;
- if (@_ and "[[field]]" ne "id") {
- $self->{":modified:"}->{[[field]]} = 1;
- $self->{__[[field]]__} = shift;
- }
- return $self->{__[[field]]__};
- }
- };
-
- $sub =~ s/\[\[field\]\]/$field/g;
- eval $sub;
-
- if ($@) {
- die $@;
- }
-}
-
-sub commit {
- my $self = shift;
- my $mode = 'update';
-
- if ($self->id == -1) {
- my $dbh = RHN::DB->connect;
-
- my $sth = $dbh->prepare("SELECT rhn_m_id_seq.nextval FROM DUAL");
- $sth->execute;
- my ($id) = $sth->fetchrow;
- die "No new message id from seq rhn_m_id_seq (possible error: " . $sth->errstr . ")" unless $id;
- $sth->finish;
-
- $self->{":modified:"}->{id} = 1;
- $self->{__id__} = $id;
- $self->{":modified:"}->{message_id} = 1;
- $self->{__message_id__} = $id;
- $mode = 'insert';
- }
-
- die "$self->commit called on message without valid id" unless $self->id and $self->id > 0;
-
- my @modified = keys %{$self->{":modified:"}};
- my %modified = map { $_ => 1 } @modified;
-
- return unless @modified;
-
- my $dbh = RHN::DB->connect;
-
- my @queries;
- if ($mode eq 'update') {
- @queries = $tm->update_queries($tm->methods_to_columns(@modified));
- }
- else {
- @queries = $tm->insert_queries($tm->methods_to_columns(@modified));
- }
-
- foreach my $query (@queries) {
- my $sth = $dbh->prepare($query->[0]);
- my @vars = ((map { $self->$_() } grep { exists $modified{$_} } @{$query->[1]}), $modified{id} ? () : $self->id);
- $sth->execute(@vars);
- }
-
- $dbh->commit;
- delete $self->{":modified:"};
-}
-
-1;
diff --git a/web/modules/rhn/RHN/ServerMessage.pm b/web/modules/rhn/RHN/ServerMessage.pm
deleted file mode 100644
index 3ff7f56..0000000
--- a/web/modules/rhn/RHN/ServerMessage.pm
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-package RHN::ServerMessage;
-
-use strict;
-use RHN::DB::Message::ServerMessage;
-
-our @ISA = qw/RHN::DB::Message::ServerMessage/;
-
-
-1;
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index be145c2..0e7db68 100644
--- a/web/spacewalk-web.spec
+++ b/web/spacewalk-web.spec
@@ -208,7 +208,6 @@ rm -rf $RPM_BUILD_ROOT
%{perl_vendorlib}/RHN/Server.pm
%{perl_vendorlib}/RHN/ServerActions.pm
%{perl_vendorlib}/RHN/ServerGroup.pm
-%{perl_vendorlib}/RHN/ServerMessage.pm
%{perl_vendorlib}/RHN/ServerNotes.pm
%{perl_vendorlib}/RHN/Session.pm
%{perl_vendorlib}/RHN/Set.pm
@@ -218,7 +217,6 @@ rm -rf $RPM_BUILD_ROOT
%{perl_vendorlib}/RHN/TSDB.pm
%{perl_vendorlib}/RHN/Tag.pm
%{perl_vendorlib}/RHN/TemplateString.pm
-%{perl_vendorlib}/RHN/TextMessage.pm
%{perl_vendorlib}/RHN/TinyURL.pm
%{perl_vendorlib}/RHN/Token.pm
%{perl_vendorlib}/RHN/TokenGen/
14 years, 4 months
33 commits - web/html web/modules
by Jan Pazdziora
web/html/forms/.htaccess | 8
web/html/forms/user_details.xml | 54 --
web/html/forms/user_prefixes.xml | 10
web/modules/grail/Grail/Frame.pm | 16
web/modules/rhn/RHN/DB/Channel.pm | 28 -
web/modules/rhn/RHN/DB/Org.pm | 40 -
web/modules/rhn/RHN/DB/Profile.pm | 19
web/modules/rhn/RHN/DB/User.pm | 194 --------
web/modules/sniglets/Sniglets/Profiles.pm | 97 ----
web/modules/sniglets/Sniglets/Users.pm | 674 ------------------------------
10 files changed, 1140 deletions(-)
New commits:
commit ab7939cf07bb0a60b34f8d1f7318785157dce1f6
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:38:28 2009 +0100
grail:canvas_trap_handler not used, removing, as well as canvas_trap_handler.
diff --git a/web/modules/grail/Grail/Frame.pm b/web/modules/grail/Grail/Frame.pm
index 873f8ad..5867931 100644
--- a/web/modules/grail/Grail/Frame.pm
+++ b/web/modules/grail/Grail/Frame.pm
@@ -29,13 +29,6 @@ sub register_tags {
$pxt->register_tag("grail-canvas-replacement" => \&canvas_replacement_handler, 50);
}
-sub register_callbacks {
- my $class = shift;
- my $pxt = shift;
-
- $pxt->register_callback('grail:canvas_trap_handler' => \&canvas_trap_handler);
-}
-
sub canvas_handler {
my $pxt = shift;
my %params = @_;
@@ -84,13 +77,4 @@ sub canvas_template_handler {
return $pxt->include($file);
}
-sub canvas_trap_handler {
- my $pxt = shift;
-
- $pxt->pnotes($_, $pxt->param($_))
- foreach qw/grail_canvas_handler grail_canvas_formvars/;
-
- $pxt->form_builder_variables(qw/grail_canvas_handler grail_canvas_formvars/);
-}
-
1;
commit dff4a0f4449cc932bfaee5f34ab0b2ba0b3ba74f
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:35:58 2009 +0100
timezone_sort not used, removing.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index 698d42b..4bc7c62 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -440,37 +440,6 @@ sub user_site_view {
}
-# sort timezones, making the listed ones pop to the top
-sub timezone_sort {
- my $class = shift;
- my @zones = @_;
-
- my $i = 10;
- my %preferred_zones =
- map { $_ => --$i }
- ( "United States (Eastern)",
- "United States (Central)",
- "United States (Indiana)",
- "United States (Mountain)",
- "United States (Arizona)",
- "United States (Pacific)",
- "United States (Alaska)",
- "United States (Hawaii)" );
-
- # now we we-order the timezones based on a random, euro-centric hueristic
- @zones =
- sort {
- my $a_name = $a->{DESCRIPTION};
- my $b_name = $b->{DESCRIPTION};
- my $a_score = $preferred_zones{$a_name} || -1;
- my $b_score = $preferred_zones{$b_name} || -1;
-
- return ($b_score <=> $a_score) || ($a->{OFFSET} <=> $b->{OFFSET}) || ($a_name cmp $b_name);
- } @zones;
-
- return @zones;
-}
-
sub user_prefs_edit_cb {
my $pxt = shift;
commit 85aa9b4db8e8956de8e66d665a7c6c3fd3619021
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:34:59 2009 +0100
Removal of validate_user made variables @required* and %required* unused, removing.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index f958340..698d42b 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -440,28 +440,6 @@ sub user_site_view {
}
-my @required_map =
- ( 'login' => 'Username',
- 'password1' => 'Password',
- 'password2' => 'Password Confirmation',
- 'account_type' => 'Account Type',
- 'prefix' => 'Title',
- 'first_names' => 'First Name',
- 'last_name' => 'Last Name',
- 'email' => 'E-mail Address',
- );
-
-unless (PXT::Config->get('satellite')) {
- push @required_map, ('address1' => 'Mailing Address',
- 'city' => 'City',
- 'zip' => 'Zip Code',
- 'phone' => 'Phone');
-
-}
-
-my %required_map = @required_map;
-my @required_fields = map { $_ & 1 ? () : $required_map[$_] } 0..$#required_map;
-
# sort timezones, making the listed ones pop to the top
sub timezone_sort {
my $class = shift;
commit 474163bd98a4f4365fdda752ac4997e096364ef6
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:31:50 2009 +0100
validate_user not used, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index b1dbf1f..f958340 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -558,141 +558,6 @@ sub rhn_require {
return '';
}
-sub validate_user {
- my $pxt = shift;
-
- my @param_list = (qw/password1 password2 prefix first_names last_name/,
- qw/genqual parent_company company title phone fax email pin/,
- qw/first_names_ol last_name_ol address1 address2 city state zip country/,
- qw/contact_call contact_email contact_fax contact_mail account_type education_account/);
-
- my %user_params = map { ("${_}" => ($pxt->dirty_param($_) || '')) } @param_list;
- $user_params{login} = $pxt->passthrough_param('login') || '';
-
- $user_params{alt_first_names} = $user_params{first_names};
- $user_params{alt_last_name} = $user_params{last_name};
- $user_params{$_} = $user_params{$_} ? 'Y' : 'N'
- foreach qw/contact_call contact_email contact_fax contact_mail/;
-
- $user_params{$_} =~ s/^\s+// foreach keys %user_params;
- $user_params{$_} =~ s/\s+$// foreach keys %user_params;
-
- my ($min_username, $max_username) = (PXT::Config->get('min_user_len'), PXT::Config->get('max_user_len'));
-
-
-#-- BEGIN BASIC VALIDATION
- my $validator = 'valid';
-
- if (length $user_params{login} < $min_username) {
- PXT::Debug->log(7, "username too short");
- $pxt->push_message(local_alert =>"Usernames must be no shorter than $min_username characters.");
- $validator = 'invalid';
- }
- if (length $user_params{login} > $max_username) {
- PXT::Debug->log(7, "username too long");
- $pxt->push_message(local_alert =>"Usernames must be no longer than $max_username characters.");
- $validator = 'invalid';
- }
-
- if ( ( $user_params{login} !~ /^[\x20-\x7e]+$/ ) or ( $user_params{login} =~ /[&+\s%'`=#"]/ ) ) { #'
- PXT::Debug->log(7, "invalid login chars");
- $pxt->push_message(local_alert =>'The specified user name contains invalid characters. Please use alphanumeric characters.');
- $validator = 'invalid';
- }
-
- if (not PXT::Config->get('satellite')) {
- if ($user_params{login} =~ /\(a)redhat\.com$/i) {
- $pxt->push_message(local_alert => 'Usernames may not be of the form "*(a)redhat.com"');
- $validator = 'invalid';
- }
- }
-
- if ($user_params{education_account}) {
- unless ($user_params{company}) {
- $pxt->push_message(local_alert => 'You must enter a school.');
- $validator = 'invalid';
- }
-
- unless ($user_params{title}) {
- $pxt->push_message(local_alert => 'You must enter a grade, year, or position.');
- $validator = 'invalid';
- }
- }
-
- if ($user_params{account_type} eq 'create_corporate') {
-
- unless ($user_params{company}) {
- $pxt->push_message(local_alert => 'You must enter your company name.');
- $validator = 'invalid';
- }
- }
-
- my @missing;
- foreach my $field (@required_fields) {
- push @missing, $field if $user_params{$field} =~ /^\s*$/;
- }
-
- if (@missing) {
- my $msg = "The following fields are required to create or modify an account: <br />";
- if (@missing > 1) {
- $msg .= join(", ", @required_map{@missing[0..$#missing - 1]}) . ", and " . $required_map{$missing[-1]};
- }
- else {
- $msg .= $required_map{$missing[0]};
- }
-
- PXT::Debug->log(7, "missing fields");
- $pxt->push_message(local_alert =>$msg);
- $validator = 'invalid';
- }
-
- if (not Mail::RFC822::Address::valid($user_params{email})) {
- $pxt->push_message(local_alert =>'Email address is not valid.');
- $validator = 'invalid';
- # no need to display a message twice for invalid and dupe emails.
- }
-
- if ($user_params{country} eq 'US' and not $user_params{state}) {
- PXT::Debug->log(7, "no state");
- $pxt->push_message(local_alert =>'State is required for US citizens.');
- $validator = 'invalid';
- }
-
- if (length $user_params{password1} < 5) {
- PXT::Debug->log(7, "password short");
- $pxt->push_message(local_alert =>'Passwords must be at least 5 characters long.');
- $validator = 'invalid';
- }
-
- if (length $user_params{password1} > 32) {
- PXT::Debug->log(7, "password long");
- $pxt->push_message(local_alert =>'Passwords must be shorter than 32 characters long.');
- $validator = 'invalid';
- }
-
- if ($user_params{password1} ne $user_params{password2}) {
- PXT::Debug->log(7, "passwords don't match");
- $pxt->push_message(local_alert =>'Your passwords do not match; please re-confirm your password of choice.');
- $validator = 'invalid';
- }
-
- if ($user_params{account_type} eq 'into_org') {
- unless ($pxt->user->is('org_admin')) {
- PXT::Debug->log(7, "not an org admin");
- $pxt->push_message(local_alert =>'Only an Org Admin can add a user');
- $validator = 'invalid';
- }
- }
-
- $user_params{password} = $user_params{password1};
-
- PXT::Debug->log(7, "validator: $validator");
-
- return if $validator eq 'invalid';
-
- return \%user_params;
-}
-
#abstracting permission checking code from rhn_require to here
#takes a 'pxt' and a hash of params, and checks for various states and permissions
#returns true for success, false for failure
commit f4a691ac8a805c03d945726b4c3f82904f389813
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:17:53 2009 +0100
rhn:accepted not used, removing, as well as tnc_accepted_cb.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index 596f57b..b1dbf1f 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -73,15 +73,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:forgot_accounts_cb', \&forgot_accounts_cb);
$pxt->register_callback('rhn:user_prefs_edit_cb' => \&user_prefs_edit_cb);
-
- $pxt->register_callback('rhn:accepted' => \&tnc_accepted_cb);
-}
-
-#Can you see this
-sub tnc_accepted_cb {
- my $pxt = shift;
- $pxt->push_message(site_info => 'Thank you for accepting the Terms and Conditions!');
- $pxt->redirect("/rhn/YourRhn.do");
}
# secures *all* intraserver links and all links to specified exterior servers
commit fca082d990c16f33e54e2747f784151c3d62b529
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:15:58 2009 +0100
Removal of default_system_groups_cb made set_default_system_groups unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index e9edbaf..5dac40f 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -2514,42 +2514,6 @@ EOQ
return $truth ? 1 : 0;
}
-sub set_default_system_groups {
- my $self = shift;
- my @sgids = grep { $_ } @_;
-
- my $dbh = RHN::DB->connect;
-
- $self->org->owns_server_groups(@sgids)
- or die "Attempt to set system groups (@sgids) for user '" . $self->id . "' without permission";
-
- my $query =<<EOQ;
-DELETE
- FROM rhnUserDefaultSystemGroups
- WHERE user_id = :user_id
-EOQ
-
- my $sth = $dbh->prepare($query);
- $sth->execute_h(user_id => $self->id);
-
- $query =<<EOQ;
-INSERT
- INTO rhnUserDefaultSystemGroups
- (user_id, system_group_id)
-VALUES (:user_id, :sgid)
-EOQ
-
- $sth = $dbh->prepare($query);
-
- foreach my $sgid (@sgids) {
- $sth->execute_h(user_id => $self->id, sgid => $sgid);
- }
-
- $dbh->commit;
-
- return;
-}
-
##
# Sees if user exists in rhnWebContactDisabled view.
# If so, return true(1). Otherwise, the user is an active
commit a9ba672281ee3b7b662e5b0f82b2e6e8cbbf22e7
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:15:29 2009 +0100
Removal of default_system_groups_cb made default_system_groups unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index 5bbdb4c..e9edbaf 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -2514,29 +2514,6 @@ EOQ
return $truth ? 1 : 0;
}
-sub default_system_groups {
- my $self = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query =<<EOQ;
-SELECT system_group_id
- FROM rhnUserDefaultSystemGroups
- WHERE user_id = :user_id
-EOQ
-
- my $sth = $dbh->prepare($query);
- $sth->execute_h(user_id => $self->id);
-
- my @groups;
-
- while (my ($gid) = $sth->fetchrow) {
- push @groups, $gid;
- }
-
- return @groups;
-}
-
sub set_default_system_groups {
my $self = shift;
my @sgids = grep { $_ } @_;
commit 7298ba21505ecaab7a6c03c69cc43ef4fb6a3e36
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:14:09 2009 +0100
rhn:user_default_system_groups_cb not used, removing, as well as default_system_groups_cb and build_default_system_groups_form.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index 1522887..596f57b 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -73,8 +73,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:forgot_accounts_cb', \&forgot_accounts_cb);
$pxt->register_callback('rhn:user_prefs_edit_cb' => \&user_prefs_edit_cb);
-
- $pxt->register_callback('rhn:user_default_system_groups_cb' => \&default_system_groups_cb);
$pxt->register_callback('rhn:accepted' => \&tnc_accepted_cb);
}
@@ -833,89 +831,4 @@ sub rhn_user_login {
return $user->login;
}
-sub default_system_groups_cb {
- my $pxt = shift;
-
- my $form = build_default_system_groups_form($pxt);
- my $response = $form->prepare_response;
-
- my $errors = Sniglets::Forms::load_params($pxt, $response);
-
- if (@{$errors}) {
- foreach my $error (@{$errors}) {
- $pxt->push_message(local_alert => $error);
- }
- return;
- }
-
- my @groups = $response->lookup_widget('default_system_groups')->value;
-
- if (ref $groups[0] eq 'ARRAY') {
- @groups = @{$groups[0]};
- }
-
- my $uid = $pxt->param('uid');
- my $user = RHN::User->lookup(-id => $uid);
-
- my @old_groups = $user->default_system_groups;
- $user->set_default_system_groups(@groups);
-
- if (RHN::Utils::sets_differ(\@groups, \@old_groups)) {
- $pxt->push_message(site_info => sprintf('Default system groups updated for <strong>%s</strong>.', $user->login));
- }
-
- my $url = $pxt->uri;
- $pxt->redirect($url . "?uid=" . $user->id);
-
- return;
-}
-
-sub build_default_system_groups_form {
- my $pxt = shift;
- my %attr = @_;
-
- my $form = new RHN::Form::ParsedForm(name => 'Default System Groups',
- label => 'default_system_groups',
- action => $attr{action},
- );
-
- my $group_selectbox = new RHN::Form::Widget::Select(name => 'Default System Groups',
- label =>'default_system_groups',
- multiple => 1,
- size => 4);
-
- my $uid = $pxt->param('uid');
- my $user = RHN::User->lookup(-id => $uid);
-
- my $group_perms_ds = new RHN::DataSource::SystemGroup(-mode => 'user_permissions');
- my $data = $group_perms_ds->execute_full(-formvar_uid => $uid, -org_id => $user->org_id);
-
- foreach my $group ( @{$data} ) {
- my $name = $group->{GROUP_NAME};
- my $id = $group->{ID};
-
- if ($group->{HAS_PERMISSION}) {
- $name = '(*) ' . $name;
- }
-
- $group_selectbox->add_option( {value => $id,
- label => $name,
- } );
- }
-
- $group_selectbox->value([ $user->default_system_groups ]);
-
- unless (@{$data}) { #no system groups in org
- $form->add_widget( new RHN::Form::Widget::Literal(name => 'Default System Groups', value => '<strong>Your organization has no system groups.</strong>') );
- return $form;
- }
-
- $form->add_widget($group_selectbox);
- $form->add_widget( new RHN::Form::Widget::Hidden(name => 'uid', value => $user->id) );
- $form->add_widget( new RHN::Form::Widget::Hidden(name => 'pxt:trap', value => 'rhn:user_default_system_groups_cb') );
- $form->add_widget( new RHN::Form::Widget::Submit(name => 'Update Defaults') );
-
- return $form;
-}
-
1;
commit 419453e96464e0ae9b42bc81b7d75dfdf9025882
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:10:38 2009 +0100
Removal of request_account_deactivation_cb made request_deactivation unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index 951d30a..5bbdb4c 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -264,18 +264,6 @@ sub delete_user {
}
-# queues up a user to be deleted/disabled
-sub request_deactivation {
- my $self = shift;
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare("INSERT INTO rhnUserDeletionQueue (user_id) VALUES (?)");
-
- $sth->execute($self->id);
- $dbh->commit;
-}
-
-
sub create_custom_data_key {
my $self = shift;
my %params = validate(@_, {label => 1, description => 1});
commit 87ca8874774fc92e4b6a461e53904190bcfa4540
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:09:58 2009 +0100
rhn:request_account_deactivation_cb not used, removing, as well as request_account_deactivation_cb.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index 01b65de..1522887 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -74,7 +74,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:user_prefs_edit_cb' => \&user_prefs_edit_cb);
- $pxt->register_callback('rhn:request_account_deactivation_cb' => \&request_account_deactivation_cb);
$pxt->register_callback('rhn:user_default_system_groups_cb' => \&default_system_groups_cb);
$pxt->register_callback('rhn:accepted' => \&tnc_accepted_cb);
@@ -106,35 +105,6 @@ sub secure_links_if_logged_in {
}
-sub request_account_deactivation_cb {
- my $pxt = shift;
- my $user = $pxt->user;
-
- die "no user!" unless $user;
-
- eval {
- $user->request_deactivation();
- };
-
- if ($@) {
-
- my $E = $@;
-
- if (ref $E and catchable($E) and $E->constraint_value eq 'RHN_UDQUEUE_UID_UQ') {
- $pxt->push_message(site_info => 'We have already logged your deactivation request and will complete the request as soon as possible.');
- }
- else {
- throw $E;
- }
- }
- else {
- $pxt->push_message(site_info => 'Request for account deactivation sent.');
- }
-
- $pxt->redirect('/network/account/details.pxt');
-}
-
-
commit 1a0b202541be6e1bf5589bdf7a5233ec6dc98c11
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:09:03 2009 +0100
rhn:delete_user_cb not used, removing, as well as delete_user_cb.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index 00762d8..01b65de 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -74,7 +74,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:user_prefs_edit_cb' => \&user_prefs_edit_cb);
- $pxt->register_callback('rhn:delete_user_cb' => \&delete_user_cb);
$pxt->register_callback('rhn:request_account_deactivation_cb' => \&request_account_deactivation_cb);
$pxt->register_callback('rhn:user_default_system_groups_cb' => \&default_system_groups_cb);
@@ -106,45 +105,6 @@ sub secure_links_if_logged_in {
return $params{__block__};
}
-sub delete_user_cb {
- my $pxt = shift;
-
- my $uid = $pxt->param('uid');
- die 'no user id' unless $uid;
-
- if ($uid == $pxt->user->id) {
- $pxt->push_message(local_alert => "You may not delete yourself.");
- $pxt->redirect("/rhn/users/UserDetails.do?uid=$uid");
- }
-
- my $user = RHN::User->lookup(-id => $uid);
- die 'user lookup failed' unless $user;
-
- my $login = $user->login;
-
- eval {
- RHN::User->delete_user($uid);
- };
- if ($@ and catchable($@)) {
- my $E = $@;
-
- if ($E->is_rhn_exception('cannot_delete_user')) {
- $pxt->push_message(local_alert => "Could not delete user <strong>" . $login . "</strong>.");
- $pxt->redirect("/rhn/users/UserDetails.do?uid=$uid");
- }
- else {
- throw $E;
- }
- }
- else {
- $pxt->push_message(site_info => "Deleted user <strong>" . $login . "</strong>.");
- }
-
- $pxt->redirect('/rhn/users/index.jsp');
-
- return;
-}
-
sub request_account_deactivation_cb {
my $pxt = shift;
commit 0b18c6523c6719cd058d97541ef3d993e79bd44a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:07:43 2009 +0100
Removal of toggle_pref makes rhn:toggle_pref_cb as well as toggle_pref_cb not used, removing.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index 552da73..00762d8 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -74,10 +74,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:user_prefs_edit_cb' => \&user_prefs_edit_cb);
-
- $pxt->register_callback('rhn:toggle_pref_cb' => \&toggle_pref_cb);
-
-
$pxt->register_callback('rhn:delete_user_cb' => \&delete_user_cb);
$pxt->register_callback('rhn:request_account_deactivation_cb' => \&request_account_deactivation_cb);
$pxt->register_callback('rhn:user_default_system_groups_cb' => \&default_system_groups_cb);
@@ -643,21 +639,6 @@ sub rhn_require {
return '';
}
-sub toggle_pref_cb {
- my $pxt = shift;
-
- my $name = $pxt->dirty_param('pref_name') || '';
- my $value = $pxt->dirty_param('pref_value') || '';
-
- die "rhn:toggle_pref_cb called without proper args ($name, $value)" unless $name && $value;
-
- $pxt->user->set_pref($name, $value);
-
- $pxt->redirect($pxt->uri);
-
- return;
-}
-
sub validate_user {
my $pxt = shift;
commit fb21a532e75cb386ef0e21ec61129ca28f05021a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 12:58:24 2009 +0100
Removal of update_site_record and default_bill_address made new_site unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index 5b5cfeb..951d30a 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -883,17 +883,6 @@ sub oai_contact_sync {
}
}
-sub new_site {
- my $self = shift;
- my $type = shift;
-
- my $site = bless { }, 'RHN::DB::UserSite';
- $site->{__newly_created__} = 1;
- $site->{__site_id__} = -1;
- $site->site_type($type);
- return $site;
-}
-
# instance OR class method
sub sites {
my $class = shift;
commit fd0938645eb26be51c93c754405784fb0150bc3a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 12:57:26 2009 +0100
default_bill_address not used anywhere, removing.
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index b285bb0..5b5cfeb 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -922,16 +922,6 @@ sub sites {
return @ret;
}
-sub default_bill_address {
- my $self = shift;
-
- my $site = ($self->sites('B'))[0] || ($self->sites('M'))[0] || ($self->sites('S'))[0];
-
- $site = $self->new_site('B') if not $site;
-
- return $site;
-}
-
# this crap is foobared. unfoobar it later.
sub RHN::DB::UserSite::commit {
commit 18eb709c27c29963d3d5a2e9ea4bc41e4e0581c3
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 12:55:15 2009 +0100
Removal of update_site_record made associated_with_order unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index 91404ae..b285bb0 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -992,20 +992,6 @@ sub RHN::DB::UserSite::oai_site_sync {
}
}
-sub RHN::DB::UserSite::associated_with_order {
- my $self = shift;
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare("SELECT id FROM web_user_order WHERE web_user_id = ? AND (bill_to_contact_id = ? OR ship_to_contact_id = ?)");
-
- $sth->execute($self->site_web_user_id, $self->site_id, $self->site_id);
- my ($id) = $sth->fetchrow;
-
- $sth->finish;
-
- return $id ? 1 : 0;
-}
-
sub selection_details {
my $self = shift;
commit 38f633f6979170d97304a1eb4822f9e4134bd7c3
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 12:54:06 2009 +0100
Removal of admin_user_site_edit_cb made update_site_record unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index acaf7b7..552da73 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -525,91 +525,6 @@ sub user_site_view {
}
-sub update_site_record {
- my $class = shift;
-
- my $pxt = shift;
- my $user = shift;
- my $type = shift;
-
- my $address = $pxt->dirty_param('site_address1') || '';
- if ($address =~ /^\s*$/) {
- $pxt->push_message(local_alert => "You must enter a valid street address.");
- return;
- }
-
- my $city = $pxt->dirty_param('site_city') || '';
- if ($city =~ /^\s*$/) {
- $pxt->push_message(local_alert => "You must enter a valid city.");
- return;
- }
-
- my $country = $pxt->dirty_param('site_country') || '';
- if ($country =~ /^\s*$/) {
- $pxt->push_message(local_alert => "You must enter a valid country.");
- return;
- }
-
- my $zip = $pxt->dirty_param('site_zip') || '';
- if ($zip =~ /^\s*$/) {
- $pxt->push_message(local_alert => "You must enter a zipcode.");
- return;
- }
-
- my $state = $pxt->dirty_param('site_state') || '';
- if ($state =~ /^\s*$/) {
- $pxt->push_message(local_alert => "You must enter a state.");
- return;
- }
-
- my $phone = $pxt->dirty_param('site_phone') || '';
- if ($phone =~ /^\s*$/) {
- $pxt->push_message(local_alert => "You must enter a phone number.");
- return;
- }
-
- my ($site) = $user->sites($type);
-
- if ($site) {
- if (($site->site_type eq 'B' or $site->site_type eq 'S') and $site->associated_with_order()) {
- $site = $user->new_site($type);
- }
- }
- else {
- $site = $user->new_site($type);
- }
-
- my $changed = 0;
- foreach (qw/site_address1 site_address2 site_address3 site_city site_state site_zip site_country site_zip site_phone site_fax/) {
- my $value = $site->$_() || '';
- if ($value ne ($pxt->dirty_param($_) || '')) {
- $changed = 1;
- if ($_ eq 'site_state') {
- $site->$_(uc $pxt->dirty_param($_))
- }
- else {
- $site->$_($pxt->dirty_param($_))
- }
- }
- }
-
- $site->site_alt_first_names($user->first_names);
- $site->site_alt_last_name($user->last_name);
- my $site_email = $site->site_email || '';
-
- if ($user->email ne $site_email) {
- $site->site_email($user->email);
- $changed = 1;
- }
-
- $site->site_web_user_id($user->id);
- $site->site_type($type);
-
- $site->commit;
-
- return (1, $changed);
-}
-
my @required_map =
( 'login' => 'Username',
'password1' => 'Password',
commit 91691f0486d5e3e3d39e6cab6c5234b96115a0a4
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 12:52:33 2009 +0100
rhn:admin_user_site_edit_cb not used, removing, as well as admin_user_site_edit_cb.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index 16fcbd9..acaf7b7 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -72,8 +72,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:forgot_password_cb', \&forgot_password_cb);
$pxt->register_callback('rhn:forgot_accounts_cb', \&forgot_accounts_cb);
- $pxt->register_callback('rhn:admin_user_site_edit_cb' => \&admin_user_site_edit_cb);
-
$pxt->register_callback('rhn:user_prefs_edit_cb' => \&user_prefs_edit_cb);
@@ -612,33 +610,6 @@ sub update_site_record {
return (1, $changed);
}
-sub admin_user_site_edit_cb {
- my $pxt = shift;
-
- my $uid = $pxt->param('uid');
- my $user = RHN::User->lookup(-id => $uid);
-
- my $incomplete = $user->has_incomplete_info;
- my $broken;
- $broken = 1 if $incomplete;
-
- my ($success, $changed) = Sniglets::Users->update_site_record($pxt, $user, $pxt->dirty_param('type'));
- return unless $success;
-
- $incomplete = $user->has_incomplete_info;
-
- if ($broken and not $incomplete) {
- $pxt->push_message(site_info => 'Thank you for completely filling out your account information.');
- $pxt->redirect('/network/');
- }
-
- $pxt->push_message(site_info => 'Address changed.');
-
- $pxt->redirect('/network/') if ($pxt->dirty_param('redirect_to_main_page'));
- $pxt->redirect('/network/account/addresses.pxt') if ($pxt->dirty_param('redirect_to_my_addresses'));
- $pxt->redirect('/rhn/users/Addresses.do?uid=' . $user->id) if ($pxt->dirty_param('redirect_to_user_addresses'));
-}
-
my @required_map =
( 'login' => 'Username',
'password1' => 'Password',
commit 783a62c3e98f3932e807f347da4f1da67b7c1edf
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 12:46:51 2009 +0100
Removal of add_users_to_groups made org_applicant_group_from_ugid unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/Org.pm b/web/modules/rhn/RHN/DB/Org.pm
index 7dccf33..a776387 100644
--- a/web/modules/rhn/RHN/DB/Org.pm
+++ b/web/modules/rhn/RHN/DB/Org.pm
@@ -562,29 +562,6 @@ EOSQL
return ($count, $sec, $bug, $enh);
}
-sub org_applicant_group_from_ugid {
- my $class = shift;
- my $ugid = shift;
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare(<<EOQ);
-SELECT UG1.id
- FROM rhnUserGroupType UGT,
- rhnUserGroup UG1,
- rhnUserGroup UG2
- WHERE UG1.group_type = UGT.id
- AND UGT.label = 'org_applicant'
- AND UG1.org_id = UG2.org_id
- AND UG2.id = ?
-EOQ
-
- $sth->execute($ugid);
- my ($ret) = $sth->fetchrow;
- $sth->finish;
-
- return $ret;
-}
-
sub entitlement_counts {
my $self = shift;
my $entitlement = shift;
commit 35431d25d2dda20654f6b2b6f1dfef219fc6666a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 12:44:36 2009 +0100
Removal of admin_user_edit_cb made add_users_to_groups unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index f34a2f2..91404ae 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -932,41 +932,6 @@ sub default_bill_address {
return $site;
}
-# Now an object method because we need a user who owns the set
-sub add_users_to_groups {
- my $self = shift;
- my @users = @{+shift};
- my @groups = @{+shift};
- my $pending = shift;
-
- return unless @users and @groups;
-
- my $dbh = RHN::DB->connect;
-
- my $query = "delete from rhnSet where user_id = :user_id and label = :label";
- my $sth0 = $dbh->prepare($query);
- $sth0->execute_h(user_id => $self->id, label => "user_group_list");
-
- my $sth1 = $dbh->prepare(<<EOQ);
-INSERT INTO rhnSet (user_id, label, element, element_two)
- values (:set_owner, 'user_group_list', :user_id, :ugid)
-EOQ
-
- my $pending_group = RHN::Org->org_applicant_group_from_ugid($groups[0]);
-
- foreach my $user_id (@users) {
- foreach my $group_id (@groups) {
- next if ($pending_group and ($group_id == $pending_group) and (!$pending));
- $sth1->execute_h(set_owner => $self->id, user_id => $user_id, ugid => $group_id);
- }
- }
-
- $dbh->call_procedure("rhn_user.add_users_to_usergroups", $self->id);
- $sth0->execute_h(user_id => $self->id, label=>"user_group_list");
-
- $dbh->commit;
-}
-
# this crap is foobared. unfoobar it later.
sub RHN::DB::UserSite::commit {
commit 46a06362b317403cecf18124ceba7bc018b64451
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 12:43:47 2009 +0100
Removal of admin_user_edit_cb made remove_users_from_groups unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index 69981b5..f34a2f2 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -967,36 +967,6 @@ EOQ
$dbh->commit;
}
-# Now an object method because we need a user who owns the set
-sub remove_users_from_groups {
- my $self = shift;
- my @users = @{+shift};
- my @groups = @{+shift};
-
- return unless @users and @groups;
- my $dbh = RHN::DB->connect;
-
- my $query = "delete from rhnSet where user_id = :user_id and label = :label";
- my $sth0 = $dbh->prepare($query);
- $sth0->execute_h(user_id=>$self->id, label=>"user_group_list");
-
- my $sth1 = $dbh->prepare(<<EOQ);
-INSERT INTO rhnSet (user_id, label, element, element_two)
- values (:owner, 'user_group_list', :user_id, :ugid)
-EOQ
-
- for my $user (@users) {
- for my $group (@groups) {
- $sth1->execute_h(owner=>$self->id, user_id=>$user, ugid=>$group);
- }
- }
-
- $dbh->call_procedure("rhn_user.remove_users_from_servergroups", $self->id);
-
- $sth0->execute_h(user_id=>$self->id, label=>"user_group_list");
- $dbh->commit;
-}
-
# this crap is foobared. unfoobar it later.
sub RHN::DB::UserSite::commit {
commit 385c0fa91f9ec9908ab5b49e59e5c5f155eae7c9
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 12:42:34 2009 +0100
Removal of group_checkboxes and admin_user_edit_cb made group_list_for_user unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index cb7daf4..69981b5 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -997,29 +997,6 @@ EOQ
$dbh->commit;
}
-sub group_list_for_user {
- my $self = shift;
-
- my $dbh = RHN::DB->connect;
- my $query = <<EOS;
- SELECT MAX(DECODE(user_id, ?, 1, 0)), GROUP_ID, GROUP_NAME, GROUP_TYPE
- FROM rhnUserGroupMembership
- WHERE ORG_ID = ?
-GROUP BY group_id, group_name, group_type
-ORDER BY UPPER(group_name), group_id
-EOS
-
- my $sth = $dbh->prepare($query);
- $sth->execute($self->id, $self->org_id);
-
- my @ret;
- while (my ($user_member, $id, $name, $group_type) = $sth->fetchrow) {
- push @ret, [ $user_member, $id, $name, $group_type ];
- }
-
- return @ret;
-}
-
# this crap is foobared. unfoobar it later.
sub RHN::DB::UserSite::commit {
commit 24f16f4fc9de72e7db40123003b7b37a3c1de60c
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 12:41:42 2009 +0100
Removal of Sniglets::Inspector made group_checkboxes unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index b7b7576..16fcbd9 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -661,29 +661,6 @@ unless (PXT::Config->get('satellite')) {
my %required_map = @required_map;
my @required_fields = map { $_ & 1 ? () : $required_map[$_] } 0..$#required_map;
-sub group_checkboxes {
- my $formvar = shift;
- my $user = shift;
-
- my @groups = $user->group_list_for_user;
-
- my $ret;
-
- foreach my $line (@groups) {
- next if !$line->[0] and $line->[3] and $line->[3] eq 'org_applicant';
-
- $ret .= PXT::HTML->checkbox(-name => $formvar,
- -value => $line->[1], #group_id
- -checked => $line->[0]); #user has permissions to group
-
- $ret .= $line->[2]; #group_name
-
- $ret .= "<br />\n";
- }
-
- return $ret;
-}
-
# sort timezones, making the listed ones pop to the top
sub timezone_sort {
my $class = shift;
commit 435bb1300957316382fd1f571e4e084fc026d3e3
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 11:46:03 2009 +0100
Removal of user_details.xml made rhn:admin_user_edit_cb, as well as admin_user_edit_cb unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index cbad168..b7b7576 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -72,7 +72,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:forgot_password_cb', \&forgot_password_cb);
$pxt->register_callback('rhn:forgot_accounts_cb', \&forgot_accounts_cb);
- $pxt->register_callback('rhn:admin_user_edit_cb' => \&admin_user_edit_cb);
$pxt->register_callback('rhn:admin_user_site_edit_cb' => \&admin_user_site_edit_cb);
$pxt->register_callback('rhn:user_prefs_edit_cb' => \&user_prefs_edit_cb);
@@ -457,109 +456,6 @@ sub rhn_login_cb {
}
-sub admin_user_edit_cb {
- my $pxt = shift;
-
- my $user = Sniglets::Forms::catch_form($pxt);
- return unless $user;
-
- $pxt->redirect("/errors/permission.pxt") unless $pxt->user->can_modify_user($user);
-
- if ($pxt->dirty_param('user_password_confirm') ne $pxt->dirty_param('user_password')) {
- $pxt->push_message(local_alert => 'Password and confirmation do not match');
- return;
- }
-
-# validation done, start modifying
-
-# pam authentication is a satellite feature
- if (PXT::Config->get('pam_auth_service') and not $pxt->dirty_param('editing_self')) {
- $user->set_pref(use_pam_authentication => ($pxt->dirty_param('use_pam_authentication') ? 'Y' : 'N'));
- }
- elsif ($pxt->dirty_param('user_password') =~ /[^*]/) { # otherwise, just set the password
- $user->set_password($pxt->dirty_param('user_password'))
- }
-
- my $url = new URI ($pxt->uri);
-
- eval {
- # Set the user's roles/groups
- if (not $pxt->dirty_param('editing_self') and $pxt->user->is('org_admin')) {
- my %old_groups = map { $_->[1] => 1 } grep { $_->[0] } $user->group_list_for_user;
- my %new_groups = map { $_ => 1 } $pxt->dirty_param('user_groups');
-
- my $chan_admin_group = $user->org->user_group_id('channel_admin') || 0;
- my $conf_admin_group = $user->org->user_group_id('config_admin') || 0;
-
- if ($user->is('org_admin') and exists ($old_groups{$chan_admin_group})) {
- $new_groups{$chan_admin_group} = 1;
- }
-
- if ($user->is('org_admin') and exists ($old_groups{$conf_admin_group})) {
- $new_groups{$conf_admin_group} = 1;
- }
-
- my @remove = grep { not exists $new_groups{$_} } keys %old_groups;
- my @add = grep { not exists $old_groups{$_} } keys %new_groups;
-
- my $admin_group = $user->org->user_group_id('org_admin');
-
- if ($user->is('org_admin') && (grep { $_ == $admin_group} @remove)) {
- if ($user->org->org_admins == 1) {
- $pxt->push_message(local_alert => 'This user is the last Org Admin for this Org. You cannot remove him from the Org Admins group.');
- return;
- }
- elsif ($user->id == $pxt->user->id) {
- $pxt->push_message(site_info => "You have removed your Org Admin privileges.");
- $url->path_query('/rhn/YourRhn.do');
- }
- }
-
- $user->remove_users_from_groups([ $user->id ], \@remove);
- $user->add_users_to_groups([ $user->id ], \@add);
- }
- };
-
- if ($@ and catchable($@)) {
- my $E = $@;
-
- if ($E->is_rhn_exception('usergroup_max_members')) {
- $pxt->push_message(local_alert => "Maximum group membership exceeded.");
- return;
- }
- else {
- throw $E;
- }
- }
-
-# Set company name
- $user->company($user->org->name)
- if $user->org->customer_type eq 'B';
-
-# set marketing site info
- my ($marketing_site) = $user->sites('M');
- if ($marketing_site) {
- $marketing_site->site_alt_first_names($user->first_names);
- $marketing_site->site_alt_last_name($user->last_name);
-
-# commit changes
- $marketing_site->commit;
- }
-
- $user->commit;
-
- $pxt->push_message(site_info => 'User information updated.');
-
- unless ($pxt->dirty_param('editing_self')) {
- $url->query_form(uid => $user->id);
- }
-
- $url->query_form($url->query_form, rand => int rand 5000000);
-
- $pxt->redirect($url->as_string)
-}
-
-
sub user_site_view {
my $pxt = shift;
my %params = @_;
commit 74811eb5563e233ab5120c16b1b5b6a15eec86cb
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 11:43:29 2009 +0100
Since web/html/network/account/details.pxt is no longer present, /forms is not referenced, removing.
diff --git a/web/html/forms/.htaccess b/web/html/forms/.htaccess
deleted file mode 100644
index a1f3909..0000000
--- a/web/html/forms/.htaccess
+++ /dev/null
@@ -1,8 +0,0 @@
-AuthType Basic
-AuthName "RHN Org Admin Area"
-
-PerlModule PXT::ApacheHandler
-PerlModule PXT::ApacheAuth
-PerlAuthenHandler PXT::ApacheAuth
-require no-access
-
diff --git a/web/html/forms/user_details.xml b/web/html/forms/user_details.xml
deleted file mode 100644
index 2d342f7..0000000
--- a/web/html/forms/user_details.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<rhn-form xmlns:xi="http://www.w3.org/2001/XInclude" name="User Details" label="user_details" action="index.pxt" method="post">
- <widget type="literal" name="Company Name" label="company" />
- <widget type="literal" name="Username" label="login" />
- <xi:include href="user_prefixes.xml" />
-<!--
-or:
- <widget type="select" name="Prefix" label="prefix" />
-or:
- <widget type="select" name="Prefix" label="prefix" default="Mr.">
- <opt name="Dr." label="Dr."/>
- <opt name="Hr." label="Hr." />
- <opt name="Miss" label="Miss" />
- <opt name="Mr." label="Mr." />
- <opt name="Mrs." label="Mrs." />
- <opt name="Ms." label="Ms." />
- <opt name="Sr." label="Sr." />
- </widget>
--->
- <widget type="text" name="First name" label="first_names" size="20">
- <filter type="text" />
- <require response="1" />
- </widget>
- <widget type="text" name="Last name" label="last_name" size="20">
- <filter type="text" />
- <require response="1" />
- </widget>
- <widget type="text" name="Position" label="title" size="30">
- <filter type="text" />
- </widget>
- <widget type="literal" name="User Type" label="user_type" default="(normal user)" acl="org_entitlement(sw_mgr_enterprise)"/>
- <widget type="checkbox" name="Use PAM" label="use_pam_authentication" acl="global_config(pam_auth_service)" default="1"/>
- <widget type="password" name="Password" label="user_password" size="20" maxlength="32">
- <filter type="password" />
- <require min-length="5" />
- <require max-length="32" />
- </widget>
- <widget type="password" name="Confirm Password" label="user_password_confirm" size="20" maxlength="32">
- <filter type="password" />
- <require min-length="5" />
- <require max-length="32" />
- </widget>
- <widget type="literal" name="Email" label="email_address" default="(none)" />
- <widget type="checkbox_group" name="Roles" label="user_groups" acl="org_entitlement(sw_mgr_enterprise);user_role(org_admin)"/>
- <widget type="literal" name="Created" label="user_created" default="(no data)"/>
- <widget type="literal" name="Last Sign In" label="last_login" default="(never)"/>
-
- <widget type="hidden" label="pxt:trap" default="rhn:admin_user_edit_cb" />
- <widget type="hidden" label="uid" />
- <widget type="hidden" label="source" default="RHN::User" />
- <widget type="hidden" label="id_formvar" default="uid" />
- <widget type="hidden" label="editing_self" default="0" />
- <widget type="submit" label="Update" />
-</rhn-form>
diff --git a/web/html/forms/user_prefixes.xml b/web/html/forms/user_prefixes.xml
deleted file mode 100644
index c216ed5..0000000
--- a/web/html/forms/user_prefixes.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
- <widget type="select" name="Prefix" label="prefix" default="Mr.">
- <opt value="Dr." label="Dr."/>
- <opt value="Hr." label="Hr." />
- <opt value="Miss" label="Miss" />
- <opt value="Mr." label="Mr." />
- <opt value="Mrs." label="Mrs." />
- <opt value="Ms." label="Ms." />
- <opt value="Sr." label="Sr." />
- </widget>
commit d5742367992f8ec1d4aa6f107b07fcacc761a471
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 11:36:33 2009 +0100
rhn:logout_cb not used, removing, as well as rhn_logout_cb.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index d0c56a5..cbad168 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -71,8 +71,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:login_cb', \&rhn_login_cb);
$pxt->register_callback('rhn:forgot_password_cb', \&forgot_password_cb);
$pxt->register_callback('rhn:forgot_accounts_cb', \&forgot_accounts_cb);
- $pxt->register_callback('rhn:logout_cb', \&rhn_logout_cb);
-
$pxt->register_callback('rhn:admin_user_edit_cb' => \&admin_user_edit_cb);
$pxt->register_callback('rhn:admin_user_site_edit_cb' => \&admin_user_site_edit_cb);
@@ -458,23 +456,6 @@ sub rhn_login_cb {
}
-sub rhn_logout_cb {
- my $pxt = shift;
-
- $pxt->clear_user;
- $pxt->session->uid(undef);
- $pxt->clear_session;
-
- if ($pxt->dirty_param('logout_redirect')) {
- my @extra_params = grep { $_ ne 'logout_redirect' and $_ ne 'pxt:trap' and $_ ne ''} $pxt->param();
- my $extra_params = @extra_params ? "?" . join("&", map { $_ . "=" . $pxt->param($_) } @extra_params) : "";
- $pxt->redirect($pxt->dirty_param('logout_redirect') . $extra_params);
- }
- else {
- $pxt->redirect('/rhn/Logout.do');
- }
-}
-
sub admin_user_edit_cb {
my $pxt = shift;
commit a9683d7ca45b20413f54c9837d5daf8159569bb9
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 11:32:45 2009 +0100
Removal of education_cb made enter_edu_holding_pen unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/Org.pm b/web/modules/rhn/RHN/DB/Org.pm
index 864432a..7dccf33 100644
--- a/web/modules/rhn/RHN/DB/Org.pm
+++ b/web/modules/rhn/RHN/DB/Org.pm
@@ -1017,23 +1017,6 @@ EOQ
}
-sub enter_edu_holding_pen {
- my $self = shift;
-
- my $dbh = RHN::DB->connect;
- my $query = <<EOQ;
-INSERT INTO rhnEduHoldingPen
- (org_id)
-VALUES
- (?)
-EOQ
-
- my $sth = $dbh->prepare($query);
- $sth->execute($self->id);
-
- $dbh->commit;
-}
-
# all roles that are available to the org
sub available_roles {
my $self = shift;
commit 3533c55318aaefd788ecd2c3d05f876ec6346255
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 11:31:44 2009 +0100
rhn:education_cb not used, removing, as well as education_cb.
diff --git a/web/modules/sniglets/Sniglets/Users.pm b/web/modules/sniglets/Sniglets/Users.pm
index 6401b0a..d0c56a5 100644
--- a/web/modules/sniglets/Sniglets/Users.pm
+++ b/web/modules/sniglets/Sniglets/Users.pm
@@ -68,8 +68,6 @@ sub register_callbacks {
my $class = shift;
my $pxt = shift;
- $pxt->register_callback('rhn:education_cb' => \&education_cb);
-
$pxt->register_callback('rhn:login_cb', \&rhn_login_cb);
$pxt->register_callback('rhn:forgot_password_cb', \&forgot_password_cb);
$pxt->register_callback('rhn:forgot_accounts_cb', \&forgot_accounts_cb);
@@ -186,45 +184,6 @@ sub request_account_deactivation_cb {
}
-sub education_cb {
- my $pxt = shift;
-
- eval {
- $pxt->user->org->enter_edu_holding_pen();
- };
- if ($@) {
- my $E = $@;
- if (ref($E) eq 'RHN::Exception') {
- if ($E->constraint_value eq 'RHN_EDU_HP_OID_UQ') {
- $pxt->push_message(local_alert => 'Your application is currently being processed.');
- return;
- }
- else {
- warn "unknown error in education_cb: " . Data::Dumper->Dump([($@)]);
- die $@;
- }
- }
- else {
- # passthrough, add real error checking later
- die $@;
- }
- }
- else {
- my ($login, $uid, $env, $oid) = ($pxt->user->login, $pxt->user->id, $pxt->hostname, $pxt->user->org->id);
- RHN::Mail->send(to => PXT::Config->get('education_account_email'),
- subject => "EDUCATION: User $login has subscribed to the education channels",
- headers => { "X-RHN-Info" => "education_account_creation"},
- body => <<EOB);
-
-The user $login (uid $uid, oid $oid) has subscribed to the education
-channels in the $env environment.
-
-EOB
-
- $pxt->redirect("/newlogin/education_pending.pxt");
- }
-}
-
commit 2715827478ec46d24d30061f63f174e863499dfe
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 11:29:23 2009 +0100
Removal of create_profile_from_system_cb made base_channel_list unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/Channel.pm b/web/modules/rhn/RHN/DB/Channel.pm
index caccfda..6956425 100644
--- a/web/modules/rhn/RHN/DB/Channel.pm
+++ b/web/modules/rhn/RHN/DB/Channel.pm
@@ -786,34 +786,6 @@ EOQ
return RHN::Utils->parameterize(\@channels, 'id', 'name');
}
-sub base_channel_list {
- my $class = shift;
- my $org_id = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- my $sth;
-
- $query = <<EOQ;
-SELECT AC.channel_name, AC.channel_id, AC.channel_arch_id
- FROM rhnAvailableChannels AC
- WHERE AC.org_id = ?
- AND AC.channel_depth = 1
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute($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 04174489f0335eb0a3a6998a7e175c2d427a14b0
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 11:26:05 2009 +0100
rhn:create_profile_from_system_cb not used, removing, as well as create_profile_from_system_cb.
diff --git a/web/modules/sniglets/Sniglets/Profiles.pm b/web/modules/sniglets/Sniglets/Profiles.pm
index 9333fc1..9ff3869 100644
--- a/web/modules/sniglets/Sniglets/Profiles.pm
+++ b/web/modules/sniglets/Sniglets/Profiles.pm
@@ -31,65 +31,6 @@ sub register_callbacks {
my $pxt = shift;
$pxt->register_callback('rhn:sync_server_cb' => \&sync_server_cb);
-
- $pxt->register_callback('rhn:create_profile_from_system_cb' => \&create_profile_from_system_cb);
-}
-
-sub create_profile_from_system_cb {
- my $pxt = shift;
-
- my $name = $pxt->dirty_param('name');
- my $description = $pxt->dirty_param('description');
-
- unless ($name && $description) {
- $pxt->push_message(local_alert => "A system profile must have both a name and a description.");
- return
- }
-
- my $profile = RHN::Profile->create;
-
- $profile->org_id($pxt->user->org_id);
- my $system = RHN::Server->lookup(-id => $pxt->param('sid'));
- throw "no system!" unless $system;
-
- unless ($system->base_channel_id) {
- $pxt->push_message(local_alert => "This system must be subscribed to a base channel before a package profile can be created.");
- return;
- }
-
- $profile->base_channel($system->base_channel_id);
- $profile->$_($pxt->dirty_param($_)) foreach qw/name description/;
-
- throw "profile base channel not in org"
- unless grep { $_->[1] == $profile->base_channel }
- RHN::Channel->base_channel_list($pxt->user->org_id);
-
- eval {
- $profile->commit;
- };
- if ($@) {
- my $E = $@;
- if (ref $E and catchable($E)) {
- if ($E->is_rhn_exception('RHN.RHN_SERVER_PROFILE_NOID_UQ')) {
- $pxt->push_message(local_alert => "A profile with that name already exists.");
- return;
- }
- else {
- throw $E;
- }
- }
- else {
- die $E;
- }
- }
-
- $profile->copy_from(-sid => $system->id);
-
- $pxt->push_message(site_info => sprintf('Profile <strong>%s</strong> successfully created from <strong>%s</strong>.', PXT::Utils->escapeHTML($profile->name), PXT::Utils->escapeHTML($system->name)));
-
- my $redir = $pxt->dirty_param('redirect_success');
- throw "param 'redirect_success' needed but not provided." unless $redir;
- $pxt->redirect($redir);
}
sub sync_server_cb {
commit cf9841b396d6e2eec324aec1574b20a929024d3e
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 11:24:11 2009 +0100
register_tags without content can be removed as well.
diff --git a/web/modules/sniglets/Sniglets/Profiles.pm b/web/modules/sniglets/Sniglets/Profiles.pm
index 80832cf..9333fc1 100644
--- a/web/modules/sniglets/Sniglets/Profiles.pm
+++ b/web/modules/sniglets/Sniglets/Profiles.pm
@@ -26,12 +26,6 @@ use PXT::Utils;
use Data::Dumper;
-sub register_tags {
- my $class = shift;
- my $pxt = shift;
-
-}
-
sub register_callbacks {
my $class = shift;
my $pxt = shift;
commit e446de035c4f4077d2d6431e2944d0eb31d42f43
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 11:23:45 2009 +0100
rhn:profile_edit_cb not used, removing, as well as profile_edit_cb.
diff --git a/web/modules/sniglets/Sniglets/Profiles.pm b/web/modules/sniglets/Sniglets/Profiles.pm
index 76a3295..80832cf 100644
--- a/web/modules/sniglets/Sniglets/Profiles.pm
+++ b/web/modules/sniglets/Sniglets/Profiles.pm
@@ -36,23 +36,11 @@ sub register_callbacks {
my $class = shift;
my $pxt = shift;
- $pxt->register_callback('rhn:profile_edit_cb' => \&profile_edit_cb);
$pxt->register_callback('rhn:sync_server_cb' => \&sync_server_cb);
$pxt->register_callback('rhn:create_profile_from_system_cb' => \&create_profile_from_system_cb);
}
-sub profile_edit_cb {
- my $pxt = shift;
-
- my $profile = RHN::Profile->lookup(-id => $pxt->param('prid'));
- $profile->name($pxt->dirty_param('profile_name'));
- $profile->description($pxt->dirty_param('profile_description'));
- $profile->commit;
-
- $pxt->redirect("details.pxt", prid => $profile->id);
-}
-
sub create_profile_from_system_cb {
my $pxt = shift;
commit c39846c65217ce1f1b64289fed9e0b3956aaff1a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 11:22:22 2009 +0100
Removal of profile_delete_cb made delete_profile unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/Profile.pm b/web/modules/rhn/RHN/DB/Profile.pm
index c192f6a..5bdfae1 100644
--- a/web/modules/rhn/RHN/DB/Profile.pm
+++ b/web/modules/rhn/RHN/DB/Profile.pm
@@ -384,25 +384,6 @@ EOS
return @packages;
}
-sub delete_profile {
- my $self = shift;
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare(<<EOQ);
-DELETE FROM rhnServerProfilePackage WHERE server_profile_id = :prid
-EOQ
-
- $sth->execute_h(prid => $self->id);
-
- $sth = $dbh->prepare(<<EOQ);
-DELETE FROM rhnServerProfile WHERE id = :prid
-EOQ
-
- $sth->execute_h(prid => $self->id);
-
- return;
-}
-
sub load_package_manifest {
my $self = shift;
my $mfst = new RHN::Manifest(-org_id => $self->org_id);
commit 7573fdcb98225c0e901a51899242cd03125f27d2
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 11:20:30 2009 +0100
rhn:profile_delete_cb not used, removing, as well as profile_delete_cb.
diff --git a/web/modules/sniglets/Sniglets/Profiles.pm b/web/modules/sniglets/Sniglets/Profiles.pm
index 84b4ea3..76a3295 100644
--- a/web/modules/sniglets/Sniglets/Profiles.pm
+++ b/web/modules/sniglets/Sniglets/Profiles.pm
@@ -36,7 +36,6 @@ sub register_callbacks {
my $class = shift;
my $pxt = shift;
- $pxt->register_callback('rhn:profile_delete_cb' => \&profile_delete_cb);
$pxt->register_callback('rhn:profile_edit_cb' => \&profile_edit_cb);
$pxt->register_callback('rhn:sync_server_cb' => \&sync_server_cb);
@@ -111,25 +110,6 @@ sub create_profile_from_system_cb {
$pxt->redirect($redir);
}
-sub profile_delete_cb {
- my $pxt = shift;
-
- my $prid = $pxt->param('prid');
- throw "No profile id" unless $prid;
-
- my $sid = $pxt->param('sid');
-
- my $profile = RHN::Profile->lookup(-id => $prid);
-
- my $name = PXT::Utils->escapeHTML($profile->name);
- $profile->delete_profile;
-
- my $redir = $pxt->dirty_param('delete_success_page');
- throw "param 'delete_success_page' needed but not provided." unless $redir;
- $pxt->push_message(site_info => "Profile <strong>$name</strong> deleted.");
- $pxt->redirect($redir, ($sid ? (sid => $sid) : ()));
-}
-
sub sync_server_cb {
my $pxt = shift;
my $missing_packages_option = shift || '';
14 years, 4 months
19 commits - web/modules
by Jan Pazdziora
web/modules/rhn/RHN/DB/ConfigFile.pm | 21 -
web/modules/rhn/RHN/DB/Scheduler.pm | 104 -------
web/modules/rhn/RHN/DB/Server.pm | 15 -
web/modules/rhn/RHN/DB/User.pm | 31 --
web/modules/sniglets/Sniglets/ConfigManagement.pm | 6
web/modules/sniglets/Sniglets/ServerActions.pm | 153 ----------
web/modules/sniglets/Sniglets/Servers.pm | 318 ----------------------
7 files changed, 648 deletions(-)
New commits:
commit d8be0c21552195cef5e47710a4c98ddba54b7419
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:42:24 2009 +0100
rhn:osa-ping not used, removing, as well as osa_ping_cb.
diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm
index 6ef30fb..e836214 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -107,23 +107,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:remote-command-cb' => \&remote_command_cb);
$pxt->register_callback('rhn:package-action-command-cb' => \&package_action_command_cb);
-
- $pxt->register_callback('rhn:osa-ping' => \&osa_ping_cb);
-}
-
-sub osa_ping_cb {
- my $pxt = shift;
- my $sid = $pxt->param('sid');
-
- die "no sid" unless $sid;
-
- my $server = RHN::Server->lookup(-id => $sid);
- die "no server" unless $server;
-
- $server->osa_ping();
-
- # $pxt->push_message(site_info => "<strong>" . $server->name . "</strong> has been pinged. OSA Status will update within the next minute.");
- $pxt->redirect('/rhn/systems/details/Overview.do?sid=' . $sid . "&message=system.osad.pinged&messagep1=" . $server->name);
}
sub system_pending_actions_count {
commit d2e525ba597ce3886056047a82b39de4dca447d5
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:39:12 2009 +0100
rhn:server_lock_cb not used, removing, as well as server_lock_cb.
diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm
index 95f1cf5..6ef30fb 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -103,7 +103,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:system-activation-key-cb' => \&system_activation_key_cb);
- $pxt->register_callback('rhn:server_lock_cb' => \&server_lock_cb);
$pxt->register_callback('rhn:server_set_lock_cb' => \&server_set_lock_cb);
$pxt->register_callback('rhn:remote-command-cb' => \&remote_command_cb);
@@ -1330,26 +1329,6 @@ sub system_activation_key_cb {
$pxt->redirect($url . "?sid=" . $sid);
}
-sub server_lock_cb {
- my $pxt = shift;
- my $sid = $pxt->param('sid');
- my $lock = $pxt->dirty_param('lock');
-
- my $system = RHN::Server->lookup(-id => $sid);
- my $msg;
- if ($lock) {
- $system->lock_server($pxt->user, "Manually locked");
- $msg = "<strong>%s</strong> has been locked.";
- }
- else {
- $system->unlock_server();
- $msg = "<strong>%s</strong> has been unlocked.";
- }
-
- $pxt->push_message(site_info => sprintf($msg, $system->name));
- $pxt->redirect("index.pxt?sid=$sid");
-}
-
sub server_set_lock_cb {
my $pxt = shift;
my $lock = $pxt->dirty_param('lock');
commit df4126d0477d040fdd92a70ec18890040a788430
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:37:53 2009 +0100
Removal of add_filenames_to_set_cb made validate_path_name unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/ConfigFile.pm b/web/modules/rhn/RHN/DB/ConfigFile.pm
index 277963d..7ea4a20 100644
--- a/web/modules/rhn/RHN/DB/ConfigFile.pm
+++ b/web/modules/rhn/RHN/DB/ConfigFile.pm
@@ -79,25 +79,4 @@ sub file_id_to_path {
return $class->file_name_id_to_path($ret);
}
-sub validate_path_name {
- my $class = shift;
- my $path = shift;
-
- return "No path defined" unless $path;
-
- my @path = split m([/]), $path;
-
- if ($path =~ m(^[^/])) {
- return "Paths must begin with a forward slash ('/').";
- }
- if ($path =~ m(/$)) {
- return "Paths must not end with a forward slash ('/').";
- }
- if (grep { $_ eq ".." } @path) {
- return "Paths must be absolute paths (no '..' in the pathname).";
- }
-
- return;
-}
-
1;
commit 9779a1eb0f5472020fb79268edbce95f46cae37c
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:37:05 2009 +0100
rhn:add-filenames-to-set-cb not used, removing, as well as add_filenames_to_set_cb.
diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm
index d01b1b7..95f1cf5 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -102,7 +102,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:delete_servers_cb' => \&delete_servers_cb);
$pxt->register_callback('rhn:system-activation-key-cb' => \&system_activation_key_cb);
- $pxt->register_callback('rhn:add-filenames-to-set-cb' => \&add_filenames_to_set_cb);
$pxt->register_callback('rhn:server_lock_cb' => \&server_lock_cb);
$pxt->register_callback('rhn:server_set_lock_cb' => \&server_set_lock_cb);
@@ -1331,40 +1330,6 @@ sub system_activation_key_cb {
$pxt->redirect($url . "?sid=" . $sid);
}
-sub add_filenames_to_set_cb {
- my $pxt = shift;
-
- my $filenames = $pxt->dirty_param('input_filenames');
-
- my @filenames = split(/,\s*/, $filenames);
-
- my $errors;
-
- foreach my $file (@filenames) {
- my $errmsg = RHN::ConfigFile->validate_path_name($file);
- if ($errmsg) {
- $pxt->push_message(local_alert => sprintf('Invalid path <strong>%s</strong>: %s', PXT::Utils->escapeHTML($file), $errmsg));
- $errors++;
- }
- }
-
- return if $errors;
-
- my $set_label = 'selected_configfilenames';
- my $set = RHN::Set->lookup(-label => $set_label, -uid => $pxt->user->id);
-
- foreach my $file (@filenames) {
- $set->add(RHN::ConfigFile->path_to_id($file));
- }
-
- $set->commit;
-
- my $sid = $pxt->param('sid');
- my $uri = $pxt->uri;
-
- $pxt->redirect($uri . '?sid=' . $sid);
-}
-
sub server_lock_cb {
my $pxt = shift;
my $sid = $pxt->param('sid');
commit b978aa88d3c12c3582ed39fd9db902da68c1c33b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:34:21 2009 +0100
Removal of system_package_list_refresh_cb made schedule_package_refresh unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/Scheduler.pm b/web/modules/rhn/RHN/DB/Scheduler.pm
index 7ba4e44..744c412 100644
--- a/web/modules/rhn/RHN/DB/Scheduler.pm
+++ b/web/modules/rhn/RHN/DB/Scheduler.pm
@@ -390,40 +390,6 @@ EOQ
return $action_id;
}
-sub schedule_package_refresh {
- my $class = shift;
- my %params = @_;
-
- my ($org_id, $user_id, $server_id, $earliest, $transaction) =
- map { $params{"-" . $_} } qw/org_id user_id server_id earliest transaction/;
-
- my $action_label;
- my $server_packaging_type = RHN::Server->packaging_type($server_id);
-
- if ($server_packaging_type eq 'rpm') {
- $action_label = 'packages.refresh_list';
- }
- elsif ($server_packaging_type eq 'sysv-solaris') {
- $action_label = 'solarispkgs.refresh_list';
- }
- else {
- throw "Unknown packaging type ($server_packaging_type) for system ($server_id)";
- }
-
- my ($action_id, $stat_id) = $class->make_base_action(-org_id => $org_id,
- -user_id => $user_id,
- -type_label => $action_label,
- -earliest => $earliest,
- -transaction => $transaction
- );
-
- $class->add_servers_to_action($action_id, $stat_id, $user_id, undef, $server_id);
-
- osa_wakeup_tickle();
-
- return $action_id;
-}
-
sub sscd_schedule_package_refresh {
my $class = shift;
my %params = @_;
commit 80c918cd8473a2871af01a77025d67210b81da0f
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:32:47 2009 +0100
rhn:system_package_list_refresh_cb not used, removing, as well as system_package_list_refresh_cb.
diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm
index aae8578..d01b1b7 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -95,7 +95,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:server_prefs_form_cb' => \&server_prefs_form_cb);
- $pxt->register_callback('rhn:system_package_list_refresh_cb' => \&system_package_list_refresh_cb);
$pxt->register_callback('rhn:server_hardware_list_refresh_cb' => \&server_hardware_list_refresh_cb);
$pxt->register_callback('rhn:ssm_change_system_prefs_cb' => \&ssm_change_system_prefs_cb);
@@ -390,24 +389,6 @@ sub cancel_scheduled_proxy_install {
$pxt->redirect($url . "?sid=$sid");
}
-sub system_package_list_refresh_cb {
- my $pxt = shift;
-
- my $sid = $pxt->param('sid');
- throw "no server id" unless $sid;
-
- my $earliest_date = RHN::Date->now->long_date;
- my $action_id = RHN::Scheduler->schedule_package_refresh(-org_id => $pxt->user->org_id,
- -user_id => $pxt->user->id,
- -earliest => $earliest_date,
- -server_id => $sid);
-
- my $system = RHN::Server->lookup(-id => $sid);
-
- $pxt->push_message(site_info => sprintf("You have successfully scheduled a package profile refresh for <strong>%s</strong>.", PXT::Utils->escapeHTML($system->name)));
- return;
-}
-
sub server_hardware_list_refresh_cb {
my $pxt = shift;
commit 903162791a2dc66ed25c0533bc051f18c57886da
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:31:49 2009 +0100
rhn:system_update_brb_cb not used anywhere; system_update_brb_cb even does not exist.
diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm
index d8fd6c0..aae8578 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -95,9 +95,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:server_prefs_form_cb' => \&server_prefs_form_cb);
- # this now gets called in some cases by admin_server_edit_cb
- $pxt->register_callback('rhn:system_update_brb_cb' => \&system_update_brb_cb);
-
$pxt->register_callback('rhn:system_package_list_refresh_cb' => \&system_package_list_refresh_cb);
$pxt->register_callback('rhn:server_hardware_list_refresh_cb' => \&server_hardware_list_refresh_cb);
commit 5250c85313fdb2296df93045121b55cdc505d386
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:27:45 2009 +0100
server_location not used, removing.
diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm
index 19a9053..d8fd6c0 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -884,38 +884,6 @@ sub server_network_interfaces {
return $block;
}
-sub server_location {
- my $pxt = shift;
- my %params = @_;
- my $sid = $pxt->param('sid');
- die "no server id" unless ($sid);
-
- # if possible, reuse existing server object
- my $server = RHN::Server->lookup(-id => $sid);
-
- my %subst;
-
- $subst{country} = defined $server->location_country ? $server->location_country : "";
-
- $subst{state} = defined $server->location_state ? $server->location_state : "";
-
- $subst{city} = defined $server->location_city ? $server->location_city : "";
-
- $subst{address1} = defined $server->location_address1 ? $server->location_address1 : "";
- $subst{address2} = defined $server->location_address2 ? $server->location_address2 : "";
-
- $subst{building} = defined $server->location_building ? $server->location_building : "";
-
- $subst{room} = defined $server->location_room ? $server->location_room : "" ;
- $subst{rack} = defined $server->location_rack ? $server->location_rack : "" ;
-
- $subst{machine} = defined $server->location_machine ? $server->location_machine : "";
-
- PXT::Utils->escapeHTML_multi(\%subst);
-
- return PXT::Utils->perform_substitutions($params{__block__}, \%subst);
-}
-
# must happen *after* server_hardware_profile... so use tags
# correctly!
sub server_device {
commit cc4955d4f0b634fa05f83eebfa246c815f0739f4
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:24:50 2009 +0100
Removal of handle_system_entitlement_change made schedule_sat_cluster_push unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index 94fff25..498573d 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -52,7 +52,6 @@ use Carp;
use RHN::Utils;
use RHN::Exception qw/throw/;
use RHN::API::Exception;
-use RHN::SatCluster;
# fields in the rhnServer table
@@ -3738,20 +3737,6 @@ sub sat_clusters_for_system {
return @{$data};
}
-sub schedule_sat_cluster_push {
- my $self = shift;
- my $uid = shift;
- my @clusters = @_;
-
- my $org_id = $self->org_id();
-
- foreach my $row (@clusters) {
- RHN::SatCluster->push_config($org_id, $row->{SAT_CLUSTER_ID}, $uid);
- }
-
- return;
-}
-
sub virtual_guest_details {
my $self = shift;
commit ece013824410f3d2866ff4d095997df2d653ccb1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:22:31 2009 +0100
Removal of admin_server_edit_cb made server_edit_location_cb unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm
index d13f854..19a9053 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -759,28 +759,6 @@ sub addon_entitlement_box {
return join("<br/>\n", $boxes->render);
}
-sub server_edit_location_cb {
- my $pxt = shift;
- my $transaction = shift;
-
- my $sid = $pxt->param('sid');
- die "no server id" unless $sid;
-
- my $server = $transaction || RHN::Server->lookup(-id => $sid);
-
- die "Orgs for admin server edit mistatch (admin: @{[$pxt->user->org_id]} != @{[$server->org_id]}"
- unless $pxt->user->org_id == $server->org_id;
-
- foreach my $form_var (qw/country state city address1 address2 building room rack/) {
- my $function = 'location_' . $form_var;
- $server->$function($pxt->dirty_param($form_var));
- }
-
- $server->commit unless $transaction;
-
- return $server;
-}
-
sub reboot_server_cb {
my $pxt = shift;
my $sid = $pxt->param('sid');
commit 040d67943be4639a4228e4a0f10743d8f5e11c0b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:22:02 2009 +0100
Removal of admin_server_edit_cb made handle_system_entitlement_change unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm
index b6a5765..d13f854 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -806,103 +806,6 @@ sub reboot_server_cb {
$pxt->redirect("/rhn/systems/details/Overview.do?sid=$sid&message=system.reboot.scheduled&messagep1=" . $server->name . "&messagep2=" . $pretty_earliest_date . "&messagep3=" . $action_id);
}
-# Not a sniglet - handle system entitlement changes from server
-# properties edit page.
-sub handle_system_entitlement_change {
- my $pxt = shift;
- my $server = shift;
-
- my $base_entitlement = $pxt->dirty_param('base_entitlement');
-
- my $transaction = RHN::DB->connect();
- $transaction->nest_transactions();
-
- eval {
- my $changed = 0;
-
- my %addon_entitlements = map { ($_, 1) } $pxt->dirty_param('addon_entitlements');
- my %current_entitlements = map { ($_->{LABEL}, $_) }
- grep { $_->{IS_BASE} eq 'N' } $server->entitlements;
-
- my $has_monitoring = ( grep { $_ eq 'monitoring_entitled' } keys %current_entitlements ) ? 1 : 0;
- my $removed_monitoring = 0;
- my @sat_clusters;
-
- if ($has_monitoring) {
- @sat_clusters = RHN::Server->sat_clusters_for_system($server->id);
- }
-
- foreach my $ent (keys %addon_entitlements) {
- unless (exists $current_entitlements{$ent}) {
- $server->entitle_server($ent);
- $changed = 1;
- }
- }
-
- foreach my $ent (keys %current_entitlements) {
- unless (exists $addon_entitlements{$ent}) {
- if ($ent eq 'monitoring_entitled') {
- $removed_monitoring = 1;
- }
- $server->remove_entitlement($ent);
- $changed = 1;
- }
- }
-
- if ($base_entitlement eq 'unentitle') {
- $changed = 1;
-
- if ($has_monitoring) {
- $removed_monitoring = 1;
- }
-
- $server->unentitle_server();
- } elsif ($base_entitlement ne 'none' and
- not $server->has_entitlement($base_entitlement)) {
- $changed = 1;
-
- if ($has_monitoring) {
- $removed_monitoring = 1;
- }
-
- $server->unentitle_server();
- $server->entitle_server($base_entitlement);
- }
-
- if ($changed and $server->has_feature('ftr_snapshotting')) {
- RHN::Server->snapshot_server(-server_id => $server->id,
- -reason => "Entitlement change");
- }
-
- if ($removed_monitoring) {
- $server->schedule_sat_cluster_push($pxt->user->id, @sat_clusters);
- }
- };
-
- if ($@) {
- my $E = $@;
- $transaction->nested_rollback();
-
- if (ref $E and catchable($E)) {
- if ($E->is_rhn_exception('servergroup_max_members')) {
- $pxt->push_message(local_alert => sprintf("You do not have enough entitlements to entitle <strong>%s</strong>.", PXT::Utils->escapeHTML($server->name)));
- return;
- }
- else {
- throw $E;
- }
- }
- else {
- die $E;
- }
- }
- else {
- $transaction->nested_commit();
- }
-
- return;
-}
-
sub server_network_details {
my $pxt = shift;
my %params = @_;
commit 0fb07ff19aee40b2c660604296e7a48c5c1bdae9
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:21:19 2009 +0100
Removal of admin_server_edit_cb made set_server_pref unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index d8e49f6..cb7daf4 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -2024,37 +2024,6 @@ sub get_server_pref {
return $val;
}
-sub set_server_pref {
- my $self = shift;
- my $server_id = shift;
- my $pref = shift;
- my $new_val = shift;
- my $assumed_default = shift;
-
- my $dbh = RHN::DB->connect;
- my $query = <<EOS;
-DELETE FROM rhnUserServerPrefs
- WHERE user_id = ?
- AND server_id = ?
- AND name = ?
-EOS
- my $sth = $dbh->prepare($query);
- $sth->execute($self->id, $server_id, $pref);
-
- if ($new_val ne $assumed_default) {
- my $query = <<EOS;
-INSERT INTO rhnUserServerPrefs
-(user_id, server_id, name, value)
-VALUES
-(?, ?, ?, ?)
-EOS
- my $sth = $dbh->prepare($query);
- $sth->execute($self->id, $server_id, $pref, $new_val);
- }
-
- $dbh->commit;
-}
-
sub set_pref {
my $self = shift;
my $pref = shift;
commit 8a4d2a29fd0bf0f1389dd80d4db9bbb4be94aa90
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:20:22 2009 +0100
rhn:admin_server_edit_cb not used, removing, as well as admin_server_edit_cb.
diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm
index a64d855..b6a5765 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -90,8 +90,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:proxy_entitlement_cb' => \&proxy_entitlement_cb);
$pxt->register_callback('rhn:cancel_scheduled_proxy_install_cb' => \&cancel_scheduled_proxy_install);
- $pxt->register_callback('rhn:admin_server_edit_cb' => \&admin_server_edit_cb);
-
$pxt->register_callback('rhn:delete_server_cb' => \&delete_server_cb);
$pxt->register_callback('rhn:reboot_server_cb' => \&reboot_server_cb);
@@ -808,76 +806,6 @@ sub reboot_server_cb {
$pxt->redirect("/rhn/systems/details/Overview.do?sid=$sid&message=system.reboot.scheduled&messagep1=" . $server->name . "&messagep2=" . $pretty_earliest_date . "&messagep3=" . $action_id);
}
-sub admin_server_edit_cb {
- my $pxt = shift;
-
- my @extra_messages;
-
- my $sid = $pxt->param('sid');
- die "no server id" unless ($sid);
-
- my $server = RHN::Server->lookup(-id => $sid);
-
- my $trunc_name = substr($pxt->dirty_param('name'), 0, 128);
- $trunc_name =~ s/^\s+//;
- $trunc_name =~ s/\s+$//;
-
- unless (length $trunc_name > 2) {
- $pxt->push_message(local_alert => "A system name must be at least three characters in length.");
- return;
- }
-
- unless ($trunc_name =~ /^[\x20-\x7e]+$/) {
- $pxt->push_message(local_alert => "Desired System Name contains invalid characters. In addition to alphanumeric characters, '-', '_', '.', and '\@' are allowed. Please try again");
- return;
- }
-
-
- $server->name($trunc_name);
- my $trunc_desc = substr($pxt->dirty_param('description'), 0, 256);
- $server->description($trunc_desc);
-
- $pxt->user->set_server_pref($server->id,
- 'receive_notifications',
- $pxt->dirty_param('receive_notifications') ? 1 : 0, 1);
- $pxt->user->set_server_pref($server->id,
- 'include_in_daily_summary',
- ($pxt->dirty_param('include_in_daily_summary') and
- $server->has_feature('ftr_daily_summary')
- ) ? 1 : 0, 1);
-
- if ($pxt->user->is('org_admin')) {
- handle_system_entitlement_change($pxt, $server);
- }
-
- $server = server_edit_location_cb($pxt, $server);
-
- my $auto_update = $pxt->dirty_param('auto_update') ? 'Y' : 'N';
-
- if (($auto_update ne uc $server->auto_update) and $server->has_feature('ftr_auto_errata_updates')) {
- $server->auto_update($auto_update);
-
-# only do the auto update if we're switching to an auto-updated enterprise slot system...
- if ($auto_update eq 'Y') {
- RHN::Scheduler->schedule_all_errata_updates_for_system(-earliest => RHN::Date->now->long_date,
- -org_id => $pxt->user->org_id,
- -user_id => $pxt->user->id,
- -server_id => $server->id,
- );
-
- push @extra_messages, $server->name . " will be <strong>fully updated</strong> in accordance with Auto Errata Update preference.";
- }
- }
-
- $server->commit;
- $pxt->push_message(site_info => "System properties changed for <strong>" . $server->name . "</strong>.");
-
- foreach my $message (@extra_messages) {
- $pxt->push_message(site_info => $message);
- }
- $pxt->redirect("/rhn/systems/details/Overview.do?sid=$sid");
-}
-
# Not a sniglet - handle system entitlement changes from server
# properties edit page.
sub handle_system_entitlement_change {
commit a0c990453490df7ce202589f661b5a7f1a87a83a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:18:09 2009 +0100
rhn:configfile_copy_files_cb not used, removing (configfile_copy_files_cb kept as still referenced).
diff --git a/web/modules/sniglets/Sniglets/ConfigManagement.pm b/web/modules/sniglets/Sniglets/ConfigManagement.pm
index 07d38b0..b12bc8d 100644
--- a/web/modules/sniglets/Sniglets/ConfigManagement.pm
+++ b/web/modules/sniglets/Sniglets/ConfigManagement.pm
@@ -39,12 +39,6 @@ sub register_tags {
# use -150 for priority since we need to set a {foo} that is consumed by a the navi tag
}
-sub register_callbacks {
- my $class = shift;
- my $pxt = shift;
- $pxt->register_callback('rhn:configfile_copy_files_cb' => \&configfile_copy_files_cb);
-}
-
sub configfile_copy_files_cb {
my $pxt = shift;
my $mode = $pxt->dirty_param('copy_mode') || '';
commit 0a429a066040c2379c12ea8ea638e9dbacd6b651
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:13:29 2009 +0100
Removal of schedule_ssm_config_action_cb made _schedule_config_action_schedule_config_action and thus %config_actions unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/ServerActions.pm b/web/modules/sniglets/Sniglets/ServerActions.pm
index 7db6db3..f60c7c9 100644
--- a/web/modules/sniglets/Sniglets/ServerActions.pm
+++ b/web/modules/sniglets/Sniglets/ServerActions.pm
@@ -431,39 +431,6 @@ sub server_set_actions_cb {
}
}
-my %config_actions = ('configfiles.verify' => 'verification',
- 'configfiles.diff' => 'diff',
- 'configfiles.upload' => 'upload',
- 'configfiles.deploy' => 'deploy');
-
-sub _schedule_config_action {
- my $user = shift;
- my $action = shift;
- my $earliest_date = shift;
- my $sid = shift;
- my $ids = shift;
- my %id_map = %{$ids};
-
- my $server = RHN::Server->lookup(-id => $sid);
-
- my @revisions;
-
- foreach my $revision ($server->latest_managed_config_revisions()) {
- # skip file/rev unless it's truly under management on the server...
- next unless $id_map{$revision->{LATEST_CONFIG_REVISION_ID}};
- push @revisions, $revision->{LATEST_CONFIG_REVISION_ID};
- }
-
- RHN::Scheduler->schedule_config_action(-org_id => $user->org_id,
- -user_id => $user->id,
- -earliest => $earliest_date,
- -server_id => $sid,
- -action_type => $action,
- -action_name => 'Configuration ' . $config_actions{$action} . ' for '. $server->name,
- -revision_ids => [@revisions],
- );
-}
-
sub package_event_result {
my $pxt = shift;
my %attr = @_;
commit 970c8604f84ac3dcef03faa983cbbdcd2a13f29c
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:11:44 2009 +0100
rhn:schedule_ssm_config_action_cb not used, removing, as well as schedule_ssm_config_action_cb.
diff --git a/web/modules/sniglets/Sniglets/ServerActions.pm b/web/modules/sniglets/Sniglets/ServerActions.pm
index 7d97c54..7db6db3 100644
--- a/web/modules/sniglets/Sniglets/ServerActions.pm
+++ b/web/modules/sniglets/Sniglets/ServerActions.pm
@@ -58,9 +58,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:reschedule_action_cb' => \&reschedule_action_cb);
$pxt->register_callback('rhn:sscd_reboot_servers_cb' => \&sscd_reboot_servers_cb);
-
- $pxt->register_callback('rhn:schedule_ssm_config_action_cb' => \&schedule_ssm_config_action_cb);
-
}
sub raw_script_output {
@@ -467,61 +464,6 @@ sub _schedule_config_action {
);
}
-sub schedule_ssm_config_action_cb {
-
- my $pxt = shift;
-
- my $action;
-
- foreach my $action_type (keys %config_actions) {
- $action = $action_type if $pxt->dirty_param($action_type);
- }
-
- die "no action" unless $action;
-
-
- my $earliest_date = Sniglets::ServerActions->parse_date_pickbox($pxt);
-
- # grab all the latest revisions per server
- my $ds = new RHN::DataSource::Simple(-querybase => 'config_queries',
- -mode => 'ssm_configfile_revisions',
- );
-
- my $data = $ds->execute_query(-user_id => $pxt->user->id);
-
- # Here's the plan. ssm_configfile_revisions is ordered by
- # SERVER_ID, and SCC.POSITION. So as we loop through the data, all
- # of the paths for each system are ordered by the
- # priority/position/rank for that system of the config channel they
- # were found in. So we just take the first instance of each path,
- # and thus avoid scheduling a diff for a path twice if it is in two
- # config channels that a system is subscribed to.
-
- my %paths_by_server_id;
- foreach my $row (@{$data}) {
- my $sid = $row->{SERVER_ID};
- my $path = $row->{PATH};
- my $crid = $row->{ID};
-
- next if exists $paths_by_server_id{$sid}->{$path};
- $paths_by_server_id{$sid}->{$path} = $crid;
- }
-
- my $server;
- foreach my $sid (keys %paths_by_server_id) {
- my %ids = map { ( $_ => 1 ) } values %{$paths_by_server_id{$sid}};
- _schedule_config_action($pxt->user, $action, $earliest_date, $sid, \%ids);
- }
-
- my $count = keys %paths_by_server_id;
- $pxt->push_message(site_info => sprintf("%d system%s scheduled for %s.",
- $count, $count > 1 ? "s" : "", $config_actions{$action}));
-
- $pxt->redirect("/network/systems/ssm/index.pxt");
-
-}
-
-
sub package_event_result {
my $pxt = shift;
my %attr = @_;
commit 44627d0862a8c825a65dcca2694d9a5f5f589fb4
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:10:44 2009 +0100
rhn:add_managed_filenames_to_set_cb not used, removing, as well as add_managed_filenames_to_set_cb.
diff --git a/web/modules/sniglets/Sniglets/ServerActions.pm b/web/modules/sniglets/Sniglets/ServerActions.pm
index a4e5705..7d97c54 100644
--- a/web/modules/sniglets/Sniglets/ServerActions.pm
+++ b/web/modules/sniglets/Sniglets/ServerActions.pm
@@ -59,7 +59,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:sscd_reboot_servers_cb' => \&sscd_reboot_servers_cb);
- $pxt->register_callback('rhn:add_managed_filenames_to_set_cb' => \&add_managed_filenames_to_set_cb);
$pxt->register_callback('rhn:schedule_ssm_config_action_cb' => \&schedule_ssm_config_action_cb);
}
@@ -523,36 +522,6 @@ sub schedule_ssm_config_action_cb {
}
-sub add_managed_filenames_to_set_cb {
- my $pxt = shift;
-
- my $sid = $pxt->param('sid');
- my $ds = new RHN::DataSource::Simple(-querybase => 'config_queries',
- -mode => 'configfiles_for_system',
- );
-
- my $data = $ds->execute_query(-sid => $sid);
-
- my %seen;
-
- $data = [ sort { $a->{PATH} cmp $b->{PATH} }
- grep { not $seen{$_->{PATH}}++ } @{$data} ];
-
- my @ids = map { $_->{CONFIG_FILE_NAME_ID} } @{$data};
-
- my $set_label = $pxt->dirty_param('set_label');
- die "No set label" unless $set_label;
-
- my $set = RHN::Set->lookup(-label => $set_label, -uid => $pxt->user->id);
- $set->empty;
- $set->commit;
- $set->add(@ids);
- $set->commit;
-
- my $uri = $pxt->uri;
- $pxt->redirect($uri . sprintf('?sid=%d&set_label=%s', $sid, $set_label));
-}
-
sub package_event_result {
my $pxt = shift;
my %attr = @_;
commit b11db6ff8259e6b1e9a7d6613de79f8ffdffa3b4
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:09:49 2009 +0100
rhn:add_managed_files_to_set_cb not used, removing, as well as add_managed_files_to_set_cb.
diff --git a/web/modules/sniglets/Sniglets/ServerActions.pm b/web/modules/sniglets/Sniglets/ServerActions.pm
index 5751671..a4e5705 100644
--- a/web/modules/sniglets/Sniglets/ServerActions.pm
+++ b/web/modules/sniglets/Sniglets/ServerActions.pm
@@ -59,7 +59,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:sscd_reboot_servers_cb' => \&sscd_reboot_servers_cb);
- $pxt->register_callback('rhn:add_managed_files_to_set_cb' => \&add_managed_files_to_set_cb);
$pxt->register_callback('rhn:add_managed_filenames_to_set_cb' => \&add_managed_filenames_to_set_cb);
$pxt->register_callback('rhn:schedule_ssm_config_action_cb' => \&schedule_ssm_config_action_cb);
@@ -524,36 +523,6 @@ sub schedule_ssm_config_action_cb {
}
-sub add_managed_files_to_set_cb {
- my $pxt = shift;
-
- my $sid = $pxt->param('sid');
- my $mode = $pxt->dirty_param('mode') eq 'diff' ? 'configfiles_for_system_diff' : 'configfiles_for_system';
- my $ds = new RHN::DataSource::Simple(-querybase => 'config_queries',
- -mode => $mode,
- );
- my $data = $ds->execute_query(-sid => $sid);
-
- my %seen;
-
- $data = [ sort { $a->{PATH} cmp $b->{PATH} }
- grep { not $seen{$_->{PATH}}++ } @{$data} ];
-
- my @ids = map { $_->{ID} } @{$data};
-
- my $set_label = $pxt->dirty_param('set_label');
- die "No set label" unless $set_label;
-
- my $set = RHN::Set->lookup(-label => $set_label, -uid => $pxt->user->id);
- $set->empty;
- $set->commit;
- $set->add(@ids);
- $set->commit;
-
- my $uri = $pxt->uri;
- $pxt->redirect($uri . sprintf('?sid=%d&set_label=%s', $sid, $set_label));
-}
-
sub add_managed_filenames_to_set_cb {
my $pxt = shift;
commit 56715cc949c15451b7d83efe6d6556dc40c659e2
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:07:28 2009 +0100
Removal of schedule_config_action_cb made schedule_config_upload unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/Scheduler.pm b/web/modules/rhn/RHN/DB/Scheduler.pm
index 59d7c48..7ba4e44 100644
--- a/web/modules/rhn/RHN/DB/Scheduler.pm
+++ b/web/modules/rhn/RHN/DB/Scheduler.pm
@@ -1752,76 +1752,6 @@ EOQ
}
-# treat uploads differently, because, well, they're different.
-sub schedule_config_upload {
- my $class = shift;
- my %params = validate(@_, { org_id => 1,
- user_id => 1,
- server_id => 1,
- earliest => 1,
- action_name => 1,
- transaction => 0,
- prerequisite => 0,
- filename_ids => 1,
- config_channel_id => 1,
- });
-
- my $dbh = $params{transaction} || RHN::DB->connect;
-
- my ($action_id, $stat_id) = $class->make_base_action(-org_id => $params{org_id},
- -user_id => $params{user_id},
- -type_label => 'configfiles.upload',
- -earliest => $params{earliest},
- -action_name => $params{action_name},
- -prerequisite => $params{prerequisite},
- -transaction => $dbh,
- );
-
- $class->add_servers_to_action($action_id, $stat_id, $params{user_id}, undef, $params{server_id});
-
- my $server = RHN::Server->lookup(-id => $params{server_id});
-
- my $query;
- my $sth;
-
- $query =<<EOQ;
-INSERT
- INTO rhnActionConfigFileName
- (action_id, config_file_name_id, server_id)
-VALUES (:aid, :cfnid, :server_id)
-EOQ
-
- $sth = $dbh->prepare($query);
-
- foreach my $file_name_id (@{$params{filename_ids}}) {
- $sth->execute_h(server_id => $params{server_id},
- aid => $action_id,
- cfnid => $file_name_id,
- );
- }
-
- $query =<<EOQ;
-INSERT
- INTO rhnActionConfigChannel
- (action_id, server_id, config_channel_id)
-VALUES (:aid, :server_id, :config_channel_id)
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute_h(aid => $action_id,
- config_channel_id => $params{config_channel_id},
- server_id => $params{server_id},
- );
-
- $dbh->commit unless $params{transaction};
-
- # XXX FIXME: trace and percolate up
- osa_wakeup_tickle();
-
- return ($action_id, $dbh);
-}
-
-
sub schedule_kickstart_inject {
my $class = shift;
my %params = validate(@_, { org_id => 1, user_id => 1, server_id => 1, earliest => 1, kstree_id => 1, append_string => 1, prerequisite => 0, transaction => 0, static_device => 1, ksid => 0});
14 years, 4 months
3 commits - web/modules
by Jan Pazdziora
web/modules/rhn/RHN/DB/ChannelEditor.pm | 26 --------
web/modules/sniglets/Sniglets/ChannelEditor.pm | 75 -------------------------
web/modules/sniglets/Sniglets/ServerActions.pm | 73 ------------------------
3 files changed, 174 deletions(-)
New commits:
commit 080a3278edb7d80783f02a8dc269c503435ce51f
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:06:06 2009 +0100
rhn:schedule_config_action_cb not used, removing, as well as schedule_config_action_cb.
diff --git a/web/modules/sniglets/Sniglets/ServerActions.pm b/web/modules/sniglets/Sniglets/ServerActions.pm
index a1f3369..5751671 100644
--- a/web/modules/sniglets/Sniglets/ServerActions.pm
+++ b/web/modules/sniglets/Sniglets/ServerActions.pm
@@ -59,7 +59,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:sscd_reboot_servers_cb' => \&sscd_reboot_servers_cb);
- $pxt->register_callback('rhn:schedule_config_action_cb' => \&schedule_config_action_cb);
$pxt->register_callback('rhn:add_managed_files_to_set_cb' => \&add_managed_files_to_set_cb);
$pxt->register_callback('rhn:add_managed_filenames_to_set_cb' => \&add_managed_filenames_to_set_cb);
$pxt->register_callback('rhn:schedule_ssm_config_action_cb' => \&schedule_ssm_config_action_cb);
@@ -442,78 +441,6 @@ my %config_actions = ('configfiles.verify' => 'verification',
'configfiles.upload' => 'upload',
'configfiles.deploy' => 'deploy');
-sub schedule_config_action_cb {
- my $pxt = shift;
- my $sid = $pxt->param('sid');
- die "no server id" unless $sid;
-
- PXT::Utils->untaint(\$sid);
-
- my $action;
-
- foreach my $action_type (keys %config_actions) {
- $action = $action_type if $pxt->dirty_param($action_type);
- }
-
- die "no action" unless $action;
-
- my $set_label = $pxt->dirty_param('set_label') || '';
- my $set = RHN::Set->lookup(-label => $set_label, -uid => $pxt->user->id);
- my %ids = map { ( $_, 1 ) } $set->contents;
-
- my $count = scalar $set->contents;
-
- $set->empty;
- $set->commit;
-
- my $server = RHN::Server->lookup(-id => $sid);
-
- my $action_id;
- my $earliest_date = Sniglets::ServerActions->parse_date_pickbox($pxt);
-
- if ($action eq 'configfiles.upload') {
- my @filename_ids = keys %ids;
-
- my $dest_type = $pxt->dirty_param('destination_channel_type') || 'sandbox';
-
- my $ccid = RHN::ConfigChannel->vivify_server_config_channel($sid, $dest_type eq 'sandbox' ? 'server_import' : 'local_override');
-
- ($action_id) = RHN::Scheduler->schedule_config_upload(-org_id => $pxt->user->org_id,
- -user_id => $pxt->user->id,
- -earliest => $earliest_date,
- -server_id => $sid,
- -action_name => 'Configuration ' . $config_actions{$action},
- -filename_ids => [@filename_ids],
- -config_channel_id => $ccid,
- );
-
- }
- else {
- my @revisions;
-
- foreach my $revision ($server->latest_managed_config_revisions()) {
- # skip file/rev unless it's truly under management on the server...
- next unless $ids{$revision->{LATEST_CONFIG_REVISION_ID}};
- push @revisions, $revision->{LATEST_CONFIG_REVISION_ID};
- }
-
-
- ($action_id) = RHN::Scheduler->schedule_config_action(-org_id => $pxt->user->org_id,
- -user_id => $pxt->user->id,
- -earliest => $earliest_date,
- -server_id => $sid,
- -action_type => $action,
- -action_name => 'Configuration ' . $config_actions{$action},
- -revision_ids => [@revisions],
- );
- }
-
- $pxt->push_message( site_info =>
- sprintf('System config <strong><a href="/network/systems/details/history/event.pxt?sid=%d&hid=%d">%s</a></strong> scheduled for <strong>%d</strong> file%s.',
- $sid, $action_id, $config_actions{$action}, $count, $count == 1 ? '' : 's') );
- $pxt->redirect("/rhn/systems/details/configuration/Overview.do?sid=$sid");
-}
-
sub _schedule_config_action {
my $user = shift;
my $action = shift;
commit d760f4fda97072eeb37077651aa36e76b096c381
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:01:50 2009 +0100
Removal of channel_delete_cb made delete_channel unused, removing as dead code.
diff --git a/web/modules/rhn/RHN/DB/ChannelEditor.pm b/web/modules/rhn/RHN/DB/ChannelEditor.pm
index 57e65f0..d84a281 100644
--- a/web/modules/rhn/RHN/DB/ChannelEditor.pm
+++ b/web/modules/rhn/RHN/DB/ChannelEditor.pm
@@ -203,32 +203,6 @@ EOQ
return @channels;
}
-sub delete_channel {
- my $class = shift;
- my $cid = shift;
-
- my $dbh = RHN::DB->connect;
- my $sth;
-
- my $channel = RHN::Channel->lookup(-id => $cid);
-
- die "Attempt to delete RHN channel '$cid'" unless $channel->org_id;
-
- $sth = $dbh->prepare(<<EOQ);
-INSERT
- INTO rhnRepoRegenQueue
- (id, channel_label, client, reason, force, bypass_filters, next_action, created, modified)
-VALUES (rhn_repo_regen_queue_id_seq.nextval,
- :label, 'perl-web::delete_channel', NULL, 'N', 'N', sysdate, sysdate, sysdate)
-EOQ
-
- $sth->execute_h(label => $channel->label);
-
- $dbh->call_procedure('delete_channel', $cid);
-
- $dbh->commit;
-}
-
#remove all packages from channel, and replace with contents of set.
#Caller is responsible for making sure the user is allowed to do this
sub replace_channel_packages {
commit 252364ae09db8f2b99021d3bd979117ecedb7987
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 10:00:03 2009 +0100
rhn:channel_delete_cb not used, removing, as well as channel_delete_cb.
diff --git a/web/modules/sniglets/Sniglets/ChannelEditor.pm b/web/modules/sniglets/Sniglets/ChannelEditor.pm
index bfc32e5..3285543 100644
--- a/web/modules/sniglets/Sniglets/ChannelEditor.pm
+++ b/web/modules/sniglets/Sniglets/ChannelEditor.pm
@@ -46,7 +46,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:channel_view_cb' => \&channel_view_cb);
$pxt->register_callback('rhn:channel_edit_cb' => \&channel_edit_cb);
- $pxt->register_callback('rhn:channel_delete_cb' => \&channel_delete_cb);
$pxt->register_callback('rhn:update_channel_cache' => \&update_channel_cache);
$pxt->register_callback('rhn:clone_channel_cb' => \&clone_channel_cb);
}
@@ -85,80 +84,6 @@ sub channel_view_cb {
$pxt->redirect($url);
}
-sub channel_delete_cb {
- my $pxt = shift;
-
- my $cid = $pxt->param('cid') || 0;
-
- die "no channel id"
- unless $cid;
-
- unless ($pxt->user->verify_channel_admin($cid) and $pxt->user->is('channel_admin')) {
- $pxt->redirect("/errors/permission.pxt");
- }
-
- if (RHN::Channel->children($cid)) {
- $pxt->push_message(local_alert => 'A channel cannot be deleted until all child channels are deleted.');
- return;
- }
- if (RHN::Channel->distros($cid)) {
- $pxt->push_message(local_alert => 'A channel cannot be deleted until all associated kickstart distributions are deleted or dissociated.');
- return;
- }
-
-
- my @servers = RHN::Channel->servers($cid);
-
- my $force_unsub = $pxt->dirty_param('force_unsubscribe') || 0;
-
- if (@servers) {
- my $servers_link = $pxt->dirty_param('servers_link');
- throw "param 'servers_link' needed but not provided" unless $servers_link;
- unless ($force_unsub == 1) {
- $pxt->push_message(local_alert => "There are currently systems subscribed to this channel. Please confirm system channel removal by selecting the unsubscribe checkbox.");
- return;
- }
- foreach my $sid(@servers) {
- my $server = RHN::Server->lookup(-id => $sid);
- $server->unsubscribe_from_channel($cid);
- }
- }
-
- my $channel = RHN::Channel->lookup(-id => $cid);
- my $name = $channel->name;
-
- my $ds = new RHN::DataSource::Package(-mode => 'packages_only_in_channel');
- my $orphaned_packages = $ds->execute_query(-cid => $cid, -org_id => $pxt->user->org_id);
-
- RHN::ChannelEditor->delete_channel($cid);
-
- foreach my $sid (@servers) {
- RHN::Server->schedule_errata_cache_update($pxt->user->org_id, $sid, 0);
- }
-
- $pxt->push_message(site_info => "Channel <strong>$name</strong> has been deleted.");
-
- my $redirect_to;
-
- if (@{$orphaned_packages}) {
- $redirect_to = $pxt->dirty_param('orphaned_packages_redirect');
- throw "param 'orphaned_packages_redirect' needed but not provided" unless $redirect_to;
-
- $redirect_to .= '?view_channel=no_channels';
- my $set = RHN::Set->lookup(-label => 'deletable_package_list', -uid => $pxt->user->id);
- $set->empty;
- $set->add(map { $_->{ID} } @{$orphaned_packages});
- $set->commit;
-
- $pxt->push_message(site_info => "The packages selected below were unique to <strong>$name</strong>, and have now been orphaned. The packages which are not selected were already orphaned.");
- }
- else {
- $redirect_to = $pxt->dirty_param('redirect_to');
- throw "param 'redirect_to' needed but not provided" unless $redirect_to;
- }
- $pxt->redirect($redirect_to);
-}
-
sub channel_edit_cb {
my $pxt = shift;
14 years, 4 months
9 commits - web/modules
by Jan Pazdziora
web/modules/sniglets/Sniglets/Search.pm | 279 --------------------------------
1 file changed, 279 deletions(-)
New commits:
commit 2771c96efdf48e64faecc52d73c51a266a2e2fd9
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 09:31:46 2009 +0100
Previous removals made validate_search_string unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Search.pm b/web/modules/sniglets/Sniglets/Search.pm
index 34484e8..4073319 100644
--- a/web/modules/sniglets/Sniglets/Search.pm
+++ b/web/modules/sniglets/Sniglets/Search.pm
@@ -24,37 +24,6 @@ use RHN::Server;
use RHN::Exception;
use PXT::Utils;
-sub validate_search_string {
- my $class = shift;
- my $pxt = shift;
- my $search = shift;
- my $search_string = shift;
-
- if ($search_string =~ /[^-a-zA-Z0-9_.]/) {
- $pxt->push_message(local_alert => 'Search strings must contain only letters, numbers, hyphens and dashes.');
- return;
- }
-
- if (length $search_string < 2) {
- $pxt->push_message(local_alert => 'Search strings must be longer than two characters.');
- return;
- }
-
- if ($search) {
- my $result = $search->valid_search_string($search_string);
-
- # returned value is error message to display, or undef/emptystring
- # if there are no errors
-
- if ($result) {
- $pxt->push_message(local_alert => $result);
- return;
- }
- }
-
- $pxt->pnotes(searched => 1);
-}
-
my @integer_types = qw/search_id search_cpu_mhz_lt search_cpu_mhz_gt search_ram_lt search_ram_gt search_checkin search_registered/;
# Utility functions
commit 213cb07f246d1ce6a9654043d4b5270ea5479488
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 09:29:01 2009 +0100
The rest of Package Searching can be removed as well.
diff --git a/web/modules/sniglets/Sniglets/Search.pm b/web/modules/sniglets/Sniglets/Search.pm
index a1c5c26..34484e8 100644
--- a/web/modules/sniglets/Sniglets/Search.pm
+++ b/web/modules/sniglets/Sniglets/Search.pm
@@ -57,17 +57,6 @@ sub validate_search_string {
my @integer_types = qw/search_id search_cpu_mhz_lt search_cpu_mhz_gt search_ram_lt search_ram_gt search_checkin search_registered/;
-#################################
-# Package Searching
-#################################
-
-my $package_searches = new RHN::SearchType;
-$package_searches->add_mode(simple_package_search => "Name and Summary", 'Summary');
-$package_searches->add_mode(package_search_by_name => "Name Only", 'Summary');
-$package_searches->set_name('package_search');
-
-RHN::SearchTypes->register_type('package', $package_searches);
-
# Utility functions
sub strip_rpm_extensions { #strips the extensions off of an rpm file name
commit acb4125d5046c1e82d869a6b262123562c707eb9
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 09:27:58 2009 +0100
Removal of bar_search_cb made package_search_handler unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Search.pm b/web/modules/sniglets/Sniglets/Search.pm
index d0833c6..a1c5c26 100644
--- a/web/modules/sniglets/Sniglets/Search.pm
+++ b/web/modules/sniglets/Sniglets/Search.pm
@@ -24,13 +24,6 @@ use RHN::Server;
use RHN::Exception;
use PXT::Utils;
-sub register_callbacks {
- my $class = shift;
- my $pxt = shift;
-
- $pxt->register_callback('rhn:package_search_handler' => \&package_search_handler);
-}
-
sub validate_search_string {
my $class = shift;
my $pxt = shift;
@@ -75,40 +68,6 @@ $package_searches->set_name('package_search');
RHN::SearchTypes->register_type('package', $package_searches);
-sub package_search_handler {
- my $pxt = shift;
-
- my $search = RHN::SearchTypes->find_type('package');
- my $selected = new RHN::DB::Set $search->set_name, $pxt->user->id;
- $selected->empty;
- $selected->commit;
-
- my $search_string = $pxt->dirty_param('search_string') || '';
- my $search_mode = $pxt->dirty_param('view_mode') || $search->default_search_type;
-
- my @arch_labels;
- for my $arch (qw/ia32 ia64 x86_64/) {
- push @arch_labels, "channel-$arch"
- if $pxt->dirty_param("channel_arch_$arch");
- }
-
- my $smart_search = $pxt->dirty_param('search_subscribed_channels');
-
- if (not $smart_search and not @arch_labels) {
- $pxt->push_message(local_alert => 'You must choose at least one architecture, or to search relevant channels.');
- return;
- }
-
- if ($smart_search and @arch_labels) {
- $pxt->push_message(local_alert => 'Either do a smart search -or- an arch search, not both.');
- return;
- }
-
- if (Sniglets::Search->validate_search_string($pxt, $search, $search_string)) {
- RHN::Search->package_search($pxt->user, $search_mode, $search_string, \@arch_labels, $smart_search);
- }
-}
-
# Utility functions
sub strip_rpm_extensions { #strips the extensions off of an rpm file name
commit 174a61d55d7be1d4bc720600f3b30b85259a532a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 09:27:10 2009 +0100
The rest of Errata Searching can be removed as well.
diff --git a/web/modules/sniglets/Sniglets/Search.pm b/web/modules/sniglets/Sniglets/Search.pm
index 0e66174..d0833c6 100644
--- a/web/modules/sniglets/Sniglets/Search.pm
+++ b/web/modules/sniglets/Sniglets/Search.pm
@@ -65,19 +65,6 @@ sub validate_search_string {
my @integer_types = qw/search_id search_cpu_mhz_lt search_cpu_mhz_gt search_ram_lt search_ram_gt search_checkin search_registered/;
#################################
-# Errata Searching
-#################################
-
-
-my $errata_searches = new RHN::SearchType;
-$errata_searches->add_mode(simple_errata_search => "Summary", 'Synopsis');
-$errata_searches->add_mode(errata_search_by_advisory => "Errata Advisory (ex: RHSA-2002:130)", 'Errata Advisory');
-$errata_searches->add_mode(errata_search_by_package_name => "Package Name (ex: apache)", 'Package Name');
-$errata_searches->set_name('errata_search');
-
-RHN::SearchTypes->register_type('errata', $errata_searches);
-
-#################################
# Package Searching
#################################
commit c53cc40c2fdda2a19a827fd498e048081d6b2e3e
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 09:26:44 2009 +0100
Removal of bar_search_cb made errata_search_handler unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Search.pm b/web/modules/sniglets/Sniglets/Search.pm
index 3fde4ad..0e66174 100644
--- a/web/modules/sniglets/Sniglets/Search.pm
+++ b/web/modules/sniglets/Sniglets/Search.pm
@@ -28,7 +28,6 @@ sub register_callbacks {
my $class = shift;
my $pxt = shift;
- $pxt->register_callback('rhn:errata_search_handler' => \&errata_search_handler);
$pxt->register_callback('rhn:package_search_handler' => \&package_search_handler);
}
@@ -78,21 +77,6 @@ $errata_searches->set_name('errata_search');
RHN::SearchTypes->register_type('errata', $errata_searches);
-sub errata_search_handler {
- my $pxt = shift;
-
- my $search = RHN::SearchTypes->find_type('errata');
-
- my $selected = new RHN::DB::Set $search->set_name, $pxt->user->id;
- $selected->empty;
- $selected->commit;
-
- my $search_string = $pxt->dirty_param('search_string') || '';
- my $search_mode = $pxt->dirty_param('view_mode') || $search->default_search_type;
-
- RHN::Search->errata_search($pxt->user, $search_mode, $search_string);
-}
-
#################################
# Package Searching
#################################
commit 9430f4ec3ccc9ae5a8b2a0d937c27e0ac92aa1cc
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 09:26:11 2009 +0100
The rest of System Searching can be removed as well.
diff --git a/web/modules/sniglets/Sniglets/Search.pm b/web/modules/sniglets/Sniglets/Search.pm
index 65289a7..3fde4ad 100644
--- a/web/modules/sniglets/Sniglets/Search.pm
+++ b/web/modules/sniglets/Sniglets/Search.pm
@@ -63,106 +63,6 @@ sub validate_search_string {
$pxt->pnotes(searched => 1);
}
-#################################
-# System Searching
-#################################
-
-my $system_searches = new RHN::SearchType::System;
-$system_searches->set_name('system_search');
-
-$system_searches->add_category(-label => 'Details',
- -modes => [
- { -label => 'Name/Description',
- -name => 'search_simple' },
- { -label => 'ID',
- -name => 'search_id' },
- { -label => 'Custom Info',
- -name => 'search_custom_info',
- -acl => 'org_entitlement(rhn_provisioning)'},
- { -label => 'Snapshot Tag',
- -name => 'search_snapshot_tag',
- -acl => 'org_entitlement(rhn_provisioning)'},
- ] );
-
-$system_searches->add_category(-label => 'Activity',
- -modes => [
- { -label => 'Days Since Last Checkin',
- -name => 'search_checkin' },
- { -label => 'Days Since First Registered',
- -name => 'search_registered' },
- ] );
-
-$system_searches->add_category(-label => 'Hardware',
- -modes => [
- { -label => 'CPU Model',
- -name => 'search_cpu_model' },
- { -label => 'CPU MHz less than',
- -name => 'search_cpu_mhz_lt',
- -column_name => 'CPU MHz' },
- { -label => 'CPU MHz greater than',
- -name => 'search_cpu_mhz_gt',
- -column_name => 'CPU MHz' },
- { -label => 'RAM less than',
- -name => 'search_ram_lt',
- -column_name => 'RAM' },
- { -label => 'RAM greater than',
- -name => 'search_ram_gt',
- -column_name => 'RAM' },
- ] );
-
-$system_searches->add_category(-label => 'Hardware Devices',
- -modes => [
- { -label => 'Description',
- -name => 'search_hwdevice_description' },
- { -label => 'Driver',
- -name => 'search_hwdevice_driver' },
- { -label => 'Device ID',
- -name => 'search_hwdevice_device_id' },
- { -label => 'Vendor ID',
- -name => 'search_hwdevice_vendor_id' },
- ] );
-
-$system_searches->add_category(-label => 'DMI Info',
- -modes => [
- { -label => 'System',
- -name => 'search_dmi_system' },
- { -label => 'BIOS',
- -name => 'search_dmi_bios' },
- { -label => 'Asset Tag',
- -name => 'search_dmi_asset' },
- ] );
-
-$system_searches->add_category(-label => 'Network Info',
- -modes => [
- { -label => 'Hostname',
- -name => 'search_hostname' },
- { -label => 'IP address',
- -name => 'search_ip' },
- ] );
-
-$system_searches->add_category(-label => 'Packages',
- -modes => [
- { -label => 'Installed Packages',
- -name => 'search_installed_packages' },
- { -label => 'Needed Packages',
- -name => 'search_needed_packages' },
- ] );
-
-$system_searches->add_category(-label => 'Location',
- -modes => [
- { -label => 'Address',
- -name => 'search_location_address' },
- { -label => 'Building',
- -name => 'search_location_building' },
- { -label => 'Room',
- -name => 'search_location_room' },
- { -label => 'Rack',
- -name => 'search_location_rack' },
- ] );
-
-
-RHN::SearchTypes->register_type('system', $system_searches);
-
my @integer_types = qw/search_id search_cpu_mhz_lt search_cpu_mhz_gt search_ram_lt search_ram_gt search_checkin search_registered/;
#################################
commit f384f0ef6ee20e7fb1cca17c8052a50c9fddace7
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 09:20:11 2009 +0100
Removal of bar_search_cb made system_search_handler unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Search.pm b/web/modules/sniglets/Sniglets/Search.pm
index 32dc6dd..65289a7 100644
--- a/web/modules/sniglets/Sniglets/Search.pm
+++ b/web/modules/sniglets/Sniglets/Search.pm
@@ -28,7 +28,6 @@ sub register_callbacks {
my $class = shift;
my $pxt = shift;
- $pxt->register_callback('rhn:system_search_handler' => \&system_search_handler);
$pxt->register_callback('rhn:errata_search_handler' => \&errata_search_handler);
$pxt->register_callback('rhn:package_search_handler' => \&package_search_handler);
}
@@ -166,29 +165,6 @@ RHN::SearchTypes->register_type('system', $system_searches);
my @integer_types = qw/search_id search_cpu_mhz_lt search_cpu_mhz_gt search_ram_lt search_ram_gt search_checkin search_registered/;
-sub system_search_handler {
- my $pxt = shift;
-
- my $search_string = $pxt->dirty_param('search_string') || '';
- my $search_set = $pxt->dirty_param('search_set') || 'all';
- my $search_type = $pxt->dirty_param('view_mode') || 'search_simple';
- my $invert = $pxt->dirty_param('invert');
-
- my $set_name = $pxt->dirty_param('set_name') || 'search_result_list';
- my $selected = new RHN::DB::Set $set_name, $pxt->user->id;
-
- $selected->empty;
- $selected->commit;
-
- $search_string = Sniglets::Search->strip_invalid_chars($search_string, $search_type);
-
- my $integer_search = grep { $search_type eq $_ } @integer_types;
-
- if ($integer_search or Sniglets::Search->validate_search_string($pxt, undef, $search_string)) {
- RHN::Search->system_search($pxt->user, $search_string, $search_set, $search_type, $invert);
- }
-}
-
#################################
# Errata Searching
#################################
commit d090b6c0a15d0f5080ca921b6bf4d1051e5c9c58
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 09:18:18 2009 +0100
register_tags without content can be removed as well.
diff --git a/web/modules/sniglets/Sniglets/Search.pm b/web/modules/sniglets/Sniglets/Search.pm
index b816bff..32dc6dd 100644
--- a/web/modules/sniglets/Sniglets/Search.pm
+++ b/web/modules/sniglets/Sniglets/Search.pm
@@ -24,12 +24,6 @@ use RHN::Server;
use RHN::Exception;
use PXT::Utils;
-sub register_tags {
- my $class = shift;
- my $pxt = shift;
-
-}
-
sub register_callbacks {
my $class = shift;
my $pxt = shift;
commit cc267b65e9c9eccead93b197ce3b6522fc0bed14
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 09:18:03 2009 +0100
rhn:bar_search_cb not used, removing, as well as bar_search_cb.
diff --git a/web/modules/sniglets/Sniglets/Search.pm b/web/modules/sniglets/Sniglets/Search.pm
index f56cc71..b816bff 100644
--- a/web/modules/sniglets/Sniglets/Search.pm
+++ b/web/modules/sniglets/Sniglets/Search.pm
@@ -37,8 +37,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:system_search_handler' => \&system_search_handler);
$pxt->register_callback('rhn:errata_search_handler' => \&errata_search_handler);
$pxt->register_callback('rhn:package_search_handler' => \&package_search_handler);
-
- $pxt->register_callback('rhn:bar_search_cb' => \&bar_search_cb);
}
sub validate_search_string {
@@ -270,41 +268,6 @@ sub package_search_handler {
}
}
-sub bar_search_cb {
- my $pxt = shift;
-
- my $type = $pxt->dirty_param('search_type') || 'systems';
- my $string = $pxt->dirty_param('search_string') || '';
-
- $string = PXT::Utils->escapeURI($string);
- my $url;
-
- if ($type eq 'systems') {
- my $trap = PXT::Utils->escapeURI('pxt_trap=rhn:system_search_handler');
- $url = "/rhn/systems/Search.do?view_mode=systemsearch_name_and_description&search_string=$string&whereToSearch=all&submitted=true";
-
- $url = "/rhn/systems/Search.do" if not $string;
- }
- elsif ($type eq 'errata') {
- my $trap = PXT::Utils->escapeURI('pxt_trap=rhn:errata_search_handler');
- $url = "/rhn/errata/Search.do?view_mode=simple_errata_search&search_string=$string";
-
- $url = "/rhn/errata/Search.do" if not $string;
- }
- elsif ($type eq 'packages') {
- my $trap = PXT::Utils->escapeURI('pxt_trap=rhn:package_search_handler');
- $url = "/rhn/channels/software/Search.do?view_mode=search_name_and_summary&search_string=$string&ia32=channel-ia32&ia64=channel-ia64&x86=channel-x86_64&$trap";
-
- $url = "/rhn/channels/software/Search.do" if not $string;
- }
- else {
- die "no search type?!";
- }
-
- $pxt->session->set('last_search_type' => $type);
- $pxt->redirect($url);
-}
-
# Utility functions
sub strip_rpm_extensions { #strips the extensions off of an rpm file name
14 years, 4 months
3 commits - web/html web/modules
by Jan Pazdziora
web/html/network/keys/key_list.pxt | 1
web/html/network/systems/custominfo/index.pxt | 1
web/html/network/systems/ssm/misc/choose_value_to_remove.pxt | 1
web/html/network/systems/ssm/misc/choose_value_to_set.pxt | 1
web/modules/sniglets/Sniglets/Org.pm | 46 -----------
web/modules/sniglets/Sniglets/Servers.pm | 1
6 files changed, 51 deletions(-)
New commits:
commit c7dd38d4fa4010b2da0e7f92f900a6d3265e13b5
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Dec 21 20:37:25 2009 +0100
Previous removals made Sniglets::Org empty package, dropping.
diff --git a/web/html/network/keys/key_list.pxt b/web/html/network/keys/key_list.pxt
index 9508808..73a1b2d 100644
--- a/web/html/network/keys/key_list.pxt
+++ b/web/html/network/keys/key_list.pxt
@@ -2,7 +2,6 @@
<pxt-passthrough>
<pxt-use class="Grail::Frame" />
<pxt-use class="Sniglets::HTML" />
- <pxt-use class="Sniglets::Org" />
<pxt-use class="Sniglets::Lists" />
<pxt-use class="Sniglets::HTML" />
diff --git a/web/html/network/systems/custominfo/index.pxt b/web/html/network/systems/custominfo/index.pxt
index cb14a1d..b3dbf40 100644
--- a/web/html/network/systems/custominfo/index.pxt
+++ b/web/html/network/systems/custominfo/index.pxt
@@ -2,7 +2,6 @@
<pxt-passthrough>
<pxt-use class="Grail::Frame" />
<pxt-use class="Sniglets::HTML" />
- <pxt-use class="Sniglets::Org" />
<pxt-use class="Sniglets::Lists" />
<pxt-use class="Sniglets::HTML" />
diff --git a/web/html/network/systems/ssm/misc/choose_value_to_remove.pxt b/web/html/network/systems/ssm/misc/choose_value_to_remove.pxt
index 3ccf935..d4902bf 100644
--- a/web/html/network/systems/ssm/misc/choose_value_to_remove.pxt
+++ b/web/html/network/systems/ssm/misc/choose_value_to_remove.pxt
@@ -2,7 +2,6 @@
<pxt-passthrough>
<pxt-use class="Grail::Frame" />
<pxt-use class="Sniglets::HTML" />
- <pxt-use class="Sniglets::Org" />
<pxt-use class="Sniglets::Lists" />
<pxt-use class="Sniglets::HTML" />
diff --git a/web/html/network/systems/ssm/misc/choose_value_to_set.pxt b/web/html/network/systems/ssm/misc/choose_value_to_set.pxt
index 52e245e..b0cff91 100644
--- a/web/html/network/systems/ssm/misc/choose_value_to_set.pxt
+++ b/web/html/network/systems/ssm/misc/choose_value_to_set.pxt
@@ -2,7 +2,6 @@
<pxt-passthrough>
<pxt-use class="Grail::Frame" />
<pxt-use class="Sniglets::HTML" />
- <pxt-use class="Sniglets::Org" />
<pxt-use class="Sniglets::Lists" />
<grail-canvas-template base="/templates/c.pxt" mode="main_canvas">
diff --git a/web/modules/sniglets/Sniglets/Org.pm b/web/modules/sniglets/Sniglets/Org.pm
deleted file mode 100644
index 4ffa032..0000000
--- a/web/modules/sniglets/Sniglets/Org.pm
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-
-package Sniglets::Org;
-
-use POSIX qw/strftime/;
-use RHN::Channel;
-use RHN::API::Types;
-use RHN::SatelliteCert;
-use Carp;
-
-use RHN::Exception qw/throw/;
-
-1;
diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm
index 787e411..a64d855 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -44,7 +44,6 @@ use RHN::ConfigFile;
use RHN::Kickstart::Session;
use Sniglets::Forms;
-use Sniglets::Org;
use Sniglets::HTML;
use Sniglets::AppInstall;
use Sniglets::ServerActions;
commit feec0fa42777a91251ae2e664792829c594acbff
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Dec 21 20:35:36 2009 +0100
Removal of reset_form made reset_and_commit_set unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Org.pm b/web/modules/sniglets/Sniglets/Org.pm
index af37008..4ffa032 100644
--- a/web/modules/sniglets/Sniglets/Org.pm
+++ b/web/modules/sniglets/Sniglets/Org.pm
@@ -25,13 +25,4 @@ use Carp;
use RHN::Exception qw/throw/;
-sub reset_and_commit_set {
- my $uid = shift;
- my $label = shift;
-
- my $set = RHN::Set->lookup(-label => $label, -uid => $uid);
- $set->empty();
- $set->commit();
-}
-
1;
commit a382bc93cd788cc40b6c19c4ca5b01ebf33df953
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Dec 21 20:35:05 2009 +0100
Previous removals made reset_form unused, removing as dead code.
diff --git a/web/modules/sniglets/Sniglets/Org.pm b/web/modules/sniglets/Sniglets/Org.pm
index 2d1cd48..af37008 100644
--- a/web/modules/sniglets/Sniglets/Org.pm
+++ b/web/modules/sniglets/Sniglets/Org.pm
@@ -25,15 +25,6 @@ use Carp;
use RHN::Exception qw/throw/;
-sub reset_form {
- my $pxt = shift;
-
- $pxt->session->unset('new_cert_info');
- reset_and_commit_set($pxt->user->id, 'new_cert_channel_set');
- reset_and_commit_set($pxt->user->id, 'new_cert_add_channel_set');
- reset_and_commit_set($pxt->user->id, 'new_cert_service_set');
-}
-
sub reset_and_commit_set {
my $uid = shift;
my $label = shift;
14 years, 4 months