summaryrefslogtreecommitdiffstats
path: root/modules/main.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/main.inc.php')
-rw-r--r--modules/main.inc.php16
1 files changed, 16 insertions, 0 deletions
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);
}