Exemplo n.º 1
0
 public static function emailUsers($emailData)
 {
     //$mail 	= JMail::getInstance();
     $mailer = JFactory::getMailer();
     $myparams = JComponentHelper::getParams('com_fbconnct');
     $mainframe = JFactory::getApplication();
     $usermailbody = $myparams->get('usermailbody', '');
     $adminmailbody = $myparams->get('adminmailbody', '');
     $usermailsubject = $myparams->get('usermailsubject', 'Your Registration Details at {sitename}');
     $adminmailsubject = $myparams->get('adminmailsubject', 'New Account Details for {fullname}');
     $adminhemails = $myparams->get('admin-email-to-notify');
     // Email
     $mailfrom = $mainframe->getCfg('mailfrom');
     $fromname = $mainframe->getCfg('fromname');
     $sitename = $mainframe->getCfg('sitename');
     $UserSubject = JText::sprintf(JText::_('COM_FBCONNCT_EMAILSUBJECT'), $sitename);
     $MailBodyArray = array('{fullname}' => $emailData['name'], '{br}' => '<br />', '{sitename}' => $sitename, '{siteurl}' => JURI::base(), '{username}' => $emailData['username'], '{password}' => $emailData['temp_pass'], '{profileid}' => $emailData['fbid']);
     $UserBody = fbconnctController::mail_body_phraser($usermailbody, $MailBodyArray);
     $AdminBody = fbconnctController::mail_body_phraser($adminmailbody, $MailBodyArray);
     $userMailSub = fbconnctController::mail_body_phraser($usermailsubject, $MailBodyArray);
     $adminMailSub = fbconnctController::mail_body_phraser($adminmailsubject, $MailBodyArray);
     $adminEmails = explode(',', $adminhemails);
     $sender = array($mailfrom, $fromname);
     $mailer->setSender($sender);
     // to all admins
     if ($adminEmails) {
         $mailer->addRecipient($adminEmails);
         $mailer->setSubject($adminMailSub);
         $mailer->setBody($AdminBody);
         $send = $mailer->Send();
         if ($send !== true) {
             echo '<div style="color:red;margin:5px">Error sending email: ' . $send->__toString() . '</div>';
         }
     }
     //to user
     $mailer->addRecipient($emailData['email']);
     $mailer->setSubject($userMailSub);
     $mailer->setBody($UserBody);
     $send = $mailer->Send();
     if ($send !== true) {
         echo '<div style="color:red;margin:5px">Error sending email: ' . $send->__toString() . '</div>';
     }
     //end email
 }
Exemplo n.º 2
0
//.fbconnct_btn:hover{background: url('.JRoute::_(JURI::base().'modules/mod_fbconnct/assets/Small_103x25.png').') no-repeat 0px -26px;}
$stylelink .= '</style>';
if ($type == 'logout') {
    $logoutUrl = JRoute::_('index.php?task=logout&option=com_fbconnct&return=' . base64_encode(JURI::current()));
    $query = "SELECT facebook_userid FROM #__facebook_joomla_connect WHERE joomla_userid={$user->id} AND linked=1";
    $db->setQuery($query);
    $rows = $db->loadObjectList();
    if ($rows && $showfacebookimage != 'none') {
        $fbuserid = strlen($rows[0]->facebook_userid) > 0 ? $rows[0]->facebook_userid : 0;
        echo '<div class="fb_profile_pic_wrp"><img class="fb_profile_pic" src="https://graph.facebook.com/' . $fbuserid . '/picture?type=' . $showfacebookimage . '" border="0" /></div>';
    }
    echo '<div class="fb_welcome_text_wrp"><strong>' . $user->name . ' [<a href="' . $logoutUrl . '">' . JText::_('MOD_FBCONNCT_LOG_OUT') . '</a>]</strong></div>';
} else {
    if ($params->get('show-login-form') == 1) {
        ########## J6 login Form #########
        if (fbconnctController::isJ16()) {
            echo '<form action="' . JRoute::_('index.php', true, $params->get('usesecure')) . '" method="post" id="login-form" >';
            if ($params->get('pretext')) {
                echo '<div class="pretext">' . $params->get('pretext') . '</div>';
            }
            echo '<fieldset class="userdata"><p id="form-login-username"><label for="modlgn-username">' . JText::_('MOD_FBCONNCT_USERNAME') . '</label>';
            echo '<input id="modlgn-username" type="text" name="username" class="inputbox"  size="18" /></p>';
            echo '<p id="form-login-password"><label for="modlgn-passwd">' . JText::_('MOD_FBCONNCT_PASSWORD') . '</label>';
            echo '<input id="modlgn-passwd" type="password" name="password" class="inputbox" size="18"  /></p>';
            if (JPluginHelper::isEnabled('system', 'remember')) {
                echo '<p id="form-login-remember"><label for="modlgn-remember">' . JText::_('MOD_FBCONNCT_REMEMBER_ME') . '</label>';
                echo '<input id="modlgn-remember" type="checkbox" name="remember" class="inputbox" value="yes"/></p>';
            }
            echo '<input type="submit" name="Submit" class="button" value="' . JText::_('MOD_FBCONNCT_LOGIN') . '" />';
            echo '<input type="hidden" name="option" value="com_cvnusers" />';
            echo '<input type="hidden" name="task" value="user.login" />';
Exemplo n.º 3
0
 public static function emailUsers($emailData)
 {
     $myparams = JComponentHelper::getParams('com_fbconnct');
     if (fbconnctController::isJ16()) {
         $mainframe = JFactory::getApplication();
         $usermailbody = $myparams->getValue('data.params.usermailbody', '');
         $adminmailbody = $myparams->getValue('data.params.adminmailbody', '');
         $usermailsubject = $myparams->getValue('data.params.usermailsubject', 'Your Registration Details at {sitename}');
         $adminmailsubject = $myparams->getValue('data.params.adminmailsubject', 'New Account Details for {fullname}');
         $adminhemails = $myparams->getValue('data.params.admin-email-to-notify');
     } else {
         global $mainframe;
         $usermailbody = $myparams->get('usermailbody', 'Dear {fullname}{br}Thank You for Registering using Facebook Connect at {sitename} {br}You can login using facebook connect button at {siteurl}, however if you wish to login manually, you can use your username and Temp password provided below.{br}Keep this email safe and reset your password as soon as possible! {br}{br}Username : {username}{br}Password : {password}{br}{br}Regards{br}{sitename}{br}{siteurl}');
         $adminmailbody = $myparams->get('adminmailbody', '{fullname} is registered at {sitename} with username {username}, his/her facebook profile is : http://www.facebook.com/profile.php?id={profileid}');
         $usermailsubject = $myparams->get('usermailsubject', 'Your Registration Details at {sitename}');
         $adminmailsubject = $myparams->get('adminmailsubject', 'New Account Details for {fullname}');
         $adminhemails = $myparams->get('admin-email-to-notify');
     }
     // Email
     $mailfrom = $mainframe->getCfg('mailfrom');
     $fromname = $mainframe->getCfg('fromname');
     $sitename = $mainframe->getCfg('sitename');
     $UserSubject = JText::sprintf(JText::_('COM_FBCONNCT_EMAILSUBJECT'), $sitename);
     $MailBodyArray = array('{fullname}' => $emailData['name'], '{br}' => '<br />', '{sitename}' => $sitename, '{siteurl}' => JURI::base(), '{username}' => $emailData['username'], '{password}' => $emailData['temp_pass'], '{profileid}' => $emailData['fbid']);
     $UserBody = fbconnctController::mail_body_phraser($usermailbody, $MailBodyArray);
     $AdminBody = fbconnctController::mail_body_phraser($adminmailbody, $MailBodyArray);
     $userMailSub = fbconnctController::mail_body_phraser($usermailsubject, $MailBodyArray);
     $adminMailSub = fbconnctController::mail_body_phraser($adminmailsubject, $MailBodyArray);
     $adminEmails = explode(',', $adminhemails);
     // to all admins
     if ($adminEmails) {
         foreach ($adminEmails as $adminEmail) {
             JUtility::sendMail($mailfrom, $fromname, $adminEmail, $adminMailSub, $AdminBody, true);
         }
     }
     //to user
     JUtility::sendMail($mailfrom, $fromname, $emailData['email'], $userMailSub, $UserBody, true);
     //end email
 }
Exemplo n.º 4
0
<?php

/**
* @package 		Facebook Connect Extension (joomla 3.x)
* @copyright	Copyright (C) Computer - http://www.sanwebe.com. All rights reserved.
* @license		http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @author		Saran Chamling
* @download URL	http://www.sanwebe.com
*/
defined('_JEXEC') or die('Restricted access');
// Require the base controller
require_once JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'controller.php';
// check curl before we move in
if (!fbconnctController::iscurlinstalled()) {
    $mainframe =& JFactory::getApplication();
    $mainframe->enqueueMessage(JText::_('Facebook Connect requires Curl PHP Extension!'), 'error');
    $mainframe->redirect(JURI::base());
}
if (!class_exists('FacebookApiException')) {
    require_once JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'facebook.php';
}
$controller = JControllerLegacy::getInstance('fbconnct');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();