mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-01 19:09:27 +00:00
FHC ACL
This commit is contained in:
@@ -11,10 +11,12 @@ class MY_Model extends CI_Model
|
||||
|
||||
class DB_Model extends MY_Model
|
||||
{
|
||||
function __construct()
|
||||
function __construct($uid=null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->database();
|
||||
// Loading Tools for Access Control (Benutzerberechtigungen)
|
||||
$this->load->library('FHC_DB_ACL',array('uid' => $uid));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ require_once 'include/authentication.class.php';
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
class FHCAuth
|
||||
class FHC_Auth
|
||||
{
|
||||
/**
|
||||
* Auth Username, Password over FH-Complete
|
||||
@@ -39,7 +39,7 @@ class FHCAuth
|
||||
$auth = new authentication();
|
||||
if ($auth->checkpassword($username, $password))
|
||||
{
|
||||
echo 'Auth-Method-False';
|
||||
echo 'Auth-Method-True';
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-Helper
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016 fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link https://fhcomplete.org
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
*/
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
require_once('include/basis_db.class.php');
|
||||
require_once('include/organisationseinheit.class.php');
|
||||
require_once('include/studiengang.class.php');
|
||||
require_once('include/fachbereich.class.php');
|
||||
require_once('include/functions.inc.php');
|
||||
require_once('include/wawi_kostenstelle.class.php');
|
||||
require_once('include/benutzerberechtigung.class.php');
|
||||
|
||||
/**
|
||||
* FHC-Auth Helpers
|
||||
*
|
||||
* @package FH-Complete
|
||||
* @subpackage Libraries
|
||||
* @category Library
|
||||
* @author FHC-Team
|
||||
* @link http://fhcomplete.org/user_guide/helpers/fhcauth_helper.html
|
||||
*/
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
class FHC_DB_ACL
|
||||
{
|
||||
public $bb;
|
||||
protected $uid;
|
||||
|
||||
/**
|
||||
* Auth Username, Password over FH-Complete
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @return bool
|
||||
*/
|
||||
function __construct($uid)
|
||||
{
|
||||
$this->bb = new benutzerberechtigung();
|
||||
$this->uid = $uid;
|
||||
}
|
||||
|
||||
function isBerechtigt($berechtigung_kurzbz, $art=null, $oe_kurzbz=null, $kostenstelle_id=null)
|
||||
{
|
||||
$this->bb->getBerechtigungen($this->uid);
|
||||
return $this->bb->isBerechtigt($berechtigung_kurzbz, $oe_kurzbz=null, $art=null, $kostenstelle_id=null);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
class Person_model extends DB_Model
|
||||
{
|
||||
public function __construct()
|
||||
public function __construct($uid=null)
|
||||
{
|
||||
parent::__construct();
|
||||
parent::__construct($uid);
|
||||
}
|
||||
|
||||
public function getPersonen($person_id = FALSE)
|
||||
@@ -20,7 +20,10 @@ class Person_model extends DB_Model
|
||||
|
||||
public function getPersonByCode($code)
|
||||
{
|
||||
$query = $this->db->get_where('public.tbl_person', array('zugangscode' => $code));
|
||||
if ($this->fhc_db_acl->bb->isBerechtigt('person','s'))
|
||||
{
|
||||
$query = $this->db->get_where('public.tbl_person', array('zugangscode' => $code));
|
||||
return $query->result_object();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user