Beispiel #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";
}
Beispiel #2
0
function DisplayUsers($rQuery, $TResult, $Message = "")
{
    global $title;
    if (isset($rQuery->Name)) {
        // If the query was successfull and if it has a name
        $title = $rQuery->Name;
    } else {
        $title = "FailedQuery";
    }
    require_once "header.php";
    Menu1("", ww('MainPage'));
    // Displays the top menu
    Menu2("admin/adminquery.php", ww('MainPage'));
    // Displays the second menu
    if (HasRight("SqlForVolunteers") >= 1) {
        $MenuAction = "            <li><a href=\"adminquery.php\">admin query</a></li>\n";
    }
    //  $MenuAction .= "            <li><a href=\"admingroups.php?action=updategroupscounter\">Update group counters</a></li>\n";
    DisplayHeaderShortUserContent("See user who can execute the query #" . $rQuery->id);
    ShowLeftColumn($MenuAction, VolMenu());
    echo "    <div id=\"col3\"> \n";
    echo "      <div id=\"col3_content\" class=\"clearfix\"> \n";
    echo "        <div class=\"info\">\n";
    if (!empty($Message)) {
        echo "<h2>{$Message}</h2>";
    }
    $bgcolor[0] = "#ffffcc";
    $bgcolor[1] = "#ffccff";
    echo "<center><p><table>\n";
    $max = count($TResult);
    if ($max > 0) {
        echo "<tr bgcolor=\"#ff9966\">";
        echo "<th colspan=3>";
        echo "Users able to execute : ", $rQuery->Name;
        echo "</th>";
        echo "<tr bgcolor=\"#ff9966\">";
        echo "<td colspan=3>";
        echo $rQuery->Query;
        echo "</td>";
        echo "</tr>";
        echo "<tr bgcolor=\"#ff9966\" align=\"left\">";
        echo "<th>Username</th><th>Scope</th><th>action</th>";
        echo "</tr>";
        for ($ii = 0; $ii < $max; $ii++) {
            echo "<tr align=left valign=center bgcolor=\"" . $bgcolor[$ii % 2] . "\">";
            $rr = $TResult[$ii];
            echo "<td>", LinkWithUsername($rr->Username), "</td>";
            echo "<td>", $rr->Scope, "</td>";
            echo "<td>";
            if (HasRight("Rights", "SqlForVolunteers")) {
                echo "<form  method=\"post\" action=\"adminquery.php\"><input type=\"hidden\" value=\"" . $rr->IdMember . "\" name=IdMember><input type=hidden value=\"" . $rQuery->id . "\" name=IdQuery><input type=submit name=\"action\" value=\"remove access\"></form>";
            }
            echo "</td>";
            echo "</tr>";
        }
        // end of for $ii
        echo "</table></p>\n";
        if (HasRight("Rights", "SqlForVolunteers")) {
            echo "<br /><p>";
            echo "<table>";
            echo "<tr bgcolor=\"#ff9966\">";
            echo "<td> Grant this query to a new user</td>";
            echo "<form  method=\"post\" action=\"adminquery.php\"><tr><td>Username <input type=text name=\"Username\"></td></tr>";
            echo "<tr><td align=center><input type=\"hidden\" value=\"" . $rQuery->id . "\" name=IdQuery><br><input type=submit name=\"action\" value=\"grant query\"></td></tr></form></table>";
            echo "</p>\n";
        }
    } else {
        echo "<p>Nobody has right for this</p>\n";
    }
    echo "</center>";
    require_once "footer.php";
}
Beispiel #3
0
function DisplayHeaderMainPage($TitleTopContent = "", $MessageBeforeColumnLow = "", $ActionList = "")
{
    global $DisplayHeaderMainPageIsSet;
    echo "    <div id=\"main\">\n";
    echo "      <div id=\"teaser_bg\">\n";
    echo "      <div id=\"teaser\" class=\"clearfix teaser_main\">\n";
    if (IsLoggedIn()) {
        echo "        <h2>", ww("HelloUsername", LinkWithUsername($_SESSION["Username"])), "</h2>\n";
    } else {
        echo "        <h2>", ww("YourAreNotLogged"), "</h2>\n";
    }
    echo "        <div id=\"teaser_l\">\n";
    echo "\t\t\t\t<img src=\"" . MyPict() . "\" id=\"MainUserpic\" alt=\"ProfilePicture\"/>\n";
    echo "        </div>\n";
    echo "        <div id=\"teaser_r\">\n";
    echo "\t\t\t<div class=\"subcolumns\">\n";
    echo "\t\t\t\t<div class=\"c38l\">\n";
    echo "    \t\t\t\t<div class=\"subcl\">\n";
    echo "          \t<p><img src=\"images/icons1616/icon_contactmember.png\" alt=\"Messages\"/>", ww("MainPageNewMessages"), "</p>\n";
    echo "          \t<p><img src=\"images/icons1616/icon_addcomments.png\" alt=\"Comments\"/>", ww("MainPageNewComments"), "</p>\n";
    echo "          \t<p><img src=\"images/icons1616/icon_myvisitors.png\" alt=\"Visitors\"/>", ww("MainPageNewVisitors"), "</p>\n";
    echo "        \t\t\t</div>\n";
    echo "      \t\t</div>\n";
    echo "\t\t\t\t<div class=\"c62r\">\n";
    echo "\t\t\t\t\t<div class=\"subcr\">\n";
    echo "\t\t\t\t\t\t<div id=\"mapsearch\">\n";
    echo "\t\t\t\t\t\t<form>\n";
    echo "\t\t\t\t\t          <fieldset> \n";
    // echo "                    <label for=\"searchtext\">Search the map</label><br />\n";
    echo "\t\t\t\t\t          <input type=\"text\" id=\"searchtext\" name=\"searchtext\" size=\"20\" maxlength=\"30\" id=\"text-field\" value=\"Search the map!\" onfocus=\"this.value='';\"/>\n";
    echo "\t\t\t\t\t          <input type=\"hidden\" name=\"action\" value=\"mapsearch\" />\n";
    echo "\t\t\t\t\t          <input type=\"image\" src=\"" . bwlink("images/icon_go.png") . "\" id=\"submit-button\" /><br />\n";
    echo "\t\t\t\t\t        </fieldset>\n";
    echo "\t\t\t\t\t\t</form>\n";
    echo "\t\t\t\t\t\t</div>\n";
    echo "\t\t\t\t\t</div>\n";
    echo "\t\t\t\t</div>\n";
    echo "\t\t\t</div>\n";
    echo "        </div>\n";
    echo "      </div>\n";
    // no tabs >>
    echo "\t        <div id=\"middle_nav\" class=\"clearfix\">\n";
    echo "\t\t        <div id=\"nav_sub\" class=\"notabs\">\n";
    echo "\t\t\t        <ul>\n";
    echo "\t\t\t        </ul>\n";
    echo "\t\t        </div>\n";
    echo "\t        </div>\n";
    echo "      </div>\n";
    //end teaser_bg
    ShowLeftColumn($ActionList, VolMenu());
    // Show the Actions
    // middle column
    echo "\n";
    echo "      <div id=\"col3\"> \n";
    echo "        <div id=\"col3_content\" class=\"clearfix\"> \n";
    $DisplayHeaderMainPageIsSet = true;
    // set this for footer function which will be in charge of calling the closing /div
}
Beispiel #4
0
function ShowList($TData, $start = 0, $total = 0)
{
    global $_SYSHCVOL;
    $maxTData = count($TData);
    $count = 0;
    $tt = $_SYSHCVOL['LenghtComments'];
    $max = count($tt);
    for ($iData = 0; $iData < $maxTData; $iData++) {
        $c = $TData[$iData];
        $count++;
        echo "          <div class=\"admincomment\">\n";
        echo "            <h3>Comment from ", LinkWithUsername($c->UsernameWriterMember), " about ", LinkWithUsername($c->UsernameReceiverMember), "</h3>\n";
        echo "            <p><strong>", $c->AdminAction, "</strong></p>\n";
        echo "            <form method=\"post\" action=\"admincomments.php\">\n";
        echo "              <div class=\"subcolumns\">\n";
        echo "                <div class=\"c50l\">\n";
        echo "                  <div class=\"subcl\">\n";
        $QualityStyle = "background-color:lightgreen;";
        if ($c->Quality == "Bad") {
            $QualityStyle = "background-color:red;color:white;";
        }
        if ($c->Quality == "Neutral") {
            $QualityStyle = "background-color:lightgray;";
        }
        echo "                    <p>\n";
        echo "                      <select name=\"Quality\" style=\"", $QualityStyle, "\">\n";
        echo "                        <option value=\"Neutral\" ";
        if ($c->Quality == "Neutral") {
            echo " selected=\"selected\"";
        }
        echo ">";
        echo ww("CommentQuality_Neutral"), "</option>\n";
        echo "                        <option value=\"Good\"";
        if ($c->Quality == "Good") {
            echo " selected=\"selected\" ";
        }
        echo ">", ww("CommentQuality_Good"), "</option>\n";
        echo "                        <option value=\"Bad\"";
        if ($c->Quality == "Bad") {
            echo " selected=\"selected\" ";
        }
        echo ">", ww("CommentQuality_Bad"), "</option>\n";
        echo "                      </select>\n";
        echo "                    </p>\n";
        $ttLenght = explode(",", $c->Lenght);
        echo "                    <ul>\n";
        for ($ii = 0; $ii < $max; $ii++) {
            echo "                      <li><input type=\"checkbox\" name=\"Comment_" . $tt[$ii] . "\"";
            if (in_array($tt[$ii], $ttLenght)) {
                echo " checked=\"checked\" ";
            }
            echo " />";
            echo "&nbsp;", ww("Comment_" . $tt[$ii]), "</li>\n";
        }
        echo "                    </ul>\n";
        echo "                  </div> <!-- subcl -->\n";
        echo "                </div> <!-- c50l -->\n";
        echo "                <div class=\"c50r\">\n";
        echo "                  <div class=\"subcr\">\n";
        echo "                    <ul class=\"linklist\">\n";
        // define button texts
        if ($c->DisplayInPublic == 1) {
            $ToggleHideText = 'Hide';
            $ToggleHideAction = 'HideAction';
        } else {
            $ToggleHideText = 'Show';
            $ToggleHideAction = 'UnhideAction';
        }
        if ($c->AllowEdit == 1) {
            $ToggleEditText = 'Default editing';
            $ToggleEditAction = 'DefaultEditAction';
        } else {
            $ToggleEditText = 'Allow editing';
            $ToggleEditAction = 'AllowEditAction';
        }
        if ($c->AdminComment != "Checked") {
            echo "                      <li><a href=\"" . bwlink("admin/admincomments.php?IdComment=" . $c->id . "&amp;action={$ToggleHideAction}") . "\" class=button>{$ToggleHideText}</a>\n";
            echo "                      <a href=\"" . bwlink("admin/admincomments.php?IdComment=" . $c->id . "&amp;action={$ToggleEditAction}") . "\" class=button>{$ToggleEditText}</a>\n";
            echo "                      <li><a href=\"" . bwlink("admin/admincomments.php?IdComment=" . $c->id . "&amp;action=Checked") . "\" class=button>Mark as checked</a>\n";
        }
        if ($c->AdminComment != "Checked" and HasRight("Comments", "AdminAbuser")) {
            echo "                      <a href=\"" . bwlink("admin/admincomments.php?IdComment=" . $c->id . "&amp;action=AdminAbuserMustCheck") . "\" class=button>Mark as abuse</a></li>\n";
        }
        if ($c->AdminComment != "Checked" and HasRight("Comments", "AdminComment")) {
            echo "                      <li><a href=\"" . bwlink("admin/admincomments.php?IdComment=" . $c->id . "&amp;action=AdminCommentMustCheck") . "\" class=button>Move to negative</a>\n";
        }
        if ($c->AdminComment != "Checked" and HasRight("Comments", "DeleteComment")) {
            echo "                      <a href=\"" . bwlink("admin/admincomments.php?IdComment=" . $c->id . "&amp;action=del\" onclick=\"return('Confirm delete ?');") . "\" class=button>Delete comment</a></li>\n";
        }
        echo "                      <li><a href=\"" . bwlink("admin/admincomments.php?FromIdMember=" . $c->UsernameWriterMember) . "&amp;action=All\">Other comments written by ", $c->UsernameWriterMember, "</a></li>\n";
        echo "                      <li><a href=\"" . bwlink("admin/admincomments.php?ToIdMember=" . $c->UsernameReceiverMember) . "&amp;action=All\">Other comments written about ", $c->UsernameReceiverMember, "</a></li>\n";
        echo "                      <li><a href=\"" . bwlink("messages/compose/" . $c->UsernameWriterMember, true) . "\">Contact writer (" . $c->UsernameWriterMember . ")</a></li>\n";
        echo "                      <li><a href=\"" . bwlink("messages/compose/" . $c->UsernameReceiverMember, true) . "\">Contact receiver (" . $c->UsernameReceiverMember . ")</a></li>\n";
        echo "                    </ul>\n";
        echo "                  </div> <!-- subcr -->\n";
        echo "                </div> <!-- c50r -->\n";
        echo "              </div> <!-- subcolumns -->\n";
        echo " <h4>Last updated: " . $c->updated . "&nbsp;&nbsp;Created: " . $c->created . "</h4>\n";
        echo "              <h4>Where?</h4>\n";
        echo "              <p><textarea name=\"TextWhere\" cols=\"70\" rows=\"5\">", $c->TextWhere, "</textarea></p>\n";
        echo "              <h4>Comment:</h4>\n";
        echo "              <p><textarea name=\"TextFree\" cols=\"70\" rows=\"8\">", $c->TextFree, "</textarea></p>\n";
        echo "              <p class=\"center\">\n";
        echo "                <input type=\"hidden\" value=\"" . $c->id . "\" name=\"IdComment\" />\n";
        echo "                <input type=\"hidden\" value=\"" . $IdMember . "\" name=cid />\n";
        echo "                <input type=\"hidden\" name=\"action\" value=\"update\" />\n";
        echo "                <input type=\"submit\" id=\"submit\" value=\"update\" />\n";
        echo "              </p>\n";
        echo "             </form>\n";
        echo "            </div> <!-- admincomment -->\n";
    }
    if ($total != 0) {
        echo "            <p><strong>Total number of comments:</strong> ", $total, "</p>\n";
    } else {
        echo "            <p><strong>Total number of comments:</strong> ", $count, "</p>\n";
    }
    echo "        </div> <!-- info -->\n";
}
Beispiel #5
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>";