вопрос
Хорошие,
Я номера панели Управления модуля Downpage версии DLE 11.x, и я хотел бы знать, если есть ошибки в файле: engine/inc/downpage.php
Это мой первый вклад.
С уважением,
Я номера панели Управления модуля Downpage версии DLE 11.x, и я хотел бы знать, если есть ошибки в файле: engine/inc/downpage.php
Это мой первый вклад.
С уважением,
<?php
/*
=====================================================
DownPage Ultimate para DLE Versión Yeti
-----------------------------------------------------
Adatapdo a DLE 11.x por GuilleOz para 4DLE.ES
-----------------------------------------------------
(c) 2012 iGrock. Yeti. Simon. Dr.Soft. HAMMER fix kiua
-----------------------------------------------------
Este código está protegido por derechos de autor
=====================================================
*/
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
die( "Hacking attempt!" );
}
if( $member_id['user_group'] != 1 ) {
msg( "error", $lang['addnews_denied'], $lang['db_denied'] );
}
// Cargamos el Archivo de Configuración del Módulo
if ( file_exists( ENGINE_DIR . '/data/dp_conf.php' ) ) {
require_once ( ENGINE_DIR . '/data/dp_conf.php' );
}
// Cargamos el Archivo de Lenguage del Módulo
if ( file_exists( ROOT_DIR . '/language/' . $selected_language . '/downpage.lng' ) ) {
require_once ( ROOT_DIR . '/language/' . $selected_language . '/downpage.lng' );
}
if( isset( $_REQUEST['subaction'] ) ) $subaction = $_REQUEST['subaction']; else $subaction = "";
if( $action == "downpage" or $action == '') {
echoheader( "<i class=\"icon-hdd\"></i> DownPage Ultimate", "Panel de Control" );
if ($dp_conf['online'] == "1") {$dp_onl_info = $dplang_adm['mod_online'];} else {$dp_onl_info = "<font color=red>{$dplang_adm[mod_offline]}</font>";};
echo <<<HTML
<div class="box">
<div class="box-header">
<div class="title">{$lang['main_quick']}</div>
</div>
<div class="box-content">
<div class="row box-section">
<div class="col-md-6">
<div class="news with-icons">
<div class="avatar"><img src="engine/skins/images/dp_conf.png"></div>
<div class="news-content">
<div class="news-title"><a href="$PHP_SELF?mod=downpage&action=options">{$dplang_adm['global_opt']}</a></div>
<div class="news-text">
<a href="$PHP_SELF?mod=downpage&action=options">{$dplang_adm[global_opt_i]}</a>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="news with-icons">
<div class="avatar"><img src="engine/skins/images/dp_log.png"></div>
<div class="news-content">
<div class="news-title"><a href="$PHP_SELF?mod=downpage&action=logs">{$dplang_adm[log_opt]}</a></div>
<div class="news-text">
<a href="$PHP_SELF?mod=downpage&action=logs">{$dplang_adm[log_opt_i]}</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-header">
<div class="title">{$dplang_adm['main_quick']}</div>
</div>
<div class="box-content">
<div class="tab-content">
<div class="tab-pane active" id="statall">
<div class="row box-section">
<div class="col-md-3">{$dplang_adm['mod_name']}</div>
<div class="col-md-9">DownPage Ultimate para DLE</div>
</div>
<div class="row box-section">
<div class="col-md-3">{$dplang_adm['mod_vers']}</div>
<div class="col-md-9">{$dp_conf['vers']} desde 08.09.2012</div>
</div>
<div class="row box-section">
<div class="col-md-3">{$dplang_adm['mod_starus']}</div>
<div class="col-md-9">{$dp_onl_info}</div>
</div>
<div class="row box-section">
<div class="col-md-3">{$dplang_adm['mod_author']}</div>
<div class="col-md-9">iGrock. Yeti. Simon. Dr. Soft. HAMMER. fix for 9.6 kiua</div>
</div>
<div class="row box-section">
<div class="col-md-3">{$dplang_adm['mod_translate']}</div>
<div class="col-md-9">[GuilleOz]</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
HTML;
if(@file_exists("dp_ultimate_install.php")){
echo <<<HTML
<div class="alert alert-error">{$dplang_adm['mod_install_check']}</div>
HTML;
}
echofooter();
}
elseif( $action == "options" ) {
echoheader( "<i class=\"icon-hdd\"></i> DownPage Ultimate", "Ajustes Generales" );
function showRow($title = "", $description = "", $field = "", $class = "") {
echo "<tr>
<td class=\"col-xs-10 col-sm-6 col-md-7 {$class}\"><h6>{$title}</h6><span class=\"note large\">{$description}</span></td>
<td class=\"col-xs-2 col-md-5 settingstd {$class}\">{$field}</td>
</tr>";
}
function makeDropDown($options, $name, $selected) {
$output = "<select class=\"uniform\" style=\"min-width:100px;\" name=\"$name\">\r\n";
foreach ( $options as $value => $description ) {
$output .= "<option value=\"$value\"";
if( $selected == $value ) {
$output .= " selected ";
}
$output .= ">$description</option>\n";
}
$output .= "</select>";
return $output;
}
function makeCheckBox($name, $selected) {
$selected = $selected ? "checked" : "";
return "<input class=\"iButton-icons-tab\" type=\"checkbox\" name=\"$name\" value=\"1\" {$selected}>";
}
foreach ( $user_group as $group )
$sys_group_arr[$group['id']] = $group['group_name'];
echo <<<HTML
<script type="text/javascript">
<!--
function ChangeOption(selectedOption) {
document.getElementById('global').style.display = "none";
document.getElementById('ultimate').style.display = "none";
document.getElementById('complaint').style.display = "none";
document.getElementById(selectedOption).style.display = "";
$('#'+selectedOption).find(".iButton-icons-tab").iButton({
labelOn: "<i class='icon-ok'></i>",
labelOff: "<i class='icon-remove'></i>",
handleWidth: 30
});
}
//-->
</script>
<div class="box">
<div class="box-content">
<div class="row box-section">
<ul class="settingsb">
<li style="min-width:90px;"><a href="javascript:ChangeOption('global');" class="tip" title="{$dplang_adm['global_opt']}"><i class="icon-cog"></i><span>{$dplang_adm['opt_d_1']}</span></a></li>
<li style="min-width:90px;"><a href="javascript:ChangeOption('ultimate');" class="tip" title="{$dplang_adm['ultimate']}"><i class="icon-globe"></i><span>{$dplang_adm['opt_d_2']}</span></a></li>
<li style="min-width:90px;"><a href="javascript:ChangeOption('complaint');" class="tip" title="{$dplang_adm['opt_complaint']}"><i class="icon-lightbulb"></i><span>{$dplang_adm['opt_d_3']}</span></a></li>
<li style="min-width:90px;"><a href="$PHP_SELF?mod=downpage" class="tip" title="{$dplang_adm['opt_exit']}"><i class="icon-retweet"></i><span>{$dplang_adm['opt_d_4']}</span></a></li>
</ul>
</div>
</div>
</div>
HTML;
echo <<<HTML
<form action="" method="post">
HTML;
echo <<<HTML
<div id="global" class="box">
<div class="box-header">
<div class="title">{$lang['opt_sys_all']}</div>
</div>
<div class="box-content">
<table class="table table-normal">
HTML;
showRow( $dplang_adm['global_opt_1_online'], $dplang_adm['global_opt_1_online_i'], makeDropDown( array ( "1" => $dplang_adm['mod_online_1'], "0" => $dplang_adm['mod_offline_1'] ), "save_con[online]", "{$dp_conf['online']}" ) );
showRow( $dplang_adm['global_opt_1_online'], $dplang_adm['global_opt_1_online_i'], makeDropDown( array ( "1" => $dplang_adm['mod_online_1'], "0" => $dplang_adm['mod_offline_1'] ), "save_con[allow_download]", "{$dp_conf['allow_download']}" ) );
showRow( $dplang_adm['global_opt_1_hpu'], $dplang_adm['global_opt_1_hpu_i'], makeDropDown( array ( "1" => $dplang_adm['mkopt_yes'], "0" => $dplang_adm['mkopt_no'] ), "save_con[allow_hpu]", "{$dp_conf['allow_hpu']}" ) );
showRow( $dplang_adm['global_opt_1_savelog'], $dplang_adm['global_opt_1_savelog_i'], makeDropDown( array ( "1" => $dplang_adm['mkopt_yes'], "0" => $dplang_adm['mkopt_no'] ), "save_con[log_save]", "{$dp_conf['log_save']}"));
echo "</table></div></div>";
echo <<<HTML
<div id="ultimate" class="box" style='display:none'>
<div class="box-header">
<div class="title">{$dplang_adm['ultimate']}:</div>
</div>
<div class="box-content">
<table class="table table-normal">
HTML;
showRow($dplang_adm['fftp_size'], $dplang_adm['fftp_size_i'], makeDropDown( array ( "on" => $dplang_adm['ftp_on2'], "off" => $dplang_adm['ftp_off2'] ), "save_con[ftp_function]", "{$dp_conf['ftp_function']}"));
showRow( $dplang_adm['users'], $dplang_adm['users_i'], makeDropDown( array ( "on" => $dplang_adm['users_y'], "off" => $dplang_adm['users_n'] ), "save_con[users]", "{$dp_conf['users']}"));
showRow( $dplang_adm['ftp_login'], $dplang_adm['ftp_login_i'], "<input type=text style='text-align: center;' size=20 class=edit name='save_con[ftp_login]' value='{$dp_conf['ftp_login']}'>", "");
showRow( $dplang_adm['ftp_pass'], $dplang_adm['ftp_pass_i'], "<input type=text style='text-align: center;' size=20 class=edit name='save_con[ftp_pass]' value='{$dp_conf['ftp_pass']}'>", "");
echo "</table></div></div>";
echo <<<HTML
<div id="complaint" class="box" style='display:none'>
<div class="box-header">
<div class="title">{$dplang_adm['opt_complaint']}:</div>
</div>
<div class="box-content">
<table class="table table-normal">
HTML;
showRow( $dplang_adm['global_opt_3_allowcomplaint'], $dplang_adm['global_opt_3_allowcomplaint_i'], makeDropDown( array ( "1" => $dplang_adm['mkopt_on2'], "0" => $dplang_adm['mkopt_off2'] ), "save_con[complaint_online]", "{$dp_conf['complaint_online']}"));
showRow( $dplang_adm['global_opt_3_complmessread'], $dplang_adm['global_opt_3_complmessread_i'], makeDropDown( array ( "yes" => $dplang_adm['mkopt_yes'], "no" => $dplang_adm['mkopt_no'] ), "save_con[complaint_messread]", "{$dp_conf['complaint_messread']}"));
showRow( $dplang_adm['global_opt_3_adminid'], $dplang_adm['global_opt_3_adminid_i'], "<input type=text style='text-align: center;' size=20 class=edit name='save_con[complaint_adm_id]' value='{$dp_conf['complaint_adm_id']}'>", "");
echo "</table></div></div>";
if(!is_writable(ENGINE_DIR . '/data/dp_conf.php')) {
echo "<div class=\"alert alert-error\">".str_replace("{file}", "engine/data/dp_conf.php", $lang['stat_system'])."</div>";
}
echo <<<HTML
<div style="margin-bottom:30px;">
<input type="hidden" name="mod" value="downpage">
<input type="hidden" name="action" value="save">
<input type="hidden" name="user_hash" value="{$dle_login_hash}">
<input type="submit" class="btn btn-lg btn-green" value="{$lang['user_save']}">
</div>
</form>
HTML;
echofooter();
}
elseif( $action == "save" ) {
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
die( "Hacking attempt! User not found" );
}
if( $member_id['user_group'] != 1 ) {
msg( "error", $lang['opt_denied'], $lang['opt_denied'] );
}
$find[] = "'\r'";
$replace[] = "";
$find[] = "'\n'";
$replace[] = "";
$save_con['vers'] = "Ultimate";
$save_con = $save_con + $dp_conf;
$handler = fopen(ENGINE_DIR.'/data/dp_conf.php', "w");
fwrite($handler, "<?php\n\$dp_conf = array(\n");
foreach($save_con as $name => $value){
$value=trim(stripslashes ($value));
$value=htmlspecialchars ($value, ENT_QUOTES);
$value = preg_replace($find,$replace,$value);
fwrite($handler, "'{$name}' => \"{$value}\",\n");}
fwrite($handler, ");\n?>");
fclose($handler);
clear_cache ();
msg( "info", "DownPage Ultimate for DLE", $dplang_adm['opt_allsave_ok'], "$PHP_SELF?mod=downpage");
}
elseif( $action == "logs" ) {
echoheader( "<i class=\"icon-hdd\"></i> DownPage Ultimate", "Historial de Descargas" );
if($dp_conf[log_save] == "1"){
$dp_log_save_info = "<a href=\"$PHP_SELF?mod=downpage&action=options\" class=\"btn btn-green\"><i class=\"icon-folder-open\"></i> {$dplang_adm['plu_online']}</a>";
} else {
$dp_log_save_info = "<a href=\"$PHP_SELF?mod=downpage&action=options\" class=\"btn btn-red\"><i class=\"icon-folder-close\"></i> {$dplang_adm['plu_offline']}</a>";
}
echo <<<HTML
<div class="box">
<div class="box-content">
<div class="row box-section">
<form action="" method="">
{$dp_log_save_info}
<input type="hidden" name="user_hash" value="{$dle_login_hash}">
<input type=hidden name=mod value=downpage>
<input type=hidden name=action value=clearlog>
<button type="submit" class="btn btn-red"><i class="icon-trash"></i> {$dplang_adm[opt_log_clear]}</button>
<a href="$PHP_SELF?mod=downpage" class="btn btn-gold"><i class="icon-exchange"></i> {$dplang_adm['opt_back']}</a>
</form>
</div>
</div>
</div>
HTML;
echo <<<HTML
<div class="alert alert-info"><b>{$dplang_adm['mod_log_help_1']}:</b><br />{$dplang_adm['mod_log_help']}</div>
HTML;
echo <<<HTML
<style>table.bt1,table.bt1 td {border:1px solid #f4f4f4;border-collapse:collapse;padding:3;}</style>
<script>function bg1(t){t.style.background="#FFF9E0";}function bg(t){t.style.background="";}</script>
HTML;
$mass = file(ENGINE_DIR.'/data/dp_log.txt');
if ($mass == "" or $mass[0] == ""){
$dp_log_mass = "
<div class=\"box\">
<div class=\"box-header\">
<div class=\"title\">En esta sección usted podrá ver una lista con los detalles de los archivos descargados desde el Servidor.</div>
</div>
<div class=\"box-content\">
<table class=\"table table-normal table-hover\">
<tr onmouseover='bg1(this)' onmouseout='bg(this)'>
<td style=\"padding-left:5px;\">{$dplang_adm['log_0']}</td>
</tr>
</table>
</div>
</div>";
} else {
$dp_log_mass .= <<<HTML
<div class="box">
<div class="box-header">
<div class="title">En esta sección usted podrá ver una lista con los detalles de los archivos descargados desde el Servidor.</div>
</div>
<div class="box-content">
<table class="table table-normal table-hover">
<thead>
<tr onmouseover='bg1(this)' onmouseout='bg(this)'>
<td width="200"><b>{$dplang_adm['log_sort_login']}</b></td>
<td width="300"><b>{$dplang_adm['log_sort_file']}</b></td>
<td width="200"><b>{$dplang_adm['log_sort_date']}</b></td>
<td><b>{$dplang_adm['log_sort_ip']}</b></td>
</tr>
</thead>
<tbody>
HTML;
for ($x=0;$x<count($mass);$x++){
list($user_login,$datetime,$ip,$file) = explode("|",trim($mass[$x]));
$dp_log_mass .= <<<HTML
<tr onmouseover='bg1(this)' onmouseout='bg(this)'>
<td>{$user_login}</td>
<td>{$file}</td>
<td>{$datetime}</td>
<td>{$ip}</td>
</tr>
HTML;
}
$dp_log_mass .= <<<HTML
</tbody>
</table>
</div>
</div>
HTML;
}
echo "$dp_log_mass";
echofooter();
}
elseif( $action == "clearlog" ) {
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
die( "Hacking attempt! User not found" );
}
$f = fopen( ENGINE_DIR . '/data/dp_log.txt',"w");
fclose ($f);
msg( "info", "DownPage Ultimate for DLE", $dplang_adm['log_clear'], "$PHP_SELF?mod=downpage" );
}
?>