Issue Details (XML | Word | Printable)

Key: MDL-18723
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Dongsheng Cai
Reporter: Mark Webster
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Role required to display search box in /user/index.php is not appropriate

Created: 28/Mar/09 06:20 AM   Updated: 07/Oct/09 06:22 AM
Component/s: Administration, Roles
Affects Version/s: 1.9.4
Fix Version/s: 1.9.6

File Attachments: 1. Text File index.php.patch (0.8 kB)


Participants: Dongsheng Cai, Evan Kroske and Mark Webster
Security Level: None
Difficulty: Easy
Resolved date: 02/Oct/09
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
The role required to display search box in /user/index.php is currently set to 'moodle/course:bulkmessaging'

$bulkoperations = has_capability('moodle/course:bulkmessaging', $context);
...
if ($bulkoperations && $totalcount > ($perpage*3)) { echo '<form action="index.php"><div><input type="hidden" name="id" value="'.$course->id.'" />'.get_string('search').': '."\n"; echo '<input type="text" name="search" value="'.s($search).'" /> <input type="submit" value="'.get_string('search').'" /></div></form>'."\n"; }

Displaying this search box should instead be restricted by something like '/moodle/site:viewparticipants'

The simple fix is to change the above if statement to:

if (has_capability('moodle/site:viewparticipants', $context) && $totalcount > ($perpage*3)) { echo '<form action="index.php"><div><input type="hidden" name="id" value="'.$course->id.'" />'.get_string('search').': '."\n"; echo '<input type="text" name="search" value="'.s($search).'" /> <input type="submit" value="'.get_string('search').'" /></div></form>'."\n"; }



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Evan Kroske added a comment - 28/Mar/09 11:51 PM
I followed Mark's instructions to create this minor patch. I tested it, and I think it works.

Dongsheng Cai added a comment - 02/Oct/09 02:52 PM
Thanks Mark, please review

Mark Webster added a comment - 07/Oct/09 06:22 AM
Looks good, Dongsheng - thanks a bunch !