[Spacewalk-devel] [PATCH] Error message when successfully toggling user roles

2011-09-06 Thread Johannes Renner
Hey,

Here is a (very) small thing I stumbled upon: There is an error message
sent to the client even in case of success while toggling administrator
roles of single users. Please see the attached patch for a fix to send
a success message instead. There is further no bugzilla item about this,
since it was probably never an issue..

(The URI of the respective page is /rhn/admin/multiorg/Users.do)

Greetings,
Johannes

-- 
SUSE LINUX Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
From 9138ab493776b334005c8ab63f635284b913da6e Mon Sep 17 00:00:00 2001
From: Johannes Renner jren...@suse.de
Date: Tue, 6 Sep 2011 10:03:55 +0200
Subject: [PATCH] Do not send error message in case of success

---
 .../frontend/action/multiorg/SatAdminAction.java   |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/frontend/action/multiorg/SatAdminAction.java b/java/code/src/com/redhat/rhn/frontend/action/multiorg/SatAdminAction.java
index 479a7ad..3fe048c 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/multiorg/SatAdminAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/multiorg/SatAdminAction.java
@@ -76,12 +76,12 @@ public class SatAdminAction extends RhnAction {
 // check role and toggle
 if (u.hasRole(RoleFactory.SAT_ADMIN)) {
 u.removeRole(RoleFactory.SAT_ADMIN);
-createErrorMessage(request, user.satadmin.remove,
+createSuccessMessage(request, user.satadmin.remove,
 u.getLogin());
 }
 else {
 u.addRole(RoleFactory.SAT_ADMIN);
-createErrorMessage(request, user.satadmin.add,
+createSuccessMessage(request, user.satadmin.add,
 u.getLogin());
 }
 
-- 
1.7.3.4


___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] 1, y, true, yes, on etc

2011-09-06 Thread Bo Maryniuk

Anyone?...


--
Bo Maryniuk

SUSE LINUX Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)



On 09/05/2011 04:08 PM, Bo Maryniuk wrote:

Guys,
should we support all of the list of valid true's for the config,
listed in /spacewalk/java/code/src/com/redhat/rhn/common/conf/Config.java,
or 1 is just enough for the next century?


/**
* List of values that are considered true, ignoring case.
*/
private static final String[] TRUE_VALUES = {1, y, true, yes,
on};

This is a bit not synchronized, since *only* Java stack allows such
odd choices, while the rest of the Spacewalk seems like understands
only 1 or 0 (Python part, at least).

I would suggest to put it to the common schema, because this is
very confusing.

So either:
1. Teach the rest of the Spacewalk to understand all of the above,
where seems like Esperanto and Swahili are still missing :-)

2. Reduce it to just 1 or 0.


What you think? I would go #2 personally...




___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel