<?php
if(IN_IQQOL){
    if($_COOKIE['iQQol_Administrator']!=IQQOL_SPPASS)
    {
        $style->assign("state",'COOKIE失效');
        $style->display('admin/index.html');exit();
    }
    else {
        if($_GET['act']=='delete'){
             $ban_search=mysql_query("DELETE FROM {$table}online
WHERE `qq`='".$_GET['qq']."'",$con);
                $tem_url_return='admin.php?action=members&operation=qqinfo';
             $state = '删除成功';
             $style->display('admin/status.html');
             }
        if($_GET['act']=='check'){
            if($_GET['edit']=='yes'){
                $mqq = new SET_MQQ($_REQUEST['qq'], $_REQUEST['password']);
            $rand = json_decode($mqq->Verifycode($_REQUEST['verifycode']) , true);
            if ($rand[status] != 'ok') {
                if ($rand[status] == 'vc') {
                    $filename = 'libs/Cache/'.md5($rand['res']) . '.png';
                    $fp = fopen($filename, 'w');
                    fwrite($fp, $mqq->HexToText($rand['res']));
                    fclose($fp);
                    $state = '<form method="post" action="admin.php?action=members&operation=set_qq&act=check&edit=yes">';
                    $state.= '请输入QQ验证码(手机协议登录)';
                    $state.= '<img src="' . $filename . '">';
                    $state.= '<input type="text" name="verifycode" value="">';
                    $state.= '<input type="hidden" name="qq" value="' . $_REQUEST['qq']. '">';
                    $state.= '<input type="hidden" name="sid" value="' . $_POST['sid'] . '">';
                    $state.= '<input type="hidden" name="password" value="' . $_REQUEST[password] . '">';
                    $state.= '<input type="hidden" name="login_status" value="' . $_REQUEST[login_status] . '">';
                    $state.= '<input type="hidden" name="reply" value="' . $_REQUEST[reply] . '">';
                    $state.= '<input type="hidden" name="noticeqq" value="' . $noticeqq . '">';
                    $state.= '<input type="hidden" name="runtime" value="' . $_REQUEST[runtime] . '">';
                    $state.= '<input type=submit name=sub value="确定"> ';
                    $state.= '</form"> ';
                }
                            else {
                                $tem_url_return='admin.php?action=members&operation=qqinfo';
                                $state = '发生未知错误，请刷新！';
                            }
                $style->display('admin/status.html');
                exit();
            }
                else {
                    mysql_query("UPDATE ".IQQOL_SQLTABLE."online
 SET status='1' 
 WHERE qq = '{$_REQUEST['qq']}'");
                    $tem_url_return='admin.php?action=members&operation=qqinfo';
                    $state = '打码成功！';
                    $style->display('admin/status.html');
                    exit();
                }
            }
            $mqq = new SET_MQQ($_REQUEST['qq'], $_REQUEST['password']);
            $rand = json_decode($mqq->Login() , true);
            if ($rand[status] != 'ok') {
                if ($rand[status] == 'vc') {
                    $filename = 'libs/Cache/'.md5($rand['res']) . '.png';
                    $fp = fopen($filename, 'w');
                    fwrite($fp, $mqq->HexToText($rand['res']));
                    fclose($fp);
                    $state = '<form method="post" action="admin.php?action=members&operation=set_qq&act=check&edit=yes">';
                    $state.= '请输入QQ验证码(手机协议登录)';
                    $state.= '<img src="' . $filename . '">';
                    $state.= '<input type="text" name="verifycode" value="">';
                    $state.= '<input type="hidden" name="qq" value="' . $_REQUEST['qq'] . '">';
                    $state.= '<input type="hidden" name="sid" value="' . $_POST['sid'] . '">';
                    $state.= '<input type="hidden" name="password" value="' . $_REQUEST[password] . '">';
                    $state.= '<input type="hidden" name="login_status" value="' . $_REQUEST[login_status] . '">';
                    $state.= '<input type="hidden" name="reply" value="' . $_REQUEST[reply] . '">';
                    $state.= '<input type="hidden" name="noticeqq" value="' . $noticeqq . '">';
                    $state.= '<input type="hidden" name="runtime" value="' . $_REQUEST[runtime] . '">';
                    $state.= '<input type=submit name=sub value="确定"> ';
                    $state.= '</form"> ';
                    $style->display('admin/status.html');
                    exit();
                }
                            else {
                                $tem_url_return='admin.php?action=members&operation=qqinfo';
                                $state = '发生未知错误，请刷新！';
                                $style->display('admin/status.html');
                                exit();
                            }
                $style->display('admin/status.html');
                exit();
            }
                else {
                    mysql_query("UPDATE ".IQQOL_SQLTABLE."online
 SET status='1' 
 WHERE qq = '{$_REQUEST['qq']}'");
                    $tem_url_return='admin.php?action=members&operation=qqinfo';
                    $state = '打码成功！';
                    $style->display('admin/status.html');
                    exit();
                }
        }
    }
}
?>