Example #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);
         }
     }
 }
 function updateOneSubscriber($userId = 0, $user = null, $confirmed = '0')
 {
     $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
     $oneSubscriber = '';
     $oneSubscriber->name = mosGetParam($_REQUEST, 'name', '');
     $oneSubscriber->receive_html = intval(mosGetParam($_REQUEST, 'receive_html', 0));
     $oneSubscriber->confirmed = intval(mosGetParam($_REQUEST, 'confirmed', 0));
     $oneSubscriber->blacklist = mosGetParam($_REQUEST, 'blacklist', 0);
     $oneSubscriber->timezone = mosGetParam($_REQUEST, 'timezone', '');
     $oneSubscriber->language_iso = mosGetParam($_REQUEST, 'language_iso', '');
     $oneSubscriber->params = mosGetParam($_REQUEST, 'params', '');
     $oneSubscriber->email = mosGetParam($_REQUEST, 'email', '');
     if (isset($user)) {
         $oneSubscriber->email = $user->email;
         if (empty($oneSubscriber->email) or !subscribers::validEmail($oneSubscriber->email)) {
             echo '<br />' . acajoom::printM('red', _ACA_EMAIL_INVALID);
             echo "<script> alert('" . addslashes(_ACA_EMAIL_INVALID) . "'); window.history.go(-1);</script>\n";
             return false;
         }
         $oneSubscriber->user_id = $user->id;
         $oneSubscriber->id = subscribers::getSubscriberIdFromUserId($user->id);
         $subscriberId = $oneSubscriber->id;
         if (!empty($user->name)) {
             $oneSubscriber->name = $user->name;
         }
         if ($oneSubscriber->confirmed or $confirmed) {
             $oneSubscriber->confirmed = 1;
         }
         if (isset($user->receive_html)) {
             $oneSubscriber->receive_html = $user->receive_html;
         }
     } elseif ($userId != 0) {
         $oneSubscriber->user_id = $userId;
         $subscriberId = subscribers::getSubscriberIdFromUserId($userId);
         $oneSubscriber->id = $subscriberId;
     } else {
         $oneSubscriber->user_id = mosGetParam($_REQUEST, 'id', '');
         $subscriberId = intval(mosGetParam($_REQUEST, 'subscriber_id', 0));
         $oneSubscriber->id = $subscriberId;
     }
     $dontParse[] = 'params';
     acajoom::objectHTMLSafe($oneSubscriber, ENT_QUOTES, $dontParse);
     $erro->ck = subscribers::updateSubscriber($oneSubscriber, $subscriberId);
     $erro->Eck(__LINE__, '8635');
     if ($erro->ck) {
         $erro->ck = queue::updateOneSuscription($subscriberId);
         $erro->Eck(__LINE__, '8636');
     }
     return $erro->R();
 }
Example #3
0
if ($subscriberId > 0 && !empty($cle) && $userId < 1) {
    if (subscribers::checkValidKey($subscriberId, $cle)) {
        $userId = $subscriberId;
        $validated = true;
    } else {
        echo acajoom::printM('red', _NOT_AUTH);
        $subscriberId = 0;
    }
}
global $mainframe;
$mainframe->addCustomHeadTag('<link rel="stylesheet" href="components/com_acajoom/css/acajoom.css" type="text/css" >');
$d['subscriberId'] = $subscriberId;
$d['cle'] = $cle;
if ($userId > 0 && empty($cle)) {
    $validated = true;
    $subscriberId = subscribers::getSubscriberIdFromUserId($userId);
}
$showPanel = false;
echo '<!--  Beginning : ' . acajoom::version() . '   -->' . "\n\r";
switch ($action) {
    case 'confirm':
        $message = acajoom::printYN(frontend::confirmRegistration($d), _ACA_ACCOUNT_CONFIRMED, _ACA_VERIFY_INFO);
        $showPanel = true;
        if (!empty($GLOBALS[ACA . 'redirectconfirm'])) {
            compa::redirect($GLOBALS[ACA . 'redirectconfirm'], $message);
        }
        break;
    case 'sublist':
        frontEnd::showSubscriberLists($subscriberId, 'subscribeAll');
        break;
    case 'mailing':
Example #4
0
 function userDeleted($user, $success)
 {
     require_once ACA_JPATH_ROOT_NO_ADMIN . '/administrator/components/com_acajoom/classes/class.acajoom.php';
     $erro = new xerr(__FILE__, __FUNCTION__);
     if (!empty($user->user_id)) {
         $subscriberId = subscribers::getSubscriberIdFromUserId($user->user_id);
         if (!empty($subscriberId)) {
             subscribers::deleteOneSubscriber($subscriberId);
         }
     }
     $erro->ck = subscribers::updateSubscribers();
     $erro->Eck(__LINE__, '7009');
     return true;
 }