log_legal function usable without a valid user instance as parameter
[brisk.git] / TODO.txt
1  TODO |
2 ------+
3
4   BUGS |
5  ------+
6    - /cont and /rules just during 'bidding' phase
7    DONE - Not sequence of 3 same chars
8    DONE   . check server side with test
9    DONE - Global vars checker
10    <release>
11    - usermgmt: add user delete
12    DONE - 10002 message when already clicked
13    DONE - trim spaces in apprentice form
14    DONE - Remove books from chat
15    DONE - usermgmt: add email
16
17
18   FEATURES |
19  ----------+
20    * multiple rules
21      DONE - show current rules
22      DONE - select tournment dropdown menu (send a 'cont' like message for each change)
23      WIP - new rules for 'together for fun' turnment
24        DONE . strange 4 abandoned rule for auction
25        DONE . check of max points
26        DONE . check of suit at the end of bet
27
28      DONE - increase constraint for rules change
29      DONE - select rules dropdown 'selected' to the current rule or the current
30
31      POSTPONED - no points multiplication for abandon
32      POSTPONED - cache data structure for tournments
33      POSTPONED   . reload on SIGHUP
34
35
36    WIP * inherited info
37    * Users Network construction
38      DONE - sql
39      DONE - dbase API
40      DONE - add apprentices tables
41      DONE - remove entry when set unknown
42      DONE - enhance info interface
43        DONE . SQL to show current evaluation
44        DONE . disable parts of interface
45        WIP . add title to items
46        . fix SELECT 
47      <release>
48      - minisplash at end of the match
49      - differentiate table authorization
50    * add new kind of isolation for apprentice
51
52    * Double click on chat to open preferences
53
54    * APPRENTICE
55      Phase2
56      DONE - match counters (part 2)
57        DONE . migration script for old users
58      - guarantee for apprentice
59
60
61
62 ---------
63    - APPRENTICE
64      Phase2
65      DONE - match counters (part 2)
66        DONE . migration script for old users
67
68    - APPRENTICE
69      Phase1
70      DONE - correggere minuta giornaliera
71      DONE - aggiungere mask per autogar
72      DONE - correggere email per apprentice
73      DONE - verificare la variabile per tout IP ban apprentice
74      DONE - chat ban for apprentice
75
76      DONE - ip check and time limit
77        DONE . sql
78          DONE . temporary table limitation
79        DONE . message
80      DONE - usermgmt extension
81      DONE - add close button
82      DONE - add apprentice icon
83      DONE - match counters (part 1)
84        DONE . sql for match counters
85      DONE - new info system
86        DONE - click management
87        DONE - show user info (RO)
88          DONE - require command/info
89          DONE - fix fiverank table
90          DONE - fix bug with bitwise
91          DONE - fix layout of tables
92      DONE - aggiungere books.png
93
94     - MENTORS
95      - listen all
96
97    - BUDDY LIST
98      - white list
99      - black list
100      - delegate
101
102    - DEANONYMIZER
103       . study how to move login delta injection
104
105    - CERTIFICATIONS
106       DONE . Guarantes for certified-only (buttons choice managed)
107       DONE . Tables for certified-only
108       . Term Of Use
109       . Placing for certified-only
110
111    - IP CLASSES BAN
112       DONE . BAN and BLACK lists added
113       DONE . update method to SIGHUP manager
114       DONE . create constructor refactored
115
116    - PLACEMENT-NORMALIZATION
117       DONE . Normalize previous points
118       DONE . Denormalize "Info" view
119       DONE . Denormalize explained matches
120       DONE . Check placement
121       DONE . Distinguish between inherited mult and local mult
122
123    - AUTO-MAINTENANCE
124      DONE . Terms Of Service acceptance
125        DONE . print date of hard switch
126        DONE . TOS version
127        DONE . user TOS acceptance (db field)
128        DONE . show TOS ([show me later, yes, no]/[yes, no])
129        DONE . switch-off date
130        DONE . manage accept
131        DONE . manage refuse
132        DONE . show current TOS
133        DONE . disable user reason integer field and remove SUSPEND state (db, php)
134        DONE . fix tos layout
135        DONE . opt - download TOS
136        . opt - checkbox for anonimous users with message when not checked
137        . opt - button enabled when arrived to the bottom of the TOS only
138        . opt - check TOS version between config file and TOS file
139      DONE . show guarantee (/guar <login> command)
140        DONE . multi-language
141        DONE . command documentation
142        DONE . manage disagreeding users investigation
143        DONE . self guaranteed
144      . DONE New Users Guarantee Procedure
145        . DONE Change guarantee workflow
146        . DONE Db update
147
148          UserA                 UserB                      Admin
149 -------------------------------------------------------------------------
150       guarante UserB
151            |
152            v
153       Save on mail
154          table,
155       email to UserB
156     (Disabled, MAILED)
157 -------------------------------------------------------------------------
158                            Receive email
159                            to check address
160                                  |
161                                  v
162                            Click on link
163                                  |
164                                  v
165                            Check on mail
166                                table,
167                            update user status,
168                            delete mail rec
169                           (Disabled, TOBECHK)
170 -------------------------------------------------------------------------
171                                                        admin panel
172                                                        accept user
173                                                             |
174                                                             v
175                                                      send email with
176                                                      password,
177                                                      update user status
178                                                       (Normal, NONE)
179 -------------------------------------------------------------------------
180                            Receive email
181                            with password
182 -------------------------------------------------------------------------
183
184      DONE . More user info in the list
185      DONE . Manage date to display when a user was required
186      . Email-address expiration check
187      . Account expiration
188
189
190    DONE - CONTINUE FEATURE
191      DONE . replace explicit strings with multilanguage array
192      DONE . add a php downloader with filtering on allowed requests
193      DONE . save points every game
194      DONE . modify points calculation to include order and mazzo
195      DONE . exclude not standard types from statistics
196          DONE . daily reports (1 for each active tournament)
197          DONE . monthly stats (for normal match only)
198      DONE . show current match ID when created
199      DONE . add info about continue to the info page
200      DONE . add command to continue
201          DONE . check consistency of the request
202      DONE . rearrange users and game status to continue the selected match
203      DONE . investigate user reordering ??
204
205    - WEBSOCKET TRANSPORT
206      . refactoring $enc attribute management
207      DONE . reintroduced $enc = 'plain' for websocket
208      DONE . fallback for not correct WS version
209      DONE . fini of ws stream
210      DONE . reactivate compression
211      DONE . fix xynt_test01
212      DONE M2: brisk working
213      DONE . manage multiport apache config
214      DONE . manage headers correctly in sac-a-push
215      DONE . manage transport.close method where required
216      DONE . xynt_stream: manage fallback to multiple ports
217      DONE . manage fini for ws
218      POST . server: manage input data from clients
219      POST . manage ping/pong (seems not required)
220
221      DONE . client (xynt_streaming.js)
222      DONE . server (transport.phh)
223
224      DONE M1: xynt_test01.php working
225
226
227    - improved S
228      . db update (add components, maybe single string)
229      . filter in index.php
230      . filter in index_wr.php
231
232    - prefs API:
233      . prefs_assign(content): assign json content as output var
234      . prefs_apply(prefs_new): apply new content to g_prefs and system
235      . prefs_load(content): load json content and apply to g_prefs and system
236
237      . prefs_update: update preferences temporarly
238      . prefs_save: save to the server the new prefs
239
240    - preferences (listen into preferences)
241         // js var, volatile server, (db server || cookie)
242         temporary: js var, volatile server
243         permanent: js var, volatile server, (db server || cookie)
244
245      . data from db OR, if missing, from cookies
246
247      . update values
248      . database change
249      . MANAGE NOT AUTH USERS
250
251    - preferences (with "modifiable S")
252      . Mod. S: new flag into database
253      . graph infrastructure
254      . new box to edit color
255
256   MAJOR |
257  -------+
258    - BUG: some connection to the named socket fails
259    - Not simultaneous more then one stream
260
261
262   MINOR |
263  -------+
264    WIP - try to be more antivirus-friendly
265    - multiple rows between games
266    - packetize and automatize php-ancillary and apache module
267    - DISABLED_TO_FIX: DNS access (perform blocking dns requests, must be fixed)
268
269
270   DONE |
271  ------+
272    DONE - temporarly server hung not reflected on user timeouts
273    DONE - timeouted users are still be able to sit down (only the first at the table is banned)
274    DONE - page still opened after the server restart
275    DONE - log_legal address fix
276    DONE - manage too fast reload in xynt-streaming
277    DONE - add xhr as transport layer and manage different streams better
278    TEST - BUG: pari + 72 non fa 4x ma attualmente fa 3x, da correggere
279    TEST - BUG: lurker are logged out (and remain a pending socket opened (look the spush log)
280    DONE - save/restore database
281    DONE - into the room local step remains -1
282    DONE - centralize all '<script ...' incapsulation to allow multiple transport system.
283    DONE - BUG: access with password from 2 diff browsers the second go in strange "page not found" 
284           in the first tentative, the second works
285    DONE - BUG: access with password from 2 diff browsers place the first in a strict loop (the 
286           problem was a call to a static parent method instead of the overrided child method,
287           substitute self:: with the dynamically get class::)
288    DONE - garbage management
289
290    DONE/FROZEN - problem with getpeer (HOSTADDR)
291
292    DONE - slow cards distribution
293    DONE - substr to mb_substr
294    DONE - parametrizations:
295           . parametrization of $DOCUMENT_ROOT  var in brisk-spush.phh file
296           . parametrization of SITE_PREFIX(_LEN) define
297           . move the name of the named socket into the configuration file
298    DONE - manage and test cross forwarder between table and room
299    DONE - setcookie (for tables only and persist prefs)
300    DONE - images flickering on slow windows: try to poll stream every 300 ms (seems to be download problem)
301    DONE - database connection fails after a while, check close and try PGSQL_CONNECT_FORCE_NEW.
302    DONE - unneeded garbage_time.expired access
303    DONE - BUG: fast loop on stream index_rd_ifra page (js watchdog start without timeout corrupt counts)
304    DONE - BUG: logout failed (fixed with a garbage_collector wrapper at sac-a-push level
305    DONE - 404 wrong page management (remove directories redirections (es. brisk/))
306    DONE - configuration file management
307    DONE - app level keep-alive
308    DONE - index_wr other issues
309    DONE - from room to table
310    DONE - from table to room
311    DONE - chunked
312    DONE - bug: read from a not resource handle (already closed because a new socket substitute it)
313    DONE - partial write for normal page management
314    DONE - index_rd_ifra: last_clean issue
315    DONE - fwrite failed error management (select, buffer where store unsent data, and fwrite check and retry)
316    DONE - bug: after restart index_rd.php receive from prev clients a lot of req
317    DONE - index_wr.php::chat
318    DONE - index_wr.php::exit
319    DONE - index_rd.php porting
320    DONE - generic var management from internet
321    DONE - index.php auth part
322    ABRT - index_wr.php::reload - reload is js-only function
323    ABRT - keepalive management - not interesting for our purposes
324
325  BRISK4 (mammuth)
326  ======
327
328  - STEP MANAGEMENT VERIFY
329  Slim Paragraph
330  DONE - move the garbage timeout on file
331  DONE - in index_rd load all data only when required
332  - briskin5 alignment
333    DONE . extern del garb_timeout
334    DONE . user_load parameters verify
335    DONE . Bin5::load_data and Bin5::save_data refactoring with
336           data split
337    . move many function into "Bin5 class"
338  - garbaging of .step files
339
340  DB: - initial usage
341      DONE - configurabilitĂ  file o db
342      DONE - aggiornare le funz di gestione db in modo che prevedano anche il flag DISABLE
343      DONE - travasatore file to pg
344        DONE - travaso punteggi
345        DONE - memorizzazione nuovi i punteggi nel db
346        DONE - gestione classifiche in SQL
347          DONE - produrle
348          DONE - mostrarle
349
350      STEP 1.1
351        DONE - points archiver
352
353      STEP 1.2
354        DONE - partial usability if database go down.
355
356      STEP 1.5
357      - sistema di inserimento nuovi utenti (riversatore da form di inserimento)
358
359      STEP 2
360      - modifica password   
361      - ripristino password 
362
363      STEP 3
364      - comunicazioni di aggiornamento (stato salvato sul server) 
365
366  DONE - var $G_base aggiunta per gestire include in include da path differenti
367
368  BRISK3 (trusty)
369  ======
370   DONE - donameter
371     DONE - G_donors
372     DONE (WOW!) - js object with infos
373     DONE - main logic at login (cookie check in index_rd.php; show_message and createCookie via snippets with block
374            to prevent fast reload)
375     DONE - cookie per non assillare e visualizz.
376     DONE - graphical donameter
377     WIP content (in conf.)
378
379   DONE - numero di tavoli auth-only nel .brisk-install
380   - isolation
381     TEST - ricalcolo delle persone in piedi quando si cambia modalitĂ 
382     DONE - se si e' in isolation non si può cambiare nick perdendo l' auth
383     DONE - non leggere le chat di quelli non autenticati (in isolation)
384     DONE - regole per passare alla modalita' (in piedi o ai tavoli autenticati) 
385     DONE - treni non auth da nascondere 
386     DONE - verso gli altri ??: uguale a prima
387
388   finire multilingua (briskin5/index_wr.php e altri se ce ne sono)
389   coniglio
390   only auth strictly
391   placing limits to config file
392
393 Dunque, 
394
395 - come vengono aggiornate le classifiche: ogni giorno alle 23:58
396
397 - cosa cambia tra le tre coppie di classifiche: 
398   ci sono le classifiche dell' ultima settimana, quelle dell' ultimo mese,  e quelle dell' ultimo trimestre,
399   per ognuno di questi lassi di tempo poi c'è la classifica di chi ha giocato piĂą di TOT partite o meno di TOT partite, con TOT che cambia a seconda del lasso di tempo.
400
401 - come vengono calcolate le classifiche: per ogni utente vengono presi tutti i punti fatti ai tavoli con lucchetto nel lasso di tempo preso in considerazione (ultima settimana, ultimo mese o ultimo trimestre), sommati e divisi per il numero di partite fatte in quello stesso lasso di tempo per normalizzare i valori; poi siccome la gente quando vede 0.18734 sbarella ho deciso di moltiplicare il tutto per 100.
402
403 Un esempio per chiarire:
404
405   l'utente 'pippo' che Ă¨ nuovo gioca 4 partite nell'ultima settimana con i seguenti punteggi:
406     -2, 1, 2, 1
407   lo score viene { [ (-2) + (1) + (2) + (1) ] / 4 }  * 100 = 50.0
408   
409   a paritĂ  di score tra utenti va piĂą in alto chi ha giocato piĂą partite.
410
411 Se dopo quelle 4 partite 'pippo' non ne giocherĂ  piĂą, passata una settimana dall'ultima giocata 
412 sparirĂ  dalla classifica settimanale e rimarrĂ  in quelle mensili e trimestrali.
413
414
415   
416
417
418
419
420  BUG
421  ---
422  
423   DONE - paste da demauroparavia
424   DONE - recupero partita per re-login con password
425   DONE - problema "|" nei nomi (manca enhance degli script lato server)
426   - problema col treno se mouse sopra mentre stringe (verif)
427   
428  MINOR
429  -----
430
431  NORMAL
432  ------
433
434   - win test
435   WIP - /listen 
436     DONE - skin della textarea
437     DONE - set cookie 
438     DONE - init client (read from cookie) - ALWAYS BY SERVER
439     DONE - init server
440     DONE - after cookie check auth-only when no-auth case
441     DONE - aggiungi info accanto a "Chat"
442   DONE - /mesgtoadm
443   DONE - img dei comandi
444
445   DONE - form per garantire utenti (accoda in un file nel formato corretto)
446   DONE -   process request
447   DONE -   show form
448   DONE -   close butt
449   DONE -   submit form
450   DONE -   process form js side 
451   DONE -   process form
452   DONE -   documentazione in help
453
454   DONE - user status
455
456   DONE - aggiornare help
457   DONE -   overflow management
458   DONE -   for status
459   -   for password
460
461   DONE - reload home
462   - notify for long pages
463
464   - buddy list
465   - silenziastolti vari (fino al buddy import)
466   - restrict challenge per IP
467   - restricted charset for login
468   - watchdog
469
470   - db (minimal)
471     - db admin page
472     - user db admin
473     - use db 
474     - admin db
475
476     - studiare un anti-dos
477   - login modify
478  DONE  - db (fake)
479  DONE  - display auth
480     - manage preferences 
481
482  minor
483  -----
484    - auth after login
485
486 ----- done ------
487
488  BUG
489  ---
490   DONE   righe troncate
491   DONE - questione "a monte" che:
492   DONE   - lascia fuori il bottone
493   DONE   - scrive &agrave e compagnia
494   DONE - refresh act_table when unauthorized
495   DONE - problema ghost autenticato (ne prendi il posto ovunque sia)
496
497  MINOR
498  -----
499   DONE - refactoring of the owner name (auth attr for owner name)
500   DONE   - room
501   DONE     - at chat input line 
502   DONE     - in the chat output line
503   DONE     - deauth management
504   DONE - table
505   DONE   - at chat input line
506   DONE   - in the chat output line
507   DONE   - for user area of other users
508   DONE   - deauth management
509   DONE - alart to one user
510
511
512  NORMAL
513  ------
514   DONE - strong ban: "expire time|IP|session|(nick if authenticated)"
515   DONE   - login: se auth      -  verifica solo gli expire per quel nick
516   DONE   -        se non auth  -  verifica gli expire per IP e sessione
517   DONE   - riscrivere messaggi
518
519   DONE - login 
520   DONE   - se pass:
521   DONE     - richiede per l' utente un token (tutta la parte backend va un minimo studiata)
522   DONE     - lo legge, ci hasha la password
523   DONE     - invia la pass al server hashata
524   DONE   - se non pass:
525   DONE     - check del login e return corretto
526   DONE     - oggetto in shm single table con ( "ip", "login", timestamp ) e suo management
527   DONE     - rename ghost if logged
528   DONE     - onunload_cb e onbeforeunload_cb !!! 
529   DONE   - da change attrs a change class (input field)
530   DONE     - colore del bg per arrivare ad essere omogeneo
531   DONE     - cambiare path e file di config
532   DONE   - login with or without pass
533   DONE   - registered nick notice (METTERE IL MSG NELLA PAG DI LOGIN)
534   DONE     - segnalare tavoli solo per auth
535   DONE     - rename restriction at auth table
536   DONE     - change nick (strcasecmp)
537   DONE   - refact js tables to handle flags
538   DONE - room javascript refactoring
539
540   DONE - work background
541   DONE - reserved tables
542
543
544  BRISK2 (spawn)
545  ======
546
547    
548    URGENT - tables spawn
549             DONE - link with photos
550             DONE - top banner in Etc file
551             DONE - spawn of a table
552             DONE - data to cookies (removed table_idx from xhr calls also)
553             DONE - set subst to shutdowner/shutdowned
554             DONE - return to index.php
555             DONE - game's token
556             DONE - recover of corrupted table data
557             DONE - closure of a table
558             DONE - flush of the table
559             DONE - security checks for right scope access
560             DONE - garbage collector management
561             DONE -    recursive garbage - howto ?
562             DONE - stat & subst in browser
563             DONE - laccwr setting and exit if all players are unactive for some time
564             DONE - the list of test case
565             DONE - shm dimension
566             DONE - remove unused parts
567             DONE - move images
568             DONE - optimizations
569             DONE - cambiare titolo al tavolo
570             DONE - shutdowning lock tables
571             DONE - topbanner
572             DONE - public announcements
573             DONE - 10 sec to exit from table
574
575             FAR - inheritances
576    
577    TRAIN  -  DONE - add again in reload   
578              DONE - wag_set refact
579              DONE - filtra char speciali per title
580              DONE - chatt_send refact 
581              DONE - elenco dei giocatori
582              DONE - documentazione online
583              DONE - timeout management     
584              LATER - border color a muzzo
585        
586    NORM   - testament
587    NORM   - public announcements
588    NORM   - 10 sec to exit from table
589    NORM   - moving label for tables click
590
591 ----------------- join -----------------
592    NORM   - map
593
594    NORM   - restart preload img
595    NORM   - tools dir with a main and some pages where check briscola tools.
596    NORM   - watchdog
597
598    NORM   - chat vecchie in reload (forse)
599
600  MIDDLE TODO
601  ===========
602
603    - user assistant (with button to enable disable)
604    - documentation
605
606
607  FAR TODO
608  ========
609    NORM - internationalization
610    NORM - img -> div + css
611    
612  WEB
613  ===
614
615    - link to stable/unstable
616
617 -------------------------------------------------------------------
618  DONE
619  ====
620
621    ABORTED - asta: highlight buttons (css hover) - change pointer when over
622    DONE - step proxy
623    DONE - special chars in js
624    DONE - ban temporaneo dai tavoli
625    DONE - flash player to play sound
626    DONEBUG - (aum. il timeout) - carte giocate che restano girate
627          Sembra non migliorare di molto la cosa, gestita la cache
628          correttamente, sono apposto.
629
630    DONE - one player reject a game, to less points (<= 2)
631    DONE - help page
632    DONE - test di download per la cache
633    DONE - se passano tutti tranne l'ultimo l'asta va al penultimo.
634           Corretto il codice, occorre verificare se questo
635           ingenera qualche problema.
636    DONE - raddoppiato il numero di righe nella chat
637    DONE - corretto bug del /nick
638    DONE - carosello pubblicitĂ  altout
639    DONE - smammamorti
640    DONE - unload of the stream
641    DONE - standup centrati
642    DONE - current player - in info
643    DONE - HELP butt con ABOUT, REGOLE, VERSIONE
644    DONE - welcome lines in the chats (room and table)
645    DONE - welcome lines in the chats (room and table)
646    DONE - nomi in primo piano se vai sul quadrato   
647    DONE - to pass explicit config file to INSTALL.sh
648    DONE - flag to create a config file
649    ABRT - bottoni => immagini
650    DONE - aggiungere bottone al login
651    DONE - nomi in primo piano se vai sul quadrato   
652    DONE - installer to set cookie path
653    DONE - change name
654    DONE - automatic and manual logout
655    DONE - cache problems solved via .htaccess
656    DONE - all players out of the auction
657    DONE - time to send cards
658    DONE - hide cards before sends at a new game
659    DONE - well recognization of the browser and O.S.
660    DONE - login consistency !!!!
661    DONE - functionalization of garbage
662    DONE - call garbage function into login
663    DONE - game
664    DONE - manage the reload from scratch of the table page
665    DONE - table reset
666    DONE - sendcard => card_send(idx, ....)
667    DONE - show table for game
668    DONE - points calculation
669    DONE - make-up of the chooser
670    DONE - where place the briscola on the table
671    DONE - users info
672    DONE - show current auction position
673    DONE - table with internal management of the transition between pages.
674    DONE - server side page abort management  
675    DONE - cookie problem with Ajax
676    DONE - spostare il tasto "esco"
677    DONE - to pass explicit config file to INSTALL.sh 
678    DONE - 8 tables
679    DONE - safety out management
680    DONE - info enhancement and related button (how win the last game and
681           with how much points ?)
682
683  WEB
684    DONE - homepage
685    DONE - screenshots
686
687 DOC
688    CHAPTERS
689       HTTP Streaming
690       Local serializer
691       Database on shmem
692       Page abort (reload on http streaming case)
693       Chat
694       Cookies management
695       CSS tricks
696
697 CHECK ON NEW SERVERS
698 .htaccess AllowOverwrite mode for Cache-Control directive
699
700
701
702
703 */
704