暫無描述

provider-dummy.php 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?php
  2. abstract class NextendSocialProviderDummy {
  3. protected $id;
  4. protected $label;
  5. protected $path;
  6. /**
  7. * Defines the way the OAuth redirect is handled
  8. *
  9. * default_redirect: both the App and the Authorization requests accepts GET parameters in the redirect uri
  10. *
  11. * default_redirect_but_app_has_restriction: the App doesn't allow redirect URLs with GET parameters, but the
  12. * Authorization requests accepts it.
  13. *
  14. * rest_redirect: the App doesn't allow redirect URLs with GET parameters, and neither the Authorization
  15. * requests. In these cases we use the REST Endpoint of the provider e.g:
  16. * https://example.com/wp-json/nextend-social-login/v1/{{providerID}}/redirect_uri
  17. * that passes the state and code to the login endpoint of the provider.
  18. *
  19. * @var string
  20. */
  21. public $oauthRedirectBehavior = "default";
  22. protected $color = '#fff';
  23. protected $popupWidth = 600;
  24. protected $popupHeight = 600;
  25. /** @var NextendSocialLoginSettings */
  26. public $settings;
  27. /** @var NextendSocialProviderAdmin */
  28. protected $admin = null;
  29. public function needPro() {
  30. return true;
  31. }
  32. /**
  33. * @return string
  34. */
  35. public function getId() {
  36. return $this->id;
  37. }
  38. /**
  39. * @return string
  40. */
  41. public function getLabel() {
  42. return $this->label;
  43. }
  44. public function enable() {
  45. return false;
  46. }
  47. public function isEnabled() {
  48. return false;
  49. }
  50. public function isTested() {
  51. return false;
  52. }
  53. public function isTest() {
  54. return false;
  55. }
  56. public function connect() {
  57. }
  58. public function getState() {
  59. return 'pro-only';
  60. }
  61. public function getIcon() {
  62. return plugins_url('/providers/' . $this->id . '/' . $this->id . '.png', NSL_PATH_FILE);
  63. }
  64. /**
  65. * @return string
  66. */
  67. public function getColor() {
  68. return $this->color;
  69. }
  70. /**
  71. * @return int
  72. */
  73. public function getPopupWidth() {
  74. return $this->popupWidth;
  75. }
  76. /**
  77. * @return int
  78. */
  79. public function getPopupHeight() {
  80. return $this->popupHeight;
  81. }
  82. /**
  83. * @return mixed
  84. */
  85. public function getPath() {
  86. return $this->path;
  87. }
  88. /**
  89. * @return NextendSocialProviderAdmin
  90. */
  91. public function getAdmin() {
  92. return $this->admin;
  93. }
  94. /**
  95. * @param string $subview
  96. *
  97. * @return bool
  98. */
  99. public function adminDisplaySubView($subview) {
  100. return false;
  101. }
  102. }