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


PHP users::ChangeSafetyPhone方法代码示例

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


在下文中一共展示了users::ChangeSafetyPhone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:52,代码来源:admin_log.server.php

示例2: array

         }
         $history_bill[$value['uid']][] = array('ammount' => $value['ammount'], 'op_date' => $value['op_date'], 'comments' => $value['descr'] . ($value['comments'] ? " ({$value['comments']})" : ''));
     }
     $no_more = 1;
     break;
 case 'change_email':
     $res = users::ChangeMail(trim($_POST['uid']), trim($_POST['email']));
     if ($res) {
         $_SESSION['a_alert_msg'] = $res;
     }
     ob_end_clean();
     header('Location: ?type=' . $_POST['s_type'] . '&page=' . $_POST['s_page'] . '&search=' . $_POST['s_search'] . '&searchip=' . $_POST['s_searchip'] . '&action=' . $_POST['s_action'] . '#user_' . $_POST['uid']);
     exit;
     break;
 case 'change_safety_phone':
     $res = users::ChangeSafetyPhone(trim($_POST['uid']), $_POST['safety_phone'], $_POST['safety_only_phone']);
     if ($res) {
         $_SESSION['a_alert_msg'] = $res;
     }
     ob_end_clean();
     header('Location: ?type=' . $_POST['s_type'] . '&page=' . $_POST['s_page'] . '&search=' . $_POST['s_search'] . '&searchip=' . $_POST['s_searchip'] . '&action=' . $_POST['s_action'] . '#user_' . $_POST['uid']);
     exit;
     break;
 case 'change_safety_ip':
     $res = users::ChangeSafetyIP(trim($_POST['uid']), $_POST['safety_ip']);
     if ($res) {
         $_SESSION['a_alert_msg'] = $res;
     }
     ob_end_clean();
     header('Location: ?type=' . $_POST['s_type'] . '&page=' . $_POST['s_page'] . '&search=' . $_POST['s_search'] . '&searchip=' . $_POST['s_searchip'] . '&action=' . $_POST['s_action'] . '#user_' . $_POST['uid']);
     exit;
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:inner_index.php

示例3: array

         }
         $history_bill[$value['uid']][] = array("ammount" => $value['ammount'], "op_date" => $value['op_date'], "comments" => $value['descr'] . ($value['comments'] ? " ({$value['comments']})" : ""));
     }
     $no_more = 1;
     break;
 case "change_email":
     $res = users::ChangeMail(trim($_POST["uid"]), trim($_POST["email"]));
     if ($res) {
         $_SESSION['a_alert_msg'] = $res;
     }
     ob_end_clean();
     header('Location: ?type=' . $_POST['s_type'] . '&page=' . $_POST['s_page'] . '&search=' . $_POST['s_search'] . '&searchip=' . $_POST['s_searchip'] . '&action=' . $_POST['s_action'] . '#user_' . $_POST['uid']);
     exit;
     break;
 case "change_safety_phone":
     $res = users::ChangeSafetyPhone(trim($_POST["uid"]), $_POST["safety_phone"], $_POST['safety_only_phone']);
     if ($res) {
         $_SESSION['a_alert_msg'] = $res;
     }
     ob_end_clean();
     header('Location: ?type=' . $_POST['s_type'] . '&page=' . $_POST['s_page'] . '&search=' . $_POST['s_search'] . '&searchip=' . $_POST['s_searchip'] . '&action=' . $_POST['s_action'] . '#user_' . $_POST['uid']);
     exit;
     break;
 case "change_safety_ip":
     $res = users::ChangeSafetyIP(trim($_POST["uid"]), $_POST["safety_ip"]);
     if ($res) {
         $_SESSION['a_alert_msg'] = $res;
     }
     ob_end_clean();
     header('Location: ?type=' . $_POST['s_type'] . '&page=' . $_POST['s_page'] . '&search=' . $_POST['s_search'] . '&searchip=' . $_POST['s_searchip'] . '&action=' . $_POST['s_action'] . '#user_' . $_POST['uid']);
     exit;
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:inner_index.php


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