Commit bf7736e4 authored by Lusito's avatar Lusito
Browse files

public information reduced

parent 03612a68
......@@ -29,26 +29,26 @@ class UserController extends BaseController {
$deprecated = $user['deprecated'];
$deprecatedMsg = $deprecated ? " (veraltet)" : "";
$showMail = ($isAdmin || $user['show_mail']);
// filter out the student number
if($showMail)
$mail = vHtml::encryptText(preg_replace("#\+[0-9]*@#", '@', $user['mail']));
$mail = isset($mail) ? ($mail . $deprecatedMsg) : "";
$innerData = array('Anzeigename:' => htmlspecialchars($user['displayname']));
if($this->user->isLoggedIn()) {
$innerData['Username:'] = htmlspecialchars($user['name'] . $deprecatedMsg);
$innerData['Vorname:'] = htmlspecialchars($user['forename']);
$innerData['Nachname:'] = htmlspecialchars($user['surname']);
}
// admin can see all emails, others only if the user said yes
if($isAdmin || $user['show_mail']) {
// filter out the student number and encrypt
$innerData['E-Mail:'] = vHtml::encryptText(preg_replace("#\+[0-9]*@#", '@', $user['mail']));
}
$innerData['Admin:'] = $user['admin'] ? "Ja" : "Nein";
$data = array(
'data' => array(
'Anzeigename:' => htmlspecialchars($user['displayname']),
'Username:' => htmlspecialchars($user['name'] . $deprecatedMsg),
'Vorname:' => htmlspecialchars($user['forename']),
'Nachname:' => htmlspecialchars($user['surname']),
'E-Mail' => $mail,
'Admin' => $user['admin'] ? "Ja" : "Nein"
),
'data' => $innerData,
'userId' => $id,
'deprecated' => $deprecated,
'isAdmin' => $isAdmin
);
if(!$this->user->isLoggedIn())
unset($data['data']['Username:']);
vTemplate::pushView('content', 'content/userinfo', $data);
$this->loadSidebar(null);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment