Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-11040

Moodle Networking - Profile Creation on remote site

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.2
    • Fix Version/s: 1.8.4, 1.9, 2.0
    • Component/s: MNet
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      Our setup – we have site A as our hub --> main place for all our students to create an account.
      Site B - Courses are located there.

      When a student logs in to site A and goes to Site B - mnet creates a user in the user table... this works fine but the description part of their profile does not come over, it only shows a number 1.

      Is there an easy fix for this?

        Gliffy Diagrams

          Activity

          Hide
          tigger996 Lori Bakken added a comment -

          If I could change this to critical I would. ALL profile settings should brought over and properly. This is really screwing my users up.

          PLEASE HELP!

          Show
          tigger996 Lori Bakken added a comment - If I could change this to critical I would. ALL profile settings should brought over and properly. This is really screwing my users up. PLEASE HELP!
          Hide
          tigger996 Lori Bakken added a comment -

          Found the problem, in moodlelib.php – description was being set to true. I commented out

          I also changed auth.php and added in the other fields I wanted brought over.

          Issue can be closed.

          Show
          tigger996 Lori Bakken added a comment - Found the problem, in moodlelib.php – description was being set to true. I commented out I also changed auth.php and added in the other fields I wanted brought over. Issue can be closed.
          Hide
          donal@catalyst.net.nz Donal McMullan added a comment -

          Lori - can you post your patch? I'm interested to know what the other fields you wanted were.

          Thanks

          Show
          donal@catalyst.net.nz Donal McMullan added a comment - Lori - can you post your patch? I'm interested to know what the other fields you wanted were. Thanks
          Hide
          tigger996 Lori Bakken added a comment -

          Sure:

          In /lib/moodlelib.php

          if (!empty($user->description)) {
          $user->description = true; // No need to cart all of it around
          }

          Changed to this:
          In /lib/moodlelib.php
          // if (!empty($user->description))

          { //$user->description = true; // No need to cart all of it around // }

          moodle/auth/mnet/auth.php:

          In function user_authorise($token, $useragent) {

          Add:
          $userdata['autosubscribe'] = $user->autosubscribe;
          $userdata['trackforums'] = $user->trackforums;
          $userdata['screenreader'] = $user->screenreader;
          $userdata['url'] = $user->url;

          I might add other stuff if our instructors require it. The description was the important one because the instructors first assignment to students is to update their profile, and the instructors couldn't see if the students were doing the assignment.

          Show
          tigger996 Lori Bakken added a comment - Sure: In /lib/moodlelib.php if (!empty($user->description)) { $user->description = true; // No need to cart all of it around } Changed to this: In /lib/moodlelib.php // if (!empty($user->description)) { //$user->description = true; // No need to cart all of it around // } moodle/auth/mnet/auth.php: In function user_authorise($token, $useragent) { Add: $userdata ['autosubscribe'] = $user->autosubscribe; $userdata ['trackforums'] = $user->trackforums; $userdata ['screenreader'] = $user->screenreader; $userdata ['url'] = $user->url; I might add other stuff if our instructors require it. The description was the important one because the instructors first assignment to students is to update their profile, and the instructors couldn't see if the students were doing the assignment.
          Hide
          donal@catalyst.net.nz Donal McMullan added a comment -

          I've altered the function in auth/mnet/auth.php to get the user record direct from the user table, instead of going through get_complete_user_data. We get more data this way (including description), and it's cheaper.

          http://moodle.cvs.sourceforge.net/moodle/moodle/auth/mnet/auth.php?r1=1.27.2.1&r2=1.27.2.2

          I haven't altered the function to bring over the additional fields requested, because for many MNet sites, each time the user SSOs from SiteA to SiteB, her details on SiteB get overwritten with the info from SiteA. This would be very frustrating if you want to maintain different values on each Moodle.

          As Lori noted - this is pretty straightforward to customize.

          Show
          donal@catalyst.net.nz Donal McMullan added a comment - I've altered the function in auth/mnet/auth.php to get the user record direct from the user table, instead of going through get_complete_user_data. We get more data this way (including description), and it's cheaper. http://moodle.cvs.sourceforge.net/moodle/moodle/auth/mnet/auth.php?r1=1.27.2.1&r2=1.27.2.2 I haven't altered the function to bring over the additional fields requested, because for many MNet sites, each time the user SSOs from SiteA to SiteB, her details on SiteB get overwritten with the info from SiteA. This would be very frustrating if you want to maintain different values on each Moodle. As Lori noted - this is pretty straightforward to customize.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Jan/08