mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
ACL-System
This commit is contained in:
@@ -19,8 +19,8 @@ class Person_model extends DB_Model
|
||||
|
||||
// Checks if the operation is permitted by the API caller
|
||||
// All the code should be put inside this if statement
|
||||
if(isAllowed($this->getAddonID(), 'person'))
|
||||
{
|
||||
/*if(isAllowed($this->getAddonID(), 'person'))
|
||||
{*/
|
||||
if((isset($code)) && (isset($email)))
|
||||
{
|
||||
$result = $this->_getPersonByCodeAndEmail($code, $email);
|
||||
@@ -33,7 +33,7 @@ class Person_model extends DB_Model
|
||||
{
|
||||
$result = $this->_getPersonByID($personId);
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -826,4 +826,4 @@ class Person_model extends DB_Model
|
||||
->where("p.zugangscode", $code);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ class Prestudent_model extends DB_Model
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -19,11 +19,23 @@ class Prestudent_model extends DB_Model
|
||||
*/
|
||||
public function loadPrestudentPerson($prestudentID)
|
||||
{
|
||||
// Check the rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt('basis/person', 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> basis/person', FHC_MODEL_ERROR);
|
||||
|
||||
// Prepare SQL-Query
|
||||
$this->db->select('*')
|
||||
->from('public.tbl_prestudent')
|
||||
->join('public.tbl_person', 'person_id')
|
||||
->where('prestudent_id', $prestudentID);
|
||||
return $this->db->get()->result_array();
|
||||
// Do the query
|
||||
$result = $this->db->get()->result_object();
|
||||
|
||||
// Return the result
|
||||
if ($result)
|
||||
return $this->_success($result);
|
||||
else
|
||||
return $this->_error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user