summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/main.inc.php7
-rw-r--r--modules/register.inc.php6
2 files changed, 10 insertions, 3 deletions
diff --git a/modules/main.inc.php b/modules/main.inc.php
index 2581a59..8873b12 100644
--- a/modules/main.inc.php
+++ b/modules/main.inc.php
@@ -34,6 +34,9 @@ class Page_Main extends Page
$this->renderShibbolethRegistered();
return;
}
+ if (!User::isTutor()) {
+ return;
+ }
// User is not in DB, so he might want so sign up for the service - see if conditions are met
if (User::getOrganization() !== false) {
// Organization is known, show signup form
@@ -67,11 +70,11 @@ class Page_Main extends Page
$data['testacc'] = true;
$mail = trim(User::getMail());
if (!empty($mail)) {
- $existing = Database::queryFirst('SELECT login FROM user WHERE email = :email LIMIT 1', array(
+ $existing = Database::queryFirst('SELECT userid FROM user WHERE email = :email LIMIT 1', array(
'email' => $mail
));
if ($existing !== false) {
- $data['testlogin'] = $existing['login'];
+ $data['testlogin'] = $existing['userid'];
}
}
}
diff --git a/modules/register.inc.php b/modules/register.inc.php
index d24d304..f9a6ef5 100644
--- a/modules/register.inc.php
+++ b/modules/register.inc.php
@@ -12,6 +12,10 @@ class Page_Register extends Page
}
if (!User::isShibbolethAuth())
Util::redirect(CONFIG_PREFIX . 'shib/?do=Main');
+
+ if (!User::isTutor()) {
+ return;
+ }
if (User::getOrganization() === false) {
Message::addError('Ihre Einrichtung {{0}} scheint kein bwIDM zu unterstützen. Bitte wenden Sie sich an den Support.',
@@ -21,7 +25,7 @@ class Page_Register extends Page
if (Request::post('testlogin')) {
// Check if one of firstname, lastname or email matches
- $user = Database::queryFirst('SELECT firstname, lastname, email, organizationid FROM user WHERE login = :login LIMIT 1', array('login' => Request::post('testlogin')));
+ $user = Database::queryFirst('SELECT firstname, lastname, email, organizationid FROM user WHERE userid = :login LIMIT 1', array('login' => Request::post('testlogin')));
if ($user === false || User::getOrganizationId() !== $user['organizationid']) {
// Invalid Login
Message::addError('Test-Account {{0}} unbekannt. '