BxBaseStudioSettingsServices.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaView UNA Studio Representation classes
  7. * @ingroup UnaStudio
  8. * @{
  9. */
  10. /**
  11. * System services related to Comments.
  12. */
  13. class BxBaseStudioSettingsServices extends BxDol
  14. {
  15. protected $oDb;
  16. public function __construct()
  17. {
  18. parent::__construct();
  19. $this->oDb = new BxDolStudioSettingsQuery();
  20. }
  21. public function serviceAlertResponseChangeKands($oAlert)
  22. {
  23. if(!in_array($oAlert->aExtras['option'], ['sys_oauth_key', 'sys_oauth_secret']))
  24. return;
  25. if(strcmp($oAlert->aExtras['value'], $oAlert->aExtras['value_prior']) == 0)
  26. return;
  27. BxDolStudioOAuth::unsetAuthorized();
  28. }
  29. public function serviceAlertResponseSysImagesCustomFileDeleted($oAlert)
  30. {
  31. if(!isset($oAlert->aExtras['ghost']['content_id']))
  32. return;
  33. $iOption = (int)$oAlert->aExtras['ghost']['content_id'];
  34. $aOption = array();
  35. $this->oDb->getOptions(array('type' => 'by_id', 'value' => $iOption), $aOption, false);
  36. if(!empty($aOption) && is_array($aOption))
  37. setParam($aOption['name'], 0);
  38. }
  39. }
  40. /** @} */