Example #1
0
function DisplayAdminLogs($tData, $username, $type, $ip, $andS1, $andS2, $notAndS1, $notAndS2, $maxpos)
{
    global $title;
    $rTime = LoadRow("select now() as ss");
    $title = "Admin logs Server time: " . $rTime->ss;
    require_once "header.php";
    Menu1("", "Admin Logs page");
    // Displays the top menu
    Menu2("admin/adminlogs.php", ww('MainPage'));
    // Displays the second menu
    DisplayHeaderShortUserContent($title);
    ShowLeftColumn("", VolMenu());
    // Show the Actions
    // middle column
    echo "      <div id=\"col3\"> \n";
    echo "        <div id=\"col3_content\" class=\"clearfix\"> \n";
    echo "          <div class=\"info clearfix\">\n";
    $max = count($tData);
    $infoStyles = array(0 => "              <tr class=\"blank\" align=\"left\" valign=\"center\">\n", 1 => "              <tr class=\"highlight\" align=\"left\" valign=\"center\">\n");
    echo "          <table cellspacing=\"10\" cellpadding=\"10\" style=\"font-size:11px;\">\n";
    echo "            <tr>\n";
    if (empty($username)) {
        echo "              <th>Username</th>\n";
        echo "              <th>Type</th>\n";
        echo "              <th>Str</th>\n";
        echo "              <th>created</th>\n";
        echo "              <th>ip</th>\n";
    } else {
        echo "              <th colspan=4 align=center> Logs for ", LinkWithUsername(fUsername($username)), "</th>\n";
    }
    echo "</tr>\n";
    for ($ii = 0; $ii < $max; $ii++) {
        $logs = $tData[$ii];
        echo $infoStyles[$ii % 2];
        // this displays the <tr>
        if (!empty($logs->Username)) {
            echo "<td>";
            echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?Username="******"\">" . $logs->Username . "</a>";
            echo "</td>";
        } else {
            echo "<td>";
            // To do according to ip addresses replace with Google, Yahoo .. etc - an external solution is to be find
            switch (long2ip($logs->IpAddress)) {
                case "66.249.72.206":
                    echo "Googlebot/2.1";
                    break;
                case "74.6.23.107":
                    echo "Yahoo slurp";
                    break;
                case "127.0.0.1":
                    echo "<i>localhost</i>";
                    break;
                default:
                    echo "<i>not logged</i>";
                    break;
                    break;
            }
            echo "</td>";
        }
        echo "<td>";
        echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?Type=" . $logs->Type . "\">" . $logs->Type . "</a>";
        //    echo $logs->Type;
        echo "</td>";
        echo "<td>";
        echo $logs->Str;
        echo "</td>";
        echo "<td>{$logs->created}</td><td>&nbsp;";
        echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?ip=" . long2ip($logs->IpAddress) . "\">" . long2ip($logs->IpAddress) . "</a>";
        echo " <a href=\"http://ws.arin.net/whois/?queryinput=+" . long2ip($logs->IpAddress) . " \" target=\"new\">arinc</a>";
        echo " <a href=\"http://outils-rezo.info/cgi-bin/action.cgi?valeur=" . long2ip($logs->IpAddress) . "&cmd=Whois\" target=\"new\">whois</a>";
        echo "</td>";
        echo "</tr>\n";
    }
    echo "          </table>\n<br>";
    if ($max > 0) {
        echo _Pagination($maxpos);
    }
    echo "          <hr />\n";
    echo "          <table>\n";
    echo "            <form method='post' action='adminlogs.php'>\n";
    if (HasRight("Logs") > 1) {
        echo "              <tr>\n";
        echo "                <td>Username</td><td><input type=\"text\" name=\"Username\" value=\"" . (!empty($username) ? $username : '') . "\"></td>\n";
    } else {
        echo "              <tr>\n";
        echo "                <td>Username</td><td><input type=\"text\" readonly=\"readonly\" name=\"Username\" value=\"" . $username . "\"></td>";
    }
    echo "                <td>Type</td><td><input type=text name=Type value=\"" . $type . "\"></td>\n";
    echo "                <td>Ip</td><td><input type=text name=ip value=\"" . $ip . "\"></td>\n";
    echo "              </tr>\n";
    echo "              <tr><td>    Having</td><td><input type=text name=andS1 value=\"" . $andS1 . "\"></td></tr>";
    echo "        <tr><td>and Having</td><td><input type=text name=andS2 value=\"" . $andS2 . "\"></td></tr>";
    echo "        <tr><td>and not Having</td><td><input type=text name=NotandS1 value=\"" . $notAndS1 . "\"></td></tr>";
    echo "        <tr><td>and not Having</td><td><input type=text name=NotandS2 value=\"" . $notAndS2 . "\"></td></tr>";
    echo "                <tr><td colspan=2 align=center>";
    echo "<input type=submit id=submit>";
    echo "</td>\n";
    echo "              </tr>\n";
    echo "            </form>\n";
    echo "          </table>\n";
    echo "        </div>\n";
    require_once "footer.php";
}
Example #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;
    }
}
Example #3
0
$infoStyles = array(0 => "              <tr class=\"blank\" align=\"left\" valign=\"center\">\n", 1 => "              <tr class=\"highlight\" align=\"left\" valign=\"center\">\n");
?>
	<div id="col3"> 
		<div id="col3_content" class="clearfix"> 
			<div class="info">
				<table cellspacing="10" cellpadding="10" style="font-size:11px;">
					<tr>
					<?php 
if (empty($username)) {
    echo "              <th>Username</th>\n";
    echo "              <th>Type</th>\n";
    echo "              <th>Str</th>\n";
    echo "              <th>created</th>\n";
    echo "              <th>ip</th>\n";
} else {
    echo "              <th colspan=4 align=center> Logs for ", LinkWithUsername(fUsername($username)), "</th>\n";
}
?>
					</tr>
					<?php 
$ii = 0;
while ($logs = $tData->fetch(PDB::FETCH_OBJ)) {
    $ii++;
    echo $infoStyles[$ii % 2];
    // this displays the <tr>
    if (!empty($logs->Username)) {
        echo "<td>";
        echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?Username="******"&Type=" . $logs->Type . "\">" . $logs->Username . "</a>";
        echo "</td>";
    }
    echo "<td>";
Example #4
0
$RightLevel = HasRight('Logs');
// Check the rights
if ($RightLevel < 1) {
    echo "This Need the sufficient <b>Logs</b> rights<br />";
    exit(0);
}
$where = '';
$username = GetParam("Username", "0");
$cid = IdMember($username);
if ($cid != 0) {
    $where .= " AND IdMember=" . $cid;
}
if (HasRight('Logs', 'OwnLogsRestriction') and !HasRight('Logs', '"All"')) {
    $cid = $_SESSION["IdMember"];
    // Member with scope OwnLogsRestriction can only see his own rights
    $username = fUsername($cid);
}
$limitcount = GetParam("limitcount", 100);
// Number of records per page
$start_rec = GetParam("start_rec", 0);
// Number of records per page
$andS1 = GetStrParam("andS1", "");
if ($andS1 != "") {
    $where .= " AND Str LIKE '%" . $andS1 . "%'";
}
$andS2 = GetStrParam("andS2", "");
if ($andS2 != "") {
    $where .= " AND Str LIKE '%" . $andS2 . "%'";
}
$notAndS1 = GetStrParam("NotandS1", "");
if ($notAndS1 != "") {
Example #5
0
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
BW Rox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/> or 
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA  02111-1307, USA.
*/
chdir("..");
require_once "lib/init.php";
require_once "layout/error.php";
require_once "layout/adminchecker.php";
$username = fUsername(GetStrParam("username"));
$sResult = "";
// initialisation to avoid a warning
$RightLevel = HasRight('Checker');
// Check the rights
if ($RightLevel < 1) {
    echo "This Need the suffcient <b>Checker</b> rights<br>";
    exit(0);
}
// this function call the view of reported spam
function viewSpamSayMember($sResult = "")
{
    $TMess = array();
    $str = "select messages.*,messages.Status as MessageStatus,mSender.Username as Username_sender,mReceiver.Username as Username_receiver from messages,members as mSender,members as mReceiver where mSender.id=IdSender and messages.SpamInfo='SpamSayMember' and mReceiver.id=IdReceiver and (mSender.Status='Active' or mSender.Status='Pending') order by messages.id desc limit 50";
    if (GetStrParam("IdSender", "") != "") {
        $str = "select messages.*,messages.Status as MessageStatus,mSender.Username as Username_sender,mReceiver.Username as Username_receiver from messages,members as mSender,members as mReceiver where mSender.id=IdSender and mReceiver.id=IdReceiver and (mSender.Status='Active' or mSender.Status='Pending') and messages.SpamInfo='SpamSayMember' and messages.IdSender=" . IdMember(GetStrParam("IdSender", 0)) . " order by messages.id desc limit 20";