本文整理汇总了PHP中OW::getRequestHandler方法的典型用法代码示例。如果您正苦于以下问题:PHP OW::getRequestHandler方法的具体用法?PHP OW::getRequestHandler怎么用?PHP OW::getRequestHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OW
的用法示例。
在下文中一共展示了OW::getRequestHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @return Constructor.
*/
public function __construct($params)
{
parent::__construct();
$adsService = ADS_BOL_Service::getInstance();
$rhandlerAttrs = OW::getRequestHandler()->getHandlerAttributes();
$pluginKey = OW::getAutoloader()->getPluginKey($rhandlerAttrs['controller']);
if (empty($params['position']) || OW::getUser()->isAuthorized('ads', 'hide_ads')) {
$this->setVisible(false);
return;
}
$position = trim($params['position']);
if (!in_array($position, array(ADS_BOL_Service::BANNER_POSITION_TOP, ADS_BOL_Service::BANNER_POSITION_SIDEBAR, ADS_BOL_Service::BANNER_POSITION_BOTTOM))) {
$this->setVisible(false);
return;
}
$location = BOL_GeolocationService::getInstance()->ipToCountryCode3(OW::getRequest()->getRemoteAddress());
$banners = ADS_BOL_Service::getInstance()->findPlaceBannerList($pluginKey, $params['position'], $location);
if (empty($banners)) {
$this->setVisible(false);
return;
}
$banner = $banners[array_rand($banners)];
$event = new OW_Event('ads_get_banner_code', array('pluginKey' => $pluginKey, 'position' => $params['position'], 'location' => $location));
$result = OW::getEventManager()->trigger($event);
$data = $result->getData();
$this->assign('code', empty($data) ? $banner->getCode() : $data);
$this->assign('position', $params['position']);
}
示例2: profileprogressbar_after_route
function profileprogressbar_after_route(OW_Event $event)
{
$handler = OW::getRequestHandler()->getHandlerAttributes();
if ($handler[OW_RequestHandler::ATTRS_KEY_CTRL] == 'BASE_CTRL_Edit' && $handler[OW_RequestHandler::ATTRS_KEY_ACTION] == 'index') {
OW::getRegistry()->addToArray(BASE_CTRL_Edit::EDIT_SYNCHRONIZE_HOOK, array(new PROFILEPROGRESSBAR_CMP_Synchronize(), 'render'));
}
}
示例3: __construct
public function __construct()
{
parent::__construct();
$handlerAttributes = OW::getRequestHandler()->getHandlerAttributes();
$event = new OW_Event('plugin.mailbox.on_plugin_init.handle_controller_attributes', array('handlerAttributes' => $handlerAttributes));
OW::getEventManager()->trigger($event);
$handleResult = $event->getData();
if ($handleResult === false) {
$this->setVisible(false);
}
if (!OW::getUser()->isAuthenticated()) {
$this->setVisible(false);
} else {
if (!BOL_UserService::getInstance()->isApproved() && OW::getConfig()->getValue('base', 'mandatory_user_approve')) {
$this->setVisible(false);
}
$user = OW::getUser()->getUserObject();
if (BOL_UserService::getInstance()->isSuspended($user->getId())) {
$this->setVisible(false);
}
if ((int) $user->emailVerify === 0 && OW::getConfig()->getValue('base', 'confirm_email')) {
$this->setVisible(false);
}
$this->useChat = BOL_AuthorizationService::STATUS_AVAILABLE;
$this->assign('useChat', $this->useChat);
$this->assign('msg', '');
}
}
示例4: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct();
if (!OW::getUser()->isAdmin()) {
throw new AuthenticateException();
}
if (!OW::getRequest()->isAjax()) {
$document = OW::getDocument();
$document->setMasterPage(new ADMIN_CLASS_MasterPage());
$this->setPageTitle(OW::getLanguage()->text('admin', 'page_default_title'));
}
BOL_PluginService::getInstance()->checkManualUpdates();
$plugin = BOL_PluginService::getInstance()->findNextManualUpdatePlugin();
$handlerParams = OW::getRequestHandler()->getHandlerAttributes();
// TODO refactor shortcut below
if (!defined('OW_PLUGIN_XP') && $plugin !== null) {
if ($handlerParams['controller'] === 'ADMIN_CTRL_Plugins' && $handlerParams['action'] === 'manualUpdateRequest') {
//action
} else {
throw new RedirectException(OW::getRouter()->urlFor('ADMIN_CTRL_Plugins', 'manualUpdateRequest', array('key' => $plugin->getKey())));
}
}
// TODO temp admin pge inform event
function admin_check_if_admin_page()
{
return true;
}
OW::getEventManager()->bind('admin.check_if_admin_page', 'admin_check_if_admin_page');
}
示例5: antibruteforce_core_after_route
function antibruteforce_core_after_route(OW_Event $event)
{
if (OW::getUser()->isAuthenticated()) {
return;
}
$classDir = OW::getPluginManager()->getPlugin('antibruteforce')->getClassesDir();
$handler = OW::getRequestHandler()->getHandlerAttributes();
if (OW::getConfig()->getValue('antibruteforce', 'authentication')) {
include_once $classDir . 'sign_in.php';
include_once $classDir . 'auth_result.php';
}
if (OW::getConfig()->getValue('antibruteforce', 'registration')) {
if ($handler[OW_RequestHandler::ATTRS_KEY_CTRL] == 'BASE_CTRL_Join' && $handler[OW_RequestHandler::ATTRS_KEY_ACTION] == 'index') {
OW::getEventManager()->bind(OW_EventManager::ON_FINALIZE, 'antibruteforce_core_finalize');
} else {
if ($handler[OW_RequestHandler::ATTRS_KEY_CTRL] == 'BASE_CTRL_Captcha' && $handler[OW_RequestHandler::ATTRS_KEY_ACTION] == 'ajaxResponder') {
include_once $classDir . 'captcha.php';
}
}
}
if ($handler[OW_RequestHandler::ATTRS_KEY_CTRL] != 'ANTIBRUTEFORCE_CTRL_Antibruteforce') {
if (ANTIBRUTEFORCE_BOL_Service::getInstance()->isLocked()) {
ANTIBRUTEFORCE_BOL_Service::getInstance()->redirect();
}
}
}
示例6: getRoute
public static function getRoute()
{
$route = OW::getRequestHandler()->getHandlerAttributes();
if (is_array($route)) {
return $route;
}
return false;
}
示例7: watchdog_after_route
function watchdog_after_route(OW_Event $event)
{
$handlerAttributes = OW::getRequestHandler()->getHandlerAttributes();
if ($handlerAttributes[OW_RequestHandler::ATTRS_KEY_CTRL] == 'BASE_CTRL_Join' && $handlerAttributes[OW_RequestHandler::ATTRS_KEY_ACTION] == 'index' || OW::getUser()->isAuthenticated() && !OW::getUser()->isAdmin()) {
WATCHDOG_BOL_WatchdogService::getInstance()->checkRemoteIP();
return;
}
}
示例8: init
public function init()
{
parent::init();
$handler = OW::getRequestHandler()->getHandlerAttributes();
if (!in_array($handler[OW_RequestHandler::ATTRS_KEY_VARLIST]['category'], array(BOOKMARKS_BOL_Service::LIST_LATEST, BOOKMARKS_BOL_Service::LIST_ONLINE))) {
throw new Redirect404Exception();
}
$this->getComponent('sort')->setActive($handler[OW_RequestHandler::ATTRS_KEY_VARLIST]['category']);
}
示例9: ivideo_after_route
function ivideo_after_route(OW_Event $event)
{
$handlerAttributes = OW::getRequestHandler()->getHandlerAttributes();
$attrKey = $handlerAttributes[OW_RequestHandler::ATTRS_KEY_CTRL];
$attrAction = $handlerAttributes[OW_RequestHandler::ATTRS_KEY_ACTION];
if ($attrKey == 'VIDEO_CTRL_Video' && ($attrAction == 'viewList' || $attrAction == 'viewTaggedList') || $attrKey == 'VIDEOPLUS_CTRL_Video' && ($attrAction == 'viewList' || $attrAction == 'viewTaggedList' || $attrAction == 'listCategory' || $attrAction == 'listCategoryItems')) {
$code = '<li class=\\"uploads\\"><a href=\\"' . OW::getRouter()->urlForRoute('ivideo_view_list', array('type' => 'latest')) . '\\"><span class=\\"ow_ic_video\\">' . OW::getLanguage()->text('ivideo', 'video_uploads') . '</span></a></li>';
$textLocation = OW::getConfig()->getValue('ivideo', 'makeUploaderMain') == '1' ? 'prepend' : 'append';
$headSrc = '$(document).ready(function()
{
$(".ow_content_menu ").' . $textLocation . '("' . $code . '");
});';
OW::getDocument()->addCustomHeadInfo('<script type="text/javascript">' . $headSrc . '</script>');
}
}
示例10: onAfterRout
public function onAfterRout(OW_Event $event)
{
$handlerAtr = OW::getRequestHandler()->getHandlerAttributes();
if ($handlerAtr['controller'] == 'BASE_CTRL_ComponentPanel' && $handlerAtr['action'] == 'profile') {
if (!OW::getUser()->isAuthenticated() && $this->redirectGuestToJoin) {
OW::getApplication()->redirect(OW::getRouter()->urlForRoute('base_join', array('type' => $_POST['type'])));
}
}
if ($handlerAtr['controller'] == 'BASE_CTRL_ComponentPanel' && $handlerAtr['action'] == 'profile') {
if (OW::getPluginManager()->getPlugin('skadate')) {
$this->checkProfileSkadate($handlerAtr);
} else {
$this->checkProfileOxwall($handlerAtr);
}
}
}
示例11: onAfterRout
public function onAfterRout(OW_Event $event)
{
$handlerAtr = OW::getRequestHandler()->getHandlerAttributes();
if ($handlerAtr['controller'] == 'BASE_CTRL_ComponentPanel' && $handlerAtr['action'] == 'profile') {
$profileUserName = empty($handlerAtr['params']['username']) ? false : $handlerAtr['params']['username'];
$profileUserId = BOL_UserService::getInstance()->findByUsername($profileUserName)->id;
$currentId = OW::getUser()->getId();
if ($profileUserId == $currentId) {
return;
}
$total = BOL_QuestionService::getInstance()->getQuestionData(array($profileUserId, $currentId), array('sex'));
if ($total[$profileUserId]['sex'] == $total[$currentId]['sex']) {
OW::getApplication()->redirect(OW::getRouter()->urlForRoute('not-for-your-sex', array('type' => $_POST['type'])));
}
}
}
示例12: onAfterRoute
public function onAfterRoute()
{
$userService = BOL_UserService::getInstance();
if (OW::getUser()->isAuthenticated()) {
$user = OW::getUser()->getUserObject();
if ($userService->isSuspended($user->id)) {
OW::getRequestHandler()->setCatchAllRequestsAttributes('skadateios.suspended', array(OW_RequestHandler::CATCH_ALL_REQUEST_KEY_CTRL => 'SKADATEIOS_ACTRL_Base', OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ACTION => 'suspended'));
} else {
if (OW::getConfig()->getValue('base', 'mandatory_user_approve') && !$userService->isApproved($user->id)) {
OW::getRequestHandler()->setCatchAllRequestsAttributes('skadateios.not_approved', array(OW_RequestHandler::CATCH_ALL_REQUEST_KEY_CTRL => 'SKADATEIOS_ACTRL_Base', OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ACTION => 'notApproved'));
} else {
if (!$user->emailVerify && OW::getConfig()->getValue('base', 'confirm_email')) {
OW::getRequestHandler()->setCatchAllRequestsAttributes('skadateios.not_verified', array(OW_RequestHandler::CATCH_ALL_REQUEST_KEY_CTRL => 'SKADATEIOS_ACTRL_Base', OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ACTION => 'notVerified'));
}
}
}
} else {
OW::getRequestHandler()->setCatchAllRequestsAttributes('skadateios.not_authenticated', array(OW_RequestHandler::CATCH_ALL_REQUEST_KEY_CTRL => 'SKADATEIOS_ACTRL_Base', OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ACTION => 'notAuthenticated'));
}
}
示例13: redirect
public function redirect()
{
if (OW::getRequest()->isAjax()) {
$handler = OW::getRequestHandler()->getHandlerAttributes();
if ($handler[OW_RequestHandler::ATTRS_KEY_CTRL] == 'BASE_CTRL_User' && $handler[OW_RequestHandler::ATTRS_KEY_ACTION] == 'ajaxSignIn') {
OW::getSession()->delete(ANTIBRUTEFORCE_BOL_Service::SESSION_NAME);
exit(json_encode(array('result' => TRUE, 'message' => '')));
} else {
if ($handler[OW_RequestHandler::ATTRS_KEY_CTRL] == 'BASE_CTRL_Captcha' && $handler[OW_RequestHandler::ATTRS_KEY_ACTION] == 'ajaxResponder') {
OW::getSession()->delete(ANTIBRUTEFORCE_BOL_Service::SESSION_NAME);
exit(json_encode(array('result' => FALSE, 'reload' => OW::getRouter()->urlForRoute('antibruteforce.authenticate_fail'))));
} else {
if ($handler[OW_RequestHandler::ATTRS_KEY_CTRL] == 'SMARTCAPTCHA_CTRL_SmartCaptcha' && $handler[OW_RequestHandler::ATTRS_KEY_ACTION] == 'ajaxResponder') {
OW::getSession()->delete(ANTIBRUTEFORCE_BOL_Service::SESSION_NAME);
exit(json_encode(array('result' => FALSE, 'reload' => OW::getRouter()->urlForRoute('antibruteforce.authenticate_fail'))));
}
}
}
} else {
OW::getSession()->delete(ANTIBRUTEFORCE_BOL_Service::SESSION_NAME);
UTIL_Url::redirect(OW::getRouter()->urlForRoute('antibruteforce.authenticate_fail'));
}
}
示例14: onPluginsInitCheckUserStatus
public function onPluginsInitCheckUserStatus()
{
if (OW::getUser()->isAuthenticated()) {
$user = BOL_UserService::getInstance()->findUserById(OW::getUser()->getId());
if (OW::getConfig()->getValue('base', 'mandatory_user_approve') && OW::getUser()->isAuthenticated() && !BOL_UserService::getInstance()->isApproved()) {
OW::getRequestHandler()->setCatchAllRequestsAttributes('base.wait_for_approval', array('controller' => 'BASE_CTRL_WaitForApproval', 'action' => 'index'));
OW::getRequestHandler()->addCatchAllRequestsExclude('base.wait_for_approval', 'BASE_CTRL_User', 'signOut');
}
if ($user !== null) {
if (BOL_UserService::getInstance()->isSuspended($user->getId()) && !OW::getUser()->isAdmin()) {
OW::getRequestHandler()->setCatchAllRequestsAttributes('base.suspended_user', array('controller' => 'BASE_CTRL_SuspendedUser', 'action' => 'index'));
OW::getRequestHandler()->addCatchAllRequestsExclude('base.suspended_user', 'BASE_CTRL_User', 'signOut');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.suspended_user', 'BASE_CTRL_Avatar');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.suspended_user', 'BASE_CTRL_Edit');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.suspended_user', 'BASE_CTRL_DeleteUser');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.suspended_user', 'BASE_CTRL_Captcha');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.suspended_user', 'BASE_CTRL_Console');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.suspended_user', 'BASE_CTRL_AjaxLoader');
}
if ((int) $user->emailVerify === 0 && OW::getConfig()->getValue('base', 'confirm_email')) {
OW::getRequestHandler()->setCatchAllRequestsAttributes('base.email_verify', array(OW_RequestHandler::CATCH_ALL_REQUEST_KEY_CTRL => 'BASE_CTRL_EmailVerify', OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ACTION => 'index'));
OW::getRequestHandler()->addCatchAllRequestsExclude('base.email_verify', 'BASE_CTRL_User', 'signOut');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.email_verify', 'BASE_CTRL_EmailVerify');
}
$isAdminUrl = false;
$accountType = BOL_QuestionService::getInstance()->findAccountTypeByName($user->accountType);
$attrs = OW::getRequestHandler()->getHandlerAttributes();
if (!empty($attrs[OW_RequestHandler::ATTRS_KEY_CTRL])) {
$parents = class_parents($attrs[OW_RequestHandler::ATTRS_KEY_CTRL], true);
if (in_array('ADMIN_CTRL_Abstract', $parents)) {
$isAdminUrl = true;
}
}
if (!$isAdminUrl) {
if (empty($accountType)) {
OW::getRequestHandler()->setCatchAllRequestsAttributes('base.complete_profile.account_type', array('controller' => 'BASE_CTRL_CompleteProfile', 'action' => 'fillAccountType'));
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile.account_type', 'BASE_CTRL_Console', 'listRsp');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile.account_type', 'BASE_CTRL_User', 'signOut');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile.account_type', 'INSTALL_CTRL_Install');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile.account_type', 'BASE_CTRL_BaseDocument', 'installCompleted');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile.account_type', 'BASE_CTRL_AjaxLoader');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile.account_type', 'BASE_CTRL_AjaxComponentAdminPanel');
} else {
$questionsEditStamp = OW::getConfig()->getValue('base', 'profile_question_edit_stamp');
$updateDetailsStamp = BOL_PreferenceService::getInstance()->getPreferenceValue('profile_details_update_stamp', OW::getUser()->getId());
if ($questionsEditStamp >= (int) $updateDetailsStamp) {
require_once OW_DIR_CORE . 'validator.php';
$questionList = BOL_QuestionService::getInstance()->getEmptyRequiredQuestionsList($user->id);
if (!empty($questionList)) {
OW::getRequestHandler()->setCatchAllRequestsAttributes('base.complete_profile', array('controller' => 'BASE_CTRL_CompleteProfile', 'action' => 'fillRequiredQuestions'));
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile', 'BASE_CTRL_Console', 'listRsp');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile', 'BASE_CTRL_User', 'signOut');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile', 'INSTALL_CTRL_Install');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile', 'BASE_CTRL_BaseDocument', 'installCompleted');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile', 'BASE_CTRL_AjaxLoader');
OW::getRequestHandler()->addCatchAllRequestsExclude('base.complete_profile', 'BASE_CTRL_AjaxComponentAdminPanel');
} else {
BOL_PreferenceService::getInstance()->savePreferenceValue('profile_details_update_stamp', time(), OW::getUser()->getId());
}
}
}
}
} else {
OW::getUser()->logout();
}
}
}
示例15: handleRequest
/**
* ---------
*/
public function handleRequest()
{
$baseConfigs = OW::getConfig()->getValues('base');
//members only
if ((int) $baseConfigs['guests_can_view'] === BOL_UserService::PERMISSIONS_GUESTS_CANT_VIEW && !OW::getUser()->isAuthenticated()) {
$attributes = array(OW_RequestHandler::CATCH_ALL_REQUEST_KEY_CTRL => 'BASE_MCTRL_User', OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ACTION => 'standardSignIn');
OW::getRequestHandler()->setCatchAllRequestsAttributes('base.members_only', $attributes);
$this->addCatchAllRequestsException('base.members_only_exceptions', 'base.members_only');
}
//splash screen
if ((bool) OW::getConfig()->getValue('base', 'splash_screen') && !isset($_COOKIE['splashScreen'])) {
$attributes = array(OW_RequestHandler::CATCH_ALL_REQUEST_KEY_CTRL => 'BASE_MCTRL_BaseDocument', OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ACTION => 'splashScreen', OW_RequestHandler::CATCH_ALL_REQUEST_KEY_REDIRECT => true, OW_RequestHandler::CATCH_ALL_REQUEST_KEY_JS => true, OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ROUTE => 'base_page_splash_screen');
OW::getRequestHandler()->setCatchAllRequestsAttributes('base.splash_screen', $attributes);
$this->addCatchAllRequestsException('base.splash_screen_exceptions', 'base.splash_screen');
}
// password protected
if ((int) $baseConfigs['guests_can_view'] === BOL_UserService::PERMISSIONS_GUESTS_PASSWORD_VIEW && !OW::getUser()->isAuthenticated() && !isset($_COOKIE['base_password_protection'])) {
$attributes = array(OW_RequestHandler::CATCH_ALL_REQUEST_KEY_CTRL => 'BASE_MCTRL_BaseDocument', OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ACTION => 'passwordProtection');
OW::getRequestHandler()->setCatchAllRequestsAttributes('base.password_protected', $attributes);
$this->addCatchAllRequestsException('base.password_protected_exceptions', 'base.password_protected');
}
// maintenance mode
if ((bool) $baseConfigs['maintenance'] && !OW::getUser()->isAdmin()) {
$attributes = array(OW_RequestHandler::CATCH_ALL_REQUEST_KEY_CTRL => 'BASE_MCTRL_BaseDocument', OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ACTION => 'maintenance', OW_RequestHandler::CATCH_ALL_REQUEST_KEY_REDIRECT => true);
OW::getRequestHandler()->setCatchAllRequestsAttributes('base.maintenance_mode', $attributes);
$this->addCatchAllRequestsException('base.maintenance_mode_exceptions', 'base.maintenance_mode');
}
try {
OW::getRequestHandler()->dispatch();
} catch (RedirectException $e) {
$this->redirect($e->getUrl(), $e->getRedirectCode());
} catch (InterceptException $e) {
OW::getRequestHandler()->setHandlerAttributes($e->getHandlerAttrs());
$this->handleRequest();
}
}