This commit is contained in:
Abdulrahman
2019-05-31 01:09:32 +03:00
parent e6f0162bf0
commit 4cf47abfd3
4 changed files with 16 additions and 5 deletions

View File

@@ -135,9 +135,13 @@ function do_config_export($srv, $usr, $pass, $nm, $prf, $type = 'mysql')
$data .= '$dbname = \'' . str_replace("'", "\'", $nm) . "'; // database name \n";
$data .= '$dbprefix = \'' . str_replace("'", "\'", $prf) . "'; // if you use prefix for tables , fill it \n";
if (file_put_contents(PATH . 'config.php', $data, LOCK_EX) !== false)
if (is_writable(PATH . 'config.php'))
{
return true;
if (@file_put_contents(PATH . 'config.php', $data, LOCK_EX) !== false)
{
return true;
}
}
if (defined('CLI') && CLI)
@@ -145,7 +149,6 @@ function do_config_export($srv, $usr, $pass, $nm, $prf, $type = 'mysql')
return true;
}
header('Content-Type: text/x-delimtext; name="config.php"');
header('Content-disposition: attachment; filename=config.php');
echo $data;

View File

@@ -11,7 +11,14 @@
{{if($GLOBALS['no_connection']): $GLOBALS['submit_disabled'] = true;}}
<div class="notice">
<p class="error2"><img src="style/images/k_info.png" class="img" alt=" " />{{echo $lang['INST_CONNCET_ERR']}}</p>
<p class="error2">
<img src="style/images/k_info.png" class="img" alt=" " />
{{echo $lang['INST_CONNCET_ERR']}}
{{if(! empty($GLOBALS['dbtype']) && $GLOBALS['dbtype'] == 'sqlite'):}}
<br>
{{echo $lang['INST_CONNCET_ERR_SQLITE']}}
{{endif;}}
</p>
</div>
{{endif}}