* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBAjax'); /** * Simple AJAX stub: CacheControl * * Flush caches * * @version 0.1.1 * @package WB * @subpackage base */ class WBAjax_CacheControl extends WBAjax { /** * Config * @var WBConfig */ protected $config; /** * @var WBCache_Control */ private $cacheControl; /** * Second construcotr * * Called by constructer of super class. * @see include/WB/WBAjax#init() */ protected function init() { $this->cacheControl = WBClass::create('WBCache_Control'); } /** * Flush Cache * * @return string zero */ protected function flush() { // check permissions if (!$this->user->isAuthenticated()) { return 0; } if (!$this->user->isInGroup('admin')) { return 0; } $this->cacheControl->flush(); return 0; } }