| @@ -4,6 +4,14 @@ | |||||
| { | { | ||||
| "type": "text", | "type": "text", | ||||
| "name": "id" | "name": "id" | ||||
| }, | |||||
| { | |||||
| "type": "text", | |||||
| "name": "sort" | |||||
| }, | |||||
| { | |||||
| "type": "text", | |||||
| "name": "dir" | |||||
| } | } | ||||
| ] | ] | ||||
| }, | }, | ||||
| @@ -39,7 +47,15 @@ | |||||
| "column": "lastname" | "column": "lastname" | ||||
| } | } | ||||
| ], | ], | ||||
| "params": [], | |||||
| "params": [ | |||||
| { | |||||
| "operator": "equal", | |||||
| "type": "expression", | |||||
| "name": ":P1", | |||||
| "value": "{{$_GET.id}}", | |||||
| "test": "" | |||||
| } | |||||
| ], | |||||
| "table": { | "table": { | ||||
| "name": "users" | "name": "users" | ||||
| }, | }, | ||||
| @@ -49,22 +65,21 @@ | |||||
| "condition": "AND", | "condition": "AND", | ||||
| "rules": [ | "rules": [ | ||||
| { | { | ||||
| "id": "users.email", | |||||
| "field": "users.email", | |||||
| "type": "string", | |||||
| "id": "users.id", | |||||
| "field": "users.id", | |||||
| "type": "double", | |||||
| "operator": "equal", | "operator": "equal", | ||||
| "value": "admin@prelub.com", | |||||
| "value": "{{$_GET.id}}", | |||||
| "data": { | "data": { | ||||
| "table": "users", | "table": "users", | ||||
| "column": "email", | |||||
| "type": "text", | |||||
| "column": "id", | |||||
| "type": "number", | |||||
| "columnObj": { | "columnObj": { | ||||
| "type": "string", | |||||
| "maxLength": 255, | |||||
| "primary": false, | |||||
| "type": "increments", | |||||
| "primary": true, | |||||
| "unique": false, | "unique": false, | ||||
| "nullable": true, | |||||
| "name": "email" | |||||
| "nullable": false, | |||||
| "name": "id" | |||||
| } | } | ||||
| }, | }, | ||||
| "operation": "=" | "operation": "=" | ||||
| @@ -73,7 +88,7 @@ | |||||
| "conditional": null, | "conditional": null, | ||||
| "valid": true | "valid": true | ||||
| }, | }, | ||||
| "query": "select `id`, `email`, `pwd`, `firstname`, `lastname` from `users` where `users`.`email` = ?" | |||||
| "query": "select `id`, `email`, `pwd`, `firstname`, `lastname` from `users` where `users`.`id` = ?" | |||||
| } | } | ||||
| }, | }, | ||||
| "output": true, | "output": true, | ||||
| @@ -106,7 +121,7 @@ | |||||
| "module": "core", | "module": "core", | ||||
| "action": "condition", | "action": "condition", | ||||
| "options": { | "options": { | ||||
| "if": "{{!gettheuser}}", | |||||
| "if": "{{gettheuser}}", | |||||
| "then": { | "then": { | ||||
| "steps": [ | "steps": [ | ||||
| { | { | ||||
| @@ -237,15 +252,118 @@ | |||||
| "outputType": "object" | "outputType": "object" | ||||
| }, | }, | ||||
| { | { | ||||
| "name": "addrole", | |||||
| "module": "api", | |||||
| "action": "send", | |||||
| "name": "query", | |||||
| "module": "dbconnector", | |||||
| "action": "select", | |||||
| "options": { | "options": { | ||||
| "url": "{{$_ENV.API_BASEURL+'xuserroles/add/'+gettheuser.id+'/1'}}", | |||||
| "method": "POST", | |||||
| "dataType": "json" | |||||
| "connection": "authdb", | |||||
| "sql": { | |||||
| "type": "select", | |||||
| "columns": [ | |||||
| { | |||||
| "table": "xuserrole", | |||||
| "column": "roleid" | |||||
| } | |||||
| ], | |||||
| "params": [ | |||||
| { | |||||
| "operator": "equal", | |||||
| "type": "expression", | |||||
| "name": ":P1", | |||||
| "value": "{{$_GET.id}}", | |||||
| "test": "" | |||||
| } | |||||
| ], | |||||
| "table": { | |||||
| "name": "xuserrole" | |||||
| }, | |||||
| "primary": "id", | |||||
| "joins": [], | |||||
| "wheres": { | |||||
| "condition": "AND", | |||||
| "rules": [ | |||||
| { | |||||
| "id": "xuserrole.userid", | |||||
| "field": "xuserrole.userid", | |||||
| "type": "double", | |||||
| "operator": "equal", | |||||
| "value": "{{$_GET.id}}", | |||||
| "data": { | |||||
| "table": "xuserrole", | |||||
| "column": "userid", | |||||
| "type": "number", | |||||
| "columnObj": { | |||||
| "type": "integer", | |||||
| "primary": false, | |||||
| "unique": false, | |||||
| "nullable": true, | |||||
| "name": "userid" | |||||
| } | |||||
| }, | |||||
| "operation": "=" | |||||
| } | |||||
| ], | |||||
| "conditional": null, | |||||
| "valid": true | |||||
| }, | |||||
| "query": "select `roleid` from `xuserrole` where `xuserrole`.`userid` = ?" | |||||
| } | |||||
| }, | |||||
| "output": true, | |||||
| "meta": [ | |||||
| { | |||||
| "type": "number", | |||||
| "name": "roleid" | |||||
| } | |||||
| ], | |||||
| "outputType": "array" | |||||
| }, | |||||
| { | |||||
| "name": "repeat", | |||||
| "module": "core", | |||||
| "action": "repeat", | |||||
| "options": { | |||||
| "outputFilter": "exclude", | |||||
| "repeat": "{{query}}", | |||||
| "outputFields": [], | |||||
| "exec": { | |||||
| "steps": { | |||||
| "name": "addrole", | |||||
| "module": "api", | |||||
| "action": "send", | |||||
| "options": { | |||||
| "url": "{{$_ENV.API_BASEURL+'xuserroles/add/'+gettheuser.id+'/'+roleid}}", | |||||
| "method": "POST", | |||||
| "dataType": "json" | |||||
| }, | |||||
| "output": true | |||||
| } | |||||
| } | |||||
| }, | }, | ||||
| "output": true | |||||
| "output": true, | |||||
| "meta": [ | |||||
| { | |||||
| "name": "$index", | |||||
| "type": "number" | |||||
| }, | |||||
| { | |||||
| "name": "$number", | |||||
| "type": "number" | |||||
| }, | |||||
| { | |||||
| "name": "$name", | |||||
| "type": "text" | |||||
| }, | |||||
| { | |||||
| "name": "$value", | |||||
| "type": "object" | |||||
| }, | |||||
| { | |||||
| "name": "roleid", | |||||
| "type": "number" | |||||
| } | |||||
| ], | |||||
| "outputType": "array" | |||||
| } | } | ||||
| ] | ] | ||||
| } | } | ||||