Merged master into branch

Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2021-04-28 15:54:54 +02:00
committed by cris-technikum
parent cafd72e51d
commit 21ce118f0b
27 changed files with 2714 additions and 597 deletions
@@ -220,7 +220,7 @@ class Pruefungsprotokoll extends Auth_Controller
$nullfields = array('uhrzeit', 'endezeit', 'abschlussbeurteilung_kurzbz', 'protokoll');
foreach ($data as $idx => $item)
{
if (in_array($idx, $nullfields) & $item === '')
if (in_array($idx, $nullfields) && $item === '')
$data[$idx] = null;
}
+1 -1
View File
@@ -167,7 +167,7 @@ class LDAPLib
}
// LDAP connection
$ldapConnection = @ldap_connect($ldapConfigs[self::SERVER], $ldapConfigs[self::PORT]);
$ldapConnection = @ldap_connect($ldapConfigs[self::SERVER].':'.$ldapConfigs[self::PORT]);
if ($ldapConnection) // if success
{
// Sets the LDAP protocol version
@@ -41,4 +41,23 @@ class Projektbetreuer_model extends DB_Model
return error ('Incorrect parameter type');
}
}
/**
* Get Projektbetreuer data by authentification token
* @param $zugangstoken
* @return object
*/
public function getBetreuerByToken($zugangstoken)
{
$qry = '
SELECT tbl_projektbetreuer.person_id, tbl_projektbetreuer.projektarbeit_id, student_uid
FROM lehre.tbl_projektbetreuer
JOIN lehre.tbl_projektarbeit USING (projektarbeit_id)
WHERE zugangstoken = ? AND zugangstoken_gueltigbis >= NOW()
ORDER BY tbl_projektbetreuer.insertamum DESC, projektarbeit_id DESC
LIMIT 1
';
return $this->execQuery($qry, array($zugangstoken));
}
}
@@ -13,6 +13,11 @@ class Benutzer_model extends DB_Model
$this->hasSequence = false;
}
/**
* Gets active Benutzer from person_id
* @param $person_id
* @return object
*/
public function getFromPersonId($person_id)
{
return $this->loadWhere(array('person_id' => $person_id, 'aktiv' => true));