Skip to content
Snippets Groups Projects
Commit ae263e80 authored by Sebastian Kehr's avatar Sebastian Kehr :rowboat_tone2: Committed by Frank Morgner
Browse files

refs #14863 [master-v5] - discards custom cookie manager at finc module

parent 3509e38a
No related merge requests found
......@@ -12,7 +12,6 @@ $config = [
'finc\Rewrite' => 'finc\Rewrite\Factory',
'VuFind\Export' => 'finc\Service\Factory::getExport',
'VuFind\SessionManager' => 'finc\Session\ManagerFactory',
'VuFind\CookieManager' => 'finc\Service\Factory::getCookieManager'
],
'delegators' => [
'VuFindSearch\Service' => [
......
<?php
/**
* Cookie Manager
*
* PHP version 5
*
* Copyright (C) Villanova University 2015.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category VuFind
* @package Cookie
* @author Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development Wiki
*/
namespace finc\Cookie;
/**
* Cookie Manager
*
* @category VuFind
* @package Cookie
* @author Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development Wiki
*/
class CookieManager extends \VuFind\Cookie\CookieManager
{
/**
* The name of the session cookie
*
* @var string
*/
protected $sessionName;
/**
* Constructor
*
* @param array $cookies Cookie array to manipulate (e.g. $_COOKIE)
* @param string $path Cookie base path (default = /)
* @param string $domain Cookie domain
* @param bool $secure Are cookies secure only? (default = false)
* @param string $sessionName Session cookie name (if null defaults to PHP
* settings)
*/
public function __construct(
$cookies,
$path = '/',
$domain = null,
$secure = false,
$sessionName = null
) {
$this->cookies = $cookies;
$this->path = $path;
$this->domain = $domain;
$this->secure = $secure;
$this->sessionName = $sessionName;
}
/**
* Get the name of the cookie
*
* @return mixed
*/
public function getSessionName()
{
return $this->sessionName;
}
}
......@@ -105,43 +105,6 @@ class Factory
);
}
/**
* Construct the cookie manager.
*
* @param ServiceManager $sm Service manager.
*
* @return \VuFind\Cookie\CookieManager
*/
public static function getCookieManager(ServiceManager $sm)
{
$config = $sm->get('VuFind\Config')->get('config');
$path = '/';
if (isset($config->Cookies->limit_by_path)
&& $config->Cookies->limit_by_path
) {
$path = $sm->get('Request')->getBasePath();
if (empty($path)) {
$path = '/';
}
}
$secure = isset($config->Cookies->only_secure)
? $config->Cookies->only_secure
: false;
$domain = isset($config->Cookies->domain)
? $config->Cookies->domain
: null;
$session_name = isset($config->Cookies->session_name)
? $config->Cookies->session_name
: null;
return new \finc\Cookie\CookieManager(
$_COOKIE,
$path,
$domain,
$secure,
$session_name
);
}
/**
* Construct the export helper.
*
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment