chamilo-lms icon indicating copy to clipboard operation
chamilo-lms copied to clipboard

login.ws.php should get user info from username

Open simbulu opened this issue 10 years ago • 3 comments

api_get_user_info() works on userid rather than username At least in login.ws.php the following fixed the issue for me. The same change might be relevant in other files under chamilo-lms-1.10.8/main/auth/

diff  -u login.ws.php.000 login.ws.php
--- login.ws.php.000    2016-09-02 13:27:13.303940444 +0100
+++ login.ws.php    2016-09-02 13:28:52.713228101 +0100
@@ -21,7 +21,7 @@
 // if the authentication was successful, proceed
 if ($isValid === 1) {
     //error_log('WS authentication worked');
-    $chamiloUser = api_get_user_info($login);
+    $chamiloUser = api_get_user_info_from_username($login);
     $loginFailed = false;
     $_user['user_id'] = $chamiloUser['user_id'];
     $_user['status'] = (isset($chamiloUser['status']) ? $chamiloUser['status'] : 5);

simbulu avatar Sep 02 '16 13:09 simbulu

I added the change

jmontoyaa avatar Sep 06 '16 08:09 jmontoyaa

Thanks - the commit looks correct to me, and works in the pop3 variation of login.ws.php we happen to use. Let me know if there is any interest in adding our login.pop3.php to chamilo. Should I close this issue or will it be closed by some other way ?

simbulu avatar Sep 06 '16 17:09 simbulu

You can close the issue at any time, once you decide it is fixed (if you reported it). We're happy to include the login.pop3.php file in Chamilo if you can send it soon (that would be another issue, though).

ywarnier avatar Sep 12 '16 16:09 ywarnier