Relecture des valeurs ecrites
This commit is contained in:
parent
bceda2f91d
commit
a4079443e1
@ -1,5 +1,85 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
|
|
||||||
|
if ($action == "set")
|
||||||
|
{
|
||||||
|
print "- Enregistrement des valeurs<br>";
|
||||||
|
|
||||||
|
$fp = fopen("conf/conf.php", "w");
|
||||||
|
if($fp)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (substr($HTTP_POST_VARS["main_dir"], strlen($HTTP_POST_VARS["main_dir"]) -1) == "/")
|
||||||
|
{
|
||||||
|
$HTTP_POST_VARS["main_dir"] = substr($HTTP_POST_VARS["main_dir"], 0, strlen($HTTP_POST_VARS["main_dir"])-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (substr($HTTP_POST_VARS["main_url"], strlen($HTTP_POST_VARS["main_url"]) -1) == "/")
|
||||||
|
{
|
||||||
|
$HTTP_POST_VARS["main_url"] = substr($HTTP_POST_VARS["main_url"], 0, strlen($HTTP_POST_VARS["main_url"])-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
fwrite($fp, '<?PHP');
|
||||||
|
fputs($fp,"\n");
|
||||||
|
|
||||||
|
fputs($fp, '$dolibarr_main_document_root="'.$HTTP_POST_VARS["main_dir"].'";');
|
||||||
|
fputs($fp,"\n");
|
||||||
|
|
||||||
|
fputs($fp, '$dolibarr_main_url_root="'.$HTTP_POST_VARS["main_url"].'";');
|
||||||
|
fputs($fp,"\n");
|
||||||
|
|
||||||
|
fputs($fp, '$dolibarr_main_db_host="'.$HTTP_POST_VARS["db_host"].'";');
|
||||||
|
fputs($fp,"\n");
|
||||||
|
|
||||||
|
fputs($fp, '$dolibarr_main_db_name="'.$HTTP_POST_VARS["db_name"].'";');
|
||||||
|
fputs($fp,"\n");
|
||||||
|
|
||||||
|
fputs($fp, '$dolibarr_main_db_user="'.$HTTP_POST_VARS["db_user"].'";');
|
||||||
|
fputs($fp,"\n");
|
||||||
|
|
||||||
|
fputs($fp, '$dolibarr_main_db_pass="'.$HTTP_POST_VARS["db_pass"].'";');
|
||||||
|
fputs($fp,"\n");
|
||||||
|
|
||||||
|
fputs($fp, '?>');
|
||||||
|
fclose($fp);
|
||||||
|
|
||||||
|
if (file_exists("conf/conf.php"))
|
||||||
|
{
|
||||||
|
include ("conf/conf.php");
|
||||||
|
}
|
||||||
|
|
||||||
|
print "- Configuration enregistré<br>";
|
||||||
|
print "- test de connexion à la base de données<br>";
|
||||||
|
require ($dolibarr_main_document_root . "/lib/mysql.lib.php3");
|
||||||
|
require ($dolibarr_main_document_root . "/conf/conf.class.php3");
|
||||||
|
$conf = new Conf();
|
||||||
|
$conf->db->host = $dolibarr_main_db_host;
|
||||||
|
$conf->db->name = $dolibarr_main_db_name;
|
||||||
|
$conf->db->user = $dolibarr_main_db_user;
|
||||||
|
$conf->db->pass = $dolibarr_main_db_pass;
|
||||||
|
$db = new Db();
|
||||||
|
|
||||||
|
$sql = "REPLACE INTO llx_const SET name = 'FAC_OUTPUTDIR', value='".$dolibarr_main_document_root."/document', visible=0, type='chaine'";
|
||||||
|
|
||||||
|
if ($db->query($sql))
|
||||||
|
{
|
||||||
|
print "- connexion réussie à la base de données<br>";
|
||||||
|
|
||||||
|
print '<a href="'.$dolibarr_main_url_root .'/">Go !</a>';
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $db->error();
|
||||||
|
}
|
||||||
|
$db->close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "Erreur le système à besoin d'écrire dans le fichier conf/conf.php veuillez mettre les droits correct pour cela.";
|
||||||
|
}
|
||||||
|
print "<hr>";
|
||||||
|
}
|
||||||
|
|
||||||
if (file_exists("conf/conf.php"))
|
if (file_exists("conf/conf.php"))
|
||||||
{
|
{
|
||||||
include ("conf/conf.php");
|
include ("conf/conf.php");
|
||||||
@ -70,86 +150,5 @@ Laissez vide si vous vous connectez en anonymous
|
|||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?PHP
|
|
||||||
|
|
||||||
if ($action == "set")
|
|
||||||
{
|
|
||||||
print "- Enregistrement des valeurs<br>";
|
|
||||||
|
|
||||||
$fp = fopen("conf/conf.php", "w");
|
|
||||||
if($fp)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (substr($HTTP_POST_VARS["main_dir"], strlen($HTTP_POST_VARS["main_dir"]) -1) == "/")
|
|
||||||
{
|
|
||||||
$HTTP_POST_VARS["main_dir"] = substr($HTTP_POST_VARS["main_dir"], 0, strlen($HTTP_POST_VARS["main_dir"])-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (substr($HTTP_POST_VARS["main_url"], strlen($HTTP_POST_VARS["main_url"]) -1) == "/")
|
|
||||||
{
|
|
||||||
$HTTP_POST_VARS["main_url"] = substr($HTTP_POST_VARS["main_url"], 0, strlen($HTTP_POST_VARS["main_url"])-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
fwrite($fp, '<?PHP');
|
|
||||||
fputs($fp,"\n");
|
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_document_root="'.$HTTP_POST_VARS["main_dir"].'";');
|
|
||||||
fputs($fp,"\n");
|
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_url_root="'.$HTTP_POST_VARS["main_url"].'";');
|
|
||||||
fputs($fp,"\n");
|
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_host="'.$HTTP_POST_VARS["db_host"].'";');
|
|
||||||
fputs($fp,"\n");
|
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_name="'.$HTTP_POST_VARS["db_name"].'";');
|
|
||||||
fputs($fp,"\n");
|
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_user="'.$HTTP_POST_VARS["db_user"].'";');
|
|
||||||
fputs($fp,"\n");
|
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_pass="'.$HTTP_POST_VARS["db_pass"].'";');
|
|
||||||
fputs($fp,"\n");
|
|
||||||
|
|
||||||
fputs($fp, '?>');
|
|
||||||
fclose($fp);
|
|
||||||
|
|
||||||
|
|
||||||
print "- Configuration enregistré<br>";
|
|
||||||
print "- test de connexion à la base de données<br>";
|
|
||||||
require ($dolibarr_main_document_root . "/lib/mysql.lib.php3");
|
|
||||||
require ($dolibarr_main_document_root . "/conf/conf.class.php3");
|
|
||||||
$conf = new Conf();
|
|
||||||
$conf->db->host = $dolibarr_main_db_host;
|
|
||||||
$conf->db->name = $dolibarr_main_db_name;
|
|
||||||
$conf->db->user = $dolibarr_main_db_user;
|
|
||||||
$conf->db->pass = $dolibarr_main_db_pass;
|
|
||||||
$db = new Db();
|
|
||||||
|
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'FAC_OUTPUTDIR', value='".$dolibarr_main_document_root."/document', visible=0, type='chaine'";
|
|
||||||
|
|
||||||
if ($db->query($sql))
|
|
||||||
{
|
|
||||||
print "- connexion réussie à la base de données<br>";
|
|
||||||
|
|
||||||
print '<a href="'.$dolibarr_main_url_root .'/">Go !</a>';
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $db->error();
|
|
||||||
}
|
|
||||||
$db->close();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "Erreur le système à besoin d'écrire dans le fichier conf/conf.php veuillez mettre les droits correct pour cela.";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<p>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user