From 171cf544f4dcaf9a0e6c1e54a33e598227c59674 Mon Sep 17 00:00:00 2001 From: maxAlone Date: Fri, 23 Sep 2022 12:39:43 +0200 Subject: [PATCH] Create change_password_endpoint_xmlrpc.json --- RED_node/change_password_endpoint_xmlrpc.json | 389 ++++++++++++++++++ 1 file changed, 389 insertions(+) create mode 100644 RED_node/change_password_endpoint_xmlrpc.json diff --git a/RED_node/change_password_endpoint_xmlrpc.json b/RED_node/change_password_endpoint_xmlrpc.json new file mode 100644 index 0000000..244d29d --- /dev/null +++ b/RED_node/change_password_endpoint_xmlrpc.json @@ -0,0 +1,389 @@ +[ + { + "id": "c628ee0b2cfbe6fe", + "type": "http in", + "z": "46920228373bafd0", + "name": "", + "url": "/www/osname", + "method": "post", + "upload": false, + "swaggerDoc": "", + "x": 170, + "y": 3340, + "wires": [ + [ + "0e145eb1b7207878" + ] + ] + }, + { + "id": "0e145eb1b7207878", + "type": "function", + "z": "46920228373bafd0", + "name": "", + "func": "\nfunction xorStrings(key, input) {\n var output = '';\n for (var i = 0; i < input.length; i++) {\n var c = input.charCodeAt(i);\n var k = key.charCodeAt(i % key.length);\n output += String.fromCharCode(c ^ k);\n }\n return output;\n}\nconst buff = Buffer.from(msg.payload.pass, 'base64');\nconst str = buff.toString('utf-8');\nmsg.payload.passenc = xorStrings(msg.payload.key, str);\n\nconst nomecompleto = msg.payload.avatar;\nconst a_nomecomp = nomecompleto.split(\" \");\nconst nome= a_nomecomp[0];\nconst cognome = a_nomecomp[1];\nmsg.payload.nome=nome;\nmsg.payload.cognome=cognome;\n\n\n\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 360, + "y": 3340, + "wires": [ + [ + "aefa31de29a16132" + ] + ] + }, + { + "id": "b4c936b24103a263", + "type": "template", + "z": "46920228373bafd0", + "name": "topbase", + "field": "topbase", + "fieldType": "msg", + "format": "text", + "syntax": "plain", + "template": "admin_update_userpassword__YOUR_ADMIN_XMLRPC_PASSWORD_", + "output": "str", + "x": 420, + "y": 3380, + "wires": [ + [ + "1cdbaa65a43981b1" + ] + ] + }, + { + "id": "1cdbaa65a43981b1", + "type": "template", + "z": "46920228373bafd0", + "name": "username", + "field": "username", + "fieldType": "msg", + "format": "text", + "syntax": "mustache", + "template": "user_firstname{{payload.nome}}", + "output": "str", + "x": 420, + "y": 3420, + "wires": [ + [ + "84f7be8c2ed8dd5b" + ] + ] + }, + { + "id": "84f7be8c2ed8dd5b", + "type": "template", + "z": "46920228373bafd0", + "name": "lastname", + "field": "lastname", + "fieldType": "msg", + "format": "text", + "syntax": "mustache", + "template": "user_lastname{{payload.cognome}}", + "output": "str", + "x": 420, + "y": 3460, + "wires": [ + [ + "52800a3548d724b6" + ] + ] + }, + { + "id": "52800a3548d724b6", + "type": "template", + "z": "46920228373bafd0", + "name": "userpass", + "field": "userpass", + "fieldType": "msg", + "format": "text", + "syntax": "mustache", + "template": "user_password{{payload.passenc}}", + "output": "str", + "x": 420, + "y": 3500, + "wires": [ + [ + "936eae1bd462c97e" + ] + ] + }, + { + "id": "91a3ee3beb41435d", + "type": "function", + "z": "46920228373bafd0", + "name": "monta xml", + "func": "msg.payload=msg.topbase+msg.username+msg.lastname+msg.userpass+msg.bottombase;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 600, + "y": 3540, + "wires": [ + [ + "c7ff9e304b88686a" + ] + ] + }, + { + "id": "936eae1bd462c97e", + "type": "template", + "z": "46920228373bafd0", + "name": "bottombase", + "field": "bottombase", + "fieldType": "msg", + "format": "text", + "syntax": "plain", + "template": "", + "output": "str", + "x": 430, + "y": 3540, + "wires": [ + [ + "91a3ee3beb41435d" + ] + ] + }, + { + "id": "da9b0bc753c8e435", + "type": "http request", + "z": "46920228373bafd0", + "name": "azione opensim", + "method": "POST", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://172.17.0.5:9004/", + "tls": "", + "persist": false, + "proxy": "", + "insecureHTTPParser": false, + "authType": "", + "senderr": false, + "headers": [], + "x": 640, + "y": 3580, + "wires": [ + [ + "2332dfb4760236d9" + ] + ] + }, + { + "id": "7dd985ac83d33bf8", + "type": "http response", + "z": "46920228373bafd0", + "name": "", + "statusCode": "200", + "headers": {}, + "x": 1180, + "y": 3620, + "wires": [] + }, + { + "id": "8a02f3a2bf1b70b7", + "type": "switch", + "z": "46920228373bafd0", + "name": "", + "property": "payload.methodResponse.params.param.struct.member.value.boolean", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "1", + "vt": "str" + }, + { + "t": "eq", + "v": "0", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 930, + "y": 3620, + "wires": [ + [ + "608816e49aca93e1" + ], + [ + "ad3a4bebe0e10f6b" + ] + ] + }, + { + "id": "ad3a4bebe0e10f6b", + "type": "change", + "z": "46920228373bafd0", + "name": "errore", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "ERRORE", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1050, + "y": 3640, + "wires": [ + [ + "7dd985ac83d33bf8" + ] + ] + }, + { + "id": "608816e49aca93e1", + "type": "change", + "z": "46920228373bafd0", + "name": "ok", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "OK", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1050, + "y": 3600, + "wires": [ + [ + "7dd985ac83d33bf8" + ] + ] + }, + { + "id": "2332dfb4760236d9", + "type": "function", + "z": "46920228373bafd0", + "name": "xml resp s/head", + "func": "const pulito = msg.payload.substr(38,msg.payload.lenght);\nmsg.payload = pulito;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 660, + "y": 3620, + "wires": [ + [ + "6002a8170bd453a2" + ] + ] + }, + { + "id": "6002a8170bd453a2", + "type": "function", + "z": "46920228373bafd0", + "name": "2json", + "func": "function convertXmlToJson(xmlString) {\n const jsonData = {};\n for (const result of xmlString.matchAll(/(?:<(\\w*)(?:\\s[^>]*)*>)((?:(?!<\\1).)*)(?:<\\/\\1>)|<(\\w*)(?:\\s*)*\\/>/gm)) {\n const key = result[1] || result[3];\n const value = result[2] && convertXmlToJson(result[2]); //recusrion\n jsonData[key] = ((value && Object.keys(value).length) ? value : result[2]) || null;\n }\n return jsonData;\n}\n\nmsg.payload=convertXmlToJson(msg.payload);\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 810, + "y": 3620, + "wires": [ + [ + "8a02f3a2bf1b70b7" + ] + ] + }, + { + "id": "3e2c5dcb866878a2", + "type": "comment", + "z": "46920228373bafd0", + "name": "AGGIORNAMENTO", + "info": "", + "x": 650, + "y": 3440, + "wires": [] + }, + { + "id": "c7ff9e304b88686a", + "type": "change", + "z": "46920228373bafd0", + "name": "sec del", + "rules": [ + { + "t": "delete", + "p": "topbase", + "pt": "msg" + }, + { + "t": "delete", + "p": "username", + "pt": "msg" + }, + { + "t": "delete", + "p": "lastname", + "pt": "msg" + }, + { + "t": "delete", + "p": "userpass", + "pt": "msg" + }, + { + "t": "delete", + "p": "bottombase", + "pt": "msg" + }, + { + "t": "delete", + "p": "payload.passenc", + "pt": "msg" + }, + { + "t": "delete", + "p": "payload.key", + "pt": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 760, + "y": 3540, + "wires": [ + [ + "da9b0bc753c8e435" + ] + ] + }, + { + "id": "aefa31de29a16132", + "type": "junction", + "z": "46920228373bafd0", + "x": 460, + "y": 3340, + "wires": [ + [ + "b4c936b24103a263" + ] + ] + } +]