Ejemplo n.º 1
0
 function resend_password()
 {
     $this->loadTicket();
     FSS_Settings::set('support_email_on_create', 1);
     FSS_EMail::User_Create_Unreg($this->ticket, $this->ticket->title, JText::_('RESENDING_TICKET_PASSWORD'));
     $link = FSSRoute::_("index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=" . $this->ticket->id, false);
     JFactory::getApplication()->redirect($link, JText::_("PASSWORD_FOR_TICKET_HAS_BEEN_RESENT_TO_THE_USER"));
     return false;
 }
Ejemplo n.º 2
0
 function sortCaptchaType()
 {
     if ($this->admin_create > 0) {
         FSS_Settings::set('support_captcha_type', 'none');
     }
     $capset = FSS_Settings::get('support_captcha_type');
     if (substr($capset, 0, 3) == "ur-") {
         if (JFactory::getUser()->id == 0) {
             $capset = substr($capset, 3);
         } else {
             $capset = "";
         }
         FSS_Settings::set('support_captcha_type', $capset);
     }
 }
Ejemplo n.º 3
0
 function Send()
 {
     $emails = $this->getAllTo();
     // limit to max 15 email target addresses
     if (count($emails) > 15) {
         $emails = array_slice($emails, 0, 15);
     }
     if (strpos($this->body, "{login_code}") !== false) {
         FSS_Settings::set('email_send_multiple', "multi");
     }
     if (FSS_Settings::Get('email_send_multiple') == "to" || FSS_Settings::Get('email_send_multiple') == "bcc") {
         $mailer = $this->getMailer();
         $mailer->isHTML($this->ishtml);
         $mailer->setSubject($this->subject);
         $mailer->setBody($this->body);
         foreach ($emails as $email => $name) {
             if (trim($email) == "") {
                 continue;
             }
             if (FSS_Settings::Get('email_send_multiple') == "bcc") {
                 $mailer->addBCC(array($email));
             } else {
                 $mailer->addRecipient(array($email));
             }
         }
         foreach ($this->files as $filename => $display) {
             $mailer->addAttachment($display, $filename);
         }
         $this->debug_data['mailer'] = $mailer;
         //SupportActions::DoAction("beforeEMailSend", $this->debug_data['Ticket'], $this->debug_data);
         unset($this->debug_data['mailer']);
         $mailer->Send();
     } else {
         foreach ($emails as $email => $name) {
             if (trim($email) == "") {
                 continue;
             }
             $mailer = $this->getMailer();
             $mailer->isHTML($this->ishtml);
             $body = $this->body;
             // strip and replace login code if its in the email
             if (strpos($body, "{login_code}") !== false) {
                 // lookup user_id from email
                 $db = JFactory::getDBO();
                 $sql = "SELECT id FROM #__users WHERE email = '" . $db->escape($email) . "'";
                 $db->setQuery($sql);
                 $user_id = $db->loadResult();
                 if ($user_id > 1) {
                     $body = str_replace("{login_code}", FSS_Helper::AutoLoginCreate($user_id), $body);
                 } else {
                     $body = str_replace("{login_code}", "", $body);
                 }
             }
             $mailer->setSubject($this->subject);
             $mailer->setBody($body);
             $mailer->addRecipient(array($email));
             foreach ($this->files as $filename => $display) {
                 $mailer->addAttachment($filename, $display);
             }
             $this->debug_data['mailer'] = $mailer;
             //SupportActions::DoAction("beforeEMailSend", $this->debug_data['Ticket'], $this->debug_data);
             unset($this->debug_data['mailer']);
             $mailer->Send();
         }
     }
     $this->doLog();
 }
Ejemplo n.º 4
0
 function testdates()
 {
     // test the 4 date formats
     $date = time();
     $result = array();
     $offset = (int) JRequest::GetVar('offset');
     FSS_Settings::set('timezone_offset', $offset);
     $date_dt_short = JRequest::GetVar('date_dt_short');
     if ($date_dt_short == "") {
         $date_dt_short = JText::_('DATE_FORMAT_LC4') . ', H:i';
     }
     $result['date_dt_short'] = $this->testdate($date, $date_dt_short);
     $date_dt_long = JRequest::GetVar('date_dt_long');
     if ($date_dt_long == "") {
         $date_dt_long = JText::_('DATE_FORMAT_LC3') . ', H:i';
     }
     $result['date_dt_long'] = $this->testdate($date, $date_dt_long);
     $date_d_short = JRequest::GetVar('date_d_short');
     if ($date_d_short == "") {
         $date_d_short = JText::_('DATE_FORMAT_LC4');
     }
     $result['date_d_short'] = $this->testdate($date, $date_d_short);
     $date_d_long = JRequest::GetVar('date_d_long');
     if ($date_d_long == "") {
         $date_d_long = JText::_('DATE_FORMAT_LC3');
     }
     $result['date_d_long'] = $this->testdate($date, $date_d_long);
     $result['timezone_offset'] = $this->testdate($date, 'Y-m-d H:i:s');
     echo json_encode($result);
     exit;
 }