26if (! defined(
'CSRFCHECK_WITH_TOKEN')) {
27 define(
'CSRFCHECK_WITH_TOKEN',
'1');
31require
'../../main.inc.php';
45$langs->loadLangs(array(
"other",
"admin"));
51$radio_dump =
GETPOST(
'radio_dump');
52$action =
GETPOST(
'action',
'aZ09');
63$help_url =
'EN:Restores|FR:Restaurations|ES:Restauraciones';
64llxHeader(
'',
'', $help_url,
'', 0, 0,
'',
'',
'',
'mod-admin page-tools_dolibarr_import');
67<script
type=
"text/javascript">
68jQuery(document).ready(
function() {
69 jQuery(
"#mysql_options").<?php echo $radio_dump ==
'mysql_options' ?
'show()' :
'hide()'; ?>;
70 jQuery(
"#postgresql_options").<?php echo $radio_dump ==
'postgresql_options' ?
'show()' :
'hide()'; ?>;
72 jQuery(
"#radio_dump_mysql").click(
function() {
73 jQuery(
"#mysql_options").show();
75 jQuery(
"#radio_dump_postgresql").click(
function() {
76 jQuery(
"#postgresql_options").show();
79 if ($label ==
'MySQL') {
80 print
'jQuery("#radio_dump_mysql").click();';
82 if ($label ==
'PostgreSQL') {
83 print
'jQuery("#radio_dump_postgresql").click();';
92print
'<div class="center">';
93print $langs->trans(
"RestoreDesc", 3);
96print
'<span class="small opacitymedium">'.$langs->trans(
"RestoreDescMore").
'</span><br>';
101<legend style=
"font-size: 3em">1</legend>
103print
'<span class="opacitymedium">';
104print $langs->trans(
"RestoreDesc2", DOL_DATA_ROOT).
'<br><br>';
112<legend style=
"font-size: 3em">2</legend>
114print
'<span class="opacitymedium">';
115print $langs->trans(
"RestoreDesc3", $dolibarr_main_db_name).
'<br><br>';
119<?php print $langs->trans(
"DatabaseName").
' : <b>'.$dolibarr_main_db_name.
'</b>'; ?><br><br>
121<
table class=
"centpercent"><tr><td
class=
"tdtop">
123<?php
if ($conf->use_javascript_ajax) { ?>
124<div
id=
"div_container_exportoptions">
125<fieldset
id=
"exportoptions">
126 <legend><?php echo $langs->trans(
"ImportMethod"); ?></legend>
128 if (in_array($type, array(
'mysql',
'mysqli'))) {
130 <div
class=
"formelementrow">
131 <input
type=
"radio" name=
"what" value=
"mysql" id=
"radio_dump_mysql"<?php echo($radio_dump ==
'mysql_options' ?
' checked' :
''); ?> />
132 <label
for=
"radio_dump_mysql">MySQL (mysql)</label>
135 } elseif (in_array($type, array(
'pgsql'))) {
137 <div
class=
"formelementrow">
138 <input
type=
"radio" name=
"what" value=
"mysql" id=
"radio_dump_postgresql"<?php echo($radio_dump ==
'postgresql_options' ?
' checked' :
''); ?> />
139 <label
for=
"radio_dump_postgresql">PostgreSQL Restore (pg_restore or psql)</label>
143 print
'No method available with database '.$label;
151</td><td
class=
"tdtop">
154<div
id=
"div_container_sub_exportoptions" >
156if (in_array($type, array(
'mysql',
'mysqli'))) {
157 print
'<fieldset id="mysql_options">';
158 print
'<legend>'.$langs->trans(
'RestoreMySQL').
'</legend>';
159 print
'<div class="formelementrow centpercent">';
162 $command = $db->getPathOfRestore();
163 if (preg_match(
"/\s/", $command)) {
164 $command = $command = escapeshellarg($command);
167 $param = $dolibarr_main_db_name;
168 $param .=
" -h ".$dolibarr_main_db_host;
169 if (!empty($dolibarr_main_db_port)) {
170 $param .=
" -P ".$dolibarr_main_db_port;
172 $param .=
" -u ".$dolibarr_main_db_user;
173 $paramcrypted = $param;
174 $paramclear = $param;
175 if (!empty($dolibarr_main_db_pass)) {
176 $paramcrypted .=
" -p".preg_replace(
'/./i',
'*', $dolibarr_main_db_pass);
177 $paramclear .=
" -p".$dolibarr_main_db_pass;
180 print $langs->trans(
"ImportMySqlDesc");
182 print
'<textarea rows="1" id="restorecommand" class="centpercent" spellcheck="false">'.$langs->trans(
"ImportMySqlCommand", $command, ($action ==
'showpass' ? $paramclear : $paramcrypted)).
'</textarea><br>';
185 if (
GETPOST(
"action") !=
'showpass' && $dolibarr_main_db_pass) {
186 print
'<br><a href="'.$_SERVER[
"PHP_SELF"].
'?action=showpass&token='.
newToken().
'&radio_dump=mysql_options">'.$langs->trans(
"UnHidePassword").
'</a>';
193} elseif (in_array($type, array(
'pgsql'))) {
194 print
'<fieldset id="postgresql_options">';
195 print
'<legend>Restore PostgreSQL</legend>';
196 print
'<div class="formelementrow">';
198 $command = $db->getPathOfRestore();
199 if (preg_match(
"/\s/", $command)) {
200 $command = $command = escapeshellarg($command);
203 $param =
" -d ".$dolibarr_main_db_name;
204 $param .=
" -h ".$dolibarr_main_db_host;
205 if (!empty($dolibarr_main_db_port)) {
206 $param .=
" -p ".$dolibarr_main_db_port;
208 $param .=
" -U ".$dolibarr_main_db_user;
209 $paramcrypted = $param;
210 $paramclear = $param;
216 $paramcrypted .=
" -W";
217 $paramclear .=
" -W";
219 $paramcrypted .=
" -f";
220 $paramclear .=
" -f";
222 echo $langs->trans(
"ImportPostgreSqlDesc");
224 print
'<textarea rows="1" id="restorecommand" class="centpercent">'.$langs->trans(
"ImportPostgreSqlCommand", $command, ($action ==
'showpass' ? $paramclear : $paramcrypted)).
'</textarea><br>';
236print
'</td></tr></table>';
242print
"<!-- Save setup conf -->\n";
244print
'<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">3</legend>';
248print
'<span class="opacitymedium">';
249print $langs->trans(
"RestoreDesc4",
'dolibarr_main_instance_unique_id '.$langs->transnoentitiesnoconv(
"or").
' dolibarr_main_dolcrypt_key').
'<br>';
254print
'<div id="backupfileright">';
256print $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.
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.