mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 08:22:17 +00:00
Permission Problem workaround
This commit is contained in:
@@ -137,9 +137,11 @@ class DB_Model extends FHC_Model
|
||||
return $this->_error(lang('fhc_'.FHC_NOPK), FHC_MODEL_ERROR);
|
||||
|
||||
|
||||
// Check rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->dbTable], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->dbTable], FHC_MODEL_ERROR);
|
||||
// Check rights only if this method is called from a model
|
||||
//var_dump(get_called_class());
|
||||
if (substr(get_called_class(), -6) == '_model')
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->dbTable], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->dbTable], FHC_MODEL_ERROR);
|
||||
|
||||
// DB-SELECT
|
||||
// Check for composite Primary Key
|
||||
@@ -173,8 +175,11 @@ class DB_Model extends FHC_Model
|
||||
return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->dbTable], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->dbTable], FHC_MODEL_ERROR);
|
||||
// Check rights only if this method is called from a model
|
||||
//var_dump(get_called_class());
|
||||
if (substr(get_called_class(), -6) == '_model')
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->dbTable], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->dbTable], FHC_MODEL_ERROR);
|
||||
|
||||
// DB-SELECT
|
||||
if (is_null($where))
|
||||
@@ -204,9 +209,11 @@ class DB_Model extends FHC_Model
|
||||
return $this->_error(lang('fhc_'.FHC_NOPK), FHC_MODEL_ERROR);
|
||||
|
||||
|
||||
// Check rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->dbTable], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->dbTable], FHC_MODEL_ERROR);
|
||||
// Check rights only if this method is called from a model
|
||||
//var_dump(get_called_class());
|
||||
if (substr(get_called_class(), -6) == '_model')
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->dbTable], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->dbTable], FHC_MODEL_ERROR);
|
||||
|
||||
// DB-SELECT
|
||||
$result = $this->db->get($this->dbTable);
|
||||
@@ -229,8 +236,11 @@ class DB_Model extends FHC_Model
|
||||
return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR);
|
||||
|
||||
// Check rights for joined table
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$joinTable], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$joinTable], FHC_MODEL_ERROR);
|
||||
// Check rights only if this method is called from a model
|
||||
//var_dump(get_called_class());
|
||||
if (substr(get_called_class(), -6) == '_model')
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$joinTable], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$joinTable], FHC_MODEL_ERROR);
|
||||
|
||||
$this->db->join($joinTable, $cond, $type);
|
||||
|
||||
@@ -300,9 +310,11 @@ class DB_Model extends FHC_Model
|
||||
if (is_null($this->pk))
|
||||
return $this->_error(lang('fhc_'.FHC_NOPK), FHC_MODEL_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->dbTable], 'd'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->dbTable], FHC_MODEL_ERROR);
|
||||
// Check rights only if this method is called from a model
|
||||
//var_dump(get_called_class());
|
||||
if (substr(get_called_class(), -6) == '_model')
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl[$this->dbTable], 'd'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl[$this->dbTable], FHC_MODEL_ERROR);
|
||||
|
||||
// DB-DELETE
|
||||
// Check for composite Primary Key
|
||||
|
||||
@@ -49,8 +49,14 @@ class benutzer extends person
|
||||
* Laedt Benutzer mit der uebergebenen ID
|
||||
* @param $uid ID der Person die geladen werden soll
|
||||
*/
|
||||
public function load($uid)
|
||||
public function load($uid = null)
|
||||
{
|
||||
if (empty($uid))
|
||||
{
|
||||
$this->errormsg = "UID not set!";
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry = "SELECT * FROM public.tbl_benutzer WHERE uid=".$this->db_add_param($uid);
|
||||
|
||||
if($this->db_query($qry))
|
||||
|
||||
@@ -50,8 +50,14 @@ class berechtigung extends Berechtigung_model
|
||||
* @param $berechtigung_kurzbz
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load($berechtigung_kurzbz)
|
||||
public function load($berechtigung_kurzbz = null)
|
||||
{
|
||||
if (empty($berechtigung_kurzbz))
|
||||
{
|
||||
$this->errormsg = "berechtigung not set!";
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = parent::load($berechtigung_kurzbz);
|
||||
|
||||
if (is_object($result) && $result->error == EXIT_SUCCESS && is_array($result->retval))
|
||||
|
||||
@@ -109,9 +109,10 @@ class funktion extends Funktion_model
|
||||
* @param $funktion_kurzbz ID der zu ladenden Funktion
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load($funktion_kurzbz)
|
||||
public function load($funktion_kurzbz = null)
|
||||
{
|
||||
if ($funktion_kurzbz == '')
|
||||
|
||||
if (empty($funktion_kurzbz) || $funktion_kurzbz == '')
|
||||
{
|
||||
$this->errormsg = 'funktion_bz darf nicht leer sein';
|
||||
return false;
|
||||
@@ -218,4 +219,4 @@ class funktion extends Funktion_model
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -87,7 +87,7 @@ class person extends Person_model
|
||||
* @param int $personId ID der Person die geladen werden soll.
|
||||
* @return bool
|
||||
**/
|
||||
public function load($personId)
|
||||
public function load($personId = null)
|
||||
{
|
||||
//person_id auf gueltigkeit pruefen
|
||||
if (is_numeric($personId) && $personId != '')
|
||||
|
||||
@@ -80,7 +80,7 @@ class statistik extends Statistik_model
|
||||
* Laedt eine Statistik
|
||||
* @param $statistik_kurzbz
|
||||
*/
|
||||
public function load($statistik_kurzbz)
|
||||
public function load($statistik_kurzbz = null)
|
||||
{
|
||||
$result = parent::load($statistik_kurzbz);
|
||||
|
||||
|
||||
@@ -59,8 +59,14 @@ class studiensemester extends Studiensemester_model
|
||||
*
|
||||
* @param $studiensemester_kurzbz Stsem das geladen werden soll
|
||||
*/
|
||||
public function load($studiensemester_kurzbz)
|
||||
public function load($studiensemester_kurzbz = null)
|
||||
{
|
||||
if (empty($studiensemester_kurzbz))
|
||||
{
|
||||
$this->errormsg = "studiensemester not set!";
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = parent::load($studiensemester_kurzbz);
|
||||
|
||||
if (is_object($result) && $result->error == EXIT_SUCCESS && is_array($result->retval))
|
||||
|
||||
Reference in New Issue
Block a user