change concatenation of verband, use contact email in Stv search result, use dummy image when viewing anothers profile and foto is null or foto_sperre is not false

This commit is contained in:
Harald Bamberger
2024-12-13 12:09:16 +01:00
parent 5a174e554a
commit f62108f1d4
2 changed files with 13 additions and 8 deletions
@@ -495,12 +495,11 @@ class Profil extends FHCAPI_Controller
*/
private function getPersonInfo($uid, $geburtsInfo = null)
{
$selectClause = ["foto", "anrede", "titelpost as postnomen", "titelpre as titel", "vorname", "nachname"];
$selectClause = ["foto", "foto_sperre", "anrede", "titelpost as postnomen", "titelpre as titel", "vorname", "nachname"];
/** @param integer $geburtsInfo */
if ($geburtsInfo) {
array_push($selectClause, "gebort");
array_push($selectClause, "gebdatum");
array_push($selectClause, "foto_sperre");
}
$this->BenutzerModel->addSelect($selectClause);
$this->BenutzerModel->addJoin("tbl_person", "person_id");
@@ -512,6 +511,12 @@ class Profil extends FHCAPI_Controller
$person_res = hasData($person_res) ? getData($person_res)[0] : null;
}
if( ($person_res->foto === null) || (($this->uid !== $uid) && ($person_res->foto_sperre !== false)) )
{
$dummy_foto = base64_encode(file_get_contents(DOC_ROOT.'skin/images/profilbild_dummy.jpg'));
$person_res->foto = $dummy_foto;
}
return $person_res;
}