conga/luci load_site.py plone-custom/join_form ...
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-09-19 15:01:21
Modified files:
luci : load_site.py
Added files:
luci/plone-custom: join_form_validate.vpy logged_in.vpy
login_form_validate.vpy login_next.vpy
Log message:
add python form validator controls for login
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/load_site.py.diff?cvsroot=cluster&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/join_form_validate.vpy.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/logged_in.vpy.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/login_form_validate.vpy.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/login_next.vpy.diff?cvsroot=cluster&r1=NONE&r2=1.1
luci/load_site.py +24 -1
@@ -1,5 +1,5 @@ #!/usr/bin/python -# $Id: load_site.py,v 1.13 2006/09/18 21:23:45 rmccabe Exp $ +# $Id: load_site.py,v 1.14 2006/09/19 15:01:20 rmccabe Exp $ ############################################################################## #
@@ -163,6 +163,29 @@ def upload_js(object, f): upload_txt(object, f, t='text/javascript') +def upload_vpy(object, f): + dir, name = os.path.split(f) + + nobject = object.__class__(object.url+'/manage_addProduct/CMFFormController', + username=object.username, + password=object.password) + + dbid = name.split('.')[0] + + try: + call(nobject.manage_addControllerPythonScript, id=dbid, file=open(f,'rb')) + if verbose: print 'Uploaded', dbid + except: + if verbose: print name, 'exists trying to delete then upload again' + try: + call(object.manage_delObjects, ids=[dbid]) + if verbose: print 'Deleted', dbid + try: + call(nobject.manage_addControllerPythonScript, id=dbid, file=open(f,'rb')) + if verbose: print 'Uploaded', dbid + except: print 'Unable to upload', dbid + except: print 'Unable to delete', dbid + def upload_cpt(object, f): dir, name = os.path.split(f)
/cvs/cluster/conga/luci/plone-custom/join_form_validate.vpy,v --> standard output revision 1.1
- renamed from luci/plone-custom/join_form_validate.vpy +13 -0
@@ -0,0 +1,13 @@ +## Controller Validator "join_form_validate" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##parameters=username='',email='',password='',password_confirm='' +##title=validates the Registration of a User +## +from Products.CMFPlone import PloneMessageFactory as _ + +return state.set(status='failure_page')
/cvs/cluster/conga/luci/plone-custom/logged_in.vpy,v --> standard output revision 1.1
- renamed from luci/plone-custom/logged_in.vpy +39 -0
@@ -0,0 +1,39 @@ +## Controller Python Script "logged_in" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##parameters= +##title=Initial post-login actions +## +from Products.CMFPlone import PloneMessageFactory as _ +REQUEST=context.REQUEST + +# If someone has something on their clipboard, expire it. +if REQUEST.get('__cp', None) is not None: + REQUEST.RESPONSE.expireCookie('__cp', path='/') + +membership_tool=context.portal_membership +if membership_tool.isAnonymousUser(): + REQUEST.RESPONSE.expireCookie('__ac', path='/') + return state.set(status='failure') + +member = membership_tool.getAuthenticatedMember() +login_time = member.getProperty('login_time', '2000/01/01') +initial_login = int(str(login_time) == '2000/01/01') +state.set(initial_login=initial_login) + +must_change_password = member.getProperty('must_change_password', 0) +state.set(must_change_password=must_change_password) + +if initial_login: + state.set(status='initial_login') +elif must_change_password: + state.set(status='change_password') + +membership_tool.setLoginTimes() +membership_tool.createMemberArea() + +return state
/cvs/cluster/conga/luci/plone-custom/login_form_validate.vpy,v --> standard output revision 1.1
- renamed from luci/plone-custom/login_form_validate.vpy +52 -0
52 lines not on this page · raw message
/cvs/cluster/conga/luci/plone-custom/login_next.vpy,v --> standard output revision 1.1
- renamed from luci/plone-custom/login_next.vpy +59 -0
59 lines not on this page · raw message