person.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * ownCloud
  4. *
  5. * @author Frank Karlitschek
  6. * @author Tom Needham
  7. * @copyright 2012 Frank Karlitschek frank@owncloud.org
  8. * @copyright 2012 Tom Needham tom@owncloud.com
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  12. * License as published by the Free Software Foundation; either
  13. * version 3 of the License, or any later version.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public
  21. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. class OC_OCS_Person {
  25. public static function check($parameters) {
  26. $login = isset($_POST['login']) ? $_POST['login'] : false;
  27. $password = isset($_POST['password']) ? $_POST['password'] : false;
  28. if($login && $password) {
  29. if(OC_User::checkPassword($login, $password)) {
  30. $xml['person']['personid'] = $login;
  31. return new OC_OCS_Result($xml);
  32. } else {
  33. return new OC_OCS_Result(null, 102);
  34. }
  35. } else {
  36. return new OC_OCS_Result(null, 101);
  37. }
  38. }
  39. }