Skip to contentSkip to conversation

conga ./conga.spec.in.in luci/cluster/cluster_ ...

Cluster-devel [email protected] 1 participant 1 message Feb 8, 2008

lore
Share & tools
lore
#0 lore 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.spec.in.in +4 -0
@@ -292,6 +292,10 @@
 
 ###  changelog ###
 %changelog
+* Fri Feb 08 2008 Ryan McCabe <[email protected]> 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 <[email protected]> 0.12.0-3
 - Fix bz431105 (IP Address Resource configuration: cannot enter fully qualified hostname)
 
luci/cluster/cluster_config-macros +0 -3
@@ -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>
 
luci/cluster/cluster_svc-macros +0 -1
@@ -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>
luci/cluster/form-chooser +8 -0
@@ -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>
 
luci/cluster/form-macros +9 -2
@@ -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>
luci/cluster/index_html +0 -7
@@ -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)
luci/cluster/system_svc-macros +0 -3
@@ -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>
luci/homebase/form-macros +0 -3
@@ -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>
luci/homebase/index_html +0 -8
@@ -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

- renamed from luci/plone-custom/manage_inactive.js +84 -0

84 lines not on this page · raw message

luci/site/luci/Extensions/LuciZope.py +40 -0
@@ -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()))
luci/site/luci/Extensions/LuciZopeAsync.py +12 -0
@@ -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
 
luci/site/luci/Extensions/LuciZopeExternal.py +1 -1
@@ -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
luci/site/luci/Extensions/conga_constants.py +3 -0
@@ -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

luci/storage/index_html +0 -1
@@ -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>