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


PHP users::updateSafetyPhone方法代码示例

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


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

示例1: SafetyPhoneNow

/**
 * Привязать телефон к аккаунту.
 */
function SafetyPhoneNow()
{
    session_start();
    return;
    // #0019588
    $aRes = array('success' => false);
    if (trim($_POST['phone']) == '') {
        $aRes['error'] = iconv('CP1251', 'UTF-8', 'Вы должны ввести номер телефона');
    } else {
        $users = new users();
        $sPhone = change_q(stripslashes($_POST['phone']), true);
        $aPhone = $users->CheckSafetyPhone($sPhone);
        if ($aPhone['error_flag'] == 1) {
            $aRes['error'] = iconv('CP1251', 'UTF-8', $aPhone['alert'][2]);
        } elseif (isset($_SESSION['uid'])) {
            $sPhoneOnly = $_POST['phone_only'] == 't' ? 't' : 'f';
            if ($users->updateSafetyPhone($_SESSION['uid'], $sPhone, $sPhoneOnly)) {
                $aRes['success'] = true;
            }
        }
    }
    echo json_encode($aRes);
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:26,代码来源:safetyphone.server.php

示例2: unauthCodeSMS

function unauthCodeSMS($code)
{
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sms_gate_a1.php';
    $objResponse = new xajaxResponse();
    $uid = get_uid();
    $reqv = sbr_meta::getUserReqvs($uid);
    $ureqv = $reqv[$reqv['form_type']];
    $sms_gate = new sms_gate_a1($ureqv['mob_phone']);
    $info = $sms_gate->getInfoSend();
    if ($info['data'] == $code) {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
        $user = new users();
        sbr_meta::authMobPhone($uid, false);
        sbr_meta::safetyMobPhone($uid, false);
        $user->updateSafetyPhone($uid, false);
        $html = '<a href="javascript:void(0)" class="b-button b-button_rectangle_color_transparent b-button_margtop_-2" data-send="safety"><span class="b-button__b1"><span class="b-button__b2"><span class="b-button__txt">Активировать</span></span></span></a>';
        if ($_SESSION['is_verify'] != 't') {
            $mobphone = "\$('safety_mob_phone').removeClass('b-combo__input_disabled'); \$('safety_mob_phone').getElement('input').set('disabled', false);";
        } else {
            $mobphone = '';
        }
        $objResponse->script("\$('auth_popup').set('html', '').hide();\n                              \$\$('.c_sms_main').set('html', '{$html}');\n                              \$\$('.safety_phone_checks').each( function(el) {\n                                  \$(el).getElements('input[type=checkbox]').set('disabled', true).set('checked', false);\n                              });\n                              {$mobphone}\n                              \$('safety_status').set('html', 'выключена');\n                              \$('safety_status').addClass('b-layout__txt_color_c10600').removeClass('b-layout__txt_color_6bb336');\n                              bindLinkActivateAuth();\n                              ");
        return $objResponse;
    }
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:25,代码来源:sbr.server.php

示例3: users

     }
     break;
 case "save_safety":
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/sbr.php";
     $post_safety_phone = true;
     $uid = get_uid(false);
     $code = __paramInit('int', null, 'smscode');
     $phone = $ureqv['mob_phone'];
     $user = new users();
     $only_phone = __paramInit('string', NULL, 'only_phone', 'f');
     $finance_safety_phone = __paramInit('string', NULL, 'finance_safety_phone', 'f');
     if (($o_only_phone == 't' || $reqv['is_safety_mob'] == 't') && $code == $_SESSION['send_sms_code'] && $phone == $_SESSION['send_sms_phone']) {
         $safety_complete = true;
         $o_only_phone = $only_phone;
         $reqv['is_safety_mob'] = $finance_safety_phone;
         $user->updateSafetyPhone($uid, $only_phone == 't' ? true : false);
         sbr_meta::safetyMobPhone($uid, $finance_safety_phone == 't' ? true : false);
         unset($_SESSION['send_sms_code'], $_SESSION['send_sms_phone']);
     } elseif ($o_only_phone == 't' && $o_only_phone != $only_phone || $reqv['is_safety_mob'] == 't' && $reqv['is_safety_mob'] != $finance_safety_phone) {
         $error_phone['code'] = true;
     }
     // Включение, без проверки СМС
     if ($o_only_phone == 'f' && $only_phone == 't' && !$safety_complete) {
         $o_only_phone = 't';
         $user->updateSafetyPhone($uid, true);
     }
     if ($reqv['is_safety_mob'] == 'f' && $finance_safety_phone == 't' && !$safety_complete) {
         $reqv['is_safety_mob'] = 't';
         sbr_meta::safetyMobPhone($uid, true);
     }
     break;
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:index.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;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:77,代码来源:users.server.php


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