{
  "meta": {
    "options": {
      "linkedFile": "/views/cnfrm.ejs",
      "linkedForm": "frm_cnfrm"
    },
    "$_GET": [
      {
        "type": "text",
        "name": "sort"
      },
      {
        "type": "text",
        "name": "dir"
      }
    ],
    "$_POST": [
      {
        "type": "text",
        "fieldName": "id",
        "name": "id"
      },
      {
        "type": "text",
        "fieldName": "confirmation",
        "options": {
          "rules": {
            "core:required": {
              "param": ""
            }
          }
        },
        "name": "confirmation"
      },
      {
        "type": "text",
        "fieldName": "firstname",
        "options": {
          "rules": {
            "core:required": {
              "param": ""
            }
          }
        },
        "name": "firstname"
      },
      {
        "type": "text",
        "fieldName": "lastname1",
        "options": {
          "rules": {
            "core:required": {
              "param": ""
            }
          }
        },
        "name": "lastname1"
      },
      {
        "type": "text",
        "fieldName": "email",
        "options": {
          "rules": {
            "core:required": {
              "param": ""
            }
          }
        },
        "name": "email"
      },
      {
        "type": "text",
        "fieldName": "password",
        "options": {
          "rules": {
            "core:required": {
              "param": ""
            }
          }
        },
        "name": "password"
      },
      {
        "type": "text",
        "fieldName": "pwd2",
        "options": {
          "rules": {
            "core:required": {
              "param": ""
            },
            "core:equalTo": {
              "param": "password"
            }
          }
        },
        "name": "pwd2"
      }
    ]
  },
  "exec": {
    "steps": [
      {
        "name": "identity",
        "module": "auth",
        "action": "identify",
        "options": {
          "provider": "auth"
        },
        "output": true,
        "meta": []
      },
      {
        "name": "hash",
        "module": "crypto",
        "action": "passwordHash",
        "options": {
          "password": "{{$_POST.password}}"
        },
        "outputType": "text"
      },
      {
        "name": "update",
        "module": "dbupdater",
        "action": "update",
        "options": {
          "connection": "authdb",
          "sql": {
            "type": "update",
            "values": [
              {
                "table": "users",
                "column": "email",
                "type": "text",
                "value": "{{$_POST.email}}"
              },
              {
                "table": "users",
                "column": "pwd",
                "type": "text",
                "value": "{{hash}}"
              },
              {
                "table": "users",
                "column": "regdate",
                "type": "datetime",
                "value": "{{NOW}}"
              },
              {
                "table": "users",
                "column": "regcode",
                "type": "text",
                "value": ""
              },
              {
                "table": "users",
                "column": "validated",
                "type": "boolean",
                "value": "1"
              },
              {
                "table": "users",
                "column": "firstname",
                "type": "text",
                "value": "{{$_POST.firstname}}"
              },
              {
                "table": "users",
                "column": "lastname",
                "type": "text",
                "value": "{{$_POST.lastname1}}"
              }
            ],
            "table": "users",
            "wheres": {
              "condition": "AND",
              "rules": [
                {
                  "id": "id",
                  "type": "double",
                  "operator": "equal",
                  "value": "{{$_POST.id}}",
                  "data": {
                    "column": "id"
                  },
                  "operation": "="
                }
              ]
            },
            "returning": "id",
            "query": "update `users` set `email` = ?, `pwd` = ?, `regdate` = ?, `regcode` = ?, `validated` = ?, `firstname` = ?, `lastname` = ? where `id` = ? returning `id`",
            "params": [
              {
                "name": ":P1",
                "type": "expression",
                "value": "{{$_POST.email}}",
                "test": ""
              },
              {
                "name": ":P2",
                "type": "expression",
                "value": "{{hash}}",
                "test": ""
              },
              {
                "name": ":P3",
                "type": "expression",
                "value": "{{NOW}}",
                "test": ""
              },
              {
                "name": ":P4",
                "type": "expression",
                "value": "{{$_POST.firstname}}",
                "test": ""
              },
              {
                "name": ":P5",
                "type": "expression",
                "value": "{{$_POST.lastname1}}",
                "test": ""
              },
              {
                "operator": "equal",
                "type": "expression",
                "name": ":P6",
                "value": "{{$_POST.id}}",
                "test": ""
              }
            ]
          }
        },
        "meta": [
          {
            "name": "affected",
            "type": "number"
          }
        ]
      },
      {
        "name": "query",
        "module": "dbconnector",
        "action": "select",
        "options": {
          "connection": "authdb",
          "sql": {
            "type": "select",
            "columns": [
              {
                "table": "xuserrole",
                "column": "userid"
              },
              {
                "table": "xuserrole",
                "column": "roleid"
              }
            ],
            "params": [
              {
                "operator": "equal",
                "type": "expression",
                "name": ":P1",
                "value": "{{identity}}",
                "test": ""
              }
            ],
            "table": {
              "name": "xuserrole"
            },
            "primary": "id",
            "joins": [],
            "wheres": {
              "condition": "AND",
              "rules": [
                {
                  "id": "xuserrole.userid",
                  "field": "xuserrole.userid",
                  "type": "double",
                  "operator": "equal",
                  "value": "{{identity}}",
                  "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 `userid`, `roleid` from `xuserrole` where `xuserrole`.`userid` = ?"
          }
        },
        "output": true,
        "meta": [
          {
            "type": "number",
            "name": "userid"
          },
          {
            "type": "number",
            "name": "roleid"
          }
        ],
        "outputType": "array"
      }
    ]
  },
  "usedModules": {
    "argon2": "^0.30.2"
  }
}