Skip to content
Snippets Groups Projects
Commit c1685760 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Removed not used function.

parent 8e77de92
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
/** /**
* \file htdocs/core/class/cookie.class.php * \file htdocs/core/class/cookie.class.php
* \ingroup core * \ingroup core
* \version $Id$ * \version $Id: cookie.class.php,v 1.6 2011/07/30 08:56:26 eldy Exp $
* \brief File of class to manage cookies * \brief File of class to manage cookies
*/ */
...@@ -131,86 +131,6 @@ class DolCookie ...@@ -131,86 +131,6 @@ class DolCookie
return $decryptValue; return $decryptValue;
} }
/**
* \brief Add cookie cryptkey in config file
* \return int <0 if KO, >0 if OK
*/
function add_cookiecryptkeyconf()
{
dol_syslog("cookie.class::add_cookiecryptkeyconf", LOG_DEBUG);
$config = '';
$added=0;
if ($fp = fopen(DOL_DOCUMENT_ROOT.'/conf/conf.php','r'))
{
while(!feof($fp))
{
$buffer = fgets($fp,4096);
if (strstr($buffer,"\$dolibarr_main_cookie_cryptkey"))
{
$config .= "\$dolibarr_main_cookie_cryptkey=\"$this->myKey\";\n";
$added++;
}
else
{
$config .= $buffer;
}
}
fclose($fp);
if (!$added)
{
$config = '';
if ($fp = fopen(DOL_DOCUMENT_ROOT.'/conf/conf.php','r'))
{
while(!feof($fp))
{
$buffer = fgets($fp,4096);
if (strstr($buffer,"\$dolibarr_main_authentication"))
{
$config .= $buffer;
$config .= "\$dolibarr_main_cookie_cryptkey=\"$this->myKey\";\n";
}
else
{
$config .= $buffer;
}
}
fclose($fp);
}
else
{
dol_syslog("cookie.class::add_cookiecryptkeyconf Failed to read conf.php", LOG_ERR);
return -2;
}
}
$file=DOL_DOCUMENT_ROOT.'/conf/conf.php';
if ($fp = @fopen($file,'w'))
{
fputs($fp, $config, dol_strlen($config));
fclose($fp);
// It's config file, so we set permission for creator only
// @chmod($file, octdec('0600'));
return 1;
}
else
{
dol_syslog("cookie.class::add_cookiecryptkeyconf Failed to open conf.php file for writing", LOG_WARNING);
return -1;
}
}
else
{
dol_syslog("cookie.class::add_cookiecryptkeyconf Failed to read conf.php", LOG_ERR);
return -2;
}
}
} }
?> ?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment