From c16857605943696db5e7ed0e30c34c8e0696d2a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@users.sourceforge.net> Date: Sat, 30 Jul 2011 08:56:26 +0000 Subject: [PATCH] Fix: Removed not used function. --- htdocs/core/class/cookie.class.php | 82 +----------------------------- 1 file changed, 1 insertion(+), 81 deletions(-) diff --git a/htdocs/core/class/cookie.class.php b/htdocs/core/class/cookie.class.php index 86e96912762..07fed567b48 100644 --- a/htdocs/core/class/cookie.class.php +++ b/htdocs/core/class/cookie.class.php @@ -19,7 +19,7 @@ /** * \file htdocs/core/class/cookie.class.php * \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 */ @@ -131,86 +131,6 @@ class DolCookie 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 -- GitLab