1
0
Fork 0
Dieser Commit ist enthalten in:
DSB 2011-06-10 22:58:43 +00:00
Commit 35b80040c0
337 geänderte Dateien mit 31341 neuen und 0 gelöschten Zeilen

15
ReadMe/ReadMe.txt Normale Datei
Datei anzeigen

@ -0,0 +1,15 @@
MySqlDumper Copyright (C)2004-2007 Daniel Schlichtholz (admin@daniel-schlichtholz.de)
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.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 675 Mass
Ave, Cambridge, MA 02139, USA.

5
ReadMe/install_deutsch.txt Normale Datei
Datei anzeigen

@ -0,0 +1,5 @@
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

5
ReadMe/install_english.txt Normale Datei
Datei anzeigen

@ -0,0 +1,5 @@
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 Installatio assistent

6
ReadMe/install_francais.txt Normale Datei
Datei anzeigen

@ -0,0 +1,6 @@
Installation:
- Envoyer le r<>pertoire "mysqldumper" sur votre serveur
- Chmoder le fichier "config.php" en 777
- 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

6
ReadMe/install_italiano.txt Normale Datei
Datei anzeigen

@ -0,0 +1,6 @@
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

105
ReadMe/license_deutsch.txt Normale Datei
Datei anzeigen

@ -0,0 +1,105 @@
GNU General Public License
Deutsche Übersetzung der Version 2, Juni 1991
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!
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 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.
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.
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.
Es folgen die genauen Bedingungen für die Vervielfältigung, Verbreitung und Bearbeitung:
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.
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.
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:
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.
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.
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).
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.
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:
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:
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:
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.)
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.
§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.
§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.
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ß.
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.
§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.
§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
§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.
Ende der Bedingungen

88
ReadMe/license_english.txt Normale Datei
Datei anzeigen

@ -0,0 +1,88 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS

46
ReadMe/my_changelog.txt Normale Datei
Datei anzeigen

@ -0,0 +1,46 @@
Changelog von 1.22 auf 1.23
----------------------------------------
crondump.pl:
- Aufruf jetzt mit Optionen über Getopt
perl /pfad/zu/msd/msd_cron/crondump.pl -config=testconfig.conf.php -html_output=1
Anzeige, ob die Konfiguration aus dem Aufruf, der Shell oder der Standardvariablen
übernommen wurde (wenn ohne Parameter aufgerufen).
Parameter html_output:
- es kann gewählt werden, ob die Ausgabe der Meldungen im HTML-Format erfolgen soll oder nicht.
Standardeinstellung:
- Aufruf von Shell -> HTML-Ausgabe ist ausgeschaltet
- Aufruf über HTTP -> HTML-Ausgabe ist eingeschaltet
Durch Übergabe des Parameters im Aufruf kann die Standardeinstellung jederzeit überschrieben werden.
Die Ausgabe der Dateigroesse erfolgt nun im lesbaren Format (1 MB anstatt 1048576 Bytes).
Sendmail:
- ist in der Konfiguration sendmail aktiviert, so wird die Email via sendmail verschickt.
Der Aufruf inkluisve der Parameter wird aus der Konfiguration übernommen.
- ist in der Konfiguration SMTP gewählt, dann wird die Email via SMTP versandt.
Der SMTP-Server wird aus der Konfiguration übernommen. Der Port ist fix auf 25 gestellt.
----------------------------------------
perltest.pl
- die Ausgabe ist komplett auf Englisch uebersetzt.
Zusätzlich wird klarer ausgegeben wofuer ein Modul benoetigt wird.
----------------------------------------
Wiederherstellung:
- wird eine Backupdatei von MySQLDumper (ab Version 1.23) zur Wiederherstellung ausgewählt, so kann
man jetzt wahlweise auch nur bestimmte Tabellen aus dem Backup wiederherstellen.
----------------------------------------
SQL-Browser:
- in der MySQL-Suche (Lupe) kann man die Treffer nun bequem editieren/löschen und kommt danach
sofort wieder zur Trefferliste zurück
----------------------------------------
refresh_db_list und config_overview.php:
- beim Neu-Einlesen der Datenbanken geht die Einstellung der gewählten Datenbank für das Cronscript
nicht mehr verloren, sondern wird korrekt auf die alte Einstellung zurück gesetzt
- refresh_db_list.php kann man vor dem eigentlichen Start von crondump.pl aufrufen, wenn sich häufig
Datenbanken verändern/ gelöscht werden. Die Datenbankliste in der Konfigurationsdatei wird dann aktualisiert.
Existiert die Datenbank der alten Konfiguration nicht mehr, so wird die erste gefundene Datenbank ausgewählt.

135
config.php Normale Datei
Datei anzeigen

@ -0,0 +1,135 @@
<?php
//////////////////////////////////////////////////////////
// MySQL Dumper Configuration
//////////////////////////////////////////////////////////
// The Connection-Data for MySQL
//
// 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']=5000;
// Your Interface language. Use 'de' for german, 'en' for english
$config['language']="de";
//Shows the Serveradress on top 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;
//select your stylesheet
$config['theme']="msd";
//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']=2000;
$config['empty_db_before_restore']=0;
$config['optimize_tables_beforedump']=1;
$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]=""; // Adress of FTP-Server
$config['ftp_port'][1]="21"; // Port
$config['ftp_user'][1]=""; // Username
$config['ftp_pass'][1]=""; // Password
$config['ftp_dir'][1]=""; // Upload-Directory
$config['ftp_transfer'][2]=0;
$config['ftp_timeout'][2]=30;
$config['ftp_useSSL'][2]=0;
$config['ftp_mode'][2]=0;
$config['ftp_server'][2]=""; // Adress of FTP-Server
$config['ftp_port'][2]="21"; // Port
$config['ftp_user'][2]=""; // Username
$config['ftp_pass'][2]=""; // Password
$config['ftp_dir'][2]=""; // Upload-Directory
//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
$config['cron_sendmail']="/usr/lib/sendmail -t -oi -oem";
//adress of smtp-server
$config['cron_smtp']="localhost";
//smtp-port
$config['cron_smtp_port']=25;
$config['cron_samedb']=1;
$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";
?>

991
config_overview.php Normale Datei
Datei anzeigen

@ -0,0 +1,991 @@
<?php
error_reporting(E_ALL);
function print_save_button()
{
global $lang;
$t='<span style="float:right;padding-right:6px;"><input class="Formbutton" type="submit" name="save" value="' . $lang['save'] . '"></span>';
return $t;
}
// wenn neue Sprache angewählt wurde schon vor dem includen übernehmen
if (isset($_POST['save']) && $_POST['language'] != $_POST['lang_old'])
{
$config['language']=$_POST['language'];
$temp_lang=$config['language'];
include_once ( './inc/header.php' ); // Normal prodecure (resets config[language])
$config['language']=$temp_lang; // re-set language
include ( './language/lang_list.php' ); // This re-initializes $lang[] and loads appropiate language files
}
else
include_once ( './inc/header.php' ); // language not changed, go on as usual
include_once ( './inc/runtime.php' );
include_once ( './inc/functions_sql.php' );
include_once ( './language/' . $config['language'] . '/lang_help.php' );
include_once ( './language/' . $config['language'] . '/lang_config_overview.php' );
include_once ( './language/' . $config['language'] . '/lang_sql.php' );
$msg='';
$sel=( isset($_POST['sel']) ) ? $_POST['sel'] : 'db';
if (isset($_GET['sel'])) $sel=$_GET['sel'];
$old_config_file=$config['config_file'];
if (isset($_GET['config']))
{
unset($databases);
$databases=array();
if (isset($_POST['save'])) unset($_POST['save']);
if (read_config($_GET['config']))
{
$config['config_file']=$_GET['config'];
$_SESSION['config_file']=$config['config_file'];
$msg="<strong>" . sprintf($lang['config_loaded'],$config['config_file']) . "</strong>";
$msg.='<script type="text/javascript" language="javascript">parent.MySQL_Dumper_menu.location.href="menu.php?config=' . $config['config_file'] . '";</script>';
}
else
{
read_config($old_config_file);
$msg='<p class="error">' . sprintf($lang['error_loading_configfile'],$config['config_file']) . '</p>';
}
}
if (isset($_GET['config_delete']))
{
$del_config=urldecode($_GET['config_delete']);
if ($del_config == $config['config_file'])
{
//aktuell gewaehlte Konfiguration wurde geloescht
$config['config_file']='mysqldumper';
$_SESSION['config_file']=$config['config_file'];
read_config($config['config_file']); // Standard laden
}
$del=@unlink($config['paths']['config'] . $del_config . '.php');
if ($del) $del=@unlink($config['paths']['config'] . $del_config . '.conf.php');
if ($del === false) $msg='<p class="error">' . sprintf($lang['error_deleting_configfile'],$del_config) . '</p>';
else $msg='<p class="success">' . sprintf($lang['success_deleting_configfile'],$del_config) . '</p>' . '<script type="text/javascript">parent.MySQL_Dumper_menu.location.href="menu.php?config=' . $config['config_file'] . '";</script>'; //refresh menu-frame
$sel='configs';
}
include_once ( './inc/define_icons.php' );
$config['files']['parameter']=$config['paths']['config'] . $config['config_file'] . '.php';
$config['theme']=( !isset($config['theme']) ) ? 'msd' : $config['theme'];
$config['cron_smtp_port']=( !isset($config['cron_smtp_port']) ) ? 25 : $config['cron_smtp_port'];
if (!isset($command)) $command=0;
$checkFTP=Array(
"&nbsp;<br><br>&nbsp;<br>&nbsp;",
"&nbsp;<br><br>&nbsp;<br>&nbsp;",
"&nbsp;<br><br>&nbsp;<br>&nbsp;"
);
$checkFTP[$i]="";
$ftptested=-1;
if (( isset($_POST['testFTP0']) ) || ( isset($_POST['testFTP1']) ) || ( isset($_POST['testFTP2']) ))
{
$config['ftp_transfer']=array();
$config['ftp_timeout']=array();
$config['ftp_mode']=array();
$config['ftp_useSSL']=array();
for ($i=0; $i < 3; $i++)
{
$config['ftp_transfer'][$i]=( isset($_POST['ftp_transfer'][$i]) ) ? $_POST['ftp_transfer'][$i] : 0;
$config['ftp_timeout'][$i]=( isset($_POST['ftp_timeout'][$i]) ) ? $_POST['ftp_timeout'][$i] : 30;
$config['ftp_useSSL'][$i]=( isset($_POST['ftp_useSSL'][$i]) ) ? $_POST['ftp_useSSL'][$i] : 0;
$config['ftp_mode'][$i]=( isset($_POST['ftp_mode'][$i]) ) ? 1 : 0;
$config['ftp_server'][$i]=( isset($_POST['ftp_server'][$i]) ) ? $_POST['ftp_server'][$i] : '';
$config['ftp_port'][$i]=( isset($_POST['ftp_port'][$i]) ) ? $_POST['ftp_port'][$i] : 21;
$config['ftp_user'][$i]=( isset($_POST['ftp_user'][$i]) ) ? $_POST['ftp_user'][$i] : '';
$config['ftp_pass'][$i]=( isset($_POST['ftp_pass'][$i]) ) ? $_POST['ftp_pass'][$i] : '';
$config['ftp_dir'][$i]=( isset($_POST['ftp_dir'][$i]) ) ? stripslashes($_POST['ftp_dir'][$i]) : '/';
if ($config['ftp_dir'][$i] == "" || ( strlen($config['ftp_dir'][$i]) > 1 && substr($config['ftp_dir'][$i],-1) != "/" )) $config['ftp_dir'][$i].="/";
if (isset($_POST['testFTP' . $i]))
{
$checkFTP[$i]='<div class="ssmall">' . $lang['testconnection'] . ' FTP-Connection ' . ( $i + 1 ) . '<br><br>' . TesteFTP($i) . '</div>';
$ftptested=$i;
}
}
}
$showVP=false;
$oldtheme=$config['theme'];
$oldscposition=$config['interface_server_caption_position'];
if ($ftptested > -1)
{
$ftp_server[$ftptested]=$_POST['ftp_server'][$ftptested];
$ftp_port[$ftptested]=$_POST['ftp_port'][$ftptested];
$ftp_user[$ftptested]=$_POST['ftp_user'][$ftptested];
$ftp_pass[$ftptested]=$_POST['ftp_pass'][$ftptested];
$ftp_dir_s='ftp_dir[' . $ftptested . ']';
$f=$_POST['ftp_dir'];
$ftp_dir[$ftptested]=stripslashes($f[$ftptested]);
// Eingaben merken
$config['ftp_transfer'][$ftptested]=( isset($_POST['ftp_transfer'][$ftptested]) ) ? $_POST['ftp_transfer'][$ftptested] : 0;
$config['ftp_timeout'][$ftptested]=( isset($_POST['ftp_timeout'][$ftptested]) ) ? $_POST['ftp_timeout'][$ftptested] : 30;
$config['ftp_useSSL'][$ftptested]=( isset($_POST['ftp_useSSL'][$ftptested]) ) ? $_POST['ftp_useSSL'][$ftptested] : 0;
$config['ftp_mode'][$ftptested]=( isset($_POST['ftp_mode'][$ftptested]) ) ? 1 : 0;
$config['ftp_server'][$ftptested]=$ftp_server[$ftptested];
$config['ftp_port'][$ftptested]=$ftp_port[$ftptested];
$config['ftp_user'][$ftptested]=$ftp_user[$ftptested];
$config['ftp_pass'][$ftptested]=$ftp_pass[$ftptested];
$config['ftp_dir'][$ftptested]=$ftp_dir[$ftptested];
if ($ftp_dir[$ftptested] == "" || ( strlen($ftp_dir[$ftptested]) > 1 && substr($ftp_dir[$ftptested],-1) != "/" )) $ftp_dir[$ftptested].="/";
WriteParams();
}
echo MSDHeader();
if (isset($_POST['load']))
{
$msg=SetDefault(true);
$msg=nl2br($msg) . "<br>" . $lang['load_success'] . "<br>";
echo '<script type="text/javascript">parent.MySQL_Dumper_menu.location.href="menu.php";</script>';
}
if (isset($_POST['save']))
{
$save_config=true;
//Parameter auslesen
$config['multi_dump']=( isset($_POST['MultiDBDump']) ) ? $_POST['MultiDBDump'] : 0;
$config['compression']=$_POST['compression'];
$config['language']=$_POST['language'];
if (!isset($_POST['server_caption'])) $config['interface_server_caption']=0;
else $config['interface_server_caption']=$_POST['server_caption'];
$config['interface_server_caption_position']=isset($_POST['server_caption_position']) ? $_POST['server_caption_position'] : 0;
$config['interface_sqlboxsize']=$_POST['sqlboxsize'];
$config['theme']=$_POST['theme'];
$config['interface_table_compact']=( isset($_POST['interface_table_compact']) ) ? $_POST['interface_table_compact'] : 1;
$config['email_recipient']=$_POST['email0'];
$config['email_recipient_cc']=$_POST['email_recipient_cc'];
$config['email_sender']=$_POST['email1'];
$config['send_mail']=$_POST['send_mail'];
$config['send_mail_dump']=$_POST['send_mail_dump'];
$config['email_maxsize1']=$_POST['email_maxsize1'];
if ($config['email_maxsize1'] == "") $config['email_maxsize1']=0;
$config['email_maxsize2']=$_POST['email_maxsize2'];
$config['email_maxsize']=$config['email_maxsize1'] * ( ( $config['email_maxsize2'] == 1 ) ? 1024 : 1024 * 1024 );
$config['memory_limit']=$_POST['memory_limit'];
if ($config['memory_limit'] == "") $config['memory_limit']=0;
$config['minspeed']=$_POST['minspeed'];
if ($config['minspeed'] < 50) $config['minspeed']=50;
$config['maxspeed']=$_POST['maxspeed'];
if ($config['maxspeed'] < $config['minspeed']) $config['maxspeed']=$config['minspeed'] * 2;
$config['stop_with_error']=$_POST['stop_with_error'];
$config['multi_part']=$_POST['multi_part'];
$config['multipartgroesse1']=isset($_POST['multipartgroesse1']) ? floatval(str_replace(',','.',$_POST['multipartgroesse1'])) : 0;
$config['multipartgroesse2']=isset($_POST['multipartgroesse2']) ? intval($_POST['multipartgroesse2']) : 0;
if ($config['multipartgroesse1'] < 100 && $config['multipartgroesse2'] == 1) $config['multipartgroesse1']=100;
if ($config['multipartgroesse1'] < 1 && $config['multipartgroesse2'] == 2) $config['multipartgroesse1']=1;
$oldlogcompression=$config['logcompression'];
$config['logcompression']=( isset($_POST['logcompression']) && $_POST['logcompression'] == 1 ) ? 1 : 0;
$config['log_maxsize1']=$_POST['log_maxsize1'];
if ($config['log_maxsize1'] == "") $config['log_maxsize1']=0;
$config['log_maxsize2']=$_POST['log_maxsize2'];
$config['log_maxsize']=$config['log_maxsize1'] * ( ( $config['log_maxsize2'] == 1 ) ? 1024 : 1024 * 1024 );
$config['auto_delete']=$_POST['auto_delete'];
$config['max_backup_files']=$_POST['max_backup_files'];
$config['empty_db_before_restore']=$_POST['empty_db_before_restore'];
$config['optimize_tables_beforedump']=$_POST['optimize_tables'];
$config['cron_dbindex']=$_POST['cron_dbindex'];
$config['cron_comment']=$_POST['cron_comment'];
$config['cron_extender']=$_POST['cron_extender'];
// cron_select_savepath/
if (!isset($_POST['cron_select_savepath'])) $_POST['cron_select_savepath']=$config['config_file'];
if (isset($_POST['cron_savepath_new']) && !empty($_POST['cron_savepath_new']))
{
$tmp_configfilename=utf8_decode(trim($_POST['cron_savepath_new']));
if (!preg_match("/^[a-z.-_]+$/i",$tmp_configfilename,$matches))
{
$save_config=false;
$msg.='<p class="error">' . sprintf($lang['error_configfile_name'],$_POST['cron_savepath_new']) . '</p>';
}
else
{
$config['config_file']=$_POST['cron_savepath_new'];
$config['cron_configurationfile']=$_POST['cron_savepath_new'] . ".conf.php";
}
}
$config['cron_execution_path']=$_POST['cron_execution_path'];
if ($config['cron_execution_path'] == "") $config['cron_execution_path']="msd_cron/";
if (strlen($config['cron_execution_path']) > 1 && substr($config['cron_execution_path'],-1) != "/") $config['cron_execution_path'].="/";
$config['cron_use_sendmail']=$_POST['cron_use_sendmail'];
$config['cron_sendmail']=$_POST['cron_sendmail'];
$config['cron_smtp']=isset($_POST['cron_smtp']) ? $_POST['cron_smtp'] : 'localhost';
$config['cron_printout']=$_POST['cron_printout'];
$config['cron_completelog']=$_POST['cron_completelog'];
$config['cron_compression']=$_POST['compression'];
$config['cron_completelog']=$_POST['cron_completelog'];
$databases['multi']=Array();
$databases['multi_praefix']=Array();
$databases['multi_commandbeforedump']=Array();
$databases['multi_commandafterdump']=Array();
if (isset($databases['Name'][0]) && $databases['Name'][0] > '')
{
for ($i=0; $i < count($databases['Name']); $i++)
{
$databases['praefix'][$i]=isset($_POST['dbpraefix_' . $i]) ? $_POST['dbpraefix_' . $i] : '';
$databases['command_before_dump'][$i]=( !isset($_POST['command_before_' . $i]) ) ? "" : $_POST['command_before_' . $i];
$databases['command_after_dump'][$i]=( !isset($_POST['command_after_' . $i]) ) ? "" : $_POST['command_after_' . $i];
if (isset($_POST['db_multidump_' . $i]) && $_POST['db_multidump_' . $i] == "db_multidump_$i")
{
$databases['multi'][]=$databases['Name'][$i];
$databases['multi_praefix'][]=$databases['praefix'][$i];
$databases['multi_commandbeforedump'][]=$databases['command_before_dump'][$i];
$databases['multi_commandafterdump'][]=$databases['command_after_dump'][$i];
}
}
}
$databases['multisetting']=( count($databases['multi']) > 0 ) ? implode(";",$databases['multi']) : "";
$databases['multisetting_praefix']=( count($databases['multi']) > 0 ) ? implode(";",$databases['multi_praefix']) : "";
$databases['multisetting_commandbeforedump']=( count($databases['multi']) > 0 ) ? implode(";",$databases['multi_commandbeforedump']) : "";
$databases['multisetting_commandafterdump']=( count($databases['multi']) > 0 ) ? implode(";",$databases['multi_commandafterdump']) : "";
if ($config['cron_dbindex'] == -2)
{
$datenbanken=count($databases['Name']);
$cron_db_array=str_replace(";","|",$databases['multisetting']);
$cron_dbpraefix_array=str_replace(";","|",$databases['multisetting_praefix']);
$cron_db_cbd_array=str_replace(";","|",$databases['multisetting_commandbeforedump']);
$cron_db_cad_array=str_replace(";","|",$databases['multisetting_commandafterdump']);
}
elseif ($config['cron_dbindex'] == -3)
{
$cron_db_array=implode("|",$databases['Name']);
$cron_dbpraefix_array=implode("|",$databases['praefix']);
$cron_db_cbd_array=implode("|",$databases['command_before_dump']);
$cron_db_cad_array=implode("|",$databases['command_after_dump']);
}
$config['ftp_transfer']=array();
$config['ftp_timeout']=array();
$config['ftp_mode']=array();
$config['ftp_useSSL']=array();
for ($i=0; $i < 3; $i++)
{
$checkFTP[$i]="";
$config['ftp_transfer'][$i]=isset($_POST['ftp_transfer'][$i]) ? $_POST['ftp_transfer'][$i] : $config['ftp_transfer'][$i];
$config['ftp_timeout'][$i]=isset($_POST['ftp_timeout'][$i]) ? $_POST['ftp_timeout'][$i] : 30;
$config['ftp_useSSL'][$i]=isset($_POST['ftp_useSSL'][$i]) ? 1 : 0;
$config['ftp_mode'][$i]=isset($_POST['ftp_mode'][$i]) ? 1 : 0;
$config['ftp_server'][$i]=$_POST['ftp_server'][$i];
$config['ftp_port'][$i]=$_POST['ftp_port'][$i];
$config['ftp_user'][$i]=$_POST['ftp_user'][$i];
$config['ftp_pass'][$i]=$_POST['ftp_pass'][$i];
$config['ftp_dir'][$i]=stripslashes($_POST['ftp_dir'][$i]);
if ($config['ftp_port'][$i] == 0) $config['ftp_port'][$i]=21;
if ($config['ftp_dir'][$i] == "" || ( strlen($config['ftp_dir'][$i]) > 1 && substr($config['ftp_dir'][$i],-1) != "/" )) $config['ftp_dir'][$i].="/";
}
$config['bb_width']=$_POST['bb_width'];
$config['bb_textcolor']=$_POST['bb_textcolor'];
$config['sql_limit']=$_POST['sql_limit'];
if ($config['dbhost'] != $_POST['dbhost'] || $config['dbuser'] != $_POST['dbuser'] || $config['dbpass'] != $_POST['dbpass'] || $config['dbport'] != $_POST['dbport'] || $config['dbsocket'] != $_POST['dbsocket'])
{
//neue Verbindungsparameter
$show_VP=true;
//alte Parameter sichern
$old['dbhost']=$config['dbhost'];
$old['dbuser']=$config['dbuser'];
$old['dbpass']=$config['dbpass'];
$old['dbport']=$config['dbport'];
$old['dbsocket']=$config['dbsocket'];
//neu setzen
$config['dbhost']=$_POST['dbhost'];
$config['dbuser']=$_POST['dbuser'];
$config['dbpass']=$_POST['dbpass'];
$config['dbport']=$_POST['dbport'];
$config['dbsocket']=$_POST['dbsocket'];
if (MSD_mysql_connect())
{
// neue Verbindungsdaten wurden akzeptiert -> manuelle DB-Liste von anderem User löschen
if (file_exists('./' . $config['files']['dbs_manual'])) @unlink('./' . $config['files']['dbs_manual']);
SetDefault();
$msg.='<script type="text/javascript">parent.MySQL_Dumper_menu.location.href="menu.php";</script>';
}
else
{
//alte Werte holen
$config['dbhost']=$old['dbhost'];
$config['dbuser']=$old['dbuser'];
$config['dbpass']=$old['dbpass'];
$config['dbport']=$old['dbport'];
$config['dbsocket']=$old['dbsocket'];
$msg.='<p class="error">' . $lang['wrong_connectionpars'] . '</p>';
}
}
// Manuelles hinzufügen einer Datenbank
if ($_POST['add_db_manual'] > '')
{
$to_add=trim($_POST['add_db_manual']);
$found=false;
// Prüfen, ob die DB bereits in der Liste vorhanden ist
if (isset($databases['Name'][0]))
{
foreach ($databases['Name'] as $existing_db)
{
if ($existing_db == $to_add) $found=true;
}
}
if ($found) $add_db_message=sprintf($lang['db_in_list'],$to_add);
else
{
if (MSD_mysql_connect())
{
$res=mysql_selectdb($to_add,$config['dbconnection']);
if (!$res === false)
{
$dbs_manual=array();
if (file_exists('./' . $config['files']['dbs_manual'])) $dbs_manual=file('./' . $config['files']['dbs_manual']);
if (!in_array($to_add,$dbs_manual)) $dbs_manual[]=$to_add;
$file_handle=fopen('./' . $config['files']['dbs_manual'],'a');
if ($file_handle)
{
foreach ($dbs_manual as $f)
{
fwrite($file_handle,$f);
}
fclose($file_handle);
@chmod('./' . $config['files']['dbs_manual'],0777);
//Menü aktualisieren, damit die DB in der Selectliste erscheint
echo '<script type="text/javascript">parent.MySQL_Dumper_menu.location.href="menu.php";</script>';
}
else
$add_db_message=sprintf($lang['db_manual_file_error'],$to_add);
}
else
$add_db_message=sprintf($lang['db_manual_error'],$to_add);
$showVP=true;
}
}
}
//Nach einer Uebernahme einer neuen Configuration vor dem Schreiben ueberfluessige Indexe entfernen
$anzahl_datenbanken=sizeof($databases['Name']);
if (sizeof($databases['praefix']) > $anzahl_datenbanken)
{
for ($i=sizeof($databases['praefix']); $i >= $anzahl_datenbanken; $i--)
{
unset($databases['praefix'][$i]);
unset($databases['command_before_dump'][$i]);
unset($databases['command_after_dump'][$i]);
}
if ($databases['db_selected_index'] >= $anzahl_datenbanken) $databases['db_selected_index']=0;
}
// und wegschreiben
if ($save_config)
{
if (WriteParams(false) == true)
{
//neue Sprache? Dann Menue links auch aktualisieren
if ($_SESSION['config']['language'] != $config['language'] || $_POST['scaption_old'] != $config['interface_server_caption'] || $oldtheme != $config['theme'] || $oldscposition != $config['interface_server_caption_position'])
{
$msg.='<script type="text/javascript">parent.MySQL_Dumper_menu.location.href="menu.php?config=' . urlencode($config['config_file']) . '";</script>';
if (isset($_POST['cron_savepath_new']) && $_POST['cron_savepath_new'] > '') $msg.='<p class="success">' . $lang['success_configfile_created'] . '</p>';
}
//Parameter laden
read_config($config['config_file']);
if ($config['logcompression'] != $oldlogcompression) SwitchLogfileFormat();
$msg.='<p class="success">' . sprintf($lang['save_success'],$config['config_file']) . '</p>';
$msg.='<script type="text/javascript" language="javascript">parent.MySQL_Dumper_menu.location.href="menu.php?config=' . $config['config_file'] . '";</script>';
}
else
$msg.='<p class="error">' . $lang['save_error'] . '</p>';
}
}
ReadSQL();
?>
<script type="text/javascript">
function hide_pardivs() {
document.getElementById("db").style.display = 'none';
document.getElementById("global1").style.display = 'none';
document.getElementById("global2").style.display = 'none';
document.getElementById("global3").style.display = 'none';
document.getElementById("transfer1").style.display = 'none';
document.getElementById("transfer2").style.display = 'none';
document.getElementById("cron").style.display = 'none';
document.getElementById("configs").style.display = 'none';
for(i=0;i<8;i++) {
document.getElementById("command"+i).className ='ConfigButton';
}
}
function SwitchVP(objid) {
if (!document.getElementById(objid)) objid='VP';
if(document.getElementById(objid).style.display=='none')
document.getElementById(objid).style.display='block';
else
document.getElementById(objid).style.display='none'
}
function show_pardivs(lab) {
hide_pardivs();
switch(lab) {
case "db":
document.getElementById("db").style.display = 'block';
document.getElementById("command1").className ='ConfigButtonSelected';
break;
case "global1":
document.getElementById("global1").style.display = 'block';
document.getElementById("command2").className ='ConfigButtonSelected';
break;
case "global2":
document.getElementById("global3").style.display = 'block';
document.getElementById("command3").className ='ConfigButtonSelected';
break;
case "global3":
document.getElementById("global2").style.display = 'block';
document.getElementById("command4").className ='ConfigButtonSelected';
break;
case "transfer1":
document.getElementById("transfer1").style.display = 'block';
document.getElementById("command5").className ='ConfigButtonSelected';
break;
case "transfer2":
document.getElementById("transfer2").style.display = 'block';
document.getElementById("command6").className ='ConfigButtonSelected';
break;
case "cron":
document.getElementById("cron").style.display = 'block';
document.getElementById("command7").className ='ConfigButtonSelected';
break;
case "configs":
document.getElementById("configs").style.display = 'block';
document.getElementById("command0").className ='ConfigButtonSelected';
break;
case "all":
document.getElementById("db").style.display = 'block';
document.getElementById("global1").style.display = 'block';
document.getElementById("global2").style.display = 'block';
document.getElementById("global3").style.display = 'block';
document.getElementById("transfer1").style.display = 'block';
document.getElementById("transfer2").style.display = 'block';
document.getElementById("cron").style.display = 'block';
document.getElementById("configs").style.display = 'block';
document.getElementById("command8").className ='ConfigButtonSelected';
break;
default:
document.getElementById("db").style.display = 'block';
document.getElementById("command1").className ='ConfigButtonSelected';
break;
}
document.getElementById("sel").value=lab;
}
function WriteMem()
{
document.getElementById("mlimit").value=<?php
echo round($config['php_ram'] * 1024 * 1024 * 0.9,0);
?>;
}
</script>
<?php
if (!isset($config['email_maxsize1'])) $config['email_maxsize1']=0;
if (!isset($config['email_maxsize2'])) $config['email_maxsize2']=1;
if (!isset($databases['multisetting'])) $databases['multisetting']="";
$databases['multi']=explode(";",$databases['multisetting']);
//Ausgabe-Teile
$aus['formstart']=headline($lang['config_headline'] . ': ' . $config['config_file']);
$aus['formstart'].='<form name="frm_config" method="POST" action="config_overview.php"><input type="hidden" name="sel" id="sel" value="db">' . $nl;
$aus['formstart'].='<div id="configleft">';
$aus['formstart'].='<input type="Button" id="command1" onclick="show_pardivs(\'db\');" value="' . $lang['dbs'] . '" class="ConfigButton"><br>' . $nl;
$aus['formstart'].='<input type="Button" id="command2" onclick="show_pardivs(\'global1\');" value="' . $lang['general'] . '" class="ConfigButton"><br>' . $nl;
$aus['formstart'].='<input type="Button" id="command3" onclick="show_pardivs(\'global2\');" value="' . $lang['config_interface'] . '" class="ConfigButton"><br>' . $nl;
$aus['formstart'].='<input type="Button" id="command4" onclick="show_pardivs(\'global3\');" value="' . $lang['config_autodelete'] . '" class="ConfigButton"><br>' . $nl;
$aus['formstart'].='<input type="Button" id="command5" onclick="show_pardivs(\'transfer1\');" value="Email" class="ConfigButton"><br>' . $nl;
$aus['formstart'].='<input type="Button" id="command6" onclick="show_pardivs(\'transfer2\');" value="FTP" class="ConfigButton"><br>' . $nl;
$aus['formstart'].='<input type="Button" id="command7" onclick="show_pardivs(\'cron\');" value="Cronscript" class="ConfigButton"><br>' . $nl;
$aus['formstart'].='<input type="Button" id="command0" onclick="show_pardivs(\'configs\');" value="' . $lang['configfiles'] . '" class="ConfigButton"><br>' . $nl;
//$aus['formstart'].='<input type="Button" id="command8" onclick="show_pardivs(\'all\');" value="' . $lang['allpars'] . '" class="ConfigButton"><br>' . $nl;
//$aus['formstart'].='<input class="Formbutton" type="reset" name="reset" value="' . $lang['reset'] . '">';
$aus['formstart'].='<br><input class="Formbutton" type="submit" name="save" value="' . $lang['save'] . '"><br><br>' . $nl;
$aus['formstart'].='<input class="Formbutton" type="Submit" name="load" value="' . $lang['load'] . '" onclick="if (!confirm(\'' . $lang['config_askload'] . '\')) return false;">' . $nl;
//$aus['formstart'].='<input class="Formbutton" type="button" value="' . $lang['install'] . '" onclick="parent.location.href=\'install.php\'">' . $nl;
$aus['formstart'].='</div><div id="configright">' . $msg . $nl;
// Konfigurationsdateien
$aus['conf']='<div id="configs"><fieldset><legend>' . $lang['configfiles'] . '</legend>' . $nl . $nl;
$aus['conf'].='<table><tr class="dbrow">';
$aus['conf'].='<td style="vertical-align:middle">' . $lang['create_configfile'] . ':</td>';
$aus['conf'].='<td style="vertical-align:middle"><input type="text" class="text" style="width:300px;" name="cron_savepath_new" value=""></td>';
$aus['conf'].='<td colspan="2">'.print_save_button().'</td>';
$aus['conf'].='</tr></table>';
$aus['conf'].='<br><table class="bdr"><tr class="thead"><th>#</th><th>' . $lang['configfile'] . ' / ' . $lang['mysql_data'] . '</th>';
$aus['conf'].='<th>' . $lang['configurations'] . '</th><th>' . $lang['action'] . '</th></tr>';
$i=0;
$old_config=$config;
$configs=get_config_filenames();
if (sizeof($configs) > 0)
{
foreach ($configs as $c)
{
$i++;
unset($databases);
read_config($c);
$aus['conf'].='<tr class="';
if ($old_config['config_file'] == $c) $aus['conf'].='dbrowsel';
else $aus['conf'].=( $i % 2 ) ? 'dbrow' : 'dbrow1';
$aus['conf'].='">';
$aus['conf'].='<td><a name="config' . sprintf("%03d",$i) . '" style="text-decoration:none;">' . $i . '.</a></td>';
// Einstellungen
$aus['conf'].='<td>';
$aus['conf'].='<table>';
$aus['conf'].='<tr><td>' . $lang['name'] . ':</td><td><strong>' . $c . '</strong></td></tr>'; // filename
$aus['conf'].='<tr><td>' . $lang['db_host'] . ':</td><td><strong>' . $config['dbhost'] . '</strong></td></tr>';
$aus['conf'].='<tr><td>' . $lang['db_user'] . ':</td><td><strong>' . $config['dbuser'] . '</strong></td></tr>';
$aus['conf'].='<tr><td>';
$aus['conf'].=$lang['dbs'] . ':</td><td>';
$aus['conf'].='<a href="#config' . sprintf("%03d",$i) . '" onclick="SwitchVP(\'show_db' . sprintf("%03d",$i) . '\');">';
$aus['conf'].=$icon['search'] . '<strong>' . sizeof($databases['Name']) . '</strong></a>';
$aus['conf'].='</td></tr>';
// Datenbankliste anzeigen
$aus['conf'].='<tr><td colspan="2">';
$aus['conf'].='<div id="show_db' . sprintf("%03d",$i) . '" style="padding:0;margin:0;display:none;">';
$a=1;
$aus['conf'].='<table class="bdr">';
if (isset($databases['Name']))
{
foreach ($databases['Name'] as $d)
{
$aus['conf'].='<tr class="' . ( ( $a % 2 ) ? 'dbrow' : 'dbrow1' ) . '"><td style="text-align:right;">';
$aus['conf'].=$a . '.&nbsp;</td><td>';
$aus['conf'].='<a href="sql.php?db=' . urlencode($d) . '">';
$aus['conf'].=$d . '</a></td></tr>';
$a++;
}
}
$aus['conf'].='</table></div></td></tr>';
$aus['conf'].='</table></td>';
$aus['conf'].='<td><table>';
// String aus Multidump-DBs aufbauen
$toolboxstring='';
$databases['multi']=explode(";",$databases['multisetting']);
$multi_praefixe=array();
if (isset($databases['multisetting_praefix'])) $multi_praefixe=explode(";",$databases['multisetting_praefix']);
if (is_array($databases['multi']))
{
for ($x=0; $x < sizeof($databases['multi']); $x++)
{
if ($x > 0) $toolboxstring.=', ';
$toolboxstring.=$databases['multi'][$x];
if (isset($multi_praefixe[$x]) && $multi_praefixe[$x] > '') $toolboxstring.=' (<i>\'' . $multi_praefixe[$x] . '\'</i>)';
}
}
// DB-Liste fuer PHP
if ($config['multi_dump'] == 1) // Multidump
{
$aus['conf'].=table_output($lang['backup_dbs_php'],$toolboxstring);
}
else
{
// aktuelle DB
$text=isset($databases['db_actual']) ? $databases['db_actual'] : '';
if (isset($databases['db_selected_index']) && isset($databases['praefix'][$databases['db_selected_index']]) && $databases['praefix'][$databases['db_selected_index']] > '') $text.=" ('<i>" . $databases['praefix'][$databases['db_selected_index']] . "</i>')";
$aus['conf'].=table_output($lang['backup_dbs_php'],$text);
}
// DB-Liste fuer Perl
// Fallback falls aus alten Konfigurationsdateien der Index noch nicht gesetzt ist -> alle DBs sichern
if (!isset($config['cron_dbindex'])) $config['cron_dbindex']=-3;
if ($config['cron_dbindex'] == -2)
{
$aus['conf'].=table_output($lang['backup_dbs_perl'],$toolboxstring);
}
elseif ($config['cron_dbindex'] == -3)
{
$text=$lang['all'];
$aus['conf'].=table_output($lang['backup_dbs_perl'],$text);
}
else
{
$text=isset($databases['Name'][$config['cron_dbindex']]) ? $databases['Name'][$config['cron_dbindex']] : '';
if (isset($databases['praefix'][$config['cron_dbindex']]) && $databases['praefix'][$config['cron_dbindex']] > '') $text.=" ('<i>" . $databases['praefix'][$config['cron_dbindex']] . "</i>')";
$aus['conf'].=table_output($lang['backup_dbs_perl'],$text);
}
if ($config['multi_part'] == 1) // Multipart
{
$aus['conf'].=table_output($lang['multi_part'],$lang['yes'] . ", " . $lang['filesize'] . " " . byte_output($config['multipart_groesse']));
}
if ($config['send_mail'] == 1) //Email
{
$aus['conf'].=table_output($lang['send_mail_form'],$lang['yes'] . ", " . $lang['email_adress'] . ": " . $config['email_recipient']);
if ($config['email_recipient_cc'] > '') $aus['conf'].=table_output($lang['email_cc'],$config['email_recipient_cc']);
$text=$lang['yes'] . ", " . $lang['max_upload_size'] . ": ";
$bytes=$config['email_maxsize1'] * 1024;
if ($config['email_maxsize2'] == 2) $bytes=$bytes * 1024;
$text.=byte_output($bytes);
if ($config['send_mail_dump'] == 1) $aus['conf'].=table_output($lang['send_mail_dump'],$text);
}
for ($x=0; $x < 3; $x++)
{
if (isset($config['ftp_transfer'][$x]) && $config['ftp_transfer'][$x] > 0)
{
//$aus['conf'].=table_output($lang['ftp'],sprintf($lang['ftp_send_to'],$config['ftp_server'][$x],$config['ftp_dir'][$x]),1,2);
$aus['conf'].=table_output($lang['ftp'],sprintf($lang['ftp_send_to'],$config['ftp_server'][$x],$config['ftp_dir'][$x]));
}
}
$aus['conf'].='</table></td><td>';
$aus['conf'].='<a href="config_overview.php?config=' . urlencode($c) . '">' . $icon['edit'] . '</a>';
if ($c != 'mysqldumper') // && $old_config['config_file']!=$c)
$aus['conf'].='<a href="config_overview.php?config_delete=' . urlencode($c) . '" onclick="if(!confirm(\'' . sprintf($lang['confirm_configfile_delete'],$c) . '\')) return false;">' . $icon['delete'] . '</a>';
else $aus['conf'].='&nbsp;';
$aus['conf'].='</td></tr>';
}
}
$configfile=$old_config['config_file'];
$config=$old_config;
unset($databases);
$databases=array();
read_config($configfile);
$aus['conf'].='</table>';
$aus['conf'].='</fieldset></div>' . $nl . $nl;
// Zugangsdaten
$aus['db']='<div id="db"><fieldset><legend>' . $lang['connectionpars'] . '</legend>' . $nl . $nl;
$aus['db'].='<div id="VP" style="display:none;"';
$aus['db'].='><table><tr><td>Host / User / Passwort:</td>';
$aus['db'].='<td><input class="text" type="text" name="dbhost" value="' . $config['dbhost'] . '">&nbsp;&nbsp;/&nbsp;&nbsp;';
$aus['db'].='<input class="text" type="text" name="dbuser" value="' . $config['dbuser'] . '" size="20">&nbsp;&nbsp;/&nbsp;&nbsp;';
$aus['db'].='<input class="text" type="password" name="dbpass" value="' . $config['dbpass'] . '" size="20"></td></tr>';
$aus['db'].='<tr><td colspan="2"><strong>' . $lang['extendedpars'] . '</strong></td></tr>';
$aus['db'].='<tr><td>Port / Socket:</td><td><input class="text" type="text" name="dbport" value="' . $config['dbport'] . '">&nbsp;&nbsp;/&nbsp;&nbsp;';
$aus['db'].='<input class="text" type="text" name="dbsocket" value="' . $config['dbsocket'] . '"></td></tr>';
$aus['db'].='<tr><td>' . $lang['add_db_manually'] . ':</td>';
$aus['db'].='<td><input class="text" type="text" name="add_db_manual" value=""></td></tr>';
if (isset($add_db_message))
{
$aus['db'].='<tr><td colspan="2" class="error">' . $add_db_message;
$aus['db'].='</td></tr>';
}
$aus['db'].='<tr><td colspan="2">'.print_save_button().'</td></tr>';
$aus['db'].='</table></div><div><a class="small" href="#" onclick="SwitchVP();">' . $lang['fade_in_out'] . '</a></div></fieldset><fieldset><legend>' . $lang['db_backuppars'] . '</legend>';
$aus['db'].='<table>';
//Wenn Datenbanken vorhanden sind
if (isset($databases['Name'][0]) && $databases['Name'][0] > '')
{
if (!isset($databases['multi']) || ( !is_array($databases['multi']) )) $databases['multi']=array();
if (count($databases['Name']) == 1)
{
$databases['db_actual']=$databases['Name'][0];
$aus['db'].='<tr><td>' . Help($lang['help_db'],"conf1") . $lang['list_db'] . '</td>';
$aus['db'].='<td><strong>' . $databases['db_actual'] . '</strong></td></tr>';
$aus['db'].='<tr><td>' . Help($lang['help_praefix'],"conf2") . $lang['praefix'] . '</td><td><input type="text" class="text" name="dbpraefix_' . $databases['db_selected_index'] . '" size="10" value="' . $databases['praefix'][$databases['db_selected_index']] . '"></td></tr>';
$aus['db'].='<tr><td>' . Help($lang['help_commands'],"") . 'Command before Dump</td><td>' . ComboCommandDump(0,$databases['db_selected_index']) . '</td></tr>';
$aus['db'].='<tr><td>' . Help($lang['help_commands'],"") . 'Command after Dump</td><td>' . ComboCommandDump(1,$databases['db_selected_index']) . '</td>';
$aus['db'].='<td><a href="sql.php?context=1">' . $lang['sql_befehle'] . '</a></td>';
$aus['db'].='</tr>';
}
else
{
$aus['db'].='<tr><td>' . Help($lang['help_db'],"conf1") . $lang['list_db'] . '</td><td><input type="checkbox" class="checkbox" name="MultiDBDump" value="1" ' . ( ( $config['multi_dump'] == 1 ) ? "CHECKED" : "" ) . '>&nbsp;' . $lang['activate_multidump'] . '</td>';
$aus['db'].='<tr><td colspan="2"><table class="bdr">';
$aus['db'].='<tr class="thead"><th>' . $lang['db'] . '</th><th>Multidump<br><span class="ssmall">(<a href="javascript:SelectMD(true,' . count($databases['Name']) . ')" class="small">' . $lang['all'] . '</a>&nbsp;<a href="javascript:SelectMD(false,' . count($databases['Name']) . ')" class="small">' . $lang['none'] . '</a>)</span></th>';
$aus['db'].='<th>' . Help($lang['help_praefix'],"conf2") . $lang['praefix'] . '</th><th>' . Help($lang['help_commands'],"",11) . 'Command before Dump</th><th>' . Help($lang['help_commands'],"",11) . 'Command after Dump</th><th>' . $lang['sql_befehle'] . '</th></tr>';
//erst die aktuelle DB
$aus['db'].='<tr class="dbrowsel"><td><strong>' . $databases['db_actual'] . '</strong></td>';
$aus['db'].='<td align="center"><input type="checkbox" class="checkbox" name="db_multidump_' . $databases['db_selected_index'] . '" value="db_multidump_' . $databases['db_selected_index'] . '" ' . ( ( in_array($databases['db_actual'],$databases['multi']) ) ? "CHECKED" : "" ) . '></td>';
$aus['db'].='<td><img src="' . $icon['blank'] . '" width="40" height="1" alt=""><input type="text" class="text" name="dbpraefix_' . $databases['db_selected_index'] . '" size="10" value="' . $databases['praefix'][$databases['db_selected_index']] . '"></td>';
$aus['db'].='<td>' . ComboCommandDump(0,$databases['db_selected_index']) . '</td><td>' . ComboCommandDump(1,$databases['db_selected_index']) . '</td>';
$aus['db'].='<td><a href="sql.php?context=1">' . $lang['sql_befehle'] . '</a></td>';
$aus['db'].='</tr>';
$dbacombo=$dbbcombo="";
$j=0;
for ($i=0; $i < count($databases['Name']); $i++)
{
if ($i != $databases['db_selected_index'])
{
$j++;
$aus['db'].='<tr class="' . ( ( $i % 2 ) ? 'dbrow' : 'dbrow1' ) . '"><td>' . $databases['Name'][$i] . '</td>';
$aus['db'].='<td align="center"><input type="checkbox" class="checkbox" name="db_multidump_' . $i . '" value="db_multidump_' . $i . '" ' . ( ( in_array($databases['Name'][$i],$databases['multi']) ) ? "CHECKED" : "" ) . '></td>';
$aus['db'].='<td><img src="' . $icon['blank'] . '" width="40" height="1" alt=""><input type="text" class="text" name="dbpraefix_' . $i . '" size="10" value="' . $databases['praefix'][$i] . '"></td><td>' . ComboCommandDump(0,$i) . '</td><td>' . ComboCommandDump(1,$i) . '</td>';
$aus['db'].='<td><a href="sql.php?context=1">' . $lang['sql_befehle'] . '</a></td>';
$aus['db'].='</tr>';
}
}
}
}
else
$aus['db'].='<tr><td>' . $lang['no_db_found'] . '</td></tr>';
$aus['db'].='</table></td></tr>';
$aus['db'].='</table></fieldset></div>';
// sonstige Einstellungen
$aus['global1']='<div id="global1"><fieldset><legend>' . $lang['general'] . '</legend><table>';
$aus['global1'].='<tr><td>' . Help("","") . 'Logfiles:&nbsp;</td>';
$aus['global1'].='<td><input type="checkbox" class="checkbox" value="1" name="logcompression" ' . ( ( $config['zlib'] ) ? '' : 'disabled' ) . ( ( $config['logcompression'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['compressed'] . '<br>';
$aus['global1'].='' . $lang['maxsize'] . ':&nbsp;&nbsp;<input type="text" class="text" name="log_maxsize1" size="3" maxlength="3" value="' . $config['log_maxsize1'] . '">&nbsp;&nbsp;';
$aus['global1'].='<select name="log_maxsize2"><option value="1" ' . ( ( $config['log_maxsize2'] == 1 ) ? ' SELECTED' : '' ) . '>Kilobytes</option>';
$aus['global1'].='<option value="2" ' . ( ( $config['log_maxsize2'] == 2 ) ? ' SELECTED' : '' ) . '>Megabytes</option></select></td></tr>';
$aus['global1'].='<tr><td>' . Help($lang['help_memorylimit'],"") . $lang['memory_limit'] . ':&nbsp;&nbsp;</td>';
$aus['global1'].='<td>';
$aus['global1'].='<input type="text" class="text" size="10" id="mlimit" name="memory_limit" maxlength="10" style="text-align:right;font-size:11px;" value="' . $config['memory_limit'] . '"> Bytes&nbsp;&nbsp;&nbsp;<a href="#" onclick="WriteMem();" class="small">' . $lang['autodetect'] . '</a>';
$aus['global1'].='</td></tr>';
$aus['global1'].='<tr><td>' . Help($lang['help_speed'],"") . $lang['speed'] . ':&nbsp;</td>';
$aus['global1'].='<td><input type="text" class="text" size="6" name="minspeed" maxlength="6" style="text-align:right;" value="' . $config['minspeed'] . '">&nbsp;' . $lang['to'] . '&nbsp;<input type="text" class="text" size="6" name="maxspeed" maxlength="9" style="text-align:right;" value="' . $config['maxspeed'] . '"></td></tr>';
$aus['global1'].='</table></fieldset><fieldset><legend>' . $lang['dump'] . '</legend><table>';
$aus['global1'].='<tr><td>' . Help($lang['help_zip'],"conf3") . $lang['gzip'] . ':&nbsp;</td>';
$aus['global1'].='<td><input type="radio" class="radio" value="1" name="compression" ' . ( ( $config['zlib'] ) ? '' : 'disabled' ) . ( ( $config['compression'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['activated'];
$aus['global1'].='&nbsp;&nbsp;&nbsp;<input type="radio" class="radio" value="0" name="compression" ' . ( ( $config['compression'] == 0 ) ? " checked" : "" ) . '>&nbsp;' . $lang['not_activated'] . '</td></tr>';
//Multipart-Backup -->
$aus['global1'].='<tr><td>' . Help($lang['help_multipart'],"") . $lang['multi_part'] . ':&nbsp;</td><td>';
$aus['global1'].='<input type="radio" class="radio" value="1" name="multi_part" onclick="obj_enable(\'multipartgroesse1\');obj_enable(\'multipartgroesse2\');" ' . ( ( $config['multi_part'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['yes'];
$aus['global1'].='&nbsp;&nbsp;<input type="radio" class="radio" value="0" name="multi_part" onclick="obj_disable(\'multipartgroesse1\');obj_disable(\'multipartgroesse2\');" ' . ( ( $config['multi_part'] == 0 ) ? " checked" : "" ) . '>&nbsp;' . $lang['no'];
$aus['global1'].='</td></tr><tr><td>' . Help($lang['help_multipartgroesse'],"") . $lang['multi_part_groesse'] . ':&nbsp;</td>';
$aus['global1'].='<td>&nbsp;';
$aus['global1'].='<input type="text" class="text" id="multipartgroesse1" name="multipartgroesse1" size="3" maxlength="8" value="' . $config['multipartgroesse1'] . '"';
if ($config['multi_part'] == 0) $aus['global1'].=' disabled';
$aus['global1'].='>&nbsp;&nbsp;';
$aus['global1'].='<select id="multipartgroesse2" name="multipartgroesse2"';
if ($config['multi_part'] == 0) $aus['global1'].=' disabled';
$aus['global1'].='><option value="1" ' . ( ( $config['multipartgroesse2'] == 1 ) ? 'SELECTED' : '' ) . '>Kilobytes</option><option value="2" ' . ( ( $config['multipartgroesse2'] == 2 ) ? 'SELECTED' : '' ) . '>Megabytes</option></select></td></tr>';
$aus['global1'].='<tr><td>' . Help($lang['help_optimize'],"") . $lang['optimize'] . '</td>';
$aus['global1'].='<td><input type="radio" class="radio" value="1" name="optimize_tables" ' . ( ( $config['optimize_tables_beforedump'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['activated'];
$aus['global1'].='&nbsp;&nbsp;&nbsp;<input type="radio" class="radio" value="0" name="optimize_tables" ' . ( ( $config['optimize_tables_beforedump'] == 0 ) ? " checked" : "" ) . '>&nbsp;' . $lang['not_activated'] . '</td></tr>';
$aus['global1'].='</table></fieldset><fieldset><legend>' . $lang['restore'] . '</legend><table>';
$aus['global1'].='<tr><td>' . Help($lang['help_empty_db_before_restore'],"conf4") . $lang['empty_db_before_restore'] . ':&nbsp;</td><td>';
$aus['global1'].='<input type="radio" class="radio" value="1" name="empty_db_before_restore" ' . ( ( $config['empty_db_before_restore'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['yes'];
$aus['global1'].='&nbsp;&nbsp;&nbsp;<input type="radio" class="radio" value="0" name="empty_db_before_restore" ' . ( ( $config['empty_db_before_restore'] == 0 ) ? " checked" : "" ) . '>&nbsp;' . $lang['no'];
$aus['global1'].='</td></tr>';
$aus['global1'].='<tr><td>' . Help("","") . $lang['errorhandling_restore'] . '</td><td>';
$aus['global1'].='<input type="radio" class="radio" name="stop_with_error" value="0" ' . ( ( $config['stop_with_error'] == 0 ) ? " checked" : "" ) . '>&nbsp;' . $lang['ehrestore_continue'] . '<br>';
$aus['global1'].='<input type="radio" class="radio" name="stop_with_error" value="1" ' . ( ( $config['stop_with_error'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['ehrestore_stop'];
$aus['global1'].='</td></tr></table></fieldset>';
$aus['global1'].=print_save_button();
$aus['global1'].='</div>';
//Interface -->
$aus['global3']='<div id="global3"><fieldset><legend>' . $lang['config_interface'] . '</legend><table>';
$aus['global3'].='<tr><td>' . Help($lang['help_lang'],"conf11") . $lang['language'] . ':&nbsp;</td>';
$aus['global3'].='<td><select name="language">' . GetLanguageCombo("op");
$aus['global3'].='</select>&nbsp;&nbsp;<a href="' . $languagepacks_ref . '" target="_blank">' . $lang['download_languages'] . '</a><input type="hidden" name="lang_old" value="' . $config['language'] . '"><input type="hidden" name="scaption_old" value="' . $config['interface_server_caption'] . '"></td></tr>';
$aus['global3'].='<tr><td>' . Help($lang['help_servercaption'],"") . $lang['servercaption'] . ':</td>';
$aus['global3'].='<td><input type="checkbox" class="checkbox" value="1" name="server_caption" ' . ( ( $config['interface_server_caption'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['activated'] . '&nbsp;&nbsp;&nbsp;';
$aus['global3'].='<input type="radio" class="radio" name="server_caption_position" value="1" ' . ( ( $config['interface_server_caption_position'] == 1 ) ? "checked" : "" ) . '>&nbsp;' . $lang['in_mainframe'] . '&nbsp;&nbsp;<input type="radio" class="radio" name="server_caption_position" value="0" ' . ( ( $config['interface_server_caption_position'] == 0 ) ? "checked" : "" ) . '>&nbsp;' . $lang['in_leftframe'] . '';
$aus['global3'].='</td></tr>';
$aus['global3'].='<tr><td>' . Help("","") . 'Theme</td><td><select name="theme">' . GetThemes() . '</select>&nbsp;&nbsp;<a href="' . $stylepacks_ref . '" target="_blank">' . $lang['download_styles'] . '</a></td></tr>';
$aus['global3'].='</table></fieldset><fieldset><legend>' . $lang['sql_browser'] . '</legend><table>';
$aus['global3'].='<tr><td>' . Help("","") . $lang['sqlboxheight'] . ':&nbsp;</td>';
$aus['global3'].='<td><input type="text" class="text" name="sqlboxsize" value="' . $config['interface_sqlboxsize'] . '" size="3" maxlength="3">&nbsp;Pixel</td></tr>';
$aus['global3'].='<tr><td>' . Help("","") . $lang['sqllimit'] . ':&nbsp;</td>';
$aus['global3'].='<td><input type="text" class="text" name="sql_limit" value="' . $config['sql_limit'] . '" size="3" maxlength="6">&nbsp;</td></tr>';
$aus['global3'].='<tr><td>' . Help("","") . $lang['bbparams'] . ':&nbsp;</td>';
$aus['global3'].='<td>';
$aus['global3'].='<table><tr><td>' . $lang['width'] . ':</td><td><input type="text" class="text" name="bb_width" value="' . $config['bb_width'] . '" size="3" maxlength="3">&nbsp;pixel</td></tr>';
$aus['global3'].='<tr><td>' . $lang['bbtextcolor'] . ':&nbsp;</td>';
$aus['global3'].='<td><select name="bb_textcolor">
<option value="#000000" style="color :#000000;" ' . ( ( $config['bb_textcolor'] == "#000000" ? "selected" : "" ) ) . '>&nbsp;Textcolor&nbsp;</option>
<option value="#000066" style="color :#000066;" ' . ( ( $config['bb_textcolor'] == "#000066" ? "selected" : "" ) ) . '>&nbsp;Textcolor&nbsp;</option>
<option value="#800000" style="color :#800000;" ' . ( ( $config['bb_textcolor'] == "#800000" ? "selected" : "" ) ) . '>&nbsp;Textcolor&nbsp;</option>
<option value="#990000" style="color :#990000;" ' . ( ( $config['bb_textcolor'] == "#990000" ? "selected" : "" ) ) . '>&nbsp;Textcolor&nbsp;</option>
<option value="#006600" style="color :#006600;" ' . ( ( $config['bb_textcolor'] == "#006600" ? "selected" : "" ) ) . '>&nbsp;Textcolor&nbsp;</option>
<option value="#996600" style="color :#996600;" ' . ( ( $config['bb_textcolor'] == "#996600" ? "selected" : "" ) ) . '>&nbsp;Textcolor&nbsp;</option>
<option value="#999999" style="color :#999999;" ' . ( ( $config['bb_textcolor'] == "#999999" ? "selected" : "" ) ) . '>&nbsp;Textcolor&nbsp;</option>
</select></td></tr></table>';
$aus['global3'].='</td></tr><tr><td>' . Help("","") . 'SQL-Grid:&nbsp;</td>';
$aus['global3'].='<td><input type="radio" class="radio" name="interface_table_compact" value="0" ' . ( ( $config['interface_table_compact'] == 0 ) ? 'checked' : '' ) . '>&nbsp;normal&nbsp;&nbsp;&nbsp;';
$aus['global3'].='<input type="radio" class="radio" name="interface_table_compact" value="1" ' . ( ( $config['interface_table_compact'] == 1 ) ? 'checked' : '' ) . '>&nbsp;compact</td></tr>';
$aus['global3'].='</table></fieldset>'.print_save_button().'</div>';
//automatisches L&ouml;schen-->
$aus['global2']='<div id="global2"><fieldset><legend>' . $lang['config_autodelete'] . '</legend><table>';
$aus['global2'].='<tr><td>' . Help($lang['help_ad1'],"conf8") . $lang['autodelete'] . ':&nbsp;</td>';
$aus['global2'].='<td><input type="radio" class="radio" value="1" name="auto_delete" ' . ( ( $config['auto_delete'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['activated'];
$aus['global2'].='&nbsp;&nbsp;&nbsp;<input type="radio" class="radio" value="0" name="auto_delete" ' . ( ( $config['auto_delete'] == 0 ) ? " checked" : "" ) . '>&nbsp;' . $lang['not_activated'];
$aus['global2'].='</td>';
$aus['global2'].='</tr><tr><td>' . Help($lang['help_ad3'],"conf10") . $lang['number_of_files_form'] . ':&nbsp;</td>';
$aus['global2'].='<td><input type="text" class="text" size="3" name="max_backup_files" value="' . $config['max_backup_files'] . '"> ';
$aus['global2'].='</td></tr></table></fieldset>'.print_save_button().'</div>';
//Email-->
if (!isset($config['email_recipient_cc'])) $config['email_recipient_cc']=''; // backwards compatibility if field is undefined
$aus['transfer1']='<div id="transfer1"><fieldset><legend>' . $lang['config_email'] . '</legend><table>';
$aus['transfer1'].='<tr><td>' . $lang['send_mail_form'] . ':&nbsp;</td>';
$aus['transfer1'].='<td><input type="radio" class="radio" value="1" name="send_mail" ' . ( ( $config['send_mail'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['yes'];
$aus['transfer1'].='&nbsp;&nbsp;&nbsp;<input type="radio" class="radio" value="0" name="send_mail" ' . ( ( $config['send_mail'] == 0 ) ? " checked" : "" ) . '>&nbsp;' . $lang['no'];
$aus['transfer1'].='</td></tr><tr><td>' . $lang['email_adress'] . ':&nbsp;</td><td><input type="text" class="text" name="email0" value="' . $config['email_recipient'] . '" size="30"></td></tr>';
$aus['transfer1'].='<tr><td>' . $lang['email_cc'] . ':&nbsp;</td><td><input type="text" class="text" name="email_recipient_cc" value="' . $config['email_recipient_cc'] . '" size="60" maxlength="255"></td></tr>';
$aus['transfer1'].='<tr><td>' . $lang['email_subject'] . ':&nbsp;</td><td><input type="text" class="text" name="email1" value="' . $config['email_sender'] . '" size="30"></td></tr>';
$aus['transfer1'].='<tr><td>' . $lang['send_mail_dump'] . ':&nbsp;</td><td>';
$aus['transfer1'].='<input type="radio" class="radio" value="1" name="send_mail_dump" ' . ( ( $config['send_mail_dump'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['yes'];
$aus['transfer1'].='&nbsp;&nbsp;&nbsp;<input type="radio" class="radio" value="0" name="send_mail_dump"' . ( ( $config['send_mail_dump'] == 0 ) ? " checked" : "" ) . '>&nbsp;' . $lang['no'];
$aus['transfer1'].='</td></tr><tr><td>' . $lang['email_maxsize'] . ':&nbsp;</td><td>';
$aus['transfer1'].='<input type="text" class="text" name="email_maxsize1" size="3" maxlength="3" value="' . $config['email_maxsize1'] . '">&nbsp;&nbsp;';
$aus['transfer1'].='<select name="email_maxsize2"><option value="1" ' . ( ( $config['email_maxsize2'] == 1 ) ? ' SELECTED' : '' ) . '>Kilobytes</option>';
$aus['transfer1'].='<option value="2" ' . ( ( $config['email_maxsize2'] == 2 ) ? ' SELECTED' : '' ) . '>Megabytes</option></select></td></tr>';
$aus['transfer1'].='<tr><td>' . $lang['cron_mailprg'] . ':&nbsp;</td>';
$aus['transfer1'].='<td><table><tr><td><input type="radio" class="radio" name="cron_use_sendmail" value="1" ' . ( ( $config['cron_use_sendmail'] == 1 ) ? " checked" : "" ) . '>&nbsp;sendmail</td><td><input type="text" class="text" size="30" name="cron_sendmail" value="' . $config['cron_sendmail'] . '"></td></tr>';
$aus['transfer1'].='<tr><td><input type="radio" class="radio" name="cron_use_sendmail" value="0" ' . ( ( $config['cron_use_sendmail'] == 0 ) ? " checked" : "" ) . '>&nbsp;SMTP</td><td><input type="text" class="text" size="30" name="cron_smtp" value="' . $config['cron_smtp'] . '"></td></tr><tr><td>&nbsp;</td><td>SMTP-Port: <strong>' . $config['cron_smtp_port'] . '</strong></td></tr>';
$aus['transfer1'].='</table></td></tr></table></fieldset>'.print_save_button().'</div>';
//FTP-->
$aus['transfer2']='<div id="transfer2"><fieldset><legend>' . $lang['config_ftp'] . '</legend>';
for ($i=0; $i < 3; $i++)
{
$aus['transfer2'].='<fieldset><legend>FTP-Connection ' . ( $i + 1 ) . '</legend><table>';
$aus['transfer2'].='<tr><td>' . Help($lang['help_ftptransfer'],"") . $lang['ftp_transfer'] . ':&nbsp;</td>';
$aus['transfer2'].='<td><input type="radio" class="radio" value="1" name="ftp_transfer[' . $i . ']" ' . ( ( !extension_loaded("ftp") ) ? "disabled " : "" ) . ( ( $config['ftp_transfer'][$i] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['activated'];
$aus['transfer2'].='&nbsp;&nbsp;&nbsp;<input type="radio" class="radio" value="0" name="ftp_transfer[' . $i . ']" ' . ( ( $config['ftp_transfer'][$i] == 0 ) ? " checked" : "" ) . '>&nbsp;' . $lang['not_activated'] . '</td></tr>';
$aus['transfer2'].='<tr><td>' . Help($lang['help_ftptimeout'],"") . $lang['ftp_timeout'] . ':&nbsp;</td>';
$aus['transfer2'].='<td><input type="text" class="text" size="10" name="ftp_timeout[' . $i . ']" maxlength="3" style="text-align:right;" value="' . $config['ftp_timeout'][$i] . '">&nbsp;sec</td></tr>';
$aus['transfer2'].='<tr><td>' . Help($lang['help_ftp_mode'],"") . $lang['ftp_choose_mode'] . ':&nbsp;</td>';
$aus['transfer2'].='<td><input type="checkbox" class="checkbox" name="ftp_mode[' . $i . ']" value="1" ' . ( ( $config['ftp_mode'][$i] == 1 ) ? 'checked' : '' ) . '>&nbsp;';
$aus['transfer2'].=$lang['ftp_passive'] . '</td></tr><tr><td colspan="2">';
$aus['transfer2'].='<tr><td>' . Help($lang['help_ftpssl'],"") . $lang['ftp_ssl'] . ':&nbsp;</td>';
$aus['transfer2'].='<td><input type="checkbox" class="checkbox" name="ftp_useSSL[' . $i . ']" value="1" ' . ( ( $config['ftp_useSSL'][$i] == 1 ) ? 'checked' : '' ) . ' ' . ( ( !extension_loaded("openssl") ) ? "disabled " : "" ) . '>';
$aus['transfer2'].='&nbsp;<span ' . ( ( !extension_loaded("openssl") ) ? 'style="color:#999999;"' : '' ) . '>' . $lang['ftp_useSSL'] . '</span></td></tr><tr><td colspan="2">';
$aus['transfer2'].='<tr><td><input type="submit" name="testFTP' . $i . '" value="' . $lang['testconnection'] . '" class="Formbutton"><br>' . $checkFTP[$i] . '</td><td><table>';
$aus['transfer2'].='<tr><td class="small">' . Help($lang['help_ftpserver'],"conf14",12) . $lang['ftp_server'] . ':&nbsp;</td><td><input class="text" type="text" size="30" name="ftp_server[' . $i . ']" value="' . $config['ftp_server'][$i] . '"></td></tr>';
$aus['transfer2'].='<tr><td class="small">' . Help($lang['help_ftpport'],"conf15",12) . $lang['ftp_port'] . ':&nbsp;</td><td class="small"><input class="text" type="text" size="30" name="ftp_port[' . $i . ']" value="' . $config['ftp_port'][$i] . '"></td></tr>';
$aus['transfer2'].='<tr><td class="small">' . Help($lang['help_ftpuser'],"conf16",12) . $lang['ftp_user'] . ':&nbsp;</td><td class="small"><input class="text" type="text" size="30" name="ftp_user[' . $i . ']" value="' . $config['ftp_user'][$i] . '"></td></tr>';
$aus['transfer2'].='<tr><td class="small">' . Help($lang['help_ftppass'],"conf17",12) . $lang['ftp_pass'] . ':&nbsp;</td><td class="small"><input class="text" type="password" size="30" name="ftp_pass[' . $i . ']" value="' . $config['ftp_pass'][$i] . '"></td></tr>';
$aus['transfer2'].='<tr><td class="small">' . Help($lang['help_ftpdir'],"conf18",12) . $lang['ftp_dir'] . ':&nbsp;</td><td class="small"><input class="text" type="text" size="30" name="ftp_dir[' . $i . ']" value="' . $config['ftp_dir'][$i] . '"></td></tr>';
$aus['transfer2'].='</table></td></tr></table>'.print_save_button().'</fieldset>';
}
$aus['transfer2'].='</fieldset></div>';
//Crondump
$aus['cron']='<div id="cron"><fieldset><legend>' . $lang['config_cronperl'] . '</legend><table>';
$aus['cron'].='<tr><td>' . Help($lang['help_cronextender'],"") . $lang['cron_extender'] . ':&nbsp;</td>';
$aus['cron'].='<td><input type="radio" class="radio" value="0" name="cron_extender" ' . ( ( $config['cron_extender'] == 0 ) ? " checked" : "" ) . '>&nbsp;.pl';
$aus['cron'].='&nbsp;&nbsp;&nbsp;<input type="radio" class="radio" value="1" name="cron_extender" ' . ( ( $config['cron_extender'] == 1 ) ? " checked" : "" ) . '>&nbsp;.cgi';
$aus['cron'].='</tr><tr><td>' . Help($lang['help_cronexecpath'],"") . $lang['cron_execpath'] . ':&nbsp;</td>';
$aus['cron'].='<td><input type="text" class="text" size="30" name="cron_execution_path" value="' . $config['cron_execution_path'] . '"></td>';
$aus['cron'].='</tr><tr><td>' . Help($lang['help_cronprintout'],"") . $lang['cron_printout'] . ':&nbsp;</td>';
$aus['cron'].='<td><input type="radio" class="radio" value="1" name="cron_printout" ' . ( ( $config['cron_printout'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['yes'];
$aus['cron'].='&nbsp;&nbsp;&nbsp;<input type="radio" class="radio" value="0" name="cron_printout" ' . ( ( $config['cron_printout'] == 0 ) ? " checked" : "" ) . '>&nbsp;' . $lang['no'] . '</td></tr>';
$aus['cron'].='<tr><td>' . Help($lang['help_croncompletelog'],"") . $lang['cron_completelog'] . ':&nbsp;</td>';
$aus['cron'].='<td><input type="radio" class="radio" value="1" name="cron_completelog" ' . ( ( $config['cron_completelog'] == 1 ) ? " checked" : "" ) . '>&nbsp;' . $lang['yes'];
$aus['cron'].='&nbsp;&nbsp;&nbsp;<input type="radio" class="radio" value="0" name="cron_completelog" ' . ( ( $config['cron_completelog'] == 0 ) ? " checked" : "" ) . '>&nbsp;' . $lang['no'] . '</td></tr>';
$aus['cron'].='<tr><td>' . Help($lang['help_crondbindex'],"conf14") . $lang['cron_crondbindex'] . ':&nbsp;</td>';
$aus['cron'].='<td><select name="cron_dbindex" id="cron_dbindex">';
$aus['cron'].='<option value="-3" ';
if ($config['cron_dbindex'] == -3) $aus['cron'].='SELECTED';
$aus['cron'].='>' . $lang['multidumpall'] . "</option>\n";
$aus['cron'].='<option value="-2" ';
if ($config['cron_dbindex'] == -2) $aus['cron'].='SELECTED';
$aus['cron'].='>' . $lang['multidumpconf'] . "</option>\n";
if (isset($databases['Name'][0]) && $databases['Name'][0] > '')
{
$datenbanken=count($databases['Name']);
for ($i=0; $i < $datenbanken; $i++)
{
$aus['cron'].='<option value="' . $i . '" ';
if ($i == $config['cron_dbindex']) $aus['cron'].='SELECTED';
$aus['cron'].='>' . $databases['Name'][$i] . "</option>\n";
}
}
else
{
$config['cron_dbindex']=0;
}
$aus['cron'].='</select>' . "\n";
$aus['cron'].='</td></tr>';
// comment
$aus['cron'].='<tr><td>' . $lang['cron_comment'] . ':&nbsp;</td>';
$aus['cron'].='<td><input type="text" class="text" name="cron_comment" size="30" maxlength="100" value="' . htmlspecialchars($config['cron_comment']) . '"></td></tr>';
$aus['cron'].='</table></fieldset>'.print_save_button().'</div>';
//Formular-Buttons -->
$aus['formende']='</div></form><br style="clear:both;">';
// AUSGABE
echo $aus['formstart'];
echo $aus['db'];
echo $aus['global1'];
echo $aus['global2'];
echo $aus['global3'];
echo $aus['transfer1'];
echo $aus['transfer2'];
echo $aus['cron'];
echo $aus['conf'];
echo $aus['formende'];
echo '<script language="JavaScript" type="text/javascript">show_pardivs("' . $sel . '");';
// Wenn irgendetwas beim Wechsel eines Users nicht stimmt oder keine Db gefunden wurde oder eine DB nicht hinzugefügt
// werden konnte --> User mit der Nase drauf stossen und Verbindungsdaten einblenden
if (( $showVP ) || ( !isset($databases['Name']) ) || ( isset($databases['name']) && count($databases['Name'] == 0) ) || ( isset($add_db_message) )) echo 'SwitchVP();';
echo '</script>';
echo MSDFooter();
$_SESSION['config']=$config;
?>

BIN
css/msd/icons/arrow_down.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/arrow_up.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/arrowdown.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/arrowleft.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/arrowup.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/blank.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/browse.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/close.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/delete.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/edit.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/gz.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/index.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/key_fulltext.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/key_nokey.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/key_primary.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/key_unique.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/mysql_help.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/notok.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/ok.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/openfile.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/rename.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/icons/search.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/bg-body.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/bg-buttons.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/bg-headings.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/blank.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/body_bg.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/h1_logo.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/logo.jpg Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/loveyourdata.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/mainnavi.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/navi_bg.jpg Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/overall_bg.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd/pics/pagetitle.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

587
css/msd/style.css Normale Datei
Datei anzeigen

@ -0,0 +1,587 @@
/*
@copyright MySQLDumper - Daniel Schlichtholz <http://www.mysqldumper.de>
@author Ingo Wagener <http://www.vorderdeck.de>, Daniel Schlichtholz
@date 2008-02-28 13:39:07
@lastmodified 2009-07-01 21:56:00
@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;
border-top: 5px solid #256777;
background: #fff url(pics/bg-body.gif) repeat-x 0 5px;
}
body.content {
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;
}
.version {
display: block;
position: relative;
top: -15px;
z-index: 5;
text-align: center;
font-size: 11px;
height: 100px;
}
.small {
font-size: 11px;
}
.ssmall {
font-size: 10px;
}
.success {
font-weight: bold;
}
.error {
color: #E87B00;
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 {
margin-top: 1px;
background: url(pics/navi_bg.jpg) no-repeat;
text-align: left;
}
#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: 4px 6px;
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.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;
padding: 2px;
cursor: pointer;
white-space: nowrap;
overflow: visible;
}
#content .Formtext {
overflow: hidden;
}
#content .ConfigButtonSelected {
color: #256777;
}
#content .ConfigButton,#content .ConfigButtonSelected {
width: 160px;
margin-bottom: 4px;
}
#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;
}
/* for Geckos */
input[disabled] {
color: #888;
}
/*horizontal menu */
#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;
}
/* 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: 18px;
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;
}
#selectConfig {
border: 0;
}
#footer a {
text-decoration: none;
}
#footer a:hover {
text-decoration: underline;
}
#ilog {
border: 1px solid #ddd !important;
padding: 12px;
background-color: #fcfcfc;
}

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/blank.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/browse.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/close.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/delete.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/edit.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/gz.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/index.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/nokey.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/notok.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/ok.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/rename.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/icons/search.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/pics/body_bg.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/pics/h1_logo.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

BIN
css/msd_green/pics/navi_bg.jpg Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

Binäre Datei nicht angezeigt.

Nachher

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

674
css/msd_green/style.css Normale Datei
Datei anzeigen

@ -0,0 +1,674 @@
/* MySQLDumper STYLESHEET
Name: msd_green
*/
*,.normargin {
margin: 0;
padding: 0;
}
img {
border: 0;
}
body {
font: 12px/1.5 Verdana, Helvetica, sans-serif;
color: #4E5665;
background: #C7D1D0;
}
.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: 32px;
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 {
margin:0px;
top:0px;
border-top:1px solid #A9B0BD;
background: url(pics/navi_bg.jpg) no-repeat;
text-align: center;
background-color: #738C88;
height: 100%;
}
#menu ul {
margin-top: 174px;
padding: 0;
list-style: none;
border-top: 1px solid #9AA2B1
}
#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;
}
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
:
1
px
solid
#738C88
;
font-size
:
11
px
;
}
.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;
cursor: pointer;
}
#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;
}
/*horizontales Menü */
#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;
}
#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;
}

466
dump.php Normale Datei
Datei anzeigen

@ -0,0 +1,466 @@
<?php
session_name('MySQLDumper');
session_start();
ob_start();
error_reporting(E_ALL);
$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_once ( './' . $config['files']['parameter'] );
include_once ( './inc/mysql.php' );
include_once ( './language/' . $config['language'] . '/lang.php' );
include_once ( './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;
}
$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['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'];
}
//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']);
// 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['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['dbs'] . ')' : $lang['db'] . ': ' . $databases['Name'][$dump['dbindex']] . ( ( $databases['praefix'][$dump['dbindex']] != '' ) ? ' (' . $lang['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['error'] . ': ' . sprintf($lang['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['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['file'] . ' <a href="' . $config['paths']['backup'] . $mpdatei . '" class="smallblack">' . $mpdatei . ' (' . $sz . ')</a> ' . $lang['dump_successful'] . '<br>';
}
}
else
{
clearstatcache();
$out.=$lang['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>';
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['fatal_error_dump'],$table,$adbname) . ': ' . mysql_error($config['dbconnection']);
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++)
{
//$a.=$databases['multi'][$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['dump_headline'] . '</h4>';
if ($dump['kommentar'] > '') $aus[]=$lang['comment'] . ': <span><em>' . $dump['kommentar'] . '</em></span><br>';
$aus[]=( $config['multi_dump'] == 1 ) ? $lang['db'] . ': ' . $mudbs : $lang['db'] . ': <strong>' . $databases['Name'][$dump['dbindex']] . '</strong>';
$aus[]=( ( $databases['praefix'][$dump['dbindex']] != '' ) ? ' (' . $lang['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['dump_filename'] . '<b>' . $dump['backupdatei'] . '</b><br>' . $lang['charset'] . ': <strong>' . $dump['dump_encoding'] . '</strong>' .
'<br>' . $lang['filesize'] . ': <b>' . byte_output($dump['filesize']) . '</b><br><br>' . $lang['gzip_compression'] . ' <b>';
$aus[]=( $config['compression'] == 1 ) ? $lang['activated'] : $lang['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['saving_table'] . '<b>' . ( $dump['table_offset'] + 1 ) . '</b> ' . $lang['of'] . '<b> ' . sizeof($dump['tables']) . '</b><br>' . $lang['actual_table'] . ': <b>' . $table . '</b><br><br>' . $lang['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['entry'] . ' <b>' . number_format($eintrag,0,',','.') . '</b> ' . $lang['upto'] . ' <b>' . number_format(( $zeilen_gesamt ),0,',','.') . '</b> ' . $lang['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['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'] . ' pages' . $aus2;
$aus[]=( $dump['errors'] > 0 ) ? ', <span style="color:red;">' . $dump['errors'] . ' errors</span>' : '';
$aus[]='</p>';
}
else
$dump['table_offset']++;
//////////////////////////////////////
// Ende Anzeige
//////////////////////////////////////
WriteToDumpFile();
flush();
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'],0755);
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['file'] . ' <a href="' . $config['paths']['backup'] . $mpdatei . '" class="smallblack">' . $mpdatei . ' (' . $sz . ')</a> ' . $lang['dump_successful'] . '<br>';
}
}
else
$out.="\n" . '<div class="backupmsg">' . $lang['file'] . ' <a href="' . $config['paths']['backup'] . $dump['backupdatei'] . '" class="smallblack">' . $dump['backupdatei'] . ' (' . byte_output(filesize($config['paths']['backup'] . $dump['backupdatei'])) . ')' . '</a>' . $lang['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['done'] . '</strong><br>';
if ($config['multi_dump'] == 1)
{
$aus[]=sprintf($lang['multidump'],count($databases['multi'])) . ': ';
$aus[]='<strong>' . implode(', ',$databases['multi']) . '</strong>';
$aus2='';
$out='';
}
else
{
$aus[]='<br>' . sprintf($lang['dump_endergebnis'],$num_tables,number_format($dump['countdata'],0,',','.'));
}
if ($dump['errors'] > 0) $aus[]=sprintf($lang['dump_errors'],$dump['errors']);
$aus[]='<form action="" method="POST">' . $out . '<br>' . '<p class="small">' . zeit_format($xtime) . ', ' . $dump['aufruf'] . ' pages' . $aus2 . '</p>' . "\n";
$aus[]="\n" . '<br><input class="Formbutton" type="button" value="' . $lang['back_to_control'] . '" onclick="self.location.href=\'' . $relativ_path . 'filemanagement.php\'">';
$aus[]='&nbsp;&nbsp;&nbsp;<input class="Formbutton" type="button" value="' . $lang['back_to_minisql'] . '" onclick="self.location.href=\'' . $relativ_path . 'sql.php\'">';
$aus[]='&nbsp;&nbsp;&nbsp;<input class="Formbutton" type="button" value="' . $lang['back_to_overview'] . '" onclick="self.location.href=\'' . $relativ_path . 'main.php?action=db&amp;dbid=' . $dump['dbindex'] . '#dbid\'"><br><br>';
$aus[]='</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='';
$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 . '</body></html>';
echo $complete_page;
ob_end_flush();
?>

559
filemanagement.php Normale Datei
Datei anzeigen

@ -0,0 +1,559 @@
<?php
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' );
get_sql_encodings();
echo MSDHeader();
$msg='';
$dump=array();
$dirs=Array(
"",
"./",
"./inc/",
"./msd_cron/",
"./language/",
"./work/config/"
);
if ($config['auto_delete'] == 1) $msg=AutoDelete();
//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;
$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['fm_restore'] . ': ' . $file);
// if we can't detect encoding ask user
echo '<br>' . $lang['choose_charset'] . '<br><br>';
echo '<form action="filemanagement.php?action=restore&amp;kind=0" method="POST">';
echo '<table><tr><td>' . $lang['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['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['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['fm_nofile'] . '</p>';
}
//--------------------------------------------------------
//*** Abfrage ob Delete ***
//--------------------------------------------------------
$del=array();
if (isset($_POST['delete']))
{
if (isset($_POST['file']))
{
$file=$_POST['file'];
if ($_POST['multi'] == 1)
{
$delfiles=Array();
for ($i=0; $i < count($_POST['file']); $i++)
{
if ($_POST['multipart'][$i] == 0)
{
$delfiles[]=$_POST['file'][$i];
}
else
{
$delfiles[]=substr($_POST['file'][$i],0,strpos($_POST['file'][$i],"_part_")) . "*.*";
}
}
for ($i=0; $i < count($delfiles); $i++)
{
$del=array_merge($del,DeleteFilesM($fpath,$delfiles[$i]));
}
}
else
{
if ($_POST['multipart'][0] == 0)
{
$delfiles[]=$_POST['file'][0];
}
else
{
$delfiles[]=substr($_POST['file'][0],0,strpos($_POST['file'][0],"_part_")) . "*.*";
}
$del=array_merge($del,DeleteFilesM($fpath,$delfiles[0]));
}
}
else
$msg.='<p class="error">' . $lang['fm_nofile'] . '</p>';
}
if (isset($_POST['deleteauto'])) $msg.='<p class="small">' . AutoDelete() . '</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))
{
foreach ($del as $filename=>$success)
{
if ($success)
{
$msg.='<span class="small">';
$msg.=$lang['fm_delete1'] . ' \'' . $filename . '\' ' . $lang['fm_delete2'];
WriteLog("deleted '$filename'.");
$msg.='</span><br>';
}
else
{
$msg.='<span class="small error">';
$msg.=$lang['fm_delete1'] . ' \'' . $filename . '\' ' . $lang['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['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['fm_uploadnotallowed1'] . "<br>";
$msg.=$lang['fm_uploadnotallowed2'] . "</font>";
}
else
{
if (!$error)
{
if (move_uploaded_file($_FILES['upfile']['tmp_name'],$fpath . $_FILES['upfile']['name'])) @chmod($fpath . $upfile_name,0755);
else $error.="<font color=\"red\">" . $lang['fm_uploadmoveerror'] . "<br>";
}
if ($error) $msg.=$error . "<font color=\"red\">" . $lang['fm_uploadfailed'] . "</font><br>";
}
}
else
$msg.="<font color=\"red\">" . $lang['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['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['fm_comment'] . ':</td><td><input type="text" class="text" style="width:260px;" name="dumpKommentar" value="' . $dk . '"></td></tr>';
$autodel='<p class="autodel">' . $lang['autodelete'] . ": ";
$autodel.=( $config['auto_delete'] == 0 ) ? $lang['not_activated'] : $lang['activated'] . ' (' . $config['max_backup_files'] . ' ' . $lang['max_backup_files_each2'] . ')';
$autodel.='</p>';
//Fallunterscheidung
switch ($action)
{
case 'dump':
//Variablen
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=Realpfad("./") . $config['paths']['config'];
$cronabsolute=( substr($config['cron_execution_path'],0,1) == "/" ) ? $_SERVER['DOCUMENT_ROOT'] . $scriptdir : Realpfad("./") . $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['fm_dump_header'] . ' <span class="small">("' . $lang['config_headline'] . ': ' . $config['config_file'] . '")</span>');
if (!is_writable($config['paths']['backup'])) die('<span class="error">' . sprintf($lang['wrong_rights'],'work/backup','777') . '</span>');
echo ( $msg > '' ) ? $msg . '<br>' : '';
echo $autodel;
//Auswahl
echo '<div>
<input type="button" value=" ' . $lang['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['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['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['fm_startdump'] . '"><br>';
echo '<fieldset>
<legend></legend>';
echo '<table>';
echo $tbl_abfrage;
echo '<tr><td><label for "sel_dump_encoding">' . $lang['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['mysql_connection_encoding'] . ':</td><td><strong>' . $config['mysql_standard_character_set'] . '</strong></td></tr>';
echo '</table></form></div>';
echo '</fieldset>';
echo '<h6>' . $lang['fm_dumpsettings'] . ' (PHP)</h6>';
echo '<table>';
echo '<tr><td>' . $lang['db'] . ':</td><td><strong>';
if ($config['multi_dump'] == 1)
{
echo 'Multidump (' . count($databases['multi']) . ' ' . $lang['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['praefix'] . ':</td><td><strong>';
echo $databases['praefix'][$databases['db_selected_index']];
echo '</strong></td></tr>';
}
echo '<tr><td>' . $lang['gzip'] . ':</td><td><strong>' . ( ( $config['compression'] == 1 ) ? $lang['activated'] : $lang['not_activated'] );
echo '</strong></td></tr>';
echo '<tr><td>' . $lang['multi_part'] . ':</td><td><strong>' . ( ( $config['multi_part'] == 1 ) ? $lang['yes'] : $lang['no'] );
echo '</strong></td></tr>';
if ($config['multi_part'] == 1)
{
echo '<tr><td>' . $lang['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['withattach'] : $lang['withoutattach'] );
}
echo '<tr><td>' . $lang['send_mail_form'] . ':</td><td><strong>' . ( ( $config['send_mail'] == 1 ) ? $t : $lang['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['ftp_transfer'],sprintf(str_replace('<br>',' ',$lang['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"><br><img src="' . $config['files']['iconpath'] . 'progressbar_speed.gif"></div>';
echo '</div><div id="buperl" style="display:none;">';
//crondumpsettings
echo '<h6>' . $lang['dump'] . ' (PERL)</h6>';
echo '<p><input class="Formbutton" type="Button" name="DoCronscript" value="' . $lang['DoCronButton'] . '" onclick="self.location.href=\'' . $scriptref . '\'">&nbsp;&nbsp;';
echo '<input class="Formbutton" type="Button" name="DoPerlTest" value="' . $lang['DoPerlTest'] . '" onclick="self.location.href=\'' . $sfile . '\'">&nbsp;&nbsp;';
echo '<input class="Formbutton" type="Button" name="DoSimpleTest" value="' . $lang['DoSimpleTest'] . '" onclick="self.location.href=\'' . $simplefile . '\'"></p>';
echo '<h6>' . $lang['fm_dumpsettings'] . ' (PERL)</h6>';
if ($config['cron_dbindex'] == -3)
{
$cron_dbname=$lang['multidumpall'];
$cron_dbpraefix="";
}
elseif ($config['cron_dbindex'] == -2)
{
//$cron_dbname='Multidump ('.count($databases['multi']).' '.$lang['dbs'].')';
$cron_dbname='Multidump (' . count($databases['multi']) . ' ' . $lang['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['db'] . ':</td><td><strong>' . $cron_dbname . '</strong></td></tr>';
if ($cron_dbpraefix > '')
{
echo '<tr><td>' . $lang['praefix'] . ":</td><td><strong>";
echo $cron_dbpraefix . '</strong></td></tr>';
}
echo '<tr><td>' . $lang['gzip'] . ":</td><td><strong>" . ( ( $config['cron_compression'] == 1 ) ? $lang['activated'] : $lang['not_activated'] );
echo '</strong></td></tr>';
echo '<tr><td>' . $lang['multi_part'] . ":</td><td><strong>" . ( ( $config['multi_part'] == 1 ) ? $lang['yes'] : $lang['no'] );
echo '</strong></td></tr>';
if ($config['multi_part'] == 1)
{
echo '<tr><td>' . $lang['multi_part_groesse'] . ':</td><td><strong>' . byte_output($config['multipart_groesse']) . '</td></tr>';
}
echo '<tr><td>' . $lang['cron_printout'] . ':</td><td><strong>' . ( ( $config['cron_printout'] == 1 ) ? $lang['activated'] : $lang['not_activated'] ) . '</strong></td></tr>';
if ($config['send_mail'] == 1)
{
$t=$config['email_recipient'] . ( ( $config['send_mail_dump'] == 1 ) ? $lang['withattach'] : $lang['withoutattach'] );
}
echo '<tr><td>' . $lang['send_mail_form'] . ':</td><td><strong>' . ( ( $config['send_mail'] == 1 ) ? $t : $lang['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['ftp_transfer'],sprintf(str_replace('<br>',' ',$lang['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['perloutput1'] . ':<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>' . $scriptentry . '</strong><br>';
echo $lang['perloutput2'] . ':<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>' . $scriptref . '</strong><br>';
echo $lang['perloutput3'] . ':<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>' . $cronref . '</strong></p>';
echo '</div>';
break;
case 'restore':
echo headline(sprintf($lang['fm_restore_header'],$databases['db_actual']));
echo '<div id="content">';
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['fm_restore'] . '" onclick="if (!confirm(\'' . $lang['fm_alertrestore1'] . ' `' . $databases['db_actual'] . '` ' . $lang['fm_alertrestore2'] . ' `\' + GetSelectedFilename() + \'` ' . $lang['fm_alertrestore3'] . '\')) return false;">';
echo '<input class="Formbutton" name="restore" type="submit" value="' . $lang['restore_of_tables'] . '" onclick="if (!confirm(\'' . $lang['fm_alertrestore1'] . ' `' . $databases['db_actual'] . '` ' . $lang['fm_alertrestore2'] . ' `\' + GetSelectedFilename() + \'` ' . $lang['fm_alertrestore3'] . '\')) return false; 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['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['fm_delete'] . '" onclick="if (!confirm(\'' . $lang['fm_askdelete1'] . '`\' + GetSelectedFilename() + \'`' . $lang['fm_askdelete2'] . '\')) return false;">';
echo '<input class="Formbutton" name="deleteauto" type="submit" value="' . $lang['fm_deleteauto'] . '" onclick="if (!confirm(\'' . $lang['fm_askdelete3'] . '\')) return false;">';
echo '<input class="Formbutton" name="deleteall" type="submit" value="' . $lang['fm_deleteall'] . '" onclick="if (!confirm(\'' . $lang['fm_askdelete4'] . '\')) return false;">';
echo '<input class="Formbutton" name="deleteallfilter" type="submit" value="' . $lang['fm_deleteallfilter'] . $databases['db_actual'] . $lang['fm_deleteallfilter2'] . '" onclick="if (!confirm(\'' . $lang['fm_askdelete5'] . $databases['db_actual'] . $lang['fm_askdelete5_2'] . '\')) return false;">';
echo FileList() . '</form>';
echo '<h6>' . $lang['fm_fileupload'] . '</h6>';
echo '<div align="left"><form action="' . $href . '" method="POST" enctype="multipart/form-data">';
echo '<input type="file" name="upfile" class="Formbutton" size="60">';
echo '<input type="submit" name="upload" value="' . $lang['fm_fileupload'] . '" class="Formbutton">';
echo '<br>' . $lang['max_upload_size'] . ': <strong>' . $config['upload_max_filesize'] . '</strong>';
echo '<br>' . $lang['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['converter'] . '">';
echo '</div>';
break;
case "convert":
// Konverter
echo headline($lang['converter']);
echo '<br><br><form action="filemanagement.php?action=convert" method="post">';
echo '<div align="center"><table class="bdr"><tr><th colspan="2">' . $lang['convert_title'] . '</th></tr>';
echo '<tr><td>' . $lang['convert_file'] . '</td><td>' . FilelisteCombo($config['paths']['backup'],$selectfile) . '</td></tr>';
echo '<tr><td>' . $lang['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" : "" ) . '>' . $lang['compressed'] . '</td>';
echo '<td><input type="submit" name="startconvert" value=" ' . $lang['convert_start'] . ' " class="Formbutton"></td></tr>';
echo '</table></div></form><br>';
if (isset($_POST['startconvert']))
{
//$destfile.=($compressed==1) ? ".sql.gz" : ".sql";
echo $lang['converting'] . " $selectfile ==&gt; $destfile<br>";
if ($selectfile != "" && file_exists($config['paths']['backup'] . $selectfile) && strlen($destfile) > 2)
{
Converter($selectfile,$destfile,$compressed);
}
else
echo $lang['convert_wrong_parameters'];
}
}
echo MSDFooter();
?>

57
help.php Normale Datei
Datei anzeigen

@ -0,0 +1,57 @@
<?php
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['credits']);
include ( MSD_PATH . 'language/' . $config['language'] . '/help.php' );
echo MSDFooter();
?>
<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>

BIN
images/blank.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
images/logo.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

BIN
images/paypal-de.gif Normale Datei

Binäre Datei nicht angezeigt.

Nachher

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

27
inc/define_icons.php Normale Datei
Datei anzeigen

@ -0,0 +1,27 @@
<?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['title_show_data'] . '" title="' . $lang['title_show_data'] . '">';
$icon['edit']='<img src="' . $config['files']['iconpath'] . 'edit.gif" alt="' . $lang['edit'] . '" title="' . $lang['edit'] . '">';
$icon['delete']='<img src="' . $config['files']['iconpath'] . 'delete.gif" alt="' . $lang['delete'] . '" title="' . $lang['delete'] . '">';
$icon['index']='<img src="' . $config['files']['iconpath'] . 'index.gif" alt="' . $lang['title_index'] . '" title="' . $lang['title_index'] . '">';
$icon['key_primary']='<img src="' . $config['files']['iconpath'] . 'key_primary.gif" alt="' . $lang['title_key_primary'] . '" title="' . $lang['title_key_primary'] . '">';
$icon['key_fulltext']='<img src="' . $config['files']['iconpath'] . 'key_fulltext.gif" alt="' . $lang['title_key_fulltext'] . '" title="' . $lang['title_key_fulltext'] . '">';
$icon['key_unique']='<img src="' . $config['files']['iconpath'] . 'key_unique.gif" alt="' . $lang['title_key_unique'] . '" title="' . $lang['title_key_unique'] . '">';
$icon['key_nokey']='<img src="' . $config['files']['iconpath'] . 'key_nokey.gif" alt="' . $lang['title_nokey'] . '" title="' . $lang['title_nokey'] . '">';
$icon['table_truncate']='<img src="' . $config['files']['iconpath'] . 'table_truncate.gif" alt="' . $lang['empty'] . '" title="' . $lang['empty'] . '">';
$icon['table_truncate_reset']='<img src="' . $config['files']['iconpath'] . 'table_truncate_reset.gif" alt="' . $lang['emptykeys'] . '" title="' . $lang['emptykeys'] . '">';
$icon['back2db_overview']='<img src="' . $config['files']['iconpath'] . 'arrowleft.gif" alt="' . $lang['sql_backdboverview'] . '" title="' . $lang['sql_backdboverview'] . '">';
$icon['search']='<img src="' . $config['files']['iconpath'] . 'search.gif" alt="' . $lang['title_search'] . '" title="' . $lang['title_search'] . '">';
$icon['mysql_help']='<img src="' . $config['files']['iconpath'] . 'mysql_help.gif" alt="' . $lang['title_mysql_help'] . '" title="' . $lang['title_mysql_help'] . '">';
$icon['upload']='<img src="' . $config['files']['iconpath'] . 'openfile.gif" alt="' . $lang['title_upload'] . '" title="' . $lang['title_upload'] . '">';
//other pics
$icon['logo']=$config['theme'] . 'pics/h1_logo.gif';
?>

6
inc/footer.php Normale Datei
Datei anzeigen

@ -0,0 +1,6 @@
<?php
if (!defined('MSD_VERSION')) die('No direct access.');
echo '<p align="center" class="footer">
' . $lang['authors'] . ': <a href="http://www.mysqldumper.de" target="_blank">Daniel Schlichtholz &amp; Steffen Kamper</a> | Infoboard:
<a href="' . $config['homepage'] . '" target="_blank">' . $config['homepage'] . '</a></p>';
echo '</div></body></html>';

692
inc/functions.php Normale Datei
Datei anzeigen

@ -0,0 +1,692 @@
<?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) && ereg("^" . $pattern . "$",$file))
{
if (unlink($dir . $file)) $deleted[$file]=true;
else $deleted[$file]=false;
}
}
closedir($d);
return $deleted;
}
else
return 0;
}
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_samedb']=isset($config['cron_samedb']) ? intval($config['cron_samedb']) : 0;
$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']:'';
//Arrays löschen
$i=0;
$databases['Name']=Array();
$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" );
}
//DB-Liste holen
MSD_mysql_connect();
$create_statement='CREATE TABLE `mysqldumper_test_abcxyvfgh` (`test` varchar(200) default NULL, `id` bigint(20) unsigned NOT NULL auto_increment,' . 'PRIMARY KEY (`id`)) TYPE=MyISAM;';
$res=mysql_query("SHOW DATABASES ;",$config['dbconnection']);
if (!$res === false)
{
$numrows=mysql_numrows($res);
$a=0;
for ($i=0; $i < $numrows; $i++)
{
$row=mysql_fetch_row($res);
$found_db=$row[0];
// Testverbindung - Tabelle erstellen, nachschauen, ob es geklappt hat und dann wieder löschen
$use=@mysql_select_db($found_db);
if ($use)
{
$res2=mysql_query("DROP TABLE IF EXISTS `mysqldumper_test_abcxyvfgh`",$config['dbconnection']);
$res2=mysql_query($create_statement,$config['dbconnection']);
if (!$res2 === false)
{
$res2=mysql_query("DROP TABLE IF EXISTS `mysqldumper_test_abcxyvfgh`",$config['dbconnection']);
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]="";
$out.=$lang['saving_db_form'] . " " . $found_db . " " . $lang['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))
{
$config['cron_samedb']=$restore_values['cron_samedb'];
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();
check_manual_dbs();
//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(Realpfad("./"));
$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 . "'" ) . '] = \'' . myaddslashes($val2) . "';$nl";
}
}
else
{
if ($config['magic_quotes_gpc'] == 1)
{
$val=stripslashes($val);
}
if (!in_array($var,$config_dontsave)) $pars_all.='$config[\'' . $var . '\'] = \'' . myaddslashes($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 . "'" ) . '] = \'' . myaddslashes(stripslashes($val2)) . "';$nl";
}
else
{
$pars_all.='$databases[\'' . $var . '\'][' . ( ( is_int($var2) ) ? $var2 : "'" . $var2 . "'" ) . '] = \'' . myaddslashes($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;
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'];
//v($databases);
// -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 values 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'];
}
$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=' . $config['cron_dbindex'] . ';' . $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 ($config['logcompression'] == 1)
{
$fp=@gzopen($config['files']['log'] . '.gz',"wb");
@gzwrite($fp,$log);
@gzclose($fp);
@chmod($config['files']['log'] . '.gz',0755);
}
else
{
$fp=@fopen($config['files']['log'],"wb");
@fwrite($fp,$log);
@fclose($fp);
@chmod($config['files']['log'],0755);
}
}
function SwitchLogfileFormat()
{
global $config;
$del=DeleteFilesM($config['paths']['log'],"*");
DeleteLog();
}
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['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['ftp_notconnected'];
echo $lang['connwith'] . " $tinstall_ftp_server " . $lang['asuser'] . " $install_ftp_user_name " . $lang['notpossible'];
return 0;
}
else
{
if ($config['ftp_mode'] == 1) ftp_pasv($conn_id,true);
//Wechsel in betroffenes Verzeichnis
echo $lang['changedir'] . ' `' . $install_ftp_path . '` ...<br>';
ftp_chdir($conn_id,$install_ftp_path);
// Erstellen der Verzeichnisse
echo $lang['dircr1'] . ' ...<br>';
ftp_mkdir($conn_id,"work");
ftp_site($conn_id,"CHMOD 0777 work");
echo $lang['changedir'] . ' `work` ...<br>';
ftp_chdir($conn_id,"work");
echo $lang['indir'] . ' `' . ftp_pwd($conn_id) . '`<br>';
echo $lang['dircr5'] . ' ...<br>';
ftp_mkdir($conn_id,"config");
ftp_site($conn_id,"CHMOD 0777 config");
echo $lang['dircr2'] . ' ...<br>';
ftp_mkdir($conn_id,"backup");
ftp_site($conn_id,"CHMOD 0777 backup");
echo $lang['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)
{
$dir=split("/",$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 == '')
{
// Datenbanken automatisch erkennen
$show_dbs=mysql_query("SHOW DATABASES",$config['dbconnection']);
if (!$show_dbs === false)
{
WHILE ($row=mysql_fetch_row($show_dbs))
{
if (trim($row[0]) > '') $db_list[]=$row[0];
}
}
}
else
$db_list[]=$db; // DB wurde manuell angegeben
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 (!@mysql_query("SHOW TABLES FROM `" . $db_list[$i] . "`",$config['dbconnection']) === false)
{
$databases['Name'][$i]=$db_list[0];
$databases['praefix'][$i]='';
$databases['command_before_dump'][$i]='';
$databases['command_after_dump'][$i]='';
if ($printout == 1) echo $lang['found_db'] . ' `' . $db_list[$i] . '`<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;
}
function myaddslashes($t)
{
return str_replace("'","\'",$t);
}
?>

545
inc/functions_dump.php Normale Datei
Datei anzeigen

@ -0,0 +1,545 @@
<?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) WriteLog('starting Multidump with ' . count($databases['multi']) . ' Datenbases.');
WriteLog('Start Dump \'' . $dump['backupdatei'] . '\'');
}
else
WriteLog('Start Multipart-Dump \'' . $dateiname . '\'');
$out.='<strong>' . $lang['startdump'] . ' `' . $databases['Name'][$dump['dbindex']] . '`</strong>' . ( ( $databases['praefix'][$dump['dbindex']] != "" ) ? ' (' . $lang['withpraefix'] . ' <span style="color:blue">' . $databases['praefix'][$dump['dbindex']] . '</span>)' : '' ) . '... ';
ExecuteCommand('b');
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=mysql_query("SHOW TABLE STATUS FROM `" . $databases['Name'][$dump['dbindex']] . "`");
$numrows=intval(@mysql_num_rows($res));
for ($i=0; $i < $numrows; $i++)
{
$erg=mysql_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=@mysql_query($sql_2);
if ($res2 === false)
{
// error reading table definition
$read_create_error=sprintf($lang['fatal_error_dump'],$databases['Name'][$dump['dbindex']],$erg['Name']) . ': ' . mysql_error($config['dbconnection']);
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=mysql_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";
mysql_select_db($db);
$result=mysql_query('SHOW CREATE TABLE `' . $table . '`',$config['dbconnection']);
$row=@mysql_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 );
mysql_select_db($db);
$result=mysql_query($query,$config['dbconnection']);
$ergebnisse=@mysql_num_rows($result);
if ($ergebnisse !== false)
{
$num_felder=mysql_num_fields($result);
$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=mysql_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.='\'' . mysql_escape_string($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();
}
}
@mysql_free_result($result);
}
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']) new_file($dump['filesize']); // Wenn maximale Dateigroesse erreicht -> neues File starten
}
function ExecuteCommand($when)
{
global $config,$databases,$dump,$out,$lang;
if (!isset($dump['dbindex'])) return;
if ($when == 'b')
{ // before dump
$cd=$databases['command_before_dump'][$dump['dbindex']];
$cap='before Dump';
$lf='<br>';
}
else
{
$cd=$databases['command_after_dump'][$dump['dbindex']];
$cap='after Dump';
$lf='';
}
if ($cd != '')
{
//jetzt ausführen
if (substr(strtolower($cd),0,7) != 'system:')
{
@mysql_select_db($databases['Name'][$dump['dbindex']]);
if (strpos($cd,';'))
{
$cad=explode(';',$cd);
for ($i=0; $i < count($cad); $i++)
{
if ($cad[$i]) $result.=@mysql_query($cad[$i],$config['dbconnection']);
}
}
else
{
$result=@mysql_query($cd,$config['dbconnection']);
}
if (!$result)
{
WriteLog("Error while executing Query $cap ($cd) : " . mysql_error());
ErrorLog("Command " . $cap,$databases['Name'][$dump['dbindex']],$cd,mysql_error());
$dump['errors']++;
$out.=$lf . '<span class="error">ERROR executing Query ' . $cap . '</span><br>';
}
else
{
WriteLog("executing Query $cap ($cd) was successful");
$out.=$lf . '<span class="success">executing Query ' . $cap . ' was successful</span><br>';
}
}
elseif (substr(strtolower($cd),0,7) == "system:")
{
//$result=@system(substr($cd,7),$returnval);
$cap=substr($cd,7);
$result=1;
if (!$result)
{
WriteLog("Error while executing System Command $cap");
$dump['errors']++;
$out.=$lf . '<span class="error">ERROR executing System Command ' . $cap . '</span><br>';
}
else
{
WriteLog("executing System Command $cap was successful. [$returnval]");
$out.=$lf . '<span class="success">executing System Command ' . $cap . ' was successful</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['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['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['email_was_send'] . "`" . $config['email_recipient'] . "`<br>";
}
else
{
//alles ok, anhang generieren
$msg_body=sprintf(addslashes($lang['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['email_was_send'] . "`" . $config['email_recipient'] . "`" . $lang['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['emailbody_mp_attach']),$databases['Name'][$dump['dbindex']],$mpfiles) : sprintf(addslashes($lang['emailbody_mp_noattach']),$databases['Name'][$dump['dbindex']],$mpfiles);
$email_log="Email was sent to '" . $config['email_recipient'] . "'";
$email_out=$lang['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['mailerror'] . '</span><br>';
WriteLog("Email to '" . $config['email_recipient'] . "' failed !");
ErrorLog("Email ",$databases['Name'][$dump['dbindex']],'Subject: ' . stripslashes($subject),$lang['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['email_only_attachment'] . $lang['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['email_was_send'] . "`" . $config['email_recipient'] . "`" . $lang['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['mailerror'] . '</span><br>';
WriteLog("Email to '" . $config['email_recipient'] . "' failed !");
ErrorLog("Email ",$databases['Name'][$dump['dbindex']],'Subject: ' . stripslashes($subject),$lang['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['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['ftpconnerror'] . $config['ftp_server'][$i] . $lang['ftpconnerror1'] . $config['ftp_user'][$i] . $lang['ftpconnerror2'] . '</span><br>';
}
else
{
if ($conn_msg == 1) $out.='<span class="success">' . $lang['ftpconnected1'] . $config['ftp_server'][$i] . $lang['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['ftpconnerror3'] . "<br>($source -> $dest)</span><br>";
}
else
{
$out.='<span class="success">' . $lang['file'] . ' <a href="' . $config['paths']['backup'] . $source_file . '" class="smallblack">' . $source_file . '</a>' . $lang['ftpconnected2'] . $config['ftp_server'][$i] . $lang['ftpconnected3'] . '</span><br>';
WriteLog("'$source_file' sent via FTP.");
}
// Schließen des FTP-Streams
@ftp_quit($conn_id);
}
?>

484
inc/functions_files.php Normale Datei
Datei anzeigen

@ -0,0 +1,484 @@
<?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['fm_files1'] . ' ' . $lang['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['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="2">' . $lang['db'] . '</th>
<th>gz</th>
<th>Script</th>
<th colspan="2">' . $lang['comment'] . '</th>
<th>' . $lang['fm_filedate'] . '</th>
<th>Multipart</th>
<th>' . $lang['fm_tables'] . ' / ' . $lang['fm_records'] . '</th>
<th align="right" colspan="2">' . $lang['fm_filesize'] . '</th>
<th align="right" >' . $lang['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'];
//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);">';
}
$fl.=( $db_backups[$i]['multipart'] == 0 ) ? '&nbsp;<a href="' . $fpath . $dbn . '" title="Backupfile: ' . $dbn . '" style="font-size:8pt;" target="_blank">' . ( ( $db_backups[$i]['db'] == 'unknown' ) ? $dbn : $db_backups[$i]['db'] ) . '</a></td>' : '&nbsp;<span style="font-size:8pt;">' . $db_backups[$i]['db'] . '</span></td>';
$fl.='<td class="sm" nowrap="nowrap" align="center">' . ( ( substr($dbn,-3) == ".gz" ) ? '<img src="' . $config['files']['iconpath'] . 'gz.gif" alt="' . $lang['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['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['fm_oldbackup'];
$fl.='</td>';
$fl.='<td align="right" colspan="2" style="font-size:8pt;">' . byte_output($db_backups[$i]['size']) . '</td>';
$fl.='<td align="right" style="font-size:8pt;">' . $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['fm_all_bu'] . '</strong></td></tr>';
//Tableheader
$fl.='<tr class="thead"><th colspan="5" align="left">' . $lang['fm_dbname'] . '</th>
<th align="left">' . $lang['fm_anz_bu'] . '</th><th>' . $lang['fm_last_bu'] . '</th>
<th colspan="5" style="text-align:right;">' . $lang['fm_totalsize'] . '</th></tr>';
//die anderen Backups
if (count($db_summary_anzahl) > 0)
{
$i=0;
while (list ($key, $val)=each($db_summary_anzahl))
{
$cl=( $i++ % 2 ) ? "dbrow" : "dbrow1";
$keyaus=( $key == "unknown" ) ? '<em>' . $lang['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['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['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['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;
$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="' . $config['paths']['backup'] . $dateistamm . $i . $dateiendung . '">' . $dateistamm . $i . $dateiendung . '</a>&nbsp;&nbsp;&nbsp;' . byte_output(@filesize($config['paths']['backup'] . $dateistamm . $i . $dateiendung));
}
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['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 besplitted? 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,0,'(') === 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(substr(ltrim($zeile),0,2)==',(' && $insert !='')
//{
// $zeile=";\n\r".$insert.$zeile; //substr($zeile,1);
//}
//if(substr(rtrim($zeile),-2)=='),' && $insert !='') {
// $zeile="\n\r".substr(rtrim($zeile),0,strlen(rtrim($zeile))-1).";\r\n".$insert;
//}
}
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['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;
}
?>

1084
inc/functions_global.php Normale Datei

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

356
inc/functions_restore.php Normale Datei
Datei anzeigen

@ -0,0 +1,356 @@
<?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 ($sub6 == '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['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);
// 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;
}
}
// 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)
{
//Führt eine Create-Anweisung durch
$tablename=get_tablename($sql);
$res=@mysql_query($sql);
if ($res === false)
{
// erster Versuch fehlgeschlagen -> zweiter Versuch - vielleicht versteht der Server die Inline-Kommentare nicht?
$sql=del_inline_comments($sql);
$res=@mysql_query(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=@mysql_query(downgrade($sql));
}
}
if ($res === false)
{
// wenn wir hier angekommen sind hat nichts geklappt -> Fehler ausgeben und abbrechen
SQLError($sql,mysql_error());
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=mysql_query($sql);
if ($res)
{
$insert='INSERT INTO `' . $table . '` (';
while ($row=mysql_fetch_object($res))
{
$insert.='`' . $row->Field . '`,';
}
$insert=substr($insert,0,strlen($insert) - 1) . ') ';
}
else
{
global $restore;
v($restore);
SQLError($sql,mysql_error());
}
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,50); // 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($sql,'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
$quotes=substr_count($string,'\'');
$escaped_quotes=substr_count($string,'\\\'');
if (( $quotes - $escaped_quotes ) % 2 == 0)
{
if (substr($string,-2) == ');') return true;
if (substr($string,-2) == '),') return true;
}
return false;
}
?>

1543
inc/functions_sql.php Normale Datei

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

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