*/ /** * @ignore */ define('IN_TITANIA', true); if (!defined('TITANIA_ROOT')) { define('TITANIA_ROOT', './'); } if (!defined('PHP_EXT')) { define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); } require TITANIA_ROOT . 'common.' . PHP_EXT; $action = request_var('action', ''); switch ($action) { case 'login': phpbb::login_box(titania_url::build_url('')); break; case 'logout': if (phpbb::$user->data['user_id'] != ANONYMOUS) { phpbb::$user->session_kill(); phpbb::$user->session_begin(); } redirect(titania_url::build_url('')); break; /** * Rate something & remove a rating from something */ /** * Rate something & remove a rating from something */ case 'rate':
// Initialise phpBB phpbb::initialise(); // If the database is not installed or outdated redirect to the installer if (!defined('IN_TITANIA_INSTALL') && (!isset(phpbb::$config['titania_version']) || version_compare(phpbb::$config['titania_version'], TITANIA_VERSION, '<'))) { if (phpbb::$user->data['user_type'] != USER_FOUNDER) { phpbb::$user->set_custom_lang_path(TITANIA_ROOT . 'language/'); phpbb::$user->add_lang('common'); msg_handler(E_USER_ERROR, phpbb::$user->lang['TITANIA_DISABLED'], '', ''); } redirect(phpbb::append_sid(TITANIA_ROOT . 'install.' . PHP_EXT)); } // Initialise Titania titania::initialise(); // Allow login attempts from any page (mini login box) if (isset($_POST['login'])) { phpbb::login_box(); } // admin requested the cache to be purged, ensure they have permission and purge the cache. if (isset($_GET['cache']) && $_GET['cache'] == 'purge' && phpbb::$auth->acl_get('a_')) { titania::$cache->purge(); titania::error_box('SUCCESS', phpbb::$user->lang['CACHE_PURGED']); } // admin requested a sync if (isset($_GET['sync']) && phpbb::$auth->acl_get('a_')) { $sync = new titania_sync(); $method = explode('_', request_var('sync', ''), 2); if (method_exists($sync, $method[0])) { if (isset($method[1])) { $id = request_var('id', 0); $sync->{$method}[0]($method[1], $id); } else {
public static function needs_auth() { if (!phpbb::$user->data['is_registered']) { phpbb::login_box(); } trigger_error('NO_AUTH'); }