mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b891d8baa5 | |||
| 5dbcf9ce70 | |||
| c26db6cc40 | |||
| 8548b93ddc | |||
| bdc4782e9d | |||
| 0583990870 | |||
| 335753be8c | |||
| 8862f050e8 | |||
| 29f9b226ab |
@@ -64,7 +64,7 @@ class AuthLib
|
||||
{
|
||||
// - The uid must be NOT an empty string
|
||||
// - The current user should NOT be already logged as the given uid
|
||||
if (!isEmptyString($uid) && $this->getAuthObj()->{self::AO_USERNAME} != $uid)
|
||||
if (!isEmptyString($uid) && $this->getAuthObj()->username != $uid)
|
||||
{
|
||||
$this->_ci->load->library('PermissionLib'); // Loads permissions library
|
||||
|
||||
@@ -75,28 +75,8 @@ class AuthLib
|
||||
$loginAS = $this->_createAuthObjByPerson(array('uid' => $uid));
|
||||
if (isSuccess($loginAS))
|
||||
{
|
||||
$authObj = getData($loginAS); // get the authenticate object
|
||||
|
||||
// Store the new authentication object in authentication session
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, $authObj);
|
||||
|
||||
$authObjOrigin = getSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ_ORIGIN);
|
||||
|
||||
// Load the LogLib
|
||||
$this->_ci->load->library('LogLib');
|
||||
// Setup the LogLib
|
||||
$this->_ci->loglib->setConfigs(
|
||||
array(
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => $authObjOrigin->{self::AO_USERNAME}, // current logged user
|
||||
'requestId' => 'API'
|
||||
)
|
||||
);
|
||||
// Log into the database
|
||||
$this->_ci->loglib->logInfoDB(
|
||||
'The user "'.$authObjOrigin->{self::AO_USERNAME}.'" has changed identity with the user "'.$authObj->{self::AO_USERNAME}.
|
||||
'" and person id '.$authObj->{self::AO_PERSON_ID}
|
||||
);
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, getData($loginAS));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -125,7 +105,7 @@ class AuthLib
|
||||
{
|
||||
// - The person id must be a number
|
||||
// - The current user should NOT be already logged as the given person id
|
||||
if (is_numeric($person_id) && $this->getAuthObj()->{self::AO_PERSON_ID} != $person_id)
|
||||
if (is_numeric($person_id) && $this->getAuthObj()->person_id != $person_id)
|
||||
{
|
||||
$this->_ci->load->library('PermissionLib'); // Loads permissions library
|
||||
|
||||
@@ -144,24 +124,6 @@ class AuthLib
|
||||
{
|
||||
// Store the new authentication object in authentication session
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, $authObj);
|
||||
|
||||
$authObjOrigin = getSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ_ORIGIN);
|
||||
|
||||
// Load the LogLib
|
||||
$this->_ci->load->library('LogLib');
|
||||
// Setup the LogLib
|
||||
$this->_ci->loglib->setConfigs(
|
||||
array(
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => $authObjOrigin->{self::AO_USERNAME}, // current logged user
|
||||
'requestId' => 'API'
|
||||
)
|
||||
);
|
||||
// Log into the database
|
||||
$this->_ci->loglib->logInfoDB(
|
||||
'The user "'.$authObjOrigin->{self::AO_USERNAME}.'" has changed identity with the user "'.$authObj->{self::AO_USERNAME}.
|
||||
'" and person id '.$authObj->{self::AO_PERSON_ID}
|
||||
);
|
||||
}
|
||||
else // if does NOT have permissions
|
||||
{
|
||||
@@ -210,22 +172,6 @@ class AuthLib
|
||||
// The LoginAs account is logged out
|
||||
// The user is again connected with its real account
|
||||
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, $authObjOrigin);
|
||||
|
||||
// Load the LogLib
|
||||
$this->_ci->load->library('LogLib');
|
||||
// Setup the LogLib
|
||||
$this->_ci->loglib->setConfigs(
|
||||
array(
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => $authObjOrigin->{self::AO_USERNAME}, // current logged user
|
||||
'requestId' => 'API'
|
||||
)
|
||||
);
|
||||
// Log into the database
|
||||
$this->_ci->loglib->logInfoDB(
|
||||
'The user "'.$authObjOrigin->{self::AO_USERNAME}.'" has logout from the user "'.$authObj->{self::AO_USERNAME}.
|
||||
'" and person id '.$authObj->{self::AO_PERSON_ID}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -662,4 +608,3 @@ class AuthLib
|
||||
return $finalUserBasicDataByUID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,47 @@ class Studiensemester_model extends DB_Model
|
||||
return $this->execQuery($query, array($studiensemester_kurzbz, $limit));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the current study semester and the previous semesters of the same type (SS/WS).
|
||||
*
|
||||
* Example:
|
||||
* - SS2026, limit 3: SS2026, SS2025, SS2024
|
||||
* - WS2025, limit 2: WS2025, WS2024
|
||||
*
|
||||
* @param $studiensemester_kurzbz
|
||||
* @param $limit
|
||||
*/
|
||||
public function getPreviousSameSemesterFrom($studiensemester_kurzbz, $limit = 1)
|
||||
{
|
||||
$qry = '
|
||||
SELECT
|
||||
studiensemester_kurzbz,
|
||||
start,
|
||||
ende
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
SUBSTRING(studiensemester_kurzbz FROM 1 FOR 2) = SUBSTRING(? FROM 1 FOR 2)
|
||||
AND start <= (
|
||||
SELECT start
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE studiensemester_kurzbz = ?
|
||||
)
|
||||
ORDER BY
|
||||
start DESC
|
||||
LIMIT ?
|
||||
';
|
||||
|
||||
return $this->execQuery($qry,
|
||||
[
|
||||
$studiensemester_kurzbz,
|
||||
$studiensemester_kurzbz,
|
||||
$limit
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* getNearest
|
||||
*/
|
||||
|
||||
@@ -260,7 +260,6 @@ class Benutzerfunktion_model extends DB_Model
|
||||
return $this->execQuery($query, $parameters_array);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get active Kompetenzfeldleitung bei UID.
|
||||
*
|
||||
@@ -296,7 +295,6 @@ class Benutzerfunktion_model extends DB_Model
|
||||
return $this->execQuery($query, $parameters_array);
|
||||
}
|
||||
|
||||
|
||||
public function insertBenutzerfunktion($Json)
|
||||
{
|
||||
unset($Json['benutzerfunktion_id']);
|
||||
|
||||
@@ -218,15 +218,23 @@ export const CoreFilterCmpt = {
|
||||
},
|
||||
columnsForFilter() {
|
||||
if (!this.filteredColumns || !this.datasetMetadata) return [];
|
||||
const localizedColumnTitles = this.tabulator.getLang().columns;
|
||||
|
||||
const isTabulatorLocalized = !!this.$props.tabulatorOptions.locale;
|
||||
const filterTitles = this.filteredColumns.reduce((a, c) => {
|
||||
a[c.field] =
|
||||
isTabulatorLocalized && localizedColumnTitles[c.field]
|
||||
? localizedColumnTitles[c.field]
|
||||
: c.title;
|
||||
return a;
|
||||
}, {});
|
||||
|
||||
let filterTitles;
|
||||
if (isTabulatorLocalized) {
|
||||
const localizedColumnTitles = this.tabulator.getLang().columns;
|
||||
filterTitles = this.filteredColumns.reduce((a, c) => {
|
||||
a[c.field] = localizedColumnTitles[c.field];
|
||||
return a;
|
||||
}, {});
|
||||
} else {
|
||||
filterTitles = this.filteredColumns.reduce((a, c) => {
|
||||
a[c.field] = c.title;
|
||||
return a;
|
||||
}, {});
|
||||
}
|
||||
|
||||
return this.datasetMetadata.map((el) => ({
|
||||
...el,
|
||||
...{ title: filterTitles[el.name] },
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 79 KiB |
Reference in New Issue
Block a user