<?php
# Subroutine: adm_permission.php called by Admin.php
# Xinfeng Chen, 2002.11.20
# Input: $errmsg

require_once('bin/config.php');
require_once('admin/adm.inc');

#--- Validate dministrator ---
include('admin/adm_validate.php');
if(!$adm_validated){jumpTo('admin.php?cmd=logon'); exit;}

#--- Start Processing ---
require_once('core/class_forum_base.php');
CForumBase::setFileBase("$filepath");
require_once('core/base_array_file.php');
require_once('core/class_board_list.php');

page_header();

print <<<EOT
<h1>权限管理</h1>
<p>管理允许进入指定加密论坛的用户。</p>
EOT;

#--- Process error message from previous page ---
if($errmsg){
 print <<<EOT
<table border=1 width=100% cellpadding=6 align=center>
<tr><td width=100% align=center>
<b><font color=FF6633>$errmsg</font></b>
</td></tr></table>
EOT;
}

print <<<EOT
<form name="form1" method="post" action="?cmd=permission_1">
<table width=100% cellpadding=4 cellspacing=1 border=0 class="forumline">
<tr> 
 <th class="thHead" colspan="2"><b>选择论坛</b></th>
</tr>
EOT;

#--- Generate secret board list item ---
$oBrdLst=new CBoardList;
if($oBrdLst->load()){$blsize=$oBrdLst->itemcount();}
else{$blsize=0;}

$ssize=0; $soption='';
for($ii=0; $ii<$blsize; $ii++){
 $oBrdLst->moveTo($ii); $bid=$oBrdLst->id;
 if($oBrdLst->secret){
  $ssize++;
  $soption .= "<option value=$bid>$oBrdLst->name</option>";
 }
}

if($ssize>0){
 print <<<EOT
<tr> 
 <td class="row1">Select Board(only secured is listed): 
  <select name="f_bid">$soption</select>
 </td>
 <td class="row1">
  <input type="submit" name="Submit" value="确认">
 </td>
</tr>
EOT;
}else{
 print '<tr><td class=row1>No secret board</td><td class=row1>&nbsp;</td><tr>';
}

print '</table></form>';

page_footer();
exit;

?>