예제 #1
0
	if(!In_Names($tname,$udata['friends'])) MessageBox('该用户不在好友列表中');
	$friends=explode('|',$udata['friends']);
	foreach($friends as $k=>$n)
		if( IsSameName($n,$tname))
		{
			unset($friends[$k]);
			break;
		}
	$udata['friends']=implode('|',$friends);
	$sql="UPDATE $cfg[tb_members] SET friends='$udata[friends]' WHERE u_id='$udata[u_id]' LIMIT 1";
	RenDB_Query($sql,true);
	header("Location: m_fb.php?action=view");
	exit();
	break;
case 'b_add':
	if(!IsMember($tname)) ErrorBox('用户不存在');
	if(IsSameName($tname,$udata['u_name'])) MessageBox('不能加自己');
	if(strlen($udata['blacklist']) >= $cfg['max_blacklist']) MessageBox('您的黑名单已经满了');
	if(In_Names($tname,$udata['blacklist'])) MessageBox('该用户已经在黑名单中了');
	if(In_Names($tname,$udata['friends']))
	{
		//从黑名单中删除
		$friends=explode('|',$udata['friends']);
		foreach($friends as $k=>$n)
		{
			if(IsSameName($tname,$n))
			{
				unset($friends[$k]);
				break;
			}
		}
예제 #2
0
	ShowFooter();
	break;
case 'reg2':
	SetNoUseCache();
	if( !$cfg['register_enable']) MessageBox('目前暂停注册新账号');
	if(!isset($reg_name)||!isset($reg_pass)||!isset($reg_pass2)||!isset($reg_email))
		ErrorBox( $str['act_err'] );
	$show_email=isset($show_email)?1:0;

	if( $cfg['max_user_per_ip']!=-1 &&  UserCountOfIP($userip) > $cfg['max_user_per_ip'] )
		MessageBox('你的ip不能再注册新账号了');

	if(($code=Check_U_Name($reg_name))!==true)
		MessageBox($code);

	if( IsMember( $reg_name ) )
		MessageBox('该用户名已经被注册了');

	if(($code=Check_U_Email($reg_email))!==true)
		MessageBox($code);

	if($reg_pass!=$reg_pass2)
		MessageBox('两次输入的密码不一致');

	if(($code=Check_U_Pass($reg_pass))!==true)
		MessageBox($code);

	//insert into database
	$checkcode=md5(uniqid(rand()));
	$password=md5($reg_pass);
	$sql ="INSERT INTO $cfg[tb_members] SET ";
예제 #3
0
 }
 require_once '../include/txt_func.php';
 $description = CSubStr($description, 0, 65533);
 $cp_name = CSubStr($cp_name, 0, 253);
 $group_player = str_replace("\r\n", "\n", $group_player);
 $group_player = explode("\n\n", $group_player);
 require_once '../include/m_func.php';
 $players = array();
 foreach ($group_player as $k => $v) {
     $v = explode("\n", $v);
     foreach ($v as $k1 => $v1) {
         $v1 = trim($v1);
         $v[$k1] = $v1;
         if ($v1 == '') {
             unset($v[$k1]);
         } elseif (!IsMember($v1)) {
             ACP_MessageBox("{$v1}不是注册用户");
         }
     }
     if (count($v) == 0) {
         continue;
     }
     if (count($v) < 2) {
         ACP_MessageBox(chr(65 + $k) . '组人数不够');
     }
     $players[] = $v;
 }
 if (count($players) == 0) {
     ACP_MessageBox("没有选手?");
 }
 $allplayer = array();
예제 #4
0
include '../model/set.php';
$array_post = array();
array_push($array_post, $_POST['surname']);
array_push($array_post, $_POST['name']);
array_push($array_post, $_POST['email']);
array_push($array_post, $_POST['password']);
array_push($array_post, $_POST['born']);
array_push($array_post, $_POST['city']);
array_push($array_post, $_POST['department']);
array_push($array_post, $_POST['adress']);
array_push($array_post, $_POST['phone']);
$i = 0;
$error = false;
while ($i != sizeof($array_post)) {
    if (empty($array_post[$i])) {
        $error = true;
    }
    $i++;
}
if ($error == true) {
    header('Location: ../register.php?error=1');
} else {
    if (IsMember(hash('sha512', $_POST['email']))) {
        header('Location: ../register.php?error=2');
    } else {
        $email = hash('sha512', $_POST['email']);
        $password = hash('sha512', $_POST['password']);
        AddMember($_POST['name'], $_POST['surname'], $email, $password, $_POST['born'], $_POST['city'], $_POST['department'], $_POST['adress'], $_POST['phone']);
        header('Location: ../index.php');
    }
}
예제 #5
0
        $admins = implode('', $admins);
        $sql = "SELECT u_name FROM `{$cfg['tb_members']}` WHERE last_visit<'{$dateline2}' AND g_w+g_d+g_l<'{$gameline}' {$admins} LIMIT 100";
        $result = RenDB_Query($sql);
        while ($row = RenDB_Fetch_Row($result)) {
            //对符合条件的会员的贴子、主题和棋局改成游客的
            DeleteMember($row[0]);
        }
        $sql = "SELECT COUNT(*) FROM `{$cfg['tb_members']}` WHERE last_visit<'{$dateline2}'  AND g_w+g_d+g_l<'{$gameline}' {$admins}";
        $result = RenDB_Query($sql);
        $row = RenDB_Fetch_Row($result);
        if ($row[0] > 0) {
            header("Location: index.php?mode=m_man&action=batch_del2&dateline={$dateline}&gameline={$gameline}");
            exit;
        }
        ACP_MessageBox('删除完毕');
        break;
    case 'del':
        if (!isset($u_name)) {
            ACP_MessageBox($str['act_err']);
        }
        if (In_Names($u_name, $cfg['admins'])) {
            ACP_MessageBox('不能删除管理员');
        }
        if (!IsMember($u_name)) {
            ACP_MessageBox($u_name . ' 不是会员');
        }
        DeleteMember($u_name);
        $lks[0] = array('返回', 'm_man');
        ACP_MessageBox('删除成功', $lks);
        break;
}