<?php
// +---------------------------------------------+
// |     Copyright 2003-2005 weenCompany |
// |     http://www.weentech.com               |
// |     This file may not be redistributed.     |
// +---------------------------------------------+

define('MOD_ACCESS', true);
define('IN_ADMIN', true);
define('IN_WEENCOMPANY', true);

$rootpath = "./../";

include($rootpath . 'includes/core.php');

$moduleid = $_GET['moduleid'];

$module = $DB->query_first("SELECT name, displayname, version, settingspath, authorname, authorlink FROM " . TABLE_PREFIX . "modules WHERE moduleid = '$moduleid'");

$loadwysiwyg = isset($_GET['loadwysiwyg']) ? $_GET['loadwysiwyg'] : (isset($_POST['loadwysiwyg']) ? $_POST['loadwysiwyg'] : 0);

if($moduleid == 12)
{
  $module['name'] = '用户注册';
}

switch($module['authorname'])
{
  case 'weencompany':
    PrintHeader($module['name'], $loadwysiwyg);
  break;

  case 'weencompany_cloner':
    PrintHeader($module['name'], $loadwysiwyg);
  break;

  case 'weenduck':
    PrintHeader($module['name'].'(v'.$module['version'].' by weenCompany)', $loadwysiwyg);
  break;

  default:
    PrintHeader($module['name'].'(v'.$module['version'].' by '.$module['authorname'].')', $loadwysiwyg);
  break;
}

if(isset($updatesettings))
{
  UpdateModuleSettings($settings, $refreshpage);
}

// Check the user has permission to do this
if(!@in_array($moduleid, $userinfo['moduleadminids']))
{
  PrintErrors("无权设置此模块.", '操作失败');
  PrintFooter();
  return;
}


$refreshpage = 'mymodules.php?moduleid='.$moduleid;

if(!@include($rootpath . 'modules/' . $module['settingspath']))
{
  PrintSection('&nbsp;');
  echo '<table width="100%" border="0" cellpadding="5" cellspacing="0">
        <tr><td class="tdrow2" align="center"><b>模块安装目录有误, 不能修改此模块的任何设置.</b></td></tr>
        </table>';
  EndSection();
}


PrintFooter();

?>