Re: [Spacewalk-devel] [RFC] showing timestamps in Spacewalk

2014-01-28 Thread Duncan Mac-Vicar P.
On 27/01/14 15:00, Michael Mraka wrote:
 I've commited this part of timestamp changes with an exception of 
 moment-with-langs.min.js file.
 It isn't referenced from pages (moment.min.js is), moreover it should not be 
 in
 spacewalk-web but a separate package. 

It is referenced from the JSP tag. The tag includes the script once if
the tag is used. If you don't use the JSP tag but the HTML tag manually
then you have to include it yourself.

 Should there be already some dates translated to human readable string on 
 pxt pages? Even if I download moment.min.js to my spacewalk I can't see any.
 I see date wrapped with time/time but no translation (e.g. on 
 /network/systems/details/history/pending.pxt).

No, I did some examples but did not include them in the patch. I think
case by case we should define if for a displayed date it makes more
sense the calendar or ago style.

-- 
Duncan Mac-Vicar P. - http://www.suse.com/

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

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

Re: [Spacewalk-devel] [PATCH] Adding a password strength meter to spacewalk

2014-01-28 Thread Maximilian Meister

On 01/24/2014 12:29 PM, Matej Kollar wrote:

Hi everybody,

here you can find the new patch with the following changes:


Hi Maximilian.

I see you have made some nice work there but there are still few things
that need to be fixed.

   * Warning pop-up.
 * Could it be moved to the right or bottom of the filed?
 * It also blinks/flickers on change, is there a way to stop it?

   * Colored progress bar/strength meter.
 * It is connected with the password field in very strange way (visually).
   Would it be possible to change it as per Michael's suggestion
   to look like [1] or [2]? Personally I would prefer second option.


* progress bar now has its own named column



   * Spec
 * `jquery.pwstrength.bootstrap` is not good name for package. I suggest
   `pwstrength-bootstrap` (the .spec is called such anyway).


* package name == filename


 * `Source0` is defined in a bit complicated way. Using
   [4] would not only be sufficient but will make it clearer and
   easier to understand.


Source0 is now readable :) as in [4]



   * Is there simple way to change rules that determine what is acceptable
 password?
 * E.g. various character classes reminded me
   there are other ways to make good password :-). [3]

Thanks for the effort invested and keep up good work :-).

[1] 
http://www.jqueryscript.net/demo/Simple-jQuery-Password-Strength-Indicator-Plugin-passMeter/
[2] 
http://cdn1.freshdesignweb.com/wp-content/uploads/2011/09/jquery-password-strength-meter-005.jpg
[3] http://xkcd.com/936/
[4] https://github.com/ablanco/jquery.pwstrength.bootstrap/archive/1.0.2.tar.gz




please check it out, and tell me if I missed something.

Thank you
Maximilian

--
--
Mit freundlichen Grüßen,
Maximilian Meister
Systems Management Department

SUSE LINUX Products GmbH
Maxfeldstr. 5
D-90409 Nuremberg, Germany

http://www.suse.com

GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer, HRB 21284 (AG Nuremberg)

From 9237a4157c666f8a78a65ef99098147b759e7a3d Mon Sep 17 00:00:00 2001
From: Maximilian Meister mmeis...@suse.de
Date: Tue, 28 Jan 2014 11:24:47 +0100
Subject: [PATCH 1/4] adding spec and patch to spec-tree

---
 .../pwstrength/pwstrength-bootstrap-1.0.2.patch| 84 ++
 spec-tree/pwstrength/pwstrength-bootstrap.spec | 41 +++
 2 files changed, 125 insertions(+)
 create mode 100644 spec-tree/pwstrength/pwstrength-bootstrap-1.0.2.patch
 create mode 100644 spec-tree/pwstrength/pwstrength-bootstrap.spec

diff --git a/spec-tree/pwstrength/pwstrength-bootstrap-1.0.2.patch b/spec-tree/pwstrength/pwstrength-bootstrap-1.0.2.patch
new file mode 100644
index 000..f32efe5
--- /dev/null
+++ b/spec-tree/pwstrength/pwstrength-bootstrap-1.0.2.patch
@@ -0,0 +1,84 @@
+--- dist/pwstrength-bootstrap-1.0.2.js	2014-01-27 10:20:54.927264579 +0100
 dist/pwstrength-bootstrap-1.0.2.js	2014-01-28 09:47:16.720675185 +0100
+@@ -47,7 +47,7 @@ try {
+ };
+
+ validation.wordSimilarToUsername = function (options, word, score) {
+-var username = $(options.common.usernameField).val();
++var username = $(options.common.usernameField).val() || $(options.common.usernameField).text();
+ if (username  word.toLowerCase().match(username.toLowerCase())) {
+ options.instances.errors.push(options.ui.spanError(options, same_as_username));
+ return score;
+@@ -288,7 +288,7 @@ var ui = {};
+
+ ui.initProgressBar = function (options, $el) {
+ var $container = ui.getContainer(options, $el),
+-progressbar = div class='progress'div class=';
++progressbar = div class='progress progress-pwstrength'div class=';
+
+ if (!options.ui.bootstrap2) {
+ progressbar += progress-;
+@@ -296,9 +296,9 @@ var ui = {};
+ progressbar += bar'/div/div;
+
+ if (options.ui.viewports.progress) {
+-$container.find(options.ui.viewports.progress).append(progressbar);
++$container.append(progressbar);
+ } else {
+-$(progressbar).insertAfter($el);
++$(progressbar).insertAfter('#desiredpassword-input-group');
+ }
+ };
+
+@@ -312,7 +312,7 @@ var ui = {};
+ };
+
+ ui.initVerdict = function (options, $el) {
+-ui.initHelper(options, $el, span class='password-verdict'/span,
++ui.initHelper(options, $el, span class='password-verdict' style='display:none'/span,
+ options.ui.viewports.verdict);
+ };
+
+@@ -334,7 +334,7 @@ var ui = {};
+ if (options.ui.showErrors) {
+ html += divul class='error-list';
+ $.each(options.instances.errors, function (idx, err) {
+-html += li + err + /li;
++html += err;
+ });
+ html += /ul/div;
+ }
+@@ -343,7 +343,7 @@ var ui = {};
+ $el.popover({
+ html: true,
+ placement: placement,
+-trigger: manual,
++   

[Spacewalk-devel] Patch: 1058431-sw-remove-channel-does-not-rm-ks-trees

2014-01-28 Thread Dimitar Yordanov
Hi all,

   I tried to fix the problem described in bz1058431 - Spacewalk-remove-channel 
does not remove the kickstart trees.
   You can find my patch enclosed.

Dimi

-- 
Dimitar Yordanov
Systems Management QA
#satellite-qa
From 50cd79f0607322aab39a3d34e48dd8712c87eadb Mon Sep 17 00:00:00 2001
From: Dimitar Yordanov dyord...@redhat.com
Date: Mon, 27 Jan 2014 20:09:53 +0100
Subject: [PATCH] 1058431 - sw-remove-channel does not rm ks trees.

---
 backend/satellite_tools/spacewalk-remove-channel | 71 
 1 file changed, 47 insertions(+), 24 deletions(-)

diff --git a/backend/satellite_tools/spacewalk-remove-channel b/backend/satellite_tools/spacewalk-remove-channel
index f3b5d2e..1b9216c 100755
--- a/backend/satellite_tools/spacewalk-remove-channel
+++ b/backend/satellite_tools/spacewalk-remove-channel
@@ -11,10 +11,10 @@
 # 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. 
+# in this software or its documentation.
 #
 
 import sys
@@ -35,11 +35,11 @@ from spacewalk.server import rhnSQL
 from spacewalk.server.rhnPackage import unlink_package_file
 
 options_table = [
-Option(-v, --verbose,   action=count, 
+Option(-v, --verbose,   action=count,
help=Increase verbosity),
 Option(-l, --list,  action=store_true,
help=List defined channels and exit),
-Option(-c, --channel,   action=append, 
+Option(-c, --channel,   action=append,
help=Delete this channel (can be present multiple times)),
 Option(-u, --unsubscribe,   action=store_true,
help=Unsubscribe systems registered to the specified channels),
@@ -157,7 +157,7 @@ def main():
 def __serverCheck(labels, unsubscribe):
 sql = 
 select distinct S.org_id, S.id, S.name
-from rhnChannel c inner join 
+from rhnChannel c inner join
  rhnServerChannel sc on c.id = sc.channel_id inner join
  rhnServer s on s.id = sc.server_id
 where c.label in (%s)
@@ -187,13 +187,13 @@ def __serverCheck(labels, unsubscribe):
 print str(map['id']).ljust(14),
 print(map['name'])
 
-return len(list) 
+return len(list)
 
 
 def __unsubscribeServers(labels):
 sql = 
 select distinct sc.server_id as server_id, C.id as channel_id, c.parent_channel, c.label
-from rhnChannel c inner join 
+from rhnChannel c inner join
  rhnServerChannel sc on c.id = sc.channel_id
 where c.label in (%s) order by C.parent_channel
 
@@ -231,7 +231,7 @@ def __unsubscribeServers(labels):
 def __kickstartCheck(labels):
 sql = 
 select K.org_id, K.label
-from rhnKSData K inner join 
+from rhnKSData K inner join
  rhnKickstartDefaults KD on KD.kickstart_id = K.id inner join
  rhnKickstartableTree KT on KT.id = KD.kstree_id inner join
  rhnChannel c on c.id = KT.channel_id
@@ -250,7 +250,7 @@ def __kickstartCheck(labels):
   Please remove these or change their associated base channel.\n)
 print('org_id'.ljust(8)),
 print('label')
-print(-*20) 
+print(-*20)
 for map in list:
 print str(map['org_id']).ljust(8),
 print(map['label'])
@@ -260,7 +260,7 @@ def __kickstartCheck(labels):
 
 def __listChannels():
 sql = 
-select c1.label, c2.label parent_channel 
+select c1.label, c2.label parent_channel
 from rhnChannel c1 left outer join rhnChannel c2 on c1.parent_channel = c2.id
 order by c2.label desc, c1.label asc
 
@@ -286,7 +286,7 @@ def __listChannels():
 def delete_channels(channelLabels, force=0, justdb=0, skip_packages=0, skip_channels=0):
 # Get the package ids
 if not channelLabels:
-return 
+return
 
 rpms_ids = list_packages(channelLabels, force=force, sources=0)
 rpms_paths = _get_package_paths(rpms_ids, sources=0)
@@ -297,14 +297,17 @@ def delete_channels(channelLabels, force=0, justdb=0, skip_packages=0, skip_chan
 _delete_srpms(srpms_ids)
 _delete_rpms(rpms_ids)
 
+_delete_ks_files(channelLabels)
+
 if not justdb and not skip_packages:
 _delete_files(rpms_paths + srpms_paths)
 
+
 # Get the channel ids
 h = rhnSQL.prepare(
-select id, parent_channel 
-from rhnChannel 
-where label = :label 
+select id, parent_channel
+from rhnChannel
+where label = :label
 order by parent_channel)
 channel_ids = []
 for label in channelLabels:
@@ -327,7 +330,7 @@ def delete_channels(channelLabels, force=0, justdb=0, skip_packages=0, skip_chan
 ]
 query = 
 delete from %(table_2)s 

Re: [Spacewalk-devel] [PATCH] Adding a password strength meter to spacewalk

2014-01-28 Thread Matej Kollar


--
Matej Kollar
Satellite Engineering, Red Hat

- Original Message -
 From: Maximilian Meister mmeis...@suse.de
 To: spacewalk-devel@redhat.com
 Sent: Friday, January 24, 2014 2:33:46 PM
 Subject: Re: [Spacewalk-devel] [PATCH] Adding a password strength meter to 
 spacewalk
 
 On 01/24/2014 12:29 PM, Matej Kollar wrote:
 
 * Warning pop-up.
   * Could it be moved to the right or bottom of the filed?
 Yes. Though on the bottom it overlaps with the bar, and on the right it
 could end up being
 compressed, depending on the window size of your browser.
 I guess I could try to hang the popover on the bottom of the bar for
 example.
 Right now it's attached to the input field, which makes sense IMO.
 So I personally would keep it on top, what do you think?
   * It also blinks/flickers on change, is there a way to stop it?
 The popover needs to be destroyed and recreated to update it, otherwise
 it stacks up
 in the html output. That's where the flickering comes from.
 I am currently not aware of a workaround. The popover class has the methods
 show, hide, toggle and destroy.
 
 * Colored progress bar/strength meter.
   * It is connected with the password field in very strange way
   (visually).
 Would it be possible to change it as per Michael's suggestion
 to look like [1] or [2]? Personally I would prefer second option.
 I guess I could give it an extra column like in [2] and place it under the
 Confirm Password: field?
 
 * Spec
   * `jquery.pwstrength.bootstrap` is not good name for package. I
   suggest
 `pwstrength-bootstrap` (the .spec is called such anyway).
 I will rename it.
   * `Source0` is defined in a bit complicated way. Using
 [4] would not only be sufficient but will make it clearer and
 easier to understand.
 Agreed. I took a hint at https://fedoraproject.org/wiki/Packaging:SourceURL
 But I can change it as you said.

Appreciate that you looked up some recommendations. However, the document
you mention states:

  If the upstream does not create tarballs for releases,
  you can use this mechanism to produce them

But upstream does create the tarball... [4]. Just saying ;-).

 
 * Is there simple way to change rules that determine what is acceptable
   password?
   * E.g. various character classes reminded me
 there are other ways to make good password :-). [3]
 
 [3] = Nice :) I couldn't imagine that yet...
 Yesterday the maintainer of that project also opened an issue:
 https://github.com/ablanco/jquery.pwstrength.bootstrap/issues/14
 which points exactly to that illustration, so maybe soon there'll be
 support for that.
 
 
 --
 --
 Mit freundlichen Grüßen,
 Maximilian Meister
 Systems Management Department
 
 SUSE LINUX Products GmbH
 Maxfeldstr. 5
 D-90409 Nuremberg, Germany
 
 http://www.suse.com
 
 GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer, HRB 21284 (AG Nuremberg)
 
 ___
 Spacewalk-devel mailing list
 Spacewalk-devel@redhat.com
 https://www.redhat.com/mailman/listinfo/spacewalk-devel

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

Re: [Spacewalk-devel] [PATCH] Adding a password strength meter to spacewalk

2014-01-28 Thread Matej Kollar
Pushed as series of patches ending last of which is 
201b52db45f9c7f10b159bbbcb8d41b1b9fc6f2d.
--
Matej Kollar
Satellite Engineering, Red Hat

- Original Message -
 From: Maximilian Meister mmeis...@suse.de
 To: spacewalk-devel@redhat.com
 Sent: Tuesday, January 28, 2014 11:45:14 AM
 Subject: Re: [Spacewalk-devel] [PATCH] Adding a password strength meter to 
 spacewalk
 
 On 01/24/2014 12:29 PM, Matej Kollar wrote:
 
 Hi everybody,
 
 here you can find the new patch with the following changes:
 
  Hi Maximilian.
 
  I see you have made some nice work there but there are still few things
  that need to be fixed.
 
 * Warning pop-up.
   * Could it be moved to the right or bottom of the filed?
   * It also blinks/flickers on change, is there a way to stop it?
 
 * Colored progress bar/strength meter.
   * It is connected with the password field in very strange way
   (visually).
 Would it be possible to change it as per Michael's suggestion
 to look like [1] or [2]? Personally I would prefer second option.
 
 * progress bar now has its own named column
 
 
 * Spec
   * `jquery.pwstrength.bootstrap` is not good name for package. I
   suggest
 `pwstrength-bootstrap` (the .spec is called such anyway).
 
 * package name == filename
 
   * `Source0` is defined in a bit complicated way. Using
 [4] would not only be sufficient but will make it clearer and
 easier to understand.
 
 Source0 is now readable :) as in [4]
 
 
 * Is there simple way to change rules that determine what is acceptable
   password?
   * E.g. various character classes reminded me
 there are other ways to make good password :-). [3]
 
  Thanks for the effort invested and keep up good work :-).
 
  [1]
  http://www.jqueryscript.net/demo/Simple-jQuery-Password-Strength-Indicator-Plugin-passMeter/
  [2]
  http://cdn1.freshdesignweb.com/wp-content/uploads/2011/09/jquery-password-strength-meter-005.jpg
  [3] http://xkcd.com/936/
  [4]
  https://github.com/ablanco/jquery.pwstrength.bootstrap/archive/1.0.2.tar.gz
 
 
 
 please check it out, and tell me if I missed something.
 
 Thank you
 Maximilian
 
 --
 --
 Mit freundlichen Grüßen,
 Maximilian Meister
 Systems Management Department
 
 SUSE LINUX Products GmbH
 Maxfeldstr. 5
 D-90409 Nuremberg, Germany
 
 http://www.suse.com
 
 GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer, HRB 21284 (AG Nuremberg)
 
 
 ___
 Spacewalk-devel mailing list
 Spacewalk-devel@redhat.com
 https://www.redhat.com/mailman/listinfo/spacewalk-devel

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

[Spacewalk-devel] [PATCH] Adding a password placeholder check when editing a user.

2014-01-28 Thread Maximilian Meister

Hi,

after the password strength meter went through, I have another enhancement
related to the password field.
On the edit user page, there are placeholders in the password fields.
The placeholders are plain *'s, so if I add some characters after the 
placeholder
like [**newchars] my new password will contain the placeholder 
instead

of my expectation [oldpassnewchars].
That could lead to locking out of a user.

This patch makes sure that you can't lock yourself out accidentally like 
this.



--
--
Mit freundlichen Grüßen,
Maximilian Meister
Systems Management Department

SUSE LINUX Products GmbH
Maxfeldstr. 5
D-90409 Nuremberg, Germany

http://www.suse.com

GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer, HRB 21284 (AG Nuremberg)

From ac8d7ce0ab1e5319ce822a76557c5097ba24f148 Mon Sep 17 00:00:00 2001
From: Maximilian Meister mmeis...@suse.de
Date: Tue, 28 Jan 2014 14:54:37 +0100
Subject: [PATCH] add placeholder check to not accidentally submit the
 placeholder or parts of it as a password

---
 .../fragments/user/edit_user_table_rows.jspf   |  1 +
 web/html/javascript/spacewalk-placeholder-check.js | 29 ++
 2 files changed, 30 insertions(+)
 create mode 100644 web/html/javascript/spacewalk-placeholder-check.js

diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/user/edit_user_table_rows.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/user/edit_user_table_rows.jspf
index e00b70b..51a3581 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/user/edit_user_table_rows.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/user/edit_user_table_rows.jspf
@@ -44,6 +44,7 @@
 /c:if
 /rhn:require
 
+script type=text/javascript src=/javascript/spacewalk-placeholder-check.js/script
 div class=form-group
 label class=col-lg-3 control-labelbean:message key=password.displayname//label
 div class=col-lg-6
diff --git a/web/html/javascript/spacewalk-placeholder-check.js b/web/html/javascript/spacewalk-placeholder-check.js
new file mode 100644
index 000..d63486e
--- /dev/null
+++ b/web/html/javascript/spacewalk-placeholder-check.js
@@ -0,0 +1,29 @@
+// make sure not to submit the placeholder (or parts of it) as a password when editing a user
+$(document).ready(function () {
+// Return true if all password fields are empty
+function isPasswordFieldsEmpty() {
+var empty = true;
+$('input:password').each(function(index) {
+if ($(this).val() != '') {
+empty = false;
+return false;
+}
+});
+return empty;
+}
+
+// PLACEHOLDER needs to be in sync with PLACEHOLDER_PASSWORD
+// in the UserActionHelper Java class.
+var PLACEHOLDER = **;
+$('input:password').focus(function() {
+if ($(this).val() == PLACEHOLDER) {
+$('input:password').val('');
+updateTickIcon();
+}
+}).blur(function() {
+if (isPasswordFieldsEmpty()) {
+$('input:password').val(PLACEHOLDER);
+updateTickIcon();
+}
+});
+});
-- 
1.8.4

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

Re: [Spacewalk-devel] Action scheduling on ported pages

2014-01-28 Thread Bo Maryniuk
On Tue, Jan 28, 2014 at 06:57:25AM -0500, Jan Dobes wrote:
 Nevermind, you don't have to fix it. I already corrected your patch and 
 pushed it to master.

Thanks. :)

-- 
Bo Maryniuk

SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg)
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer

His entire job career were upgraded by the company to a shell script.

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