45d7c24d7b24944fc9a88224dc946b4f1b8f3011
[brisk.git] / doc / ARCHITECTURE.txt
1 Sparse documentation about Brisk.
2
3 Many things aren't documented at all, but I start with authentication workflow.
4
5 ==== MODIFY USERS TABLE ====
6
7 === PHP CODE ===
8
9 web/Obj/dbase_base.phh
10   function LoginDBItem -> args & body
11   function LoginDBItemFromRecord -> args & body
12
13 === SQL CODE ===
14 sql/sql.d/nnn-name-patch.sql
15
16
17 AUTHENTICATION WORKFLOW
18
19 --- CLI ------------
20 index.php:
21   onsubmit="return j_login_manager(this);" ->
22             sync xhr(index_wr.php?mesg=getchallenge&cli_name=<username>)
23
24 --- SRV ------------
25   GET index_wr.php send the string: "1|<tokens>"
26
27 --- CLI ------------
28   POST index.php with passid_private field equal to calcMD5(tokens[1]+calcMD5(form.elements['passid'].value))
29
30
31
32 ===== Game Lifecycle =====
33
34 -> bin5/index_wr.php + argz[0] == 'logout'
35    - bri->table_wakeup($user)
36      - set users subst to "shutdowner" and "shutdowned"
37      - save this: "gst.st_loc++; the_end=true; window.onbeforeunload = null; \
38                    window.onunload = null; document.location.assign("../index.php");" 
39        in user->comm var for client xhr
40      - set $bri->the_end = TRUE
41
42
43 -> index.php  (after verify session value: ~L250)
44   - garbage_manager(TRUE)
45     - align many status var with briskin5 user values
46     - room_join_wakeup()
47