|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #include "./modules/http.mod.hsp"
-
-
- #ifndef __USER__
- #define __USER__
-
- #module \
- User
-
- #define CREATE_URL (CONFIG_SERVER_URL + "/create_user.php")
- #define FETCH_URL (CONFIG_SERVER_URL + "/fetch_user.php")
-
- #deffunc local \
- Create \
- str p_name,
- local l_data
- Fetch@Http CREATE_URL + "?name=" + p_name
-
- If status@Http = STATUS_SUCCESS@Http {
- Split data@Http, ",", l_data
-
- id = Int (l_data.0)
- pass = l_data.1
- inheritanceCode = l_data.2
- }
- Else {
- id = 0
- pass = ""
- inheritanceCode = ""
- }
-
- Return
-
- #deffunc local \
- Auth \
- int p_id,\
- local l_data
- id = userId@Setting
- pass = userPasscode@Setting
-
- Return
-
- #global
-
- #endif ; not __USER__
-
|