BxFaceBookConnectConfig.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 FacebookConnect Facebook Connect
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxFaceBookConnectConfig extends BxBaseModConnectConfig
  12. {
  13. public $mApiID;
  14. public $mApiSecret;
  15. public $sPageReciver;
  16. public $bAutoFriends;
  17. public $aFaceBookReqParams;
  18. public $sFaceBookFields;
  19. public $sDefaultCountryCode = 'US';
  20. function __construct($aModule)
  21. {
  22. parent::__construct($aModule);
  23. $this -> mApiID = getParam('bx_facebook_connect_api_key');
  24. $this -> mApiSecret = getParam('bx_facebook_connect_secret');
  25. $this -> sPageReciver = BX_DOL_URL_ROOT . $this -> getBaseUri() . 'login_callback';
  26. $this -> sSessionUid = 'facebook_session';
  27. $this -> sSessionProfile = 'facebook_session_profile';
  28. $this -> sEmailTemplatePasswordGenerated = 'bx_facebook_password_generated';
  29. $this -> sDefaultTitleLangKey = '_bx_facebook';
  30. $this -> sRedirectPage = getParam('bx_facebook_connect_redirect_page');
  31. $this -> sProfilesModule = getParam('bx_facebook_connect_module');
  32. $this -> isAlwaysConfirmEmail = (bool)getParam('bx_facebook_connect_confirm_email');
  33. $this -> isAlwaysAutoApprove = (bool)getParam('bx_facebook_connect_approve');
  34. $this -> bAutoFriends = 'on' == getParam('bx_facebook_connect_auto_friends');
  35. $this -> aFaceBookReqParams = array(
  36. 'scope' => getParam('bx_facebook_connect_extended_info')
  37. ? 'email,public_profile,user_friends,user_birthday,user_hometown,user_location'
  38. : 'email,public_profile',
  39. 'redirect_uri' => $this -> sPageReciver,
  40. );
  41. $this -> sFaceBookFields = getParam('bx_facebook_connect_extended_info')
  42. ? 'name,email,first_name,last_name,gender,birthday,bio,hometown,location'
  43. : 'name,email,first_name,last_name';
  44. }
  45. }
  46. /** @} */