Пример #1
0
 function writeLogs($list, $log_simple, $log_detailed)
 {
     global $database;
     if ($GLOBALS[ACA . 'send_log_simple']) {
         $send = $log_simple;
     } else {
         $send = $log_detailed;
     }
     if (lisType::sendLogs($list->list_type)) {
         $database->setQuery("SELECT * FROM `#__users` WHERE `gid` = 25 LIMIT 1");
         $database->loadObject($admin);
         if ($GLOBALS[ACA . 'send_log'] == 1) {
             $owner = subscribers::getSubscriberIdFromUserId($list->owner, false);
             if (!empty($owner->email)) {
                 mosMail($admin->email, $admin->username, $owner->email, 'Acajoom mailing report', $send);
             } else {
                 mosMail($admin->email, $admin->username, $admin->email, 'Acajoom mailing report', $send);
             }
         } else {
             if ($GLOBALS[ACA . 'send_log_closed'] == 1 && connection_aborted()) {
                 if (!empty($owner->email)) {
                     mosMail($admin->email, $admin->username, $owner->email, 'Acajoom mailing report', $send);
                 } else {
                     mosMail($admin->email, $admin->username, $admin->email, 'Acajoom mailing report', $send);
                 }
             }
         }
     }
     if ($GLOBALS[ACA . 'save_log']) {
         if ($GLOBALS[ACA . 'save_log_simple']) {
             @file_put_contents($GLOBALS['mosConfig_absolute_path'] . $GLOBALS[ACA . 'save_log_file'], $log_simple, FILE_APPEND);
         } else {
             @file_put_contents($GLOBALS['mosConfig_absolute_path'] . $GLOBALS[ACA . 'save_log_file'], $log_detailed, FILE_APPEND);
         }
     }
 }
Пример #2
0
 function writeLogs($list, $log_simple, $log_detailed)
 {
     if (ACA_CMSTYPE) {
         $database =& JFactory::getDBO();
     } else {
         global $database;
     }
     //endif
     if ($GLOBALS[ACA . 'send_log_simple']) {
         $send = $log_simple;
     } else {
         $send = $log_detailed;
     }
     if (lisType::sendLogs($list->list_type)) {
         $database->setQuery("SELECT * FROM `#__users` WHERE `gid` = 25 LIMIT 1");
         if (ACA_CMSTYPE) {
             // joomla 15
             $admin = $database->loadObject();
             $owner = subscribers::getSubscriberInfoFromUserId($list->owner);
             if ($GLOBALS[ACA . 'send_log'] == 1) {
                 if (!empty($owner->email)) {
                     JUTility::sendMail($admin->email, $admin->username, $owner->email, 'Acajoom mailing report', $send);
                 } else {
                     JUTility::sendMail($admin->email, $admin->username, $admin->email, 'Acajoom mailing report', $send);
                 }
             } else {
                 if ($GLOBALS[ACA . 'send_log_closed'] == 1 && connection_aborted()) {
                     if (!empty($owner->email)) {
                         JUTility::sendMail($admin->email, $admin->username, $owner->email, 'Acajoom mailing report', $send);
                     } else {
                         JUTility::sendMail($admin->email, $admin->username, $admin->email, 'Acajoom mailing report', $send);
                     }
                 }
             }
         } else {
             //joomla 1x
             $database->loadObject($admin);
             $owner = subscribers::getSubscriberInfoFromUserId($list->owner);
             if ($GLOBALS[ACA . 'send_log'] == 1) {
                 if (!empty($owner->email)) {
                     mosMail($admin->email, $admin->username, $owner->email, 'Acajoom mailing report', $send);
                 } else {
                     mosMail($admin->email, $admin->username, $admin->email, 'Acajoom mailing report', $send);
                 }
             } else {
                 if ($GLOBALS[ACA . 'send_log_closed'] == 1 && connection_aborted()) {
                     if (!empty($owner->email)) {
                         mosMail($admin->email, $admin->username, $owner->email, 'Acajoom mailing report', $send);
                     } else {
                         mosMail($admin->email, $admin->username, $admin->email, 'Acajoom mailing report', $send);
                     }
                 }
             }
         }
         //endif
     }
     if ($GLOBALS[ACA . 'save_log']) {
         if ($GLOBALS[ACA . 'save_log_simple']) {
             @file_put_contents(ACA_JPATH_ROOT_NO_ADMIN . $GLOBALS[ACA . 'save_log_file'], $log_simple, FILE_APPEND);
         } else {
             @file_put_contents(ACA_JPATH_ROOT_NO_ADMIN . $GLOBALS[ACA . 'save_log_file'], $log_detailed, FILE_APPEND);
         }
     }
 }