msd Backup hinzugefügt
This commit is contained in:
79
msd/inc/home/apr1_md5/apr1_md5.php
Normal file
79
msd/inc/home/apr1_md5/apr1_md5.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace WhiteHat101\Crypt;
|
||||
|
||||
class APR1_MD5
|
||||
{
|
||||
public const BASE64_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||
public const APRMD5_ALPHABET = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
// Source/References for core algorithm:
|
||||
// http://www.cryptologie.net/article/126/bruteforce-apr1-hashes/
|
||||
// http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/crypto/apr_md5.c?view=co
|
||||
// http://www.php.net/manual/en/function.crypt.php#73619
|
||||
// http://httpd.apache.org/docs/2.2/misc/password_encryptions.html
|
||||
// Wikipedia
|
||||
|
||||
public static function hash($mdp, $salt = null)
|
||||
{
|
||||
if (is_null($salt)) {
|
||||
$salt = self::salt();
|
||||
}
|
||||
$salt = substr($salt, 0, 8);
|
||||
$max = strlen($mdp);
|
||||
$context = $mdp.'$apr1$'.$salt;
|
||||
$binary = pack('H32', md5($mdp.$salt.$mdp));
|
||||
for ($i = $max; $i > 0; $i -= 16) {
|
||||
$context .= substr($binary, 0, min(16, $i));
|
||||
}
|
||||
for ($i = $max; $i > 0; $i >>= 1) {
|
||||
$context .= ($i & 1) ? chr(0) : $mdp[0];
|
||||
}
|
||||
$binary = pack('H32', md5($context));
|
||||
for ($i = 0; $i < 1000; ++$i) {
|
||||
$new = ($i & 1) ? $mdp : $binary;
|
||||
if ($i % 3) {
|
||||
$new .= $salt;
|
||||
}
|
||||
if ($i % 7) {
|
||||
$new .= $mdp;
|
||||
}
|
||||
$new .= ($i & 1) ? $binary : $mdp;
|
||||
$binary = pack('H32', md5($new));
|
||||
}
|
||||
$hash = '';
|
||||
for ($i = 0; $i < 5; ++$i) {
|
||||
$k = $i + 6;
|
||||
$j = $i + 12;
|
||||
if (16 == $j) {
|
||||
$j = 5;
|
||||
}
|
||||
$hash = $binary[$i].$binary[$k].$binary[$j].$hash;
|
||||
}
|
||||
$hash = chr(0).chr(0).$binary[11].$hash;
|
||||
$hash = strtr(
|
||||
strrev(substr(base64_encode($hash), 2)),
|
||||
self::BASE64_ALPHABET,
|
||||
self::APRMD5_ALPHABET
|
||||
);
|
||||
return '$apr1$'.$salt.'$'.$hash;
|
||||
}
|
||||
|
||||
// 8 character salts are the best. Don't encourage anything but the best.
|
||||
public static function salt()
|
||||
{
|
||||
$alphabet = self::APRMD5_ALPHABET;
|
||||
$salt = '';
|
||||
for ($i = 0; $i < 8; ++$i) {
|
||||
$offset = hexdec(bin2hex(openssl_random_pseudo_bytes(1))) % 64;
|
||||
$salt .= $alphabet[$offset];
|
||||
}
|
||||
return $salt;
|
||||
}
|
||||
|
||||
public static function check($plain, $hash)
|
||||
{
|
||||
$parts = explode('$', $hash);
|
||||
return self::hash($plain, $parts[2]) === $hash;
|
||||
}
|
||||
}
|
22
msd/inc/home/apr1_md5/license.txt
Normal file
22
msd/inc/home/apr1_md5/license.txt
Normal file
@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Jeremy
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
1
msd/inc/home/apr1_md5/origin_url.txt
Normal file
1
msd/inc/home/apr1_md5/origin_url.txt
Normal file
@ -0,0 +1 @@
|
||||
https://github.com/whitehat101/apr1-md5
|
230
msd/inc/home/databases.php
Normal file
230
msd/inc/home/databases.php
Normal file
@ -0,0 +1,230 @@
|
||||
<?php
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
MyOOS [Dumper]
|
||||
http://www.oos-shop.de/
|
||||
|
||||
Copyright (c) 2013 - 2022 by the MyOOS Development Team.
|
||||
----------------------------------------------------------------------
|
||||
Based on:
|
||||
|
||||
MySqlDumper
|
||||
http://www.mysqldumper.de
|
||||
|
||||
Copyright (C)2004-2011 Daniel Schlichtholz (admin@mysqldumper.de)
|
||||
----------------------------------------------------------------------
|
||||
Released under the GNU General Public License
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
if (!defined('MOD_VERSION')) {
|
||||
exit('No direct access.');
|
||||
}
|
||||
include './language/'.$config['language'].'/lang_sql.php';
|
||||
$checkit = (isset($_GET['checkit'])) ? urldecode($_GET['checkit']) : '';
|
||||
$repair = (isset($_GET['repair'])) ? $_GET['repair'] : 0;
|
||||
$enableKeys = (isset($_GET['enableKeys'])) ? $_GET['enableKeys'] : '';
|
||||
for ($i = 0; $i < count($databases['Name']); ++$i) {
|
||||
if (isset($_POST['empty'.$i])) {
|
||||
EmptyDB($databases['Name'][$i]);
|
||||
$dba = '<p class="green">'.$lang['L_DB'].' '.$databases['Name'][$i].' '.$lang['L_INFO_CLEARED'].'</p>';
|
||||
break;
|
||||
}
|
||||
if (isset($_POST['kill'.$i])) {
|
||||
$res = mysqli_query($config['dbconnection'], 'DROP DATABASE `'.$databases['Name'][$i].'`') or exit(mysqli_error($config['dbconnection']));
|
||||
$dba = '<p class="green">'.$lang['L_DB'].' '.$databases['Name'][$i].' '.$lang['L_INFO_DELETED'].'</p>';
|
||||
SetDefault();
|
||||
include $config['files']['parameter'];
|
||||
echo '<script>parent.MyOOS_Dumper_menu.location.href="menu.php?action=dbrefresh";</script>';
|
||||
break;
|
||||
}
|
||||
if (isset($_POST['optimize'.$i])) {
|
||||
mysqli_select_db($config['dbconnection'], $databases['Name'][$i]);
|
||||
$res = mysqli_query($config['dbconnection'], 'SHOW TABLES FROM `'.$databases['Name'][$i].'`');
|
||||
$tabellen = '';
|
||||
while ($row = mysqli_fetch_row($res)) {
|
||||
$tabellen .= '`'.$row[0].'`,';
|
||||
}
|
||||
$tabellen = substr($tabellen, 0, (strlen($tabellen) - 1));
|
||||
if ($tabellen > '') {
|
||||
$query = 'OPTIMIZE TABLE '.$tabellen;
|
||||
$res = mysqli_query($config['dbconnection'], $query) or exit(mysqli_error($config['dbconnection']).'');
|
||||
}
|
||||
$_GET['dbid'] = $i;
|
||||
$dba = '<p class="green">'.$lang['L_DB'].' <b>'.$databases['Name'][$i].'</b> '.$lang['L_INFO_OPTIMIZED'].'.</p>';
|
||||
break;
|
||||
}
|
||||
if (isset($_POST['check'.$i])) {
|
||||
$checkit = 'ALL';
|
||||
$_GET['dbid'] = $i;
|
||||
}
|
||||
if (isset($_POST['enableKeys'.$i])) {
|
||||
$enableKeys = 'ALL';
|
||||
$_GET['dbid'] = $i;
|
||||
}
|
||||
}
|
||||
|
||||
//list databases
|
||||
$tpl = new MODTemplate();
|
||||
$tpl->set_filenames([
|
||||
'show' => './tpl/home/databases_list_dbs.tpl', ]);
|
||||
$tpl->assign_vars([
|
||||
'ICONPATH' => $config['files']['iconpath'], ]);
|
||||
|
||||
if (!isset($config['dbconnection'])) {
|
||||
mod_mysqli_connect();
|
||||
}
|
||||
for ($i = 0; $i < count($databases['Name']); ++$i) {
|
||||
$rowclass = ($i % 2) ? 'dbrow' : 'dbrow1';
|
||||
if ($i == $databases['db_selected_index']) {
|
||||
$rowclass = 'dbrowsel';
|
||||
}
|
||||
|
||||
//gibts die Datenbank überhaupt?
|
||||
if (!mysqli_select_db($config['dbconnection'], $databases['Name'][$i])) {
|
||||
$tpl->assign_block_vars('DB_NOT_FOUND', [
|
||||
'ROWCLASS' => $rowclass,
|
||||
'NR' => ($i + 1),
|
||||
'DB_NAME' => $databases['Name'][$i],
|
||||
'DB_ID' => $i, ]);
|
||||
} else {
|
||||
mysqli_select_db($config['dbconnection'], $databases['Name'][$i]);
|
||||
$tabellen = mysqli_query($config['dbconnection'], 'SHOW TABLES FROM `'.$databases['Name'][$i].'`');
|
||||
$num_tables = mysqli_num_rows($tabellen);
|
||||
$tpl->assign_block_vars('ROW', [
|
||||
'ROWCLASS' => $rowclass,
|
||||
'NR' => ($i + 1),
|
||||
'DB_NAME' => $databases['Name'][$i],
|
||||
'DB_ID' => $i,
|
||||
'TABLE_COUNT' => $num_tables, ]);
|
||||
if (1 == $num_tables) {
|
||||
$tpl->assign_block_vars('ROW.TABLE', []);
|
||||
} else {
|
||||
$tpl->assign_block_vars('ROW.TABLES', []);
|
||||
}
|
||||
}
|
||||
}
|
||||
$tpl->pparse('show');
|
||||
|
||||
//list tables of selected database
|
||||
if (isset($_GET['dbid'])) {
|
||||
$disabled_keys_found = false;
|
||||
|
||||
// Output list of tables of the selected database
|
||||
$tpl = new MODTemplate();
|
||||
$tpl->set_filenames([
|
||||
'show' => 'tpl/home/databases_list_tables.tpl', ]);
|
||||
$dbid = $_GET['dbid'];
|
||||
|
||||
$numrows = 0;
|
||||
$res = mysqli_query($config['dbconnection'], 'SHOW TABLE STATUS FROM `'.$databases['Name'][$dbid].'`');
|
||||
mysqli_select_db($config['dbconnection'], $databases['Name'][$dbid]);
|
||||
if ($res) {
|
||||
$numrows = mysqli_num_rows($res);
|
||||
}
|
||||
$tpl->assign_vars([
|
||||
'DB_NAME' => $databases['Name'][$dbid],
|
||||
'DB_NAME_URLENCODED' => urlencode($databases['Name'][$dbid]),
|
||||
'DB_ID' => $dbid,
|
||||
'TABLE_COUNT' => $numrows,
|
||||
'ICONPATH' => $config['files']['iconpath'], ]);
|
||||
$numrows = intval($numrows);
|
||||
if ($numrows > 1) {
|
||||
$tpl->assign_block_vars('MORE_TABLES', []);
|
||||
} elseif (1 == $numrows) {
|
||||
$tpl->assign_block_vars('1_TABLE', []);
|
||||
} elseif (0 == $numrows) {
|
||||
$tpl->assign_block_vars('NO_TABLE', []);
|
||||
}
|
||||
if ($numrows > 0) {
|
||||
$last_update = '2000-01-01 00:00:00';
|
||||
$sum_records = $sum_data_length = 0;
|
||||
for ($i = 0; $i < $numrows; ++$i) {
|
||||
$row = mysqli_fetch_array($res, MYSQLI_ASSOC);
|
||||
// Get nr of records -> need to do it this way because of incorrect returns when using InnoDBs
|
||||
$sql_2 = 'SELECT count(*) as `count_records` FROM `'.$databases['Name'][$dbid].'`.`'.$row['Name'].'`';
|
||||
$res2 = mysqli_query($config['dbconnection'], $sql_2);
|
||||
if (false === $res2) {
|
||||
$row['Rows'] = 0;
|
||||
$rowclass = 'dbrowsel';
|
||||
} else {
|
||||
$row2 = mysqli_fetch_array($res2);
|
||||
$row['Rows'] = $row2['count_records'];
|
||||
$rowclass = ($i % 2) ? 'dbrow' : 'dbrow1';
|
||||
}
|
||||
|
||||
if (isset($row['Update_time']) && strtotime($row['Update_time']) > strtotime($last_update)) {
|
||||
$last_update = $row['Update_time'];
|
||||
}
|
||||
$sum_records += $row['Rows'];
|
||||
$sum_data_length += $row['Data_length'] + $row['Index_length'];
|
||||
|
||||
$keys_disabled = false;
|
||||
if ('MyIsam' == $row['Engine']) {
|
||||
}
|
||||
$tpl->assign_block_vars('ROW', [
|
||||
'ROWCLASS' => $rowclass,
|
||||
'NR' => ($i + 1),
|
||||
'TABLE_NAME' => $row['Name'],
|
||||
'TABLE_NAME_URLENCODED' => urlencode($row['Name']),
|
||||
'RECORDS' => $row['Rows'],
|
||||
'SIZE' => byte_output($row['Data_length'] + $row['Index_length']),
|
||||
'LAST_UPDATE' => $row['Update_time'],
|
||||
'ENGINE' => $row['Engine'],
|
||||
]);
|
||||
|
||||
// Otimize & Repair - only for MyISAM-Tables
|
||||
if ('MyISAM' == $row['Engine']) {
|
||||
if (0 == $row['Data_free']) {
|
||||
$tpl->assign_block_vars('ROW.OPTIMIZED', []);
|
||||
} else {
|
||||
$tpl->assign_block_vars('ROW.NOT_OPTIMIZED', []);
|
||||
}
|
||||
|
||||
if ($checkit == $row['Name'] || 1 == $repair) {
|
||||
$tmp_res = mysqli_query($config['dbconnection'], 'REPAIR TABLE `'.$row['Name'].'`');
|
||||
}
|
||||
|
||||
if (($checkit == $row['Name'] || 'ALL' == $checkit)) {
|
||||
// table needs to be checked
|
||||
$tmp_res = mysqli_query($config['dbconnection'], 'CHECK TABLE `'.$row['Name'].'`');
|
||||
if ($tmp_res) {
|
||||
$tmp_row = mysqli_fetch_row($tmp_res);
|
||||
if ('OK' == $tmp_row[3]) {
|
||||
$tpl->assign_block_vars('ROW.CHECK_TABLE_OK', []);
|
||||
} else {
|
||||
$tpl->assign_block_vars('ROW.CHECK_TABLE_NOT_OK', []);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Show Check table link
|
||||
$tpl->assign_block_vars('ROW.CHECK_TABLE', []);
|
||||
}
|
||||
if ($enableKeys == $row['Name'] || 'ALL' == $enableKeys) {
|
||||
$sSql = 'ALTER TABLE `'.$databases['Name'][$dbid].'`.`'.$row['Name'].'` ENABLE KEYS';
|
||||
$tmp_res = mysqli_query($config['dbconnection'], $sSql);
|
||||
}
|
||||
$res3 = mysqli_query($config['dbconnection'], 'SHOW INDEX FROM `'.$databases['Name'][$dbid].'`.`'.$row['Name'].'`');
|
||||
while ($row3 = mysqli_fetch_array($res3, MYSQLI_ASSOC)) {
|
||||
if ('disabled' == $row3['Comment']) {
|
||||
$keys_disabled = true;
|
||||
$disabled_keys_found = true;
|
||||
}
|
||||
}
|
||||
if ($keys_disabled) {
|
||||
$tpl->assign_block_vars('ROW.KEYS_DISABLED', []);
|
||||
} else {
|
||||
$tpl->assign_block_vars('ROW.KEYS_ENABLED', []);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Output sum-row
|
||||
$tpl->assign_block_vars('SUM', [
|
||||
'RECORDS' => number_format($sum_records, 0, ',', '.'),
|
||||
'SIZE' => byte_output($sum_data_length),
|
||||
'LAST_UPDATE' => $last_update, ]);
|
||||
if ($disabled_keys_found) {
|
||||
$tpl->assign_block_vars('DISABLED_KEYS_FOUND', []);
|
||||
}
|
||||
}
|
||||
$tpl->pparse('show');
|
||||
}
|
144
msd/inc/home/home.php
Normal file
144
msd/inc/home/home.php
Normal file
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
MyOOS [Dumper]
|
||||
http://www.oos-shop.de/
|
||||
|
||||
Copyright (c) 2013 - 2022 by the MyOOS Development Team.
|
||||
----------------------------------------------------------------------
|
||||
Based on:
|
||||
|
||||
MySqlDumper
|
||||
http://www.mysqldumper.de
|
||||
|
||||
Copyright (C)2004-2011 Daniel Schlichtholz (admin@mysqldumper.de)
|
||||
----------------------------------------------------------------------
|
||||
Released under the GNU General Public License
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
if (!defined('MOD_VERSION')) {
|
||||
exit('No direct access.');
|
||||
}
|
||||
$Sum_Files = $Sum_Size = 0;
|
||||
$Last_BU = [];
|
||||
$is_htaccess = (file_exists('./.htaccess'));
|
||||
$is_protected = IsAccessProtected();
|
||||
$is_new_version_available = (isset($update) && is_object($update) && $check_update === true) ? $update->newVersionAvailable() : false;
|
||||
|
||||
// find latest backup file
|
||||
$available = [];
|
||||
if ('' == $databases['multisetting']) {
|
||||
$available[0] = $databases['db_actual'];
|
||||
} else {
|
||||
$available = explode(';', $databases['multisetting']);
|
||||
}
|
||||
$dh = opendir($config['paths']['backup']);
|
||||
while (false !== ($filename = readdir($dh))) {
|
||||
if ('.' != $filename && '..' != $filename && !is_dir($config['paths']['backup'].$filename)) {
|
||||
foreach ($available as $item) {
|
||||
$pos = strpos($filename, $item);
|
||||
if ($pos === false) {
|
||||
// Der Datenbankname wurde nicht in der Konfiguration gefunden;
|
||||
} else {
|
||||
$files[] = $filename;
|
||||
++$Sum_Files;
|
||||
$Sum_Size += filesize($config['paths']['backup'].$filename);
|
||||
$ft = filectime($config['paths']['backup'].$filename);
|
||||
if (!isset($Last_BU[2]) || (isset($Last_BU[2]) && $ft > $Last_BU[2])) {
|
||||
$Last_BU[0] = $filename;
|
||||
$Last_BU[1] = date('d.m.Y H:i', $ft);
|
||||
$Last_BU[2] = $ft;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!is_writable($config['paths']['temp'])) {
|
||||
$ret = SetFileRechte($config['paths']['temp'], 1, 0777);
|
||||
}
|
||||
if (!is_writable($config['paths']['cache'])) {
|
||||
$ret = SetFileRechte($config['paths']['cache'], 1, 0777);
|
||||
}
|
||||
$directory_warnings = DirectoryWarnings();
|
||||
|
||||
if ($is_new_version_available) {
|
||||
$update_info = $lang['L_NEW_MOD_VERSION'] . ': ' . $update->getLatestVersion();
|
||||
}
|
||||
|
||||
$tpl = new MODTemplate();
|
||||
$tpl->set_filenames([
|
||||
'show' => 'tpl/home/home.tpl', ]);
|
||||
$tpl->assign_vars([
|
||||
'THEME' => $config['theme'],
|
||||
'MOD_VERSION' => MOD_VERSION,
|
||||
'OS' => MOD_OS,
|
||||
'OS_EXT' => MOD_OS_EXT,
|
||||
'MYSQL_VERSION' => MOD_MYSQL_VERSION,
|
||||
'PHP_VERSION' => PHP_VERSION,
|
||||
'MEMORY' => byte_output($config['php_ram'] * 1024 * 1024),
|
||||
'MAX_EXECUTION_TIME' => $config['max_execution_time'],
|
||||
'PHP_EXTENSIONS' => $config['phpextensions'],
|
||||
'SERVER_NAME' => $_SERVER['SERVER_NAME'],
|
||||
'MOD_PATH' => $config['paths']['root'],
|
||||
'DB' => $databases['db_actual'],
|
||||
'NR_OF_BACKUP_FILES' => $Sum_Files,
|
||||
'SIZE_BACKUPS' => byte_output($Sum_Size),
|
||||
'FREE_DISKSPACE' => MD_FreeDiskSpace(),
|
||||
]);
|
||||
|
||||
|
||||
|
||||
if ($is_new_version_available) {
|
||||
$tpl->assign_block_vars('NEW_VERSION_EXISTS', []);
|
||||
}
|
||||
|
||||
if (isset($update_info)) {
|
||||
$tpl->assign_block_vars('UPDATE_INFO', [
|
||||
'MSG' => $update_info, ]);
|
||||
}
|
||||
|
||||
|
||||
if ($directory_warnings > '') {
|
||||
$tpl->assign_block_vars('DIRECTORY_WARNINGS', [
|
||||
'MSG' => $directory_warnings, ]);
|
||||
}
|
||||
|
||||
if ($config['disabled'] > '') {
|
||||
$tpl->assign_block_vars('DISABLED_FUNCTIONS', [
|
||||
'PHP_DISABLED_FUNCTIONS' => str_replace(',', ', ', $config['disabled']), ]);
|
||||
}
|
||||
|
||||
if (!extension_loaded('ftp')) {
|
||||
$tpl->assign_block_vars('NO_FTP', []);
|
||||
}
|
||||
if (!$config['zlib']) {
|
||||
$tpl->assign_block_vars('NO_ZLIB', []);
|
||||
}
|
||||
|
||||
if (false === $is_protected) {
|
||||
$tpl->assign_block_vars('DIRECTORY_PROTECTION_STATUS_ERROR', ['MSG' => $lang['L_HTACC_CHECK_ERROR']]);
|
||||
} elseif (1 === $is_protected && !$is_htaccess) {
|
||||
$tpl->assign_block_vars('DIRECTORY_PROTECTION_STATUS', ['MSG' => $lang['L_HTACC_NOT_NEEDED']]);
|
||||
} elseif (1 === $is_protected && $is_htaccess) {
|
||||
$tpl->assign_block_vars('DIRECTORY_PROTECTION_STATUS', ['MSG' => $lang['L_HTACC_COMPLETE']]);
|
||||
} elseif (0 === $is_protected && $is_htaccess) {
|
||||
$tpl->assign_block_vars('DIRECTORY_PROTECTION_STATUS_ERROR', ['MSG' => $lang['L_HTACC_INCOMPLETE']]);
|
||||
} else {
|
||||
$tpl->assign_block_vars('DIRECTORY_PROTECTION_STATUS_ERROR', ['MSG' => $lang['L_HTACC_PROPOSED']]);
|
||||
}
|
||||
|
||||
if ($is_htaccess) {
|
||||
$tpl->assign_block_vars('HTACCESS_EXISTS', []);
|
||||
} else {
|
||||
$tpl->assign_block_vars('HTACCESS_DOESNT_EXISTS', []);
|
||||
}
|
||||
|
||||
if ($Sum_Files > 0 && isset($Last_BU[1])) {
|
||||
$tpl->assign_block_vars('LAST_BACKUP', [
|
||||
'LAST_BACKUP_INFO' => $Last_BU[1],
|
||||
'LAST_BACKUP_LINK' => $config['paths']['backup'].urlencode($Last_BU[0]),
|
||||
'LAST_BACKUP_NAME' => $Last_BU[0], ]);
|
||||
}
|
||||
$tpl->pparse('show');
|
118
msd/inc/home/mysql_variables.php
Normal file
118
msd/inc/home/mysql_variables.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
MyOOS [Dumper]
|
||||
http://www.oos-shop.de/
|
||||
|
||||
Copyright (c) 2013 - 2022 by the MyOOS Development Team.
|
||||
----------------------------------------------------------------------
|
||||
Based on:
|
||||
|
||||
MySqlDumper
|
||||
http://www.mysqldumper.de
|
||||
|
||||
Copyright (C)2004-2011 Daniel Schlichtholz (admin@mysqldumper.de)
|
||||
----------------------------------------------------------------------
|
||||
Released under the GNU General Public License
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
if (!defined('MOD_VERSION')) {
|
||||
exit('No direct access.');
|
||||
}
|
||||
$var = (isset($_GET['var'])) ? $_GET['var'] : 'prozesse';
|
||||
$Titelausgabe = [
|
||||
'variables' => $lang['L_VARIABELN'], 'status' => $lang['L_STATUS'], 'prozesse' => $lang['L_PROZESSE'], ];
|
||||
echo '<h5>'.$lang['L_MYSQLVARS'].'</h5><strong>'.$Titelausgabe[$var].'</strong> ';
|
||||
echo '<a href="main.php?action=vars&var=prozesse">'.$lang['L_PROZESSE'].'</a> ';
|
||||
echo '<a href="main.php?action=vars&var=status">'.$lang['L_STATUS'].'</a> ';
|
||||
echo '<a href="main.php?action=vars&var=variables">'.$lang['L_VARIABELN'].'</a> ';
|
||||
|
||||
echo '<p> </p>';
|
||||
//Variabeln
|
||||
switch ($var) {
|
||||
case 'variables':
|
||||
$res = mysqli_query($config['dbconnection'], 'SHOW variables');
|
||||
if ($res) {
|
||||
$numrows = mysqli_num_rows($res);
|
||||
}
|
||||
if (0 == $numrows) {
|
||||
echo $lang['L_INFO_NOVARS'];
|
||||
} else {
|
||||
echo '<table class="bdr"><tr class="thead"><th><strong>Name</strong></th><th><strong>'.$lang['L_INHALT'].'</strong></th></tr>';
|
||||
for ($i = 0; $i < $numrows; ++$i) {
|
||||
$row = mysqli_fetch_array($res);
|
||||
$cl = ($i % 2) ? 'dbrow' : 'dbrow1';
|
||||
echo '<tr class="'.$cl.'"><td align="left">'.$row[0].'</td><td align="left">'.$row[1].'</td></tr>';
|
||||
}
|
||||
}
|
||||
echo '</table>';
|
||||
break;
|
||||
case 'status':
|
||||
$res = mysqli_query($config['dbconnection'], 'SHOW STATUS');
|
||||
if ($res) {
|
||||
$numrows = mysqli_num_rows($res);
|
||||
}
|
||||
if (0 == $numrows) {
|
||||
echo $lang['L_INFO_NOSTATUS'];
|
||||
} else {
|
||||
echo '<table class="bdr"><tr class="thead"><th>Name</th><th>'.$lang['L_INHALT'].'</th></tr>';
|
||||
for ($i = 0; $i < $numrows; ++$i) {
|
||||
$cl = ($i % 2) ? 'dbrow' : 'dbrow1';
|
||||
$row = mysqli_fetch_array($res);
|
||||
echo '<tr class="'.$cl.'"><td align="left" valign="top">'.$row[0].'</td><td align="left" valign="top">'.$row[1].'</td></tr>';
|
||||
}
|
||||
}
|
||||
echo '</table>';
|
||||
break;
|
||||
case 'prozesse':
|
||||
if ($config['processlist_refresh'] < 1000) {
|
||||
$config['processlist_refresh'] = 2000;
|
||||
}
|
||||
if (isset($_GET['killid']) && $_GET['killid'] > 0) {
|
||||
$killid = (isset($_GET['killid'])) ? $_GET['killid'] : 0;
|
||||
$wait = (isset($_GET['wait'])) ? $_GET['wait'] : 0;
|
||||
if (0 == $wait) {
|
||||
$ret = mysqli_query($config['dbconnection'], 'KILL '.$_GET['killid']);
|
||||
$wait = 2;
|
||||
} else {
|
||||
$wait += 2;
|
||||
}
|
||||
|
||||
if (0 == $wait) {
|
||||
echo '<p class="success">'.$lang['L_PROCESSKILL1'].$_GET['killid'].' '.$lang['L_PROCESSKILL2'].'</p>';
|
||||
} else {
|
||||
echo '<p class="success">'.$lang['L_PROCESSKILL3'].$wait.$lang['L_PROCESSKILL4'].$_GET['killid'].' '.$lang['L_PROCESSKILL2'].'</p>';
|
||||
}
|
||||
}
|
||||
|
||||
$killid = $wait = 0;
|
||||
$res = mysqli_query($config['dbconnection'], 'SHOW FULL PROCESSLIST ');
|
||||
if ($res) {
|
||||
$numrows = mysqli_num_rows($res);
|
||||
}
|
||||
if (0 == $numrows) {
|
||||
echo $lang['L_INFO_NOPROCESSES'];
|
||||
} else {
|
||||
echo '<table class="bdr" style="width:100%"><tr class="thead"><th>ID</th><th>User</th><th>Host</th><th>DB</th><th>Command</th><th>Time</th><th>State</th><th width="800">Info</th><th nowrap="nowrap">RT: '.round($config['processlist_refresh'] / 1000).' sec</th></tr>';
|
||||
for ($i = 0; $i < $numrows; ++$i) {
|
||||
$cl = ($i % 2) ? 'dbrow' : 'dbrow1';
|
||||
$row = mysqli_fetch_array($res);
|
||||
echo '<tr><td>'.$row[0].'</td><td>'.$row[1].'</td>
|
||||
<td>'.$row[2].'</td><td>'.$row[3].'</td><td>'.$row[4].'</td><td>'.$row[5].'</td>
|
||||
<td>'.$row[6].'</td><td>'.$row[7].'</td>
|
||||
<td><a href="main.php?action=vars&var=prozesse&killid='.$row[0].'">kill</a></td></tr>';
|
||||
if ($row[0] == $killid && 'Killed' == $row[4]) {
|
||||
$wait = $killid = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '</table>';
|
||||
echo '<form name="f" method="get" action="main.php">
|
||||
<input type="hidden" name="wait" value="'.$wait.'">
|
||||
<input type="hidden" name="killid" value="'.$killid.'">
|
||||
<input type="hidden" name="action" value="vars">
|
||||
<input type="hidden" name="var" value="prozesse"></form>';
|
||||
echo '<script>window.setTimeout("document.f.submit();","'.$config['processlist_refresh'].'");</script>';
|
||||
|
||||
break;
|
||||
}
|
167
msd/inc/home/protection_create.php
Normal file
167
msd/inc/home/protection_create.php
Normal file
@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
MyOOS [Dumper]
|
||||
http://www.oos-shop.de/
|
||||
|
||||
Copyright (c) 2013 - 2022 by the MyOOS Development Team.
|
||||
----------------------------------------------------------------------
|
||||
Based on:
|
||||
|
||||
MySqlDumper
|
||||
http://www.mysqldumper.de
|
||||
|
||||
Copyright (C)2004-2011 Daniel Schlichtholz (admin@mysqldumper.de)
|
||||
----------------------------------------------------------------------
|
||||
Released under the GNU General Public License
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
if (!defined('MOD_VERSION')) {
|
||||
exit('No direct access.');
|
||||
}
|
||||
include './language/'.$config['language'].'/lang_sql.php';
|
||||
|
||||
include './inc/home/apr1_md5/apr1_md5.php';
|
||||
use WhiteHat101\Crypt\APR1_MD5;
|
||||
|
||||
$dba = $hta_dir = $Overwrite = $msg = '';
|
||||
$error = [];
|
||||
$is_htaccess = (file_exists('./.htaccess'));
|
||||
if ($is_htaccess) {
|
||||
$Overwrite = '<p class="error">'.$lang['L_HTACCESS8'].'</p>';
|
||||
$htaccess_exist = file('.htaccess'); // read .htaccess
|
||||
}
|
||||
|
||||
$step = (isset($_POST['step'])) ? intval($_POST['step']) : 0;
|
||||
$type = 1; // default encryption type set to MD5(APR)
|
||||
if ('WIN' == strtoupper(substr(MOD_OS, 0, 3))) {
|
||||
$type = 2;
|
||||
} // we are on a Win-System; pre-select encryption type
|
||||
if (isset($_POST['type'])) {
|
||||
$type = intval($_POST['type']);
|
||||
}
|
||||
$username = (isset($_POST['username'])) ? $_POST['username'] : '';
|
||||
$userpass1 = (isset($_POST['userpass1'])) ? $_POST['userpass1'] : '';
|
||||
$userpass2 = (isset($_POST['userpass2'])) ? $_POST['userpass2'] : '';
|
||||
|
||||
header('Pragma: no-cache');
|
||||
header('Cache-Control: no-cache, must-revalidate');
|
||||
header('Expires: -1');
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
$tpl = new MODTemplate();
|
||||
$tpl->set_filenames([
|
||||
'show' => './tpl/home/protection_create.tpl', ]);
|
||||
$tpl->assign_vars([
|
||||
'THEME' => $config['theme'],
|
||||
'HEADLINE' => headline($lang['L_HTACC_CREATE']), ]);
|
||||
|
||||
if (isset($_POST['username'])) {
|
||||
// Form submitted
|
||||
if ('' == $username) {
|
||||
$error[] = $lang['L_HTACC_NO_USERNAME'];
|
||||
}
|
||||
if (($userpass1 != $userpass2) || ('' == $userpass1)) {
|
||||
$error[] = $lang['L_PASSWORDS_UNEQUAL'];
|
||||
}
|
||||
|
||||
if (0 == sizeof($error)) {
|
||||
$realm = 'MyOOS-Dumper';
|
||||
$htaccess =
|
||||
"<IfModule mod_rewrite.c>\n".
|
||||
" RewriteEngine off\n".
|
||||
"</IfModule>\n".
|
||||
'AuthName "'.$realm."\"\n".
|
||||
"AuthType Basic\n".
|
||||
'AuthUserFile "'.$config['paths']['root'].".htpasswd\"\n".
|
||||
'Require valid-user';
|
||||
switch ($type) {
|
||||
// CRYPT
|
||||
case 0:
|
||||
$userpass = crypt($userpass1, 'rl');
|
||||
break;
|
||||
// MD5(APR)
|
||||
case 1:
|
||||
$userpass = APR1_MD5::hash($userpass1);
|
||||
break;
|
||||
// PLAIN TEXT
|
||||
case 2:
|
||||
$userpass = $userpass1;
|
||||
break;
|
||||
// SHA1
|
||||
case 3:
|
||||
$userpass = '{SHA}'.base64_encode(sha1($userpass1, true));
|
||||
break;
|
||||
// BCRYPT
|
||||
case 4:
|
||||
$userpass = password_hash($userpass1, PASSWORD_BCRYPT);
|
||||
break;
|
||||
}
|
||||
$htpasswd = $username.':'.$userpass;
|
||||
@chmod($config['paths']['root'], 0777);
|
||||
|
||||
// save .htpasswd
|
||||
if ($file_htpasswd = @fopen('.htpasswd', 'w')) {
|
||||
$saved = fputs($file_htpasswd, $htpasswd);
|
||||
fclose($file_htpasswd);
|
||||
} else {
|
||||
$saved = false;
|
||||
}
|
||||
|
||||
// save .htaccess
|
||||
if (false !== $saved) {
|
||||
$file_htaccess = @fopen('.htaccess', 'w');
|
||||
if ($file_htaccess) {
|
||||
$saved = fputs($file_htaccess, $htaccess);
|
||||
fclose($file_htaccess);
|
||||
} else {
|
||||
$saved = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (false !== $saved) {
|
||||
$msg = '<span class="success">'.$lang['L_HTACC_CREATED'].'</span>';
|
||||
$tpl->assign_block_vars('CREATE_SUCCESS', [
|
||||
'HTACCESS' => htmlspecialchars($htaccess),
|
||||
'HTPASSWD' => htmlspecialchars($htpasswd),
|
||||
]);
|
||||
@chmod($config['paths']['root'], 0755);
|
||||
} else {
|
||||
$tpl->assign_block_vars('CREATE_ERROR', [
|
||||
'HTACCESS' => htmlspecialchars($htaccess),
|
||||
'HTPASSWD' => htmlspecialchars($htpasswd),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($error) > 0 || !isset($_POST['username'])) {
|
||||
$tpl->assign_vars([
|
||||
'PASSWORDS_UNEQUAL' => my_addslashes($lang['L_PASSWORDS_UNEQUAL']),
|
||||
'HTACC_CONFIRM_CREATE' => my_addslashes($lang['L_HTACC_CONFIRM_CREATE']),
|
||||
]);
|
||||
|
||||
$tpl->assign_block_vars('INPUT', [
|
||||
'USERNAME' => htmlspecialchars($username),
|
||||
'USERPASS1' => htmlspecialchars($userpass1),
|
||||
'USERPASS2' => htmlspecialchars($userpass2),
|
||||
'TYPE0_CHECKED' => 0 == $type ? ' checked="checked"' : '',
|
||||
'TYPE1_CHECKED' => 1 == $type ? ' checked="checked"' : '',
|
||||
'TYPE2_CHECKED' => 2 == $type ? ' checked="checked"' : '',
|
||||
'TYPE3_CHECKED' => 3 == $type ? ' checked="checked"' : '',
|
||||
'TYPE4_CHECKED' => 4 == $type ? ' checked="checked"' : '',
|
||||
]);
|
||||
}
|
||||
|
||||
if (sizeof($error) > 0) {
|
||||
$msg = '<span class="error">'.implode('<br>', $error).'</span>';
|
||||
}
|
||||
if ($msg > '') {
|
||||
$tpl->assign_block_vars('MSG', [
|
||||
'TEXT' => $msg, ]);
|
||||
}
|
||||
|
||||
$tpl->pparse('show');
|
||||
|
||||
echo MODFooter();
|
||||
ob_end_flush();
|
||||
exit();
|
26
msd/inc/home/protection_delete.php
Normal file
26
msd/inc/home/protection_delete.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
MyOOS [Dumper]
|
||||
http://www.oos-shop.de/
|
||||
|
||||
Copyright (c) 2013 - 2022 by the MyOOS Development Team.
|
||||
----------------------------------------------------------------------
|
||||
Based on:
|
||||
|
||||
MySqlDumper
|
||||
http://www.mysqldumper.de
|
||||
|
||||
Copyright (C)2004-2011 Daniel Schlichtholz (admin@mysqldumper.de)
|
||||
----------------------------------------------------------------------
|
||||
Released under the GNU General Public License
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
if (!defined('MOD_VERSION')) {
|
||||
exit('No direct access.');
|
||||
}
|
||||
@unlink($config['paths']['root'].'.htaccess');
|
||||
@unlink($config['paths']['root'].'.htpasswd');
|
||||
$action = 'status';
|
||||
|
||||
// todo -> give user info about success or failure of deleting action
|
93
msd/inc/home/protection_edit.php
Normal file
93
msd/inc/home/protection_edit.php
Normal file
@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
MyOOS [Dumper]
|
||||
http://www.oos-shop.de/
|
||||
|
||||
Copyright (c) 2013 - 2022 by the MyOOS Development Team.
|
||||
----------------------------------------------------------------------
|
||||
Based on:
|
||||
|
||||
MySqlDumper
|
||||
http://www.mysqldumper.de
|
||||
|
||||
Copyright (C)2004-2011 Daniel Schlichtholz (admin@mysqldumper.de)
|
||||
----------------------------------------------------------------------
|
||||
Released under the GNU General Public License
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
if (!defined('MOD_VERSION')) {
|
||||
exit('No direct access.');
|
||||
}
|
||||
include './language/'.$config['language'].'/lang_sql.php';
|
||||
echo MODHeader();
|
||||
echo headline($lang['L_HTACC_EDIT']);
|
||||
|
||||
$htaccessdontexist = 0;
|
||||
|
||||
if (isset($_POST['hta_dir']) && isset($_POST['hta_file']) && is_dir($_POST['hta_dir'])) {
|
||||
$hta_dir = $_POST['hta_dir'];
|
||||
$hta_file = $_POST['hta_file'];
|
||||
} else {
|
||||
$hta_dir = $config['paths']['root'];
|
||||
$hta_file = '.htaccess';
|
||||
}
|
||||
if ('' != $hta_dir & '/' != substr($hta_dir, -1)) {
|
||||
$hta_dir .= '/';
|
||||
}
|
||||
$hta_complete = $hta_dir.$hta_file;
|
||||
|
||||
if ((isset($_GET['create']) && 1 == $_GET['create']) || (isset($_POST['create']) && 1 == $_POST['create'])) {
|
||||
$fp = fopen($hta_complete, 'w');
|
||||
fwrite($fp, '# created by MySQLDumper '.MOD_VERSION."\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if (isset($_POST['submit']) && isset($_POST['thta'])) {
|
||||
$fp = fopen($hta_complete, 'w');
|
||||
fwrite($fp, $_POST['thta']);
|
||||
fclose($fp);
|
||||
}
|
||||
if (file_exists($hta_complete)) {
|
||||
$htaccess_exist = file($hta_complete);
|
||||
} else {
|
||||
$htaccessdontexist = 1;
|
||||
}
|
||||
|
||||
echo $lang['L_HTACCESS32'];
|
||||
echo '<br><br><form name="ehta" action="main.php?action=edithtaccess" method="post">';
|
||||
echo '<table>';
|
||||
echo '<tr><td>'.$lang['L_DIR'].':</td><td><input type="text" name="hta_dir" value="'.$hta_dir.'" size="60"></td></tr>';
|
||||
echo '<tr><td>'.$lang['L_FILE'].':</td><td><input type="text" name="hta_file" value="'.$hta_file.'"></td></tr>';
|
||||
echo '</table>';
|
||||
if (1 != $htaccessdontexist) {
|
||||
echo '<table class="bdr"><tr><td style="width:70%;"><textarea rows="25" cols="40" name="thta" id="thta">'.htmlspecialchars(implode('', $htaccess_exist)).'</textarea><br><br>';
|
||||
echo '</td><td valign="top">';
|
||||
//Presets
|
||||
echo '<h6>Presets</h6><p><strong>'.$lang['L_HTACCESS30'].'</strong><p>
|
||||
<a href="javascript:insertHTA(1,document.ehta.thta)">all-inkl</a><br>
|
||||
|
||||
<br><p><strong>'.$lang['L_HTACCESS31'].'</strong></p>
|
||||
<a href="javascript:insertHTA(101,document.ehta.thta)">'.$lang['L_HTACCESS20'].'</a><br>
|
||||
<a href="javascript:insertHTA(102,document.ehta.thta)">'.$lang['L_HTACCESS21'].'</a><br>
|
||||
<a href="javascript:insertHTA(103,document.ehta.thta)">'.$lang['L_HTACCESS22'].'</a><br>
|
||||
<a href="javascript:insertHTA(104,document.ehta.thta)">'.$lang['L_HTACCESS23'].'</a><br>
|
||||
<a href="javascript:insertHTA(105,document.ehta.thta)">'.$lang['L_HTACCESS24'].'</a><br>
|
||||
<a href="javascript:insertHTA(106,document.ehta.thta)">'.$lang['L_HTACCESS25'].'</a><br>
|
||||
<a href="javascript:insertHTA(107,document.ehta.thta)">'.$lang['L_HTACCESS26'].'</a><br>
|
||||
<a href="javascript:insertHTA(108,document.ehta.thta)">'.$lang['L_HTACCESS27'].'</a><br>
|
||||
<a href="javascript:insertHTA(109,document.ehta.thta)">'.$lang['L_HTACCESS28'].'</a><br>
|
||||
<br><a href="http://httpd.apache.org/docs/2.0/mod/directives.html" target="_blank">'.$lang['L_HTACCESS29'].'</a>';
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td colspan="2">';
|
||||
echo '<input type="submit" name="submit" value=" '.$lang['L_SAVE'].' " class="Formbutton"> ';
|
||||
echo '<input type="reset" name="reset" value=" '.$lang['L_RESET'].' " class="Formbutton"> ';
|
||||
echo '<input type="submit" name="newload" value=" '.$lang['L_HTACCESS19'].' " class="Formbutton">';
|
||||
echo '</td></tr></table></form>';
|
||||
} else {
|
||||
echo '<br>'.$lang['L_FILE_MISSING'].': '.$hta_complete.'<br><br>';
|
||||
echo '<form action="" method="post"><input type="hidden" name="hta_dir" value="'.$hta_dir.'"><input type="hidden" name="hta_file" value="'.$hta_file.'"><input type="hidden" name="create" value="1"><input type="submit" name="createhtaccess" value="'.$lang['L_CREATE'].'" class="Formbutton"></form>';
|
||||
}
|
||||
echo '</div>';
|
||||
ob_end_flush();
|
||||
exit();
|
101
msd/inc/home/system.php
Normal file
101
msd/inc/home/system.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
MyOOS [Dumper]
|
||||
http://www.oos-shop.de/
|
||||
|
||||
Copyright (c) 2013 - 2022 by the MyOOS Development Team.
|
||||
----------------------------------------------------------------------
|
||||
Based on:
|
||||
|
||||
MySqlDumper
|
||||
http://www.mysqldumper.de
|
||||
|
||||
Copyright (C)2004-2011 Daniel Schlichtholz (admin@mysqldumper.de)
|
||||
----------------------------------------------------------------------
|
||||
Released under the GNU General Public License
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
if (!defined('MOD_VERSION')) {
|
||||
exit('No direct access.');
|
||||
}
|
||||
$sysaction = (isset($_GET['dosys'])) ? $_GET['dosys'] : 0;
|
||||
$msg = '';
|
||||
$res = mysqli_query($config['dbconnection'], "SHOW VARIABLES LIKE 'datadir'");
|
||||
if ($res) {
|
||||
$row = mysqli_fetch_array($res);
|
||||
$data_dir = $row[1];
|
||||
}
|
||||
switch ($sysaction) {
|
||||
case 1: //FLUSH PRIVILEGES
|
||||
$msg = '> operating FLUSH PRIVILEGES<br>';
|
||||
$res = mysqli_query($config['dbconnection'], 'FLUSH PRIVILEGES');
|
||||
$meldung = mysqli_error($config['dbconnection']);
|
||||
if ('' != $meldung) {
|
||||
$msg .= '> MySQL-Error: '.$meldung;
|
||||
} else {
|
||||
$msg .= '> Privileges were reloaded.';
|
||||
}
|
||||
break;
|
||||
case 2: //FLUSH STATUS
|
||||
$msg = '> operating FLUSH STATUS<br>';
|
||||
$res = mysqli_query($config['dbconnection'], 'FLUSH STATUS');
|
||||
$meldung = mysqli_error($config['dbconnection']);
|
||||
if ('' != $meldung) {
|
||||
$msg .= '> MySQL-Error: '.$meldung;
|
||||
} else {
|
||||
$msg .= '> Status was reset.';
|
||||
}
|
||||
break;
|
||||
case 3: //FLUSH HOSTS
|
||||
$msg = '> operating FLUSH HOSTS<br>';
|
||||
$res = mysqli_query($config['dbconnection'], 'FLUSH HOSTS');
|
||||
$meldung = mysqli_error($config['dbconnection']);
|
||||
if ('' != $meldung) {
|
||||
$msg .= '> MySQL-Error: '.$meldung;
|
||||
} else {
|
||||
$msg .= '> Hosts were reloaded.';
|
||||
}
|
||||
break;
|
||||
case 4: //SHOW MASTER LOGS
|
||||
$msg = '> operating SHOW MASTER LOGS<br>';
|
||||
$res = mysqli_query($config['dbconnection'], 'SHOW MASTER LOGS');
|
||||
$meldung = mysqli_error($config['dbconnection']);
|
||||
if ('' != $meldung) {
|
||||
$msg .= '> MySQL-Error: '.$meldung;
|
||||
} else {
|
||||
$numrows = mysqli_num_rows($res);
|
||||
if (0 == $numrows || false === $numrows) {
|
||||
$msg .= '> there are no master log-files';
|
||||
} else {
|
||||
$msg .= '> there are '.$numrows.' logfiles<br>';
|
||||
for ($i = 0; $i < $numrows; ++$i) {
|
||||
$row = mysqli_fetch_row($res);
|
||||
$msg .= '> '.$row[0].' '.(($data_dir) ? byte_output(@filesize($data_dir.$row[0])) : '').'<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5: //RESET MASTER
|
||||
$msg = '> operating RESET MASTER<br>';
|
||||
$res = mysqli_query($config['dbconnection'], 'RESET MASTER');
|
||||
$meldung = mysqli_error($config['dbconnection']);
|
||||
if ('' != $meldung) {
|
||||
$msg .= '> MySQL-Error: '.$meldung;
|
||||
} else {
|
||||
$msg .= '> All Masterlogs were deleted.';
|
||||
}
|
||||
break;
|
||||
}
|
||||
echo '<h5>'.$lang['L_MYSQLSYS'].'</h5>';
|
||||
echo '<div id="hormenu"><ul>
|
||||
<li><a href="main.php?action=sys&dosys=1">Reload Privileges</a></li>
|
||||
<li><a href="main.php?action=sys&dosys=2">Reset Status</a></li>
|
||||
<li><a href="main.php?action=sys&dosys=3">Reload Hosts</a></li>
|
||||
<li><a href="main.php?action=sys&dosys=4">Show Log-Files</a></li>
|
||||
<li><a href="main.php?action=sys&dosys=5">Reset Master-Log</a></li>
|
||||
</ul></div>';
|
||||
echo '<div align="center" class="MySQLbox">';
|
||||
echo '> MySQL Dumper v'.MOD_VERSION.' - Output Console<br><br>';
|
||||
echo ('' != $msg) ? $msg : '> waiting for operation ...<br>';
|
||||
echo '</div>';
|
87
msd/inc/home/update.php
Normal file
87
msd/inc/home/update.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
MyOOS [Dumper]
|
||||
http://www.oos-shop.de/
|
||||
|
||||
Copyright (c) 2013 - 2022 by the MyOOS Development Team.
|
||||
----------------------------------------------------------------------
|
||||
Based on:
|
||||
|
||||
MySqlDumper
|
||||
http://www.mysqldumper.de
|
||||
|
||||
Copyright (C)2004-2011 Daniel Schlichtholz (admin@mysqldumper.de)
|
||||
----------------------------------------------------------------------
|
||||
Released under the GNU General Public License
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
if (!defined('MOD_VERSION')) {
|
||||
exit('No direct access.');
|
||||
}
|
||||
|
||||
if ($update->newVersionAvailable() && $check_update === true) {
|
||||
// Install new update
|
||||
echo '<p align="center"><a href="main.php"><< Home</a></p>';
|
||||
|
||||
echo $lang['L_NEW_MOD_VERSION'] . ': ' . $update->getLatestVersion() . '<br>';
|
||||
echo $lang['L_INSTALLING_UPDATES'] . ': <br>';
|
||||
/*
|
||||
echo '<pre>';
|
||||
var_dump(array_map(function ($version) {
|
||||
return (string) $version;
|
||||
}, $update->getVersionsToUpdate()));
|
||||
echo '</pre>';
|
||||
*/
|
||||
// Optional - empty log file
|
||||
$f = fopen($config['paths']['log'] . 'update.log', 'rb+');
|
||||
if ($f !== false) {
|
||||
ftruncate($f, 0);
|
||||
fclose($f);
|
||||
}
|
||||
|
||||
/*
|
||||
// Optional Callback function - on each version update
|
||||
function eachUpdateFinishCallback($updatedVersion)
|
||||
{
|
||||
echo '<h3>CALLBACK for version ' . $updatedVersion . '</h3>';
|
||||
}
|
||||
$update->onEachUpdateFinish('eachUpdateFinishCallback');
|
||||
|
||||
// Optional Callback function - on each version update
|
||||
function onAllUpdateFinishCallbacks($updatedVersions)
|
||||
{
|
||||
echo '<h3>CALLBACK for all updated versions:</h3>';
|
||||
echo '<ul>';
|
||||
foreach ($updatedVersions as $v) {
|
||||
echo '<li>' . $v . '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
$update->setOnAllUpdateFinishCallbacks('onAllUpdateFinishCallbacks');
|
||||
*/
|
||||
|
||||
// This call will only simulate an update.
|
||||
// Set the first argument (simulate) to "false" to install the update
|
||||
// i.e. $update->update(false);
|
||||
$result = $update->update(false);
|
||||
|
||||
if ($result === true) {
|
||||
echo $lang['L_UPDATE_SUCCESSFUL'] . '<br>';
|
||||
} else {
|
||||
echo $lang['L_UPDATE_FAILED'] . ': ' . $result . '!<br>';
|
||||
|
||||
if ($result = AutoUpdate::ERROR_SIMULATE) {
|
||||
echo '<pre>';
|
||||
var_dump($update->getSimulationResults());
|
||||
echo '</pre>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo $lang['L_UP_TO_DATE']. '<br>';
|
||||
}
|
||||
|
||||
echo 'Log:<br>';
|
||||
echo nl2br(file_get_contents($config['paths']['log'] . '/update.log'));
|
||||
|
||||
echo '<p align="center"><a href="main.php"><< Home</a></p>';
|
Reference in New Issue
Block a user