2006-04-26 12:28:53 +00:00
< ? php
/*
$Id : sql_restore . php , v 1.5 2003 / 06 / 10 13 : 16 : 11 root Exp $
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright ( C ) 2002 by the AlternC Development Team .
http :// alternc . org /
----------------------------------------------------------------------
Based on :
Valentin Lacambre ' s web hosting softwares : http :// altern . org /
----------------------------------------------------------------------
LICENSE
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License ( GPL )
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 .
To read the license please visit http :// www . gnu . org / copyleft / gpl . html
----------------------------------------------------------------------
Original Author of file : Benjamin Sonntag
Purpose of file : Manage the MySQL Restore
----------------------------------------------------------------------
*/
require_once ( " ../class/config.php " );
2009-09-08 05:29:38 +00:00
include_once ( " head.php " );
$fields = array (
2013-03-03 13:23:22 +00:00
" id " => array ( " request " , " string " , " " ),
" filename " => array ( " request " , " string " , " " ),
2009-09-08 05:29:38 +00:00
);
getFields ( $fields );
2006-04-26 12:28:53 +00:00
if ( ! $r = $mysql -> get_mysql_details ( $id )) {
$error = $err -> errstr ();
}
?>
< h3 >< ? php __ ( " MySQL Databases " ); ?> </h3>
2010-05-27 15:10:45 +00:00
< hr id = " topbar " />
< br />
2006-04-26 12:28:53 +00:00
< ? php
2013-03-03 13:29:53 +00:00
if ( ! empty ( $error )) {
2013-10-18 09:59:03 +00:00
echo " <p class= \" alert alert-danger \" > $error </p><p> </p> " ;
2013-03-03 13:29:53 +00:00
}
2006-04-26 12:28:53 +00:00
2013-03-03 13:29:53 +00:00
if ( ! is_array ( $r )) {
echo " <p> " . _ ( " You currently have no database defined " ) . " </p> " ;
include_once ( " foot.php " );
exit ;
}
2006-04-26 12:28:53 +00:00
?>
2010-04-29 10:07:15 +00:00
< h3 >< ? php printf ( _ ( " Restore a MySQL backup for database %s " ), $r [ " db " ]); ?> </h3>
2010-05-27 13:47:27 +00:00
< ? php
echo " <p> " ;
2010-05-27 14:01:35 +00:00
__ ( " Warning: Write the complete path and the filename. <br />For example if your backups are in the directory /Backups,<br />write /Backups/file.sql.gz (where file.sql.gz is the filename). " );
2010-05-27 13:47:27 +00:00
echo " </p> " ;
?>
2006-04-26 12:28:53 +00:00
< form action = " sql_dorestore.php " method = " post " >
2016-05-20 12:21:47 +00:00
< ? php csrf_get (); ?>
2016-05-22 18:14:26 +00:00
< input type = " hidden " name = " id " value = " <?php ehe( $id ); ?> " />
2010-06-02 18:47:39 +00:00
< p >< label for = " restfile " >< ? php __ ( " Please enter the path and the filename containing SQL data to be restored. " ); ?> </label></p>
2013-03-03 13:29:53 +00:00
< p >< input type = " text " class = " int " id = " restfile " name = " restfile " size = " 35 " maxlength = " 255 " value = " <?php ehe( $filename ); ?> " /> < input class = " inb " type = " submit " name = " submit " onClick = 'return restfilenotempty();' value = " <?php __( " Restore my database " ); ?> " />< i >< ? php __ ( " Tip: you can restore a file directly in the File Browser " ); ?> </i></p>
2006-04-26 12:28:53 +00:00
</ form >
2013-02-01 08:24:53 +00:00
< script type = " text/javascript " >
function restfilenotempty () {
if ( $ ( '#restfile' ) . val () == '' ) {
alert ( " <?php __( " Please the complete path of the filename " );?> " );
return false ;
} else {
return true ;
}
}
</ script >
2006-04-26 12:28:53 +00:00
< ? php
echo " <p> " ;
__ ( " Note: If the filename ends with .gz, it will be uncompressed before. " );
echo " </p> " ;
?>
2009-09-08 05:29:38 +00:00
< ? php include_once ( " foot.php " ); ?>