当前位置: 首页>>代码示例>>PHP>>正文


PHP BuckysUser::createNewAccount方法代码示例

本文整理汇总了PHP中BuckysUser::createNewAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP BuckysUser::createNewAccount方法的具体用法?PHP BuckysUser::createNewAccount怎么用?PHP BuckysUser::createNewAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BuckysUser的用法示例。


在下文中一共展示了BuckysUser::createNewAccount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: registerAction

 public function registerAction()
 {
     $request = $_POST;
     //email, firstName, lastName, email, password, password2
     $token = isset($request['TOKEN']) ? trim($request['TOKEN']) : null;
     if (!$token) {
         return ['STATUS_CODE' => STATUS_CODE_BAD_REQUEST, 'DATA' => buckys_api_get_error_result('Api token should not be blank')];
     }
     if ($token != THENEWBOSTON_PUBLIC_API_KEY) {
         return ['STATUS_CODE' => STATUS_CODE_UNAUTHORIZED, 'DATA' => buckys_api_get_error_result('Api token is not valid.')];
     }
     //Validate Input Data
     $newID = BuckysUser::createNewAccount($request);
     if (!$newID) {
         //Getting Error Message
         $error = buckys_get_pure_messages();
         return ['STATUS_CODE' => STATUS_CODE_OK, 'DATA' => buckys_api_get_error_result($error)];
     } else {
         return ['STATUS_CODE' => STATUS_CODE_OK, 'DATA' => ['STATUS' => 'SUCCESS', 'USERID' => $newID, 'MESSAGE' => MSG_NEW_ACCOUNT_CREATED]];
     }
 }
开发者ID:HAPwebsite,项目名称:Social-Network-Website,代码行数:21,代码来源:accountApi.php

示例2: trim

}
if (isset($_GET['action']) && $_GET['action'] == 'verify') {
    $token = trim($_GET['token']);
    $email = trim($_GET['email']);
    if (!$token || !$email) {
        buckys_redirect("/index.php", MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
    }
    BuckysUser::verifyAccount($email, $token);
    buckys_redirect("/index.php");
}
if (isset($_POST['action']) && $_POST['action'] == 'create-account') {
    //Check Captcha
    $resp = recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
    if ($resp->is_valid) {
        //Create New Account
        $newID = BuckysUser::createNewAccount($_POST);
        render_result_xml(array('status' => !$newID ? 'error' : 'success', 'message' => !$newID ? buckys_get_messages() : MSG_NEW_ACCOUNT_CREATED));
    } else {
        render_result_xml(array('status' => 'error', 'message' => '<p class="message error">' . ($resp->error == 'incorrect-captcha-sol' ? 'The captcha input is not correct!' : $resp->error) . '</p>'));
    }
    exit;
} else {
    if (isset($_POST['action']) && $_POST['action'] == 'reset-password') {
        BuckysUser::resetPassword($_POST['email']);
    }
}
$showForgotPwdForm = isset($_GET['forgotpwd']) && $_GET['forgotpwd'];
buckys_enqueue_stylesheet('register.css');
buckys_enqueue_javascript('register.js');
$BUCKYS_GLOBALS['content'] = 'register';
$BUCKYS_GLOBALS['title'] = 'Register - BuckysRoom';
开发者ID:kishoreks,项目名称:BuckysRoom,代码行数:31,代码来源:register.php


注:本文中的BuckysUser::createNewAccount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。