Moodle
  1. Moodle
  2. MDL-26409

Apply some defaults on user creation by various methods...

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0.1
    • Fix Version/s: None
    • Component/s: Authentication, Libraries
    • Labels:
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      16002

      Description

      While reviewing PULL-313 (aka, MDL-25778) it has been detected that:

      $CFG->country

      isn't used and applied in the next scripts:

      • admin/uploaduser.php
      • auth/db/auth.php
      • auth/ldap/auth.php

      and it seems that only manual creation takes it into account (user/edit.php).

      So perhaps we should check what happens with "country" and also other defaults (department, institution...and so on) in all those scripts.

      Ciao

      PS: Note I haven't looked at it exhaustively at all, just looked around the newly introduced "$CFG->citydefault" code and didn't find it's country counterpart.

        Issue Links

          Activity

          Hide
          Charles Fulton added a comment -

          Hi Eloy,

          Right now in uploaduser country defaults to the current user's country. What about something like this (admittedly hackish) testing if $CFG->country is valid, then failing over to $USER?

          $mform->setDefault('country', (array_key_exists($CFG->country, get_string_manager()>get_list_of_countries())) ? $CFG>country : $templateuser->country);

          The same is true for city, timezone, lang, institution and department. I haven't looked at the auth pages.

          Show
          Charles Fulton added a comment - Hi Eloy, Right now in uploaduser country defaults to the current user's country. What about something like this (admittedly hackish) testing if $CFG->country is valid, then failing over to $USER? $mform->setDefault('country', (array_key_exists($CFG->country, get_string_manager() >get_list_of_countries())) ? $CFG >country : $templateuser->country); The same is true for city, timezone, lang, institution and department. I haven't looked at the auth pages.
          Hide
          Charles Fulton added a comment -

          Never mind, that's an awful idea. https://github.com/mackensen/moodle/commit/1f2c1df41be1d549caaf4bc3e9c35745f0affc9d is more sustainable, but I don't know that defaults are even configurable for a couple of these.

          Show
          Charles Fulton added a comment - Never mind, that's an awful idea. https://github.com/mackensen/moodle/commit/1f2c1df41be1d549caaf4bc3e9c35745f0affc9d is more sustainable, but I don't know that defaults are even configurable for a couple of these.
          Hide
          Petr Škoda added a comment -

          1/ I would be great to have separate defaults for the auth/ldap and auth/db at least.
          2/ please note the recommended way is to call these settings and strings defaultxxx
          3/ the country setting and strings should be renamed to defaultcountry in 2.1

          Show
          Petr Škoda added a comment - 1/ I would be great to have separate defaults for the auth/ldap and auth/db at least. 2/ please note the recommended way is to call these settings and strings defaultxxx 3/ the country setting and strings should be renamed to defaultcountry in 2.1
          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this issue.

          We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported.

          If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

          Michael d.

          TW9vZGxlDQo=

          Show
          Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d. TW9vZGxlDQo=
          Hide
          Michael de Raadt added a comment -

          I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported.

          This is being done as part of a bulk annual clean-up of issues.

          If you still believe this is an issue in supported versions, please create a new issue.

          Show
          Michael de Raadt added a comment - I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported. This is being done as part of a bulk annual clean-up of issues. If you still believe this is an issue in supported versions, please create a new issue.

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: