<!--<?php
include_once PrintEot('left');print <<<EOT
-->
<div class="mb10"><a href="$admin_file?adminjob=hackcenter">插件中心</a> &raquo; <a href="javascript:;">{$db_hackdb[passport][0]}</a></div>
<!--
EOT;
if(empty($action)){
print <<<EOT
-->
<h2 class="h1">
    <span class="linka">
        <span class="bt2"><span><button type="button" value="通行證設置" onclick="SetType(0)">通行證設置</button></span></span>
        <span class="bt2"><span><button type="button" value="ShopEx" onclick="SetType(1)">ShopEx</button></span></span>
        <span class="bt2"><span><button type="button" value="DedeCMS" onclick="SetType(2)">DedeCMS</button></span></span>
        <span class="bt2"><span><button type="button" value="PHP168" onclick="SetType(3)">PHP168</button></span></span>
        <span class="bt2"><span><button type="button" value="phpwind" onclick="SetType(4)">phpwind</button></span></span>
    </span>
</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
  <tr class="tr1 vt">
    <td class="td2">phpwind 通行證系統是為解決多個系統之間會員數據共享問題而開發的，是一套跨服務器，跨域名，跨語言的會員共享系統，實現了不同系統之間共享會員數據和同步會員基本信息，支持不同域名下同步登錄，同步退出功能</td>
  </tr>
</table>
</div>
<form name="setform" action="$basename" method="post">
  <input type=hidden name="action" value="unsubmit">
  <h2 class="h1">通行證設置</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">通行證</td>
      <td class="td2">
      	<ul class="cc list_80 list_A">
           <li><input type=radio name="config[db_pptifopen]" value="1" $ifopen_Y>開啟</li>
           <li><input type=radio name="config[db_pptifopen]" value="0" $ifopen_N>關閉</li>
        </ul>
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">通行證私有密鑰</td>
      <td class="td2"><input class="input input_wb mr20" id="db_pptkey" name="config[db_pptkey]" value="$db_pptkey">
        <span class="bt2"><span><button type="button" value="隨機生成私有密鑰" onclick="generatekey()">隨機生成私有密鑰</button></span></span>
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">將本系統作為</td>
      <td class="td2">
      	<ul class="cc list_80 list_A">
           <li><input type=radio name="config[db_ppttype]" id="pptserver" value="server" $type_server onclick="sendtype('server')">服務器端</li>
           <li><input type=radio name="config[db_ppttype]" id="pptclient" value="client" $type_client onclick="sendtype('client')">客戶端</li>
        </ul>
         </td>
    </tr>
  </table>
  </div>
  <div id="server">
  <h2 class="h1">服務器端設置</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">通行證兼容模式</td>
      <td class="td2">
      <ul class="cc list_80 list_A fl">
           <li><input type=radio name="config[db_pptcmode]" value="0" $cmode_N>關閉</li>
           <li><input type=radio name="config[db_pptcmode]" value="1" $cmode_Y>開啟</li>
        </ul>
        <span>(兼容phpwind v6.3之前版本的通行證)</span> </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">同步登錄的客戶端地址</td>
      <td class="td2"><input type="text" class="input input_wb" name="config[db_ppturls]" value="$db_ppturls" /></td>
    </tr>
  </table>
  </div>
  </div>
  <div id="client">
  <h2 class="h1">客戶端設置</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">通行證服務器地址</td>
      <td class="td2"><input id="serverurl" class="input input_wb" name="config[db_pptserverurl]" value="$db_pptserverurl"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">通行證登錄地址</td>
      <td class="td2"><input id="loginurl" class="input input_wb" name="config[db_pptloginurl]" value="$db_pptloginurl"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">通行證退出地址</td>
      <td class="td2"><input id="loginouturl" class="input input_wb" name="config[db_pptloginouturl]" value="$db_pptloginouturl"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">通行證注冊地址</td>
      <td class="td2"><input id="regurl" class="input input_wb" name="config[db_pptregurl]" value="$db_pptregurl"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">選擇需要同步的積分</td>
      <td class="td2">
<!--
EOT;
foreach($credit as $key=>$val){
$ifchecked=strpos(",$db_pptcredit,",",$key,")!==false ? 'checked' : '';
print <<<EOT
-->
        <input type="checkbox" name="ppt_credit[]" value="$key" $ifchecked>
        $val
<!--
EOT;
}print <<<EOT
-->
      </td>
    </tr>
  </table>
  </div>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
  </div>
</form>
<div class="admin_info mb10">
    <h3 class="h1">通行證說明</h3>
    <div class="legend">
     <b>功能說明︰</b>實現同步登錄，退出功能，共享會員數據，同步積分信息<br />
     <b>使用方法︰</b>通行證由一個服務器端和多個客戶端組成，選擇一個系統的會員數據做為通行證服務器，其他系統做為客戶端
      <p class="s1">以站點和博客整合為例說明通行證使用方法:</p>
        <ol>
            <li><p>將站點做為<b>服務器端</b>，後台設置如下︰</p>
			<table>
			<tr ><td>通行證</td><td style="text-indent:1.5em">開啟</td></tr>
			<tr ><td>通行證私有密鑰</td><td style="text-indent:1.5em">隨機生成一個私有密鑰(各系統私有密鑰必須完全相同)</td></tr>
			<tr ><td>將本系統作為</td><td style="text-indent:1.5em">服務器端</td></tr>
			<tr ><td>客戶端地址</td><td style="text-indent:1.5em">博客系統url地址</td></tr>
            </table><li>
            <p>將博客做為<b>客戶端</b>，後台設置如下</p>
            <table>
			<tr ><td>通行證</td><td style="text-indent:1.5em">開啟</td></tr>
            <tr ><td>通行證私有密鑰</td><td style="text-indent:1.5em">將服務器端的私有密鑰填寫到此處(各系統的私有密鑰必須完全相同)</td></tr>
            <tr ><td>將本系統作為</td><td style="text-indent:1.5em">客戶端</td></tr>
            <tr ><td>通行證服務器地址</td><td style="text-indent:1.5em">站點url地址</td></tr>
            <tr ><td>通行證登錄地址</td><td style="text-indent:1.5em">login.php(論壇登錄地址)</td></tr>
            <tr ><td>通行證退出地址</td><td style="text-indent:1.5em">login.php?action=quit(論壇退出登錄地址)</td></tr>
            <tr ><td>通行證注冊地址</td><td style="text-indent:1.5em">{$db_registerfile}(論壇注冊地址)</td></tr>
            <tr ><td>選擇需要同步的積分</td><td style="text-indent:1.5em">選擇需要同步的積分</td></tr></table>
           </li>
           <li>通行證設置完成！</li>
        </ol>
      </ul>
    </div>
</div>
<script type="text/javascript">
var pptType = '$db_ppttype';
function sendtype(show){
	try{
		document.getElementById(show).style.display = "";
		if(show=='server'){
			document.getElementById('client').style.display = "none";
			getObj('pptserver').checked = 'checked';
			getObj('pptclient').checked = false;
		} else{
			document.getElementById('server').style.display = "none";
			getObj('pptclient').checked = 'checked';
			getObj('pptserver').checked = false;
		}
	}catch(e){}
}
var oldkey = "$db_pptkey";
function generatekey(){
    var keychars = "abcdefhjmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWYXZ.,:";
    var keylength = 16;
    var key = document.getElementById('db_pptkey');
	if(oldkey=='' || confirm('更改私有密鑰需要同時在其他使用通行證接口的應用程序中修改私有密鑰，您確認要更改私有密鑰？')){
		oldkey='';
		key.value = '';
		for( i = 0; i < keylength; i++ ){
			key.value += keychars.charAt(Math.floor( Math.random() * keychars.length ))
		}
	}
}
function SetType(type){
	var url = 'http://{$pwServer['HTTP_HOST']}/';
	if(getObj('serverurl').defaultValue == ''){
		var serverurl = {0 : '',1 : 'shopex',2 : 'dedecms',3 : 'php168',4 : 'phpwind'};
		getObj('serverurl').value = url + serverurl[type];
	}

	var loginurl = {0 : '',1 : 'login.php',2 : 'member/login.php',3 : 'login.php',4 : 'login.php'};
	getObj('loginurl').value = loginurl[type];

	var loginouturl = {0 : '',1 : 'user_logout.php',2 : 'index_do.php?fmdo=login&dopost=exit',3 : 'login.php?action=quit',4 : 'login.php?action=quit'};
	getObj('loginouturl').value = loginouturl[type];

	var regurl = {0 : '',1 : 'user_register.php',2 : 'member/index_do.php?fmdo=user&dopost=regnew',3 : 'reg.php',4 : 'register.php'};
	getObj('regurl').value = regurl[type];
}

setTimeout(function(){
	sendtype(pptType);
}, 200);
</script>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->
