示例#1
0
文件: users.php 项目: revcozmo/dating
 public static function delete()
 {
     $vars = self::get_path_variables();
     if (count($vars) == 1) {
         \lib\user::delete(reset($vars));
     }
     return true;
 }
示例#2
0
文件: login.php 项目: revcozmo/dating
 public static function post()
 {
     if ($user = \lib\user::authenticate($_POST['username'], $_POST['password'])) {
         $_SESSION['user_id'] = $user['id'];
         return true;
     } else {
         return false;
     }
 }
示例#3
0
 public static function post()
 {
     if (\lib\token::match($_POST['token'], 'createuser', $_POST['email'], $_POST['time'], 0)) {
         // email confirmed
         \lib\user::confirm($_POST['email']);
         $user = \lib\user::get($_POST['email'], 'email');
         $_SESSION['user_id'] = $user['id'];
         return true;
     } else {
         // email not confirmed
         // $_POST[''];
         return false;
     }
 }