本文整理汇总了PHP中sbr_meta::setUserReqv方法的典型用法代码示例。如果您正苦于以下问题:PHP sbr_meta::setUserReqv方法的具体用法?PHP sbr_meta::setUserReqv怎么用?PHP sbr_meta::setUserReqv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sbr_meta
的用法示例。
在下文中一共展示了sbr_meta::setUserReqv方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateSafetyPhone
/**
* Изменить данные привязки аккаунта к телефону.
*
* @param int $sUid UID пользователя
* @param string $sPhone телефон
* @param string $sPhoneOnly отправлять восстановление пароля только на телефон - 't' или 'f'
* @param string $sSafetyMob Входить в финансы только по СМС - 't' или 'f'
*
* @return object xajaxResponse
*/
function updateSafetyPhone($sUid = 0, $sPhone = '', $sPhoneOnly = 'f', $sSafetyMob = 'f')
{
session_start();
$objResponse = new xajaxResponse();
if (hasPermissions('users')) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sbr.php';
$sPhone = '+' . str_replace('+', '', $sPhone);
$reqv = sbr_meta::getUserReqvs($sUid);
if ($reqv[$reqv['form_type']]['mob_phone'] != $sPhone) {
$nreqv['mob_phone'] = $sPhone;
$cnt = 0;
$filter = array('search_phone_exact' => true, 'search_phone' => $nreqv['mob_phone']);
sbr_meta::searchUsersPhone($cnt, $filter);
if ($cnt > 0) {
$res = "Телефон {$sPhone} уже зарегистрирован в системе.";
$objResponse->assign("safety_phone{$sUid}", 'value', $reqv[$reqv['form_type']]['mob_phone']);
} else {
sbr_meta::$reqv_fields[$reqv['form_type']]['mob_phone']['maxlength'] = 15;
$error = sbr_meta::setUserReqv($sUid, $reqv['rez_type'], $reqv['form_type'], $nreqv);
}
}
$res = users::ChangeSafetyPhone($sUid, $sPhone, $sPhoneOnly);
$error = sbr_meta::safetyMobPhone($sUid, $sSafetyMob);
if ($res) {
$objResponse->alert($res);
$objResponse->script("\$('safety_phone_show{$sUid}').setStyle('display', '');");
} else {
$sChecked = $sPhoneOnly == 't' ? 'true' : 'false';
$sDisplay = $sPhoneOnly == 't' ? '' : 'none';
$sSafetyMobDisplay = $sSafetyMob == 't' ? '' : 'none';
$objResponse->assign("safety_phone_value{$sUid}", 'innerHTML', $sPhone);
$objResponse->assign("safety_phone_hidden{$sUid}", 'value', $sPhone);
$objResponse->script("\$('safety_only_phone_show{$sUid}').setStyle('display', '{$sDisplay}');");
$objResponse->script("\$('is_safety_mob_show{$sUid}').setStyle('display', '{$sSafetyMobDisplay}');");
$sDisplay = trim($sPhone) ? '' : 'none';
$objResponse->script("\$('safety_phone_show{$sUid}').setStyle('display', '{$sDisplay}');");
}
$objResponse->script("\$('safety_phone_edit{$sUid}').setStyle('display', 'none');");
}
return $objResponse;
}
示例2: attachedfiles
// сканы документов
$attachedFiles = new attachedfiles($_POST['attachedfiles_session']);
$attachedFiles_files = $attachedFiles->getFiles(array(1, 4));
$err = $account->addAttach2($attachedFiles_files);
// сохраняем файлы
$filesExists = count($attachedFiles->getFiles()) > 0;
$attachedFiles->clearBySession();
if ($err) {
$error_file['err_attach'] = $err;
} elseif (!$filesExists) {
$error_file['err_attach'] = "Необходимо загрузить скан одной или нескольких страниц паспорта.";
}
}
$required_error = sbr_meta::checkRequired($form_type, $rez_type, $reqvs[$form_type], is_emp($u->role));
$start_errors = array_merge($required_error, $error_file, $other_error);
if ($err = sbr_meta::setUserReqv($uid, $rez_type, $form_type, $reqvs[$form_type], $ft_disabled, $is_agree_view, $start_errors)) {
if (isset($err['mob_phone'])) {
$err['phone'] = $err['mob_phone'];
}
if (isset($err['phone']) && $err['phone'] === true) {
if (count($err) == 1) {
//отправляем смс
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sms_gate_a1.php';
$sms_gate = new sms_gate_a1($reqvs[$form_type]['phone']);
if (!$sms_gate->isNextSend()) {
$sms_gate->sendAuthCellCode(sms_gate::TYPE_ACTIVATE);
$_SESSION['sms_accept_code'] = $sms_gate->getAuthCode();
$_SESSION['sms_accept_phone'] = $reqvs[$form_type]['phone'];
if (SMS_GATE_DEBUG) {
$code_debug = $sms_gate->getAuthCode();
}
示例3: unset
sbr_meta::authMobPhone($uid, true);
$reqv['is_activate_mob'] = 't';
$error_phone = false;
unset($_SESSION["unbind_phone_action"]);
header_location_exit("/users/" . $_SESSION["login"] . "/setup/main/");
} else {
$error_phone['phone'] = current($text_error);
// Телефон забит
}
} else {
if ($type == 'unbind') {
// Сбрасываем все
$phone = '';
$save_reqv['mob_phone'] = '';
$ureqv['mob_phone'] = '';
sbr_meta::setUserReqv($uid, $reqv['rez_type'], $reqv['form_type'], $save_reqv);
// Удаляем телефон
sbr_meta::authMobPhone($uid, false);
sbr_meta::safetyMobPhone($uid, false);
$user->updateSafetyPhone($uid, false);
$reqv['is_activate_mob'] = 'f';
$_SESSION["unbind_phone_action"] = true;
header_location_exit("/users/" . $_SESSION["login"] . "/setup/main/");
}
}
} else {
$error_phone['code'] = true;
}
break;
case "save_safety":
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/sbr.php";
示例4: checkCode
function checkCode($phone, $code, $type = "bind")
{
$objResponse = new xajaxResponse();
$success = 0;
$reqv = sbr_meta::getUserReqvs(get_uid(false));
$ureqv = $reqv[$reqv['form_type']];
$uid = get_uid(false);
if ($type == 'unbind') {
$phone = $ureqv['mob_phone'];
}
$error = false;
if ($code == $_SESSION['send_sms_code'] && $phone == $_SESSION['send_sms_phone']) {
unset($_SESSION['send_sms_code'], $_SESSION['send_sms_phone']);
$user = new users();
$ureqv['mob_phone'] = $phone;
$save_reqv['mob_phone'] = $phone;
if ($type == 'bind') {
if (!($text_error = sbr_meta::setUserReqv($uid, $reqv['rez_type'], $reqv['form_type'], $save_reqv))) {
sbr_meta::authMobPhone($uid, true);
$reqv['is_activate_mob'] = 't';
unset($_SESSION["unbind_phone_action"]);
unset($_SESSION['send_sms_time']);
$success = 2;
} else {
$error = current($text_error);
// Телефон забит
}
} else {
if ($type == 'unbind') {
// Сбрасываем все
$phone = '';
$save_reqv['mob_phone'] = '';
$ureqv['mob_phone'] = '';
sbr_meta::setUserReqv($uid, $reqv['rez_type'], $reqv['form_type'], $save_reqv);
// Удаляем телефон
sbr_meta::authMobPhone($uid, false);
sbr_meta::safetyMobPhone($uid, false);
$user->updateSafetyPhone($uid, false);
$reqv['is_activate_mob'] = 'f';
$_SESSION["unbind_phone_action"] = true;
$success = 3;
}
}
} else {
$error = 'Неправильный код';
}
switch ($success) {
case 2:
//Прицепили телефон
$objResponse->script("\$('safety_status')" . ".set('text', 'включена')" . ".removeClass('b-layout__txt_color_c10600')" . ".addClass('b-layout__txt_color_6db335');");
$objResponse->script("\$('mob_phone_text').set('html', " . "'<a href=\"javascript:void(0)\" onclick=\"User_Phone.unbindStart();\" " . "class=\"b-layout__link b-layout__link_fontsize_11 b-layout__link_bordbot_dot_0f71c8\">Отвязать</a>')");
$objResponse->script("\$('mob_phone_text').removeClass('b-layout__txt_hide')");
$objResponse->script("\$('mob_code_block').addClass('b-layout__txt_hide');");
$objResponse->script("\$('buttons_step1').addClass('b-layout__txt_hide');");
$objResponse->script("\$('buttons_step2').removeClass('b-layout__txt_hide');");
break;
case 3:
//Отцепили телефон
$objResponse->script("\$('safety_status')" . ".set('text', 'выключена')" . ".removeClass('b-layout__txt_color_6db335')" . ".addClass('b-layout__txt_color_c10600');");
$objResponse->script("\$('mob_phone_text').set('text', 'без пробелов и дефиса')");
$objResponse->script("\$('sms_sent_ok').addClass('b-layout__txt_hide');");
$objResponse->script("\$('smscode').set('value', '');");
$objResponse->script("\$('buttons_step1').removeClass('b-layout__txt_hide');");
$objResponse->script("\$('buttons_step3').addClass('b-layout__txt_hide');");
break;
case 0:
default:
$objResponse->script("\$('smscode').getParent().addClass('b-combo__input_error');");
}
if ($error) {
$objResponse->script("\$('sms_error').set('html', '{$error}').removeClass('b-layout__txt_hide');");
} else {
$objResponse->script("\$('sms_error').addClass('b-layout__txt_hide');");
}
$objResponse->script("shadow_center();");
return $objResponse;
}