Skip to content

Commit

Permalink
FIx update
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Sep 9, 2016
1 parent e69cb1e commit 1e36b99
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions main/cron/import_csv.php
Expand Up @@ -561,7 +561,7 @@ private function importStudents($file, $moveFile = true)

if ($result) {
foreach ($row as $key => $value) {
if (substr($key, 0, 6) == 'extra_') {
if (substr($key, 0, 6) === 'extra_') {
//an extra field
UserManager::update_extra_field_value($result, substr($key, 6), $value);
}
Expand Down Expand Up @@ -612,9 +612,9 @@ private function importStudents($file, $moveFile = true)
}

// Blocking password update
$avoidUsersWithPassword = $this->conditions['importStudents']['update']['avoid']['password'];
//$avoidUsersWithPassword = $this->conditions['importStudents']['update']['avoid']['password'];

if (isset($row['password'])) {
/*if (isset($row['password'])) {
$user = api_get_user_entity($userInfo['id']);
$encoded = UserManager::encryptPassword(
$row['password'],
Expand All @@ -630,10 +630,14 @@ private function importStudents($file, $moveFile = true)
$password = null;
$resetPassword = 0; // disallow password change
}
}
}*/
}
}

// Always disallow password change during update
$password = null;
$resetPassword = 0; // disallow password change

$expirationDate = api_get_utc_datetime(strtotime("+".intval($this->expirationDateInUserUpdate)."years"));

// Update user
Expand Down

0 comments on commit 1e36b99

Please sign in to comment.