当前位置: 首页>>代码示例>>PHP>>正文


PHP OW::getAuthorization方法代码示例

本文整理汇总了PHP中OW::getAuthorization方法的典型用法代码示例。如果您正苦于以下问题:PHP OW::getAuthorization方法的具体用法?PHP OW::getAuthorization怎么用?PHP OW::getAuthorization使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OW的用法示例。


在下文中一共展示了OW::getAuthorization方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: connect_forum

 public function connect_forum()
 {
     $config = OW::getConfig();
     $language = OW::getLanguage();
     if ($_GET['isForumConnected'] === 'yes' && !OW::getConfig()->getValue('groups', 'is_forum_connected')) {
         try {
             OW::getAuthorization()->addAction('groups', 'add_topic');
         } catch (Exception $e) {
         }
         // Add forum section
         $event = new OW_Event('forum.create_section', array('name' => 'Groups', 'entity' => 'groups', 'isHidden' => true));
         OW::getEventManager()->trigger($event);
         // Add widget
         $event = new OW_Event('forum.add_widget', array('place' => 'group', 'section' => BOL_ComponentAdminService::SECTION_RIGHT));
         OW::getEventManager()->trigger($event);
         $groupsService = GROUPS_BOL_Service::getInstance();
         $groupList = $groupsService->findGroupList(GROUPS_BOL_Service::LIST_ALL);
         if (!empty($groupList)) {
             foreach ($groupList as $group) {
                 // Add forum group
                 $event = new OW_Event('forum.create_group', array('entity' => 'groups', 'name' => $group->title, 'description' => $group->description, 'entityId' => $group->getId()));
                 OW::getEventManager()->trigger($event);
             }
         }
         $config->saveConfig('groups', 'is_forum_connected', 1);
         OW::getFeedback()->info($language->text('groups', 'forum_connected'));
     }
     $redirectURL = OW::getRouter()->urlForRoute('groups-admin-widget-panel');
     $this->redirect($redirectURL);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:30,代码来源:admin.php

示例2: onCollectProfileActions

 public function onCollectProfileActions(BASE_CLASS_EventCollector $event)
 {
     if (!OW::getUser()->isAuthenticated()) {
         return;
     }
     $params = $event->getParams();
     $targetUserID = $params['userId'];
     if (empty($targetUserID) || $targetUserID == OW::getUser()->getId() || !OW::getAuthorization()->isUserAuthorized($targetUserID, 'credits', 'receive')) {
         return;
     }
     $linkId = 'credits' . rand(10, 1000000);
     $event->add(array("label" => OW::getLanguage()->text('credits', 'profile_label_send'), "href" => OW::getRouter()->urlFor('CREDITS_MCTRL_Action', 'send', array('id' => $targetUserID)), "id" => $linkId));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:13,代码来源:event_handler.php

示例3: credits_members_action_tool

function credits_members_action_tool(BASE_CLASS_EventCollector $event)
{
    if (!OW::getUser()->isAuthenticated()) {
        return;
    }
    $params = $event->getParams();
    $targetUserID = $params['userId'];
    if (empty($targetUserID) || $targetUserID == OW::getUser()->getId() || !OW::getAuthorization()->isUserAuthorized($targetUserID, 'credits', 'receive')) {
        return;
    }
    $user = BOL_UserService::getInstance()->getUserName((int) $targetUserID);
    $linkId = 'credits' . rand(10, 1000000);
    $resultArray = array(BASE_CMP_ProfileActionToolbar::DATA_KEY_LABEL => OW::getLanguage()->text('credits', 'profile_label_send'), BASE_CMP_ProfileActionToolbar::DATA_KEY_LINK_HREF => OW::getRouter()->urlFor('CREDITS_CTRL_Action', 'send', array('id' => $targetUserID)), BASE_CMP_ProfileActionToolbar::DATA_KEY_LINK_ID => $linkId);
    $event->add($resultArray);
}
开发者ID:vazahat,项目名称:dudex,代码行数:15,代码来源:init.php

示例4: __construct

 /**
  * @return Constructor.
  */
 public function __construct($paramObj)
 {
     parent::__construct();
     // check if comments are empty and user can't add comments
     if ((int) BOL_CommentService::getInstance()->findCommentCount('base_index_wall', 1) === 0) {
         if (!OW::getUser()->isAuthenticated() || !OW::getAuthorization()->isUserAuthorized(OW::getUser()->getId(), 'base', 'add_comment')) {
             $this->setVisible(false);
         }
     }
     $params = $paramObj->customParamList;
     $commentParams = new BASE_CommentsParams('base', 'base_index_wall');
     if (isset($params['comments_count'])) {
         $commentParams->setCommentCountOnPage($params['comments_count']);
     }
     $commentParams->setDisplayType(BASE_CommentsParams::DISPLAY_TYPE_TOP_FORM_WITH_PAGING);
     $commentParams->setWrapInBox(false);
     $this->addComponent('comments', new BASE_CMP_Comments($commentParams));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:21,代码来源:index_wall_widget.php

示例5: index

 /**
  * Default action
  */
 public function index()
 {
     $lang = OW::getLanguage();
     $form = new OCSFAVORITES_CLASS_SettingsForm();
     $this->addForm($form);
     if (OW::getRequest()->isPost() && $form->isValid($_POST)) {
         $values = $form->getValues();
         $canView = (int) $values['canView'];
         OW::getConfig()->saveConfig('ocsfavorites', 'can_view', $canView);
         $authorization = OW::getAuthorization();
         $groupName = 'ocsfavorites';
         if ($canView) {
             $authorization->addAction($groupName, 'view_users', false);
         } else {
             $authorization->deleteAction($groupName, 'view_users');
         }
         OW::getFeedback()->info($lang->text('ocsfavorites', 'settings_updated'));
         $this->redirect();
     }
     $form->getElement('canView')->setValue(OW::getConfig()->getValue('ocsfavorites', 'can_view'));
     $logo = OW::getPluginManager()->getPlugin('ocsfavorites')->getStaticUrl() . 'img/oxwallcandystore-logo.jpg';
     $this->assign('logo', $logo);
     $this->setPageHeading($lang->text('ocsfavorites', 'page_heading_admin'));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:27,代码来源:admin.php

示例6: send

 public function send(array $params = null)
 {
     if (!OW::getUser()->isAuthenticated()) {
         throw new AuthenticateException();
     }
     $receiveUser = $params['id'];
     if (!OW::getUser()->isAuthorized('credits', 'send') || !OW::getAuthorization()->isUserAuthorized($receiveUser, 'credits', 'receive') || !isset($params['id'])) {
         $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCtrlViewDir() . 'authorization_failed.html');
         return;
     }
     $language = OW::getLanguage();
     $config = OW::getConfig();
     $userId = OW::getUser()->getId();
     $userCredits = USERCREDITS_BOL_CreditsService::getInstance()->getCreditsBalance($userId);
     $this->assign('userCredits', $userCredits);
     $this->assign('receiveUserName', BOL_UserService::getInstance()->getDisplayName($receiveUser));
     $form = new Form('creditForm');
     $element = new TextField('creditPoint');
     $element->setRequired(true);
     $element->setLabel($language->text('credits', 'credits_to_send'));
     $element->addAttribute("style", "width: 100px;");
     $validator = new IntValidator(1, $userCredits);
     $validator->setErrorMessage($language->text('credits', 'credit_value_error'));
     $element->addValidator($validator);
     $form->addElement($element);
     $element = new Submit('sendCredit');
     $element->setValue($language->text('credits', 'send_credits'));
     $form->addElement($element);
     if (OW::getRequest()->isPost()) {
         if ($form->isValid($_POST)) {
             $values = $form->getValues();
             $creditValue = (int) $values['creditPoint'];
             if (CREDITS_BOL_Service::getInstance()->transferCredits($userId, $receiveUser, $creditValue)) {
                 OW::getFeedback()->info($language->text('credits', 'credit_transfer_ok'));
                 $this->redirect(OW::getRouter()->urlForRoute('credits_transfer'));
             } else {
                 OW::getFeedback()->error($language->text('credits', 'credit_transfer_fail'));
             }
         }
     }
     $this->addForm($form);
     $this->setPageHeading($language->text('credits', 'transfer_credits_label'));
     $this->setPageTitle($language->text('credits', 'transfer_credits_label'));
     $this->setPageHeadingIconClass('ow_ic_gear_wheel');
 }
开发者ID:vazahat,项目名称:dudex,代码行数:45,代码来源:action.php

示例7: updateUserInfo

 public function updateUserInfo()
 {
     //DDoS check
     if (empty($_SESSION['lastUpdateRequestTimestamp'])) {
         $_SESSION['lastUpdateRequestTimestamp'] = time();
     } else {
         if (time() - (int) $_SESSION['lastUpdateRequestTimestamp'] < 3) {
             exit('{error: "Too much requests"}');
         }
     }
     $_SESSION['lastUpdateRequestTimestamp'] = time();
     $service = AJAXIM_BOL_Service::getInstance();
     if ($errorMessage = $service->checkPermissions()) {
         exit(json_encode(array('error' => $errorMessage)));
     }
     /* @var BOL_User $user */
     $user = null;
     $friendship = null;
     if (!empty($_POST['click']) && $_POST['click'] == 'online_now') {
         $user = BOL_UserService::getInstance()->findUserById($_POST['userId']);
         if (!OW::getAuthorization()->isUserAuthorized($user->getId(), 'ajaxim', 'chat')) {
             $info = array('warning' => true, 'message' => OW::getLanguage()->text('ajaxim', 'user_is_not_authorized_chat', array('username' => BOL_UserService::getInstance()->getDisplayName($user->getId()))), 'type' => 'warning');
             exit(json_encode($info));
         }
         $eventParams = array('action' => 'ajaxim_invite_to_chat', 'ownerId' => $user->getId(), 'viewerId' => OW::getUser()->getId());
         try {
             OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
         } catch (RedirectException $e) {
             $info = array('warning' => true, 'message' => OW::getLanguage()->text('ajaxim', 'warning_user_privacy_friends_only', array('displayname' => BOL_UserService::getInstance()->getDisplayName($user->getId()))), 'type' => 'warning');
             exit(json_encode($info));
         }
         $isFriendsOnlyMode = (bool) OW::getEventManager()->call('plugin.friends');
         if ($isFriendsOnlyMode) {
             $friendship = OW::getEventManager()->call('plugin.friends.check_friendship', array('userId' => OW::getUser()->getId(), 'friendId' => $user->getId()));
             if (empty($friendship)) {
                 $info = array('warning' => true, 'message' => OW::getLanguage()->text('ajaxim', 'warning_user_privacy_friends_only', array('displayname' => BOL_UserService::getInstance()->getDisplayName($user->getId()))), 'type' => 'warning');
                 exit(json_encode($info));
             } else {
                 if ($friendship->getStatus() != 'active') {
                     $info = array('warning' => true, 'message' => OW::getLanguage()->text('ajaxim', 'warning_user_privacy_friends_only', array('displayname' => BOL_UserService::getInstance()->getDisplayName($user->getId()))), 'type' => 'warning');
                     exit(json_encode($info));
                 }
             }
         }
         if (BOL_UserService::getInstance()->isBlocked(OW::getUser()->getId(), $user->getId())) {
             $errorMessage = OW::getLanguage()->text('base', 'user_block_message');
             $info = array('warning' => true, 'message' => $errorMessage, 'type' => 'error');
             exit(json_encode($info));
         }
         $onlineStatus = BOL_UserService::getInstance()->findOnlineStatusForUserList(array($user->getId()));
         if (!$onlineStatus[$user->getId()]) {
             $displayname = BOL_UserService::getInstance()->getDisplayName($user->getId());
             $info = array('warning' => true, 'message' => OW::getLanguage()->text('ajaxim', 'user_went_offline', array('displayname' => $displayname)), 'type' => 'warning');
             exit(json_encode($info));
         }
     } else {
         if (!empty($_POST['userId'])) {
             $user = BOL_UserService::getInstance()->findUserById($_POST['userId']);
         }
     }
     if (empty($user)) {
         exit('{error: "User not found"}');
     }
     $friendship = OW::getEventManager()->call('plugin.friends.check_friendship', array('userId' => OW::getUser()->getId(), 'friendId' => $user->getId()));
     $info = '';
     switch ($_POST['action']) {
         case "open":
             $info['node'] = $user->getId();
             $info = $service->getUserInfoByNode($user, $friendship);
             break;
     }
     exit(json_encode($info));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:73,代码来源:action.php

示例8: int

    $config->addConfig('vwls', 'availability', 0, 'Availability');
}
if (!$config->configExists('vwls', 'status')) {
    $config->addConfig('vwls', 'status', 'approved', 'status');
}
if (!$config->configExists('vwls', 'member')) {
    $config->addConfig('vwls', 'member', 'all', 'member');
}
if (!$config->configExists('vwls', 'member_list')) {
    $config->addConfig('vwls', 'member_list', '', 'member_list');
}
$baseSwf_url = OW_URL_HOME . 'ow_plugins/vwlivestreaming/ls/';
if (!$config->configExists('vwls', 'baseSwf_url')) {
    $config->addConfig('vwls', 'baseSwf_url', $baseSwf_url, 'baseSwf_url');
}
$dbPref = OW_DB_PREFIX;
// 'permission' consists of
// showCamSettings:advancedCamSettings:configureSource:onlyVideo:noVideo:noEmbeds:showTimer:writeText:privateTextchat:
// fillWindow:writeText2:enableVideo:enableChat:enableUsers:fillWindow2:verboseLevel (16)
$sql = "CREATE TABLE IF NOT EXISTS `" . $dbPref . "vwls_clip` (\n  `id` int(11) NOT NULL auto_increment,\n  `userId` int(11) NOT NULL,\n  `title` varchar(128) NOT NULL default '',\n  `description` text NOT NULL,\n  `modifDatetime` int(11) NOT NULL default '0',\n  `roomLimit` int(11) NOT NULL,\n  `welcome` text NOT NULL,\n  `welcome2` text NOT NULL,\n  `offlineMessage` text NOT NULL,\n  `camWidth` int(11) NOT NULL,\n  `camHeight` int(11) NOT NULL,\n  `camFPS` int(11) NOT NULL,\n  `micRate` int(11) NOT NULL,\n  `soundQuality` int(11) NOT NULL,\n  `camBandwidth` int(11) NOT NULL,\n  `labelColor` varchar(50) NOT NULL,\n  `layoutCode` text NOT NULL,\n  `layoutCode2` text NOT NULL,\n  `filterRegex` text NOT NULL,\n  `filterReplace` text NOT NULL,\n  `floodProtection` int(11) NOT NULL,\n  `floodProtection2` int(11) NOT NULL,\n  `permission` varchar(128) NOT NULL,\n  `status` varchar(50) NOT NULL,\n  `user_list` text NOT NULL,\n  `moderator_list` text NOT NULL,\n  `addDatetime` int(11) NOT NULL default '0',\n  `privacy` varchar(50) NOT NULL default 'everybody',\n  `online` varchar(128) NOT NULL default 'no',\n  `onlineCount` int(11) NOT NULL,\n  `onlineUser` varchar(128) NOT NULL default '',\n  `onlineUsers` varchar(128) NOT NULL default '',\n  PRIMARY KEY  (`id`),\n  KEY `userId` (`userId`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8;";
OW::getDbo()->query($sql);
OW::getPluginManager()->addPluginSettingsRouteName('vwls', 'vwls_admin_config');
$authorization = OW::getAuthorization();
$groupName = 'vwls';
$authorization->addGroup($groupName);
$authorization->addAction($groupName, 'add');
$authorization->addAction($groupName, 'view', true);
$authorization->addAction($groupName, 'add_comment');
$authorization->addAction($groupName, 'delete_comment_by_content_owner');
$path = OW::getPluginManager()->getPlugin('vwls')->getRootDir() . 'langs.zip';
BOL_LanguageService::getInstance()->importPrefixFromZip($path, 'vwls');
开发者ID:vazahat,项目名称:dudex,代码行数:31,代码来源:install.php

示例9: updateUserInfo

 public function updateUserInfo()
 {
     //DDoS check
     if (empty($_SESSION['lastUpdateRequestTimestamp'])) {
         $_SESSION['lastUpdateRequestTimestamp'] = time();
     } else {
         if (time() - (int) $_SESSION['lastUpdateRequestTimestamp'] < 3) {
             exit('{error: "Too much requests"}');
         }
     }
     $_SESSION['lastUpdateRequestTimestamp'] = time();
     $conversationService = MAILBOX_BOL_ConversationService::getInstance();
     if ($errorMessage = $conversationService->checkPermissions()) {
         exit(json_encode(array('error' => $errorMessage)));
     }
     /* @var BOL_User $user */
     $user = null;
     if (!empty($_POST['userId'])) {
         $user = BOL_UserService::getInstance()->findUserById($_POST['userId']);
         if (!$user) {
             $info = array('warning' => true, 'message' => 'User not found', 'type' => 'error');
             exit(json_encode($info));
         }
         if (!OW::getAuthorization()->isUserAuthorized($user->getId(), 'mailbox', 'reply_to_chat_message')) {
             $status = BOL_AuthorizationService::getInstance()->getActionStatus('mailbox', 'reply_to_chat_message', array('userId' => $user->getId()));
             if ($status['status'] == BOL_AuthorizationService::STATUS_DISABLED) {
                 $info = array('warning' => true, 'message' => OW::getLanguage()->text('mailbox', 'user_is_not_authorized_chat', array('username' => BOL_UserService::getInstance()->getDisplayName($user->getId()))), 'type' => 'warning');
                 exit(json_encode($info));
             }
         }
         $eventParams = array('action' => 'mailbox_invite_to_chat', 'ownerId' => $user->getId(), 'viewerId' => OW::getUser()->getId());
         try {
             OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
         } catch (RedirectException $e) {
             //TODOS return message that has been set in a privacy value
             $info = array('warning' => true, 'message' => OW::getLanguage()->text('mailbox', 'warning_user_privacy_friends_only', array('displayname' => BOL_UserService::getInstance()->getDisplayName($user->getId()))), 'type' => 'warning');
             exit(json_encode($info));
         }
         if (BOL_UserService::getInstance()->isBlocked(OW::getUser()->getId(), $user->getId())) {
             $errorMessage = OW::getLanguage()->text('base', 'user_block_message');
             $info = array('warning' => true, 'message' => $errorMessage, 'type' => 'error');
             exit(json_encode($info));
         }
         if (empty($_POST['checkStatus']) || $_POST['checkStatus'] != 2) {
             $onlineStatus = BOL_UserService::getInstance()->findOnlineStatusForUserList(array($user->getId()));
             if (!$onlineStatus[$user->getId()]) {
                 $displayname = BOL_UserService::getInstance()->getDisplayName($user->getId());
                 $info = array('warning' => true, 'message' => OW::getLanguage()->text('mailbox', 'user_went_offline', array('displayname' => $displayname)), 'type' => 'warning');
                 exit(json_encode($info));
             }
         }
         $info = $conversationService->getUserInfo($user->getId());
         exit(json_encode($info));
     }
     exit;
 }
开发者ID:tammyrocks,项目名称:mailbox,代码行数:56,代码来源:ajax.php

示例10: onPing

 public function onPing(OW_Event $event)
 {
     $eventParams = $event->getParams();
     $params = $eventParams['params'];
     if ($eventParams['command'] != 'ajaxim_ping') {
         return;
     }
     $service = AJAXIM_BOL_Service::getInstance();
     if (empty($_SESSION['lastRequestTimestamp'])) {
         $_SESSION['lastRequestTimestamp'] = (int) $params['lastRequestTimestamp'];
     }
     if ((int) $params['lastRequestTimestamp'] - (int) $_SESSION['lastRequestTimestamp'] < 3) {
         $event->setData(array('error' => "Too much requests"));
     }
     $_SESSION['lastRequestTimestamp'] = (int) $params['lastRequestTimestamp'];
     if (!OW::getUser()->isAuthenticated()) {
         $event->setData(array('error' => "You have to sign in"));
     }
     if (!OW::getRequest()->isAjax()) {
         $event->setData(array('error' => "Ajax request required"));
     }
     $onlinePeople = AJAXIM_BOL_Service::getInstance()->getOnlinePeople(OW::getUser());
     if (!empty($params['lastMessageTimestamps'])) {
         $clientOnlineList = array_keys($params['lastMessageTimestamps']);
     } else {
         $clientOnlineList = array();
     }
     $onlineInfo = array();
     /* @var $user BOL_User */
     foreach ($onlinePeople['users'] as $user) {
         if (!OW::getAuthorization()->isUserAuthorized($user->getId(), 'ajaxim', 'chat') && !OW::getAuthorization()->isUserAuthorized($user->getId(), 'ajaxim')) {
             $onlinePeople['count']--;
             continue;
         }
         if (!in_array($user->getId(), $clientOnlineList)) {
             $friendship = OW::getEventManager()->call('plugin.friends.check_friendship', array('userId' => OW::getUser()->getId(), 'friendId' => $user->getId()));
             $roster = $service->getUserInfoByNode($user, $friendship);
             $roster['show'] = 'chat';
             $roster['status'] = 'online';
             $presence = array('node' => $user->getId(), 'data' => $roster);
             $onlineInfo[] = $presence;
         }
     }
     /* @var $user BOL_User */
     foreach ($clientOnlineList as $userId) {
         if (!array_key_exists($userId, $onlinePeople['users'])) {
             $presence = array('node' => $userId, 'data' => array('status' => 'offline'));
             $onlineInfo[] = $presence;
         }
     }
     switch ($params['action']) {
         case "get":
             $response = array();
             if (!empty($onlineInfo)) {
                 $response['presenceList'] = $onlineInfo;
             }
             if ($onlinePeople['count'] != $params['onlineCount']) {
                 $response['onlineCount'] = $onlinePeople['count'];
             }
             if (!empty($params['lastMessageTimestamps'])) {
                 $messageList = AJAXIM_BOL_Service::getInstance()->findUnreadMessages(OW::getUser(), $params['lastMessageTimestamps']);
                 if (!empty($messageList)) {
                     $response['messageList'] = $messageList;
                     $response['messageListLength'] = count($messageList);
                 }
             }
             $event->setData($response);
             break;
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:70,代码来源:event_handler.php

示例11: onRemoveFavorite

 /**
  * @param OW_Event $e
  */
 public function onRemoveFavorite(OW_Event $e)
 {
     $params = $e->getParams();
     $userId = (int) $params['userId'];
     $favoriteId = (int) $params['favoriteId'];
     $id = (int) $params['id'];
     if (OW::getConfig()->getValue('ocsfavorites', 'can_view') && OW::getAuthorization()->isUserAuthorized($favoriteId, 'ocsfavorites', 'view_users')) {
         $params = array('entityType' => 'ocsfavorites_add_favorite', 'entityId' => $id);
         $event = new OW_Event('notifications.remove', $params);
         OW::getEventManager()->trigger($event);
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:15,代码来源:event_handler.php

示例12: getNewConversationListForConsoleNotificationMailer

 /**
  *
  * @param array $userId
  * @return array
  */
 public function getNewConversationListForConsoleNotificationMailer($userIdList)
 {
     if (empty($userIdList)) {
         return array();
     }
     $userList = $this->dbo->mergeInClause($userIdList);
     $sql = " SELECT `mess`.`id` as messageId, `mess`.*, `conv`.* FROM `" . $this->getTableName() . "` AS `conv`\n\n\t\t\t\t INNER JOIN `" . MAILBOX_BOL_LastMessageDao::getInstance()->getTableName() . "` AS `last_m`\n\t\t\t\t\t ON (`last_m`.`conversationId` = `conv`.`id`)\n\n            \t INNER JOIN `" . MAILBOX_BOL_MessageDao::getInstance()->getTableName() . "` AS `mess`\n\t\t\t\t \tON ( `last_m`.`initiatorMessageId` = `mess`.id AND ( `last_m`.`initiatorMessageId` > `last_m`.interlocutorMessageId )\n                    OR `last_m`.`interlocutorMessageId` = `mess`.id AND ( `last_m`.`initiatorMessageId` < `last_m`.interlocutorMessageId ) )\n\n\t\t\t     WHERE  `conv`.`notificationSent` = 0 AND ( ( `conv`.`initiatorId` IN ( {$userList} ) AND `last_m`.`interlocutorMessageId` > 0 AND `conv`.`deleted` != " . self::DELETED_INITIATOR . " AND NOT `conv`.`read` & " . self::READ_INITIATOR . "  AND NOT `conv`.`viewed` &  " . self::VIEW_INITIATOR . " )\n\t\t\t\t\t \tOR ( `conv`.`interlocutorId` IN ( {$userList} ) AND `conv`.`deleted` != " . self::DELETED_INTERLOCUTOR . "  AND  NOT `conv`.`read` & " . self::READ_INTERLOCUTOR . " AND NOT `conv`.`viewed` &  " . self::VIEW_INTERLOCUTOR . " ) ) \n        ";
     $conversationList = $this->dbo->queryForList($sql);
     $resultList = array();
     foreach ($conversationList as $conversation) {
         $userId = $conversation['recipientId'];
         if ($conversation['wasAuthorized'] == 0) {
             $actionName = 'read_message';
             if ($conversation['subject'] == 'mailbox_chat_conversation') {
                 $actionName = 'read_chat_message';
             }
             if (!OW::getAuthorization()->isUserAuthorized($userId, 'mailbox', $actionName)) {
                 $status = BOL_AuthorizationService::getInstance()->getActionStatus('mailbox', $actionName);
                 $conversation['text'] = $status['msg'];
             }
         } else {
             if ($conversation['isSystem'] == 1) {
                 $eventParams = json_decode($conversation['text'], true);
                 $eventParams['params']['messageId'] = $conversation['messageId'];
                 $eventParams['params']['getPreview'] = true;
                 $event = new OW_Event($eventParams['entityType'] . '.' . $eventParams['eventName'], $eventParams['params']);
                 OW::getEventManager()->trigger($event);
                 $data = $event->getData();
                 if (!empty($data)) {
                     $conversation['text'] = $data;
                 } else {
                     $conversation['text'] = OW::getLanguage()->text('mailbox', 'can_not_display_entitytype_message', array('entityType' => $eventParams['entityType']));
                 }
             }
         }
         $resultList[$userId][] = $conversation;
     }
     return $resultList;
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:44,代码来源:conversation_dao.php

示例13: int

<?php

/**
 * Copyright (c) 2014, Skalfa LLC
 * All rights reserved.
 *
 * ATTENTION: This commercial software is intended for exclusive use with SkaDate Dating Software (http://www.skadate.com) and is licensed under SkaDate Exclusive License by Skalfa LLC.
 *
 * Full text of this license can be found at http://www.skadate.com/sel.pdf
 */
$pluginKey = 'hotlist';
$dbPrefix = OW_DB_PREFIX . $pluginKey . '_';
$sql = <<<EOT

CREATE TABLE IF NOT EXISTS `{$dbPrefix}user` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `userId` int(11) NOT NULL,
  `timestamp` int(10) NOT NULL,
  `expiration_timestamp` int(10) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `userId` (`userId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

EOT;
OW::getDbo()->query($sql);
OW::getLanguage()->importPluginLangs(OW::getPluginManager()->getPlugin($pluginKey)->getRootDir() . 'langs.zip', $pluginKey);
OW::getPluginManager()->addPluginSettingsRouteName($pluginKey, 'hotlist-admin-settings');
OW::getConfig()->addConfig($pluginKey, 'expiration_time', 86400 * 30);
OW::getAuthorization()->addGroup('hotlist', false);
OW::getAuthorization()->addAction('hotlist', 'add_to_list');
开发者ID:hardikamutech,项目名称:loov,代码行数:30,代码来源:install.php

示例14: catch

 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
 * following conditions are met:
 *
 *  - Redistributions of source code must retain the above copyright notice, this list of conditions and
 *  the following disclaimer.
 *
 *  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
 *  the following disclaimer in the documentation and/or other materials provided with the distribution.
 *
 *  - Neither the name of the Oxwall Foundation nor the names of its contributors may be used to endorse or promote products
 *  derived from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
try {
    Updater::getConfigService()->addConfig('questions', 'list_order', 'latest');
    Updater::getConfigService()->addConfig('questions', 'ev_page_visited', 0);
    Updater::getConfigService()->addConfig('questions', 'plugin_installed', 1);
    OW::getAuthorization()->addAction('questions', 'add_answer');
    $widgetService = Updater::getWidgetService();
    $widget = $widgetService->addWidget('QUESTIONS_CMP_IndexWidget', false);
    $widgetService->addWidgetToPlace($widget, 'index');
    Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'questions');
} catch (Exception $e) {
}
开发者ID:jorgemunoz8807,项目名称:havanabook,代码行数:31,代码来源:update.php

示例15: getUserFriends

 public function getUserFriends($userId)
 {
     $friendsCount = FRIENDS_BOL_Service::getInstance()->countFriends($userId);
     $friends = FRIENDS_BOL_Service::getInstance()->findFriendIdList($userId, 0, $friendsCount);
     $list = array();
     foreach ($friends as $friend) {
         if (OW::getAuthorization()->isUserAuthorized($friend, 'credits', 'receive')) {
             $list[$friend] = BOL_UserService::getInstance()->getDisplayName($friend);
         }
     }
     return $list;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:12,代码来源:service.php


注:本文中的OW::getAuthorization方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。