From 5136f6622e7ca87695c158a31cb8e78299f1967a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 3 Jun 2015 14:26:22 +0200 Subject: Allow registration, add support for creating test accounts, rename satellite to organization --- modules/main.inc.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'modules/main.inc.php') diff --git a/modules/main.inc.php b/modules/main.inc.php index c1382e6..3e3aff8 100644 --- a/modules/main.inc.php +++ b/modules/main.inc.php @@ -59,6 +59,22 @@ class Page_Main extends Page { $data = User::getData(); $data['organization'] = User::getOrganizationName(); + // Shoe testacc merge form if organization has test accounts + $res = Database::queryFirst('SELECT Count(*) as cnt FROM user WHERE organizationid = :oid', array( + 'oid' => User::getOrganizationId() + )); + if ($res !== false && $res['cnt'] > 0) { + $data['testacc'] = true; + $mail = trim(User::getMail()); + if (!empty($mail)) { + $existing = Database::queryFirst('SELECT login FROM user WHERE email = :email LIMIT 1', array( + 'email' => $mail + )); + if ($existing !== false) { + $data['testlogin'] = $existing['login']; + } + } + } Render::addTemplate('main/deploy', $data); } -- cgit v1.2.3-55-g7522