All of lore.kernel.org
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga ./conga.spec.in.in luci/cluster/cluster_ ...
Date: 8 Feb 2008 21:57:00 -0000	[thread overview]
Message-ID: <20080208215700.29466.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2008-02-08 21:56:56

Modified files:
	.              : conga.spec.in.in 
	luci/cluster   : cluster_config-macros cluster_svc-macros 
	                 form-chooser form-macros index_html 
	                 system_svc-macros 
	luci/homebase  : form-macros index_html 
	luci/site/luci/Extensions: LuciZope.py LuciZopeAsync.py 
	                           LuciZopeExternal.py 
	                           conga_constants.py 
	luci/site/luci/var: Data.fs 
	luci/storage   : index_html 
Added files:
	luci/plone-custom: manage_inactive.js 

Log message:
	- Fix bz429151 ([RFE] Luci: increase min password length to 6 characters)
	- Fix bz429152 ([RFE] add inactivity timeout)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.67&r2=1.45.2.68
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_config-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.1&r2=1.3.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_svc-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.1&r2=1.3.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-chooser.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.12.2.7&r2=1.12.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.90.2.33&r2=1.90.2.34
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/index_html.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20.2.14&r2=1.20.2.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/system_svc-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.1&r2=1.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.44.2.13&r2=1.44.2.14
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/index_html.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.18.2.6&r2=1.18.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/manage_inactive.js.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZope.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.5&r2=1.1.4.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeAsync.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.4&r2=1.1.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeExternal.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.3&r2=1.1.4.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.19.2.15&r2=1.19.2.16
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/var/Data.fs.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.15.2.28&r2=1.15.2.29
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/index_html.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.5&r2=1.7.2.6

--- conga/conga.spec.in.in	2008/02/07 06:52:55	1.45.2.67
+++ conga/conga.spec.in.in	2008/02/08 21:56:33	1.45.2.68
@@ -292,6 +292,10 @@
 
 ###  changelog ###
 %changelog
+* Fri Feb 08 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-4
+- Fix bz429151 ([RFE] Luci: increase min password length to 6 characters)
+- Fix bz429152 ([RFE] add inactivity timeout)
+
 * Wed Feb 06 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-3
 - Fix bz431105 (IP Address Resource configuration: cannot enter fully qualified hostname)
 
--- conga/luci/cluster/cluster_config-macros	2008/01/23 04:44:30	1.3.2.1
+++ conga/luci/cluster/cluster_config-macros	2008/02/08 21:56:33	1.3.2.2
@@ -22,9 +22,6 @@
 		var cur_label_elem = null;
 	</script>
 	<script type="text/javascript"
-		src="conga_ajax.js">
-	</script>
-	<script type="text/javascript"
 		src="validate_xvm_key.js">
 	</script>
 
--- conga/luci/cluster/cluster_svc-macros	2008/01/23 04:44:30	1.3.2.1
+++ conga/luci/cluster/cluster_svc-macros	2008/02/08 21:56:33	1.3.2.2
@@ -623,7 +623,6 @@
 	<script type="text/javascript"
 		src="/luci/homebase/homebase_common.js">
 	</script>
-	<script type="text/javascript" src="conga_ajax.js"></script>
 	<script type="text/javascript"
 		src="/luci/cluster/resource_form_handlers.js">
 	</script>
--- conga/luci/cluster/form-chooser	2008/01/23 04:44:30	1.12.2.7
+++ conga/luci/cluster/form-chooser	2008/02/08 21:56:33	1.12.2.8
@@ -229,6 +229,14 @@
 	<tal:block tal:condition="python: ptype == '1002'">
 		<div metal:use-macro="here/form-macros/macros/get-system-info-form" />
 	</tal:block>
+
+	<tal:block tal:condition="python: ptype == '1010'">
+		<div metal:use-macro="here/form-macros/macros/check-inactive-form" />
+	</tal:block>
+
+	<tal:block tal:condition="python: ptype == '1011'">
+		<div metal:use-macro="here/form-macros/macros/update-inactive-form" />
+	</tal:block>
 </tal:block>
 </metal:choose-form>
 
--- conga/luci/cluster/form-macros	2008/01/25 17:18:37	1.90.2.33
+++ conga/luci/cluster/form-macros	2008/02/08 21:56:33	1.90.2.34
@@ -156,7 +156,6 @@
 	<script type="text/javascript" src="/luci/homebase/homebase_common.js"></script>
 	<script type="text/javascript" src="/luci/homebase/validate_cluster_add.js"></script>
 	<script type="text/javascript" src="validate_create_gulm.js"></script>
-	<script type="text/javascript" src="conga_ajax.js"></script>
 	<script type="text/javascript" src="update_hostinfo.js"></script>
 	
 	<script type="text/javascript">
@@ -1075,7 +1074,6 @@
 	</script>
 	<script type="text/javascript" src="/luci/homebase/validate_cluster_add.js">
 	</script>
-	<script type="text/javascript" src="conga_ajax.js"></script>
 	<script type="text/javascript" src="update_hostinfo.js"></script>
 
 	<form name="add_node" action="" method="post"
@@ -1324,5 +1322,14 @@
 	<tal:block tal:define="ret python: here.get_sysinfo_async(request)" />
 </div>
 
+<div metal:define-macro="check-inactive-form">
+	<tal:block tal:define="ret python: here.check_inactive_async(request)" />
+</div>
+
+<div metal:define-macro="update-inactive-form">
+	<tal:block tal:define="ret python: here.update_inactive_async(request)" />
+</div>
+
+
 </body>
 </html>
--- conga/luci/cluster/index_html	2008/01/23 04:44:30	1.20.2.14
+++ conga/luci/cluster/index_html	2008/02/08 21:56:33	1.20.2.15
@@ -58,17 +58,10 @@
     </metal:headslot>
 
     <metal:cssslot fill-slot="css_slot">
-		<style type="text/css">
-			<!-- @import url(clusterportlet.css); -->
-		</style>
-		<style type="text/css">
-			<!-- @import url(luci.css); -->
-		</style>
 		<metal:cssslot define-slot="css_slot" />
     </metal:cssslot>
 
     <metal:javascriptslot fill-slot="javascript_head_slot">
-		<script type="text/javascript" src="/luci/conga.js"></script>
       <SCRIPT TYPE="text/javascript">
       <!--
        function dropdown(mySel)
--- conga/luci/cluster/system_svc-macros	2008/01/23 04:44:30	1.2.2.1
+++ conga/luci/cluster/system_svc-macros	2008/02/08 21:56:33	1.2.2.2
@@ -17,9 +17,6 @@
 
 <div metal:define-macro="system-svc-form">
 	<script type="text/javascript"
-		src="conga_ajax.js">
-	</script>
-	<script type="text/javascript"
 		src="/luci/cluster/validate_sys_svc.js">
 	</script>
 	<h2>Configure System Services</h2>
--- conga/luci/homebase/form-macros	2008/02/07 06:52:56	1.44.2.13
+++ conga/luci/homebase/form-macros	2008/02/08 21:56:33	1.44.2.14
@@ -289,7 +289,6 @@
 					-> if yes, confirm again, showing list
 	</tal:comment>
 
-	<script type="text/javascript" src="conga_ajax.js"></script>
 	<script type="text/javascript" src="update_hostinfo.js"></script>
 	<script type="text/javascript" src="validate_auth.js"></script>
 	<script type="text/javascript" src="/luci/homebase/validate_sys_remove.js">
@@ -612,7 +611,6 @@
 
 	<script type="text/javascript" src="/luci/homebase/validate_sys_add.js">
 	</script>
-	<script type="text/javascript" src="conga_ajax.js"></script>
 	<script type="text/javascript" src="update_hostinfo.js"></script>
 
 	<script type="text/javascript">
@@ -940,7 +938,6 @@
 			- At least one node name/password are given and are valid
 	</tal:comment>
 
-	<script type="text/javascript" src="conga_ajax.js"></script>
 	<script type="text/javascript" src="update_hostinfo.js"></script>
 	<script type="text/javascript" src="/luci/homebase/validate_cluster_add_initial.js">
 	</script>
--- conga/luci/homebase/index_html	2008/01/23 04:44:31	1.18.2.6
+++ conga/luci/homebase/index_html	2008/02/08 21:56:33	1.18.2.7
@@ -34,20 +34,12 @@
 	</metal:headslot>
 
 	<metal:cssslot fill-slot="css_slot">
-		<style type="text/css">
-			<!-- @import url(clusterportlet.css); -->
-		</style>
-
-		<style type="text/css">
-			<!-- @import url(luci.css); -->
-		</style>
 		<tal:block
 			tal:define="global data python:here.homebaseControl(request)" />
 		<metal:cssslot define-slot="css_slot" />
 	</metal:cssslot>
 
 	<metal:javascriptslot fill-slot="javascript_head_slot">
-		<script type="text/javascript" src="/luci/conga.js"></script>
 		<script type="text/javascript"
 			src="/luci/homebase/homebase_common.js">
 		</script>
/cvs/cluster/conga/luci/plone-custom/manage_inactive.js,v  -->  standard output
revision 1.1.2.1
--- conga/luci/plone-custom/manage_inactive.js
+++ -	2008-02-08 21:56:58.251531000 +0000
@@ -0,0 +1,84 @@
+/*
+** Copyright (C) 2008 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+*/
+
+var update_activity_url = '/luci/cluster?pagetype=1011';
+var check_inactive_url = '/luci/cluster?pagetype=1010';
+var pending_events = 0;
+
+function activity_event_handler() {
+	++pending_events;
+}
+
+function update_activity_check(ret_status, obj) {
+	/* Doesn't matter what comes back */
+	return;
+}
+
+function check_inactive_check(ret_status, obj) {
+	if (ret_status === null) {
+		return;
+	}
+
+	if (ret_status !== true) {
+		/* A communication error occurred. */
+		return;
+	}
+
+	var err = get_ricci_response_status(obj.responseXML);
+	if (err !== null && err.length > 0) {
+		alert(err.join('\n'));
+		return;
+	}
+
+	try {
+		obj = obj.responseXML.getElementsByTagName('dict')[0];
+	} catch (e) {
+		alert('Received a malformed response from the luci server.');
+		return;
+	}
+
+	var var_elem = obj.getElementsByTagName('var');
+	for (var i = 0 ; i < var_elem.length ; i++) {
+		if (var_elem[i].getAttribute('name') == 'inactive') {
+			if (var_elem[i].getAttribute('value') != 'False') {
+				window.location.assign('/luci/logout');
+				alert('You have been logged out due to inactivity.');
+			}
+		}
+	}
+}
+
+function update_activity_callback() {
+	return check_ajax_xml(xmlHttp_object, update_activity_check);
+}
+
+function check_inactive_callback() {
+	return check_ajax_xml(xmlHttp_object, check_inactive_check);
+}
+
+function update_last_active() {
+	if (pending_events < 1) {
+		return (false);
+	}
+	initiate_async_get(update_activity_url, update_activity_callback);
+	pending_events = 0;
+	return (true);
+}
+
+function check_user_inactive() {
+	if (update_last_active() === true) {
+		return (0);
+	}
+	return (initiate_async_get(check_inactive_url, check_inactive_callback));
+}
+
+setInterval("update_last_active()", 1000 * 30);
+setInterval("check_user_inactive()", 1000 * 60);
+window.onmousemove = new Function('activity_event_handler()');
+window.onkeypress = new Function('activity_event_handler()');
--- conga/luci/site/luci/Extensions/LuciZope.py	2008/01/23 04:44:32	1.1.4.5
+++ conga/luci/site/luci/Extensions/LuciZope.py	2008/02/08 21:56:33	1.1.4.6
@@ -82,6 +82,8 @@
 	if not userAuthenticated(self):
 		return []
 
+	enforce_inactivity_timeout(self, req)
+
 	htab = {
 		'Title': 'homebase',
 		'Description': 'Home base for this luci server',
@@ -163,4 +165,42 @@
 
 	return '/luci/cluster/index_html?pagetype=7&clustername=%s' % clustername
 
+def user_update_inactive(self, request):
+	from time import time
+	if userAuthenticated(self):
+		request.SESSION.set('last_activity', int(time()))
+
+def user_check_inactive(self, request):
+	from time import time
+	from conga_constants import INACTIVITY_TIMEOUT_SEC as INACTIVITY_TIMEOUT
+
+	if not userAuthenticated(self):
+		return (False, -1)
 
+	cur_time = int(time())
+	old_time = request.SESSION.get('last_activity', None)
+	if old_time is None:
+		request.SESSION.set('last_activity', cur_time)
+		return (False, -2)
+	old_time = int(old_time)
+
+	time_diff = cur_time - old_time
+	if time_diff >= INACTIVITY_TIMEOUT:
+		return (True, time_diff)
+	return (False, time_diff)
+
+def enforce_inactivity_timeout(self, request):
+	from time import time
+	pagetype = request.get('pagetype')
+	if pagetype != '1010' and pagetype != '1011':
+		(ret, dummy) = user_check_inactive(self, request)
+		if ret is True:
+			try:
+				request.SESSION.getBrowserIdManager().flushBrowserIdCookie()
+				request.SESSION.invalidate()
+			except Exception, e:
+				if LUCI_DEBUG_MODE is True:
+					luci_log.debug_verbose('UCI0: %r %s' % (e, str(e)))
+			request.RESPONSE.redirect('/luci/logout')
+		else:
+			request.SESSION.set('last_activity', int(time()))
--- conga/luci/site/luci/Extensions/LuciZopeAsync.py	2008/02/07 06:52:56	1.1.2.4
+++ conga/luci/site/luci/Extensions/LuciZopeAsync.py	2008/02/08 21:56:33	1.1.2.5
@@ -169,6 +169,18 @@
 	xml_obj = result_to_xml((len(errors) < len(node_list), ret))
 	write_xml_resp(request, xml_obj)
 
+def check_inactive_async(self, request):
+	from LuciZope import user_check_inactive
+	(inactive, diff) = user_check_inactive(self, request)
+	xml_obj = result_to_xml((True, { 'inactive': inactive, 'diff': diff }))
+	write_xml_resp(request, xml_obj)
+
+def update_inactive_async(self, request):
+	from LuciZope import user_update_inactive
+	user_update_inactive(self, request)
+	xml_obj = result_to_xml((True, { 'result': True }))
+	write_xml_resp(request, xml_obj)
+
 def get_sysinfo_async(self, request):
 	from HelperFunctions import get_system_info
 
--- conga/luci/site/luci/Extensions/LuciZopeExternal.py	2008/01/23 04:44:32	1.1.4.3
+++ conga/luci/site/luci/Extensions/LuciZopeExternal.py	2008/02/08 21:56:33	1.1.4.4
@@ -55,4 +55,4 @@
 from system_adapters import get_sys_svc_list, validate_manage_svc
 
 from LuciZopeAsync import get_cluster_nodes_async, get_sysinfo_async, \
-	validate_clusvc_async
+	validate_clusvc_async, check_inactive_async, update_inactive_async
--- conga/luci/site/luci/Extensions/conga_constants.py	2008/01/23 04:44:32	1.19.2.15
+++ conga/luci/site/luci/Extensions/conga_constants.py	2008/02/08 21:56:33	1.19.2.16
@@ -147,6 +147,9 @@
 
 REDIRECT_MSG = ' -- You will be redirected in %d seconds.' % REDIRECT_SEC
 
+# Log users out after 10 minutes of inactivity.
+
+INACTIVITY_TIMEOUT_SEC = 600
 
 # Debugging parameters. Set LUCI_DEBUG_MODE to True and LUCI_DEBUG_VERBOSITY
 # to >= 2 to get full debugging output in syslog (LOG_DAEMON/LOG_DEBUG).
Binary files /cvs/cluster/conga/luci/site/luci/var/Data.fs	2008/02/07 06:52:56	1.15.2.28 and /cvs/cluster/conga/luci/site/luci/var/Data.fs	2008/02/08 21:56:33	1.15.2.29 differ
rcsdiff: /cvs/cluster/conga/luci/site/luci/var/Data.fs: diff failed
--- conga/luci/storage/index_html	2008/01/23 04:44:56	1.7.2.5
+++ conga/luci/storage/index_html	2008/02/08 21:56:56	1.7.2.6
@@ -36,7 +36,6 @@
 	<metal:javascriptslot fill-slot="javascript_head_slot">
 		<metal:javascriptslot define-slot="javascript_head_slot">
 			<!-- async helper functions -->
-			<script type="text/javascript" src="conga.js"></script>
 			<script type="text/javascript" src="storage_async.js"></script>
 		</metal:javascriptslot>
 	</metal:javascriptslot>



             reply	other threads:[~2008-02-08 21:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 21:57 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-02-27 20:22 [Cluster-devel] conga ./conga.spec.in.in luci/cluster/cluster_ rmccabe
2008-03-12 15:13 rmccabe
2008-07-14 21:52 rmccabe
2008-08-07 18:08 rmccabe
2008-09-18 15:20 rmccabe
2009-02-16 17:23 rmccabe
2009-03-24 20:06 rmccabe
2009-04-15 16:07 rmccabe
2009-04-27 21:03 rmccabe
2009-05-14 21:05 rmccabe
2009-05-21 13:33 rmccabe
2010-09-29 17:08 rmccabe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080208215700.29466.qmail@sourceware.org \
    --to=rmccabe@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.