Commit a5c833b4 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: User can now add extra Logins on his account

parent 90833180
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Site List</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_page_slap_person_add_erp5_login.js" type="text/javascript"></script>
</head>
<body>
<form class="save_form ui-body-c" novalidate>
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" 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>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</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>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_slap_person_add_erp5_login.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_page_slap_person_add_erp5_login_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Person Add ERP5 Login</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</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>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</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>publish_alive</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>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1559202678.18</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </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>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>976.3557.5699.51524</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>1559201605.46</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</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>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</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>1559201559.4</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_post", "jio_post")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.allowPublicAcquisition('notifySubmit', function () {
return this.triggerSubmit();
})
.onEvent('submit', function () {
var gadget = this,
doc = {};
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (content) {
var k;
for (k in content) {
if (k !== "password_confirmation") {
doc[k] = content[k];
}
if ((k === "password_confirmation") &&
(content.password !== content.password_confirmation)) {
return gadget.notifySubmitted({message: 'Password is different from confirmation', status: 'error'});
}
}
return gadget.getSetting("hateoas_url")
.push(function (hateoas_url) {
return gadget.jio_putAttachment(content.parent_relative_url,
hateoas_url + gadget.state.jio_key + "/Person_newLogin", doc)
.push(function () {
return gadget.notifySubmitted({message: 'New User Login created.', status: 'success'});
})
.push(function () {
return gadget.redirect({"command": "change",
"options": {"jio_key": content.parent_relative_url,
"page": "slap_controller"}});
});
});
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.declareMethod("render", function (options) {
var gadget = this;
gadget.state.jio_key = options.jio_key;
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view')
]);
})
.push(function (result) {
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_reference": {
"description": "",
"title": "Login Name",
"default": "",
"css_class": "",
"required": 1,
"editable": 1,
"key": "reference",
"hidden": 0,
"type": "StringField"
},
"my_new_password": {
"description": "",
"title": "Password",
"default": "",
"css_class": "",
"required": 1,
"editable": 1,
"key": "password",
"hidden": 0,
"type": "PasswordField"
},
"my_confirmation_password": {
"description": "",
"title": "Confirm your Password",
"default": "",
"css_class": "",
"required": 1,
"editable": 1,
"key": "password_confirmation",
"hidden": 0,
"type": "PasswordField"
},
"my_portal_type": {
"description": "The name of a document in ERP5",
"title": "Portal Type",
"default": "ERP5 Login",
"css_class": "",
"required": 1,
"editable": 1,
"key": "portal_type",
"hidden": 1,
"type": "StringField"
},
"my_parent_relative_url": {
"description": "",
"title": "Parent Relative Url",
"default": gadget.state.jio_key,
"css_class": "",
"required": 1,
"editable": 1,
"key": "parent_relative_url",
"hidden": 1,
"type": "StringField"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"left",
[["my_reference"], ["my_new_password"], ["my_confirmation_password"], ["my_portal_type"], ["my_parent_relative_url"]]
]]
}
});
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {page: "slap_controller"}})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "Add New User Login",
selection_url: url_list[0],
submit_action: true
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" 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>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
<string>Authenticated</string>
<string>Developer</string>
<string>Owner</string>
</list>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</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>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_slap_person_add_erp5_login.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_page_slap_person_add_erp5_login_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Person Add ERP5 Login</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>003</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>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</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>publish_alive</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>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1559202667.83</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </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>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>976.5545.8476.36522</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>1559514750.72</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</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>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</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>1559201637.49</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
...@@ -91,8 +91,7 @@ ...@@ -91,8 +91,7 @@
var gadget = this, var gadget = this,
column_list = [ column_list = [
['reference', 'Reference'], ['reference', 'Reference'],
['portal_type', 'Type'], ['portal_type', 'Type']
['validation_state', 'Status']
], ],
data; data;
return new RSVP.Queue() return new RSVP.Queue()
...@@ -149,7 +148,8 @@ ...@@ -149,7 +148,8 @@
"query": "urn:jio:allDocs?query=%28portal_type%3A%28%22" + "query": "urn:jio:allDocs?query=%28portal_type%3A%28%22" +
"ERP5 Login" + "%22%2C%20%22" + "ERP5 Login" + "%22%2C%20%22" +
"Google Login" + "%22%2C%20%22" + "Google Login" + "%22%2C%20%22" +
"Facebook Login" + "%22%29%29", "Facebook Login" + "%22%29%20AND%20" +
"validation_state%3Avalidated%29",
"portal_type": [], "portal_type": [],
"search_column_list": column_list, "search_column_list": column_list,
"sort_column_list": column_list, "sort_column_list": column_list,
...@@ -185,6 +185,7 @@ ...@@ -185,6 +185,7 @@
gadget.getUrlFor({command: "change", options: {jio_key: me, page: "slap_person_revoke_certificate"}}), gadget.getUrlFor({command: "change", options: {jio_key: me, page: "slap_person_revoke_certificate"}}),
gadget.getUrlFor({command: "change", options: {jio_key: me, page: "slap_person_request_certificate"}}), gadget.getUrlFor({command: "change", options: {jio_key: me, page: "slap_person_request_certificate"}}),
gadget.getUrlFor({command: "change", options: {jio_key: me, page: "slap_person_get_token"}}), gadget.getUrlFor({command: "change", options: {jio_key: me, page: "slap_person_get_token"}}),
gadget.getUrlFor({command: "change", options: {jio_key: me, page: "slap_person_add_erp5_login"}}),
gadget.getUrlFor({command: "change", options: {page: "slapos"}}) gadget.getUrlFor({command: "change", options: {page: "slapos"}})
]); ]);
}) })
...@@ -195,7 +196,8 @@ ...@@ -195,7 +196,8 @@
request_certificate_url: url_list[2], request_certificate_url: url_list[2],
revoke_certificate_url: url_list[1], revoke_certificate_url: url_list[1],
token_url: url_list[3], token_url: url_list[3],
selection_url: url_list[4] add_url: url_list[4],
selection_url: url_list[5]
}; };
if (!gadget.state.editable) { if (!gadget.state.editable) {
header_dict.edit_content = url_list[0]; header_dict.edit_content = url_list[0];
......
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.32024.53732.34406</string> </value> <value> <string>976.3552.39636.23859</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1545663870.65</float> <float>1559517473.11</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -269,6 +269,8 @@ gadget_erp5_page_slap_add_software_installation.html\n ...@@ -269,6 +269,8 @@ gadget_erp5_page_slap_add_software_installation.html\n
gadget_erp5_page_slap_add_software_installation.js\n gadget_erp5_page_slap_add_software_installation.js\n
gadget_erp5_page_slap_add_ticket.html\n gadget_erp5_page_slap_add_ticket.html\n
gadget_erp5_page_slap_add_ticket.js\n gadget_erp5_page_slap_add_ticket.js\n
gadget_erp5_page_slap_close_ticket.js\n
gadget_erp5_page_slap_close_ticket.html\n
gadget_erp5_page_slap_computer_get_token.html\n gadget_erp5_page_slap_computer_get_token.html\n
gadget_erp5_page_slap_computer_get_token.js\n gadget_erp5_page_slap_computer_get_token.js\n
gadget_erp5_page_slap_computer_list.html\n gadget_erp5_page_slap_computer_list.html\n
...@@ -360,8 +362,6 @@ gadget_erp5_page_slap_support_request_view.html\n ...@@ -360,8 +362,6 @@ gadget_erp5_page_slap_support_request_view.html\n
gadget_erp5_page_slap_ticket_list.html\n gadget_erp5_page_slap_ticket_list.html\n
gadget_erp5_page_slap_ticket_list.js\n gadget_erp5_page_slap_ticket_list.js\n
gadget_erp5_page_slap_ticket_view.js\n gadget_erp5_page_slap_ticket_view.js\n
gadget_erp5_page_slap_close_ticket.js\n
gadget_erp5_page_slap_close_ticket.html\n
gadget_erp5_page_slap_transfer_computer.html\n gadget_erp5_page_slap_transfer_computer.html\n
gadget_erp5_page_slap_transfer_computer.js\n gadget_erp5_page_slap_transfer_computer.js\n
gadget_erp5_page_slap_trial_request_message.html\n gadget_erp5_page_slap_trial_request_message.html\n
...@@ -370,6 +370,8 @@ gadget_erp5_page_slap_upgrade_decision_view.html\n ...@@ -370,6 +370,8 @@ gadget_erp5_page_slap_upgrade_decision_view.html\n
gadget_erp5_page_slap_upgrade_decision_view.js\n gadget_erp5_page_slap_upgrade_decision_view.js\n
gadget_erp5_page_slap_invalidate_login.js\n gadget_erp5_page_slap_invalidate_login.js\n
gadget_erp5_page_slap_invalidate_login.html\n gadget_erp5_page_slap_invalidate_login.html\n
gadget_erp5_page_slap_person_add_erp5_login.js\n
gadget_erp5_page_slap_person_add_erp5_login.html\n
gadget_erp5_page_slapos.css\n gadget_erp5_page_slapos.css\n
gadget_erp5_page_slapos.html\n gadget_erp5_page_slapos.html\n
gadget_erp5_page_slapos.js\n gadget_erp5_page_slapos.js\n
...@@ -549,7 +551,7 @@ NETWORK:\n ...@@ -549,7 +551,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>ERP5TypeTestCase</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -563,7 +565,7 @@ NETWORK:\n ...@@ -563,7 +565,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>975.57226.29060.57429</string> </value> <value> <string>976.8845.38902.19200</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -581,7 +583,7 @@ NETWORK:\n ...@@ -581,7 +583,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1558489648.02</float> <float>1559518993.22</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
from zExceptions import Unauthorized
portal = context.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue()
if person.getUid() != context.getUid():
raise Unauthorized("You are not allowed to create login to a different user")
if context.Person_testLoginExistence(reference=reference):
raise Unauthorized("Login already exists")
erp5_login = context.newContent(
portal_type = "ERP5 Login",
reference=reference,
password=password
)
erp5_login.validate()
return erp5_login.getRelativeUrl()
<?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, password</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>Person_newLogin</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from zExceptions import Unauthorized
if REQUEST is not None:
raise Unauthorized
portal = context.getPortalObject()
return portal.portal_catalog.countResults(
portal_type=["ERP5 Login", "Google Login", "Facebook Login"],
reference=reference,
validation_state="validated"
)[0][0] > 0
<?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, REQUEST=None</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>Person_testLoginExistence</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
image_module/gadget_slapos_panel_png image_module/gadget_slapos_panel_png
web_page_module/rjs_gadget_translation_data_js web_page_module/gadget_erp5_page_slap_reject_upgrade_decision_html
web_page_module/rjs_gadget_slapos_alert_listbox_field_css web_page_module/gadget_erp5_page_slap_reject_upgrade_decision_js
web_page_module/rjs_gadget_slapos_alert_listbox_field_html
web_page_module/rjs_gadget_slapos_alert_listbox_field_js
web_page_module/rjs_gadget_erp5_attention_point_css web_page_module/rjs_gadget_erp5_attention_point_css
web_page_module/rjs_gadget_erp5_attention_point_html web_page_module/rjs_gadget_erp5_attention_point_html
web_page_module/rjs_gadget_erp5_attention_point_js web_page_module/rjs_gadget_erp5_attention_point_js
web_page_module/gadget_erp5_page_slap_reject_upgrade_decision_html
web_page_module/gadget_erp5_page_slap_reject_upgrade_decision_js
web_page_module/rjs_gadget_erp5_page_map_css web_page_module/rjs_gadget_erp5_page_map_css
web_page_module/rjs_gadget_erp5_page_map_html web_page_module/rjs_gadget_erp5_page_map_html
web_page_module/rjs_gadget_erp5_page_map_js web_page_module/rjs_gadget_erp5_page_map_js
...@@ -31,6 +27,8 @@ web_page_module/rjs_gadget_erp5_page_slap_add_software_installation_html ...@@ -31,6 +27,8 @@ web_page_module/rjs_gadget_erp5_page_slap_add_software_installation_html
web_page_module/rjs_gadget_erp5_page_slap_add_software_installation_js web_page_module/rjs_gadget_erp5_page_slap_add_software_installation_js
web_page_module/rjs_gadget_erp5_page_slap_add_ticket_html web_page_module/rjs_gadget_erp5_page_slap_add_ticket_html
web_page_module/rjs_gadget_erp5_page_slap_add_ticket_js web_page_module/rjs_gadget_erp5_page_slap_add_ticket_js
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_html
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js
web_page_module/rjs_gadget_erp5_page_slap_computer_get_token_html web_page_module/rjs_gadget_erp5_page_slap_computer_get_token_html
web_page_module/rjs_gadget_erp5_page_slap_computer_get_token_js web_page_module/rjs_gadget_erp5_page_slap_computer_get_token_js
web_page_module/rjs_gadget_erp5_page_slap_computer_list_html web_page_module/rjs_gadget_erp5_page_slap_computer_list_html
...@@ -79,6 +77,8 @@ web_page_module/rjs_gadget_erp5_page_slap_parameter_form_css ...@@ -79,6 +77,8 @@ web_page_module/rjs_gadget_erp5_page_slap_parameter_form_css
web_page_module/rjs_gadget_erp5_page_slap_parameter_form_html web_page_module/rjs_gadget_erp5_page_slap_parameter_form_html
web_page_module/rjs_gadget_erp5_page_slap_parameter_form_js web_page_module/rjs_gadget_erp5_page_slap_parameter_form_js
web_page_module/rjs_gadget_erp5_page_slap_payment_result_html web_page_module/rjs_gadget_erp5_page_slap_payment_result_html
web_page_module/rjs_gadget_erp5_page_slap_person_add_erp5_login_html
web_page_module/rjs_gadget_erp5_page_slap_person_add_erp5_login_js
web_page_module/rjs_gadget_erp5_page_slap_person_get_token_html web_page_module/rjs_gadget_erp5_page_slap_person_get_token_html
web_page_module/rjs_gadget_erp5_page_slap_person_get_token_js web_page_module/rjs_gadget_erp5_page_slap_person_get_token_js
web_page_module/rjs_gadget_erp5_page_slap_person_request_certificate_html web_page_module/rjs_gadget_erp5_page_slap_person_request_certificate_html
...@@ -122,8 +122,6 @@ web_page_module/rjs_gadget_erp5_page_slap_support_request_view_html ...@@ -122,8 +122,6 @@ web_page_module/rjs_gadget_erp5_page_slap_support_request_view_html
web_page_module/rjs_gadget_erp5_page_slap_ticket_list_html web_page_module/rjs_gadget_erp5_page_slap_ticket_list_html
web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js
web_page_module/rjs_gadget_erp5_page_slap_ticket_view_js web_page_module/rjs_gadget_erp5_page_slap_ticket_view_js
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_html
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js
web_page_module/rjs_gadget_erp5_page_slap_transfer_computer_html web_page_module/rjs_gadget_erp5_page_slap_transfer_computer_html
web_page_module/rjs_gadget_erp5_page_slap_transfer_computer_js web_page_module/rjs_gadget_erp5_page_slap_transfer_computer_js
web_page_module/rjs_gadget_erp5_page_slap_trial_request_message_html web_page_module/rjs_gadget_erp5_page_slap_trial_request_message_html
...@@ -143,6 +141,9 @@ web_page_module/rjs_gadget_erp5_panel_shortcut_html ...@@ -143,6 +141,9 @@ web_page_module/rjs_gadget_erp5_panel_shortcut_html
web_page_module/rjs_gadget_erp5_panel_shortcut_js web_page_module/rjs_gadget_erp5_panel_shortcut_js
web_page_module/rjs_gadget_erp5_pt_form_slapos_index_html web_page_module/rjs_gadget_erp5_pt_form_slapos_index_html
web_page_module/rjs_gadget_erp5_pt_form_slapos_index_js web_page_module/rjs_gadget_erp5_pt_form_slapos_index_js
web_page_module/rjs_gadget_slapos_alert_listbox_field_css
web_page_module/rjs_gadget_slapos_alert_listbox_field_html
web_page_module/rjs_gadget_slapos_alert_listbox_field_js
web_page_module/rjs_gadget_slapos_appcache web_page_module/rjs_gadget_slapos_appcache
web_page_module/rjs_gadget_slapos_computer_map_html web_page_module/rjs_gadget_slapos_computer_map_html
web_page_module/rjs_gadget_slapos_computer_map_js web_page_module/rjs_gadget_slapos_computer_map_js
...@@ -175,6 +176,7 @@ web_page_module/rjs_gadget_slapos_project_status_html ...@@ -175,6 +176,7 @@ web_page_module/rjs_gadget_slapos_project_status_html
web_page_module/rjs_gadget_slapos_project_status_js web_page_module/rjs_gadget_slapos_project_status_js
web_page_module/rjs_gadget_slapos_site_status_html web_page_module/rjs_gadget_slapos_site_status_html
web_page_module/rjs_gadget_slapos_site_status_js web_page_module/rjs_gadget_slapos_site_status_js
web_page_module/rjs_gadget_translation_data_js
web_page_module/rjs_gadget_trial_panel_html web_page_module/rjs_gadget_trial_panel_html
web_page_module/rjs_gadget_trial_panel_js web_page_module/rjs_gadget_trial_panel_js
web_page_module/rjs_leaflet_css web_page_module/rjs_leaflet_css
......
...@@ -77,6 +77,8 @@ web_page_module/rjs_gadget_erp5_page_slap_parameter_form_css ...@@ -77,6 +77,8 @@ web_page_module/rjs_gadget_erp5_page_slap_parameter_form_css
web_page_module/rjs_gadget_erp5_page_slap_parameter_form_html web_page_module/rjs_gadget_erp5_page_slap_parameter_form_html
web_page_module/rjs_gadget_erp5_page_slap_parameter_form_js web_page_module/rjs_gadget_erp5_page_slap_parameter_form_js
web_page_module/rjs_gadget_erp5_page_slap_payment_result_html web_page_module/rjs_gadget_erp5_page_slap_payment_result_html
web_page_module/rjs_gadget_erp5_page_slap_person_add_erp5_login_html
web_page_module/rjs_gadget_erp5_page_slap_person_add_erp5_login_js
web_page_module/rjs_gadget_erp5_page_slap_person_get_token_html web_page_module/rjs_gadget_erp5_page_slap_person_get_token_html
web_page_module/rjs_gadget_erp5_page_slap_person_get_token_js web_page_module/rjs_gadget_erp5_page_slap_person_get_token_js
web_page_module/rjs_gadget_erp5_page_slap_person_request_certificate_html web_page_module/rjs_gadget_erp5_page_slap_person_request_certificate_html
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment