new login rules (max 2 same characters a side), check rules server side and associate...
[brisk.git] / test / logintest.php
1 #!/usr/bin/php
2 <?php
3
4 $G_base = "web/";
5
6 require_once('test/Obj/test.phh');
7 require_once('web/Obj/brisk.phh');
8
9 printf("testing internal_encoding: ");
10 if (mb_internal_encoding() != "UTF-8") {
11     printf("mb_internal_encoding from cli/php.ini: [%s], FIX with UTF-8\n", mb_internal_encoding());
12     exit(1);
13 }
14 else {
15     printf("UTF-8, OK\n");
16 }
17
18 $nam = array ("ò12345678912", "ò123456789123", "pippo", "pìppo", "zorrro", "pìììppo");
19
20 if (mb_strlen($nam[0]) != 12) {
21     printf("mb_strlen not return expected len (12) but %d\n", mb_strlen($nam[0]));
22     exit(1);
23 }
24
25 for ($i = 0 ; $i < count($nam) ; $i++) {
26     printf("[%s] %s\n", $nam[$i], (login_consistency($nam[$i]) ? "TRUE" : "FALSE"));
27 }
28
29 ?>