mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
show only events of logged in user unless it is admin
This commit is contained in:
parent
b8924666b6
commit
2134754e91
|
@ -42,6 +42,9 @@ class SeedDMS_Calendar {
|
|||
$date = mktime(12,0,0, $month, $day, $year);
|
||||
|
||||
$queryStr = "SELECT * FROM `tblEvents` WHERE `start` <= " . $date . " AND `stop` >= " . $date;
|
||||
if(!$this->user->isAdmin()) {
|
||||
$queryStr .= " AND `userID`=".$this->user->getID();
|
||||
}
|
||||
$ret = $this->db->getResultArray($queryStr);
|
||||
return $ret;
|
||||
} /* }}} */
|
||||
|
@ -50,6 +53,9 @@ class SeedDMS_Calendar {
|
|||
$queryStr = "SELECT * FROM `tblEvents` WHERE ( `start` <= " . (int) $start . " AND `stop` >= " . (int) $start . " ) ".
|
||||
"OR ( `start` <= " . (int) $stop . " AND `stop` >= " . (int) $stop . " ) ".
|
||||
"OR ( `start` >= " . (int) $start . " AND `stop` <= " . (int) $stop . " )";
|
||||
if(!$this->user->isAdmin()) {
|
||||
$queryStr .= " AND `userID`=".$this->user->getID();
|
||||
}
|
||||
$ret = $this->db->getResultArray($queryStr);
|
||||
return $ret;
|
||||
} /* }}} */
|
||||
|
|
Loading…
Reference in New Issue
Block a user