<?php
if (!defined('USING_SYSTEM')) exit;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="admin/images/page.css" />
<script type="text/javascript" src="skins/common/images/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="admin/images/page.js"></script>
<title>Filiant Control Panel</title>
</head>
<body>
<div class="bigTips"<?php echo ($tips=='')?'':' style="display:block;"' ?>><?php echo $tips ?></div>
<form id="mainForm" action="" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th colspan="3">注册设置</th>
  </tr>
  <tr>
    <td class="title" width="150">开启注册</td>
    <td width="400" class="dropdown">
      <select name="userRegTxt">
        <option value="1"<?php echo $_APP['register']['open']?' selected="selected"':'' ?>>开启</option>
        <option value="0"<?php echo $_APP['register']['open']?'':' selected="selected"' ?>>关闭</option>
      </select>
    </td>
    <td class="tips">开启的话游客将可以自行进行注册</td>
  </tr>
  <tr>
    <td class="title">关闭说明</td>
    <td>
      <textarea name="userRegCloseInfoTxt" class="textbox" style="height:100px;"><?php echo $_APP['register']['closeinfo'] ?></textarea>
    </td>
    <td class="tips">若注册关闭后给用户的提示信息</td>
  </tr>
  <tr>
    <td class="title">默认组</td>
    <td class="dropdown">
      <select name="userRegGroupTxt" id="userRegGroupTxt">
<?php
$groups = xGroup::getAll();
foreach($groups as $group) {
	echo '<option value="'.$group['id'].'">'.$group['name'].'</option>';
}
?>
      </select>
<script type="text/javascript">
$('#userRegGroupTxt').val('<?php echo $_APP['register']['group'] ?>');
</script>
    </td>
    <td class="tips">用户注册后的默认用户组</td>
  </tr>
  <tr>
    <td class="title">邮箱验证</td>
    <td class="dropdown">
      <select name="userRegVerTxt" id="userRegVerTxt">
        <option value="1"<?php echo $_APP['register']['verify']?' selected="selected"':'' ?>>开启</option>
        <option value="0"<?php echo $_APP['register']['verify']?'':' selected="selected"' ?>>关闭</option>
      </select>
    </td>
    <td class="tips">开启后新注册用户需要验证邮箱才可登录（需要您正确的配置了 SMTP 信息）</td>
  </tr>
  <tr>
    <td class="title">验证时组</td>
    <td class="dropdown">
      <select name="userVerGroupTxt" id="userVerGroupTxt">
<?php
$groups = xGroup::getAll();
foreach($groups as $group) {
	echo '<option value="'.$group['id'].'">'.$group['name'].'</option>';
}
?>
      </select>
<script type="text/javascript">
$('#userVerGroupTxt').val('<?php echo $_APP['register']['vgroup'] ?>');
</script>
    </td>
    <td class="tips">用户未通过验证时的组（仅开启邮箱验证时有效）</td>
  </tr>
</table>
<div class="controls">
  <a class="button" href="javascript:void(0);" onclick="$('#mainForm').trigger('submit');return false;">保存<i></i></a>
</div>
</form>
</body>
</html>