From 2c2fb0816e1ad4fc5210c08cd849bd8bc03934b4 Mon Sep 17 00:00:00 2001
From: montuy337513
Date: Tue, 3 Nov 2020 17:33:33 +0100
Subject: [PATCH] Initial GIT
---
admin/about.php | 19 ++
admin/admin_footer.php | 15 +
admin/admin_header.php | 60 ++++
admin/backup.inc.php | 405 ++++++++++++++++++++++++++
admin/backup.ini.php | 84 ++++++
admin/download.php | 127 +++++++++
admin/index.html | 1 +
admin/index.php | 16 ++
admin/index2.php | 236 ++++++++++++++++
admin/menu.php | 59 ++++
admin/optimizer.php | 82 ++++++
admin/restore.php | 187 ++++++++++++
class/class.backpack.php | 531 +++++++++++++++++++++++++++++++++++
class/index.html | 1 +
docs/changelog.txt | 32 +++
docs/index.html | 1 +
hook_cron.php | 25 ++
images/alert.gif | Bin 0 -> 572 bytes
images/attachment.gif | Bin 0 -> 170 bytes
images/backpack_slogo.png | Bin 0 -> 8581 bytes
images/bg.gif | Bin 0 -> 61 bytes
images/index.html | 1 +
images/left_both.gif | Bin 0 -> 538 bytes
images/right_both.gif | Bin 0 -> 2010 bytes
include/defines.lib.php | 134 +++++++++
include/ext2mime.php | 316 +++++++++++++++++++++
include/index.html | 1 +
include/read_dump.lib.php | 182 ++++++++++++
include/zip.lib.php | 121 ++++++++
index.html | 1 +
index.php | 22 ++
language/english/admin.php | 74 +++++
language/english/index.html | 1 +
language/english/modinfo.php | 29 ++
language/french/admin.php | 74 +++++
language/french/index.html | 1 +
language/french/modinfo.php | 29 ++
language/index.html | 1 +
sql/.htaccess | 2 +
sql/index.html | 1 +
xoops_version.php | 75 +++++
41 files changed, 2946 insertions(+)
create mode 100644 admin/about.php
create mode 100644 admin/admin_footer.php
create mode 100644 admin/admin_header.php
create mode 100644 admin/backup.inc.php
create mode 100644 admin/backup.ini.php
create mode 100644 admin/download.php
create mode 100644 admin/index.html
create mode 100644 admin/index.php
create mode 100644 admin/index2.php
create mode 100644 admin/menu.php
create mode 100644 admin/optimizer.php
create mode 100644 admin/restore.php
create mode 100644 class/class.backpack.php
create mode 100644 class/index.html
create mode 100644 docs/changelog.txt
create mode 100644 docs/index.html
create mode 100644 hook_cron.php
create mode 100644 images/alert.gif
create mode 100644 images/attachment.gif
create mode 100644 images/backpack_slogo.png
create mode 100644 images/bg.gif
create mode 100644 images/index.html
create mode 100644 images/left_both.gif
create mode 100644 images/right_both.gif
create mode 100644 include/defines.lib.php
create mode 100644 include/ext2mime.php
create mode 100644 include/index.html
create mode 100644 include/read_dump.lib.php
create mode 100644 include/zip.lib.php
create mode 100644 index.html
create mode 100644 index.php
create mode 100644 language/english/admin.php
create mode 100644 language/english/index.html
create mode 100644 language/english/modinfo.php
create mode 100644 language/french/admin.php
create mode 100644 language/french/index.html
create mode 100644 language/french/modinfo.php
create mode 100644 language/index.html
create mode 100644 sql/.htaccess
create mode 100644 sql/index.html
create mode 100644 xoops_version.php
diff --git a/admin/about.php b/admin/about.php
new file mode 100644
index 0000000..8da837e
--- /dev/null
+++ b/admin/about.php
@@ -0,0 +1,19 @@
+addNavigation('about.php');
+echo $aboutAdmin->renderAbout('2MHAG2L3NZG8G', false);
+
+include 'admin_footer.php';
diff --git a/admin/admin_footer.php b/admin/admin_footer.php
new file mode 100644
index 0000000..e7950c9
--- /dev/null
+++ b/admin/admin_footer.php
@@ -0,0 +1,15 @@
+'."\n".''."\n"
+ . '
'."\n"
+ . '
'."\n" . ' ';
+
+xoops_cp_footer();
diff --git a/admin/admin_header.php b/admin/admin_header.php
new file mode 100644
index 0000000..3887be0
--- /dev/null
+++ b/admin/admin_header.php
@@ -0,0 +1,60 @@
+getVar('dirname');
+$thisModulePath = dirname(__DIR__);
+
+include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+require_once($thisModulePath.'/include/zip.lib.php');
+require_once($thisModulePath.'/include/defines.lib.php');
+require_once($thisModulePath.'/include/read_dump.lib.php');
+
+$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
+$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
+$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
+// Include backup functions
+include_once($thisModulePath.'/admin/backup.ini.php');
+include_once($thisModulePath.'/class/class.backpack.php');
+
+// Load language files
+xoops_loadLanguage('admin', $thisModuleDir);
+xoops_loadLanguage('modinfo', $thisModuleDir);
+
+if (file_exists($GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'))) {
+ include_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php');
+} else {
+ redirect_header('../../../admin.php', 5, _AM_MODULEADMIN_MISSING, FALSE);
+}
+$myts = MyTextSanitizer::getInstance();
+
+if ($xoopsUser) {
+ $moduleperm_handler = xoops_gethandler('groupperm');
+ if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar( 'mid' ), $xoopsUser->getGroups())) {
+ redirect_header(XOOPS_URL, 1, _NOPERM);
+ exit();
+ }
+} else {
+ redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
+ exit();
+}
+
+if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
+ include_once(XOOPS_ROOT_PATH.'/class/template.php');
+ $xoopsTpl = new XoopsTpl();
+}
+
+$xoopsTpl->assign('pathIcon16', $pathIcon16);
diff --git a/admin/backup.inc.php b/admin/backup.inc.php
new file mode 100644
index 0000000..fa183c7
--- /dev/null
+++ b/admin/backup.inc.php
@@ -0,0 +1,405 @@
+= 32306
+ && !empty($a_name) && $a_name != '*') {
+ return '`' . $a_name . '`';
+ } else {
+ return $a_name;
+ }
+} // end of the 'PMA_backquote()' function
+
+function create_table_sql_string($tablename){
+ global $dump_line,$dump_buffer;
+ $crlf = "\r\n";
+
+ // Start the SQL string for this table
+ $field_header = "CREATE TABLE `$tablename` (";
+ $field_string = "";
+
+ // Get the field info and output to a string in the correct MySQL syntax
+ $result = mysqli_query("DESCRIBE $tablename");
+ if (DEBUG) echo "field_info\n\n";
+ while ($field_info = mysqli_fetch_array($result)) {
+ if (DEBUG) {
+ for ($i = 0; $i < count($field_info); $i++) {
+ echo "$i: $field_info[$i]\n";
+ }
+ }
+ $field_name = $field_info[0];
+ $field_type = $field_info[1];
+ $field_not_null = ($field_info[2] == "YES") ? "" : " NOT NULL";
+ $field_default = ($field_info[4] == NULL) ? "" : sprintf(" default '%s'", $field_info[4]);;
+ $field_auto_increment = ($field_info[5] == NULL) ? "" : sprintf(" %s", $field_info[5]);
+ $field_string .= $field_string ? "," : $field_header ;
+ $field_string .= $crlf.sprintf(" `%s` %s%s%s%s", $field_name, $field_type, $field_not_null, $field_auto_increment, $field_default);
+ }
+ // Get the index info and output to a string in the correct MySQL syntax
+ $result = mysqli_query("SHOW KEYS FROM $tablename"); //SHOW INDEX FROM
+ if (DEBUG) echo "\nindex_info\n\n";
+ while ($row = mysqli_fetch_array($result)) {
+ $kname = $row['Key_name'];
+ $ktype = (isset($row['Index_type'])) ? $row['Index_type'] : '';
+ if (!$ktype && (isset($row['Comment']))) $ktype = $row['Comment']; // For Under MySQL v4.0.2
+ $sub_part = (isset($row['Sub_part'])) ? $row['Sub_part'] : '';
+ if ($kname != 'PRIMARY' && $row['Non_unique'] == 0) {
+ $kname = 'UNIQUE KEY `'.$kname.'`';
+ }
+ if ($ktype == 'FULLTEXT') {
+ $kname = 'FULLTEXT KEY `'.$kname.'`';
+ }
+ if (!isset($index[$kname])) {
+ $index[$kname] = array();
+ }
+ if ($sub_part > 1) {
+ $index[$kname][] = PMA_backquote($row['Column_name'], 0) . '(' . $sub_part . ')';
+ } else {
+ $index[$kname][] = PMA_backquote($row['Column_name'], 0);
+ }
+ } // end while
+ mysqli_free_result($result);
+ $index_string = "";
+ while (list($x, $columns) = @each($index)) {
+ $index_string .= ',' . $crlf;
+ if ($x == 'PRIMARY') {
+ $index_string .= ' PRIMARY KEY (';
+ } else if (substr($x, 0, 6) == 'UNIQUE') {
+ $index_string .= ' UNIQUE ' . substr($x, 7) . ' (';
+ } else if (substr($x, 0, 8) == 'FULLTEXT') {
+ $index_string .= ' FULLTEXT ' . substr($x, 9) . ' (';
+ } else {
+ $index_string .= ' KEY `' . $x . '` (';
+ }
+ $index_string .= implode($columns, ', ') . ')';
+ } // end while
+ $index_string .= $crlf;
+
+ // Get the table type and output it to a string in the correct MySQL syntax
+ $result = mysqli_query("SHOW TABLE STATUS");
+ if (DEBUG) echo "\nstatus_info\n\n";
+ while ($status_info = mysql_fetch_array($result)) {
+ for ($i = 0; $i < count($status_info); $i++) {
+ if (DEBUG) echo "$i: $status_info[$i]\n";
+
+ if ($status_info[0] == $tablename) $table_type = sprintf("TYPE=%s", $status_info[1]);
+ }
+ }
+
+ // Append the index string to the field string
+ $field_string = sprintf("%s%s", $field_string, $index_string);
+
+ // Put the field string in parantheses
+ $field_string = sprintf("%s)", $field_string);
+
+ // Finalise the MySQL create table string
+ $field_string .= $table_type.";";
+ $field_string = "-- \r\n-- ".$tablename." structure.\r\n-- ".$crlf.$field_string.$crlf;
+ $dump_buffer .= $field_string;
+ preg_match_all("/\r\n/",$field_string,$c);
+ $dump_line += count($c[0]);
+}
+function create_data_sql_string($tablename,$filename,$cfgZipType){
+ global $dump_line,$dump_buffer,$query_res;
+ // Get field names from MySQL and output to a string in the correct MySQL syntax
+ $query_res = mysqli_query("SELECT * FROM $tablename");
+
+ // Get table data from MySQL and output to a string in the correct MySQL syntax
+ $dump_buffer .= "-- \r\n-- ".$tablename." dump.\r\n-- \r\n";
+ $dump_line+=3;
+ while ($row = mysqli_fetch_row($query_res)) {
+ // Initialise the data string
+ $data_string = "";
+ // Loop through the records and append data to the string after escaping
+ for ($i = 0; $i < mysqli_num_fields($query_res); $i++) {
+ if (!isset($row[$i]) || is_null($row[$i]))
+ $data_string = sprintf("%s, NULL", $data_string);
+ else
+ $data_string = sprintf("%s, '%s'", $data_string, mysqli_escape_string($row[$i]));
+ //$data_string = str_replace("`","\'",$data_string);
+ }
+ // Remove the first 2 characters (", ") from the data string
+ $data_string = substr($data_string, 2);
+ // Put the data string in parantheses and prepend "VALUES "
+ $data_string = sprintf("VALUES (%s)", $data_string);
+ // Finalise the MySQL insert into string for this record
+ $dump_buffer .= sprintf("INSERT INTO `%s` %s;\r\n", $tablename, $data_string);
+ $dump_line++;
+ check_dump_buffer($filename,$cfgZipType);
+ }
+}
+function make_download($filename,$cfgZipType){
+ global $backup_dir,$dump_line,$dump_buffer,$download_count,$download_fname,$mime_type;
+
+ if (($cfgZipType == 'bzip') && function_exists('bzcompress')) { // (PMA_PHP_INT_VERSION >= 40004 &&
+ $filename .= $download_count>0 ? "-".$download_count.".sql" : ".sql" ;
+ $ext = 'bz2';
+ $mime_type = 'application/x-bzip';
+ $op_buffer = bzcompress($dump_buffer);
+ } else if (($cfgZipType == 'gzip') && function_exists('gzencode')) { // (PMA_PHP_INT_VERSION >= 40004 &&
+ $filename .= $download_count>0 ? "-".$download_count.".sql" : ".sql" ;
+ $ext = 'gz';
+ $content_encoding = 'x-gzip';
+ $mime_type = 'application/x-gzip';
+ // without the optional parameter level because it bug
+ $op_buffer = gzencode($dump_buffer,9);
+ } else if (($cfgZipType == 'zip') && function_exists('gzcompress')) { // (PMA_PHP_INT_VERSION >= 40000 &&
+ $filename .= $download_count>0 ? "-".$download_count : "";
+ $ext = 'zip';
+ $mime_type = 'application/x-zip';
+ $extbis = '.sql';
+ $zipfile = new zipfile();
+ $zipfile -> addFile($dump_buffer, $filename . $extbis);
+ $op_buffer = $zipfile -> file();
+ } else {
+ $ext = 'sql';
+ $cfgZipType = 'none';
+ $mime_type = "text/plain";
+ $op_buffer = $dump_buffer;
+ }
+ $fpathname = $backup_dir.$filename.'.'.$ext;
+ $fp = fopen($fpathname,'w');
+ fwrite($fp, $op_buffer);
+ fclose($fp);
+ unset($op_buffer);
+ if(!file_exists($fpathname)){
+ print("Error - $filename does not exist.");
+ return ;
+ }
+ $download_fname[$download_count]['filename'] = $filename.'.'.$ext;
+ $download_fname[$download_count]['line'] = $dump_line;
+ $download_fname[$download_count]['size'] = filesize($fpathname);
+ $download_count++;
+}
+function purge_allfiles(){
+ global $backup_dir;
+ if ($handle = opendir( $backup_dir )) {
+ while (false !== ($file = readdir($handle))) {
+ if (preg_match("/sql/",$file)) {
+ //echo "$file\n
";
+ unlink($backup_dir.$file);
+ }
+ }
+ closedir($handle);
+ }
+}
+function check_dump_buffer($filename,$cfgZipType){
+ global $dump_line,$dump_buffer;
+ if ($dump_line >= MAX_DUMPLINE ){//|| strlen($dump_buffer) >= MAX_DUMPSIZE){
+ make_download($filename,$cfgZipType);
+ //unset($GLOBALS['dump_buffer']);
+ //unset($GLOBALS['dump_line']);
+ $dump_buffer = '';
+ $dump_line = 0;
+ }
+}
+function Lock_Tables($tablename_array){
+ $q = "LOCK TABLES";
+
+ for ($i = 0; $i = $time_now + 30) {
+ $time_start = $time_now;
+ header('X-pmaPing: Pong');
+ }
+ }
+ mysqli_query("UNLOCK TABLES");
+ if ( $dump_buffer ) make_download( $filename ,$cfgZipType );
+}
+function restore_data($filename, $restore_structure, $restore_data, $db_selected)
+{
+ if (!file_exists($filename)) exit();
+ $handle = fopen("$filename", "r");
+
+ $prefix ='';
+ while (!feof($handle)) {
+// $buffer = fgets($handle);
+ $buffer='';
+ while (!feof($handle)) {
+ $temp = array("\r\n", "\n", "\r","\t");
+ $cbuff = str_replace($temp,"",fgets($handle));
+ if (!preg_match('`^--`',$cbuff)) $buffer .= $cbuff;
+ if (preg_match('`;`',$cbuff)!=false) break;
+ }
+ if (preg_match("/^CREATE TABLE|^INSERT INTO|^DELETE/i",$buffer)){
+ if (!$prefix){
+ $match = explode(" ",$buffer);
+ $prefix = explode("_",$match[2]);
+ $prefix = preg_replace("/^`/","", $prefix[0]);
+ }
+ $buffer = preg_replace("/".$prefix."_/" , XOOPS_DB_PREFIX."_" , $buffer);
+ }
+ if ($buffer) {
+ // if this line is a create table query then check if the table already exists
+ if (preg_match('`^CREATE TABLE`i',$buffer) ) {
+ if ($restore_structure) {
+ $tablename = explode(" ", $buffer);
+ $tablename = preg_replace('/`/','',$tablename[2]);
+ $result = $xoopsDB->queryF('SHOW TABLES FROM '.$db_selected);
+ for ($i = 0; $i < $xoopsDB->getRowsNum($result); $i++) {
+ if (mysqli_tablename($result, $i) == $tablename) {
+ //$rand = substr(md5(time()), 0, 8);
+ //$random_tablename = sprintf("%s_bak_%s", $tablename, $rand);
+ mysqli_query("DROP TABLE IF EXISTS $tablename");
+ //mysql_query("RENAME TABLE $tablename TO $random_tablename");
+ //echo "Backed up $tablename to $random_tablename.
\n";
+ }
+ }
+ $result = mysqli_query($buffer);
+ if (!$result) {
+ echo mysqli_error()."
\n";
+ } else {
+ echo "Table '$tablename' successfully recreated.
\n";
+ }
+ }
+ } else {
+ if ($restore_data) {
+ $result = mysqli_query($buffer);
+ if (!$result) echo mysqli_error()."
\n";
+ }
+ }
+ }
+ }
+ fclose($handle);
+}
+function get_module_tables($dirname)
+{
+ global $xoopsConfig;
+ if (!$dirname ) return;
+ $module_handler = xoops_gethandler('module');
+ $module = $module_handler->getByDirname($dirname);
+ // Get tables used by this module
+ $modtables = $module->getInfo('tables');
+ if ($modtables != false && is_array($modtables)) {
+ return $modtables;
+ }
+}
+function make_module_selection($select_dirname='',$addblank=0)
+{
+ global $xoopsDB;
+ $sql = "SELECT name,dirname FROM ".$xoopsDB->prefix('modules');
+ if (!$result = $xoopsDB->query($sql)) {
+ return false;
+ }
+ $mod_selections = "\n";
+ return $mod_selections;
+}
+/**
+ * Maximum upload size as limited by PHP
+ * Used with permission from Moodle (http://moodle.org) by Martin Dougiamas
+ *
+ * this section generates $max_upload_size in bytes
+ */
+
+function get_real_size($size=0) {
+/// Converts numbers like 10M into bytes
+ if (!$size) {
+ return 0;
+ }
+ $scan['MB'] = 1048576;
+ $scan['Mb'] = 1048576;
+ $scan['M'] = 1048576;
+ $scan['m'] = 1048576;
+ $scan['KB'] = 1024;
+ $scan['Kb'] = 1024;
+ $scan['K'] = 1024;
+ $scan['k'] = 1024;
+
+ while (list($key) = each($scan)) {
+ if ((strlen($size)>strlen($key))&&(substr($size, strlen($size) - strlen($key))==$key)) {
+ $size = substr($size, 0, strlen($size) - strlen($key)) * $scan[$key];
+ break;
+ }
+ }
+ return $size;
+}
+/**
+* Displays the maximum size for an upload
+*
+* @param integer the size
+*
+* @return string the message
+*
+* @access public
+*/
+function PMA_displayMaximumUploadSize($max_upload_size) {
+ list($max_size, $max_unit) = PMA_formatByteDown($max_upload_size);
+ return '(' . sprintf(_AM_SELECTAFILE_DESC, $max_size, $max_unit) . ')';
+}
+/**
+ * Formats $value to byte view
+ *
+ * @param double the value to format
+ * @param integer the sensitiveness
+ * @param integer the number of decimals to retain
+ *
+ * @return array the formatted value and its unit
+ *
+ * @access public
+ *
+ * @author staybyte
+ * @version 1.2 - 18 July 2002
+ */
+function PMA_formatByteDown($value, $limes = 6, $comma = 0)
+{
+ $dh = pow(10, $comma);
+ $li = pow(10, $limes);
+ $return_value = $value;
+ $unit = $byteunits[0];
+ $byteunits = array('Byte', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');
+ $number_thousands_separator = ',';
+ $number_decimal_separator = '.';
+
+ for ( $d = 6, $ex = 15; $d >= 1; $d--, $ex-=3 ) {
+ if (isset($byteunits[$d]) && $value >= $li * pow(10, $ex)) {
+ $value = round($value / ( pow(1024, $d) / $dh) ) /$dh;
+ $unit = $byteunits[$d];
+ break 1;
+ } // end if
+ } // end for
+
+ if ($unit != $byteunits[0]) {
+ $return_value = number_format($value, $comma, $number_decimal_separator, $number_thousands_separator);
+ } else {
+ $return_value = number_format($value, 0, $number_decimal_separator, $number_thousands_separator);
+ }
+
+ return array($return_value, $unit);
+} // end of the 'PMA_formatByteDown' function
+// end function
diff --git a/admin/backup.ini.php b/admin/backup.ini.php
new file mode 100644
index 0000000..463f91f
--- /dev/null
+++ b/admin/backup.ini.php
@@ -0,0 +1,84 @@
+'."\n".''."\n"
+ . '
'."\n"
+ . '
'."\n" . ' ';
+
+// Whether the os php is running on is windows or not
+if (!defined('PMA_IS_WINDOWS')) {
+ if (defined('PHP_OS') && stristr(PHP_OS, 'win')) {
+ define('PMA_IS_WINDOWS', 1);
+ } else {
+ define('PMA_IS_WINDOWS', 0);
+ }
+}
+
diff --git a/admin/download.php b/admin/download.php
new file mode 100644
index 0000000..757062a
--- /dev/null
+++ b/admin/download.php
@@ -0,0 +1,127 @@
+addNavigation('download.php.php');
+
+include '../include/ext2mime.php'; // Load the decode array of extension to MIME
+
+$fpathname = htmlspecialchars ( rawurldecode($_GET['url']) , ENT_QUOTES );
+$dl_filename = $fpathname;
+if ( defined('XOOPS_VAR_PATH')) {
+ $backup_dir = XOOPS_VAR_PATH . '/caches/';
+}else{
+ $backup_dir = XOOPS_ROOT_PATH . '/cache/';
+}
+$fpathname = $backup_dir.$fpathname;
+ob_clean();
+if(!file_exists($fpathname)){
+ if(file_exists($fpathname.'.log')){
+ echo 'Already downloaded by ';
+ $fp = fopen($fpathname.'.log','r');
+ while(!feof($fp)) {
+ $line = fgets($fp);
+ echo $line.'
';
+ }
+ fclose($fp);
+ exit();
+ }
+ print('Error - '.$fpathname.' does not exist.');
+ return ;
+}
+$browser = $version =0;
+UsrBrowserAgent($browser,$version);
+ignore_user_abort();
+
+$fnamedotpos = strrpos($dl_filename,'.');
+$fext = substr($dl_filename,$fnamedotpos+1);
+$ctype = isset($ext2mime[$fext]) ? $ext2mime[$fext] : "application/octet-stream-dummy" ;
+if ($fext=="gz") $content_encoding = 'x-gzip';
+//echo $fext.$ctype; exit();
+if ($browser == 'IE' && (ini_get('zlib.output_compression')) ) {
+ ini_set('zlib.output_compression', 'Off');
+}
+//if (!empty($content_encoding)) {
+// header('Content-Encoding: ' . $content_encoding);
+//}
+if (!empty($content_encoding)) {
+ header('Content-Encoding: ' . $content_encoding);
+}
+header("Content-Transfer-Encoding: binary");
+header("Content-Length: " . filesize($fpathname) );
+header("Content-type: " . $ctype);
+header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
+header('Last-Modified: ' . date("D M j G:i:s T Y"));
+header('Content-Disposition: attachment; filename="' . $dl_filename . '"');
+//header("Content-Disposition: inline; filename=" . $dl_filename);
+header("x-extension: " . $ctype );
+
+if ($browser == 'IE') {
+ header('Pragma: public');
+ header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
+} else {
+ header('Pragma: no-cache');
+}
+
+$fp = fopen($fpathname,'r');
+while(!feof($fp)) {
+ $buffer = fread($fp, 1024*6); //speed-limit 64kb/s
+ print $buffer;
+ flush();
+ ob_flush();
+ usleep(10000);
+}
+fclose($fp);
+//
+// Save download log
+//
+if ($xoopsUser) $uname = $xoopsUser->getVar('uname'); else $uname = "Anonymous";
+$str = $uname.",".date("Y-m-d H:i:s", time());
+$postlog = $fpathname.'.log';
+$fp = fopen($postlog, 'a');
+fwrite($fp, $str."\n");
+fclose($fp);
+unlink($fpathname);
+//xoops_cp_footer();
+//
+// Check User Browser
+//
+function UsrBrowserAgent(&$browser,&$version) {
+ if (preg_match('@Opera(/| )([0-9].[0-9]{1,2})@', $_SERVER['HTTP_USER_AGENT'], $log_version)) {
+ $version= $log_version[2];
+ $browser='OPERA';
+ } elseif (preg_match('@MSIE ([0-9].[0-9]{1,2})@', $_SERVER['HTTP_USER_AGENT'], $log_version)) {
+ $version= $log_version[1];
+ $browser='IE';
+ } elseif (preg_match('@OmniWeb/([0-9].[0-9]{1,2})@', $_SERVER['HTTP_USER_AGENT'], $log_version)) {
+ $version= $log_version[1];
+ $browser='OMNIWEB';
+ } elseif (preg_match('@(Konqueror/)(.*)(;)@', $_SERVER['HTTP_USER_AGENT'], $log_version)) {
+ $version= $log_version[2];
+ $browser='KONQUEROR';
+ } elseif (preg_match('@Mozilla/([0-9].[0-9]{1,2})@', $_SERVER['HTTP_USER_AGENT'], $log_version)
+ && preg_match('@Safari/([0-9]*)@', $_SERVER['HTTP_USER_AGENT'], $log_version2)) {
+ $version= $log_version[1] . '.' . $log_version2[1];
+ $browser='SAFARI';
+ } elseif (preg_match('@Mozilla/([0-9].[0-9]{1,2})@', $_SERVER['HTTP_USER_AGENT'], $log_version)) {
+ $version= $log_version[1];
+ $browser='MOZILLA';
+ } else {
+ $version= 0;
+ $browser='OTHER';
+ }
+ return $browser;
+}
diff --git a/admin/index.html b/admin/index.html
new file mode 100644
index 0000000..990cbd6
--- /dev/null
+++ b/admin/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/index.php b/admin/index.php
new file mode 100644
index 0000000..cffae15
--- /dev/null
+++ b/admin/index.php
@@ -0,0 +1,16 @@
+addNavigation('index.php');
+echo $indexAdmin->renderIndex();
+include 'admin_footer.php';
diff --git a/admin/index2.php b/admin/index2.php
new file mode 100644
index 0000000..f22a4cc
--- /dev/null
+++ b/admin/index2.php
@@ -0,0 +1,236 @@
+addNavigation('index2.php');
+
+$bp = new backpack();
+ if ($bp->err_msg) sprintf('%s',$bp->err_msg);
+function mysqli_tablename($result, $i){
+ mysqli_data_seek( $result, $i );
+ $f = mysqli_fetch_array( $result );
+ $fetch = $f[0];
+ return $fetch;
+}
+$time_start = time();
+//$dump_buffer = null;
+$dump_line =0;
+$dump_size =0;
+$download_count = 0;
+$download_fname = array();
+$mime_type = '';
+$query_res = array(); // for query result
+$mode = '';
+$action = '';
+$num_tables = '';
+$checkall = '';
+
+if( isset( $_POST[ 'purgeallfiles'] )){
+ $bp->purge_allfiles();
+ redirect_header('./index.php', 1, _AM_PURGED_ALLFILES);
+}
+// Make sure we pick up variables passed via URL
+if( isset( $_GET[ 'mode' ] ) ) $mode = filter_input(INPUT_GET,'mode',FILTER_SANITIZE_STRING);
+if( isset( $_GET[ 'action' ] ) ) $action = filter_input(INPUT_GET,'action',FILTER_SANITIZE_STRING);
+if( isset( $_GET[ 'num_tables' ] ) ) $num_tables = filter_input(INPUT_GET,'num_tables',FILTER_SANITIZE_STRING);
+if( isset( $_GET[ 'checkall' ] ) ) $checkall = filter_input(INPUT_GET,'checkall',FILTER_SANITIZE_STRING);
+
+$tr_comp = ''._AM_COMPRESSION.' | '
+ .''
+ .' '
+ .''
+ .'  '
+ .''
+ .'   |
';
+$tr_strd = ''._AM_DETAILSTOBACKUP.' | '
+ .' '._AM_TABLESTRUCTURE.' '
+ .' '._AM_TABLEDATA.' |
';
+
+// Handle URL actions
+switch ($mode) {
+ case POST_SELECT_MODULE_FORM: {
+ $select_dirname = isset($_GET['dirname']) ? filter_input(INPUT_GET,'dirname',FILTER_SANITIZE_STRING) : 0;
+ $mod_selections = $bp->make_module_selection($select_dirname);
+ echo '';
+ //echo '
';
+ echo '
';
+ break;
+ }
+ case POST_DB_SELECT_FORM: {
+ $select_dirname = isset($_GET['dirname']) ? filter_input(INPUT_GET,'dirname',FILTER_SANITIZE_STRING) : 0;
+ $mod_selections = $bp->make_module_selection($select_dirname,1);
+ // Get list of tables in the database and output form
+ if ($action == 'module' && $dirname){
+ $result = get_module_tables($dirname);
+ $num_tables = sizeof($result);
+ $checkall = true;
+ }else{
+ $result = $xoopsDB->queryF('SHOW TABLES FROM '.$db_selected);
+ $num_tables = $xoopsDB->getRowsNum($result);
+ }
+ echo '';
+ break;
+ }
+ case POST_SELECT_TABLES_FORM: {
+ $bp->purge_allfiles();
+ if (!ini_get('safe_mode')) {
+ set_time_limit(0);
+ }
+ $sql_string = '';
+ $alltables = $backup_structure = $backup_data =0;
+ if (isset($_GET['alltables'])) $alltables = (filter_input(INPUT_GET,'alltables',FILTER_SANITIZE_STRING) == 'on') ? 1 : 0;
+ if (isset($_POST['alltables'])) $alltables = (filter_input(INPUT_POST,'alltables',FILTER_SANITIZE_STRING) == 'on') ? 1 : 0;
+ if (isset($_POST['structure'])) $backup_structure = (filter_input(INPUT_POST,'structure',FILTER_SANITIZE_STRING) == 'on') ? 1 : 0;
+ if (isset($_POST['data'])) $backup_data = (filter_input(INPUT_POST,'data',FILTER_SANITIZE_STRING) == 'on') ? 1 : 0;
+ $dirname = isset($_POST['dirname']) ? filter_input(INPUT_POST,'dirname',FILTER_SANITIZE_STRING) : 0;
+ if ($dirname){
+ if (strcmp($dirname,'system') == 0)
+ $result = $sys_tables;
+ else
+ $result = $bp->get_module_tables($dirname);
+ $num_tables = sizeof($result);
+ }else{
+ $result = $xoopsDB->queryF('SHOW TABLES FROM '.$db_selected);
+ $num_tables = $xoopsDB->getRowsNum($result);
+ }
+ $j = 0;
+ $tablename_array = array();
+ if (!$alltables){
+ for ($i = 0; $i < $num_tables; $i++) {
+ $check_id = sprintf('check_id%d', $i);
+ $tablename = sprintf('tablename%d', $i);
+
+ if ( isset($_POST[$check_id]) ) {
+ if (isset($_POST[$tablename])){
+ $tablename_array[$j] = filter_input(INPUT_POST,$tablename,FILTER_SANITIZE_STRING);
+ $j++;
+ }
+ }
+ }
+ }else{
+ for ($i = 0; $i < $num_tables; $i++) {
+ if ( $dirname )
+ $tablename_array[$i] = $xoopsDB->prefix($result[$i]);
+ else
+ $tablename_array[$i] = mysqli_tablename($result, $i);
+ }
+ }
+ if ($dirname){
+ $filename =$dirname.date("YmdHis",time());
+ }elseif($alltables){
+ $filename ="xdb".date("YmdHis",time());
+ }else{
+ $filename ="xtbl".date("YmdHis",time());
+ }
+ $cfgZipType = filter_input(INPUT_POST,'file_compression',FILTER_SANITIZE_STRING); //$_POST['file_compression'] ;
+ $bp->backup_data($tablename_array, $backup_structure, $backup_data, $filename, $cfgZipType);
+ $download_fname = $bp->download_fname();
+ if ( $bp->download_count == 1 ){
+ //redirect_header("./download.php?url=".$download_fname[0]['filename'], 1, _AM_READY_TO_DOWNLOAD);
+ $url="./download.php?url=".$download_fname[0]['filename'];
+ $time=1;
+ $message=_AM_READY_TO_DOWNLOAD;
+ $url = preg_replace("/&/i", '&', htmlspecialchars($url, ENT_QUOTES));
+ echo '
+
+
+ '.htmlspecialchars($xoopsConfig['sitename']).'
+
+
+
+
+
+
+
+
'.$message.'
+
+
'.sprintf(_AM_IFNOTRELOAD, $url).'
+
+
+
+ ';
+ }else{
+ $form = new XoopsThemeForm( _AM_DOWNLOAD_LIST , 'download', $_SERVER['PHP_SELF'] ) ;
+ for ($i=0; $i'.$download_fname[$i]['filename'].'';
+ $url .= $download_fname[$i]['line'].'lines '.$download_fname[$i]['size'].'bytes
';
+ $form->addElement( new XoopsFormLabel( $i , $url ) ) ;
+ }
+ $form->addElement(new XoopsFormButton('', 'purgeallfiles', _AM_PURGE_FILES, 'submit'));
+ $form->display();
+ }
+ break;
+ }
+
+ case DB_SELECT_FORM: {
+ echo '';
+ if ($action == 'backup') {
+ echo ''._AM_TITLE_BCK.' |
';
+ echo ''._AM_SELECT_DATABASE.'';
+ }
+ if ($action == 'backup') echo ' |
';
+ break;
+ }
+ default: {
+ $result = $xoopsDB->queryF('SHOW TABLES FROM '.$db_selected);
+ $num_tables = $xoopsDB->getRowsNum($result);
+ echo '';
+ echo '
';
+ }
+}
+include 'admin_footer.php';
\ No newline at end of file
diff --git a/admin/menu.php b/admin/menu.php
new file mode 100644
index 0000000..faece6a
--- /dev/null
+++ b/admin/menu.php
@@ -0,0 +1,59 @@
+getByDirname($dirname);
+$pathIcon32 = $module->getInfo('icons32');
+$pathModuleAdmin = $module->getInfo('dirmoduleadmin');
+$pathLanguage = $path . $pathModuleAdmin;
+
+
+if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) {
+ $fileinc = $pathLanguage . '/language/english/main.php';
+}
+
+include_once $fileinc;
+
+$adminmenu = array();
+$i = 1;
+$adminmenu[$i]['title'] = _MI_ACCUEIL;
+$adminmenu[$i]['link'] = 'admin/index.php';
+$adminmenu[$i]['icon'] = $pathIcon32.'/index.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_BACKUPTITLE;
+$adminmenu[$i]['link'] = 'admin/index2.php';
+$adminmenu[$i]['icon'] = $pathIcon32.'/list.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_MODULEBACKUP;
+$adminmenu[$i]['link'] = 'admin/index2.php?mode=7';
+$adminmenu[$i]['icon'] = $pathIcon32.'/export.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_SELECTTABLES;
+$adminmenu[$i]['link'] = 'admin/index2.php?mode=2&action=backup';
+$adminmenu[$i]['icon'] = $pathIcon32.'/list.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_RESTORE;
+$adminmenu[$i]['link'] = 'admin/restore.php';
+$adminmenu[$i]['icon'] = $pathIcon32.'/download.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_OPTIMIZE;
+$adminmenu[$i]['link'] = 'admin/optimizer.php';
+$adminmenu[$i]['icon'] = $pathIcon32.'/synchronized.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_ABOUT;
+$adminmenu[$i]['link'] = 'admin/about.php';
+$adminmenu[$i]['icon'] = $pathIcon32.'/about.png';
+unset($i);
\ No newline at end of file
diff --git a/admin/optimizer.php b/admin/optimizer.php
new file mode 100644
index 0000000..76469d0
--- /dev/null
+++ b/admin/optimizer.php
@@ -0,0 +1,82 @@
+ FILTER_NULL_ON_FAILURE)) : false;
+$ok = (isset($_POST['ok'])) ? filter_input(INPUT_POST, 'ok', FILTER_SANITIZE_STRING, array('flags' => FILTER_NULL_ON_FAILURE)) : false;
+
+include_once 'admin_header.php';
+xoops_cp_header();
+$indexAdmin = new ModuleAdmin();
+echo $indexAdmin->addNavigation('optimizer.php');
+
+function format_time($seconds){
+ $hour = $seconds / 3600;
+ $total_time = $seconds - ($hour*3600);
+ $min = $seconds / 60;
+ $sec = $seconds % 60;
+ $format = sprintf("%02d",$hour).":".sprintf("%02d",$min).":".sprintf("%02d",$sec);
+ return $format;
+}
+if ($ok != 1) {
+ $op = '';
+}
+switch ($op) {
+ case 'conf_opt':
+ echo _AM_PROCESS_EFFECTUE.'
';
+ $r = $xoopsDB->queryF('SHOW TABLES');
+ while($row = $xoopsDB->fetchRow($r)) {
+ $table[] = $row[0];
+ }
+ if (count($table) == 0) {
+ $ok = 0;
+ $message = _AM_PASOK_PASTABLE;
+ break;
+ } elseif (count($table) == 1) {
+ $xoopsDB->queryF('LOCK TABLES `'.$table[0].'` WRITE');
+ } elseif (count($table) > 1) {
+ $xoopsDB->queryF('LOCK TABLES `'.implode('` WRITE, `',$table).'` WRITE');
+ } else {
+ $ok = 0;
+ $message = _AM_ERROR_UNKNOWN;
+ break;
+ }
+ echo _AM_LOCK_BDD.'
';
+ $t1 = time();
+ foreach ($table as $val) {
+ $b1 = time();
+ if ($xoopsDB->query('OPTIMIZE TABLE `'.$val.'`')) {
+ $b2 = time();
+ $table_time = $b2 - $b1;
+ echo _AM_OPTIMIZE . ' ' . $val . ' OK (' . _AM_TEMPS_ECOULE .' : ' . format_time($table_time) . ')
';
+ }
+ }
+ $xoopsDB->queryF('UNLOCK TABLES');
+ echo _AM_UNLOCK_BDD.'
';
+ $t2 = time();
+ $total_time = $t2 - $t1;
+ echo _AM_TEMPS_TOT.' : '.format_time($total_time) .'
';
+ echo ''._AM_RETURNTOSTART.'
';
+ break;
+ default:
+ $ok = 1;
+ xoops_confirm(array( 'op' => 'conf_opt', 'ok' => 1),XOOPS_URL.'/modules/' . $xoopsModule->getVar('dirname') .'/admin/optimizer.php',_AM_OPT_WARNING. '
'._AM_PRECISION.'
'._AM_VERIF_SUR.'
'._AM_RETURNTOSTART.'');
+}
+if ($ok != 1) {
+ echo $message;
+ echo ''._AM_RETURNTOSTART.'
';
+}
+include 'admin_footer.php';
diff --git a/admin/restore.php b/admin/restore.php
new file mode 100644
index 0000000..8a4b98d
--- /dev/null
+++ b/admin/restore.php
@@ -0,0 +1,187 @@
+addNavigation('restore.php');
+
+$mode = '' ;
+$action = '' ;
+$filename = '' ;
+$restore_structure = '' ;
+$restore_data = '' ;
+$replace_url = '';
+// Make sure we pick up variables passed via URL
+if( isset( $_GET[ 'mode' ] ) ) $mode = filter_input(INPUT_GET,'mode',FILTER_SANITIZE_SPECIAL_CHARS);
+if( isset( $_GET[ 'action' ] ) ) $action = filter_input(INPUT_GET,'action',FILTER_SANITIZE_SPECIAL_CHARS);
+if( isset( $_GET[ 'filename' ] ) ) $filename = filter_input(INPUT_GET,'filename',FILTER_SANITIZE_SPECIAL_CHARS);
+if( isset( $_GET[ 'restore_structure' ] ) ) $restore_structure = filter_input(INPUT_GET,'restore_structure',FILTER_SANITIZE_SPECIAL_CHARS);
+if( isset( $_GET[ 'restore_data' ] ) ) $restore_data = filter_input(INPUT_GET,'restore_data',FILTER_SANITIZE_SPECIAL_CHARS);
+if( isset( $_POST['replace_url'] ) ) $replace_url = filter_input(INPUT_POST,'replace_url',FILTER_SANITIZE_SPECIAL_CHARS);
+
+
+$bp = new backpack();
+if ($bp->err_msg) echo '' . $bp->err_msg .'';
+
+// Handle URL actions
+switch ($mode) {
+ case RESTORE_DATA: {
+ if (!ini_get('safe_mode')) {
+ set_time_limit(TIME_LIMIT);
+ }
+ echo ''._AM_RESTORE_OK.'
'._AM_RESTORE_MESS1.'
';
+ $fnamedotpos = strrpos($filename,'.');
+ $fext = substr($filename,$fnamedotpos+1);
+ $sql_str = '';
+ switch($fext) {
+ case 'gz':
+ $mime_type = 'application/x-gzip';
+ $sql_str = PMA_readFile($bp->backup_dir.$filename,$mime_type);
+ break;
+ case 'bz':
+ $mime_type = 'application/x-bzip';
+ $sql_str = PMA_readFile($bp->backup_dir.$filename,$mime_type);
+ break;
+ case 'sql':
+ $mime_type = 'text/plain';
+ break;
+ default:
+ $mime_type = '';
+ break;
+ }
+ if (!file_exists($bp->backup_dir.$filename)){
+ echo _AM_NO_FILE.$bp->backup_dir.$filename;
+ break;
+ }
+ if ($sql_str){
+ unlink($bp->backup_dir.$filename);
+ //$filename = eregi_replace( ".gz|.bz" , "" , $filename);
+ $filename = preg_replace('/.gz|.bz/i','',$filename);
+ $fp = fopen($bp->backup_dir.$filename, 'wb');
+ fwrite($fp, $sql_str);
+ fclose($fp);
+ }
+ if ( strcmp(_CHARSET,'EUC-JP')==0 ){
+ //$result = mysql_query( "SET NAMES 'ujis'" );
+ $result = $xoopsDB->queryF('SET NAMES \'ujis\'');
+ }
+ $bp->restore_data($bp->backup_dir.$filename, $restore_structure, $restore_data, $db_selected, $replace_url);
+ unlink($bp->backup_dir.$filename);
+ break;
+ }
+ case DB_SELECT_FORM: {
+ echo '';
+ if ($action == 'backup') {
+ echo ''._AM_TITLE_BCK.' |
';
+ echo ''._AM_SELECT_DATABASE.'';
+ }
+ if ($action == 'restore') {
+ $upload = $_FILES['filename'];
+ $upload_tmp = $_FILES['filename']['tmp_name']; // Temp File name
+ $upload_name = $_FILES['filename']['name']; // Local File Name
+ $upload_size = $_FILES['filename']['size']; // Size
+ $upload_type = $_FILES['filename']['type']; // Type
+ $upfile_error = $_FILES['filename']['error']; //upload file error no
+ if ( $upfile_error > 0 ){
+ switch ($upfile_error){
+ case UPLOAD_ERR_INI_SIZE:
+ echo _AM_MESS_ERROR_1;
+ break;
+ case UPLOAD_ERR_FORM_SIZE:
+ echo _AM_MESS_ERROR_2;
+ break;
+ case UPLOAD_ERR_PARTIAL:
+ echo _AM_MESS_ERROR_3;
+ break;
+ case UPLOAD_ERR_NO_FILE:
+ echo _AM_MESS_ERROR_4;
+ break;
+ default:
+ echo sprintf(_AM_MESS_ERROR_5,$upfile_error);
+ break;
+ }
+ }
+ echo ' |
'._AM_TITLE_RESTORE.' |
';
+ if ( !$upload_name && isset($_POST['uploadedfilename'])) {
+ $upload_name = filter_input(INPUT_POST,'uploadedfilename',FILTER_SANITIZE_STRING); //$_POST['uploadedfilename'];
+ } else {
+ // Upload file
+ $ret_val = move_uploaded_file($upload_tmp, $bp->backup_dir.$upload_name);
+ if (!$ret_val) {
+ echo '
'._AM_MESS_ERROR_6.'
'._AM_MESS_ERROR_7.'
';
+ break;
+ }
+ }
+ echo 'restore from '.$upload_name.'';
+ echo ' |
replace URL from http://'.$replace_url.'';
+ //$restore_structure = ($_POST['structure'] == "on") ? 1 : 0;
+ $restore_structure = (filter_input(INPUT_POST,'structure',FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE) == 'on') ? 1 : 0;
+ //$restore_data = ($_POST['data'] == "on") ? 1 : 0;
+ $restore_data = (filter_input(INPUT_POST,'data',FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE) == "on") ? 1 : 0;
+ echo ' ';
+ echo ' |
';
+ break;
+ }
+ default: {
+ if (!$filesize = ini_get('upload_max_filesize')) {
+ $filesize = '5M';
+ }
+ $max_upload_size = $bp->get_real_size($filesize);
+ if ($postsize = ini_get('post_max_size')) {
+ $postsize = $bp->get_real_size($postsize);
+ if ($postsize < $max_upload_size) {
+ $max_upload_size = $postsize;
+ }
+ }
+ unset($filesize);
+ unset($postsize);
+ echo ''._AM_RESTORETITLE.'
';
+ /*
+ ** for file upload
+ */
+ //echo "';
+ echo '';
+ /*
+ ** for import only
+ */
+ //echo "';
+ echo '';
+ }
+}
+include 'admin_footer.php';
diff --git a/class/class.backpack.php b/class/class.backpack.php
new file mode 100644
index 0000000..f5b4134
--- /dev/null
+++ b/class/class.backpack.php
@@ -0,0 +1,531 @@
+xoopsModuleConfig = $xoopsModuleConfig;
+ $this->backup_dir = $backup_dir;
+ }
+ public function backpack($dirname='',$purgeBefore=''){
+ global $xoopsModuleConfig,$xoopsModule;
+ if (empty($dirname)){
+
+ $this->xoopsModuleConfig = $xoopsModuleConfig;
+ $dirname = $xoopsModule->dirname();
+ }else{
+
+ $this->xoopsModuleConfig($dirname);
+ }
+ $this->set_backup_dir($dirname);
+ $this->time_start = time();
+ $this->dump_buffer = null;
+ if (!empty($purgeBefore))
+ $this->purge_allfiles($purgeBefore);
+ }
+ public function set_backup_dir($dirname){
+ if ( defined('XOOPS_VAR_PATH')) {
+ $backup_dir = XOOPS_VAR_PATH . '/caches/';
+ }else{
+ $backup_dir = XOOPS_ROOT_PATH . '/cache/';
+ }
+ $this->backup_dir = $backup_dir;
+ }
+ public function xoopsModuleConfig($dirname){
+ $module_handler = xoops_gethandler('module');
+ $this_module = $module_handler->getByDirname($dirname);
+ $mid = $this_module->getVar('mid');
+ $config_handler = xoops_gethandler('config');
+ $this->xoopsModuleConfig = $config_handler->getConfigsByCat(0, $mid);
+ }
+ public function PMA_backquote($a_name, $do_it = TRUE){
+ if ($do_it
+ && PMA_MYSQL_INT_VERSION >= 32306
+ && !empty($a_name) && $a_name != '*') {
+ return '`' . $a_name . '`';
+ } else {
+ return $a_name;
+ }
+ } // end of the 'PMA_backquote()' function
+
+ public function create_table_sql_string($tablename){
+ global $xoopsDB;
+ $crlf = "\r\n";
+
+ // Start the SQL string for this table
+ $field_header = 'CREATE TABLE `'.$tablename.'` (';
+ $field_string = '';
+
+ // Get the field info and output to a string in the correct MySQL syntax
+ $result = $xoopsDB->queryF('DESCRIBE '.$tablename);
+ if ($this->debug) echo $tablename." .field_info\n\n";
+ while ($field_info = mysqli_fetch_array($result)) {
+ if ($this->debug) {
+ for ($i = 0; $i < count($field_info); $i++) {
+ echo $i.': '.$field_info[$i]."\n";
+ }
+ }
+ $field_name = $field_info[0];
+ $field_type = $field_info[1];
+ $field_not_null = ($field_info[2] == 'YES') ? '' : ' NOT NULL';
+ $field_default = ($field_info[4] == NULL) ? '' : sprintf(' default \'%s\'', $field_info[4]);;
+ $field_auto_increment = ($field_info[5] == NULL) ? '' : sprintf(' %s', $field_info[5]);
+ $field_string .= $field_string ? ',' : $field_header ;
+ $field_string .= $crlf.sprintf(' `%s` %s%s%s%s', $field_name, $field_type, $field_not_null, $field_auto_increment, $field_default);
+ }
+ // Get the index info and output to a string in the correct MySQL syntax
+ $result = $xoopsDB->queryF('SHOW KEYS FROM '.$tablename);
+ if ($this->debug) echo "\nindex_info\n\n";
+ while ($row = mysqli_fetch_array($result)) {
+ $kname = $row['Key_name'];
+ $ktype = (isset($row['Index_type'])) ? $row['Index_type'] : '';
+ if (!$ktype && (isset($row['Comment']))) $ktype = $row['Comment']; // For Under MySQL v4.0.2
+ $sub_part = (isset($row['Sub_part'])) ? $row['Sub_part'] : '';
+ if ($kname != 'PRIMARY' && $row['Non_unique'] == 0) {
+ $kname = 'UNIQUE KEY `'.$kname.'`';
+ }
+ if ($ktype == 'FULLTEXT') {
+ $kname = 'FULLTEXT KEY `'.$kname.'`';
+ }
+ if (!isset($index[$kname])) {
+ $index[$kname] = array();
+ }
+ if ($sub_part > 1) {
+ $index[$kname][] = $this->PMA_backquote($row['Column_name'], 0) . '(' . $sub_part . ')';
+ } else {
+ $index[$kname][] = $this->PMA_backquote($row['Column_name'], 0);
+ }
+ } // end while
+ mysqli_free_result($result);
+ $index_string = '';
+ // @TODO : eachà supprimer
+ while (list($x, $columns) = @each($index)) {
+ $index_string .= ',' . $crlf;
+ if ($x == 'PRIMARY') {
+ $index_string .= ' PRIMARY KEY (';
+ } else if (substr($x, 0, 6) == 'UNIQUE') {
+ $index_string .= ' UNIQUE ' . substr($x, 7) . ' (';
+ } else if (substr($x, 0, 8) == 'FULLTEXT') {
+ $index_string .= ' FULLTEXT ' . substr($x, 9) . ' (';
+ } else {
+ $index_string .= ' KEY `' . $x . '` (';
+ }
+ $index_string .= implode(', ',$columns) . ')';
+ } // end while
+ $index_string .= $crlf;
+
+ // Get the table type and output it to a string in the correct MySQL syntax
+ //$result = mysqli_query("SHOW TABLE STATUS");
+ $result = $xoopsDB->query('SHOW TABLE STATUS');
+ if ($this->debug) echo "\nstatus_info\n\n";
+ while ($status_info = mysqli_fetch_array($result)) {
+ for ($i = 0; $i < count($status_info); $i++) {
+ if ($this->debug) echo "$i: $status_info[$i]\n";
+ if ($status_info[0] == $tablename) $table_type = sprintf("TYPE=%s", $status_info[1]);
+ }
+ }
+
+ // Append the index string to the field string
+ $field_string = sprintf("%s%s", $field_string, $index_string);
+
+ // Put the field string in parantheses
+ $field_string = sprintf("%s)", $field_string);
+
+ // Finalise the MySQL create table string
+ $field_string .= $table_type.";";
+ $field_string = "-- \r\n-- ".$tablename." structure.\r\n-- ".$crlf.$field_string.$crlf;
+ $this->dump_buffer .= $field_string;
+ preg_match_all("/\r\n/",$field_string,$c);
+ $this->dump_line += count($c[0]);
+ $this->dump_size += strlen(bin2hex($field_string)) / 2;
+ }
+ public function create_data_sql_string($tablename,$filename,$cfgZipType){
+ global $xoopsModuleConfig,$xoopsDB;
+ // Get field names from MySQL and output to a string in the correct MySQL syntax
+ $this->query_res = $xoopsDB->query("SELECT * FROM $tablename");
+
+ // Get table data from MySQL and output to a string in the correct MySQL syntax
+ $this->dump_buffer .= "-- \r\n-- ".$tablename." dump.\r\n-- \r\n";
+ $this->dump_line+=3;
+ while ($row = $xoopsDB->fetchRow($this->query_res)) {
+ // Initialise the data string
+ $data_string = '';
+ // Loop through the records and append data to the string after escaping
+ for ($i = 0; $i < mysqli_num_fields($this->query_res); $i++) {
+ if ( $data_string != "") $data_string .= ",";
+ if (!isset($row[$i]) || is_null($row[$i]))
+ $data_string .= "NULL";
+ else
+ //$data_string .= '"'.mysqli_real_escape_string($row[$i]).'"';
+ $data_string .= '"'.$xoopsDB->escape($row[$i]).'"';
+ //$data_string = str_replace("`","\'",$data_string);
+ }
+ //die($data_string);
+ // URL change
+ if ( strcmp( $xoopsModuleConfig['xoopsurlto'], XOOPS_URL)<>0 )
+ $data_string = preg_replace( '/' . preg_quote(XOOPS_URL, '/') . '/' , $xoopsModuleConfig['xoopsurlto'] , $data_string);
+ // Encoding change
+ /*
+ if(extension_loaded("mbstring") && function_exists("mb_convert_encoding")){
+ if ( strcmp( $xoopsModuleConfig['encodingto'], _CHARSET)<>0 )
+ $data_string = mb_convert_encoding($data_string, $xoopsModuleConfig['encodingto'],_CHARSET);
+ }*/
+ // Put the data string in parantheses and prepend "VALUES "
+ $data_string = sprintf("VALUES (%s)", $data_string);
+ // Finalise the MySQL insert into string for this record
+ $field_string = sprintf("INSERT INTO `%s` %s;\r\n", $tablename, $data_string);
+ $this->dump_buffer .= $field_string;
+ $this->dump_size += strlen(bin2hex($field_string)) / 2;
+ $this->dump_line++;
+ $this->check_dump_buffer($filename,$cfgZipType);
+ }
+ }
+ public function make_download($filename,$cfgZipType){
+
+ if (($cfgZipType == 'bzip') && function_exists('bzcompress')) { // (PMA_PHP_INT_VERSION >= 40004 &&
+ $filename .= $this->download_count>0 ? "-".$this->download_count.".sql" : ".sql" ;
+ $ext = 'bz2';
+ $this->mime_type = 'application/x-bzip';
+ $op_buffer = bzcompress($this->dump_buffer);
+ } elseif (($cfgZipType == 'gzip') && function_exists('gzencode')) { // (PMA_PHP_INT_VERSION >= 40004 &&
+ $filename .= $this->download_count>0 ? "-".$this->download_count.".sql" : ".sql" ;
+ $ext = 'gz';
+ $content_encoding = 'x-gzip';
+ $this->mime_type = 'application/x-gzip';
+ // without the optional parameter level because it bug
+ $op_buffer = gzencode($this->dump_buffer,9);
+ } elseif (($cfgZipType == 'zip') && function_exists('gzcompress')) { // (PMA_PHP_INT_VERSION >= 40000 &&
+ $filename .= $this->download_count>0 ? "-".$this->download_count : "";
+ $ext = 'zip';
+ $this->mime_type = 'application/x-zip';
+ $extbis = '.sql';
+ $zipfile = new zipfile();
+ $zipfile -> addFile($this->dump_buffer, $filename . $extbis);
+ $op_buffer = $zipfile -> file();
+ } else {
+ $filename .= $this->download_count>0 ? "-".$this->download_count : "";
+ $ext = 'sql';
+ $cfgZipType = 'none';
+ $this->mime_type = "text/plain";
+ $op_buffer = $this->dump_buffer;
+ }
+ $fpathname = $this->backup_dir.$filename.'.'.$ext;
+ if ($this->debug) echo $fpathname."
";
+ $fp = fopen($fpathname,'w');
+ fwrite($fp, $op_buffer);
+ fclose($fp);
+ unset($op_buffer);
+ if(!file_exists($fpathname)){
+ print("Error - $filename does not exist.");
+ return false;
+ }
+ $this->download_fname[$this->download_count]['filename'] = $filename.'.'.$ext;
+ $this->download_fname[$this->download_count]['line'] = $this->dump_line;
+ $this->download_fname[$this->download_count]['size'] = filesize($fpathname);
+ $this->download_count++;
+ }
+ /*
+ ** $beforeDays : You can purge before N days
+ */
+ public function purge_allfiles($beforeDays=NULL){
+ if ($handle = opendir( $this->backup_dir )) {
+ while (false !== ($file = readdir($handle))) {
+ if (preg_match("/sql/",$file)) {
+ $fileDate = filemtime( $this->backup_dir.$file );
+ if ($beforeDays){
+ $beforeDate = time() - 86400 * intval($beforeDays);
+ if ( $fileDate < $beforeDate ){
+ if ($this->debug) echo "DELETE - $file $fileDate\n
";
+ unlink($this->backup_dir.$file);
+ }
+ }else{
+ if ($this->debug) echo "DELETE - $file $fileDate\n
";
+ unlink($this->backup_dir.$file);
+ }
+ }
+ }
+ closedir($handle);
+ }
+ }
+ public function check_dump_buffer($filename,$cfgZipType){
+ //var_dump($this->xoopsModuleConfig);
+ $max_dumpsize = $this->xoopsModuleConfig['max_dumpsize'];//max_dumpsize
+ if( !$max_dumpsize ) $max_dumpsize = MAX_DUMPSIZE;
+ //echo $this->dump_line . " - " .strlen( bin2hex( $this->dump_buffer)) / 2 . "byte
";
+ if ($this->dump_line >= MAX_DUMPLINE || $this->dump_size >= $max_dumpsize ){
+ $this->make_download($filename,$cfgZipType);
+ //unset($GLOBALS['dump_buffer']);
+ //unset($GLOBALS['$this->dump_line']);
+ $this->dump_buffer = "";
+ $this->dump_line = 0;
+ $this->dump_size = 0;
+ }
+ }
+ public function Lock_Tables($tablename_array){
+ global $xoopsDB;
+ $q = 'LOCK TABLES';
+ for ($i = 0; $i queryF($q);
+ }
+ public function backup_data($tablename_array, $backup_structure, $backup_data, $filename, $cfgZipType){
+ global $xoopsDB;
+ $field_string = "-- CHG-WEB.Xoops Backup/Restore Module\r\n-- BackPack\r\n-- https://store.chg-web.com/\r\n"
+ . "-- --------------------------------------------\r\n";
+ $this->dump_buffer = $field_string;
+ $this->dump_size += strlen(bin2hex($field_string)) / 2;
+ preg_match_all("/\r\n/",$this->dump_buffer,$c);
+ $this->dump_line += count($c[0]);
+ //mysqli_query($xoopsDB->conn,'FLUSH TABLES');
+ $xoopsDB->queryF('FLUSH TABLES');
+ $this->Lock_Tables($tablename_array);
+ for ($i = 0; $i create_table_sql_string( $tablename_array[$i] );
+ if ( $backup_data ){
+ $this->create_data_sql_string ( $tablename_array[$i], $filename, $cfgZipType);
+ }
+ $this->check_dump_buffer( $filename , $cfgZipType );
+ $time_now = time();
+ if ($this->time_start >= $time_now + 30) {
+ $this->time_start = $time_now;
+ header('X-pmaPing: Pong');
+ }
+ }
+ $xoopsDB->queryF('UNLOCK TABLES');
+ if ( $this->dump_buffer ) $this->make_download( $filename, $cfgZipType );
+ }
+ public function restore_data($filename, $restore_structure, $restore_data, $db_selected, $replace_url='')
+ {
+ global $xoopsDB;
+ if (!file_exists($filename)) exit();
+ $handle = fopen($filename, 'r');
+
+ $prefix ='';
+ mysqli_set_charset('utf8');
+ while (!feof($handle)) {
+ $buffer='';
+ while (!feof($handle)) {
+ //$cbuff = ereg_replace("\n|\r|\t","",fgets($handle));
+ $cbuff = preg_replace('/\n|\r|\t/','',fgets($handle));
+ // print (ereg('--',$cbuff)?"true
":"false
");
+ //if (!ereg('^--',$cbuff)) $buffer .= $cbuff;
+ if (!preg_match('/^--/',$cbuff)) $buffer .= $cbuff;
+ if (preg_match('/;/',$cbuff)!=false) break;
+ }
+ if (preg_match("/^CREATE TABLE|^INSERT INTO|^DELETE/i",$buffer)){
+ if (!$prefix){
+ $match = explode(' ',$buffer);
+ $prefix = explode('_',$match[2]);
+ $prefix = preg_replace("/^`/","", $prefix[0]);
+ }
+ $buffer = preg_replace("/".$prefix."_/" , XOOPS_DB_PREFIX."_" , $buffer);
+ if ($replace_url){
+ $pattern = 'http://' . $replace_url;
+ $buffer = preg_replace( '/' . preg_quote($pattern, '/') . '/' , XOOPS_URL , $buffer);
+ }
+ }
+ // 20100218
+ $buffer = preg_replace("/on update CURRENT_TIMESTAMP default \'CURRENT_TIMESTAMP\'/i","",$buffer);
+ if ($buffer) {
+ // if this line is a create table query then check if the table already exists
+
+ //if (eregi("^CREATE TABLE",$buffer) ) {
+ if (preg_match('/^CREATE TABLE/i',$buffer) ) {
+ if ($restore_structure) {
+ $tablename = explode(' ', $buffer);
+ $tablename = preg_replace('/`/','',$tablename[2]);
+ $result = mysqli_list_tables($db_selected);
+ for ($i = 0; $i < mysqli_num_rows($result); $i++) {
+ if (mysqli_tablename($result, $i) == $tablename) {
+ //$rand = substr(md5(time()), 0, 8);
+ //$random_tablename = sprintf("%s_bak_%s", $tablename, $rand);
+ //mysqli_query("DROP TABLE IF EXISTS $tablename");
+ $xoopsDB->queryF('DROP TABLE IF EXISTS '.$tablename);
+ //mysqli_query("RENAME TABLE $tablename TO $random_tablename");
+ //echo "Backed up $tablename to $random_tablename.
\n";
+ }
+ }
+ //$result = mysqli_query($buffer);
+ $xoopsDB->queryF($buffer);
+ if (!$result) {
+ echo mysqli_error()."
\n";
+ } else {
+ echo "Table '$tablename' successfully recreated.
\n";
+ }
+ }
+ } else {
+ //echo "[".$buffer."]";die;
+ if ($restore_data) {
+ //$result = mysqli_query($buffer);
+ $xoopsDB->queryF($buffer);
+ if (!$result) echo mysqli_error()."
\n";
+ }
+ }
+ }
+ }
+ fclose($handle);
+ }
+ public function get_module_tables($dirname){
+ global $xoopsConfig,$xoopsDB;
+ if (!$dirname ) return;
+ $module_handler = xoops_gethandler('module');
+ $module = $module_handler->getByDirname($dirname);
+ // Get tables used by this module
+ $modtables = $module->getInfo('tables');
+ if ($modtables != false && is_array($modtables)) {
+ return $modtables;
+ }else{
+ // TABLES (loading mysql.sql)
+ $sql_file_path = XOOPS_TRUST_PATH . '/modules/' . $dirname.'/sql/mysql.sql' ;
+ $prefix_mod = $dirname ;
+ if( file_exists( $sql_file_path ) ) {
+ $sql_lines = file( $sql_file_path ) ;
+ foreach( $sql_lines as $sql_line ) {
+ if( preg_match( '/^CREATE TABLE \`?([a-zA-Z0-9_-]+)\`? /i' , $sql_line , $regs ) ) {
+ $modtables[] = $prefix_mod.'_'.$regs[1] ;
+ }
+ }
+ return $modtables;
+ }
+ }
+
+ //die( "No Table" );
+ redirect_header('./index.php', 1, _AM_NO_TABLE);
+ }
+ public function make_module_selection($select_dirname='',$addblank=0)
+ {
+ global $xoopsDB;
+ $sql = 'SELECT name,dirname FROM '.$xoopsDB->prefix('modules');
+ if (!$result = $xoopsDB->queryF($sql)) {
+ return false;
+ }
+ $mod_selections = '';
+ return $mod_selections;
+ }
+ /**
+ * Maximum upload size as limited by PHP
+ * Used with permission from Moodle (http://moodle.org) by Martin Dougiamas
+ *
+ * this section generates $max_upload_size in bytes
+ */
+
+ public function get_real_size($size=0) {
+ /// Converts numbers like 10M into bytes
+ if (!$size) {
+ return 0;
+ }
+ $scan['MB'] = 1048576;
+ $scan['Mb'] = 1048576;
+ $scan['M'] = 1048576;
+ $scan['m'] = 1048576;
+ $scan['KB'] = 1024;
+ $scan['Kb'] = 1024;
+ $scan['K'] = 1024;
+ $scan['k'] = 1024;
+
+ while (list($key) = each($scan)) {
+ if ((strlen($size)>strlen($key))&&(substr($size, strlen($size) - strlen($key))==$key)) {
+ $size = substr($size, 0, strlen($size) - strlen($key)) * $scan[$key];
+ break;
+ }
+ }
+ /*foreach($scan as $key=>$value){
+ if ((strlen($size)>strlen($value))&&(substr($size, strlen($size) - strlen($key))==$key)) {
+ $size = substr($size, 0, strlen($size) - strlen($key)) * $value;
+ break;
+ }
+ }*/
+ return $size;
+ }
+ /**
+ * Displays the maximum size for an upload
+ *
+ * @param integer the size
+ *
+ * @return string the message
+ *
+ * @access public
+ */
+ public function PMA_displayMaximumUploadSize($max_upload_size) {
+ list($max_size, $max_unit) = $this->PMA_formatByteDown($max_upload_size);
+ return '(' . sprintf(_AM_SELECTAFILE_DESC, $max_size, $max_unit) . ')';
+ }
+ /**
+ * Formats $value to byte view
+ *
+ * @param double the value to format
+ * @param integer the sensitiveness
+ * @param integer the number of decimals to retain
+ *
+ * @return array the formatted value and its unit
+ *
+ * @access public
+ *
+ * @author staybyte
+ * @version 1.2 - 18 July 2002
+ */
+ public function PMA_formatByteDown($value, $limes = 6, $comma = 0)
+ {
+ $dh = pow(10, $comma);
+ $li = pow(10, $limes);
+ $return_value = $value;
+ $byteunits = array('Byte', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');
+ $unit = $byteunits[0];
+ $number_thousands_separator = ',';
+ $number_decimal_separator = '.';
+
+ for ( $d = 6, $ex = 15; $d >= 1; $d--, $ex-=3 ) {
+ if (isset($byteunits[$d]) && $value >= $li * pow(10, $ex)) {
+ $value = round($value / ( pow(1024, $d) / $dh) ) /$dh;
+ $unit = $byteunits[$d];
+ break 1;
+ } // end if
+ } // end for
+
+ if ($unit != $byteunits[0]) {
+ $return_value = number_format($value, $comma, $number_decimal_separator, $number_thousands_separator);
+ } else {
+ $return_value = number_format($value, 0, $number_decimal_separator, $number_thousands_separator);
+ }
+
+ return array($return_value, $unit);
+ } // end of the 'PMA_formatByteDown' function
+ public function download_fname(){
+ return $this->download_fname;
+ }
+ // end function
+}
\ No newline at end of file
diff --git a/class/index.html b/class/index.html
new file mode 100644
index 0000000..990cbd6
--- /dev/null
+++ b/class/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/changelog.txt b/docs/changelog.txt
new file mode 100644
index 0000000..d72f6b4
--- /dev/null
+++ b/docs/changelog.txt
@@ -0,0 +1,32 @@
+==================================
+Version 2.01 - 2020/11/03
+==================================
+- Fixed bugs minor
+
+==================================
+Version 2.00 - 2020/10/15
+==================================
+- Update deprecated PHP functions for compatibilty PHP 7.0.x and higher
+- Update deprecated SQL functions for compatibilty MariaDB
+- Fixed bugs minor
+
+==================================
+Version 1.01 - 2012/08/17
+==================================
+- Correction of French language files
+- Update and correction of file: xoops_version.php
+- Fixed links in the file: ./admin/footer_admin.php
+- Fixed a bug "go to module"
+- Fixed a bug "Cannot modify header information - headers already sent by" in file : ./admin/optimizer.php
+
+==================================
+Version 1.00 - 2012/08/13
+==================================
+- Update deprecated functions
+- New blue logo
+- Changed to standardized XOOPS Module GUI
+
+==================================
+Version 0.97 - Before 2012/08/13
+==================================
+- Baseline
\ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 0000000..990cbd6
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/hook_cron.php b/hook_cron.php
new file mode 100644
index 0000000..2bd2027
--- /dev/null
+++ b/hook_cron.php
@@ -0,0 +1,25 @@
+queryF('SHOW TABLES FROM '.$db_selected);
+ $num_tables = $xoopsDB->getRowsNum($result);
+ for ($i = 0; $i < $num_tables; $i++) {
+ $tablename_array[$i] = mysqli_tablename($result, $i);
+ }
+ $filename = 'xdb'.date('YmdHis',time());
+ $cfgZipType = 'gzip';
+ $bp = new backpack($dirname,$parameter);
+ if ($bp->err_msg) echo "" . $bp->err_msg ."";
+ $bp->backup_data($tablename_array, $backup_structure, $backup_data, $filename, $cfgZipType);
+}
diff --git a/images/alert.gif b/images/alert.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b271a0187be2310349d58de1e017262406e21ff4
GIT binary patch
literal 572
zcmZ?wbhEHbIc0mef_WlN!re+uSmUed;R%T0g2QgNu
zwhkqJLoNBqP42R+^H_DP4Cb@)Id$l>8qMmEX0>p)XXRbvF3Bp)qG_$iDaa}@i_z81
z&DHtHF^2YLchfazTG{4ZXmRHIB%SPQ6o^*AJI2ryU!0Mq?-q5uE@
literal 0
HcmV?d00001
diff --git a/images/attachment.gif b/images/attachment.gif
new file mode 100644
index 0000000000000000000000000000000000000000..53dcf9921a52c8dd755740b3d3eb8f4d7a477f89
GIT binary patch
literal 170
zcmZ?wbhEHb6krfw*v!E2|NsA|ub$kx_wf7fqsGR@s=^Tr3^Uo73jQ%NF<=9VKUr8r
z82&TpfFwa?FtCJgnBus4=_eV1hW~NPC8ZPRX%tAPyr|3WKG$+8Z~g8phPhcb=T{FJ5vxlq>zEuBy64C-U3*=65YE{0D3-C{GSh{d5(-QV
F)&NHJJeU9g
literal 0
HcmV?d00001
diff --git a/images/backpack_slogo.png b/images/backpack_slogo.png
new file mode 100644
index 0000000000000000000000000000000000000000..6288a1e1e0ae6df1fea9dfcd80e577cb132489f3
GIT binary patch
literal 8581
zcmV;0A$s14P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T
zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p
z00esgV8|mQcmRZ%02D^@S3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XnFAN15yPl>0Wewyy??!WnHv#F_xjT<+zV#Nvy3k$F6wX3VEdH?gNDU
zitb-$wgkS|{`_F4r>BSQ+qbiLb~=*7;h?m%wDF;b9?DBjP9`}yS?&16c69*XzI{7D
zYe`ATZIZ*`prN6``tr*!Zvt36JN@rd#xM8+t*fwgpZ}D7M>_#pZ@>NaHOrPQ`%rQ?
zqQ2rsAAPiN`}XboTUuJaKhistory.go(-1);
\ No newline at end of file
diff --git a/images/left_both.gif b/images/left_both.gif
new file mode 100644
index 0000000000000000000000000000000000000000..22162a82e042406be2bc4d73c73a7d10517e610d
GIT binary patch
literal 538
zcmZ?wbhEHb8>SvX7Ap&ckzM4hmI~f
zzH-a{V<)$tKC%A%*_{V3oVt4X(#0FMk6b%<=lZ>y4<9_fd*;RcE6*RjeE0g+hbM2J
zy`Q3_rlu^w!~CB?)j?tc^8y!XZON}Asy_uh9QS|*wS
zOT6bB@p_47U0z|kJZkN#t*fuBk39H~$GdFJ%|%HUr-fEudl|JocjK|WUemLqcI141
zbXPk(KYm~7cCK%~zO8?Fpyl~3-JT!s9v
T=d_Ek}i;ojcf&EDSF*x1P1
z+r-z`z}3~d&(F5c%hLs>a5r#l@w)y_~(hwY9aEy1JCOxU8(KkfEV@lapClSyEC`
zFiA-+KtKQh0RR90A^8La6aXIpEC2ui0FVJJ0RRR6peK%GX`X1Ru59bRa4gSsZQppV
z@AUTxz@TtQEE2%@3V;w39t4t;l$Dm3n3(w6(UkxVgH!yuH4^z`?@9#Kp$P$jQpf%+0^93l5JHkOtP**xB0K+}+;a
z;Njxqr-hzKqe`7hwW`&tST`zVs*`8duVBN99ZPoT)}~&|s$I*r
zty`;SyFPtOx31m0ct^%{3N^3azkmZ%-J4dh;lqd%vm`uMvE#>(6Ep4`xw7TUYbRsg
z%(*k%rDz*_9!y!`Pbskqf0*ueY*AQHLGLa&V8l!?%>0}RxVn+`STsWqhF6*J^T03-NT=MTt5B#
zz3t=QZ(BeA|Fn^(8h`}O=3jvba&}<0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LWt
zt_3P=V>{H@($=W@G~sPmYTMm1wYR=~YHrCG+|dqKp2e-?W|N!2ex_LU!g
s^LtJC^0$in{V)FfD`38wx4?G{FoOL_-~}sD!4CdrgCktT8ioJ>J1<5x@c;k-
literal 0
HcmV?d00001
diff --git a/include/defines.lib.php b/include/defines.lib.php
new file mode 100644
index 0000000..9fbba61
--- /dev/null
+++ b/include/defines.lib.php
@@ -0,0 +1,134 @@
+ 0) {
+ $row = mysql_fetch_array($result);
+ $match = explode('.', $row['version']);
+ } else {
+ $result = @mysql_query('SHOW VARIABLES LIKE \'version\'');
+ if ($result != FALSE && @mysql_num_rows($result) > 0){
+ $row = mysql_fetch_row($result);
+ $match = explode('.', $row[1]);
+ }
+ }
+ } // end server id is defined case
+
+ if (!isset($match) || !isset($match[0])) {
+ $match[0] = 3;
+ }
+ if (!isset($match[1])) {
+ $match[1] = 21;
+ }
+ if (!isset($match[2])) {
+ $match[2] = 0;
+ }
+
+ define('PMA_MYSQL_INT_VERSION', (int)sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2])));
+ unset($match);
+}
+
+if (!defined('PMA_USR_OS')) {
+ if (!isset($_SERVER['HTTP_USER_AGENT']) OR empty($_SERVER['HTTP_USER_AGENT'])) {
+ die ('PHP version is too old');
+ }
+
+ // 1. Platform
+ if(preg_match_all("#Windows NT (.*)[;|\)]#isU", $_SERVER["HTTP_USER_AGENT"], $version)){
+ $os = 'Win';
+ } elseif(preg_match_all("#Mac (.*);#isU", $_SERVER["HTTP_USER_AGENT"], $version)){
+ $os = 'Mac';
+ } elseif(preg_match("#Mac#", $_SERVER["HTTP_USER_AGENT"])){
+ $os = 'Mac';
+ } elseif(preg_match("#SunOS#", $_SERVER["HTTP_USER_AGENT"])){
+ $os = 'SunOS';
+ } elseif(preg_match("#Fedora#", $_SERVER["HTTP_USER_AGENT"])){
+ $os = 'Fedora';
+ } elseif(preg_match("#Haiku#", $_SERVER["HTTP_USER_AGENT"])){
+ $os = 'Haiku';
+ } elseif(preg_match("#Ubuntu#", $_SERVER["HTTP_USER_AGENT"])){
+ $os = 'Linux Ubuntu';
+ } elseif(preg_match("#FreeBSD#", $_SERVER["HTTP_USER_AGENT"])){
+ $os = 'FreeBSD';
+ } elseif(preg_match("#Linux#", $_SERVER["HTTP_USER_AGENT"])){
+ $os = 'Linux';
+ } else {
+ $os = 'Inconnu';
+ }
+ define('PMA_USR_OS', $os);
+ unset($os);
+
+ // 2. browser and version
+ if(preg_match_all("#Opera (.*)(\[[a-z]{2}\];)?$#isU", $_SERVER["HTTP_USER_AGENT"], $version)){
+ $navigateur = 'Opéra';
+ $ver = $version[1][0];
+ } elseif(preg_match_all("#MSIE (.*);#isU", $_SERVER["HTTP_USER_AGENT"], $version)){
+ $navigateur = 'Internet Explorer';
+ $ver = $version[1][0];
+ } elseif(preg_match_all("#Firefox(.*)$#isU", $_SERVER["HTTP_USER_AGENT"], $version)){
+ $ver = str_replace('/', '', $version[1][0]);
+ $navigateur = 'Firefox';
+ } elseif(preg_match_all("#Chrome(.*) Safari#isU", $_SERVER["HTTP_USER_AGENT"], $version)){
+ $ver = str_replace('/', '', $version[1][0]);
+ $navigateur = 'Chrome';
+ } elseif(preg_match_all("#Opera(.*) \(#isU", $_SERVER["HTTP_USER_AGENT"], $version)){
+ $ver = str_replace('/', '', $version[1][0]);
+ $navigateur = 'Opéra';
+ } elseif(preg_match("#Nokia#", $_SERVER["HTTP_USER_AGENT"])){
+ $ver = '';
+ $navigateur = 'Nokia';
+ } elseif(preg_match("#Safari#", $_SERVER["HTTP_USER_AGENT"])){
+ $navigateur = 'Safari';
+ $ver = '';
+ } elseif(preg_match("#SeaMonkey#", $_SERVER["HTTP_USER_AGENT"])){
+ $navigateur = 'SeaMonkey';
+ $ver = '';
+ } elseif(preg_match("#PSP#", $_SERVER["HTTP_USER_AGENT"])){
+ $navigateur = 'PSP';
+ $ver = '';
+ } elseif(preg_match("#Netscape#", $_SERVER["HTTP_USER_AGENT"])){
+ $navigateur = 'Netscape';
+ $ver = '';
+ } else {
+ $navigateur = 'Inconnu';
+ $ver = '';
+ }
+ define ('PMA_USR_BROWSER_VER', $ver);
+ define ('PMA_USR_BROWSER_AGENT', $navigateur);
+ unset ($navigateur, $ver);
+}
\ No newline at end of file
diff --git a/include/ext2mime.php b/include/ext2mime.php
new file mode 100644
index 0000000..3ad64fe
--- /dev/null
+++ b/include/ext2mime.php
@@ -0,0 +1,316 @@
+"application/vnd.lotus-1-2-3",
+ "3g2"=>"video/3gpp2",
+ "3gp"=>"video/3gpp",
+ "ai"=>"application/postscript",
+ "aif"=>"audio/x-aiff",
+ "aifc"=>"audio/x-aiff",
+ "aiff"=>"audio/x-aiff",
+ "album"=>"application/album",
+ "amc"=>"application/x-mpeg",
+ "api"=>"application/x-httpd-isapi",
+ "asc"=>"text/plain",
+ "asd"=>"application/astound",
+ "asf"=>"video/x-ms-asf",
+ "asis"=>"httpd/send-as-is",
+ "asn"=>"application/astound",
+ "asp"=>"application/x-asap",
+ "asx"=>"video/x-ms-asf",
+ "au"=>"audio/basic",
+ "avi"=>"video/x-msvideo",
+ "bcpio"=>"application/x-bcpio",
+ "bin"=>"application/octet-stream",
+ "bmp"=>"image/bmp",
+ "bz2"=>"application/x-bzip",
+ "cco"=>"application/x-cocoa",
+ "cct"=>"application/x-cct",
+ "cdf"=>"application/x-netcdf",
+ "cgi"=>"application/x-httpd-cgi",
+ "class"=>"application/octet-stream",
+ "clp"=>"application/x-msclip",
+ "cocoa"=>"application/x-cocoa",
+ "com"=>"application/octet-stream",
+ "cpio"=>"application/x-cpio",
+ "cpt"=>"application/mac-compactpro",
+ "crd"=>"application/x-mscardfile",
+ "csh"=>"application/x-csh",
+ "csm"=>"chemical/x-csml",
+ "csml"=>"chemical/x-csml",
+ "css"=>"text/css",
+ "d96"=>"x-world/x-d96",
+ "dcr"=>"application/x-director",
+ "dir"=>"application/x-director",
+ "dl"=>"application/x-WebSync-plugin",
+ "dms"=>"application/octet-stream",
+ "doc"=>"application/msword",
+ "dot"=>"application/x-dot",
+ "dvi"=>"application/x-dvi",
+ "dwf"=>"drawing/x-dwf",
+ "dwg"=>"image/vnd",
+ "dxr"=>"application/x-director",
+ "ebk"=>"application/x-expandedbook",
+ "emb"=>"chemical/x-embl-dl-nucleotide",
+ "embl"=>"chemical/x-embl-dl-nucleotide",
+ "eps"=>"application/postscript",
+ "es"=>"audio/echospeech",
+ "esl"=>"audio/echospeech",
+ "etc"=>"application/x-earthtime",
+ "etx"=>"text/x-setext",
+ "evy"=>"application/x-envoy",
+ "exe"=>"application/octet-stream",
+ "ez"=>"application/andrew-inset",
+ "fdf"=>"application/vnd",
+ "fgd"=>"application/x-director",
+ "fif"=>"image/fif",
+ "fm"=>"application/x-maker",
+ "fvi"=>"video/isivideo",
+ "gau"=>"chemical/x-gaussian-input",
+ "gif"=>"image/gif",
+ "gtar"=>"application/x-gtar",
+ "gz"=>"application/x-gzip",
+ "hdf"=>"application/x-hdf",
+ "hdml"=>"text/x-hdml;charset=Shift_JIS",
+ "hlp"=>"application/winhlp",
+ "hqx"=>"application/mac-binhex40",
+ "htm"=>"text/html",
+ "html"=>"text/html",
+ "ice"=>"x-conference/x-cooltalk",
+ "ief"=>"image/ief",
+ "ifm"=>"image/gif",
+ "ifs"=>"image/ifs",
+ "iges"=>"model/iges",
+ "igs"=>"model/iges",
+ "ins"=>"application/x-NET-Install",
+ "ips"=>"application/x-ipscript",
+ "ipx"=>"application/x-ipix",
+ "ivr"=>"i-world/i-vrml",
+ "jbw"=>"application/x-js-taro",
+ "jfw"=>"application/x-js-taro",
+ "jnlp"=>"application/x-java-jnlp-file",
+ "jpe"=>"image/jpeg",
+ "jpeg"=>"image/jpeg",
+ "jpg"=>"image/jpeg",
+ "js"=>"application/x-javascript",
+ "jtd"=>"application/x-js-taro",
+ "kar"=>"audio/midi",
+ "kjx"=>"application/x-kjx",
+ "latex"=>"application/x-latex",
+ "lcc"=>"application/fastman",
+ "lcl"=>"application/x-digitalloca",
+ "lcr"=>"application/x-digitalloca",
+ "lha"=>"application/octet-stream",
+ "LZH"=>"application/octet-stream",
+ "lzh"=>"application/octet-stream",
+ "m13"=>"application/x-msmediaview",
+ "m14"=>"application/x-msmediaview",
+ "m3u"=>"audio/x-mpegurl",
+ "man"=>"application/x-troff-man",
+ "map"=>"application/x-httpd-imap",
+ "mbd"=>"application/mbedlet",
+ "mcf"=>"text/mcf",
+ "mcp"=>"application/netmc",
+ "mct"=>"application/x-mascot",
+ "mdb"=>"application/x-msaccess",
+ "mdc"=>"application/x-mediadesc",
+ "mdx"=>"application/x-mediadesc",
+ "me"=>"application/x-troff-me",
+ "mesh"=>"model/mesh",
+ "MID"=>"audio/midi",
+ "mid"=>"audio/midi",
+ "midi"=>"audio/midi",
+ "mif"=>"application/vnd.mif",
+ "mio"=>"audio/x-mio",
+ "mmf"=>"application/x-smaf",
+ "mng"=>"video/x-mng",
+ "mny"=>"application/x-msmoney",
+ "mocha"=>"application/x-mocha",
+ "mof"=>"application/x-yumekara",
+ "mol"=>"chemical/x-mdl-molfile",
+ "mop"=>"chemical/x-mopac-input",
+ "mov"=>"video/quicktime",
+ "movie"=>"video/x-sgi-movie",
+ "mp2"=>"audio/mpeg",
+ "mp3"=>"audio/mpeg",
+ "mp4"=>"video/mp4",
+ "mpe"=>"video/mpeg",
+ "mpeg"=>"video/mpeg",
+ "mpg"=>"video/mpeg",
+ "mpg4"=>"video/mp4",
+ "mpga"=>"audio/mpeg",
+ "mpp"=>"application/vnd.ms-project",
+ "mrl"=>"text/x-mrml",
+ "ms"=>"application/x-troff-ms",
+ "msh"=>"model/mesh",
+ "mus"=>"x-world/x-d96",
+ "nc"=>"application/x-netcdf",
+ "nm"=>"application/x-nvat",
+ "nva"=>"application/x-neva1",
+ "nvat"=>"application/x-nvat",
+ "oda"=>"application/oda",
+ "oke"=>"audio/karaoke",
+ "olh"=>"application/x-onlivehead",
+ "olr"=>"application/x-onlivereg",
+ "olv"=>"x-world/x-vrml1.0",
+ "pac"=>"audio/x-pac",
+ "pae"=>"audio/x-epac",
+ "pbm"=>"image/x-portable-bitmap",
+ "pcv"=>"application/x-pcnavi",
+ "pdb"=>"chemical/x-pdb",
+ "pdf"=>"application/pdf",
+ "pfr"=>"application/font-tdpfr",
+ "pgm"=>"image/x-portable-graymap",
+ "pgn"=>"application/x-chess-pgn",
+ "pmd"=>"application/x-pmd",
+ "png"=>"image/png",
+ "pnm"=>"image/x-portable-anymap",
+ "pot"=>"application/vnd.ms-powerpoint",
+ "ppm"=>"image/x-portable-pixmap",
+ "pps"=>"application/vnd.ms-powerpoint",
+ "ppt"=>"application/vnd.ms-powerpoint",
+ "prc"=>"application/x-palmpilot",
+ "ps"=>"application/postscript",
+ "pub"=>"application/x-mspublisher",
+ "qcp"=>"audio/vnd.qcelp",
+ "qt"=>"video/quicktime",
+ "ra"=>"audio/x-realaudio",
+ "ram"=>"audio/x-pn-realaudio",
+ "ras"=>"image/x-cmu-raster",
+ "rgb"=>"image/x-rgb",
+ "rm"=>"audio/x-pn-realaudio",
+ "roff"=>"application/x-troff",
+ "rp"=>"image/vnd.rn-realpix",
+ "rpm"=>"audio/x-pn-realaudio-plugin",
+ "rt"=>"text/vnd.rn-realtext",
+ "rtf"=>"text/rtf",
+ "rtx"=>"text/richtext",
+ "rv"=>"video/vnd.rn-realvideo",
+ "rxnfile"=>"chemical/x-mdl-rxnfile",
+ "scd"=>"application/x-msschedule",
+ "sds"=>"application/x-onlive",
+ "sea"=>"application/octet-stream",
+ "sgm"=>"text/sgml",
+ "sgml"=>"text/sgml",
+ "sh"=>"application/x-sh",
+ "shar"=>"application/x-shar",
+ "shtml"=>"text/x-server-parsed-html",
+ "silo"=>"model/mesh",
+ "sit"=>"application/x-stuffit",
+ "skd"=>"application/x-koan",
+ "skm"=>"application/x-koan",
+ "skp"=>"application/x-koan",
+ "skt"=>"application/x-koan",
+ "slc"=>"application/x-salsa",
+ "smi"=>"application/smil",
+ "smil"=>"application/smil",
+ "smp"=>"application/studiom",
+ "snd"=>"audio/basic",
+ "spl"=>"application/x-futuresplash",
+ "sprite"=>"application/x-sprite",
+ "spt"=>"application/x-spt",
+ "src"=>"application/x-wais-source",
+ "sv4cpio"=>"application/x-sv4cpio",
+ "sv4crc"=>"application/x-sv4crc",
+ "svf"=>"image/vnd",
+ "svi"=>"application/softvision",
+ "svr"=>"x-world/x-svr",
+ "swf"=>"application/x-shockwave-flash",
+ "t"=>"application/x-troff",
+ "talk"=>"text/x-speech",
+ "tar"=>"application/x-tar",
+ "tbp"=>"application/x-timbuktu",
+ "tbt"=>"application/timbuktu",
+ "tcl"=>"application/x-tcl",
+ "tex"=>"application/x-tex",
+ "texinfo"=>"application/x-texinfo",
+ "tgf"=>"chemical/x-mdl-tgf",
+ "tif"=>"image/tiff",
+ "tiff"=>"image/tiff",
+ "tki"=>"application/x-tkined",
+ "tkined"=>"application/x-tkined",
+ "tlk"=>"application/x-tlk",
+ "tr"=>"application/x-troff",
+ "trm"=>"application/x-msterminal",
+ "tsp"=>"application/dsptype",
+ "tsv"=>"text/tab-separated-values",
+ "ttz"=>"application/t-time",
+ "txt"=>"text/plain",
+ "ustar"=>"application/x-ustar",
+ "vcd"=>"application/x-cdlink",
+ "vdo"=>"video/vdo",
+ "vex"=>"application/x-yumekara",
+ "vgm"=>"video/x-videogram",
+ "vgp"=>"video/x-videogram-plugin",
+ "vgx"=>"video/x-videogram",
+ "vif"=>"video/x-vif",
+ "viv"=>"video/vnd.vivo",
+ "vivo"=>"video/vnd.vivo",
+ "vqe"=>"audio/x-twinvq-plugin",
+ "vqf"=>"audio/x-twinvq",
+ "vql"=>"audio/x-twinvq",
+ "vrml"=>"model/vrml",
+ "vrt"=>"x-world/x-vrt",
+ "wav"=>"audio/x-wav",
+ "wax"=>"audio/x-ms-wax",
+ "wbmp"=>"image/vnd.wap.wbmp",
+ "wbxml"=>"application/vnd.wap.wbxml",
+ "wfp"=>"application/wfphelpap",
+ "wi"=>"image/wavelet",
+ "wk1"=>"application/vnd.lotus-1-2-3",
+ "wk3"=>"application/vnd.lotus-1-2-3",
+ "wk4"=>"application/vnd.lotus-1-2-3",
+ "wm"=>"video/x-ms-wm",
+ "wma"=>"audio/x-ms-wma",
+ "wmd"=>"video/x-ms-wmd",
+ "wmf"=>"application/x-msmetafile",
+ "wml"=>"text/vnd.wap.wml;charset=Shift_JIS",
+ "wmlc"=>"application/vnd.wap.wmlc",
+ "wmls"=>"text/vnd.wap.wmlscript",
+ "wmlsc"=>"application/vnd.wap.wmlscriptc",
+ "wmv"=>"video/x-ms-wmv",
+ "wmx"=>"video/x-ms-wmx",
+ "wmz"=>"video/x-ms-wmz",
+ "wri"=>"application/x-mswrite",
+ "wrl"=>"model/vrml",
+ "ws2"=>"application/x-WebSync2-Plugin",
+ "wse"=>"application/x-WebSync-plugin",
+ "wss"=>"application/x-WebSync-plugin",
+ "wv"=>"video/wavelet",
+ "wvh"=>"video/x-webview-h",
+ "wvp"=>"video/x-webview-p",
+ "wvx"=>"video/x-ms-wvx",
+ "xbd"=>"application/vnd.fujixerox.docuworks.binder",
+ "xbm"=>"image/x-xbitmap",
+ "xdm"=>"application/x-xdma",
+ "xdw"=>"application/vnd.fujixerox.docuworks",
+ "xhm"=>"application/xhtml+xml",
+ "xht"=>"application/xhtml+xml",
+ "xhtm"=>"application/xhtml+xml",
+ "xhtml"=>"application/xhtml+xml",
+ "xla"=>"application/vnd.ms-excel",
+ "xlc"=>"application/vnd.ms-excel",
+ "xll"=>"application/x-excel",
+ "xlm"=>"application/vnd.ms-excel",
+ "xls"=>"application/vnd.ms-excel",
+ "xlt"=>"application/vnd.ms-excel",
+ "xlw"=>"application/vnd.ms-excel",
+ "XML"=>"text/xml",
+ "xml"=>"text/xml",
+ "xpm"=>"image/x-xpixmap",
+ "xsl"=>"text/xml",
+ "xwd"=>"image/x-xwindowdump",
+ "xyz"=>"chemical/x-xyz",
+ "Z"=>"application/octet-stream",
+ "zac"=>"application/x-zaurus-zac",
+ "zip"=>"application/zip",
+);
+?>
\ No newline at end of file
diff --git a/include/index.html b/include/index.html
new file mode 100644
index 0000000..990cbd6
--- /dev/null
+++ b/include/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/include/read_dump.lib.php b/include/read_dump.lib.php
new file mode 100644
index 0000000..db2c1ed
--- /dev/null
+++ b/include/read_dump.lib.php
@@ -0,0 +1,182 @@
+ add the current substring to the
+ // returned array
+ if (!$i) {
+ $ret[] = $sql;
+ return TRUE;
+ }
+ // Backquotes or no backslashes before quotes: it's indeed the
+ // end of the string -> exit the loop
+ else if ($string_start == '`' || $sql[$i-1] != '\\') {
+ $string_start = '';
+ $in_string = FALSE;
+ break;
+ }
+ // one or more Backslashes before the presumed end of string...
+ else {
+ // ... first checks for escaped backslashes
+ $j = 2;
+ $escaped_backslash = FALSE;
+ while ($i-$j > 0 && $sql[$i-$j] == '\\') {
+ $escaped_backslash = !$escaped_backslash;
+ $j++;
+ }
+ // ... if escaped backslashes: it's really the end of the
+ // string -> exit the loop
+ if ($escaped_backslash) {
+ $string_start = '';
+ $in_string = FALSE;
+ break;
+ }
+ // ... else loop
+ else {
+ $i++;
+ }
+ } // end if...elseif...else
+ } // end for
+ } // end if (in string)
+
+ // lets skip comments (/*, -- and #)
+ else if (($char == '-' && $sql_len > $i + 2 && $sql[$i + 1] == '-' && $sql[$i + 2] <= ' ') || $char == '#' || ($char == '/' && $sql_len > $i + 1 && $sql[$i + 1] == '*')) {
+ $i = strpos($sql, $char == '/' ? '*/' : "\n", $i);
+ // didn't we hit end of string?
+ if ($i === FALSE) {
+ break;
+ }
+ if ($char == '/') $i++;
+ }
+
+ // We are not in a string, first check for delimiter...
+ else if ($char == ';') {
+ // if delimiter found, add the parsed part to the returned array
+ $ret[] = array('query' => substr($sql, 0, $i), 'empty' => $nothing);
+ $nothing = TRUE;
+ $sql = ltrim(substr($sql, min($i + 1, $sql_len)));
+ $sql_len = strlen($sql);
+ if ($sql_len) {
+ $i = -1;
+ } else {
+ // The submited statement(s) end(s) here
+ return TRUE;
+ }
+ } // end else if (is delimiter)
+
+ // ... then check for start of a string,...
+ else if (($char == '"') || ($char == '\'') || ($char == '`')) {
+ $in_string = TRUE;
+ $nothing = FALSE;
+ $string_start = $char;
+ } // end else if (is start of string)
+
+ elseif ($nothing) {
+ $nothing = FALSE;
+ }
+
+ // loic1: send a fake header each 30 sec. to bypass browser timeout
+ $time1 = time();
+ if ($time1 >= $time0 + 30) {
+ $time0 = $time1;
+ header('X-pmaPing: Pong');
+ } // end if
+ } // end for
+
+ // add any rest to the returned array
+ if (!empty($sql) && preg_match('@[^[:space:]]+@', $sql)) {
+ $ret[] = array('query' => $sql, 'empty' => $nothing);
+ }
+
+ return TRUE;
+} // end of the 'PMA_splitSqlFile()' function
+
+
+/**
+ * Reads (and decompresses) a (compressed) file into a string
+ *
+ * @param string the path to the file
+ * @param string the MIME type of the file, if empty MIME type is autodetected
+ *
+ * @global array the phpMyAdmin configuration
+ *
+ * @return string the content of the file or
+ * boolean FALSE in case of an error.
+ */
+function PMA_readFile($path, $mime = '') {
+ global $cfg;
+
+ if (!file_exists($path)) {
+ return FALSE;
+ }
+ switch ($mime) {
+ case '':
+ if (!$file = fopen($path, 'rb')) {
+ return FALSE;
+ }
+ $test = fread($file, 3);
+ fclose($file);
+ if ($test[0] == chr(31) && $test[1] == chr(139)) return PMA_readFile($path, 'application/x-gzip');
+ if ($test == 'BZh') return PMA_readFile($path, 'application/x-bzip');
+ return PMA_readFile($path, 'text/plain');
+ case 'text/plain':
+ if (!$file = fopen($path, 'rb')) {
+ return FALSE;
+ }
+ $content = fread($file, filesize($path));
+ fclose($file);
+ break;
+ case 'application/x-gzip':
+ if ($cfg['GZipDump'] && function_exists('gzopen')) {
+ if (!$file = gzopen($path, 'rb')) {
+ return FALSE;
+ }
+ $content = '';
+ while (!gzeof($file)) {
+ $content .= gzgetc($file);
+ }
+ gzclose($file);
+ } else {
+ return FALSE;
+ }
+ break;
+ case 'application/x-bzip':
+ if ($cfg['BZipDump'] && function_exists('bzdecompress')) {
+ if (!$file = fopen($path, 'rb')) {
+ return FALSE;
+ }
+ $content = fread($file, filesize($path));
+ fclose($file);
+ $content = bzdecompress($content);
+ } else {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return $content;
+}
\ No newline at end of file
diff --git a/include/zip.lib.php b/include/zip.lib.php
new file mode 100644
index 0000000..d39c65b
--- /dev/null
+++ b/include/zip.lib.php
@@ -0,0 +1,121 @@
+> 1);
+ } // end of the 'unix2DosTime()' method
+
+ public function addFile($data, $name, $time = 0)
+ {
+ $name = str_replace('\\', '/', $name);
+
+ $dtime = dechex($this->unix2DosTime($time));
+ $hexdtime = '\x' . $dtime[6] . $dtime[7]
+ . '\x' . $dtime[4] . $dtime[5]
+ . '\x' . $dtime[2] . $dtime[3]
+ . '\x' . $dtime[0] . $dtime[1];
+ eval('$hexdtime = "' . $hexdtime . '";');
+
+ $fr = "\x50\x4b\x03\x04";
+ $fr .= "\x14\x00"; // ver needed to extract
+ $fr .= "\x00\x00"; // gen purpose bit flag
+ $fr .= "\x08\x00"; // compression method
+ $fr .= $hexdtime; // last mod time and date
+
+ // "local file header" segment
+ $unc_len = strlen($data);
+ $crc = crc32($data);
+ $zdata = gzcompress($data);
+ $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug
+ $c_len = strlen($zdata);
+ $fr .= pack('V', $crc); // crc32
+ $fr .= pack('V', $c_len); // compressed filesize
+ $fr .= pack('V', $unc_len); // uncompressed filesize
+ $fr .= pack('v', strlen($name)); // length of filename
+ $fr .= pack('v', 0); // extra field length
+ $fr .= $name;
+
+ // "file data" segment
+ $fr .= $zdata;
+
+ // "data descriptor" segment (optional but necessary if archive is not
+ // served as file)
+ $fr .= pack('V', $crc); // crc32
+ $fr .= pack('V', $c_len); // compressed filesize
+ $fr .= pack('V', $unc_len); // uncompressed filesize
+
+ // add this entry to array
+ $this -> datasec[] = $fr;
+ $new_offset = strlen(implode('', $this->datasec));
+
+ // now add to central directory record
+ $cdrec = "\x50\x4b\x01\x02";
+ $cdrec .= "\x00\x00"; // version made by
+ $cdrec .= "\x14\x00"; // version needed to extract
+ $cdrec .= "\x00\x00"; // gen purpose bit flag
+ $cdrec .= "\x08\x00"; // compression method
+ $cdrec .= $hexdtime; // last mod time & date
+ $cdrec .= pack('V', $crc); // crc32
+ $cdrec .= pack('V', $c_len); // compressed filesize
+ $cdrec .= pack('V', $unc_len); // uncompressed filesize
+ $cdrec .= pack('v', strlen($name) ); // length of filename
+ $cdrec .= pack('v', 0 ); // extra field length
+ $cdrec .= pack('v', 0 ); // file comment length
+ $cdrec .= pack('v', 0 ); // disk number start
+ $cdrec .= pack('v', 0 ); // internal file attributes
+ $cdrec .= pack('V', 32 ); // external file attributes - 'archive' bit set
+
+ $cdrec .= pack('V', $this -> old_offset ); // relative offset of local header
+ $this -> old_offset = $new_offset;
+
+ $cdrec .= $name;
+
+ // optional extra field, file comment goes here
+ // save to central directory
+ $this -> ctrl_dir[] = $cdrec;
+ } // end of the 'addFile()' method
+
+ public function file()
+ {
+ $data = implode('', $this -> datasec);
+ $ctrldir = implode('', $this -> ctrl_dir);
+
+ return
+ $data .
+ $ctrldir .
+ $this -> eof_ctrl_dir .
+ pack('v', sizeof($this -> ctrl_dir)) . // total # of entries "on this disk"
+ pack('v', sizeof($this -> ctrl_dir)) . // total # of entries overall
+ pack('V', strlen($ctrldir)) . // size of central dir
+ pack('V', strlen($data)) . // offset to start of central dir
+ "\x00\x00"; // .zip file comment length
+ } // end of the 'file()' method
+
+} // end of the 'zipfile' class
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..b4281a2
--- /dev/null
+++ b/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..163bd13
--- /dev/null
+++ b/index.php
@@ -0,0 +1,22 @@
+here
");
+// After V0.97
+define('_AM_REPLACEURL','Replace URL(ommit http://)');
+define('_AM_REPLACEURL_DESC','Describe the URL perplace to \''.XOOPS_URL.'\'');
+// After V1.01
+define('_AM_VERIF_SUR', 'Are you sure you want to continue ?');
+define('_AM_PRECISION', 'Depending on the size of your database,
a shorter or longer period is necessary');
+define('_AM_PASOK_PASTABLE', 'No tables found in the database');
+define('_AM_PROCESS_EFFECTUE', 'Process :');
+define('_AM_LOCK_BDD', 'Locking tables of the database');
+define('_AM_TEMPS_ECOULE', 'Elapsed time');
+define('_AM_UNLOCK_BDD', 'Unlocking tables of database');
+define('_AM_TEMPS_TOT', 'Total time of the operation :');
+// Add version 2
+define('_AM_RESTORE_OK','Restore Complete');
+define('_AM_RESTORE_MESS1','The Restore is complete. Any errors or messages encountered are shown below.');
+define('_AM_NO_FILE','No exist file: ');
+define('_AM_TITLE_BCK','Backup MySQL Data');
+define('_AM_TITLE_RESTORE', 'Restore MySQL Data');
+define('_AM_SELECT_DATABASE','Select database to backup from ');
+define('_AM_MESS_ERROR_1','Over upload_max_filesize on php.ini');
+define('_AM_MESS_ERROR_2','Over MAX_FILE_SIZE at form');
+define('_AM_MESS_ERROR_3','An error occured while trying to recieve the file. Please try again.');
+define('_AM_MESS_ERROR_4','No Upload File.');
+define('_AM_MESS_ERROR_5','Unknown Error - %s');
+define('_AM_MESS_ERROR_6','Could not upload file.');
+define('_AM_MESS_ERROR_7','Check upload_max_filesize, post_max_size, memory_limit parameters in php.ini');
+define('_AM_NO_TABLE','No table found');
diff --git a/language/english/index.html b/language/english/index.html
new file mode 100644
index 0000000..990cbd6
--- /dev/null
+++ b/language/english/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/language/english/modinfo.php b/language/english/modinfo.php
new file mode 100644
index 0000000..92879b1
--- /dev/null
+++ b/language/english/modinfo.php
@@ -0,0 +1,29 @@
+ici");
+// After V0.97
+define('_AM_REPLACEURL','Remplacer le lien (sans http://)');
+define('_AM_REPLACEURL_DESC',"Renseigner le lien. Remplacer par '.XOOPS_URL.'");
+// After V1.01
+define('_AM_VERIF_SUR', 'Êtes-vous sûr de vouloir continuer ?');
+define('_AM_PRECISION', 'Suivant la taille de votre base de données,
un délai plus ou moins long sera nécessaire');
+define('_AM_PASOK_PASTABLE', 'Aucune table présente dans la BDD');
+define('_AM_PROCESS_EFFECTUE', 'Processus effectué :');
+define('_AM_LOCK_BDD', 'Verrouillage des tables de la BDD');
+define('_AM_TEMPS_ECOULE', 'Temps écoulé');
+define('_AM_UNLOCK_BDD', 'Déverrouillage de la BDD');
+define('_AM_TEMPS_TOT', 'Durée totale de l\'opération ');
+// Add version 2
+define('_AM_RESTORE_OK','Restauration complète');
+define('_AM_RESTORE_MESS1','La restauration est terminée. Les erreurs ou messages rencontrés sont indiqués ci-dessous.');
+define('_AM_NO_FILE','Fichier manquant: ');
+define('_AM_TITLE_BCK','Backup des données MySQL');
+define('_AM_TITLE_RESTORE', 'Restaurer les données MySQL');
+define('_AM_SELECT_DATABASE','Sélectionnez la base de données à partir de laquelle effectuer la sauvegarde ');
+define('_AM_MESS_ERROR_1','Augmenter upload_max_filesize dans le php.ini');
+define('_AM_MESS_ERROR_2','Augmenter la valeur de MAX_FILE_SIZE dans le formulaire');
+define('_AM_MESS_ERROR_3','Une erreur s\'est produite lors de la tentative de réception du fichier. Veuillez réessayer.');
+define('_AM_MESS_ERROR_4','Aucun fichier à télécharger.');
+define('_AM_MESS_ERROR_5','Erreur inconnue - %s');
+define('_AM_MESS_ERROR_6','Impossible de télécharger le fichier.');
+define('_AM_MESS_ERROR_7','Vérifier les paramètres upload_max_filesize, post_max_size, memory_limit dans le php.ini');
+define('_AM_NO_TABLE','Aucune table trouvée');
\ No newline at end of file
diff --git a/language/french/index.html b/language/french/index.html
new file mode 100644
index 0000000..990cbd6
--- /dev/null
+++ b/language/french/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/language/french/modinfo.php b/language/french/modinfo.php
new file mode 100644
index 0000000..5c9fd5f
--- /dev/null
+++ b/language/french/modinfo.php
@@ -0,0 +1,29 @@
+history.go(-1);
\ No newline at end of file
diff --git a/sql/.htaccess b/sql/.htaccess
new file mode 100644
index 0000000..c468487
--- /dev/null
+++ b/sql/.htaccess
@@ -0,0 +1,2 @@
+order deny,allow
+deny from all
diff --git a/sql/index.html b/sql/index.html
new file mode 100644
index 0000000..990cbd6
--- /dev/null
+++ b/sql/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/xoops_version.php b/xoops_version.php
new file mode 100644
index 0000000..7fd0fd2
--- /dev/null
+++ b/xoops_version.php
@@ -0,0 +1,75 @@
+'5.5', 'mysqli'=>'5.5');
+
+//Admin things
+$modversion['system_menu'] = 1 ;
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = 'admin/index.php';
+$modversion['adminmenu'] = 'admin/menu.php';
+
+// Menu
+$modversion['hasMain'] = 0;
+
+// Blocks
+
+
+// Search
+$modversion['hasSearch'] = 0;
+
+// Smarty
+$modversion['use_smarty'] = 1;
+
+/**
+* Option
+*/
+$modversion['config'][1]['name'] = 'max_dumpsize';
+$modversion['config'][1]['title'] = '_MI_MAX_DUMPSIZE';
+$modversion['config'][1]['description'] = '_MI_MAX_DUMPSIZEDSC';
+$modversion['config'][1]['formtype'] = 'textbox';
+$modversion['config'][1]['valuetype'] = 'int';
+$modversion['config'][1]['default'] = 15000000;
+
+$modversion['config'][2]['name'] = 'xoopsurlto';
+$modversion['config'][2]['title'] = '_MI_XOOPSURL_TO';
+$modversion['config'][2]['description'] = '_MI_XOOPSURL_DSC';
+$modversion['config'][2]['formtype'] = 'textbox';
+$modversion['config'][2]['valuetype'] = 'text';
+$modversion['config'][2]['default'] = XOOPS_URL;
\ No newline at end of file