26if (! defined(
'CSRFCHECK_WITH_TOKEN')) {
27 define(
'CSRFCHECK_WITH_TOKEN',
'1');
31require
'../../main.inc.php';
46$langs->loadLangs(array(
"other",
"admin"));
52$radio_dump =
GETPOST(
'radio_dump');
53$action =
GETPOST(
'action',
'aZ09');
64$help_url =
'EN:Restores|FR:Restaurations|ES:Restauraciones';
65llxHeader(
'',
'', $help_url,
'', 0, 0,
'',
'',
'',
'mod-admin page-tools_dolibarr_import');
68<script
type=
"text/javascript">
69jQuery(document).ready(
function() {
70 jQuery(
"#mysql_options").<?php echo $radio_dump ==
'mysql_options' ?
'show()' :
'hide()'; ?>;
71 jQuery(
"#postgresql_options").<?php echo $radio_dump ==
'postgresql_options' ?
'show()' :
'hide()'; ?>;
73 jQuery(
"#radio_dump_mysql").click(
function() {
74 jQuery(
"#mysql_options").show();
76 jQuery(
"#radio_dump_postgresql").click(
function() {
77 jQuery(
"#postgresql_options").show();
80 if ($label ==
'MySQL') {
81 print
'jQuery("#radio_dump_mysql").click();';
83 if ($label ==
'PostgreSQL') {
84 print
'jQuery("#radio_dump_postgresql").click();';
93print
'<div class="center">';
94print $langs->trans(
"RestoreDesc", 3);
97print
'<span class="small opacitymedium">'.$langs->trans(
"RestoreDescMore").
'</span><br>';
102<legend style=
"font-size: 3em">1</legend>
104print
'<span class="opacitymedium">';
105print $langs->trans(
"RestoreDesc2", DOL_DATA_ROOT).
'<br><br>';
113<legend style=
"font-size: 3em">2</legend>
115print
'<span class="opacitymedium">';
116print $langs->trans(
"RestoreDesc3", $dolibarr_main_db_name).
'<br><br>';
120<?php print $langs->trans(
"DatabaseName").
' : <b>'.$dolibarr_main_db_name.
'</b>'; ?><br><br>
122<
table class=
"centpercent"><tr><td
class=
"tdtop">
124<?php
if (
$conf->use_javascript_ajax) { ?>
125<div
id=
"div_container_exportoptions">
126<fieldset
id=
"exportoptions">
127 <legend><?php echo $langs->trans(
"ImportMethod"); ?></legend>
129 if (in_array($type, array(
'mysql',
'mysqli'))) {
131 <div
class=
"formelementrow">
132 <input
type=
"radio" name=
"what" value=
"mysql" id=
"radio_dump_mysql"<?php echo($radio_dump ==
'mysql_options' ?
' checked' :
''); ?> />
133 <label
for=
"radio_dump_mysql">MySQL (mysql)</label>
136 } elseif (in_array($type, array(
'pgsql'))) {
138 <div
class=
"formelementrow">
139 <input
type=
"radio" name=
"what" value=
"mysql" id=
"radio_dump_postgresql"<?php echo($radio_dump ==
'postgresql_options' ?
' checked' :
''); ?> />
140 <label
for=
"radio_dump_postgresql">PostgreSQL Restore (pg_restore or psql)</label>
144 print
'No method available with database '.$label;
152</td><td
class=
"tdtop">
155<div
id=
"div_container_sub_exportoptions" >
157if (in_array($type, array(
'mysql',
'mysqli'))) {
158 print
'<fieldset id="mysql_options">';
159 print
'<legend>'.$langs->trans(
'RestoreMySQL').
'</legend>';
160 print
'<div class="formelementrow centpercent">';
163 $command =
$db->getPathOfRestore();
164 if (preg_match(
"/\s/", $command)) {
165 $command = $command = escapeshellarg($command);
168 $param = $dolibarr_main_db_name;
169 $param .=
" -h ".$dolibarr_main_db_host;
170 if (!empty($dolibarr_main_db_port)) {
171 $param .=
" -P ".$dolibarr_main_db_port;
173 $param .=
" -u ".$dolibarr_main_db_user;
174 $paramcrypted = $param;
175 $paramclear = $param;
176 if (!empty($dolibarr_main_db_pass)) {
177 $paramcrypted .=
" -p".preg_replace(
'/./i',
'*', $dolibarr_main_db_pass);
178 $paramclear .=
" -p".$dolibarr_main_db_pass;
181 print $langs->trans(
"ImportMySqlDesc");
183 print
'<textarea rows="1" id="restorecommand" class="centpercent" spellcheck="false">'.$langs->trans(
"ImportMySqlCommand", $command, ($action ==
'showpass' ? $paramclear : $paramcrypted)).
'</textarea><br>';
184 print ajax_autoselect(
'restorecommand');
186 if (
GETPOST(
"action") !=
'showpass' && $dolibarr_main_db_pass) {
187 print
'<br><a href="'.$_SERVER[
"PHP_SELF"].
'?action=showpass&token='.newToken().
'&radio_dump=mysql_options">'.$langs->trans(
"UnHidePassword").
'</a>';
194} elseif (in_array($type, array(
'pgsql'))) {
195 print
'<fieldset id="postgresql_options">';
196 print
'<legend>Restore PostgreSQL</legend>';
197 print
'<div class="formelementrow">';
199 $command =
$db->getPathOfRestore();
200 if (preg_match(
"/\s/", $command)) {
201 $command = $command = escapeshellarg($command);
204 $param =
" -d ".$dolibarr_main_db_name;
205 $param .=
" -h ".$dolibarr_main_db_host;
206 if (!empty($dolibarr_main_db_port)) {
207 $param .=
" -p ".$dolibarr_main_db_port;
209 $param .=
" -U ".$dolibarr_main_db_user;
210 $paramcrypted = $param;
211 $paramclear = $param;
217 $paramcrypted .=
" -W";
218 $paramclear .=
" -W";
220 $paramcrypted .=
" -f";
221 $paramclear .=
" -f";
223 echo $langs->trans(
"ImportPostgreSqlDesc");
225 print
'<textarea rows="1" id="restorecommand" class="centpercent">'.$langs->trans(
"ImportPostgreSqlCommand", $command, ($action ==
'showpass' ? $paramclear : $paramcrypted)).
'</textarea><br>';
226 print ajax_autoselect(
'restorecommand');
237print
'</td></tr></table>';
243print
"<!-- Save setup conf -->\n";
245print
'<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">3</legend>';
249print
'<span class="opacitymedium">';
250print $langs->trans(
"RestoreDesc4",
'dolibarr_main_instance_unique_id '.$langs->transnoentitiesnoconv(
"or").
' dolibarr_main_dolcrypt_key').
'<br>';
255print
'<div id="backupfileright">';
257print $langs->trans(
"SeeValueIntoConfPhp");
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
treeview li table
No Email.
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
$conf db name
Only used if Module[ID]Name translation string is not found.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.