Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
 1: <?php
 2: /**
 3:  * Description: Cookie Directive
 4:  *
 5:  * @package Module
 6:  * @subpackage ScriptCookieDirective
 7:  * @version SVN Revision $Rev:$
 8:  *
 9:  * @author ilia.schwarz
10:  * @author claus.schunk@4fb.de
11:  * @copyright four for business AG <www.4fb.de>
12:  * @license http://www.contenido.org/license/LIZENZ.txt
13:  * @link http://www.4fb.de
14:  * @link http://www.contenido.org
15:  */
16: 
17: if (!$contenido) {
18: 
19:     $session = cRegistry::getSession();
20: 
21:     if (array_key_exists('acceptCookie', $_GET)) {
22:         // Check value in get, if js is off
23:         $allowCookie = $_GET['acceptCookie'] === '1'? 1 : 0;
24:         setcookie('allowCookie', $allowCookie);
25: 
26:         // Save value
27:         $session->register('allowCookie');
28:     } elseif (array_key_exists('allowCookie', $_COOKIE)) {
29:         // Check value in cookies
30:         $allowCookie = $_COOKIE['allowCookie'] === '1'? 1 : 0;
31: 
32:         // Save value
33:         $session->register('allowCookie');
34:     }
35: 
36:     // Show notify
37:     if (!isset($allowCookie)) {
38: 
39:         $tpl = cSmartyFrontend::getInstance();
40: 
41:         // build translations
42:         $tpl->assign('trans', array(
43:             'title' => mi18n("TITLE"),
44:             'infoText' => mi18n("INFOTEXT"),
45:             'userInput' => mi18n("USERINPUT"),
46:             'accept' => mi18n("ACCEPT"),
47:             'decline' => mi18n("DECLINE")
48:         ));
49: 
50:         function script_cookie_directive_add_get_params($uri) {
51:             foreach($_GET as $getKey => $getValue) {
52:                 // do not add already added GET parameters to redirect url
53:                 if (strpos($uri, '?' . $getKey . '=') !== false
54:                         || strpos($uri, '&' . $getKey . '=') !== false
55:                         || strpos($uri, '&amp;' . $getKey . '=') !== false) {
56:                             continue;
57:                         }
58:                         if (strpos($uri, '?') === false) {
59:                             $uri .= '?';
60:                         } else {
61:                             $uri .= '&amp;';
62:                         }
63:                         $uri .= htmlentities($getKey) . '=' . htmlentities($getValue);
64:             }
65:         
66:             return $uri;
67:         }
68: 
69:         // build accept url
70:         $acceptUrl = script_cookie_directive_add_get_params(cUri::getInstance()->build(array(
71:             'idart' => cRegistry::getArticleId(),
72:             'lang' => cRegistry::getLanguageId(),
73:             'acceptCookie' => 1
74:         ), true));
75: 
76:         $tpl->assign('pageUrlAccept', $acceptUrl);
77: 
78:         // build deny url
79:         $denyUrl = script_cookie_directive_add_get_params(cUri::getInstance()->build(array(
80:             'idart' => cRegistry::getArticleId(),
81:             'lang' => cRegistry::getLanguageId(),
82:             'acceptCookie' => 0
83:         ), true));
84:         $tpl->assign('pageUrlDeny', $denyUrl);
85: 
86:         $tpl->display('get.tpl');
87: 
88:     }
89: }
90: ?>
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen