| 50 |
"×¢²áÇëÊäÈë`\033[1;31mnew\033[m'): "); |
"×¢²áÇëÊäÈë`\033[1;31mnew\033[m'): "); |
| 51 |
iflush (); |
iflush (); |
| 52 |
|
|
| 53 |
str_input (username, 19, 0); |
str_input (username, 19, DOECHO); |
| 54 |
count++; |
count++; |
| 55 |
|
|
| 56 |
if (strcmp (username, "guest") == 0) |
if (strcmp (username, "guest") == 0) |
| 64 |
if (user_register () == 0) |
if (user_register () == 0) |
| 65 |
return 0; |
return 0; |
| 66 |
else |
else |
| 67 |
return -2; |
return -2; |
| 68 |
} |
} |
| 69 |
|
|
| 70 |
if (strlen (username) > 0) |
if (strlen (username) > 0) |
| 73 |
prints ("\033[1;37mÇëÊäÈëÃÜÂë\033[m: "); |
prints ("\033[1;37mÇëÊäÈëÃÜÂë\033[m: "); |
| 74 |
iflush (); |
iflush (); |
| 75 |
|
|
| 76 |
str_input (password, 19, 1); |
str_input (password, 19, NOECHO); |
| 77 |
|
|
| 78 |
ok = (check_user (username, password) == 0); |
ok = (check_user (username, password) == 0); |
| 79 |
} |
} |
| 114 |
|
|
| 115 |
sprintf (sql, |
sprintf (sql, |
| 116 |
"select UID,username,p_login from user_list where username='%s' " |
"select UID,username,p_login from user_list where username='%s' " |
| 117 |
"and (password=MD5('%s') or password=PASSWORD('%s')) and " |
"and (password=MD5('%s') or password=SHA2('%s', 256)) and " |
| 118 |
"enable", username, password, password); |
"enable", username, password, password); |
| 119 |
if (mysql_query (db, sql) != 0) |
if (mysql_query (db, sql) != 0) |
| 120 |
{ |
{ |