<?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();

?>
