Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

248 rindas
6.2 KiB

  1. {
  2. "meta": {
  3. "$_POST": [
  4. {
  5. "type": "text",
  6. "name": "email"
  7. },
  8. {
  9. "type": "text",
  10. "name": "department"
  11. }
  12. ]
  13. },
  14. "exec": {
  15. "steps": [
  16. {
  17. "name": "strpwd",
  18. "module": "core",
  19. "action": "setvalue",
  20. "options": {
  21. "key": "g_strpwd",
  22. "value": "P@$$w0rd"
  23. },
  24. "meta": [],
  25. "output": true,
  26. "outputType": "text"
  27. },
  28. {
  29. "name": "hash",
  30. "module": "crypto",
  31. "action": "passwordHash",
  32. "options": {
  33. "password": "{{strpwd}}"
  34. },
  35. "outputType": "text",
  36. "metaData": {
  37. "hashPassword": {
  38. "name": "strpwd",
  39. "type": "text"
  40. }
  41. }
  42. },
  43. {
  44. "name": "regcode",
  45. "module": "core",
  46. "action": "setvalue",
  47. "options": {
  48. "key": "g_regcode",
  49. "value": "{{UUID}}"
  50. },
  51. "meta": [],
  52. "outputType": "text",
  53. "metaData": {
  54. "setValueExpression": {
  55. "name": "UUID",
  56. "type": "object"
  57. }
  58. }
  59. },
  60. {
  61. "name": "insert",
  62. "module": "dbupdater",
  63. "action": "insert",
  64. "options": {
  65. "connection": "authdb",
  66. "sql": {
  67. "type": "insert",
  68. "values": [
  69. {
  70. "table": "users",
  71. "column": "email",
  72. "type": "text",
  73. "value": "{{$_POST.email}}"
  74. },
  75. {
  76. "table": "users",
  77. "column": "pwd",
  78. "type": "text",
  79. "value": "{{hash}}"
  80. },
  81. {
  82. "table": "users",
  83. "column": "regcode",
  84. "type": "text",
  85. "value": "{{regcode}}"
  86. }
  87. ],
  88. "table": "users",
  89. "returning": "id",
  90. "query": "insert into `users` (`email`, `pwd`, `regcode`) values (?, ?, ?) returning `id`",
  91. "params": [
  92. {
  93. "name": ":P1",
  94. "type": "expression",
  95. "value": "{{$_POST.email}}",
  96. "test": ""
  97. },
  98. {
  99. "name": ":P2",
  100. "type": "expression",
  101. "value": "{{hash}}",
  102. "test": ""
  103. },
  104. {
  105. "name": ":P3",
  106. "type": "expression",
  107. "value": "{{regcode}}",
  108. "test": ""
  109. }
  110. ]
  111. }
  112. },
  113. "meta": [
  114. {
  115. "name": "identity",
  116. "type": "number"
  117. },
  118. {
  119. "name": "affected",
  120. "type": "number"
  121. }
  122. ],
  123. "output": true
  124. },
  125. {
  126. "name": "insert1",
  127. "module": "dbupdater",
  128. "action": "insert",
  129. "options": {
  130. "connection": "authdb",
  131. "sql": {
  132. "type": "insert",
  133. "values": [
  134. {
  135. "table": "xuserrole",
  136. "column": "userid",
  137. "type": "number",
  138. "value": "{{insert.identity}}"
  139. },
  140. {
  141. "table": "xuserrole",
  142. "column": "roleid",
  143. "type": "number",
  144. "value": "{{$_POST.department}}"
  145. }
  146. ],
  147. "table": "xuserrole",
  148. "returning": "id",
  149. "query": "insert into `xuserrole` (`roleid`, `userid`) values (?, ?)",
  150. "params": [
  151. {
  152. "name": ":P1",
  153. "type": "expression",
  154. "value": "{{insert.identity}}",
  155. "test": ""
  156. },
  157. {
  158. "name": ":P2",
  159. "type": "expression",
  160. "value": "{{$_POST.department}}",
  161. "test": ""
  162. }
  163. ]
  164. }
  165. },
  166. "meta": [
  167. {
  168. "name": "identity",
  169. "type": "text"
  170. },
  171. {
  172. "name": "affected",
  173. "type": "number"
  174. }
  175. ]
  176. },
  177. {
  178. "name": "insert2",
  179. "module": "dbupdater",
  180. "action": "insert",
  181. "options": {
  182. "connection": "authdb",
  183. "sql": {
  184. "type": "insert",
  185. "values": [
  186. {
  187. "table": "xuserrole",
  188. "column": "userid",
  189. "type": "number",
  190. "value": "{{insert.identity}}"
  191. },
  192. {
  193. "table": "xuserrole",
  194. "column": "roleid",
  195. "type": "number",
  196. "value": "4"
  197. }
  198. ],
  199. "table": "xuserrole",
  200. "returning": "id",
  201. "query": "insert into `xuserrole` (`roleid`, `userid`) values (?, ?)",
  202. "params": [
  203. {
  204. "name": ":P1",
  205. "type": "expression",
  206. "value": "{{insert.identity}}",
  207. "test": ""
  208. }
  209. ]
  210. }
  211. },
  212. "meta": [
  213. {
  214. "name": "identity",
  215. "type": "text"
  216. },
  217. {
  218. "name": "affected",
  219. "type": "number"
  220. }
  221. ]
  222. },
  223. {
  224. "name": "",
  225. "module": "mail",
  226. "action": "send",
  227. "options": {
  228. "instance": "mail",
  229. "subject": "Validation Code",
  230. "fromName": "RPM Access",
  231. "fromEmail": "no-reply@rpmindustries.com",
  232. "toName": "New User",
  233. "toEmail": "{{$_POST.email}}",
  234. "body": "<p>Here are your credentials to login for the first time and your registration code to validate your account.</p>\n<p>Your username is: {{$_POST.email}}</p>\n<p>Your password is: P@$$w0rd</p>\n<p>Your validation code is: {{regcode}}</p>\n<br/>\n<p>Once you login you will be prompted for the validation code.</p>"
  235. },
  236. "metaData": {
  237. "sendToEmail": {
  238. "name": "email",
  239. "type": "text"
  240. }
  241. }
  242. }
  243. ]
  244. },
  245. "usedModules": {
  246. "argon2": "^0.30.2"
  247. }
  248. }