public function init()
 {
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     //require_once(_base_.'/addons/social/config_docebo.php');
     //require_once(_base_.'/addons/social/class.fblinkedtwit.php');
     //$fblinkedtwit   =   new FbLinkedTwit();
     //require_once(_base_.'/addons/social/functions.php');
     $this->conf = Social::getConfig();
     Social::includeTwitterLib();
 }
Exemple #2
0
         } else {
             // user is already logged in, so connect the account with user
             $social->connectAccount('twitter', $userInfo->screen_name);
             Util::jump_to('index.php?r=lms/elearning/show');
             die;
         }
     } else {
         Util::jump_to('index.php?access_fail=3');
     }
     break;
 case "linkedin_login":
     $social = new Social();
     $social->includeLinkedinLib();
     require_once _base_ . '/lib/lib.preference.php';
     $preference = new UserPreferences(getLogUserId());
     $conf = $social->getConfig();
     $user_pref = array();
     if (Docebo::user()->isAnonymous()) {
         $user_pref['linkedin_key'] = '';
         $user_pref['linkedin_secret'] = '';
     } else {
         $user_pref['linkedin_key'] = $preference->getPreference('social.linkedin_key');
         $user_pref['linkedin_secret'] = $preference->getPreference('social.linkedin_secret');
     }
     $already_auth = $social->checkLinkedinAuth($conf['linkedin_key'], $conf['linkedin_secret'], $user_pref['linkedin_key'], $user_pref['linkedin_secret']);
     $sign_in = false;
     if ($already_auth) {
         $sign_in = true;
     } else {
         if (!isset($_GET['back'])) {
             $social->linkedinRequestToken($conf['linkedin_key'], $conf['linkedin_secret']);