contributions/usermanagement/controller/base/cachemanager/anonymouscachemanager.cls.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Cache manager that caches only if user is not logged in 00004 * 00005 * If user is logged in, it returns the CacheHeaderManager set 00006 * as ConfigUsermanagement::CACHEHEADER_CLASS_LOGGEDIN 00007 * 00008 * Returns url as cache key 00009 * 00010 * @author Gerd Riesselmann 00011 * @ingroup Usermanagement 00012 */ 00013 class AnonymousCacheManager extends SuccessCacheManager { 00014 /** 00015 * Return a chache id 00016 */ 00017 public function get_cache_id() { 00018 if (Users::is_logged_in() == false) { 00019 return parent::get_cache_id(); 00020 } 00021 return ''; 00022 } 00023 00024 /** 00025 * Get cache header manager 00026 * 00027 * @return ICacheHeaderManager 00028 */ 00029 public function get_cache_header_manager() { 00030 if (Users::is_logged_in()) { 00031 return CacheHeaderManagerFactory::create(Config::get_value(ConfigUsermanagement::CACHEHEADER_CLASS_LOGGEDIN)); 00032 } 00033 else { 00034 return parent::get_cache_header_manager(); 00035 } 00036 } 00037 }