uawdijnntqw1x1x1
IP : 216.73.216.168
Hostname : server.fattispazio.it
Kernel : Linux server.fattispazio.it 3.10.0-1160.144.1.el7.tuxcare.els4.x86_64 #1 SMP Tue Apr 7 08:40:40 UTC 2026 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
poliximo
/
public_html
/
4690b
/
..
/
home_
/
cache
/
..
/
plugins
/
system
/
rsmail_rsformpro_subscription.php
/
/
<?php // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin' ); $lang = &JFactory::getLanguage(); $lang->load('com_rsmail',JPATH_ADMINISTRATOR); $lang->load('com_rsmail',JPATH_SITE); class plgSystemRsmail_RSFormPro_Subscription extends JPlugin { function plgSystemRsmail_RSFormPro_Subscription( &$subject, $config ) { $db =& JFactory::getDBO(); parent::__construct( $subject, $config ); //Call the parent constructor $this->_plugin =& JPluginHelper::getPlugin( 'system', 'rsmail_rsformpro_subscription' ); //Get a reference to this plugin $this->loadLanguage( 'com_rsmail',JPATH_ADMINISTRATOR ); // Load the language file $this->_params = new JParameter( $this->_plugin->params ); //Get the plugin parameters } function rsfp_bk_onInit() { global $RSadapter; $RSadapter->config['component_ids'][] = 25; } function rsfp_f_onAfterStoreSubmissions($args) { $this->loadLanguage( 'com_rsmail',JPATH_ADMINISTRATOR ); $this->loadLanguage( 'com_rsmail',JPATH_SITE ); $db =& JFactory::getDBO(); $user = JFactory::getUser(); $userid = $user->id; $db->setQuery("SELECT IdList , params FROM #__rsmail_integrations WHERE IntegrationType = 'rsfp' "); $details = $db->loadObjectList(); foreach($details as $detail) { $reg =& JRegistry::getInstance(''); $reg->loadINI($detail->params); $params = $reg->toObject(); $params2 = $reg->toArray(); $db->setQuery("SELECT * FROM `#__rsmail_config`"); $rsmailConfigDb = $db->loadObjectList(); $rsmailConfig = array(); foreach ($rsmailConfigDb as $rowConfig) $rsmailConfig[$rowConfig->ConfigName] = $rowConfig->ConfigValue; if($params->formId == $args['formId']) { //get the submission details $db->setQuery("SELECT FieldName , FieldValue FROM #__rsform_submission_values WHERE FormId = ".$args['formId']." AND SubmissionId = ".$args['SubmissionId']); $submissions = $db->loadObjectList(); $result = array(); foreach($submissions as $submission) $result[$submission->FieldName] = $submission->FieldValue; //get the email address $elements = array_flip($params2); $emailElement = $elements['RSM_EMAIL']; $email = $result[$emailElement]; if(isset($result['RSMail_component'])) { $db->setQuery("SELECT COUNT(IdSubscriber) FROM #__rsmail_subscribers WHERE IdList = ".$detail->IdList." AND SubscriberEmail = '".$email."'"); $alreadySubscribed = $db->loadResult(); if ($alreadySubscribed == 0) { //set the status of the subscriber $published = 0; $published = ($rsmailConfig['confirm_email'] == 0) ? 1 : 0; //lets add the subscriber into RSMail! $db->setQuery("INSERT INTO #__rsmail_subscribers SET SubscriberEmail = '".$db->getEscaped($email)."' , IdList = ".$detail->IdList." , DateSubscribed = ".time()." , UserId = ".$userid." , SubscriberIp = '".$_SERVER['REMOTE_ADDR']."' , published = ".$published); $db->query(); $subscriberId = $db->insertid(); foreach($params as $prop => $param) { if($param == JText::_('RSM_IGNORE')) continue; if($param == JText::_('RSM_EMAIL')) continue; if($prop == 'formId') continue; $db->setQuery("INSERT INTO #__rsmail_subscriber_details SET IdSubscriber = ".$subscriberId." , IdList = ".$detail->IdList." , FieldName = '".$param."' , FieldValue = '".$result[$prop]."' "); $db->query(); } //send the confirmation email if($published == 0) { $db->setQuery("SELECT ListName FROM #__rsmail_lists WHERE IdList = ".$detail->IdList); $listName = $db->loadResult(); $to = $email; $from = $rsmailConfig['confirm_from']; $fromName = $rsmailConfig['confirm_fromname']; $subject = $rsmailConfig['confirm_subject']; $type = $rsmailConfig['confirm_type']; $message = $rsmailConfig['confirm_text']; $secret = md5($detail->IdList.$subscriberId.$db->getEscaped($email)); $secretLink = '<a href="'.JURI::root().'index.php?option=com_rsmail&task=activate&secret='.$secret.'">'.JText::_('RSM_CLICK_TO_ACTIVATE').'</a>'; $bad = array('{newsletter}','{email}','{activationlink}'); $good = array($listName,$to,$secretLink); $subject = str_replace($bad,$good,$subject); $message = str_replace($bad,$good,$message); JUtility::sendMail($from ,$fromName, $to, $subject, $message, $type); } } } } } } function rsfp_bk_onAfterShowComponents() { global $mainframe; $db = JFactory::getDBO(); $formId = intval(JRequest::getVar('formId')); $link = ''; if($this->rsfp_containsComponents($formId,array(25))) { $db->setQuery("SELECT ComponentId FROM #__rsform_components WHERE ComponentTypeId = 25"); $link = ",'".$db->loadResult()."'"; } ?> <strong><?php echo JText::_('RSFP_RSMAIL_COMPONENT');?></strong> <a href="#" onclick="displayTemplate('25'<?php echo $link;?>);return false;" class="component" id="check"> <?php echo JText::_('RSFP_RSMAIL_LABEL');?> </a><div title="componentEdit" id="componentEdit25" class="componentEdit"></div> <?php } function rsfp_bk_onBeforeCreateFrontComponentBody($args) { $this->loadLanguage( 'com_rsmail',JPATH_ADMINISTRATOR ); $this->loadLanguage( 'com_rsmail',JPATH_SITE ); } function createSubscribeOption() { return '1|'.JText::_('RSM_SUBSCRIBE_NAME'); } function rsfp_containsComponents($formId, $components) { global $RSadapter; $db = JFactory::getDBO(); $db->setQuery("SELECT count(*) CNT FROM #__rsform_components WHERE FormId='".$formId."' AND ComponentTypeId IN (".implode(',',$components).")"); return $db->loadResult(); } }
/home/poliximo/public_html/4690b/../home_/cache/../plugins/system/rsmail_rsformpro_subscription.php