summaryrefslogtreecommitdiffstats
path: root/hosted
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-09-27 09:25:14 +0200
committerAleksander Machniak <alec@alec.pl>2012-09-27 09:25:14 +0200
commit71fe77ab8367cb4473e6bac7d8f002f82a121b99 (patch)
tree3e8ca4b5efe38bc08fa6d6a7ef53a258f27c5388 /hosted
parent987a93aec322f7b8171d8f492a01dc7de5ae011c (diff)
downloadwebadmin-71fe77ab8367cb4473e6bac7d8f002f82a121b99.tar.gz
Integrate hosted/signup with core, fix Smarty cache issue (#1044)
Diffstat (limited to 'hosted')
-rw-r--r--hosted/index.php11
l---------hosted/js1
l---------hosted/js/jquery.min.js1
l---------hosted/js/kolab_admin.js1
-rw-r--r--hosted/js/kolab_hosted.js120
l---------hosted/skins1
-rw-r--r--hosted/skins/default/hosted.css44
l---------hosted/skins/default/images/error.png1
l---------hosted/skins/default/images/favicon.png1
l---------hosted/skins/default/images/info.png1
l---------hosted/skins/default/images/loading.gif1
-rw-r--r--hosted/skins/default/images/logo.pngbin17755 -> 0 bytes
l---------hosted/skins/default/style.css1
-rw-r--r--hosted/skins/default/templates/footer.html1
-rw-r--r--hosted/skins/default/templates/signup.html41
l---------hosted/skins/default/ui.js1
-rw-r--r--hosted/skins/kolabsys/hosted.css26
l---------hosted/skins/kolabsys/images/error.png1
l---------hosted/skins/kolabsys/images/favicon.png1
l---------hosted/skins/kolabsys/images/info.png1
l---------hosted/skins/kolabsys/images/loading.gif1
l---------hosted/skins/kolabsys/style.css1
-rw-r--r--hosted/skins/kolabsys/templates/signup.html20
l---------hosted/skins/kolabsys/ui.js1
l---------hosted/skins/minimal/hosted.css1
l---------hosted/skins/minimal/images/error.png1
l---------hosted/skins/minimal/images/favicon.png1
l---------hosted/skins/minimal/images/info.png1
l---------hosted/skins/minimal/images/loading.gif1
l---------hosted/skins/minimal/style.css1
-rw-r--r--hosted/skins/minimal/templates/footer.html1
-rw-r--r--hosted/skins/minimal/templates/signup.html23
l---------hosted/skins/minimal/ui.js1
33 files changed, 3 insertions, 307 deletions
diff --git a/hosted/index.php b/hosted/index.php
index 867a6e1..6414cbe 100644
--- a/hosted/index.php
+++ b/hosted/index.php
@@ -26,16 +26,7 @@
// environment initialization
require_once '../lib/functions.php';
-// starting task
-$task = kolab_utils::get_input('task', kolab_utils::REQUEST_GET);
-
-if (!$task) {
- $task = 'signup';
-}
-
-$class = "kolab_client_task_$task";
-
-$KADM = new $class;
+$KADM = new kolab_client_task_signup;
// run actions and send output
$KADM->run();
diff --git a/hosted/js b/hosted/js
new file mode 120000
index 0000000..050426c
--- /dev/null
+++ b/hosted/js
@@ -0,0 +1 @@
+../public_html/js \ No newline at end of file
diff --git a/hosted/js/jquery.min.js b/hosted/js/jquery.min.js
deleted file mode 120000
index c3b1873..0000000
--- a/hosted/js/jquery.min.js
+++ /dev/null
@@ -1 +0,0 @@
-../../public_html/js/jquery.min.js \ No newline at end of file
diff --git a/hosted/js/kolab_admin.js b/hosted/js/kolab_admin.js
deleted file mode 120000
index ea11949..0000000
--- a/hosted/js/kolab_admin.js
+++ /dev/null
@@ -1 +0,0 @@
-../../public_html/js/kolab_admin.js \ No newline at end of file
diff --git a/hosted/js/kolab_hosted.js b/hosted/js/kolab_hosted.js
deleted file mode 100644
index 9f717ae..0000000
--- a/hosted/js/kolab_hosted.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- +--------------------------------------------------------------------------+
- | This file is part of the Kolab Web Admin Panel |
- | |
- | Copyright (C) 2011-2012, Kolab Systems AG |
- | |
- | This program is free software: you can redistribute it and/or modify |
- | it under the terms of the GNU Affero General Public License as published |
- | by the Free Software Foundation, either version 3 of the License, or |
- | (at your option) any later version. |
- | |
- | This program is distributed in the hope that it will be useful, |
- | but WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- | GNU Affero General Public License for more details. |
- | |
- | You should have received a copy of the GNU Affero General Public License |
- | along with kadm program. If not, see <http://www.gnu.org/licenses/> |
- +--------------------------------------------------------------------------+
- | Author: Torsten Grote <grote@kolabsys.com> |
- +--------------------------------------------------------------------------+
-*/
-
-// overwrite user_save() function
-kadm.user_save = function(reload, section)
-{
- var data = kadm.serialize_form('#'+this.env.form_id);
-
- // check email address
- if(typeof data.mailalternateaddress != 'undefined' && !isValidEmailAddress(data.mailalternateaddress)) {
- kadm.display_message('signup.wrongmailalternateaddress', 'error');
- kadm.form_value_error('mailalternateaddress');
- return;
- }
-
- if (!kadm.check_required_fields(data)) {
- kadm.display_message('form.required.empty', 'error');
- return;
- }
-
- // check password
- if (data.userpassword != data.userpassword2) {
- kadm.display_message('user.password.mismatch', 'error');
- kadm.form_value_error('userpassword2');
- return;
- }
- delete data['userpassword2'];
-
- kadm.http_post('signup.add_user', {data: data});
-};
-
-kadm.change_user_type = function()
-{
- var data = kadm.serialize_form('#'+this.env.form_id);
-
- kadm.http_post('signup.default', {data: data});
-};
-
-kadm.check_user_availability = function()
-{
- // get form data and build new email address
- var data = kadm.serialize_form('#signup-form');
- var mail = data['uid'] + '@' + data['domain'];
-
- if(isValidEmailAddress(mail)) {
- // update future mail form field
- $('input[name="mail"]').val(mail);
-
- // check if user with that email address already exists
- kadm.http_post('signup.check_user', {data: data});
- } else {
- kadm.update_user_info('signup.wronguid', 'uid');
- }
-};
-
-kadm.update_user_info = function(msg, part)
-{
- var span_id = 'availability';
- if(!part.localeCompare('userpassword')) {
- span_id = 'pass_match';
- }
-
- if (msg) {
- msg = kadm.t(msg);
- }
-
- // display message next to form field
- if($('span[id="'+span_id+'"]').length) {
- // update existing span area
- $('span[id="'+span_id+'"]').html(msg);
- }
- else {
- // add span area and add message
- $('input[name="'+part+'"]').after(' <span id="'+span_id+'" class="form_error">' + msg + '</span>');
- }
-
- // enable/disable button
- if(msg == '') {
- $('input[type="button"]').removeAttr("disabled");
- } else {
- $('input[type="button"]').attr("disabled", "disabled");
- }
-};
-
-
-function password_match()
-{
- if($('input[name="userpassword"]').val().localeCompare($('input[name="userpassword2"]').val())) {
- kadm.update_user_info('user.password.mismatch', 'userpassword');
- }
- else {
- kadm.update_user_info('', 'userpassword');
- }
-}
-
-// TODO use form.validate api call for that
-function isValidEmailAddress(emailAddress) {
- var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
- return pattern.test(emailAddress);
-};
diff --git a/hosted/skins b/hosted/skins
new file mode 120000
index 0000000..5327ffe
--- /dev/null
+++ b/hosted/skins
@@ -0,0 +1 @@
+../public_html/skins \ No newline at end of file
diff --git a/hosted/skins/default/hosted.css b/hosted/skins/default/hosted.css
deleted file mode 100644
index bba4df6..0000000
--- a/hosted/skins/default/hosted.css
+++ /dev/null
@@ -1,44 +0,0 @@
-body {
- background: #f0f0f0;
- text-align: center;
-}
-
-#bodybox {
- display: inline-block;
- width: 900px;
- text-align: left;
-}
-
-#logo {
- width: 462px;
- height: 100px;
- position: relative;
- margin: 10px;
- cursor: default;
-}
-
-#content {
- padding: 15px;
-}
-
-#taskcontent {
- display: inline-block;
- margin-top: 10px;
- text-align: center;
-}
-
-form#signup-form {
- padding-top: 10px;
-}
-
-td.label {
- vertical-align: top;
-}
-
-table.form td {
- text-align: left;
-}
-
-#footer {
- text-align: center;
-}
diff --git a/hosted/skins/default/images/error.png b/hosted/skins/default/images/error.png
deleted file mode 120000
index fe901a7..0000000
--- a/hosted/skins/default/images/error.png
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/error.png \ No newline at end of file
diff --git a/hosted/skins/default/images/favicon.png b/hosted/skins/default/images/favicon.png
deleted file mode 120000
index 7ee1ea8..0000000
--- a/hosted/skins/default/images/favicon.png
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/favicon.png \ No newline at end of file
diff --git a/hosted/skins/default/images/info.png b/hosted/skins/default/images/info.png
deleted file mode 120000
index 8e1fec7..0000000
--- a/hosted/skins/default/images/info.png
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/info.png \ No newline at end of file
diff --git a/hosted/skins/default/images/loading.gif b/hosted/skins/default/images/loading.gif
deleted file mode 120000
index aaca76f..0000000
--- a/hosted/skins/default/images/loading.gif
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/loading.gif \ No newline at end of file
diff --git a/hosted/skins/default/images/logo.png b/hosted/skins/default/images/logo.png
deleted file mode 100644
index 0c06ff1..0000000
--- a/hosted/skins/default/images/logo.png
+++ /dev/null
Binary files differ
diff --git a/hosted/skins/default/style.css b/hosted/skins/default/style.css
deleted file mode 120000
index 6f5490d..0000000
--- a/hosted/skins/default/style.css
+++ /dev/null
@@ -1 +0,0 @@
-../../../public_html/skins/default/style.css \ No newline at end of file
diff --git a/hosted/skins/default/templates/footer.html b/hosted/skins/default/templates/footer.html
deleted file mode 100644
index 24d972d..0000000
--- a/hosted/skins/default/templates/footer.html
+++ /dev/null
@@ -1 +0,0 @@
-{$engine->translate('signup.footer')}
diff --git a/hosted/skins/default/templates/signup.html b/hosted/skins/default/templates/signup.html
deleted file mode 100644
index 8043859..0000000
--- a/hosted/skins/default/templates/signup.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8" />
- <title>{$engine->translate('signup.headline')}</title>
- <link rel="stylesheet" href="{$skin_path}style.css" />
- <link rel="stylesheet" href="{$skin_path}hosted.css" />
- <link rel="shortcut icon" type="image/png" href="{$skin_path}images/favicon.png" />
- <script src="js/jquery.min.js"></script>
- <script src="js/kolab_admin.js"></script>
- <script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
- <script src="js/kolab_hosted.js"></script>
- <script src="{$skin_path}ui.js"></script>
-</head>
-<body>
- <div id="bodybox">
- <div id="logo"></div>
- <div id="content">
-
-
- <div id="task_content" class="signup">
-
- <h1>{$engine->translate('signup.headline')}</h1>
-
- <p>{$engine->translate('signup.intro1')}</p>
-
- <p>{$engine->translate('signup.intro2')}</p>
-
- <div id="taskcontent" class="signup">{$form}</div>
-
-
- </div>
-
- </div>
- <div id="footer">
- {include file="footer.html"}
- </div>
- </div>
-{$script}
-</body>
-</html>
diff --git a/hosted/skins/default/ui.js b/hosted/skins/default/ui.js
deleted file mode 120000
index 625253b..0000000
--- a/hosted/skins/default/ui.js
+++ /dev/null
@@ -1 +0,0 @@
-../../../public_html/skins/default/ui.js \ No newline at end of file
diff --git a/hosted/skins/kolabsys/hosted.css b/hosted/skins/kolabsys/hosted.css
deleted file mode 100644
index 427d57d..0000000
--- a/hosted/skins/kolabsys/hosted.css
+++ /dev/null
@@ -1,26 +0,0 @@
-body {
- background: #F3F3F3;
- text-align: center;
-}
-
-#taskcontent {
- width: 680px;
- min-height: 100px;
- max-height: 460px;
-}
-
-form#signup-form {
- padding-top: 10px;
-}
-
-td.value input {
- width: 250px;
-}
-
-td.label {
- vertical-align: top;
-}
-
-table.form td {
- text-align: left;
-}
diff --git a/hosted/skins/kolabsys/images/error.png b/hosted/skins/kolabsys/images/error.png
deleted file mode 120000
index fe901a7..0000000
--- a/hosted/skins/kolabsys/images/error.png
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/error.png \ No newline at end of file
diff --git a/hosted/skins/kolabsys/images/favicon.png b/hosted/skins/kolabsys/images/favicon.png
deleted file mode 120000
index 7ee1ea8..0000000
--- a/hosted/skins/kolabsys/images/favicon.png
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/favicon.png \ No newline at end of file
diff --git a/hosted/skins/kolabsys/images/info.png b/hosted/skins/kolabsys/images/info.png
deleted file mode 120000
index 8e1fec7..0000000
--- a/hosted/skins/kolabsys/images/info.png
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/info.png \ No newline at end of file
diff --git a/hosted/skins/kolabsys/images/loading.gif b/hosted/skins/kolabsys/images/loading.gif
deleted file mode 120000
index aaca76f..0000000
--- a/hosted/skins/kolabsys/images/loading.gif
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/loading.gif \ No newline at end of file
diff --git a/hosted/skins/kolabsys/style.css b/hosted/skins/kolabsys/style.css
deleted file mode 120000
index 6f5490d..0000000
--- a/hosted/skins/kolabsys/style.css
+++ /dev/null
@@ -1 +0,0 @@
-../../../public_html/skins/default/style.css \ No newline at end of file
diff --git a/hosted/skins/kolabsys/templates/signup.html b/hosted/skins/kolabsys/templates/signup.html
deleted file mode 100644
index 7c756ae..0000000
--- a/hosted/skins/kolabsys/templates/signup.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8" />
- <title>Sign Up For Hosted Kolab</title>
- <link rel="stylesheet" href="{$skin_path}style.css" />
- <link rel="stylesheet" href="{$skin_path}hosted.css" />
- <link rel="shortcut icon" type="image/png" href="{$skin_path}images/favicon.png" />
- <script src="js/jquery.min.js"></script>
- <script src="js/kolab_admin.js"></script>
- <script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
- <script src="js/kolab_hosted.js"></script>
- <script src="{$skin_path}ui.js"></script>
-</head>
-<body>
- <div id="taskcontent" class="signup">{$form}</div>
-
- {$script}
-</body>
-</html>
diff --git a/hosted/skins/kolabsys/ui.js b/hosted/skins/kolabsys/ui.js
deleted file mode 120000
index 625253b..0000000
--- a/hosted/skins/kolabsys/ui.js
+++ /dev/null
@@ -1 +0,0 @@
-../../../public_html/skins/default/ui.js \ No newline at end of file
diff --git a/hosted/skins/minimal/hosted.css b/hosted/skins/minimal/hosted.css
deleted file mode 120000
index a66df34..0000000
--- a/hosted/skins/minimal/hosted.css
+++ /dev/null
@@ -1 +0,0 @@
-../default/hosted.css \ No newline at end of file
diff --git a/hosted/skins/minimal/images/error.png b/hosted/skins/minimal/images/error.png
deleted file mode 120000
index fe901a7..0000000
--- a/hosted/skins/minimal/images/error.png
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/error.png \ No newline at end of file
diff --git a/hosted/skins/minimal/images/favicon.png b/hosted/skins/minimal/images/favicon.png
deleted file mode 120000
index 7ee1ea8..0000000
--- a/hosted/skins/minimal/images/favicon.png
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/favicon.png \ No newline at end of file
diff --git a/hosted/skins/minimal/images/info.png b/hosted/skins/minimal/images/info.png
deleted file mode 120000
index 8e1fec7..0000000
--- a/hosted/skins/minimal/images/info.png
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/info.png \ No newline at end of file
diff --git a/hosted/skins/minimal/images/loading.gif b/hosted/skins/minimal/images/loading.gif
deleted file mode 120000
index aaca76f..0000000
--- a/hosted/skins/minimal/images/loading.gif
+++ /dev/null
@@ -1 +0,0 @@
-../../../../public_html/skins/default/images/loading.gif \ No newline at end of file
diff --git a/hosted/skins/minimal/style.css b/hosted/skins/minimal/style.css
deleted file mode 120000
index 6f5490d..0000000
--- a/hosted/skins/minimal/style.css
+++ /dev/null
@@ -1 +0,0 @@
-../../../public_html/skins/default/style.css \ No newline at end of file
diff --git a/hosted/skins/minimal/templates/footer.html b/hosted/skins/minimal/templates/footer.html
deleted file mode 100644
index 4b6bac5..0000000
--- a/hosted/skins/minimal/templates/footer.html
+++ /dev/null
@@ -1 +0,0 @@
-This is a service offered by <a href="http://kolabsys.com">Kolab Systems</a>.
diff --git a/hosted/skins/minimal/templates/signup.html b/hosted/skins/minimal/templates/signup.html
deleted file mode 100644
index 961dbf8..0000000
--- a/hosted/skins/minimal/templates/signup.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8" />
- <title>Sign Up For Hosted Kolab</title>
- <link rel="stylesheet" href="{$skin_path}style.css" />
- <link rel="stylesheet" href="{$skin_path}hosted.css" />
- <link rel="shortcut icon" type="image/png" href="{$skin_path}images/favicon.png" />
- <script src="js/jquery.min.js"></script>
- <script src="js/kolab_admin.js"></script>
- <script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
- <script src="js/kolab_hosted.js"></script>
- <script src="{$skin_path}ui.js"></script>
-</head>
-<body>
- <div id="taskcontent" class="signup">{$form}</div>
-
- <div id="footer">
- {include file="footer.html"}
- </div>
-{$script}
-</body>
-</html>
diff --git a/hosted/skins/minimal/ui.js b/hosted/skins/minimal/ui.js
deleted file mode 120000
index 625253b..0000000
--- a/hosted/skins/minimal/ui.js
+++ /dev/null
@@ -1 +0,0 @@
-../../../public_html/skins/default/ui.js \ No newline at end of file