示例#1
0
 public function __construct()
 {
     parent::__construct('facebook', 'et_facebook_id', array('title' => __('SIGN IN WITH FACEBOOK', ET_DOMAIN), 'content' => __("This seems to be your first time signing in using your Facebook account.If you already have an account, please log in using the form below to link it to your Facebook account. Otherwise, please enter an email address and a password on the form, and a username on the next page to create an account.You will only do this step ONCE. Next time, you'll get logged in right away.", ET_DOMAIN), 'content_confirm' => __("Please provide a username to continue", ET_DOMAIN)));
     //$this->add_action('init', 'auth_facebook');
     $this->fb_app_id = ae_get_option('et_facebook_key', false);
     $this->fb_secret_key = ae_get_option('et_facebook_secret_key', false);
     $this->fb_token_url = 'https://graph.facebook.com/me';
     $this->fb_exchange_token = 'https://graph.facebook.com/oauth/access_token';
     $this->add_action('wp_enqueue_scripts', 'add_scripts', 20);
     $this->add_ajax('et_facebook_auth', 'auth_facebook');
 }
示例#2
0
 public function __construct()
 {
     parent::__construct('twitter', 'et_twitter_id', array('title' => __("SIGN IN WITH TWITTER", ET_DOMAIN), 'content' => __("This seems to be your first time signing in using your Twitter account.If you already have an account  , please log in using the form below to link it to your Twitter account. Otherwise, please enter an email address and a password on the form, and a username on the next page to create an account.You will only do this step ONCE. Next time, you'll get logged in right away.", ET_DOMAIN), 'content_confirm' => __("Please provide a username to continue", ET_DOMAIN)));
     $this->consumer_key = ae_get_option(self::OPT_CONSUMER_KEY, '');
     // 'H7ggzgE4rNubSq09SKQJGw';
     $this->consumer_secret = ae_get_option(self::OPT_CONSUMER_SECRET, '');
     //'zUrMVznhHvrMEKBE5LhipfvRODLlPsvEJLvYiaf4yqE';
     $this->oath_callback = add_query_arg('action', 'twitterauth_callback', home_url());
     // only run if options are given
     if (!empty($this->consumer_key) && !empty($this->consumer_secret) && !is_user_logged_in()) {
         //$this->add_action('init', 'redirect');
         $this->redirect();
     }
 }
示例#3
0
 public function __construct()
 {
     parent::__construct('google', 'et_google_id', array('title' => __('SIGN IN WITH GOOGLE+', ET_DOMAIN), 'content' => __("This seems to be your first time signing in using your Google+ account.If you already have an account, please log in using the form below to link it to your Facebook account. Otherwise, please enter an email address and a password on the form, and a username on the next page to create an account.You will only do this step ONCE. Next time, you'll get logged in right away.", ET_DOMAIN), 'content_confirm' => __("Please provide a username to continue", ET_DOMAIN)));
     $this->add_ajax('ae_gplus_auth', 'ae_gplus_redirect');
     $this->gplus_client_id = ae_get_option('gplus_client_id');
     $this->gplus_secret_key = ae_get_option('gplus_secret_id');
     $this->gplus_base_url = 'https://accounts.google.com/o/oauth2/auth';
     $this->gplus_exchange_url = 'https://www.googleapis.com/oauth2/v3/token';
     $this->gplus_token_info_url = 'https://www.googleapis.com/oauth2/v1/userinfo';
     if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'gplus_auth_callback') {
         if (!empty($this->gplus_client_id) && !empty($this->gplus_secret_key) && !is_user_logged_in()) {
             $this->auth_google();
         } else {
             _e('Please enter your Google client id and secret key in setting page!', ET_DOMAIN);
             exit;
         }
     }
 }
示例#4
0
 public function __construct()
 {
     parent::__construct('linkedin', 'et_linkedin_id', array('title' => __('SIGN IN WITH LINKEDIN', ET_DOMAIN), 'content' => __("This seems to be your first time signing in using your LinkedIn account.If you already have an account, please log in using the form below to link it to your LinkedIn account. Otherwise, please enter an email address and a password on the form, and a username on the next page to create an account.You will only do this step ONCE. Next time, you'll get logged in right away.", ET_DOMAIN), 'content_confirm' => __("Please provide a username to continue", ET_DOMAIN)));
     $this->state = md5(uniqid());
     $this->add_ajax('ae_linked_auth', 'lkin_redirect');
     $this->linkedin_api_key = ae_get_option('linkedin_api_key');
     $this->linkedin_secret_key = ae_get_option('linkedin_secret_key');
     $this->linkedin_base_url = 'https://www.linkedin.com/uas/oauth2/authorization';
     $this->linkedin_token_url = 'https://www.linkedin.com/uas/oauth2/accessToken';
     $this->linkedin_people_url = 'https://api.linkedin.com/v1/people/~:(id,location,picture-url,specialties,public-profile-url,email-address,formatted-name)?format=json';
     if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'linked_auth_callback') {
         if (!empty($this->linkedin_api_key) && !empty($this->linkedin_secret_key) && !is_user_logged_in()) {
             $this->linked_auth();
         } else {
             _e('Please enter your Linkedin App id and secret key!', ET_DOMAIN);
             exit;
         }
     }
 }
示例#5
0
 public function __construct()
 {
     parent::__construct('google', 'et_google_id', array('title' => __('SIGN IN WITH GOOGLE+', ET_DOMAIN), 'content' => __("This seems to be your first time signing in using your Google+ account.If you already have an account, please log in using the form below to link it to your Google+ account. Otherwise, please enter an email address and a password on the form, and a username on the next page to create an account.You will only do this step ONCE. Next time, you'll get logged in right away.", ET_DOMAIN), 'content_confirm' => __("Please provide a username to continue", ET_DOMAIN)));
     $this->add_action('wp_enqueue_scripts', 'add_scripts', 20);
     $this->add_ajax('et_google_auth', 'auth_google');
 }