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

Implement getremoteaddr() in all places where $_SERVER['REMOTE_ADDR'] is used

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.4
    • Fix Version/s: 1.9.5
    • Component/s: Libraries
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      getremoteaddr() is designed to get the best IP for the current user, with settings so that the admin can even control the way it works.

      We should be using it consistently everywhere, but currently there are still places where we are not and are accessing $_SERVER['REMOTE_ADDR'] directly

      ie:

      auth/cas/cas_ldap_sync_users.php
      auth/db/auth_db_sync_users.php
      lib/moodlelib.php
      lib/form/recaptcha.php
      mnet/remote_client.php
      mod/resource/type/file/resource.class.php
      mod/resource/type/repository/resource.class.php

      Dongsheng, can you carefully fix these for 1.9.5 please?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dongsheng Dongsheng Cai
                Reporter:
                dougiamas Martin Dougiamas
                Tester:
                Petr Skoda
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/May/09