Merge branch '1.10.x' of github.com:chamilo/chamilo-lms into 1.10.x

1.10.x
Yannick Warnier 10 years ago
commit 3f191ad9c5
  1. 25
      main/inc/lib/webservices/WebService.class.php

@ -45,28 +45,15 @@ abstract class WebService
return false;
}
$userTable = Database::get_main_table(TABLE_MAIN_USER);
$user = UserManager::getRepository()->findOneBy([
'username' => $username
]);
$whereConditions = array(
"username = '?' " => $username,
"AND password = '?'" => sha1($password)
);
$conditions = array(
'where' => $whereConditions
);
$table = Database::select('count(1) as qty', $userTable, $conditions);
if ($table != false) {
$row = current($table);
if ($row['qty'] > 0) {
return true;
}
if (empty($user)) {
return false;
}
return false;
return UserManager::isPasswordValid($password, $user);
}
}

Loading…
Cancel
Save