Esempio n. 1
0
function DisplayGrepForm($s1 = "", $s2 = "", $stringnot = "", $scope, $RightLevel, $previousres = "")
{
    global $countmatch;
    global $title;
    $title = "AdminGrep";
    require_once "header.php";
    Menu1("", $title);
    // Displays the top menu
    Menu2("admin/admingrep.php", $title);
    // Displays the second menu
    DisplayHeaderShortUserContent($title);
    ShowLeftColumn($MenuAction, VolMenu());
    echo "    <div id=\"col3\"> \n";
    echo "      <div id=\"col3_content\" class=\"clearfix\"> \n";
    echo "        <div class=\"info clearfix\">\n";
    if ($previousres != "") {
        echo "<table bgcolor=gray width=100%>";
        echo "<tr><th bgcolor=silver>Looking in (<b>{$repertoire}</b>{$scope}) for <b><font color=blue>", stripslashes($s1), "</font></b>";
        if ($s2 != "") {
            echo " and for <b><font color=blue>", stripslashes($s2), "</font></b>";
        }
        if ($stringnot != "") {
            echo " and NOT <b><font color=blue>", stripslashes($stringnot), "</font></b>";
        }
        echo "</th>\n";
        echo "<tr><td>";
        echo $previousres;
        echo "</td>";
        echo "<tr><td>match : ";
        echo $countmatch;
        echo "</td>";
        echo "</table>";
    }
    echo "\n<form method=post><center><table bgcolor=silver><tr bgcolor=gray><th colspan=2>parameters</th>";
    //  echo "\n<tr><td>directory (leave empty)</td><td><input type=text name=repertoire value=\"$repertoire\" size=30></td>";
    if ($RightLevel >= 5) {
        echo "\n<tr><td>File Scope</td><td><input type=text name=scope value=\"{$scope}\" size=60></td>";
    } else {
        echo "\n<tr><td>File Scope</td><td><input type=text readonly name=scope value=\"{$scope}\" size=60></td>";
    }
    echo "\n<tr><td>string to find</td><td><input type=text name=s1 value=\"", stripslashes(htmlentities($s1)), "\" size=30></td>";
    echo "\n<tr><td>and 2nd string to find</td><td><input type=text name=s2 value=\"", stripslashes(htmlentities($s2)), "\" size=30></td>";
    echo "\n<tr><td>and string not to have</td><td><input type=text name=stringnot value=\"", stripslashes(htmlentities($stringnot)), "\" size=30></td>";
    echo "<input type=hidden name=action value=\"grep\" >";
    echo "\n<tr><td colspan=2 align=center><input type=submit id=submit name=submit value=\"find\" size=2></td>";
    echo "\n</table></center></form>";
    require_once "footer.php";
}
Esempio n. 2
0
function DisplayPannel($TData, $Message = "")
{
    global $title;
    global $PannelScope;
    if ($title == "") {
        $title = "Admin Pannel";
    }
    require_once "header.php";
    Menu1("", "Admin pannel");
    // Displays the top menu
    Menu2("adminpannel.php", $title);
    // Displays the second menu
    DisplayHeaderShortUserContent($Message);
    echo "Your Scope is for <b>", $PannelScope, "</b><br>";
    $max = count($TData);
    echo "<form method=post>\n";
    echo "<table>\n";
    echo "<tr><th colspan=2>key</th><th colspan=2>value</th><th>comment</th>\n";
    for ($ii = 0; $ii < $max; $ii++) {
        $rr = $TData[$ii];
        //	  echo "<tr><td>",$ii,"</td><td>",$rr->SYSHCvol_key ,$rr->SYSHCvol_value,$rr->SYSHCvol_comment,"</td>\n";
        echo "<tr>\n";
        echo "<td><textarea name=SYSHCvol_key_" . $ii . " rows=1 cols=50>", $rr->SYSHCvol_key . "</textarea></td><td>=</td>\n";
        echo "<td><textarea name=SYSHCvol_value_" . $ii . " rows=1 cols=50>", $rr->SYSHCvol_value . "</textarea><td> //</td></td>\n";
        echo "<td><textarea name=SYSHCvol_comment_" . $ii . " rows=1 cols=50>", $rr->SYSHCvol_comment . "</textarea></td>\n";
        echo "<td></td>\n";
    }
    echo "</table>\n";
    echo "<input type=submit id=submit name=action value=\"SaveToDB\"> &nbsp;&nbsp;&nbsp;";
    echo "<input type=submit id=submit name=action value=\"LoadFromDB\"> &nbsp;&nbsp;&nbsp;";
    echo "<input type=submit id=submit name=action value=\"LoadFromFile\"> &nbsp;&nbsp;&nbsp;";
    echo "<input type=submit id=submit name=action value=\"Generate\"> &nbsp;&nbsp;&nbsp;";
    echo "</form>\n";
    echo "<hr />";
    for ($ii = 0; $ii < $max; $ii++) {
        $rr = $TData[$ii];
        echo "<div style=\"font-size=10px;color=green;\">";
        if ($rr->SYSHCvol_key != "") {
            echo $rr->SYSHCvol_key, "=";
        }
        echo $rr->SYSHCvol_value, " //", $rr->SYSHCvol_comment;
        echo "</div>\n";
    }
    require_once "footer.php";
}
Esempio n. 3
0
function DisplayError($ErrorMessage = "No Error Message")
{
    global $title, $errcode;
    $title = ww('ErrorPage');
    require_once "header.php";
    Menu1("error.php", ww('MainPage'));
    // Displays the top menu
    Menu2($_SERVER["PHP_SELF"]);
    // Display the second menu
    DisplayHeaderShortUserContent($errcode);
    // Display the heade
    echo "        <div class=\"info\">";
    echo "<p class=\"error\">", $ErrorMessage, "</p>";
    echo "        </div>";
    require_once "footer.php";
    exit(0);
    // To be sure that member doesn't go further after an error
}
Esempio n. 4
0
function refuse_login($message, $nextlink, $Status)
{
    $title = ww('login');
    include "layout/header.php";
    $title = ww('LoginError');
    Menu1("error.php", ww('MainPage'));
    // Displays the top menu
    Menu2($_SERVER["PHP_SELF"]);
    DisplayHeaderShortUserContent(ww("LoginError"));
    // Display the header
    echo "          <div class=\"info\" style=\"text-align: center\">\n";
    echo "            <p style=\"color:red;font-size:22px\">", $message, "</p>\n";
    echo "            <p><a href=\"" . $nextlink . "\" style=\"font-size:22px;\">", ww("GoBack"), "</a></p>\n";
    echo "            <br />\n";
    echo "            <p>", ww("IndexPageWord18");
    // This is a forgot yout pssword link
    if ($Status == "MailToConfirm") {
        echo "</p>\n", ww("ProposeSendAgainMailToConfirm");
    }
    echo "          </div>\n";
    include "layout/footer.php";
    exit(0);
}
Esempio n. 5
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";
}
Esempio n. 6
0
function DisplayMyResults($_TResult, $_TTitle, $_TTsqry, $rQuery, $Message, $TList)
{
    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") >= 10) {
        $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($title);
    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>";
    }
    for ($kk = 0; $kk < count($_TTsqry); $kk++) {
        $TResult = $_TResult[$kk];
        $TTitle = $_TTitle[$kk];
        $sqry = $_TTsqry[$kk];
        $iCount = count($TTitle);
        $bgcolor[0] = "#ffffcc";
        $bgcolor[1] = "#ffccff";
        echo "<p><table>\n";
        $max = count($TResult);
        echo "<tr bgcolor=\"#ff9966\"><th colspan=\"" . $iCount . "\">", $sqry, "</th></tr>";
        echo "<tr bgcolor=\"#ff9966\">";
        for ($ii = 0; $ii < $iCount; $ii++) {
            echo "<th>", $TTitle[$ii], "</th>";
        }
        echo "</tr>";
        for ($jj = 0; $jj < $max; $jj++) {
            $rr = $TResult[$jj];
            echo "<tr align=left valign=center bgcolor=\"" . $bgcolor[$jj % 2] . "\">";
            for ($ii = 0; $ii < $iCount; $ii++) {
                $FieldName = $TTitle[$ii];
                echo "<td>", $rr[$ii], "</td>";
            }
            echo "</tr>";
        }
        echo "</table></p>\n";
    }
    ShowAvailableQueries($TList);
    echo "</center>";
    require_once "footer.php";
}
Esempio n. 7
0
function DisplayFormCreateBroadcast($IdBroadCast = 0, $Name = "", $BroadCast_Title_, $BroadCast_Body_, $Description, $Type = "")
{
    global $title;
    $title = "Create a new broadcast";
    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());
    echo "    <div id=\"col3\"> \n";
    echo "      <div id=\"col3_content\" class=\"clearfix\"> \n";
    echo "        <div class=\"info clearfix\">\n";
    echo "<form method=\"post\" action=\"adminmassmails.php\" class=\"yform full\">\n";
    echo "<input type=\"hidden\" name=\"IdBroadCast\" value=\"{$IdBroadCast}\">";
    echo "<p class=\"note center\">Please write here in <strong>" . LanguageName($_SESSION['IdLanguage']) . "</strong></p>";
    echo "<div class=\"type-text\">";
    echo "<p>Give the code name of the broadcast as a word entry (must not exist in words table previously) like <b>NewsJuly2007</b> or <b>NewsAugust2007</b> without spaces!</p>";
    echo "<label for=\"Name\">WordCode for the newsletter</label>";
    echo "<input type=\"text\" ";
    if ($Name != "") {
        echo "readonly";
    }
    // don't change a group name because it is connected to words
    echo " id=\"Name\" name=\"Name\" value=\"{$Name}\" />";
    echo "</div>";
    echo "<div class=\"type-text\">";
    echo "<label for=\"BroadCast_Title_\">Subject for the newsletter (%username% will be replaced by the username at sending)</label>";
    echo "<input type=\"text\" id=\"BroadCast_Title_\" name=\"BroadCast_Title_\" value=\"{$BroadCast_Title_}\" />";
    echo "</div>";
    echo "<div class=\"type-text\">";
    echo "<label for=\"BroadCast_Body_\">Body of the newsletter (%username% will be replaced by the username at sending)</label>";
    echo "<textarea id=\"BroadCast_Body_\" name=\"BroadCast_Body_\" rows=\"30\">", $BroadCast_Body_, "</textarea>";
    echo "</div>";
    echo "<div class=\"type-text\">";
    echo "<label for=\"Description\">Description (as translators will see it in AdminWord) </label>";
    echo "<textarea id=\"Description\" name=\"Description\" rows=\"8\">", $Description, "</textarea>";
    echo "</div>";
    echo "<div class=\"type-button\">";
    if ($IdBroadCast != 0) {
        echo "<input type=\"submit\" name=\"submit\" value=\"update massmail\">";
    } else {
        echo "<input type=\"submit\" name=\"submit\" value=\"create massmail\">";
    }
    echo "<input type=\"hidden\" name=\"action\" value=\"createbroadcast\">";
    echo "</div>";
    echo "</form>";
    require_once "footer.php";
}
Esempio n. 8
0
function DisplayAdminComments($TData, $lastaction = "", $page = 0, $itemsperpage = 0, $count = 0, $urlpiece = "")
{
    global $countmatch;
    global $title;
    $title = "Admin Comments";
    global $AdminCommentsScope;
    require_once "header.php";
    Menu1("", ww('MainPage'));
    // Displays the top menu
    Menu2("admincomments.php", ww('MainPage'));
    // Displays the second menu
    $MenuAction = "";
    $MenuAction .= "            <li><a href=\"" . bwlink("admin/admincomments.php") . "\">Negative comments</a></li>\n";
    if (HasRight("Comments", "AdminAbuser")) {
        $MenuAction .= "            <li><a href=\"" . bwlink("admin/admincomments.php?action=AdminAbuser") . "\">Abusive comments</a></li>\n";
    }
    $MenuAction .= "            <li><a href=\"" . bwlink("admin/admincomments.php?action=All") . "\">All comments</a></li>\n";
    DisplayHeaderShortUserContent($title . ": " . $lastaction);
    ShowLeftColumn($MenuAction, VolMenu());
    echo "    <div id=\"col3\"> \n";
    echo "      <div id=\"col3_content\" class=\"clearfix\"> \n";
    echo "        <div class=\"info clearfix\">\n";
    echo "          <h2>Your scope:", $AdminCommentsScope, "</h2>\n";
    if ($itemsperpage != 0) {
        $params = new StdClass();
        $params->strategy = new HalfPagePager('right');
        if (empty($urlpiece)) {
            $params->page_url = 'admincomments.php?action=All';
        } else {
            $params->page_url = 'admincomments.php?action=' . $urlpiece;
        }
        $params->page_url_marker = 'page';
        $params->page_method = 'get';
        $params->items = $count;
        $params->active_page = $page;
        $params->items_per_page = $itemsperpage;
        $pager = new PagerWidget($params);
        $pager->render();
    }
    if (!empty($TData)) {
        ShowList($TData, $page * $itemsperpage, $count);
    }
    if (isset($pager)) {
        $pager->render();
    }
    require_once "footer.php";
}
Esempio n. 9
0
function DisplayUpdateMandatoryDone($Message)
{
    global $title, $IsVolunteerAtWork;
    $title = ww('UpdateMandatoryPage');
    require_once "header.php";
    Menu1($title, ww('UpdateMandatoryPage'));
    // Displays the top menu
    Menu2("", ww('UpdateMandatoryPage'));
    // Displays the second menu
    DisplayHeaderShortUserContent($title);
    echo "<br><br><center>", $Message, "</center>\n";
    require_once "footer.php";
}
Esempio n. 10
0
// force English for menu
Menu1("", "DB_MAINTENANCE");
// Displays the top menu
Menu2("main.php", "DB_MAINTENANCE");
// Displays the second menu
if (!HasRight("Admin")) {
    echo "<p> this need Admin rights</p>";
    require_once "layout/footer.php";
    die(1);
}
$MenuAction = "            <li><a href=\"" . bwlink("admin/dbmaintenance.php") . "\">db maintenance</a></li>\n";
$MenuAction .= "            <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=updateid") . "\">update new ids</a></li>\n";
$MenuAction .= "            <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=filltrads") . "\">fill the forum_trads</a></li>\n";
$MenuAction .= "            <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=filltag_threads") . "\">recreate tags_threads</a></li>\n";
$MenuAction .= "            <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=updatetagcounters") . "\">update tags counters</a></li>\n";
DisplayHeaderShortUserContent("Db Maintenance", $MenuAction, "");
// Display the header
ShowLeftColumn($MenuAction, "");
$action = GetStrParam("action", "");
switch ($action) {
    case "updateid":
        sql_query("update forums_tags set id=tagid");
        // dealing with redundant values
        sql_query("update forums_threads set id=threadid");
        // dealing with redundant values
        sql_query("update forums_posts set id=postid");
        // dealing with redundant values
        echo "<br />Id updated</p>";
        break;
    case "updatetagcounters":
        echo "<p>updating tags counter according to new tags_threads<br />";