mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
- In Emails muss ein @ enthalten sein
- loadArray für Organisationseinheiten
This commit is contained in:
@@ -639,5 +639,44 @@ class benutzerberechtigung extends basis_db
|
||||
sort($fachbereich_kurzbz);
|
||||
return $fachbereich_kurzbz;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt Array mit den Organisationseinheiten zurueck fuer welche die
|
||||
* Person eine Berechtigung besitzt.
|
||||
* Optional wird auf Berechtigung eingeschraenkt.
|
||||
*/
|
||||
public function getOEkurzbz($berechtigung_kurzbz=null)
|
||||
{
|
||||
$oe_kurzbz=array();
|
||||
$timestamp=time();
|
||||
$in='';
|
||||
$not='';
|
||||
$all=false;
|
||||
|
||||
foreach ($this->berechtigungen as $b)
|
||||
{
|
||||
if (($berechtigung_kurzbz==$b->berechtigung_kurzbz || $berechtigung_kurzbz==null)
|
||||
&& (($timestamp>$b->starttimestamp || $b->starttimestamp==null) && ($timestamp<$b->endetimestamp || $b->endetimestamp==null)))
|
||||
{
|
||||
if($b->negativ)
|
||||
{
|
||||
//Negativ-Recht
|
||||
if(!is_null($b->oe_kurzbz))
|
||||
$not .="'".addslashes($b->oe_kurzbz)."',";
|
||||
else
|
||||
return array();
|
||||
}
|
||||
else
|
||||
{
|
||||
$oe_kurzbz[] = $b->oe_kurzbz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$studiengang_kz=array_unique($oe_kurzbz);
|
||||
sort($oe_kurzbz);
|
||||
return $oe_kurzbz;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -131,6 +131,11 @@ class kontakt extends basis_db
|
||||
$this->errormsg = 'kontakt darf nicht länger als 128 Zeichen sein';
|
||||
return false;
|
||||
}
|
||||
if($this->kontakttyp=='email' && !strstr($this->kontakt, '@'))
|
||||
{
|
||||
$this->errormsg = 'Wenn der Typ E-Mail ausgewählt wurde, muss der Kontakt ein @ enthalten!';
|
||||
return false;
|
||||
}
|
||||
$this->errormsg = '';
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -319,5 +319,48 @@ class organisationseinheit extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt die Organisationseinheiten die als Array uebergeben werden
|
||||
* @param $kurzbzs Array mit den kurzbezeichnungen
|
||||
* @param $order Sortierreihenfolge
|
||||
* @param $aktiv wenn true dann nur aktive sonst alle
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function loadArray($kurzbzs, $order=null, $aktiv=true)
|
||||
{
|
||||
if(count($kurzbzs)==0)
|
||||
return true;
|
||||
|
||||
$kurzbzs = "'".implode("','",$kurzbzs)."'";
|
||||
|
||||
$qry = 'SELECT * FROM public.tbl_organisationseinheit WHERE oe_kurzbz in('.$kurzbzs.')';
|
||||
if ($aktiv)
|
||||
$qry.=' AND aktiv=true';
|
||||
|
||||
if($order!=null)
|
||||
$qry .=" ORDER BY $order";
|
||||
|
||||
if(!$result = $this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = 'Datensatz konnte nicht geladen werden';
|
||||
return false;
|
||||
}
|
||||
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$obj = new organisationseinheit();
|
||||
|
||||
$obj->oe_kurzbz = $row->oe_kurzbz;
|
||||
$obj->oe_parent_kurzbz = $row->oe_parent_kurzbz;
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->organisationseinheittyp_kurzbz = $row->organisationseinheittyp_kurzbz;
|
||||
$obj->aktiv = ($row->aktiv=='t'?true:false);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user