BxGitHubModule.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 GitHub GitHub
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /*
  12. *
  13. * Creating a fine-grained personal access token
  14. * https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token
  15. *
  16. * Creating a personal access token (classic)
  17. * https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic
  18. *
  19. * Web application flow
  20. * https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#web-application-flow
  21. *
  22. */
  23. class BxGitHubModule extends BxBaseModGeneralModule
  24. {
  25. function __construct($aModule)
  26. {
  27. parent::__construct($aModule);
  28. $this->_oConfig->init($this->_oDb);
  29. }
  30. /**
  31. * ACTION METHODS
  32. */
  33. /**
  34. * SERVICE METHODS
  35. */
  36. public function serviceGetBlockSettings($iProfileId = 0)
  37. {
  38. $iLoggedId = bx_get_logged_profile_id();
  39. if(!$iProfileId || ($iProfileId != $iLoggedId && !$this->_isAdministrator()))
  40. $iProfileId = $iLoggedId;
  41. if(!$iProfileId)
  42. return MsgBox(_t('_sys_txt_access_denied'));
  43. return $this->_oTemplate->getBlockSettings($iProfileId);
  44. }
  45. public function serviceAddIssue($iProfileId, $sRepository, $sTitle, $sText = '')
  46. {
  47. //TODO: Create Issue in Repository.
  48. }
  49. /*
  50. * COMMON METHODS
  51. */
  52. }
  53. /** @} */