Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

231 linhas
5.9 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. },
  37. {
  38. "name": "regcode",
  39. "module": "core",
  40. "action": "setvalue",
  41. "options": {
  42. "key": "g_regcode",
  43. "value": "{{UUID}}"
  44. },
  45. "meta": [],
  46. "outputType": "text"
  47. },
  48. {
  49. "name": "insert",
  50. "module": "dbupdater",
  51. "action": "insert",
  52. "options": {
  53. "connection": "authdb",
  54. "sql": {
  55. "type": "insert",
  56. "values": [
  57. {
  58. "table": "users",
  59. "column": "email",
  60. "type": "text",
  61. "value": "{{$_POST.email}}"
  62. },
  63. {
  64. "table": "users",
  65. "column": "pwd",
  66. "type": "text",
  67. "value": "{{hash}}"
  68. },
  69. {
  70. "table": "users",
  71. "column": "regcode",
  72. "type": "text",
  73. "value": "{{regcode}}"
  74. }
  75. ],
  76. "table": "users",
  77. "returning": "id",
  78. "query": "insert into `users` (`email`, `pwd`, `regcode`) values (?, ?, ?) returning `id`",
  79. "params": [
  80. {
  81. "name": ":P1",
  82. "type": "expression",
  83. "value": "{{$_POST.email}}",
  84. "test": ""
  85. },
  86. {
  87. "name": ":P2",
  88. "type": "expression",
  89. "value": "{{hash}}",
  90. "test": ""
  91. },
  92. {
  93. "name": ":P3",
  94. "type": "expression",
  95. "value": "{{regcode}}",
  96. "test": ""
  97. }
  98. ]
  99. }
  100. },
  101. "meta": [
  102. {
  103. "name": "identity",
  104. "type": "text"
  105. },
  106. {
  107. "name": "affected",
  108. "type": "number"
  109. }
  110. ],
  111. "output": true
  112. },
  113. {
  114. "name": "insert1",
  115. "module": "dbupdater",
  116. "action": "insert",
  117. "options": {
  118. "connection": "authdb",
  119. "sql": {
  120. "type": "insert",
  121. "values": [
  122. {
  123. "table": "xuserrole",
  124. "column": "userid",
  125. "type": "number",
  126. "value": "{{insert.identity}}"
  127. },
  128. {
  129. "table": "xuserrole",
  130. "column": "roleid",
  131. "type": "number",
  132. "value": "{{$_POST.department}}"
  133. }
  134. ],
  135. "table": "xuserrole",
  136. "returning": "id",
  137. "query": "insert into `xuserrole` (`roleid`, `userid`) values (?, ?)",
  138. "params": [
  139. {
  140. "name": ":P1",
  141. "type": "expression",
  142. "value": "{{insert.identity}}",
  143. "test": ""
  144. },
  145. {
  146. "name": ":P2",
  147. "type": "expression",
  148. "value": "{{$_POST.department}}",
  149. "test": ""
  150. }
  151. ]
  152. }
  153. },
  154. "meta": [
  155. {
  156. "name": "identity",
  157. "type": "text"
  158. },
  159. {
  160. "name": "affected",
  161. "type": "number"
  162. }
  163. ]
  164. },
  165. {
  166. "name": "insert2",
  167. "module": "dbupdater",
  168. "action": "insert",
  169. "options": {
  170. "connection": "authdb",
  171. "sql": {
  172. "type": "insert",
  173. "values": [
  174. {
  175. "table": "xuserrole",
  176. "column": "userid",
  177. "type": "number",
  178. "value": "{{insert.identity}}"
  179. },
  180. {
  181. "table": "xuserrole",
  182. "column": "roleid",
  183. "type": "number",
  184. "value": "4"
  185. }
  186. ],
  187. "table": "xuserrole",
  188. "returning": "id",
  189. "query": "insert into `xuserrole` (`roleid`, `userid`) values (?, ?)",
  190. "params": [
  191. {
  192. "name": ":P1",
  193. "type": "expression",
  194. "value": "{{insert.identity}}",
  195. "test": ""
  196. }
  197. ]
  198. }
  199. },
  200. "meta": [
  201. {
  202. "name": "identity",
  203. "type": "text"
  204. },
  205. {
  206. "name": "affected",
  207. "type": "number"
  208. }
  209. ]
  210. },
  211. {
  212. "name": "",
  213. "module": "mail",
  214. "action": "send",
  215. "options": {
  216. "instance": "mail",
  217. "subject": "Validation Code",
  218. "fromName": "RPM Access",
  219. "fromEmail": "no-reply@access2.prelub.com",
  220. "toName": "New User",
  221. "toEmail": "{{$_POST.email}}",
  222. "body": "<p>\nHere are your credentials to login for the first time and your registration code to validate your account.\nYour username is: {{$_POST.email}}\nYour password is: P@$$w0rd\nYour validation code is: {{regcode}}\n</p><Br/>\n<p>Click <a href='http://access2.prelub.com'>here</a> to be directed to the website.\n Then click the account menu and login.\n Once you login you will be prompted for the validation code.\n</p>\n\n\n\n",
  223. "contentType": "html"
  224. }
  225. }
  226. ]
  227. },
  228. "usedModules": {
  229. "argon2": "^0.30.2"
  230. }
  231. }