本文整理汇总了PHP中checkuserexists函数的典型用法代码示例。如果您正苦于以下问题:PHP checkuserexists函数的具体用法?PHP checkuserexists怎么用?PHP checkuserexists使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkuserexists函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: signup
function signup()
{
global $Userservice;
global $SKADATE_BOL_AccountTypeToGenderDao;
global $BOL_AvatarService_inst;
//global $EmailVerifyService;
global $SKAPI_BOL_Service_inst;
global $language;
$app = \Slim\Slim::getInstance();
$app->response->headers->set('Content-Type', 'application/json');
$app->response->setStatus(200);
//Lang Call Start
$hammu_lang_id = $app->request()->params("lang_id");
if (!empty($hammu_lang_id)) {
getCurrentLanguages($hammu_lang_id);
}
//Lang Call end
//$match_sex = $app->request()->params('match_sex');
//$preferences_or_services = $app->request()->params('preferences_or_services');
//$photo = $app->request()->params('photo');
//$photo_data = $_FILES["photo"];
$username = $app->request()->params('username');
$email = $app->request()->params('email');
$password = $app->request()->params('password');
$realname = $app->request()->params('realname');
$sex = $app->request()->params('sex');
$i_m_using = $app->request()->params(HAMMU_DB_IM_USING_HAMMU_AS_KEY);
$googlemap_location = $app->request()->params('googlemap_location');
$birthdate = $app->request()->params('birthdate');
$mobile_number = $app->request()->params(HAMMU_DB_MOBILE_NUMBER_KEY);
$meeting_point = $app->request()->params(HAMMU_DB_METTING_POINT_KEY);
$pay_pal_address = $app->request()->params(HAMMU_DB_PAYMENT_TYPE_KEY);
//hardik edited
$HOTEL_SERVICE = $app->request()->params(HAMMU_HOTEL_SERVICE);
$HOME_VISIT = $app->request()->params(HAMMU_HOME_VISIT);
$HAMMU_AVAILABLE_AT = urldecode($app->request()->params(HAMMU_AVAILABLE_AT));
$SECRET_FANTASY = $app->request()->params(HAMMU_SECRET_FANTASY);
$HAMMU_LANGUAGE = $app->request()->params(HAMMU_LANGUAGE);
$HAMMU_COUNTRY = $app->request()->params(HAMMU_COUNTRY);
//
$token = $app->request()->params('token');
$type = $app->request()->params('type');
$preferences = $app->request()->params(HAMMU_DB_SERVICES_KEY);
$lang = $app->request()->params(HAMMU_LANG);
$deviceId = $token;
$deviceType = $type;
$preferenceArr = explode(",", $preferences);
$langArr = explode(",", $lang);
//print_r($preferenceArr);
$preVal = 0;
foreach ($preferenceArr as $key => $value) {
$preVal = $preVal + $value;
}
$langVal = 0;
foreach ($langArr as $key => $value) {
$langVal = $langVal + $value;
}
//
$HAMMU_AVAILABLE_ATArr = explode(",", $HAMMU_AVAILABLE_AT);
//print_r($HAMMU_AVAILABLE_ATArr);
// die;
// $preVal1 = 0;
// foreach ($HAMMU_AVAILABLE_ATArr as $key => $value) {
// $preVal1 = $preVal1 + $value;
// }
$data["email"] = urldecode($email);
$data["username"] = $username;
$data['password'] = $password;
$data["googlemap_location"] = $googlemap_location;
$data["birthdate"] = $birthdate;
$data[HAMMU_DB_MOBILE_NUMBER_KEY] = $mobile_number;
$data["sex"] = $sex;
$today_date_timestamp = strtotime(date("d-m-Y"));
$birth_date_timestamp = strtotime($birthdate);
if ($birth_date_timestamp > $today_date_timestamp) {
$message = $language->text("hammu", "signup_error_prorper_date");
//"Please Provide Proper Date!";
$return_data = array("response_status" => "0", "response_message" => $message);
$app->response->setBody(json_encode($return_data));
} else {
$crdata = checkuserexists($data);
if (count($crdata) > 0) {
$app->response->setBody(json_encode($crdata));
} else {
$username = trim(preg_replace('/[^\\w]/', '', $username));
$username = makeUsername($username);
$data['realname'] = $username;
$newUser = false;
$accountdata = $SKADATE_BOL_AccountTypeToGenderDao->findByGenderValue($sex);
$accounttype = $accountdata[0]->accountType;
$user = $Userservice->createUser($username, $password, $data["email"], $accounttype, false);
$check_exist_value = $SKAPI_BOL_Service_inst->findValueExistOrNot($user->id);
if ($check_exist_value) {
$table_id = $check_exist_value[0]->id;
if ($table_id) {
$user_skapi_id = $check_exist_value[0]->id;
} else {
$user_skapi_id = "";
}
} else {
//.........这里部分代码省略.........
示例2: signup
function signup()
{
global $Userservice;
$app = \Slim\Slim::getInstance();
$app->response->headers->set('Content-Type', 'application/json');
$app->response->setStatus(200);
$email = $app->request()->params('email');
$username = $app->request()->params('username');
$password = $app->request()->params('password');
$birthdate = $app->request()->params('birthdate');
$address = $app->request()->params('address');
$mobile = $app->request()->params('mobile');
$i_am = $app->request()->params('i_am');
$looking_for = $app->request()->params('looking_for');
$preferences_or_services = $app->request()->params('preferences_or_services');
//$photo = $app->request()->params('photo');
$photo_data = $_FILES["photo"];
$token = $app->request()->params('token');
$type = $app->request()->params('type');
$deviceId = $token;
$deviceType = $type;
$data = $_POST;
checkuserexists($data);
$email = trim($data['email']);
$password = $data['password'];
$username = $data['username'];
// $tmpUsername = explode('@', $email);
// $username = $tmpUsername[0];
$username = trim(preg_replace('/[^\\w]/', '', $username));
$username = $this->makeUsername($username);
//extra question data
// $data['realname'] = $username;
//
// $accountype = (int) $data["sex"]; //(1 = Female, 2 = Male)
//
// $data["sex"] = (int) $data["sex"];
//
// $UserDob = date("Y/m/d", strtotime($data["birthdate"]));
//
// $data["birthdate"] = $UserDob;
$data['realname'] = $username;
$newUser = false;
try {
$user = BOL_UserService::getInstance()->createUser($username, $password, $email, null, true);
$newUser = true;
} catch (LogicException $ex) {
$userdata = array("status" => "false", "message" => "unsuccess", "error" => $ex->getCode());
echo json_encode($userdata);
exit;
}
unset($data['email']);
unset($data['password']);
unset($data['username']);
//Geo location settings on address
if (!empty($data["address"])) {
$urlencode_address = urlencode($data["address"]);
$geocode = file_get_contents('http://maps.google.com/maps/api/geocode/json?address=' . $urlencode_address . '&sensor=false');
$output = json_decode($geocode);
//echo print_r(json_encode($output->results));
if (!empty($output->results[0]->formatted_address)) {
$data['googlemap_location']['address'] = $output->results[0]->formatted_address;
$data['googlemap_location']['latitude'] = $output->results[0]->geometry->location->lat;
$data['googlemap_location']['longitude'] = $output->results[0]->geometry->location->lng;
$data['googlemap_location']['northEastLat'] = $output->results[0]->geometry->bounds->northeast->lat;
$data['googlemap_location']['northEastLng'] = $output->results[0]->geometry->bounds->northeast->lng;
$data['googlemap_location']['southWestLat'] = $output->results[0]->geometry->bounds->southwest->lat;
$data['googlemap_location']['southWestLng'] = $output->results[0]->geometry->bounds->southwest->lng;
$data['googlemap_location']['json'] = json_encode($output->results[0]);
}
}
BOL_QuestionService::getInstance()->saveQuestionsData(array_filter($data), $user->id);
//$avatarUrl = 'http://graph.facebook.com/' . $facebookId . '/picture?type=large&height=400&width=400';
//$pluginfilesDir = OW::getPluginManager()->getPlugin('skandroid')->getPluginFilesDir();
//$ext = 'jpg';
//$tmpFile = $pluginfilesDir . uniqid('avatar-') . (empty($ext) ? '' : '.' . $ext);
//copy($avatarUrl, $tmpFile);
// if (file_exists($tmpFile)) {
// BOL_AvatarService::getInstance()->setUserAvatar($user->id, $tmpFile);
// @unlink($tmpFile);
// }
// if (!$authAdapter->isRegistered()) {
// $authAdapter->register($user->id);
// }
if ($newUser) {
$event = new OW_Event(OW_EventManager::ON_USER_REGISTER, array('method' => 'native', 'userId' => $user->id, 'params' => array()));
OW::getEventManager()->trigger($event);
$userdata = $this->respondUserData($user->id, $data);
} else {
$userdata = array("status" => "false", "message" => "unsuccess");
}
echo json_encode($userdata);
exit;
}
示例3: signup
function signup()
{
global $Userservice;
global $SKADATE_BOL_AccountTypeToGenderDao;
global $BOL_AvatarService_inst;
$app = \Slim\Slim::getInstance();
$app->response->headers->set('Content-Type', 'application/json');
$app->response->setStatus(200);
//$match_sex = $app->request()->params('match_sex');
//$preferences_or_services = $app->request()->params('preferences_or_services');
//$photo = $app->request()->params('photo');
//$photo_data = $_FILES["photo"];
$username = $app->request()->params('username');
$email = $app->request()->params('email');
$password = $app->request()->params('password');
$realname = $app->request()->params('realname');
$sex = $app->request()->params('sex');
echo $i_m_using = $app->request()->params(HAMMU_DB_IM_USING_HAMMU_AS_KEY);
$googlemap_location = $app->request()->params('googlemap_location');
$birthdate = $app->request()->params('birthdate');
echo $mobile_number = $app->request()->params(HAMMU_DB_MOBILE_NUMBER_KEY);
$price = $app->request()->params(HAMMU_DB_PRICE_KEY);
$meeting_point = $app->request()->params(HAMMU_DB_METTING_POINT_KEY);
$pay_pal_address = $app->request()->params(HAMMU_DB_PAYPAL_KEY);
$token = $app->request()->params('token');
$type = $app->request()->params('type');
$preferences = $app->request()->params(HAMMU_DB_SERVICES_KEY);
$deviceId = $token;
$deviceType = $type;
exit;
$preferenceArr = explode(",", $preferences);
$preVal = 0;
foreach ($preferenceArr as $key => $value) {
$preVal = $preVal + $value;
}
$data["email"] = urldecode($email);
$data["username"] = $username;
$data['password'] = $password;
$data["googlemap_location"] = $googlemap_location;
$data["birthdate"] = $birthdate;
$data[HAMMU_DB_MOBILE_NUMBER_KEY] = $mobile_number;
$data["sex"] = $sex;
// $data["match_sex"] = $match_sex;
//$data["field_391797ad0e06d17d5b5cec0e48def7c2"] = $field_391797ad0e06d17d5b5cec0e48def7c2;
// $filed = array('field_f2d8bb949d7d74a70bcb2003abc5b436', 'field_f92bbdb57510b86ba6c506c487be3aa1');
// $all_services_preferences = getallquestions(array("user_id" => $user_id, "fields" => $filed));
// print_r($all_services_preferences);
//
// die;
// echo urldecode($data["email"]);
//// print_r($data);
// die;
$crdata = checkuserexists($data);
if (count($crdata) > 0) {
$app->response->setBody(json_encode($crdata));
} else {
// $email = trim($data['email']);
// $password = $data['password'];
// $username = $data['username'];
// $tmpUsername = explode('@', $email);
// $username = $tmpUsername[0];
$username = trim(preg_replace('/[^\\w]/', '', $username));
$username = makeUsername($username);
//extra question data
// $data['realname'] = $username;
//
// $accountype = (int) $data["sex"]; //(1 = Female, 2 = Male)
//
// $data["sex"] = (int) $data["sex"];
//
// $UserDob = date("Y/m/d", strtotime($data["birthdate"]));
//
// $data["birthdate"] = $UserDob;
$data['realname'] = $username;
$newUser = false;
$accountdata = $SKADATE_BOL_AccountTypeToGenderDao->findByGenderValue($sex);
//print_r($accountdata);
$accounttype = $accountdata[0]->accountType;
if ($accounttype == "8cc28eaddb382d7c6a94aeea9ec029fb") {
//$type = "services";
$type_value = "field_f92bbdb57510b86ba6c506c487be3aa1";
} else {
//$type = "preferences";
$type_value = "field_f2d8bb949d7d74a70bcb2003abc5b436";
}
$user = BOL_UserService::getInstance()->createUser($username, $password, $data["email"], $accounttype, true);
$newUser = true;
// } catch (LogicException $ex) {
// $userdata = array("status" => "false", "message" => "unsuccess", "error" => $ex->getCode());
// echo json_encode($userdata);
//exit();
// }
unset($data['email']);
unset($data['password']);
unset($data['username']);
//Geo location settings on address
if (!empty($data["googlemap_location"])) {
$urlencode_address = urlencode($data["googlemap_location"]);
$geocode = file_get_contents('http://maps.google.com/maps/api/geocode/json?address=' . $urlencode_address . '&sensor=false');
$output = json_decode($geocode);
//.........这里部分代码省略.........
示例4: signup
function signup()
{
global $Userservice;
global $SKADATE_BOL_AccountTypeToGenderDao;
global $BOL_AvatarService_inst;
$app = \Slim\Slim::getInstance();
$app->response->headers->set('Content-Type', 'application/json');
$app->response->setStatus(200);
//$match_sex = $app->request()->params('match_sex');
//$preferences_or_services = $app->request()->params('preferences_or_services');
//$photo = $app->request()->params('photo');
//$photo_data = $_FILES["photo"];
$username = $app->request()->params('username');
$email = $app->request()->params('email');
$password = $app->request()->params('password');
$realname = $app->request()->params('realname');
$sex = $app->request()->params('sex');
$i_m_using = $app->request()->params(HAMMU_DB_IM_USING_HAMMU_AS_KEY);
$googlemap_location = $app->request()->params('googlemap_location');
$birthdate = $app->request()->params('birthdate');
$mobile_number = $app->request()->params(HAMMU_DB_MOBILE_NUMBER_KEY);
$meeting_point = $app->request()->params(HAMMU_DB_METTING_POINT_KEY);
$pay_pal_address = $app->request()->params(HAMMU_DB_PAYMENT_TYPE_KEY);
$token = $app->request()->params('token');
$type = $app->request()->params('type');
$preferences = $app->request()->params(HAMMU_DB_SERVICES_KEY);
$deviceId = $token;
$deviceType = $type;
$preferenceArr = explode(",", $preferences);
$preVal = 0;
foreach ($preferenceArr as $key => $value) {
$preVal = $preVal + $value;
}
$data["email"] = urldecode($email);
$data["username"] = $username;
$data['password'] = $password;
$data["googlemap_location"] = $googlemap_location;
$data["birthdate"] = $birthdate;
$data[HAMMU_DB_MOBILE_NUMBER_KEY] = $mobile_number;
$data["sex"] = $sex;
$crdata = checkuserexists($data);
if (count($crdata) > 0) {
$app->response->setBody(json_encode($crdata));
} else {
$username = trim(preg_replace('/[^\\w]/', '', $username));
$username = makeUsername($username);
$data['realname'] = $username;
$newUser = false;
$accountdata = $SKADATE_BOL_AccountTypeToGenderDao->findByGenderValue($sex);
$accounttype = $accountdata[0]->accountType;
$user = BOL_UserService::getInstance()->createUser($username, $password, $data["email"], $accounttype, true);
$newUser = true;
unset($data['email']);
unset($data['password']);
unset($data['username']);
//Geo location settings on address
$price = $app->request()->params(HAMMU_DB_PRICE_KEY);
if (!empty($price)) {
$final_price = $price;
} else {
$final_price = "";
}
if (!empty($data["googlemap_location"])) {
$urlencode_address = urlencode($data["googlemap_location"]);
$geocode = file_get_contents('http://maps.google.com/maps/api/geocode/json?address=' . $urlencode_address . '&sensor=false');
$output = json_decode($geocode);
if (!empty($output->results[0]->formatted_address)) {
$data_location[HAMMU_DB_PRICE_KEY] = $final_price;
$data_location['googlemap_location']['address'] = $output->results[0]->formatted_address;
$data_location['googlemap_location']['latitude'] = $output->results[0]->geometry->location->lat;
$data_location['googlemap_location']['longitude'] = $output->results[0]->geometry->location->lng;
$data_location['googlemap_location']['northEastLat'] = $output->results[0]->geometry->bounds->northeast->lat;
$data_location['googlemap_location']['northEastLng'] = $output->results[0]->geometry->bounds->northeast->lng;
$data_location['googlemap_location']['southWestLat'] = $output->results[0]->geometry->bounds->southwest->lat;
$data_location['googlemap_location']['southWestLng'] = $output->results[0]->geometry->bounds->southwest->lng;
$data_location['googlemap_location']['json'] = json_encode($output->results[0]);
$data_location['birthdate'] = $data["birthdate"];
$data_location['sex'] = $sex;
$data_location['realname'] = $realname;
$data_location[HAMMU_DB_MOBILE_NUMBER_KEY] = $data[HAMMU_DB_MOBILE_NUMBER_KEY];
$data_location[HAMMU_DB_SERVICES_KEY] = $preVal;
$data_location[HAMMU_DB_PAYMENT_TYPE_KEY] = $pay_pal_address;
$data_location[HAMMU_DB_IM_USING_HAMMU_AS_KEY] = $i_m_using;
$data_location[HAMMU_DB_METTING_POINT_KEY] = $meeting_point;
}
}
if ($i_m_using == "1") {
$final_array = array_shift($data_location);
} else {
$final_array = $data_location;
}
print_r($data_location);
exit;
BOL_QuestionService::getInstance()->saveQuestionsData(array_filter($final_array), $user->id);
if (!empty($_FILES)) {
$files = $_FILES;
//PHOTO_BOL_PhotoService::getInstance()->getPhotoPath($data["photoId"], $data["hash"], 'original');
$path = $_FILES['photo']['tmp_name'];
$avtar = $BOL_AvatarService_inst->setUserAvatar($user->id, $path);
}
//.........这里部分代码省略.........