Minor - format code.

pull/2487/head
jmontoyaa 7 years ago
parent 93e57949e5
commit d13f3aaf11
  1. 32
      main/admin/ldap_synchro.php
  2. 15
      main/auth/cas/authcas.php
  3. 48
      main/auth/ldap/authldap.php

@ -103,12 +103,40 @@ foreach ($Sessions as $session) {
$active = 1;
// Ajout de l'utilisateur
if (UserManager::is_username_available($username)) {
$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);
$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
);
$UserAdd[] = $user_id;
} else {
$user = api_get_user_info_from_username($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);
UserManager::update_user(
$user_id,
$firstname,
$lastname,
$username,
null,
null,
$email,
$status,
$official_code,
$phone,
$picture_uri,
$expiration_date,
$active
);
$UserUpdate[] = $user_id;
}
$UserList[] = $user_id;

@ -106,8 +106,19 @@ function cas_is_authenticated()
case PLATFORM_AUTH_SOURCE :
// user will have to modify firstname, lastname, email in chamilo profil edit
$userdata = get_lang("EditInProfil");
UserManager::create_user($userdata, $userdata, '5', $userdata, $login, 'casplaceholder', '', '',
'', '', CAS_AUTH_SOURCE);
UserManager::create_user(
$userdata,
$userdata,
'5',
$userdata,
$login,
'casplaceholder',
'',
'',
'',
'',
CAS_AUTH_SOURCE
);
$user_added = $login;
break;
case LDAP_AUTH_SOURCE :

@ -206,9 +206,19 @@ function ldap_put_user_info_locally($login, $info_array) {
$language = api_get_setting('platformLanguage');
if (empty($language)) { $language = 'english'; }
$_userId = UserManager::create_user($prenom, $nom, $status,
$email, $uname, $password, $official_code,
$language, '', '', 'ldap');
$_userId = UserManager::create_user(
$prenom,
$nom,
$status,
$email,
$uname,
$password,
$official_code,
$language,
'',
'',
'ldap'
);
//echo "new user added to Chamilo, id = $_userId";
@ -516,12 +526,40 @@ function ldap_add_user_by_array($data, $update_if_exists = true) {
// Adding user
$user_id = 0;
if (UserManager::is_username_available($username)) {
$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);
$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 = 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);
UserManager::update_user(
$user_id,
$firstname,
$lastname,
$username,
null,
null,
$email,
$status,
$official_code,
$phone,
$picture_uri,
$expiration_date,
$active
);
}
}
return $user_id;

Loading…
Cancel
Save