diff options
Diffstat (limited to 'modules/main.inc.php')
-rw-r--r-- | modules/main.inc.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/modules/main.inc.php b/modules/main.inc.php index ed92bd2..3f77d7b 100644 --- a/modules/main.inc.php +++ b/modules/main.inc.php @@ -10,19 +10,30 @@ class Page_Main extends Page protected function doRender() { - Render::addTemplate('main/_page', array( - 'user' => User::getLastName(), - )); + Render::addTemplate('main/_page'); if (User::isLoggedIn()) { // Logged in user -- if (User::getOrganization() !== false) { // Organization is known, show signup form if (User::isShibbolethAuth() && !User::isInDatabase()) { - Render::addTemplate('main/deploy'); + // User comes via Shibboleth and is not known yet + $data = User::getData(); + $data['organization'] = User::getOrganizationName(); + Render::addTemplate('main/deploy', $data); + } else if (User::isInDatabase()) { + // User is known from DB at least + Render::addTemplate('main/logged-in'); } } else if (User::getRemoteOrganizationId() !== false) { + // Organization is not known, see if we at least have an idea Message::addWarning('Ihre Hochschule/Einrichtung {{0}} ist leider nicht bekannt. Bitte kontaktieren Sie den Support.', User::getRemoteOrganizationId()); + } else { + // No idea where the user is coming from + Message::addError('Ihr IdP sendet leider keine Informationen über Ihre Hochschul-/Einrichtungszugehörigkeit'); } + } else { + // Guest + Render::addTemplate('main/guest'); } } |