'Profile' link in Admin for students

'Profile' link in Admin for students

by Teresa Gibbison -
Number of replies: 7
Hi all
When did the 'Profile' link sneak back into place? Is this standard or custom? How do I get this in our 1.9 instance?
Thanks in advance
Teresa smile

Average of ratings: -
In reply to Teresa Gibbison

Re: 'Profile' link in Admin for students

by Ray Lawrence -
Hi Teresa,

This is an unexpected (and unwelcome) change as the admin block now appears all the time for students (from my limited testing). Also if a student clicks the link they are able to view and edit profiles irrespective of the permissions for their role (again from some quick testing a day or so ago). Can you confirm this is the same for you?
In reply to Ray Lawrence

Re: 'Profile' link in Admin for students

by Teresa Gibbison -
Thanks heaps for the link David

Ray - I agree this is an issue. When I prevented and prohibited students from editing their own profile at site level they were still able to click this link and edit their profile.

The lines in blocks/admin/block_admin.php only check the capability moodle/site:viewfullnames so I added an if statement to this block of code (Line 210 of the above file in 1.9) which prevents the link being displayed as we would expect.

if (has_capability('moodle/user:editownprofile', $context)){
$fullname = fullname($USER, has_capability('moodle/site:viewfullnames', $context));
$editmyprofile = '<a title="'.$fullname.'" href="'.$CFG->wwwroot.'/user/edit.php?id='.$USER->id.'&amp;course='.$this->instance->pageid.'">'.get_string('editmyprofile').'</a>';
if (empty($USER->description)) {
//Accessibility: replace non-standard <blink> with CSS (<a> makes title visible in IE).
$text = get_string('profile').' '.get_string('missingdescription');
$this->content->items[]= $editmyprofile.' <a title="'.$text.'" class="useredit blink">*<span class="accesshide">'.$text.'</span></a>';
} else {
$this->content->items[]= $editmyprofile;
}
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
}

Hopefully this will help you

Teresa smile
In reply to Teresa Gibbison

Re: 'Profile' link in Admin for students

by Ray Lawrence -
Thanks. I've added this to the tracker as this needs a fix in core IMO. Vote away.. smile MDL-14846

On side note, if this is retained would it be better positioned in the participants block?
In reply to Ray Lawrence

Re: 'Profile' link in Admin for students

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Profil link in "Administration" block is intended :
http://moodle.org/mod/forum/discuss.php?d=96385

And if you remove capability to "Edit" profil for Autenticated user, you can't edit your profil anymore...

So, i don't understand the problem...
In reply to Séverin Terrier

Re: 'Profile' link in Admin for students

by Ray Lawrence -
Well, it means that the Admin block now appears where it didn't before (with no way to prevent it) and when I tested it removing the capability you mentioned above editing profiles was still possible.

Edit: Just read the issue that originated this appearing (- or actually re-appearing here). Funny how you forget how things used to be. But it still needs to respect roles..
In reply to Séverin Terrier

Re: 'Profile' link in Admin for students

by Teresa Gibbison -
Thanks for the link Séverin
I have 1.9 but not the latest version so when tested found this as an issue. We will be upgrading the latest 1.9 in the next few days so will check again then.
I also had trouble finding any other discussions or Tracker issues about this (I always have trouble searching for stuff, in this case I was searching for profile link and admin in the blocks forum.
I will keep an eye on the two tracker issues and check out install after the upgrade smile
Cheers
Teresa