Exemplo n.º 1
0
function uc_api_synlogin($get, $post)
{
    $username = $get['username'];
    if (strtolower(UC_CHARSET) != 'utf-8') {
        $username = mb_convert_encoding($username, 'UTF-8', UC_CHARSET);
    }
    $u = Table::Fetch('user', $username, 'username');
    if ($u) {
        ZLogin::Login($u['id']);
    }
    return API_RETURN_SUCCEED;
}
Exemplo n.º 2
0
    }
    if ($_POST['password2'] == $_POST['password'] && $_POST['password']) {
        if ($INI['system']['emailverify']) {
            $u['enable'] = 'N';
        }
        $usergroup = Table::Fetch('user_group', 'customer', 'name');
        if (!empty($usergroup)) {
            $u['user_group_id'] = $usergroup['id'];
        }
        if ($user_id = ZUser::Create($u)) {
            if ($INI['system']['emailverify']) {
                mail_sign_id($user_id);
                Session::Set('unemail', $_POST['email']);
                Utility::Redirect(WEB_ROOT . '/account/verify.php');
            } else {
                ZLogin::Login($user_id);
                Utility::Redirect(WEB_ROOT . '/index.php');
            }
        } else {
            $au = Table::Fetch('user', $_POST['email'], 'email');
            if ($au) {
                Session::Set('error', 'Failed, Email has registerred ');
            } else {
                Session::Set('error', 'Failed, username has  been taken');
            }
        }
    } else {
        Session::Set('error', 'Register failed, check your password please');
    }
}
include template('account_signup');
Exemplo n.º 3
0
    $wwwlink = mail_zd($email);
    die(include template('account_verify'));
} else {
    if (strpos($secret, '@')) {
        Session::Set('unemail', $secret);
        mail_sign_email($secret);
        redirect(WEB_ROOT . '/account/verify.php');
    }
}
$user = Table::Fetch('user', $secret, 'secret');
if ($user['enable'] == 'Y') {
    Session::Set('error', '你的账户已经验通过,请直接登录!');
    if (isset($_SESSION['user_id'])) {
        unset($_SESSION['user_id']);
        ZLogin::NoRemember();
        ZUser::SynLogout();
    }
    redirect(WEB_ROOT . '/account/login.php');
}
if ($user) {
    if (option_yes('mobilecode')) {
        Table::UpdateCache('user', $user['id'], array('emailable' => 'Y'));
        die(include template('account_signmobile'));
    } else {
        Table::UpdateCache('user', $user['id'], array('emailable' => 'Y', 'enable' => 'Y'));
        Session::Set('notice', '恭喜!你的帐户已经通过Email验证');
        ZLogin::Login($user['id']);
        redirect(get_loginpage(WEB_ROOT . '/index.php'));
    }
}
redirect(WEB_ROOT . '/index.php');
Exemplo n.º 4
0
Arquivo: sms.php Projeto: noikiy/mdwp
 } else {
     if ('bindcodeyes' == $action) {
         $mobile = trim(strval($_GET['mobile']));
         $user_id = abs(intval($_GET['user_id']));
         $secretcode = trim(strval($_GET['secretcode']));
         $condition = array('tools' => $mobile, 'enable' => 'N', 'user_id' => $user_id);
         //json($user_id, 'alert');
         $sms = DB::GetTableRow('toolsbind', $condition);
         if (!$sms) {
             json(array(array('data' => '非法访问!', 'type' => 'alert'), array('data' => 'X.boxClose();', 'type' => 'eval')), 'mix');
         }
         if ($sms['secret'] != $secretcode) {
             json('短信认证码不正确,请重新输入!', 'alert');
         } else {
             ZToolsbind::Enable($mobile, true);
             ZLogin::Login($sms['user_id']);
             json(array(array('data' => '绑定成功', 'type' => 'alert'), array('data' => 'X.boxClose();', 'type' => 'eval'), array('data' => 'window.location=  "/index.php";', 'type' => 'eval')), 'mix');
             redirect(WEB_ROOT . '/index.php');
         }
     } else {
         if ('loginbindmobile' == $action) {
             $userid = strval($_GET['userid']);
             $html = render('ajax_dialog_smsloginbind');
             json($html, 'dialog');
         } else {
             if ('loginmobilebindcheck' == $action) {
                 $mobile = trim(strval($_GET['mobile']));
                 $verifycode = trim(strval($_GET['verifycode']));
                 $user_id = abs(intval($_GET['user_id']));
                 $secret = Utility::VerifyCode();
                 if (Utility::CaptchaCheck($verifycode)) {