Example #1
0
require_once "lib/init.php";
require_once "lib/FunctionsLogin.php";
require_once "layout/error.php";
require_once "layout/adminquery.php";
$IdMember = GetParam("cid");
$countmatch = 0;
//------------------------------------------------------------------------------
MustLogIn();
// need to be log
$RightLevel = HasRight('SqlForVolunteers');
// Check the rights
if ($RightLevel < 1) {
    echo "This Need the sufficient <b>SqlForVolunteers</b> rights<br>";
    exit(0);
}
$IdQueryScope = RightScope('SqlForVolunteers');
$membergrouplist = "";
// receive the list of groups the member belongs to
$qry = sql_query("select IdGroup from membersgroups where Status='In' and IdMember=" . $_SESSION["IdMember"]);
while ($rr = mysql_fetch_object($qry)) {
    if ($membergrouplist != "") {
        $membergrouplist .= ",";
    }
    $membergrouplist = $membergrouplist . $rr->IdGroup;
}
$TList = array();
$table = "sqlforvolunteers";
if ($IdQueryScope == "\"All\"") {
    $swhere = "";
} else {
    /* Group option Disabled -because this is not a good one (better write real features)
Example #2
0
        // end of while not feof
        fclose($ff);
    }
    // end of loading data from file
    return $TData;
}
// end of loading data
MustLogIn();
$RightLevel = HasRight('Pannel');
// Check the rights
if ($RightLevel < 1) {
    echo "For this you need the <b>Panel</b> rights<br />";
    exit(0);
}
$action = GetParam("action");
$PannelScope = RightScope('Pannel');
$Message = "";
switch ($action) {
    case "DiffDB":
        if (!HasRight('Pannel', $action)) {
            // Check the rights
            echo "For this you need the scope <b>" . $action . "</b> within <b>Panel</b> rights<br>";
            exit(0);
        }
        break;
    case "SaveToDB":
        if (!HasRight('Pannel', $action)) {
            // Check the rights
            echo "For this you need the scope <b>" . $action . "</b> within <b>Panel</b> rights<br>";
            exit(0);
        }
Example #3
0
}
$notAndS2 = GetStrParam("NotandS2", "");
if ($notAndS2 != "") {
    $where .= " AND Str NOT LIKE '%" . $notAndS2 . "%'";
}
$ip = GetStrParam("ip", "");
if ($ip != "") {
    $where .= " AND IpAddress=" . ip2long($ip) . "";
}
$type = GetStrParam("Type", "");
if ($type != "") {
    $where .= " AND Type='" . $type . "'";
}
// If there is a Scope limit logs to the type in this Scope (unless it his own logs)
if (!HasRight('Logs', "\"All\"")) {
    $scope = RightScope("Logs");
    str_replace($scope, "\"", "'");
    $where .= " AND (Type IN (" . $scope . ") OR IdMember=" . $_SESSION["IdMember"] . ") ";
}
switch (GetParam("action")) {
    case "del":
        // case a delete is requested
        break;
}
$tData = array();
if (empty($where) and $start_rec == 0) {
    // In this case we will avoid the FOUND_ROW which is a performance killer
    $str = "SELECT logs.*,Username " . "FROM " . $_SYSHCVOL['ARCH_DB'] . ".logs LEFT JOIN members ON members.id=logs.IdMember " . "ORDER BY " . $_SYSHCVOL['ARCH_DB'] . ".logs.id DESC LIMIT {$start_rec}," . $limitcount;
    $qry = sql_query($str);
    $rCount = LoadRow("SELECT count(*)  AS cnt from " . $_SYSHCVOL['ARCH_DB'] . ".logs");
} else {
Example #4
0
Boston, MA  02111-1307, USA.
*/
chdir("..");
require_once "lib/init.php";
require_once "lib/FunctionsLogin.php";
require_once "layout/error.php";
require_once "layout/admingrep.php";
$action = GetParam("action");
$countmatch = 0;
$RightLevel = HasRight('Grep');
// Check the rights
if ($RightLevel < 1) {
    echo "This requires the sufficient <strong>Grep</strong> rights<br />";
    exit(0);
}
$scope = RightScope('Grep');
if ($nbligne == "") {
    $nbligne = "3";
}
if (isset($_POST['repertoire'])) {
    $repertoire = $_SESSION['repertoire'];
}
if ($RightLevel >= 5) {
    // rigcht level 5 allow to overwrite scope
    if (GetParam("scope") != "") {
        $scope = GetParam("scope");
    }
}
if (GetParam("s1") != "") {
    $s1 = GetParam("s1");
}
Example #5
0
 public function procActivitylogs($vars, $level = 0)
 {
     $where = '';
     $username = $vars["username"];
     $cid = $this->_idMember($username);
     if ($level <= 1) {
         $cid = $_SESSION["IdMember"];
         // Member with level 1 can only see his own rights
     }
     if ($cid != 0) {
         $where .= " AND IdMember=" . $cid;
     }
     $R = MOD_right::get();
     $level = $R->hasRight('Logs');
     $limitcount = $vars["limitcount"];
     // Number of records per page
     $start_rec = $vars["start_rec"];
     // Number of records per page
     $andS1 = $vars["andS1"];
     if ($andS1 != "") {
         $where .= " AND Str LIKE '%" . $andS1 . "%'";
     }
     $andS2 = $vars["andS2"];
     if ($andS2 != "") {
         $where .= " AND Str LIKE '%" . $andS2 . "%'";
     }
     $notAndS1 = $vars["notAndS1"];
     if ($notAndS1 != "") {
         $where .= " AND Str NOT LIKE '%" . $notAndS1 . "%'";
     }
     $notAndS2 = $vars["notAndS2"];
     if ($notAndS2 != "") {
         $where .= " AND Str NOT LIKE '%" . $notAndS2 . "%'";
     }
     $ip = $vars["ip"];
     if ($ip != "") {
         $where .= " AND IpAddress=" . ip2long($ip) . "";
     }
     $type = $vars["type"];
     if ($type != "") {
         $where .= " AND Type='" . $type . "'";
     }
     // If there is a Scope limit logs to the type in this Scope (unless it his own logs)
     if (!$R->hasRight('Logs', "\"All\"")) {
         $scope = RightScope("Logs");
         str_replace($scope, "\"", "'");
         $where .= " AND (Type IN (" . $scope . ") OR IdMember=" . $_SESSION["IdMember"] . ") ";
     }
     $tData = array();
     $db = "";
     if (!empty($_SYSHCVOL['ARCH_DB'])) {
         $db = $_SYSHCVOL['ARCH_DB'] . ".";
     }
     // not using: SQL_CALC_FOUND_ROWS and FOUND_ROWS()
     $query = "SELECT logs.*, Username " . "FROM " . $db . ".logs LEFT JOIN members ON members.id=logs.IdMember " . "WHERE 1=1 " . $where . " " . "ORDER BY created DESC LIMIT {$start_rec}," . $limitcount;
     $resultRecords = $this->dao->query($query);
     $query = "SELECT COUNT(*) AS n " . "FROM " . $db . ".logs LEFT JOIN members ON members.id=logs.IdMember " . "WHERE 1=1 " . $where;
     $result = $this->dao->query($query);
     $altogether = $result->fetch(PDB::FETCH_OBJ);
     return array($altogether->n => $resultRecords);
 }
Example #6
0
    }
    return $TData;
}
// end of load data
//------------------------------------------------------------------------------
MustLogIn();
// need to be log
$IdMember = GetParam("cid");
$countmatch = 0;
$RightLevel = HasRight('Comments');
// Check the rights
if ($RightLevel < 1) {
    echo "For this you need the <b>Comments</b> rights<br>";
    exit(0);
}
$AccepterScope = RightScope('Comments');
if ($AccepterScope != "All") {
    $CommentsScope = str_replace("\"", "'", $CommentsScope);
}
$RestrictToIdMember = "";
if (GetStrParam("ToIdMember") != "") {
    $RestrictToIdMember = " and IdToMember=" . IdMember(GetStrParam("ToIdMember"));
}
if (GetStrParam("FromIdMember") != "") {
    $RestrictToIdMember = " and IdFromMember=" . IdMember(GetStrParam("FromIdMember"));
}
$page = GetParam('page', 0);
if ($page == "") {
    $page = 0;
}
$action = GetParam("action");
Example #7
0
    }
    if (GetStrParam("IdReceiver", "") != "") {
        $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.IdReceiver" . IdMember(GetStrParam("IdReceiver", 0)) . " order by messages.id desc limit 20";
    }
    //		echo "str=$str<br>" ;
    $qry = sql_query($str);
    while ($rr = mysql_fetch_object($qry)) {
        array_push($TMess, $rr);
    }
    DisplayMessages($TMess, $sResult, GetStrParam("IdSender", ""));
    // call the layout
    exit(0);
    // exit after the layout has been called
}
// end of viewSpamSayMember
$scope = RightScope('Checker');
$TMess = array();
$lastaction = "";
$action = GetParam("action");
switch ($action) {
    case "logout":
        Logout();
        exit(0);
        break;
    case "PendingSpammers":
        $str = "select messages.*,messages.Status as MessageStatus,mSender.Username as Username_sender,count(*) as cnt from messages,members as mSender where mSender.id=IdSender and messages.Status='ToCheck' group by mSender.Username order by mSender.Username desc";
        $qry = sql_query($str);
        $tot = 0;
        while ($rr = mysql_fetch_object($qry)) {
            array_push($TMess, $rr);
            $tot++;