Exemple #1
0
 /**
  * Class constructor
  */
 public function __construct($providerName)
 {
     parent::__construct('provider-config-form');
     $this->setAjax(true);
     $this->bindJsFunction(Form::BIND_SUCCESS, 'function(data){if( data.result ){OW.info(data.message);setTimeout(function(){location.reload();}, 1000);}else{OW.error(data.message);}}');
     $this->setAction(OW::getRouter()->urlForRoute('ynsocialconnect-admin-ajaxUpdateProfileQuestion'));
     $language = OW::getLanguage();
     $service = YNSOCIALCONNECT_BOL_ServicesService::getInstance();
     $questionDtoList = $service->getOWQuestionDtoList($providerName);
     $aliases = $service->findAliasList($providerName);
     $options = $service->getServiceFields($providerName);
     foreach ($questionDtoList as $question) {
         $new_element = new Selectbox('alias[' . $question->name . ']');
         foreach ($options as $option) {
             $new_element->addOption($option->name, $option->label);
         }
         $new_element->setValue(empty($aliases[$question->name]) ? '' : $aliases[$question->name]);
         $this->addElement($new_element);
     }
     $hidden = new TextField('providerName');
     $hidden->addAttribute('type', 'hidden');
     $hidden->setValue($providerName);
     $this->addElement($hidden);
     $submit = new Submit('edit');
     $submit->setValue($language->text('ynsocialconnect', 'save_btn_label'));
     $this->addElement($submit);
 }
 public function __construct($providerName)
 {
     parent::__construct();
     $providerConfigForm = new YNSOCIALCONNECT_CLASS_ConfigFieldsForm($providerName);
     $this->addForm($providerConfigForm);
     $service = YNSOCIALCONNECT_BOL_ServicesService::getInstance();
     $provider = $service->getProvider($providerName);
     $this->assign('provider', $provider->getTitle());
     $questionDtoList = $service->getOWQuestionDtoList($providerName);
     $questionList = array();
     foreach ($questionDtoList as $dto) {
         $questionList[$dto->sectionName][(int) $dto->sortOrder] = array('name' => $dto->name, 'el_name' => 'alias[' . $dto->name . ']');
     }
     $questionSectionDtoList = BOL_QuestionService::getInstance()->findAllSections();
     $tplQuestionList = array();
     foreach ($questionSectionDtoList as $sectionDto) {
         if (empty($questionList[$sectionDto->name])) {
             continue;
         }
         /* @var $sectionDto BOL_QuestionSection */
         $tplQuestionList[(int) $sectionDto->sortOrder] = array('name' => $sectionDto->name, 'items' => $questionList[$sectionDto->name]);
     }
     ksort($tplQuestionList);
     $this->assign('questionList', $tplQuestionList);
 }
Exemple #3
0
 /**
  * Constructor.
  *
  */
 public function __construct()
 {
     //	init
     parent::__construct();
     $this->consoleItem = new BASE_CMP_ConsoleItem();
     $this->addClass('ow_console_button');
     $staticUrl = OW::getPluginManager()->getPlugin('ynsocialconnect')->getStaticUrl();
     $document = OW::getDocument();
     $document->addScript($staticUrl . 'js/ynsocialconnect.js');
     //	process
     $iLimit = OW::getConfig()->getValue('ynsocialconnect', 'limit_providers_view_on_login_header');
     $iLimitSelected = OW::getConfig()->getValue('ynsocialconnect', 'limit_providers_view_on_login_header');
     //$aOpenProviders = YNSOCIALCONNECT_BOL_ServicesService::getInstance() -> getEnabledProviders($iLimit, (int)$iLimitSelected);
     $aOpenProviders = YNSOCIALCONNECT_BOL_ServicesService::getInstance()->getProvidersByStatus($bDisplay = true);
     $listProvider = array();
     $step = 0;
     foreach ($aOpenProviders as $item) {
         if (in_array($item->name, array('facebook', 'twitter', 'linkedin'))) {
             if (!YNSOCIALCONNECT_CLASS_SocialConnect::getInstance()->checkSocialBridgePlugin($item->name)) {
                 continue;
             }
         }
         $listProvider[] = $item;
         $step++;
         if ($step >= $iLimit) {
             break;
         }
     }
     $iIconSize = intval(OW::getConfig()->getValue('ynsocialconnect', 'size_of_provider_icon_px')) >= 0 ? intval(OW::getConfig()->getValue('ynsocialconnect', 'size_of_provider_icon_px')) : 24;
     $iWidth = (count($listProvider) + 1) * ($iIconSize + 6);
     $minusSign = '';
     if (22 < $iIconSize) {
         $minusSign = '-';
         $marginTop = ceil(($iIconSize - 22) / 2);
         $marginTop = $minusSign . $marginTop;
     } else {
         $marginTop = ceil((22 - $iIconSize) / 2);
     }
     $this->assign('marginTop', $marginTop);
     $this->assign('iLimitView', $iLimit);
     $this->assign('iLimitSelected', $iLimitSelected);
     $this->assign('aOpenProviders', $listProvider);
     $this->assign('iIconSize', $iIconSize);
     $this->assign('iWidth', $iWidth);
     $this->assign('sCoreUrl', OW_DIR_ROOT);
     $this->assign('sImgSrc', OW::getPluginManager()->getPlugin('ynsocialconnect')->getStaticUrl() . 'img/');
     $this->addComponent('eicmp', new YNSOCIALCONNECT_CMP_ViewMore());
     YNSOCIALCONNECT_CLASS_Helper::getInstance()->setIsViewMore('1');
     //	set url redirect to session
     $uri = OW::getRequest()->getRequestUri();
     // @formatter:off
     if (isset($uri) && strpos($uri, 'socialbridge') === false && strpos($uri, 'ynsocialbridge') === false && strpos($uri, 'ynsocialconnect') === false && strpos($uri, 'socialconnect') === false) {
         $uri = OW_URL_HOME . $uri;
         $_SESSION['ynsc_session']['urlRedirect'] = $uri;
     }
     // @formatter:on
 }
Exemple #4
0
 public function render()
 {
     //	init
     $iLimit = OW::getConfig()->getValue('ynsocialconnect', 'limit_providers_view_on_login_header');
     $iLimitSelected = OW::getConfig()->getValue('ynsocialconnect', 'limit_providers_view_on_login_header');
     //	process
     //$aOpenProviders = YNSOCIALCONNECT_BOL_ServicesService::getInstance() -> getEnabledProviders($iLimit, (int)$iLimitSelected);
     $aOpenProviders = YNSOCIALCONNECT_BOL_ServicesService::getInstance()->getProvidersByStatus($bDisplay = true);
     $listProvider = array();
     $step = 0;
     foreach ($aOpenProviders as $item) {
         if (in_array($item->name, array('facebook', 'twitter', 'linkedin'))) {
             if (!YNSOCIALCONNECT_CLASS_SocialConnect::getInstance()->checkSocialBridgePlugin($item->name)) {
                 continue;
             }
         }
         $listProvider[] = $item;
         $step++;
         if ($step >= $iLimit) {
             break;
         }
     }
     $iIconSize = intval(OW::getConfig()->getValue('ynsocialconnect', 'size_of_provider_icon_px')) >= 0 ? intval(OW::getConfig()->getValue('ynsocialconnect', 'size_of_provider_icon_px')) : 24;
     $iWidth = (count($listProvider) + 1) * ($iIconSize + 6);
     $this->assign('iLimitView', $iLimit);
     $this->assign('iLimitSelected', $iLimitSelected);
     $this->assign('aOpenProviders', $listProvider);
     $this->assign('iIconSize', $iIconSize);
     $this->assign('iWidth', $iWidth);
     $this->assign('sCoreUrl', OW_DIR_ROOT);
     $this->assign('sImgSrc', OW::getPluginManager()->getPlugin('ynsocialconnect')->getStaticUrl() . 'img/');
     //	set url redirect to session
     $uri = OW::getRequest()->getRequestUri();
     // @formatter:off
     if (isset($uri) && strpos($uri, 'socialbridge') === false && strpos($uri, 'ynsocialbridge') === false && strpos($uri, 'ynsocialconnect') === false && strpos($uri, 'socialconnect') === false) {
         $uri = OW_URL_HOME . $uri;
         $_SESSION['ynsc_session']['urlRedirect'] = $uri;
     }
     // @formatter:on
     if (OW::getSession()->isKeySet(YNSOCIALCONNECT_CTRL_Sync::SESSION_SIGNUP_DATA)) {
         $signupData = OW::getSession()->get(YNSOCIALCONNECT_CTRL_Sync::SESSION_SIGNUP_DATA);
         $profilePicture = YNSOCIALCONNECT_CLASS_SocialConnect::getInstance()->getPhotoUrlFromTokenData($signupData['user'], $signupData['service']);
         if ($profilePicture == null) {
             //OW::getSession() -> set(self::SESSION_USE_PROFILE_PHOTO, 'not_use');
             $profilePicture = "";
         } else {
             //OW::getSession() -> set(self::SESSION_USE_PROFILE_PHOTO, 'use');
             $url = OW::getRouter()->urlFor('YNSOCIALCONNECT_CTRL_Sync', 'removeAvatar');
             $removeEl = "<div class=\"ow_avatar_change\"><a href=\"javascript:void(0);\" onclick=\"YNSocialConnect.removeAvatar(\\'{$url}\\');\" class=\"ow_lbutton\">X</a></div>";
             //$removeEl = "<div class=\"ow_avatar_change\"><a href=\"javascript:void(0);\" onclick=\"YNSocialConnect.removeAvatar();\" class=\"ow_lbutton\">X</a></div>";
             $profilePicture = "<div id=\"ynsc_profile_picture\" class=\"ynsc_profile_photo_center\"><img class=\"ynsc_profile_phpto\" src=\"" . $profilePicture . "\">" . $removeEl . "</div><br />";
         }
         $this->assign('profilePicture', $profilePicture);
     }
     //	end
     return parent::render();
 }
Exemple #5
0
 private function __mappingProfile($profile, $sService)
 {
     $key = 'joinData';
     $joinData = OW::getSession()->get($key);
     if (!isset($joinData) || !is_array($joinData)) {
         $joinData = array();
     }
     $fields = YNSOCIALCONNECT_BOL_ServicesService::getInstance()->findAliasList($sService);
     foreach ($fields as $question => $field) {
         switch ($question) {
             case 'username':
                 //	username
                 if (isset($profile[$field])) {
                     $joinData[$question] = preg_replace("/[^A-Za-z0-9\\+]/", "", $profile[$field]);
                 }
                 break;
             default:
                 if (isset($profile[$field])) {
                     $joinData[$question] = $profile[$field];
                 }
                 break;
         }
     }
     //	set into session
     try {
         OW::getSession()->set($key, $joinData);
     } catch (Exception $e) {
     }
     //session_write_close();
     return $joinData;
 }
Exemple #6
0
 public function index()
 {
     $this->setPageHeading(OW::getLanguage()->text('ynsocialconnect', 'h_synchronize_user'));
     //	init
     if (OW::getUser()->isAuthenticated()) {
         $this->redirect(OW_URL_HOME);
         //throw new AuthenticateException();
     }
     $oBridge = YNSOCIALCONNECT_CLASS_SocialBridge::getInstance();
     $signupData = OW::getSession()->get(YNSOCIALCONNECT_CTRL_Sync::SESSION_SIGNUP_DATA);
     //	process
     $form = new YNSOCIALCONNECT_CLASS_UserSyncForm();
     $email = $signupData['user']['email'];
     if (!$email) {
         $email = '';
     }
     if (OW::getRequest()->isPost() && $form->isValid($_POST)) {
         $data = $form->getValues();
         if ($data['form_name'] == YNSOCIALCONNECT_CLASS_UserSyncForm::FORM_NAME) {
             if (isset($_POST['no'])) {
                 //	sign up
                 $this->redirect(OW::getRouter()->urlForRoute('base_join'));
             }
             if (isset($_POST['synchronize'])) {
                 //	synchronize with existed account
                 $aUser = BOL_UserService::getInstance()->findByEmail($email);
                 $sUrlRedirect = '';
                 if ($aUser) {
                     ////		update ow_base_remote_auth
                     $authAdapter = new YNSOCIALCONNECT_CLASS_AuthAdapter($signupData['identity'], $signupData['service']);
                     $authAdapter->register($aUser->id);
                     ////	add agent
                     $provider = YNSOCIALCONNECT_BOL_ServicesService::getInstance()->getProvider($signupData['service']);
                     $entity = new YNSOCIALCONNECT_BOL_Agents();
                     $entity->userId = (int) $aUser->id;
                     $entity->identity = $signupData['identity'];
                     $entity->serviceId = $provider->id;
                     $entity->ordering = 0;
                     $entity->status = 'login';
                     $entity->login = '******';
                     $entity->data = base64_encode(serialize($signupData['user']));
                     $entity->tokenData = base64_encode(serialize($signupData['user']));
                     $entity->token = time();
                     $entity->createdTime = time();
                     $entity->loginTime = time();
                     $entity->logoutTime = time();
                     YNSOCIALCONNECT_BOL_AgentsService::getInstance()->save($entity);
                     //		add token in social bridge
                     if ($oBridge->hasProvider(strtolower($signupData['service']))) {
                         $core = new YNSOCIALBRIDGE_CLASS_Core();
                         $oProvider = $core->getInstance($signupData['service']);
                         $values = array('service' => strtolower($signupData['service']), 'userId' => $aUser->id);
                         $tokenDto = $oProvider->getToken($values);
                         if (!$tokenDto) {
                             //
                             $obj = $core->getInstance($signupData['service']);
                             $obj->saveToken();
                         }
                     }
                     ////	update statistics with "sync" type
                     YNSOCIALCONNECT_BOL_ServicesService::getInstance()->updateStatistics($signupData['service'], 'sync');
                     ////		add user linking
                     $entityUserlinking = new YNSOCIALCONNECT_BOL_Userlinking();
                     $entityUserlinking->userId = (int) $aUser->id;
                     $entityUserlinking->identity = $signupData['identity'];
                     $entityUserlinking->serviceId = $provider->id;
                     YNSOCIALCONNECT_BOL_UserlinkingService::getInstance()->save($entityUserlinking);
                     ////	clear sign up session
                     OW::getSession()->delete(YNSOCIALCONNECT_CTRL_Sync::SESSION_SIGNUP_DATA);
                     ////	redirect
                     $authResult = OW::getUser()->authenticate($authAdapter);
                     if ($authResult->isValid()) {
                         if (isset($_SESSION['ynsc_session']) && isset($_SESSION['ynsc_session']['urlRedirect']) && strlen(trim($_SESSION['ynsc_session']['urlRedirect'])) > 0) {
                             $sUrlRedirect = $_SESSION['ynsc_session']['urlRedirect'];
                         } else {
                             $sUrlRedirect = OW_URL_HOME;
                         }
                         $this->redirect($sUrlRedirect);
                     } else {
                         $this->redirect(OW_URL_HOME);
                     }
                 }
             }
         }
     }
     // 	end
     //// 	clear session
     if (isset($_SESSION['socialbridge_session'][$signupData['service']])) {
         unset($_SESSION['socialbridge_session'][$signupData['service']]);
     }
     $this->addForm($form);
     $this->assign('email', $email);
     $this->assign('question', OW::getLanguage()->text('ynsocialconnect', 'txt_sync_question', array('email' => $email)));
 }
Exemple #7
0
 public function linking($params)
 {
     if (!OW::getUser()->isAuthenticated()) {
         $this->redirect(OW_URL_HOME);
         //throw new AuthenticateException();
     }
     if (!isset($params['service']) || !strlen(trim($params['service']))) {
         $this->redirect(OW_URL_HOME);
         //throw new Redirect404Exception();
     }
     //	init
     $oBridge = YNSOCIALCONNECT_CLASS_SocialBridge::getInstance();
     $sService = isset($params['service']) ? strtolower($params['service']) : null;
     $sIdentity = null;
     $data = NULL;
     $type = 'bridge';
     $sUrlRedirect = OW::getRouter()->urlForRoute('ynsocialconnect_user_user_linking');
     //	process
     if ($oBridge->hasProvider($sService)) {
         //	process Facebook, Twitter, LinkedIn
         $profile = null;
         //check enable API
         $clientConfig = YNSOCIALBRIDGE_BOL_ApisettingService::getInstance()->getConfig($sService);
         if ($clientConfig) {
             $core = new YNSOCIALBRIDGE_CLASS_Core();
             $oProvider = $core->getInstance($sService);
             if (!empty($_SESSION['socialbridge_session'][$sService])) {
                 try {
                     $profile = $oProvider->getOwnerInfo($_SESSION['socialbridge_session'][$sService]);
                 } catch (Exception $e) {
                     $profile = null;
                 }
             }
             //
             if ($profile) {
                 $sIdentity = isset($profile['identity']) ? $profile['identity'] : null;
                 ////	filter data
                 $profile = YNSOCIALCONNECT_CLASS_SocialConnect::getInstance()->filterProfile($profile, $sService);
                 $data = $profile;
             }
         }
     } else {
         //	process with other services
         $type = 'not_bridge';
         $sIdentity = isset($_REQUEST['identity']) ? $_REQUEST['identity'] : null;
         $data = $_REQUEST;
     }
     if (NULL == $sIdentity) {
         $type = 'close_not_loading';
     } else {
         ////		update ow_base_remote_auth
         $authAdapter = new YNSOCIALCONNECT_CLASS_AuthAdapter($sIdentity, $sService);
         $authAdapter->register(OW::getUser()->getId());
         ////		update agent table in social connect
         $provider = YNSOCIALCONNECT_BOL_ServicesService::getInstance()->getProvider($sService);
         $entity = new YNSOCIALCONNECT_BOL_Agents();
         $entity->userId = (int) OW::getUser()->getId();
         $entity->identity = $sIdentity;
         $entity->serviceId = $provider->id;
         $entity->ordering = 0;
         $entity->status = 'linking';
         $entity->login = '******';
         $entity->data = base64_encode(serialize($data));
         $entity->tokenData = base64_encode(serialize($data));
         $entity->token = time();
         $entity->createdTime = time();
         $entity->loginTime = time();
         $entity->logoutTime = time();
         YNSOCIALCONNECT_BOL_AgentsService::getInstance()->save($entity);
         ////		delete old token and add new token in social bridge
         if ($oBridge->hasProvider($sService)) {
             //	remove old token
             $values = array('service' => $sService, 'userId' => OW::getUser()->getId());
             $tokenDto = $oProvider->getToken($values);
             if ($tokenDto) {
                 YNSOCIALBRIDGE_BOL_TokenService::getInstance()->delete($tokenDto);
             }
             //	add new token
             $oProvider->saveToken();
         }
         ////		add user linking
         $entityUserlinking = new YNSOCIALCONNECT_BOL_Userlinking();
         $entityUserlinking->userId = (int) OW::getUser()->getId();
         $entityUserlinking->identity = $sIdentity;
         $entityUserlinking->serviceId = $provider->id;
         YNSOCIALCONNECT_BOL_UserlinkingService::getInstance()->save($entityUserlinking);
     }
     //	end
     //// 	clear session
     if (isset($_SESSION['socialbridge_session'][$sService])) {
         unset($_SESSION['socialbridge_session'][$sService]);
     }
     $this->assign('type', $type);
     $this->assign('sUrlRedirect', $sUrlRedirect);
 }
Exemple #8
0
 /**
  * Return YNSOCIALCONNECT_BOL_Agents object or NULL
  */
 public function getAgentByIdentityAndService($sIdentity, $sService, $iServiceId = null)
 {
     if (NULL == $sIdentity || NULL == $sService) {
         return NULL;
     }
     if (null == $iServiceId) {
         $provider = YNSOCIALCONNECT_BOL_ServicesService::getInstance()->getProvider($sService);
         $iServiceId = $provider->getId();
     }
     //      init sql query
     //$sIdentity = trim($sIdentity, '/');
     $sqlQuery = "\n\t\t                        SELECT \t`yna`.* \n\t\t\n\t\t                        FROM  {$this->getTableName()}  AS `yna`\n\t\t                        WHERE 1=1 \n\t\t                      ";
     $sqlQuery .= " AND identity = :sIdentity";
     $sqlQuery .= " AND serviceId = :iServiceId";
     return $this->dbo->queryForObject($sqlQuery, $this->getDtoClassName(), array('sIdentity' => $sIdentity, 'iServiceId' => $iServiceId));
 }
Exemple #9
0
 /**
  * ajax edit provider action
  */
 public function ajaxUpdateProfileQuestion()
 {
     if (!OW::getRequest()->isAjax()) {
         throw new Redirect404Exception();
     }
     if (OW::getRequest()->isPost()) {
         try {
             if (empty($_POST['alias'])) {
                 exit(json_encode(array('result' => false, 'message' => 'Error!')));
             }
             $list = $_POST['alias'];
             $service = $_POST['providerName'];
             foreach ($list as $question => $field) {
                 if (!empty($field)) {
                     YNSOCIALCONNECT_BOL_ServicesService::getInstance()->assignQuestion($question, $field, $service);
                 } else {
                     YNSOCIALCONNECT_BOL_ServicesService::getInstance()->unsetQuestion($question, $service);
                 }
             }
             exit(json_encode(array('result' => true, 'message' => OW::getLanguage()->text('yncontactimporter', 'provider_updated'))));
         } catch (LogicException $e) {
             exit(json_encode(array('result' => false, 'message' => 'Error!')));
         }
     }
     exit(json_encode(array('result' => true, 'message' => OW::getLanguage()->text('yncontactimporter', 'provider_updated'))));
 }
 public function onUserRegister(OW_Event $event)
 {
     //	init
     $params = $event->getParams();
     $signupData = OW::getSession()->get(YNSOCIALCONNECT_CTRL_Sync::SESSION_SIGNUP_DATA);
     if (NULL != $params && is_array($params) && NULL != $signupData) {
         //	process
         ////		update ow_base_remote_auth
         $authAdapter = new YNSOCIALCONNECT_CLASS_AuthAdapter($signupData['identity'], $signupData['service']);
         $authAdapter->register($params['userId']);
         ////		update agent table in social connect
         $provider = YNSOCIALCONNECT_BOL_ServicesService::getInstance()->getProvider($signupData['service']);
         $entity = new YNSOCIALCONNECT_BOL_Agents();
         $entity->userId = (int) $params['userId'];
         $entity->identity = $signupData['identity'];
         $entity->serviceId = $provider->id;
         $entity->ordering = 0;
         $entity->status = 'login';
         $entity->login = '******';
         $entity->data = base64_encode(serialize($signupData['user']));
         $entity->tokenData = base64_encode(serialize($signupData['user']));
         $entity->token = time();
         $entity->createdTime = time();
         $entity->loginTime = time();
         $entity->logoutTime = time();
         YNSOCIALCONNECT_BOL_AgentsService::getInstance()->save($entity);
         ////add token in social bridge
         $oBridge = YNSOCIALCONNECT_CLASS_SocialBridge::getInstance();
         if ($oBridge->hasProvider(strtolower($signupData['service']))) {
             $core = new YNSOCIALBRIDGE_CLASS_Core();
             $obj = $core->getInstance($signupData['service']);
             $obj->saveToken();
         }
         ////update signup statistic
         YNSOCIALCONNECT_BOL_ServicesService::getInstance()->updateStatistics($signupData['service'], 'signup');
         ////add user linking
         $entityUserlinking = new YNSOCIALCONNECT_BOL_Userlinking();
         $entityUserlinking->userId = (int) $params['userId'];
         $entityUserlinking->identity = $signupData['identity'];
         $entityUserlinking->serviceId = $provider->id;
         YNSOCIALCONNECT_BOL_UserlinkingService::getInstance()->save($entityUserlinking);
         //	end
         if (isset($_SESSION['socialbridge_session'][$signupData['service']])) {
             unset($_SESSION['socialbridge_session'][$signupData['service']]);
         }
         ////		clear session
         OW::getSession()->delete(YNSOCIALCONNECT_CTRL_Sync::SESSION_SIGNUP_DATA);
         //	update avatar
         ////	if avatar doesn't exist, update with profile image
         if (in_array($signupData['service'], array('facebook', 'linkedin', 'twitter'))) {
             $useProfilePhoto = OW::getSession()->get(YNSOCIALCONNECT_CMP_ViewInJoinPage::SESSION_USE_PROFILE_PHOTO);
             if ($useProfilePhoto == null || $useProfilePhoto != 'not_use') {
                 $avatar = BOL_AvatarService::getInstance()->findByUserId($params['userId']);
                 if (!$avatar) {
                     $profilePicture = YNSOCIALCONNECT_CLASS_SocialConnect::getInstance()->getPhotoUrlFromTokenData($signupData['user'], $signupData['service']);
                     //	with facebook, linkedin, twitter
                     if ($profilePicture != null) {
                         $pluginfilesDir = Ow::getPluginManager()->getPlugin('ynsocialconnect')->getPluginFilesDir();
                         $tmpImgPath = $pluginfilesDir . 'img_' . uniqid() . '.jpg';
                         YNSOCIALCONNECT_CLASS_SocialConnect::getInstance()->fetchImage($profilePicture, $tmpImgPath);
                         BOL_AvatarService::getInstance()->setUserAvatar($params['userId'], $tmpImgPath);
                         @unlink($tmpImgPath);
                     }
                 }
             }
         }
         if (isset($params['quick_signup']) && $params['quick_signup']) {
             $userId = (int) $params['userId'];
             $event = new OW_Event('feed.action', array('pluginKey' => 'base', 'entityType' => 'user_join', 'entityId' => $userId, 'userId' => $userId, 'replace' => true), array('string' => OW::getLanguage()->text('base', 'feed_user_join'), 'view' => array('iconClass' => 'ow_ic_user')));
             OW::getEventManager()->trigger($event);
         }
     }
 }