本文整理汇总了PHP中profile_check函数的典型用法代码示例。如果您正苦于以下问题:PHP profile_check函数的具体用法?PHP profile_check怎么用?PHP profile_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了profile_check函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: libfile
}
}
}
if ($_FILES) {
require_once libfile('class/upload');
$upload = new discuz_upload();
foreach ($_FILES as $key => $file) {
if (!isset($_G['cache']['profilesetting'][$key])) {
continue;
}
if (!empty($file) && $file['error'] == 0 || !empty($space[$key]) && empty($_G['gp_deletefile'][$key])) {
$value = '1';
} else {
$value = '';
}
if (profile_check($key, $value, $space)) {
$upload->init($file, 'profile');
$attach = $upload->attach;
if (!$upload->error()) {
$upload->save();
if (!$upload->get_image_info($attach['target'])) {
@unlink($attach['target']);
continue;
}
$setarr[$key] = '';
$attach['attachment'] = dhtmlspecialchars(trim($attach['attachment']));
if ($vid && $verifyconfig['available'] && isset($verifyconfig['field'][$key])) {
if (isset($verifyinfo['field'][$key])) {
@unlink(getglobal('setting/attachdir') . './profile/' . $verifyinfo['field'][$key]);
$verifyarr[$key] = $attach['attachment'];
}
示例2: array
C::t('common_member' . $tableext)->update($_GET['uid'], array('avatarstatus' => 0));
uc_user_deleteavatar($uid);
}
$creditsnew = intval($creditsnew);
$regdatenew = strtotime($_GET['regdatenew']);
$lastvisitnew = strtotime($_GET['lastvisitnew']);
$secquesadd = $_GET['clearquestion'] ? ", secques=''" : '';
$signaturenew = censor($_GET['signaturenew']);
$sigstatusnew = $signaturenew ? 1 : 0;
$sightmlnew = discuzcode($signaturenew, 1, 0, 0, 0, $member['allowsigbbcode'] ? $member['allowcusbbcode'] ? 2 : 1 : 0, $member['allowsigimgcode'], 0);
$oltimenew = round($_GET['totalnew'] / 60);
$fieldadd = '';
$fieldarr = array();
include_once libfile('function/profile');
foreach ($_POST as $field_key => $field_val) {
if (isset($fields[$field_key]) && (profile_check($field_key, $field_val) || $_G['adminid'] == 1)) {
$fieldarr[$field_key] = $field_val;
}
}
if ($_GET['deletefile'] && is_array($_GET['deletefile'])) {
foreach ($_GET['deletefile'] as $key => $value) {
if (isset($fields[$key]) && $_G['cache']['profilesetting'][$key]['formtype'] == 'file') {
@unlink(getglobal('setting/attachdir') . './profile/' . $member[$key]);
$fieldarr[$key] = '';
}
}
}
if ($_FILES) {
$upload = new discuz_upload();
foreach ($_FILES as $key => $file) {
if (isset($fields[$key])) {
示例3: trim
}
$email = trim($_G['gp_email']);
$password = $_G['gp_password'];
}
$censorexp = '/^(' . str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote($_G['setting']['censoruser'] = trim($_G['setting']['censoruser']), '/')) . ')$/i';
if ($_G['setting']['censoruser'] && @preg_match($censorexp, $username)) {
showmessage('profile_username_protect');
}
$profile = $verifyarr = array();
foreach ($_G['cache']['fields_register'] as $field) {
$field_key = $field['fieldid'];
$field_val = $_G['gp_' . $field_key];
if ($field['formtype'] == 'file' && !empty($_FILES[$field_key]) && $_FILES[$field_key]['error'] == 0) {
$field_val = true;
}
if (!profile_check($field_key, $field_val)) {
showmessage('profile_required_info_invalid');
}
if ($field['needverify']) {
$verifyarr[$field_key] = $field_val;
} else {
$profile[$field_key] = $field_val;
}
}
if (isset($_POST['birthmonth']) && isset($_POST['birthday'])) {
$profile['constellation'] = get_constellation($_POST['birthmonth'], $_POST['birthday']);
}
if (isset($_POST['birthyear'])) {
$profile['zodiac'] = get_zodiac($_POST['birthyear']);
}
if ($_FILES) {
示例4: on_register
//.........这里部分代码省略.........
}
}
} else {
$ctrlip = $_G['clientip'];
}
if ($this->setting['regctrl']) {
if (C::t('common_regip')->count_by_ip_dateline($ctrlip, $_G['timestamp'] - $this->setting['regctrl'] * 3600)) {
showmessage('register_ctrl', NULL, array('regctrl' => $this->setting['regctrl']));
}
}
$setregip = null;
if ($this->setting['regfloodctrl']) {
$regip = C::t('common_regip')->fetch_by_ip_dateline($_G['clientip'], $_G['timestamp'] - 86400);
if ($regip) {
if ($regip['count'] >= $this->setting['regfloodctrl']) {
showmessage('register_flood_ctrl', NULL, array('regfloodctrl' => $this->setting['regfloodctrl']));
} else {
$setregip = 1;
}
} else {
$setregip = 2;
}
}
$profile = $verifyarr = array();
foreach ($_G['cache']['fields_register'] as $field) {
if (defined('IN_MOBILE')) {
break;
}
$field_key = $field['fieldid'];
$field_val = $_GET['' . $field_key];
if ($field['formtype'] == 'file' && !empty($_FILES[$field_key]) && $_FILES[$field_key]['error'] == 0) {
$field_val = true;
}
if (!profile_check($field_key, $field_val)) {
$showid = !in_array($field['fieldid'], array('birthyear', 'birthmonth')) ? $field['fieldid'] : 'birthday';
showmessage($field['title'] . lang('message', 'profile_illegal'), '', array(), array('showid' => 'chk_' . $showid, 'extrajs' => $field['title'] . lang('message', 'profile_illegal') . ($field['formtype'] == 'text' ? '<script type="text/javascript">' . '$(\'registerform\').' . $field['fieldid'] . '.className = \'px er\';' . '$(\'registerform\').' . $field['fieldid'] . '.onblur = function () { if(this.value != \'\') {this.className = \'px\';$(\'chk_' . $showid . '\').innerHTML = \'\';}}' . '</script>' : '')));
}
if ($field['needverify']) {
$verifyarr[$field_key] = $field_val;
} else {
$profile[$field_key] = $field_val;
}
}
if (!$activation) {
$uid = uc_user_register(addslashes($username), $password, $email, $questionid, $answer, $_G['clientip']);
if ($uid <= 0) {
if ($uid == -1) {
showmessage('profile_username_illegal');
} elseif ($uid == -2) {
showmessage('profile_username_protect');
} elseif ($uid == -3) {
showmessage('profile_username_duplicate');
} elseif ($uid == -4) {
showmessage('profile_email_illegal');
} elseif ($uid == -5) {
showmessage('profile_email_domain_illegal');
} elseif ($uid == -6) {
showmessage('profile_email_duplicate');
} else {
showmessage('undefined_action');
}
}
} else {
list($uid, $username, $email) = $activation;
}
$_G['username'] = $username;
示例5: on_register
//.........这里部分代码省略.........
}
}
} else {
$ctrlip = $_G['clientip'];
}
if ($this->setting['regctrl']) {
$query = DB::query("SELECT ip FROM " . DB::table('common_regip') . " WHERE ip LIKE '{$ctrlip}' AND count='-1' AND dateline>{$_G['timestamp']}-'" . $this->setting['regctrl'] . "'*3600 LIMIT 1");
if (DB::num_rows($query)) {
showmessage('register_ctrl', NULL, array('regctrl' => $this->setting['regctrl']));
}
}
$regipsql = '';
if ($this->setting['regfloodctrl']) {
if ($regattempts = DB::result_first("SELECT count FROM " . DB::table('common_regip') . " WHERE ip='{$_G['clientip']}' AND count>'0' AND dateline>'{$_G['timestamp']}'-86400")) {
if ($regattempts >= $this->setting['regfloodctrl']) {
showmessage('register_flood_ctrl', NULL, array('regfloodctrl' => $this->setting['regfloodctrl']));
} else {
$regipsql = "UPDATE " . DB::table('common_regip') . " SET count=count+1 WHERE ip='{$_G['clientip']}' AND count>'0'";
}
} else {
$regipsql = "INSERT INTO " . DB::table('common_regip') . " (ip, count, dateline)\r\n\t\t\t\t\t\tVALUES ('{$_G['clientip']}', '1', '{$_G['timestamp']}')";
}
}
$profile = $verifyarr = array();
foreach ($_G['cache']['fields_register'] as $field) {
if (defined('IN_MOBILE')) {
break;
}
$field_key = $field['fieldid'];
$field_val = $_G['gp_' . $field_key];
if ($field['formtype'] == 'file' && !empty($_FILES[$field_key]) && $_FILES[$field_key]['error'] == 0) {
$field_val = true;
}
if (!profile_check($field_key, $field_val)) {
$showid = !in_array($field['fieldid'], array('birthyear', 'birthmonth')) ? $field['fieldid'] : 'birthday';
showmessage($field['title'] . lang('message', 'profile_illegal'), '', array(), array('showid' => 'chk_' . $showid, 'extrajs' => $field['title'] . lang('message', 'profile_illegal') . ($field['formtype'] == 'text' ? '<script type="text/javascript">' . '$(\'registerform\').' . $field['fieldid'] . '.className = \'px er\';' . '$(\'registerform\').' . $field['fieldid'] . '.onblur = function () { if(this.value != \'\') {this.className = \'px\';$(\'chk_' . $showid . '\').innerHTML = \'\';}}' . '</script>' : '')));
}
if ($field['needverify']) {
$verifyarr[$field_key] = $field_val;
} else {
$profile[$field_key] = $field_val;
}
}
if (!$activation) {
$uid = uc_user_register($username, $password, $email, $questionid, $answer, $_G['clientip']);
if ($uid <= 0) {
if ($uid == -1) {
showmessage('profile_username_illegal');
} elseif ($uid == -2) {
showmessage('profile_username_protect');
} elseif ($uid == -3) {
showmessage('profile_username_duplicate');
} elseif ($uid == -4) {
showmessage('profile_email_illegal');
} elseif ($uid == -5) {
showmessage('profile_email_domain_illegal');
} elseif ($uid == -6) {
showmessage('profile_email_duplicate');
} else {
showmessage('undefined_action');
}
}
} else {
list($uid, $username, $email) = $activation;
}
$_G['username'] = $username;
示例6: on_register
//.........这里部分代码省略.........
if (in_array(2, $this->setting['strongpw']) && !preg_match("/[a-z]+/", $_GET['password'])) {
$strongpw_str[] = lang('user/template', 'strongpw_2');
}
if (in_array(3, $this->setting['strongpw']) && !preg_match("/[A-Z]+/", $_GET['password'])) {
$strongpw_str[] = lang('user/template', 'strongpw_3');
}
if (in_array(4, $this->setting['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['password'])) {
$strongpw_str[] = lang('user/template', 'strongpw_4');
}
if ($strongpw_str) {
showmessage(lang('user/template', 'password_weak') . implode(',', $strongpw_str));
}
}
//验证两次密码一致性
if ($_GET['password'] !== $_GET['password2']) {
showmessage('两次密码不匹配');
}
if (!$_GET['password'] || $_GET['password'] != addslashes($_GET['password'])) {
showmessage('profile_passwd_illegal');
}
$password = $_GET['password'];
$ctrlip = $_G['clientip'];
$setregip = null;
$profile = $verifyarr = array();
foreach ($_G['cache']['fields_register'] as $field) {
/*if(defined('IN_MOBILE')) {
break;
}*/
$field_key = $field['fieldid'];
$field_val = $_GET['' . $field_key];
if ($field['formtype'] == 'file' && !empty($_FILES[$field_key]) && $_FILES[$field_key]['error'] == 0) {
$field_val = true;
}
if (!profile_check($field_key, $field_val)) {
$showid = !in_array($field['fieldid'], array('birthyear', 'birthmonth')) ? $field['fieldid'] : 'birthday';
showmessage($field['title'] . lang('message', 'profile_illegal'), '', array(), array('showid' => 'chk_' . $showid, 'extrajs' => $field['title'] . lang('message', 'profile_illegal') . ($field['formtype'] == 'text' ? '<script type="text/javascript">' . '$(\'registerform\').' . $field['fieldid'] . '.parentNode.parentNode.className = \'form-group warning\';' . '$(\'registerform\').' . $field['fieldid'] . '.onblur = function () { if(this.value != \'\') {this.parentNode.parentNode.className = \'form-group\';$(\'chk_' . $showid . '\').innerHTML = \'\';}}' . '</script>' : '')));
}
if ($field['needverify']) {
$verifyarr[$field_key] = $field_val;
} else {
$profile[$field_key] = $field_val;
}
}
$groupinfo = array();
$addorg = 0;
if ($this->setting['regverify']) {
$groupinfo['groupid'] = 8;
} else {
$groupinfo['groupid'] = $this->setting['newusergroupid'];
$addorg = 1;
}
$result = uc_user_register(addslashes($username), $password, $email, addslashes($nickname), $questionid, $answer, $_G['clientip'], $addorg);
if (is_array($result)) {
$uid = $result['uid'];
$password = $result['password'];
} else {
$uid = $result;
}
if ($uid <= 0) {
if ($uid == -1) {
showmessage('profile_nickname_illegal');
} elseif ($uid == -2) {
showmessage('profile_nickname_protect');
} elseif ($uid == -3) {
showmessage('profile_nickname_duplicate');
} elseif ($uid == -4) {
示例7: uc_user_deleteavatar
if ($_G['gp_clearavatar']) {
uc_user_deleteavatar($member['uid']);
}
$creditsnew = intval($creditsnew);
$regdatenew = strtotime($_G['gp_regdatenew']);
$lastvisitnew = strtotime($_G['gp_lastvisitnew']);
$secquesadd = $_G['gp_clearquestion'] ? ", secques=''" : '';
$signaturenew = censor($_G['gp_signaturenew']);
$sigstatusnew = $signaturenew ? 1 : 0;
$sightmlnew = addslashes(discuzcode(dstripslashes($signaturenew), 1, 0, 0, 0, $member['allowsigbbcode'] ? $member['allowcusbbcode'] ? 2 : 1 : 0, $member['allowsigimgcode'], 0));
$oltimenew = round($_G['gp_totalnew'] / 60);
$fieldadd = '';
$fieldarr = array();
include_once libfile('function/profile');
foreach ($_POST as $field_key => $field_val) {
if (isset($fields[$field_key]) && profile_check($field_key, $field_val)) {
$fieldarr[] = "{$field_key}='" . $field_val . "'";
}
}
$emailadd = $ucresult < 0 ? '' : "email='{$emailnew}', ";
$passwordadd = $ucresult < 0 ? '' : ", password='" . md5(random(10)) . "'";
$addsize = intval($_G['gp_addsizenew']);
$addfriend = intval($_G['gp_addfriendnew']);
$status = intval($_G['gp_status']);
DB::query("UPDATE " . DB::table('common_member') . " SET {$emailadd} regdate='{$regdatenew}', status='{$status}', timeoffset='{$_G['gp_timeoffsetnew']}' {$passwordadd} WHERE uid='{$_G['gp_uid']}'");
DB::query("UPDATE " . DB::table('common_member_field_home') . " SET addsize='{$addsize}', addfriend='{$addfriend}' WHERE uid='{$_G['gp_uid']}'");
DB::query("UPDATE " . DB::table('common_member_count') . " SET posts='{$_G['gp_postsnew']}', digestposts='{$_G['gp_digestpostsnew']}' WHERE uid='{$_G['gp_uid']}'");
DB::query("UPDATE " . DB::table('common_member_status') . " SET regip='{$_G['gp_regipnew']}', lastvisit='{$lastvisitnew}', lastip='{$_G['gp_lastipnew']}' WHERE uid='{$_G['gp_uid']}'");
DB::query("UPDATE " . DB::table('common_member_field_forum') . " SET customstatus='{$_G['gp_cstatusnew']}', sightml='{$sightmlnew}' WHERE uid='{$_G['gp_uid']}'");
if ($fieldarr) {
$fieldadd = implode(',', $fieldarr);
示例8: _adminUserInfo
//.........这里部分代码省略.........
if (in_array($key, $forumfield)) {
if ($key == 'sightml') {
loadcache(array('smilies', 'smileytypes'));
$value = cutstr($value, $_G['group']['maxsigsize'], '');
foreach ($_G['cache']['smilies']['replacearray'] as $skey => $smiley) {
$_G['cache']['smilies']['replacearray'][$skey] = '[img]' . $_G['siteurl'] . 'static/image/smiley/' . $_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$skey]]['directory'] . '/' . $smiley . '[/img]';
}
$value = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], trim($value));
$forum[$key] = discuzcode($value, 1, 0, 0, 0, $_G['group']['allowsigbbcode'], $_G['group']['allowsigimgcode'], 0, 0, 1);
} elseif ($key == 'customstatus' && $allowcstatus) {
$forum[$key] = dhtmlspecialchars(trim($value));
}
continue;
} elseif ($field && !$field['available']) {
continue;
} elseif ($key == 'timeoffset') {
if ($value >= -12 && $value <= 12 || $value == 9999) {
C::t('common_member')->update($_G['uid'], array('timeoffset' => intval($value)));
}
} elseif ($key == 'site') {
if (!in_array(strtolower(substr($value, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://')) && !preg_match('/^static\\//', $value) && !preg_match('/^data\\//', $value)) {
$value = 'http://' . $value;
}
}
if ($field['formtype'] == 'file') {
if (!empty($_FILES[$key]) && $_FILES[$key]['error'] == 0 || !empty($space[$key]) && empty($_GET['deletefile'][$key])) {
$value = '1';
} else {
$value = '';
}
}
if (empty($field)) {
continue;
} elseif (profile_check($key, $value, $space)) {
$setarr[$key] = dhtmlspecialchars(trim($value));
} else {
if ($key == 'birthprovince') {
$key = 'birthcity';
} elseif ($key == 'resideprovince' || $key == 'residecommunity' || $key == 'residedist') {
$key = 'residecity';
} elseif ($key == 'birthyear' || $key == 'birthmonth') {
$key = 'birthday';
}
// profile_showerror($key);
$list = $this->makeErrorInfo($res, 'check_date_item');
$errcode = $list['errcode'] . $settings[$key]['title'];
$this->_exitWithHtmlAlert($errcode);
}
if ($field['formtype'] == 'file') {
unset($setarr[$key]);
}
if ($vid && $verifyconfig['available'] && isset($verifyconfig['field'][$key])) {
if (isset($verifyinfo['field'][$key]) && $setarr[$key] !== $space[$key]) {
$verifyarr[$key] = $setarr[$key];
}
unset($setarr[$key]);
}
if (isset($setarr[$key]) && $_G['cache']['profilesetting'][$key]['needverify']) {
if ($setarr[$key] !== $space[$key]) {
$verifyarr[$key] = $setarr[$key];
}
unset($setarr[$key]);
}
}
if ($vid && !empty($verifyinfo['field']) && is_array($verifyinfo['field'])) {
foreach ($verifyinfo['field'] as $key => $fvalue) {