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


PHP captcha::report方法代码示例

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


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

示例1: on_login

	function on_login() {
		global $_G;
		if($_G['uid']) {
			$referer = dreferer();
			$ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';
			$param = array('username' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['member']['uid']);
			showmessage('login_succeed', $referer ? $referer : './', $param, array('showdialog' => 1, 'locationtime' => true, 'extrajs' => $ucsynlogin));
		}

		list($seccodecheck) = seccheck('login');
		if(!empty($_GET['auth'])) {
			$dauth = authcode($_GET['auth'], 'DECODE', $_G['config']['security']['authkey']);
			list(,,,$secchecklogin2) = explode("\t", $dauth);
			if($secchecklogin2) {
				$seccodecheck = true;
			}
		}
		$seccodestatus = !empty($_GET['lssubmit']) ? false : $seccodecheck;
		$invite = getinvite();

		if(!submitcheck('loginsubmit', 1, $seccodestatus)) {

			$auth = '';
			$username = !empty($_G['cookie']['loginuser']) ? dhtmlspecialchars($_G['cookie']['loginuser']) : '';

			if(!empty($_GET['auth'])) {
				list($username, $password, $questionexist) = explode("\t", authcode($_GET['auth'], 'DECODE', $_G['config']['security']['authkey']));
				$username = dhtmlspecialchars($username);
				$auth = dhtmlspecialchars($_GET['auth']);
			}

			$cookietimecheck = !empty($_G['cookie']['cookietime']) || !empty($_GET['cookietime']) ? 'checked="checked"' : '';

			if($seccodecheck) {
				$seccode = random(6, 1) + $seccode{0} * 1000000;
			}

			if($this->extrafile && file_exists($this->extrafile)) {
				require_once $this->extrafile;
			}

			$navtitle = lang('core', 'title_login');
			include template($this->template);

		} else {

			if(!empty($_GET['auth'])) {
				list($_GET['username'], $_GET['password']) = daddslashes(explode("\t", authcode($_GET['auth'], 'DECODE', $_G['config']['security']['authkey'])));
			}

			$loginhash = !empty($_GET['loginhash']) && preg_match('/^\w+$/', $_GET['loginhash']) ? $_GET['loginhash'] : '';

			if(!($_G['member_loginperm'] = logincheck($_GET['username']))) {
				captcha::report($_G['clientip']);
				showmessage('login_strike');
			}
			if($_GET['fastloginfield']) {
				$_GET['loginfield'] = $_GET['fastloginfield'];
			}
			$_G['uid'] = $_G['member']['uid'] = 0;
			$_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
			if(!$_GET['password'] || $_GET['password'] != addslashes($_GET['password'])) {
				showmessage('profile_passwd_illegal');
			}
			$result = userlogin($_GET['username'], $_GET['password'], $_GET['questionid'], $_GET['answer'], $this->setting['autoidselect'] ? 'auto' : $_GET['loginfield'], $_G['clientip']);
			$uid = $result['ucresult']['uid'];

			if(!empty($_GET['lssubmit']) && ($result['ucresult']['uid'] == -3 || $seccodecheck)) {
				$_GET['username'] = $result['ucresult']['username'];
				$this->logging_more($result['ucresult']['uid'] == -3);
			}

			if($result['status'] == -1) {
				if(!$this->setting['fastactivation']) {
					$auth = authcode($result['ucresult']['username']."\t".FORMHASH, 'ENCODE');
					showmessage('location_activation', 'member.php?mod='.$this->setting['regname'].'&action=activation&auth='.rawurlencode($auth).'&referer='.rawurlencode(dreferer()), array(), array('location' => true));
				} else {
					$init_arr = explode(',', $this->setting['initcredits']);
					$groupid = $this->setting['regverify'] ? 8 : $this->setting['newusergroupid'];

					C::t('common_member')->insert($uid, $result['ucresult']['username'], md5(random(10)), $result['ucresult']['email'], $_G['clientip'], $groupid, $init_arr);
					$result['member'] = getuserbyuid($uid);
					$result['status'] = 1;
				}
			}

			if($result['status'] > 0) {

				if($this->extrafile && file_exists($this->extrafile)) {
					require_once $this->extrafile;
				}

				setloginstatus($result['member'], $_GET['cookietime'] ? 2592000 : 0);
				checkfollowfeed();
				if($_G['group']['forcelogin']) {
					if($_G['group']['forcelogin'] == 1) {
						clearcookies();
						showmessage('location_login_force_qq');
					} elseif($_G['group']['forcelogin'] == 2 && $_GET['loginfield'] != 'email') {
						clearcookies();
//.........这里部分代码省略.........
开发者ID:hutao1004,项目名称:yintt,代码行数:101,代码来源:class_member.php

示例2: elseif

                 for ($i = 1; $i <= 4; $i++) {
                     if ($banned["ip{$i}"] == -1) {
                         $exists++;
                     } elseif ($banned["ip{$i}"] == ${"ip" . $i . "new"}) {
                         $exists++;
                     }
                 }
                 if ($exists == 4) {
                     cpmsg('members_ipban_invalid', '', 'error');
                 }
             }
             $expiration = TIMESTAMP + $_GET['validitynew'] * 86400;
             C::app()->session->update_by_ipban($_GET['ip1new'], $_GET['ip2new'], $_GET['ip3new'], $_GET['ip4new']);
             $data = array('ip1' => $_GET['ip1new'], 'ip2' => $_GET['ip2new'], 'ip3' => $_GET['ip3new'], 'ip4' => $_GET['ip4new'], 'admin' => $_G['username'], 'dateline' => $_G['timestamp'], 'expiration' => $expiration);
             C::t('common_banned')->insert($data);
             captcha::report($_GET['ip1new'] . '.' . $_GET['ip2new'] . '.' . $_GET['ip3new'] . '.' . $_GET['ip4new']);
         }
         if (is_array($_GET['expirationnew'])) {
             foreach ($_GET['expirationnew'] as $id => $expiration) {
                 C::t('common_banned')->update_expiration_by_id($id, strtotime($expiration), $_G['adminid'], $_G['username']);
             }
         }
         updatecache('ipbanned');
         cpmsg('members_ipban_succeed', 'action=members&operation=ipban', 'succeed');
     }
 } elseif ($_GET['ipact'] == 'input') {
     if ($_G['adminid'] != 1) {
         cpmsg('members_ipban_nopermission', '', 'error');
     }
     if (!submitcheck('ipbansubmit')) {
         shownav('user', 'nav_members_ipban');
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:31,代码来源:admincp_members.php

示例3: ipbanadd

function ipbanadd($ip1new, $ip2new, $ip3new, $ip4new, $validitynew, &$error)
{
    global $_G;
    if ($ip1new != '' && $ip2new != '' && $ip3new != '' && $ip4new != '') {
        $own = 0;
        $ip = explode('.', $_G['clientip']);
        for ($i = 1; $i <= 4; $i++) {
            if (!is_numeric(${'ip' . $i . 'new'}) || ${'ip' . $i . 'new'} < 0) {
                if ($_G['adminid'] != 1) {
                    $error = 1;
                    return FALSE;
                }
                ${'ip' . $i . 'new'} = -1;
                $own++;
            } elseif (${'ip' . $i . 'new'} == $ip[$i - 1]) {
                $own++;
            }
            ${'ip' . $i . 'new'} = intval(${'ip' . $i . 'new'}) > 255 ? 255 : intval(${'ip' . $i . 'new'});
        }
        if ($own == 4) {
            $error = 2;
            return FALSE;
        }
        $query = DB::query("SELECT * FROM " . DB::table('common_banned') . " WHERE (ip1='{$ip1new}' OR ip1='-1') AND (ip2='{$ip2new}' OR ip2='-1') AND (ip3='{$ip3new}' OR ip3='-1') AND (ip4='{$ip4new}' OR ip4='-1')");
        if ($banned = C::t('common_banned')->fetch_by_ip($ip1new, $ip2new, $ip3new, $ip4new)) {
            $error = 3;
            return FALSE;
        }
        $expiration = $validitynew > 1 ? TIMESTAMP + $validitynew * 86400 : TIMESTAMP + 86400;
        C::app()->session->update_by_ipban($ip1new, $ip2new, $ip3new, $ip4new);
        $data = array('ip1' => $ip1new, 'ip2' => $ip2new, 'ip3' => $ip3new, 'ip4' => $ip4new, 'admin' => $_G['username'], 'dateline' => $_G['timestamp'], 'expiration' => $expiration);
        C::t('common_banned')->insert($data);
        captcha::report($ip1new . '.' . $ip2new . '.' . $ip3new . '.' . $ip4new);
        return TRUE;
    }
    return FALSE;
}
开发者ID:lemonstory,项目名称:bbs,代码行数:37,代码来源:modcp_member.php


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