File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,22 @@ function go () {
5454
5555 // (C4) USER HAS ALREADY TIED GOOGLE TO ACCOUNT - LOGIN
5656 $ user = $ this ->get ($ guser ["id " ]);
57- if (is_array ($ user )) { $ this ->login ($ user ); }
57+ if (is_array ($ user )) {
58+ if ($ user ["user_level " ]=="S " ) {
59+ $ this ->error = "Invalid user " ;
60+ return ;
61+ }
62+ $ this ->login ($ user );
63+ }
5864
5965 // (C5) HAS EXISTING ACCOUNT (EMAIL) - TIE TO ACCOUNT & LOGIN
6066 $ this ->Core ->load ("Users " );
6167 $ user = $ this ->Users ->get ($ guser ["email " ]);
6268 if (is_array ($ user )) {
69+ if ($ user ["user_level " ]=="S " ) {
70+ $ this ->error = "Invalid user " ;
71+ return ;
72+ }
6373 $ this ->Users ->hashAdd ($ user ["user_id " ], "GOO " , $ guser ["id " ]);
6474 $ this ->login ($ user );
6575 }
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ function login ($token) {
4545 // (D2) VERIFY TOKEN
4646 if ($ valid ) {
4747 $ user = $ this ->Users ->get ($ token [0 ], "NFC " );
48- $ valid = (is_array ($ user ) && password_verify ($ token [1 ], $ user ["hash_code " ]));
48+ $ valid = (is_array ($ user ) && $ user [ " user_level " ]!= " S " && password_verify ($ token [1 ], $ user ["hash_code " ]));
4949 }
5050
5151 // (D3) SESSION START
Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ function getUser ($email) {
4343 $ this ->error = "Please register for passwordless login first. " ;
4444 return false ;
4545 }
46+ if ($ user ["user_level " ]=="S " ) {
47+ $ this ->error = "Invalid user or password. " ;
48+ return false ;
49+ }
4650 $ user ["hash_code " ] = json_decode ($ user ["hash_code " ]);
4751 $ user ["hash_code " ]->credentialId = hex2bin ($ user ["hash_code " ]->credentialId );
4852 $ user ["hash_code " ]->AAGUID = hex2bin ($ user ["hash_code " ]->AAGUID );
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ function del ($id) {
9595 // $id : user id
9696 function suspend ($ id ) {
9797 $ this ->DB ->update ("users " ,
98- ["` user_level`=? " ], "`user_id`=? " ,
98+ ["user_level " ], "`user_id`=? " ,
9999 ["S " , $ id ]
100100 );
101101 }
You can’t perform that action at this time.
0 commit comments