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


PHP sbr_meta::findSafetyPhone方法代码示例

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


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

示例1: actionRegistrationMobile

 /**
  * Регистрация через API мобильного приложения. Начало.
  * 
  * @param  array $aParams массив входящих данных
  * @return bool true - успех, false - провал
  */
 public function actionRegistrationMobile($aParams = array())
 {
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sbr_meta.php';
     $this->setFieldInfo('role', __paramValue('int', $aParams['role']));
     $this->setFieldInfo('login', trim(__paramValue('string', $aParams['username'])));
     $this->setFieldInfo('email', trim(__paramValue('string', $aParams['email'])));
     $this->setFieldInfo('phone', trim(preg_replace("#[\\D]#", "", __paramValue('string', $aParams['phone']))));
     $this->setFieldInfo('password', stripslashes($aParams['password']));
     $this->checkedFields(true);
     if (!$this->role) {
         $this->error['role'] = 'Не указан параметр - Роль пользователя';
         $this->errno['role'] = 1;
     } elseif ($this->role > 2) {
         $this->error['role'] = 'Ошибочный параметр - Роль пользователя';
         $this->errno['role'] = 2;
     }
     if ((is_release() || $this->phone != 71111112222) && sbr_meta::findSafetyPhone($this->phone, $this->role == 2 ? 'emp' : 'frl')) {
         $this->error['phone'] = 'Пользователь с таким номером уже зарегистрирован';
         $this->errno['phone'] = 3;
     }
     if (empty($this->error)) {
         $_SESSION['api_reg_role'] = $this->role;
         $_SESSION['api_reg_login'] = substr($this->login, 0, 15);
         $_SESSION['api_reg_email'] = substr($this->email, 0, 64);
         $_SESSION['api_reg_passwd'] = substr($this->password, 0, 24);
         $_SESSION['api_reg_phone'] = $this->phone;
         // отправляем смс для подтверждения телефона
         $_SESSION['send_sms_time'] = 0;
         $_SESSION['regform_captcha_entered'] = true;
         $nCode = $this->actionSendSms(false, true);
     }
     return empty($this->error) && !empty($nCode);
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:39,代码来源:registration.php

示例2: RemindByPhone

function RemindByPhone($phone, $rnd, $captchanum)
{
    session_start();
    $objResponse = new xajaxResponse();
    $captcha = new captcha($captchanum);
    if (!$captcha->checkNumber(trim($rnd))) {
        $error = 'Вы ввели неверную комбинацию букв';
        $captcha->setNumber();
        $objResponse->assign('image_rnd2', 'src', '/image.php?num=' . $captchanum . '&t=' . time());
        $objResponse->assign('remind_phone_error', 'innerHTML', $error);
        $objResponse->assign('remind_rnd2', 'value', '');
        $objResponse->script("\$('remind_button_phone').removeClass('b-button_rectangle_color_disable');\n                              \$('remind_phone_msg').removeClass('b-layout__txt_hide');  \n        ");
    } else {
        $phone = trim($phone);
        $i_phone = users::CheckSafetyPhone($phone);
        if ($i_phone['error_flag'] || trim($phone) == '') {
            $captcha->setNumber();
            $objResponse->assign('remind_phone_error', 'innerHTML', 'Вы ввели телефон в недопустимом формате');
            $objResponse->assign('image_rnd2', 'src', '/image.php?num=2&t=' . time());
            $objResponse->assign('remind_rnd2', 'value', '');
            $objResponse->assign('remind_phone', 'value', $phone);
            $objResponse->script("\$('remind_button_phone').removeClass('b-button_rectangle_color_disable');\n                                  \$('remind_phone_msg').removeClass('b-layout__txt_hide');  \n            ");
        } else {
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sms_gate_a1.php';
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sbr_meta.php';
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
            $safety = sbr_meta::findSafetyPhone($phone);
            if ($safety['safety_only_phone'] == 'f' || empty($safety)) {
                $error = 'Этот номер телефона не связан ни с одним аккаунтом. Попробуйте восстановить доступ через  <a class="b-layout__link b-layout__link_bordbot_dot_0f71c8" href="#">логин или email</a>';
                $captcha->setNumber();
                $objResponse->assign('remind_phone_error', 'innerHTML', $error);
                $objResponse->assign('image_rnd2', 'src', '/image.php?num=' . $captchanum . '&t=' . time());
                $objResponse->assign('remind_rnd2', 'value', '');
                $objResponse->assign('remind_phone', 'value', $phone);
                $objResponse->script("\$('remind_button_phone').removeClass('b-button_rectangle_color_disable');\n                                      \$('remind_phone_msg').removeClass('b-layout__txt_hide');  \n                ");
            } else {
                $passwd = users::ResetPasswordSMS($safety['uid'], $phone);
                $sms_gate = new sms_gate_a1($phone);
                $sms_gate->sendSMS($sms_gate->getTextMessage(sms_gate::TYPE_PASS, $passwd));
                if ($sms_gate->getHTTPCode() == 200) {
                    $html = '<span class="b-icon b-icon_sbr_gattent"></span>На указанный вами номер выслан новый пароль для входа в систему.';
                    if (SMS_GATE_DEBUG) {
                        $html .= ' <strong style="color:red">(DEBUG TEST: ' . $passwd . ')</strong>';
                    }
                    $objResponse->script("\$('remind_button_phone').removeClass('b-button_rectangle_color_disable');\n                                          \$('remind_phone_msg').addClass('b-layout__txt_hide');\n                                          var e = new Element('div', {html: '{$html}', class: 'b-layout__txt b-layout__txt_padtop_15'});\n                                          \$('sms_remind').getElement('table').destroy();\n                                          \$('sms_remind').getElement('h3').grab(e, 'after');\n                    ");
                } else {
                    $error = 'Ошибка отправки СМС на указанный номер';
                    $captcha->setNumber();
                    $objResponse->assign('remind_phone_error', 'innerHTML', $error);
                    $objResponse->assign('image_rnd2', 'src', '/image.php?num=' . $captchanum . '&t=' . time());
                    $objResponse->assign('remind_rnd2', 'value', '');
                    $objResponse->assign('remind_phone', 'value', $phone);
                    $objResponse->script("\$('remind_button_phone').removeClass('b-button_rectangle_color_disable');\n                                          \$('remind_phone_msg').removeClass('b-layout__txt_hide');  \n                    ");
                }
            }
        }
    }
    return $objResponse;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:59,代码来源:remind.server.php


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