~ubuntu-branches/ubuntu/natty/moodle/natty

« back to all changes in this revision

Viewing changes to user/index.php

  • Committer: Bazaar Package Importer
  • Author(s): Tomasz Muras
  • Date: 2010-10-30 12:19:28 UTC
  • mfrom: (1.1.12 upstream) (3.1.10 squeeze)
  • Revision ID: james.westby@ubuntu.com-20101030121928-qzobi6mctpnk4dif
Tags: 1.9.9.dfsg2-2
* Added Romanian translation
* Updated Japanese translation (closes: #596820)
* Backporting security fixes from Moodle 1.9.10 (closes: #601384)
   - Updated embedded CAS to 1.1.3
   - Added patch for MDL-24523:
     clean_text() not filtering text in markdown format
   - Added patch for MDL-24810 and upgraded customized HTML Purifier to 4.2.0 
   - Added patch for MDL-24258:
     students can delete their forum posts later than $CFG->maxeditingtime 
     under certain conditions
   - Added patch for MDL-23377:
     Can't delete quiz attempts in course without enrolled students

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?PHP // $Id: index.php,v 1.194.2.18 2008/12/01 20:46:13 skodak Exp $
 
1
<?PHP // $Id: index.php,v 1.194.2.23 2010/02/04 04:37:31 rwijaya Exp $
2
2
 
3
3
//  Lists all the users within a given course
4
4
 
140
140
        $currentgroup  = NULL;
141
141
    }
142
142
 
143
 
    $isseparategroups = ($course->groupmode == SEPARATEGROUPS and $course->groupmodeforce and
144
 
                         !has_capability('moodle/site:accessallgroups', $context));
 
143
    $isseparategroups = ($course->groupmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context));
145
144
 
146
145
    if ($isseparategroups and (!$currentgroup) ) {
147
146
        $navlinks = array();
446
445
    if (!empty($search)) {
447
446
        $LIKE = sql_ilike();
448
447
        $fullname  = sql_fullname('u.firstname','u.lastname');
449
 
        $wheresearch .= ' AND ('. $fullname .' '. $LIKE .'\'%'. $search .'%\' OR email '. $LIKE .'\'%'. $search .'%\' OR idnumber '.$LIKE.' \'%'.$search.'%\') ';
 
448
        $wheresearch .= ' AND ('. $fullname .' '. $LIKE .' \'%'. $search .'%\' OR email '. $LIKE .' \'%'. $search .'%\' OR idnumber '.$LIKE.' \'%'.$search.'%\') ';
450
449
 
451
450
    }
452
451
 
680
679
 
681
680
 
682
681
        if ($userlist)  {
683
 
            $usersprinted = array();
 
682
            $usersprinted = array();            
684
683
            while ($user = rs_fetch_next_record($userlist)) {
685
684
                if (in_array($user->id, $usersprinted)) { /// Prevent duplicates by r.hidden - MDL-13935
686
685
                    continue;
718
717
                } else {
719
718
                    $usercontext = $user->context;
720
719
                }
 
720
                
 
721
                $contextcanviewdetails = has_capability('moodle/user:viewdetails', $context);
 
722
                $usercontextcanviewdetails = has_capability('moodle/user:viewdetails', $usercontext);
721
723
 
722
 
                if ($piclink = ($USER->id == $user->id || has_capability('moodle/user:viewdetails', $context) || has_capability('moodle/user:viewdetails', $usercontext))) {
723
 
                    $profilelink = '<strong><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.fullname($user).'</a></strong>';
 
724
                if ($piclink = ($USER->id == $user->id || $contextcanviewdetails || $usercontextcanviewdetails)) {
 
725
                    if ($usercontextcanviewdetails) {
 
726
                        $canviewfullname = has_capability('moodle/site:viewfullnames', $usercontext);
 
727
                    } else {
 
728
                        $canviewfullname = has_capability('moodle/site:viewfullnames', $context);
 
729
                    } 
 
730
                    $profilelink = '<strong><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.fullname($user, $canviewfullname).'</a></strong>';
724
731
                } else {
725
 
                    $profilelink = '<strong>'.fullname($user).'</strong>';
 
732
                    $profilelink = '<strong>'.fullname($user, has_capability('moodle/site:viewfullnames', $context)).'</strong>';
726
733
                }
727
734
 
728
735
                $data = array (
788
795
 
789
796
    }
790
797
 
791
 
    if ($bulkoperations && $totalcount > ($perpage*3)) {
792
 
        echo '<form action="index.php"><div><input type="hidden" name="id" value="'.$course->id.'" />'.get_string('search').':&nbsp;'."\n";
 
798
    if (has_capability('moodle/site:viewparticipants', $context) && $totalcount > ($perpage*3)) {
 
799
        echo '<form action="index.php" class="searchform"><div><input type="hidden" name="id" value="'.$course->id.'" />'.get_string('search').':&nbsp;'."\n";
793
800
        echo '<input type="text" name="search" value="'.s($search).'" />&nbsp;<input type="submit" value="'.get_string('search').'" /></div></form>'."\n";
794
801
    }
795
802