예제 #1
0
 function __construct($username, $password)
 {
     parent::__construct(SQL_HOST, SQL_NAME, SQL_PASS, SQL_DB);
     $query = sprintf("select UserName,PassWord from UserInfo where UserName = '******' and PassWord = '******'", $username, $password);
     if ($result = parent::sql_query($query)) {
         $row_cnt = mysqli_num_rows($result);
         if ($row_cnt != 0) {
             //printf("login success\n");
             setcookie("UserName", $username);
             setcookie("PassWord", $password);
             printf("%s\n", LOGIN_SUCCESS);
         } else {
             //printf("login fail\n");
             printf("%s\n", LOGIN_FAIL);
         }
     }
 }
예제 #2
0
 function __construct($username, $secure_question, $secure_password, $new_password)
 {
     parent::__construct(SQL_HOST, SQL_NAME, SQL_PASS, SQL_DB);
     $hash_password = parent::hash($new_password);
     parent::reset_password($username, $secure_question, $secure_password, $hash_password);
 }
예제 #3
0
 function __construct($username, $password, $secure_question, $secure_password, $machine_id)
 {
     parent::__construct(SQL_HOST, SQL_NAME, SQL_PASS, SQL_DB);
     $hash_password = parent::hash($password);
     parent::insert_user($username, $hash_password, $secure_question, $secure_password, $machine_id);
 }
예제 #4
0
 function __construct($username, $password, $new_password)
 {
     parent::__construct(SQL_HOST, SQL_NAME, SQL_PASS, SQL_DB);
     $hash_password = parent::hash($new_password);
     parent::modify_password($username, $password, $hash_password);
 }