conga/luci cluster/cluster_config-macros clust ...
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2008-02-08 21:48:12
Modified files:
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: LuciValidation.py 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:
Fixes for 429151 and 429152
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_config-macros.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_svc-macros.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-chooser.diff?cvsroot=cluster&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.221&r2=1.222
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/index_html.diff?cvsroot=cluster&r1=1.41&r2=1.42
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/system_svc-macros.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.66&r2=1.67
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/index_html.diff?cvsroot=cluster&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/manage_inactive.js.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciValidation.py.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZope.py.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeAsync.py.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeExternal.py.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&r1=1.48&r2=1.49
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/var/Data.fs.diff?cvsroot=cluster&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/index_html.diff?cvsroot=cluster&r1=1.14&r2=1.15
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
- renamed from luci/plone-custom/manage_inactive.js +84 -0
84 lines not on this page · raw message
luci/site/luci/Extensions/LuciValidation.py +0 -1
@@ -8,7 +8,6 @@ from ClusterModel.RefObject import RefObject from ClusterModel.Service import Service from ClusterModel.Method import Method -from ClusterModel.Fence import Fence from ClusterModel.FailoverDomain import FailoverDomain from ClusterModel.FailoverDomainNode import FailoverDomainNode from ClusterModel.QuorumD import QuorumD
luci/site/luci/Extensions/LuciZope.py +27 -11
@@ -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,28 +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 + 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 + return (False, -2) old_time = int(old_time) time_diff = cur_time - old_time if time_diff >= INACTIVITY_TIMEOUT: - 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', cur_time) + 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 +2 -2
@@ -35,7 +35,7 @@ from LuciZope import appendModel, bytes_to_value_prefunits, \ set_persistent_var, strFilter, getTabs, siteIsSetup, \ - getClusterURL, user_check_inactive + getClusterURL from LuciZopeClusterPortal import createCluChooser, createCluConfigTree
@@ -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 -1
@@ -136,7 +136,6 @@ ] REDIRECT_SEC = 5 -INACTIVITY_TIMEOUT_SEC = 600 # cluster/node create error status messages PRE_INSTALL = 'The install state is not yet complete.'
@@ -148,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/06 21:23:52 1.30 and /cvs/cluster/conga/luci/site/luci/var/Data.fs 2008/02/08 21:47:56 1.31 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>