Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs-appstore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
officejs-appstore
Commits
5f903703
Commit
5f903703
authored
Sep 14, 2018
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Plain Diff
Appstore update
/reviewed-on
!5
parents
ced0603a
4a97693c
Changes
43
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
3095 additions
and
2 deletions
+3095
-2
bt5/officejs_credential/PathTemplateItem/notification_message_module/ojs_credential_request-subscription.xml
...on_message_module/ojs_credential_request-subscription.xml
+665
-0
bt5/officejs_credential/PathTemplateItem/portal_preferences/officejs_system_preference.xml
...ateItem/portal_preferences/officejs_system_preference.xml
+279
-0
bt5/officejs_credential/RegisteredSkinSelectionTemplateItem/registered_skin_selection.xml
...edSkinSelectionTemplateItem/registered_skin_selection.xml
+6
-0
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential.xml
...ial/SkinTemplateItem/portal_skins/officejs_credential.xml
+47
-0
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/ERP5Site_activeLogin.py
.../portal_skins/officejs_credential/ERP5Site_activeLogin.py
+20
-0
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/ERP5Site_activeLogin.xml
...portal_skins/officejs_credential/ERP5Site_activeLogin.xml
+70
-0
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/WebSection_newCredentialRequest.py
...ns/officejs_credential/WebSection_newCredentialRequest.py
+78
-0
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/WebSection_newCredentialRequest.xml
...s/officejs_credential/WebSection_newCredentialRequest.xml
+62
-0
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/WebSite_login.py
...ateItem/portal_skins/officejs_credential/WebSite_login.py
+57
-0
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/WebSite_login.xml
...teItem/portal_skins/officejs_credential/WebSite_login.xml
+62
-0
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/join_form.xml
...mplateItem/portal_skins/officejs_credential/join_form.xml
+58
-0
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/join_form.zpt
...mplateItem/portal_skins/officejs_credential/join_form.zpt
+64
-0
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/login_form.xml
...plateItem/portal_skins/officejs_credential/login_form.xml
+58
-0
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/login_form.zpt
...plateItem/portal_skins/officejs_credential/login_form.zpt
+73
-0
bt5/officejs_credential/bt/dependency_list
bt5/officejs_credential/bt/dependency_list
+2
-0
bt5/officejs_credential/bt/description
bt5/officejs_credential/bt/description
+1
-0
bt5/officejs_credential/bt/template_format_version
bt5/officejs_credential/bt/template_format_version
+1
-0
bt5/officejs_credential/bt/template_keep_workflow_path_list
bt5/officejs_credential/bt/template_keep_workflow_path_list
+2
-0
bt5/officejs_credential/bt/template_path_list
bt5/officejs_credential/bt/template_path_list
+2
-0
bt5/officejs_credential/bt/template_registered_skin_selection_list
...ejs_credential/bt/template_registered_skin_selection_list
+1
-0
bt5/officejs_credential/bt/template_skin_id_list
bt5/officejs_credential/bt/template_skin_id_list
+1
-0
bt5/officejs_credential/bt/title
bt5/officejs_credential/bt/title
+1
-0
bt5/officejs_test/PathTemplateItem/portal_tests/officejs_appstore_ui_zuite.xml
...hTemplateItem/portal_tests/officejs_appstore_ui_zuite.xml
+26
-0
bt5/officejs_test/PathTemplateItem/portal_tests/officejs_appstore_ui_zuite/testOfficeJSAppstoreRegisterAndLogin.xml
...ppstore_ui_zuite/testOfficeJSAppstoreRegisterAndLogin.xml
+58
-0
bt5/officejs_test/PathTemplateItem/portal_tests/officejs_appstore_ui_zuite/testOfficeJSAppstoreRegisterAndLogin.zpt
...ppstore_ui_zuite/testOfficeJSAppstoreRegisterAndLogin.zpt
+137
-0
bt5/officejs_test/PathTemplateItem/portal_tests/officejs_appstore_ui_zuite/testOfficeJSAppstoreRegisterFail.xml
...js_appstore_ui_zuite/testOfficeJSAppstoreRegisterFail.xml
+58
-0
bt5/officejs_test/PathTemplateItem/portal_tests/officejs_appstore_ui_zuite/testOfficeJSAppstoreRegisterFail.zpt
...js_appstore_ui_zuite/testOfficeJSAppstoreRegisterFail.zpt
+153
-0
bt5/officejs_test/SkinTemplateItem/portal_skins/officejs_test.xml
...cejs_test/SkinTemplateItem/portal_skins/officejs_test.xml
+26
-0
bt5/officejs_test/SkinTemplateItem/portal_skins/officejs_test/ERP5Site_createTestUserList.py
...portal_skins/officejs_test/ERP5Site_createTestUserList.py
+7
-0
bt5/officejs_test/SkinTemplateItem/portal_skins/officejs_test/ERP5Site_createTestUserList.xml
...ortal_skins/officejs_test/ERP5Site_createTestUserList.xml
+62
-0
bt5/officejs_test/SkinTemplateItem/portal_skins/officejs_test/ERP5Site_removeTestUserList.py
...portal_skins/officejs_test/ERP5Site_removeTestUserList.py
+13
-0
bt5/officejs_test/SkinTemplateItem/portal_skins/officejs_test/ERP5Site_removeTestUserList.xml
...ortal_skins/officejs_test/ERP5Site_removeTestUserList.xml
+62
-0
bt5/officejs_test/SkinTemplateItem/portal_skins/officejs_test/Zuite_CommonTemplateForOfficejsAppstoreUi.xml
...ficejs_test/Zuite_CommonTemplateForOfficejsAppstoreUi.xml
+58
-0
bt5/officejs_test/SkinTemplateItem/portal_skins/officejs_test/Zuite_CommonTemplateForOfficejsAppstoreUi.zpt
...ficejs_test/Zuite_CommonTemplateForOfficejsAppstoreUi.zpt
+168
-0
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testFunctionalOfficeJSAppstoreUI.py
..._components/test.erp5.testFunctionalOfficeJSAppstoreUI.py
+56
-0
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testFunctionalOfficeJSAppstoreUI.xml
...components/test.erp5.testFunctionalOfficeJSAppstoreUI.xml
+123
-0
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenarioRjsUI.py
.../portal_components/test.erp5.testOfficeJSScenarioRjsUI.py
+340
-0
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenarioRjsUI.xml
...portal_components/test.erp5.testOfficeJSScenarioRjsUI.xml
+128
-0
bt5/officejs_test/bt/dependency_list
bt5/officejs_test/bt/dependency_list
+3
-1
bt5/officejs_test/bt/template_path_list
bt5/officejs_test/bt/template_path_list
+2
-0
bt5/officejs_test/bt/template_skin_id_list
bt5/officejs_test/bt/template_skin_id_list
+1
-0
bt5/officejs_test/bt/template_test_id_list
bt5/officejs_test/bt/template_test_id_list
+3
-1
test/__init__.py
test/__init__.py
+1
-0
No files found.
bt5/officejs_credential/PathTemplateItem/notification_message_module/ojs_credential_request-subscription.xml
0 → 100644
View file @
5f903703
This diff is collapsed.
Click to expand it.
bt5/officejs_credential/PathTemplateItem/portal_preferences/officejs_system_preference.xml
0 → 100644
View file @
5f903703
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"System Preference"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Authenticated
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Member
</string>
<string>
Owner
</string>
<string>
Reviewer
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Authenticated
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Member
</string>
<string>
Owner
</string>
<string>
Reviewer
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
officejs_system_preference
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
System Preference
</string>
</value>
</item>
<item>
<key>
<string>
preferred_credential_alarm_automatic_call
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
preferred_credential_recovery_automatic_approval
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
preferred_credential_request_automatic_approval
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
preferred_document_conversion_server_url
</string>
</key>
<value>
<tuple>
<string>
https://cloudooo.erp5.net/
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
preferred_subscription_assignment_category
</string>
</key>
<value>
<tuple>
<string>
role/author
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
preferred_system_generate_password
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
OfficeJS System Preference
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
preference_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
969.49393.60016.53896
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1534947704.91
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
global_enable
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
preference_state
</string>
</key>
<value>
<string>
global
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1534944796.77
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/officejs_credential/RegisteredSkinSelectionTemplateItem/registered_skin_selection.xml
0 → 100644
View file @
5f903703
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>
officejs_credential
</skin_folder>
<skin_selection>
RJS
</skin_selection>
</skin_folder_selection>
</registered_skin_selection>
\ No newline at end of file
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential.xml
0 → 100644
View file @
5f903703
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Folder"
module=
"OFS.Folder"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_local_properties
</string>
</key>
<value>
<tuple>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
business_template_skin_layer_priority
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
float
</string>
</value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
business_template_skin_layer_priority
</string>
</key>
<value>
<float>
99.1
</float>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
officejs_credential
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
OfficeJS Credential
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/ERP5Site_activeLogin.py
0 → 100644
View file @
5f903703
from
Products.ERP5Type.Message
import
translateString
REQUEST
=
context
.
REQUEST
RESPONSE
=
REQUEST
.
RESPONSE
portal
=
context
.
getPortalObject
()
assert
key
mail_message
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Mail Message"
,
reference
=
key
)
credential_request
=
mail_message
.
getFollowUpValue
()
if
credential_request
.
getValidationState
()
in
(
'submitted'
,
'accepted'
):
message
=
translateString
(
"Your account is already active."
)
notification_status
=
"error"
else
:
credential_request
.
submit
(
comment
=
translateString
(
'Created by subscription form'
))
mail_message
.
deliver
()
message
=
translateString
(
"Account activation processing, an email will be sent on finish"
)
notification_status
=
"success"
url
=
'%s/login_form?portal_status_message=%s¬ification_status=%s'
%
(
context
.
absolute_url
(),
message
,
notification_status
)
RESPONSE
.
redirect
(
url
)
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/ERP5Site_activeLogin.xml
0 → 100644
View file @
5f903703
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
key
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site_activeLogin
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/WebSection_newCredentialRequest.py
0 → 100644
View file @
5f903703
"""Call by dialog to create a new credential request and redirect to the context
Paramameter list :
reference -- User login is mandatory (String)
default_email_text -- Email is mandatory (String)"""
# create the credential request
portal
=
context
.
getPortalObject
()
module
=
portal
.
getDefaultModule
(
portal_type
=
'Credential Request'
)
portal_preferences
=
portal
.
portal_preferences
category_list
=
portal_preferences
.
getPreferredSubscriptionAssignmentCategoryList
()
if
password
!=
password_confirmation
:
message_str
=
"Password and Confirmation Password must be same"
notification_status
=
"error"
return
context
.
REQUEST
.
RESPONSE
.
redirect
(
context
.
absolute_url
()
+
"/join_form?portal_status_message="
+
context
.
Base_translateString
(
message_str
)
+
'¬ification_status='
+
notification_status
)
if
not
context
.
CredentialRequest_checkLoginAvailability
(
reference
):
message_str
=
"Selected email is already in use, please choose different one."
notification_status
=
"error"
return
context
.
REQUEST
.
RESPONSE
.
redirect
(
context
.
absolute_url
()
+
"/join_form?portal_status_message="
+
context
.
Base_translateString
(
message_str
)
+
'¬ification_status='
+
notification_status
)
credential_request
=
module
.
newContent
(
portal_type
=
"Credential Request"
,
first_name
=
first_name
,
last_name
=
last_name
,
reference
=
reference
,
password
=
password
,
default_credential_question_question
=
default_credential_question_question
,
default_credential_question_question_free_text
=
default_credential_question_question_free_text
,
default_credential_question_answer
=
default_credential_question_answer
,
default_email_text
=
reference
,
default_telephone_text
=
default_telephone_text
,
default_mobile_telephone_text
=
default_mobile_telephone_text
,
default_fax_text
=
default_fax_text
,
default_address_street_address
=
default_address_street_address
,
default_address_city
=
default_address_city
,
default_address_zip_code
=
default_address_zip_code
,
default_address_region
=
default_address_region
,
role_list
=
role_list
,
function
=
function
,
site
=
site
,
activity_list
=
activity_list
,
corporate_name
=
corporate_name
,
date_of_birth
=
date_of_birth
)
credential_request
.
setCategoryList
(
category_list
)
# Same tag is used as in ERP5 Login._setReference, in order to protect against
# concurrency between Credential Request and Person object too
credential_request
.
reindexObject
(
activate_kw
=
dict
(
tag
=
'set_login_%s'
%
reference
.
encode
(
'hex'
)))
if
portal_preferences
.
getPreferredCredentialAlarmAutomaticCall
():
credential_request
.
submit
(
"Automatic submit"
)
message_str
=
"Credential Request Created."
notification_status
=
"success"
else
:
if
portal_preferences
.
isPreferredEmailVerificationCheck
():
# after_path_and_method_id argument is used below to not activate when
# Crededial request object is not indexed yet. This is needed because when
# the method searchAndActivate from catalog is called, if the object is not
# indexed, the e-mail is not sent.
method_id_list
=
(
'immediateReindexObject'
,
'recursiveImmediateReindexObject'
)
path_and_method_id
=
(
credential_request
.
getPath
(),
method_id_list
)
activity_kw
=
dict
(
activity
=
'SQLQueue'
,
after_path_and_method_id
=
path_and_method_id
)
credential_request
.
activate
(
**
activity_kw
).
CredentialRequest_sendSubmittedNotification
(
context_url
=
context
.
absolute_url
(),
notification_reference
=
'ojs_credential_request-subscription'
)
message_str
=
"Thanks for your registration. You will receive an email to activate your account."
notification_status
=
"success"
else
:
# no email verification is needed
credential_request
.
submit
(
"Automatic submit"
)
message_str
=
"Credential Request Created."
notification_status
=
"success"
if
batch_mode
:
return
credential_request
return
context
.
REQUEST
.
RESPONSE
.
redirect
(
context
.
absolute_url
()
+
"/login_form?portal_status_message="
+
context
.
Base_translateString
(
message_str
)
+
"¬ification_status="
+
notification_status
)
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/WebSection_newCredentialRequest.xml
0 → 100644
View file @
5f903703
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
reference, first_name=None, last_name=None, password=None, password_confirmation=None, date_of_birth=None, default_telephone_text=None, default_mobile_telephone_text=None, default_fax_text=None, corporate_name=None, default_credential_question_question=None, default_credential_question_question_free_text=None, default_credential_question_answer=None, role_list=None, function=None, site=None, activity_list=None, default_address_city=None, default_address_street_address=None, default_address_zip_code=None, default_address_region=None, dialog_id=\'\', batch_mode=False, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebSection_newCredentialRequest
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/WebSite_login.py
0 → 100644
View file @
5f903703
import
re
REQUEST
=
context
.
REQUEST
RESPONSE
=
REQUEST
.
RESPONSE
from
ZTUtils
import
make_query
portal
=
context
.
getPortalObject
()
if
(
came_from
is
None
):
#XXX Hardcoded for JS app's url end with '/'
came_from
=
"%s/"
%
context
.
getPermanentURL
(
context
.
getWebSiteValue
())
portal
.
portal_skins
.
updateSkinCookie
()
portal
.
setupCurrentSkin
(
REQUEST
)
if
(
portal
.
portal_membership
.
isAnonymousUser
()):
RESPONSE
.
expireCookie
(
'__ac'
,
path
=
'/'
)
is_user_account_blocked
=
REQUEST
.
get
(
'is_user_account_blocked'
,
False
)
is_user_account_password_expired
=
REQUEST
.
get
(
'is_user_account_password_expired'
,
False
)
if
is_user_account_blocked
:
message
=
context
.
Base_translateString
(
'Account is blocked.'
)
elif
is_user_account_password_expired
:
if
(
portal
.
portal_preferences
.
isPreferredSystemRecoverExpiredPassword
()):
message
=
context
.
Base_translateString
(
'Password is expired. You will soon receive an email with details about how you can recover it.'
)
else
:
message
=
context
.
Base_translateString
(
'Password is expired.'
)
else
:
credential_request
=
portal
.
portal_catalog
(
portal_type
=
"Credential Request"
,
reference
=
REQUEST
.
get
(
'__ac_name'
))
user
=
context
.
getPortalObject
().
portal_membership
.
getAuthenticatedMember
()
context
.
log
(
user
.
getUserValue
())
context
.
log
(
user
.
getLoginValue
())
if
credential_request
and
credential_request
[
0
].
getValidationStateTitle
()
==
'Draft'
:
message
=
context
.
Base_translateString
(
'Please validate your account'
)
else
:
message
=
context
.
Base_translateString
(
'Can not connect'
)
url
=
'%s/login_form?portal_status_message=%s¬ification_status=error'
%
(
context
.
absolute_url
(),
message
)
url
=
came_from
and
'%s&came_from=%s'
%
(
url
,
came_from
)
or
url
RESPONSE
.
redirect
(
url
)
else
:
# XXX How to warn user that password will expire?
# is_user_account_password_expired_expire_date = REQUEST.get('is_user_account_password_expired_expire_date', 0)
# XXX Hardcoded behaviour for JS app.
# Expect came_from to be an URL template
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
url_parameter
=
"n.me"
pattern
=
'{[&|?]%s}'
%
url_parameter
if
(
person
is
None
or
not
portal
.
portal_membership
.
checkPermission
(
'View'
,
person
)):
came_from
=
re
.
sub
(
pattern
,
''
,
came_from
)
else
:
prefix
=
"&"
if
"&%s"
%
url_parameter
in
came_from
else
"?"
came_from
=
re
.
sub
(
pattern
,
'%s%s'
%
(
prefix
,
make_query
({
url_parameter
:
person
.
getRelativeUrl
()})),
came_from
)
# RESPONSE.redirect(came_from or context.getPermanentURL(context));
RESPONSE
.
setHeader
(
'Location'
,
came_from
or
context
.
getPermanentURL
(
context
))
RESPONSE
.
setStatus
(
303
)
bt5/officejs_credential/SkinTemplateItem/portal_skins/officejs_credential/WebSite_login.xml
0 → 100644
View file @
5f903703
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>