Commit befc621f authored by Romain Courteaud's avatar Romain Courteaud Committed by Cédric Le Ninivin

[erp5_officejs] Allow to preset the linshare username

parent 38f379f1
......@@ -13,7 +13,16 @@
})
.push(function (setting) {
var configuration = {},
attachment_synchro = setting[1] !== "";
attachment_synchro = setting[1] !== "",
linshare_json = {
type: "linshare",
url: options.url
};
if (options.username || options.password) {
linshare_json.access_token = window.btoa(
options.username + ':' + options.password
);
}
configuration = {
type: "replicate",
query: {
......@@ -69,13 +78,7 @@
},
sub_storage: {
type: "query",
sub_storage: {
type: "linshare",
url: options.url,
access_token: window.btoa(
options.username + ':' + options.password
)
}
sub_storage: linshare_json
}
}
}
......@@ -111,7 +114,8 @@
var gadget = this;
if (options.url) {
return gadget.changeState({
url: options.url || ""
url: options.url || "",
username: options.username || ""
});
}
return gadget.getSetting('linshare_storage', "")
......@@ -160,7 +164,7 @@
"my_username": {
"description": "",
"title": "Username",
"default": "",
"default": gadget.state.username || "",
"css_class": "",
"required": 1,
"editable": 1,
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>973.24661.29279.57753</string> </value>
<value> <string>973.43371.54750.44595</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1549019475.4</float>
<float>1550139619.39</float>
<string>UTC</string>
</tuple>
</state>
......
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