1
0
Fork 0

Commits vergleichen

...

Keine gemeinsamen Commits. "master" und "msd1.22" haben vollständig unterschiedliche Historien.

517 geänderte Dateien mit 23633 neuen und 37638 gelöschten Zeilen

2
.gitignore vendored
Datei anzeigen

@ -1,2 +0,0 @@
.idea
/work/

Datei anzeigen

@ -1,6 +0,0 @@
# MySQLDumper
Backup & Restore for MySQL databases
This project is no longer maintained and inactive. Please take a look for alternatives.
Adding version 1.24 as master to make bug fixing via pull request as easy as possible.

Datei anzeigen

@ -1,4 +1,4 @@
MySqlDumper Copyright (C)2004-2009 Daniel Schlichtholz (admin@mysqldumper.de)
MySqlDumper Copyright (C)2004-2007 Daniel Schlichtholz (admin@daniel-schlichtholz.de) & Steffen Kamper
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software

135
ReadMe/changelog.txt Normale Datei
Datei anzeigen

@ -0,0 +1,135 @@
Changelog (from Version 1.21 to 1.22):
Added:
- used character set is shown while backing up with PHP
- used character set is shown while restoring
Deleted:
- removed some old no longer needed debug-features to speed up backup & restore
Deleted:
- removed old function "WritePageParams" which is no longer used
- removed some checkings for temp-files that are no longer created (this will speed up the backup and restore progress!)
Bugfix: unwanted vars have been saved to parameter.php (array $config_dont_save was not recognized - possible mysql character sets have been savedto parameter.php by accident). Fixed.
Added: Set HTML-output of crondump.pl to utf-8
Bugfix: PHP-Emails were still sent in ISO, so some special chars were shown incorrectly. Fixed Emailheader to be utf8.
Added: sendmail call from configuration is now interpretd by crondump.pl (no more need to fix it manually in crondump.pl)
Added: security - recursively cleaning tags in $_REQUEST-Array (now walks through sub-arrays)
Bugfix: filemanagement.php Date of Perlfiles were shown incorrectly. Fixed
Bugfix for Firefox: replaced some & in links by &
Bugfix: Filemanagement - Selected Encoding got lost on some servers. Fixed.
Bugfix: SQLBrowser - there was still a last bug left when BBCode was activated. Not all columns were shown with interpreted BBCode. Now they do. ;)
Bugfix: SQLBrowser - warning when editing fields: "undefined var d_collate" - fixed
Added Feature: SQLBrowser
- in table overview some columns are displayed "human readable" (1 MB instead of 1048576)
- added explaining titles when hovering size (move curosr onto TB and you will see the explanation "TeraByte")
Bugfix: SQLBrowser - BB-Codes are now reactivated. You can activate BBCode-displaying of any char-row again
Bugfix: SQLBrowser - fixed some problems with the listing of table overview (fields were sometimes not in the correct row if a field before was empty)
Added: most wanted features when restoring ;)
- if it is a backupfile of MSD -> get character set automatically and restore file with switching MySQL-connection to correct character set
- let the user choose the charset of backupfile if we can't detect the charset automatically
Bugfix: enclosed encoding in backticks when writing encoding to dumpfile (problem: encoding is a keyword and must be placed inside backticks)
Bugfix: for Installation (Warning: mysql_query() [function.mysql-query]: Unable to save result set in
/www/htdocs/xxx/inc/functions.php on line 471") - suppressed Warning by adding @
Added: Toolbox - choose character set and collation separatly when creating new tables
Added: Toolbox - language var for charset added
Bugfix: Toolbox - charset and collation was not surrounded by backticks. Error when using charset "binary". Fixed.
Bugfix: fixed some validation errors in sqlbrowser
Bugfix: filemanagement -> bugfix for coloring table rows when listing backup-files
Bugfix: SQLBrowser: undefined index 'Name'
Added: SQLBrowser - edit table structure: Charset-Listing is now sorted alphabetically
Bugfix: when editing Records in SQLBrowser the tablename got lost
Fixed some missing lang-vars in language pack "de-Du"
Added feature: when backing up via PHP one now can choose the encoding of the backupfile (standard encoding of MySQL-Server is pre-selected)
SET NAMES character_set now also is written into backupfile when using PHP
Added: Implemented detection of possible character_sets of MySQL-Server for MySQL 4.0 and 4.1 and higher
Added: some language-vars for output (language-packs are updatet)
Bugfix: SQL-Browser: fixed a problem when deleting tables
Added: some language-vars (I found some fixed text-outputs)
Security: began to secure some of the included files. They can't be accessed directly now (still some more to do)
Update crondump.pl:
- security: crondump.pl won't do anything if the passed config-parameter contains ":" (should prevent unsecured installations from including external evil configurations)
- translated some German outputs to English
- removed some unnecessary breaks and hr's in logfiles and screen-outputs
- adorned output in some other ways
- added the possibility to include and evaluate the new .conf.php-file
Bugfix for warning: undefined index cronfile_savepath
Added feature: show file encoding in filemangement
Security: Perl configuration file is named .conf.php - corrected configuration (config_overview) to get the correct filelist according to the new filenames
Bugfix crondump.pl: when using Multipart and Multidump together the partcounter was not reset to 1 (Part1 of the next database was named part_(part of last database+1)
Added Charset-var: preparing the manual choose of the encoding of the backupfile
Added charset-var to statusline in order to show it in filemanagement.PHP/msd/trunk/msd_cron/crondump.pl
Bugfix: SET NAMES $charset; has been placed before each table - now it is just written once into each backupfile
Bugfix Perlscript: Use of uninitialized value in concatenation (.) or string
Added: Perlscript crondump.pl:
- When backing up, Perl now sets the connection to MySQL to utf8
- added output "SET NAMES utf8" to Dumpfile. This way MySQL is switched to utf8 when restoring
Added: Delete older perl configuration files
Added: Security issue for typo3
Bugfix for undefined Index-Notices in SQLBrowser
anti vulnerable patch in sql.php
Bugfix: when using InnoDbs nr of records was shown wrong in databaseoverview (Not really a bug because MySQL itself returns the wrong sum - bypassing this by using SELECT count(*) )
Added: output of used Perl compress::zlib version number in perltest.pl
Bugfix: failure when using the converter and the backup contains "decimal" fields. Backticks were set wrong. Fixed.
Added: Portsetting of configuration was not recognized by crondump.pl - now you can choose different ports than 3306
Bugfix: on some servers some of the configvars in mysqldumper.conf were not saved as 0 but as empty strings. This lead to errore when executing crondump.pl . Fixed by converting those vars to intvalues when saving mysqldumper.conf.
Bugfix: error unknown var $id in sql.php when changing fields
Bugfix: menu.php Javscript-Definition completet
Added some error handling for mysql_search if chosen table is empty
Added string-conversion for output if connection is not set to utf8
Bugfix: JS-Error when selecting a SQL-Command from the SQLLib in other browsers than IE

Datei anzeigen

@ -1,107 +0,0 @@
Version 1.24.4
Folgende Dinge wurden geändert:
- Allgemein: Wenn "inc" in der Domain oder im Pfad zum MySQLDUmper-Verzeichnis vorkam, konnte die Datei runtime.php nicht eingebunden werden.
- Home / Konfiguration: beim Speichern der Perl-Konfigurationsdatei wurden die Auswahl der zu sichernden Datenbanken nicht korrekt gespeichert.
- Home / Verzeichnisschutz: beim Anlegen des Verzeichnisschutzes wurden PHP-Warnungen ausgegeben wenn PHP kleiner 5.3.0 genutzt wird.
- Perl: Einige kosmetische Änderungen in der Ausgabe.
- Perl: Schreibt "DROP VIEW" anstelle von "DROP TABLE" in die Backupdatei wenn es sich um einen VIEW handelt.
- Perl: Ausgabe des Typs einer Tabelle zur Ausgabe hinzugefügt.
Version 1.24.3
Folgende Dinge wurden geändert:
- Manuelles Hinzufügen von Datenbanken: Das interne Handling wurde überarbeitet. Die Datei dbs_manual.php ist nicht mehr notwendig; manuell hinzugefügte Datenbanken werden nun im jeweiligen Konfigurationsprofil gespeichert.
- Home / Verzeichnisschutz: Beim Anlegen war die Ausgabe über Erfolg / Misserfolg vertauscht.
- Home / Verzeichnisschutz: Schlägt das Erstellen des Schutzes fehl, so enthielt die folgende Anzeige der Inhalte der Dateien unschöne <br>'s, die nicht in die Dateien gehören.
- Home / Verzeichnisschutz: Der erstellten htaccess-Datei wurde "RewriteEngine off" hinzugefügt. Das vermindert Probleme, wenn MySQLDumper in einen Unterordner bestehender Systeme installiert wird, die selbst mod_rewrite nutzen.
- Home / Verzeichnisschutz: Funktion zum Editieren eines bestehenden Schutzes wurde überarbeitet.
- Home / Datenbanken: Der Key Status wurde unvollständig ermittelt. Es wurde für jede Tabelle nur der erste Index betrachtet.
- SQLBrowser / Tabellenstruktur: Bei der Anzeige der Felder und Indizes ist die Spalte "Kommentar" hinzugekommen.
- SQLBrowser / Tabellenstruktur: Die Verwaltung für Indizes wurde überarbeitet. Es können nun beliebige Indizes festgelegt werden, was bisher auf Primärschlüssel beschränkt war.
- SQLBrowser: Die Systemtabelle "information_schema" wird nun angezeigt und kann betrachtet werden.
- SQLBrowser: Ein Fehler, welcher die korrekte Funktion der Suche verhindern konnte, wurde korrigiert.
- SQLBrowser: Bei bestimmten Anfragen wurde die Anzahl der Datensätze nicht korrekt ermittelt.
- SQLBrowser: Datensätze, welche in einem Feld das Zeichen "|" enthalten, konnten unter Umständen nicht editiert werden.
- SQLBrowser: Die Fehlerbehandlung wurde verbessert.
- Wiederherstellung: Bei der Wiederherstellung von Backups anderer Skripte wurden "CREATE DATABASE"-Anweisungen nicht korrekt erkannt.
- Verwaltung / Backup-Konverter: Im Backup-Konverter befand sich ein fehlerhafter Funktionsaufruf, der eine Fehlermeldung verursachte.
- Perl: in der Perl-Datei crondump.pl wurden Warnungen ausgegeben, wenn die Option "Autodelete" aktiviert ist und sich Backups anderer Programme im work/backup-Ordner befinden.
- Perl: Anzeige der Perl-Version, Kleinigkeiten bei der Fehlerbehandlung, Schriftart in der HTML-Ausgabe
- Perl: Unterstützung von FTP via SSL (NET::FTPSSL-Perl-Modul notwendig)
- Perl: Die optionalen SQL-Befehle (Command Before/After) können nun mit mehreren, aufeinanderfolgenden Querys konfiguriert werden
Version 1.24.2
Folgende Dinge wurden geändert:
- Trotz der inteligenten Umgehung des PHP-Timeouts, kann es während einer Wiederherstellung beim Aufbau von Indexen großer Tabellen zu einem Timeout kommen.
Jetzt kann man MySQLDumper so konfigurieren, dass während der Wiederherstellung "ENABLE KEYS"-Befehle ignoriert werden.
Nach der Wiederherstellung müssen die so deaktivierten Schlüssel/Indexe manuell wieder aktiviert werden.
Dies geschieht unter Home/Datenbanken/Datenbank wählen/ Button: Enable keys. Die Option und eine entsprechende Nachricht wird automatisch eingeblendet wenn nicht aktivierte Schlüssel/Indexe erkannt werden => nichts zu sehen = nichts zu tun.
- Bei Systemen, die den Wert 0 in auto_increment-Feldern nutzen (z.B. bei Magento), kann die Wiederherstellung den Eintrag mit dem Wert 0 verfälschen, so dass es in der Anwendung (die gesicherte Anwendung, nicht MySQLDumper) zu Fehlfunktionen kommen kann.
Nun setzt MySQLDumper für die Dauer der Wiederherstellung den SQL-Modus auf "NO_AUTO_VALUE_ON_ZERO", so dass auch ungültige Werte aus der Originalanwendung unverfälscht erhalten bleiben.
- Das Perl Skript wirft Warnungen beim Sichern von VIEWS.
- Beim Sichern über die Web-Gui und aktivierter Option "Tabellen optimieren" hat diese aufgrund eines fehlerhaften Befehls
keine Auswirkung.
--------------------
Version 1.24
Changelog der wichtigsten Änderungen im Vergleich zur Version 1.22 (1.23 hat die Beta-Phase nie verlassen):
- MySQLDumper 1.24 funktioniert nach wie vor sowohl mit PHP4 als auch mit PHP5
- neue, helle und freundliche Optik. Der "alte" Style ist für "Nostaligiker" ebenfalls enthalten.
- bessere Speicherausnutzung
- Backup und Wiederherstellung per PHP sind im Schnitt ca. 25 Prozent schneller
- Möglichkeit beim Sichern und auch beim Wiederherstellen nur bestimmte Tabellen auszuwählen
- Nutzen von mehreren MySQL-Servern und -Usern über Konfigurationsprofile.
Damit kann man mehrere Server über eine MySQLDumper-Installation warten und sichern.
- der interne SQL-Parser ist an vielen Stellen verbessert worden (noch mehr Fremdbackups können importiert werden)
- SQLBrowser: jede Menge Bugfxies und kleinere Erweiterungen (dennoch ist der SQLBrowser noch als experimentell einzustufen)
- SQLBrowser: über die Lupe kommt man zu einer durchdachten Vollextsuche. Editiert man einen Datensatz, kommt man zur Trefferliste zurück.
Das ist recht komfortabel wenn man Stellen finden muss, von denen man nicht genau weiß in welchen Spalten sie vorkommen können.
- Tools: der Export von Daten als Datei funktionierte in 1.22 nicht. Jetzt klappt das wieder.
- die Konfiguration in der WEB-GUI wurde an einigen Stellen nochmals vereinfacht und überflüssige Parameter entfernt
(Du hast kaum noch eine Chance etwas "falsch" einzustellen. :) )
- FTP-Übertragung kann nun optional auf bis zu 3 unterschiedliche Server gleichzeitig erfolgen
- Tabellen vom Typ VIEW und MEMORY werden nun automatisch erkannt und deren Daten korrekterweise nicht mitgesichert, wohl aber deren Struktur.
- das Verzeichnis work/structure wird nicht mehr benötigt
- die automatisch immer mit angelegten Struktur-Backups wurden entfernt
- noch besseres, internes Handling der Kodierung von Backups (Umlautproblematik)
- Fehler (auch beim Sichern) werden noch zuverlässig abgefangen und aussagekräftig im Log notiert
- Konverter: wurde neu geschrieben. Jetzt werden große Dateien beim Konvertieren automatisch in Multipart-Dateien aufgeteilt
- keine Notices in Server-Logs mehr
- Beim Anlegen von gespeicherten SQL-Befehlen können nun mehrere Queries angegeben werden, die bei Nutzung von "Command before/after backup"
nacheinander ausgeführt werden. Der Erfolg oder Mißerfolg wird om Logfile notiert.
- Beim Anlegen des Verzeichnisschutzes wird die Stärke des Kennworts visualisiert.
crodump.pl:
- wenn die crondump.pl im Standardordner "msd_cron" aufgerufen werded kann, braucht man den "$absolute_path_of_configdir" nicht mehr editieren.
Hier findet nun eine automatische Erkennung statt.
- besseres Abfangen von Fehlern
- es wird präziser mit aussagekräftigen Nachrichten geloggt
- automatisches Löschen betrachtet Multipart-Dateien nun korrekt als 1 vollständiges Backup und funktioniert wie erwartet
- das automatische Löschen wird nicht mehr zu Beginn ausgeführt, sondern erst nach Beenden des Sicherungsvorgangs
(somit bleiben im Fehlerfall alte Backups erhalten)
- der Parameter der zu nutzenden Konfigurationsdatei kann im Aufruf nun auf 3 Arten angegeben werden.
Die fehlende Endung ".conf.php" wird bei Bedarf automatisch ergänzt:
1. config=mysqldumper.conf.php
2. config=mysqdumper.conf
3. config=mysqldumper
- Signalhandler entfernt:
Dieser sollte eigentlich einen Abbruch des Users melden und das Skript beenden. Über einen Cronjob aufgerufen führte dies bei einigen, wenigen
Servern zu der Fehlfunktion, dass mehrere Instanzen des Skripts gestartet wurden, die lange in der Prozesliste standen und manuell beendet
werden mussten.
... und viele weitere kleine und große Bugfixes und jede Menge Aufräumarbeiten im Code.
Wer Du es ganz genau wissen möchtest, dann schaue Dir das changelog auf Sourceforge an. Hier ist akribisch
jede Änderung am Code dokumentiert:
http://mysqldumper.svn.sourceforge.net/viewvc/mysqldumper/trunk/?view=log

Datei anzeigen

@ -1,100 +0,0 @@
Version 1.24.4
We addressed the following issues:
- General: If "inc" was anywhere in the path or the domain to the MySQLDumper-Root-Diretory the file runtime.php couldn't be included.
- Configuration: When saving the Perl configuration file, the selected databases to be backed up have been saved incorrectly.
- Home / directory protection: At creating the protection PHP-Warnings were shown if running PHP lower than 5.3.0.
- Perl: Some cosmetic changes in output
- Perl: Write "DROP VIEW" instead of "DROP TABLE" to backup file if table is a view.
- Perl: Added type of table to log output.
Version 1.24.3
We addressed the following issues:
- Configuration / Databases / Connection Parameter: manual adding of databases: The internal handling was completely modified. The file dbs_manual.php is no longer needed. Manually added databases are now stored in the selected configuration profile.
- Home / directory protection: Fixed a bug that inverted the resulting message of success / failure.
- Home / directory protection: If the automatic creation of the directory protection failed, the displayed content of the .htaccess file to be created manually contained some messy <br> html code.
- Home / directory protection: The created .htaccess file was extended with "RewriteEngine off". That fixes some problems if MySQLDumper was installed in a sub-folder of an existing website that also used .htaccess files with "mod_rewrite".
- Home / directory protection: The functionality for editing an existing protection was revised.
- Home / Databases: The key status was determined incompletely so that only the first index of each table was considered.
- SQL-Browser / table structure: Added the row "comment" in the display of fields and indexes.
- SQL-Browser / table structure: The functionality for managing keys was revised. It is now possible to define any kind of keys which was limited to primary keys.
- SQL-Browser: The system table "information_schema" is now displayed and can be browsed.
- SQL-Browser: A bug was fixed that could prevent the search from working correctly.
- SQL-Browser: For some queries the number of records was not determined correctly.
- SQL-Browser: Records containing the character "|" could not be edited in some cases.
- SQL-Browser: Error handling was improved.
- Restore: When restoring backups that were not created with MySQLDumper, CREATE DATABASE statements were not recognized correctly.
- File-Administration / Backup Converter: Inside the backup converter there was a buggy routine that caused an error message.
- Backup / Perl: When the configuration option "autodelete" was activated and the folder work/backup contained files not created by MySQLDumper, the perl script crondump.pl issued warning messages.
- Perl: Show perl version, better error handling, nicer font with html
- Perl: Support for FTP over SSL added (NET::FTPSSL perl modul necessary).
- Perl: The optional SQL-Commands (Command Before/After) can now handle multiple Queries.
Version 1.24.2
We addressed the following issues:
- Although MySQLDumper bypasses timeouts by taking care of PHP's max_execution_time, it can happen that building the index of a big table leads to a timeout.
Now you can can configure MySQLDumper to ignore "ENABLE KEYS" statements while restoring a backup. But remember to enable them manually afterwards.
This is done under Home/Databases/Select database/ Button: Enable Keys. This option and a message will only show up, if MySQLDumper detects disabled keys or indexes.
- When systems use the value 0 for auto_increment fields (e.g. Magento), restoring could change the value which could cause the app to malfunction.
While restoring MySQLDumper now sets the SQL-Mode to "NO_AUTO_VALUE_ON_ZERO" for the restoring session.
- The Perl script crondump.pl threw warnings when backing up views.
- When backing up via the gui the option "optimize tables" has no effect because of an incomplete query.
--------------------
Version 1.24
Changelog of the most important changes compared to version 1.22 (1.23 never left the beta status):
- MySQLDumper 1.24 still is working on PHP4 and PHP5
- new, light and friendly style. The "old" style is still included.
- better use of RAM
- backup and restore via PHP is about 25 percent faster
- possibility to select tables when doing an backup or restore
- use different configuration profiles to manage different MySQL-Server or -user.
This way you can maintain different MySQL-Server with a singel MySQLDumper-Installation.
- the internal SQL-Parser has been improved (more backups from other programms can be importet)
- SQLBrowser: a lot of bugfixes and some improvements (nevertheless it must still be regarded as experimental)
- SQLBrowser: a comfortable fulltext-search lets you find text even when you don't know in what column it can occur
After editing a record you get back to the hitlist. That really is comfortable when you need to change data.
- Tools: in version 1.22 the export of data as file didn't work. Now it is working again.
- the Web-GUI has been simplified. Some parameters have been removed. (You nearly have no chance to configure something incorrectly :) )
- FTP-Transfer: address up to 3 ftp configurations simultaneously in one backup process
- Tables of type VIEW or MEMORY are now detected and data is not saved but the structure of the table is
- the directory work/structure is no longer needed
- the automatic "structure only" backup has been removed
- better and safer handling of encodings of backup files
- better and safer error-handling
- the backup converter has been rewritten. Now it also automatically converts big files into Multipart files.
- no notices in server-logs
- when adding SQL-Queries to the SQL-Library you can now enter more than one query. If using "commadn before/after backup"
these queries will be executed in a row. Succes or failure is written to the log file.
- When creating a password protection the password strength is visualized.
crodump.pl:
- when you can call crondump.pl in the standard directory "msd_cron" you no longer need to enter the
"$absolute_path_of_configdir" manually. An automatic detection was added.
- better and safer catching of errors
- logging of events is much more precise and gives you clear statements what happened
- automatic deletion now regards Multipart files as one complete backup and works the way you expect it to work
- automatic deletion is done after the backup process. In case of errors this retains your old backups you might need.
- the config parameter - which configuration profile is to be used - can be set in 3 ways. The missing suffix
".conf.php" will be added dynamically.
1. config=mysqldumper.conf.php
2. config=mysqdumper.conf
3. config=mysqldumper
- removed signalhandler:
When crondump.pl was started via a cronjob there was a malfunction. On some, rare server this signalhandler caused a second
or third instance of the script that never stopped and stuck in the process list. In this case the process must be killed manually.
... and many more small or big bugfixes and cleaning up the code
When you want to know more, just take a look at the changelog of my code changes at Sourceforge. Each change
of the code is documented here:
http://mysqldumper.svn.sourceforge.net/viewvc/mysqldumper/trunk/?view=log

Datei anzeigen

@ -1,100 +0,0 @@
Versión 1.24.4
Hemos abordado los siguientes temas:
- General: Si "inc" estaba en cualquier parte de la ruta o el dominio a la MySQLDumper-Root-Diretory, el archivo runtime.php no pudo ser incluido.
- Configuración: Al guardar el archivo de configuración de Perl, las bases de datos seleccionadas para realizar una copia de seguridad se han guardado incorrectamente.
- Protección de inicio / directorio: Al crear la protección se mostraron PHP-Advertencias si se ejecuta PHP inferior a 5.3.0.
- Perl: Algunos cambios cosméticos en la salida
- Perl: Escribir "DROP VIEW" en lugar de "DROP TABLE" al archivo de copia de seguridad si la tabla es una vista.
- Perl: Se agregó el tipo de tabla para registrar la salida.
Versión 1.24.3
Hemos abordado los siguientes temas:
- Configuración / Bases de datos / Parámetro de conexión: adición manual de bases de datos: El manejo interno fue completamente modificado. El archivo dbs_manual.php ya no es necesario. Las bases de datos añadidas manualmente se almacenan ahora en el perfil de configuración seleccionado.
- Protección de inicio / directorio: Corregido un error que invirtió el mensaje resultante de éxito / fracaso.
- Protección de inicio / directorio: Si falla la creación automática de la protección de directorio, el contenido mostrado en el archivo .htaccess que se va a crear manualmente contiene algún código html desordenado.
- Protección de inicio / directorio: El archivo .htaccess creado se extendió con "RewriteEngine off". Esto soluciona algunos problemas si MySQLDumper se instaló en una subcarpeta de un sitio web existente que también usaba archivos .htaccess con "mod_rewrite".
- Protección de inicio / directorio: Se revisó la funcionalidad para editar una protección existente.
- Inicio / Bases de datos: El estado clave se determinó de manera incompleta de modo que sólo se consideró el primer índice de cada tabla.
- SQL-Navegador / estructura de tabla: Se agregó la fila "comentario" en la visualización de campos e índices.
- SQL-Browser / estructura de tabla: Se revisó la funcionalidad para gestionar claves. Ahora es posible definir cualquier tipo de claves que estuviera limitada a las claves primarias.
- SQL-Browser: La tabla de sistema "information_schema" ahora se muestra y se puede navegar.
- SQL-Browser: Se ha corregido un error que podría impedir que la búsqueda funcione correctamente.
- SQL-Browser: Para algunas consultas el número de registros no se determinó correctamente.
- SQL-Browser: Registros que contienen el carácter "|" No se pudo editar en algunos casos.
- SQL-Browser: Se ha mejorado el manejo de errores.
- Restaurar: Al restaurar copias de seguridad que no se crearon con MySQLDumper, las sentencias CREATE DATABASE no fueron reconocidas correctamente.
- File-Administration / Backup Converter: Dentro del convertidor de copia de seguridad había una rutina de buggy que causó un mensaje de error.
- Backup / Perl: Cuando la opción de configuración "autodelete" fue activada y la carpeta work / backup contenía archivos no creados por MySQLDumper, el script perl crondump.pl emitió mensajes de advertencia.
- Perl: Mostrar versión de Perl, mejor manejo de errores, mejor fuente con html
- Perl: Se ha añadido soporte para FTP a través de SSL (NET :: FTPLL perl modul necesario).
- Perl: Los comandos SQL opcionales (Command Before / After) ahora pueden manejar varias consultas.
Versión 1.24.2
Hemos abordado los siguientes temas:
- Aunque MySQLDumper ignora los timeouts (tiempos fuera) de espera al cuidar el max_execution_time de PHP, puede suceder que construir el índice de una tabla grande conduzca a un tiempo de espera.
Ahora puede configurar MySQLDumper para ignorar las sentencias "ENABLE KEYS" mientras restaura una copia de seguridad. Pero recuerde habilitarlos manualmente después.
Esto se realiza en Inicio / Bases de datos / Seleccionar base de datos / Botón: Habilitar claves. Esta opción y un mensaje solo aparecerán si MySQLDumper detecta claves o índices inhabilitados.
- Cuando los sistemas usan el valor 0 para campos de auto_increment (por ejemplo, Magento), la restauración podría cambiar el valor que podría provocar que la aplicación funcione mal.
Mientras restaura MySQLDumper ahora establece el modo SQL como "NO_AUTO_VALUE_ON_ZERO" para la sesión de restauración.
- El script de Perl crondump.pl lanzó advertencias al realizar copias de seguridad de vistas.
- Al realizar una copia de seguridad a través del gui, la opción "optimizar tablas" no tiene ningún efecto debido a una consulta incompleta.
--------------------
Versión 1.24
Changelog de los cambios más importantes en comparación con la versión 1.22 (1.23 nunca dejó el estado beta):
- MySQLDumper 1.24 sigue trabajando en PHP4 y PHP5
- estilo nuevo, ligero y amistoso. El "viejo" estilo sigue siendo incluido.
- mejor uso de la RAM
- la copia de seguridad y restauración a través de PHP es aproximadamente un 25% más rápida
- posibilidad de seleccionar tablas al hacer una copia de seguridad o restauración
- utilizar diferentes perfiles de configuración para gestionar diferentes MySQL-Server o -user.
  De esta manera usted puede mantener diferentes MySQL-Server con un solo MySQLDumper-Instalación.
- el SQL-Parser interno se ha mejorado (más copias de seguridad de otros programas pueden ser importet)
- SQLBrowser: un montón de correcciones de errores y algunas mejoras (sin embargo, debe ser considerado como experimental)
- SQLBrowser: una cómoda búsqueda fulltext le permite encontrar texto incluso cuando no sabe en qué columna puede ocurrir
  Después de editar un registro volverá a la lista de resultados. Eso realmente es cómodo cuando se necesita cambiar los datos.
- Herramientas: en la versión 1.22 la exportación de datos como archivo no funcionó. Ahora está funcionando de nuevo.
- la GUI Web ha sido simplificada. Se han eliminado algunos parámetros. (Casi no tienes la oportunidad de configurar algo incorrectamente :))
- FTP-Transfer: direcciona hasta 3 configuraciones de ftp simultáneamente en un proceso de reserva
- Ahora se detectan las tablas de tipo VIEW o MEMORY y los datos no se guardan, pero la estructura de la tabla es
- el directorio de trabajo / estructura ya no es necesario
- se ha eliminado la copia de seguridad automática de "estructura única"
- mejor y más seguro manejo de las codificaciones de los archivos de copia de seguridad
- mejor y más seguro manejo de errores
- el convertidor de copia de seguridad ha sido reescrito. Ahora también convierte automáticamente archivos grandes en archivos Multipart.
- no hay avisos en los registros del servidor
- al agregar consultas SQL a la biblioteca de SQL, ahora puede introducir más de una consulta. Si utiliza "commadn antes / después de la copia de seguridad"
  Estas consultas se ejecutarán en una fila. Suces o falla se escribe en el archivo de registro.
- Al crear una protección por contraseña se visualiza la fuerza de la contraseña.
Crodump.pl:
- cuando se puede llamar a crondump.pl en el directorio estándar "msd_cron" ya no es necesario ingresar el
  "$ Absolute_path_of_configdir" manualmente. Se añadió una detección automática.
- una mejor y más segura captura de errores
- registro de eventos es mucho más preciso y le da declaraciones claras lo que sucedió
- la eliminación automática ahora considera archivos Multipart como una copia de seguridad completa y funciona de la manera que usted espera que funcione
- la eliminación automática se realiza después del proceso de copia de seguridad. En caso de errores, esto conserva las copias de seguridad antiguas que pueda necesitar.
- el parámetro de configuración - el perfil de configuración que se va a utilizar - se puede configurar de tres maneras. El sufijo faltante
  ".conf.php" se añadirá dinámicamente.
1. config = mysqldumper.conf.php
2. config = mysqdumper.conf
3. config = mysqldumper
- manipulador de señales eliminado:
Cuando crondump.pl se inició a través de un cronjob hubo un mal funcionamiento. En algunos, un servidor raro este manipulador de señales causó un segundo
O tercera instancia de la secuencia de comandos que nunca se detuvo y se quedó en la lista de procesos. En este caso el proceso debe ser eliminado manualmente.
... y muchos más pequeños o grandes correcciones de errores y la limpieza del código
Cuando quiera saber más, eche un vistazo al changelog de mis cambios de código en Sourceforge. Cada cambio
Del código se documenta aquí:
Http://mysqldumper.svn.sourceforge.net/viewvc/mysqldumper/trunk/?view=log

Datei anzeigen

@ -1,5 +1,96 @@
Installation:
- lade den Ordner mysqldumper in einen beliebeigen Ordner auf Deinen Webspace hoch
- Starte das Script im Browser (http://www.deineDomain.de/DeinOrdner/mysqldumper/)
- Folge den Installationsanweisungen
- lade den Ordner mysqldumper auf Deinen Webspace hoch
- gebe der Datei config.php die Rechte 777 (es ist nicht nötig die Datei config.php von Hand anzupassen! Das erledigt MySQLDumper während der Installation von alleine.)
- Starte das Script im Browser (http://www.deineDomain.de/mysqldumper/)
- Folge der Installation
- in Schritt 2 (Konfiguration) ändere die Daten (Host, Name, Passwort) der zu verwaltenden Datenbanken
- MySQLDumper benötigt zum Speichern der Backups verschiedene Unterordner, die mit den Rechten 0777 versehen werden müssen.
MySQLDumper erstellt diese Verzeichnisse automatisch.
Sollte der Webserver mit dem Einstellung "safe_mode=on" konfiguriert sein (und nur dann! - Ansonsten kannst Du diesen Punkt überspringen. Solltest Du Dir nicht sicher sein, so meldet Dir MySQLDumper dies während der Installation aber auch zuverlässig), so kann MySQLDUmper die Verzeichnisse aufgrund der Serverbeschränkung nicht selbstständig anlegen.
Im Falle von safe_mode=on müssen folgende Ordner von Dir manuell mit Deinem FTP-Programm erstellt und mit den Rechten (CHMOD) 0777 versehen werden:
- work
- work/backup
- work/config
- work/structure
- work/log
("work/backup" bedeutet, dass im Ordner "work" ein Unterverzeichnis "backup" erstellt wird)
- Da wir wissen, dass sich viele User nicht die Mühe machen diese ReadMe-Datei zu lesen, werden alle Einstellungen
vom MySQLDumper gewissenhaft überprüft und bei Nicht-Erfüllung jeweils eine entsprechende Bildschirmausgabe gemacht. ;-)
- Fertig ! Jetzt kann MySQLDUmper im Browser über http://www.DeineDomain/Dein_MySQLDumper-Verzeichnis/ aufgerufen werden
-------------------
Verzeichnisschutz erstellen:
Es ist dringend erforderlich den MySQLDUmper vor Fremdzugriffen zu schützen!!!
Jeder, der Zugriff zum MySQLDUmper hat, kann in der Datenbank beliebige SQL-Befehle ausführen,
die Daten herunterladen oder einfach alle Daten der Datenbank löschen.
Deshalb sollte jeder das MySQLDumper-Verzeichnis durch einen Verzeichnisschutz schützen.
Dies geschieht über eine sogenannte .htaccess-Datei, welche den besten Schutz bietet.
Glücklicherweise bietet MySQLDumper eine eigene Routine, um einen Verzeichnisschutz zu erstellen.
Es gibt aber so viele unterschiedliche Verfahren einen Webserver zu konfigurieren, dass die
automatische Erstellung nicht immer klappt. Dies merkt der Dumper aber und teilt das auch mit.
Sollte Dir MySQLDumepr mitteilen, dass das Anlegen des Schutzes nicht funktioniert hat udn Dich auffordern
manuell eine Datei anzulegen, dann versuche folgendes:
- gebe dem Hauptverzeichnis des MySQLDumpers mit Deinem FTP-Programm die Rechte 0777
- starte MySQLDUmper in Deinem Browser und versuche erneut einen Schutz zu erstellen
- die Angabe der Verschlüsselungsart bezieht sich auf das Betriebssystem des Serers Deines Webspaces! Nicht auf Dein lokales Betriebssystem. In 99% aller Fälle ist die voreingestellte Verschlüsselungsart "Linux und Unix-Systeme (Crypt)" richtig! Ändere diese nur, wenn Du genau weißt, dass Dein Webserver (!) auf Windows läuft
- nun sollte der Verzeichnisschutz korrekt erstellt werden. Du merkst das daran, dass Du beim nächsten Seitenaufruf
nach den Zugangsdaten gefragt wirst.
- solltest Du nicht nach den Zugangsdaten gefragt werden, so realisiert Dein Hoster den Verzeichnisschutz auf eine andere Art und Weise. Erkundige Dich bei Deinem Hoster, wie man auf seinem Server einen Verzeichnisschutz erstellen kann.
- solltest Du immer wieder nach den Zugangsdaten gefragt werden udn diese nicht anerkannt werden, so hast Du die falsche Verschlüsselungsart gewählt. Lösche dann die Dateien .htaccess und .htpasswd im MySQLDumper-Hauptordner - dann bekommst Du wieder Zugriff. Dummerweise gibt es aber auch Hoster
Anleitung für das Perlskript:
Wer Perl in allen Verzeichnissen ausführen kann, dem reichen folgende Schritte:
1. Rufe im MySQLDumper die Seite Backup auf.
2. Kopiere den Pfad, der hinter Eintrag in crondump.pl für $absolute_path_of_configdir: steht.
3. öffne die Datei "crondump.pl" im Editor
4. trage den kopierten Pfad dort bei absolute_path_of_configdir ein (keine Leerzeichen)
5. Speicher crondump.pl
6. gebe den Datein die Rechte 755
6b. Wenn die Endung cgi gewünscht ist, ändere bei allen 3 Dateien die Endung von pl -> cgi (umbenennen)
(ev. 10b+11 von oben)
Fertig.
--------------------
Wenn bei Dir Perl nur innerhalb des Verzeichnisses "cgi-bin" ausgeführt werden kann:
1. Rufe im MySQLDumper die Seite Backup auf und klicke auf "Backup Perl".
2. Kopiere den Pfad, der hinter Eintrag in crondump.pl für $absolute_path_of_configdir: steht.
3. öffne die Datei "crondump.pl" im Editor
4. trage den kopierten Pfad dort bei absolute_path_of_configdir ein (keine Leerzeichen)
5. Speicher crondump.pl
6. kopiere crondump.pl, sowie perltest.pl und simpletest.pl ins cgi-bin-Verzeichnis (Ascii-Modus im FTP)
7. gebe den Dateien die Rechte 755
7b. Wenn die Endung cgi gewünscht ist, ändere bei allen 3 Dateien die Endung von pl -> cgi (umbenennen)
8. Rufe die Konfiguration im MySQLDumper auf
9. wähle Seite Cronscript
10. ändere Perl Ausführungspfad in /cgi-bin/
10b. wenn die Scripte .pl haben, ändere die Dateiendung auf .cgi
11. speicher die Konfiuguration
------------------------
fertig, die Skripte lassen sich nun von der Backupseite aufrufen
Windowsuser müssen bei allen Scripten die erste Zeile ändern, dort steht der Pfad von Perl. Beispiel:
statt: #!/usr/bin/perl -w
jetzt #!C:\perl\bin\perl.exe -w

Datei anzeigen

@ -1,5 +1,70 @@
Installation:
- upload the folder mysqldumper to any folder on your webspace
- start the script in your browser (http://www.yourDomain.de/yourFolder/mysqldumper/)
- Follow the Installation assistent
- upload the folder mysqldumper to your webspace
- chmod the file "config.php" to 777
- start the script in your browser (http://www.deineDomain.de/mysqldumper/)
- Follow the Installationscript
- in step 2 (Configuration) change Data (Host, Name, Password) of your databaseconnection and save
- in case of safe_mode=1 you must create the folders manually.
create following folders in the Scriptdir:
- work
- work/backup
- work/config
- work/structure
- work/log
and chmod these folders to 0777
- Ready !
Guidance for the Perl script:
When you can execute Perl anywhere:
1. In MySQLDumper switch to the page Backup.
2. Copy the path, that stands behind entry in crondump.pl for $absolute_path_of_configdir:
3. open the file "crondump.pl" in the editor
4. paste the copied path there to the $absolute_path_of_configdir-variable (no blanks,no new line)
5. Save crondump.pl
6. chmod the scripts to 0755.
7. If the ending .cgi is desired, change the ending of all 3 files from .pl to .cgi (rename)
8. If the Scripts are renamed to *.cgi , change Fileextension to cgi in the MySQLDumper Configuration (cronscript)
Done.
--------------------------------------
When perl is only allowed in cgi-bin:
Many user have a cgi-bin directory, in which Perl can be executed.
This is usually available via Browser http://www.domain.com/cgi-bin/ .
In this casse do the following steps:
1. in MySQLDumper call the page Backup and click "Backup Perl".
2. Copy the path, that stands behind entry in crondump.pl for $absolute_path_of_configdir:
3. open the file "crondump.pl" in the editor
4. paste the copied path there with absolute_path_of_configdir (no blanks, no new line)
5. Save crondump.pl
6. copy crondump.pl, as well as perltest.pl and simpletest.pl to the cgi-bin directory (ASCII mode in the ftp-client!)
7. chmod 755 the scripts to 0755.
7b. If the ending cgi is desired, change the ending of all 3 files .pl to .cgi (rename)
8. in MySQLDumper switch to the page Configuration
9. click on Cronscript
10. change the Perl execution path to /cgi-bin/ or ./../cgi-bin (depending on your file-structure. Path is relative from MSD-Dir)
10b. if the Scripts are renamed to *.cgi , change Fileextension to cgi
11 save the Configuration
-------------------------------------
Ready ! The scripts are now available from the Page "Backup".
Windowsuser must change the first line of all Perlscripts, to the path of Perl.
Example:
instead of: #!/usr/bin/perl w
now #!C:\perl\bin\perl.exe w

Datei anzeigen

@ -1,6 +0,0 @@
Instalación:
- Descargue la carpeta MySQLDumper en su espacio web
- Cambie los derechos de config.php a 777
- Navegue a su sitio (por ejemplo: http://www.su_sitio_de_internet.mx/mysqldumper/)
- Sigue la instalación

Datei anzeigen

@ -1,6 +1,71 @@
Installation:
- Envoyer le r<EFBFBD>pertoire "mysqldumper" sur votre serveur
- Envoyer le répertoire "mysqldumper" sur votre serveur
- Chmoder le fichier "config.php" en 777
- D<EFBFBD>buter le script en saisissant l'adresse suivante dans votre navigateur (http://www.votre_domaine.fr/mysqldumper/)
- Débuter le script en saisissant l'adresse suivante dans votre navigateur (http://www.votre_domaine.fr/mysqldumper/)
- Suivez les instructions d'installation du script
- Dans l'étape 2 (Configuration), changer les données (Serveur, Nom, Mot de passe) par ceux fournis par votre hébergeur puis sauvegardez
- Si pour votre serveur le safe_mode=1 vous devez créer manuellement les répertoires suivants:
créer les répertoires ci-dessous dans le répertoire du Script (mysqldumper/):
- work
- work/backup
- work/config
- work/structure
- work/log
et Chmoder ces répertoires en 0777
- C'est fini !
Guide pour le script Perl:
Si vous pouvez exécuter Perl de tous les fichiers, il vous suffit de suivre les étapes suivantes:
1. Appeler dans MySQLDumper la page 'Sauvegarde' et cliquer "Backup Perl".
2. Copier le chemin qui se trouve derrière le texte: crondump.pl pour $absolute_path_of_configdir:
3. Ouvrir le fichier "crondump.pl" dans un éditeur
4. et transmettre le chemin que vous avez copié près de absolute_path_of_configdir (sans espace)
5. Sauvegarder crondump.pl
6. Donner les droits CHMOD 755
7. Si l'extension .cgi est désirée, changer pour les trois fichiers l'extension de .pl vers .cgi (action renommer)
8. Si le script est renommé en *.cgi, changer l'extension du fichier en cgi dans la configuration MySQLDumper (cronscript)
-C'est fini !
--------------------------------------
Quand perl est seulement laissé dans cgi-bin:
La plupart ont un répertoire cgi-bin, qui permet d'exécuter en Perl.
Vous pouvez y accéder dans la majeur partie des cas en saisissant l'adresse suivante dans votre navigateur http://www.domaine.com/cgi-bin/.
Dans ce cas veuillez suivre les étapes suivantes:
1. Appeler la page 'Sauvegarde' dans MySQLDumper.
2. Copier le chemin qui se trouve derrière le texte: crondump.pl pour $absolute_path_of_configdir:
3. Ouvrir le fichier "crondump.pl" dans un éditeur
4. et transmettre le chemin que vous venez de copier près de absolute_path_of_configdir (sans espace)
5. Sauvegarder crondump.pl
6. Copier crondump.pl, ainsi que perltest.pl et simpletest.pl dans le répertoire cgi-bin (Mode-ASCII par FTP)
7. Donner les droits CHMOD 755
7b. Si l'extension .cgi est désirée, changer pour les trois fichiers l'extension de .pl vers .cgi (action renommer)
8. Appeller la configuraion dans MySQLDumper
9. Choisir la page script Cron
10. Changer le chemin d'exécution Perl vers /cgi-bin/ou ./../cgi-bin (depend de la structure fichiers. Le chemin est relatif de MSD-Dir)
10b. Si les scripts ont l'extension .cgi, changer l'extension vers .cgi
11. et sauvegarder la configuration
Voila, c'est terminé, les scripts s'exécutent maintenant d'après la page de sauvegarde.
----------------------------------------------------------------------------------
Les utilisateurs de windows doivent changer la première ligne de tous les scripts de Perls, avec le chemin de Perl.
Exemple:
Au lieu de: #!/usr/bin/perl w
Mettre #!C:\perl\bin\perl.exe w

Datei anzeigen

@ -3,4 +3,63 @@ Installazione:
- carica la cartella mysqldumper sul tuo spazio web
- metti i diritti del file config.php a 777
- fai partire lo script nel tuo Browser (http://www.il tuo dominio.it/mysqldumper/)
- segui la installazione
- segui la installazione
- nel secondo passo (configurazione) cambia i tuoi dati (Host, nome, password) della banca dati da gestire
- nel caso di safe_mode=1 dovete creare le cartelle manualmente.
crea nella cartella di MySQLDumper le cartelle
- works
- works/backup
- works/config
- works/sturcture
- works/log
metti i diritti delle cartelle a 777
- finito !
Istruzioni Perlskript:
Molti hanno un elenco con cartella cgi-bin in cui puo essere efettuato Perl.
A maggior parte dei casi questo e raggingibile tramite Browser http://www.domain.de/cgi-bin/.
Chi puo usare Perl in tutti gli elenchi deve seguire semplicemente i seguenti passi:
1. Chiama nel MySQLDumper la pagina Backup.
2. Copia il cammino, che è scritto nella crondump.pl per $absolute_path_of_configdir.
3. Apri il dato "crondump.pl" in editor
4. Porta il cammino dove c`è absolute_path_of_configdir (senza spazi)
5. Salva crondump.pl
6. Metti i permessi dei dati a CHMOD 755
6b. Se preferite cgi, cambiate tutti i 3 dati da pl -> cgi (rinominare)
(ev. 10b+11 da sopra)
finito.
---------------------
Nel caso che puoi effettuare Perl in "cgi-bin"consigliamo di effettuare i seguenti passi:
1. Chiama nel MySQLDumper la pagina Backup e clicca "Backup Perl".
2. Copia il cammino, che è scritto nella crondump.pl per $absolute_path_of_configdir:
3. Apri il dato "crondump.pl" in editor
4. Porta il cammino dove c`è absolute_path_of_configdir (senza spazi)
5. Salva crondump.pl
6. Copia crondump.pl, perltest.pl e simpletest.pl nel elenco cgi-bin (nel modo Ascii con FTP)
7. Metti i permessi dei dati in CHMOD 755
7b. Se preferite cgi come nome del dato, allora cambiate tutti i 3 dati da pl -> cgi (rinominare)
8. Chiama la configurazione nel MySQLDumper
9. Scegli la pagina Cronscript
10. Cambia l`esecuzione di cammino di Perl in /cgi-bin/
10b.Se gli script hanno .pl, cambiali in .cgi
11. Salva la configurazione.
---------------------
Hai finito, i tuoi script si fanno caricare nella tua pagina backup.
Se usate Windows dovete cambiare in tutti i dati la prima riga; dove trovate il cammino di Perl. Esempio:
aposto di: #!/usr/bin/perl -w
adesso #!C:\perl\bin\perl.exe -w

Datei anzeigen

@ -1,105 +1,105 @@
GNU General Public License
Deutsche Übersetzung der Version 2, Juni 1991
Deutsche Übersetzung der Version 2, Juni 1991
Copyright © 1989, 1991 Free Software Foundation, Inc.
Copyright © 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Diese Übersetzung ist kein rechtskräftiger Ersatz für die englischsprachige Originalversion!
Diese Übersetzung ist kein rechtskräftiger Ersatz für die englischsprachige Originalversion!
Vorwort
Die meisten Softwarelizenzen sind daraufhin entworfen worden, Ihnen die Freiheit zu nehmen, die Software weiterzugeben und zu verändern. Im Gegensatz dazu soll Ihnen die GNU General Public License , die Allgemeine Öffentliche GNU-Lizenz, ebendiese Freiheit garantieren. Sie soll sicherstellen, daß die Software für alle Benutzer frei ist. Diese Lizenz gilt für den Großteil der von der Free Software Foundation herausgegebenen Software und für alle anderen Programme, deren Autoren ihr Datenwerk dieser Lizenz unterstellt haben. Auch Sie können diese Möglichkeit der Lizenzierung für Ihre Programme anwenden. (Ein anderer Teil der Software der Free Software Foundation unterliegt stattdessen der GNU Library General Public License , der Allgemeinen Öffentlichen GNU-Lizenz für Bibliotheken.) [Mittlerweile wurde die GNU Library Public License von der GNU Lesser Public License abgelöst - Anmerkung des Übersetzers.]
Die meisten Softwarelizenzen sind daraufhin entworfen worden, Ihnen die Freiheit zu nehmen, die Software weiterzugeben und zu verändern. Im Gegensatz dazu soll Ihnen die GNU General Public License , die Allgemeine Öffentliche GNU-Lizenz, ebendiese Freiheit garantieren. Sie soll sicherstellen, daß die Software für alle Benutzer frei ist. Diese Lizenz gilt für den Großteil der von der Free Software Foundation herausgegebenen Software und für alle anderen Programme, deren Autoren ihr Datenwerk dieser Lizenz unterstellt haben. Auch Sie können diese Möglichkeit der Lizenzierung für Ihre Programme anwenden. (Ein anderer Teil der Software der Free Software Foundation unterliegt stattdessen der GNU Library General Public License , der Allgemeinen Öffentlichen GNU-Lizenz für Bibliotheken.) [Mittlerweile wurde die GNU Library Public License von der GNU Lesser Public License abgelöst - Anmerkung des Übersetzers.]
Die Bezeichnung ,,freie`` Software bezieht sich auf Freiheit, nicht auf den Preis. Unsere Lizenzen sollen Ihnen die Freiheit garantieren, Kopien freier Software zu verbreiten (und etwas für diesen Service zu berechnen, wenn Sie möchten), die Möglichkeit, die Software im Quelltext zu erhalten oder den Quelltext auf Wunsch zu bekommen. Die Lizenzen sollen garantieren, daß Sie die Software ändern oder Teile davon in neuen freien Programmen verwenden dürfen - und daß Sie wissen, daß Sie dies alles tun dürfen.
Die Bezeichnung ,,freie`` Software bezieht sich auf Freiheit, nicht auf den Preis. Unsere Lizenzen sollen Ihnen die Freiheit garantieren, Kopien freier Software zu verbreiten (und etwas für diesen Service zu berechnen, wenn Sie möchten), die Möglichkeit, die Software im Quelltext zu erhalten oder den Quelltext auf Wunsch zu bekommen. Die Lizenzen sollen garantieren, daß Sie die Software ändern oder Teile davon in neuen freien Programmen verwenden dürfen - und daß Sie wissen, daß Sie dies alles tun dürfen.
Um Ihre Rechte zu schützen, müssen wir Einschränkungen machen, die es jedem verbieten, Ihnen diese Rechte zu verweigern oder Sie aufzufordern, auf diese Rechte zu verzichten. Aus diesen Einschränkungen folgen bestimmte Verantwortlichkeiten für Sie, wenn Sie Kopien der Software verbreiten oder sie verändern.
Um Ihre Rechte zu schützen, müssen wir Einschränkungen machen, die es jedem verbieten, Ihnen diese Rechte zu verweigern oder Sie aufzufordern, auf diese Rechte zu verzichten. Aus diesen Einschränkungen folgen bestimmte Verantwortlichkeiten für Sie, wenn Sie Kopien der Software verbreiten oder sie verändern.
Beispielsweise müssen Sie den Empfängern alle Rechte gewähren, die Sie selbst haben, wenn Sie - kostenlos oder gegen Bezahlung - Kopien eines solchen Programms verbreiten. Sie müssen sicherstellen, daß auch die Empfänger den Quelltext erhalten bzw. erhalten können. Und Sie müssen ihnen diese Bedingungen zeigen, damit sie ihre Rechte kennen.
Beispielsweise müssen Sie den Empfängern alle Rechte gewähren, die Sie selbst haben, wenn Sie - kostenlos oder gegen Bezahlung - Kopien eines solchen Programms verbreiten. Sie müssen sicherstellen, daß auch die Empfänger den Quelltext erhalten bzw. erhalten können. Und Sie müssen ihnen diese Bedingungen zeigen, damit sie ihre Rechte kennen.
Wir schützen Ihre Rechte in zwei Schritten: (1) Wir stellen die Software unter ein Urheberrecht (Copyright), und (2) wir bieten Ihnen diese Lizenz an, die Ihnen das Recht gibt, die Software zu vervielfältigen, zu verbreiten und/oder zu verändern.
Wir schützen Ihre Rechte in zwei Schritten: (1) Wir stellen die Software unter ein Urheberrecht (Copyright), und (2) wir bieten Ihnen diese Lizenz an, die Ihnen das Recht gibt, die Software zu vervielfältigen, zu verbreiten und/oder zu verändern.
Um die Autoren und uns zu schützen, wollen wir darüberhinaus sicherstellen, daß jeder erfährt, daß für diese freie Software keinerlei Garantie besteht. Wenn die Software von jemand anderem modifiziert und weitergegeben wird, möchten wir, daß die Empfänger wissen, daß sie nicht das Original erhalten haben, damit irgendwelche von anderen verursachte Probleme nicht den Ruf des ursprünglichen Autors schädigen.
Um die Autoren und uns zu schützen, wollen wir darüberhinaus sicherstellen, daß jeder erfährt, daß für diese freie Software keinerlei Garantie besteht. Wenn die Software von jemand anderem modifiziert und weitergegeben wird, möchten wir, daß die Empfänger wissen, daß sie nicht das Original erhalten haben, damit irgendwelche von anderen verursachte Probleme nicht den Ruf des ursprünglichen Autors schädigen.
Schließlich und endlich ist jedes freie Programm permanent durch Software-Patente bedroht. Wir möchten die Gefahr ausschließen, daß Distributoren eines freien Programms individuell Patente lizensieren - mit dem Ergebnis, daß das Programm proprietär würde. Um dies zu verhindern, haben wir klargestellt, daß jedes Patent entweder für freie Benutzung durch jedermann lizenziert werden muß oder überhaupt nicht lizenziert werden darf.
Schließlich und endlich ist jedes freie Programm permanent durch Software-Patente bedroht. Wir möchten die Gefahr ausschließen, daß Distributoren eines freien Programms individuell Patente lizensieren - mit dem Ergebnis, daß das Programm proprietär würde. Um dies zu verhindern, haben wir klargestellt, daß jedes Patent entweder für freie Benutzung durch jedermann lizenziert werden muß oder überhaupt nicht lizenziert werden darf.
Es folgen die genauen Bedingungen für die Vervielfältigung, Verbreitung und Bearbeitung:
Es folgen die genauen Bedingungen für die Vervielfältigung, Verbreitung und Bearbeitung:
Allgemeine Öffentliche GNU-Lizenz
Bedingungen für die Vervielfältigung,
Allgemeine Öffentliche GNU-Lizenz
Bedingungen für die Vervielfältigung,
Verbreitung und Bearbeitung
§0. Diese Lizenz gilt für jedes Programm und jedes andere Datenwerk, in dem ein entsprechender Vermerk des Copyright-Inhabers darauf hinweist, daß das Datenwerk unter den Bestimmungen dieser General Public License verbreitet werden darf. Im folgenden wird jedes derartige Programm oder Datenwerk als ,,das Programm`` bezeichnet; die Formulierung ,,auf dem Programm basierendes Datenwerk`` bezeichnet das Programm sowie jegliche Bearbeitung des Programms im urheberrechtlichen Sinne, also ein Datenwerk, welches das Programm, auch auszugsweise, sei es unverändert oder verändert und/oder in eine andere Sprache übersetzt, enthält. (Im folgenden wird die Übersetzung ohne Einschränkung als ,,Bearbeitung`` eingestuft.) Jeder Lizenznehmer wird im folgenden als ,,Sie`` angesprochen.
§0. Diese Lizenz gilt für jedes Programm und jedes andere Datenwerk, in dem ein entsprechender Vermerk des Copyright-Inhabers darauf hinweist, daß das Datenwerk unter den Bestimmungen dieser General Public License verbreitet werden darf. Im folgenden wird jedes derartige Programm oder Datenwerk als ,,das Programm`` bezeichnet; die Formulierung ,,auf dem Programm basierendes Datenwerk`` bezeichnet das Programm sowie jegliche Bearbeitung des Programms im urheberrechtlichen Sinne, also ein Datenwerk, welches das Programm, auch auszugsweise, sei es unverändert oder verändert und/oder in eine andere Sprache übersetzt, enthält. (Im folgenden wird die Übersetzung ohne Einschränkung als ,,Bearbeitung`` eingestuft.) Jeder Lizenznehmer wird im folgenden als ,,Sie`` angesprochen.
Andere Handlungen als Vervielfältigung, Verbreitung und Bearbeitung werden von dieser Lizenz nicht berührt; sie fallen nicht in ihren Anwendungsbereich. Der Vorgang der Ausführung des Programms wird nicht eingeschränkt, und die Ausgaben des Programms unterliegen dieser Lizenz nur, wenn der Inhalt ein auf dem Programm basierendes Datenwerk darstellt (unabhängig davon, daß die Ausgabe durch die Ausführung des Programmes erfolgte). Ob dies zutrifft, hängt von den Funktionen des Programms ab.
Andere Handlungen als Vervielfältigung, Verbreitung und Bearbeitung werden von dieser Lizenz nicht berührt; sie fallen nicht in ihren Anwendungsbereich. Der Vorgang der Ausführung des Programms wird nicht eingeschränkt, und die Ausgaben des Programms unterliegen dieser Lizenz nur, wenn der Inhalt ein auf dem Programm basierendes Datenwerk darstellt (unabhängig davon, daß die Ausgabe durch die Ausführung des Programmes erfolgte). Ob dies zutrifft, hängt von den Funktionen des Programms ab.
§1. Sie dürfen auf beliebigen Medien unveränderte Kopien des Quelltextes des Programms, wie sie ihn erhalten haben, anfertigen und verbreiten. Voraussetzung hierfür ist, daß Sie mit jeder Kopie einen entsprechenden Copyright-Vermerk sowie einen Haftungsausschluß veröffentlichen, alle Vermerke, die sich auf diese Lizenz und das Fehlen einer Garantie beziehen, unverändert lassen und desweiteren allen anderen Empfängern des Programms zusammen mit dem Programm eine Kopie dieser Lizenz zukommen lassen.
§1. Sie dürfen auf beliebigen Medien unveränderte Kopien des Quelltextes des Programms, wie sie ihn erhalten haben, anfertigen und verbreiten. Voraussetzung hierfür ist, daß Sie mit jeder Kopie einen entsprechenden Copyright-Vermerk sowie einen Haftungsausschluß veröffentlichen, alle Vermerke, die sich auf diese Lizenz und das Fehlen einer Garantie beziehen, unverändert lassen und desweiteren allen anderen Empfängern des Programms zusammen mit dem Programm eine Kopie dieser Lizenz zukommen lassen.
Sie dürfen für den eigentlichen Kopiervorgang eine Gebühr verlangen. Wenn Sie es wünschen, dürfen Sie auch gegen Entgeld eine Garantie für das Programm anbieten.
Sie dürfen für den eigentlichen Kopiervorgang eine Gebühr verlangen. Wenn Sie es wünschen, dürfen Sie auch gegen Entgeld eine Garantie für das Programm anbieten.
§2. Sie dürfen Ihre Kopie(n) des Programms oder eines Teils davon verändern, wodurch ein auf dem Programm basierendes Datenwerk entsteht; Sie dürfen derartige Bearbeitungen unter den Bestimmungen von Paragraph 1 vervielfältigen und verbreiten, vorausgesetzt, daß zusätzlich alle im folgenden genannten Bedingungen erfüllt werden:
§2. Sie dürfen Ihre Kopie(n) des Programms oder eines Teils davon verändern, wodurch ein auf dem Programm basierendes Datenwerk entsteht; Sie dürfen derartige Bearbeitungen unter den Bestimmungen von Paragraph 1 vervielfältigen und verbreiten, vorausgesetzt, daß zusätzlich alle im folgenden genannten Bedingungen erfüllt werden:
1.
Sie müssen die veränderten Dateien mit einem auffälligen Vermerk versehen, der auf die von Ihnen vorgenommene Modifizierung und das Datum jeder Änderung hinweist.
Sie müssen die veränderten Dateien mit einem auffälligen Vermerk versehen, der auf die von Ihnen vorgenommene Modifizierung und das Datum jeder Änderung hinweist.
2.
Sie müssen dafür sorgen, daß jede von Ihnen verbreitete oder veröffentlichte Arbeit, die ganz oder teilweise von dem Programm oder Teilen davon abgeleitet ist, Dritten gegenüber als Ganzes unter den Bedingungen dieser Lizenz ohne Lizenzgebühren zur Verfügung gestellt wird.
Sie müssen dafür sorgen, daß jede von Ihnen verbreitete oder veröffentlichte Arbeit, die ganz oder teilweise von dem Programm oder Teilen davon abgeleitet ist, Dritten gegenüber als Ganzes unter den Bedingungen dieser Lizenz ohne Lizenzgebühren zur Verfügung gestellt wird.
3.
Wenn das veränderte Programm normalerweise bei der Ausführung interaktiv Kommandos einliest, müssen Sie dafür sorgen, daß es, wenn es auf dem üblichsten Wege für solche interaktive Nutzung gestartet wird, eine Meldung ausgibt oder ausdruckt, die einen geeigneten Copyright-Vermerk enthält sowie einen Hinweis, daß es keine Gewährleistung gibt (oder anderenfalls, daß Sie Garantie leisten), und daß die Benutzer das Programm unter diesen Bedingungen weiter verbreiten dürfen. Auch muß der Benutzer darauf hingewiesen werden, wie er eine Kopie dieser Lizenz ansehen kann. (Ausnahme: Wenn das Programm selbst interaktiv arbeitet, aber normalerweise keine derartige Meldung ausgibt, muß Ihr auf dem Programm basierendes Datenwerk auch keine solche Meldung ausgeben).
Wenn das veränderte Programm normalerweise bei der Ausführung interaktiv Kommandos einliest, müssen Sie dafür sorgen, daß es, wenn es auf dem üblichsten Wege für solche interaktive Nutzung gestartet wird, eine Meldung ausgibt oder ausdruckt, die einen geeigneten Copyright-Vermerk enthält sowie einen Hinweis, daß es keine Gewährleistung gibt (oder anderenfalls, daß Sie Garantie leisten), und daß die Benutzer das Programm unter diesen Bedingungen weiter verbreiten dürfen. Auch muß der Benutzer darauf hingewiesen werden, wie er eine Kopie dieser Lizenz ansehen kann. (Ausnahme: Wenn das Programm selbst interaktiv arbeitet, aber normalerweise keine derartige Meldung ausgibt, muß Ihr auf dem Programm basierendes Datenwerk auch keine solche Meldung ausgeben).
Diese Anforderungen gelten für das bearbeitete Datenwerk als Ganzes. Wenn identifizierbare Teile des Datenwerkes nicht von dem Programm abgeleitet sind und vernünftigerweise als unabhängige und eigenständige Datenwerke für sich selbst zu betrachten sind, dann gelten diese Lizenz und ihre Bedingungen nicht für die betroffenen Teile, wenn Sie diese als eigenständige Datenwerke weitergeben. Wenn Sie jedoch dieselben Abschnitte als Teil eines Ganzen weitergeben, das ein auf dem Programm basierendes Datenwerk darstellt, dann muß die Weitergabe des Ganzen nach den Bedingungen dieser Lizenz erfolgen, deren Bedingungen für weitere Lizenznehmer somit auf das gesamte Ganze ausgedehnt werden - und somit auf jeden einzelnen Teil, unabhängig vom jeweiligen Autor.
Diese Anforderungen gelten für das bearbeitete Datenwerk als Ganzes. Wenn identifizierbare Teile des Datenwerkes nicht von dem Programm abgeleitet sind und vernünftigerweise als unabhängige und eigenständige Datenwerke für sich selbst zu betrachten sind, dann gelten diese Lizenz und ihre Bedingungen nicht für die betroffenen Teile, wenn Sie diese als eigenständige Datenwerke weitergeben. Wenn Sie jedoch dieselben Abschnitte als Teil eines Ganzen weitergeben, das ein auf dem Programm basierendes Datenwerk darstellt, dann muß die Weitergabe des Ganzen nach den Bedingungen dieser Lizenz erfolgen, deren Bedingungen für weitere Lizenznehmer somit auf das gesamte Ganze ausgedehnt werden - und somit auf jeden einzelnen Teil, unabhängig vom jeweiligen Autor.
Somit ist es nicht die Absicht dieses Abschnittes, Rechte für Datenwerke in Anspruch zu nehmen oder Ihnen die Rechte für Datenwerke streitig zu machen, die komplett von Ihnen geschrieben wurden; vielmehr ist es die Absicht, die Rechte zur Kontrolle der Verbreitung von Datenwerken, die auf dem Programm basieren oder unter seiner auszugsweisen Verwendung zusammengestellt worden sind, auszuüben.
Somit ist es nicht die Absicht dieses Abschnittes, Rechte für Datenwerke in Anspruch zu nehmen oder Ihnen die Rechte für Datenwerke streitig zu machen, die komplett von Ihnen geschrieben wurden; vielmehr ist es die Absicht, die Rechte zur Kontrolle der Verbreitung von Datenwerken, die auf dem Programm basieren oder unter seiner auszugsweisen Verwendung zusammengestellt worden sind, auszuüben.
Ferner bringt auch das einfache Zusammenlegen eines anderen Datenwerkes, das nicht auf dem Programm basiert, mit dem Programm oder einem auf dem Programm basierenden Datenwerk auf ein- und demselben Speicher- oder Vertriebsmedium dieses andere Datenwerk nicht in den Anwendungsbereich dieser Lizenz.
§3. Sie dürfen das Programm (oder ein darauf basierendes Datenwerk gemäß Paragraph 2) als Objectcode oder in ausführbarer Form unter den Bedingungen der Paragraphen 1 und 2 kopieren und weitergeben - vorausgesetzt, daß Sie außerdem eine der folgenden Leistungen erbringen:
§3. Sie dürfen das Programm (oder ein darauf basierendes Datenwerk gemäß Paragraph 2) als Objectcode oder in ausführbarer Form unter den Bedingungen der Paragraphen 1 und 2 kopieren und weitergeben - vorausgesetzt, daß Sie außerdem eine der folgenden Leistungen erbringen:
1.
Liefern Sie das Programm zusammen mit dem vollständigen zugehörigen maschinenlesbaren Quelltext auf einem für den Datenaustausch üblichen Medium aus, wobei die Verteilung unter den Bedingungen der Paragraphen 1 und 2 erfolgen muß. Oder:
Liefern Sie das Programm zusammen mit dem vollständigen zugehörigen maschinenlesbaren Quelltext auf einem für den Datenaustausch üblichen Medium aus, wobei die Verteilung unter den Bedingungen der Paragraphen 1 und 2 erfolgen muß. Oder:
2.
Liefern Sie das Programm zusammen mit einem mindestens drei Jahre lang gültigen schriftlichen Angebot aus, jedem Dritten eine vollständige maschinenlesbare Kopie des Quelltextes zur Verfügung zu stellen - zu nicht höheren Kosten als denen, die durch den physikalischen Kopiervorgang anfallen -, wobei der Quelltext unter den Bedingungen der Paragraphen 1 und 2 auf einem für den Datenaustausch üblichen Medium weitergegeben wird. Oder:
Liefern Sie das Programm zusammen mit einem mindestens drei Jahre lang gültigen schriftlichen Angebot aus, jedem Dritten eine vollständige maschinenlesbare Kopie des Quelltextes zur Verfügung zu stellen - zu nicht höheren Kosten als denen, die durch den physikalischen Kopiervorgang anfallen -, wobei der Quelltext unter den Bedingungen der Paragraphen 1 und 2 auf einem für den Datenaustausch üblichen Medium weitergegeben wird. Oder:
3.
Liefern Sie das Programm zusammen mit dem schriftlichen Angebot der Zurverfügungstellung des Quelltextes aus, das Sie selbst erhalten haben. (Diese Alternative ist nur für nicht-kommerzielle Verbreitung zulässig und nur, wenn Sie das Programm als Objectcode oder in ausführbarer Form mit einem entsprechenden Angebot gemäß Absatz b erhalten haben.)
Liefern Sie das Programm zusammen mit dem schriftlichen Angebot der Zurverfügungstellung des Quelltextes aus, das Sie selbst erhalten haben. (Diese Alternative ist nur für nicht-kommerzielle Verbreitung zulässig und nur, wenn Sie das Programm als Objectcode oder in ausführbarer Form mit einem entsprechenden Angebot gemäß Absatz b erhalten haben.)
Unter dem Quelltext eines Datenwerkes wird diejenige Form des Datenwerkes verstanden, die für Bearbeitungen vorzugsweise verwendet wird. Für ein ausführbares Programm bedeutet ,,der komplette Quelltext``: Der Quelltext aller im Programm enthaltenen Module einschließlich aller zugehörigen Modulschnittstellen-Definitionsdateien sowie der zur Compilation und Installation verwendeten Skripte. Als besondere Ausnahme jedoch braucht der verteilte Quelltext nichts von dem zu enthalten, was üblicherweise (entweder als Quelltext oder in binärer Form) zusammen mit den Hauptkomponenten des Betriebssystems (Kernel, Compiler usw.) geliefert wird, unter dem das Programm läuft - es sei denn, diese Komponente selbst gehört zum ausführbaren Programm.
Unter dem Quelltext eines Datenwerkes wird diejenige Form des Datenwerkes verstanden, die für Bearbeitungen vorzugsweise verwendet wird. Für ein ausführbares Programm bedeutet ,,der komplette Quelltext``: Der Quelltext aller im Programm enthaltenen Module einschließlich aller zugehörigen Modulschnittstellen-Definitionsdateien sowie der zur Compilation und Installation verwendeten Skripte. Als besondere Ausnahme jedoch braucht der verteilte Quelltext nichts von dem zu enthalten, was üblicherweise (entweder als Quelltext oder in binärer Form) zusammen mit den Hauptkomponenten des Betriebssystems (Kernel, Compiler usw.) geliefert wird, unter dem das Programm läuft - es sei denn, diese Komponente selbst gehört zum ausführbaren Programm.
Wenn die Verbreitung eines ausführbaren Programms oder von Objectcode dadurch erfolgt, daß der Kopierzugriff auf eine dafür vorgesehene Stelle gewährt wird, so gilt die Gewährung eines gleichwertigen Zugriffs auf den Quelltext als Verbreitung des Quelltextes, auch wenn Dritte nicht dazu gezwungen sind, den Quelltext zusammen mit dem Objectcode zu kopieren.
Wenn die Verbreitung eines ausführbaren Programms oder von Objectcode dadurch erfolgt, daß der Kopierzugriff auf eine dafür vorgesehene Stelle gewährt wird, so gilt die Gewährung eines gleichwertigen Zugriffs auf den Quelltext als Verbreitung des Quelltextes, auch wenn Dritte nicht dazu gezwungen sind, den Quelltext zusammen mit dem Objectcode zu kopieren.
§4. Sie dürfen das Programm nicht vervielfältigen, verändern, weiter lizenzieren oder verbreiten, sofern es nicht durch diese Lizenz ausdrücklich gestattet ist. Jeder anderweitige Versuch der Vervielfältigung, Modifizierung, Weiterlizenzierung und Verbreitung ist nichtig und beendet automatisch Ihre Rechte unter dieser Lizenz. Jedoch werden die Lizenzen Dritter, die von Ihnen Kopien oder Rechte unter dieser Lizenz erhalten haben, nicht beendet, solange diese die Lizenz voll anerkennen und befolgen.
§4. Sie dürfen das Programm nicht vervielfältigen, verändern, weiter lizenzieren oder verbreiten, sofern es nicht durch diese Lizenz ausdrücklich gestattet ist. Jeder anderweitige Versuch der Vervielfältigung, Modifizierung, Weiterlizenzierung und Verbreitung ist nichtig und beendet automatisch Ihre Rechte unter dieser Lizenz. Jedoch werden die Lizenzen Dritter, die von Ihnen Kopien oder Rechte unter dieser Lizenz erhalten haben, nicht beendet, solange diese die Lizenz voll anerkennen und befolgen.
§5. Sie sind nicht verpflichtet, diese Lizenz anzunehmen, da Sie sie nicht unterzeichnet haben. Jedoch gibt Ihnen nichts anderes die Erlaubnis, das Programm oder von ihm abgeleitete Datenwerke zu verändern oder zu verbreiten. Diese Handlungen sind gesetzlich verboten, wenn Sie diese Lizenz nicht anerkennen. Indem Sie das Programm (oder ein darauf basierendes Datenwerk) verändern oder verbreiten, erklären Sie Ihr Einverständnis mit dieser Lizenz und mit allen ihren Bedingungen bezüglich der Vervielfältigung, Verbreitung und Veränderung des Programms oder eines darauf basierenden Datenwerks.
§5. Sie sind nicht verpflichtet, diese Lizenz anzunehmen, da Sie sie nicht unterzeichnet haben. Jedoch gibt Ihnen nichts anderes die Erlaubnis, das Programm oder von ihm abgeleitete Datenwerke zu verändern oder zu verbreiten. Diese Handlungen sind gesetzlich verboten, wenn Sie diese Lizenz nicht anerkennen. Indem Sie das Programm (oder ein darauf basierendes Datenwerk) verändern oder verbreiten, erklären Sie Ihr Einverständnis mit dieser Lizenz und mit allen ihren Bedingungen bezüglich der Vervielfältigung, Verbreitung und Veränderung des Programms oder eines darauf basierenden Datenwerks.
§6. Jedesmal, wenn Sie das Programm (oder ein auf dem Programm basierendes Datenwerk) weitergeben, erhält der Empfänger automatisch vom ursprünglichen Lizenzgeber die Lizenz, das Programm entsprechend den hier festgelegten Bestimmungen zu vervielfältigen, zu verbreiten und zu verändern. Sie dürfen keine weiteren Einschränkungen der Durchsetzung der hierin zugestandenen Rechte des Empfängers vornehmen. Sie sind nicht dafür verantwortlich, die Einhaltung dieser Lizenz durch Dritte durchzusetzen.
§6. Jedesmal, wenn Sie das Programm (oder ein auf dem Programm basierendes Datenwerk) weitergeben, erhält der Empfänger automatisch vom ursprünglichen Lizenzgeber die Lizenz, das Programm entsprechend den hier festgelegten Bestimmungen zu vervielfältigen, zu verbreiten und zu verändern. Sie dürfen keine weiteren Einschränkungen der Durchsetzung der hierin zugestandenen Rechte des Empfängers vornehmen. Sie sind nicht dafür verantwortlich, die Einhaltung dieser Lizenz durch Dritte durchzusetzen.
§7. Sollten Ihnen infolge eines Gerichtsurteils, des Vorwurfs einer Patentverletzung oder aus einem anderen Grunde (nicht auf Patentfragen begrenzt) Bedingungen (durch Gerichtsbeschluß, Vergleich oder anderweitig) auferlegt werden, die den Bedingungen dieser Lizenz widersprechen, so befreien Sie diese Umstände nicht von den Bestimmungen dieser Lizenz. Wenn es Ihnen nicht möglich ist, das Programm unter gleichzeitiger Beachtung der Bedingungen in dieser Lizenz und Ihrer anderweitigen Verpflichtungen zu verbreiten, dann dürfen Sie als Folge das Programm überhaupt nicht verbreiten. Wenn zum Beispiel ein Patent nicht die gebührenfreie Weiterverbreitung des Programms durch diejenigen erlaubt, die das Programm direkt oder indirekt von Ihnen erhalten haben, dann besteht der einzige Weg, sowohl das Patentrecht als auch diese Lizenz zu befolgen, darin, ganz auf die Verbreitung des Programms zu verzichten.
§7. Sollten Ihnen infolge eines Gerichtsurteils, des Vorwurfs einer Patentverletzung oder aus einem anderen Grunde (nicht auf Patentfragen begrenzt) Bedingungen (durch Gerichtsbeschluß, Vergleich oder anderweitig) auferlegt werden, die den Bedingungen dieser Lizenz widersprechen, so befreien Sie diese Umstände nicht von den Bestimmungen dieser Lizenz. Wenn es Ihnen nicht möglich ist, das Programm unter gleichzeitiger Beachtung der Bedingungen in dieser Lizenz und Ihrer anderweitigen Verpflichtungen zu verbreiten, dann dürfen Sie als Folge das Programm überhaupt nicht verbreiten. Wenn zum Beispiel ein Patent nicht die gebührenfreie Weiterverbreitung des Programms durch diejenigen erlaubt, die das Programm direkt oder indirekt von Ihnen erhalten haben, dann besteht der einzige Weg, sowohl das Patentrecht als auch diese Lizenz zu befolgen, darin, ganz auf die Verbreitung des Programms zu verzichten.
Sollte sich ein Teil dieses Paragraphen als ungültig oder unter bestimmten Umständen nicht durchsetzbar erweisen, so soll dieser Paragraph seinem Sinne nach angewandt werden; im übrigen soll dieser Paragraph als Ganzes gelten.
Sollte sich ein Teil dieses Paragraphen als ungültig oder unter bestimmten Umständen nicht durchsetzbar erweisen, so soll dieser Paragraph seinem Sinne nach angewandt werden; im übrigen soll dieser Paragraph als Ganzes gelten.
Zweck dieses Paragraphen ist nicht, Sie dazu zu bringen, irgendwelche Patente oder andere Eigentumsansprüche zu verletzen oder die Gültigkeit solcher Ansprüche zu bestreiten; dieser Paragraph hat einzig den Zweck, die Integrität des Verbreitungssystems der freien Software zu schützen, das durch die Praxis öffentlicher Lizenzen verwirklicht wird. Viele Leute haben großzügige Beiträge zu dem großen Angebot der mit diesem System verbreiteten Software im Vertrauen auf die konsistente Anwendung dieses Systems geleistet; es liegt am Autor/Geber, zu entscheiden, ob er die Software mittels irgendeines anderen Systems verbreiten will; ein Lizenznehmer hat auf diese Entscheidung keinen Einfluß.
Zweck dieses Paragraphen ist nicht, Sie dazu zu bringen, irgendwelche Patente oder andere Eigentumsansprüche zu verletzen oder die Gültigkeit solcher Ansprüche zu bestreiten; dieser Paragraph hat einzig den Zweck, die Integrität des Verbreitungssystems der freien Software zu schützen, das durch die Praxis öffentlicher Lizenzen verwirklicht wird. Viele Leute haben großzügige Beiträge zu dem großen Angebot der mit diesem System verbreiteten Software im Vertrauen auf die konsistente Anwendung dieses Systems geleistet; es liegt am Autor/Geber, zu entscheiden, ob er die Software mittels irgendeines anderen Systems verbreiten will; ein Lizenznehmer hat auf diese Entscheidung keinen Einfluß.
Dieser Paragraph ist dazu gedacht, deutlich klarzustellen, was als Konsequenz aus dem Rest dieser Lizenz betrachtet wird.
§8. Wenn die Verbreitung und/oder die Benutzung des Programms in bestimmten Staaten entweder durch Patente oder durch urheberrechtlich geschützte Schnittstellen eingeschränkt ist, kann der Urheberrechtsinhaber, der das Programm unter diese Lizenz gestellt hat, eine explizite geographische Begrenzung der Verbreitung angeben, in der diese Staaten ausgeschlossen werden, so daß die Verbreitung nur innerhalb und zwischen den Staaten erlaubt ist, die nicht ausgeschlossen sind. In einem solchen Fall beinhaltet diese Lizenz die Beschränkung, als wäre sie in diesem Text niedergeschrieben.
§8. Wenn die Verbreitung und/oder die Benutzung des Programms in bestimmten Staaten entweder durch Patente oder durch urheberrechtlich geschützte Schnittstellen eingeschränkt ist, kann der Urheberrechtsinhaber, der das Programm unter diese Lizenz gestellt hat, eine explizite geographische Begrenzung der Verbreitung angeben, in der diese Staaten ausgeschlossen werden, so daß die Verbreitung nur innerhalb und zwischen den Staaten erlaubt ist, die nicht ausgeschlossen sind. In einem solchen Fall beinhaltet diese Lizenz die Beschränkung, als wäre sie in diesem Text niedergeschrieben.
§9. Die Free Software Foundation kann von Zeit zu Zeit überarbeitete und/oder neue Versionen der General Public License veröffentlichen. Solche neuen Versionen werden vom Grundprinzip her der gegenwärtigen entsprechen, können aber im Detail abweichen, um neuen Problemen und Anforderungen gerecht zu werden.
§9. Die Free Software Foundation kann von Zeit zu Zeit überarbeitete und/oder neue Versionen der General Public License veröffentlichen. Solche neuen Versionen werden vom Grundprinzip her der gegenwärtigen entsprechen, können aber im Detail abweichen, um neuen Problemen und Anforderungen gerecht zu werden.
Jede Version dieser Lizenz hat eine eindeutige Versionsnummer. Wenn in einem Programm angegeben wird, daß es dieser Lizenz in einer bestimmten Versionsnummer oder ,,jeder späteren Version`` (``any later version'') unterliegt, so haben Sie die Wahl, entweder den Bestimmungen der genannten Version zu folgen oder denen jeder beliebigen späteren Version, die von der Free Software Foundation veröffentlicht wurde. Wenn das Programm keine Versionsnummer angibt, können Sie eine beliebige Version wählen, die je von der Free Software Foundation veröffentlicht wurde.
Jede Version dieser Lizenz hat eine eindeutige Versionsnummer. Wenn in einem Programm angegeben wird, daß es dieser Lizenz in einer bestimmten Versionsnummer oder ,,jeder späteren Version`` (``any later version'') unterliegt, so haben Sie die Wahl, entweder den Bestimmungen der genannten Version zu folgen oder denen jeder beliebigen späteren Version, die von der Free Software Foundation veröffentlicht wurde. Wenn das Programm keine Versionsnummer angibt, können Sie eine beliebige Version wählen, die je von der Free Software Foundation veröffentlicht wurde.
§10. Wenn Sie den Wunsch haben, Teile des Programms in anderen freien Programmen zu verwenden, deren Bedingungen für die Verbreitung anders sind, schreiben Sie an den Autor, um ihn um die Erlaubnis zu bitten. Für Software, die unter dem Copyright der Free Software Foundation steht, schreiben Sie an die Free Software Foundation ; wir machen zu diesem Zweck gelegentlich Ausnahmen. Unsere Entscheidung wird von den beiden Zielen geleitet werden, zum einen den freien Status aller von unserer freien Software abgeleiteten Datenwerke zu erhalten und zum anderen das gemeinschaftliche Nutzen und Wiederverwenden von Software im allgemeinen zu fördern.
§10. Wenn Sie den Wunsch haben, Teile des Programms in anderen freien Programmen zu verwenden, deren Bedingungen für die Verbreitung anders sind, schreiben Sie an den Autor, um ihn um die Erlaubnis zu bitten. Für Software, die unter dem Copyright der Free Software Foundation steht, schreiben Sie an die Free Software Foundation ; wir machen zu diesem Zweck gelegentlich Ausnahmen. Unsere Entscheidung wird von den beiden Zielen geleitet werden, zum einen den freien Status aller von unserer freien Software abgeleiteten Datenwerke zu erhalten und zum anderen das gemeinschaftliche Nutzen und Wiederverwenden von Software im allgemeinen zu fördern.
Keine Gewährleistung
Keine Gewährleistung
§11. Da das Programm ohne jegliche Kosten lizenziert wird, besteht keinerlei Gewährleistung für das Programm, soweit dies gesetzlich zulässig ist. Sofern nicht anderweitig schriftlich bestätigt, stellen die Copyright-Inhaber und/oder Dritte das Programm so zur Verfügung, ,,wie es ist``, ohne irgendeine Gewährleistung, weder ausdrücklich noch implizit, einschließlich - aber nicht begrenzt auf - Marktreife oder Verwendbarkeit für einen bestimmten Zweck. Das volle Risiko bezüglich Qualität und Leistungsfähigkeit des Programms liegt bei Ihnen. Sollte sich das Programm als fehlerhaft herausstellen, liegen die Kosten für notwendigen Service, Reparatur oder Korrektur bei Ihnen.
§11. Da das Programm ohne jegliche Kosten lizenziert wird, besteht keinerlei Gewährleistung für das Programm, soweit dies gesetzlich zulässig ist. Sofern nicht anderweitig schriftlich bestätigt, stellen die Copyright-Inhaber und/oder Dritte das Programm so zur Verfügung, ,,wie es ist``, ohne irgendeine Gewährleistung, weder ausdrücklich noch implizit, einschließlich - aber nicht begrenzt auf - Marktreife oder Verwendbarkeit für einen bestimmten Zweck. Das volle Risiko bezüglich Qualität und Leistungsfähigkeit des Programms liegt bei Ihnen. Sollte sich das Programm als fehlerhaft herausstellen, liegen die Kosten für notwendigen Service, Reparatur oder Korrektur bei Ihnen.
§12. In keinem Fall, außer wenn durch geltendes Recht gefordert oder schriftlich zugesichert, ist irgendein Copyright-Inhaber oder irgendein Dritter, der das Programm wie oben erlaubt modifiziert oder verbreitet hat, Ihnen gegenüber für irgendwelche Schäden haftbar, einschließlich jeglicher allgemeiner oder spezieller Schäden, Schäden durch Seiteneffekte (Nebenwirkungen) oder Folgeschäden, die aus der Benutzung des Programms oder der Unbenutzbarkeit des Programms folgen (einschließlich - aber nicht beschränkt auf - Datenverluste, fehlerhafte Verarbeitung von Daten, Verluste, die von Ihnen oder anderen getragen werden müssen, oder dem Unvermögen des Programms, mit irgendeinem anderen Programm zusammenzuarbeiten), selbst wenn ein Copyright-Inhaber oder Dritter über die Möglichkeit solcher Schäden unterrichtet worden war.
§12. In keinem Fall, außer wenn durch geltendes Recht gefordert oder schriftlich zugesichert, ist irgendein Copyright-Inhaber oder irgendein Dritter, der das Programm wie oben erlaubt modifiziert oder verbreitet hat, Ihnen gegenüber für irgendwelche Schäden haftbar, einschließlich jeglicher allgemeiner oder spezieller Schäden, Schäden durch Seiteneffekte (Nebenwirkungen) oder Folgeschäden, die aus der Benutzung des Programms oder der Unbenutzbarkeit des Programms folgen (einschließlich - aber nicht beschränkt auf - Datenverluste, fehlerhafte Verarbeitung von Daten, Verluste, die von Ihnen oder anderen getragen werden müssen, oder dem Unvermögen des Programms, mit irgendeinem anderen Programm zusammenzuarbeiten), selbst wenn ein Copyright-Inhaber oder Dritter über die Möglichkeit solcher Schäden unterrichtet worden war.
Ende der Bedingungen

Datei anzeigen

@ -1,87 +0,0 @@
Licencia Pública General de GNU
Versión 2 (junio de 1991)
Copyright © 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 EE.UU. Se permite la copia y distribución de copias literales de esta licencia, siempre y cuando no entren en los cambios.
preámbulo
La mayoría de las licencias de software están diseñadas para privar al usuario de la libertad de compartir y modificar el software. Por el contrario, la Licencia Pública General de GNU pretende garantizar su libertad de compartir y modificar software libre, para asegurar que el software es libre para todos sus usuarios. Esta Licencia Pública General se aplica a la mayoría del software de la Free Software Foundation, así como cualquier otro programa cuyos autores se comprometen a utilizarla (ningún otro software de la Free Software Foundation que se rige, en cambio, por la Licencia Pública General reducida GNU). También puede aplicarla a sus propios programas.
Cuando se habla de software libre expresión de libertad, no de precio. Nuestras Licencias Públicas Generales están diseñadas con el objetivo de garantizar su libertad de distribuir copias de software libre (y cobrar por ese servicio si lo desea), que reciba el código fuente o que pueda recibir, si lo desea, tiene la posibilidad para modificar el software o usar fragmentos de él en nuevos programas libres, y que, por otra parte, es consciente de que puede hacerlo todo.
Para proteger sus derechos, necesitamos introducir algunas restricciones que impiden que cualquier otro puede negar estos derechos o pedirle que renuncie a ellos. Estas restricciones implican ciertas obligaciones que le afectan si distribuir copias del software o modificar.
Por ejemplo, si distribuye copias del software libre, ya sea libre o no, lo tiene que dar a los receptores todos los derechos que tiene. Tendrá que asegurarse de que estos, también, reciban o puedan obtener el código fuente y tendrán que mostrar estos términos para informarles de sus derechos.
Hay dos pasos para proteger sus derechos: (1) poner el software con derechos de autor y (2) le ofrecemos esta licencia, que autoriza legalmente copiar, distribuir y / o modificar el software.
También, como una protección para todos los autores y nosotros mismos, es importante hacerles claro a todas las partes que no existe garantía para este software libre. En el caso de que cualquier usuario puede modificar el software y luego distribuir a un tercero, los beneficiarios deben saber que lo que nos trajeron no es el software original, por lo que cualquier problema introducido por la otra parte no afecta a la reputación de los autores originales.
Por último, cualquier programa libre está constantemente amenazado por las patentes de software. Nuestra intención es evitar el peligro de que los redistribuidores de un programa libre obtengan patentes por su cuenta, por lo tanto, su programa de software registrado. Para evitar esto, deja claro que cualquier patente debe garantizar la transferencia de la licencia a cualquier usuario que sea posible, para que todos puedan utilizar el software libre o de otro modo, no debe garantizar que nadie ninguna licencia.
A continuación se enumeran los términos y condiciones exactos para la copia, distribución y modificación.
Licencia Pública General de GNU
TÉRMINOS Y CONDICIONES PARA LA COPIA, distribución y modificación
0. Esta Licencia se aplica a cualquier programa o producto contenida de otra manera en una nota colocada por el titular de los derechos de autor para especificar que puede ser distribuido bajo los términos de esta Licencia Pública General. En lo sucesivo, el término "programa" se refiere a cualquier programa o producto de este tipo, mientras que el término "basado en el Programa" se refieren al programa tanto como cualquier producto derivado de acuerdo con la ley de derechos de autor, es decir, cualquier producto que contiene el programa o una porción del mismo, ya sea literal o con modificaciones y / o traducido a otro idioma. (De aquí en adelante, la traducción está incluida sin ningún límite en el término "modificación".) Las licencias se escriben en la forma de cortesía cómo a "usted".
Cualquier actividad que no sea la copia, distribución y modificación no están cubiertas por esta licencia, pero quedan fuera de su alcance. No se restringen a la acción para ejecutar el programa, y los resultados extraídos del Programa están cubiertos únicamente si sus contenidos constituyen un trabajo basado en el Programa (independientemente de si se hace ejecutando el Programa). Esto es cierto o no, dependerá de lo que haga el programa.
1. Usted puede copiar y distribuir copias literales del código fuente del Programa, ya que recibe, en cualquier medio, siempre que cada copia incluye, de manera adecuada y suficientemente visibles, las indicaciones requeridas relativas a la propiedad intelectual y la exención del garantía de que mantenga intactos todos los avisos que se refieran a esta licencia ya la ausencia de cualquier interés para ellos y entregado a todos los demás destinatarios del programa una copia de esta licencia junto con el programa.
Puede cobrar un precio por el acto físico de transferir una copia, y si lo desea, también puede ofrecer una cierta garantía a cambio de una tarifa.
2. Puede modificar su copia o copias del Programa o cualquier parte de ella, y así obtener un producto basado en el Programa, y copiar y distribuir tales modificaciones o producto en los términos del apartado 1 anterior, siempre que se mantengan también con todas las condiciones siguientes:
a) Debe hacer que cualquier archivo modificado incluye instrucciones en un lugar destacado sentido de que el archivo correspondiente se modificó, y la fecha de cualquier cambio.
b) Debe hacer que cualquier producto distribuido ni publicado por usted, en su totalidad o en parte contiene o se deriva del Programa o de cualquier parte del programa, obtener una licencia en su conjunto sin este impacto gasto alguno a ningún acuerdo con terceras partes con los términos de esta licencia.
c) Si el programa modificado lee normalmente órdenes interactivamente cuando es ejecutado, debe hacer que, cuando su ejecución para ese uso interactivo de la más común, mostrar o exhibir un aviso que incluya la información correspondiente al programa de propiedad intelectual y la ausencia de cualquier interés (o, en su caso, al hecho de que usted es el que da la garantía), la indicación de que los usuarios pueden redistribuir el programa de acuerdo con estas condiciones y la información necesaria para conocer cómo el acceso de un usuario copia de esta licencia. (Excepción: si el propio programa es interactivo pero normalmente no muestra este tipo de advertencias, no es necesario que su producto basado en el Programa muestre ningún aviso.)
Estos requisitos se aplican al producto modificado como un todo. Si el producto contiene secciones fácilmente identificables no derivadas del Programa, que razonablemente puede considerarse como productos separados e independientes para sí mismos, pero esta licencia y sus términos no se aplican a esas partes cuando sean distribuidas como productos separados. Pero si esas mismas secciones se distribuyen como parte de un todo que consiste basado en el Programa, la distribución de todos debe ser la sede de los términos de esta licencia, cuyas disposiciones se aplican a todos los demás poseedores de la licencia, que cubre todo el conjunto y, en En consecuencia, todas y cada una de las partes de la articulación independientemente de quien los escribe.
Así que el propósito de esta sección no ha sido reclamar los derechos o refutar sus afirmaciones sobre cualquier producto en para usted en su totalidad; más bien al contrario, su propósito es ejercer el derecho a controlar la distribución de derivados o colectivos basados en el Programa.
Por otra parte, la simple agregación de Programa (o un trabajo basado en el Programa) otro producto no basado en el Programa en un volumen de un medio de distribución o almacenamiento no implica la inclusión de otros productos dentro del alcance de esta licencia.
3. Usted puede copiar y distribuir el Programa (o un producto basado en él, según los términos de la Sección 2) en código objeto o en formato ejecutable según los apartados 1 y 2 anteriores, siempre que cumplan también con los siguientes requisitos:
a) Acompañarlo con el código fuente completo correspondiente en formato legible por máquina, que se distribuye bajo los términos de los apartados 1 y 2 anteriores, en un medio habitualmente utilizado para el intercambio de software.
b) Acompañarlo con una oferta por escrito, válida durante al menos tres años, que fue dada a terceros, por un costo sea superior a los costes en que se puede incurrir en la ejecución física de la distribución del código fuente, un formato de copia completa código fuente legible por la máquina, que se ha distribuido bajo los términos de las secciones 1 y 2 anteriores, en un medio habitualmente utilizado para el intercambio de software.
c) Acompañarlo con la información que recibió sobre la oferta de distribución del código fuente correspondiente. (Esta opción se permite sólo para distribución no comercial y sólo si usted recibió el programa como código objeto o en formato ejecutable con tal oferta acabamos de explicar, de conformidad con el apartado b anterior).
Se entiende por una fuente que trabaja su formato más adecuado cuando se le hacen modificaciones. En el caso de un trabajo ejecutable, se considera el código fuente completo todo el código fuente para todos los módulos, que incluye todos los archivos de definición de interfaz asociados y los guiones utilizados para controlar la compilación e instalación del ejecutable. Sin embargo, como una excepción especial, el código fuente distribuido no necesita incluir nada que sea distribuido normalmente (ya sea binaria o fuente) con los componentes principales (compilador, kernel, etc.) del sistema operativo en el cual funciona el ejecutable, salvo que dicha el propio componente acompañe al ejecutable.
Si la distribución del ejecutable o del código objeto se hace mediante la concesión de acceso a la copia desde un lugar designado, a continuación, la concesión de acceso para copiar el código fuente desde el mismo lugar que se considera como distribución del código fuente, aunque se requiere un tercero para copiar el código fuente junto con el objeto.
4. Usted no puede copiar, modificar, sublicenciar o distribuir el Programa excepto las expresamente mencionadas en este documento. Cualquier otro intento de copiar, modificar, sublicenciar o distribuir el programa es nulo, y supondrá la cancelación automática de los derechos de la concesión de esta licencia. Sin embargo, las partes a las que las copias o los derechos concedidos en virtud de los términos de esta licencia no se resuelva sus respectivas licencias, siempre que cumplan plenamente con todo lo que en ellos se estipula.
5. Teniendo en cuenta que no han firmado, no está obligado a aceptar estos términos. Sin embargo, ella es la única que autoriza modificar o distribuir el Programa o cualquier obra derivada. Estas acciones están prohibidas por la ley, mientras no aceptar esta licencia. Por lo tanto, al modificar o distribuir el Programa (o cualquier trabajo basado en el Programa) está indicando que acepta esta Licencia para la ejecución de estas acciones, así como todos los términos y condiciones establecidos en el mismo para la copia, distribución o la modificación del programa o cualquier producto basado en él.
6. Cada vez que redistribuya el Programa (o cualquier trabajo basado en el Programa), el receptor recibirá automáticamente una licencia del licenciatario original para copiar, distribuir o modificar el Programa sujeto a estos términos y condiciones. Usted no puede imponer ninguna restricción adicional sobre el ejercicio de los derechos establecidos en el mismo por el receptor. Usted no es responsable cuando un tercero para exigir el cumplimiento de los términos establecidos en este documento.
7. Si, como consecuencia de una resolución judicial o alegación patente violación, o por cualquier otra razón (no limitada a asuntos relacionados con patentes), dio lugar a la imposición de cualquier condición (ya sea por orden judicial, acuerdo o cualquier otra causa) que contradigan las condiciones de esta licencia, que no le exime de cumplir las condiciones de esta licencia. Para que no sea posible distribuir el programa respetando las obligaciones bajo esta licencia y asimismo cualquier otra obligación pertinente, entonces usted tiene que dejar de distribuir de ninguna manera. Por ejemplo, si hay una licencia de patente que no permite la redistribución del Programa libre de derechos de autor por parte de todos aquellos que reciban copias directa o indirectamente de usted, la única manera de cumplir con los términos de la licencia de patentes y más de esta licencia, al mismo tiempo estarían evitando por completo la distribución del programa.
En el caso de que cualquier sección de este apartado se considera inválida o imposible de cumplir bajo cualquier circunstancia particular se aplica al resto de la sección y, en cualquier otra circunstancia, se aplica la sección en su conjunto.
El objetivo de esta sección no se induzca a infringir ninguna reivindicación de patente o cualquier otro derecho de propiedad intelectual, ni impugnar la validez de tales reclamaciones. La única intención de esta sección es la de proteger la integridad del sistema de distribución de software libre, puesto en práctica por el desarrollo de licencia pública.
Mucha gente ha hecho contribuciones generosas a la evolución de la amplia gama de software distribuido a través de este sistema, con la confianza de que una aplicación coherente. Sólo el autor / donante puede decidir si está dispuesto a distribuir su software mediante cualquier otro sistema; titular de una licencia no puede imponer este tipo de elección.
Esta sección está destinada a dejar claro lo que se cree es una consecuencia del resto de esta Licencia.
8. En el caso de que algunos países restringen la distribución y / o uso del Programa de cualquier patente o por interfaces bajo copyright, el tenedor del copyright que presentó el programa a los términos de esta Licencia puede añadir una limitación explícita de distribución geográfica excluyendo esos países, de forma que sólo se permite la distribución en o entre los países no sujetos a dicha exclusión. Si este es el caso, la licencia para incorporar limitación mencionada en los mismos términos que fueron reclutados como parte del cuerpo de esta Licencia.
9. La Free Software Foundation puede publicar versiones revisadas y / o nuevas esta Licencia Pública General en el momento que considere oportuno. La nueva versión mantiene el mismo espíritu que el actual, aunque los detalles pueden diferir en algunos de los contenidos con el fin de hacer frente a nuevos problemas o preocupaciones.
Cada versión tiene un número de identificación diferente. Si el Programa especifica que se aplica a una versión específica de esta licencia y "cualquier versión posterior", se puede elegir entre adhieren a los términos y condiciones del primer pozo de esa versión o de cualquier versión posterior publicada por la Free Software Foundation. Si el Programa no especifica un número de versión de esta Licencia, usted tiene la opción de elegir cualquier versión de todos publicados por la Free Software Foundation.
10. Si desea incluir partes del Programa en otros programas libres con diferentes condiciones de distribución, se espera que para hacer frente a la escritura del autor de pedir su consentimiento. En el caso de los derechos de autor de software de la Free Software Foundation, ir a escribir a la Free Software Foundation, que a veces hace excepciones en estos casos. La elección que hacemos se basa en nuestros dos objetivos de preservar la libertad de todos los derivados de nuestro software libre y promover el intercambio y la reutilización del software en general.
SIN GARANTÍA
11. COMO EL PROGRAMA SE LICENCIA LIBRE DE CARGAS, NO SE OFRECE NINGUNA GARANTÍA SOBRE EL PROGRAMA, EN LA EXTENSIÓN PERMITIDA POR LA LEGISLACIÓN APLICABLE. EXCEPTO CUANDO SE INDIQUE DE OTRA FORMA POR ESCRITO, LOS TENEDORES DEL COPYRIGHT Y / U OTRAS PARTES PROPORCIONAN EL PROGRAMA "TAL CUAL" SIN GARANTÍA DE NINGÚN TIPO, YA SEA EXPRESA O IMPLÍCITA, INCLUYENDO, PERO NO LIMITADO A, LAS GARANTÍAS IMPLÍCITAS DE COMERCIALIZACIÓN E IDONEIDAD PARA UN FIN DETERMINADO . TODO EL RIESGO EN CUANTO A LA CALIDAD Y RENDIMIENTO DEL PROGRAMA ES CON USTED. SI EL PROGRAMA TIENE UN ERROR, ASUME EL COSTE DE CUALQUIER SERVICIO, REPARACIÓN O CORRECCIÓN.
12. EN NINGÚN CASO, SALVO QUE LO REQUIERA LA LEGISLACIÓN APLICABLE O HAYA SIDO ACORDADO POR ESCRITO, NINGÚN TENEDOR DEL COPYRIGHT NI NINGUNA OTRA PARTE QUE MODIFIQUE Y / O REDISTRIBUYA EL PROGRAMA SEGÚN PERMITE EN ESTA LICENCIA SERÁ RESPONSABLE ANTE USTED POR DAÑOS, INCLUYENDO CUALQUIER GENERAL, ESPECIAL, DAÑOS INCIDENTALES O CONSECUENTES QUE SURJAN DEL USO O DE USO DEL PROGRAMA INCAPACIDAD (INCLUYENDO PERO NO LIMITADO A LA PÉRDIDA DE DATOS OA LA GENERACIÓN INCORRECTA OA PÉRDIDAS SUFRIDAS POR USTED O POR TERCERAS PARTES OA UN FALLO DEL PROGRAMA AL FUNCIONAR EN COMBINACIÓN CON CUALQUIER OTRO PROGRAMA) , INCLUSO SI DICHO TENEDOR U OTRA PARTE HA SIDO ADVERTIDO DE LA POSIBILIDAD DE TALES DAÑOS.
FIN DE LOS TÉRMINOS Y CONDICIONES

10
ReadMe/update_deutsch.txt Normale Datei
Datei anzeigen

@ -0,0 +1,10 @@
Update einer älteren MySQLDumper-Version:
- überschreibe alle Dateien mit denen aus der neuen Version
- rufe MySQLDumper im Browser auf, klicke Dich in die Konfiguration und klicke einmal auf "speichern"
- wenn das crondump.pl-Script per cronjob aufgerufen wird: im Aufruf muss der Parameter config angepasst werden
(bis Version 1.21 hieß er mysqldumper.conf - seit Version 1.22 heißt er mysqldumper.conf.php !)
Hinweis:
eventuell wirst Du auf dem Wege dahin auf Warnmeldungen stoßen ["undefinde index ..."].
Diese kannst Du ignorieren. Nach dem Speichern der Konfiguration sind diese verschwunden.

10
ReadMe/update_english.txt Normale Datei
Datei anzeigen

@ -0,0 +1,10 @@
Updating an older Version of MySQLDumper:
- overwrite all files with the new ones
- call MySQLDumper in your browser, go to the configuration and clicke "save"
- when you are running crondump.pl via cronjob: remember to update the name of the configuration file in the call of the cronjob
(up to version 1.21 it was named mysqldumper.conf - now it is called mysqldumper.conf.php !)
Notice:
maybe you will some warnings on your way to the configuration: ["undefinde index ..."].
Ignore that. After saving the new configuration theses warnings are gone.

Datei anzeigen

@ -1,126 +0,0 @@
<?php
// MySQL Dumper Configuration
// Host-Adress, default 'localhost'
$config['dbhost'] = 'localhost';
// port - if empty, mysql uses default
$config['dbport'] = '';
// socket - if empty, mysql uses default
$config['dbsocket'] = '';
// Username
$config['dbuser'] = 'root';
//User-Pass. For no Password leave empty
$config['dbpass'] = '';
//Speed Values between 50 and 1000000
//use low values if you have bad connection or slow machines
$config['minspeed']=100;
$config['maxspeed']=50000;
// Interface language and style
$config['language']='en';
$config['theme']='msd';
//Shows the Serveradress if 1
$config['interface_server_caption']=1;
$config['interface_server_captioncolor']='#ff9966';
//Position of the Serveradress 0=left, 1=right
$config['interface_server_caption_position']=0;
//Height of the SQL-Box in Mini-SQL in pixel
$config['interface_sqlboxsize']=70;
$config['interface_table_compact']=0;
// Determine the maximum Amount for Memory Use in Bytes, 0 for no limit
$config['memory_limit']=100000;
// For gz-Compression set to 1, without compression set to 0
$config['compression']=1;
//Refreshtime for MySQL processlist in msec, use any value >1000
$config['processlist_refresh']=3000;
$config['empty_db_before_restore']=0;
$config['optimize_tables_beforedump']=0;
$config['stop_with_error']=1;
// For sending a mail after backup set send_mail to 1, otherless set to 0
$config['send_mail']=0;
// Attach the backup 0=no 1=yes
$config['send_mail_dump']=0;
// set the recieve adress for the mail
$config['email_recipient']='';
$config['email_recipient_cc']='';
// set the sender adress (the script)
$config['email_sender']='';
//max. Size of Email-Attach, here 3 MB
$config['email_maxsize1']=3;
$config['email_maxsize2']=2;
// FTP Server Configuration for Transfer
$config['ftp_transfer'][0]=0;
$config['ftp_timeout'][0]=30;
$config['ftp_useSSL'][0]=0;
$config['ftp_mode'][0]=0;
$config['ftp_server'][0]=''; // Adress of FTP-Server
$config['ftp_port'][0]='21'; // Port
$config['ftp_user'][0]=''; // Username
$config['ftp_pass'][0]=''; // Password
$config['ftp_dir'][0]=''; // Upload-Directory
$config['ftp_transfer'][1]=0;
$config['ftp_timeout'][1]=30;
$config['ftp_useSSL'][1]=0;
$config['ftp_mode'][1]=0;
$config['ftp_server'][1]='';
$config['ftp_port'][1]='21';
$config['ftp_user'][1]='';
$config['ftp_pass'][1]='';
$config['ftp_dir'][1]='';
$config['ftp_transfer'][2]=0;
$config['ftp_timeout'][2]=30;
$config['ftp_useSSL'][2]=0;
$config['ftp_mode'][2]=0;
$config['ftp_server'][2]='';
$config['ftp_port'][2]='21';
$config['ftp_user'][2]='';
$config['ftp_pass'][2]='';
$config['ftp_dir'][2]='';
//Multipart 0=off 1=on
$config['multi_part']=0;
$config['multipartgroesse1']=1;
$config['multipartgroesse2']=2;
$config['multipart_groesse']=0;
//Auto-Delete 0=off 1=on
$config['auto_delete']=0;
$config['max_backup_files']=3;
//configuration file
$config['cron_configurationfile']='mysqldumper.conf.php';
//path to perl, for windows use e.g. C:perlbinperl.exe
$config['cron_perlpath']='/usr/bin/perl';
//mailer use sendmail(1) or SMTP(0)
$config['cron_use_sendmail']=1;
//path to sendmail
$sendmail_path=ini_get('sendmail_path');
$config['cron_sendmail']=$sendmail_path>'' ? $sendmail_path: '/usr/lib/sendmail -t -oi -oem';
//adress of smtp-server
$config['cron_smtp']='localhost';
//smtp-port
$config['cron_smtp_port']=25;
$config['cron_extender']=0;
$config['cron_compression']=1;
$config['cron_printout']=1;
$config['cron_completelog']=1;
$config['cron_comment']='';
$config['multi_dump']=0;
$config['logcompression']=1;
$config['log_maxsize1']=1;
$config['log_maxsize2']=2;
$config['log_maxsize']=1048576;

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 132 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 131 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 211 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 131 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 208 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 991 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 131 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 145 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 1003 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 998 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 547 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 1001 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 359 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 74 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 138 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 154 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 780 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 680 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 108 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 991 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 1.2 KiB

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 583 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 3.4 KiB

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 6.2 KiB

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 4.0 KiB

Datei anzeigen

@ -1,647 +0,0 @@
/*
@MySQLDumper STYLESHEET
@name msd
@copyright MySQLDumper - Daniel Schlichtholz <http://www.mysqldumper.de>
@author Ingo Wagener <http://www.vorderdeck.de>, Daniel Schlichtholz, Christian Gresshoener <http://www.gresshoener.de>
@date 2008-02-28 13:39:07
@lastmodified 2009-09-15 00:19:30
@media screen and projection
*/
*,.nomargin {
margin: 0;
padding: 0;
}
label {
cursor: pointer;
}
img {
border: 0;
padding: 0;
margin: 0;
}
body {
font: 12px/1.5 Verdana, Helvetica, sans-serif; /* Important IE Bugfix: No spaces in font-attribute between px and slash */
border-top: 5px solid #256777;
background: #fff url(pics/bg-body.gif) repeat-x 0 5px;
}
body.content {
min-width: 540px;
padding: 0 18px;
}
.menu-frame {
background-color: #FFF;
color: #000;
}
/* LINKS */
a {
color: #256777;
}
a:hover {
color: #E87B00;
text-decoration: none;
}
a.ul {
text-decoration: underline;
}
/* general */
#pagetitle {
color: #256777;
font-size: 1.8em;
padding-top: 2px;
margin-bottom: 20px;
border-bottom: 1px solid #c7c7c7;
}
#server0 {
position: absolute;
bottom: 4px;
text-align: center;
left: 10px;
color: #000;
}
#server1 {
position: absolute;
right: 16px;
text-align: center;
padding: 10px;
}
.small {
font-size: 11px;
}
.ssmall {
font-size: 10px;
}
.success {
color: green;
font-weight: bold;
}
.error {
color: #E87B00;
background-color: yellow;
font-weight: bold;
}
.explain {
text-decoration: none;
border-bottom: 1px dotted;
}
.explain:hover {
cursor: help;
}
.active_db {
font-weight: bold;
border-bottom: 1px dotted;
color: #9AA2B1;
}
table {
color: #000;
}
table.bdr,.bdr {
border: 1px solid #ddd !important;
border-collapse: collapse !important;
}
table td {
text-align: left;
vertical-align: top;
padding: 0 6px;
font-size: 12px;
}
table th {
padding: 0 6px;
}
/* MENU */
#menu {
text-align: left;
position:absolute;
margin: 0px;
top: 154px;
left:0;
width:190px;
height:160px;
}
#menu ul {
margin: 0px 0 0 0;
list-style: none;
background-color: transparent;
}
#menu ul li {
border-bottom: 1px solid #ddd;
}
#menu ul a {
padding: 0 10px;
display: block;
line-height: 2;
text-decoration: none;
outline: none;
}
#menu ul a:hover {
background: #eee;
text-decoration: none;
}
#menu ul li.active {
border-bottom: 1px solid #256777;
}
#menu ul li.active a,#menu ul li.active a:hover {
color: #E87B00;
font-weight: bold;
text-decoration: none;
background: transparent;
}
#menu ul li.icon-holder {
margin-top: 3em;
border-bottom: 0;
text-align: center;
}
#menu ul li strong {
text-align: left;
color: #256777;
font: normal normal .8em/1.4em verdana, sans-serif;
display: block;
}
fieldset {
margin: 10px;
padding: 5px;
border: 1px solid #ddd;
color: #256777;
}
body.content legend {
font-weight: bold;
}
body.menu fieldset p {
margin: 5px 0 0;
text-align: center;
}
/* MAIN */
#topnavi {
list-style: none;
margin: 10px 0 20px;
}
#topnavi li {
float: left;
margin-right: 6px;
}
#topnavi li a {
float: left;
font: 1.1em verdana, arial, sans-serif;
border: 1px solid #ddd;
background: url(pics/bg-buttons.gif) repeat-x;
color: #E87B00;
padding: 3px 6px;
vertical-align: bottom;
cursor: pointer;
text-decoration: none;
white-space: nowrap;
}
#topnavi li a span {
color: #256777;
}
#topnavi li a:hover {
color: #256777;
}
#topnavi li a:hover span {
color: #E87B00;
}
#content p {
margin: 10px 0;
}
/*Tabellen */
table tr.dbrow {
background: #FCFDFD;
}
table tr.dbrow1 {
background: #F8FAFB;
}
table tr.dbrowsel {
background: #F9F3ED;
color: #256777;
}
table tr.dbrowsel a:hover {
color: #E87B00;
}
table td.treffer {
background: #000;
}
/* Treffer bei der MySQL-Suche */
table tr.dbrow .treffer,table tr.dbrow1 .treffer {
color: yellow;
background-color: #E87B00;
}
table.border {
border: 1px solid #738C88;
}
table td.sum {
background-color: red;
font-weight: bold;
text-align: right;
}
table tr.thead th,table tr.thead td {
background: url(pics/bg-buttons.gif) repeat-x;
border: 1px solid #ddd;
color: #256777;
}
#configright table a {
font-size: 11px;
color: #E87B00;
}
#configright table tr.dbrowsel a {
color: #E87B00;
}
.tdcompact {
width: 100px;
height: 16px;
overflow: hidden;
font-size: 11px;
}
.tdnormal {
white-space: nowrap;
padding: 1px;
}
.sqlheadmenu a {
}
/* FORM-Elements */
#content .Formbutton,#content .ConfigButton,#content .ConfigButtonSelected,#content .Formtext {
margin: 0px 6px 0px 0px;
font: 1.1em verdana, arial, sans-serif;
border: 1px solid #ddd;
background: url(pics/bg-buttons.gif) repeat-x;
color: #E87B00;
line-height: 14px;
padding: 2px;
white-space: nowrap;
overflow: visible;
text-decoration: none;
}
#content a.Formbutton {
padding: 3px 6px;
vertical-align: bottom;
}
.Formbutton { cursor: pointer; }
.Formbutton:disabled { cursor: default; }
#content .Formtext {
overflow: hidden;
cursor: text;
}
#content .ConfigButtonSelected {
color: #256777;
}
#content .ConfigButton,#content .ConfigButtonSelected {
width: 160px;
margin-bottom: 4px;
cursor: pointer;
}
#content .SQLbutton {
font-size: 11px;
background: #E4E9E8;
cursor: pointer;
}
/* htaccess edit area */
#content textarea #thta {
font-size: 11px;
color: blue;
width: 400px;
height: 300px;
overflow: scroll;
}
#content textarea {
width: 100%;
background: #FFF;
}
input.radio,input.checkbox {
background-color: transparent;
}
/* Colors for Formelements */
input.text,input.small {
border: 1px solid #256777;
background: #fff;
color: #000;
}
select {
background: #FFF;
color: #000;
}
textarea {
background: #B3C2C0;
color: #4E5665;
}
/* disabled textarea when editign rows in SQLBrowser */
.off {
background-color: #ccc !important;
}
/* for Geckos */
input[disabled] {
color: #888 !important;
border: 1px solid #CAC8BB !important;
}
/*horizontal menu */
#hormenu ul {
border-bottom: thin solid #D5DDDC;
margin-bottom: 8px;
width: 80%;
}
#hormenu ul li {
display: inline;
}
#hormenu ul li a {
font: 11px/20px verdana, sans-serif;
text-decoration: none;
color: #4E5665;
padding: 0 14px;
border: 0;
}
#hormenu ul li a:hover {
color: #E87B00;
}
#hormenu ul li#active a {
font: bold 11px/ 20px verdana, sans-serif;
text-decoration: none;
color: #E87B00;
float: left;
padding: 0 14px;
}
#hormenu ul li#active a:hover {
color: #E87B00;
}
/* special elements */
.MySQLbox {
font-size: 10pt;
padding: 0px;
background: #000;
color: #fff;
border: thin solid #999999;
height: 200px;
width: 100%;
text-align: left;
overflow: auto;
}
#content #sqlheaderbox,.sqlbox-warning {
white-space: nowrap;
vertical-align: top;
padding: 8px;
background: url(pics/bg-buttons.gif) repeat-x;
border: 1px solid #ddd;
color: #256777;
line-height: 22px;
}
#sqlheaderbox .Formbutton {
line-height: 14px;
padding: 2px;
margin: 0px;
}
#sqltextarea {
margin-right: 30px !important;
width: 100% !important;
overflow: auto;
}
#content #sqleditbox {
border: 1px solid #738C88;
background: #EEEEEE;
margin-bottom: 10px;
}
#content #sqleditbox form {
margin: 10px;
}
#content #sqleditbox p {
background: #A5B6B4;
font-weight: bold;
text-align: center;
}
#content #sqlnewbox {
border: 1px solid #738C88;
background: #E4E9E8;
}
#content #sqlnewbox p {
background: #A5B6B4;
font-weight: bold;
text-align: center;
}
#content #sqloutbox {
font-size: 11px;
width: 700px;
padding: 6px;
background: #D5DDDC;
border: 1px solid #738C88;
overflow: auto;
}
#content p.autodel {
font-size: 11px;
border-bottom: 1px dashed #fff;
margin-bottom: 12px;
}
#content .Logbox {
font: 12px/1.2 "Courier New", Courier, monospace;
padding: 6px;
border: 1px solid #ddd;
height: 320px;
width: 90%;
text-align: left;
overflow: auto;
}
#content .Logbox span {
color: #738C88;
}
#content .backupmsg {
padding-left: 20px;
font-size: 11px;
}
#content .backupmsg .success,#content .backupmsg a {
color: #999;
font-size: 11px;
}
#content .backupmsg .error {
color: red;
}
/* TEXT */
h1 {
font-size: 16px;
}
h5 {
font-size: 1.7em;
font-weight: normal;
color: #256777;
margin: 20px 0 10px;
}
h6 {
font-size: 1.5em;
font-weight: normal;
color: #256777;
margin: 10px 0;
padding-left: 4px;
background: url(pics/bg-headings.gif) repeat-x;
}
/* Config */
#configleft {
float: left;
width: 180px;
}
#configleft .Formbutton {
width: 160px;
margin: 4px 0;
}
#configright {
margin-left: 180px;
}
#footer {
margin-top: 36px;
padding: 10px 0;
border-top: 1px solid #eee;
font-size: 10px;
text-align: right;
}
#version {
position:absolute;
top:60px;
left:0;
margin:0;
padding:0;
height:90px;
color: #4E5665;
z-index:10;
}
.version-line
{
position:absolute;
top:-20px;
left:0;
width:190px;
text-align:center;
font: 11px/20px verdana, sans-serif;
}
#version a:link,
#version a:active,
#version a:hover,
#version a:visited
{ color: #4E5665; }
#selectConfig
{
position:absolute;
top:360px;
left:0;
width:190px;
height: 196px;
z-index:5;
}
#footer a {
text-decoration: none;
}
#footer a:hover {
text-decoration: underline;
}
#ilog {
border: 1px solid #ddd !important;
padding: 12px;
background-color: #fcfcfc;
}
.right {
text-align: right;
}
.center {
text-align: center;
}

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 43 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 985 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 1.4 KiB

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 1003 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 998 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 547 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 994 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 1001 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 359 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 74 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 138 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 296 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 979 B

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 4.7 KiB

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 43 B

Datei anzeigen

@ -1,708 +0,0 @@
/*
@MySQLDumper STYLESHEET
@name msd_green
@copyright MySQLDumper - Daniel Schlichtholz <http://www.mysqldumper.de>
@author Ingo Wagener <http://www.vorderdeck.de>, Daniel Schlichtholz, Christian Gresshoener <http://www.gresshoener.de>
@date 2006-04-11 16:26:00
@lastmodified 2009-09-15 00:21:30
@media screen and projection
*/
*,.normargin {
margin: 0;
padding: 0;
}
img {
border: 0;
}
body {
font: 12px/1.5 Verdana, Helvetica, sans-serif; /* Important IE Bugfix: No spaces in font-attribute between px and slash */
color: #4E5665;
background: #C7D1D0;
}
body.content {
min-width: 540px;
}
.menu-frame {
font: 12px/1.5 Verdana, Helvetica, sans-serif;
background-color: #738C88;
color: #eee;
}
/* LINKS */
a {
color: #4E5665;
text-decoration: underline;
font: 12px verdana, sans-serif
}
a:hover {
color: #E87B00;
text-decoration: none
}
a.ul {
text-decoration: underline;
}
/* general */
#pagetitle {
font-size: 1.5em;
font-weight: bold;
background: url(pics/pagetitle.gif);
background-repeat: repeat-x;
letter-spacing: 2px;
color: white;
padding: 2px 6px;
border-bottom: 1px solid #A9AFBB;
height: 26px;
overflow: hidden;
}
#server0 {
position: absolute;
bottom: 4px;
text-align: center;
left: 10px;
color: white;
}
#server1 {
position: absolute;
right: 16px;
text-align: center;
padding: 10px;
}
a.server {
color: #333333;
font-size: 10px;
}
a.server:hover {
text-decoration: underline;
color: white;
}
.version {
display: block;
position: absolute;
top: 31px;
left: 0;
width: 190px;
z-index: 5;
text-align: center;
font-size: 11px;
font-weight: bold;
}
.small {
font-size: 11px;
}
.ssmall {
font-size: 10px;
}
.success {
font-weight: bold;
}
.error {
color: red;
font-weight: bold;
}
.explain {
text-decoration: none;
border-bottom: 1px dotted;
}
.explain:hover {
cursor: help;
}
.active_db {
font-weight: bold;
border-bottom: 1px dotted;
color: #9AA2B1;
}
table td {
text-align: left;
vertical-align: top;
padding: 0 6px;
}
table th {
padding: 0 6px;
}
table.bdr,.bdr {
border: 1px solid #ddd !important;
border-collapse: collapse !important;
}
/* MENU */
#wrapmenu {
background: url(pics/pagetitle.gif) #A9AFBB;
background-repeat: repeat-x;
}
#db-select {
font: 12px Verdana, Helvetica, sans-serif;
color: #4E5665;
background: #A9AFBB;
}
#menu {
position:absolute;
margin: 0px;
top: 222px;
left:0;
width:190px;
height:160px;
background-color: #738C88;
border-top: 1px solid #9AA2B1
}
#menu ul {
list-style: none;
}
#menu ul li {
height: 20px;
}
#menu ul li a {
display: block;
position: relative; /*fuer den ie*/
font: 11px/20px verdana, sans-serif;
text-decoration: none;
color: #4E5665;
background: url(pics/mainnavi.gif) repeat-x 0 -20px;
padding: 0 15px;
height: 20px;
text-align: left;
}
#menu ul li a:hover {
color: #fff;
background: url(pics/mainnavi.gif) repeat-x 0 0px;
}
/*der aktive link in der navi*/
#menu ul li.active a {
font-weight: bold;
color: #fff;
background: url(pics/mainnavi.gif) repeat-x 0 -40px;
display: block;
}
#menu p,#menu p a {
color: #fff;
line-height: 1.5;
font-size: 11px;
}
#version {
position:absolute;
top:30px;
left:0;
margin:0;
padding:0;
height:191px;
color: #4E5665;
z-index:10;
border-top:1px solid #A9AFBB;
}
.version-line
{
position:absolute;
top:-1px;
left:0;
width:190px;
text-align:center;
font: 11px/20px verdana, sans-serif;
}
#version a:link,
#version a:active,
#version a:hover,
#version a:visited
{ color: #4E5665; }
#selectConfig
{
position:absolute;
top:380px;
left:0;
width:190px;
height: 196px;
z-index:5;
}
table.bdr,.bdr {
border: 1px solid #4E5665 !important;
border-collapse: collapse !important;
}
#db-selectbox,#config-selectbox {
position: relative;
top: 0px;
width: 190px;
background: transparent;
text-align: center;
font: 11px/1.5 Verdana, Helvetica, sans-serif;
color: white;
}
#db-selectbox a,#config-selectbox a {
font: 11px/1.5 Verdana, Helvetica, sans-serif;
color: white;
text-decoration: underline;
}
#db-selectbox a:hover,#config-selectbox a:hover {
text-decoration: none
}
fieldset {
margin: 10px;
padding: 5px;
border: 1px solid #ddd;
color: #256777;
}
body.content legend {
font-weight: bold;
}
body.menu fieldset p {
margin: 5px 0 0;
text-align: center;
}
#configSelect legend,#dbSelect legend,#dbSelect a {
font: 11px/1.5 Verdana, Helvetica, sans-serif;
color: #eee;
}
/* MAIN */
#topnavi {
list-style: none;
margin: 10px 0 20px;
padding: 5px 0px;
}
#topnavi li {
float: left;
margin-right: 6px;
}
#topnavi li a {
float: left;
font: 0.8em verdana, arial, sans-serif;
border: 1px solid #4E5665;
background-color: #A9B2B1;
color: #4E5665;
margin: 3px;
padding: 3px 23px 4px 23px;
cursor: pointer;
text-decoration: none;
white-space: nowrap;
}
#topnavi li a span {
display: none;
}
#content {
margin-left: 12px;
background-color: #C7D1D0;
}
#content p {
margin-bottom: 8px;
}
/*Tabellen */
table tr.dbrow {
background: #E4E9E8;
}
table tr.dbrow1 {
background: #D5DDDC;
}
table tr.dbrowsel {
background: #fff;
}
table td.treffer {
background: #000;
}
/* Treffer bei der MySQL-Suche */
table tr.dbrow .treffer,table tr.dbrow1 .treffer {
color: yellow;
background-color: #738C88;
}
table.bordersmall,table.border {
border: 2px solid #738C88;
width: 84%;
}
table.border th,table.bordersmall th {
font-size: 11px;
color: #738C88;
}
table tr.thead th,table tr.thead td {
background-color: #A5B6B4;
color: #738C88;
border: 1px solid #738C88;
}
table.border tr.thead,table.bordersmall tr.thead {
height: 24px;
}
table td.sum {
background-color: red;
font-weight: bold;
text-align: right;
}
table.bordersmall input,table.bordersmall select,table.bordersmall td,#sqlheaderbox select
{
border: 1px solid #738C88;
font-size: 11px;
}
.tdcompact {
width: 100px;
height: 16px;
overflow: hidden;
font-size: 11px;
}
.tdnormal {
white-space: nowrap;
padding: 4px;
}
.sqlheadmenu a {
}
/* FORM-Elements */
#content .Formbutton,#content .Formtext {
white-space: nowrap;
margin: 6px;
font: 10px verdana, sans-serif;
border: 1px solid #4E5665;
background: #A9B2B1;
color: #4E5665;
padding: 2px 10px;
cursor: pointer;
overflow: visible;
text-decoration: none;
}
#content a.Formbutton {
padding: 2px 23px 3px 23px;
}
label {
cursor: pointer;
}
.Formbutton {
cursor: pointer;
}
.Formbutton:disabled {
cursor: default !important;
}
#content .Formtext {
padding: 2px;
overflow: hidden;
cursor: text;
}
#content .SQLbutton {
font-size: 11px;
background: #E4E9E8;
cursor: pointer;
}
#content textarea #thta {
font-size: 11px;
color: blue;
width: 400px;
height: 300px;
overflow: scroll;
}
#content textarea {
width: 100%;
background: #B3C2C0;
}
input.radio,input.checkbox {
background-color: transparent;
}
/* Colors for Formelements */
input.text,input.small {
background: #B3C2C0;
color: #4E5665;
}
select {
background: #B3C2C0;
color: #4E5665;
}
textarea {
background: #B3C2C0;
color: #4E5665;
}
/* for Geckos */
input[disabled] {
color: #888 !important;
}
/*horizontales Men<65> */
#hormenu {
}
#hormenu ul {
border-bottom: thin solid #D5DDDC;
margin-bottom: 8px;
width: 80%;
}
#hormenu ul li {
display: inline;
}
#hormenu ul li a {
font: 11px/20px verdana, sans-serif;
text-decoration: none;
color: #4E5665;
padding: 0 14px;
border: 0;
}
#hormenu ul li a:hover {
color: #E87B00;
}
#hormenu ul li#active a {
font: bold 11px/20px verdana, sans-serif;
text-decoration: none;
color: #E87B00;
float: left;
padding: 0 14px;
}
#hormenu ul li#active a:hover {
color: #E87B00;
}
/* spezielle Elemente */
.MySQLbox {
font-size: 10pt;
padding: 6px;
background: #000;
color: #fff;
border: thin solid #999999;
height: 200px;
width: 80%;
text-align: left;
overflow: auto;
}
#content #mysqlbox {
border: 1px solid #738C88;
background: #D5DDDC;
}
#content #sqlheaderbox,.sqlbox-warning {
white-space: nowrap;
vertical-align: top;
padding: 8px;
border: 1px solid #738C88;
color: #256777;
line-height: 22px;
}
#sqlheaderbox .Formbutton {
line-height: 12px;
padding: 2px;
margin: 0px;
}
#sqltextarea {
width: 100% !important;
overflow: auto;
background-color: #B3C2C0;
}
#content #sqlheaderbox {
white-space: nowrap;
height: 20px;
vertical-align: middle;
padding-top: 2px;
}
#content #sqleditbox {
border: 1px solid #738C88;
background: #E4E9E8;
margin-bottom: 10px;
}
#content #sqleditbox form {
margin: 10px;
}
#content #sqleditbox p {
background: #A5B6B4;
font-weight: bold;
text-align: center;
}
#content #sqlnewbox {
border: 1px solid #738C88;
background: #E4E9E8;
}
#content #sqlnewbox p {
background: #A5B6B4;
font-weight: bold;
text-align: center;
}
#content #sqloutbox {
font-size: 11px;
width: 700px;
padding: 6px;
background: #D5DDDC;
border: 1px solid #738C88;
overflow: auto;
height: 240px;
}
#content p.autodel {
font-size: 11px;
border-bottom: 1px dashed #fff;
margin-bottom: 12px;
}
#content .Logbox {
font: 12px/1.2 "Courier New", Courier, monospace;
padding: 6px;
border: thin solid #738C88;
height: 320px;
width: 90%;
text-align: left;
overflow: auto;
}
#content .Logbox span {
color: #738C88;
}
#content .backupmsg {
padding-left: 20px;
font-size: 11px;
}
#content .backupmsg .success,#content .backupmsg a {
color: #999;
font-size: 11px;
}
#content .backupmsg .error {
color: red;
}
/* TEXT */
h1 {
font-size: 16px;
}
h5 {
font-size: 14px;
margin: 12px 0;
}
h6 {
font-size: 11px;
background: #D1D4DC;
border: 1px solid #9AA2B1;
text-indent: 12px;
margin: 8px 0;
}
/* Config */
#configleft {
float: left;
width: 160px;
margin-top: 24px;
}
#configleft .Formbutton {
width: 130px;
margin: 8px 0;
}
#configleft .ConfigButton {
width: 130px;
font-size: 11px;
background: #E4E9E8;
cursor: pointer;
}
#configleft .ConfigButtonSelected {
width: 130px;
font-size: 11px;
background: #D5DDDC;
}
#configright {
font-size: 11px;
margin-left: 160px;
}
#configright fieldset {
border: 1px solid #D5DDDC;
padding: 12px;
width: 90%;
}
#configright legend {
color: #646968;
margin: 8px 0;
}
#footer {
font-size: 11px;
text-align: center;
border-top: 1px dashed #eee;
margin-top: 36px;
}
#footer a {
font-size: 11px;
}

452
dump.php
Datei anzeigen

@ -1,452 +0,0 @@
<?php
if (!@ob_start("ob_gzhandler")) @ob_start();
session_name('MySQLDumper');
session_start();
$aus2=$page_parameter=$a=$out='';
include_once ('./inc/functions_dump.php');
// beim Erstaufruf Konfigurationsdatei auslesen und in Session speichern
if (isset($_GET['config']))
{
// Session loeschen, damit keine alten Werte des letzten Laufs uebernommen werden
if (isset($_SESSION['dump'])) unset($_SESSION['dump']);
$search=array(
'/','\\',':','@');
$replace=array(
'','','','');
$config_file=str_replace($search,$replace,$_GET['config']);
if (is_readable($config['paths']['config'].$config_file.'.php'))
{
$config['files']['parameter']=$config['paths']['config'].$config_file.'.php';
$_SESSION['config_file']=$config_file;
read_config($config['paths']['config'].$config['files']['parameter']);
$_SESSION['config']=$config;
}
else
die("Hacking attempt or configuration not found!");
}
$config=$_SESSION['config'];
include ('./'.$config['files']['parameter']);
$config['files']['iconpath']='./css/'.$config['theme'].'/icons/';
include ('./inc/mysql.php');
include ('./language/'.$config['language'].'/lang.php');
include ('./language/'.$config['language'].'/lang_dump.php');
$pageheader=MSDHeader();
$DumpFertig=0;
$relativ_path='./';
$flipped=array_flip($databases['Name']);
if (isset($_SESSION['dump'])&&!isset($_GET['config']))
{
$dump=$_SESSION['dump'];
}
else
{
$dump['tables']=Array();
$dump['records']=Array();
$dump['skip_data']=Array();
$dump['totalrecords']=0;
$dump['dbindex']=0;
//$_POST-Parameter lesen
$dump['kommentar']=(isset($_GET['comment'])) ? urldecode($_GET['comment']):'';
if (isset($_POST['kommentar'])) $dump['kommentar']=urldecode($_POST['kommentar']);
if (get_magic_quotes_gpc()) $dump['kommentar']=stripslashes($dump['kommentar']);
$dump['backupdatei']=(isset($_POST['backupdatei'])) ? $_POST['backupdatei']:'';
$dump['part']=(isset($_POST['part'])) ? $_POST['part']:1;
$dump['part_offset']=(isset($_POST['part_offset'])) ? $_POST['part_offset']:0;
$dump['verbraucht']=(isset($_POST['verbraucht'])) ? $_POST['verbraucht']:0;
$dump['errors']=(isset($_POST['errors'])) ? $_POST['errors']:0;
$dump['table_offset']=(isset($_POST['table_offset'])) ? $_POST['table_offset']:-1;
$dump['zeilen_offset']=(isset($_POST['zeilen_offset'])) ? $_POST['zeilen_offset']:0;
$dump['filename_stamp']=(isset($_POST['filename_stamp'])) ? $_POST['filename_stamp']:'';
$dump['anzahl_zeilen']=(isset($_POST['anzahl_zeilen'])) ? $_POST['anzahl_zeilen']:(($config['minspeed']>0) ? $config['minspeed']:50);
$dump['dump_encoding']=(isset($_POST['dump_encoding'])) ? urldecode($_POST['dump_encoding']):'';
if (isset($_GET['sel_dump_encoding']))
{
// Erstaufruf -> encoding auswerten
include_once ('./inc/functions_sql.php');
get_sql_encodings();
$encodingline=$config['mysql_possible_character_sets'][$_GET['sel_dump_encoding']];
$encoding=explode(' ',$encodingline);
$dump['dump_encoding']=isset($encoding[0]) ? $encoding[0]:$encodingline;
}
include ('./inc/define_icons.php');
$dump['tabellen_gesamt']=0;
}
$mp2=array(
'Bytes','Kilobytes','Megabytes','Gigabytes');
FillMultiDBArrays();
if ($databases['db_actual_tableselected']!=''&&$config['multi_dump']==0)
{
$dump['tblArray']=explode('|',$databases['db_actual_tableselected']);
$tbl_sel=true;
$msgTbl=sprintf($lang['L_NR_TABLES_SELECTED'],count($dump['tblArray']));
}
// Korrektur -> Multi-DB-Array ist gefuellt (damit die Infos in der Konfig nicht verloren gehen), aber Multidump ist nicht aktiviert)
if ($config['multi_dump']==0)
{
unset($databases['multi']);
$databases['multi']=array();
$databases['multi'][0]=$databases['db_actual'];
}
else
{
// wenn Multidump aktiviert ist, aber keine DB gewaehlt wurde -> aktuelle DB uebernehmen
if (!isset($databases['multi'][0])) $databases['multi'][0]=$databases['db_actual'];
// find correct dbindex -> take dbname from $databases['multi'] and get the correct index
// from $databases['Name'] -> needed to set $dump['dbindex'] for first run of command_before_dump
$dump['dbindex']=$flipped[$databases['multi'][0]];
}
//Zeitzähler aktivieren
$dump['max_zeit']=intval($config['max_execution_time']*$config['time_buffer']);
$dump['startzeit']=time();
$xtime=(isset($_POST['xtime'])) ? $_POST['xtime']:time();
$dump['countdata']=(!empty($_POST['countdata'])) ? $_POST['countdata']:0;
$dump['aufruf']=(!empty($_POST['aufruf'])) ? $_POST['aufruf']:0;
MSD_mysql_connect($dump['dump_encoding']);
if ($dump['table_offset']==-1) ExecuteCommand('b');
// only read tableinfos the first time and save it to session to speed up backing up process
if (!isset($_SESSION['dump'])) getDBInfos();
$num_tables=count($dump['tables']);
if ($config['optimize_tables_beforedump']==1&&$dump['table_offset']==-1) $out.=sprintf($lang['L_NR_TABLES_OPTIMIZED'],$num_tables).'<br>';
$dump['data']='';
$dump['dbindex']=(isset($_POST['dbindex'])) ? $_POST['dbindex']:$flipped[$databases['multi'][0]];
//Ausgaben-Header bauen
$aus_header[]=headline('Backup: '.(($config['multi_dump']==1) ? 'Multidump ('.count($databases['multi']).' '.$lang['L_DBS'].')':$lang['L_DB'].': '.$databases['Name'][$dump['dbindex']].(($databases['praefix'][$dump['dbindex']]!='') ? ' ('.$lang['L_WITHPRAEFIX'].' <span>'.$databases['praefix'][$dump['dbindex']].'</span>)':'')));
if (isset($aus_error)&&count($aus_error)>0) $aus_header=array_merge($aus_header,$aus_error);
if ($num_tables==0)
{
//keine Tabellen gefunden
$aus[]='<br><br><p class="error">'.$lang['L_ERROR'].': '.sprintf($lang['L_DUMP_NOTABLES'],$databases['Name'][$dump['dbindex']]).'</p>';
if (!$config['multi_dump']==1)
{
echo $pageheader;
echo get_page_parameter($dump);
echo implode("\n",$aus);
echo '</body></html>';
exit();
}
}
else
{
if ($dump['table_offset']==-1)
{
// File anlegen, da Erstaufruf
new_file();
$dump['table_offset']=0; // jetzt kanns losgehen
flush();
}
else
{
// SQL-Befehle ermitteln
$dump['restzeilen']=$dump['anzahl_zeilen'];
WHILE (($dump['table_offset']<$num_tables)&&($dump['restzeilen']>0))
{
$table=substr($dump['tables'][$dump['table_offset']],strpos($dump['tables'][$dump['table_offset']],'|')+1);
$adbname=substr($dump['tables'][$dump['table_offset']],0,strpos($dump['tables'][$dump['table_offset']],'|'));
if ($databases['Name'][$dump['dbindex']]!=$adbname)
{
//neue Datenbank
$dump['data'].="\nSET FOREIGN_KEY_CHECKS=1;";
$dump['data'].="\n".$mysql_commentstring.' EOB'."\n\n";
WriteToDumpFile();
WriteLog('Dump \''.$dump['backupdatei'].'\' finished.');
ExecuteCommand('a');
if ($config['multi_part']==1)
{
$out.=$lang['L_FINISHED'].'<br><div class="backupmsg">';
$dateistamm=substr($dump['backupdatei'],0,strrpos($dump['backupdatei'],'part_')).'part_';
$dateiendung=($config['compression']==1) ? '.sql.gz':'.sql';
for($i=1;$i<($dump['part']-$dump['part_offset']);$i++)
{
$mpdatei=$dateistamm.$i.$dateiendung;
clearstatcache();
$sz=byte_output(@filesize($config['paths']['backup'].$mpdatei));
$out.=$lang['L_FILE'].' <a href="'.$config['paths']['backup'].$mpdatei.'" class="smallblack">'.$mpdatei.' ('.$sz.')</a> '.$lang['L_DUMP_SUCCESSFUL'].'<br>';
}
}
else
{
clearstatcache();
$out.=$lang['L_FINISHED'].'<br><div class="backupmsg"><a href="'.$config['paths']['backup'].$dump['backupdatei'].'" class="smallblack">'.$dump['backupdatei'].' ('.byte_output(filesize($config['paths']['backup'].$dump['backupdatei'])).')</a><br>';
}
if ($config['send_mail']==1) DoEmail();
for($i=0;$i<3;$i++)
{
if ($config['ftp_transfer'][$i]==1) DoFTP($i);
}
if (isset($flipped[$adbname])) $dump['dbindex']=$flipped[$adbname];
$dump['part_offset']=$dump['part']-1;
$out.='</div><br>';
ExecuteCommand('b');
new_file();
}
$aktuelle_tabelle=$dump['table_offset'];
if ($dump['zeilen_offset']==0)
{
if ($config['minspeed']>0)
{
$dump['anzahl_zeilen']=$config['minspeed'];
$dump['restzeilen']=$config['minspeed'];
}
$create_statement='';
$create_statement=get_def($adbname,$table);
if (!($create_statement===false))
{
$dump['data'].=$create_statement;
}
else
{
WriteToDumpFile(); // save data we have up to now
// error reading table definition
$read_create_error=sprintf($lang['L_FATAL_ERROR_DUMP'],$table,$adbname).': '.((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
Errorlog("DUMP",$databases['db_actual'],'',$read_create_error,0);
WriteLog($read_create_error);
if ($config['stop_with_error']>0)
{
die($read_create_error);
}
$dump['errors']++;
}
}
WriteToDumpFile();
if (!in_array($adbname.'|'.$table,$dump['skip_data'])&&$dump['table_types'][getDBIndex($adbname,$table)]!='VIEW')
{
get_content($adbname,$table);
$dump['restzeilen']--;
}
else
{
// skip data
if ($dump['table_types'][getDBIndex($adbname,$table)]!='VIEW') $dump['data'].='/*!40000 ALTER TABLE `'.$table.'` ENABLE KEYS */;'."\n";
WriteToDumpFile();
$dump['table_offset']++;
}
if ($config['memory_limit']>0&&strlen($dump['data'])>$config['memory_limit']) WriteToDumpFile();
}
}
/////////////////////////////////
// Anzeige - Fortschritt
/////////////////////////////////
if ($config['multi_dump']==1)
{
$mudbs='';
$count_dbs=count($databases['multi']);
for($i=0;$i<$count_dbs;$i++)
{
if ($databases['Name'][$dump['dbindex']]==$databases['multi'][$i]) $mudbs.='<span class="active_db">'.$databases['multi'][$i].'&nbsp;&nbsp;</span> ';
else
$mudbs.='<span class="success">'.$databases['multi'][$i].'&nbsp;&nbsp;</span> ';
}
}
if ($config['multi_part']==1) $aus[]='<h5>Multipart-Backup: '.$config['multipartgroesse1'].' '.$mp2[$config['multipartgroesse2']].'</h5>';
$aus[]='<h4>'.$lang['L_DUMP_HEADLINE'].'</h4>';
if ($dump['kommentar']>'') $aus[]=$lang['L_COMMENT'].': <span><em>'.$dump['kommentar'].'</em></span><br>';
$aus[]=($config['multi_dump']==1) ? $lang['L_DB'].': '.$mudbs:$lang['L_DB'].': <strong>'.$databases['Name'][$dump['dbindex']].'</strong>';
$aus[]=(($databases['praefix'][$dump['dbindex']]!='') ? ' ('.$lang['L_WITHPRAEFIX'].' <span>'.$databases['praefix'][$dump['dbindex']].'</span>)':'').'<br>';
if (isset($tbl_sel)) $aus[]=$msgTbl.'<br><br>';
if ($config['multi_part']==1)
{
$aus[]='<span>Multipart-Backup File <strong>'.($dump['part']-$dump['part_offset']-1).'</strong></span><br>';
$aus2=', '.($dump['part']-1).' files';
}
$aus[]=$lang['L_DUMP_FILENAME'].'<b>'.$dump['backupdatei'].'</b><br>'.$lang['L_CHARSET'].': <strong>'.$dump['dump_encoding'].'</strong>'.
'<br>'.$lang['L_FILESIZE'].': <b>'.byte_output($dump['filesize']).'</b><br><br>'.$lang['L_GZIP_COMPRESSION'].' <b>';
$aus[]=($config['compression']==1) ? $lang['L_ACTIVATED']:$lang['L_NOT_ACTIVATED'];
$aus[]='</b>.<br>';
if ($out>'') $aus[]='<br><span class="smallgrey">'.$out.'</span>';
if (isset($dump['tables'][$dump['table_offset']]))
{
$table=substr($dump['tables'][$dump['table_offset']],strpos($dump['tables'][$dump['table_offset']],'|')+1);
$adbname=substr($dump['tables'][$dump['table_offset']],0,strpos($dump['tables'][$dump['table_offset']],'|'));
// get nr of recorsd from dump-array
$record_string=$dump['records'][$dump['table_offset']];
$record_string=explode('|',$record_string);
$dump['zeilen_total']=$record_string[1];
if ($dump['zeilen_total']>0) $fortschritt=intval((100*$dump['zeilen_offset'])/$dump['zeilen_total']);
else
$fortschritt=100;
$aus[]=$lang['L_SAVING_TABLE'].'<b>'.($dump['table_offset']+1).'</b> '.$lang['L_OF'].'<b> '.sizeof($dump['tables']).'</b><br>'.$lang['L_ACTUAL_TABLE'].': <b>'.$table.'</b><br><br>'.$lang['L_PROGRESS_TABLE'].':<br>';
$aus[]='<table border="0" width="380"><tr>'.'<td width="'.($fortschritt*3).'"><img src="'.$config['files']['iconpath'].'progressbar_dump.gif" alt="" width="'.($fortschritt*3).'" height="16" border="0"></td>'.'<td width="'.((100-$fortschritt)*3).'">&nbsp;</td>'.'<td width="80" align="right">'.($fortschritt).'%</td>';
if ($dump['anzahl_zeilen']+$dump['zeilen_offset']>=$dump['zeilen_total'])
{
$eintrag=$dump['zeilen_offset']+1;
$zeilen_gesamt=$dump['zeilen_total'];
if ($zeilen_gesamt==0) $eintrag=0;
}
else
{
$zeilen_gesamt=$dump['zeilen_offset']+$dump['anzahl_zeilen'];
$eintrag=$dump['zeilen_offset']+1;
}
$aus[]='</tr><tr>'.'<td colspan="3">'.$lang['L_ENTRY'].' <b>'.number_format($eintrag,0,',','.').'</b> '.$lang['L_UPTO'].' <b>'.number_format(($zeilen_gesamt),0,',','.').'</b> '.$lang['L_OF'].' <b>'.number_format($dump['zeilen_total'],0,',','.').'</b></td></tr></table>';
$dump['tabellen_gesamt']=(isset($dump['tables'])) ? count($dump['tables']):0;
$noch_zu_speichern=$dump['totalrecords']-$dump['countdata'];
$prozent=($dump['totalrecords']>0) ? round(((100*$noch_zu_speichern)/$dump['totalrecords']),0):100;
if ($noch_zu_speichern==0||$prozent>100) $prozent=100;
$aus[]="\n".'<br>'.$lang['L_PROGRESS_OVER_ALL'].':'."\n".'<table border="0" width="550" cellpadding="0" cellspacing="0"><tr>'.'<td width="'.(5*(100-$prozent)).'"><img src="'.$config['files']['iconpath'].'progressbar_dump.gif" alt="" width="'.(5*(100-$prozent)).'" height="16" border="0"></td>'.'<td width="'.($prozent*5).'" align="center"></td>'.'<td width="50">'.(100-$prozent).'%</td></tr></table>';
//Speed-Anzeige
$fw=($config['maxspeed']==$config['minspeed']) ? 300:round(($dump['anzahl_zeilen']-$config['minspeed'])/($config['maxspeed']-$config['minspeed'])*300,0);
if ($fw>300) $fw=300;
$aus[]='<br><table border="0" cellpadding="0" cellspacing="0"><tr>'.'<td class="nomargin" width="60" valign="top" align="center" style="font-size:10px;" >'.'<strong>Speed</strong><br>'.$dump['anzahl_zeilen'].'</td><td class="nomargin" width="300">'.'<table border="0" width="100%" cellpadding="0" cellspacing="0"><tr>'.'<td class="nomargin small" align="left" width="300" nowrap="nowrap">'.'<img src="'.$config['files']['iconpath'].'progressbar_speed.gif" alt="" width="'.$fw.'" height="14" border="0" vspace="0" hspace="0">'.'</td></tr></table><table border="0" width="100%" cellpadding="0" cellspacing="0"><tr>'.'<td class="nomargin" align="left" nowrap="nowrap" style="font-size:10px;" >'.$config['minspeed'].'</td>'.'<td class="nomargin" nowrap="nowrap" style="font-size:10px;text-align:right;" >'.$config['maxspeed'].'</td>'.'</tr></table>'."\n".'</td></tr></table>'.
//Status-Text
'<p class="small">'.zeit_format(time()-$xtime).', '.$dump['aufruf'].' '.$lang['L_PAGE_REFRESHS'].$aus2;
$aus[]=($dump['errors']>0) ? ', <span style="color:red;">'.$dump['errors'].' errors</span>':'';
$aus[]='</p>';
}
else
$dump['table_offset']++;
// Ende Anzeige
WriteToDumpFile();
if (!isset($summe_eintraege)) $summe_eintraege=0;
if ($dump['table_offset']<=$dump['tabellen_gesamt'])
{
$dauer=time()-($xtime+$dump['verbraucht']);
$dump['verbraucht']+=$dauer;
$summe_eintraege+=$dump['anzahl_zeilen'];
//Zeitanpassung
if ($dauer<$dump['max_zeit'])
{
$dump['anzahl_zeilen']=$dump['anzahl_zeilen']*$config['tuning_add'];
if ($dauer<$dump['max_zeit']/2) $dump['anzahl_zeilen']*=1.8;
if ($dump['anzahl_zeilen']>$config['maxspeed']) $dump['anzahl_zeilen']=$config['maxspeed'];
}
else
{
$dump['anzahl_zeilen']=$dump['anzahl_zeilen']*$config['tuning_sub'];
if ($dump['anzahl_zeilen']<$config['minspeed']) $dump['anzahl_zeilen']=$config['minspeed'];
}
$dump['anzahl_zeilen']=intval($dump['anzahl_zeilen']);
$dump['aufruf']++;
}
else
{
//Backup fertig
$dump['data']="\nSET FOREIGN_KEY_CHECKS=1;";
$dump['data'].="\n".$mysql_commentstring.' EOB'."\n\n";
WriteToDumpFile();
ExecuteCommand('a');
chmod($config['paths']['backup'].$dump['backupdatei'],0777);
if ($config['multi_part']==1)
{
$out.="\n".'<br><div class="backupmsg">';
$dateistamm=substr($dump['backupdatei'],0,strrpos($dump['backupdatei'],'part_')).'part_';
$dateiendung=($config['compression']==1) ? '.sql.gz':'.sql';
clearstatcache();
for($i=1;$i<($dump['part']-$dump['part_offset']);$i++)
{
$mpdatei=$dateistamm.$i.$dateiendung;
$sz=byte_output(@filesize($config['paths']['backup'].$mpdatei));
$out.="\n".$lang['L_FILE'].' <a href="'.$config['paths']['backup'].$mpdatei.'" class="smallblack">'.$mpdatei.' ('.$sz.')</a> '.$lang['L_DUMP_SUCCESSFUL'].'<br>';
}
}
else
$out.="\n".'<div class="backupmsg">'.$lang['L_FILE'].' <a href="'.$config['paths']['backup'].$dump['backupdatei'].'" class="smallblack">'.$dump['backupdatei'].' ('.byte_output(filesize($config['paths']['backup'].$dump['backupdatei'])).')'.'</a>'.$lang['L_DUMP_SUCCESSFUL'].'<br>';
$xtime=time()-$xtime;
$aus=Array();
$aus[]='<br>'."\n";
if ($config['multi_dump']==1)
{
WriteLog('Dump \''.$dump['backupdatei'].'\' finished.');
WriteLog('Multidump: '.count($databases['multi']).' Databases in '.zeit_format($xtime).'.');
}
else
WriteLog('Dump \''.$dump['backupdatei'].'\' finished in '.zeit_format($xtime).'.');
if ($config['send_mail']==1) DoEmail();
for($i=0;$i<3;$i++)
{
if ($config['ftp_transfer'][$i]==1) DoFTP($i);
}
$aus[]='<strong>'.$lang['L_DONE'].'</strong><br>';
if ($config['multi_dump']==1)
{
$aus[]=sprintf($lang['L_MULTIDUMP'],count($databases['multi'])).': ';
$aus[]='<strong>'.implode(', ',$databases['multi']).'</strong>';
$aus2='';
$out='';
}
else
{
$aus[]='<br>'.sprintf($lang['L_DUMP_ENDERGEBNIS'],$num_tables,number_format($dump['countdata'],0,',','.'));
}
if ($dump['errors']>0) $aus[]=sprintf($lang['L_DUMP_ERRORS'],$dump['errors']);
$aus[]='<form action="dump.php?MySQLDumper='.session_id().'" method="POST">'.$out.'<br>'.'<p class="small">'.zeit_format($xtime).', '.$dump['aufruf'].' '.$lang['L_PAGE_REFRESHS'].$aus2.'</p>'."\n";
$aus[]="\n".'<br><input class="Formbutton" type="button" value="'.$lang['L_BACK_TO_CONTROL'].'" onclick="self.location.href=\''.$relativ_path.'filemanagement.php\'">';
$aus[]='&nbsp;&nbsp;&nbsp;<input class="Formbutton" type="button" value="'.$lang['L_BACK_TO_MINISQL'].'" onclick="self.location.href=\''.$relativ_path.'sql.php\'">';
$aus[]='&nbsp;&nbsp;&nbsp;<input class="Formbutton" type="button" value="'.$lang['L_BACK_TO_OVERVIEW'].'" onclick="self.location.href=\''.$relativ_path.'main.php?action=db&amp;dbid='.$dump['dbindex'].'#dbid\'"><br><br>';
$aus[]='</div></form>';
$DumpFertig=1;
}
}
//=====================================================================
//================= Anzeige ===========================================
//=====================================================================
//Seite basteln
$aus=array_merge($aus_header,$aus);
$dump['xtime']=$xtime;
if ($DumpFertig!=1)
{
// save actual values to session
$_SESSION['dump']=$dump;
$page_parameter=get_page_parameter($dump);
$pagefooter='</body></html>';
$selbstaufruf=$page_parameter.'<script language="javascript" type="text/javascript">setTimeout("document.dump.submit()", 10);</script></div>';
}
else
{
$dump=array();
$_SESSION['dump']=$dump;
$pagefooter=MSDFooter('',1);
$selbstaufruf='';
}
$complete_page=$pageheader.implode("\n",$aus)."\n".$selbstaufruf."\n".$pagefooter;
echo $complete_page;
ob_end_flush();

Datei anzeigen

@ -1,540 +0,0 @@
<?php
if (isset($_GET['action'])&&$_GET['action']=='dl') $download=true;
include ('./inc/header.php');
include_once ('./language/'.$config['language'].'/lang.php');
include_once ('./language/'.$config['language'].'/lang_filemanagement.php');
include_once ('./language/'.$config['language'].'/lang_config_overview.php');
include_once ('./language/'.$config['language'].'/lang_main.php');
include_once ('./inc/functions_files.php');
include_once ('./inc/functions_sql.php');
$msg='';
$dump=array();
if ($config['auto_delete']==1) $msg=AutoDelete();
get_sql_encodings(); // get possible sql charsets and also get default charset
//0=Datenbank 1=Struktur
$action=(isset($_GET['action'])) ? $_GET['action'] : 'files';
$kind=(isset($_GET['kind'])) ? $_GET['kind'] : 0;
$expand=(isset($_GET['expand'])) ? $_GET['expand'] : -1;
$selectfile=(isset($_POST['selectfile'])) ? $_POST['selectfile'] : "";
$destfile=(isset($_POST['destfile'])) ? $_POST['destfile'] : "";
$compressed=(isset($_POST['compressed'])) ? $_POST['compressed'] : "";
$dk=(isset($_POST['dumpKommentar'])) ? ((get_magic_quotes_gpc()) ? stripslashes($_POST['dumpKommentar']) : $_POST['dumpKommentar']) : "";
$dk=str_replace(':','|',$dk); // remove : because of statusline
$dump['sel_dump_encoding']=(isset($_POST['sel_dump_encoding'])) ? $_POST['sel_dump_encoding'] : get_index($config['mysql_possible_character_sets'],$config['mysql_standard_character_set']);
$dump['dump_encoding']=isset($config['mysql_possible_character_sets'][$dump['sel_dump_encoding']]) ? $config['mysql_possible_character_sets'][$dump['sel_dump_encoding']] : 0;
if ($action=='dl')
{
// Download of a backup file wanted
$file='./'.$config['paths']['backup'].urldecode($_GET['f']);
if (is_readable($file))
{
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: '.(string) filesize($file));
flush();
$file=fopen($file,"rb");
while (!feof($file))
{
print fread($file,round(100*1024));
flush();
}
fclose($file);
}
//readfile($file);
exit();
}
if (!@ob_start("ob_gzhandler")) @ob_start();
echo MSDHeader();
$toolboxstring='';
$fpath=$config['paths']['backup'];
$dbactiv=(isset($_GET['dbactiv'])) ? $_GET['dbactiv'] : $databases['db_actual'];
$databases['multi']=Array();
if ($databases['multisetting']=="")
{
$databases['multi'][0]=$databases['db_actual'];
}
else
{
$databases['multi']=explode(";",$databases['multisetting']);
$multi_praefixe=array();
$multi_praefixe=explode(";",$databases['multisetting_praefix']);
$toolboxstring='<br>';
if (is_array($databases['multi']))
{
for ($i=0; $i<sizeof($databases['multi']); $i++)
{
if ($i>0) $toolboxstring.=', ';
$toolboxstring.=$databases['multi'][$i];
if ($multi_praefixe[$i]>'') $toolboxstring.=' (<i>\''.$multi_praefixe[$i].'\'</i>)';
}
}
}
//*** Abfrage ob Dump nach Tabellenaufruf ***
if (isset($_POST['dump_tbl']))
{
$check_dirs=TestWorkDir();
if (!$check_dirs===true) die($check_dirs);
$databases['db_actual_tableselected']=substr($_POST['tbl_array'],0,strlen($_POST['tbl_array'])-1);
WriteParams();
$dump['fileoperations']=0;
echo '<script language="JavaScript" type="text/javascript">parent.MySQL_Dumper_content.location.href="dump.php?comment='.urlencode($dk).'&sel_dump_encoding='.$dump['sel_dump_encoding'].'&config='.urlencode($config['config_file']).'";</script></body></html>';
exit();
}
//*** Abfrage ob Dump ***
if (isset($_POST['dump']))
{
if (isset($_POST['tblfrage'])&&$_POST['tblfrage']==1)
{
//Tabellenabfrage
$tblfrage_refer="dump";
include ("inc/tabellenabfrage.php");
exit();
}
else
{
@$check_dir=TestWorkDir();
if (!$check_dir===true) die($check_dir);
$databases['db_actual_tableselected']="";
WriteParams();
$dump['fileoperations']=0;
echo '<script language="JavaScript" type="text/javascript">parent.MySQL_Dumper_content.location.href="dump.php?comment='.urlencode($dk).'&sel_dump_encoding='.$dump['sel_dump_encoding'].'&config='.urlencode($config['config_file']).'";</script></body></html>';
exit();
}
}
//*** Abfrage ob Restore nach Tabellenaufruf ***
if (isset($_POST['restore_tbl']))
{
$databases['db_actual_tableselected']=substr($_POST['tbl_array'],0,strlen($_POST['tbl_array'])-1);
WriteParams();
echo '<script language="JavaScript" type="text/javascript">parent.MySQL_Dumper_content.location.href="restore.php?filename='.urlencode($_POST['filename']).'";</script></body></html>';
exit();
}
//*** Abfrage ob Restore ***
if (isset($_POST['restore']))
{
if (isset($_POST['file']))
{
if (isset($_POST['tblfrage'])&&$_POST['tblfrage']==1)
{
//Tabellenabfrage
$tblfrage_refer="restore";
$filename=urldecode($_POST['file'][0]);
include ("inc/tabellenabfrage.php");
exit();
}
else
{
$file=$_POST['file'][0];
$statusline=read_statusline_from_file($file);
if (isset($_POST['sel_dump_encoding_restore']))
{
$encodingstring=$config['mysql_possible_character_sets'][$_POST['sel_dump_encoding_restore']];
$encoding=explode(' ',$encodingstring);
$dump_encoding=$encoding[0];
}
else
{
if (!isset($statusline['charset'])||trim($statusline['charset'])=='?')
{
echo headline($lang['L_FM_RESTORE'].': '.$file);
// if we can't detect encoding ask user
echo '<br>'.$lang['L_CHOOSE_CHARSET'].'<br><br>';
echo '<form action="filemanagement.php?action=restore&amp;kind=0" method="POST">';
echo '<table><tr><td>'.$lang['L_FM_CHOOSE_ENCODING'].':</td><td>';
echo '<select name="sel_dump_encoding_restore">';
echo make_options($config['mysql_possible_character_sets'],$dump['sel_dump_encoding']);
echo '</select></td></tr><tr><td>';
echo $lang['L_MYSQL_CONNECTION_ENCODING'].':</td><td><strong>'.$config['mysql_standard_character_set'].'</strong></td></tr>';
echo '<tr><td colspan="2"><br><input type="submit" name="restore" class="Formbutton" value="'.$lang['L_FM_RESTORE'].'">';
echo '<input type="hidden" name="file[0]" value="'.$file.'">';
echo '</td></tr></table></form></body></html>';
exit();
}
else
$dump_encoding=$statusline['charset'];
}
$databases['db_actual_tableselected']="";
WriteParams();
echo '<script language="JavaScript" type="text/javascript">parent.MySQL_Dumper_content.location.href="restore.php?filename='.$file.'&dump_encoding='.$dump_encoding.'&kind='.$kind.'";</script></body></html>';
exit();
}
}
else
$msg.='<p class="error">'.$lang['L_FM_NOFILE'].'</p>';
}
//*** Abfrage ob Delete ***
$del=array();
if (isset($_POST['delete']))
{
if (isset($_POST['file']))
{
$delfiles=Array();
for ($i=0; $i<count($_POST['file']); $i++)
{
if (!strpos($_POST['file'][$i],"_part_")===false)
{
$delfiles[]=substr($_POST['file'][$i],0,strpos($_POST['file'][$i],"_part_")+6).'*';
}
else
$delfiles[]=$_POST['file'][$i];
}
for ($i=0; $i<count($delfiles); $i++)
{
$del=array_merge($del,DeleteFilesM($fpath,$delfiles[$i]));
}
}
else
$msg.='<p class="error">'.$lang['L_FM_NOFILE'].'</p>';
}
if (isset($_POST['deleteauto']))
{
$delete_result=AutoDelete();
if ($delete_result>'') $msg.='<p class="small">'.$delete_result.'</p>';
}
if (isset($_POST['deleteall'])||isset($_POST['deleteallfilter']))
{
if (isset($_POST['deleteall']))
{
$del=DeleteFilesM($fpath,"*.sql");
$del=array_merge($del,DeleteFilesM($fpath,"*.gz"));
}
else
$del=DeleteFilesM($fpath,$databases['db_actual']."*");
}
// print file-delete-messages
if (is_array($del)&&sizeof($del)>0)
{
foreach ($del as $filename=>$success)
{
if ($success)
{
$msg.='<span class="small">';
$msg.=$lang['L_FM_DELETE1'].' \''.$filename.'\' '.$lang['L_FM_DELETE2'];
WriteLog("deleted '$filename'.");
$msg.='</span><br>';
}
else
{
$msg.='<span class="small error">';
$msg.=$lang['L_FM_DELETE1'].' \''.$filename.'\' '.$lang['L_FM_DELETE3'];
WriteLog("deleted '$filename'.");
$msg.='</span><br>';
}
}
}
// Upload
if (isset($_POST['upload']))
{
$error=false;
if (!isset($_FILES['upfile']['name'])) echo '<span class="error">'.$lang['L_FM_UPLOADFILEREQUEST'].'</span><br><br>';
else
{
if (!file_exists($fpath.$_FILES['upfile']['name']))
{
// Extension ermitteln -strrpos f&auml;ngt hinten an und ermittelt somit den letzten Punkt
$endung=strrchr($_FILES['upfile']['name'],".");
$erlaubt=ARRAY(
".gz", ".sql");
if (!in_array($endung,$erlaubt))
{
$msg.="<font color=\"red\">".$lang['L_FM_UPLOADNOTALLOWED1']."<br>";
$msg.=$lang['L_FM_UPLOADNOTALLOWED2']."</font>";
}
else
{
if (!$error)
{
if (move_uploaded_file($_FILES['upfile']['tmp_name'],$fpath.$_FILES['upfile']['name'])) @chmod($fpath.$upfile_name,0777);
else
$error.="<font color=\"red\">".$lang['L_FM_UPLOADMOVEERROR']."<br>";
}
if ($error) $msg.=$error."<font color=\"red\">".$lang['L_FM_UPLOADFAILED']."</font><br>";
}
}
else
$msg.="<font color=\"red\">".$lang['L_FM_UPLOADFILEEXISTS']."</font><br>";
}
}
//Seitenteile vordefinieren
$href='filemanagement.php?action='.$action.'&amp;kind='.$kind;
$tbl_abfrage='';
if ($config['multi_dump']==0) $tbl_abfrage='<tr><td>'.$lang['L_FM_SELECTTABLES'].'</td><td><input type="checkbox" class="checkbox" name="tblfrage" value="1"></td></tr>';
$dk=(isset($_POST['dumpKommentar'])) ? htmlentities($_POST['dumpKommentar']) : '';
$tbl_abfrage.='<tr><td>'.$lang['L_FM_COMMENT'].':</td><td><input type="text" class="text" style="width:260px;" name="dumpKommentar" value="'.$dk.'"></td></tr>';
$autodel='<p class="autodel">'.$lang['L_AUTODELETE'].": ";
$autodel.=($config['auto_delete']==0) ? $lang['L_NOT_ACTIVATED'] : $lang['L_ACTIVATED'].' ('.$config['max_backup_files'].' '.$lang['L_MAX_BACKUP_FILES_EACH2'].')';
$autodel.='</p>';
//Fallunterscheidung
switch ($action)
{
case 'dump':
$dbName = $databases['Name'][$databases['db_selected_index']];
if ($config['multi_dump']==0 && in_array($dbName, $dontBackupDatabases)) {
echo headline($lang['L_FM_DUMP_HEADER'].' <span class="small">("'.$lang['L_CONFIG_HEADLINE'].': '.$config['config_file'].'")</span>');
echo '<span class="error">'.sprintf($lang['L_BACKUP_NOT_POSSIBLE'], $dbName).'</span>';
break;
}
if ($config['multi_dump']==0) DBDetailInfo($databases['db_selected_index']);
$cext=($config['cron_extender']==0) ? "pl" : "cgi";
$actualUrl=substr($_SERVER['SCRIPT_NAME'],0,strrpos($_SERVER['SCRIPT_NAME'],"/")+1);
if (substr($actualUrl,-1)!="/") $actualUrl.="/";
if (substr($actualUrl,0,1)!="/") $actualUrl="/$actualUrl";
$refdir=(substr($config['cron_execution_path'],0,1)=="/") ? "" : $actualUrl;
$scriptdir=$config['cron_execution_path'].'crondump.'.$cext;
$sfile=$config['cron_execution_path']."perltest.$cext";
$simplefile=$config['cron_execution_path']."simpletest.$cext";
$scriptentry=basePath(). $config['paths']['config'];
$cronabsolute=(substr($config['cron_execution_path'],0,1)=="/") ? $_SERVER['DOCUMENT_ROOT'].$scriptdir : basePath().$scriptdir;
$confabsolute=$config['config_file'];
$scriptref=getServerProtocol().$_SERVER['SERVER_NAME'].$refdir.$config['cron_execution_path'].'crondump.'.$cext."?config=".$confabsolute;
$cronref="perl ".$cronabsolute." -config=".$confabsolute." -html_output=0";
//Ausgabe
echo headline($lang['L_FM_DUMP_HEADER'].' <span class="small">("'.$lang['L_CONFIG_HEADLINE'].': '.$config['config_file'].'")</span>');
if (!is_writable($config['paths']['backup'])) die('<span class="error">'.sprintf($lang['L_WRONG_RIGHTS'],'work/backup','777').'</span>');
echo ($msg>'') ? $msg.'<br>' : '';
echo $autodel;
//Auswahl
echo '<div>
<input type="button" value=" '.$lang['L_DUMP'].' PHP " class="Formbutton" onclick="document.getElementById(\'buperl\').style.display=\'none\';document.getElementById(\'buphp\').style.display=\'block\';">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value=" '.$lang['L_DUMP'].' PERL " class="Formbutton" onclick="document.getElementById(\'buphp\').style.display=\'none\';document.getElementById(\'buperl\').style.display=\'block\';">
</div>';
echo '<div id="buphp">';
//Dumpsettings
echo '<h6>'.$lang['L_DUMP'].' (PHP)</h6>';
echo '<div><form name="fm" id="fm" method="post" action="'.$href.'">';
echo '<input class="Formbutton" name="dump" type="submit" value="';
echo $lang['L_FM_STARTDUMP'].'"><br>';
echo '<br><table>';
echo $tbl_abfrage;
echo '<tr><td><label for="sel_dump_encoding">'.$lang['L_FM_CHOOSE_ENCODING'].'</label></td>';
echo '<td><select name="sel_dump_encoding" id="sel_dump_encoding">';
echo make_options($config['mysql_possible_character_sets'],$dump['sel_dump_encoding']);
echo '</select></td></tr>';
echo '<tr><td>'.$lang['L_MYSQL_CONNECTION_ENCODING'].':</td><td><strong>'.$config['mysql_standard_character_set'].'</strong></td></tr>';
echo '</table>';
echo '</form><br></div>';
echo '<h6>'.$lang['L_FM_DUMPSETTINGS'].' (PHP)</h6>';
echo '<table>';
echo '<tr><td>'.$lang['L_DB'].':</td><td><strong>';
if ($config['multi_dump']==1)
{
echo 'Multidump ('.count($databases['multi']).' '.$lang['L_DBS'].')</strong>';
echo '<span class="small">'.$toolboxstring.'</span>';
}
else
{
echo $databases['db_actual'].'&nbsp;&nbsp;<span>('.$databases['Detailinfo']['tables']." Tables, ".$databases['Detailinfo']['records']." Records, ".byte_output($databases['Detailinfo']['size']).')</span></strong>';
}
echo '</td></tr>';
if ($config['multi_dump']==0&&$databases['praefix'][$databases['db_selected_index']]>'')
{
echo '<tr><td>'.$lang['L_PRAEFIX'].':</td><td><strong>';
echo $databases['praefix'][$databases['db_selected_index']];
echo '</strong></td></tr>';
}
echo '<tr><td>'.$lang['L_GZIP'].':</td><td><strong>'.(($config['compression']==1) ? $lang['L_ACTIVATED'] : $lang['L_NOT_ACTIVATED']);
echo '</strong></td></tr>';
echo '<tr><td>'.$lang['L_MULTI_PART'].':</td><td><strong>'.(($config['multi_part']==1) ? $lang['L_YES'] : $lang['L_NO']);
echo '</strong></td></tr>';
if ($config['multi_part']==1)
{
echo '<tr><td>'.$lang['L_MULTI_PART_GROESSE'].':</td><td><strong>'.byte_output($config['multipart_groesse']).'</strong></td></tr>';
}
if ($config['send_mail']==1)
{
$t=$config['email_recipient'].(($config['send_mail_dump']==1) ? $lang['L_WITHATTACH'] : $lang['L_WITHOUTATTACH']);
}
echo '<tr><td>'.$lang['L_SEND_MAIL_FORM'].':</td><td><strong>'.(($config['send_mail']==1) ? $t : $lang['L_NOT_ACTIVATED']);
echo '</strong></td></tr>';
for ($x=0; $x<3; $x++)
{
if (isset($config['ftp_transfer'][$x])&&$config['ftp_transfer'][$x]>0)
{
echo table_output($lang['L_FTP_TRANSFER'],sprintf(str_replace('<br>',' ',$lang['L_FTP_SEND_TO']),$config['ftp_server'][$x],$config['ftp_dir'][$x]),1,2);
}
}
//echo '</td></tr>';
echo '</table>';
echo '<div style="display:none"><img src="'.$config['files']['iconpath'].'progressbar_dump.gif" alt=""><br><img src="'.$config['files']['iconpath'].'progressbar_speed.gif" alt=""></div>';
echo '</div><div id="buperl" style="display:none;">';
//crondumpsettings
echo '<h6>'.$lang['L_DUMP'].' (PERL)</h6>';
echo '<p><input class="Formbutton" type="Button" name="DoCronscript" value="'.$lang['L_DOCRONBUTTON'].'" onclick="self.location.href=\''.$scriptref.'\'">&nbsp;&nbsp;';
echo '<input class="Formbutton" type="Button" name="DoPerlTest" value="'.$lang['L_DOPERLTEST'].'" onclick="self.location.href=\''.$sfile.'\'">&nbsp;&nbsp;';
echo '<input class="Formbutton" type="Button" name="DoSimpleTest" value="'.$lang['L_DOSIMPLETEST'].'" onclick="self.location.href=\''.$simplefile.'\'"></p>';
echo '<h6>'.$lang['L_FM_DUMPSETTINGS'].' (PERL)</h6>';
if ($config['cron_dbindex']==-3)
{
$cron_dbname=$lang['L_MULTIDUMPALL'];
$cron_dbpraefix="";
}
elseif ($config['cron_dbindex']==-2)
{
//$cron_dbname='Multidump ('.count($databases['multi']).' '.$lang['L_DBS'].')';
$cron_dbname='Multidump ('.count($databases['multi']).' '.$lang['L_DBS'].')</strong>';
$cron_dbname.='<span class="small">'.$toolboxstring.'</span>';
$cron_dbpraefix="";
}
else
{
$cron_dbname=$databases['Name'][$config['cron_dbindex']];
$cron_dbpraefix=$databases['praefix'][$config['cron_dbindex']];
}
echo '<table>';
echo '<tr><td>'.$lang['L_DB'].':</td><td><strong>'.$cron_dbname.'</strong></td></tr>';
if ($cron_dbpraefix>'')
{
echo '<tr><td>'.$lang['L_PRAEFIX'].":</td><td><strong>";
echo $cron_dbpraefix.'</strong></td></tr>';
}
echo '<tr><td>'.$lang['L_GZIP'].":</td><td><strong>".(($config['cron_compression']==1) ? $lang['L_ACTIVATED'] : $lang['L_NOT_ACTIVATED']);
echo '</strong></td></tr>';
echo '<tr><td>'.$lang['L_MULTI_PART'].":</td><td><strong>".(($config['multi_part']==1) ? $lang['L_YES'] : $lang['L_NO']);
echo '</strong></td></tr>';
if ($config['multi_part']==1)
{
echo '<tr><td>'.$lang['L_MULTI_PART_GROESSE'].':</td><td><strong>'.byte_output($config['multipart_groesse']).'</td></tr>';
}
echo '<tr><td>'.$lang['L_CRON_PRINTOUT'].':</td><td><strong>'.(($config['cron_printout']==1) ? $lang['L_ACTIVATED'] : $lang['L_NOT_ACTIVATED']).'</strong></td></tr>';
if ($config['send_mail']==1)
{
$t=$config['email_recipient'].(($config['send_mail_dump']==1) ? $lang['L_WITHATTACH'] : $lang['L_WITHOUTATTACH']);
}
echo '<tr><td>'.$lang['L_SEND_MAIL_FORM'].':</td><td><strong>'.(($config['send_mail']==1) ? $t : $lang['L_NOT_ACTIVATED']).'</strong></td></tr>';
for ($x=0; $x<3; $x++)
{
if (isset($config['ftp_transfer'][$x])&&$config['ftp_transfer'][$x]>0)
{
echo table_output($lang['L_FTP_TRANSFER'],sprintf(str_replace('<br>',' ',$lang['L_FTP_SEND_TO']),$config['ftp_server'][$x],$config['ftp_dir'][$x]),1,2);
}
}
//echo '</td></tr>';
echo '</table>';
// Eintraege fuer Perl
echo '<br><p class="small">'.$lang['L_PERLOUTPUT1'].':<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>'.$scriptentry.'</strong><br>';
echo $lang['L_PERLOUTPUT2'].':<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>'.$scriptref.'</strong><br>';
echo $lang['L_PERLOUTPUT3'].':<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>'.$cronref.'</strong></p>';
echo '</div>';
break;
case 'restore':
echo headline(sprintf($lang['L_FM_RESTORE_HEADER'],$databases['db_actual']));
echo ($msg>'') ? $msg : '';
echo $autodel;
echo '<form name="fm" id="fm" method="post" action="'.$href.'">';
echo '<div>';
echo '<input class="Formbutton" name="restore" type="submit" value="'.$lang['L_FM_RESTORE'].'" onclick="if (!confirm(\''.$lang['L_FM_ALERTRESTORE1'].' `'.$databases['db_actual'].'` '.$lang['L_FM_ALERTRESTORE2'].' `\' + GetSelectedFilename() + \'` '.$lang['L_FM_ALERTRESTORE3'].'\')) return false;">';
echo '<input class="Formbutton" name="restore" type="submit" value="'.$lang['L_RESTORE_OF_TABLES'].'" onclick="document.forms[0].tblfrage.value=1;">';
echo FileList();
echo '<input type="hidden" name="tblfrage" value="0">';
echo '</div></form>';
break;
case 'files':
$sysfedit=(isset($_POST['sysfedit'])) ? 1 : 0;
$sysfedit=(isset($_GET['sysfedit'])) ? $_GET['sysfedit'] : $sysfedit;
echo headline($lang['L_FILE_MANAGE']);
echo ($msg>'') ? $msg.'<br>' : '';
echo $autodel;
echo '<form name="fm" id="fm" method="post" action="'.$href.'">';
echo '<input class="Formbutton" name="delete" type="submit" value="'.$lang['L_FM_DELETE'].'" onclick="if (!confirm(\''.$lang['L_FM_ASKDELETE1'].'\n\' + GetSelectedFilename() + \'\n\n'.$lang['L_FM_ASKDELETE2'].'\')) return false;">';
echo '<input class="Formbutton" name="deleteauto" type="submit" value="'.$lang['L_FM_DELETEAUTO'].'" onclick="if (!confirm(\''.$lang['L_FM_ASKDELETE3'].'\')) return false;">';
echo '<input class="Formbutton" name="deleteall" type="submit" value="'.$lang['L_FM_DELETEALL'].'" onclick="if (!confirm(\''.$lang['L_FM_ASKDELETE4'].'\')) return false;">';
echo '<input class="Formbutton" name="deleteallfilter" type="submit" value="'.$lang['L_FM_DELETEALLFILTER'].$databases['db_actual'].$lang['L_FM_DELETEALLFILTER2'].'" onclick="if (!confirm(\''.$lang['L_FM_ASKDELETE5'].$databases['db_actual'].$lang['L_FM_ASKDELETE5_2'].'\')) return false;">';
echo FileList().'</form>';
echo '<h6>'.$lang['L_FM_FILEUPLOAD'].'</h6>';
echo '<div align="left"><form action="'.$href.'" method="POST" enctype="multipart/form-data">';
echo '<input type="file" name="upfile" class="Formtext" size="60">';
echo '<input type="submit" name="upload" value="'.$lang['L_FM_FILEUPLOAD'].'" class="Formbutton">';
echo '<br>'.$lang['L_MAX_UPLOAD_SIZE'].': <strong>'.$config['upload_max_filesize'].'</strong>';
echo '<br>'.$lang['L_MAX_UPLOAD_SIZE_INFO'];
echo '</form></div>';
echo '<h6>Tools</h6><div align="left">';
echo '<input type="Button" onclick="document.location=\'filemanagement.php?action=convert\'" class="Formbutton" value="'.$lang['L_CONVERTER'].'">';
echo '</div>';
break;
case "convert":
// Konverter
echo headline($lang['L_CONVERTER']);
echo '<br><br><form action="filemanagement.php?action=convert" method="post">';
echo '<table class="bdr"><tr><th colspan="2">'.$lang['L_CONVERT_TITLE'].'</th></tr>';
echo '<tr><td>'.$lang['L_CONVERT_FILE'].'</td><td>'.FilelisteCombo($config['paths']['backup'],$selectfile).'</td></tr>';
echo '<tr><td>'.$lang['L_CONVERT_FILENAME'].':</td><td><input type="text" name="destfile" size="50" value="'.$destfile.'"></td></tr>';
echo '<tr><td><input type="checkbox" name="compressed" value="1" '.(($compressed==1) ? "checked" : "").'>&nbsp;'.$lang['L_COMPRESSED'].'</td>';
echo '<td><input type="submit" name="startconvert" value=" '.$lang['L_CONVERT_START'].' " class="Formbutton"></td></tr>';
echo '</table></form><br>';
if (isset($_POST['startconvert']))
{
//$destfile.=($compressed==1) ? ".sql.gz" : ".sql";
echo $lang['L_CONVERTING']." $selectfile ==&gt; $destfile<br>";
if ($selectfile!=""&&file_exists($config['paths']['backup'].$selectfile)&&strlen($destfile)>2)
{
Converter($selectfile,$destfile,$compressed);
}
else
echo $lang['L_CONVERT_WRONG_PARAMETERS'];
}
}
echo MSDFooter();
ob_end_flush();

Datei anzeigen

@ -1,60 +0,0 @@
<?php
if (!@ob_start("ob_gzhandler")) @ob_start();
include ( './inc/header.php' );
include ( MSD_PATH . 'language/' . $config['language'] . '/lang.php' );
include ( MSD_PATH . 'language/' . $config['language'] . '/lang_help.php' );
echo MSDHeader(0);
echo headline($lang['L_CREDITS']);
include ( MSD_PATH . 'language/' . $config['language'] . '/help.php' );
?>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<?php
echo MSDFooter();
ob_end_flush();

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 5.1 KiB

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 1.3 KiB

Datei anzeigen

@ -1,27 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
//define icons
$icon['arrow_up']='<img src="' . $config['files']['iconpath'] . 'arrow_up.gif" alt="">';
$icon['arrow_down']='<img src="' . $config['files']['iconpath'] . 'arrow_down.gif" alt="">';
$icon['blank']=$config['files']['iconpath'] . 'blank.gif';
$icon['browse']='<img src="' . $config['files']['iconpath'] . 'browse.gif" alt="' . $lang['L_TITLE_SHOW_DATA'] . '" title="' . $lang['L_TITLE_SHOW_DATA'] . '">';
$icon['edit']='<img src="' . $config['files']['iconpath'] . 'edit.gif" alt="' . $lang['L_EDIT'] . '" title="' . $lang['L_EDIT'] . '">';
$icon['delete']='<img src="' . $config['files']['iconpath'] . 'delete.gif" alt="' . $lang['L_DELETE'] . '" title="' . $lang['L_DELETE'] . '">';
$icon['index']='<img src="' . $config['files']['iconpath'] . 'index.gif" alt="' . $lang['L_TITLE_INDEX'] . '" title="' . $lang['L_TITLE_INDEX'] . '">';
$icon['key_primary']='<img src="' . $config['files']['iconpath'] . 'key_primary.gif" alt="' . $lang['L_TITLE_KEY_PRIMARY'] . '" title="' . $lang['L_TITLE_KEY_PRIMARY'] . '">';
$icon['key_fulltext']='<img src="' . $config['files']['iconpath'] . 'key_fulltext.gif" alt="' . $lang['L_TITLE_KEY_FULLTEXT'] . '" title="' . $lang['L_TITLE_KEY_FULLTEXT'] . '">';
$icon['key_unique']='<img src="' . $config['files']['iconpath'] . 'key_unique.gif" alt="' . $lang['L_TITLE_KEY_UNIQUE'] . '" title="' . $lang['L_TITLE_KEY_UNIQUE'] . '">';
$icon['key_nokey']='<img src="' . $config['files']['iconpath'] . 'key_nokey.gif" alt="' . $lang['L_TITLE_NOKEY'] . '" title="' . $lang['L_TITLE_NOKEY'] . '">';
$icon['table_truncate']='<img src="' . $config['files']['iconpath'] . 'table_truncate.gif" alt="' . $lang['L_EMPTY'] . '" title="' . $lang['L_EMPTY'] . '">';
$icon['table_truncate_reset']='<img src="' . $config['files']['iconpath'] . 'table_truncate_reset.gif" alt="' . $lang['L_EMPTYKEYS'] . '" title="' . $lang['L_EMPTYKEYS'] . '">';
$icon['back2db_overview']='<img src="' . $config['files']['iconpath'] . 'arrowleft.gif" alt="' . $lang['L_SQL_BACKDBOVERVIEW'] . '" title="' . $lang['L_SQL_BACKDBOVERVIEW'] . '">';
$icon['search']='<img src="' . $config['files']['iconpath'] . 'search.gif" alt="' . $lang['L_TITLE_SEARCH'] . '" title="' . $lang['L_TITLE_SEARCH'] . '">';
$icon['mysql_help']='<img src="' . $config['files']['iconpath'] . 'mysql_help.gif" alt="' . $lang['L_TITLE_MYSQL_HELP'] . '" title="' . $lang['L_TITLE_MYSQL_HELP'] . '">';
$icon['upload']='<img src="' . $config['files']['iconpath'] . 'openfile.gif" alt="' . $lang['L_TITLE_UPLOAD'] . '" title="' . $lang['L_TITLE_UPLOAD'] . '">';
//other pics
$icon['logo']=$config['theme'] . 'pics/h1_logo.gif';
?>

Datei anzeigen

@ -1,802 +0,0 @@
<?php
if (!function_exists('get_page_parameter')) {
include('./inc/functions_global.php');
}
if (!function_exists('str_ireplace')) // borrowed from http://www.dscripts.net
{
function str_ireplace($find, $replace, $string)
{
if (!is_array($find)) {
$find = array(
$find
);
}
if (!is_array($replace)) {
if (!is_array($find)) {
$replace = array(
$replace
);
} else {
// this will duplicate the string into an array the size of $find
$c = count($find);
$rString = $replace;
unset($replace);
for ($i = 0; $i < $c; $i++) {
$replace[$i] = $rString;
}
}
}
foreach ($find as $fKey => $fItem) {
$between = explode(strtolower($fItem), strtolower($string));
$pos = 0;
foreach ($between as $bKey => $bItem) {
$between[$bKey] = substr($string, $pos, strlen($bItem));
$pos += strlen($bItem) + strlen($fItem);
}
$string = implode($replace[$fKey], $between);
}
return ($string);
}
}
if (!function_exists('stripos')) // borrowed from php.net comments
{
function stripos($haystack, $needle)
{
return strpos($haystack, stristr($haystack, $needle));
}
}
function Help($ToolTip, $Anker, $imgsize = 12)
{/*
global $config;
if($Anker!=""){
return '<a href="language/'.$config['language'].'/help.php#'.$Anker.'" title="'.$ToolTip.'"><img src="'.$config['files']['iconpath'].'help16.gif" width="'.$imgsize.'" height="'.$imgsize.'" hspace="'.(round($imgsize/4,0)).'" vspace="0" border="0" alt="Help"></a>';
} else {
return '<img src="'.$config['files']['iconpath'].'help16.gif" width="'.$imgsize.'" height="'.$imgsize.'" alt="Help" title="'.$ToolTip.'" border="0" hspace="'.(round($imgsize/4,0)).'" vspace="0" >';
}
*/
}
function DeleteFilesM($dir, $pattern = "*.*")
{
$deleted = array();
$pattern = str_replace(
array(
"\*",
"\?"
),
array(
".*",
"."
),
preg_quote($pattern)
);
if (substr($dir, -1) != "/") {
$dir .= "/";
}
if (is_dir($dir)) {
$d = opendir($dir);
while ($file = readdir($d)) {
if (is_file($dir . $file) && preg_match("/^" . $pattern . "$/", $file)) {
if (unlink($dir . $file)) {
$deleted[$file] = true;
} else {
$deleted[$file] = false;
}
}
}
closedir($d);
return $deleted;
}
}
function SetDefault($load_default = false)
{
global $config, $databases, $nl, $out, $lang, $preConfig;
if ($load_default == true) {
if (file_exists($config['files']['parameter']) && (is_readable($config['files']['parameter']))) {
include($config['files']['parameter']);
} // alte Config lesen
}
$restore_values = array();
$restore_values['cron_dbindex'] = isset($config['cron_dbindex']) ? $config['cron_dbindex'] : -3;
$restore_values['cron_dbpraefix_array'] = isset($config['cron_dbpraefix_array']) ? $config['cron_dbpraefix_array']
: '';
if ($restore_values['cron_dbindex'] >= 0
&& isset($databases['Name'][$config['cron_dbindex']])
) // eine bestimmte Db gewaehlt?
{
// Ja, Namen merken, um spaeter den Index wieder herzustellen
$restore_values['db_actual_cron'] = $databases['Name'][$config['cron_dbindex']];
}
$restore_values['db_actual'] = isset($databases['db_actual']) ? $databases['db_actual'] : '';
$old_lang
= isset($config['language']) && in_array($config['language'], $lang['languages']) ? $config['language'] : '';
if ($load_default == true) {
if (file_exists($config['files']['parameter'])) {
@unlink($config['files']['parameter']);
}
include("./config.php");
if (is_array($preConfig)) {
foreach ($preConfig as $key => $val) {
$config[$key] = $val;
}
}
if ($old_lang != '') {
$config['language'] = $old_lang;
}
include("./language/" . $config['language'] . "/lang.php");
}
$oldVals = array();
// Zuordnung nach Namen der Db zwischenspeichern, um Eingaben nicht zu verlieren
if (isset($databases) && isset($databases['Name'])) {
foreach ($databases['Name'] as $k => $v) {
if (!isset($oldVals[$k])) {
$oldVals[$v] = array();
}
$oldVals[$v]['praefix'] = $databases['praefix'][$k];
$oldVals[$v]['command_before_dump'] = $databases['command_before_dump'][$k];
$oldVals[$v]['command_after_dump'] = $databases['command_after_dump'][$k];
}
}
$oldDbArray = array();
if (isset($databases['Name'])) {
$oldDbArray = $databases['Name'];
}
$databases['Name'] = array();
$found_dbs = array();
//DB-Liste holen
MSD_mysql_connect();
$res = mysqli_query( $config['dbconnection'], 'SHOW DATABASES');
WHILE ($row = mysqli_fetch_row($res)) {
$found_dbs[] = $row[0];
}
$found_dbs = array_merge($oldDbArray, $found_dbs);
$found_dbs = array_unique($found_dbs);
sort($found_dbs);
// now check each db
$a = 0;
for ($i = 0; $i < count($found_dbs); $i++) {
$found_db = $found_dbs[$i];
$use = @mysqli_select_db($GLOBALS["___mysqli_ston"], $found_db);
if ($use) {
if (isset($old_db) && $found_db == $old_db) {
$databases['db_selected_index'] = $a;
}
$databases['Name'][$a] = $found_db;
$databases['praefix'][$a] = "";
$databases['command_before_dump'][$a] = "";
$databases['command_after_dump'][$a] = "";
if (isset($oldVals[$found_db])) {
$databases['praefix'][$a] = $oldVals[$found_db]['praefix'];
$databases['command_before_dump'][$a] = $oldVals[$found_db]['command_before_dump'];
$databases['command_after_dump'][$a] = $oldVals[$found_db]['command_after_dump'];
}
$out .= $lang['L_SAVING_DB_FORM'] . " " . $found_db . " " . $lang['L_ADDED'] . "$nl";
$a++;
}
}
if (!isset($databases['db_selected_index'])) {
$databases['db_selected_index'] = 0;
$databases['db_actual'] = $databases['Name'][0];
}
WriteParams(1, $restore_values);
if ($load_default === true) {
WriteLog("default settings loaded.");
}
return $out;
}
function WriteParams($as = 0, $restore_values = false)
{
// wenn $as=1 wird versucht den aktuellen Index der Datenbank nach dem Einlesen wieder zu ermitteln
// auch wenn sich die Indexnummer durch Loeschaktionen geaendert hat
global $config, $databases, $config_dontsave;
$nl = "\n";
// alte Werte retten
if ($as) {
if (is_array($restore_values)) {
if ($restore_values['cron_dbindex'] < 0) {
// Multidump oder "alle Datenbanken" war gewaehlt
$config['cron_dbindex'] = $restore_values['cron_dbindex'];
} else {
//den Index der konkreten Datenbank aus der alten Konfiguration ermitteln
$db_names = array();
$db_names = array_flip($databases['Name']);
if (isset($db_names[$restore_values['db_actual']])) {
// alte Db existiert noch -> Index uebernehmen
$databases['db_actual'] = $restore_values['db_actual'];
} else {
$databases['db_actual'] = $databases['Name'][0];
}
//Cron-Index wiederfinden
if (isset($db_names[$restore_values['cron_dbindex']])) {
$config['cron_dbindex'] = $db_names[$restore_values['cron_dbindex']];
} else {
// DB wurde zwischenzeitlich geloescht - sicherheitshalber alle DBs sichern
$databases['cron_dbindex'] = -3;
}
}
}
}
FillMultiDBArrays();
//Parameter zusammensetzen
$config['multipart_groesse']
= $config['multipartgroesse1'] * (($config['multipartgroesse2'] == 1) ? 1024 : 1024 * 1024);
$param = $pars_all = '<?php ' . $nl;
if (!isset($config['email_maxsize'])) {
$config['email_maxsize'] = $config['email_maxsize1'] * (($config['email_maxsize2'] == 1) ? 1024 : 1024 * 1024);
}
if (!isset($config['cron_execution_path'])) {
$config['cron_execution_path'] = "msd_cron/";
}
if ($as == 0) {
$config['paths']['root'] = addslashes(basePath());
}
$config['files']['parameter'] = $config['paths']['config'] . $config['config_file'] . '.php';
$config['files']['iconpath'] = './css/' . $config['theme'] . '/icons/';
foreach ($config as $var => $val) {
if (!in_array($var, $config_dontsave)) {
if (is_array($val)) {
$pars_all .= '$config[\'' . $var . '\']=array();' . $nl;
foreach ($val as $var2 => $val2) {
if ($config['magic_quotes_gpc'] == 1) {
$val2 = stripslashes($val2);
}
$pars_all .= '$config[\'' . $var . '\'][' . ((is_int($var2)) ? $var2 : "'" . $var2 . "'") . '] = \''
. my_addslashes($val2) . "';$nl";
}
} else {
if ($config['magic_quotes_gpc'] == 1) {
$val = stripslashes($val);
}
if (!in_array($var, $config_dontsave)) {
$pars_all .= '$config[\'' . $var . '\'] = \'' . my_addslashes($val) . "';$nl";
}
}
}
}
foreach ($databases as $var => $val) {
if (is_array($val)) {
$pars_all .= '$databases[\'' . $var . '\']=array();' . $nl;
foreach ($val as $var2 => $val2) {
if ($config['magic_quotes_gpc'] == 1 || $as == 1) {
$pars_all
.= '$databases[\'' . $var . '\'][' . ((is_int($var2)) ? $var2 : "'" . $var2 . "'") . '] = \''
. my_addslashes(stripslashes($val2)) . "';$nl";
} else {
$pars_all
.= '$databases[\'' . $var . '\'][' . ((is_int($var2)) ? $var2 : "'" . $var2 . "'") . '] = \''
. my_addslashes($val2) . "';$nl";
}
}
} else {
if ($config['magic_quotes_gpc'] == 0 || $as == 1) {
$pars_all .= '$databases[\'' . $var . '\'] = \'' . addslashes($val) . "';$nl";
} else {
$pars_all .= '$databases[\'' . $var . '\'] = \'' . $val . "';$nl";
}
}
}
$param .= '?>';
$pars_all .= '?>';
//Datei öffnen und schreiben
$ret = true;
$file = $config['paths']['config'] . $config['config_file'] . '.php';
if ($fp = fopen($file, "wb")) {
if (!fwrite($fp, $pars_all)) {
$ret = false;
}
if (!fclose($fp)) {
$ret = false;
}
@chmod($file, 0777);
} else {
$ret = false;
}
$ret = WriteCronScript($restore_values);
return $ret;
}
function escape_specialchars($text)
{
$suchen = ARRAY(
'@',
'$',
'\\\\',
'"'
);
$ersetzen = ARRAY(
'\@',
'\$',
'\\',
'\"'
);
$text = str_replace($suchen, $ersetzen, $text);
return $text;
}
// definiert einen SAtring, der ein Array nach Perlsyntax aufbaut
function my_implode($arr, $mode = 0) // 0=String, 1=intval
{
global $nl;
if (!is_array($arr)) {
return false;
}
foreach ($arr as $key => $val) {
if ($mode == 0) {
$arr[$key] = escape_specialchars($val);
} else {
$arr[$key] = intval($val);
}
}
if ($mode == 0) {
$ret = '("' . implode('","', $arr) . '");' . $nl;
} else {
$ret = '(' . implode(',', $arr) . ');' . $nl;
}
return $ret;
}
function WriteCronScript($restore_values = false)
{
global $nl, $config, $databases, $cron_db_array, $cron_dbpraefix_array, $cron_db_cbd_array, $cron_db_cad_array, $dontBackupDatabases;
if (!isset($databases['db_selected_index'])) {
$databases['db_selected_index'] = 0;
}
if (!isset($databases['praefix'][$databases['db_selected_index']])) {
$databases['praefix'][$databases['db_selected_index']] = "";
}
if (!isset($databases['db_actual_cronindex'])) {
$databases['db_actual_cronindex'] = $databases['db_selected_index'];
}
if (!isset($config['email_maxsize'])) {
$config['email_maxsize'] = $config['email_maxsize1'] * (($config['email_maxsize2'] == 1) ? 1024 : 1024 * 1024);
}
$cron_dbname = $databases['db_actual'];
// -2 = Multidump configuration
// -3 = all databases - nothing to do
// get standard values for all databases
$cron_db_array = $databases['Name'];
$cron_dbpraefix_array = $databases['praefix'];
$cron_command_before_dump = $databases['command_before_dump'];
$cron_command_after_dump = $databases['command_after_dump'];
if (!isset($config['cron_dbindex'])) {
$config['cron_dbindex'] = -3;
}
if (intval($config['cron_dbindex']) == -2) {
// get selected dbs from multidump-settings
$cron_db_array = $databases['multi'];
$cron_dbpraefix_array = $databases['multi_praefix'];
$cron_command_before_dump = $databases['multi_commandbeforedump'];
$cron_command_after_dump = $databases['multi_commandafterdump'];
}
// we need to correct the index of the selected database after we cleaned
// the db-array from information_schema and mysql if it points to a db-name
if ($config['cron_dbindex'] >= 0) {
$cronDbIndexDbName = $databases['Name'][$config['cron_dbindex']];
} else {
$cronDbIndex = $config['cron_dbindex'];
}
$newDbNames = $databases['Name'];
//remove database we don't want to backup
// from newDbNames
foreach ($databases['Name'] as $k=>$v) {
if (in_array($v, $dontBackupDatabases)) {
unset($newDbNames[$k]);
}
}
// and from cron (cron_db_array has different length to newDbNames: at least mysql and information_schema are missing)
foreach ($cron_db_array as $k=>$v) {
if (in_array($v, $dontBackupDatabases)) {
unset($cron_db_array[$k],
$cron_dbpraefix_array[$k],
$cron_command_before_dump[$k],
$cron_command_after_dump[$k]
);
}
}
// find new index
if ($config['cron_dbindex'] >= 0) {
sort($newDbNames);
$dbNames = array_flip($newDbNames);
if (isset($dbNames[$cronDbIndexDbName])) {
$cronDbIndex = $dbNames[$cronDbIndexDbName];
} else {
$cronDbIndex = 0;
}
}
$r = str_replace("\\\\", "/", $config['paths']['root']);
$r = str_replace("@", "\@", $r);
$p1 = $r . $config['paths']['backup'];
$p2 = $r . $config['files']['perllog'] . (($config['logcompression'] == 1) ? '.gz' : '');
$p3 = $r . $config['files']['perllogcomplete'] . (($config['logcompression'] == 1) ? '.gz' : '');
// auf manchen Server wird statt 0 ein leerer String gespeichert -> fuehrt zu einem Syntax-Fehler
// hier die entsprechenden Ja/Nein-Variablen sicherheitshalber in intvalues aendern
$int_array = array(
'dbport',
'cron_compression',
'cron_printout',
'multi_part',
'multipart_groesse',
'email_maxsize',
'auto_delete',
'max_backup_files',
'perlspeed',
'optimize_tables_beforedump',
'logcompression',
'log_maxsize',
'cron_completelog',
'cron_use_sendmail',
'cron_smtp_port'
);
foreach ($int_array as $i) {
if (is_array($i)) {
foreach ($i as $key => $val) {
$int_array[$key] = intval($val);
}
} else {
$config[$i] = intval($config[$i]);
}
}
if ($config['dbport'] == 0) {
$config['dbport'] = 3306;
}
$cronscript = "<?php\n#Vars - written at " . date("Y-m-d") . $nl;
$cronscript .= '$dbhost="' . $config['dbhost'] . '";' . $nl;
$cronscript .= '$dbname="' . $cron_dbname . '";' . $nl;
$cronscript .= '$dbuser="' . escape_specialchars($config['dbuser']) . '";' . $nl;
$cronscript .= '$dbpass="' . escape_specialchars($config['dbpass']) . '";' . $nl;
$cronscript .= '$dbport=' . $config['dbport'] . ';' . $nl;
$cronscript .= '$dbsocket="' . escape_specialchars($config['dbsocket']) . '";' . $nl;
$cronscript .= '$compression=' . $config['cron_compression'] . ';' . $nl;
$cronscript .= '$backup_path="' . $p1 . '";' . $nl;
$cronscript .= '$logdatei="' . $p2 . '";' . $nl;
$cronscript .= '$completelogdatei="' . $p3 . '";' . $nl;
$cronscript .= '$sendmail_call="' . escape_specialchars($config['cron_sendmail']) . '";' . $nl;
$cronscript .= '$nl="\n";' . $nl;
$cronscript .= '$cron_dbindex=' . $cronDbIndex . ';' . $nl;
$cronscript .= '$cron_printout=' . $config['cron_printout'] . ';' . $nl;
$cronscript .= '$cronmail=' . $config['send_mail'] . ';' . $nl;
$cronscript .= '$cronmail_dump=' . $config['send_mail_dump'] . ';' . $nl;
$cronscript .= '$cronmailto="' . escape_specialchars($config['email_recipient']) . '";' . $nl;
$cronscript .= '$cronmailto_cc="' . escape_specialchars($config['email_recipient_cc']) . '";' . $nl;
$cronscript .= '$cronmailfrom="' . escape_specialchars($config['email_sender']) . '";' . $nl;
$cronscript .= '$cron_use_sendmail=' . $config['cron_use_sendmail'] . ';' . $nl;
$cronscript .= '$cron_smtp="' . escape_specialchars($config['cron_smtp']) . '";' . $nl;
$cronscript .= '$cron_smtp_port="' . $config['cron_smtp_port'] . '";' . $nl;
$cronscript .= '@cron_db_array=' . my_implode($cron_db_array);
$cronscript .= '@cron_dbpraefix_array=' . my_implode($cron_dbpraefix_array);
$cronscript .= '@cron_command_before_dump=' . my_implode($cron_command_before_dump);
$cronscript .= '@cron_command_after_dump=' . my_implode($cron_command_after_dump);
$cronscript .= '@ftp_server=' . my_implode($config['ftp_server']);
$cronscript .= '@ftp_port=' . my_implode($config['ftp_port'], 1);
$cronscript .= '@ftp_mode=' . my_implode($config['ftp_mode'], 1);
$cronscript .= '@ftp_user=' . my_implode($config['ftp_user']);
$cronscript .= '@ftp_pass=' . my_implode($config['ftp_pass']);
$cronscript .= '@ftp_dir=' . my_implode($config['ftp_dir']);
$cronscript .= '@ftp_timeout=' . my_implode($config['ftp_timeout'], 1);
$cronscript .= '@ftp_useSSL=' . my_implode($config['ftp_useSSL'], 1);
$cronscript .= '@ftp_transfer=' . my_implode($config['ftp_transfer'], 1);
$cronscript .= '$mp=' . $config['multi_part'] . ';' . $nl;
$cronscript .= '$multipart_groesse=' . $config['multipart_groesse'] . ';' . $nl;
$cronscript .= '$email_maxsize=' . $config['email_maxsize'] . ';' . $nl;
$cronscript .= '$auto_delete=' . $config['auto_delete'] . ';' . $nl;
$cronscript .= '$max_backup_files=' . $config['max_backup_files'] . ';' . $nl;
$cronscript .= '$perlspeed=' . $config['perlspeed'] . ';' . $nl;
$cronscript .= '$optimize_tables_beforedump=' . $config['optimize_tables_beforedump'] . ';' . $nl;
$cronscript .= '$logcompression=' . $config['logcompression'] . ';' . $nl;
$cronscript .= '$log_maxsize=' . $config['log_maxsize'] . ';' . $nl;
$cronscript .= '$complete_log=' . $config['cron_completelog'] . ';' . $nl;
$cronscript .= '$my_comment="' . escape_specialchars(stripslashes($config['cron_comment'])) . '";' . $nl;
$cronscript .= "?>";
// Save config
$ret = true;
$sfile = $config['paths']['config'] . $config['config_file'] . '.conf.php';
if (file_exists($sfile)) {
@unlink($sfile);
}
if ($fp = fopen($sfile, "wb")) {
if (!fwrite($fp, $cronscript)) {
$ret = false;
}
if (!fclose($fp)) {
$ret = false;
}
@chmod("$sfile", 0777);
} else {
$ret = false;
}
// if standard config was deleted -> restore it with the actual values
if (!file_exists($config['paths']['config'] . "mysqldumper.conf.php")) {
$sfile = $config['paths']['config'] . 'mysqldumper.conf.php';
if ($fp = fopen($sfile, "wb")) {
if (!fwrite($fp, $cronscript)) {
$ret = false;
}
if (!fclose($fp)) {
$ret = false;
}
@chmod("$sfile", 0777);
} else {
$ret = false;
}
}
return $ret;
}
function LogFileInfo($logcompression)
{
global $config;
$l = Array();
$sum = $s
=
$l['log_size'] = $l['perllog_size'] = $l['perllogcomplete_size'] = $l['errorlog_size'] = $l['log_totalsize'] = 0;
if ($logcompression == 1) {
$l['log'] = $config['files']['log'] . ".gz";
$l['perllog'] = $config['files']['perllog'] . ".gz";
$l['perllogcomplete'] = $config['files']['perllogcomplete'] . ".gz";
$l['errorlog'] = $config['paths']['log'] . "error.log.gz";
} else {
$l['log'] = $config['files']['log'];
$l['perllog'] = $config['files']['perllog'];
$l['perllogcomplete'] = $config['files']['perllogcomplete'];
$l['errorlog'] = $config['paths']['log'] . "error.log";
}
$l['log_size'] += @filesize($l['log']);
$sum += $l['log_size'];
$l['perllog_size'] += @filesize($l['perllog']);
$sum += $l['perllog_size'];
$l['perllogcomplete_size'] += @filesize($l['perllogcomplete']);
$sum += $l['perllogcomplete_size'];
$l['errorlog_size'] += @filesize($l['errorlog']);
$sum += $l['errorlog_size'];
$l['log_totalsize'] += $sum;
return $l;
}
function DeleteLog()
{
global $config;
//Datei öffnen und schreiben
$log = date('d.m.Y H:i:s') . " Log created.\n";
if (file_exists($config['files']['log'] . '.gz')) {
@unlink($config['files']['log'] . '.gz');
}
if (file_exists($config['files']['log'] . '.gz')) {
@unlink($config['files']['log']);
}
if ($config['logcompression'] == 1) {
$fp = @gzopen($config['files']['log'] . '.gz', "wb");
@gzwrite($fp, $log);
@gzclose($fp);
@chmod($config['files']['log'] . '.gz', 0777);
} else {
$fp = @fopen($config['files']['log'], "wb");
@fwrite($fp, $log);
@fclose($fp);
@chmod($config['files']['log'], 0777);
}
}
function CreateDirsFTP()
{
global $config, $lang, $install_ftp_server, $install_ftp_port, $install_ftp_user_name, $install_ftp_user_pass, $install_ftp_path;
// Herstellen der Basis-Verbindung
echo '<hr>' . $lang['L_CONNECT_TO'] . ' `' . $install_ftp_server . '` Port ' . $install_ftp_port . ' ...<br>';
$conn_id = ftp_connect($install_ftp_server);
// Einloggen mit Benutzername und Kennwort
$login_result = ftp_login($conn_id, $install_ftp_user_name, $install_ftp_user_pass);
// Verbindung überprüfen
if ((!$conn_id) || (!$login_result)) {
echo $lang['L_FTP_NOTCONNECTED'];
echo $lang['L_CONNWITH'] . " $tinstall_ftp_server " . $lang['L_ASUSER'] . " $install_ftp_user_name "
. $lang['L_NOTPOSSIBLE'];
return 0;
} else {
if ($config['ftp_mode'] == 1) {
ftp_pasv($conn_id, true);
}
//Wechsel in betroffenes Verzeichnis
echo $lang['L_CHANGEDIR'] . ' `' . $install_ftp_path . '` ...<br>';
ftp_chdir($conn_id, $install_ftp_path);
// Erstellen der Verzeichnisse
echo $lang['L_DIRCR1'] . ' ...<br>';
ftp_mkdir($conn_id, "work");
ftp_site($conn_id, "CHMOD 0777 work");
echo $lang['L_CHANGEDIR'] . ' `work` ...<br>';
ftp_chdir($conn_id, "work");
echo $lang['L_INDIR'] . ' `' . ftp_pwd($conn_id) . '`<br>';
echo $lang['L_DIRCR5'] . ' ...<br>';
ftp_mkdir($conn_id, "config");
ftp_site($conn_id, "CHMOD 0777 config");
echo $lang['L_DIRCR2'] . ' ...<br>';
ftp_mkdir($conn_id, "backup");
ftp_site($conn_id, "CHMOD 0777 backup");
echo $lang['L_DIRCR4'] . ' ...<br>';
ftp_mkdir($conn_id, "log");
ftp_site($conn_id, "CHMOD 0777 log");
// Schließen des FTP-Streams
ftp_quit($conn_id);
return 1;
}
}
function ftp_mkdirs($config, $dirname)
{
$path = '';
$dir = explode("/", $dirname);
for ($i = 0; $i < count($dir) - 1; $i++) {
$path .= $dir[$i] . "/";
@ftp_mkdir($config['dbconnection'], $path);
}
if (@ftp_mkdir($config['dbconnection'], $dirname)) {
return 1;
}
}
function IsWritable($dir)
{
$testfile = $dir . "/.writetest";
if ($writable = @fopen($testfile, 'w')) {
@fclose($writable);
@unlink($testfile);
}
return $writable;
}
function SearchDatabases($printout, $db = '')
{
global $databases, $config, $lang;
if (!isset($config['dbconnection'])) {
MSD_mysql_connect();
}
$db_list = array();
if ($db > '') {
$db_list[] = $db; // DB wurde manuell angegeben
}
// Datenbanken automatisch erkennen
$show_dbs = mysqli_query( $config['dbconnection'], "SHOW DATABASES");
if (!$show_dbs === false) {
WHILE ($row = mysqli_fetch_row($show_dbs)) {
if (trim($row[0]) > '') {
$db_list[] = $row[0];
}
}
}
$db_list = array_unique($db_list);
sort($db_list);
if (sizeof($db_list) > 0) {
$databases['db_selected_index'] = 0;
for ($i = 0; $i < sizeof($db_list); $i++) {
// Test-Select um zu sehen, ob Berechtigungen existieren
if (!@mysqli_query( $config['dbconnection'], "SHOW TABLES FROM `" . $db_list[$i] . "`") === false) {
$databases['Name'][$i] = $db_list[$i];
$databases['praefix'][$i] = '';
$databases['command_before_dump'][$i] = '';
$databases['command_after_dump'][$i] = '';
if ($printout == 1) {
echo $lang['L_FOUND_DB'] . ' `' . $db_list[$i] . '`<br />';
}
} else {
if ($printout == 1) {
echo '<span class="error">' . sprintf($lang['L_DB_MANUAL_ERROR'], $db_list[$i]) . '</span><br />';
}
}
}
}
if (isset($databases['Name'][0])) {
$databases['db_actual'] = $databases['Name'][0];
}
}
// removes tags from inputs recursivly
function my_strip_tags($value)
{
global $dont_strip;
if (is_array($value)) {
foreach ($value as $key => $val) {
if (!in_array($key, $dont_strip)) {
$ret[$key] = my_strip_tags($val);
} else {
$ret[$key] = $val;
}
}
} else {
$ret = trim(strip_tags($value));
}
return $ret;
}
/**
* Add a slashes only before '
*
* Used for escaping strings in JS-alerts and config-files
*
* @param $string
*
* @return string
*/
function my_addslashes($string)
{
return str_replace("'", "\'", $string);
}
/**
* Replaces quotes for outputting value in HTML-attributes
*
* Replaces quotes for outputing value in HTML-attributes without breaking HTML
*
* @param string $value value to output
*
* @return string
*/
function my_quotes($value)
{
return str_replace('"', '&quot;', $value);
}
// prepares a string for executing it as query
function db_escape($string)
{
global $config;
if (function_exists('mysqli_real_escape_string')) {
$string = mysqli_real_escape_string( $config['dbconnection'], $string);
} else {
$string = addslashes($string);
}
return $string;
}
?>

Datei anzeigen

@ -1,554 +0,0 @@
<?php
include ('./inc/functions_global.php');
//Buffer fuer Multipart-Filesizepruefung
$buffer=10*1024;
function new_file($last_groesse=0)
{
global $dump,$databases,$config,$out,$lang,$nl,$mysql_commentstring;
// Dateiname aus Datum und Uhrzeit bilden
if ($dump['part']-$dump['part_offset']==1) $dump['filename_stamp']=date("Y_m_d_H_i",time());
if ($config['multi_part']==1)
{
$dateiname=$databases['Name'][$dump['dbindex']].'_'.$dump['filename_stamp'].'_part_'.($dump['part']-$dump['part_offset']);
}
else
$dateiname=$databases['Name'][$dump['dbindex']].'_'.date("Y_m_d_H_i",time());
$endung=($config['compression']) ? '.sql.gz':'.sql';
$dump['backupdatei']=$dateiname.$endung;
if (file_exists($config['paths']['backup'].$dump['backupdatei'])) unlink($config['paths']['backup'].$dump['backupdatei']);
$cur_time=date("Y-m-d H:i");
$statuszeile=GetStatusLine().$nl.$mysql_commentstring.' Dump by MySQLDumper '.MSD_VERSION.' ('.$config['homepage'].')'.$nl;
$statuszeile.='/*!40101 SET NAMES \''.$dump['dump_encoding'].'\' */;'.$nl;
$statuszeile.='SET FOREIGN_KEY_CHECKS=0;'.$nl;
if ($dump['part']-$dump['part_offset']==1)
{
if ($config['multi_part']==0)
{
if ($config['multi_dump']==1 && $dump['dbindex']==0) WriteLog('starting Multidump with '.count($databases['multi']).' Datenbases.');
WriteLog('Start Dump \''.$dump['backupdatei'].'\'');
}
else
WriteLog('Start Multipart-Dump \''.$dateiname.'\'');
$out.='<strong>'.$lang['L_STARTDUMP'].' `'.$databases['Name'][$dump['dbindex']].'`</strong>'.(($databases['praefix'][$dump['dbindex']]!="") ? ' ('.$lang['L_WITHPRAEFIX'].' <span style="color:blue">'.$databases['praefix'][$dump['dbindex']].'</span>)':'').'... ';
if ($dump['part']==1)
{
$dump['table_offset']=0;
$dump['countdata']=0;
}
// Seitenerstaufruf -> Backupdatei anlegen
$dump['data']=$statuszeile.$mysql_commentstring.' Dump created: '.$cur_time;
}
else
{
if ($config['multi_part']!=0)
{
WriteLog('Continue Multipart-Dump with File '.($dump['part']-$dump['part_offset']).' (last file was '.$last_groesse.' Bytes)');
$dump['data']=$statuszeile.$mysql_commentstring.' This is part '.($dump['part']-$dump['part_offset']).' of the backup.'.$nl.$nl.$dump['data'];
}
}
WriteToDumpFile();
$dump['part']++;
}
function GetStatusLine($kind="php")
{
/*AUFBAU der Statuszeile:
-- Status:tabellenzahl:datensätze:Multipart:Datenbankname:script:scriptversion:Kommentar:MySQLVersion:Backupflags:SQLBefore:SQLAfter:Charset:CharsetEXTINFO
Aufbau Backupflags (1 Zeichen pro Flag, 0 oder 1, 2=unbekannt)
(complete inserts)(extended inserts)(ignore inserts)(delayed inserts)(downgrade)(lock tables)(optimize tables)
*/
global $databases,$config,$lang,$dump,$mysql_commentstring;
$t_array=explode("|",$databases['db_actual_tableselected']);
$t=0;
$r=0;
$t_zeile="$mysql_commentstring\n$mysql_commentstring TABLE-INFO\r\n";
MSD_mysql_connect();
$res=mysqli_query($GLOBALS["___mysqli_ston"], "SHOW TABLE STATUS FROM `".$databases['Name'][$dump['dbindex']]."`");
$numrows=intval(@mysqli_num_rows($res));
for($i=0;$i<$numrows;$i++)
{
$erg=mysqli_fetch_array($res);
// 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'][$dump['dbindex']]."`.`".$erg['Name']."`";
$res2=@mysqli_query($GLOBALS["___mysqli_ston"], $sql_2);
if ($res2===false)
{
// error reading table definition
$read_create_error=sprintf($lang['L_FATAL_ERROR_DUMP'],$databases['Name'][$dump['dbindex']],$erg['Name']).': '.((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
Errorlog("DUMP",$databases['Name'][$dump['dbindex']],'',$read_create_error,0);
WriteLog($read_create_error);
if ($config['stop_with_error']>0)
{
die($read_create_error);
}
$dump['errors']++;
//$i++; // skip corrupted table
}
else
{
$row2=mysqli_fetch_array($res2);
$erg['Rows']=$row2['count_records'];
if (($databases['db_actual_tableselected']==''||($databases['db_actual_tableselected']!=''&&(in_array($erg[0],$t_array))))&&(substr($erg[0],0,strlen($databases['praefix'][$dump['dbindex']]))==$databases['praefix'][$dump['dbindex']]))
{
$t++;
$r+=$erg['Rows'];
if (isset($erg['Type'])) $erg['Engine']=$erg['Type'];
$t_zeile.="$mysql_commentstring TABLE|".$erg['Name'].'|'.$erg['Rows'].'|'.($erg['Data_length']+$erg['Index_length']).'|'.$erg['Update_time'].'|'.$erg['Engine']."\n";
}
}
}
//$dump['totalrecords']=$r;
$flags=1;
$mp=($config['multi_part']==1) ? $mp="MP_".($dump['part']-$dump['part_offset']):'MP_0';
$statusline="$mysql_commentstring Status:$t:$r:$mp:".$databases['Name'][$dump['dbindex']].":$kind:".MSD_VERSION.":".$dump['kommentar'].":";
$statusline.=MSD_MYSQL_VERSION.":$flags:::".$dump['dump_encoding'].":EXTINFO\n".$t_zeile."$mysql_commentstring"." EOF TABLE-INFO\n$mysql_commentstring";
return $statusline;
}
// Liest die Eigenschaften der Tabelle aus der DB und baut die CREATE-Anweisung zusammen
function get_def($db,$table,$withdata=1)
{
global $config,$nl,$mysql_commentstring,$dump;
$def="\n\n$mysql_commentstring\n$mysql_commentstring Create Table `$table`\n$mysql_commentstring\n\n";
if ($dump['table_types'][getDBIndex($db,$table)]=='VIEW')
{
$def.="DROP VIEW IF EXISTS `$table`;\n";
$withdata=0;
}
else
$def.="DROP TABLE IF EXISTS `$table`;\n";
mysqli_select_db($GLOBALS["___mysqli_ston"], $db);
$result=mysqli_query($config['dbconnection'], 'SHOW CREATE TABLE `'.$table.'`');
$row=@mysqli_fetch_row($result);
if ($row===false) return false;
$def.=$row[1].';'."\n\n";
if ($withdata==1)
{
$def.="$mysql_commentstring\n$mysql_commentstring Data for Table `$table`\n$mysql_commentstring\n\n";
$def.="/*!40000 ALTER TABLE `$table` DISABLE KEYS */;".$nl;
}
return $def;
}
// Liest die Daten aus der DB aus und baut die INSERT-Anweisung zusammen
function get_content($db,$table)
{
global $config,$nl,$dump,$buffer;
$content='';
$complete=Fieldlist($db,$table).' ';
$table_ready=0;
$query='SELECT * FROM `'.$table.'` LIMIT '.$dump['zeilen_offset'].','.($dump['restzeilen']+1);
mysqli_select_db($GLOBALS["___mysqli_ston"], $db);
$result=mysqli_query($config['dbconnection'], $query);
$ergebnisse=@mysqli_num_rows($result);
if ($ergebnisse!==false)
{
$num_felder=(($___mysqli_tmp = mysqli_num_fields($result)) ? $___mysqli_tmp : false);
$first=1;
if ($ergebnisse>$dump['restzeilen'])
{
$dump['zeilen_offset']+=$dump['restzeilen'];
$ergebnisse--;
$dump['restzeilen']=0;
}
else
{
$dump['table_offset']++;
$dump['zeilen_offset']=0;
$dump['restzeilen']=$dump['restzeilen']-$ergebnisse;
$table_ready=1;
}
$ax=0;
for($x=0;$x<$ergebnisse;$x++)
{
$row=mysqli_fetch_row($result);
$ax++;
$insert='INSERT INTO `'.$table.'` '.$complete.'VALUES (';
for($j=0;$j<$num_felder;$j++)
{
if (!isset($row[$j])) $insert.='NULL,';
else
if ($row[$j]!='') $insert.='\''. mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $row[$j]) .'\',';
else
$insert.='\'\',';
}
$insert=substr($insert,0,-1).');'.$nl;
$dump['data'].=$insert;
$dump['countdata']++;
if (strlen($dump['data'])>$config['memory_limit']||($config['multi_part']==1&&strlen($dump['data'])+$buffer>$config['multipart_groesse']))
{
WriteToDumpFile();
}
}
if ($table_ready==1&&$dump['table_types'][getDBIndex($db,$table)]!='VIEW') $dump['data'].="/*!40000 ALTER TABLE `$table` ENABLE KEYS */;\n";
}
else
{
// table corrupt -> skip it
$dump['table_offset']++;
$dump['zeilen_offset']=0;
$dump['restzeilen']=$dump['restzeilen']-$ergebnisse;
$dump['data'].="/*!40000 ALTER TABLE `$table` ENABLE KEYS */;\n";
if (strlen($dump['data'])>$config['memory_limit']||($config['multi_part']==1&&strlen($dump['data'])+$buffer>$config['multipart_groesse']))
{
WriteToDumpFile();
}
}
@((mysqli_free_result($result) || (is_object($result) && (get_class($result) == "mysqli_result"))) ? true : false);
}
function WriteToDumpFile()
{
global $config,$dump,$buffer;
$dump['filesize']=0;
$df=$config['paths']['backup'].$dump['backupdatei'];
if ($config['compression']==1)
{
if ($dump['data']!='')
{
$fp=gzopen($df,'ab');
gzwrite($fp,$dump['data']);
gzclose($fp);
}
}
else
{
if ($dump['data']!='')
{
$fp=fopen($df,'ab');
fwrite($fp,$dump['data']);
fclose($fp);
}
}
$dump['data']='';
if (!isset($dump['fileoperations'])) $dump['fileoperations']=0;
$dump['fileoperations']++;
if ($config['multi_part']==1) clearstatcache();
$dump['filesize']=filesize($df);
if ($config['multi_part']==1&&$dump['filesize']+$buffer>$config['multipart_groesse'])
{
@chmod($df,0777);
new_file($dump['filesize']); // Wenn maximale Dateigroesse erreicht -> neues File starten
}
}
function ExecuteCommand($when)
{
global $config,$databases,$dump,$out,$lang;
$lf='<br>';
if (!isset($dump['dbindex'])) return;
if ($when=='b')
{ // before dump
$cd=$databases['command_before_dump'][$dump['dbindex']];
//WriteLog('DbIndex: '.$dump['dbindex'].' Before: '.$databases['command_before_dump'][$dump['dbindex']]);
}
else
{
$cd=$databases['command_after_dump'][$dump['dbindex']];
//WriteLog('DbIndex: '.$dump['dbindex'].' After: '.$databases['command_after_dump'][$dump['dbindex']]);
}
if ($cd!='')
{
//jetzt ausführen
if (substr(strtolower($cd),0,7)!='system:')
{
$cad=array();
mysqli_select_db($GLOBALS["___mysqli_ston"], $databases['Name'][$dump['dbindex']]);
if (strpos($cd,';'))
{
$cad=explode(';',$cd);
}
else
$cad[0]=$cd;
for($i=0;$i<sizeof($cad);$i++)
{
if (trim($cad[$i])>'')
{
$result=@mysqli_query($config['dbconnection'], $cad[$i]);
if ($result===false)
{
WriteLog("Error executing Query '$cad[$i]'! MySQL returns: ".trim(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))));
ErrorLog("Error executing Query '$cad[$i]'!",$databases['Name'][$dump['dbindex']],$cad[$i],((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)),0);
$dump['errors']++;
$out.='<span class="error">Error executing Query '.$cad[$i].'</span>'.$lf;
}
else
{
WriteLog("Successfully executed Query: '$cad[$i]'");
$out.='<span class="success">Successfully executed Query: \''.$cad[$i].'\'</span>'.$lf;
}
}
}
}
elseif (substr(strtolower($cd),0,7)=="system:")
{
$command=substr($cd,7);
$result=@system($command,$returnval);
if (!$result)
{
WriteLog("Error while executing System Command '$command'");
$dump['errors']++;
$out.=$lf.'<span class="error">ERROR executing System Command \''.$ommand.'\'</span><br>';
}
else
{
WriteLog("Successfully executed System Command '$command'. [$returnval]");
$out.=$lf.'<span class="success">Successfully executed System Command \''.$ommand.'.</span><br>';
}
}
}
}
function DoEmail()
{
global $config,$dump,$databases,$email,$lang,$out,$REMOTE_ADDR;
$header="";
if ($config['cron_use_sendmail']==1)
{
//sendmail
if (ini_get("sendmail_path")!=$config['cron_sendmail']) @ini_set("SMTP",$config['cron_sendmail']);
if (ini_get("sendmail_from")!=$config['email_sender']) @ini_set("SMTP",$config['email_sender']);
}
else
{
//SMTP
}
if (ini_get("SMTP")!=$config['cron_smtp']) @ini_set("SMTP",$config['cron_smtp']);
if (ini_get("smtp_port")!=25) @ini_set("smtp_port",25);
if ($config['multi_part']==0)
{
$file=$dump['backupdatei'];
$file_name=(strpos("/",$file)) ? substr($file,strrpos("/",$file)):$file;
$file_type=filetype($config['paths']['backup'].$file);
$file_size=filesize($config['paths']['backup'].$file);
if (($config['email_maxsize']>0&&$file_size>$config['email_maxsize'])||$config['send_mail_dump']==0)
{
//anhang zu gross
$subject="Backup '".$databases['Name'][$dump['dbindex']]."' - ".date("d\.m\.Y H:i",time());
$header.="FROM:".$config['email_sender']."\n";
if (isset($config['email_recipient_cc'])&&trim($config['email_recipient_cc'])>'') $header.="Cc: ".$config['email_recipient_cc']."\r\n";
$header.="MIME-version: 1.0\n";
$header.="X-Mailer: PHP/".phpversion()."\n";
$header.="X-Sender-IP: $REMOTE_ADDR\n";
$header.="Content-Type: text/html; charset=utf-8\n";
if ($config['send_mail_dump']!=0)
{
$msg_body=sprintf(addslashes($lang['L_EMAILBODY_TOOBIG']),byte_output($config['email_maxsize']),$databases['Name'][$dump['dbindex']],"$file (".byte_output(filesize($config['paths']['backup'].$file)).")<br>");
}
else
{
$msg_body=sprintf(addslashes($lang['L_EMAILBODY_NOATTACH']),$databases['Name'][$dump['dbindex']],"$file (".byte_output(filesize($config['paths']['backup'].$file)).")");
}
include_once ('./inc/functions.php');
$msg_body.='<a href="'.getServerProtocol().$_SERVER['HTTP_HOST'].substr($_SERVER["PHP_SELF"],0,strrpos($_SERVER["PHP_SELF"],"/")).'/'.$config['paths']['backup'].$file.'">'.$file.'</a>';
$email_log="Email sent to '".$config['email_recipient']."'";
$email_out=$lang['L_EMAIL_WAS_SEND']."`".$config['email_recipient']."`<br>";
}
else
{
//alles ok, anhang generieren
$msg_body=sprintf(addslashes($lang['L_EMAILBODY_ATTACH']),$databases['Name'][$dump['dbindex']],"$file (".byte_output(filesize($config['paths']['backup'].$file)).")");
$subject="Backup '".$databases['Name'][$dump['dbindex']]."' - ".date("d\.m\.Y",time());
$fp=fopen($config['paths']['backup'].$file,"r");
$contents=fread($fp,$file_size);
$encoded_file=chunk_split(base64_encode($contents));
fclose($fp);
$header.="FROM:".$config['email_sender']."\n";
if (isset($config['email_recipient_cc'])&&trim($config['email_recipient_cc'])>'') $header.="Cc: ".$config['email_recipient_cc']."\r\n";
$header.="MIME-version: 1.0\n";
$header.="Content-type: multipart/mixed; ";
$header.="boundary=\"Message-Boundary\"\n";
$header.="Content-transfer-encoding: 7BIT\n";
$header.="X-attachments: $file_name";
$body_top="--Message-Boundary\n";
$body_top.="Content-type: text/html; charset=utf-8\n";
$body_top.="Content-transfer-encoding: 7BIT\n";
$body_top.="Content-description: Mail message body\n\n";
$msg_body=$body_top.$msg_body;
$msg_body.="\n\n--Message-Boundary\n";
$msg_body.="Content-type: $file_type; name=\"$file\"\n";
$msg_body.="Content-Transfer-Encoding: BASE64\n";
$msg_body.="Content-disposition: attachment; filename=\"$file\"\n\n";
$msg_body.="$encoded_file\n";
$msg_body.="--Message-Boundary--\n";
$email_log="Email was sent to '".$config['email_recipient']."' with '".$dump['backupdatei']."'.";
$email_out=$lang['L_EMAIL_WAS_SEND']."`".$config['email_recipient']."`".$lang['L_WITH']."`".$dump['backupdatei']."`.<br>";
}
}
else
{
//Multipart
$mp_sub="Backup '".$databases['Name'][$dump['dbindex']]."' - ".date("d\.m\.Y",time());
$subject=$mp_sub;
$header.="FROM:".$config['email_sender']."\n";
if (isset($config['email_recipient_cc'])&&trim($config['email_recipient_cc'])>'') $header.="Cc: ".$config['email_recipient_cc']."\r\n";
$header.="MIME-version: 1.0\n";
$header.="X-Mailer: PHP/".phpversion()."\n";
$header.="X-Sender-IP: $REMOTE_ADDR\n";
$header.="Content-Type: text/html; charset=utf-8";
$dateistamm=substr($dump['backupdatei'],0,strrpos($dump['backupdatei'],"part_"))."part_";
$dateiendung=($config['compression']==1) ? ".sql.gz":".sql";
$mpdatei=Array();
$mpfiles="";
for($i=1;$i<($dump['part']-$dump['part_offset']);$i++)
{
$mpdatei[$i-1]=$dateistamm.$i.$dateiendung;
$sz=byte_output(@filesize($config['paths']['backup'].$mpdatei[$i-1]));
$mpfiles.=$mpdatei[$i-1]." (".$sz.")<br>";
}
$msg_body=($config['send_mail_dump']==1) ? sprintf(addslashes($lang['L_EMAILBODY_MP_ATTACH']),$databases['Name'][$dump['dbindex']],$mpfiles):sprintf(addslashes($lang['L_EMAILBODY_MP_NOATTACH']),$databases['Name'][$dump['dbindex']],$mpfiles);
$email_log="Email was sent to '".$config['email_recipient']."'";
$email_out=$lang['L_EMAIL_WAS_SEND']."`".$config['email_recipient']."`<br>";
}
if (@mail($config['email_recipient'],stripslashes($subject),$msg_body,$header))
{
$out.='<span class="success">'.$email_out.'</span>';
WriteLog("$email_log");
}
else
{
$out.='<span class="error">'.$lang['L_MAILERROR'].'</span><br>';
WriteLog("Email to '".$config['email_recipient']."' failed !");
ErrorLog("Email ",$databases['Name'][$dump['dbindex']],'Subject: '.stripslashes($subject),$lang['L_MAILERROR']);
$dump['errors']++;
}
if (isset($mpdatei)&&$config['send_mail_dump']==1)
{ // && ($config['email_maxsize']==0 || ($config['email_maxsize']>0 && $config['multipartgroesse2']<=$config['email_maxsize']))) {
for($i=0;$i<count($mpdatei);$i++)
{
$file_name=$mpdatei[$i];
$file_type=filetype($config['paths']['backup'].$mpdatei[$i]);
$file_size=filesize($config['paths']['backup'].$mpdatei[$i]);
$fp=fopen($config['paths']['backup'].$mpdatei[$i],"r");
$contents=fread($fp,$file_size);
$encoded_file=chunk_split(base64_encode($contents));
fclose($fp);
$subject=$mp_sub." [Part ".($i+1)." / ".count($mpdatei)."]";
$header="FROM:".$config['email_sender']."\n";
if (isset($config['email_recipient_cc'])&&trim($config['email_recipient_cc'])>'') $header.="Cc: ".$config['email_recipient_cc']."\r\n";
$header.="MIME-version: 1.0\n";
$header.="Content-type: multipart/mixed; ";
$header.="boundary=\"Message-Boundary\"\n";
$header.="Content-transfer-encoding: 7BIT\n";
$header.="X-attachments: $file_name";
$body_top="--Message-Boundary\n";
$body_top.="Content-type: text/html; charset=utf-8\n";
$body_top.="Content-transfer-encoding: 7BIT\n";
$body_top.="Content-description: Mail message body\n\n";
$msg_body=$body_top.addslashes($lang['L_EMAIL_ONLY_ATTACHMENT'].$lang['L_EMAILBODY_FOOTER']);
$msg_body.="\n\n--Message-Boundary\n";
$msg_body.="Content-type: $file_type; name=\"".$mpdatei[$i]."\"\n";
$msg_body.="Content-Transfer-Encoding: BASE64\n";
$msg_body.="Content-disposition: attachment; filename=\"".$mpdatei[$i]."\"\n\n";
$msg_body.="$encoded_file\n";
$msg_body.="--Message-Boundary--\n";
$email_log="Email with $mpdatei[$i] was sent to '".$config['email_recipient']."'";
$email_out=$lang['L_EMAIL_WAS_SEND']."`".$config['email_recipient']."`".$lang['L_WITH']."`".$mpdatei[$i]."`.<br>";
if (@mail($config['email_recipient'],stripslashes($subject),$msg_body,$header))
{
$out.='<span class="success">'.$email_out.'</span>';
WriteLog("$email_log");
}
else
{
$out.='<span class="error">'.$lang['L_MAILERROR'].'</span><br>';
WriteLog("Email to '".$config['email_recipient']."' failed !");
ErrorLog("Email ",$databases['Name'][$dump['dbindex']],'Subject: '.stripslashes($subject),$lang['L_MAILERROR']);
$dump['errors']++;
}
}
}
}
function DoFTP($i)
{
global $config,$dump,$out;
if ($config['multi_part']==0)
{
SendViaFTP($i,$dump['backupdatei'],1);
}
else
{
$dateistamm=substr($dump['backupdatei'],0,strrpos($dump['backupdatei'],"part_"))."part_";
$dateiendung=($config['compression']==1) ? ".sql.gz":".sql";
for($a=1;$a<($dump['part']-$dump['part_offset']);$a++)
{
$mpdatei=$dateistamm.$a.$dateiendung;
SendViaFTP($i,$mpdatei,$a);
}
}
}
function SendViaFTP($i,$source_file,$conn_msg=1)
{
global $config,$out,$lang;
flush();
if ($conn_msg==1) $out.='<span class="success">'.$lang['L_FILESENDFTP']."(".$config['ftp_server'][$i]." - ".$config['ftp_user'][$i].")</span><br>";
// Herstellen der Basis-Verbindung
if ($config['ftp_useSSL'][$i]==0) $conn_id=@ftp_connect($config['ftp_server'][$i],$config['ftp_port'][$i],$config['ftp_timeout'][$i]);
else
$conn_id=@ftp_ssl_connect($config['ftp_server'][$i],$config['ftp_port'][$i],$config['ftp_timeout'][$i]);
// Einloggen mit Benutzername und Kennwort
$login_result=@ftp_login($conn_id,$config['ftp_user'][$i],$config['ftp_pass'][$i]);
if ($config['ftp_mode'][$i]==1) ftp_pasv($conn_id,true);
// Verbindung überprüfen
if ((!$conn_id)||(!$login_result))
{
$out.='<span class="error">'.$lang['L_FTPCONNERROR'].$config['ftp_server'][$i].$lang['L_FTPCONNERROR1'].$config['ftp_user'][$i].$lang['L_FTPCONNERROR2'].'</span><br>';
}
else
{
if ($conn_msg==1) $out.='<span class="success">'.$lang['L_FTPCONNECTED1'].$config['ftp_server'][$i].$lang['L_FTPCONNERROR1'].$config['ftp_user'][$i].'</span><br>';
}
// Upload der Datei
$dest=$config['ftp_dir'][$i].$source_file;
$source=$config['paths']['backup'].$source_file;
$upload=@ftp_put($conn_id,$dest,$source,FTP_BINARY);
// Upload-Status überprüfen
if (!$upload)
{
$out.='<span class="error">'.$lang['L_FTPCONNERROR3']."<br>($source -> $dest)</span><br>";
}
else
{
$out.='<span class="success">'.$lang['L_FILE'].' <a href="'.$config['paths']['backup'].$source_file.'" class="smallblack">'.$source_file.'</a>'.$lang['L_FTPCONNECTED2'].$config['ftp_server'][$i].$lang['L_FTPCONNECTED3'].'</span><br>';
WriteLog("'$source_file' sent via FTP.");
}
// Schließen des FTP-Streams
@ftp_quit($conn_id);
}
?>

Datei anzeigen

@ -1,491 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
function FilelisteCombo($fpath,$selected)
{
$r='<select name="selectfile">';
$r.='<option value="" '.(($selected=="") ? "SELECTED":"").'></option>';
$dh=opendir($fpath);
while (false!==($filename=readdir($dh)))
{
if ($filename!="."&&$filename!=".."&&!is_dir($fpath.$filename))
{
$r.='<option value="'.$filename.'" ';
if ($filename==$selected) $r.=' SELECTED';
$r.='>'.$filename.'</option>'."\n";
}
}
$r.='</select>';
return $r;
}
function sortierdatum($datum)
{
$p=explode(' ',$datum);
$uhrzeit=$p[1];
$p2=explode('.',$p[0]);
$day=$p2[0];
$month=$p2[1];
$year=$p2[2];
return $year.'.'.$month.'.'.$day.' '.$uhrzeit;
}
function FileList($multi=0)
{
global $config,$fpath,$lang,$databases,$href,$dbactiv,$action,$expand;
$files=Array();
//Backup-Dateien
$Theader=$lang['L_FM_FILES1'].' '.$lang['L_OF'].' "'.$dbactiv.'"';
$akind=1;
$Sum_Files=0;
$dh=opendir($fpath);
$fl="";
$i=0;
while (false!==($filename=readdir($dh)))
{
if ($filename!='.'&&$filename!='..'&&!is_dir($fpath.$filename))
{
$files[$i]['name']=$filename;
$Sum_Files++;
$i++;
}
}
$fl.='<div>'.$lang['L_FM_CHOOSE_FILE'].' ';
$fl.='<span id="gd">&nbsp;</span><br><br>';
$fl.='<table class="bdr">';
$fl.='<tr><td colspan="8" align="left"><strong>'.$Theader.'</strong></td><td colspan="3" align="right"></td></tr>';
//Tableheader
$fl.='<tr class="thead"><th colspan="3">'.$lang['L_DB'].'</th>
<th>gz</th>
<th>Script</th>
<th colspan="2">'.$lang['L_COMMENT'].'</th>
<th>'.$lang['L_FM_FILEDATE'].'</th>
<th>Multipart</th>
<th>'.$lang['L_FM_TABLES'].' / '.$lang['L_FM_RECORDS'].'</th>
<th>'.$lang['L_FM_FILESIZE'].'</th>
<th>'.$lang['L_ENCODING'].'</th></tr>';
$checkindex=$arrayindex=$gesamt=0;
$db_summary_anzahl=Array();
if (count($files)>0)
{
for($i=0;$i<sizeof($files);$i++)
{
// Dateigr&ouml;&szlig;e
$size=filesize($fpath.$files[$i]['name']);
$file_datum=date("d\.m\.Y H:i",filemtime($fpath.$files[$i]['name']));
//statuszeile auslesen
$sline='';
if (substr($files[$i]['name'],-3)=='.gz')
{
if ($config['zlib'])
{
$fp=gzopen($fpath.$files[$i]['name'],"r");
$sline=gzgets($fp,40960);
gzclose($fp);
}
}
else
{
$fp=fopen($fpath.$files[$i]['name'],"r");
$sline=fgets($fp,5000);
fclose($fp);
}
$statusline=ReadStatusline($sline);
$but=ExtractBUT($files[$i]['name']);
if ($but=='') $but=$file_datum;
$dbn=$statusline['dbname'];
if ($dbn=='unknown') $dbn='~unknown'; // needed for sorting - place unknown files at the end
//jetzt alle in ein Array packen
if ($statusline['part']=='MP_0'||$statusline['part']=='')
{
$db_backups[$arrayindex]['name']=$files[$i]['name'];
$db_backups[$arrayindex]['db']=$dbn;
$db_backups[$arrayindex]['size']=$size;
$db_backups[$arrayindex]['date']=$but;
$db_backups[$arrayindex]['sort']=sortierdatum($but);
$db_backups[$arrayindex]['tabellen']=$statusline['tables'];
$db_backups[$arrayindex]['eintraege']=$statusline['records'];
$db_backups[$arrayindex]['multipart']=0;
$db_backups[$arrayindex]['kommentar']=$statusline['comment'];
$db_backups[$arrayindex]['script']=($statusline['script']!='') ? $statusline['script'].'('.$statusline['scriptversion'].')':'';
$db_backups[$arrayindex]['charset']=$statusline['charset'];
if (!isset($db_summary_last[$dbn])) $db_summary_last[$dbn]=$but;
$db_summary_anzahl[$dbn]=(isset($db_summary_anzahl[$dbn])) ? $db_summary_anzahl[$dbn]+1:1;
$db_summary_size[$dbn]=(isset($db_summary_size[$dbn])) ? $db_summary_size[$dbn]+$size:$size;
if (sortierdatum($but)>sortierdatum($db_summary_last[$dbn])) $db_summary_last[$dbn]=$but;
}
else
{
//multipart nur einmal
$done=0;
if (!isset($db_summary_size[$dbn])) $db_summary_size[$dbn]=0;
for($j=0;$j<$arrayindex;$j++)
{
if (isset($db_backups[$j]))
{
if (($db_backups[$j]['date']==$but)&&($db_backups[$j]['db']==$dbn))
{
$db_backups[$j]['multipart']++;
$db_backups[$j]['size']+=$size;
$db_summary_size[$dbn]+=$size;
$done=1;
break;
}
}
}
if ($done==1) $arrayindex--;
if ($done==0)
{
//Eintrag war noch nicht vorhanden
$db_backups[$arrayindex]['name']=$files[$i]['name'];
$db_backups[$arrayindex]['db']=$dbn;
$db_backups[$arrayindex]['size']=$size;
$db_backups[$arrayindex]['date']=$but;
$db_backups[$arrayindex]['sort']=sortierdatum($but);
$db_backups[$arrayindex]['tabellen']=$statusline['tables'];
$db_backups[$arrayindex]['eintraege']=$statusline['records'];
$db_backups[$arrayindex]['multipart']=1;
$db_backups[$arrayindex]['kommentar']=$statusline['comment'];
$db_backups[$arrayindex]['script']=($statusline['script']!="") ? $statusline['script']."(".$statusline['scriptversion'].")":"";
$db_backups[$arrayindex]['charset']=$statusline['charset'];
if (!isset($db_summary_last[$dbn])) $db_summary_last[$dbn]=$but;
$db_summary_anzahl[$dbn]=(isset($db_summary_anzahl[$dbn])) ? $db_summary_anzahl[$dbn]+1:1;
$db_summary_size[$dbn]=(isset($db_summary_size[$dbn])) ? $db_summary_size[$dbn]+$size:$size;
if (sortierdatum($but)>sortierdatum($db_summary_last[$dbn])) $db_summary_last[$dbn]=$but;
}
}
// Gesamtgroesse aller Backupfiles
$arrayindex++;
$gesamt=$gesamt+$size;
}
}
//Schleife fertig - jetzt Ausgabe
if ((isset($db_backups))&&(is_array($db_backups))) $db_backups=mu_sort($db_backups,'sort,name');
// Hier werden die Dateinamen ausgegeben
$rowclass=0;
if ($arrayindex>0)
{
for($i=$arrayindex;$i>=0;$i--)
{
if (isset($db_backups[$i]['db'])&&$db_backups[$i]['db']==$dbactiv)
{
$cl=($rowclass%2) ? 'dbrow':'dbrow1';
$multi=($db_summary_anzahl[$dbactiv]>1&&$action=='files') ? 1:0;
if ($db_backups[$i]['multipart']>0)
{
$dbn=NextPart($db_backups[$i]['name'],1);
}
else
{
$dbn=$db_backups[$i]['name'];
}
$fl.='<tr ';
$fl.='class="'.(($rowclass%2) ? 'dbrow"':'dbrow1"');
$fl.='>';
$fl.='<td align="left" colspan="2" nowrap="nowrap">';
$fl.='<input type="hidden" name="multi" value="'.$multi.'">';
if ($multi==0)
{
$fl.='<input type="hidden" name="multipart[]" value="'.$db_backups[$i]['multipart'].'"><input name="file[]" type="radio" class="radio" value="'.$dbn.'" onClick="Check('.$checkindex++.',0);">';
}
else
{
$fl.='<input type="hidden" name="multipart[]" value="'.$db_backups[$i]['multipart'].'"><input name="file[]" type="checkbox" class="checkbox" value="'.$dbn.'" onClick="Check('.$checkindex++.',1);">';
}
if ($db_backups[$i]['multipart']==0)
{
$fl.='&nbsp;<a href="'.$fpath.urlencode($dbn).'" title="Backupfile: '.$dbn.'" style="font-size:8pt;" target="_blank">';
$fl.=(($db_backups[$i]['db']=='~unknown') ? $dbn:$db_backups[$i]['db']).'</a></td>';
$fl.='<td><a href="filemanagement.php?action=dl&amp;f='.urlencode($dbn).'" title="'.$lang['L_DOWNLOAD_FILE'].'" alt="'.$lang['L_DOWNLOAD_FILE'].'"><img src="'.$config['files']['iconpath'].'/openfile.gif"></a></td>';
}
else
$fl.='&nbsp;<span style="font-size:8pt;">'.$db_backups[$i]['db'].'</span><td>&nbsp;</td></td>';
$fl.='<td class="sm" nowrap="nowrap" align="center">'.((substr($dbn,-3)==".gz") ? '<img src="'.$config['files']['iconpath'].'gz.gif" alt="'.$lang['L_COMPRESSED'].'" width="16" height="16" border="0">':"&nbsp;").'</td>';
$fl.='<td class="sm" nowrap="nowrap" align="center">'.$db_backups[$i]['script'].'</td>';
$fl.='<td class="sm" nowrap="nowrap" align="right">'.(($db_backups[$i]['kommentar']!="") ? '<img src="'.$config['files']['iconpath'].'rename.gif" alt="'.$db_backups[$i]['kommentar'].'" title="'.$db_backups[$i]['kommentar'].'" width="16" height="16" border="0">':"&nbsp;").'</td>';
$fl.='<td class="sm" nowrap="nowrap" align="left">'.(($db_backups[$i]['kommentar']!="") ? nl2br(wordwrap($db_backups[$i]['kommentar'],50)):"&nbsp;").'</td>';
$fl.='<td class="sm" nowrap="nowrap">'.$db_backups[$i]['date'].'</td>';
$fl.='<td style="text-align:center">';
$fl.=($db_backups[$i]['multipart']==0) ? $lang['L_NO']:'<a style="font-size:11px;" href="filemanagement.php?action=files&amp;kind=0&amp;dbactiv='.$dbactiv.'&amp;expand='.$i.'">'.$db_backups[$i]['multipart'].' Files</a>'; //
$fl.='</td><td style="text-align:right;padding-right:12px;" nowrap="nowrap">';
$fl.=($db_backups[$i]['eintraege']!=-1) ? $db_backups[$i]['tabellen'].' / '.number_format($db_backups[$i]['eintraege'],0,",","."):$lang['L_FM_OLDBACKUP'];
$fl.='</td>';
$fl.='<td style="font-size:8pt;text-align:right">'.byte_output($db_backups[$i]['size']).'</td>';
$fl.='<td style="font-size:8pt;text-align:right">'.$db_backups[$i]['charset'].'</td>';
$fl.='</tr>';
if ($expand==$i)
{
$fl.='<tr '.(($dbactiv==$databases['db_actual']) ? 'class="dbrowsel"':'class="'.$cl.'"').'>';
$fl.='<td class="sm" valign="top">All Parts:</td><td class="sm" colspan="11" align="left">'.PartListe($db_backups[$i]['name'],$db_backups[$i]['multipart']).'</td>';
}
$rowclass++;
}
}
}
//v($db_backups);
$fl.='<tr><td colspan="11" align="left"><br><strong>'.$lang['L_FM_ALL_BU'].'</strong></td></tr>';
//Tableheader
$fl.='<tr class="thead"><th colspan="5" align="left">'.$lang['L_FM_DBNAME'].'</th>
<th align="left">'.$lang['L_FM_ANZ_BU'].'</th><th>'.$lang['L_FM_LAST_BU'].'</th>
<th colspan="5" style="text-align:right;">'.$lang['L_FM_TOTALSIZE'].'</th></tr>';
//die anderen Backups
if (count($db_summary_anzahl)>0)
{
//lets sort the list
ksort($db_summary_last);
ksort($db_summary_anzahl);
ksort($db_summary_size);
$i=0;
while (list ($key,$val)=each($db_summary_anzahl))
{
$cl=($i++%2) ? "dbrow":"dbrow1";
$keyaus=($key=="~unknown") ? '<em>'.$lang['L_NO_MSD_BACKUPFILE'].'</em>':$key;
$fl.='<tr class="'.$cl.'"><td colspan="5" align="left"><a href="'.$href.'&amp;dbactiv='.$key.'">'.$keyaus.'</a></td>';
$fl.='<td style="text-align:right">'.$val.'&nbsp;&nbsp;</td>';
$fl.='<td class="sm" nowrap="nowrap">'.((isset($db_summary_last[$key])) ? $db_summary_last[$key]:'').'</td>';
$fl.='<td style="text-align:right;font-size:8pt;" colspan="5">'.byte_output($db_summary_size[$key]).'&nbsp;</td>';
$fl.='</tr>';
}
}
if (!is_array($files)) $fl.='<tr><td colspan="11">'.$lang['L_FM_NOFILESFOUND'].'</td></tr>';
//--------------------------------------------------------
//*** Ausgabe der Gesamtgr&ouml;&szlig;e aller Backupfiles ***
//--------------------------------------------------------
$space=MD_FreeDiskSpace();
$fl.='<tr>';
$fl.='<td align="left" colspan="8"><b>'.$lang['L_FM_TOTALSIZE'].' ('.$Sum_Files.' files): </b> </td>';
$fl.='<td style="text-align:right" colspan="4"><b>'.byte_output($gesamt).'</b></td>';
$fl.='</tr>';
//--------------------------------------------------------
//*** Ausgabe des freien Speicher auf dem Rechner ***
//--------------------------------------------------------
$fl.='<tr>';
$fl.='<td colspan="8" align="left">'.$lang['L_FM_FREESPACE'].': </td>';
$fl.='<td colspan="4" style="text-align:right"><b>'.$space.'</b></td>';
$fl.='</tr>';
$fl.='</table></div>';
return $fl;
}
function read_statusline_from_file($filename)
{
global $config;
if (strtolower(substr($filename,-2))=='gz')
{
$fp=gzopen($config['paths']['backup'].$filename,"r");
if ($fp===false) die('Can\'t open file '.$filename);
$sline=gzgets($fp,40960);
gzclose($fp);
}
else
{
$fp=fopen($config['paths']['backup'].$filename,"r");
if ($fp===false) die('Can\'t open file '.$filename);
$sline=fgets($fp,5000);
fclose($fp);
}
$statusline=ReadStatusline($sline);
return $statusline;
}
function PartListe($f,$nr)
{
global $config,$lang,$fpath;
$dateistamm=substr($f,0,strrpos($f,"part_"))."part_";
$dateiendung=(substr(strtolower($f),-2)=="gz") ? ".sql.gz":".sql";
$s="";
for($i=1;$i<=$nr;$i++)
{
if ($i>1) $s.="<br>";
$s.='<a href="'.$fpath.urlencode($dateistamm.$i.$dateiendung).'">'.$dateistamm.$i.$dateiendung.'</a>&nbsp;&nbsp;&nbsp;'.byte_output(@filesize($config['paths']['backup'].$dateistamm.$i.$dateiendung));
$s.='&nbsp;<a href="filemanagement.php?action=dl&amp;f='.urlencode($dateistamm.$i.$dateiendung).'" title="'.$lang['L_DOWNLOAD_FILE'].'" alt="'.$lang['L_DOWNLOAD_FILE'].'"><img src="'.$config['files']['iconpath'].'/openfile.gif"></a>';
}
return $s;
}
function Converter($filesource,$filedestination,$cp)
{
global $config,$lang;
$filesize=0;
$max_filesize=1024*1024*10; //10 MB splitsize
$part=1;
$cps=(substr(strtolower($filesource),-2)=="gz") ? 1:0;
$filedestination.='_'.date("Y_m_d_H_i",time());
echo "<h5>".sprintf($lang['L_CONVERT_FILEREAD'],$filesource).".....</h5><span style=\"font-size:10px;\">";
if (file_exists($config['paths']['backup'].$filedestination)) unlink($config['paths']['backup'].$filedestination);
$f=($cps==1) ? gzopen($config['paths']['backup'].$filesource,"r"):fopen($config['paths']['backup'].$filesource,"r");
$z=($cp==1) ? gzopen($config['paths']['backup'].$filedestination.'_part_1.sql.gz',"w"):fopen($config['paths']['backup'].$filedestination.'_part_1.sql',"w");
$zeile=get_pseudo_statusline($part,$filedestination)."\r\n";
($cp==1) ? gzwrite($z,$zeile):fwrite($z,$zeile);
$zeile='';
$insert=$mode="";
$n=0;
$eof=($cps==1) ? gzeof($f):feof($f);
$splitable=false; // can the file be splitted? Try to avoid splitting before a command is completed
WHILE (!$eof)
{
$eof=($cps==1) ? gzeof($f):feof($f);
$zeile=($cps==1) ? gzgets($f,5144000):fgets($f,5144000);
$t=strtolower(substr($zeile,0,10));
if ($t>'')
{
switch ($t)
{
case 'insert int':
{
// eine neue Insert Anweisung beginnt
if (strpos($zeile,'(')===false)
{
//Feldnamen stehen in der naechsten Zeile - holen
$zeile.="\n\r";
$zeile.=($cps==1) ? trim(gzgets($f,8192)):trim(fgets($f,8192));
$zeile.=' ';
}
// get INSERT-Satement
$insert=substr($zeile,0,strpos($zeile,'('));
if (substr(strtoupper($insert),-7)!='VALUES ') $insert.=' VALUES ';
$mode='insert';
$zeile="\n\r".$zeile;
$splitable=false;
break;
}
case 'create tab':
{
$mode='create';
WHILE (substr(rtrim($zeile),-1)!=';')
{
$zeile.=fgets($f,8192);
}
$zeile="\n\r".MySQL_Ticks($zeile)."\n\r";
$splitable=true;
break;
}
}
}
if ($mode=='insert')
{
if (substr(rtrim($zeile),strlen($zeile)-3,2)==');') $splitable=true;
// Komma loeschen
$zeile=str_replace('),(',");\n\r".$insert.' (',$zeile);
}
if ($splitable==true&&$filesize>$max_filesize) // start new file?
{
$part++;
if ($mode=='insert') // Insert -> first complete Insert-Statement, then begin new file
{
if ($cp==1)
{
gzwrite($z,$zeile);
gzclose($z);
$z=gzopen($config['paths']['backup'].$filedestination.'_part_'.$part.'.sql.gz',"w");
$zeile=get_pseudo_statusline($part,$filedestination)."\r\n";
gzwrite($z,$zeile);
$zeile='';
}
else
{
fwrite($z,$zeile);
echo "<br>Neue Datei.Zeile: <br>".htmlspecialchars(substr($zeile,0,20))."..".htmlspecialchars(substr($zeile,strlen($zeile)-41,40))."<br>";
fclose($z);
$z=fopen($config['paths']['backup'].$filedestination.'_part_'.$part.'.sql',"w");
$zeile=get_pseudo_statusline($part,$filedestination)."\r\n";
gzwrite($z,$zeile);
$zeile='';
}
}
else // first close last file, then begin new one and write new beginning command
{
if ($cp==1)
{
gzclose($z);
$z=gzopen($config['paths']['backup'].$filedestination.'_part_'.$part.'.sql.gz',"w");
$zeile=get_pseudo_statusline($part,$filedestination)."\r\n".$zeile;
gzwrite($z,$zeile);
}
else
{
fclose($z);
$z=fopen($config['paths']['backup'].$filedestination.'_part_'.$part.'.sql',"w");
$zeile=get_pseudo_statusline($part,$filedestination)."\r\n".$zeile;
fwrite($z,$zeile);
}
}
$filesize=0;
$splitable=false;
}
else // no, append to actual file
{
$filesize+=strlen($zeile);
if ($n>600)
{
$n=0;
echo '<br>';
}
echo '.';
if ($cps==1) gzwrite($z,$zeile);
else
fwrite($z,$zeile);
flush();
}
$n++;
//if ($part>4) break;
}
$zeile="\n-- EOB";
if ($cps==1)
{
gzwrite($z,$zeile);
gzclose($z);
}
else
{
fwrite($z,$zeile);
fclose($z);
}
if ($cps==1) gzclose($f);
else
fclose($f);
echo '</span><h5>'.sprintf($lang['L_CONVERT_FINISHED'],$filedestination).'</h5>';
}
function get_pseudo_statusline($part,$filedestination)
{
echo '<br>Continue with part: '.$part.'<br>';
$ret='-- Status:-1:-1:MP_'.($part).':'.$filedestination.":php:converter2:converted:unknown:1:::latin1:EXTINFO\r\n"."-- TABLE-INFO\r\n"."-- TABLE|unknown|0|0|2009-01-24 20:39:39\r\n"."-- EOF TABLE-INFO\r\n";
return $ret;
}
?>

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -1,402 +0,0 @@
<?php
function CheckCSVOptions()
{
global $sql;
if (!isset($sql['export']['trenn'])) $sql['export']['trenn']=";";
if (!isset($sql['export']['enc'])) $sql['export']['enc']="\"";
if (!isset($sql['export']['esc'])) $sql['export']['esc']="\\";
if (!isset($sql['export']['ztrenn'])) $sql['export']['ztrenn']="\\r\\n";
if (!isset($sql['export']['null'])) $sql['export']['null']="NULL";
if (!isset($sql['export']['namefirstline'])) $sql['export']['namefirstline']=0;
if (!isset($sql['export']['format'])) $sql['export']['format']=0;
if (!isset($sql['export']['sendfile'])) $sql['export']['sendfile']=0;
if (!isset($sql['export']['tables'])) $sql['export']['tables']=Array();
if (!isset($sql['export']['compressed'])) $sql['export']['compressed']=0;
if (!isset($sql['export']['htmlstructure'])) $sql['export']['htmlstructure']=0;
if (!isset($sql['export']['xmlstructure'])) $sql['export']['xmlstructure']=0;
if (!isset($sql['import']['trenn'])) $sql['import']['trenn']=";";
if (!isset($sql['import']['enc'])) $sql['import']['enc']="\"";
if (!isset($sql['import']['esc'])) $sql['import']['esc']="\\";
if (!isset($sql['import']['ztrenn'])) $sql['import']['ztrenn']="\\r\\n";
if (!isset($sql['import']['null'])) $sql['import']['null']="NULL";
if (!isset($sql['import']['namefirstline'])) $sql['import']['namefirstline']=0;
if (!isset($sql['import']['format'])) $sql['import']['format']=0;
}
function ExportCSV()
{
global $sql,$config;
$t="";
$time_start=time();
if (!isset($config['dbconnection'])) MSD_mysql_connect();
for ($table=0; $table < count($sql['export']['tables']); $table++)
{
$sqlt="SHOW Fields FROM `" . $sql['export']['db'] . "`.`" . $sql['export']['tables'][$table] . "`;";
$res=MSD_query($sqlt);
if ($res)
{
$numfields=mysqli_num_rows($res);
if ($sql['export']['namefirstline'] == 1)
{
for ($feld=0; $feld < $numfields; $feld++)
{
$row=mysqli_fetch_row($res);
if ($sql['export']['enc'] != "") $t.=$sql['export']['enc'] . $row[0] . $sql['export']['enc'] . ( ( $feld + 1 < $numfields ) ? $sql['export']['trenn'] : '' );
else $t.=$row[0] . ( ( $feld + 1 < $numfields ) ? $sql['export']['trenn'] : '' );
}
$t.=$sql['export']['endline'];
$sql['export']['lines']++;
}
}
$sqlt="SELECT * FROM `" . $sql['export']['db'] . "`.`" . $sql['export']['tables'][$table] . "`;";
$res=MSD_query($sqlt);
if ($res)
{
$numrows=mysqli_num_rows($res);
for ($data=0; $data < $numrows; $data++)
{
$row=mysqli_fetch_row($res);
for ($feld=0; $feld < $numfields; $feld++)
{
if (!isset($row[$feld]) || is_null($row[$feld]))
{
$t.=$sql['export']['null'];
}
elseif ($row[$feld] == '0' || $row[$feld] != '')
{
if ($sql['export']['enc'] != "") $t.=$sql['export']['enc'] . str_replace($sql['export']['enc'],$sql['export']['esc'] . $sql['export']['enc'],$row[$feld]) . $sql['export']['enc'];
else $t.=$row[$feld];
}
else
{
$t.='';
}
$t.=( $feld + 1 < $numfields ) ? $sql['export']['trenn'] : '';
}
$t.=$sql['export']['endline'];
$sql['export']['lines']++;
if (strlen($t) > $config['memory_limit'])
{
CSVOutput($t);
$t="";
}
$time_now=time();
if ($time_start >= $time_now + 30)
{
$time_start=$time_now;
header('X-MSDPing: Pong');
}
}
}
}
CSVOutput($t,1);
}
function CSVOutput($str, $last=0)
{
global $sql,$config;
if ($sql['export']['sendfile'] == 0)
{
//Display
echo $str;
}
else
{
if ($sql['export']['header_sent'] == "")
{
if ($sql['export']['compressed'] == 1 & !function_exists('gzencode')) $sql['export']['compressed']=0;
if ($sql['export']['format'] < 4)
{
$file=$sql['export']['db'] . ( ( $sql['export']['compressed'] == 1 ) ? ".csv.gz" : ".csv" );
}
elseif ($sql['export']['format'] == 4)
{
$file=$sql['export']['db'] . ( ( $sql['export']['compressed'] == 1 ) ? ".xml.gz" : ".xml" );
}
elseif ($sql['export']['format'] == 5)
{
$file=$sql['export']['db'] . ( ( $sql['export']['compressed'] == 1 ) ? ".html.gz" : ".html" );
}
$mime=( $sql['export']['compressed'] == 0 ) ? "x-type/subtype" : "application/x-gzip";
header('Content-Disposition: attachment; filename="' . $file . '"');
header('Pragma: no-cache');
header('Content-Type: ' . $mime);
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
$sql['export']['header_sent']=1;
}
if ($sql['export']['compressed'] == 1) echo gzencode($str);
else echo $str;
}
}
function DoImport()
{
global $sql,$lang;
$r='<span class="swarnung">';
$zeilen=count($sql['import']['csv']) - $sql['import']['namefirstline'];
$sql['import']['first_zeile']=explode($sql['import']['trenn'],$sql['import']['csv'][0]);
$importfelder=count($sql['import']['first_zeile']);
if ($sql['import']['tablecreate'] == 0)
{
$res=MSD_query("show fields FROM " . $sql['import']['table']);
$tabellenfelder=mysqli_num_rows($res);
if ($importfelder != $tabellenfelder)
{
$r.='<br>' . sprintf($lang['L_CSV_FIELDCOUNT_NOMATCH'],$tabellenfelder,$importfelder);
}
else
{
$ok=1;
}
}
else
{
$ok=ImportCreateTable();
if ($ok == 0)
{
$r.='<br>' . sprintf($lang['L_CSV_ERRORCREATETABLE'],$sql['import']['table']);
}
}
if ($ok == 1)
{
$insert="";
if ($sql['import']['emptydb'] == 1 && $sql['import']['tablecreate'] == 0)
{
MSD_DoSQL("TRUNCATE " . $sql['import']['table'] . ";");
}
$sql['import']['lines_imported']=0;
$enc=( $sql['import']['enc'] == "" ) ? "'" : "";
$zc="";
for ($i=$sql['import']['namefirstline']; $i < $zeilen + $sql['import']['namefirstline']; $i++)
{
//Importieren
$insert="INSERT INTO " . $sql['import']['table'] . " VALUES(";
if ($sql['import']['createindex'] == 1) $insert.="'', ";
$zc.=trim(rtrim($sql['import']['csv'][$i]));
//echo "Zeile $i: $zc<br>";
if ($zc != "")
{ // && substr($zc,-1)==$enc) {
$zeile=explode($sql['import']['trenn'],$zc);
for ($j=0; $j < $importfelder; $j++)
{
$a=( $zeile[$j] == "" && $enc == "" ) ? "''" : $zeile[$j];
$insert.=$enc . $a . $enc . ( ( $j == $importfelder - 1 ) ? ");\n" : "," );
}
MSD_DoSQL($insert);
$sql['import']['lines_imported']++;
$zc="";
}
}
$r.=sprintf($lang['L_CSV_FIELDSLINES'],$importfelder,$sql['import']['lines_imported']);
}
$r.='</span>';
return $r;
}
function ImportCreateTable()
{
global $sql,$lang,$db,$config;
$tbl=Array();
$tabellen=mysqli_query($config['dbconnection'], "SHOW TABLES FROM `$db`");
$num_tables=mysqli_num_rows($tabellen);
for ($i=0; $i < $num_tables; $i++)
{
$tbl[]=strtolower(((mysqli_data_seek($tabellen, $i) && (($___mysqli_tmp = mysqli_fetch_row($tabellen)) !== NULL)) ? array_shift($___mysqli_tmp) : false));
}
$i=0;
$sql['import']['table']=$sql['import']['table'] . $i;
while (in_array($sql['import']['table'],$tbl))
{
$sql['import']['table']=substr($sql['import']['table'],0,strlen($sql['import']['table']) - 1) . ++$i;
}
$create="CREATE TABLE `" . $sql['import']['table'] . "` (" . ( ( $sql['import']['createindex'] == 1 ) ? '`import_id` int(11) unsigned NOT NULL auto_increment, ' : '' );
if ($sql['import']['namefirstline'])
{
for ($i=0; $i < count($sql['import']['first_zeile']); $i++)
{
$create.='`' . $sql['import']['first_zeile'][$i] . '` VARCHAR(250) NOT NULL, ';
}
}
else
{
for ($i=0; $i < count($sql['import']['first_zeile']); $i++)
{
$create.='`FIELD_' . $i . '` VARCHAR(250) NOT NULL, ';
}
}
if ($sql['import']['createindex'] == 1) $create.='PRIMARY KEY (`import_id`) ';
else $create=substr($create,0,strlen($create) - 2);
$create.=') ' . ( ( MSD_NEW_VERSION ) ? 'ENGINE' : 'TYPE' ) . "=MyISAM COMMENT='imported at " . date("l dS of F Y H:i:s A") . "'";
$res=mysqli_query($config['dbconnection'], $create) || die(SQLError($create,((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))));
return 1;
}
function ExportXML()
{
global $sql,$config;
$tab="\t";
$level=0;
$t='<?xml version="1.0" encoding="UTF-8" ?>' . "\n" . '<database name="' . $sql['export']['db'] . '">' . "\n";
$level++;
$time_start=time();
if (!isset($config['dbconnection'])) MSD_mysql_connect();
for ($table=0; $table < count($sql['export']['tables']); $table++)
{
$t.=str_repeat($tab,$level++) . '<table name="' . $sql['export']['tables'][$table] . '">' . "\n";
$sqlt="SHOW Fields FROM `" . $sql['export']['db'] . "`.`" . $sql['export']['tables'][$table] . "`;";
$res=MSD_query($sqlt);
if ($res)
{
$numfields=mysqli_num_rows($res);
if ($sql['export']['xmlstructure'] == 1)
{
$t.=str_repeat($tab,$level++) . '<structure>' . "\n";
for ($feld=0; $feld < $numfields; $feld++)
{
$row=mysqli_fetch_array($res);
$t.=str_repeat($tab,$level++) . '<field no="' . $feld . '">' . "\n";
$t.=str_repeat($tab,$level) . '<name>' . $row['Field'] . '</name>' . "\n";
$t.=str_repeat($tab,$level) . '<type>' . $row['Type'] . '</type>' . "\n";
$t.=str_repeat($tab,$level) . '<null>' . $row['Null'] . '</null>' . "\n";
$t.=str_repeat($tab,$level) . '<key>' . $row['Key'] . '</key>' . "\n";
$t.=str_repeat($tab,$level) . '<default>' . $row['Default'] . '</default>' . "\n";
$t.=str_repeat($tab,$level) . '<extra>' . $row['Extra'] . '</extra>' . "\n";
$t.=str_repeat($tab,--$level) . '</field>' . "\n";
}
$t.=str_repeat($tab,--$level) . '</structure>' . "\n";
}
}
$t.=str_repeat($tab,$level++) . '<data>' . "\n";
$sqlt="SELECT * FROM `" . $sql['export']['db'] . "`.`" . $sql['export']['tables'][$table] . "`;";
$res=MSD_query($sqlt);
if ($res)
{
$numrows=mysqli_num_rows($res);
for ($data=0; $data < $numrows; $data++)
{
$t.=str_repeat($tab,$level) . "<row>\n";
$level++;
$row=mysqli_fetch_row($res);
for ($feld=0; $feld < $numfields; $feld++)
{
$t.=str_repeat($tab,$level) . '<field no="' . $feld . '">' . $row[$feld] . '</field>' . "\n";
}
$t.=str_repeat($tab,--$level) . "</row>\n";
$sql['export']['lines']++;
if (strlen($t) > $config['memory_limit'])
{
CSVOutput($t);
$t="";
}
$time_now=time();
if ($time_start >= $time_now + 30)
{
$time_start=$time_now;
header('X-MSDPing: Pong');
}
}
}
$t.=str_repeat($tab,--$level) . '</data>' . "\n";
$t.=str_repeat($tab,--$level) . '</table>' . "\n";
}
$t.=str_repeat($tab,--$level) . '</database>' . "\n";
CSVOutput($t,1);
}
function ExportHTML()
{
global $sql,$config,$lang;
$header='<html><head><title>MSD Export</title></head>';
$footer="\n\n</body>\n</html>";
$content="";
$content.='<h1>' . $lang['L_DB'] . ' ' . $sql['export']['db'] . '</h1>';
$time_start=time();
if (!isset($config['dbconnection'])) MSD_mysql_connect();
for ($table=0; $table < count($sql['export']['tables']); $table++)
{
$content.='<h2>Tabelle ' . $sql['export']['tables'][$table] . '</h2>' . "\n";
$fsql="show fields from `" . $sql['export']['tables'][$table] . "`";
$dsql="select * from `" . $sql['export']['tables'][$table] . "`";
//Struktur
$res=MSD_query($fsql);
if ($res)
{
$field=$fieldname=$fieldtyp=Array();
$structure="<table class=\"Table\">\n";
$numfields=mysqli_num_rows($res);
for ($feld=0; $feld < $numfields; $feld++)
{
$row=mysqli_fetch_row($res);
$field[$feld]=$row[0];
if ($feld == 0)
{
$structure.="<tr class=\"Header\">\n";
for ($i=0; $i < count($row); $i++)
{
$str=(((($___mysqli_tmp = mysqli_fetch_field_direct($res, 0)) && is_object($___mysqli_tmp)) ? ( (!is_null($___mysqli_tmp->primary_key = ($___mysqli_tmp->flags & MYSQLI_PRI_KEY_FLAG) ? 1 : 0)) && (!is_null($___mysqli_tmp->multiple_key = ($___mysqli_tmp->flags & MYSQLI_MULTIPLE_KEY_FLAG) ? 1 : 0)) && (!is_null($___mysqli_tmp->unique_key = ($___mysqli_tmp->flags & MYSQLI_UNIQUE_KEY_FLAG) ? 1 : 0)) && (!is_null($___mysqli_tmp->numeric = (int)(($___mysqli_tmp->type <= MYSQLI_TYPE_INT24) || ($___mysqli_tmp->type == MYSQLI_TYPE_YEAR) || ((defined("MYSQLI_TYPE_NEWDECIMAL")) ? ($___mysqli_tmp->type == MYSQLI_TYPE_NEWDECIMAL) : 0)))) && (!is_null($___mysqli_tmp->blob = (int)in_array($___mysqli_tmp->type, array(MYSQLI_TYPE_TINY_BLOB, MYSQLI_TYPE_BLOB, MYSQLI_TYPE_MEDIUM_BLOB, MYSQLI_TYPE_LONG_BLOB)))) && (!is_null($___mysqli_tmp->unsigned = ($___mysqli_tmp->flags & MYSQLI_UNSIGNED_FLAG) ? 1 : 0)) && (!is_null($___mysqli_tmp->zerofill = ($___mysqli_tmp->flags & MYSQLI_ZEROFILL_FLAG) ? 1 : 0)) && (!is_null($___mysqli_type = $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = (($___mysqli_type == MYSQLI_TYPE_STRING) || ($___mysqli_type == MYSQLI_TYPE_VAR_STRING)) ? "type" : "")) &&(!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && in_array($___mysqli_type, array(MYSQLI_TYPE_TINY, MYSQLI_TYPE_SHORT, MYSQLI_TYPE_LONG, MYSQLI_TYPE_LONGLONG, MYSQLI_TYPE_INT24))) ? "int" : $___mysqli_tmp->type)) &&(!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && in_array($___mysqli_type, array(MYSQLI_TYPE_FLOAT, MYSQLI_TYPE_DOUBLE, MYSQLI_TYPE_DECIMAL, ((defined("MYSQLI_TYPE_NEWDECIMAL")) ? constant("MYSQLI_TYPE_NEWDECIMAL") : -1)))) ? "real" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_TIMESTAMP) ? "timestamp" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_YEAR) ? "year" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && (($___mysqli_type == MYSQLI_TYPE_DATE) || ($___mysqli_type == MYSQLI_TYPE_NEWDATE))) ? "date " : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_TIME) ? "time" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_SET) ? "set" : $___mysqli_tmp->type)) &&(!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_ENUM) ? "enum" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_GEOMETRY) ? "geometry" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_DATETIME) ? "datetime" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && (in_array($___mysqli_type, array(MYSQLI_TYPE_TINY_BLOB, MYSQLI_TYPE_BLOB, MYSQLI_TYPE_MEDIUM_BLOB, MYSQLI_TYPE_LONG_BLOB)))) ? "blob" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_NULL) ? "null" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type) ? "unknown" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->not_null = ($___mysqli_tmp->flags & MYSQLI_NOT_NULL_FLAG) ? 1 : 0)) ) : false ) ? $___mysqli_tmp : false);
$fieldname[$i]=$str->name;
$fieldtyp[$i]=$str->type;
$structure.="<th>" . $str->name . "</th>\n";
}
$structure.="</tr>\n<tr>\n";
}
for ($i=0; $i < count($row); $i++)
{
$structure.="<td class=\"Object\">" . ( ( $row[$i] != "" ) ? $row[$i] : "&nbsp;" ) . "</td>\n";
}
$structure.="</tr>\n";
}
$structure.="</table>\n";
}
if ($sql['export']['htmlstructure'] == 1) $content.="<h3>Struktur</h3>\n" . $structure;
//Daten
$res=MSD_query($dsql);
if ($res)
{
$anz=mysqli_num_rows($res);
$content.="<h3>Daten ($anz Datens&auml;tze)</h3>\n";
$content.="<table class=\"Table\">\n";
for ($feld=0; $feld < count($field); $feld++)
{
if ($feld == 0)
{
$content.="<tr class=\"Header\">\n";
for ($i=0; $i < count($field); $i++)
{
$content.="<th>" . $field[$i] . "</th>\n";
}
$content.="</tr>\n";
}
}
for ($d=0; $d < $anz; $d++)
{
$row=mysqli_fetch_row($res);
$content.="<tr>\n";
for ($i=0; $i < count($row); $i++)
{
$content.='<td class="Object">' . ( ( $row[$i] != "" ) ? $row[$i] : "&nbsp;" ) . "</td>\n";
}
$content.="</tr>\n";
}
}
$content.="</table>";
}
CSVOutput($header . $content . $footer);
}

Datei anzeigen

@ -1,405 +0,0 @@
<?php
define('DEBUG',0);
if (!defined('MSD_VERSION')) die('No direct access.');
function get_sqlbefehl()
{
global $restore,$config,$databases,$lang;
//Init
$restore['fileEOF']=false;
$restore['EOB']=false;
$complete_sql='';
$sqlparser_status=0;
if (!isset($restore['eintraege_ready'])) $restore['eintraege_ready']=0;
//Parsen
WHILE ($sqlparser_status!=100&&!$restore['fileEOF']&&!$restore['EOB'])
{
//nächste Zeile lesen
$zeile=($restore['compressed']) ? gzgets($restore['filehandle']):fgets($restore['filehandle']);
if (DEBUG) echo "<br><br>Zeile: ".htmlspecialchars($zeile);
/******************* Setzen des Parserstatus *******************/
// herausfinden um was für einen Befehl es sich handelt
if ($sqlparser_status==0)
{
//Vergleichszeile, um nicht bei jedem Vergleich strtoupper ausführen zu müssen
$zeile2=strtoupper(trim($zeile));
// pre-built compare strings - so we need the CPU power only once :)
$sub9=substr($zeile2,0,9);
$sub7=substr($sub9,0,7);
$sub6=substr($sub7,0,6);
$sub4=substr($sub6,0,4);
$sub3=substr($sub4,0,3);
$sub2=substr($sub3,0,2);
$sub1=substr($sub2,0,1);
if ($sub7=='INSERT ')
{
$sqlparser_status=3; //Datensatzaktion
$restore['actual_table']=get_tablename($zeile);
}
//Einfache Anweisung finden die mit Semikolon beendet werden
elseif ($sub7=='LOCK TA') $sqlparser_status=4;
elseif ($sub6=='COMMIT') $sqlparser_status=7;
elseif (substr($sub6,0,5)=='BEGIN') $sqlparser_status=7;
elseif ($sub9=='UNLOCK TA') $sqlparser_status=4;
elseif ($sub3=='SET') $sqlparser_status=4;
elseif ($sub6=='START ') $sqlparser_status=4;
elseif ($sub3=='/*!') $sqlparser_status=5; //MySQL-Condition oder Kommentar
elseif ($sub9=='ALTER TAB') $sqlparser_status=4; // Alter Table
elseif ($sub9=='CREATE TA') $sqlparser_status=2; //Create Table
elseif ($sub9=='CREATE AL') $sqlparser_status=2; //Create View
elseif ($sub9=='CREATE IN') $sqlparser_status=4; //Indexaktion
//Condition?
elseif (($sqlparser_status!=5)&&(substr($zeile2,0,2)=='/*')) $sqlparser_status=6;
// Delete actions
elseif ($sub9=='DROP TABL') $sqlparser_status=1;
elseif ($sub9=='DROP VIEW') $sqlparser_status=1;
// Befehle, die nicht ausgeführt werden sollen
elseif ($sub9=='CREATE DA') $sqlparser_status=7;
elseif ($sub9=='DROP DATA ') $sqlparser_status=7;
elseif ($sub3=='USE') $sqlparser_status=7;
// Am Ende eines MySQLDumper-Backups angelangt?
elseif ($sub6=='-- EOB'||$sub4=='# EO')
{
$restore['EOB']=true;
$restore['fileEOF']=true;
$zeile='';
$zeile2='';
$sqlparser_status=100;
}
// Kommentar?
elseif ($sub2=='--'|| $sub1=='#')
{
$zeile='';
$zeile2='';
$sqlparser_status=0;
}
// Fortsetzung von erweiterten Inserts
if ($restore['flag']==1) $sqlparser_status=3;
if (($sqlparser_status==0)&&(trim($complete_sql)>'')&&($restore['flag']==-1))
{
// Unbekannten Befehl entdeckt
v($restore);
echo "<br>Sql: ".htmlspecialchars($complete_sql);
echo "<br>Erweiterte Inserts: ".$restore['erweiterte_inserts'];
die('<br>'.$lang['L_UNKNOWN_SQLCOMMAND'].': '.$zeile.'<br><br>'.$complete_sql);
}
/******************* Ende von Setzen des Parserstatus *******************/
}
$last_char=substr(rtrim($zeile),-1);
// Zeilenumbrüche erhalten - sonst werden Schlüsselwörter zusammengefügt
// z.B. 'null' und in der nächsten Zeile 'check' wird zu 'nullcheck'
$complete_sql.=$zeile."\n";
if ($sqlparser_status==3)
{
//INSERT
if (SQL_Is_Complete($complete_sql))
{
$sqlparser_status=100;
$complete_sql=trim($complete_sql);
if (substr($complete_sql,-2)=='*/')
{
$complete_sql=remove_comment_at_eol($complete_sql);
}
// letzter Ausdruck des erweiterten Inserts erreicht?
if (substr($complete_sql,-2)==');')
{
$restore['flag']=-1;
}
// Wenn am Ende der Zeile ein Klammer Komma -> erweiterter Insert-Modus -> Steuerflag setzen
else
if (substr($complete_sql,-2)=='),')
{
// letztes Komme gegen Semikolon tauschen
$complete_sql=substr($complete_sql,0,-1).';';
$restore['erweiterte_inserts']=1;
$restore['flag']=1;
}
if (substr(strtoupper($complete_sql),0,7)!='INSERT ')
{
// wenn der Syntax aufgrund eines Reloads verloren ging - neu ermitteln
if (!isset($restore['insert_syntax'])) $restore['insert_syntax']=get_insert_syntax($restore['actual_table']);
$complete_sql=$restore['insert_syntax'].' VALUES '.$complete_sql.';';
}
else
{
// INSERT Syntax ermitteln und merken
$ipos=strpos(strtoupper($complete_sql),' VALUES');
if (!$ipos===false) $restore['insert_syntax']=substr($complete_sql,0,$ipos);
else
$restore['insert_syntax']='INSERT INTO `'.$restore['actual_table'].'`';
}
}
}
else
if ($sqlparser_status==1)
{
//Löschaktion
if ($last_char==';') $sqlparser_status=100; //Befehl komplett
$restore['actual_table']=get_tablename($complete_sql);
}
else
if ($sqlparser_status==2)
{
// Createanweisung ist beim Finden eines ; beendet
if ($last_char==';')
{
if ($config['minspeed']>0) $restore['anzahl_zeilen']=$config['minspeed'];
// Soll die Tabelle hergestellt werden?
$do_it=true;
if (is_array($restore['tables_to_restore']))
{
$do_it=false;
if (in_array($restore['actual_table'],$restore['tables_to_restore']))
{
$do_it=true;
}
}
if ($do_it)
{
$tablename=submit_create_action($complete_sql);
$restore['actual_table']=$tablename;
$restore['table_ready']++;
}
// Zeile verwerfen, da CREATE jetzt bereits ausgefuehrt wurde und naechsten Befehl suchen
$complete_sql='';
$sqlparser_status=0;
}
}
// Index
else
if ($sqlparser_status==4)
{ //Createindex
if ($last_char==';')
{
if ($config['minspeed']>0)
{
$restore['anzahl_zeilen']=$config['minspeed'];
}
$complete_sql=del_inline_comments($complete_sql);
$sqlparser_status=100;
}
}
// Kommentar oder Condition
else
if ($sqlparser_status==5)
{ //Anweisung
$t=strrpos($zeile,'*/;');
if (!$t===false)
{
$restore['anzahl_zeilen']=$config['minspeed'];
$sqlparser_status=100;
if ($config['ignore_enable_keys'] &&
strrpos($zeile, 'ENABLE KEYS ') !== false)
{
$sqlparser_status=100;
$complete_sql = '';
}
}
}
// Mehrzeiliger oder Inline-Kommentar
else
if ($sqlparser_status==6)
{
$t=strrpos($zeile,'*/');
if (!$t===false)
{
$complete_sql='';
$sqlparser_status=0;
}
}
// Befehle, die verworfen werden sollen
else
if ($sqlparser_status==7)
{ //Anweisung
if ($last_char==';')
{
if ($config['minspeed']>0)
{
$restore['anzahl_zeilen']=$config['minspeed'];
}
$complete_sql='';
$sqlparser_status=0;
}
}
if (($restore['compressed'])&&(gzeof($restore['filehandle']))) $restore['fileEOF']=true;
if ((!$restore['compressed'])&&(feof($restore['filehandle']))) $restore['fileEOF']=true;
}
// wenn bestimmte Tabellen wiederhergestellt werden sollen -> pruefen
if (is_array($restore['tables_to_restore'])&&!(in_array($restore['actual_table'],$restore['tables_to_restore'])))
{
$complete_sql='';
}
return trim($complete_sql);
}
function submit_create_action($sql)
{
//executes a create command
$tablename=get_tablename($sql);
if (strtoupper(substr($sql,0,16))=='CREATE ALGORITHM')
{
// It`s a VIEW. We need to substitute the original DEFINER with the actual MySQL-User
$parts=explode(' ',$sql);
for ($i=0,$count=sizeof($parts);$i<$count;$i++)
{
if (strtoupper(substr($parts[$i],0,8))=='DEFINER=')
{
global $config;
$parts[$i]='DEFINER=`'.$config['dbuser'].'`@`'.$config['dbhost'].'`';
$sql=implode(' ',$parts);
$i=$count;
}
}
}
$res=@mysqli_query($GLOBALS["___mysqli_ston"], $sql);
if ($res===false)
{
// erster Versuch fehlgeschlagen -> zweiter Versuch - vielleicht versteht der Server die Inline-Kommentare nicht?
$sql=del_inline_comments($sql);
$res=@mysqli_query($GLOBALS["___mysqli_ston"], downgrade($sql));
if ($res===false)
{
// wieder nichts. Ok, haben wir hier einen alten MySQL-Server 3.x oder 4.0.x?
// versuchen wir es mal mit der alten Syntax
$res=@mysqli_query($GLOBALS["___mysqli_ston"], downgrade($sql));
}
}
if ($res===false)
{
// wenn wir hier angekommen sind hat nichts geklappt -> Fehler ausgeben und abbrechen
SQLError($sql,((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
die("<br>Fatal error: Couldn't create table or view `".$tablename."´");
}
return $tablename;
}
function get_insert_syntax($table)
{
$insert='';
$sql='SHOW COLUMNS FROM `'.$table.'`';
$res=mysqli_query($GLOBALS["___mysqli_ston"], $sql);
if ($res)
{
$insert='INSERT INTO `'.$table.'` (';
while ($row=mysqli_fetch_object($res))
{
$insert.='`'.$row->Field.'`,';
}
$insert=substr($insert,0,strlen($insert)-1).') ';
}
else
{
global $restore;
v($restore);
SQLError($sql,((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
}
return $insert;
}
function del_inline_comments($sql)
{
//$sql=str_replace("\n",'<br>',$sql);
$array=array();
preg_match_all("/(\/\*(.+)\*\/)/U",$sql,$array);
if (is_array($array[0]))
{
$sql=str_replace($array[0],'',$sql);
if (DEBUG) echo "Nachher: :<br>".$sql."<br><hr>";
}
//$sql=trim(str_replace('<br>',"\n",$sql));
//Wenn nach dem Entfernen nur noch ein ; übrigbleibt -> entfernen
if ($sql==';') $sql='';
return $sql;
}
// extrahiert auf einfache Art den Tabellennamen aus dem "Create",Drop"-Befehl
function get_tablename($t)
{
// alle Schluesselbegriffe entfernen, bis der Tabellenname am Anfang steht
$t=substr($t,0,150); // verkuerzen, um Speicher zu sparen - wir brauchenhier nur den Tabellennamen
$t=str_ireplace('DROP TABLE','',$t);
$t=str_ireplace('DROP VIEW','',$t);
$t=str_ireplace('CREATE TABLE','',$t);
$t=str_ireplace('INSERT INTO','',$t);
$t=str_ireplace('REPLACE INTO','',$t);
$t=str_ireplace('IF NOT EXISTS','',$t);
$t=str_ireplace('IF EXISTS','',$t);
if (substr(strtoupper($t),0,16)=='CREATE ALGORITHM')
{
$pos=strpos($t,'DEFINER VIEW ');
$t=substr($t,$pos,strlen($t)-$pos);
}
$t=str_ireplace(';',' ;',$t); // tricky -> insert space as delimiter
$t=trim($t);
// jetzt einfach nach dem ersten Leerzeichen suchen
$delimiter=substr($t,0,1);
if ($delimiter!='`') $delimiter=' ';
$found=false;
$position=1;
WHILE (!$found)
{
if (substr($t,$position,1)==$delimiter) $found=true;
if ($position>=strlen($t)) $found=true;
$position++;
}
$t=substr($t,0,$position);
$t=trim(str_replace('`','',$t));
return $t;
}
// decide if an INSERT-Command is complete - simply count quotes and look for ); at the end of line
function SQL_Is_Complete($string)
{
$string=str_replace('\\\\','',trim($string)); // trim and remove escaped backslashes
$string=trim($string);
$quotes=substr_count($string,'\'');
$escaped_quotes=substr_count($string,'\\\'');
if (($quotes-$escaped_quotes)%2==0)
{
$compare=substr($string,-2);
if ($compare=='*/') $compare=substr(trim(remove_comment_at_eol($string)),-2);
if ($compare==');') return true;
if ($compare=='),') return true;
}
return false;
}
function remove_comment_at_eol($string)
{
// check for Inline-Comments at the end of the line
if (substr(trim($string),-2)=='*/')
{
$pos=strrpos($string,'/*');
if ($pos>0)
{
$string=trim(substr($string,0,$pos));
}
}
return $string;
}

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -1,32 +0,0 @@
<?php
session_name('MySQLDumper');
session_start();
include(dirname(__FILE__) . '/functions.php');
$msd_path = basePath();
if (!defined('MSD_PATH')) {
define('MSD_PATH', $msd_path);
}
if (!isset($download)) {
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
}
include(MSD_PATH . 'inc/mysql.php');
if (!defined('MSD_VERSION')) {
die('No direct access.');
}
if (!file_exists($config['files']['parameter'])) {
$error = TestWorkDir();
}
read_config($config['config_file']);
include(MSD_PATH . 'language/lang_list.php');
if (!isset($databases['db_selected_index'])) {
$databases['db_selected_index'] = 0;
}
SelectDB($databases['db_selected_index']);
$config['files']['iconpath'] = './css/' . $config['theme'] . '/icons/';
if (isset($error)) {
echo $error;
}

Datei anzeigen

@ -1,213 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('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($GLOBALS["___mysqli_ston"], 'DROP DATABASE `'.$databases['Name'][$i].'`') or die(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
$dba='<p class="green">'.$lang['L_DB'].' '.$databases['Name'][$i].' '.$lang['L_INFO_DELETED'].'</p>';
SetDefault();
include ($config['files']['parameter']);
echo '<script language="JavaScript">parent.MySQL_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($GLOBALS["___mysqli_ston"], $query) or die(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))."");
}
$_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 MSDTemplate();
$tpl->set_filenames(array(
'show' => './tpl/home/databases_list_dbs.tpl'));
$tpl->assign_vars(array(
'ICONPATH' => $config['files']['iconpath']));
if (!isset($config['dbconnection'])) MSD_mysql_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',array(
'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',array(
'ROWCLASS' => $rowclass,
'NR' => ($i+1),
'DB_NAME' => $databases['Name'][$i],
'DB_ID' => $i,
'TABLE_COUNT' => $num_tables));
if ($num_tables==1) $tpl->assign_block_vars('ROW.TABLE',array());
else
$tpl->assign_block_vars('ROW.TABLES',array());
}
}
$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 MSDTemplate();
$tpl->set_filenames(array(
'show' => 'tpl/home/databases_list_tables.tpl'));
$dbid=$_GET['dbid'];
$numrows=0;
$res=@mysqli_query($GLOBALS["___mysqli_ston"], "SHOW TABLE STATUS FROM `".$databases['Name'][$dbid]."`");
mysqli_select_db($GLOBALS["___mysqli_ston"], $databases['Name'][$dbid]);
if ($res) $numrows=mysqli_num_rows($res);
$tpl->assign_vars(array(
'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',array());
elseif ($numrows==1) $tpl->assign_block_vars('1_TABLE',array());
elseif ($numrows==0) $tpl->assign_block_vars('NO_TABLE',array());
if ($numrows>0)
{
$last_update="2000-01-01 00:00:00";
$sum_records=$sum_data_length='';
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($GLOBALS["___mysqli_ston"], $sql_2);
if ($res2===false)
{
$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 ($row['Engine'] == "MyIsam") {
}
$tpl->assign_block_vars('ROW',array(
'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 ($row['Engine']=='MyISAM')
{
if ($row['Data_free']==0) $tpl->assign_block_vars('ROW.OPTIMIZED',array());
else
$tpl->assign_block_vars('ROW.NOT_OPTIMIZED',array());
if ($checkit==$row['Name']||$repair==1)
{
$tmp_res=mysqli_query($GLOBALS["___mysqli_ston"], "REPAIR TABLE `".$row['Name']."`");
}
if (($checkit==$row['Name']||$checkit=='ALL'))
{
// table needs to be checked
$tmp_res=mysqli_query($GLOBALS["___mysqli_ston"], 'CHECK TABLE `'.$row['Name'].'`');
if ($tmp_res)
{
$tmp_row=mysqli_fetch_row($tmp_res);
if ($tmp_row[3]=='OK') $tpl->assign_block_vars('ROW.CHECK_TABLE_OK',array());
else
$tpl->assign_block_vars('ROW.CHECK_TABLE_NOT_OK',array());
}
}
else
{
// Show Check table link
$tpl->assign_block_vars('ROW.CHECK_TABLE',array());
}
if ($enableKeys==$row['Name'] || $enableKeys=="ALL")
{
$sSql= "ALTER TABLE `".$databases['Name'][$dbid]."`.`".$row['Name']."` ENABLE KEYS";
$tmp_res=mysqli_query($GLOBALS["___mysqli_ston"], $sSql);
}
$res3=mysqli_query($GLOBALS["___mysqli_ston"], 'SHOW INDEX FROM `'.$databases['Name'][$dbid]."`.`".$row['Name']."`");
WHILE ($row3 = mysqli_fetch_array($res3, MYSQLI_ASSOC))
{
if ($row3['Comment']=="disabled") {
$keys_disabled = true;
$disabled_keys_found = true;
}
}
if ($keys_disabled) $tpl->assign_block_vars('ROW.KEYS_DISABLED', array());
else $tpl->assign_block_vars('ROW.KEYS_ENABLED', array());
}
}
// Output sum-row
$tpl->assign_block_vars('SUM',array(
'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', array());
}
$tpl->pparse('show');
}

Datei anzeigen

@ -1,63 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
$Sum_Files=$Sum_Size=0;
$Last_BU=Array();
$is_htaccess=(file_exists('./.htaccess'));
// find latest backup file
$dh=opendir($config['paths']['backup']);
while (false!==($filename=readdir($dh)))
{
if ($filename!='.'&&$filename!='..'&&!is_dir($config['paths']['backup'].$filename))
{
$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;
}
}
}
$directory_warnings=DirectoryWarnings();
$tpl=new MSDTemplate();
$tpl->set_filenames(array(
'show' => 'tpl/home/home.tpl'));
$tpl->assign_vars(array(
'THEME' => $config['theme'],
'MSD_VERSION' => MSD_VERSION,
'OS' => MSD_OS,
'OS_EXT' => MSD_OS_EXT,
'MYSQL_VERSION' => MSD_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'],
'MSD_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 ($directory_warnings>'') $tpl->assign_block_vars('DIRECTORY_WARNINGS',array(
'MSG' => $directory_warnings));
if ($config['disabled']>'') $tpl->assign_block_vars('DISABLED_FUNCTIONS',array(
'PHP_DISABLED_FUNCTIONS' => str_replace(',',', ',$config['disabled'])));
// Zlib is buggy from version 4.3.0 upto 4.3.2, so lets check for these versions
if (version_compare(PHP_VERSION,'4.3.0','>=')&&version_compare(PHP_VERSION,'4.3.2','<=')) $tpl->assign_block_vars('ZLIBBUG',array());
if (!extension_loaded('ftp')) $tpl->assign_block_vars('NO_FTP',array());
if (!$config['zlib']) $tpl->assign_block_vars('NO_ZLIB',array());
if ($is_htaccess) $tpl->assign_block_vars('HTACCESS_EXISTS',array());
else
$tpl->assign_block_vars('HTACCESS_DOESNT_EXISTS',array());
if ($Sum_Files>0&&isset($Last_BU[1])) $tpl->assign_block_vars('LAST_BACKUP',array(
'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');

Datei anzeigen

@ -1,112 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
$var=(isset($_GET['var'])) ? $_GET['var'] : "prozesse";
$Titelausgabe=array(
"variables" => $lang['L_VARIABELN'], "status" => $lang['L_STATUS'], "prozesse" => $lang['L_PROZESSE']);
echo '<h5>'.$lang['L_MYSQLVARS'].'</h5><strong>'.$Titelausgabe[$var].'</strong>&nbsp;&nbsp;&nbsp;&nbsp;';
echo '<a href="main.php?action=vars&amp;var=prozesse">'.$lang['L_PROZESSE'].'</a>&nbsp;&nbsp;&nbsp;';
echo '<a href="main.php?action=vars&amp;var=status">'.$lang['L_STATUS'].'</a>&nbsp;&nbsp;&nbsp;';
echo '<a href="main.php?action=vars&amp;var=variables">'.$lang['L_VARIABELN'].'</a>&nbsp;&nbsp;&nbsp;';
echo '<p>&nbsp;</p>';
//Variabeln
switch ($var)
{
case "variables":
$res=@mysqli_query($GLOBALS["___mysqli_ston"], "SHOW variables");
if ($res) $numrows=mysqli_num_rows($res);
if ($numrows==0)
{
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($GLOBALS["___mysqli_ston"], "SHOW STATUS");
if ($res) $numrows=mysqli_num_rows($res);
if ($numrows==0)
{
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 ($wait==0)
{
$ret=mysqli_query($GLOBALS["___mysqli_ston"], "KILL ".$_GET['killid']);
$wait=2;
}
else
$wait+=2;
if ($wait==0)
{
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($GLOBALS["___mysqli_ston"], "SHOW FULL PROCESSLIST ");
if ($res) $numrows=mysqli_num_rows($res);
if ($numrows==0)
{
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&amp;var=prozesse&amp;killid='.$row[0].'">kill</a></td></tr>';
if ($row[0]==$killid&&$row[4]=="Killed")
{
$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 language="JavaScript" type="text/javascript">window.setTimeout("document.f.submit();","'.$config['processlist_refresh'].'");</script>';
break;
}

Datei anzeigen

@ -1,140 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
include ('./language/'.$config['language'].'/lang_sql.php');
$dba=$hta_dir=$Overwrite=$msg='';
$error=array();
$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=0; // default encryption type set to crypt()
if (strtoupper(substr(MSD_OS,0,3))=='WIN') $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 MSDTemplate();
$tpl->set_filenames(array(
'show' => './tpl/home/protection_create.tpl'));
$tpl->assign_vars(array(
'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 (sizeof($error)==0)
{
$htaccess = "<IfModule mod_rewrite.c>\nRewriteEngine off\n</IfModule>\n";
$realm='MySQLDumper';
$htaccess.="AuthName \"".$realm."\"\nAuthType Basic\nAuthUserFile \""
.$config['paths']['root'].".htpasswd\"\nrequire valid-user";
switch ($type)
{
// Crypt
case 0:
$userpass=crypt($userpass1);
break;
// MD5
case 1:
$userpass=md5($username.':'.$realm.':'.$userpass1);
break;
// WIn - no encryption
case 2:
$userpass=$userpass1;
break;
// SHA
case 3:
$userpass='{SHA}'.base64_encode(sha1($userpass1,TRUE));
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)
{
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
$output = array(
'HTACCESS' => nl2br(htmlspecialchars($htaccess), false),
'HTPASSWD' => nl2br(htmlspecialchars($htpasswd), false)
);
} else {
$output = array(
'HTACCESS' => nl2br(htmlspecialchars($htaccess)),
'HTPASSWD' => nl2br(htmlspecialchars($htpasswd))
);
}
$msg='<span class="success">'.$lang['L_HTACC_CREATED'].'</span>';
$tpl->assign_block_vars('CREATE_SUCCESS', $output);
@chmod($config['paths']['root'],0755);
}
else
{
$tpl->assign_block_vars('CREATE_ERROR',array(
'HTACCESS' => htmlspecialchars($htaccess),
'HTPASSWD' => htmlspecialchars($htpasswd)));
}
}
}
if (sizeof($error)>0||!isset($_POST['username']))
{
$tpl->assign_vars(array(
'PASSWORDS_UNEQUAL' => my_addslashes($lang['L_PASSWORDS_UNEQUAL']),
'HTACC_CONFIRM_DELETE' => my_addslashes($lang['L_HTACC_CONFIRM_DELETE'])));
$tpl->assign_block_vars('INPUT',array(
'USERNAME' => htmlspecialchars($username),
'USERPASS1' => htmlspecialchars($userpass1),
'USERPASS2' => htmlspecialchars($userpass2),
'TYPE0_CHECKED' => $type==0 ? ' checked="checked"' : '',
'TYPE1_CHECKED' => $type==1 ? ' checked="checked"' : '',
'TYPE2_CHECKED' => $type==2 ? ' checked="checked"' : '',
'TYPE3_CHECKED' => $type==3 ? ' checked="checked"' : ''));
}
if (sizeof($error)>0) $msg='<span class="error">'.implode('<br>',$error).'</span>';
if ($msg>'') $tpl->assign_block_vars('MSG',array(
'TEXT' => $msg));
$tpl->pparse('show');
echo MSDFooter();
ob_end_flush();
die();

Binäre Datei nicht angezeigt.

Datei anzeigen

@ -1,83 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
include ('./language/'.$config['language'].'/lang_sql.php');
echo MSDHeader();
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'])&&$_GET['create']==1)||(isset($_POST['create'])&&$_POST['create']==1))
{
$fp=fopen($hta_complete,'w');
fwrite($fp,"# created by MySQLDumper ".MSD_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 ($htaccessdontexist!=1)
{
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">&nbsp;&nbsp;&nbsp;';
echo '<input type="reset" name="reset" value=" '.$lang['L_RESET'].' " class="Formbutton">&nbsp;&nbsp;&nbsp;';
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();

Datei anzeigen

@ -1,104 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('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="&gt; operating FLUSH PRIVILEGES<br>";
$res=@mysqli_query($config['dbconnection'], "FLUSH PRIVILEGES");
$meldung=((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
if ($meldung!="")
{
$msg.='&gt; MySQL-Error: '.$meldung;
}
else
{
$msg.="&gt; Privileges were reloaded.";
}
break;
case 2: //FLUSH STATUS
$msg="&gt; operating FLUSH STATUS<br>";
$res=@mysqli_query($config['dbconnection'], "FLUSH STATUS");
$meldung=((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
if ($meldung!="")
{
$msg.='&gt; MySQL-Error: '.$meldung;
}
else
{
$msg.="&gt; Status was reset.";
}
break;
case 3: //FLUSH HOSTS
$msg="&gt; operating FLUSH HOSTS<br>";
$res=@mysqli_query($config['dbconnection'], "FLUSH HOSTS");
$meldung=((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
if ($meldung!="")
{
$msg.='&gt; MySQL-Error: '.$meldung;
}
else
{
$msg.="&gt; Hosts were reloaded.";
;
}
break;
case 4: //SHOW MASTER LOGS
$msg="> operating SHOW MASTER LOGS<br>";
$res=@mysqli_query($config['dbconnection'], "SHOW MASTER LOGS");
$meldung=((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
if ($meldung!="")
{
$msg.='&gt; MySQL-Error: '.$meldung;
}
else
{
$numrows=mysqli_num_rows($res);
if ($numrows==0||$numrows===false)
{
$msg.='&gt; there are no master log-files';
}
else
{
$msg.='&gt; there are '.$numrows.' logfiles<br>';
for ($i=0; $i<$numrows; $i++)
{
$row=mysqli_fetch_row($res);
$msg.='&gt; '.$row[0].'&nbsp;&nbsp;&nbsp;'.(($data_dir) ? byte_output(@filesize($data_dir.$row[0])) : '').'<br>';
}
}
}
break;
case 5: //RESET MASTER
$msg="&gt; operating RESET MASTER<br>";
$res=@mysqli_query($config['dbconnection'], "RESET MASTER");
$meldung=((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
if ($meldung!="")
{
$msg.='&gt; MySQL-Error: '.$meldung;
}
else
{
$msg.="&gt; All Masterlogs were deleted.";
}
break;
}
echo '<h5>'.$lang['L_MYSQLSYS'].'</h5>';
echo '<div id="hormenu"><ul>
<li><a href="main.php?action=sys&amp;dosys=1">Reload Privileges</a></li>
<li><a href="main.php?action=sys&amp;dosys=2">Reset Status</a></li>
<li><a href="main.php?action=sys&amp;dosys=3">Reload Hosts</a></li>
<li><a href="main.php?action=sys&amp;dosys=4">Show Log-Files</a></li>
<li><a href="main.php?action=sys&amp;dosys=5">Reset Master-Log</a></li>
</ul></div>';
echo '<div align="center" class="MySQLbox">';
echo '&gt; MySQL Dumper v'.MSD_VERSION.' - Output Console<br><br>';
echo ($msg!="") ? $msg : '> waiting for operation ...<br>';
echo '</div>';

Datei anzeigen

@ -1,488 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
//Feldspezifikationen
$feldtypen=Array(
"VARCHAR",
"TINYINT",
"TEXT",
"DATE",
"SMALLINT",
"MEDIUMINT",
"INT",
"BIGINT",
"FLOAT",
"DOUBLE",
"DECIMAL",
"DATETIME",
"TIMESTAMP",
"TIME",
"YEAR",
"CHAR",
"TINYBLOB",
"TINYTEXT",
"BLOB",
"MEDIUMBLOB",
"MEDIUMTEXT",
"LONGBLOB",
"LONGTEXT",
"ENUM",
"SET"
);
$feldattribute=ARRAY(
"",
"BINARY",
"UNSIGNED",
"UNSIGNED ZEROFILL"
);
$feldnulls=Array(
"NOT NULL",
"NULL"
);
$feldextras=Array(
"",
"AUTO_INCREMENT"
);
$feldkeys=Array(
"",
"PRIMARY KEY",
"UNIQUE KEY",
"FULLTEXT"
);
$feldrowformat=Array(
"",
"FIXED",
"DYNAMIC",
"COMPRESSED"
);
$rechte_daten=Array(
"SELECT",
"INSERT",
"UPDATE",
"DELETE",
"FILE"
);
$rechte_struktur=Array(
"CREATE",
"ALTER",
"INDEX",
"DROP",
"CREATE TEMPORARY TABLES"
);
$rechte_admin=Array(
"GRANT",
"SUPER",
"PROCESS",
"RELOAD",
"SHUTDOWN",
"SHOW DATABASES",
"LOCK TABLES",
"REFERENCES",
"EXECUTE",
"REPLICATION CLIENT",
"REPLICATION SLAVE"
);
$rechte_resourcen=Array(
"MAX QUERIES PER HOUR",
"MAX UPDATES PER HOUR",
"MAX CONNECTIONS PER HOUR"
);
$sql_keywords=array(
'ALTER',
'AND',
'ADD',
'AUTO_INCREMENT',
'BETWEEN',
'BINARY',
'BOTH',
'BY',
'BOOLEAN',
'CHANGE',
'CHARSET',
'CHECK',
'COLLATE',
'COLUMNS',
'COLUMN',
'CROSS',
'CREATE',
'DATABASES',
'DATABASE',
'DATA',
'DELAYED',
'DESCRIBE',
'DESC',
'DISTINCT',
'DELETE',
'DROP',
'DEFAULT',
'ENCLOSED',
'ENGINE',
'ESCAPED',
'EXISTS',
'EXPLAIN',
'FIELDS',
'FIELD',
'FLUSH',
'FOR',
'FOREIGN',
'FUNCTION',
'FROM',
'GROUP',
'GRANT',
'HAVING',
'IGNORE',
'INDEX',
'INFILE',
'INSERT',
'INNER',
'INTO',
'IDENTIFIED',
'JOIN',
'KEYS',
'KILL',
'KEY',
'LEADING',
'LIKE',
'LIMIT',
'LINES',
'LOAD',
'LOCAL',
'LOCK',
'LOW_PRIORITY',
'LEFT',
'LANGUAGE',
'MEDIUMINT',
'MODIFY',
'MyISAM',
'NATURAL',
'NOT',
'NULL',
'NEXTVAL',
'OPTIMIZE',
'OPTION',
'OPTIONALLY',
'ORDER',
'OUTFILE',
'OR',
'OUTER',
'ON',
'PROCEEDURE',
'PROCEDURAL',
'PRIMARY',
'READ',
'REFERENCES',
'REGEXP',
'RENAME',
'REPLACE',
'RETURN',
'REVOKE',
'RLIKE',
'RIGHT',
'SHOW',
'SONAME',
'STATUS',
'STRAIGHT_JOIN',
'SELECT',
'SETVAL',
'TABLES',
'TEMINATED',
'TO',
'TRAILING',
'TRUNCATE',
'TABLE',
'TEMPORARY',
'TRIGGER',
'TRUSTED',
'UNIQUE',
'UNLOCK',
'USE',
'USING',
'UPDATE',
'UNSIGNED',
'VALUES',
'VARIABLES',
'VIEW',
'WITH',
'WRITE',
'WHERE',
'ZEROFILL',
'XOR',
'ALL',
'ASC',
'AS',
'SET',
'IN',
'IS',
'IF'
);
$mysql_doc=Array(
"Feldtypen" => "http://dev.mysql.com/doc/mysql/de/Column_types.html"
);
$mysql_string_types = array(
'char',
'varchar',
'tinytext',
'text',
'mediumtext',
'longtext',
'binary',
'varbinary',
'tinyblob',
'mediumblob',
'blob',
'longblob',
'enum',
'set'
);
$mysql_SQLhasRecords=array(
'SELECT',
'SHOW',
'EXPLAIN',
'DESCRIBE',
'DESC'
);
function MSD_mysql_connect($encoding='utf8', $keycheck_off=false, $actual_table='')
{
global $config,$databases;
if (isset($config['dbconnection']) && is_resource($config['dbconnection'])) {
return $config['dbconnection'];
}
$port=( isset($config['dbport']) && !empty($config['dbport']) ) ? $config['dbport'] : ini_get("mysqli.default_port");
$socket=( isset($config['dbsocket']) && !empty($config['dbsocket']) ) ? $config['dbsocket'] : ini_get("mysqli.default_socket");
$config['dbconnection']=@($GLOBALS["___mysqli_ston"] = mysqli_connect($config['dbhost'], $config['dbuser'], $config['dbpass'], "", $port, $socket)) or die(SQLError("Error establishing a database connection!", ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))));
if (!defined('MSD_MYSQL_VERSION')) GetMySQLVersion();
if (!isset($config['mysql_standard_character_set']) || $config['mysql_standard_character_set'] == '') get_sql_encodings();
if ($config['mysql_standard_character_set'] != $encoding)
{
$set_encoding=@mysqli_query($config['dbconnection'], 'SET NAMES \'' . $encoding . '\'');
if ($set_encoding === false) $config['mysql_can_change_encoding']=false;
else $config['mysql_can_change_encoding']=true;
}
if ($keycheck_off) {
// only called with this param when restoring
mysqli_query($config['dbconnection'], 'SET FOREIGN_KEY_CHECKS=0');
// also set SQL-Mode NO_AUTO_VALUE_ON_ZERO for magento users
mysqli_query( $config['dbconnection'], 'SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"');
}
return $config['dbconnection'];
}
function GetMySQLVersion()
{
$res=MSD_query("select version()");
$row=mysqli_fetch_array($res);
$version=$row[0];
if (!defined('MSD_MYSQL_VERSION')) define('MSD_MYSQL_VERSION',$version);
$versions=explode('.',$version);
$new=false;
if ($versions[0] == 4 && $versions[1] >= 1) $new=true;
if ($versions[0] > 4) $new=true;
if (!defined('MSD_NEW_VERSION')) define('MSD_NEW_VERSION',$new);
return $version;
}
function MSD_query($query, $error_output=true)
{
global $config;
if (!isset($config['dbconnection'])) MSD_mysql_connect();
//echo "<br>Query: ".htmlspecialchars($query);
$res=mysqli_query($config['dbconnection'], $query);
if (false === $res && $error_output) SQLError($query,((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
return $res;
}
function SQLError($sql, $error, $return_output=false)
{
global $lang;
$ret='<div align="center"><table style="border:1px solid #ff0000" cellspacing="0">
<tr bgcolor="#ff0000"><td style="color:white;font-size:16px;"><strong>MySQL-ERROR</strong></td></tr>
<tr><td style="width:80%;overflow: auto;">' . $lang['L_SQL_ERROR2'] . '<br><span style="color:red;">' . $error . '</span></td></tr>
<tr><td width="600"><br>' . $lang['L_SQL_ERROR1'] . '<br>' . Highlight_SQL($sql) . '</td></tr>
</table></div><br />';
if ($return_output) return $ret;
else echo $ret;
}
function Highlight_SQL($sql)
{
global $sql_keywords;
$end='';
$tickstart=false;
if (function_exists("token_get_all")) $a=@token_get_all("<?php $sql?>");
else return $sql;
foreach ($a as $token)
{
if (!is_array($token))
{
if ($token == '`') $tickstart=!$tickstart;
$end.=$token;
}
else
{
if ($tickstart) $end.=$token[1];
else
{
switch (token_name($token[0]))
{
case "T_STRING":
case "T_AS":
case "T_FOR":
$end.=( in_array(strtoupper($token[1]),$sql_keywords) ) ? "<span style=\"color:#990099;font-weight:bold;\">" . $token[1] . "</span>" : $token[1];
break;
case "T_IF":
case "T_LOGICAL_AND":
case "T_LOGICAL_OR":
case "T_LOGICAL_XOR":
$end.=( in_array(strtoupper($token[1]),$sql_keywords) ) ? "<span style=\"color:#0000ff;font-weight:bold;\">" . $token[1] . "</span>" : $token[1];
break;
case "T_CLOSE_TAG":
case "T_OPEN_TAG":
break;
default:
$end.=$token[1];
}
}
}
}
$end=preg_replace("/`(.*?)`/si","<span style=\"color:red;\">`$1`</span>",$end);
return $end;
}
function Fieldlist($db, $tbl)
{
$fl='';
$res=MSD_query("SHOW FIELDS FROM `$db`.`$tbl`;");
if ($res)
{
$fl='(';
for ($i=0; $i < mysqli_num_rows($res); $i++)
{
$row=mysqli_fetch_row($res);
$fl.='`' . $row[0] . '`,';
}
$fl=substr($fl,0,strlen($fl) - 1) . ')';
}
return $fl;
}
// reads all Tableinfos and place them in $dump-Array
function getDBInfos()
{
global $databases,$dump,$config,$tbl_sel,$flipped;
for ($ii=0; $ii < count($databases['multi']); $ii++)
{
$dump['dbindex']=$flipped[$databases['multi'][$ii]];
$tabellen=mysqli_query($config['dbconnection'], 'SHOW TABLE STATUS FROM `' . $databases['Name'][$dump['dbindex']] . '`') or die('getDBInfos: ' . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
$num_tables=mysqli_num_rows($tabellen);
// Array mit den gewünschten Tabellen zusammenstellen... wenn Präfix angegeben, werden die anderen einfach nicht übernommen
if ($num_tables > 0)
{
for ($i=0; $i < $num_tables; $i++)
{
$row=mysqli_fetch_array($tabellen);
if (isset($row['Type'])) $row['Engine']=$row['Type'];
if (isset($row['Comment']) && substr(strtoupper($row['Comment']),0,4) == 'VIEW') $dump['table_types'][]='VIEW';
else $dump['table_types'][]=strtoupper($row['Engine']);
// check if data needs to be backed up
if (strtoupper($row['Comment']) == 'VIEW' || ( isset($row['Engine']) && in_array(strtoupper($row['Engine']),array(
'MEMORY'
)) ))
{
$dump['skip_data'][]=$databases['Name'][$dump['dbindex']] . '|' . $row['Name'];
}
if ($config['optimize_tables_beforedump'] == 1 && $dump['table_offset'] == -1
&& $databases['Name'][$dump['dbindex']]!='information_schema') {
mysqli_select_db($GLOBALS["___mysqli_ston"], $databases['Name'][$dump['dbindex']]);
$opt = 'OPTIMIZE TABLE `' . $row['Name'] . '`';
$res = mysqli_query($GLOBALS["___mysqli_ston"], 'OPTIMIZE TABLE `' . $row['Name'] . '`');
if ($res === false) {
die("Error in ".$opt." -> ".((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
}
}
if (isset($tbl_sel))
{
if (in_array($row['Name'],$dump['tblArray']))
{
$dump['tables'][]=$databases['Name'][$dump['dbindex']] . '|' . $row['Name'];
$dump['records'][]=$databases['Name'][$dump['dbindex']] . '|' . $row['Rows'];
$dump['totalrecords']+=$row['Rows'];
}
}
elseif ($databases['praefix'][$dump['dbindex']] != '' && !isset($tbl_sel))
{
if (substr($row['Name'],0,strlen($databases['praefix'][$dump['dbindex']])) == $databases['praefix'][$dump['dbindex']])
{
$dump['tables'][]=$databases['Name'][$dump['dbindex']] . '|' . $row['Name'];
$dump['records'][]=$databases['Name'][$dump['dbindex']] . '|' . $row['Rows'];
$dump['totalrecords']+=$row['Rows'];
}
}
else
{
$dump['tables'][]=$databases['Name'][$dump['dbindex']] . '|' . $row['Name'];
$dump['records'][]=$databases['Name'][$dump['dbindex']] . '|' . $row['Rows'];
// 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'][$dump['dbindex']] . "`.`" . $row['Name'] . "`";
$res2=@mysqli_query($GLOBALS["___mysqli_ston"], $sql_2);
if ($res2 === false)
{
$read_error='(' . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_errno($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false)) . ') ' . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
SQLError($read_error,$sql_2);
WriteLog($read_error);
if ($config['stop_with_error'] > 0)
{
die($read_error);
}
}
else
{
$row2=@mysqli_fetch_array($res2);
$row['Rows']=$row2['count_records'];
$dump['totalrecords']+=$row['Rows'];
}
}
}
// Correct total number of records; substract skipped data
foreach ($dump['skip_data'] as $skip_data)
{
$index=false;
$records_to_skip=0;
//find index of table to get the nr of records
$count=sizeof($dump['tables']);
for ($a=0; $a < $count; $a++)
{
if ($dump['tables'][$a] == $skip_data)
{
$index=$a;
$t=explode('|',$dump['records'][$a]);
$rekords_to_skip=$t[1];
break;
}
}
if ($index) $dump['totalrecords']-=$rekords_to_skip;
}
}
}
}
// gets the numeric index in dump-array and returns it
function getDBIndex($db, $table)
{
global $dump;
$index=array_keys($dump['tables'],$db . '|' . $table);
return $index[0];
}
?>

Datei anzeigen

@ -1,137 +0,0 @@
<?php
error_reporting(E_ALL);
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE);
}
if (function_exists("date_default_timezone_set")) date_default_timezone_set(@date_default_timezone_get());
//Konstanten
if (!defined('MSD_VERSION')) define('MSD_VERSION','1.24.4');
if (!defined('MSD_OS')) define('MSD_OS',PHP_OS);
if (!defined('MSD_OS_EXT')) define('MSD_OS_EXT',@php_uname());
if (!defined('config') || !is_array($config)) $config=array();
if (!defined('databases') || !is_array($databases)) $databases=array();
//Pfade und Files
$config['paths']['root']=basePath();
$config['paths']['work']='work/';
$config['paths']['backup']=$config['paths']['work'] . 'backup/';
$config['paths']['log']=$config['paths']['work'] . 'log/';
$config['paths']['config']=$config['paths']['work'] . 'config/';
$config['paths']['perlexec']='msd_cron/';
if (isset($_SESSION['config_file']))
{
$config['config_file']=$_SESSION['config_file'];
$config['cron_configurationfile']=$_SESSION['config_file'];
}
else
{
$config['config_file']='mysqldumper';
$_SESSION['config_file']='mysqldumper';
$config['cron_configurationfile']='mysqldumper.conf.php';
}
$config['files']['log']=$config['paths']['log'] . 'mysqldump.log';
$config['files']['perllog']=$config['paths']['log'] . 'mysqldump_perl.log';
$config['files']['perllogcomplete']=$config['paths']['log'] . 'mysqldump_perl.complete.log';
$config['files']['parameter']=$config['paths']['config'] . $config['config_file'] . '.php';
// inti MySQL-Setting-Vars
$config['mysql_standard_character_set']='';
$config['mysql_possible_character_sets']=array();
//Ini-Parameter
$config['max_execution_time']=get_cfg_var('max_execution_time');
$config['max_execution_time']=( $config['max_execution_time'] <= 0 ) ? 30 : $config['max_execution_time'];
if ($config['max_execution_time'] > 30) $config['max_execution_time']=30;
$config['upload_max_filesize']=get_cfg_var('upload_max_filesize');
$config['safe_mode']=get_cfg_var('safe_mode');
$config['magic_quotes_gpc']=get_magic_quotes_gpc();
$config['disabled']=get_cfg_var('disable_functions');
$config['phpextensions']=implode(', ',get_loaded_extensions());
$m=trim(str_replace('M','',ini_get('memory_limit')));
// fallback if ini_get doesn't work
if (intval($m) == 0) $m=trim(str_replace('M','',get_cfg_var('memory_limit')));
$config['php_ram']=$m;
//Ist zlib moeglich?
$p1=explode(', ',$config['phpextensions']);
$p2=explode(',',str_replace(' ','',$config['disabled']));
//Buggy PHP-Version ?
$p3=explode('.',PHP_VERSION);
$buggy=( $p3[0] == 4 && $p3[1] == 3 && $p3[2] < 3 );
$config['zlib']=( !$buggy ) && ( in_array('zlib',$p1) && ( !in_array('gzopen',$p2) || !in_array('gzwrite',$p2) || !in_array('gzgets',$p2) || !in_array('gzseek',$p2) || !in_array('gztell',$p2) ) );
//Tuning-Ecke
$config['tuning_add']=1.1;
$config['tuning_sub']=0.9;
$config['time_buffer']=0.75; //max_zeit=$config['max_execution_time']*$config['time_buffer']
$config['perlspeed']=10000; //Anzahl der Datensaetze, die in einem Rutsch gelesen werden
$config['ignore_enable_keys'] = 0;
//Bausteine
$config['homepage']='http://mysqldumper.net';
$languagepacks_ref='http://forum.mysqldumper.de/downloads.php?cat=9';
$stylepacks_ref='http://forum.mysqldumper.de/downloads.php?cat=3';
$nl="\n";
$mysql_commentstring='--';
//config-Variablen, die nicht gesichert werden sollen
$config_dontsave=Array(
'homepage',
'max_execution_time',
'safe_mode',
'magic_quotes_gpc',
'disabled',
'phpextensions',
'php_ram',
'zlib',
'tuning_add',
'tuning_sub',
'time_buffer',
'perlspeed',
'cron_configurationfile',
'dbconnection',
'version',
'mysql_possible_character_sets',
'mysql_standard_character_set',
'config_file',
'upload_max_filesize',
'mysql_can_change_encoding',
'cron_samedb',
'paths',
'files'
);
$dontBackupDatabases = array('mysql', 'information_schema');
// Automatisches entfernen von Slashes und Leerzeichen vorn und hinten abschneiden
if (1==get_magic_quotes_gpc())
{
$_POST=stripslashes_deep($_POST);
$_GET=stripslashes_deep($_GET);
}
$_POST=trim_deep($_POST);
$_GET=trim_deep($_GET);
function v($t)
{
echo '<br>';
if (is_array($t) || is_object($t))
{
echo '<pre>';
print_r($t);
echo '</pre>';
}
else
echo $t;
}
function getServerProtocol()
{
return ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
}
?>

Datei anzeigen

@ -1,294 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
include('./inc/functions_imexport.php');
//Im-/Export
$import=( isset($_GET['import']) ) ? 1 : 0;
if ($import == 1)
{
//IMPORT
CheckcsvOptions();
if (isset($_POST['f_import_csvtrenn'])) $sql['import']['trenn']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_import_csvtrenn']) : $_POST['f_import_csvtrenn'];
if (isset($_POST['f_import_csvenc'])) $sql['import']['enc']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_import_csvenc']) : $_POST['f_import_csvenc'];
if (isset($_POST['f_import_csvesc'])) $sql['import']['esc']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_import_csvesc']) : $_POST['f_import_csvesc'];
if (empty($sql['import']['endline']))
{
$sql['import']['endline']=$nl;
}
else
{
$sql['import']['endline']=str_replace('\\r',"\015",$sql['import']['endline']);
$sql['import']['endline']=str_replace('\\n',"\012",$sql['import']['endline']);
$sql['import']['endline']=str_replace('\\t',"\011",$sql['import']['endline']);
}
$sql['import']['endline']=str_replace('\\t',"\011",$sql['import']['endline']);
if (isset($_POST['f_import_csvnull'])) $sql['import']['null']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_import_csvnull']) : $_POST['f_import_csvnull'];
$sql['import']['namefirstline']=( isset($_POST['f_import_namefirstline']) ) ? $_POST['f_import_namefirstline'] : 0;
$sql['import']['emptydb']=( isset($_POST['import_emptydb']) ) ? 1 : 0;
$sql['import']['createindex']=( isset($_POST['import_createindex']) ) ? 1 : 0;
$sql['import']['table']=( isset($_POST['import_table']) ) ? $_POST['import_table'] : "";
$sql['import']['import_source']=isset($_POST['import_source']) ? $_POST['import_source'] : 0;
$sql['import']['text']=isset($_POST['import_text']) ? ( ( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['import_text']) : $_POST['import_text'] ) : "";
$sql['import']['csv']="";
if (isset($_POST['do_import']))
{
$sql['import']['tablecreate']=0;
if ($sql['import']['table'] == "new")
{
$sql['import']['table']="import_";
$sql['import']['tablecreate']=1;
}
if ($sql['import']['table'] == "")
{
$aus.='<span class="error">' . $lang['L_IMPORT_NOTABLE'] . '</span>';
}
else
{
if ($_POST['import_source'] == 0)
{
//Import aus textbox
$sql['import']['csv']=explode($sql['import']['endline'],$sql['import']['text']);
}
else
{
if (!isset($_FILES['upfile']['name']) || empty($_FILES['upfile']['name']))
{
$aus.='<span class="error">' . $lang['L_FM_UPLOADFILEREQUEST'] . '</span>';
}
else
{
$fn=$_FILES['upfile']['tmp_name'];
$sql['import']['csv']=( substr($_FILES['upfile']['name'],-3) == ".gz" ) ? gzfile($fn) : file($fn);
$sql['import']['text']=implode("",$sql['import']['csv']);
$aus.='<span>' . $lang['L_SQL_UPLOADEDFILE'] . '<strong>' . $_FILES['upfile']['name'] . '</strong>&nbsp;&nbsp;&nbsp;' . byte_output(filesize($_FILES['upfile']['tmp_name'])) . '</span>';
}
}
if (is_array($sql['import']['csv'])) $aus.=DoImport();
else $aus.='<br><span class="error">' . $lang['L_CSV_NODATA'] . '</span>';
}
}
$impaus=$aus;
$impaus.='<form action="sql.php?db=' . $db . '&amp;dbid=' . $dbid . '&amp;context=4&amp;import=1" method="post" enctype="multipart/form-data">' . $nl;
$impaus.='';
$impaus.='<a href="sql.php?db=' . $db . '&amp;dbid=' . $dbid . '&amp;context=4">' . $lang['L_EXPORT'] . '</a>';
$impaus.='<h6>' . sprintf($lang['L_SQL_IMPORT'],$databases['Name'][$dbid]) . '</h6>';
$impaus.='<table class="bordersmall"><tr class="thead"><th>' . $nl;
$impaus.=$lang['L_IMPORTOPTIONS'] . '</th><th>' . $lang['L_CSVOPTIONS'] . '</th></tr>' . $nl;
$impaus.='<tr><td valign="top">' . $nl;
$impaus.='<table cellpadding="0" cellspacing="0">' . $nl;
$impaus.='<tr><td>' . $lang['L_IMPORTTABLE'] . '</td><td><select name="import_table">' . TableComboBox($sql['import']['table']) . '<option value="new" ' . ( ( $sql['import']['table'] == "import_" ) ? 'selected' : '' ) . '>== ' . $lang['L_NEWTABLE'] . ' ==</option></select></td></tr>' . $nl;
$impaus.='<tr><td>' . $lang['L_IMPORTSOURCE'] . '</td>' . $nl;
$impaus.='<td><input type="radio" class="radio" name="import_source" value="0" ' . ( ( $sql['import']['import_source'] == 0 ) ? 'checked' : '' ) . ' onclick="check_csvdivs(1); return true">' . $lang['L_FROMTEXTBOX'] . '<br>' . $nl;
$impaus.='<input type="radio" class="radio" id="radio_csv0" name="import_source" value="1" ' . ( ( $sql['import']['import_source'] == 1 ) ? 'checked' : '' ) . ' onclick="check_csvdivs(1); return true">' . $lang['L_FROMFILE'] . '</td></tr>' . $nl;
$impaus.='<tr><td colspan="2"><input type="checkbox" class="checkbox" name="import_emptydb" value="1" ' . ( ( $sql['import']['emptydb'] == 1 ) ? 'checked' : '' ) . '>' . $lang['L_EMPTYTABLEBEFORE'] . '</td></tr>' . $nl;
$impaus.='<tr><td colspan="2"><input type="checkbox" class="checkbox" name="import_createindex" value="1" ' . ( ( $sql['import']['createindex'] == 1 ) ? 'checked' : '' ) . '>' . $lang['L_CREATEAUTOINDEX'] . '</td></tr>' . $nl;
$impaus.='</table>' . $nl;
$impaus.='</td><td valign="top">' . $nl;
$impaus.='<table cellpadding="0" cellspacing="0">' . $nl;
$impaus.='<tr><td colspan="2"><input type="checkbox" class="checkbox" name="f_import_namefirstline0" value="1" ' . ( ( $sql['import']['namefirstline'] == 1 ) ? "checked" : "" ) . '>' . $lang['L_CSV_NAMEFIRSTLINE'] . '</td></tr>' . $nl;
$impaus.='<tr><td>' . $lang['L_CSV_FIELDSEPERATE'] . '</td><td><input type="text" class="text" name="f_import_csvtrenn" size="4" maxlength="12" value="' . $sql['import']['trenn'] . '"></td></tr>' . $nl;
$impaus.='<tr><td>' . $lang['L_CSV_FIELDSENCLOSED'] . '</td><td><input type="text" class="text" name="f_import_csvenc" size="4" maxlength="12" value="' . htmlspecialchars($sql['import']['enc']) . '"></td></tr>' . $nl;
$impaus.='<tr><td>' . $lang['L_CSV_FIELDSESCAPE'] . '</td><td><input type="text" class="text" name="f_import_csvesc" size="4" maxlength="12" value="' . $sql['import']['esc'] . '"></td></tr>' . $nl;
$impaus.='<tr><td>' . $lang['L_CSV_EOL'] . '</td><td><input type="text" class="text" name="f_import_csvztrenn" size="4" maxlength="12" value="' . $sql['import']['ztrenn'] . '"></td></tr>' . $nl;
$impaus.='<tr><td>' . $lang['L_CSV_NULL'] . '</td><td><input type="text" class="text" name="f_import_csvnull" size="4" maxlength="12" value="' . $sql['import']['null'] . '"></td></tr>' . $nl;
$impaus.='</table>' . $nl;
$impaus.='</td></tr>';
$impaus.='<tr><td colspan="2"><div id="csv0">' . $lang['L_CSV_FILEOPEN'] . ':&nbsp;&nbsp;
<input type="file" name="upfile" accept="application/gzip">';
$impaus.='<input type="hidden" name="MAX_FILE_SIZE" VALUE="2500000"></div></td></tr>';
$impaus.='<tr><td colspan="2" align="right"><input class="Formbutton" type="submit" name="do_import" value=" ' . $lang['L_IMPORTIEREN'] . ' "></td></tr>';
$impaus.='</table>' . $nl;
$impaus.='<p>&nbsp;</p>' . $lang['L_IMPORT'] . ':<br><textarea name="import_text" wrap="OFF" style="width:760px;height:400px;font-size=11px;">';
//$impaus.=$sql['import']['text'];
$impaus.='</textarea></form>' . $nl;
$impaus.='<script language="JavaScript" type="text/javascript">check_csvdivs(1);</script>' . $nl;
echo $impaus . $nl;
}
else
{
//EXPORT
$tables=0;
$tblstr="";
$sql['export']['db']=$db;
if (isset($_POST['f_export_submit']))
{
//echo '<pre>'.print_r($_POST,true).'</pre><hr>';
$sql['export']['header_sent']="";
$sql['export']['lines']=0;
$sql['export']['format']=$_POST['f_export_format'];
$sql['export']['ztrenn']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_export_csvztrenn']) : $_POST['f_export_csvztrenn'];
$sql['endline']['ztrenn']=$sql['export']['ztrenn'];
if ($sql['export']['format'] == 0)
{
//CSV
$format=0;
$sql['export']['trenn']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_export_csvtrenn']) : $_POST['f_export_csvtrenn'];
$sql['export']['enc']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_export_csvenc']) : $_POST['f_export_csvenc'];
$sql['export']['esc']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_export_csvesc']) : $_POST['f_export_csvesc'];
if (empty($sql['export']['endline']))
{
$sql['export']['endline']=$nl;
}
else
{
$sql['export']['endline']=str_replace('\\r',"\015",$sql['export']['endline']);
$sql['export']['endline']=str_replace('\\n',"\012",$sql['export']['endline']);
$sql['export']['endline']=str_replace('\\t',"\011",$sql['export']['endline']);
}
$sql['export']['endline']=str_replace('\\t',"\011",$sql['export']['endline']);
}
elseif ($sql['export']['format'] == 1)
{
//EXCEL
$format=1;
$sql['export']['trenn']=",";
$sql['export']['enc']='"';
$sql['export']['esc']='"';
$sql['export']['endline']="\015\012";
}
elseif ($sql['export']['format'] == 3)
{
//EXCEL 2003
$format=1;
$sql['export']['trenn']=";";
$sql['export']['enc']='"';
$sql['export']['esc']='"';
$sql['export']['endline']="\015\012";
}
elseif ($sql['export']['format'] == 4)
{
//XML
$format=4;
CheckcsvOptions();
}
elseif ($sql['export']['format'] == 5)
{
//HTML
$format=5;
CheckcsvOptions();
}
if ($format < 3) $sql['export']['null']=( $config['magic_quotes_gpc'] ) ? stripslashes($_POST['f_export_csvnull' . $format]) : $_POST['f_export_csvnull' . $format];
$sql['export']['namefirstline']=( isset($_POST['f_export_namefirstline' . $format]) ) ? $_POST['f_export_namefirstline' . $format] : 0;
$sql['export']['sendfile']=$_POST['f_export_sendresult'];
$sql['export']['compressed']=( isset($_POST['f_export_compressed']) ) ? $_POST['f_export_compressed'] : 0;
$sql['export']['exportfile']="";
$sql['export']['xmlstructure']=( isset($_POST['f_export_xmlstructure']) ) ? $_POST['f_export_xmlstructure'] : 0;
$sql['export']['htmlstructure']=( isset($_POST['f_export_htmlstructure']) ) ? $_POST['f_export_htmlstructure'] : 0;
//ausgewählte Tabellen
if (isset($_POST['f_export_tables']))
{
$sql['export']['tables']=$_POST['f_export_tables'];
}
}
else
CheckcsvOptions();
//Tabellenliste
$sqlt="SHOW TABLE STATUS FROM `$db`";
$res=MSD_query($sqlt);
if ($res)
{
$sql['export']['tablecount']=mysqli_num_rows($res);
$sql['export']['recordcount']=0;
for ($i=0; $i < $sql['export']['tablecount']; $i++)
{
$row=mysqli_fetch_array($res);
$tblstr.='<option value="' . $row['Name'] . '" ' . ( ( isset($sql['export']['tables']) && in_array($row['Name'],$sql['export']['tables']) ) ? "selected" : "" ) . '>' . $row['Name'] . ' (' . $row['Rows'] . ')</option>' . "\n";
$sql['export']['recordcount']+=$row['Rows'];
}
}
$exaus=$aus . '<h4>' . sprintf($lang['L_SQL_EXPORT'],$databases['Name'][$dbid]) . '</h4>';
$exaus.='<form action="sql.php?db=' . $db . '&amp;dbid=' . $dbid . '&amp;context=4" method="post">' . $nl;
$exaus.='<a href="sql.php?db=' . $db . '&amp;dbid=' . $dbid . '&amp;context=4&amp;import=1">' . $lang['L_IMPORT'] . '</a>';
$exaus.='<h6>' . sprintf($lang['L_SQL_EXPORT'],$databases['Name'][$dbid]) . '</h6>';
$exaus.='<table class="bdr"><tr class="thead"><th>' . $lang['L_TABLES'] . '</th>' . $nl;
$exaus.='<th>' . $lang['L_EXPORTOPTIONS'] . '</th>';
$exaus.='<th>' . $lang['L_EXPORT'] . '</th></tr><tr>';
$exaus.='';
$exaus.='<td><span class="ssmall"><strong>' . $sql['export']['tablecount'] . '</strong> ' . $lang['L_TABLES'] . ', <strong>' . $sql['export']['recordcount'] . '</strong> ' . $lang['L_RECORDS'] . '</span>';
$exaus.='&nbsp;&nbsp;&nbsp;<a class="ssmall" href="#" onclick="SelectTableList(true);">' . $lang['L_ALL'] . '</a>&nbsp;&nbsp;<a class="ssmall" href="#" onclick="SelectTableList(false);">' . $lang['L_NONE'] . '</a>' . $nl;
$exaus.='<br><select name="f_export_tables[]" size="12" multiple>' . $tblstr . '</select><br>' . $nl;
$exaus.='</td><td>' . $nl;
$exaus.='' . $nl;
$exaus.='<input type="radio" class="radio" name="f_export_format" id="radio_csv0" value="0" ' . ( ( $sql['export']['format'] == 0 ) ? "checked" : "" ) . ' onclick="check_csvdivs(0); return true">' . "CSV" . '&nbsp;&nbsp;&nbsp;' . $nl;
$exaus.='<input type="radio" class="radio" name="f_export_format" id="radio_csv1" value="1" ' . ( ( $sql['export']['format'] == 1 ) ? "checked" : "" ) . ' onclick="check_csvdivs(0); return true">' . "Excel" . '&nbsp;&nbsp;&nbsp;' . $nl;
$exaus.='<input type="radio" class="radio" name="f_export_format" id="radio_csv2" value="3" ' . ( ( $sql['export']['format'] == 3 ) ? "checked" : "" ) . ' onclick="check_csvdivs(0); return true">' . $lang['L_EXCEL2003'] . '<br>' . $nl;
$exaus.='<input type="radio" class="radio" name="f_export_format" id="radio_csv4" value="4" ' . ( ( $sql['export']['format'] == 4 ) ? "checked" : "" ) . ' onclick="check_csvdivs(0); return true">' . "XML" . '&nbsp;&nbsp;&nbsp;' . $nl;
$exaus.='<input type="radio" class="radio" name="f_export_format" id="radio_csv5" value="5" ' . ( ( $sql['export']['format'] == 5 ) ? "checked" : "" ) . ' onclick="check_csvdivs(0); return true">' . "HTML" . '<br><br>' . $nl;
$exaus.='<div id="csv0"><fieldset><legend>CSV-Optionen</legend><table cellpadding="0" cellspacing="0"><tr><td colspan="2">' . $nl;
$exaus.='<input type="checkbox" class="checkbox" name="f_export_namefirstline0" value="1" ' . ( ( $sql['export']['namefirstline'] == 1 ) ? "checked" : "" ) . '>' . $lang['L_CSV_NAMEFIRSTLINE'] . '</td></tr>' . $nl;
$exaus.='<tr><td>' . $lang['L_CSV_FIELDSEPERATE'] . '</td><td><input type="text" class="text" name="f_export_csvtrenn" size="4" maxlength="12" value="' . $sql['export']['trenn'] . '"></td></tr>' . $nl;
$exaus.='<tr><td>' . $lang['L_CSV_FIELDSENCLOSED'] . '</td><td><input type="text" class="text" name="f_export_csvenc" size="4" maxlength="12" value="' . htmlspecialchars($sql['export']['enc']) . '"></td></tr>' . $nl;
$exaus.='<tr><td>' . $lang['L_CSV_FIELDSESCAPE'] . '</td><td><input type="text" class="text" name="f_export_csvesc" size="4" maxlength="12" value="' . $sql['export']['esc'] . '"></td></tr>' . $nl;
$exaus.='<tr><td>' . $lang['L_CSV_EOL'] . '</td><td><input type="text" class="text" name="f_export_csvztrenn" size="4" maxlength="12" value="' . $sql['export']['ztrenn'] . '"></td></tr>' . $nl;
$exaus.='<tr><td>' . $lang['L_CSV_NULL'] . '</td><td><input type="text" class="text" name="f_export_csvnull0" size="4" maxlength="12" value="' . $sql['export']['null'] . '"></td></tr>' . $nl;
$exaus.='</table></fieldset></div>' . $nl;
$exaus.='<div id="csv1"><fieldset><legend>Excel-Optionen</legend><table cellpadding="0" cellspacing="0"><tr><td colspan="2">';
$exaus.='<input type="checkbox" class="checkbox" name="f_export_namefirstline1" value="1"' . ( ( $sql['export']['namefirstline'] == 1 ) ? "checked" : "" ) . '>' . $lang['L_CSV_NAMEFIRSTLINE'] . '</td></tr>' . $nl;
$exaus.='<tr><td>' . $lang['L_CSV_NULL'] . '</td><td><input type="text" class="text" name="f_export_csvnull1" size="4" maxlength="12" value="' . $sql['export']['null'] . '"></td></tr>' . $nl;
$exaus.='</table></fieldset></div>' . $nl;
$exaus.='<div id="csv4"><fieldset><legend>XML-Optionen</legend><table>';
$exaus.='<tr><td><input type="checkbox" name="f_export_xmlstructure" value="1" class="checkbox" ' . ( ( $sql['export']['xmlstructure'] == 1 ) ? 'checked' : '' ) . '> mit Struktur</td></tr>';
$exaus.='</table></fieldset></div>' . $nl;
$exaus.='<div id="csv5"><fieldset><legend>HTML-Optionen</legend><table>';
$exaus.='<tr><td><input type="checkbox" name="f_export_htmlstructure" value="1" class="checkbox" ' . ( ( $sql['export']['htmlstructure'] == 1 ) ? 'checked' : '' ) . '> mit Struktur</td></tr>';
$exaus.='</table></fieldset></div>' . $nl;
$exaus.='</td><td>' . $nl;
$exaus.='<input type="radio" class="radio" name="f_export_sendresult" value="0" ' . ( ( $sql['export']['sendfile'] == 0 ) ? "checked" : "" ) . ' onclick="check_csvdivs(0); return true">' . $lang['L_SHOWRESULT'] . '<br>' . $nl;
$exaus.='<input type="radio" class="radio" name="f_export_sendresult" id="radio_csv3" value="1" ' . ( ( $sql['export']['sendfile'] == 1 ) ? "checked" : "" ) . ' onclick="check_csvdivs(0); return true">' . $lang['L_SENDRESULTASFILE'] . '<br>' . $nl;
$exaus.='<div id="csv3"><input type="checkbox" class="checkbox" name="f_export_compressed" value="1" ' . ( ( $sql['export']['compressed'] == 1 ) ? "checked" : "" ) . '>' . $lang['L_COMPRESSED'] . '</div><br>' . $nl;
$exaus.='<img src="' . $icon['blank'] . '" width="60" height="130" border="0"><br><input class="Formbutton" type="submit" name="f_export_submit" value="' . $lang['L_EXPORT'] . '" onclick="if(SelectedTableCount()==0) {alert(msg1);return false;}">' . $nl;
$exaus.='</td></tr></table></form>' . $nl;
$exaus.='<script language="JavaScript" type="text/javascript">check_csvdivs(0);</script>' . $nl;
if (!$download) echo $exaus . $nl;
if (isset($_POST['f_export_submit']) && isset($sql['export']['tables']))
{
if (!$download) echo '<br><br><table width="90%"><tr><td>' . $lang['L_EXPORT'] . ':</td><td align="right"><a href="javascript:BrowseInput(\'imexta\');">zeige in neuem Fenster</a></td></tr></table><textarea id="imexta" wrap="OFF" style="width:760px;height:400px;font-size=11px;">' . $nl;
if ($format < 3) ExportCSV();
elseif ($format == 4) ExportXML();
elseif ($format == 5) ExportHTML();
if (!$download)
{
echo '</textarea><br>' . $nl;
echo '<span style="color:blue;">' . $lang['L_EXPORTFINISHED'] . '</span>&nbsp;&nbsp;' . sprintf($lang['L_EXPORTLINES'],$sql['export']['lines']) . $nl;
}
else
{
exit();
}
}
}
?>

Datei anzeigen

@ -1,187 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
get_sql_encodings();
//Datenbanken
if (isset($_GET['dbrefresh'])) SetDefault();
echo $aus . '<h4>' . $lang['L_TOOLS'] . '</h4>';
if (isset($_POST['dbdosubmit']))
{
$newname=$_POST['newname'];
$db_index=$_POST['db_index'];
$db_action=$_POST['db_action'];
$changed=false;
$ausgabe=$out="";
switch ($db_action)
{
case "drop":
if (MSD_DoSQL("DROP DATABASE `" . $databases['Name'][$db_index] . "`"))
{
echo SQLOutput($out,'<p class="success">' . $lang['L_DB'] . ' `' . $databases['Name'][$db_index] . '` ' . $lang['L_SQL_DELETED'] . '</p>');
$changed=true;
}
break;
case "empty":
EmptyDB($databases['Name'][$db_index]);
echo SQLOutput($out,'<p class="success">' . $lang['L_DB'] . ' `' . $databases['Name'][$db_index] . '` ' . $lang['L_SQL_WASEMPTIED'] . '.</p>');
break;
case "rename":
$dbold=$databases['Name'][$db_index];
if (DB_Copy($dbold,$newname,1))
{
echo SQLOutput($out,'<p class="success">' . $lang['L_DB'] . ' `' . $dbold . '` ' . $lang['L_SQL_RENAMEDTO'] . ' `' . $newname . '`.</p>');
$changed=true;
}
break;
case "copy":
$dbold=$databases['Name'][$db_index];
if (DB_Copy($dbold,$newname))
{
$changed=true;
echo SQLOutput($out,'<p class="success">' . sprintf($lang['L_SQL_DBCOPY'],$dbold,$newname) . '</p>');
}
break;
case "structure":
if (DB_Copy($databases['Name'][$db_index],$newname,0,0))
{
$changed=true;
echo SQLOutput($out,'<p class="success">' . sprintf($lang['L_SQL_DBSCOPY'],$databases['Name'][$db_index],$newname) . '</p>');
}
break;
case "rights":
break;
}
if ($changed==true)
{
SetDefault();
include ( $config['files']['parameter'] );
echo '<script language="JavaScript" type="text/javascript">parent.MySQL_Dumper_menu.location.href="menu.php?action=dbrefresh";</script>';
}
}
if (isset($_POST['dbwantaction']))
{
if (isset($_POST['db_createnew']))
{
$newname=trim($_POST['db_create']);
if (!empty($newname))
{
$sqlc="CREATE DATABASE `$newname`";
$col=( MSD_NEW_VERSION ) ? $_POST['db_collate'] : "";
if (isset($_POST['db_default_charset']) && intval(substr(MSD_NEW_VERSION,0,1)) > 3)
{
$db_default_charset_string=$config['mysql_possible_character_sets'][$_POST['db_default_charset']];
$db_default_charset=explode(' ',$db_default_charset_string);
if (isset($db_default_charset[0])) $sqlc.=' DEFAULT CHARACTER SET `' . $db_default_charset[0] . '`';
}
$db_default_collation=@explode('|',$col);
if (isset($db_default_collation[1])) $sqlc.=' COLLATE `' . $db_default_collation[1] . '`';
if (MSD_query($sqlc))
{
echo $lang['L_DB'] . " `$newname` " . $lang['L_SQL_WASCREATED'] . ".<br>";
SetDefault();
include ( $config['files']['parameter'] );
echo '<script language="JavaScript" type="text/javascript">parent.MySQL_Dumper_menu.location.href="menu.php?action=dbrefresh";</script>';
}
}
}
$db_action=$newname="";
$db_index=-1;
for ($i=0; $i < count($databases['Name']); $i++)
{
if (isset($_POST['db_do_' . $i]))
{
$newname=$_POST['db_rename' . $i];
$db_index=$i;
$db_action=$_POST['db_do_action_' . $i];
break;
}
}
if ($db_action != "")
{
echo '<div><div align="left" id="sqleditbox">';
echo '<form action="sql.php?context=3" method="post">
<input type="hidden" name="db_action" value="' . $db_action . '">
<input type="hidden" name="newname" value="' . $newname . '">
<input type="hidden" name="db_index" value="' . $db_index . '">';
switch ($db_action)
{
case "drop":
echo '<strong>' . sprintf($lang['L_ASKDBDELETE'],$databases['Name'][$i]) . '</strong><br><br>';
echo '<input type="submit" name="dbdosubmit" value="' . $lang['L_DO_NOW'] . '" class="Formbutton">';
break;
case "empty":
echo '<strong>' . sprintf($lang['L_ASKDBEMPTY'],$databases['Name'][$i]) . '</strong><br><br>';
echo '<input type="submit" name="dbdosubmit" value="' . $lang['L_DO_NOW'] . '" class="Formbutton">';
break;
case "rename":
echo '<strong>' . $lang['L_SQL_RENAMEDB'] . ' `' . $databases['Name'][$db_index] . '` ' . $lang['L_IN'] . ' `' . $newname . '`</strong><br><br>';
if ($newname == "") echo '<p class="error">' . $lang['L_SQL_NAMEDEST_MISSING'] . '</p>';
else
{
echo '<input type="submit" name="dbdosubmit" value="' . $lang['L_DO_NOW'] . '" class="Formbutton">';
}
break;
case "copy":
echo '<strong>' . sprintf($lang['L_ASKDBCOPY'],$databases['Name'][$db_index],$newname) . '</strong><br><br>';
if ($newname == "") echo '<p class="error">' . $lang['L_SQL_NAMEDEST_MISSING'] . '</p>';
else
{
echo '<input type="submit" name="dbdosubmit" value="' . $lang['L_DO_NOW'] . '" class="Formbutton">';
}
break;
case "structure":
echo '<strong>' . $lang['L_FM_ASKDBCOPY1'] . '`' . $databases['Name'][$db_index] . '`' . $lang['L_FM_ASKDBCOPY2'] . '`' . $newname . '`' . $lang['L_FM_ASKDBCOPY3'] . '</strong><br><br>';
if ($newname == "") echo '<p class="error">' . $lang['L_SQL_NAMEDEST_MISSING'] . '</p>';
else
{
echo '<input type="submit" name="dbdosubmit" value="' . $lang['L_DO_NOW'] . '" class="Formbutton">';
}
break;
case "rights":
break;
}
echo '</form></div></div><br>';
}
}
echo '<br><form action="sql.php?context=3" method="post"><input type="hidden" name="dbwantaction" value="1">';
echo '<div><table class="bdr">';
echo '<tr><td colspan="2" align="center"><strong>' . $lang['L_CREATE_DATABASE'] . '</strong></td></tr>';
echo '<tr><td>Name:</td><td><input type="text" class="text" name="db_create" size="20"></td></tr>';
echo '<tr><td>' . $lang['L_DEFAULT_CHARSET'] . ':</td><td><select name="db_default_charset">';
echo make_options($config['mysql_possible_character_sets'],get_index($config['mysql_possible_character_sets'],$config['mysql_standard_character_set']));
echo '</select></td></tr>';
echo '<tr><td>' . $lang['L_COLLATION'] . '</td><td><select name="db_collate">' . CollationCombo('',1) . '</select></td></tr>';
echo '<tr><td colspan="2"><input type="submit" name="db_createnew" value="' . $lang['L_CREATE'] . '" class="Formbutton"></td></tr>';
echo '</table>';
echo '<br><table class="bdr">';
echo '<tr class="thead"><th>' . $lang['L_DBS'] . '</th><th>' . $lang['L_SQL_ACTIONS'] . '</th></tr>';
for ($i=0; $i < count($databases['Name']); $i++)
{
$cl=( $i % 2 ) ? "dbrow" : "dbrow1";
echo ( $i == $databases['db_selected_index'] ) ? '<tr class="dbrowsel">' : '<tr class="' . $cl . '">';
echo '<td><a href="sql.php?db=' . $databases['Name'][$i] . '&amp;dbid=' . $i . '">' . $databases['Name'][$i] . '</a></td>';
echo '<td nowrap="nowrap"><input type="text" class="text" name="db_rename' . $i . '" size="20">';
echo '&nbsp;&nbsp;<select name="db_do_action_' . $i . '" onchange="db_do_' . $i . '.disabled=false;">';
echo '<option value="">-- ' . $lang['L_SQL_CHOOSEACTION'] . ' --</option>';
echo '<option value="drop">' . $lang['L_SQL_DELETEDB'] . '</option>';
echo '<option value="empty">' . $lang['L_SQL_EMPTYDB'] . '</option>';
if (MSD_NEW_VERSION) echo '<option value="rename">' . $lang['L_SQL_RENAMEDB'] . '</option>';
if (MSD_NEW_VERSION) echo '<option value="copy">' . $lang['L_SQL_COPYDATADB'] . '</option>';
echo '<option value="structure">' . $lang['L_SQL_COPYSDB'] . '</option>';
echo '</select>';
echo "\n\n" . '&nbsp;&nbsp;<input type="submit" name="db_do_' . $i . '" value="' . $lang['L_DO'] . '" disabled="disabled" class="Formbutton">';
echo '&nbsp;&nbsp;<input type="Button" value="' . $lang['L_SQL_IMEXPORT'] . '" onclick="location.href=\'sql.php?db=' . $databases['Name'][$i] . '&amp;dbid=' . $i . '&amp;context=4\'" class="Formbutton"></td></tr>';
}
echo '</table></div></form>';

Datei anzeigen

@ -1,91 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
function nl2null($string)
{
$search=array("\r","\n");
$replace=array('','');
return trim(str_replace($search,$replace,$string));
}
//SQL-Strings
echo $aus.='<h4>' . $lang['L_SQL_BEFEHLE'] . ' (' . (is_array($SQL_ARRAY)? count($SQL_ARRAY) : 0) . ')</h4>';
echo '<a href="' . $params . '&amp;sqlconfig=1&amp;new=1">' . $lang['L_SQL_BEFEHLNEU'] . '</a><br><br>';
if (isset($_POST['sqlnewupdate']))
{
$ind=(is_array($SQL_ARRAY))? count($SQL_ARRAY) : 0;
if ($ind > 0) array_push($SQL_ARRAY,$_POST['sqlname' . $ind] . "|" . $_POST['sqlstring' . $ind]);
else $SQL_ARRAY[0]=htmlspecialchars($_POST['sqlname0'],ENT_COMPAT ,'UTF-8') . '|' . $_POST['sqlstring0'];
WriteSQL();
echo '<p>' . $lang['L_SQL_BEFEHLSAVED1'] . ' \'' . $_POST['sqlname' . $ind] . '\' ' . $lang['L_SQL_BEFEHLSAVED2'] . '</p>';
}
echo '<form name="sqlform" action="sql.php" method="post">
<input type="hidden" name="context" value="1">
<input type="hidden" name="sqlconfig" value="1">
<input type="hidden" name="tablename" value="' . $tablename . '">
<input type="hidden" name="dbid" value="' . $dbid . '">';
echo '<table class="bdr" style="width:100%"><tr class="thead"><th>#</th><th>' . $lang['L_NAME'] . '</th><th>SQL</th><th>' . $lang['L_COMMAND'] . '</th></tr>';
$i=0;
if (is_array($SQL_ARRAY) && count($SQL_ARRAY) > 0)
{
for ($i=0; $i < count($SQL_ARRAY); $i++)
{
if (isset($_POST['sqlupdate' . $i]))
{
echo '<tr><td colspan="4"><p class="success">' . $lang['L_SQL_BEFEHLSAVED1']
. ' \'' . htmlspecialchars($_POST['sqlname' . $i],ENT_COMPAT ,'UTF-8') . '\' ' . $lang['L_SQL_BEFEHLSAVED3'] . '</p></td></tr>';
$SQL_ARRAY[$i]=$_POST['sqlname' . $i] . "|" . nl2null($_POST['sqlstring' . $i]);
WriteSQL();
}
if (isset($_POST['sqlmove' . $i]))
{
echo '<tr><td colspan="4"><p class="success">' . $lang['L_SQL_BEFEHLSAVED1'] . ' \'' . $_POST['sqlname' . $i] . '\' ' . $lang['L_SQL_BEFEHLSAVED4'] . '</p></td></tr>';
$a[]=$SQL_ARRAY[$i];
array_splice($SQL_ARRAY,$i,1);
$SQL_ARRAY=array_merge($a,$SQL_ARRAY);
WriteSQL();
}
if (isset($_POST['sqldelete' . $i]))
{
echo '<tr><td colspan="4"><p class="success">' . $lang['L_SQL_BEFEHLSAVED1'] . ' \'' . $_POST['sqlname' . $i] . '\' ' . $lang['L_SQL_BEFEHLSAVED5'] . '</p></td></tr>';
array_splice($SQL_ARRAY,$i,1);
WriteSQL();
}
}
for ($i=0; $i < count($SQL_ARRAY); $i++)
{
$cl=( $i % 2 ) ? "dbrow" : "dbrow1";
echo '<tr class="' . $cl . '"><td>' . ( $i + 1 ) . '.</td><td>';
echo '<input type="text" class="text" name="sqlname' . $i . '" value="' . htmlspecialchars(SQL_Name($i),ENT_COMPAT,'UTF-8') . '"></td>';
echo '<td><textarea rows="4" cols="80" style="width:100%;" name="sqlstring' . $i . '">' . stripslashes(SQL_String($i)) . '</textarea></td>';
echo '<td><input class="Formbutton" style="width:80px;" type="submit" name="sqlupdate' . $i . '" value="save"><br>
<input class="Formbutton" style="width:80px;" type="submit" name="sqlmove' . $i . '" value="move up"><br>
<input class="Formbutton" style="width:80px;" type="submit" name="sqldelete' . $i . '" value="delete"></td></tr>';
}
}
if (isset($_GET['new']))
{
$cl=( $i % 2 ) ? "dbrow" : "dbrow1";
echo '<tr class="' . $cl . '"><td>' . ( $i + 1 ) . '</td><td>';
echo '<input type="text" class="text" name="sqlname' . $i . '" id="sqlname' . $i . '" value="SQL ' . ( $i + 1 ) . '"><br><div class="small" align="center">' . $lang['L_SQL_LIBRARY'] . '<br>';
echo '<select id="sqllib" name="sqllib" onChange="InsertLib(' . $i . ');" class="small">';
echo '<option value=""></option>';
$og=false;
for ($j=0; $j < count($sqllib); $j++)
{
if ($sqllib[$j]['sql'] == "trenn")
{
if ($og) echo '</optgroup>';
echo '<optgroup label="' . $sqllib[$j]['name'] . '">';
$og=true;
}
else
{
echo '<option value="' . $sqllib[$j]['sql'] . '">' . $sqllib[$j]['name'] . '</option>';
}
}
if ($og) echo '</optgroup>';
echo '</select></div></td>
<td><textarea rows="3" cols="40" name="sqlstring' . $i . '" id="sqlstring' . $i . '">SELECT * FROM</textarea></td>
<td><input class="Formbutton" style="width:80px;" type="submit" name="sqlnewupdate" value="save"></td></tr>';
}
echo '</table></form>';

Datei anzeigen

@ -1,364 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
// fuegt eine Sortierungsnummer hinzu, um die Ausgabereihenfolge der Daten steuern zu koennen
// (das Feld ENGINE interessiert mich nicht so sehr und muss nicht vorne stehen)
$keysort=array(
'Name' => 0,
'Rows' => 1,
'Data_length' => 2,
'Auto_increment' => 3,
'Avg_row_length' => 4,
'Max_data_length' => 5,
'Comment' => 6,
'Row_format' => 7,
'Index_length' => 8,
'Data_free' => 9,
'Collation' => 10,
'Create_time' => 11,
'Update_time' => 12,
'Check_time' => 13,
'Create_options' => 14,
'Version' => 15,
'Engine' => 16,
'Checksum' => 17
);
$byte_output=array(
'Data_length',
'Avg_row_length',
'Max_data_length',
'Index_length',
'Data_free'
);
function add_sortkey($name)
{
global $keysort;
//echo "<br>Uebergeben: ".$name;
if (array_key_exists($name,$keysort)) $ret=$keysort[$name];
else $ret=0;
return $ret;
}
//Data-View
echo $aus . '<h4>' . ( ( $showtables == 1 ) ? $lang['L_SQL_TABLEVIEW'] : $lang['L_SQL_DATAVIEW'] ) . '</h4><p>';
if ($showtables == 0)
{
$p='sql.php?sql_statement=' . urlencode($sql['sql_statement']) . '&amp;db=' . $db . '&amp;tablename=' . $tablename . '&amp;dbid=' . $dbid . '&amp;limitstart=' . $limitstart . '&amp;order=' . urlencode($order) . '&amp;orderdir=' . $orderdir . '&amp;tdc=' . $tdcompact;
echo '<a href="' . $p . '&amp;mode=new">' . $lang['L_SQL_RECORDNEW'] . '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
echo '<a href="sql.php?db=' . $databases['db_actual'] . '&amp;dbid=' . $dbid . '&amp;tablename=' . $tablename . '&amp;context=2">' . $lang['L_SQL_EDIT_TABLESTRUCTURE'] . '</a>';
}
else
{
$p='sql.php?db=' . $db . '&amp;dbid=' . $dbid . '&amp;context=2';
echo '<a href="' . $p . '">' . $lang['L_SQL_TABLENEW'] . '</a>';
}
//Statuszeile
$tn=ExtractTablenameFromSQL($sql['sql_statement']);
if ($databases['Name'][$dbid]!=$databases['db_actual'])
{
// Table is located in a different databasse
// switch the actual database
$databases['db_actual']=$databases['Name'][$dbid];
// refresh menu to switch to actual database
echo '<script type="text/javascript" language="javascript">'
.'parent.MySQL_Dumper_menu.location.href=\'menu.php?dbindex='.$dbid.'\';</script>';
}
echo '</p><p class="tablename">' . ( $tn != '' ? $lang['L_TABLE'] . ' <strong>`' . $databases['db_actual'] . '`.`' . $tn . '`</strong><br>' : '' );
if (isset($msg)) echo $msg;
$numrowsabs=-1;
$numrows=0;
// Vorgehensweise - es soll die Summe der Datensaetze ermittelt werden, wenn es kein LIMIT gibt,
// um die Blaettern-Links korrekt anzuzeigen
$skip_mysql_execution=false;
if ($sql_to_display_data == 0)
{
//mehrere SQL-Statements
$numrowsabs=$numrows=0;
MSD_DoSQL($sql['sql_statement']);
echo SQLOutput($out);
$skip_mysql_execution=true;
}
else
{
// auch alle Tabellen-Namen werden lowercase! -> das kann zu Problemen fuehren
// siehe https://dev.mysql.com/doc/refman/5.7/en/identifier-case-sensitivity.html
$sql_temp=strtolower($sql['sql_statement']);
if (substr($sql_temp,0,7) == 'select ')
{
if (false !== strpos($sql_temp,' limit '))
{
// es wurde ein eigenes Limit im Query angegeben - eigene Berechnung abbrechen
$numrowsabs=-1;
}
else
{
// anstatt sql_temp in lowerase hier das 'original' sql_statement verwenden
$sql_temp="SELECT count(*) as anzahl FROM (".$sql['sql_statement'].") as query;";
$res=@MSD_query($sql_temp,false);
if ($res)
{
if ($row=mysqli_fetch_object($res))
{
$numrowsabs=$row->anzahl;
}
}
else
{
// Query ergab Fehler - Anzahl unbekannt; -1 übernimmt dann die Groesse des Resultsets
$numrowsabs=-1;
}
}
}
}
$sqltmp=$sql['sql_statement'] . $sql['order_statement'] . ( strpos(strtolower($sql['sql_statement'] . $sql['order_statement']),' limit ') ? '' : $limit );
if (!$skip_mysql_execution) $res=MSD_query($sqltmp);
$numrows=@mysqli_num_rows($res);
if ($numrowsabs == -1) $numrowsabs=$numrows;
if ($limitende > $numrowsabs) $limitende=$numrowsabs;
if ($numrowsabs > 0 && $Anzahl_SQLs <= 1)
{
if ($showtables == 0)
{
$command_line=$lang['L_INFO_RECORDS'] . " " . ( $limitstart + 1 ) . " - ";
if ($limitstart + $limitende > $numrowsabs) $command_line.=$numrowsabs;
else $command_line.=$limitstart + $limitende;
$command_line.=" " . $lang['L_SQL_VONINS'] . " $numrowsabs &nbsp;&nbsp;&nbsp;";
$command_line.=( $limitstart > 0 ) ? '<a href="' . $params . '&amp;limitstart=0">&lt;&lt;</a>&nbsp;&nbsp;&nbsp;&nbsp;' : '&lt;&lt;&nbsp;&nbsp;&nbsp;&nbsp;';
$command_line.=( $limitstart > 0 ) ? '<a href="' . $params . '&amp;limitstart=' . ( ( $limitstart - $config['sql_limit'] < 0 ) ? 0 : $limitstart - $config['sql_limit'] ) . '">&lt;</a>&nbsp;&nbsp;&nbsp;&nbsp;' : '&lt;&nbsp;&nbsp;&nbsp;&nbsp;';
$command_line.=( $limitstart + $limitende < $numrowsabs ) ? '<a href="' . $params . '&amp;limitstart=' . ( $limitstart + $config['sql_limit'] ) . '">&gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;' : '&gt;&nbsp;&nbsp;&nbsp;&nbsp;';
$command_line.=( $limitstart + $limitende < ( $numrowsabs - $config['sql_limit'] ) ) ? '<a href="' . $params . '&amp;limitstart=' . ( $numrowsabs - $config['sql_limit'] ) . '">&gt;&gt;</a>' : '&gt;&gt;';
echo $command_line;
}
else
{
echo $numrowsabs.' '.($numrowsabs>1 ? $lang['L_TABLES']:$lang['L_TABLE']);
}
echo '</p>';
//Datentabelle
echo '<table class="bdr" id="dataTable">';
$t=$d="";
$fdesc=Array();
$key=-1;
if ($numrows > 0)
{
//Infos und Header holen
//1.Datensatz fuer Feldinfos
$row=mysqli_fetch_row($res);
//Kompaktmodus-Switcher
$t='<td colspan="' . ( count($row) + 1 ) . '" align="left"><a href="sql.php?db=' . $db . '&amp;tablename=' . $tablename . '&amp;dbid=' . $dbid . '&amp;order=' . urlencode($order) . '&amp;orderdir=' . $orderdir . '&amp;limitstart=' . $limitstart . '&amp;sql_statement=' . urlencode($sql['sql_statement']) . '&amp;tdc=' . ( ( $tdcompact == 0 ) ? '1' : '0' ) . '">' . ( ( $tdcompact == 1 ) ? $lang['L_SQL_VIEW_STANDARD'] : $lang['L_SQL_VIEW_COMPACT'] ) . '</a>';
$t.='&nbsp;&nbsp;&nbsp;' . $lang['L_SQL_QUERYENTRY'] . ' ' . count($row) . ' ' . $lang['L_SQL_COLUMNS'];
$t.='</td></tr><tr class="thead">';
$t.='<th>&nbsp;</th><th>#</th>';
$temp=array();
for ($x=0; $x < count($row); $x++)
{
$temp[$x]['data']=(((($___mysqli_tmp = mysqli_fetch_field_direct($res, $x)) && is_object($___mysqli_tmp)) ? ( (!is_null($___mysqli_tmp->primary_key = ($___mysqli_tmp->flags & MYSQLI_PRI_KEY_FLAG) ? 1 : 0)) && (!is_null($___mysqli_tmp->multiple_key = ($___mysqli_tmp->flags & MYSQLI_MULTIPLE_KEY_FLAG) ? 1 : 0)) && (!is_null($___mysqli_tmp->unique_key = ($___mysqli_tmp->flags & MYSQLI_UNIQUE_KEY_FLAG) ? 1 : 0)) && (!is_null($___mysqli_tmp->numeric = (int)(($___mysqli_tmp->type <= MYSQLI_TYPE_INT24) || ($___mysqli_tmp->type == MYSQLI_TYPE_YEAR) || ((defined("MYSQLI_TYPE_NEWDECIMAL")) ? ($___mysqli_tmp->type == MYSQLI_TYPE_NEWDECIMAL) : 0)))) && (!is_null($___mysqli_tmp->blob = (int)in_array($___mysqli_tmp->type, array(MYSQLI_TYPE_TINY_BLOB, MYSQLI_TYPE_BLOB, MYSQLI_TYPE_MEDIUM_BLOB, MYSQLI_TYPE_LONG_BLOB)))) && (!is_null($___mysqli_tmp->unsigned = ($___mysqli_tmp->flags & MYSQLI_UNSIGNED_FLAG) ? 1 : 0)) && (!is_null($___mysqli_tmp->zerofill = ($___mysqli_tmp->flags & MYSQLI_ZEROFILL_FLAG) ? 1 : 0)) && (!is_null($___mysqli_type = $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = (($___mysqli_type == MYSQLI_TYPE_STRING) || ($___mysqli_type == MYSQLI_TYPE_VAR_STRING)) ? "type" : "")) &&(!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && in_array($___mysqli_type, array(MYSQLI_TYPE_TINY, MYSQLI_TYPE_SHORT, MYSQLI_TYPE_LONG, MYSQLI_TYPE_LONGLONG, MYSQLI_TYPE_INT24))) ? "int" : $___mysqli_tmp->type)) &&(!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && in_array($___mysqli_type, array(MYSQLI_TYPE_FLOAT, MYSQLI_TYPE_DOUBLE, MYSQLI_TYPE_DECIMAL, ((defined("MYSQLI_TYPE_NEWDECIMAL")) ? constant("MYSQLI_TYPE_NEWDECIMAL") : -1)))) ? "real" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_TIMESTAMP) ? "timestamp" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_YEAR) ? "year" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && (($___mysqli_type == MYSQLI_TYPE_DATE) || ($___mysqli_type == MYSQLI_TYPE_NEWDATE))) ? "date " : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_TIME) ? "time" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_SET) ? "set" : $___mysqli_tmp->type)) &&(!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_ENUM) ? "enum" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_GEOMETRY) ? "geometry" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_DATETIME) ? "datetime" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && (in_array($___mysqli_type, array(MYSQLI_TYPE_TINY_BLOB, MYSQLI_TYPE_BLOB, MYSQLI_TYPE_MEDIUM_BLOB, MYSQLI_TYPE_LONG_BLOB)))) ? "blob" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type && $___mysqli_type == MYSQLI_TYPE_NULL) ? "null" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->type = ("" == $___mysqli_tmp->type) ? "unknown" : $___mysqli_tmp->type)) && (!is_null($___mysqli_tmp->not_null = ($___mysqli_tmp->flags & MYSQLI_NOT_NULL_FLAG) ? 1 : 0)) ) : false ) ? $___mysqli_tmp : false);
$temp[$x]['sort']=add_sortkey($temp[$x]['data']->name);
}
if ($showtables == 1) $temp=mu_sort($temp,'sort');
for ($x=0; $x < count($temp); $x++)
{
$str=$temp[$x]['data'];
$t.='<th align="left" nowrap="nowrap">';
$pic="";
$fdesc[$temp[$x]['data']->name]['name']=isset($str->name) ? $str->name : '';
$fdesc[$temp[$x]['data']->name]['table']=isset($str->table) ? $str->table : '';
$fdesc[$temp[$x]['data']->name]['max_length']=isset($str->max_length) ? $str->max_length : '';
$fdesc[$temp[$x]['data']->name]['not_null']=isset($str->not_null) ? $str->not_null : '';
$fdesc[$temp[$x]['data']->name]['primary_key']=isset($str->primary_key) ? $str->primary_key : '';
$fdesc[$temp[$x]['data']->name]['unique_key']=isset($str->unique_key) ? $str->unique_key : '';
$fdesc[$temp[$x]['data']->name]['multiple_key']=isset($str->multiple_key) ? $str->multiple_key : '';
$fdesc[$temp[$x]['data']->name]['numeric']=isset($str->numeric) ? $str->numeric : '';
$fdesc[$temp[$x]['data']->name]['blob']=isset($str->blob) ? $str->blob : '';
$fdesc[$temp[$x]['data']->name]['type']=isset($str->type) ? $str->type : '';
$fdesc[$temp[$x]['data']->name]['unsigned']=$str->unsigned;
$fdesc[$temp[$x]['data']->name]['zerofill']=$str->zerofill;
$fdesc[$temp[$x]['data']->name]['Check_time']=isset($str->Check_time) ? $str->Check_time : '';
$fdesc[$temp[$x]['data']->name]['Checksum']=isset($str->Checksum) ? $str->Checksum : '';
$fdesc[$temp[$x]['data']->name]['Engine']=isset($str->Engine) ? $str->Engine : '';
if (isset($str->Comment) && substr($str->Comment,0,4) == 'VIEW') $fdesc[$temp[$x]['data']->name]['Engine']='View';
$fdesc[$temp[$x]['data']->name]['Version']=isset($str->Version) ? $str->Version : '';
$tt=$lang['L_NAME'] . ': ' . $fdesc[$temp[$x]['data']->name]['name'] . ' Type: ' . $fdesc[$temp[$x]['data']->name]['type'] . " Max Length: " . $fdesc[$temp[$x]['data']->name]['max_length'] . " Unsigned: " . $fdesc[$temp[$x]['data']->name]['unsigned'] . " zerofill: " . $fdesc[$temp[$x]['data']->name]['zerofill'];
$pic='<img src="' . $icon['blank'] . '" alt="" width="1" height="1" border="0">';
if ($str->primary_key == 1 || $str->unique_key == 1)
{
if ($key == -1) $key=$temp[$x]['data']->name;
else $key.='|' . $temp[$x]['data']->name;
if ($str->primary_key == 1) $pic=$icon['key_primary'];
elseif ($str->unique_key == 1) $pic=$icon['index'];
}
// show sorting icon
$arname=( $orderdir == "ASC" ) ? $icon['arrow_down'] : $icon['arrow_up'];
if ($str->name == $order) $t.=$arname;
if ($bb == -1) $bb_link=( $str->type == "blob" ) ? '&nbsp;&nbsp;&nbsp;<a style="font-size:10px;color:blue;" title="use BB-Code for this field" href="sql.php?db=' . $db . '&amp;bb=' . $x . '&amp;tablename=' . $tablename . '&amp;dbid=' . $dbid . '&amp;order=' . $order . '&amp;orderdir=' . $orderdir . '&amp;limitstart=' . $limitstart . '&amp;sql_statement=' . urlencode($sql['sql_statement']) . '&amp;tdc=' . $tdcompact . '">[BB]</a>' : '';
else $bb_link=( $str->type == "blob" ) ? '&nbsp;&nbsp;&nbsp;<a title="use BB-Code for this field" href="sql.php?db=' . $db . '&amp;bb=-1&amp;tablename=' . $tablename . '&amp;dbid=' . $dbid . '&amp;order=' . urlencode($order) . '&amp;orderdir=' . $orderdir . '&amp;limitstart=' . $limitstart . '&amp;sql_statement=' . urlencode($sql['sql_statement']) . '&amp;tdc=' . $tdcompact . '">[no BB]</a>' : '';
if ($no_order == false && $showtables == 0) $t.=$pic . '&nbsp;<a title="' . $tt . '" href="sql.php?db=' . $db . '&amp;tablename=' . $tablename . '&amp;dbid=' . $dbid . '&amp;order=' . urlencode($str->name) . '&amp;orderdir=' . $norder . '&amp;sql_statement=' . urlencode($sql['sql_statement']) . '&amp;tdc=' . $tdcompact . '">' . $str->name . '</a>' . $bb_link;
else $t.=$pic . '&nbsp;<span title="' . $tt . '" >' . $str->name . '</span>' . $bb_link;
$t.='</th>';
}
unset($temp);
$temp=array();
//und jetzt Daten holen
mysqli_data_seek($res, 0);
$s=$keysort;
$s=array_flip($keysort);
ksort($s);
for ($i=0; $i < $numrows; $i++)
{
$data[0]=mysqli_fetch_array($res, MYSQLI_ASSOC);
if ($showtables == 1 && $tabellenansicht == 1)
{
// Spalten sortieren, wenn wir uns in einer Tabellenuebersicht befinden
$xx=mu_sort($data,"$s[0],$s[1],$s[2],$s[3],$s[4],$s[5],$s[6],$s[7],$s[8],$s[9],$s[10],$s[11],$s[12],$s[13],$s[14],$s[15],$s[16]");
$temp[$i]=$xx[0];
}
else
$temp[$i]=$data[0];
}
$rownr=$limitstart + 1;
for ($i=0; $i < $numrows; $i++)
{
$row=$temp[$i]; // mysql_fetch_row($res);
$cl=( $i % 2 ) ? 'dbrow' : 'dbrow1';
$erste_spalte=1;
// bei Tabellenuebersicht soll nach vorgefertigter Reihenfolge sortiert werden, ansonsten einfach Daten anzeigen
if ($showtables == 1) $sortkey=$keysort;
else $sortkey=$row;
$spalte=0;
// get primary key link for editing
if ($key > -1)
{
$primary_key='';
$keys=explode('|',$key);
foreach ($sortkey as $rowkey=>$rowval)
{
if (in_array($rowkey,$keys))
{
if (strlen($primary_key) > 0) $primary_key.=' AND ';
$primary_key.='`' . urlencode($rowkey) . '`=\'' . urlencode($rowval) . '\'';
}
}
//echo "<br><br>Primaerschluessel erkannt: ".$primary_key;
}
foreach ($sortkey as $rowkey=>$rowval)
{
if (( $rowkey == 'Name' ) && $tabellenansicht == 1 && isset($row['Name'])) $tablename=$row['Name'];
if ($erste_spalte == 1)
{
//edit-pics
$d.=$nl . '<td valign="top" nowrap="nowrap" class="small">&nbsp;' . $nl;
$p='sql.php?sql_statement=' . urlencode($sql['sql_statement']) . '&amp;db=' . $databases['db_actual'] . '&amp;tablename=' . $tablename . '&amp;dbid=' . $dbid . '&amp;limitstart=' . $limitstart . '&amp;order=' . urlencode($order) . '&amp;orderdir=' . $orderdir . '&amp;tdc=' . $tdcompact;
if ($key == -1)
{
$rk=build_where_from_record($temp[$i]);
$p.='&amp;recordkey=' . urlencode($rk);
}
else
{
//Key vorhanden
$p.='&amp;recordkey=' . urlencode($primary_key); //urlencode("`".$fdesc[$key]['name']."`='".$rowval."'");
}
if ($showtables == 1) $p.='&amp;recordkey=' . urlencode($tablename);
if (!isset($no_edit) || !$no_edit)
{
if ($showtables == 0)
{
$d.='<a href="' . $p . '&amp;mode=edit">' . $icon['edit'] . '</a>&nbsp;';
}
}
if ($showtables == 0 && $tabellenansicht == 0)
{
$d.='<a href="' . $p . '&amp;mode=kill" onclick="if(!confirm(\'' . $lang['L_ASKDELETERECORD'] . '\')) return false;">' . $icon['delete'] . '</a>';
}
else
{
if ($tabellenansicht == 1 && $showtables == 1)
{
$d.='<a href="sql.php?db=' . $db . '&amp;dbid=' . $dbid . '&amp;tablename=' . $tablename . '&amp;context=2">' . $icon['edit'] . '</a>&nbsp;' . $nl . $nl;
if (!( isset($row['Comment']) && ( substr(strtoupper($row['Comment']),0,4) == 'VIEW' ) ))
{
$d.='<a href="' . $p . '&amp;mode=empty" onclick="if(!confirm(\'' . sprintf($lang['L_ASKTABLEEMPTY'],$tablename) . '\')) return false;">' . $icon['table_truncate'] . '</a>&nbsp;' . $nl . $nl;
$d.='<a href="' . $p . '&amp;mode=emptyk" onclick="if(!confirm(\'' . sprintf($lang['L_ASKTABLEEMPTYKEYS'],$tablename) . '\')) return false;">' . $icon['table_truncate_reset'] . '</a>&nbsp;' . $nl . $nl;
$d.='<a href="' . $p . '&amp;mode=kill" onclick="if(!confirm(\'' . sprintf($lang['L_ASKDELETETABLE'],$tablename) . '\')) return false;">' . $icon['delete'] . '</a>&nbsp;' . $nl . $nl;
}
else
{
$d.='<a href="' . $p . '&amp;mode=kill_view" onclick="if(!confirm(\'' . sprintf($lang['L_ASKDELETETABLE'],$tablename) . '\')) return false;">' . $icon['delete'] . '</a>&nbsp;' . $nl . $nl;
}
}
}
$d.='</td><td valign="top" class="small" style="text-align:right">' . $rownr . '.&nbsp;</td>';
$rownr++;
$erste_spalte=0;
}
$d.='<td valign="top" class="small" nowrap="nowrap">';
$divstart='<div' . ( ( $tdcompact == 1 ) ? ' class="tdcompact" ' : ' class="tdnormal"' ) . '>';
$divend='</div>';
if ($bb == $spalte)
{
$data=convert_to_utf8(simple_bbcode_conversion($rowval));
}
else
{
if ($showtables == 0)
{
if (isset($fdesc[$rowkey]['type'])) $data=( $fdesc[$rowkey]['type'] == 'string' || $fdesc[$rowkey]['type'] == 'blob' ) ? convert_to_utf8($rowval) : $rowval;
}
else
{
if (isset($temp[$i][$rowkey])) $data=( $fdesc[$rowkey]['type'] == 'string' || $fdesc[$rowkey]['type'] == 'blob' ) ? convert_to_utf8($temp[$i][$rowkey]) : $temp[$i][$rowkey];
else $data='';
if (in_array($rowkey,$byte_output)) $data=byte_output($data);
}
}
//v($fdesc[$rowkey]);
if ($showtables==0)
{
if (is_null($rowval)) $data='<i>NULL</i>';
else $data=htmlspecialchars($data,ENT_COMPAT,'UTF-8');
}
$spalte++;
$browse_link='<a href="sql.php?db=' . $db . '&amp;tablename=' . $tablename . '&amp;dbid=' . $dbid . '" title="' . $data . '">';
$d.=( $tabellenansicht == 1 && $rowkey == 'Name' ) ? $divstart . $browse_link . $icon['browse'] . "</a>&nbsp;" . $browse_link . $data . "</a>$divend" : $divstart . $data . $divend;
$d.='</td>';
}
// Tabellenueberschrift en ausgeben
if ($i == 0) echo '<tr>' . $t . '</tr>';
// Daten anzeigen
echo "\n\n" . '<tr class="' . $cl . '">' . $d . '</tr>' . "\n\n";
$d="";
}
}
echo '</table>';
if ($showtables == 0) echo '<br>' . $command_line;
}
else
echo '<p class="success">' . $lang['L_SQL_NODATA'] . '</p>';

Datei anzeigen

@ -1,41 +0,0 @@
<?php
// insert a new record
$tpl=new MSDTemplate();
$tpl->set_filenames(array(
'show' => './tpl/sqlbrowser/sql_record_insert_inputmask.tpl'));
$sqledit="SHOW FIELDS FROM `$tablename`";
$res=MSD_query($sqledit);
$num=mysqli_num_rows($res);
$feldnamen="";
for ($x=0; $x<$num; $x++)
{
$row=mysqli_fetch_object($res);
$feldnamen.=$row->Field.'|';
$tpl->assign_block_vars('ROW',array(
'CLASS' => ($x%2) ? 1 : 2,
'FIELD_NAME' => $row->Field,
'FIELD_ID' => correct_post_index($row->Field)));
$type=strtoupper($row->Type);
if (strtoupper($row->Null)=='YES')
{
//field is nullable
$tpl->assign_block_vars('ROW.IS_NULLABLE',array());
}
if (in_array($type,array(
'BLOB',
'TEXT'))) $tpl->assign_block_vars('ROW.IS_TEXTAREA',array());
else
$tpl->assign_block_vars('ROW.IS_TEXTINPUT',array());
}
$tpl->assign_vars(array(
'HIDDEN_FIELDS' => FormHiddenParams(),
'FIELDNAMES' => substr($feldnamen,0,strlen($feldnamen)-1),
'SQL_STATEMENT' => my_quotes($sql['sql_statement'])));
$tpl->pparse('show');

Datei anzeigen

@ -1,50 +0,0 @@
<?php
// Edit record -> built Edit-Form
$tpl=new MSDTemplate();
$tpl->set_filenames(array(
'show' => './tpl/sqlbrowser/sql_record_update_inputmask.tpl'));
$target=($mode=="searchedit") ? '?mode=searchedit' : '?mode=update'; // jump back to search hit list after saving
$fields=getExtendedFieldInfo($db,$tablename);
$sqledit="SELECT * FROM `$tablename` WHERE ".$recordkey;
$res=MSD_query($sqledit);
$record=mysqli_fetch_array($res, MYSQLI_ASSOC); // get the record
$num=sizeof($record); // get the nr of fields of the record
// iterate fields
$x=0;
$fieldnames='';
foreach ($record as $field=>$fieldvalue)
{
$fieldnames.=$field.'|';
$tpl->assign_block_vars('ROW',array(
'CLASS' => ($x%2) ? 1 : 2,
'FIELD_NAME' => $field,
'FIELD_VALUE' => my_quotes($fieldvalue),
'FIELD_ID' => correct_post_index($field)));
if ('YES'==$fields[$field]['null'])
{
//field is nullable - precheck checkbox if value is null
$tpl->assign_block_vars('ROW.IS_NULLABLE',array(
'NULL_CHECKED' => is_null($fieldvalue) ? ' checked="checked"' : ''));
}
$type=strtoupper($fields[$field]['type']);
if (in_array($type,array(
'BLOB',
'TEXT'))) $tpl->assign_block_vars('ROW.IS_TEXTAREA',array());
else
$tpl->assign_block_vars('ROW.IS_TEXTINPUT',array());
$x++;
}
$tpl->assign_vars(array(
'HIDDEN_FIELDS' => FormHiddenParams(),
'FIELDNAMES' => substr($fieldnames,0,strlen($fieldnames)-1),
'SQL_STATEMENT' => my_quotes($sql['sql_statement']),
'RECORDKEY' => my_quotes($recordkey),
'TARGET' => $target));
$tpl->pparse('show');

Datei anzeigen

@ -1,595 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
//Tabellen
echo $aus.'<h6>'.$lang['L_SQL_TABLESOFDB'].' `'.$databases['Name'][$dbid].'` '.$lang['L_SQL_EDIT'].'</h6>';
//Primaerschluessel loeschen
if (isset($_GET['killPrimaryKey']))
{
$keys=getPrimaryKeys($databases['Name'][$dbid],$_GET['tablename']);
//Zu loeschenden Schluessel aus dem Array entfernen
$keyPos=array_search($_GET['killPrimaryKey'],$keys['name']);
if (!(false===$keyPos))
{
unset($keys['name'][$keyPos]);
unset($keys['size'][$keyPos]);
$keys['name']=array_values($keys['name']);
$keys['size']=array_values($keys['size']);
$res=setNewPrimaryKeys($databases['Name'][$dbid], $_GET['tablename'], $keys['name'], $keys['size']);
if ($res)
{
echo '<script language="JavaScript">
alert("'.$lang['L_PRIMARYKEY_DELETED'].': '.$_GET['killPrimaryKey'].'");
</script>';
}
else
{
echo '<script language="JavaScript">
alert("'.$lang['L_PRIMARYKEYS_CHANGINGERROR'].': '.$_GET['killPrimaryKey'].'");
</script>';
}
}
else
{
echo '<script language="JavaScript">
alert("'.$lang['L_PRIMARYKEY_NOTFOUND'].': '.$_GET['killPrimaryKey'].'");
</script>';
}
}
//Primärschlüssel löschen ende
//Neue Schlüssel setzen
if (isset($_POST['setNewKeys']))
{
$fields=getAllFields($databases['Name'][$dbid],$_GET['tablename']);
$newKeysArray=Array();
$newKeySizesArray=Array();
foreach ($fields as $index=>$field)
{
if ((isset($_POST["setNewKey".$index]))&&($_POST["setNewKey".$index]!=""))
{
$newKeysArray[]=$_POST["setNewKey".$index];
$newKeySizesArray[]=isset($_POST["indexSize".$index]) ? (int) $_POST["indexSize".$index]:'';
}
}
//doppelte Elemente entfernen
$newKeysArray=array_unique($newKeysArray);
$newKeySizesArray=array_intersect_key($newKeySizesArray, $newKeysArray);
if ($_POST["indexType"]=="primary")
{
$res=setNewPrimaryKeys($databases['Name'][$dbid], $_GET['tablename'], $newKeysArray, $newKeySizesArray);
if ($res)
{
echo '<script language="JavaScript">
alert("'.$lang['L_PRIMARYKEYS_CHANGED'].'");
</script>';
}
else
{
echo '<script language="JavaScript">
alert("'.$lang['L_PRIMARYKEYS_CHANGINGERROR'].'");
</script>';
}
}
else
{
if ($_POST["indexType"]=="unique")
{
$newIndexType="UNIQUE";
}
elseif ($_POST["indexType"]=="fulltext")
{
$newIndexType="FULLTEXT";
}
else
{
$newIndexType="INDEX";
}
$res=setNewKeys($databases['Name'][$dbid], $_GET['tablename'], $newKeysArray, $newIndexType, $_POST['indexName'], $newKeySizesArray);
if ($res)
{
echo '<script language="JavaScript">
alert("'.$lang['L_KEY_ADDED'].'");
</script>';
}
else
{
echo '<script language="JavaScript">
alert("'.$lang['L_KEY_ADDERROR'].'");
</script>';
}
}
}
//Andere Indizes löschen
if (isset($_GET['killIndex']))
{
$res = killKey($databases['Name'][$dbid], $_GET['tablename'], $_GET['killIndex']);
if ($res)
{
echo '<script language="JavaScript">
alert("'.$lang['L_KEY_DELETED'].': '.$_GET['killIndex'].'");
</script>';
}
else
{
echo '<script language="JavaScript">
alert("'.$lang['L_KEY_DELETEERROR'].': '.$_GET['killIndex'].'");
</script>';
}
}
if (isset($_GET['kill']))
{
if ($_GET['anz']==1) echo '<p class="error">'.$lang['L_SQL_NOFIELDDELETE'].'</p>';
else
{
$sql_alter="ALTER TABLE `".$databases['Name'][$dbid]."`.`".$_GET['tablename']."` DROP COLUMN `".$_GET['kill']."`";
$res = MSD_DoSQL($sql_alter);
if ($res)
{
echo '<div align="left" id="sqleditbox" style="font-size: 11px;width:90%;padding=6px;">';
echo '<p class="success">'.$lang['L_SQL_FIELDDELETE1'].' `'.$_GET['kill'].'` '.$lang['L_SQL_DELETED'].'.</p>'.highlight_sql($out).'</div>';
}
}
}
if (isset($_POST['tablecopysubmit']))
{
$table_edit_name=$_GET['tablename'];
if ($_POST['tablecopyname']=="")
{
echo '<p class="error">'.$lang['L_SQL_NODEST_COPY'].'</p>';
}
elseif (Table_Exists($databases['Name'][$dbid],$_POST['tablecopyname']))
{
echo '<p class="error">'.$lang['L_SQL_DESTTABLE_EXISTS'].'</p>';
}
else
{
Table_Copy("`".$databases['Name'][$dbid]."`.`".$table_edit_name."`",$_POST['tablecopyname'],$_POST['copyatt']);
echo '<div align="left" id="sqleditbox">';
echo ($_POST['copyatt']==0) ? '<p class="success">'.sprintf($lang['L_SQL_SCOPY'],$table_edit_name,$_POST['tablecopyname']).'</p>' : sprintf($lang['L_SQL_TCOPY'],$table_edit_name,$_POST['tablecopyname']).'</p>'; echo highlight_sql($out).'</div>';
$tablename=$_POST['tablecopyname'];
}
}
if (isset($_POST['newtablesubmit']))
{
if ($_POST['newtablename']=="")
{
echo '<p class="error">'.$lang['L_SQL_TABLENONAME'].'</p>';
}
else
{
$sql_alter="CREATE TABLE `".$databases['Name'][$dbid]."`.`".$_POST['newtablename']."` (`id` int(11) unsigned not null AUTO_INCREMENT PRIMARY KEY ) ".((MSD_NEW_VERSION) ? "ENGINE" : "TYPE")."=MyISAM;";
$res = MSD_DoSQL($sql_alter);
if ($res)
{
echo SQLOutput($out,$lang['L_TABLE'].' `'.$_POST['newtablename'].'` '.$lang['L_SQL_CREATED']);
}
}
}
if (isset($_POST['t_edit_submit']))
{
$sql_alter="ALTER TABLE `".$databases['Name'][$dbid]."`.`".$_POST['table_edit_name']."` ";
if ($_POST['t_edit_name']=="") echo '<p class="error">'.$lang['L_SQL_TBLNAMEEMPTY'].'</p>';
elseif (MSD_NEW_VERSION&&$_POST['t_edit_collate']!=""&&substr($_POST['t_edit_collate'],0,strlen($_POST['t_edit_charset']))!=$_POST['t_edit_charset']) echo '<p class="error">'.$lang['L_SQL_COLLATENOTMATCH'].'</p>';
else
{
if ($_POST['table_edit_name']!=$_POST['t_edit_name'])
{
$sql_alter.="RENAME TO `".$_POST['t_edit_name']."`, ";
$table_edit_name=$_POST['t_edit_name'];
}
else
$table_edit_name=$_POST['table_edit_name'];
if ($_POST['t_edit_engine']!="") $sql_alter.=((MSD_NEW_VERSION) ? "ENGINE=" : "TYPE=").$_POST['t_edit_engine'].", ";
if ($_POST['t_edit_rowformat']!="") $sql_alter.="ROW_FORMAT=".$_POST['t_edit_rowformat'].", ";
if (MSD_NEW_VERSION&&$_POST['t_edit_charset']!="") $sql_alter.="DEFAULT CHARSET=".$_POST['t_edit_charset'].", ";
if (MSD_NEW_VERSION&&$_POST['t_edit_collate']!="") $sql_alter.="COLLATE ".$_POST['t_edit_collate'].", ";
$sql_alter.="COMMENT='".$_POST['t_edit_comment']."' ";
$res = MSD_DoSQL($sql_alter);
if ($res)
{
echo SQLOutput($out,$lang['L_TABLE'].' `'.$_POST['table_edit_name'].'` '.$lang['L_SQL_CHANGED']);
}
}
}
else
{
if (!isset($table_edit_name)||$table_edit_name=="")
{
$table_edit_name=(isset($_GET['tablename'])) ? $_GET['tablename'] : "";
if (isset($_POST['tableselect'])) $table_edit_name=$_POST['tableselect'];
if (isset($_POST['newtablesubmit'])) $table_edit_name=$_POST['newtablename'];
}
}
if (isset($_POST['newfield_posted']))
{
//build sql for alter
if ($_POST['f_name']=='')
{
echo '<p class="error">'.$lang['L_SQL_FIELDNAMENOTVALID'].' ('.$_POST['f_name'].')</p>';
$field_fehler=1;
}
else
{
//alter Key
$oldkeys[0]=$_POST['f_primary'];
$oldkeys[1]=$_POST['f_unique'];
$oldkeys[2]=$_POST['f_index'];
$oldkeys[3]=$_POST['f_fulltext'];
//neuer Key
$newkeys[0]=($_POST['f_index_new']=="primary") ? 1 : 0;
$newkeys[1]=($_POST['f_index_new']=="unique") ? 1 : 0;
$newkeys[2]=($_POST['f_index_new']=="index") ? 1 : 0;
$newkeys[3]=(isset($_POST['f_indexfull'])) ? 1 : 0;
$add_sql.=ChangeKeys($oldkeys,$newkeys,$_POST['f_name'],$_POST['f_size'],"drop_only");
$sql_stamm="ALTER TABLE `".$databases['Name'][$dbid]."`.`$table_edit_name` ";
$sql_alter=$sql_stamm.((isset($_POST['editfield'])) ? "CHANGE COLUMN `".$_POST['fieldname']."` `".$_POST['f_name']."` " : "ADD COLUMN `".$_POST['f_name']."` ");
$sql_alter.=$_POST['f_type'];
$wl=stripslashes($_POST['f_size']);
if ($wl!=""&&!preg_match('@^(DATE|DATETIME|TIME|TINYBLOB|TINYTEXT|BLOB|TEXT|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT)$@i',$_POST['f_type']))
{
$sql_alter.="($wl) ";
}
elseif ($_POST['f_size']==""&&preg_match('@^(VARCHAR)$@i',$_POST['f_type']))
{
$sql_alter.="("."255".") ";
}
else
$sql_alter.=" ";
$sql_alter.=$_POST['f_attribut']." ";
$sql_alter.=$_POST['f_null']." ";
$sql_alter.=($_POST['f_default']!="") ? "DEFAULT '".addslashes($_POST['f_default'])."' " : "";
if (MSD_NEW_VERSION&&$_POST['f_collate']!="") $sql_alter.="COLLATE ".$_POST['f_collate']." ";
if ($_POST['f_extra']=="AUTO_INCREMENT")
{
$sql_alter.=" AUTO_INCREMENT ";
}
$sql_alter.=$_POST['f_position'];
if ($newkeys[0]==1) $sql_alter.=", ADD PRIMARY KEY (`".$_POST['f_name']."`)";
if ($newkeys[1]==1) $sql_alter.=", ADD UNIQUE (`".$_POST['f_name']."`)";
if ($newkeys[2]==1) $sql_alter.=", ADD INDEX (`".$_POST['f_name']."`)";
if ($newkeys[3]==1) $sql_alter.=", ADD FULLTEXT INDEX (`".$_POST['f_name']."`)";
$sql_alter.=";";
if ($add_sql!="")
{
$add_sql=$sql_stamm.$add_sql;
$sql_alter="$sql_alter\n$add_sql;";
}
$res = MSD_DoSQL($sql_alter);
if ($res)
{
echo '<div align="left" id="sqleditbox" style="font-size: 11px;width:90%;padding=6px;">';
echo '<p class="success"> `'.$_POST['f_name'].'` '.((isset($_POST['editfield'])) ? $lang['L_SQL_CHANGED'] : $lang['L_SQL_CREATED']).'</p>';
echo highlight_sql($out).'</div>';
}
$fields_infos=getFieldinfos($databases['Name'][$dbid],$table_edit_name);
}
}
mysqli_select_db($GLOBALS["___mysqli_ston"], $databases['Name'][$dbid]);
$sqlt="SHOW TABLE STATUS FROM `".$databases['Name'][$dbid]."` ;";
$res=MSD_query($sqlt);
$anz_tabellen=mysqli_num_rows($res);
$p="sql.php?db=".$databases['Name'][$dbid]."&amp;dbid=$dbid&amp;tablename=$table_edit_name&amp;context=2";
echo '<form action="sql.php?db='.$databases['Name'][$dbid].'&amp;dbid='.$dbid.'&amp;tablename='.$table_edit_name.'&amp;context=2" method="post">';
echo '<table class="bdr"><tr class="dbrow"><td>'.$lang['L_SQL_CREATETABLE'].': </td><td colspan="2"><input type="text" class="text" name="newtablename" size="30" maxlength="150"></td><td><input type="submit" name="newtablesubmit" value="'.$lang['L_SQL_CREATETABLE'].'" class="Formbutton"></td></tr>';
echo '<tr class="dbrow1"><td>'.$lang['L_SQL_COPYTABLE'].': </td><td><input type="text" class="text" name="tablecopyname" size="20" maxlength="150"></td><td><select name="copyatt"><option value="0">'.$lang['L_SQL_STRUCTUREONLY'].'</option>'.((MSD_NEW_VERSION) ? '<option value="1">'.$lang['L_SQL_STRUCTUREDATA'].'</option>' : '').'</select></td><td><input type="submit" class="Formbutton" name="tablecopysubmit" value="'.$lang['L_SQL_COPYTABLE'].'" '.(($table_edit_name=="") ? "disabled=\"disabled\"" : "").'></td></tr>';
if ($anz_tabellen==0)
{
echo '<tr><td>'.$lang['L_SQL_NOTABLESINDB'].' `'.$databases['Name'][$dbid].'`</td></tr>';
}
else
{
echo '<tr><td>'.$lang['L_SQL_SELECTTABLE'].':&nbsp;&nbsp;&nbsp;</td>';
echo '<td colspan="2"><select name="tableselect" onchange="this.form.submit()"><option value="1" SELECTED></option>';
for ($i=0; $i<$anz_tabellen; $i++)
{
$row=mysqli_fetch_array($res);
echo '<option value="'.$row['Name'].'">'.$row['Name'].'</option>';
}
echo '</select>&nbsp;&nbsp;</td>';
echo '<td><input type="button" class="Formbutton" value="'.$lang['L_SQL_SHOWDATATABLE'].'" onclick="location.href=\'sql.php?db='.$databases['Name'][$dbid].'&amp;dbid='.$dbid.'&amp;tablename='.$tablename.'\'"></td></tr>';
}
echo '</table></form><p>&nbsp;</p>';
if ($table_edit_name!="")
{
$sqlf="SHOW FULL FIELDS FROM `".$databases['Name'][$dbid]."`.`$table_edit_name` ;";
$res=MSD_query($sqlf);
$anz_fields=mysqli_num_rows($res);
$fields_infos=getFieldinfos($databases['Name'][$dbid],$table_edit_name);
if (MSD_NEW_VERSION) $t_engine=(isset($fields_infos['_tableinfo_']['ENGINE'])) ? $fields_infos['_tableinfo_']['ENGINE'] : "MyISAM";
else
$t_engine=(isset($fields_infos['_tableinfo_']['TYPE'])) ? $fields_infos['_tableinfo_']['TYPE'] : "MyISAM";
$t_charset=(isset($fields_infos['_tableinfo_']['DEFAULT CHARSET'])) ? $fields_infos['_tableinfo_']['DEFAULT CHARSET'] : "";
$t_collation=isset($row['Collation']) ? $row['Collation'] : ""; //(isset($fields_infos['_tableinfo_']['COLLATE'])) ? $fields_infos['_tableinfo_']['COLLATE'] : "";
$t_comment=(isset($fields_infos['_tableinfo_']['COMMENT'])) ? substr($fields_infos['_tableinfo_']['COMMENT'],1,strlen($fields_infos['_tableinfo_']['COMMENT'])-2) : "";
$t_rowformat=(isset($fields_infos['_tableinfo_']['ROW_FORMAT'])) ? $fields_infos['_tableinfo_']['ROW_FORMAT'] : "";
echo "<h6>".$lang['L_TABLE']." `$table_edit_name`</h6>";
$td='<td valign="top" nowrap="nowrap" class="small">';
//Tabelleneigenschaften
echo '<form action="'.$p.'" method="post"><input type="hidden" name="table_edit_name" value="'.$table_edit_name.'"><table class="bdr">';
echo '<tr class="sqlNew"><td colspan="4" style="font-size:10pt;font-weight:bold;">'.$lang['L_SQL_TBLPROPSOF'].' `'.$table_edit_name.'` ('.$anz_fields.' '.$lang['L_FIELDS'].')</td>';
echo '<td class="small" colspan="2" align="center">Name<br><input type="text" class="text" name="t_edit_name" value="'.$table_edit_name.'" size="30" maxlength="150" style="font-size:11px;"></td></tr>';
echo '<tr class="sqlNew">';
echo '<td class="small" align="center">Engine<br><select name="t_edit_engine" style="font-size:11px;">'.EngineCombo($t_engine).'</select></td>';
echo '<td class="small" align="center">Row Format<br><select name="t_edit_rowformat" style="font-size:11px;">'.GetOptionsCombo($feldrowformat,$t_rowformat).'</select></td>';
echo '<td class="small" align="center">'.$lang['L_CHARSET'].'<br><select name="t_edit_charset" style="font-size:11px;">'.CharsetCombo($t_charset).'</select></td>';
echo '<td class="small" align="center">'.$lang['L_COLLATION'].'<br><select name="t_edit_collate" style="font-size:11px;">'.CollationCombo($t_collation).'</select></td>';
echo '<td class="small" align="center">'.$lang['L_COMMENT'].'<br><input type="text" class="text" name="t_edit_comment" value="'.$t_comment.'" size="30" maxlength="100" style="font-size:11px;"></td>';
echo '<td class="small" align="center">&nbsp;<br><input type="submit" name="t_edit_submit" value="'.$lang['L_CHANGE'].'" class="Formbutton"></td></tr>';
echo '</table></form><p>&nbsp;</p>';
$field_fehler=0;
echo '<h6>'.$lang['L_FIELDS_OF_TABLE'].' `'.$table_edit_name.'`</h6>';
$d_collate='';
$d_comment='';
if (isset($_GET['newfield'])||isset($_GET['editfield'])||$field_fehler>0||isset($_POST['newfield_posted']))
{
if (isset($_GET['editfield'])) $id=$_GET['editfield'];
$d_name=(isset($_GET['editfield'])) ? $fields_infos[$id]['name'] : "";
$d_type=(isset($_GET['editfield'])) ? $fields_infos[$id]['type'] : "";
$d_size=(isset($_GET['editfield'])) ? $fields_infos[$id]['size'] : "";
$d_null=(isset($_GET['editfield'])) ? $fields_infos[$id]['null'] : "";
$d_attribute=(isset($_GET['editfield'])) ? $fields_infos[$id]['attributes'] : "";
$d_default='';
if (isset($id)&&isset($fields_infos[$id])&&isset($fields_infos[$id]['default']))
{
if ($fields_infos[$id]['default']=='NULL') $d_default='NULL';
else
$d_default=substr($fields_infos[$id]['default'],1,strlen($fields_infos[$id]['default'])-2);
}
$d_extra=(isset($_GET['editfield'])) ? $fields_infos[$id]['extra'] : "";
$d_primary=$d_unique=$d_index=$d_fulltext=0;
if (isset($id))
{
if (isset($fields_infos[$id]['collate'])) $d_collate=(isset($_GET['editfield'])) ? $fields_infos[$id]['collate'] : "";
if (isset($fields_infos[$id]['comment'])) $d_comment=(isset($_GET['editfield'])) ? $fields_infos[$id]['comment'] : "";
}
$d_privileges=(isset($_GET['editfield'])) ? $fields_infos[$id]['privileges'] : "";
if (isset($_GET['editfield']))
{
$d_primary=(in_array($fields_infos[$id]['name'],$fields_infos['_primarykeys_'])) ? 1 : 0;
$d_index=(in_array($fields_infos[$id]['name'],$fields_infos['_key_'])) ? 1 : 0;
$d_fulltext=(in_array($fields_infos[$id]['name'],$fields_infos['_fulltextkey_'])) ? 1 : 0;
$d_unique=(in_array($fields_infos[$id]['name'],$fields_infos['_uniquekey_'])) ? 1 : 0;
}
echo '<form action="'.$p.'" method="post" id="smallform"><input type="hidden" name="newfield_posted" value="1">';
if (isset($_GET['editfield'])) echo '<input type="hidden" name="editfield" value="'.$id.'"><input type="hidden" name="fieldname" value="'.$d_name.'">';
if (isset($_POST['newtablesubmit'])) echo '<input type="hidden" name="newtablename" value="'.$_POST['newtablename'].'">';
echo '<input type="hidden" name="f_primary" value="'.$d_primary.'"><input type="hidden" name="f_unique" value="'.$d_unique.'">';
echo '<input type="hidden" name="f_index" value="'.$d_index.'"><input type="hidden" name="f_fulltext" value="'.$d_fulltext.'">';
echo '<table class="bdr"><tr class="thead"><th colspan="6" align="center">'.((isset($_GET['editfield'])) ? $lang['L_SQL_EDITFIELD']." `".$d_name."`" : $lang['L_SQL_NEWFIELD']).'</th></tr>';
echo '<tr><td class="small">Name<br><input type="text" class="text" value="'.$d_name.'" name="f_name" size="30"></td>';
echo '<td>Type<br><select name="f_type">'.GetOptionsCombo($feldtypen,$d_type).'</select></td>';
echo '<td>Size&nbsp;<br><input type="text" class="text" value="'.$d_size.'" name="f_size" size="3" maxlength="80"></td>';
echo '<td>NULL<br><select name="f_null">'.GetOptionsCombo($feldnulls,$d_null).'</select></td>';
echo '<td align="center">Default<br><input type="text" class="text" name="f_default" value="'.$d_default.'" size="10"></td>';
echo '<td align="center">Extra<br><select name="f_extra">'.GetOptionsCombo($feldextras,$d_extra).'</select></td>';
echo '</tr><tr><td align="center">'.$lang['L_SQL_INDEXES'].'<br>';
echo '<input type="radio" class="radio" name="f_index_new" id="k_no_index" value="no" '.(($d_primary+$d_unique+$d_index+$d_fulltext==0) ? 'checked="checked"' : '').'>';
echo '<label for="k_no_index">'.$icon['key_nokey'].'</label>&nbsp;&nbsp;';
echo '<input type="radio" class="radio" name="f_index_new" id="k_primary" value="primary" '.(($d_primary==1) ? "checked" : "").'>';
echo '<label for="k_primary">'.$icon['key_primary'].'</label>&nbsp;&nbsp;';
echo '<input type="radio" class="radio" name="f_index_new" id="k_unique" value="unique" '.(($d_unique==1) ? "checked" : "").'>';
echo '<label for="k_unique">'.$icon['key_unique'].'</label>&nbsp;&nbsp;';
echo '<input type="radio" class="radio" name="f_index_new" id="k_index" value="index" '.(($d_index==1) ? "checked" : "").'>&nbsp;';
echo '<label for="k_index">'.$icon['index'].'</label>&nbsp;&nbsp;';
echo '<input type="checkbox" class="checkbox" name="f_indexfull" id="k_fulltext" value="1" '.(($d_fulltext==1) ? "checked" : "").'>';
echo '<label for="k_fulltext">'.$icon['key_fulltext'].'</label>&nbsp;&nbsp;</td>';
echo '<td align="center" colspan="2" >'.$lang['L_COLLATION'].'<br><select name="f_collate">'.CollationCombo($d_collate).'</select></td>';
echo '<td align="center">'.$lang['L_SQL_ATTRIBUTES'].'<br><select name="f_attribut">'.AttributeCombo($d_attribute).'</select></td>';
echo '<td align="center">'.$lang['L_SQL_ATPOSITION'].':<br><select name="f_position"><option value=""></option><option value="FIRST">'.$lang['L_SQL_FIRST'].'</option>';
if ($anz_fields>0)
{
for ($i=0; $i<$anz_fields; $i++)
{
echo '<option value="AFTER `'.$fields_infos[$i]['name'].'`">'.$lang['L_SQL_AFTER'].' `'.$fields_infos[$i]['name'].'`</option>';
}
}
echo '</select></td><td align="center"><br><input type="submit" name="newfieldsubmit" value="'.((isset($_GET['editfield'])) ? $lang['L_SQL_CHANGEFIELD'] : $lang['L_SQL_INSERTFIELD']).'" class="Formbutton"></td></tr></table></form><p>&nbsp;</p>';
}
else
echo '<a style="font-size:8pt;padding-bottom:8px;" href="'.$p.'&amp;newfield=1">'.$lang['L_SQL_INSERTNEWFIELD'].'</a><br><br>';
//Felder ausgeben
echo '<table class="bdr">';
for ($i=0; $i<$anz_fields; $i++)
{
$cl=($i%2) ? "dbrow" : "dbrow1";
if ($i==0) echo '<tr class="thead"><th colspan="2">&nbsp;</th><th>Field</th><th>Type</th><th>Size</th><th>NULL</th><th>Key</th><th>Attribute</th><th>Default</th><th>Extra</th><th>'.
$lang['L_COLLATION'].'</th><th>'.$lang['L_COMMENT'].'</th></tr>';
echo '<tr class="'.$cl.'">';
echo '<td nowrap="nowrap">';
echo '<a href="'.$p.'&amp;editfield='.$i.'"><img src="'.$config['files']['iconpath'].'edit.gif" title="edit field" alt="edit field" border="0"></a>&nbsp;&nbsp;';
echo '<a href="'.$p.'&amp;kill='.$fields_infos[$i]['name'].'&amp;anz='.$anz_fields.'" onclick="if(!confirm(\''.$lang['L_ASKDELETEFIELD'].'\')) return false;"><img src="'.$config['files']['iconpath'].'delete.gif" alt="delete field" border="0"></a>&nbsp;&nbsp;';
echo '</td>';
echo '<td style="text-align:right">'.($i+1).'.</td>';
echo '<td><strong>'.$fields_infos[$i]['name'].'</strong></td><td>'.$fields_infos[$i]['type'].'</td><td>'.$fields_infos[$i]['size'].'</td>';
echo '<td>'.get_output_attribut_null($fields_infos[$i]['null']).'</td><td>';
//key
if (in_array($fields_infos[$i]['name'],$fields_infos['_primarykeys_'])) echo $icon['key_primary'];
if (in_array($fields_infos[$i]['name'],$fields_infos['_fulltextkey_'])) echo $icon['key_fulltext'];
if (in_array($fields_infos[$i]['name'],$fields_infos['_uniquekey_'])) echo $icon['key_unique'];
if (in_array($fields_infos[$i]['name'],$fields_infos['_key_'])) echo $icon['index'];
echo '</td><td>'.$fields_infos[$i]['attributes'].'</td>';
echo '<td>'.$fields_infos[$i]['default'].'</td>'.$td.$fields_infos[$i]['extra'].'</td>';
echo '<td>'.((MSD_NEW_VERSION) ? $fields_infos[$i]['collate'] : "&nbsp;").'</td>';
echo '<td>'.((isset($fields_infos[$i]['comment'])) ? $fields_infos[$i]['comment'] : "&nbsp;").'</td>';
echo "</tr>";
}
echo '</table><br>';
echo '<h6>'.$lang['L_SQL_TABLEINDEXES'].' `'.$table_edit_name.'`</h6>';
echo '<table class="bdr">
<tr class="thead">
<th colspan="2">&nbsp;</th>
<th>'.$lang['L_NAME'].'</th>
<th>'.$lang['L_SQL_COLUMNS'].'</th>
<th>'.$lang['L_INFO_SIZE'].'</th>
'.((MSD_NEW_VERSION) ? '<th>'.$lang['L_TABLE_TYPE'].'</th>' : '').'
<th>'.$lang['L_SQL_ALLOWDUPS'].'</th>
<th>'.$lang['L_SQL_CARDINALITY'].'</th>
<th>'.$lang['L_COMMENT'].'</th>
</tr>';
$sqlk="SHOW KEYS FROM `".$databases['Name'][$dbid]."`.`$table_edit_name`;";
$res=MSD_query($sqlk);
$num=mysqli_num_rows($res);
if ($num==0)
{
echo '<tr><td colspan="6">'.$lang['L_SQL_TABLENOINDEXES'].'</td></tr>';
}
else
{
for ($i=0; $i<$num; $i++)
{
$row=mysqli_fetch_array($res, MYSQLI_ASSOC);
if (!isset($row['Comment'])) {
$row['Comment'] = '';
}
$cl=($i%2) ? "dbrow" : "dbrow1";
//Images
echo '<tr class="'.$cl.'">';
echo '<td>';
if ($row['Key_name']=="PRIMARY")
{
echo '<a href="'.$p.'&amp;killPrimaryKey='.$row['Column_name'].'" onclick="if(!confirm(\''.$lang['L_PRIMARYKEY_CONFIRMDELETE'].'\')) return false;">';
echo '<img src="'.$config['files']['iconpath'].'delete.gif" alt="" border="0">';
echo '</a>';
}
else
{
echo '<a href="'.$p.'&amp;killIndex='.$row['Key_name'].'" onclick="if(!confirm(\''.$lang['L_KEY_CONFIRMDELETE'].'\')) return false;">';
echo '<img src="'.$config['files']['iconpath'].'delete.gif" alt="" border="0">';
echo '</a>';
}
echo '</td>';
echo '<td style="text-align:right">'.($i+1).'.</td>';
echo '<td>'.$row['Key_name'].'</td>';
echo '<td>'.$row['Column_name'].'</td>';
echo '<td class="right">';
if (isset($row['Sub_part']) && $row['Sub_part']>0) echo $row['Sub_part'];
echo '</td>';
if (MSD_NEW_VERSION) echo '<td>'.$row['Index_type'].'</td>';
echo '<td align="center">'.(($row['Non_unique']==1) ? $lang['L_YES'] : $lang['L_NO']).'</td>';
echo '<td>'.(($row['Cardinality']>=0) ? $row['Cardinality'] : $lang['L_NO']).'</td>';
echo '<td>'.$row['Comment'].'</td>';
echo '</tr>';
}
}
echo '</table><br><input type="Button" value="'.$lang['L_SQL_CREATEINDEX'].'" onclick="location.href=\''.$p.'&amp;sql_createindex=1#setnewkeys\'" class="Formbutton">';
if ((isset($_GET['sql_createindex']))&&($_GET['sql_createindex']=="1"))
{ ?>
<script type="text/javascript">
function toggleIndexLength(id)
{
var mysqlStrings = ['<?php echo implode("','", $mysql_string_types);?>'];
var field = 'setNewKey'+id;
var sel = document.getElementById(field).selectedIndex;
var val = document.getElementById(field).options[sel].innerHTML;
document.getElementById('indexSize'+id).disabled = true;
for (i=0;i<mysqlStrings.length;i++)
{
if (val.indexOf("["+mysqlStrings[i]) != -1)
{
document.getElementById('indexSize'+id).disabled = false;
}
}
}
</script>
<?php
echo '<br><a name="setnewkeys"></a>';
echo '<form action="'.$p.'" method="POST">';
echo '<h6>'.$lang['L_SETKEYSFOR'].' `'.$table_edit_name.'`</h6>';
//kopf
echo '<table class="bdr">';
//body
$sqlFelder="DESCRIBE `".$databases['Name'][$dbid]."`.`".$_GET['tablename']."`;";
$res=MSD_query($sqlFelder);
$num=mysqli_num_rows($res);
if ($num==0)
{
echo '<tr><td>'.$lang['L_SQL_TABLENOINDEXES'].'</td></tr>';
}
else
{
echo '<tr class="thead"><th>'.$lang['L_NAME'].'</th><th>'.$lang['L_TABLE_TYPE'].'</th></tr>';
echo '<tr>';
echo '<td><input type="text" name="indexName" value="" class="text">';
echo '<td><select name="indexType"><option value="primary">'.$lang['L_TITLE_KEY_PRIMARY'].'</option><option value="unique">'.$lang['L_TITLE_KEY_UNIQUE'].'</option><option value="index" selected="selected">'.$lang['L_TITLE_INDEX'].'</option><option value="fulltext">'.$lang['L_TITLE_KEY_FULLTEXT'].'</option></select></td>';
echo '</tr>';
echo '</table><br>';
//alle Felder holen
$feldArray=Array();
echo '<table class="bdr">';
echo '<tr class="thead"><th>#</th><th>'.$lang['L_PRIMARYKEY_FIELD'].'</th><th>'.$lang['L_INFO_SIZE'].'</th>';
while ($row=mysqli_fetch_array($res, MYSQLI_ASSOC))
{
$feldArray[$row['Field']]=$row['Type'];
}
//Primaerschluessel holen, um automatisch vorzuselektieren
$primaryKeys=getPrimaryKeys($databases['Name'][$dbid],$_GET['tablename']);
//eine Select-Box pro Feld anzeigen, Felder für Name und Typ nur in der ersten Zeile
for ($i=0; $i<$num; $i++)
{
echo '<tr><td class="right">'.($i+1).'.</td><td>';
$options ="\n\n".'<option value="">---</option>';
$selectedFeldTyp = false;
foreach ($feldArray as $feldName=>$feldTyp)
{
$options.="\n".'<option value="'.$feldName.'"';
//alle Primaerschluessel vorselektieren
if (isset($primaryKeys['name'][$i]) && $primaryKeys['name'][$i]==$feldName) {
$options.=' selected="selected"';
$selectedFeldTyp = $feldTyp;
}
$options.='>'.$feldName.' ['.$feldTyp.']</option>';
}
echo '<select id="setNewKey'.$i.'" name="setNewKey'.$i.'" onchange="toggleIndexLength('.$i.');">';
echo $options."\n".'</select></td>';
echo '<td>';
$type =explode('(', $selectedFeldTyp);
echo '<input type="text" id="indexSize'.$i.'" name="indexSize'.$i.'" value="" size="10" class="text"';
if (!isset($type[0]) || !in_array($type[0], $mysql_string_types)) echo ' disabled="disabled"';
echo '></td>';
echo '</tr>';
}
$i ++;
}
echo '</table>';
//Speichern Knopf
echo '<br><input name="setNewKeys" type="submit" value="'.$lang['L_SAVE'].'" class="Formbutton">';
echo '</form>';
}
}

Datei anzeigen

@ -1,67 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
//Start SQL-Box
$tpl=new MSDTemplate();
$tpl->set_filenames(array(
'show' => $config['paths']['root'].'./tpl/sqlbrowser/sqlbox.tpl'));
if (isset($_GET['readfile'])&&$_GET['readfile']==1)
{
$tpl->assign_block_vars('SQLUPLOAD',array(
'POSTTARGET' => $params,
'LANG_OPENSQLFILE' => $lang['L_SQL_OPENFILE'],
'LANG_OPENSQLFILE_BUTTON' => $lang['L_SQL_OPENFILE_BUTTON'],
'LANG_SQL_MAXSIZE' => $lang['L_MAX_UPLOAD_SIZE'],
'MAX_FILESIZE' => $config['upload_max_filesize']));
}
if (isset($_POST['submit_openfile']))
{
//open file
if (!isset($_FILES['upfile']['name'])||empty($_FILES['upfile']['name'])) $aus.='<span class="error">'.$lang['L_FM_UPLOADFILEREQUEST'].'</span>';
else
{
$fn=$_FILES['upfile']['tmp_name'];
if (strtolower(substr($_FILES['upfile']['name'],-3))==".gz") $read__user_sqlfile=gzfile($fn);
else
$read__user_sqlfile=file($fn);
$aus.='<span>geladenes File: <strong>'.$_FILES['upfile']['name'].'</strong>&nbsp;&nbsp;&nbsp;'.byte_output(filesize($_FILES['upfile']['tmp_name'])).'</span>';
$sql_loaded=implode("",$read__user_sqlfile);
}
}
// Sind SQL-Befehle in der SQLLib vorhanden?
$sqlcombo=SQL_ComboBox();
if ($sqlcombo>'') $tpl->assign_block_vars('SQLCOMBO',array(
'SQL_COMBOBOX' => $sqlcombo));
$tpl->assign_vars(array(
'LANG_SQL_WARNING' => $lang['L_SQL_WARNING'],
'ICONPATH' => $config['files']['iconpath'],
'MYSQL_REF' => $mysql_help_ref,
'BOXSIZE' => $config['interface_sqlboxsize'],
'BOXCONTENT' => ((isset($sql_loaded)) ? $sql_loaded : $sql['sql_statement'].$sql['order_statement']),
'LANG_SQL_BEFEHLE' => $lang['L_SQL_BEFEHLE'],
'TABLE_COMBOBOX' => Table_ComboBox(),
'LANG_SQL_EXEC' => $lang['L_SQL_EXEC'],
'LANG_RESET' => $lang['L_RESET'],
'PARAMS' => $params,
'DB' => $databases['Name'][$dbid],
'DBID' => $dbid,
'TABLENAME' => $tablename,
'ICON_SEARCH' => $icon['search'],
'ICON_UPLOAD' => $icon['upload'],
'ICON_MYSQL_HELP' => $icon['mysql_help'],
'MYSQL_HELP' => $lang['L_TITLE_MYSQL_HELP'],
'DBID' => $databases['db_selected_index'],
'LANG_TOOLBOX' => $lang['L_TOOLS_TOOLBOX'],
'LANG_TOOLS' => $lang['L_TOOLS'],
'LANG_DB' => $lang['L_DB'],
'LANG_TABLE' => $lang['L_TABLE'],
'LANG_SQL_TABLEVIEW' => $lang['L_SQL_TABLEVIEW'],
'LANG_BACK_TO_DB_OVERVIEW' => $lang['L_SQL_BACKDBOVERVIEW']));
if ($tablename>'') $tpl->assign_block_vars('TABLE_SELECTED',array());
$tpl->pparse('show');

Datei anzeigen

@ -1,172 +0,0 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
include ( './language/' . $config['language'] . '/lang.php' );
include ( './language/' . $config['language'] . '/lang_dump.php' );
include ( './inc/template.php' );
$tblr=( $tblfrage_refer == 'dump' ) ? 'Backup' : 'Restore';
$filename=( isset($_GET['filename']) ) ? $_GET['filename'] : '';
if (isset($_POST['file'][0])) $filename=$_POST['file'][0];
ob_start();
$tpl=new MSDTemplate();
$sel_dump_encoding=isset($_POST['sel_dump_encoding']) ? $_POST['sel_dump_encoding'] : '';
$tpl=new MSDtemplate();
//Informationen zusammenstellen
if ($tblr == 'Backup')
{
$tpl->set_filenames(array(
'show' => './tpl/dump_select_tables.tpl'
));
$button_name='dump_tbl';
//Info aus der Datenbank lesen
MSD_mysql_connect();
$res=mysqli_query($GLOBALS["___mysqli_ston"], 'SHOW TABLE STATUS FROM `' . $databases['db_actual'] . '`');
$numrows=mysqli_num_rows($res);
$tbl_zeile='';
for ($i=0; $i < $numrows; $i++)
{
$row=mysqli_fetch_array($res, MYSQLI_ASSOC);
//v($row);
// 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['db_actual'] . "`.`" . $row['Name'] . "`";
$res2=@mysqli_query($GLOBALS["___mysqli_ston"], $sql_2);
if ($res2 === false)
{
$read_error='(' . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_errno($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false)) . ') ' . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
$row['Rows']='<span class="error">' . $lang['L_ERROR'] . ': ' . $read_error . '</span>';
}
else
{
$row2=@mysqli_fetch_array($res2);
$row['Rows']=$row2['count_records'];
}
$klasse=( $i % 2 ) ? 1 : '';
$table_size=$row['Data_length'] + $row['Index_length'];
$table_type=$row['Engine'];
if (substr($row['Comment'],0,4) == 'VIEW')
{
$table_type='View';
$table_size='-';
}
$tpl->assign_block_vars('ROW',array(
'CLASS' => 'dbrow' . $klasse,
'ID' => $i,
'NR' => $i + 1,
'TABLENAME' => $row['Name'],
'TABLETYPE' => $table_type,
'RECORDS' => $table_type == 'View' ? '<i>' . $row['Rows'] . '</i>' : '<strong>' . $row['Rows'] . '</strong>',
'SIZE' => is_int($table_size) ? byte_output($table_size) : $table_size,
'LAST_UPDATE' => $row['Update_time']
));
}
}
else
{
$tpl->set_filenames(array(
'show' => './tpl/restore_select_tables.tpl'
));
//Restore - Header aus Backupfile lesen
$button_name='restore_tbl';
$gz=( substr($filename,-3) ) == '.gz' ? 1 : 0;
if ($gz)
{
$fp=gzopen($fpath . $filename,"r");
$statusline=gzgets($fp,40960);
$offset=gztell($fp);
}
else
{
$fp=fopen($fpath . $filename,"r");
$statusline=fgets($fp,5000);
$offset=ftell($fp);
}
//Header auslesen
$sline=ReadStatusline($statusline);
$anzahl_tabellen=$sline['tables'];
$anzahl_eintraege=$sline['records'];
$tbl_zeile='';
$part=( $sline['part'] == '' ) ? 0 : substr($sline['part'],3);
if ($anzahl_eintraege == -1)
{
// not a backup of MySQLDumper
$tpl->assign_block_vars('NO_MSD_BACKUP',array());
}
else
{
$tabledata=array();
$i=0;
//Tabellenfinos lesen
gzseek($fp,$offset);
$eof=false;
WHILE (!$eof)
{
$line=$gz ? gzgets($fp,40960) : fgets($fp,40960);
if (substr($line,0,9) == '-- TABLE|')
{
$d=explode('|',$line);
$tabledata[$i]['name']=$d[1];
$tabledata[$i]['records']=$d[2];
$tabledata[$i]['size']=$d[3];
$tabledata[$i]['update']=$d[4];
$tabledata[$i]['engine']=isset($d[5]) ? $d[5] : '';
$i++;
}
if (substr($line,0,6) == '-- EOF') $eof=true;
if (substr(strtolower($line),0,6) == 'create') $eof=true;
}
for ($i=0; $i < sizeof($tabledata); $i++)
{
$klasse=( $i % 2 ) ? 1 : '';
$tpl->assign_block_vars('ROW',array(
'CLASS' => 'dbrow' . $klasse,
'ID' => $i,
'NR' => $i + 1,
'TABLENAME' => $tabledata[$i]['name'],
'RECORDS' => $tabledata[$i]['records'],
'SIZE' => byte_output($tabledata[$i]['size']),
'LAST_UPDATE' => $tabledata[$i]['update'],
'TABLETYPE' => $tabledata[$i]['engine']
));
}
}
if ($gz) gzclose($fp);
else fclose($fp);
}
if (!isset($dk)) $dk='';
$confirm_restore=$lang['L_FM_ALERTRESTORE1'] . ' `' . $databases['db_actual'] . '` ' . $lang['L_FM_ALERTRESTORE2'] . ' ' . $filename . ' ' . $lang['L_FM_ALERTRESTORE3'];
$tpl->assign_vars(array(
'PAGETITLE' => $tblr . ' -' . $lang['L_TABLESELECTION'],
'L_NAME' => $lang['L_NAME'],
'L_DATABASE' => $lang['L_DB'],
'DATABASE' => $databases['db_actual'],
'L_LAST_UPDATE' => $lang['L_LASTBUFROM'],
'SEL_DUMP_ENCODING' => $sel_dump_encoding,
'FILENAME' => $filename,
'DUMP_COMMENT' => $dk,
'BUTTON_NAME' => $button_name,
'L_START_BACKUP' => $lang['L_STARTDUMP'],
'L_START_RESTORE' => $lang['L_FM_RESTORE'],
'L_ROWS' => $lang['L_INFO_RECORDS'],
'L_SIZE' => $lang['L_INFO_SIZE'],
'L_TABLE_TYPE' => $lang['L_TABLE_TYPE'],
'L_SELECT_ALL' => $lang['L_SELECTALL'],
'L_DESELECT_ALL' => $lang['L_DESELECTALL'],
'L_RESTORE' => $lang['L_RESTORE'],
'L_NO_MSD_BACKUP' => $lang['L_NOT_SUPPORTED'],
'L_CONFIRM_RESTORE' => $confirm_restore
));
$tpl->pparse('show');
ob_end_flush();
?>

Datei anzeigen

@ -1,467 +0,0 @@
<?php
if (!defined('MSD_VERSION')) {
die('No direct access.');
}
define('TPL_DEBUG', 0); // used if evaluationg of template fails
/***************************************************************************
* template.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: template.php 1330 2011-01-07 17:51:25Z dsb1971 $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
/**
* Template class. By Nathan Codding of the phpBB group.
* The interface was originally inspired by PHPLib templates,
* and the template file formats are quite similar.
*
*/
class MSDTemplate
{
var $classname = "MSDTemplate";
// variable that holds all the data we'll be substituting into
// the compiled templates.
// ...
// This will end up being a multi-dimensional array like this:
// $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value
// if it's a root-level variable, it'll be like this:
// $this->_tpldata[.][0][varname] == value
var $_tpldata = array();
// Hash of filenames for each template handle.
var $files = array();
// Root template directory.
var $root = "";
// this will hash handle names to the compiled code for that handle.
var $compiled_code = array();
// This will hold the uncompiled code for that handle.
var $uncompiled_code = array();
/**
* Constructor. Simply sets the root dir.
*
* @param string $root
*/
public function __construct($root = '.')
{
$this->set_rootdir($root);
}
/**
* Destroys this template object. Should be called when you're done with it, in order
* to clear out the template data so you can load/parse a new template set.
*/
public function destroy()
{
$this->_tpldata = array();
}
/**
* Sets the template root directory for this Template object.
*/
public function set_rootdir($dir)
{
if (!is_dir($dir)) {
return false;
}
$this->root = $dir;
return true;
}
/**
* Sets the template filenames for handles. $filename_array
* should be a hash of handle => filename pairs.
*/
public function set_filenames($filename_array)
{
if (!is_array($filename_array)) {
return false;
}
reset($filename_array);
while (list ($handle, $filename) = each($filename_array)) {
$this->files[$handle] = $this->make_filename($filename);
}
return true;
}
/**
* Load the file for the handle, compile the file,
* and run the compiled code. This will print out
* the results of executing the template.
*/
public function pparse($handle)
{
// Edit DSB: automatically assign language vars
global $lang;
$this->assign_vars($lang);
if (!$this->loadfile($handle)) {
die("Template->pparse(): Couldn't load template file for handle $handle");
}
// actually compile the template now.
if (!isset($this->compiled_code[$handle]) || empty($this->compiled_code[$handle])) {
// Actually compile the code now.
$this->compiled_code[$handle] = $this->compile($this->uncompiled_code[$handle]);
}
// Run the compiled code.
if (defined(TPL_DEBUG) && TPL_DEBUG > 0) {
echo '<pre>' . htmlspecialchars($this->compiled_code[$handle]) . '</pre>';
}
eval($this->compiled_code[$handle]);
return true;
}
/**
* Inserts the uncompiled code for $handle as the
* value of $varname in the root-level. This can be used
* to effectively include a template in the middle of another
* template.
* Note that all desired assignments to the variables in $handle should be done
* BEFORE calling this function.
*/
public function assign_var_from_handle($varname, $handle)
{
if (!$this->loadfile($handle)) {
die("Template->assign_var_from_handle(): Couldn't load template file for handle $handle");
}
// Compile it, with the "no echo statements" option on.
$_str = "";
$code = $this->compile($this->uncompiled_code[$handle], true, '_str');
// evaluate the variable assignment.
eval($code);
// assign the value of the generated variable to the given varname.
$this->assign_var($varname, $_str);
return true;
}
/**
* Block-level variable assignment. Adds a new block iteration with the given
* variable assignments. Note that this should only be called once per block
* iteration.
*/
public function assign_block_vars($blockname, $vararray)
{
if (strstr($blockname, '.')) {
// Nested block.
$blocks = explode('.', $blockname);
$blockcount = sizeof($blocks) - 1;
$str = '$this->_tpldata';
for ($i = 0; $i < $blockcount; $i++) {
$str .= '[\'' . $blocks[$i] . '.\']';
eval('$lastiteration = sizeof(' . $str . ') - 1;');
$str .= '[' . $lastiteration . ']';
}
// Now we add the block that we're actually assigning to.
// We're adding a new iteration to this block with the given
// variable assignments.
$str .= '[\'' . $blocks[$blockcount] . '.\'][] = $vararray;';
// Now we evaluate this assignment we've built up.
eval($str);
} else {
// Top-level block.
// Add a new iteration to this block with the variable assignments
// we were given.
$this->_tpldata[$blockname . '.'][] = $vararray;
}
return true;
}
/**
* Root-level variable assignment. Adds to current assignments, overriding
* any existing variable assignment with the same name.
*/
public function assign_vars($vararray)
{
global $lang;
while (list ($key, $val) = each($vararray)) {
$this->_tpldata['.'][0][$key] = $val;
}
return true;
}
/**
* Root-level variable assignment. Adds to current assignments, overriding
* any existing variable assignment with the same name.
*/
public function assign_var($varname, $varval)
{
$this->_tpldata['.'][0][$varname] = $varval;
return true;
}
/**
* Generates a full path+filename for the given filename, which can either
* be an absolute name, or a name relative to the rootdir for this Template
* object.
*/
public function make_filename($filename)
{
// Check if it's an absolute or relative path.
/*
if (substr($filename, 0, 1) != '/')
{
$filename = $this->root . '/' . $filename;
}
*/
if (!file_exists($filename)) {
die("Template->make_filename(): Error - file $filename does not exist");
}
return $filename;
}
/**
* If not already done, load the file for the given handle and populate
* the uncompiled_code[] hash with its code. Do not compile.
*/
public function loadfile($handle)
{
// If the file for this handle is already loaded and compiled, do nothing.
if (isset($this->uncompiled_code[$handle]) && !empty($this->uncompiled_code[$handle])) {
return true;
}
// If we don't have a file assigned to this handle, die.
if (!isset($this->files[$handle])) {
die("Template->loadfile(): No file specified for handle $handle");
}
$filename = $this->files[$handle];
$str = implode("", @file($filename));
if (empty($str)) {
die("Template->loadfile(): File $filename for handle $handle is empty");
}
$this->uncompiled_code[$handle] = $str;
return true;
}
/**
* Compiles the given string of code, and returns
* the result in a string.
* If "do_not_echo" is true, the returned code will not be directly
* executable, but can be used as part of a variable assignment
* for use in assign_code_from_handle().
*/
public function compile($code, $do_not_echo = false, $retvar = '')
{
// replace \ with \\ and then ' with \'.
$code = str_replace('\\', '\\\\', $code);
$code = str_replace('\'', '\\\'', $code);
// change template varrefs into PHP varrefs
// This one will handle varrefs WITH namespaces
$varrefs = array();
preg_match_all('#\{(([a-z0-9\-_]+?\.)+?)([a-z0-9\-_]+?)\}#is', $code, $varrefs);
$varcount = sizeof($varrefs[1]);
for ($i = 0; $i < $varcount; $i++) {
$namespace = $varrefs[1][$i];
$varname = $varrefs[3][$i];
$new = $this->generate_block_varref($namespace, $varname);
$code = str_replace($varrefs[0][$i], $new, $code);
}
// This will handle the remaining root-level varrefs
$code = preg_replace(
'#\{([a-z0-9\-_]*?)\}#is',
'\' . ( ( isset($this->_tpldata[\'.\'][0][\'\1\']) ) ? $this->_tpldata[\'.\'][0][\'\1\'] : \'\' ) . \'',
$code
);
// Break it up into lines.
$code_lines = explode("\n", $code);
$block_nesting_level = 0;
$block_names = array();
$block_names[0] = ".";
// Second: prepend echo ', append ' . "\n"; to each line.
$line_count = sizeof($code_lines);
for ($i = 0; $i < $line_count; $i++) {
$code_lines[$i] = chop($code_lines[$i]);
if (preg_match('#<!-- BEGIN (.*?) -->#', $code_lines[$i], $m)) {
$n[0] = $m[0];
$n[1] = $m[1];
// Added: dougk_ff7-Keeps templates from bombing if begin is on the same line as end.. I think. :)
if (preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $n)) {
$block_nesting_level++;
$block_names[$block_nesting_level] = $m[1];
if ($block_nesting_level < 2) {
// Block is not nested.
$code_lines[$i] = '$_' . $n[1] . '_count = ( isset($this->_tpldata[\'' . $n[1]
. '.\']) ) ? sizeof($this->_tpldata[\'' . $n[1] . '.\']) : 0;';
$code_lines[$i] .= "\n" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1]
. '_count; $_' . $n[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
} else {
// This block is nested.
// Generate a namespace string for this block.
$namespace = implode('.', $block_names);
// strip leading period from root level..
$namespace = substr($namespace, 2);
// Get a reference to the data array for this block that depends on the
// current indices of all parent blocks.
$varref = $this->generate_block_data_ref($namespace, false);
// Create the for loop code to iterate over this block.
$code_lines[$i] = '$_' . $n[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref
. ') : 0;';
$code_lines[$i] .= "\n" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1]
. '_count; $_' . $n[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
}
// We have the end of a block.
unset($block_names[$block_nesting_level]);
$block_nesting_level--;
$code_lines[$i] .= '} // END ' . $n[1];
$m[0] = $n[0];
$m[1] = $n[1];
} else {
// We have the start of a block.
$block_nesting_level++;
$block_names[$block_nesting_level] = $m[1];
if ($block_nesting_level < 2) {
// Block is not nested.
$code_lines[$i] = '$_' . $m[1] . '_count = ( isset($this->_tpldata[\'' . $m[1]
. '.\']) ) ? sizeof($this->_tpldata[\'' . $m[1] . '.\']) : 0;';
$code_lines[$i] .= "\n" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1]
. '_count; $_' . $m[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
} else {
// This block is nested.
// Generate a namespace string for this block.
$namespace = implode('.', $block_names);
// strip leading period from root level..
$namespace = substr($namespace, 2);
// Get a reference to the data array for this block that depends on the
// current indices of all parent blocks.
$varref = $this->generate_block_data_ref($namespace, false);
// Create the for loop code to iterate over this block.
$code_lines[$i] = '$_' . $m[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref
. ') : 0;';
$code_lines[$i] .= "\n" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1]
. '_count; $_' . $m[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
}
}
} else {
if (preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $m)) {
// We have the end of a block.
unset($block_names[$block_nesting_level]);
$block_nesting_level--;
$code_lines[$i] = '} // END ' . $m[1];
} else {
// We have an ordinary line of code.
if (!$do_not_echo) {
$code_lines[$i] = 'echo \'' . $code_lines[$i] . '\' . "\\n";';
} else {
$code_lines[$i] = '$' . $retvar . '.= \'' . $code_lines[$i] . '\' . "\\n";';
}
}
}
}
// Bring it back into a single string of lines of code.
$code = implode("\n", $code_lines);
return $code;
}
/**
* Generates a reference to the given variable inside the given (possibly nested)
* block namespace. This is a string of the form:
* ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . '
* It's ready to be inserted into an "echo" line in one of the templates.
* NOTE: expects a trailing "." on the namespace.
*/
public function generate_block_varref($namespace, $varname)
{
// Strip the trailing period.
$namespace = substr($namespace, 0, strlen($namespace) - 1);
// Get a reference to the data block for this namespace.
$varref = $this->generate_block_data_ref($namespace, true);
// Prepend the necessary code to stick this in an echo line.
// Append the variable reference.
$varref .= '[\'' . $varname . '\']';
$varref = '\' . ( ( isset(' . $varref . ') ) ? ' . $varref . ' : \'\' ) . \'';
return $varref;
}
/**
* Generates a reference to the array of data values for the given
* (possibly nested) block namespace. This is a string of the form:
* $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN']
*
* If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
* NOTE: does not expect a trailing "." on the blockname.
*/
public function generate_block_data_ref($blockname, $include_last_iterator)
{
// Get an array of the blocks involved.
$blocks = explode(".", $blockname);
$blockcount = sizeof($blocks) - 1;
$varref = '$this->_tpldata';
// Build up the string with everything but the last child.
for ($i = 0; $i < $blockcount; $i++) {
$varref .= '[\'' . $blocks[$i] . '.\'][$_' . $blocks[$i] . '_i]';
}
// Add the block reference for the last child.
$varref .= '[\'' . $blocks[$blockcount] . '.\']';
// Add the iterator for the last child if requried.
if ($include_last_iterator) {
$varref .= '[$_' . $blocks[$blockcount] . '_i]';
}
return $varref;
}
}

Datei anzeigen

@ -1,31 +0,0 @@
<?php
if (!@ob_start("ob_gzhandler")) @ob_start();
include ('./inc/functions.php');
$page=(isset($_GET['page'])) ? $_GET['page'] : 'main.php';
if (!file_exists("./work/config/mysqldumper.php"))
{
header("location: install.php");
ob_end_flush();
die();
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Author" content="Daniel Schlichtholz">
<title>MySQLDumper</title>
</head>
<frameset border=0 cols="190,*">
<frame name="MySQL_Dumper_menu" src="menu.php" scrolling="no" noresize
frameborder="0" marginwidth="0" marginheight="0">
<frame name="MySQL_Dumper_content" src="<?php
echo $page;
?>"
scrolling="auto" frameborder="0" marginwidth="0" marginheight="0">
</frameset>
</html>
<?php
ob_end_flush();

Datei anzeigen

@ -1,664 +0,0 @@
<?php
if (!@ob_start("ob_gzhandler")) @ob_start();
$install_ftp_server=$install_ftp_user_name=$install_ftp_user_pass=$install_ftp_path="";
$dbhost=$dbuser=$dbpass=$dbport=$dbsocket=$manual_db='';
foreach ($_GET as $getvar=>$getval)
{
${$getvar}=$getval;
}
foreach ($_POST as $postvar=>$postval)
{
${$postvar}=$postval;
}
include_once ( './inc/functions.php' );
include_once ( './inc/mysql.php' );
include_once ( './inc/runtime.php' );
if (!isset($language)) $language="en";
$config['language']=$language;
include ( './language/lang_list.php' );
include ( 'language/' . $language . '/lang_install.php' );
include ( 'language/' . $language . '/lang_main.php' );
include ( 'language/' . $language . '/lang_config_overview.php' );
//Übergabe der Parameter über FORM
if (isset($_POST['dbhost']))
{
$config['dbhost']=$dbhost;
$config['dbuser']=$dbuser;
$config['dbpass']=$dbpass;
$config['dbport']=$dbport;
$config['dbsocket']=$dbsocket;
$config['manual_db']=$manual_db;
}
else
{
// Wenn Connection-String existiert -> Verbindungsdaten aus connstr auslesen
if (isset($connstr) && !empty($connstr))
{
$p=explode("|", $connstr);
$dbhost=$config['dbhost']=$p[0];
$dbuser=$config['dbuser']=$p[1];
$dbpass=$config['dbpass']=$p[2];
$dbport=$config['dbport']=$p[3];
$dbsocket=$config['dbsocket']=$p[4];
$manual_db=$config['manual_db']=$p[5];
}
else
$connstr="";
}
//Variabeln
$phase=( isset($phase) ) ? $phase : 0;
if (isset($_POST['manual_db'])) $manual_db=trim($_POST['manual_db']);
$connstr = "$dbhost|$dbuser|$dbpass|$dbport|$dbsocket|$manual_db";
$connection='';
$delfiles=Array();
$config['files']['iconpath']='./css/msd/icons/';
$img_ok='<img src="' . $config['files']['iconpath'] . 'ok.gif" width="16" height="16" alt="ok">';
$img_failed='<img src="' . $config['files']['iconpath'] . 'notok.gif" width="16" height="16" alt="failed">';
$href="install.php?language=$language&phase=$phase&connstr=$connstr";
header('content-type: text/html; charset=utf-8');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-control" content="must-revalidate">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>MySQLDumper - Installation</title>
<link rel="stylesheet" type="text/css" href="css/msd/style.css">
<script src="js/script.js" type="text/javascript"></script>
<style type="text/css" media="screen">
td {
border: 1px solid #ddd;
}
td table td {
border: 0;
}
</style>
</head>
<body class="content">
<script language="JavaScript" type="text/javascript">
function hide_tooldivs() {
<?php
foreach ($lang['languages'] as $key)
{
echo 'document.getElementById("' . $key . '").style.display = \'none\';' . "\n";
}
?>
}
function show_tooldivs(lab) {
hide_tooldivs();
switch(lab) {
<?php
foreach ($lang['languages'] as $key)
{
echo 'case "' . $key . '":' . "\n" . 'document.getElementById("' . $key . '").style.display = \'block\';' . "\n" . 'break;' . "\n";
}
?>
}
}
</script>
<?php
if ($phase < 10)
{
if ($phase == 0) $Anzeige=$lang['L_INSTALL'] . ' - ' . $lang['L_INSTALLMENU'];
else $Anzeige=$lang['L_INSTALL'] . ' - ' . $lang['L_STEP'] . ' ' . ( $phase );
}
elseif ($phase > 9 && $phase < 12)
{
$Anzeige=$lang['L_INSTALL'] . ' - ' . $lang['L_STEP'] . ' ' . ( $phase - 7 );
}
elseif ($phase > 19 && $phase < 100)
{
$Anzeige=$lang['L_TOOLS'];
}
else
{
$Anzeige=$lang['L_UNINSTALL'] . ' - ' . $lang['L_STEP'] . ' ' . ( $phase - 99 );
}
echo '<img src="css/msd/pics/h1_logo.gif" alt="' . $lang['L_INSTALL_TOMENU'] . '">';
echo '<div id="pagetitle"><p>
' . $Anzeige . '
</p></div>';
echo '<div id="content" align="center"><p class="small"><strong>Version ' . MSD_VERSION . '</strong><br></p>';
switch ($phase)
{
case 0: // Anfang - Sprachauswahl
// da viele ja nicht in die Anleitung schauen -> versuchen die Perldateien automatisch richtig zu chmodden
@chmod('./msd_cron/crondump.pl',0755);
@chmod('./msd_cron/perltest.pl',0755);
@chmod('./msd_cron/simpletest.pl',0755);
echo '<form action="install.php" method="get"><input type="hidden" name="phase" value="1">';
echo '<table class="bdr"><tr class="thead"><th>Language</th><th>Tools</th></tr>';
echo '<tr><td valign="top" width="300"><table>';
echo GetLanguageCombo("radio","radio","language","<tr><td>","</td></tr>");
echo '</table></td><td valign="top">';
foreach ($lang['languages'] as $key)
{
echo ( "\n<div id=\"" . $key . '"><a href="install.php?language=' . $key . '&phase=100">' . $lang['L_TOOLS1'][$key] . '</a><br><br>' );
echo ( "</div>" );
}
echo ( "\n</td></tr><tr><td colspan=\"2\" style=\"padding: 4px\"><input type=\"submit\" name=\"submit\" value=\"Installation\" class=\"Formbutton\"></td></tr></table></form>" );
echo '<script language="JavaScript" type="text/javascript">show_tooldivs("' . $language . '");</script>';
break;
case 1: // checken
@chmod("config.php",0777);
echo '<h6>' . $lang['L_DBPARAMETER'] . '</h6>';
if (!is_writable("config.php"))
{
echo '<p class="warning">' . $lang['L_CONFIGNOTWRITABLE'] . '</p>';
echo '<a href="' . $href . '">' . $lang['L_TRYAGAIN'] . '</a>';
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="install.php">' . $lang['L_INSTALL_TOMENU'] . '</a>';
}
else
{
$tmp=file("config.php");
$stored=0;
if (!isset($_POST['dbconnect']))
{
// Erstaufruf - Daten aus config.php auslesen
for ($i=0; $i < count($tmp); $i++)
{
if (substr($tmp[$i],0,17) == '$config[\'dbhost\']')
{
$config['dbhost']=extractValue($tmp[$i]);
$dbhost=$config['dbhost'];
$stored++;
}
if (substr($tmp[$i],0,17) == '$config[\'dbport\']')
{
$config['dbport']=extractValue($tmp[$i]);
$dbport=$config['dbport'];
$stored++;
}
if (substr($tmp[$i],0,19) == '$config[\'dbsocket\']')
{
$config['dbsocket']=extractValue($tmp[$i]);
$dbsocket=$config['dbsocket'];
$stored++;
}
if (substr($tmp[$i],0,17) == '$config[\'dbuser\']')
{
$config['dbuser']=extractValue($tmp[$i]);
$dbuser=$config['dbuser'];
$stored++;
}
if (substr($tmp[$i],0,17) == '$config[\'dbpass\']')
{
$config['dbpass']=extractValue($tmp[$i]);
$dbpass=$config['dbpass'];
$stored++;
}
if (substr($tmp[$i],0,19) == '$config[\'language\']')
{
$config['language']=extractValue($tmp[$i]);
$stored++;
}
if ($stored == 6) break;
}
}
if (!isset($config['dbport'])) $config['dbport']="";
if (!isset($config['dbsocket'])) $config['dbsocket']="";
echo '<form action="install.php?language=' . $language . '&phase=' . $phase . '" method="post">';
echo '<table class="bdr" style="width:700px;">';
echo '<tr><td>' . $lang['L_DB_HOST'] . ':</td><td><input type="text" name="dbhost" value="' . $dbhost . '" size="60" maxlength="100"></td></tr>';
echo '<tr><td>' . $lang['L_DB_USER'] . ':</td><td><input type="text" name="dbuser" value="' . $dbuser . '" size="60" maxlength="100"></td></tr>';
echo '<tr><td>' . $lang['L_DB_PASS'] . ':</td><td><input type="password" name="dbpass" value="' . $dbpass . '" size="60" maxlength="100"></td></tr>';
echo '<tr><td>* ' . $lang['L_DB'] . ':<p class="small">('.$lang['L_ENTER_DB_INFO'].')</p></td><td><input type="text" name="manual_db" value="' . $manual_db . '" size="60" maxlength="100"></td></tr>';
echo '<tr><td>';
echo $lang['L_PORT'] . ':</td><td><input type="text" name="dbport" value="' . $dbport . '" size="5" maxlength="5">&nbsp;&nbsp;' . $lang['L_INSTALL_HELP_PORT'] . '</td></tr>';
echo '<tr><td>' . $lang['L_SOCKET'] . ':</td><td><input type="text" name="dbsocket" value="' . $dbsocket . '" size="30" maxlength="255">&nbsp;&nbsp;' . $lang['L_INSTALL_HELP_SOCKET'] . '</td></tr>';
echo '<tr><td>' . $lang['L_TESTCONNECTION'] . ':</td><td><input type="submit" name="dbconnect" value="' . $lang['L_CONNECTTOMYSQL'] . '" class="Formbutton"></td></tr>';
if (isset($_POST['dbconnect']))
{
echo '<tr class="thead"><th colspan="2">' . $lang['L_DBCONNECTION'] . '</th></tr>';
echo '<tr><td colspan="2">';
$connection=MSD_mysql_connect();
if ($connection === false)
{
echo '<p class="error">' . $lang['L_CONNECTIONERROR'] . '</p><span>&nbsp;';
}
else
{
$databases = array();
echo '<p class="success">' . $lang['L_CONNECTION_OK'] . '</p><span class="ssmall">';
$connection="ok";
$connstr="$dbhost|$dbuser|$dbpass|$dbport|$dbsocket|$manual_db";
echo '<input type="hidden" name="connstr" value="' . $connstr . '">';
if ($manual_db > '') SearchDatabases(1,$manual_db);
else SearchDatabases(1);
if (!isset($databases['Name']) || !in_array($manual_db, $databases['Name'])) {
// conect to manual db was not successful
$connstr = substr($connstr,0, strlen($connstr)-strlen($manual_db));
$manual_db = '';
}
}
echo '</span></td></tr>';
}
echo '</table></form><br>';
if ($connection == "ok")
{
if (!isset($databases['Name'][0])) echo '<br>' . $lang['L_NO_DB_FOUND_INFO'];
echo '<form action="install.php?language=' . $language . '&phase=' . ( $phase + 1 ) . '" method="post">';
echo '<input type="hidden" name="dbhost" value="' . $config['dbhost'] . '">
<input type="hidden" name="dbuser" value="' . $config['dbuser'] . '">
<input type="hidden" name="dbpass" value="' . $config['dbpass'] . '">
<input type="hidden" name="manual_db" value="' . $manual_db . '">
<input type="hidden" name="dbport" value="' . $config['dbport'] . '">
<input type="hidden" name="dbsocket" value="' . $config['dbsocket'] . '">
<input type="hidden" name="connstr" value="' . $connstr . '">';
echo '<input type="submit" name="submit" value=" ' . $lang['L_SAVEANDCONTINUE'] . ' " class="Formbutton"></form>';
}
}
break;
case 2: //
echo '<h6>MySQLDumper - ' . $lang['L_CONFBASIC'] . '</h6>';
$tmp=@file("config.php");
$stored=0;
for ($i=0; $i < count($tmp); $i++)
{
if (substr($tmp[$i],0,17) == '$config[\'dbhost\']')
{
$tmp[$i]='$config[\'dbhost\'] = \'' . $dbhost . '\';' . "\n";
$stored++;
}
if (substr($tmp[$i],0,17) == '$config[\'dbport\']')
{
$tmp[$i]='$config[\'dbport\'] = \'' . $dbport . '\';' . "\n";
$stored++;
}
if (substr($tmp[$i],0,19) == '$config[\'dbsocket\']')
{
$tmp[$i]='$config[\'dbsocket\'] = \'' . $dbsocket . '\';' . "\n";
$stored++;
}
if (substr($tmp[$i],0,17) == '$config[\'dbuser\']')
{
$tmp[$i]='$config[\'dbuser\'] = \'' . $dbuser . '\';' . "\n";
$stored++;
}
if (substr($tmp[$i],0,17) == '$config[\'dbpass\']')
{
$tmp[$i]='$config[\'dbpass\'] = \'' . $dbpass . '\';' . "\n";
$stored++;
}
if ($stored == 6) break;
}
$ret=true;
if ($fp=fopen("config.php","wb"))
{
if (!fwrite($fp,implode($tmp,""))) $ret=false;
if (!fclose($fp)) $ret=false;
@chmod("config.php",0644);
}
if (!$ret)
{
echo '<p class="warnung">' . $lang['L_CONFIG_SAVE_ERROR'] . '</p>';
}
else
{
if (ini_get('safe_mode') == 1)
{
$nextphase=( extension_loaded("ftp") ) ? 10 : 9;
}
else
$nextphase=$phase + 2;
echo $lang['L_INSTALL_STEP2FINISHED'];
echo '<p>&nbsp;</p>';
echo '<form action="install.php?language=' . $language . '&phase=' . $nextphase . '" method="post" name="continue"><input type="hidden" name="connstr" value="' . $connstr . '"><input class="Formbutton" style="width:360px;" type="submit" name="continue2" value=" ' . $lang['L_INSTALL_STEP2_1'] . ' "></form>';
echo '<script language="javascript">';
echo 'document.forms["continue"].submit();';
echo '</script>';
}
break;
case 4: //Verzeichnisse
if (isset($_POST['submit']))
{
$ret=true;
if ($fp=fopen("config.php","wb"))
{
if (!fwrite($fp,stripslashes(stripslashes($_POST['configfile'])))) $ret=false;
if (!fclose($fp)) $ret=false;
}
else
$ret=false;
if ($ret == false)
{
echo '<br><strong>' . $lang['L_ERRORMAN'] . ' config.php ' . $lang['L_MANUELL'] . '.';
die();
}
}
echo '<h6>' . $lang['L_CREATEDIRS'] . '</h6>';
$check_dirs=ARRAY(
"work/",
"work/config/",
"work/log/",
"work/backup/"
);
$msg='';
foreach ($check_dirs as $d)
{
$success=SetFileRechte($d,1,0777);
if ($success != 1) $msg.=$success . '<br>';
}
if ($msg > '') echo '<b>' . $msg . '</b>';
$iw[0]=IsWritable("work");
$iw[1]=IsWritable("work/config");
$iw[2]=IsWritable("work/log");
$iw[3]=IsWritable("work/backup");
/*
// save manual_db
if ($manual_db > '')
{
if (file_exists('./' . $config['files']['dbs_manual'])) @unlink('./' . $config['files']['dbs_manual']);
$file_handle=fopen('./' . $config['files']['dbs_manual'],'a');
if ($file_handle)
{
fwrite($file_handle,$manual_db);
fclose($file_handle);
@chmod('./' . $config['files']['dbs_manual'],0777);
}
}
*/
if ($iw[0] && $iw[1] && $iw[2] && $iw[3])
{
echo '<script language="javascript">';
echo 'self.location.href=\'install.php?language=' . $language . '&phase=5&connstr=' . $connstr . '\'';
echo '</script>';
}
echo '<form action="install.php?language=' . $language . '&phase=4" method="post"><table class="bdr"><tr class="thead">';
echo '<th>' . $lang['L_DIR'] . '</th><th>' . $lang['L_RECHTE'] . '</th><th>' . $lang['L_STATUS'] . '</th></tr>';
echo '<tr><td><strong>work</strong></td><td>' . Rechte("work") . '</td><td>' . ( ( $iw[0] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td><strong>work/config</strong></td><td>' . Rechte("work/config") . '</td><td>' . ( ( $iw[1] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td><strong>work/log</strong></td><td>' . Rechte("work/log") . '</td><td>' . ( ( $iw[2] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td><strong>work/backup</strong></td><td>' . Rechte("work/backup") . '</td><td>' . ( ( $iw[3] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td colspan="3" align="right"><input type="hidden" name="connstr" value="' . $connstr . '"><input class="Formbutton" type="submit" name="dir_check" value=" ' . $lang['L_CHECK_DIRS'] . ' "></td></tr>';
if ($iw[0] && $iw[1] && $iw[2] && $iw[3]) echo '<tr><td colspan="2">' . $lang['L_DIRS_CREATED'] . '<br><br><input class="Formbutton" type="Button" value=" ' . $lang['L_INSTALL_CONTINUE'] . ' " onclick="location.href=\'install.php?language=' . $language . '&phase=5&connstr=' . $connstr . '\'"></td></tr>';
echo '</table></form>';
break;
case 5:
echo '<h6>' . $lang['L_LASTSTEP'] . '</h6>';
echo '<br><h4>' . $lang['L_INSTALLFINISHED'] . '</h4>';
SetDefault(1);
include ( "language/" . $language . "/lang_install.php" );
// direkt zum Start des Dumeprs
echo '<script language="javascript">self.location.href=\'index.php\';</script>';
break;
case 9:
clearstatcache();
$iw[0]=IsWritable("work");
$iw[1]=IsWritable("work/config");
$iw[2]=IsWritable("work/log");
$iw[3]=IsWritable("work/backup");
echo '<h6>' . $lang['L_FTPMODE'] . '</h6>';
echo '<p align="left" style="padding-left:100px; padding-right:100px;">' . $lang['L_SAFEMODEDESC'] . '</p>';
echo '<form action="install.php?language=' . $language . '&phase=9" method="post"><input type="hidden" name="connstr" value="' . $connstr . '"><table>';
echo '<tr><td class="hd2" colspan="2">' . $lang['L_IDOMANUAL'] . '</td></tr>';
echo '<tr><td colspan="2">' . $lang['L_DOFROM'] . '<br><div class="small">' . basePath() . '</div></td></tr>';
echo '<tr><td><strong>work</strong></td><td>' . ( ( $iw[0] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td><strong>work/config</strong></td><td>' . ( ( $iw[1] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td><strong>work/log</strong></td><td>' . ( ( $iw[2] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td><strong>work/backup</strong></td><td>' . ( ( $iw[3] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td colspan="3" align="right"><input type="submit" class="Formbutton" name="dir_check" value=" ' . $lang['L_CHECK_DIRS'] . ' "></td></tr>';
// Wenn Verzeichnisse erstellt wurden - direkt weitermachen
if ($iw[0] && $iw[1] && $iw[2] && $iw[3])
{
echo '<script language="javascript">';
echo 'self.location.href=\'install.php?language=' . $language . '&phase=4&connstr=' . $connstr . '\'';
echo '</script>';
}
echo '</table>';
break;
case 10: //safe_mode FTP
$config['ftp_useSSL']=0;
clearstatcache();
$iw[0]=IsWritable("work");
$iw[1]=IsWritable("work/config");
$iw[2]=IsWritable("work/log");
$iw[3]=IsWritable("work/backup");
if (!isset($install_ftp_port) || $install_ftp_port < 1) $install_ftp_port=21;
echo '<h6>' . $lang['L_FTPMODE'] . '</h6>';
echo '<p align="left" style="padding-left:100px; padding-right:100px;">' . $lang['L_SAFEMODEDESC'] . '</p>';
echo '<form action="install.php?language=' . $language . '&phase=10" method="post"><input type="hidden" name="connstr" value="' . $connstr . '">
<table width="80%"><tr><td width="50%" valign="top"><table>';
echo '<tr><td class="hd2" colspan="2">' . $lang['L_IDOMANUAL'] . '</td></tr>';
echo '<tr><td colspan="2">' . $lang['L_DOFROM'] . '<br><div class="small">' . basePath() . '</div></td></tr>';
echo '<tr><td><strong>work</strong></td><td>' . ( ( $iw[0] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td><strong>work/config</strong></td><td>' . ( ( $iw[1] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td><strong>work/log</strong></td><td>' . ( ( $iw[2] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td><strong>work/backup</strong></td><td>' . ( ( $iw[3] ) ? $img_ok : $img_failed ) . '</td></tr>';
echo '<tr><td colspan="3" align="right"><input type="submit" name="dir_check" value=" ' . $lang['L_CHECK_DIRS'] . ' " class="Formbutton"></td></tr>';
if ($iw[0] && $iw[1] && $iw[2] && $iw[3]) echo '<tr><td colspan="2">' . $lang['L_DIRS_CREATED'] . '<br><input class="Formbutton" type="Button" value=" ' . $lang['L_INSTALL_CONTINUE'] . ' " onclick="location.href=\'install.php?language=' . $language . '&phase=4&connstr=' . $connstr . '\'"></td></tr>';
echo '</table></td><td width="50%" valign="top">';
echo '<table><tr><td class="hd2" colspan="2">' . $lang['L_FTPMODE2'] . '</td></tr>';
echo '<tr><td>FTP-Server</td><td><input type="text" name="install_ftp_server" value="' . $install_ftp_server . '"></td></tr>';
echo '<tr><td>FTP-Port</td><td><input type="text" name="install_ftp_port" value="' . $install_ftp_port . '" size="4"></td></tr>';
echo '<tr><td>FTP-User</td><td><input type="text" name="install_ftp_user_name" value="' . $install_ftp_user_name . '"></td></tr>';
echo '<tr><td>FTP-' . $lang['L_PASS'] . '</td><td><input type="text" name="install_ftp_user_pass" value="' . $install_ftp_user_pass . '"></td></tr>';
echo '<tr><td>' . $lang['L_INFO_SCRIPTDIR'] . '</td><td><input type="text" name="install_ftp_path" value="' . $install_ftp_path . '"></td></tr>';
echo '<tr><td colspan="2" align="right">
<input type="submit" name="ftp_connect" value="' . $lang['L_CONNECT'] . '" class="Formbutton"></td></tr></table></table></form>';
if (isset($ftp_connect))
{
echo '<table><tr><td class="small">';
$tftp=TesteFTP($install_ftp_server,$install_ftp_port,$install_ftp_user_name,$install_ftp_user_pass,$install_ftp_path);
echo $tftp;
echo '</td><td colspan="2" align="right">&nbsp;';
if (substr($tftp,-9) == "</strong>")
{
echo '<form action="install.php?language=' . $language . '&phase=11" method="post">
<input type="hidden" name="connstr" value="' . $connstr . '">';
echo '<input type="hidden" name="install_ftp_server" value="' . $install_ftp_server . '">
<input type="hidden" name="install_ftp_port" value="' . $install_ftp_port . '">
<input type="hidden" name="install_ftp_user_name" value="' . $install_ftp_user_name . '">
<input type="hidden" name="install_ftp_user_pass" value="' . $install_ftp_user_pass . '">
<input type="hidden" name="install_ftp_path" value="' . $install_ftp_path . '">';
echo '<input type="submit" name="submit" value=" ' . $lang['L_CREATEDIRS2'] . ' " class="Formbutton"></form>';
}
echo '</td></tr></table>';
}
//echo '</td></tr>';
//echo '</table>';
break;
case 11: //FTP-Create Dirs
echo '<h6>' . $lang['L_FTPMODE'] . '</h6>';
if (CreateDirsFTP() == 1)
{
SetDefault(true);
echo DirectoryWarnings();
echo '<br>' . $lang['L_INSTALLFINISHED'];
}
break;
case 100: //uninstall
echo '<h6>' . $lang['L_UI1'] . '</h6>';
echo '<h6>' . $lang['L_UI2'] . '</h6>';
echo '<a href="install.php">' . $lang['L_UI3'] . '</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
echo '<a href="install.php?language=' . $language . '&phase=101">' . $lang['L_UI4'] . '</a>';
break;
case 101:
echo '<h6>' . $lang['L_UI5'] . '</h6>';
$paths=Array();
$w=substr($config['paths']['work'],0,strlen($config['paths']['work']) - 1);
if (is_dir($w)) $res=rec_rmdir($w);
else $res=0;
// wurde das Verzeichnis korrekt gelöscht
if ($res == 0)
{
// das Verzeichnis wurde korrekt gelöscht
echo '<p>' . $lang['L_UI6'] . '</p>';
echo $lang['L_UI7'] . "<br>\"" . basePath() . "\"<br> " . $lang['L_MANUELL'] . ".<br><br>";
echo '<a href="../">' . $lang['L_UI8'] . '</a>';
}
else
{
echo '<p class="Warnung">' . $lang['L_UI9'] . '"' . $paths[count($paths) - 1] . '"';
}
break;
}
?>
</div>
</body>
</html>
<?php
//eigene Funktionen
// rec_rmdir - loesche ein Verzeichnis rekursiv
// Rueckgabewerte:
// 0 - alles ok
// -1 - kein Verzeichnis
// -2 - Fehler beim Loeschen
// -3 - Ein Eintrag eines Verzeichnisses war keine Datei und kein Verzeichnis und
// kein Link
function rec_rmdir($path)
{
global $paths;
$paths[]=$path;
// schau' nach, ob das ueberhaupt ein Verzeichnis ist
if (!is_dir($path))
{
return -1;
}
// oeffne das Verzeichnis
$dir=@opendir($path);
// Fehler?
if (!$dir)
{
return -2;
}
// gehe durch das Verzeichnis
while ($entry=@readdir($dir))
{
// wenn der Eintrag das aktuelle Verzeichnis oder das Elternverzeichnis
// ist, ignoriere es
if ($entry == '.' || $entry == '..') continue;
// wenn der Eintrag ein Verzeichnis ist, dann
if (is_dir($path . '/' . $entry))
{
// rufe mich selbst auf
$res=rec_rmdir($path . '/' . $entry);
// wenn ein Fehler aufgetreten ist
if ($res == -1)
{ // dies duerfte gar nicht passieren
@closedir($dir); // Verzeichnis schliessen
return -2; // normalen Fehler melden
}
else if ($res == -2)
{ // Fehler?
@closedir($dir); // Verzeichnis schliessen
return -2; // Fehler weitergeben
}
else if ($res == -3)
{ // nicht unterstuetzer Dateityp?
@closedir($dir); // Verzeichnis schliessen
return -3; // Fehler weitergeben
}
else if ($res != 0)
{ // das duerfe auch nicht passieren...
@closedir($dir); // Verzeichnis schliessen
return -2; // Fehler zurueck
}
}
else if (is_file($path . '/' . $entry) || is_link($path . '/' . $entry))
{
// ansonsten loesche diese Datei / diesen Link
$res=@unlink($path . '/' . $entry);
// Fehler?
if (!$res)
{
@closedir($dir); // Verzeichnis schliessen
return -2; // melde ihn
}
}
else
{
// ein nicht unterstuetzer Dateityp
@closedir($dir); // Verzeichnis schliessen
return -3; // tut mir schrecklich leid...
}
}
// schliesse nun das Verzeichnis
@closedir($dir);
// versuche nun, das Verzeichnis zu loeschen
$res=@rmdir($path);
// gab's einen Fehler?
if (!$res)
{
return -2; // melde ihn
}
// alles ok
return 0;
}
function Rechte($file)
{
clearstatcache();
return @substr(decoct(fileperms($file)),-3);
}
function extractValue($s)
{
$r=trim(substr($s,strpos($s,"=") + 1));
$r=substr($r,0,strlen($r) - 1);
if (substr($r,-1) == "'" || substr($r,-1) == '"') $r=substr($r,0,strlen($r) - 1);
if (substr($r,0,1) == "'" || substr($r,0,1) == '"') $r=substr($r,1);
return $r;
}
ob_end_flush();

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -1,55 +0,0 @@
var NS=(document.layers);var IE=(document.all);function obj_enable(objid)
{var e=document.getElementById(objid);e.disabled=false;}
function obj_disable(objid)
{var e=document.getElementById(objid);e.disabled=true;}
function setactiveMenuFromContent()
{var a=parent.MySQL_Dumper_content.location.href;var menuid=1;if(a.indexOf("config_overview.php")!=-1)menuid=2;if(a.indexOf("filemanagement.php")!=-1)
{if(a.indexOf("action=dump")!=-1)menuid=3;if(a.indexOf("action=restore")!=-1)menuid=4;if(a.indexOf("action=files")!=-1)menuid=5;}
if(a.indexOf("sql.php")!=-1)menuid=6;if(a.indexOf("log.php")!=-1)menuid=7;if(a.indexOf("help.php")!=-1)menuid=8;setMenuActive('m'+menuid);}
function setMenuActive(id){for(var i=1;i<=10;i++){var objid='m'+i;if(id==objid)
{parent.frames[0].document.getElementById(objid).className='active';}
else
{if(parent.frames[0].document.getElementById(objid))parent.frames[0].document.getElementById(objid).className='';}}}
function GetSelectedFilename()
{var a="";var obj=document.getElementsByName("file[]");var anz=0;if(!obj.length)
{if(obj.checked){a+=obj.value;}}
else
{for(i=0;i<obj.length;i++)
{if(obj[i].checked){a+="\n"+obj[i].value;anz++;}}}
return a;}
function Check(i,k)
{var anz=0;var s="";var smp;var ids=document.getElementsByName("file[]");var mp=document.getElementsByName("multipart[]");for(var j=0;j<ids.length;j++){if(ids[j].checked)
{s=ids[j].value;smp=(mp[j].value==0)?"":" (Multipart: "+mp[j].value+" files)";anz++;if(k==0)break;}}
if(anz==0){WP("","gd");}else if(anz==1){WP(s+smp,"gd");}else{WP("> 1","gd");}}
function SelectMD(v,anz)
{for(i=0;i<anz;i++){n="db_multidump_"+i;obj=document.getElementsByName(n)[0];if(obj&&!obj.disabled){obj.checked=v;}}}
function Sel(v)
{var a=document.frm_tbl;if(!a.chk_tbl.length)
{a.chk_tbl.checked=v;}else{for(i=0;i<a.chk_tbl.length;i++){a.chk_tbl[i].checked=v;}}}
function ConfDBSel(v,adb)
{for(i=0;i<adb;i++){var a=document.getElementsByName("db_multidump["+i+"]");if(a)a.checked=v;}}
function chkFormular()
{var a=document.frm_tbl;a.tbl_array.value="";if(!a.chk_tbl.length)
{if(a.chk_tbl.checked==true)
a.tbl_array.value+=a.chk_tbl.value+"|";}else{for(i=0;i<a.chk_tbl.length;i++){if(a.chk_tbl[i].checked==true)
a.tbl_array.value+=a.chk_tbl[i].value+"|";}}
if(a.tbl_array.value==""){alert("Choose tables!");return false;}else{return true;}}
function insertHTA(s,tb)
{if(s==1)ins="AddHandler php-fastcgi .php .php4\nAddhandler cgi-script .cgi .pl\nOptions +ExecCGI";if(s==101)ins="DirectoryIndex /cgi-bin/script.pl"
if(s==102)ins="AddHandler cgi-script .extension";if(s==103)ins="Options +ExecCGI";if(s==104)ins="Options +Indexes";if(s==105)ins="ErrorDocument 400 /errordocument.html";if(s==106)ins="# (macht aus http://domain.de/xyz.html ein\n# http://domain.de/main.php?xyz)\nRewriteEngine on\nRewriteBase /\nRewriteRule ^([a-z]+)\.html$ /main.php?$1 [R,L]";if(s==107)ins="Deny from IPADRESS\nAllow from IPADRESS";if(s==108)ins="Redirect /service http://foo2.bar.com/service";if(s==109)ins="ErrorLog /path/logfile"
tb.value+="\n"+ins;}
function WP(s,obj){document.getElementById(obj).innerHTML=s;}
function resizeSQL(i){var obj=document.getElementById("sqltextarea");var h=0;if(i==0){obj.style.height='4px';}else{if(i==1)h=-20;if(i==2)h=20;var oh=obj.style.height;var s=Number(oh.substring(0,oh.length-2))+h;if(s<24)s=24;obj.style.height=s+'px';}}
function getObj(element,docname){if(document.layers){docname=(docname)?docname:self;if(f.document.layers[element]){return f.document.layers[element];}
for(W=0;i<f.document.layers.length;W++){return(getElement(element,fdocument.layers[W]));}}
if(document.all){return document.all[element];}
return document.getElementById(element);}
function InsertLib(i){var obj=document.getElementsByName('sqllib')[0];if(obj.selectedIndex>0){document.getElementById('sqlstring'+i).value=obj.options[obj.selectedIndex].value;document.getElementById('sqlname'+i).value=obj.options[obj.selectedIndex].text;}}
function DisplayExport(s){document.getElementById("export_working").InnerHTML=s;}
function SelectedTableCount(){var obj=document.getElementsByName('f_export_tables[]')[0];var anz=0;for(var i=0;i<obj.options.length;i++)
{if(obj.options[i].selected){anz++;}}
return anz;}
function SelectTableList(s){var obj=document.getElementsByName('f_export_tables[]')[0];for(var i=0;i<obj.options.length;i++){obj.options[i].selected=s;}}
function hide_csvdivs(i){document.getElementById("csv0").style.display='none';if(i==0){document.getElementById("csv1").style.display='none';document.getElementById("csv4").style.display='none';document.getElementById("csv5").style.display='none';}}
function check_csvdivs(i){hide_csvdivs(i);if(document.getElementById("radio_csv0").checked){document.getElementById("csv0").style.display='block';}
if(i==0){if(document.getElementById("radio_csv1").checked){document.getElementById("csv1").style.display='block';}else if(document.getElementById("radio_csv2").checked){document.getElementById("csv1").style.display='block';}else if(document.getElementById("radio_csv4").checked){document.getElementById("csv4").style.display='block';}else if(document.getElementById("radio_csv5").checked){document.getElementById("csv5").style.display='block';}}}

Datei anzeigen

@ -1,20 +0,0 @@
Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
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.

Datei anzeigen

@ -1,136 +0,0 @@
// script.aculo.us builder.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
var Builder = {
NODEMAP: {
AREA: 'map',
CAPTION: 'table',
COL: 'table',
COLGROUP: 'table',
LEGEND: 'fieldset',
OPTGROUP: 'select',
OPTION: 'select',
PARAM: 'object',
TBODY: 'table',
TD: 'table',
TFOOT: 'table',
TH: 'table',
THEAD: 'table',
TR: 'table'
},
// note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken,
// due to a Firefox bug
node: function(elementName) {
elementName = elementName.toUpperCase();
// try innerHTML approach
var parentTag = this.NODEMAP[elementName] || 'div';
var parentElement = document.createElement(parentTag);
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
} catch(e) {}
var element = parentElement.firstChild || null;
// see if browser added wrapping tags
if(element && (element.tagName.toUpperCase() != elementName))
element = element.getElementsByTagName(elementName)[0];
// fallback to createElement approach
if(!element) element = document.createElement(elementName);
// abort if nothing could be created
if(!element) return;
// attributes (or text)
if(arguments[1])
if(this._isStringOrNumber(arguments[1]) ||
(arguments[1] instanceof Array) ||
arguments[1].tagName) {
this._children(element, arguments[1]);
} else {
var attrs = this._attributes(arguments[1]);
if(attrs.length) {
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
parentElement.innerHTML = "<" +elementName + " " +
attrs + "></" + elementName + ">";
} catch(e) {}
element = parentElement.firstChild || null;
// workaround firefox 1.0.X bug
if(!element) {
element = document.createElement(elementName);
for(attr in arguments[1])
element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
}
if(element.tagName.toUpperCase() != elementName)
element = parentElement.getElementsByTagName(elementName)[0];
}
}
// text, or array of children
if(arguments[2])
this._children(element, arguments[2]);
return $(element);
},
_text: function(text) {
return document.createTextNode(text);
},
ATTR_MAP: {
'className': 'class',
'htmlFor': 'for'
},
_attributes: function(attributes) {
var attrs = [];
for(attribute in attributes)
attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
'="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'&quot;') + '"');
return attrs.join(" ");
},
_children: function(element, children) {
if(children.tagName) {
element.appendChild(children);
return;
}
if(typeof children=='object') { // array can hold nodes and text
children.flatten().each( function(e) {
if(typeof e=='object')
element.appendChild(e);
else
if(Builder._isStringOrNumber(e))
element.appendChild(Builder._text(e));
});
} else
if(Builder._isStringOrNumber(children))
element.appendChild(Builder._text(children));
},
_isStringOrNumber: function(param) {
return(typeof param=='string' || typeof param=='number');
},
build: function(html) {
var element = this.node('div');
$(element).update(html.strip());
return element.down();
},
dump: function(scope) {
if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
tags.each( function(tag){
scope[tag] = function() {
return Builder.node.apply(Builder, [tag].concat($A(arguments)));
};
});
}
};

Datei anzeigen

@ -1,965 +0,0 @@
// script.aculo.us controls.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2008 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
// (c) 2005-2008 Jon Tirsen (http://www.tirsen.com)
// Contributors:
// Richard Livsey
// Rahul Bhargava
// Rob Wills
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
// Autocompleter.Base handles all the autocompletion functionality
// that's independent of the data source for autocompletion. This
// includes drawing the autocompletion menu, observing keyboard
// and mouse events, and similar.
//
// Specific autocompleters need to provide, at the very least,
// a getUpdatedChoices function that will be invoked every time
// the text inside the monitored textbox changes. This method
// should get the text for which to provide autocompletion by
// invoking this.getToken(), NOT by directly accessing
// this.element.value. This is to allow incremental tokenized
// autocompletion. Specific auto-completion logic (AJAX, etc)
// belongs in getUpdatedChoices.
//
// Tokenized incremental autocompletion is enabled automatically
// when an autocompleter is instantiated with the 'tokens' option
// in the options parameter, e.g.:
// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
// will incrementally autocomplete with a comma as the token.
// Additionally, ',' in the above example can be replaced with
// a token array, e.g. { tokens: [',', '\n'] } which
// enables autocompletion on multiple tokens. This is most
// useful when one of the tokens is \n (a newline), as it
// allows smart autocompletion after linebreaks.
if(typeof Effect == 'undefined')
throw("controls.js requires including script.aculo.us' effects.js library");
var Autocompleter = { };
Autocompleter.Base = Class.create({
baseInitialize: function(element, update, options) {
element = $(element);
this.element = element;
this.update = $(update);
this.hasFocus = false;
this.changed = false;
this.active = false;
this.index = 0;
this.entryCount = 0;
this.oldElementValue = this.element.value;
if(this.setOptions)
this.setOptions(options);
else
this.options = options || { };
this.options.paramName = this.options.paramName || this.element.name;
this.options.tokens = this.options.tokens || [];
this.options.frequency = this.options.frequency || 0.4;
this.options.minChars = this.options.minChars || 1;
this.options.onShow = this.options.onShow ||
function(element, update){
if(!update.style.position || update.style.position=='absolute') {
update.style.position = 'absolute';
Position.clone(element, update, {
setHeight: false,
offsetTop: element.offsetHeight
});
}
Effect.Appear(update,{duration:0.15});
};
this.options.onHide = this.options.onHide ||
function(element, update){ new Effect.Fade(update,{duration:0.15}) };
if(typeof(this.options.tokens) == 'string')
this.options.tokens = new Array(this.options.tokens);
// Force carriage returns as token delimiters anyway
if (!this.options.tokens.include('\n'))
this.options.tokens.push('\n');
this.observer = null;
this.element.setAttribute('autocomplete','off');
Element.hide(this.update);
Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this));
Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this));
},
show: function() {
if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
if(!this.iefix &&
(Prototype.Browser.IE) &&
(Element.getStyle(this.update, 'position')=='absolute')) {
new Insertion.After(this.update,
'<iframe id="' + this.update.id + '_iefix" '+
'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
this.iefix = $(this.update.id+'_iefix');
}
if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
},
fixIEOverlapping: function() {
Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
this.iefix.style.zIndex = 1;
this.update.style.zIndex = 2;
Element.show(this.iefix);
},
hide: function() {
this.stopIndicator();
if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
if(this.iefix) Element.hide(this.iefix);
},
startIndicator: function() {
if(this.options.indicator) Element.show(this.options.indicator);
},
stopIndicator: function() {
if(this.options.indicator) Element.hide(this.options.indicator);
},
onKeyPress: function(event) {
if(this.active)
switch(event.keyCode) {
case Event.KEY_TAB:
case Event.KEY_RETURN:
this.selectEntry();
Event.stop(event);
case Event.KEY_ESC:
this.hide();
this.active = false;
Event.stop(event);
return;
case Event.KEY_LEFT:
case Event.KEY_RIGHT:
return;
case Event.KEY_UP:
this.markPrevious();
this.render();
Event.stop(event);
return;
case Event.KEY_DOWN:
this.markNext();
this.render();
Event.stop(event);
return;
}
else
if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
(Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return;
this.changed = true;
this.hasFocus = true;
if(this.observer) clearTimeout(this.observer);
this.observer =
setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
},
activate: function() {
this.changed = false;
this.hasFocus = true;
this.getUpdatedChoices();
},
onHover: function(event) {
var element = Event.findElement(event, 'LI');
if(this.index != element.autocompleteIndex)
{
this.index = element.autocompleteIndex;
this.render();
}
Event.stop(event);
},
onClick: function(event) {
var element = Event.findElement(event, 'LI');
this.index = element.autocompleteIndex;
this.selectEntry();
this.hide();
},
onBlur: function(event) {
// needed to make click events working
setTimeout(this.hide.bind(this), 250);
this.hasFocus = false;
this.active = false;
},
render: function() {
if(this.entryCount > 0) {
for (var i = 0; i < this.entryCount; i++)
this.index==i ?
Element.addClassName(this.getEntry(i),"selected") :
Element.removeClassName(this.getEntry(i),"selected");
if(this.hasFocus) {
this.show();
this.active = true;
}
} else {
this.active = false;
this.hide();
}
},
markPrevious: function() {
if(this.index > 0) this.index--;
else this.index = this.entryCount-1;
this.getEntry(this.index).scrollIntoView(true);
},
markNext: function() {
if(this.index < this.entryCount-1) this.index++;
else this.index = 0;
this.getEntry(this.index).scrollIntoView(false);
},
getEntry: function(index) {
return this.update.firstChild.childNodes[index];
},
getCurrentEntry: function() {
return this.getEntry(this.index);
},
selectEntry: function() {
this.active = false;
this.updateElement(this.getCurrentEntry());
},
updateElement: function(selectedElement) {
if (this.options.updateElement) {
this.options.updateElement(selectedElement);
return;
}
var value = '';
if (this.options.select) {
var nodes = $(selectedElement).select('.' + this.options.select) || [];
if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
} else
value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
var bounds = this.getTokenBounds();
if (bounds[0] != -1) {
var newValue = this.element.value.substr(0, bounds[0]);
var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/);
if (whitespace)
newValue += whitespace[0];
this.element.value = newValue + value + this.element.value.substr(bounds[1]);
} else {
this.element.value = value;
}
this.oldElementValue = this.element.value;
this.element.focus();
if (this.options.afterUpdateElement)
this.options.afterUpdateElement(this.element, selectedElement);
},
updateChoices: function(choices) {
if(!this.changed && this.hasFocus) {
this.update.innerHTML = choices;
Element.cleanWhitespace(this.update);
Element.cleanWhitespace(this.update.down());
if(this.update.firstChild && this.update.down().childNodes) {
this.entryCount =
this.update.down().childNodes.length;
for (var i = 0; i < this.entryCount; i++) {
var entry = this.getEntry(i);
entry.autocompleteIndex = i;
this.addObservers(entry);
}
} else {
this.entryCount = 0;
}
this.stopIndicator();
this.index = 0;
if(this.entryCount==1 && this.options.autoSelect) {
this.selectEntry();
this.hide();
} else {
this.render();
}
}
},
addObservers: function(element) {
Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
Event.observe(element, "click", this.onClick.bindAsEventListener(this));
},
onObserverEvent: function() {
this.changed = false;
this.tokenBounds = null;
if(this.getToken().length>=this.options.minChars) {
this.getUpdatedChoices();
} else {
this.active = false;
this.hide();
}
this.oldElementValue = this.element.value;
},
getToken: function() {
var bounds = this.getTokenBounds();
return this.element.value.substring(bounds[0], bounds[1]).strip();
},
getTokenBounds: function() {
if (null != this.tokenBounds) return this.tokenBounds;
var value = this.element.value;
if (value.strip().empty()) return [-1, 0];
var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue);
var offset = (diff == this.oldElementValue.length ? 1 : 0);
var prevTokenPos = -1, nextTokenPos = value.length;
var tp;
for (var index = 0, l = this.options.tokens.length; index < l; ++index) {
tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1);
if (tp > prevTokenPos) prevTokenPos = tp;
tp = value.indexOf(this.options.tokens[index], diff + offset);
if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp;
}
return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]);
}
});
Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) {
var boundary = Math.min(newS.length, oldS.length);
for (var index = 0; index < boundary; ++index)
if (newS[index] != oldS[index])
return index;
return boundary;
};
Ajax.Autocompleter = Class.create(Autocompleter.Base, {
initialize: function(element, update, url, options) {
this.baseInitialize(element, update, options);
this.options.asynchronous = true;
this.options.onComplete = this.onComplete.bind(this);
this.options.defaultParams = this.options.parameters || null;
this.url = url;
},
getUpdatedChoices: function() {
this.startIndicator();
var entry = encodeURIComponent(this.options.paramName) + '=' +
encodeURIComponent(this.getToken());
this.options.parameters = this.options.callback ?
this.options.callback(this.element, entry) : entry;
if(this.options.defaultParams)
this.options.parameters += '&' + this.options.defaultParams;
new Ajax.Request(this.url, this.options);
},
onComplete: function(request) {
this.updateChoices(request.responseText);
}
});
// The local array autocompleter. Used when you'd prefer to
// inject an array of autocompletion options into the page, rather
// than sending out Ajax queries, which can be quite slow sometimes.
//
// The constructor takes four parameters. The first two are, as usual,
// the id of the monitored textbox, and id of the autocompletion menu.
// The third is the array you want to autocomplete from, and the fourth
// is the options block.
//
// Extra local autocompletion options:
// - choices - How many autocompletion choices to offer
//
// - partialSearch - If false, the autocompleter will match entered
// text only at the beginning of strings in the
// autocomplete array. Defaults to true, which will
// match text at the beginning of any *word* in the
// strings in the autocomplete array. If you want to
// search anywhere in the string, additionally set
// the option fullSearch to true (default: off).
//
// - fullSsearch - Search anywhere in autocomplete array strings.
//
// - partialChars - How many characters to enter before triggering
// a partial match (unlike minChars, which defines
// how many characters are required to do any match
// at all). Defaults to 2.
//
// - ignoreCase - Whether to ignore case when autocompleting.
// Defaults to true.
//
// It's possible to pass in a custom function as the 'selector'
// option, if you prefer to write your own autocompletion logic.
// In that case, the other options above will not apply unless
// you support them.
Autocompleter.Local = Class.create(Autocompleter.Base, {
initialize: function(element, update, array, options) {
this.baseInitialize(element, update, options);
this.options.array = array;
},
getUpdatedChoices: function() {
this.updateChoices(this.options.selector(this));
},
setOptions: function(options) {
this.options = Object.extend({
choices: 10,
partialSearch: true,
partialChars: 2,
ignoreCase: true,
fullSearch: false,
selector: function(instance) {
var ret = []; // Beginning matches
var partial = []; // Inside matches
var entry = instance.getToken();
var count = 0;
for (var i = 0; i < instance.options.array.length &&
ret.length < instance.options.choices ; i++) {
var elem = instance.options.array[i];
var foundPos = instance.options.ignoreCase ?
elem.toLowerCase().indexOf(entry.toLowerCase()) :
elem.indexOf(entry);
while (foundPos != -1) {
if (foundPos == 0 && elem.length != entry.length) {
ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" +
elem.substr(entry.length) + "</li>");
break;
} else if (entry.length >= instance.options.partialChars &&
instance.options.partialSearch && foundPos != -1) {
if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) {
partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" +
elem.substr(foundPos, entry.length) + "</strong>" + elem.substr(
foundPos + entry.length) + "</li>");
break;
}
}
foundPos = instance.options.ignoreCase ?
elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) :
elem.indexOf(entry, foundPos + 1);
}
}
if (partial.length)
ret = ret.concat(partial.slice(0, instance.options.choices - ret.length));
return "<ul>" + ret.join('') + "</ul>";
}
}, options || { });
}
});
// AJAX in-place editor and collection editor
// Full rewrite by Christophe Porteneuve <tdd@tddsworld.com> (April 2007).
// Use this if you notice weird scrolling problems on some browsers,
// the DOM might be a bit confused when this gets called so do this
// waits 1 ms (with setTimeout) until it does the activation
Field.scrollFreeActivate = function(field) {
setTimeout(function() {
Field.activate(field);
}, 1);
};
Ajax.InPlaceEditor = Class.create({
initialize: function(element, url, options) {
this.url = url;
this.element = element = $(element);
this.prepareOptions();
this._controls = { };
arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!!
Object.extend(this.options, options || { });
if (!this.options.formId && this.element.id) {
this.options.formId = this.element.id + '-inplaceeditor';
if ($(this.options.formId))
this.options.formId = '';
}
if (this.options.externalControl)
this.options.externalControl = $(this.options.externalControl);
if (!this.options.externalControl)
this.options.externalControlOnly = false;
this._originalBackground = this.element.getStyle('background-color') || 'transparent';
this.element.title = this.options.clickToEditText;
this._boundCancelHandler = this.handleFormCancellation.bind(this);
this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this);
this._boundFailureHandler = this.handleAJAXFailure.bind(this);
this._boundSubmitHandler = this.handleFormSubmission.bind(this);
this._boundWrapperHandler = this.wrapUp.bind(this);
this.registerListeners();
},
checkForEscapeOrReturn: function(e) {
if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return;
if (Event.KEY_ESC == e.keyCode)
this.handleFormCancellation(e);
else if (Event.KEY_RETURN == e.keyCode)
this.handleFormSubmission(e);
},
createControl: function(mode, handler, extraClasses) {
var control = this.options[mode + 'Control'];
var text = this.options[mode + 'Text'];
if ('button' == control) {
var btn = document.createElement('input');
btn.type = 'submit';
btn.value = text;
btn.className = 'editor_' + mode + '_button';
if ('cancel' == mode)
btn.onclick = this._boundCancelHandler;
this._form.appendChild(btn);
this._controls[mode] = btn;
} else if ('link' == control) {
var link = document.createElement('a');
link.href = '#';
link.appendChild(document.createTextNode(text));
link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler;
link.className = 'editor_' + mode + '_link';
if (extraClasses)
link.className += ' ' + extraClasses;
this._form.appendChild(link);
this._controls[mode] = link;
}
},
createEditField: function() {
var text = (this.options.loadTextURL ? this.options.loadingText : this.getText());
var fld;
if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) {
fld = document.createElement('input');
fld.type = 'text';
var size = this.options.size || this.options.cols || 0;
if (0 < size) fld.size = size;
} else {
fld = document.createElement('textarea');
fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows);
fld.cols = this.options.cols || 40;
}
fld.name = this.options.paramName;
fld.value = text; // No HTML breaks conversion anymore
fld.className = 'editor_field';
if (this.options.submitOnBlur)
fld.onblur = this._boundSubmitHandler;
this._controls.editor = fld;
if (this.options.loadTextURL)
this.loadExternalText();
this._form.appendChild(this._controls.editor);
},
createForm: function() {
var ipe = this;
function addText(mode, condition) {
var text = ipe.options['text' + mode + 'Controls'];
if (!text || condition === false) return;
ipe._form.appendChild(document.createTextNode(text));
};
this._form = $(document.createElement('form'));
this._form.id = this.options.formId;
this._form.addClassName(this.options.formClassName);
this._form.onsubmit = this._boundSubmitHandler;
this.createEditField();
if ('textarea' == this._controls.editor.tagName.toLowerCase())
this._form.appendChild(document.createElement('br'));
if (this.options.onFormCustomization)
this.options.onFormCustomization(this, this._form);
addText('Before', this.options.okControl || this.options.cancelControl);
this.createControl('ok', this._boundSubmitHandler);
addText('Between', this.options.okControl && this.options.cancelControl);
this.createControl('cancel', this._boundCancelHandler, 'editor_cancel');
addText('After', this.options.okControl || this.options.cancelControl);
},
destroy: function() {
if (this._oldInnerHTML)
this.element.innerHTML = this._oldInnerHTML;
this.leaveEditMode();
this.unregisterListeners();
},
enterEditMode: function(e) {
if (this._saving || this._editing) return;
this._editing = true;
this.triggerCallback('onEnterEditMode');
if (this.options.externalControl)
this.options.externalControl.hide();
this.element.hide();
this.createForm();
this.element.parentNode.insertBefore(this._form, this.element);
if (!this.options.loadTextURL)
this.postProcessEditField();
if (e) Event.stop(e);
},
enterHover: function(e) {
if (this.options.hoverClassName)
this.element.addClassName(this.options.hoverClassName);
if (this._saving) return;
this.triggerCallback('onEnterHover');
},
getText: function() {
return this.element.innerHTML.unescapeHTML();
},
handleAJAXFailure: function(transport) {
this.triggerCallback('onFailure', transport);
if (this._oldInnerHTML) {
this.element.innerHTML = this._oldInnerHTML;
this._oldInnerHTML = null;
}
},
handleFormCancellation: function(e) {
this.wrapUp();
if (e) Event.stop(e);
},
handleFormSubmission: function(e) {
var form = this._form;
var value = $F(this._controls.editor);
this.prepareSubmission();
var params = this.options.callback(form, value) || '';
if (Object.isString(params))
params = params.toQueryParams();
params.editorId = this.element.id;
if (this.options.htmlResponse) {
var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions);
Object.extend(options, {
parameters: params,
onComplete: this._boundWrapperHandler,
onFailure: this._boundFailureHandler
});
new Ajax.Updater({ success: this.element }, this.url, options);
} else {
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
Object.extend(options, {
parameters: params,
onComplete: this._boundWrapperHandler,
onFailure: this._boundFailureHandler
});
new Ajax.Request(this.url, options);
}
if (e) Event.stop(e);
},
leaveEditMode: function() {
this.element.removeClassName(this.options.savingClassName);
this.removeForm();
this.leaveHover();
this.element.style.backgroundColor = this._originalBackground;
this.element.show();
if (this.options.externalControl)
this.options.externalControl.show();
this._saving = false;
this._editing = false;
this._oldInnerHTML = null;
this.triggerCallback('onLeaveEditMode');
},
leaveHover: function(e) {
if (this.options.hoverClassName)
this.element.removeClassName(this.options.hoverClassName);
if (this._saving) return;
this.triggerCallback('onLeaveHover');
},
loadExternalText: function() {
this._form.addClassName(this.options.loadingClassName);
this._controls.editor.disabled = true;
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
Object.extend(options, {
parameters: 'editorId=' + encodeURIComponent(this.element.id),
onComplete: Prototype.emptyFunction,
onSuccess: function(transport) {
this._form.removeClassName(this.options.loadingClassName);
var text = transport.responseText;
if (this.options.stripLoadedTextTags)
text = text.stripTags();
this._controls.editor.value = text;
this._controls.editor.disabled = false;
this.postProcessEditField();
}.bind(this),
onFailure: this._boundFailureHandler
});
new Ajax.Request(this.options.loadTextURL, options);
},
postProcessEditField: function() {
var fpc = this.options.fieldPostCreation;
if (fpc)
$(this._controls.editor)['focus' == fpc ? 'focus' : 'activate']();
},
prepareOptions: function() {
this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions);
Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks);
[this._extraDefaultOptions].flatten().compact().each(function(defs) {
Object.extend(this.options, defs);
}.bind(this));
},
prepareSubmission: function() {
this._saving = true;
this.removeForm();
this.leaveHover();
this.showSaving();
},
registerListeners: function() {
this._listeners = { };
var listener;
$H(Ajax.InPlaceEditor.Listeners).each(function(pair) {
listener = this[pair.value].bind(this);
this._listeners[pair.key] = listener;
if (!this.options.externalControlOnly)
this.element.observe(pair.key, listener);
if (this.options.externalControl)
this.options.externalControl.observe(pair.key, listener);
}.bind(this));
},
removeForm: function() {
if (!this._form) return;
this._form.remove();
this._form = null;
this._controls = { };
},
showSaving: function() {
this._oldInnerHTML = this.element.innerHTML;
this.element.innerHTML = this.options.savingText;
this.element.addClassName(this.options.savingClassName);
this.element.style.backgroundColor = this._originalBackground;
this.element.show();
},
triggerCallback: function(cbName, arg) {
if ('function' == typeof this.options[cbName]) {
this.options[cbName](this, arg);
}
},
unregisterListeners: function() {
$H(this._listeners).each(function(pair) {
if (!this.options.externalControlOnly)
this.element.stopObserving(pair.key, pair.value);
if (this.options.externalControl)
this.options.externalControl.stopObserving(pair.key, pair.value);
}.bind(this));
},
wrapUp: function(transport) {
this.leaveEditMode();
// Can't use triggerCallback due to backward compatibility: requires
// binding + direct element
this._boundComplete(transport, this.element);
}
});
Object.extend(Ajax.InPlaceEditor.prototype, {
dispose: Ajax.InPlaceEditor.prototype.destroy
});
Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, {
initialize: function($super, element, url, options) {
this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions;
$super(element, url, options);
},
createEditField: function() {
var list = document.createElement('select');
list.name = this.options.paramName;
list.size = 1;
this._controls.editor = list;
this._collection = this.options.collection || [];
if (this.options.loadCollectionURL)
this.loadCollection();
else
this.checkForExternalText();
this._form.appendChild(this._controls.editor);
},
loadCollection: function() {
this._form.addClassName(this.options.loadingClassName);
this.showLoadingText(this.options.loadingCollectionText);
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
Object.extend(options, {
parameters: 'editorId=' + encodeURIComponent(this.element.id),
onComplete: Prototype.emptyFunction,
onSuccess: function(transport) {
var js = transport.responseText.strip();
if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check
throw('Server returned an invalid collection representation.');
this._collection = eval(js);
this.checkForExternalText();
}.bind(this),
onFailure: this.onFailure
});
new Ajax.Request(this.options.loadCollectionURL, options);
},
showLoadingText: function(text) {
this._controls.editor.disabled = true;
var tempOption = this._controls.editor.firstChild;
if (!tempOption) {
tempOption = document.createElement('option');
tempOption.value = '';
this._controls.editor.appendChild(tempOption);
tempOption.selected = true;
}
tempOption.update((text || '').stripScripts().stripTags());
},
checkForExternalText: function() {
this._text = this.getText();
if (this.options.loadTextURL)
this.loadExternalText();
else
this.buildOptionList();
},
loadExternalText: function() {
this.showLoadingText(this.options.loadingText);
var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
Object.extend(options, {
parameters: 'editorId=' + encodeURIComponent(this.element.id),
onComplete: Prototype.emptyFunction,
onSuccess: function(transport) {
this._text = transport.responseText.strip();
this.buildOptionList();
}.bind(this),
onFailure: this.onFailure
});
new Ajax.Request(this.options.loadTextURL, options);
},
buildOptionList: function() {
this._form.removeClassName(this.options.loadingClassName);
this._collection = this._collection.map(function(entry) {
return 2 === entry.length ? entry : [entry, entry].flatten();
});
var marker = ('value' in this.options) ? this.options.value : this._text;
var textFound = this._collection.any(function(entry) {
return entry[0] == marker;
}.bind(this));
this._controls.editor.update('');
var option;
this._collection.each(function(entry, index) {
option = document.createElement('option');
option.value = entry[0];
option.selected = textFound ? entry[0] == marker : 0 == index;
option.appendChild(document.createTextNode(entry[1]));
this._controls.editor.appendChild(option);
}.bind(this));
this._controls.editor.disabled = false;
Field.scrollFreeActivate(this._controls.editor);
}
});
//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! ****
//**** This only exists for a while, in order to let ****
//**** users adapt to the new API. Read up on the new ****
//**** API and convert your code to it ASAP! ****
Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) {
if (!options) return;
function fallback(name, expr) {
if (name in options || expr === undefined) return;
options[name] = expr;
};
fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' :
options.cancelLink == options.cancelButton == false ? false : undefined)));
fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' :
options.okLink == options.okButton == false ? false : undefined)));
fallback('highlightColor', options.highlightcolor);
fallback('highlightEndColor', options.highlightendcolor);
};
Object.extend(Ajax.InPlaceEditor, {
DefaultOptions: {
ajaxOptions: { },
autoRows: 3, // Use when multi-line w/ rows == 1
cancelControl: 'link', // 'link'|'button'|false
cancelText: 'cancel',
clickToEditText: 'Click to edit',
externalControl: null, // id|elt
externalControlOnly: false,
fieldPostCreation: 'activate', // 'activate'|'focus'|false
formClassName: 'inplaceeditor-form',
formId: null, // id|elt
highlightColor: '#ffff99',
highlightEndColor: '#ffffff',
hoverClassName: '',
htmlResponse: true,
loadingClassName: 'inplaceeditor-loading',
loadingText: 'Loading...',
okControl: 'button', // 'link'|'button'|false
okText: 'ok',
paramName: 'value',
rows: 1, // If 1 and multi-line, uses autoRows
savingClassName: 'inplaceeditor-saving',
savingText: 'Saving...',
size: 0,
stripLoadedTextTags: false,
submitOnBlur: false,
textAfterControls: '',
textBeforeControls: '',
textBetweenControls: ''
},
DefaultCallbacks: {
callback: function(form) {
return Form.serialize(form);
},
onComplete: function(transport, element) {
// For backward compatibility, this one is bound to the IPE, and passes
// the element directly. It was too often customized, so we don't break it.
new Effect.Highlight(element, {
startcolor: this.options.highlightColor, keepBackgroundImage: true });
},
onEnterEditMode: null,
onEnterHover: function(ipe) {
ipe.element.style.backgroundColor = ipe.options.highlightColor;
if (ipe._effect)
ipe._effect.cancel();
},
onFailure: function(transport, ipe) {
alert('Error communication with the server: ' + transport.responseText.stripTags());
},
onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls.
onLeaveEditMode: null,
onLeaveHover: function(ipe) {
ipe._effect = new Effect.Highlight(ipe.element, {
startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor,
restorecolor: ipe._originalBackground, keepBackgroundImage: true
});
}
},
Listeners: {
click: 'enterEditMode',
keydown: 'checkForEscapeOrReturn',
mouseover: 'enterHover',
mouseout: 'leaveHover'
}
});
Ajax.InPlaceCollectionEditor.DefaultOptions = {
loadingCollectionText: 'Loading options...'
};
// Delayed observer, like Form.Element.Observer,
// but waits for delay after last key input
// Ideal for live-search fields
Form.Element.DelayedObserver = Class.create({
initialize: function(element, delay, callback) {
this.delay = delay || 0.5;
this.element = $(element);
this.callback = callback;
this.timer = null;
this.lastValue = $F(this.element);
Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this));
},
delayedListener: function(event) {
if(this.lastValue == $F(this.element)) return;
if(this.timer) clearTimeout(this.timer);
this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000);
this.lastValue = $F(this.element);
},
onTimerEvent: function() {
this.timer = null;
this.callback(this.element, $F(this.element));
}
});

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen