From: Matteo Nastasi (mop) Date: Thu, 7 Jan 2016 18:19:45 +0000 (+0100) Subject: new login consistency constraint added (no more than 2 consecutive same char or digits) X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=92fff75b6f3b7c1f27bd6e455c483a94fb2ae89f;p=brisk.git new login consistency constraint added (no more than 2 consecutive same char or digits) --- diff --git a/TODO.txt b/TODO.txt index 3c1bad3..02efef5 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,13 +1,34 @@ TODO | ------+ + BUGS | + ------+ + - usermgmt: add user delete (with mail) + DONE - constraint on username (no more than 2 consecutive digits) + - manage isolation consistently + + FEATURES | + ----------+ + * Users Network construction + - minisplash at end of the match + - differentiate table authorization + * add new kind of isolation for apprentice + + * Double click on chat to open preferences + + * APPRENTICE + Phase2 + DONE - match counters (part 2) + DONE . migration script for old users + - guarantee for apprentice + + + BUGS | ------+ DONE - Not sequence of 3 same chars DONE . check server side with test DONE - Global vars checker - - - usermgmt: add user delete DONE - 10002 message when already clicked DONE - trim spaces in apprentice form DONE - Remove books from chat @@ -16,7 +37,7 @@ FEATURES | ----------+ - WIP * inherited info + * inherited info * Users Network construction DONE - sql DONE - dbase API diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index f971277..e3abaa9 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -3540,6 +3540,9 @@ function carousel_top() } } +/* function login_consistency: + name length must be less or equal than 12 chars, + no more than 2 consecutive same character (or generic digits) are allowed */ function login_consistency($name) { $old_c = ''; @@ -3550,6 +3553,9 @@ function login_consistency($name) for ($i = 0 ; $i < mb_strlen($name) ; $i++) { $c = mb_substr($name, $i, 1); if (mb_ereg_match ("[a-zA-Z0-9]", $c)) { + if (mb_ereg_match ("[0-9]", $c)) { + $c = "0"; + } if ($old_c != $c) { $old_c = $c; $old_ct = 1; diff --git a/web/index.php b/web/index.php index 73ebd17..7513dbb 100644 --- a/web/index.php +++ b/web/index.php @@ -1137,7 +1137,7 @@ window.onload = function() {