cm_webservice_courses.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.webservices
  5. */
  6. require_once __DIR__.'/../inc/global.inc.php';
  7. require_once __DIR__.'/cm_webservice.php';
  8. /**
  9. * Description of cm_soap_inbox.
  10. *
  11. * @author marcosousa
  12. */
  13. class WSCMCourses extends WSCM
  14. {
  15. public function get_courses_code($username, $password)
  16. {
  17. if ($this->verifyUserPass($username, $password) == "valid") {
  18. $user_id = UserManager::get_user_id_from_username($username);
  19. $listOfCourses = UserManager::get_personal_session_course_list($user_id);
  20. $courses_id = "#";
  21. foreach ($listOfCourses as $course) {
  22. $courses_id .= $course['code']."#";
  23. }
  24. return $courses_id;
  25. } else {
  26. return get_lang('Login failed - incorrect login or password.');
  27. }
  28. }
  29. public function get_course_title($username, $password, $course_code)
  30. {
  31. if ($this->verifyUserPass($username, $password) == "valid") {
  32. $course_info = CourseManager::get_course_information($course_code);
  33. return $course_info['title'];
  34. } else {
  35. return get_lang('Login failed - incorrect login or password.');
  36. }
  37. }
  38. }