Moodle
  1. Moodle
  2. MDL-3594

syntax error in auth/ldap/lib.php

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: None
    • Component/s: Authentication
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_15_STABLE

      Description

      in auth_user_activate():

      diff -rbu moodle-1.5/auth/ldap/lib.php moodle-1.5.orig/auth/ldap/lib.php

      — moodle-1.5/auth/ldap/lib.php 2005-06-21 15:01:35.000000000 +0200

      +++ moodle-1.5.orig/auth/ldap/lib.php 2005-06-06 07:18:23.000000000 +0200

      @@ -711,7 +711,7 @@

      switch ($CFG->ldap_user_type)

      { case 'edir': $newinfo['loginDisabled']=FALSE; - default: + default; error ('auth: ldap auth_user_activate() does not support selected usertype (..yet)'); }

      $result = ldap_modify($ldapconnection, $userdn, $newinfo);

        Gliffy Diagrams

          Activity

          Hide
          Martin Dougiamas added a comment -

          From Martin Langhoff (martin at catalyst.net.nz) Friday, 12 August 2005, 06:56 AM:

          This is as intended – 'default:' means that it's the default case. For more info see: http://nz.php.net/manual/en/control-structures.switch.php

          From Yann Richard (ze at nbox.org) Thursday, 8 September 2005, 03:13 PM:

          the ACTUAL code of moodle-1.5.orig/auth/ldap/lib.php

          /*

          • auth_user_activate activates user in external db.

          *

          • Activates (enables) user in external db so user can login to external db

          *

          • @param mixed $username username
          • @return boolen result

          */

          function auth_user_activate ($username) {

          global $CFG;

          $ldapconnection = auth_ldap_connect();

          $userdn = auth_ldap_find_userdn($ldapconnection, $username);

          switch ($CFG->ldap_user_type)

          { case 'edir': $newinfo['loginDisabled']=FALSE; default; error ('auth: ldap auth_user_activate() does not support selected usertype (..yet)'); }

          $result = ldap_modify($ldapconnection, $userdn, $newinfo);

          ldap_close($ldapconnection);

          return $result;

          }

          YOU MUST CHANGE: default; by default:

          Sorry for my prev patch who was badly made.

          From Martin Langhoff (martin at catalyst.net.nz) Friday, 9 September 2005, 08:28 AM:

          The patch you postted earlier was backwards! That made me think you wanted to replace default: with default; – ok, now I see the code you're talking about. Right-o. Fixed. Thanks!

          Show
          Martin Dougiamas added a comment - From Martin Langhoff (martin at catalyst.net.nz) Friday, 12 August 2005, 06:56 AM: This is as intended – 'default:' means that it's the default case. For more info see: http://nz.php.net/manual/en/control-structures.switch.php From Yann Richard (ze at nbox.org) Thursday, 8 September 2005, 03:13 PM: the ACTUAL code of moodle-1.5.orig/auth/ldap/lib.php /* auth_user_activate activates user in external db. * Activates (enables) user in external db so user can login to external db * @param mixed $username username @return boolen result */ function auth_user_activate ($username) { global $CFG; $ldapconnection = auth_ldap_connect(); $userdn = auth_ldap_find_userdn($ldapconnection, $username); switch ($CFG->ldap_user_type) { case 'edir': $newinfo['loginDisabled']=FALSE; default; error ('auth: ldap auth_user_activate() does not support selected usertype (..yet)'); } $result = ldap_modify($ldapconnection, $userdn, $newinfo); ldap_close($ldapconnection); return $result; } YOU MUST CHANGE: default; by default: Sorry for my prev patch who was badly made. From Martin Langhoff (martin at catalyst.net.nz) Friday, 9 September 2005, 08:28 AM: The patch you postted earlier was backwards! That made me think you wanted to replace default: with default; – ok, now I see the code you're talking about. Right-o. Fixed. Thanks!
          Hide
          Michael Blake added a comment -

          assign to a valid user

          Show
          Michael Blake added a comment - assign to a valid user

            People

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

              Dates

              • Created:
                Updated:
                Resolved: