Пример #1
0
 function _add_facebook($uuid)
 {
     if (!empty($_SERVER['QUERY_STRING'])) {
         parse_str($_SERVER['QUERY_STRING'], $_GET);
         if (!empty($_GET['code'])) {
             $token = process_facebook_verification($_GET['code'], site_url("user/identities/{$uuid}/add_facebook"));
             $fb_id = facebook_get_id($this, $token);
             if (!$this->sg_auth->facebook_exists($fb_id)) {
                 if (!$this->simiangrid->identity_set($uuid, 'facebook', $fb_id)) {
                     push_message(lang('sg_auth_fb_error_assoc'), 'error');
                 }
             }
         }
     }
     return redirect("user/view/{$uuid}");
 }
Пример #2
0
 function _get_facebook_token()
 {
     $token = null;
     if (!empty($_SERVER['QUERY_STRING'])) {
         parse_str($_SERVER['QUERY_STRING'], $_GET);
         if (!empty($_GET['code'])) {
             $token = process_facebook_verification($_GET['code'], site_url("auth/register_facebook"));
             $this->session->set_flashdata('facebook_token', $token);
         } else {
             return $this->_get_facebook_token_flash();
         }
     } else {
         return $this->_get_facebook_token_flash();
     }
     return $token;
 }