forum MDL-23388 altered the logic around making users exempt from the forum post threshold

This commit is contained in:
Andrew Davis 2010-08-26 07:36:23 +00:00
parent f1af9d3511
commit d4514e46fc
5 changed files with 14 additions and 10 deletions

View File

@ -294,13 +294,16 @@ $capabilities = array(
)
),
'mod/forum:throttlingapplies' => array(
'mod/forum:postwithoutthrottling' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),

View File

@ -49,9 +49,9 @@ $string['attachment_help'] = 'You can optionally attach one or more files to a f
$string['attachmentnopost'] = 'You cannot export attachments without a post id';
$string['attachments'] = 'Attachments';
$string['blockafter'] = 'Post threshold for blocking';
$string['blockafter_help'] = 'This setting specifies the maximum number of posts which a student can post in the given time period. Only applies to users with the capability mod/forum:throttlingapplies.';
$string['blockafter_help'] = 'This setting specifies the maximum number of posts which a user can post in the given time period. Users with the capability mod/forum:postwithoutthrottling are exempt from post limits.';
$string['blockperiod'] = 'Time period for blocking';
$string['blockperiod_help'] = 'Students can be blocked from posting more than a given number of posts in a given time period. Only applies to users with the capability mod/forum:throttlingapplies.';
$string['blockperiod_help'] = 'Students can be blocked from posting more than a given number of posts in a given time period. Users with the capability mod/forum:postwithoutthrottling are exempt from post limits.';
$string['blockperioddisabled'] = 'Don\'t block';
$string['blogforum'] = 'Standard forum displayed in a blog-like format';
$string['bynameondate'] = 'by {$a->name} - {$a->date}';
@ -167,6 +167,7 @@ $string['forum:initialsubscriptions'] = 'Initial subscription';
$string['forumintro'] = 'Forum introduction';
$string['forum:managesubscriptions'] = 'Manage subscriptions';
$string['forum:movediscussions'] = 'Move discussions';
$string['forum:postwithoutthrottling'] = 'Exempt from post threshold';
$string['forumname'] = 'Forum name';
$string['forumposts'] = 'Forum posts';
$string['forum:rate'] = 'Rate posts';
@ -419,7 +420,7 @@ $string['unsubscribeshort'] = 'Unsubscribe';
$string['usermarksread'] = 'Manual message read marking';
$string['viewalldiscussions'] = 'View all discussions';
$string['warnafter'] = 'Post threshold for warning';
$string['warnafter_help'] = 'Students can be warned as they approach the maximum number of posts allowed in a given period. This setting specifies after how many posts they are warned. Only applies to users with the capability mod/forum:throttlingapplies.';
$string['warnafter_help'] = 'Students can be warned as they approach the maximum number of posts allowed in a given period. This setting specifies after how many posts they are warned. Users with the capability mod/forum:postwithoutthrottling are exempt from post limits.';
$string['youratedthis'] = 'You rated this';
$string['yournewquestion'] = 'Your new question';
$string['yournewtopic'] = 'Your new discussion topic';

View File

@ -6841,7 +6841,7 @@ function forum_check_throttling($forum, $cm=null) {
}
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
if(!has_capability('mod/forum:throttlingapplies', $modcontext)) {
if(has_capability('mod/forum:postwithoutthrottling', $modcontext)) {
return true;
}
@ -7171,7 +7171,7 @@ function forum_convert_to_roles($forum, $forummodid, $teacherroles=array(),
assign_capability('mod/forum:viewqandawithoutposting', CAP_PREVENT, $studentrole->id, $context->id);
assign_capability('mod/forum:viewsubscribers', CAP_PREVENT, $studentrole->id, $context->id);
assign_capability('mod/forum:managesubscriptions', CAP_PREVENT, $studentrole->id, $context->id);
assign_capability('mod/forum:throttlingapplies', CAP_PREVENT, $studentrole->id, $context->id);
assign_capability('mod/forum:postwithoutthrottling', CAP_PREVENT, $studentrole->id, $context->id);
}
foreach ($guestroles as $guestrole) {
assign_capability('mod/forum:viewdiscussion', CAP_PREVENT, $guestrole->id, $context->id);
@ -7190,7 +7190,7 @@ function forum_convert_to_roles($forum, $forummodid, $teacherroles=array(),
assign_capability('mod/forum:viewqandawithoutposting', CAP_PREVENT, $guestrole->id, $context->id);
assign_capability('mod/forum:viewsubscribers', CAP_PREVENT, $guestrole->id, $context->id);
assign_capability('mod/forum:managesubscriptions', CAP_PREVENT, $guestrole->id, $context->id);
assign_capability('mod/forum:throttlingapplies', CAP_PREVENT, $guestrole->id, $context->id);
assign_capability('mod/forum:postwithoutthrottling', CAP_PREVENT, $guestrole->id, $context->id);
}
}
} else {

View File

@ -24,8 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$module->version = 2010080300;
$module->requires = 2010080300; // Requires this Moodle version
$module->version = 2010082600;
$module->requires = 2010082600; // Requires this Moodle version
$module->cron = 60;

View File

@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
$version = 2010082502; // YYYYMMDD = date of the last version bump
$version = 2010082600; // YYYYMMDD = date of the last version bump
// XX = daily increments
$release = '2.0 Preview 4+ (Build: 20100826)'; // Human-friendly version name