Replace old code with api_get_user_info see #7837

1.10.x
jmontoyaa 10 years ago
parent 3b363820f1
commit e94602ec57
  1. 2
      main/auth/cas/authcas.php
  2. 2
      main/auth/external_login/ldap.inc.php
  3. 2
      main/auth/external_login/login.ws.php
  4. 2
      main/auth/ldap/authldap.php
  5. 2
      main/webservices/registration.soap.php
  6. 5
      tests/main/inc/lib/usermanager.lib.test.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)) {

@ -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(

@ -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);

@ -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);
}

@ -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

@ -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));

Loading…
Cancel
Save