Browse Source

Replace old code with api_get_user_info see #7837

jmontoyaa 9 years ago
parent
commit
e94602ec57

+ 1 - 1
main/auth/cas/authcas.php

@@ -84,7 +84,7 @@ function cas_is_authenticated()
 		}*/
 		if (!$logout){
 		    // get user info from username
-		    $tab_user_info = UserManager::get_user_info($login);
+		    $tab_user_info = api_get_user_info($login);
 
 		    // user found in the chamilo database
 		    if (is_array($tab_user_info)) {

+ 1 - 1
main/auth/external_login/ldap.inc.php

@@ -344,7 +344,7 @@ function extldap_add_user_by_array($data, $update_if_exists = true)
         );
     } else {
         if ($update_if_exists) {
-            $user    = UserManager::get_user_info($username);
+            $user = api_get_user_info($username);
             $user_id = $user['user_id'];
             //echo "$username\n";
             UserManager::update_user(

+ 1 - 1
main/auth/external_login/login.ws.php

@@ -19,7 +19,7 @@ $isValid = loginWSAuthenticate($login, $password, $wsUrl);
 // if the authentication was successful, proceed
 if ($isValid === 1) {
     //error_log('WS authentication worked');
-    $chamiloUser = UserManager::get_user_info($login);
+    $chamiloUser = api_get_user_info($login);
     $loginFailed = false;
     $_user['user_id'] = $chamiloUser['user_id'];
     $_user['status'] = (isset($chamiloUser['status']) ? $chamiloUser['status'] : 5);

+ 1 - 1
main/auth/ldap/authldap.php

@@ -525,7 +525,7 @@ function ldap_add_user_by_array($data, $update_if_exists = true) {
         $user_id = UserManager::create_user($firstname,$lastname,$status,$email,$username,$password,$official_code,api_get_setting('platformLanguage'),$phone,$picture_uri,$auth_source,$expiration_date,$active);
     } else {
         if ($update_if_exists) {
-            $user = UserManager::get_user_info($username);
+            $user = api_get_user_info($username);
             $user_id=$user['user_id'];
             UserManager::update_user($user_id, $firstname, $lastname, $username, null, null, $email, $status, $official_code, $phone, $picture_uri, $expiration_date, $active);
         }

+ 1 - 1
main/webservices/registration.soap.php

@@ -4467,7 +4467,7 @@ function WSGetUserFromUsername($params) {
     $result = array();
 
     // Get user id
-    $user_data   = UserManager::get_user_info($params['username']);
+    $user_data = api_get_user_info($params['username']);
 
     if (empty($user_data)) {
         // If user was not found, there was a problem

+ 0 - 5
tests/main/inc/lib/usermanager.lib.test.php

@@ -199,11 +199,6 @@ class TestUserManager extends UnitTestCase {
 		$this->assertTrue(!(bool)$res);
 	}
 
-	function testGetUserInfo() {
-		$res=UserManager::get_user_info('arthur2');
-		$this->assertTrue(!(bool)$res);
-	}
-
 	function testGetUserList() {
 		$res=UserManager::get_user_list(null,null);
 		$this->assertTrue(is_array($res));