|
I went through and changed a number of places in the /lib/datalib.php where it was creating a $search string so that it would also search the username field. I would propose that these be included. I will see if I can find a place to upload my suggested changes.
/lib/datalib.php
Here is a what I would recommend - I think it is a more complete fix than what I had previously suggested. I am also waiting for including this in official 1.6
Thanks for all This is still not working for 1.8.2 as far as I can tell. There are lots of instances where username and idnumber are more relevant search criteria then name or email as unique identifiers. Other categories may be altered by the user to reflect user preferences (such as Anthony shortened to Tony) and so are less reliable.
Ideally both should be included but idnumber is seems the more relevant field as most enrolment features utilise this and it is often directly tied to other systems. I'm attaching the diff I use for 18STABLE - Peace - Anthony
Martin - The ability to search for users by username has been floating around for a while. Any thoughts on what you might like to do with this. I've also done a similar modification to /admin/roles/assign.php to search the username field. A neat improvement would be to allow the user to select which user fields (including the new user defined profile fields) they would like included to be searched for. That would give the site admin control to search as best works for that particular site without having to modify the code. If you would like me to work on developing a patch to accomplish this let me know but I don't want to put in the time or effort if it is not going to be used. This issue re-surfaced in http://moodle.org/mod/forum/discuss.php?d=78904
Martin - Can you see any reason not to include the ability to search on username in 1.9? It increases the functionality greatly and just seems to make sense. It comes up periodically in the forums. I'm providing the patch to yet another user which is when I come back to this issue. Peace - Anthony
Hi Anthony,
Please note that a username search is already included in Moodle 1.9 via Administration > Users > Accounts > Browse list of users or Bulk user actions. Helen - That is great news - I've not had a chance to do much playing with 1.9 yet. Thanks for letting me know that it is already there. That being the case, we can go ahead and mark this issue as resolved in 1.9. The attached patches could be used by folks should they want that functionality in 1.8 or 1.7 Peace - Anthony
Thanks to GSOC student Andrei Bautu and Yu Zhang for user management improvements in Moodle 1.9
The bulk/upload code was further improved/rewritten later
adding some links to bugs |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Clicking on 'Users' in the 'Administration' block on the Moodle home page and then on 'Edit user accounts' brings you to a list of all users on the site with a search box which also searches on usernames.
Or did I misunderstand this feature request?
From Reed Law (reedlaw at gmail.com) Monday, 17 October 2005, 04:46 PM:
I just checked this and the search does not include usernames, only First Name and Last Name fields.
From Anthony Borrow (aborrow at jesuitcp.org) Sunday, 14 May 2006, 04:39 AM:
I also would like to have this functionality. Currently, as of 1.6 beta 5 the /lib/datalib.php contains a function get_users_listing where around line 1810 it currently sets the value of the $select variable as follows:
$select .= AND ($fullname $LIKE '%$search%' OR email $LIKE '%$search%') ;
as you can see this is just the first and last name field that is being searched. We use a five digit student id to identify our students and sometimes it would be helpful to search by the student id. In particular I am thinking of how to check which student is having login failures from the logs.
I have customized the code on my production server with:
$select .= AND ($fullname $LIKE '%$search%' OR email $LIKE '%$search%' OR username $LIKE '$search%') ;
Ideally I would like to limit the number of customizations and hence I am re-opening this feature request. To that end, I have changed the version from 1.5.2 to 1.6 beta 5 and the OS from Solaris to all. I also changed the resolution from works for me to reopened. Thank you for your consideration and for all you do to make Moodle Moodle-tastic!
From Anthony Borrow (aborrow at jesuitcp.org) Tuesday, 8 August 2006, 12:03 AM:
Martin - I have changed the to be closed in version to 1.7 as I think this would be a nice, easy addition to 1.7. The code change is very minor and included in the feature request. It is just a matter of writing it to CVS. Thanks for your consideration - Anthony.