Exemplo n.º 1
0
 /**
  * @see OW_ActionController::init()
  *
  */
 public function init()
 {
     parent::init();
     $language = OW::getLanguage();
     $this->setPageHeading($language->text('mailbox', 'mailbox'));
     $this->setPageHeadingIconClass('ow_ic_mail');
 }
Exemplo n.º 2
0
 /**
  * @see OW_ActionController::init()
  *
  */
 public function init()
 {
     parent::init();
     $language = OW::getLanguage();
     $item = new BASE_MenuItem();
     $item->setLabel($language->text('mailbox', 'inbox_label'));
     $item->setIconClass('ow_ic_down_arrow');
     $item->setUrl(OW::getRouter()->urlForRoute("mailbox_default"));
     $item->setKey('inbox');
     $item->setOrder(1);
     $menuItems[] = $item;
     $item = new BASE_MenuItem();
     $item->setLabel($language->text('mailbox', 'sent_label'));
     $item->setIconClass('ow_ic_up_arrow');
     $item->setUrl(OW::getRouter()->urlForRoute("mailbox_sent"));
     $item->setKey('sent');
     $item->setOrder(2);
     $menuItems[] = $item;
     $event = new BASE_CLASS_EventCollector('mailbox.collect_menu_items');
     OW::getEventManager()->trigger($event);
     foreach ($event->getData() as $menuItem) {
         $menuItems[] = $menuItem;
     }
     $this->contentMenu = new BASE_CMP_ContentMenu($menuItems);
     $this->addComponent("mailbox_menu", $this->contentMenu);
     $this->setPageHeading($language->text('mailbox', 'mailbox'));
     $this->setPageHeadingIconClass('ow_ic_mail');
     $this->recordsToPage = (int) OW::getConfig()->getValue('mailbox', 'results_per_page');
     if ($this->recordsToPage === 0) {
         $this->recordsToPage = self::MAILBOX_RECORDS_TO_PAGE;
     }
 }
Exemplo n.º 3
0
 public function init()
 {
     parent::init();
     if (!OW::getUser()->isAuthenticated()) {
         throw new AuthenticateException();
     }
 }
Exemplo n.º 4
0
 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']);
 }
Exemplo n.º 5
0
 public function init()
 {
     parent::init();
     if (!OW::getUser()->isAuthenticated()) {
         throw new AuthenticateException();
     }
     if (!OW::getUser()->isAuthorized('video', 'add')) {
         $this->returnResponse(array('status' => self::STATUS_ERROR, 'result' => FALSE, 'msg' => OW::getLanguage()->text('spvideolite', 'auth_upload_permissions')));
     }
 }
Exemplo n.º 6
0
 public function init()
 {
     parent::init();
     $hadler = OW::getRequestHandler()->getHandlerAttributes();
     if (OW::getUser()->isAuthenticated()) {
         switch ($hadler[OW_RequestHandler::ATTRS_KEY_ACTION]) {
             case 'view':
                 $ownerMode = $this->photoService->findPhotoOwner($hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['id']) == OW::getUser()->getId();
                 $contentOwner = $this->photoService->findPhotoOwner((int) $hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['id']);
                 break;
             case 'getFloatbox':
                 $ownerMode = $this->photoService->findPhotoOwner($_POST['photoId']) == OW::getUser()->getId();
                 break;
             case 'userAlbums':
             case 'userPhotos':
                 $ownerMode = $hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['user'] == OW::getUser()->getUserObject()->username;
                 $contentOwner = ($user = BOL_UserService::getInstance()->findByUsername($hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['user'])) !== NULL ? $user->id : 0;
                 break;
             case 'userAlbum':
                 $ownerMode = $this->photoAlbumService->isAlbumOwner($hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['album'], OW::getUser()->getId());
                 $contentOwner = ($album = $this->photoAlbumService->findAlbumById((int) $hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['album'])) !== NULL ? $album->userId : 0;
                 break;
             case 'ajaxResponder':
                 switch ($_POST['ajaxFunc']) {
                     case 'getAlbumList':
                         $ownerMode = $_POST['userId'] == OW::getUser()->getId();
                         break;
                     case 'getPhotoList':
                         $ownerMode = !empty($_POST['userId']) && $_POST['userId'] == OW::getUser()->getId();
                         break;
                     case 'ajaxDeletePhotos':
                     case 'ajaxMoverToAlbum':
                         $ownerMode = $this->photoAlbumService->isAlbumOwner($_POST['albumId'], OW::getUser()->getId());
                         break;
                     case 'ajaxSetFeaturedStatus':
                     case 'setAsAvatar':
                         $ownerMode = $this->photoService->findPhotoOwner($_POST['entityId']) == OW::getUser()->getId();
                         break;
                     default:
                         $ownerMode = FALSE;
                         break;
                 }
                 break;
             case 'ajaxUpdatePhoto':
                 $ownerMode = $this->photoService->findPhotoOwner($_POST['photoId']) == OW::getUser()->getId();
                 break;
             case 'downloadPhoto':
                 $ownerMode = $this->photoService->findPhotoOwner($hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['id']) == OW::getUser()->getId();
                 break;
             case 'ajaxUpdateAlbum':
                 $ownerMode = $this->photoAlbumService->isAlbumOwner($_POST['album-id'], OW::getUser()->getId());
                 break;
             case 'ajaxCreateAlbum':
                 $ownerMode = TRUE;
                 break;
             default:
                 $ownerMode = FALSE;
                 break;
         }
     } else {
         $ownerMode = FALSE;
     }
     $modPermissions = OW::getUser()->isAuthorized('photo');
     $isAuthorized = OW::getUser()->isAuthorized('photo', 'view');
     if (!$ownerMode && !$modPermissions && !$isAuthorized) {
         if (OW::getRequest()->isAjax()) {
             exit(json_encode(array('result' => FALSE, 'status' => 'error', 'msg' => OW::getLanguage()->text('photo', 'auth_view_permissions'))));
         } else {
             $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCtrlViewDir() . 'authorization_failed.html');
             return;
         }
     }
     if (!empty($contentOwner) && !$ownerMode && !$modPermissions) {
         $privacyParams = array('action' => 'photo_view_album', 'ownerId' => $contentOwner, 'viewerId' => OW::getUser()->getId());
         $event = new OW_Event('privacy_check_permission', $privacyParams);
         OW::getEventManager()->trigger($event);
     }
     if (OW::getRequest()->isAjax() || in_array($hadler[OW_RequestHandler::ATTRS_KEY_ACTION], array('downloadPhoto', 'approve'))) {
         return;
     }
     OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'photo', 'photo');
     if ($hadler[OW_RequestHandler::ATTRS_KEY_ACTION] != 'view') {
         $this->addComponent('pageHead', OW::getClassInstance('PHOTO_CMP_PageHead', $ownerMode, !empty($album) ? $album : NULL));
     }
 }
Exemplo n.º 7
0
 public function init()
 {
     parent::init();
     $this->service = UTAGS_BOL_Service::getInstance();
 }