Ejemplo n.º 1
0
function GetMonitorPath()
{
    return GetFeedwebUrl() . "MR/Monitor.aspx?lang=" . GetDefaultLanguage() . "&bac=" . GetBac(true) . "&client=WP:" . GetPluginVersion();
}
Ejemplo n.º 2
0
function ComputeSpamCheck($IdMess)
{
    $Mes = LoadRow("select * from messages where id=" . $IdMess);
    if (isset($Mes->id)) {
        $CheckerComment = $Mes->CheckerComment;
        // Case NeverCheckSendMail
        if (HasFlag("NeverCheckSendMail", "", $Mes->IdSender)) {
            $Status = 'ToSend';
            $SpamInfo = "NotSpam";
            $CheckerComment .= "Sent by member with NeverCheckSendMail \n";
            $str = "update messages set Status='" . $Status . "',CheckerComment='" . $CheckerComment . "',SpamInfo='" . $SpamInfo . "' where id=" . $Mes->id . " and Status!='Sent'";
            sql_query($str);
            LogStr("NeverCheckSendMail for message #" . $IdMess . " from <b>" . fUsername($Mes->IdSender) . "</b> to <b>" . fUsername($Mes->IdReceiver) . "</b>", "AutoSpamCheck");
            return $Status;
        }
        // Test what the Spam mark should be
        $SpamInfo = "NotSpam";
        // By default its not a Spam
        $tt = explode(";", wwinlang("MessageBlackWord", 0));
        $max = count($tt);
        for ($ii = 0; $ii < $max; $ii++) {
            if (strstr($Mes->Message, $tt[$ii]) != "" and $tt[$ii] != "") {
                $SpamInfo = "SpamBlkWord";
                $CheckerComment .= "Has BlackWord <b>" . $tt[$ii] . "</b>\n";
            }
        }
        $tt = explode(";", wwinlang("MessageBlackWord", GetDefaultLanguage($Mes->IdSender)));
        $max = count($tt);
        for ($ii = 0; $ii < $max; $ii++) {
            if (strstr($Mes->Message, $tt[$ii]) != "" and $tt[$ii] != "") {
                $SpamInfo = "SpamBlkWord";
                $CheckerComment .= "Has BlackWord (in sender language)<b>" . $tt[$ii] . "</b>\n";
            }
        }
        // End of Test what the Spam mark should be
        // Case AlwayCheckSendMail
        if (HasFlag("AlwayCheckSendMail", "", $Mes->IdSender)) {
            $Status = 'ToCheck';
            $CheckerComment .= "Sent by member with AlwayCheckSendMail \n";
            $str = "update messages set Status='" . $Status . "',CheckerComment='" . $CheckerComment . "',SpamInfo='" . $SpamInfo . "' where id=" . $Mes->id . " and Status!='Sent'";
            sql_query($str);
            LogStr("AlwayCheckSendMail for message #" . $IdMess . " from <b>" . fUsername($Mes->IdSender) . "</b> to <b>" . fUsername($Mes->IdReceiver) . "</b>", "AutoSpamCheck");
            return $Status;
        }
        // Case if receiver has preference PreferenceCheckMyMail set to "Yes"  : mail is always set to toCheck
        $rPrefCheckMyMail = LoadRow("select *  from memberspreferences where IdMember=" . $Mes->IdReceiver . " and IdPreference=4");
        // PreferenceCheckMyMail --> IdPref=4
        if (isset($rPrefCheckMyMail->Value) and $rPrefCheckMyMail->Value == 'Yes') {
            // if member has choosen CheckMyMail
            $Status = 'ToCheck';
            $CheckerComment .= "Member has asked for checking\n";
            $str = "update messages set Status='" . $Status . "',CheckerComment='" . $CheckerComment . "',SpamInfo='" . $SpamInfo . "' where id=" . $Mes->id . " and Status!='Sent'";
            sql_query($str);
            LogStr("PreferenceCheckMyMail for message #" . $IdMess . " from <b>" . fUsername($Mes->IdSender) . "</b> to <b>" . fUsername($Mes->IdReceiver) . "</b>", "AutoSpamCheck");
            return $Status;
        }
        // Default case
        $Status = 'ToSend';
        $str = "update messages set Status='" . $Status . "',CheckerComment='" . $CheckerComment . "',SpamInfo='" . $SpamInfo . "' where id=" . $Mes->id . " and Status!='Sent'";
        sql_query($str);
        return $Status;
    }
}
Ejemplo n.º 3
0
function DisplayAdminMassprepareenque($rBroadCast, $TGroupList, $TCountries, $TData, $count = 0, $countnonews = 0, $query = "")
{
    global $title;
    $title = "Admin Mass Mails";
    require_once "header.php";
    Menu1("", ww('MainPage'));
    // Displays the top menu
    Menu2("admin/adminmassmails.php", ww('MainPage'));
    // Displays the second menu
    $MenuAction = "            <li><a href=\"adminmassmails.php\">Admin Massmails</a></li>\n";
    $MenuAction .= "            <li><a href=\"adminmassmails.php?action=createbroadcast\">Create new broadcast</a></li>\n";
    if (HasRight("MassMail", "Send")) {
        // if has right to trig
        $MenuAction .= "            <li><a href=\"adminmassmails.php?action=ShowPendingTrigs\">Trigger mass mails</a></li>\n";
    }
    DisplayHeaderShortUserContent("Admin Mails - Broadcast Messages", "");
    ShowLeftColumn($MenuAction, VolMenu());
    $Name = $rBroadCast->Name;
    $IdGroup = GetParam("IdGroup", 0);
    $CountryIsoCode = GetParam("CountryIsoCode", 0);
    echo "    <div id=\"col3\"> \n";
    echo "      <div id=\"col3_content\" class=\"clearfix\"> \n";
    echo "        <div class=\"info clearfix\">\n";
    echo "<h2>For broadcast <b>", $Name, "</b></h2>";
    if ($count > 0) {
        echo "<p class=\"note\"> {$count} enqueued messages !<br /><i>{$countnonews} will not receive the mail because of their preference</i></p>";
    }
    $BroadCast_Title_ = getBroadCastElement("BroadCast_Title_" . $Name, 0);
    $BroadCast_Body_ = getBroadCastElement("BroadCast_Body_" . $Name, 0);
    $rr = LoadRow("select * from words where code='BroadCast_Title_" . $Name . "' and IdLanguage=0");
    if (isset($rr->Description)) {
        $Description = $rr->Description;
    } else {
        $Description = "";
    }
    echo "<h3>", nl2br($BroadCast_Title_), "</h3>";
    echo "<p>", nl2br($BroadCast_Body_), "</p>";
    echo "<br /><form method=\"post\" action=\"adminmassmails.php\" name=\"adminmassmails\" class=\"yform full\">\n";
    echo "<input type=\"hidden\" Name=\"IdBroadCast\" value=" . GetParam("IdBroadCast", 0) . ">\n";
    echo "<h3> Filtering the scope of the mass mail</h3>";
    echo "<div class=\"type-text\">";
    echo "<label for=\"Usernames\">Restrict to some members (ex : lupochen;kiwiflave;jeanyves)</label>";
    echo "<input type=\"text\" id=\"Usernames\" name=\"Usernames\" value=\"" . GetStrParam("Usernames", ""), "\" />\n";
    echo "</div>";
    echo "<div class=\"type-select\">";
    echo "<label for=\"CountryIsoCode\">Choose a country</label>";
    echo "<select id=\"CountryIsoCode\" name=\"CountryIsoCode\">";
    echo "<option value=\"0\">All countries</option>";
    for ($ii = 0; $ii < count($TCountries); $ii++) {
        echo "<option value=\"", $TCountries[$ii]->isoCode . '"';
        if (strcmp($TCountries[$ii]->isoCode, $CountryIsoCode) === 0) {
            echo " selected";
        }
        echo ">", $TCountries[$ii]->Name;
        echo "</option>";
    }
    echo "</select>\n";
    echo "</div>";
    echo "<div class=\"type-select\">";
    echo "<label for=\"IdGroup\">Choose a group</label>";
    echo "<select id=\"IdGroup\" name=\"IdGroup\">";
    echo "<option value=\"0\">All groups</option>";
    for ($ii = 0; $ii < count($TGroupList); $ii++) {
        echo "<option value=", $TGroupList[$ii]->id;
        if ($TGroupList[$ii]->id == $IdGroup) {
            echo " selected";
        }
        echo ">", $TGroupList[$ii]->Name, ":", $TGroupList[$ii]->Name;
        echo "</option>";
    }
    echo "</select>\n";
    echo "</div>";
    echo "<div class=\"type-text\">";
    echo "<label for =\"MemberStatus\">Member with status</label>";
    echo "<input type=\"text\" id=\"MemberStatus\" name=\"MemberStatus\" value=\"" . GetStrParam("MemberStatus", "Active") . "\" />\n";
    echo "</div>";
    echo '<div class="type-text">';
    echo '<label for="Limit">Maximum number of members (i.e. 100)</label>';
    echo '<input type="text" id="limit" name="limit" value="' . GetStrParam("limit", "") . '" />';
    echo '</div>';
    if (GetStrParam("random_order", "") == "on") {
        $random_order_checked = ' checked="checked"';
    } else {
        $random_order_checked = '';
    }
    echo '<div class="type-check">';
    echo '<p>';
    echo '<input type="checkbox"' . $random_order_checked . ' id="random_order" name="random_order" /> ';
    echo '<label for="random_order">Select random members</label>';
    echo '<br>Note: If this option is checked the recipients list below is only an example and does not reflect the list of members the mail will actually be sent to. Members will be randomly selected again when pressing "enqueue".';
    echo '</p>';
    echo '</div>';
    if (HasRight('MassMail', "test")) {
        if (GetStrParam("hide_recipients", "") == "on") {
            $checked = ' checked="checked"';
        } else {
            $checked = '';
        }
        echo '<div class="type-check">';
        echo '<p>';
        echo '<input type="checkbox"' . $checked . ' id="hide_recipients" name="hide_recipients" /> ';
        echo '<label for="hide_recipients">Hide recipients list</label>';
        echo '</p>';
        echo '</div>';
        echo '<p>';
        echo '<input type="submit" name="action" value="test" />';
        echo ' (Shows number of matching members and list of recipients)';
        echo '</p>';
    }
    // if it was a test action display the result build from previous filtering
    if (GetStrParam("action") == "test") {
        $max = count($TData);
        echo "<h3>This newsletter will be sent to {$max} members</h3>\n";
        if (GetStrParam("hide_recipients", "") != "on") {
            echo "<table>\n";
            echo "<tr align=left><th>Username</th><th>country</th>";
            if (IsAdmin()) {
                echo "<th>email</th>";
            }
            echo "<th>Status</th><th>Will try in</th></tr>";
            for ($ii = 0; $ii < $max; $ii++) {
                $m = $TData[$ii];
                echo "<tr class=\"highlight\">";
                echo "<td>", $m->Username, "</td>";
                echo "<td>", getcountrynamebycode($m->isoCode), "</td>";
                if (IsAdmin()) {
                    echo "<td>", GetEmail($m->id), "</td>";
                }
                echo "<td>", $m->Status, "</td>";
                $iLang = GetDefaultLanguage($m->id);
                $PrefLanguageName = LanguageName($iLang);
                echo "<td>", $PrefLanguageName, "</td>";
                echo "</tr>\n";
                echo "<tr>";
                echo "<td colspan=5 class=\"blank\">";
                echo getBroadCastElement("BroadCast_Title_" . $Name, $iLang, $m->Username), "<br />";
                echo getBroadCastElement("BroadCast_Body_" . $Name, $iLang, $m->Username), "<br />";
                echo "</td>";
                echo "</tr>";
            }
            echo "</table>\n";
        }
    }
    if (HasRight('MassMail', "enqueue")) {
        echo "<div class=\"note\">";
        echo "<div class=\"type-check\">";
        echo "<input type=\"checkbox\" id=\"enqueuetick\"  name=\"enqueuetick\" />";
        echo "<label for=\"enqueuetick\">Tick this if you really want to enqueue the messages to send and click on enqueue</label>";
        echo "</div>";
        echo "<div class=\"type-button\">";
        echo "<input type=\"submit\" name=\"action\" value=\"enqueue\" />\n";
        echo "</div>";
        echo "</div>";
    }
    echo "</form>\n";
    echo "<div> <!-- info -->\n";
    require_once "footer.php";
}
Ejemplo n.º 4
0
function GetPaymentModulePath()
{
    echo GetFeedwebUrl() . "PM/PM.aspx?lang=" . GetDefaultLanguage() . "&bac=" . GetBac(true) . "&client=WP:" . GetPluginVersion();
}