Security.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: Security.php 29263 2012-03-31 05:45:08Z yexinhao $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. Cloud::loadFile('Service_Client_Restful');
  12. class Cloud_Service_Client_Security extends Cloud_Service_Client_Restful {
  13. protected static $_instance;
  14. public static function getInstance($debug = false) {
  15. if (!(self::$_instance instanceof self)) {
  16. self::$_instance = new self($debug);
  17. }
  18. return self::$_instance;
  19. }
  20. public function __construct($debug = false) {
  21. return parent::__construct($debug);
  22. }
  23. function securityReportUserRegister($batchData) {
  24. return $this->_callMethod('security.user.register', array('sId' => $this->_sId, 'data' => $batchData));
  25. }
  26. function securityReportUserLogin($batchData) {
  27. return $this->_callMethod('security.user.login', array('sId' => $this->_sId, 'data' => $batchData));
  28. }
  29. function securityReportBanUser($batchData) {
  30. return $this->_callMethod('security.user.ban', array('sId' => $this->_sId, 'data' => $batchData));
  31. }
  32. function securityReportPost($batchData) {
  33. return $this->_callMethod('security.post.handlePost', array('sId' => $this->_sId, 'data' => $batchData));
  34. }
  35. function securityReportDelPost($batchData) {
  36. return $this->_callMethod('security.post.del', array('sId' => $this->_sId, 'data' => $batchData));
  37. }
  38. function securityReportOperation($operateType, $results, $operateTime = TIMESTAMP, $extra = array()) {
  39. $data = array(
  40. 'sId' => $this->_sId,
  41. 'sSiteUid' => $this->siteUid,
  42. 'operateType' => $operateType,
  43. 'operateTime' => $operateTime,
  44. 'results' => $results,
  45. 'extra' => $extra
  46. );
  47. return $this->_callMethod('security.sitemaster.handleOperation', $data);
  48. }
  49. }