Moodle

/user/view.php - I'd suggest allowing this to be defined in the Language Packs: "You can not view the profile of this user'"

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8
  • Fix Version/s: 1.8.3, 1.9
  • Component/s: Language
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

Looking at the "/user/view.php" file in the latest 1.8+ (April 14, 2007), I noticed that you have an English error message hard-corded into the file.

I would suggest making this into a $string that can be handled by the language packs.
"You can not view the profile of this user"

// make sure user can view this student's profile
if ($USER->id != $user->id
&& !has_capability('moodle/user:viewdetails', $coursecontext)
&& !has_capability('moodle/user:viewdetails', $usercontext)) { error('You can not view the profile of this user'); }

Activity

Hide
Charles Kelly added a comment -

I forgot to mention that there were other error messages in the same file which were hard-coded in English. You'll probably want to take care of all of those in the language packs.

Show
Charles Kelly added a comment - I forgot to mention that there were other error messages in the same file which were hard-coded in English. You'll probably want to take care of all of those in the language packs.
Hide
Charles Kelly added a comment -

I wonder if this should not be put at a higher priority. (Currently using 1.8.2)

There are 3 error messages that appear only in English.

error("No such user in this course");
error("No such course id");
error('You can not view the profile of this user');

Only one of the error messages in this file properly accesses the language packs.
error(get_string("groupnotamember"), "../course/view.php?id=$course->id");

Show
Charles Kelly added a comment - I wonder if this should not be put at a higher priority. (Currently using 1.8.2) There are 3 error messages that appear only in English. error("No such user in this course"); error("No such course id"); error('You can not view the profile of this user'); Only one of the error messages in this file properly accesses the language packs. error(get_string("groupnotamember"), "../course/view.php?id=$course->id");
Hide
Howard Miller added a comment -

I would suggest that the only one that should definitely not be hard coded is the view profile one. This can happen quite easily, as by default Authenticated Users cannot view profiles and anybody logged in (but not in a course) will see this message. I'll fix it and add some advice in the docs.

Show
Howard Miller added a comment - I would suggest that the only one that should definitely not be hard coded is the view profile one. This can happen quite easily, as by default Authenticated Users cannot view profiles and anybody logged in (but not in a course) will see this message. I'll fix it and add some advice in the docs.
Hide
Howard Miller added a comment -

The cannot view profile is now correct in the language pack. The other shouldn't happen in normal use and can, I think, stay as they are.

Show
Howard Miller added a comment - The cannot view profile is now correct in the language pack. The other shouldn't happen in normal use and can, I think, stay as they are.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: