<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <title>Discuz论坛登录信息提取</title>
  <link href="//cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
  <script src="//cdn.staticfile.org/jquery/1.12.4/jquery.min.js"></script>
  <script src="//cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <script src="//cdn.staticfile.org/layer/2.3/layer.js"></script>
  <script src="//cdn.staticfile.org/clipboard.js/1.7.1/clipboard.min.js"></script>
  <!--[if lt IE 9]>
    <script src="//cdn.staticfile.org/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="//cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body>
<div class="container">
<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 center-block" style="float: none;">
<?php
if(!defined('IN_CRONLITE'))exit();
if(!$islogin==1)showmsg('登录失败，可能是密码错误或者身份失效了，请<a href="index.php?mod=login">重新登录</a>！',3);

$m = isset($_GET['m'])?$_GET['m']:'account';
$url = isset($_GET['url'])?htmlspecialchars(trim($_GET['url'])):null;
?>
<script>
var siteurl='<?php echo $apiserver ?>';
var filehash='<?php echo md5(SYS_KEY.$uid.SYS_KEY)?>';
</script>
<div class="panel panel-success">
	<div class="panel-heading"><h3 class="panel-title text-center">
		Discuz论坛登录信息提取
	</div>
	<div class="panel-body">
		<ul class="nav nav-tabs">
			<li class="<?php echo $m=='account'?'active':null;?>"><a href="index.php?mod=dzcookie">账号密码登录</a></li><li class="<?php echo $m=='qq'?'active':null;?>"><a href="index.php?mod=dzcookie&m=qq">QQ快捷登录</a></li><li class="<?php echo $m=='manual'?'active':null;?>"><a href="index.php?mod=dzcookie&m=manual">手动导入cookie</a></li>
		</ul>
<?php if($m=='account'){?>
		<div class="tab-pane active">
			<div class="list-group-item list-group-item-info text-center" style="font-weight: bold;display:none;" id="load"></div>
			<div id="login" class="list-group-item">
			<div id="urlForm">
				<div class="form-group">
					<label>论坛首页网址：</label><br/>
					<input type="text" id="url" value="<?php echo $url?>" class="form-control" onkeydown="if(event.keyCode==13){submiturl.click()}" placeholder="填写示例：https://www.52pojie.cn/"/>
				</div>
				<button type="button" id="submiturl" class="btn btn-primary btn-block">下一步</button>
			</div>
			<div id="loginForm" style="display:none;">
				<div class="form-group">
					<label><select id="fastloginfield"><option value="username">用户名</option><option value="email">Email</option></select></label><br/>
					<input type="text" id="username" value="" class="form-control" onkeydown="if(event.keyCode==13){submitlogin.click()}"/>
				</div>
				<div class="form-group">
					<label>密码：</label><br/>
					<input type="text" id="password" value="" class="form-control" onkeydown="if(event.keyCode==13){submitlogin.click()}"/>
				</div>
				<div class="form-group" id="questionForm" style="display:none;">
					<label>安全提问：</label><br/>
					<select id="questionid" class="form-control"></select>
				</div>
				<div class="form-group" id="answerForm" style="display:none;">
					<label>答案：</label><br/>
					<input type="text" id="answer" value="" class="form-control" onkeydown="if(event.keyCode==13){submitlogin.click()}"/>
				</div>
				<div class="form-group" id="verifyForm" style="display:none;">
					<label>验证码：</label><br/>
					<div id="codeimg"></div>
					<input type="text" id="seccodeverify" value="" class="form-control" onkeydown="if(event.keyCode==13){submitlogin.click()}" placeholder="输入验证码"/>
				</div>
				<input type="hidden" id="formhash" value=""/>
				<input type="hidden" id="loginhash" value=""/>
				<input type="hidden" id="seccodehash" value=""/>
				<input type="hidden" id="cookie" value=""/>
				<button type="button" id="submitlogin" class="btn btn-primary btn-block">提交</button>
			</div>
			<div id="resultForm" style="display:none;">
				<div class="form-group">
					<label>用户名：</label><br/>
					<input type="text" id="username_r" value="" class="form-control"/>
				</div>
				<div class="form-group">
					<label>登录信息SID：</label><br/>
					<div class="input-group"><input type="text" id="sid" value="" class="form-control"/><span class="input-group-btn"><a href="javascript:;" id="copy-btn" data-clipboard-text="" class="btn btn-warning" title="点此复制">复制</a></span></div>
				</div>
			</div>
			</div>
			<br/><a href="javascript:window.location.reload()">点此重新登录</a>
		</div>
	<script src="sign/getcookie/login.js?v=<?php echo VERSION?>"></script>
<?php }elseif($m=='qq'){?>
		<div class="tab-pane active">
		<div class="list-group-item list-group-item-info text-center" style="font-weight: bold;" id="load"><span id="loginmsg">论坛需要开启QQ快捷登录才可用此方式登录</span><span id="loginload" style="padding-left: 10px;color: #790909;display:none;">.</span></div>
		<input type="hidden" id="cookie" value=""/>
		<input type="hidden" id="client_id" value=""/>
		<input type="hidden" id="state" value=""/>
		<input type="hidden" id="redirect_uri" value=""/>
		<div id="urlForm" class="list-group-item">
			<div class="form-group">
				<label>论坛首页网址：</label><br/>
				<input type="text" id="url" value="<?php echo $url?>" class="form-control" onkeydown="if(event.keyCode==13){submiturl.click()}" placeholder="填写示例：https://www.52pojie.cn/"/>
			</div>
			<button type="button" id="submiturl" class="btn btn-primary btn-block">下一步</button>
		</div>
		<div id="loginForm" style="text-align: center;display:none;">
			<div class="list-group-item" id="qrimg">
			</div>
			<div class="list-group-item" id="mobile" style="display:none;"><button type="button" id="mlogin" onclick="mloginurl()" class="btn btn-warning btn-block">跳转QQ快捷登录</button><br/><button type="button" onclick="loadScript()" class="btn btn-success btn-block">我已完成登录</button></div>
		</div>
		<div id="resultForm" class="list-group-item" style="display:none;">
			<div class="form-group">
				<label>用户名：</label><br/>
				<input type="text" id="username_r" value="" class="form-control"/>
			</div>
			<div class="form-group">
				<label>登录信息SID：</label><br/>
				<div class="input-group"><input type="text" id="sid" value="" class="form-control"/><span class="input-group-btn"><a href="javascript:;" id="copy-btn" data-clipboard-text="" class="btn btn-warning" title="点此复制">复制</a></span></div>
			</div>
		</div>
		</div>
		<br/><a href="javascript:window.location.reload()">点此重新登录</a>
		</div>
	<script src="sign/getcookie/qqconnect.js?v=<?php echo VERSION?>"></script>
<?php }elseif($m=='manual'){?>
<div class="modal fade" align="left" id="note" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title" id="myModalLabel">手动获取Cookie教程</h4>
      </div>
      <div class="modal-body">
<p>1.首先安装Chrome或Chromium内核浏览器。</p>
<p>2.下载安装EditThisCookie这款插件[<a href="https://chrome.google.com/webstore/detail/edit-this-cookie/fngmhnnpilhplaeedifhccceomclgfbg?hl=zh-CN" target="_blank" rel="noreferrer">谷歌商店</a>][<a href="https://ext.chrome.360.cn/webstore/detail/fngmhnnpilhplaeedifhccceomclgfbg" target="_blank" rel="noreferrer">360极速浏览器商店</a>]，安装好后EditThisCookie的小图标会出现在浏览器菜单栏里。</p>
<p>3.进入EditThisCookie的设置界面，选择“选项”，在“选择cookie导出格式”下拉框中选择“Semicolon separated name=value pairs”。（如下图）<br>
<img src="assets/img/getcookie1.png" alt="loading" style="border:1px solid #999;" width="90%"></p>
<p>4.关闭设置界面。打开论坛登录自己的账号，进入EditThisCookie，点击“导出cookie”的小图标（如下图），会提示“cookie已复制到剪贴板”。然后直接粘贴到上方编辑框内即可。<br>
<img src="assets/img/getcookie2.png" alt="loading" style="border:1px solid #999;" width="90%"></p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">知道啦</button>
      </div>
    </div>
  </div>
</div>
		<div class="tab-pane active">
		<div class="list-group-item list-group-item-info text-center" style="font-weight: bold;display:none;" id="load"></div>
		<div id="loginForm" class="list-group-item">
			<div class="form-group">
				<label>论坛首页网址：</label><br/>
				<input type="text" id="url" value="<?php echo $url?>" class="form-control" onkeydown="if(event.keyCode==13){submiturl.click()}" placeholder="填写示例：https://www.52pojie.cn/"/>
			</div>
			<div class="form-group">
				<label>COOKIE（Semicolon separated name=value pairs）：</label><br/>
				<textarea id="cookie" rows="10" class="form-control"></textarea>
			</div>
			<button type="button" id="submit" class="btn btn-primary btn-block">确定</button>
			<a href="#note" data-toggle="modal" class="btn btn-default btn-block">手动获取Cookie教程</a>
		</div>
		<div id="resultForm" class="list-group-item" style="display:none;">
			<div class="form-group">
				<label>论坛首页网址：</label><br/>
				<input type="text" id="url_r" value="<?php echo $url?>" class="form-control"/>
			</div>
			<div class="form-group">
				<label>用户名：</label><br/>
				<input type="text" id="username_r" value="" class="form-control"/>
			</div>
			<div class="form-group">
				<label>登录信息SID：</label><br/>
				<div class="input-group"><input type="text" id="sid" value="" class="form-control"/><span class="input-group-btn"><a href="javascript:;" id="copy-btn" data-clipboard-text="" class="btn btn-warning" title="点此复制">复制</a></span></div>
			</div>
		</div>
		</div>
	<script src="sign/getcookie/import.js?v=<?php echo VERSION?>"></script>
<?php }?>
	</div>
</div>
</div>
</div>
</body>
</html>