mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 09:52:22 +00:00
Merge branch 'master' into udf
This commit is contained in:
@@ -68,11 +68,11 @@ class DmsLib
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getAktenAcceptedDms($person_id, $dokument_kurzbz = null)
|
||||
public function getAktenAcceptedDms($person_id, $dokument_kurzbz = null, $no_file = null)
|
||||
{
|
||||
$result = $this->ci->AkteModel->getAktenAcceptedDms($person_id, $dokument_kurzbz);
|
||||
|
||||
if (hasData($result))
|
||||
if (hasData($result) && $no_file == null)
|
||||
{
|
||||
for ($i = 0; $i < count($result->retval); $i++)
|
||||
{
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
* @filesource
|
||||
*/
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
require_once FCPATH.'include/authentication.class.php';
|
||||
require_once FCPATH.'include/AddonAuthentication.php';
|
||||
|
||||
require_once FHCPATH.'include/authentication.class.php';
|
||||
require_once FHCPATH.'include/AddonAuthentication.php';
|
||||
|
||||
/**
|
||||
* FHC-Auth Helpers
|
||||
|
||||
@@ -453,7 +453,7 @@ class MessageLib
|
||||
// If the person has an email account
|
||||
if (!is_null($result->retval[$i]->receiver) && $result->retval[$i]->receiver != '')
|
||||
{
|
||||
$href = APP_ROOT . $this->ci->config->item('message_html_view_url') . $result->retval[0]->token;
|
||||
$href = $this->ci->config->item('message_server') . $this->ci->config->item('message_html_view_url') . $result->retval[0]->token;
|
||||
// Using a template for the html email body
|
||||
$body = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
@@ -588,7 +588,7 @@ class MessageLib
|
||||
if ($multiPartMime === true)
|
||||
{
|
||||
// Using a template for the html email body
|
||||
$href = APP_ROOT . $this->ci->config->item('message_html_view_url') . $result->retval[0]->token;
|
||||
$href = $this->ci->config->item('message_server') . $this->ci->config->item('message_html_view_url') . $result->retval[0]->token;
|
||||
$bodyMsg = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
|
||||
@@ -59,7 +59,48 @@ class OrganisationseinheitLib
|
||||
return $this->treeSearch($schema, $table, $select, $where, $orderby, $result->retval[0]->_ppk);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function treeSearchEntire($table, $alias, $fields, $where, $orderby, $oe_kurzbz)
|
||||
{
|
||||
$select = "";
|
||||
if (is_array($fields))
|
||||
{
|
||||
for ($i = 0; $i < count($fields); $i++)
|
||||
{
|
||||
$select .= $fields[$i];
|
||||
if ($i != count($fields) - 1)
|
||||
{
|
||||
$select .= ", ";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$select = $fields;
|
||||
}
|
||||
|
||||
$result = $this->ci->OrganisationseinheitModel->getOneLevelAlias($table, $alias, $select, $where, $orderby, $oe_kurzbz);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
if ($result->retval[0]->_pk != null && $result->retval[0]->_ppk != null && $result->retval[0]->_jtpk != null)
|
||||
{
|
||||
$tmpResult = $this->treeSearchEntire($table, $alias, $select, $where, $orderby, $result->retval[0]->_ppk);
|
||||
|
||||
if (hasData($tmpResult) && $tmpResult->retval[0]->_pk != null && $tmpResult->retval[0]->_ppk != null && $tmpResult->retval[0]->_jtpk != null)
|
||||
{
|
||||
$result->retval = array_merge($result->retval, $tmpResult->retval);
|
||||
}
|
||||
}
|
||||
else if ($result->retval[0]->_ppk != null)
|
||||
{
|
||||
$result = $this->treeSearchEntire($table, $alias, $select, $where, $orderby, $result->retval[0]->_ppk);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -11,15 +11,15 @@
|
||||
* @filesource
|
||||
*/
|
||||
|
||||
if (! defined('FCPATH')) exit('No direct script access allowed');
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once(FCPATH.'include/basis_db.class.php');
|
||||
require_once(FCPATH.'include/organisationseinheit.class.php');
|
||||
require_once(FCPATH.'include/studiengang.class.php');
|
||||
require_once(FCPATH.'include/fachbereich.class.php');
|
||||
require_once(FCPATH.'include/functions.inc.php');
|
||||
require_once(FCPATH.'include/wawi_kostenstelle.class.php');
|
||||
require_once(FCPATH.'include/benutzerberechtigung.class.php');
|
||||
require_once(FHCPATH.'include/basis_db.class.php');
|
||||
require_once(FHCPATH.'include/organisationseinheit.class.php');
|
||||
require_once(FHCPATH.'include/studiengang.class.php');
|
||||
require_once(FHCPATH.'include/fachbereich.class.php');
|
||||
require_once(FHCPATH.'include/functions.inc.php');
|
||||
require_once(FHCPATH.'include/wawi_kostenstelle.class.php');
|
||||
require_once(FHCPATH.'include/benutzerberechtigung.class.php');
|
||||
|
||||
class PermissionLib
|
||||
{
|
||||
@@ -29,34 +29,36 @@ class PermissionLib
|
||||
const INSERT_RIGHT = 'i';
|
||||
const DELETE_RIGHT = 'd';
|
||||
const REPLACE_RIGHT = 'ui';
|
||||
|
||||
private $bb; // benutzerberechtigung
|
||||
|
||||
private $acl; // conversion array from a source to a permission
|
||||
|
||||
private static $bb; // benutzerberechtigung
|
||||
|
||||
/**
|
||||
*
|
||||
* PermissionLib's constructor
|
||||
* Here is initialized the static property bb with all the rights of the user (API caller)
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
// Loads CI instance
|
||||
$this->ci =& get_instance();
|
||||
|
||||
|
||||
// Loads the library to manage the rights system
|
||||
//$this->ci->load->library('FHC_DB_ACL');
|
||||
|
||||
|
||||
// Loads the auth helper
|
||||
$this->ci->load->helper('fhcauth');
|
||||
|
||||
|
||||
// Loads the array of resources
|
||||
$this->acl = $this->ci->config->item('fhc_acl');
|
||||
|
||||
//
|
||||
$this->bb = new benutzerberechtigung();
|
||||
// API Caller rights initialization
|
||||
self::$bb = new benutzerberechtigung();
|
||||
self::$bb->getBerechtigungen(getAuthUID());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the user is entitled to get access to a source with the given access type
|
||||
*
|
||||
*
|
||||
* @return bool <b>true</b> if a user has the right to access to the specified
|
||||
* resource with a specified permission type, <b>false</b> otherwise
|
||||
*/
|
||||
@@ -66,7 +68,7 @@ class PermissionLib
|
||||
if (isset($this->acl[$sourceName]))
|
||||
{
|
||||
// Checks permission
|
||||
return $this->isBerechtigt($this->acl[$sourceName], $permissionType);
|
||||
return $this->_isBerechtigt($this->acl[$sourceName], $permissionType);
|
||||
}
|
||||
// if the resource does not exist, do not lose useful clock cycles
|
||||
else
|
||||
@@ -74,7 +76,7 @@ class PermissionLib
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a permission by a given source
|
||||
*/
|
||||
@@ -89,20 +91,22 @@ class PermissionLib
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Checks user's (API caller) rights
|
||||
*/
|
||||
private function isBerechtigt($berechtigung_kurzbz, $art = null, $oe_kurzbz = null, $kostenstelle_id = null)
|
||||
private function _isBerechtigt($berechtigung_kurzbz, $art = null, $oe_kurzbz = null, $kostenstelle_id = null)
|
||||
{
|
||||
$isBerechtigt = false;
|
||||
|
||||
if (!is_null($berechtigung_kurzbz))
|
||||
{
|
||||
$this->bb->getBerechtigungen(getAuthUID());
|
||||
return $this->bb->isBerechtigt($berechtigung_kurzbz, $oe_kurzbz, $art, $kostenstelle_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
if(self::$bb->isBerechtigt($berechtigung_kurzbz, $oe_kurzbz, $art, $kostenstelle_id))
|
||||
{
|
||||
$isBerechtigt = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $isBerechtigt;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,14 @@ class ReihungstestLib
|
||||
*/
|
||||
public function insertPersonReihungstest($ddReihungstest)
|
||||
{
|
||||
return $this->ci->RtPersonModel->insert($ddReihungstest);
|
||||
if (isset($ddReihungstest['rt_id']) && $this->checkAvailability($ddReihungstest['rt_id']))
|
||||
{
|
||||
return $this->ci->RtPersonModel->insert($ddReihungstest);
|
||||
}
|
||||
else
|
||||
{
|
||||
return error('This test is not more available');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,4 +69,19 @@ class ReihungstestLib
|
||||
|
||||
return $this->ci->ReihungstestModel->loadWhere($parametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* It checks if the test is available
|
||||
*/
|
||||
public function checkAvailability($reihungstest_id)
|
||||
{
|
||||
$result = $this->ci->ReihungstestModel->checkAvailability($reihungstest_id);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user