HomeHelpTrac

Changeset 15573 for tags


Ignore:
Timestamp:
10/09/11 21:40:41 (8 months ago)
Author:
Alexander Trofimov
Message:

Ticket #2627

Location:
tags/7.0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tags/7.0/administration/memb_levels.php

    r15343 r15573  
    7171    $GLOBALS['MySQL']->query("DELETE FROM `sys_acl_level_prices` WHERE `id` IN ('" . implode("','", $_POST['prices']) . "')"); 
    7272} else if(isset($_POST['adm-mlevels-action-save'])) { 
    73     $sQuery = "REPLACE INTO `sys_acl_matrix` SET `IDLevel`='" . $_POST['levelId'] . "', `IDAction`='" . $_POST['actionId'] . "'"; 
    74     $sQuery .= !empty($_POST['allowedCnt']) ? ", `AllowedCount`='" . $_POST['allowedCnt'] . "'" : ""; 
    75     $sQuery .= !empty($_POST['period']) ? ", `AllowedPeriodLen`='" . $_POST['period'] . "'" : "";         
    76     $sQuery .= !empty($_POST['dateStart']) ? ", `AllowedPeriodStart`=FROM_UNIXTIME(" . strtotime($_POST['dateStart']) . ")" : ""; 
    77     $sQuery .= !empty($_POST['dateEnd']) ? ", `AllowedPeriodEnd`=FROM_UNIXTIME(" . strtotime($_POST['dateEnd']) . ")" : ""; 
     73    $sQuery = "REPLACE INTO `sys_acl_matrix` SET `IDLevel`='" . (int)$_POST['levelId'] . "', `IDAction`='" . (int)$_POST['actionId'] . "'"; 
     74    $sQuery .= !empty($_POST['allowedCnt']) ? ", `AllowedCount`='" . (int)$_POST['allowedCnt'] . "'" : ""; 
     75    $sQuery .= !empty($_POST['period']) ? ", `AllowedPeriodLen`='" . (int)$_POST['period'] . "'" : "";         
     76    $sQuery .= !empty($_POST['dateStart']) && strtotime($_POST['dateStart']) > 0 ? ", `AllowedPeriodStart`=FROM_UNIXTIME(" . strtotime($_POST['dateStart']) . ")" : ""; 
     77    $sQuery .= !empty($_POST['dateEnd']) && strtotime($_POST['dateEnd']) > 0 ? ", `AllowedPeriodEnd`=FROM_UNIXTIME(" . strtotime($_POST['dateEnd']) . ")" : ""; 
    7878    $aResult = $GLOBALS['MySQL']->query($sQuery) > 0 ? array('code' => 0, 'message' => MsgBox(_t('_adm_txt_mlevels_action_saved'))) : array('code' => 1, 'message' => MsgBox(_t('_adm_txt_mlevels_action_cannot_save'))); 
    7979 
  • tags/7.0/install/langs/lang-en.php

    r15565 r15573  
    21332133    '_adm_txt_mlevels_price_add_price' => 'Price:', 
    21342134    '_adm_txt_mlevels_actions_number' => 'Number of allowed actions', 
    2135     '_adm_txt_mlevels_actions_number_desc' => 'Leave it blank if you need unlimit number', 
     2135    '_adm_txt_mlevels_actions_number_desc' => 'Leave it blank for unlimited actions', 
    21362136    '_adm_txt_mlevels_actions_reset' => 'Number of actions is reset every', 
    2137     '_adm_txt_mlevels_actions_reset_desc' => 'Leave it blank if you don\'t to reset counter', 
     2137    '_adm_txt_mlevels_actions_reset_desc' => 'In hours. Leave it blank if you don\'t want to reset counter', 
    21382138    '_adm_txt_mlevels_actions_avail_start' => 'This action is available since', 
    21392139    '_adm_txt_mlevels_actions_avail_end' => 'This action is available until', 
    2140     '_adm_txt_mlevels_actions_avail_desc' => 'Leave it blank if the action is available everytime', 
     2140    '_adm_txt_mlevels_actions_avail_desc' => 'Leave it blank if the action is always available', 
    21412141    '_adm_txt_email_language' => 'Language', 
    21422142    '_adm_txt_email_subject' => 'Subject',  
  • tags/7.0/modules/boonex/forum/integrations/base/callback.php

    r15571 r15573  
    3636 
    3737    $oProfile = new BxDolProfile ($sUser); 
     38 
     39    if (!isAdmin($oProfile->_iProfileID)) { 
     40        $iActionId = BX_FORUM_PUBLIC_POST; 
     41        if (isset($aTopic['forum_type']) && 'private' == $aTopic['forum_type']) 
     42            $iActionId = BX_FORUM_PRIVATE_POST; 
     43        checkAction($oProfile->_iProfileID, $iActionId, true); // perform action 
     44    } 
     45 
    3846    $aPlusOriginal = array ( 
    3947        'PosterUrl' => $oProfile->_iProfileID ? getProfileLink($oProfile->_iProfileID) : 'javascript:void(0);' , 
     
    6371 
    6472function onPostEdit ($aTopic, $iPostId, $sPostText, $sUser) { 
     73 
     74    $oProfile = new BxDolProfile ($sUser); 
     75    $fdb = new DbForum (); 
     76    $aPost = $fdb->getPost($iPostId, false); 
     77    if ($sUser != $aPost['user'] && !isAdmin($oProfile->_iProfileID)) 
     78        checkAction($oProfile->_iProfileID, BX_FORUM_EDIT_ALL, true); // perform action 
     79 
    6580    $oAlert = new BxDolAlerts('bx_forum', 'post_edit', $iPostId); 
    6681    $oAlert->alert();     
     
    6883 
    6984function onPostDelete ($aTopic, $iPostId, $sUser) { 
     85 
     86    $oProfile = new BxDolProfile ($sUser); 
     87    $fdb = new DbForum (); 
     88    $aPost = $fdb->getPost($iPostId, false); 
     89    if ($sUser != $aPost['user'] && !isAdmin($oProfile->_iProfileID)) 
     90        checkAction($oProfile->_iProfileID, BX_FORUM_DELETE_ALL, true); // perform action 
     91 
    7092    $oAlert = new BxDolAlerts('bx_forum', 'edit_del', $iPostId); 
    7193    $oAlert->alert();     
     
    7395 
    7496function onNewTopic ($iForumId, $sTopicSubject, $sTopicText, $isTopicSticky, $sUser, $sTopicUri) { 
     97 
     98    $oProfile = new BxDolProfile ($sUser); 
     99 
     100    if (!isAdmin($oProfile->_iProfileID)) {  
     101        $fdb = new DbForum (); 
     102        $aForum = $fdb->getForum($iForumId, false);         
     103        $iActionId = BX_FORUM_PUBLIC_POST; 
     104        if (isset($aForum['forum_type']) && 'private' == $aForum['forum_type']) 
     105            $iActionId = BX_FORUM_PRIVATE_POST; 
     106        checkAction($oProfile->_iProfileID, $iActionId, true); // perform action 
     107    } 
     108 
    75109    $a = array ($iForumId, $sTopicSubject, $sTopicText, $isTopicSticky, $sUser); 
    76110    $oAlert = new BxDolAlerts('bx_forum', 'new_topic', $sTopicUri, $a); 
     
    174208    defineMembershipActions (array ('forum public read', 'forum public post', 'forum private read', 'forum private post', 'forum search', 'forum edit all', 'forum delete all', 'forum make sticky', 'forum del topics', 'forum move topics', 'forum hide topics', 'forum unhide topics', 'forum hide posts', 'forum unhide posts', 'forum files download')); 
    175209 
    176     $isPublicForumReadAllowed  =                ($aCheck = checkAction($iMemberId, BX_FORUM_PUBLIC_READ, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
    177     $isPublicForumPostAllowed  = $isLoggedIn && ($aCheck = checkAction($iMemberId, BX_FORUM_PUBLIC_POST, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
    178     $isPrivateForumReadAllowed = $isLoggedIn && ($aCheck = checkAction($iMemberId, BX_FORUM_PRIVATE_READ, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
    179     $isPrivateForumPostAllowed = $isLoggedIn && ($aCheck = checkAction($iMemberId, BX_FORUM_PRIVATE_POST, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
    180     $isEditAllAllowed = ($aCheck = checkAction($iMemberId, BX_FORUM_EDIT_ALL, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
    181     $isDelAllAllowed = ($aCheck = checkAction($iMemberId, BX_FORUM_DELETE_ALL, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
     210    $isPublicForumReadAllowed  =                ($aCheck = checkAction($iMemberId, BX_FORUM_PUBLIC_READ)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
     211    $isPublicForumPostAllowed  = $isLoggedIn && ($aCheck = checkAction($iMemberId, BX_FORUM_PUBLIC_POST)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
     212    $isPrivateForumReadAllowed = $isLoggedIn && ($aCheck = checkAction($iMemberId, BX_FORUM_PRIVATE_READ)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
     213    $isPrivateForumPostAllowed = $isLoggedIn && ($aCheck = checkAction($iMemberId, BX_FORUM_PRIVATE_POST)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
     214    $isEditAllAllowed = ($aCheck = checkAction($iMemberId, BX_FORUM_EDIT_ALL)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
     215    $isDelAllAllowed = ($aCheck = checkAction($iMemberId, BX_FORUM_DELETE_ALL)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT] ? 1 : 0; 
    182216 
    183217    return array ( 
     
    195229        'del_own' => 1, 
    196230 
    197         'download_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_FILES_DOWNLOAD, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
    198         'search_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_SEARCH, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
    199         'sticky_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_MAKE_STICKY, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
    200  
    201         'del_topics_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_DEL_TOPICS, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
    202         'move_topics_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_MOVE_TOPICS, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
    203         'hide_topics_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_HIDE_TOPICS, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
    204         'unhide_topics_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_HIDE_TOPICS, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
    205         'hide_posts_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_HIDE_TOPICS, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
    206         'unhide_posts_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_HIDE_TOPICS, true)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
     231        'download_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_FILES_DOWNLOAD)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
     232        'search_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_SEARCH)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
     233        'sticky_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_MAKE_STICKY)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
     234 
     235        'del_topics_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_DEL_TOPICS)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
     236        'move_topics_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_MOVE_TOPICS)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
     237        'hide_topics_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_HIDE_TOPICS)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
     238        'unhide_topics_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_HIDE_TOPICS)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
     239        'hide_posts_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_HIDE_TOPICS)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
     240        'unhide_posts_' => $isOrcaAdmin  || (($aCheck = checkAction($iMemberId, BX_FORUM_HIDE_TOPICS)) && CHECK_ACTION_RESULT_ALLOWED == $aCheck[CHECK_ACTION_RESULT]) ? 1 : 0, 
    207241    ); 
    208242} 
Note: See TracChangeset for help on using the changeset viewer.