- Timestamp:
- 10/09/11 21:40:41 (8 months ago)
- Location:
- tags/7.0
- Files:
-
- 3 edited
-
administration/memb_levels.php (modified) (1 diff)
-
install/langs/lang-en.php (modified) (1 diff)
-
modules/boonex/forum/integrations/base/callback.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags/7.0/administration/memb_levels.php
r15343 r15573 71 71 $GLOBALS['MySQL']->query("DELETE FROM `sys_acl_level_prices` WHERE `id` IN ('" . implode("','", $_POST['prices']) . "')"); 72 72 } 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']) . ")" : ""; 78 78 $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'))); 79 79 -
tags/7.0/install/langs/lang-en.php
r15565 r15573 2133 2133 '_adm_txt_mlevels_price_add_price' => 'Price:', 2134 2134 '_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', 2136 2136 '_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', 2138 2138 '_adm_txt_mlevels_actions_avail_start' => 'This action is available since', 2139 2139 '_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 a vailable everytime',2140 '_adm_txt_mlevels_actions_avail_desc' => 'Leave it blank if the action is always available', 2141 2141 '_adm_txt_email_language' => 'Language', 2142 2142 '_adm_txt_email_subject' => 'Subject', -
tags/7.0/modules/boonex/forum/integrations/base/callback.php
r15571 r15573 36 36 37 37 $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 38 46 $aPlusOriginal = array ( 39 47 'PosterUrl' => $oProfile->_iProfileID ? getProfileLink($oProfile->_iProfileID) : 'javascript:void(0);' , … … 63 71 64 72 function 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 65 80 $oAlert = new BxDolAlerts('bx_forum', 'post_edit', $iPostId); 66 81 $oAlert->alert(); … … 68 83 69 84 function 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 70 92 $oAlert = new BxDolAlerts('bx_forum', 'edit_del', $iPostId); 71 93 $oAlert->alert(); … … 73 95 74 96 function 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 75 109 $a = array ($iForumId, $sTopicSubject, $sTopicText, $isTopicSticky, $sUser); 76 110 $oAlert = new BxDolAlerts('bx_forum', 'new_topic', $sTopicUri, $a); … … 174 208 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')); 175 209 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; 182 216 183 217 return array ( … … 195 229 'del_own' => 1, 196 230 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, 207 241 ); 208 242 }
Note: See TracChangeset
for help on using the changeset viewer.