mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Zusätzliche Prüfung hinzugefügt beim Download von Notizdokumenten ob
diese auch tatsächlich an einer Notiz hängen
This commit is contained in:
@@ -25,6 +25,7 @@ require_once('../config/vilesci.config.inc.php');
|
||||
require_once('../include/dms.class.php');
|
||||
require_once('../include/benutzerberechtigung.class.php');
|
||||
require_once('../include/functions.inc.php');
|
||||
require_once('../include/notiz.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
$rechte = new benutzerberechtigung();
|
||||
@@ -34,6 +35,10 @@ if(!$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('assistenz') && !$r
|
||||
|
||||
if(isset($_GET['id']) && is_numeric($_GET['id']))
|
||||
{
|
||||
$notiz = new notiz();
|
||||
if(!$notiz->isNotizDokument($_GET['id']))
|
||||
die('Dokument wurde nicht gefunden oder haengt nicht an einer Notiz');
|
||||
|
||||
$dms = new dms();
|
||||
if(!$dms->load($_GET['id']))
|
||||
die('Kein Dokument vorhanden');
|
||||
|
||||
@@ -587,4 +587,27 @@ class notiz extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prueft ob das Dokument an einer Notiz haengt
|
||||
* @param $dms_id DMS id des Dokuments.
|
||||
* @return boolean true wenn das Dokument an einer Notiz hängt, sonst false.
|
||||
*/
|
||||
public function isNotizDokument($dms_id)
|
||||
{
|
||||
$qry = "SELECT * FROM public.tbl_notiz_dokument WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER);
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
if($this->db_num_rows($result)>0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user