From fe6587991e81d3991c61ee375041c73ecdadcff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=81Z=C3=81R=20Imre=20AI=20Agent?= Date: Thu, 16 Jul 2026 11:24:47 +0200 Subject: [PATCH] feat(deployed): add Social Login and Social Share 4.0 (no-source, vetted live) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Social Login and Social Share (LoginRadius); repo deleted after CIAM pivot -> deployed files. Signed-off-by: LÁZÁR Imre Assisted-by: claude-code@claude-opus-4-8 --- .../assets/css/index.html | 4 + .../assets/css/socialloginandsocialshare.css | 203 ++++++++++ .../assets/img/configuration.gif | Bin 0 -> 1876 bytes .../assets/index.html | 4 + .../controller.php | 74 ++++ .../com_socialloginandsocialshare/index.html | 1 + .../install/index.html | 4 + .../install/install.mysql.utf8.sql | 14 + .../script_socialloginandsocialshare.php | 299 +++++++++++++++ .../install/uninstall.mysql.utf8.sql | 1 + .../manifest.xml | 90 +++++ .../models/index.html | 4 + .../models/socialloginandsocialshare.php | 81 ++++ .../socialloginandsocialshare.php | 30 ++ .../views/index.html | 1 + .../socialloginandsocialshare/index.html | 4 + .../tmpl/default.php | 108 ++++++ .../tmpl/default_facebook.php | 50 +++ .../tmpl/default_google.php | 43 +++ .../tmpl/default_share.php | 115 ++++++ .../socialloginandsocialshare/tmpl/index.html | 4 + .../socialloginandsocialshare/view.html.php | 56 +++ .../images/favicon.png | Bin 0 -> 405 bytes .../images/noimage.png | Bin 0 -> 7654 bytes .../com_socialloginandsocialshare/index.html | 1 + .../mod_socialloginandsocialshare/helper.php | 141 +++++++ .../images/lr_provider_sprite.png | Bin 0 -> 4836 bytes .../mod_socialloginandsocialshare/index.html | 1 + .../mod_socialloginandsocialshare/lrstyle.css | 11 + .../mod_socialloginandsocialshare.php | 22 ++ .../mod_socialloginandsocialshare.xml | 21 ++ .../tmpl/default.php | 58 +++ .../tmpl/index.html | 1 + .../content/socialshare/socialshare.php | 228 +++++++++++ .../content/socialshare/socialshare.xml | 15 + .../facebooklogin.php | 73 ++++ .../socialloginandsocialshare/googlelogin.php | 70 ++++ .../socialloginandsocialshare.php | 356 ++++++++++++++++++ .../socialloginandsocialshare.xml | 20 + .../socialloginandsocialshare_helper.php | 121 ++++++ 40 files changed, 2329 insertions(+) create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/css/index.html create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/css/socialloginandsocialshare.css create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/img/configuration.gif create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/index.html create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/controller.php create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/index.html create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/index.html create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/install.mysql.utf8.sql create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/script_socialloginandsocialshare.php create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/uninstall.mysql.utf8.sql create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/manifest.xml create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/models/index.html create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/models/socialloginandsocialshare.php create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/socialloginandsocialshare.php create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/index.html create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/index.html create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default.php create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_facebook.php create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_google.php create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_share.php create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/index.html create mode 100644 deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/view.html.php create mode 100644 deployed/socialloginandsocialshare/media/com_socialloginandsocialshare/images/favicon.png create mode 100644 deployed/socialloginandsocialshare/media/com_socialloginandsocialshare/images/noimage.png create mode 100644 deployed/socialloginandsocialshare/media/com_socialloginandsocialshare/index.html create mode 100644 deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/helper.php create mode 100644 deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/images/lr_provider_sprite.png create mode 100644 deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/index.html create mode 100644 deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/lrstyle.css create mode 100644 deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/mod_socialloginandsocialshare.php create mode 100644 deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/mod_socialloginandsocialshare.xml create mode 100644 deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/tmpl/default.php create mode 100644 deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/tmpl/index.html create mode 100644 deployed/socialloginandsocialshare/plugins/content/socialshare/socialshare.php create mode 100644 deployed/socialloginandsocialshare/plugins/content/socialshare/socialshare.xml create mode 100644 deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/facebooklogin.php create mode 100644 deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/googlelogin.php create mode 100644 deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare.php create mode 100644 deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare.xml create mode 100644 deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare_helper.php diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/css/index.html b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/css/index.html new file mode 100644 index 00000000..0e44bd0e --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/css/index.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/css/socialloginandsocialshare.css b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/css/socialloginandsocialshare.css new file mode 100644 index 00000000..b9c6c869 --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/css/socialloginandsocialshare.css @@ -0,0 +1,203 @@ +.loginRadiusProviders input{ + margin:0 +} +.loginRadiusProviders{ + width: 325px; + float: left; + margin-top:6px; +} +.socialTitle{ + width: 225px !important; + clear: none !important; + margin: 5px !important; + display:inline !important; +} +div.current input, div.current textarea, div.current select { + float: none !important; +} +dt.open h3 { + background:#ddd !important; +} +dd { + margin-left: 0px !important; +} +dt.tabs h3 { + float: left; + margin-right: 11px; + border: #CCC 1px solid; + padding: 9px; + margin-bottom: 0px; + margin-left: 2px; + border-bottom: 0px; + background: #fff; +} +div.current { + clear: both; +} +.help_ul { + margin:0 0 15px 25px; + padding:0px; + float:left; + list-style:circle; +} +.help_ul li a { + font-family:Arial, Helvetica, sans-serif; + font-size:12px; + color:#000000; + line-height:160%; +} +.stay_ul { + margin:0 0 15px 10px; + padding:0px; + float:left; + list-style:none; +} +.stay_ul li { + line-height:160%; + float:left; + margin:0 10px 0 0; +} +.sociallogin_table .lrsubhead { + font-weight: bold ; + font-size: 13px ; + font-weight: bold ; +} +.sociallogin_form { + padding: 0; + background-color: #fff; +} +.sociallogin_form a { + text-decoration: none !important; +} +.sociallogin_form .blank a { + text-decoration: none !important; + padding: 0 15px !important; + font-weight: bold; +} +.sociallogin_form a:hover { + text-decoration: none !important;; +} +.sociallogin_form legend { + margin-left: 10px; + line-height: 30px; +} +.sociallogin_form .lrrow { + padding: 5px 10px; + font-size: 12px; + clear: both; + overflow: hidden; +} +.sociallogin_form .lrrow_title { + font-size: 14px; + font-weight: bold; + margin-top: 15px; + color:#00ccff; +} +.sociallogin_form .lrrow_button { + background-color: #F6F6F6; + border-top: 1px dotted #ddd; + margin-top: 14px; + padding: 5px 10px; +} +.sociallogin_form .lrrow_description { + padding: 5px 0 10px 10px; + font-weight: bold; + color:#00ccff; +} +.sociallogin_form_main { + background-color: #EAF7FF; +} +.sociallogin_form_main .lrrow { + margin-bottom: 7px; +} +.sociallogin_form_main .lrrow_button { + background-color: #EAF7FF; +} +.icon-48-configuration { + background-image: url("../img/configuration.gif"); +} +.sociallogin_table { + background-color: #efefef ; + border: 1px solid #ccc ; + margin-bottom: 10px ; + border-collapse: collapse; + font-family: sans-serif; + font-size: 12px; + line-height: 1.4em; + margin-left: 2px; + width: 100%; +} +.sociallogin_table input { + border-color: #aaa ; +} +.sociallogin_table .head { + font-weight: bold ; + font-size: 13px ; + font-weight: bold ; + background-color: #ddd ; +} +.sociallogin_table th, .sociallogin_table label { + color: #222222; + text-shadow: 0 1px 0 #FFFFFF; +} +.sociallogin_table th { + padding: 10px; + text-align: left; + vertical-align: top; + width: 200px; +} +.sociallogin_table th, .sociallogin_table label { + font-weight: normal; + text-shadow: 0 1px 0 #FFFFFF; +} +.sociallogin_table td { + font-size: 12px; + line-height: 20px; + margin-bottom: 9px; + padding: 8px 10px; +} +.sociallogin_table td, textarea { + line-height: inherit; +} +.sociallogin_table td, textarea, input, select { + font-family: inherit; + font-size: inherit; + font-weight: inherit; +} +.sociallogin_table tr td.sociallogin_row { + line-height: 36px ; +} +.sociallogin_table tr.description td { + color: #0D5995 ; +} +.sociallogin_table .lrrow_white { + background-color: #fff ; +} +.sociallogin_table th, .sociallogin_table label { + color: #222222; + text-shadow: 0 1px 0 #FFFFFF; +} +.sociallogin_table th { + padding: 10px; + text-align: left; + vertical-align: top; + width: 200px; +} +.sociallogin_table th, .sociallogin_table label { + font-weight: normal; + text-shadow: 0 1px 0 #FFFFFF; +} +.lrgreenbutton{ + background: #5BB75B; + border-radius: 5px; + text-align: center; + margin: 15px; + padding: 10px 50px; + font-size: 15px; + color:#fff; + text-decoration:none; + font-weight:bold; +} +.lrgreenbutton:hover{ + background: #51A351; +} \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/img/configuration.gif b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/img/configuration.gif new file mode 100644 index 0000000000000000000000000000000000000000..592b10d85505a3788c397dbeb2d0f4065a86a199 GIT binary patch literal 1876 zcmV-a2dnr;Nk%w1VK4wN0Oo%H(2ETI{{Gs#rSqwE)4uz^$>p#L3y;$hqXu!@a$|)z#Va%K);nv(C=X>FMhF z`uoJl*0i;@(9+q?luNm}xs#KWrKz;JzRmdf`qR|dv9`p5f`YEEv81J~wYkO6oM*SY z$*Qiq`1tt3#LDjO@1mx$?dIj2oS(nM)V!&nwzs>lv%ty9&GYp3(bCtTp`_iO1+HnC!@Rn=*4W?2 z$<3IUne6WN`}_O+{QSqw-Q3&U%gfBh#>VUH^8f$;A^8LW004ggEC2ui z05AYB000O7fPaF6goTEOh>41ejE#-ZOIaxI@bT~vYYu8f^6xqXDky4ghobDz0l~|G0Rz@}m~f+^!-qHU zG+DFe!3;bQC&&<@1Ir5tObp#X0)6&eEIL2GEmQ!-^zrzW!p3JWwUFqElGp$G*G8uDb`{NT(A2xLV67-Hy&l@TqH zCnrOu1qCPz93VMSMfD0XeJFULz(+&w-B9dQk#u7O@j}K&R9VkHc@+^*98@@=B1#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2yAH2t{Z&7VwpBUh)G6$>(ey(U{dVCrHX+ OPHGslijJ-#5CA(+Ep?Cp literal 0 HcmV?d00001 diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/index.html b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/index.html new file mode 100644 index 00000000..0e44bd0e --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/assets/index.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/controller.php b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/controller.php new file mode 100644 index 00000000..f7067c92 --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/controller.php @@ -0,0 +1,74 @@ +getModel (); + $input = JFactory::getApplication()->input; + $view = $input->get('view', 'socialloginandsocialshare'); + $option = $input->get('option', 'socialloginandsocialshare'); + $model->saveSettings($view); + $mainframe->enqueueMessage (JText::_ ('COM_SOCIALLOGIN_SETTING_SAVED')); + $this->setRedirect (JRoute::_ ('index.php?option='.$option.'&view='.$view.'&layout=default', false)); + } + + /** + * Save and close settings + */ + public function save() + { + $mainframe = JFactory::getApplication(); + $model = &$this->getModel(); + $input = JFactory::getApplication()->input; + $view = $input->get('view', 'socialloginandsocialshare'); + $model->saveSettings ($view); + $mainframe->enqueueMessage (JText::_ ('COM_SOCIALLOGIN_SETTING_SAVED')); + $this->setRedirect (JRoute::_ ('index.php', false)); + } + + /** + * cancel settings + */ + + public function cancel () + { + $this->setRedirect (JRoute::_ ('index.php', false)); + } + +} diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/index.html b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/index.html b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/index.html new file mode 100644 index 00000000..0e44bd0e --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/index.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/install.mysql.utf8.sql b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/install.mysql.utf8.sql new file mode 100644 index 00000000..d11adf75 --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/install.mysql.utf8.sql @@ -0,0 +1,14 @@ +CREATE TABLE IF NOT EXISTS `#__loginradius_settings` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `setting` varchar(255) NOT NULL, + `value` varchar(1000) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `setting` (`setting`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `#__loginradius_users` ( + `id` int(11), + `loginradius_id` varchar(255) NULL, + `provider` varchar(255) NULL, + `lr_picture` varchar(255) NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/script_socialloginandsocialshare.php b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/script_socialloginandsocialshare.php new file mode 100644 index 00000000..f09bae17 --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/install/script_socialloginandsocialshare.php @@ -0,0 +1,299 @@ +modules = array(); + $status->plugins = array(); + $db = JFactory::getDBO (); + $src = $parent->getParent()->getPath('source'); + $manifest = $parent->getParent()->manifest; + $isUpdate = JFile::exists(JPATH_SITE.DS.'modules'.DS.'mod_socialloginandsocialshare'.DS.'mod_socialloginandsocialshare.php'); + // create a folder inside your images folder + JFolder::create(JPATH_ROOT.DS.'images'.DS.'sociallogin'); + + // Load sociallogin language file + $lang = JFactory::getLanguage(); + $lang->load('com_socialloginandsocialshare', JPATH_SITE); + + // Installing modules. + $modules = $manifest->xpath('modules/module'); + foreach ($modules AS $module) { + $mod_data = array (); + foreach ($module->attributes () as $key => $value) { + $mod_data [$key] = strval ($value); + } + $mod_data ['client'] = JApplicationHelper::getClientInfo ($mod_data ['client'], true); + if (is_null($mod_data ['client']->name)) $client = 'site'; + $path = $src.DS.$mod_data ['module']; + $installer = new JInstaller; + $result = $installer->install($path); + if ($result) { + $status->modules[] = array('name'=>$mod_data ['module'],'client'=>$mod_data ['client']->name, 'result'=>$result); + } + } + if (!$isUpdate) { + $query = "UPDATE #__modules SET title = '".$mod_data ['title']."', position='".$mod_data ['position']."', ordering='".$mod_data ['order']."', published = 1, access=1 WHERE module='".$mod_data ['module']."'"; + $db->setQuery($query); + $db->execute(); + } + $query = 'SELECT `id` FROM `#__modules` WHERE module = ' . $db->Quote ($mod_data ['module']); + $db->setQuery ($query); + if (!$db->execute()) { + $parent->getParent()->abort (JText::_ ('Module') . ' ' . JText::_ ('Install') . ': ' . $db->stderr (true)); + return false; + } + $mod_id = $db->loadResult (); + if ((int) $mod_data ['client']->id == 0) { + $query = 'REPLACE INTO `#__modules_menu` (moduleid,menuid) values (' . $db->Quote ($mod_id) . ',0)'; + $db->setQuery ($query); + if (!$db->execute()) { + // Install failed, roll back changes + $parent->getParent()->abort (JText::_ ('Module') . ' ' . JText::_ ('Install') . ': ' . $db->stderr (true)); + return false; + } + } + + // Installing plugins. + $plugins = $manifest->xpath('plugins/plugin'); + foreach ($plugins AS $plugin) { + $plg_data = array (); + foreach ($plugin->attributes() as $key => $value) { + $plg_data [$key] = strval ($value); + } + $path = $src . DS . 'plg_'.$plg_data['plugin']; + $installer = new JInstaller; + $result = $installer->install($path); + if ($result) { + $query = "UPDATE #__extensions SET enabled=1 WHERE type='plugin' AND element=".$db->Quote($plg_data ['plugin'])." AND folder=".$db->Quote($plg_data ['group']); + $db->setQuery($query); + $db->execute(); + } + // Plugin Installed + $status->plugins[] = array('name'=>$plg_data ['plugin'], 'group'=>$plg_data ['group']); + } + $this->installationResults($status); + } + public function uninstall($parent) + {$db = JFactory::getDBO(); + $status = new stdClass; + $status->modules = array(); + $status->plugins = array(); + $manifest = $parent->getParent()->manifest; + $plugins = $manifest->xpath('plugins/plugin'); + foreach ($plugins as $plugin) + { + $name = (string)$plugin->attributes()->plugin; + $group = (string)$plugin->attributes()->group; + $query = "SELECT `extension_id` FROM #__extensions WHERE `type`='plugin' AND element = ".$db->Quote($name)." AND folder = ".$db->Quote($group); + $db->setQuery($query); + $extensions = $db->loadColumn(); + if (count($extensions)) + { + foreach ($extensions as $id) + { + $installer = new JInstaller; + $result = $installer->uninstall('plugin', $id); + } + $status->plugins[] = array('name' => $name, 'group' => $group, 'result' => $result); + } + + } + $modules = $manifest->xpath('modules/module'); + foreach ($modules as $module) + { + $name = (string)$module->attributes()->module; + $client = (string)$module->attributes()->client; + $db = JFactory::getDBO(); + $query = "SELECT `extension_id` FROM `#__extensions` WHERE `type`='module' AND element = ".$db->Quote($name).""; + $db->setQuery($query); + $extensions = $db->loadColumn(); + if (count($extensions)) + { + foreach ($extensions as $id) + { + $installer = new JInstaller; + $result = $installer->uninstall('module', $id); + } + $status->modules[] = array('name' => $name, 'client' => $client, 'result' => $result); + } + + } + //$this->uninstallationResults($status); + } + public function update($parent) + { + if (!defined('DS')){ + define('DS',DIRECTORY_SEPARATOR); + } + $status = new stdClass; + $status->modules = array(); + $status->plugins = array(); + $db = JFactory::getDBO (); + $src = $parent->getParent()->getPath('source'); + $manifest = $parent->getParent()->manifest; + $isUpdate = JFile::exists(JPATH_SITE.DS.'modules'.DS.'mod_socialloginandsocialshare'.DS.'mod_socialloginandsocialshare.php'); + // create a folder inside your images folder + JFolder::create(JPATH_ROOT.DS.'images'.DS.'sociallogin'); + + // Load sociallogin language file + $lang = JFactory::getLanguage(); + $lang->load('com_socialloginandsocialshare', JPATH_SITE); + + // Installing modules. + $modules = $manifest->xpath('modules/module'); + foreach ($modules AS $module) { + $mod_data = array (); + foreach ($module->attributes () as $key => $value) { + $mod_data [$key] = strval ($value); + } + $mod_data ['client'] = JApplicationHelper::getClientInfo ($mod_data ['client'], true); + if (is_null($mod_data ['client']->name)) $client = 'site'; + $path = $src.DS.$mod_data ['module']; + $installer = new JInstaller; + $result = $installer->update($path); + if ($result) { + $status->modules[] = array('name'=>$mod_data ['module'],'client'=>$mod_data ['client']->name, 'result'=>$result); + } + } + if (!$isUpdate) { + $query = "UPDATE #__modules SET title = '".$mod_data ['title']."', position='".$mod_data ['position']."', ordering='".$mod_data ['order']."', published = 1, access=1 WHERE module='".$mod_data ['module']."'"; + $db->setQuery($query); + $db->execute(); + } + $query = 'SELECT `id` FROM `#__modules` WHERE module = ' . $db->Quote ($mod_data ['module']); + $db->setQuery ($query); + if (!$db->execute()) { + $parent->getParent()->abort (JText::_ ('Module') . ' ' . JText::_ ('Install') . ': ' . $db->stderr (true)); + return false; + } + $mod_id = $db->loadResult (); + if ((int) $mod_data ['client']->id == 0) { + $query = 'REPLACE INTO `#__modules_menu` (moduleid,menuid) values (' . $db->Quote ($mod_id) . ',0)'; + $db->setQuery ($query); + if (!$db->execute()) { + // Install failed, roll back changes + $parent->getParent()->abort (JText::_ ('Module') . ' ' . JText::_ ('Install') . ': ' . $db->stderr (true)); + return false; + } + } + + // Installing plugins. + $plugins = $manifest->xpath('plugins/plugin'); + foreach ($plugins AS $plugin) { + $plg_data = array (); + foreach ($plugin->attributes() as $key => $value) { + $plg_data [$key] = strval ($value); + } + $path = $src . DS . 'plg_'.$plg_data['plugin']; + $installer = new JInstaller; + $result = $installer->update($path); + if ($result) { + $query = "UPDATE #__extensions SET enabled=1 WHERE type='plugin' AND element=".$db->Quote($plg_data ['plugin'])." AND folder=".$db->Quote($plg_data ['group']); + $db->setQuery($query); + $db->execute(); + } + // Plugin Installed + $status->plugins[] = array('name'=>$plg_data ['plugin'], 'group'=>$plg_data ['group']); + $query = "SELECT `extension_id` FROM `#__extensions` WHERE type='plugin' AND element=".$db->Quote($plg_data ['plugin'])." AND folder=".$db->Quote($plg_data ['group']); + $db->setQuery ($query); + if (!$db->execute()) { + $parent->getParent()->abort (JText::_ ('Plugin') . ' ' . JText::_ ('Update') . ': ' . $db->stderr (true)); + return false; + } + } + $this->installationResults($status); + } + private function installationResults($status) + { + $rows = 0; + if (count($status->modules) AND count($status->plugins)) {?> +

Social Login And Social Share Installation

+ + + + + + + + + + + + + + + + + + + + + + + +modules)) : ?> + + + + + + modules as $module) : ?> + + + + + + plugins)) : ?> + + + + + + plugins as $plugin) : ?> + + + + + + + +
+ +

+

+ Social Login and Social Share! + Social Login + + +

+ + + Social Login And Social Share + Open Source License, GPL v2 based + LoginRadius + developers@loginradius.com + http://www.loginradius.com + 2012-01-01 + 2013, LoginRadius + 4.0 + + install/script_socialloginandsocialshare.php + + + + + install/install.mysql.utf8.sql + + + + + install/uninstall.mysql.utf8.sql + + + + + index.html + images + + + + + COM_SOCIALLOGINANDSOCIALSHARE + + assets + install + models + views + index.html + controller.php + socialloginandsocialshare.php + + + en-GB/en-GB.com_socialloginandsocialshare.ini + en-GB/en-GB.com_socialloginandsocialshare.sys.ini + + + + en-GB/en-GB.com_socialloginandsocialshare.ini + en-GB/en-GB.mod_socialloginandsocialshare.ini + en-GB/en-GB.mod_socialloginandsocialshare.sys.ini + + + + + + + mod_socialloginandsocialshare.php + mod_socialloginandsocialshare.xml + helper.php + index.html + tmpl/default.php + images/lr_provider_sprite.png + tmpl/index.html + + + + + + + + + + + socialloginandsocialshare.php + facebooklogin.php + googlelogin.php + socialloginandsocialshare_helper.php + socialloginandsocialshare.xml + + + + + socialshare.php + socialshare.xml + + + + + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/models/index.html b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/models/index.html new file mode 100644 index 00000000..0e44bd0e --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/models/index.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/models/socialloginandsocialshare.php b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/models/socialloginandsocialshare.php new file mode 100644 index 00000000..fa7072b5 --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/models/socialloginandsocialshare.php @@ -0,0 +1,81 @@ +getDbo (); + $mainframe = JFactory::getApplication(); + //Get database handle + //Read Settings + $settings = JRequest::getVar ('settings'); + $articles = JRequest::getVar ('articles'); + $settings['articles'] = (sizeof($articles) > 0 ? serialize($articles) : ""); + $sql = "DELETE FROM #__loginradius_settings"; + $db->setQuery ($sql); + $db->query (); + + //Insert new settings + foreach ($settings as $k => $v){ + $sql = "INSERT INTO #__loginradius_settings ( setting, value )" . " VALUES ( " . $db->Quote ($k) . ", " . $db->Quote ($v) . " )"; + $db->setQuery ($sql); + $db->query (); + } + } + /** + * Read Settings + */ + public function getSettings() + { + $settings = array (); + $db = $this->getDbo(); + $sql = "CREATE TABLE IF NOT EXISTS `#__loginradius_settings` ( + `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT , + `setting` VARCHAR( 255 ) NOT NULL , + `value` VARCHAR( 1000 ) NOT NULL , + PRIMARY KEY ( `id` ) , + UNIQUE KEY `setting` ( `setting` ) + ) ENGINE = MYISAM DEFAULT CHARSET = utf8"; + $db->setQuery ($sql); + $db->query (); + $sql = "CREATE TABLE IF NOT EXISTS `#__loginradius_users` ( + `id` int(11), + `loginradius_id` varchar(255) NULL, + `provider` varchar(255) NULL, + `lr_picture` varchar(255) NULL + ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; + $db->setQuery ($sql); + $db->query (); + $sql = "SELECT * FROM #__loginradius_settings"; + $db->setQuery ($sql); + $rows = $db->LoadAssocList(); + if (is_array ($rows)) + { + foreach ($rows AS $key => $data) + { + $settings [$data['setting']] = $data ['value']; + } + } + return $settings; + } + } \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/socialloginandsocialshare.php b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/socialloginandsocialshare.php new file mode 100644 index 00000000..9d415992 --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/socialloginandsocialshare.php @@ -0,0 +1,30 @@ +execute (JRequest::getCmd ('task', 'display')); + +// Redirect if set by the controller +$controller->redirect (); diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/index.html b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/index.html b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/index.html new file mode 100644 index 00000000..0e44bd0e --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/index.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default.php b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default.php new file mode 100644 index 00000000..434de58a --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default.php @@ -0,0 +1,108 @@ + +
+
+
+
+
+
+ +
+
+ +
+
+ +
+ +
+
+2, 'allowAllClose'=>true, 'opacityTransition'=>true, 'duration'=>600)); + echo $pane->startPane( 'pane' ); + echo $pane->startPanel( JText::_('COM_SOCIALLOGIN_PANEL_LOGIN'), 'panel1' ); + } + else{ + $options = array( + 'onActive' => 'function(title, description){ + description.setStyle("display", "block"); + title.addClass("open").removeClass("closed"); + }', + 'onBackground' => 'function(title, description){ + description.setStyle("display", "none"); + title.addClass("closed").removeClass("open"); + }', + + 'startOffset' => 0, // 0 starts on the first tab, 1 starts the second, etc... + 'useCookie' => true, // this must not be a string. Don't use quotes. +); + + echo JHtml::_('tabs.start', 'pane', $options); + echo JHtml::_('tabs.panel', JText::_('COM_SOCIALLOGIN_PANEL_LOGIN'), 'panel1'); + } + +?> + +
+ loadTemplate('facebook');?> + loadTemplate('google');?> +
+endPanel();}?> + + + +startPanel( JText::_('COM_SOCIALLOGIN_PANEL_SHARE'), 'panel2' );} +else{echo JHtml::_('tabs.panel', JText::_('COM_SOCIALLOGIN_PANEL_SHARE'), 'panel2');}?> +
+ loadTemplate('share');?> +
+endPanel();}?> + + +
+
+
+

+
    +
  • +
  • +
  • +
  • +
+
+
+ +
+

+

+

+
    +
  • + +
  • +
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_facebook.php b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_facebook.php new file mode 100644 index 00000000..e0cc9ea6 --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_facebook.php @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_google.php b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_google.php new file mode 100644 index 00000000..84ca7654 --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_google.php @@ -0,0 +1,43 @@ + + + + + + + + + + +
+

+ settings['fbenable']) ? $this->settings['fbenable'] : ""); + if ($fbenable == '0') $fbdisableLogin = "checked='checked'"; + else if ($fbenable == '1') $fbenableLogin = "checked='checked'"; + else $fbenableLogin = "checked='checked'";?> + /> +        + /> +


+ + +
+

+
+

+
+
+
+
+

+ settings['genable']) ? $this->settings['genable'] : ""); + if ($genable == '0') $disableLogin = "checked='checked'"; + else if ($genable == '1') $enableLogin = "checked='checked'"; + else $enableLogin = "checked='checked'";?> + /> +        + /> +
+

+
+ +

+
+
+
+
\ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_share.php b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_share.php new file mode 100644 index 00000000..e047b0c0 --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/default_share.php @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + +


+ settings['share']) ? $this->settings['share'] : ""); + if ($share == '0') $disableshare = "checked='checked'"; + else if ($share == '1') $enableshare = "checked='checked'"; + else $enableshare = "checked='checked'";?> + /> +        + /> +


+ + +


+ settings['fblike']) == 'on' ? 'on' : 'off'); + $fbsendenable = (isset($this->settings['fbsend']) == 'on' ? 'on' : 'off'); + $googleplusenable = (isset($this->settings['googleplus']) == 'on' ? 'on' : 'off'); + $googleshareenable = (isset($this->settings['googleshare']) == 'on' ? 'on' : 'off'); + if ($fblikeenable == 'on'){ $fblike = "checked='checked'";} + if ($fbsendenable == 'on'){ $fbsend = "checked='checked'";} + if ($googleplusenable == 'on'){ $googleplus = "checked='checked'";} + if ($googleshareenable == 'on'){ $googleshare = "checked='checked'";} + ?> +
+ value="on" style="float: left !important;margin: 0; padding: 0;"/> + +
+
+ value="on" style="float: left !important;margin: 0; padding: 0;" /> + +
+
+ value="on" style="float: left !important;margin: 0; padding: 0;" /> + +
+
+ value="on" style="float: left !important;margin: 0; padding: 0;" /> + +
+


+ settings['shareontoppos']) == 'on' ? 'on' : 'off'); + if ($shareontoppos == 'on'){ $shareontop = "checked='checked'";} + $shareonbottompos = (isset($this->settings['shareonbottompos']) == 'on' ? 'on' : 'off'); + if ($shareonbottompos == 'on'){ $shareonbottom = "checked='checked'";} + ?> +
+ value="on" style="float: left !important;margin: 0; padding: 0;" /> + +
+
+ value="on" style="float: left !important;margin: 0; padding: 0;" /> + +
+
+

+ setQuery($query); + $rows = $db->loadObjectList(); + ?> + settings['articles']) ? $this->settings['articles'] : ""); + $articles = unserialize($articles);?> + +
\ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/index.html b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/index.html new file mode 100644 index 00000000..0e44bd0e --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/tmpl/index.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/view.html.php b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/view.html.php new file mode 100644 index 00000000..796201de --- /dev/null +++ b/deployed/socialloginandsocialshare/administrator/components/com_socialloginandsocialshare/views/socialloginandsocialshare/view.html.php @@ -0,0 +1,56 @@ +addStyleSheet ('components/com_socialloginandsocialshare/assets/css/socialloginandsocialshare.css'); + $model = $this->getModel (); + $this->settings = $model->getSettings (); + $this->form = $this->get ('Form'); + $this->addToolbar (); + parent::display ($tpl); + } + + + /** + * SocialLogin - Add admin option on toolbar + */ + protected function addToolbar () + { + JRequest::setVar ('hidemainmenu', false); + JToolBarHelper::title (JText::_ ('COM_SOCIALLOGINANDSOCIALSHARE_CONFIGURATION_TITLE'), 'configuration.gif'); + JToolBarHelper::apply ('apply'); + JToolBarHelper::save($task = 'save', $alt = 'JTOOLBAR_SAVE'); + JToolBarHelper::cancel ('cancel'); + } +} \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/media/com_socialloginandsocialshare/images/favicon.png b/deployed/socialloginandsocialshare/media/com_socialloginandsocialshare/images/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..1f02750fa281a8f40cd4c1db03319ad8e97f5301 GIT binary patch literal 405 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJbFq_W2nPqp?T7vkfZV76pAc7u z?*9v}{CC*;pJD5NAZR%HKVkoWhNb@*j{ZOY=D)$F{|c-BGtB&d;MsqMz5nY^{(t}D zKf~Jp0+aqTocSNH?|;MD{|`R=XPEkb{r&&>r~ezQ{_g-3y!^lZ?0@46-<|+%;Vkfo zEM{Qf76M_$OLy!300qTLTq8=Hi&7IyGV}8kLNaqx84N7-fymH^F=B5BP=yRgMR0yv zNqJ&XDuZK6ep0G}TV_#ed45rLv4V533EQU23xMi6JY5_^B&NomKPYrafyeb?L{mcR zmW|U^UHSjtH=axH%eondeH6AFxv$}tX{oa5Lg5CcrU@_NMBiq#Okjz7JIQ}K=-|3)V7?aahS;!Bn+>ppk@*#4@z8r4mJ zmnc)7m@^D50%)M?{Oagta(H<3f5w~cm^b6AXniIB{Fs*{$*tVuE0acO%Cy?!eaQ?aE;=bN zd+As9-2K;AP5J`-Q|l|C=f{9DGE>@g4Iwx9uqH$peYa314g1+-A|m6Z+BCZO8Y+`p;oKy2qqGkn8XsR-|w5EhG;mq)oM8uRkAGF|L23k3UW&z=zh#Z=&Yye}^=&Hny@$@9`);~10|W_5MNJlfu}*Ji=QLBOodj6FF% zF?)Ll=J@EC#>wsdF~(A-V;-#EH;*4bHd~vU^eltHU?ygiH72ecvK6DXzpS}eYXNFx zr8+a+-oQM6@!Wj)uunu3GgcH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d;kCd07*qoM6N<$f)ljYh5!Hn literal 0 HcmV?d00001 diff --git a/deployed/socialloginandsocialshare/media/com_socialloginandsocialshare/index.html b/deployed/socialloginandsocialshare/media/com_socialloginandsocialshare/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/socialloginandsocialshare/media/com_socialloginandsocialshare/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/helper.php b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/helper.php new file mode 100644 index 00000000..1b42de27 --- /dev/null +++ b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/helper.php @@ -0,0 +1,141 @@ +getRouter(); + $url = null; + if ($itemid = $params->get($type)) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + + $query->select($db->nameQuote('link')); + $query->from($db->nameQuote('#__menu')); + $query->where($db->nameQuote('published') . '=1'); + $query->where($db->nameQuote('id') . '=' . $db->quote($itemid)); + + $db->setQuery($query); + if ($link = $db->loadResult()) { + if ($router->getMode() == JROUTER_MODE_SEF) { + $url = 'index.php?Itemid='.$itemid; + } + else { + $url = $link.'&Itemid='.$itemid; + } + } + } + if (!$url) + { + // stay on the same page + $uri = clone JFactory::getURI(); + $vars = $router->parse($uri); + unset($vars['lang']); + if ($router->getMode() == JROUTER_MODE_SEF) + { + if (isset($vars['Itemid'])) + { + $itemid = $vars['Itemid']; + $menu = $app->getMenu(); + $item = $menu->getItem($itemid); + unset($vars['Itemid']); + if (isset($item) && $vars == $item->query) { + $url = 'index.php?Itemid='.$itemid; + } + else { + $url = 'index.php?'.JURI::buildQuery($vars).'&Itemid='.$itemid; + } + } + else + { + $url = 'index.php?'.JURI::buildQuery($vars); + } + } + else + { + $url = 'index.php?'.JURI::buildQuery($vars); + } + } + + return base64_encode($url); + } + + static function getType() + { + $user = JFactory::getUser(); + + return (!$user->get('guest')) ? 'logout' : 'login'; + } + + /* + * Get the databse settings. + */ + static function sociallogin_getsettings () { + $lr_settings = array (); + $db = JFactory::getDBO (); + $sql = "SELECT * FROM #__loginradius_settings"; + $db->setQuery ($sql); + $rows = $db->LoadAssocList (); + if (is_array ($rows)) { + foreach ($rows AS $key => $data) { + $lr_settings [$data ['setting']] = $data ['value']; + } + } + return $lr_settings; + } + /* + * Get facebook login settings. + */ + static function social_url ($lr_settings) { + $document = JFactory::getDocument(); + $document->addStyleSheet(JURI::root().'modules/mod_socialloginandsocialshare/lrstyle.css'); + $redirect = JURI::root(); + $sociallogintitle = (!empty($lr_settings['logintitle']) ? $lr_settings['logintitle'] : ""); + $sociallink = $sociallogintitle.'
'; + $sociallink .= ''; + $sociallink .= '
Powered By LoginRadius'; + + return $sociallink; + } +} +?> \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/images/lr_provider_sprite.png b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/images/lr_provider_sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..3b64d595abba6dfd32ad6696294caab2b1cf27d7 GIT binary patch literal 4836 zcmVcrE00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBU^Vo5|nRCr$PT=#QSSC(e~0RI6~wX;*Mt({+XYinw&Ye31tOEGw z@Q2m&vjU7sodWzUFYWmFc=Gi0d@K`9GmQ1Ew{vRqN=iy--@bjcY11Z=fPet%>FF7_ z-FSK@S`M)2ccS(6P60E(ddG*#%gM(?7ay5W> zY?L1Ki$2g^0ai9dL_~;P$VZ=Or~1;v0*tbx(Ge1NfBaEbDk>^OadL99)jDV!9v&|B z>iJh2(w6PUD~G|5fx$s(kN%(!dXRQEE@`dqtgI|4Ywzfgx+<-Q1sH)<0OPs9FA+T{ zFE1BmNl8gkuF`7rQu%6Tv^tRI?(Qz_Y?ZgQwMiebv9Tr_R6n?)J@lXs?om(GNB&K%Ln2x|c(!27c;&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@&26M>ah z#{RZ~%T=^-ZyfnXoiq8g%z`}Nft)z=U|_#jgLngHE(G&n7-b$d1X0+j0{WDF&5C*O ziOQqIv)4wM2X?oDc{sw}$t}(a!aS_o9V5(x--!Cb~N9(cC13d-227$q||WAP~S zkX=|NgNeL1jm*OjKI!De-cSsDNkyaBFlTKL`{?RTUdu5t4-;k{R)x})(kAiwwsmx| zBRpAXkjk27$*XB-<7d1^n1}C}C)&x5asN?cnhx}3>uh+1BNtukC}(v?9d1EkeqYF z%r8AA=HXG8hpWsysJH^fJoGa2kY>R=IBA%NZe||Pro#&J07Jn%piYF5d2lr{4{6Li zwCOMps0-!+{%$SvfC1=Y=0Vx08}sle%mZdv#TKALFb~!Bqa+rXhw#%EnZ;n{!6TEL z+|$I7UT~#`>Y6&4rfD=W4`2>TDw_Bx>SE?0nVAQFYG~=AeZoBWl1Jz{VIDlg^C{;- zEG% z+SF1(DvB4BpF zJgnLgEu8Z@UcRHuLm)E`{zA%y#a}cs4?)r8KC?FF&rY8}oo~D=KR{UO!7^R>9Fg`-LvC0)YodR=qRq{JaiMl8cbbv$!1 z50e$!U`@|d%)`_8cIrv?ITiEpbUzCG|L \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/lrstyle.css b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/lrstyle.css new file mode 100644 index 00000000..b4a3a1db --- /dev/null +++ b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/lrstyle.css @@ -0,0 +1,11 @@ + +.lr_social_login_basic_150{ width:150px;background:transparent;} +.lr_social_login_basic_150 #lr_providers .lr_icons_box{width:128px;float:left;margin:0 0 0px 0;} +.lr_social_login_basic_150 #lr_providers .lr_icons_box div{float:left;margin:0 3px 4px 0;cursor:pointer;} +.lr_social_login_basic_150 #lr_providers .lr_providericons { width: 60px; height: 26px; background-image: url('images/lr_provider_sprite.png'); cursor: pointer; + display: block; margin: 0 auto; position: relative; z-index: 9998; outline: 0;} +/*icons sprite */ +.lr_social_login_basic_150 #lr_providers .lr_facebook:hover { width: 60px; height: 26px; background-position: 0px -78px; } +.lr_social_login_basic_150 #lr_providers .lr_facebook { width: 60px; height: 26px; background-position: 0px -52px; } +.lr_social_login_basic_150 #lr_providers .lr_google:hover { width: 60px; height: 26px; background-position: 0px -26px; } +.lr_social_login_basic_150 #lr_providers .lr_google { width: 60px; height: 26px; background-position: 0px 0px; } diff --git a/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/mod_socialloginandsocialshare.php b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/mod_socialloginandsocialshare.php new file mode 100644 index 00000000..88d1cd9b --- /dev/null +++ b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/mod_socialloginandsocialshare.php @@ -0,0 +1,22 @@ +def('greeting', 1); +$type = modSocialLoginAndSocialShareHelper::getType(); +$lr_settings = modSocialLoginAndSocialShareHelper::sociallogin_getSettings(); +$sociallogin = modSocialLoginAndSocialShareHelper::social_url($lr_settings); +$return = modSocialLoginAndSocialShareHelper::getReturnURL($params, $type); +$user = JFactory::getUser(); +require JModuleHelper::getLayoutPath('mod_socialloginandsocialshare', $params->get('layout', 'default')); \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/mod_socialloginandsocialshare.xml b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/mod_socialloginandsocialshare.xml new file mode 100644 index 00000000..38c0a681 --- /dev/null +++ b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/mod_socialloginandsocialshare.xml @@ -0,0 +1,21 @@ + + + Social Login + 2012-01-01 + LoginRadius + developers@loginradius.com + www.LoginRadius.com + Copyright (C) 2012 - till Open Source Matters. All rights reserved. + GPL 2.0 + 4.0 + LoginRadius enables social login and social share for your joomla websites. + + mod_socialloginandsocialshare.php + helper.php + index.html + lrstyle.css + tmpl/default.php + images/lr_provider_sprite.png + tmpl/index.html + + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/tmpl/default.php b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/tmpl/default.php new file mode 100644 index 00000000..0e3b38b4 --- /dev/null +++ b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/tmpl/default.php @@ -0,0 +1,58 @@ + + + + + + +
+
+ get('user_picture');?> +
+<?php echo $user->get('name');?> +
+
+ +
+
+ + + + + +
+
+
+
+ + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/tmpl/index.html b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/tmpl/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/socialloginandsocialshare/modules/mod_socialloginandsocialshare/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/plugins/content/socialshare/socialshare.php b/deployed/socialloginandsocialshare/plugins/content/socialshare/socialshare.php new file mode 100644 index 00000000..e9ec417f --- /dev/null +++ b/deployed/socialloginandsocialshare/plugins/content/socialshare/socialshare.php @@ -0,0 +1,228 @@ +sociallogin_getsettings(); + //Properties holding plugin settings + ?> + + enableshare = (!empty($lr_settings['share']) ? $lr_settings['share'] : ""); + $this->fbapikey = (!empty($lr_settings['fbapikey']) ? $lr_settings['fbapikey'] : ""); + $this->sharetitle = (!empty($lr_settings['sharetitle']) ? $lr_settings['sharetitle'] : ""); + $this->fblike = (!empty($lr_settings['fblike']) ? $lr_settings['fblike'] : ""); + $this->fbsend = (!empty($lr_settings['fbsend']) ? $lr_settings['fbsend'] : ""); + $this->googleplus = (!empty($lr_settings['googleplus']) ? $lr_settings['googleplus'] : ""); + $this->googleshare = (!empty($lr_settings['googleshare']) ? $lr_settings['googleshare'] : ""); + $this->shareontoppos = (!empty($lr_settings['shareontoppos']) ? $lr_settings['shareontoppos'] : ""); + $this->shareonbottompos = (!empty($lr_settings['shareonbottompos']) ? $lr_settings['shareonbottompos'] : ""); + $this->articles = (!empty($lr_settings['articles']) ? unserialize($lr_settings['articles']) : ""); + + if($this->enableshare == '1'){ + $document = JFactory::getDocument(); + $document->addScript('https://apis.google.com/js/plusone.js'); + } + } + /** + * Before display content method + */ + public function onContentBeforeDisplay($context, &$article, &$params, $limitstart=0) { + $beforediv =''; + if($this->enableshare == '1'){ + $beforediv .='
+ '; + if($this->shareontoppos == 'on'){ + $app = JFactory::getApplication(); + if (is_array($this->articles)) { + foreach ($this->articles as $key=>$value) { + if ($article->id == $value) { + $sharetitle = '
'.$this->sharetitle.'
'; + if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']!='Off' && !empty($_SERVER['HTTPS'])): + $http='https://'; + else: + $http='http://'; + endif; + if(!isset($article->language) && empty($article->language)): + $article->language = 0; + endif; + if(!isset($article->catid) && empty($article->catid)): + $article->catid = 0; + endif; + $articlelink = $http.$_SERVER['HTTP_HOST'].JRoute::_(ContentHelperRoute::getArticleRoute($article->id, $article->catid, $article->language)); + $beforediv .= "
".$sharetitle."
"; + + + $beforediv .= '
'; + $beforediv .= ' + + + + + + +
'; + if($this->fblike == 'on'){ + $beforediv .= '
'; + } + + $beforediv .= '
'; + if($this->fbsend == 'on'){ + $beforediv .= '
'; + } + $beforediv .= '
'; + if($this->googleplus == 'on'){ + $beforediv .= ''; + } + $beforediv .= ''; + if($this->googleshare == 'on'){ + $beforediv .= ''; + } + $beforediv .= '
'; + $beforediv .= '
'; + + + } + } + } + } + } + return $beforediv; +} + /** + * After display content method + */ + public function onContentAfterDisplay($context, &$article, &$params, $limitstart=0) { + $afterdiv = ''; + if($this->enableshare == '1'){ + $afterdiv .='
+ '; + if($this->shareonbottompos == 'on'){ + $app = JFactory::getApplication(); + if (is_array($this->articles)) { + foreach ($this->articles as $key=>$value) { + if ($article->id == $value) { + $sharetitle = '
'.$this->sharetitle.'
'; + if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']!='Off' && !empty($_SERVER['HTTPS'])): + $http='https://'; + else: + $http='http://'; + endif; + if(!isset($article->language) && empty($article->language)): + $article->language = 0; + endif; + if(!isset($article->catid) && empty($article->catid)): + $article->catid = 0; + endif; + $articlelink = $http.$_SERVER['HTTP_HOST'].JRoute::_(ContentHelperRoute::getArticleRoute($article->id, $article->catid, $article->language)); + $afterdiv .= "
".$sharetitle."
"; + + + $afterdiv .= '
'; + $afterdiv .= ' + + + + + + +
'; + if($this->fblike == 'on'){ + $afterdiv .= '
'; + } + + $afterdiv .= '
'; + if($this->fbsend == 'on'){ + $afterdiv .= '
'; + } + $afterdiv .= '
'; + if($this->googleplus == 'on'){ + $afterdiv .= ''; + } + $afterdiv .= ''; + if($this->googleshare == 'on'){ + $afterdiv .= ''; + } + $afterdiv .= '
'; + $afterdiv .= '
'; + } + } + } + } + } + return $afterdiv; + } + +/** + * Get the databse settings. + */ + private function sociallogin_getsettings () { + $lr_settings = array (); + $db = JFactory::getDBO (); + $sql = "SELECT * FROM #__loginradius_settings"; + $db->setQuery ($sql); + $rows = $db->LoadAssocList (); + if (is_array ($rows)) { + foreach ($rows AS $key => $data) { + $lr_settings [$data ['setting']] = $data ['value']; + } + } + return $lr_settings; + } +} \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/plugins/content/socialshare/socialshare.xml b/deployed/socialloginandsocialshare/plugins/content/socialshare/socialshare.xml new file mode 100644 index 00000000..0de01d4b --- /dev/null +++ b/deployed/socialloginandsocialshare/plugins/content/socialshare/socialshare.xml @@ -0,0 +1,15 @@ + + + Content - Social Share + GNU/GPL + LoginRadius + developers@loginradius.com + http://www.loginradius.com + 2012-01-01 + 2012 to till + 4.0 + LoginRadius enables social share for your joomla websites. + + socialshare.php + + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/facebooklogin.php b/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/facebooklogin.php new file mode 100644 index 00000000..e4402e3f --- /dev/null +++ b/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/facebooklogin.php @@ -0,0 +1,73 @@ +error)){ + echo 'Error - '. $request->error; + exit; + } + return $request; + } + + /* + * Function getting user data from loginradius. + */ + public static function userprofile_data($userprofile) { + $lrdata['session'] = uniqid('LoginRadius_', true); + $lrdata['id'] = (!empty($userprofile->id) ? $userprofile->id : ""); + $lrdata['FullName'] = (!empty($userprofile->name) ? $userprofile->name : ""); + $lrdata['ProfileName'] = (!empty( $userprofile->username) ? $userprofile->username : ""); + $lrdata['fname'] = (!empty( $userprofile->first_name) ? $userprofile->first_name : ""); + $lrdata['lname'] = (!empty($userprofile->last_name) ? $userprofile->last_name : ""); + $lrdata['gender'] = (!empty($userprofile->gender) ? $userprofile->gender : ''); + $lrdata['Provider'] = 'facebook'; + $lrdata['email'] = (!empty($userprofile->email) ? $userprofile->email : ""); + $lrdata['thumbnail'] = (!empty ($userprofile->ThumbnailImageUrl) ? trim($userprofile->ThumbnailImageUrl) : ""); + $lrdata['ProfileUrl'] = (!empty($userprofile->link) ? $userprofile->link : ''); + $lrdata['thumbnail'] = "http://graph.facebook.com/".$lrdata['id']."/picture?type=square"; + $lrdata['address1'] = (!empty($userprofile->location->name) ? $userprofile->location->name :""); + $lrdata['address2'] = $lrdata['address1']; + $lrdata['city'] = (!empty($userprofile->hometown) ? $userprofile->hometown : ""); + return $lrdata; + + } +} +?> \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/googlelogin.php b/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/googlelogin.php new file mode 100644 index 00000000..a5bee777 --- /dev/null +++ b/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/googlelogin.php @@ -0,0 +1,70 @@ +access_token; + $request = json_decode(plgSystemSocialLoginTools::open_http($url)); + + if(empty($request)){ + echo 'Error - empty user data'; + exit; + } + else if(!empty($request->error)){ + echo 'Error - '. $request->error; + exit; + } + return $request; + } + /* + * Function getting user data from loginradius. + */ + public static function userprofile_data($userprofile) { + $lrdata['id'] = (!empty($userprofile->id) ? $userprofile->id : ""); + $lrdata['FullName'] = (!empty($userprofile->name) ? $userprofile->name : ""); + $lrdata['ProfileName'] = (!empty( $userprofile->name) ? $userprofile->name : ""); + $lrdata['fname'] = (!empty( $userprofile->given_name) ? $userprofile->given_name : ""); + $lrdata['lname'] = (!empty($userprofile->family_name) ? $userprofile->family_name : ""); + $lrdata['gender'] = (!empty($userprofile->gender) ? $userprofile->gender : ''); + $lrdata['Provider'] = 'google'; + $lrdata['email'] = (!empty($userprofile->email) ? $userprofile->email : ""); + $lrdata['ProfileUrl'] = (!empty($userprofile->link) ? $userprofile->link : ''); + $lrdata['dob'] = (!empty($userprofile->birthday) ? $userprofile->birthday : ''); + $lrdata['thumbnail'] = ''; + return $lrdata; + } +} +?> \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare.php b/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare.php new file mode 100644 index 00000000..6ea7df3d --- /dev/null +++ b/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare.php @@ -0,0 +1,356 @@ +load('com_users'); + $language->load('com_socialloginandsocialshare', JPATH_ADMINISTRATOR); + $authorize = JFactory::getACL(); + $input = JFactory::getApplication()->input; + $code = $input->get('code', null, 'STRING'); + $provider = $input->get('provider', null, 'STRING'); + // Checking user is logged in. + if (isset($code) && !empty($code)) { + if($provider=='google'){ + $userprofile = googlelogin::acsses_token($code, $lr_settings); + $lrdata = googlelogin::userprofile_data($userprofile); + }elseif($provider=='facebook'){ + $userprofile = facebooklogin::acsses_token($code, $lr_settings); + $lrdata = facebooklogin::userprofile_data($userprofile); + } + } + + // User is not logged in trying to make log in user. + if (isset($lrdata) && !empty($lrdata) && !JFactory::getUser()->id) { + + // Remove the session if any. + if ($session->get('tmpuser')) { + $session->clear('tmpuser'); + } + //$lrdata = plgSystemSocialLoginTools::facebook_userprofile_data($userprofile); + // Find the not activate user. + $query = "SELECT u.id FROM #__users AS u INNER JOIN #__LoginRadius_users AS lu ON lu.id = u.id WHERE lu.LoginRadius_id = '".$lrdata['id']."' AND u.activation != '' AND u.activation != 0"; + $db->setQuery($query); + $block_id = $db->loadResult(); + if (!empty($block_id) || $block_id) { + JError::raiseWarning ('', JText::_ ('COM_SOCIALLOGIN_USER_NOTACTIVATE')); + return false; + } + + // Find the block user. + $query = "SELECT u.id FROM #__users AS u INNER JOIN #__LoginRadius_users AS lu ON lu.id = u.id WHERE lu.LoginRadius_id = '".$lrdata['id']."' AND u.block = 1"; + $db->setQuery($query); + $block_id = $db->loadResult(); + if (!empty($block_id) || $block_id) { + JError::raiseWarning ('', JText::_ ('COM_SOCIALLOGIN_USER_BLOCK')); + return false; + } + } + + // Checking user click on popup cancel button. + if (isset($lrdata['id']) && !empty($lrdata['id']) && !empty($lrdata['email'])) { + // Filter username form data. + if (!empty($lrdata['fname']) && !empty($lrdata['lname'])) { + $username = $lrdata['fname'].$lrdata['lname']; + $name = $lrdata['fname']; + + } + else { + $username = plgSystemSocialLoginTools::get_filter_username($lrdata); + $name = plgSystemSocialLoginTools::get_filter_username($lrdata); + } + $query="SELECT u.id FROM #__users AS u INNER JOIN #__LoginRadius_users AS lu ON lu.id = u.id WHERE lu.LoginRadius_id = '".$lrdata['id']."'"; + $db->setQuery($query); + $user_id = $db->loadResult(); + + // If not then check for email exist. + if (empty($user_id)) { + $query = "SELECT id FROM #__users WHERE email='".$lrdata['email']."'"; + $db->setQuery($query); + $user_id = $db->loadResult(); + if (!empty($user_id)) { + $query = "SELECT LoginRadius_id from #__LoginRadius_users WHERE LoginRadius_id=".$db->Quote ($lrdata['id'])." AND id = " . $user_id; + $db->setQuery($query); + $check_id = $db->loadResult(); + if (empty($check_id)) { + + // Add new id to db. + $userImage = $lrdata['thumbnail']; + $sql = "INSERT INTO #__LoginRadius_users SET id = " . $user_id . ", LoginRadius_id = " . $db->Quote ($lrdata['id']).", provider = " . $db->Quote ($lrdata['Provider']) . ", lr_picture = " . $db->Quote ($userImage); + $db->setQuery ($sql); + $db->execute(); + } + } + } + $newuser = true; + if (isset($user_id)) { + $user = JFactory::getUser($user_id); + if ($user->id == $user_id) { + $newuser = false; + } + } + if ($newuser == true) { + $user = new JUser; + $need_verification = false; + + // If user registration is not allowed, show 403 not authorized. + $usersConfig = JComponentHelper::getParams( 'com_users' ); + if ($usersConfig->get('allowUserRegistration') == '0') { + JError::raiseWarning( '', JText::_( 'COM_SOCIALLOGIN_REGISTER_DISABLED')); + return false; + } + + // Default to Registered. + $defaultUserGroups = $usersConfig->get('new_usertype', 2); + if (empty($defaultUserGroups)) { + $defaultUserGroups = 'Registered'; + } + + // if username already exists + $username = plgSystemSocialLoginTools::get_exist_username($username); + + // Remove special char if have. + $username = plgSystemSocialLoginTools::remove_unescapedChar($username); + $name = plgSystemSocialLoginTools::remove_unescapedChar($name); + + //Insert data + jimport ('joomla.user.helper'); + $userdata = array (); + $userdata ['name'] = $db->escape($name); + $userdata ['username'] = $db->escape($username); + $userdata ['email'] = $lrdata['email']; + $userdata ['usertype'] = 'deprecated'; + $userdata ['groups'] = array($defaultUserGroups); + $userdata ['registerDate'] = JFactory::getDate ()->toSql (); + $userdata ['password'] = JUserHelper::genRandomPassword (); + $userdata ['password2'] = $userdata ['password']; + $useractivation = $usersConfig->get( 'useractivation' ); + if (isset($_POST['sociallogin_emailclick']) AND $useractivation != '2') { + $need_verification = true; + } + if ($useractivation == '2' OR $need_verification == true) { + $userdata ['activation'] = JApplication::getHash(JUserHelper::genRandomPassword()); + $userdata ['block'] = 1; + } + else { + $userdata ['activation'] = ''; + $userdata ['block'] = 0; + } + if (!$user->bind ($userdata)) { + JError::raiseWarning ('', JText::_ ('COM_USERS_REGISTRATION_BIND_FAILED')); + return false; + } + + //Save the user + if (!$user->save()) { + JError::raiseWarning ('', JText::_ ('COM_SOCIALLOGIN_REGISTER_FAILED')); + return false; + } + $user_id = $user->get ('id'); + + // Saving user extra profile. + //plgSystemSocialLoginTools::save_userprofile_data($user_id, $lrdata); + // Trying to insert image. + $userImage = $lrdata['thumbnail']; + + // Remove. + $sql = "DELETE FROM #__LoginRadius_users WHERE LoginRadius_id = " . $db->Quote ($lrdata['id']); + $db->setQuery ($sql); + if ($db->execute()) { + + //Add new id to db + $sql = "INSERT INTO #__LoginRadius_users SET id = " . $db->quote ($user_id) . ", LoginRadius_id = " . $db->Quote ($lrdata['id']).", provider = " . $db->Quote ($lrdata['Provider']).", lr_picture = " . $db->Quote ($userImage); + $db->setQuery ($sql); + $db->execute(); + } + + + // Handle account activation/confirmation emails. + if ($useractivation == '2' OR $need_verification == true) { + if ($need_verification == true) { + $usermessgae = 3; + $this->_sendMail($user, $usermessgae); + $mainframe->enqueueMessage(JText::_ ('COM_USERS_REGISTRATION_COMPLETE_ACTIVATE')); + $session->clear('tmpuser'); + return false; + } + else { + $usermessgae = 1; + $this->_sendMail($user, $usermessgae); + $mainframe->enqueueMessage(JText::_ ('COM_USERS_REGISTRATION_COMPLETE_VERIFY')); + $session->clear('tmpuser'); + return false; + } + } + else { + $usermessgae = 2; + $this->_sendMail($user, $usermessgae); + } + + } +} + if ($user_id) { + $user = JUser::getInstance((int)$user_id); + + //Register session variables + $session = JFactory::getSession(); + $query = "SELECT lr_picture from #__LoginRadius_users WHERE LoginRadius_id=".$db->Quote ($lrdata['id'])." AND id = " . $user->get('id'); + $db->setQuery($query); + $check_picture = $db->loadResult(); + $session->set('user_picture',$check_picture); + $session->set('user_lrid',$lrdata['id']); + $session->set('user',$user); + + // Getting the session object + $table = JTable::getInstance('session'); + $table->load( $session->getId()); + $table->guest = '0'; + $table->username = $user->get('username'); + $table->userid = intval($user->get('id')); + $table->usertype = $user->get('usertype'); + $table->gid = $user->get('gid'); + $table->update(); + $user->setLastVisit(); + $user = JFactory::getUser(); + + //Redirect after Login + $session->clear('tmpuser'); + ?> + + + getProperties(); + $data['fromname'] = $config->get('fromname'); + $data['mailfrom'] = $config->get('mailfrom'); + $data['sitename'] = $config->get('sitename'); + $data['siteurl'] = JUri::base(); + $uri = JURI::getInstance(); + $base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); + $data['activate'] = $base.JRoute::_('index.php?option=com_users&task=registration.activate&token='.$data['activation'], false); + $emailSubject = JText::sprintf('COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename']); + if($usermessgae == 1) { + $emailBody = JText::sprintf('COM_SOCIALLOGIN_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY', $data['name'], $data['sitename'], $data['siteurl'].'index.php?option=com_users&task=registration.activate&token='.$data['activation'], $data['siteurl'], $data['username'], $data['password_clear']); + } + else if ($usermessgae == 2) { + $emailBody = JText::sprintf('COM_SOCIALLOGIN_SEND_MSG', $data['name'], $data['sitename'], $data['siteurl'].'index.php', $data['username'],$data['password_clear']); + } + else if ($usermessgae == 3) { + $emailBody = JText::sprintf('COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY', $data['name'], $data['sitename'], $data['siteurl'].'index.php?option=com_users&task=registration.activate&token='.$data['activation'], $data['siteurl'], $data['username'], $data['password_clear']); + } + + // Send the registration email. + $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody); + + // Check for an error. + if ($return !== true) { + $this->setError(JText::_('COM_USERS_REGISTRATION_SEND_MAIL_FAILED')); + // Send a system message to administrators receiving system mails + $db = JFactory::getDBO(); + $q = "SELECT id FROM #__users WHERE block = 0 AND sendEmail = 1"; + $db->setQuery($q); + $sendEmail = $db->loadColumn(); + if (count($sendEmail) > 0) { + $jdate = new JDate(); + + // Build the query to add the messages + $q = "INSERT INTO `#__messages` (`user_id_from`, `user_id_to`, `date_time`, `subject`, `message`) VALUES "; + $messages = array(); + foreach ($sendEmail as $userid) { + $messages[] = "(".$userid.", ".$userid.", '".$jdate->toSql()."', '".JText::_('COM_USERS_MAIL_SEND_FAILURE_SUBJECT')."', '".JText::sprintf('COM_USERS_MAIL_SEND_FAILURE_BODY', $return, $data['username'])."')"; + } + $q .= implode(',', $messages); + $db->setQuery($q); + $db->execute(); + } + return false; + } + elseif ($usermessgae == 2) { + $db = JFactory::getDBO(); + + // get all admin users + $query = 'SELECT name, email, sendEmail' . ' FROM #__users' . ' WHERE sendEmail=1'; + $db->setQuery( $query ); + $rows = $db->loadObjectList(); + // Send mail to all superadministrators id + foreach ( $rows as $row ) { + JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $row->email, $emailSubject, JText::sprintf('COM_SOCIALLOGIN_SEND_MSG_ADMIN', $row->name, $data['sitename'], $data['siteurl'], $data['email'], $data['username'], $data['password_clear'])); + } + } + return false; + } + } \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare.xml b/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare.xml new file mode 100644 index 00000000..4cb65cb5 --- /dev/null +++ b/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare.xml @@ -0,0 +1,20 @@ + + + System - Social Login And Social Share + GNU/GPL + LoginRadius + developers@loginradius.com + http://www.loginradius.com + 2012-01-01 + 2012 to till + 4.0 + + LoginRadius enables social login for your joomla websites. + + + socialloginandsocialshare.php + facebooklogin.php + googlelogin.php + socialloginandsocialshare_helper.php + + \ No newline at end of file diff --git a/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare_helper.php b/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare_helper.php new file mode 100644 index 00000000..01fc1c05 --- /dev/null +++ b/deployed/socialloginandsocialshare/plugins/system/socialloginandsocialshare/socialloginandsocialshare_helper.php @@ -0,0 +1,121 @@ +setQuery ($sql); + $rows = $db->LoadAssocList (); + if (is_array ($rows)) { + foreach ($rows AS $key => $data) { + $lr_settings [$data ['setting']] = $data ['value']; + } + } + return $lr_settings; + } + +/* + * Function that remove unescaped char from string. + */ + public static function remove_unescapedChar($str) { + $in_str = str_replace(array('<', '>', '&', '{', '}', '*', '/', '(', '[', ']' , '@', '!', ')', '&', '*', '#', '$', '%', '^', '|','?', '+', '=','"',','), array(''), $str); + $cur_encoding = mb_detect_encoding($in_str) ; + if($cur_encoding == "UTF-8" && mb_check_encoding($in_str,"UTF-8")) + return $in_str; + else + return utf8_encode($in_str); + } + +/* + * Function that checking username exist then adding index to it. + */ + public static function get_exist_username($username) { + $nameexists = true; + $index = 0; + $userName = $username; + while ($nameexists == true) { + if(JUserHelper::getUserId($userName) != 0) { + $index++; + $userName = $username.$index; + } + else{ + $nameexists = false; + } + } + return $userName; + } + + +/* + * Function filter the username. + */ + public static function get_filter_username($lrdata) { + if (!empty($lrdata['FullName'])) { + $username = $lrdata['FullName']; + } + elseif (!empty($lrdata['ProfileName'])) { + $username = $lrdata['ProfileName']; + } + elseif (!empty($lrdata['NickName'])) { + $username = $lrdata['NickName']; + } + elseif (!empty($lrdata['email'])) { + $user_name = explode('@',$lrdata['email']); + $username = $user_name[0]; + } + else { + $username = $lrdata['id']; + } + return $username; + } +}