<?php
/**
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to hide@address.com so we can mail you a copy immediately.
*
* @category Forum
* @package QuickTalk forum
* @author Philippe Vandenberghe <hide@address.com>
* @copyright 2008-2012 The PHP Group
* @version 2.5 build:20100924
* @since File available since Release 1.0.0
* @deprecated File deprecated in Release 3.0.0
*/
session_start();
require_once('bin/qtf_init.php');
include(Translate('qtf_adm.php'));
if ( $oVIP->role!='A' ) die($L['E_admin']);
// INITIALISE
$strAction = 'add';
if ( isset($_GET['a']) ) $strAction = $_GET['a'];
$oVIP->selfurl = 'qtf_adm_module.php';
$oVIP->selfname = $L['Adm_modules'];
// --------
// SUBMITTED
// --------
if ( isset($_POST['ok']) )
{
$strAction = 'add';
if ( isset($_POST['action']) ) $strAction = $_POST['action'];
// check form
$strName = strtolower(strip_tags(trim($_POST['name']))); if ( get_magic_quotes_gpc() ) $strName = stripslashes($strName);
$strName = str_replace(' ','_',$strName);
$strFile = 'qtfm_'.$strName.'_'.($strAction=='rem' ? 'un' : '').'install.php';
if ( file_exists($strFile) )
{
// exit
$oVIP->exiturl = $strFile;
$oVIP->exitname = $L['Module_'.$strAction];
$oVIP->EndMessage(NULL,$L['Module_name'].': '.$strName,'admin',0);
}
else
{
$error = 'Module not found... ('.$strFile.')<br/><br/>Possible cause: components of this module are not uploaded.';
if ( $strAction=='rem' ) $oDB->Query('DELETE FROM '.TABSETTING.' WHERE param like "module_'.$strName.'" OR param like "m_'.$strName.'"');
}
}
// --------
// HTML START
// --------
include('qtf_adm_p_header.php');
echo '<form method="post" action="',$oVIP->selfurl,'">
<table class="data_o" cellspacing="0" summary="module">
';
echo '<tr class="data_o">
<td class="colhd colhdfirst" style="width:200px;"><label for="name">',$L['Module_'.$strAction],'</label></td>
<td class="colct"><input id="name" name="name" size="12" maxlength="24" value=""/> <span class="help">',$L['Module_name'],'</span></td>
</tr>
';
echo '<tr class="data_o">
<td class="colhd colhdfirst"> </td>
<td class="colct"><input type="hidden" name="action" value="',$strAction,'"/><input type="submit" name="ok" value="',$L['Search'],'"/></td>
</tr>
';
echo '</table></form><br/>
';
// HTML END
echo '
<script type="text/javascript">
<!--
document.getElementById(\'name\').focus();
-->
</script>
';
include('qtf_adm_p_footer.php');
?>