コード例 #1
0
ファイル: ajax-account.php プロジェクト: newnius/quickauth
if (isset($_GET['action'])) {
    $action = $_GET['action'];
}
switch ($action) {
    case 'login':
        if (isset($_POST['account']) && isset($_POST['password'])) {
            $account = $_POST['account'];
            $pwd = $_POST['password'];
            $remember_me = false;
            if (isset($_POST['rememberme']) && $_POST['rememberme'] == 'true') {
                $remember_me = true;
            }
            if (strpos($account, '@') === false) {
                echo loginByName($account, $pwd, $remember_me);
            } else {
                echo loginByEmail($account, $pwd, $remember_me);
            }
        } else {
            echo 'Invalid request';
        }
        break;
        /*
        case 'loginByName':
          if(isset($_POST['username']) && isset($_POST['password']))
          {
            $username = $_POST['username'];
            $pwd = $_POST['password'];
            echo loginByName($username,$pwd);
          }else{
            echo 'Invalid request';
          }
コード例 #2
0
ファイル: service-account.php プロジェクト: newnius/jluewu
if (file_exists('functions-account.php')) {
    require_once 'functions-account.php';
} else {
    die('main function file not exist !');
}
$action = '';
if (isset($_GET['action'])) {
    $action = $_GET['action'];
}
switch ($action) {
    case 'login':
        if (isset($_POST['username']) && isset($_POST['pwd'])) {
            if (strpos($_POST['username'], '@') === false) {
                echo loginByName($_POST['username'], $_POST['pwd']);
            } else {
                echo loginByEmail($_POST['username'], $_POST['pwd']);
            }
        } else {
            echo '信息填写不完整';
        }
        break;
    case 'reg':
        if (!isset($_POST['username'])) {
            exit('用户名不能为空');
        }
        if (!isset($_POST['email'])) {
            exit('邮箱不能为空');
        }
        if (!isset($_POST['pwd'])) {
            exit('密码不能为空');
        }