Page MenuHomePhorge

No OneTemporary

Authored By
Unknown
Size
39 KB
Referenced Files
None
Subscribers
None
diff --git a/hosted/index.php b/hosted/index.php
index 867a6e1..6414cbe 100644
--- a/hosted/index.php
+++ b/hosted/index.php
@@ -1,42 +1,33 @@
<?php
/*
+--------------------------------------------------------------------------+
| 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 this program. If not, see <http://www.gnu.org/licenses/> |
+--------------------------------------------------------------------------+
| Author: Aleksander Machniak <machniak@kolabsys.com> |
| Author: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> |
+--------------------------------------------------------------------------+
*/
// 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();
$KADM->send();
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/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/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/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/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/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/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/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/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
diff --git a/lib/hosted/kolab_client_task_signup.php b/lib/client/kolab_client_task_signup.php
similarity index 99%
rename from lib/hosted/kolab_client_task_signup.php
rename to lib/client/kolab_client_task_signup.php
index 6ebcdd9..a320216 100644
--- a/lib/hosted/kolab_client_task_signup.php
+++ b/lib/client/kolab_client_task_signup.php
@@ -1,327 +1,327 @@
<?php
/*
+--------------------------------------------------------------------------+
| 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 this program. If not, see <http://www.gnu.org/licenses/> |
+--------------------------------------------------------------------------+
| Author: Aleksander Machniak <machniak@kolabsys.com> |
| Author: Torsten Grote <grote@kolabsys.com> |
+--------------------------------------------------------------------------+
*/
-require_once('hosted/recaptchalib.php');
+require_once('recaptchalib.php');
class kolab_client_task_signup extends kolab_client_task
{
protected $ajax_only = true;
/**
* Overwrite Main execution.
*/
public function run()
{
// don't set any cookies
ini_set('session.use_cookies', '0');
// Initialize locales
$this->locale_init();
// Assign self to template variable
$this->output->assign('engine', $this);
// Run security checks
// TODO figure out to reenable this
// $this->input_checks();
$action = $this->get_input('action', 'GET');
if ($action) {
$method = 'action_' . $action;
if (method_exists($this, $method)) {
$this->$method();
}
}
else if (method_exists($this, 'action_default')) {
$this->action_default();
}
}
private function login($domain=NULL)
{
if(is_null($domain)) {
$this->domain = $this->config_get('primary_domain');
}
// Login ($result is a kolab_client_api_result instance)
$result = $this->api->login($this->config_get('bind_dn'), $this->config_get('bind_pw'), $this->domain);
// Set the session token we got in the API client instance, so subsequent
// API calls are made in the same session.
$this->token = $result->get('session_token');
$this->api->set_session_token($this->token);
}
public function action_default()
{
$this->login();
$data = $this->get_input('data', 'POST');
$form = $this->user_form($data);
// add captcha
$publickey = $this->config_get('recaptcha_public_key');
if (!empty($publickey)) {
// TODO find a less dirty way to add captcha into form
$form = preg_replace('/<\/tbody>/', '<tr><td class="label">'.$this->translate('signup.captcha').'</td><td class="value"><div id="recaptcha_div"></div></td></tr></tbody>', $form);
// load captcha
$form .= '
<script type="text/javascript">
Recaptcha.create("'.$publickey.'", "recaptcha_div", {theme: "red"});
</script>';
}
$this->output->assign('form', $form);
$this->output->set_object('taskcontent', $form);
}
// check if user already exists
public function action_check_user($data = array()) {
if(count($data) == 0) $data = $this->get_input('data', 'POST');
$this->login($data['domain']);
// Assemble mail attribute
$mail = $data['uid'].'@'.$data['domain'];
$post = array('search' => array('mail' => array('value' => $mail) ) );
$result = $this->api->post('users.list', null, $post);
if($result->get('count') > 0) {
$this->output->command('update_user_info("signup.userexists", "uid")');
return false;
}
$this->output->command('update_user_info("", "uid")');
return true;
}
public function action_add_user() {
$data = $this->get_input('data', 'POST');
$private_key = $this->config_get('recaptcha_private_key');
if (!empty($private_key)) {
// Check for valid CAPTCHA
$resp = recaptcha_check_answer(
$private_key,
$_SERVER['REMOTE_ADDR'],
$data['recaptcha_challenge_field'],
$data['recaptcha_response_field']
);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
$this->output->command('display_message', "The reCAPTCHA wasn't entered correctly. Please reload and try it again.", 'error');
return;
}
}
// Check again for user availability before adding user
// this also logs into the API
// TODO perform security check on value of $data['uid'] and $data['domain']
if(!$this->action_check_user($data)) {
$this->output->command('form_value_error', 'uid');
return;
}
$this->api->get('system.select_domain', array('domain', $data['domain']));
// Remove domain from $data before adding user
unset($data['domain']);
$data['cn'] = $this->api->post('form_value.generate', $data);
// Add user
$result = $this->api->post('user.add', null, $data);
if (array_key_exists('error_code', $result)) {
$this->output->command('display_message', 'internalerror', 'error');
return;
} else {
$this->output->set_object('taskcontent', 'signup.usercreated');
}
}
private function user_form($data = array()) {
$attribs['id'] = 'signup-form';
$fields_map = array(
'type_id' => 'other',
'givenname' => 'other',
'sn' => 'other',
'cn' => 'other',
'mailalternateaddress' => 'other',
'uid' => 'other',
'domain' => 'other',
'userpassword' => 'other',
'userpassword2' => 'other',
'mail' => 'other',
'alias' => 'other',
);
// Prepare fields
list($fields, $types, $type) = $this->form_prepare('user', $data, array('userpassword2'), 'hosted');
// Show only required fields
foreach ($fields as $field_name => $field_attrs) {
if(!array_key_exists('required', $field_attrs) or $field_attrs['required'] != 'true') {
unset($fields[$field_name]);
}
}
// Add user type id selector
$accttypes = array();
foreach ($types as $idx => $elem) {
if($elem['used_for'] == 'hosted') {
$accttypes[$idx] = array('value' => $idx, 'content' => $elem['name']);
}
}
$fields['type_id'] = array(
'section' => 'personal',
'type' => kolab_form::INPUT_SELECT,
'options' => $accttypes,
'onchange' => "kadm.change_user_type()",
);
// Add object type field
$fields['object_type'] = array(
'type' => kolab_form::INPUT_HIDDEN,
'value' => 'user',
);
// Add available domains
$fields['domain'] = array(
'type' => kolab_form::INPUT_SELECT,
'options' => $this->get_domains(),
'onchange' => 'kadm.check_user_availability()',
);
// Check for user availability
$fields['uid']['onchange'] = 'kadm.check_user_availability()';
// Hide cn field
if (isset($fields['cn'])) {
// TODO use type info from user types table
$fields['cn']['type'] = kolab_form::INPUT_HIDDEN;
// TODO auto generate value again with indirect API call
$fields['cn']['value'] = 'temporary fake cn';
$fields['sn']['onchange'] = '';
$fields['givenname']['onchange'] = '';
}
// Add password confirmation
if (isset($fields['userpassword'])) {
$fields['userpassword2'] = $fields['userpassword'];
$fields['userpassword2']['onchange'] = 'password_match()';
}
// Change field labels for hosted case
$fields['uid']['label'] = 'signup.username';
$fields['mail']['label'] = 'signup.futuremail';
if(isset($fields['mailalternateaddress'])) $fields['mailalternateaddress']['label'] = 'signup.mailalternateaddress';
$fields['domain']['label'] = 'signup.domain';
// Create form object and populate with fields
$form = $this->form_create('user', $attribs, array('other'), $fields, $fields_map, $data, true);
$form->set_title($this->translate('signup.formtitle'));
$this->output->add_translation('user.password.mismatch', 'user.add.success', 'signup.wronguid');
return $form->output();
}
protected function get_domains() {
// Get a list of domains ($domains again is a kolab_client_api_result instance)
$domains_list = $this->api->get('domains.list')->get('list');
if (empty($domains_list)) {
return array();
}
// The domain name attribute (the name of the LDAP attribute that holds the actual domain name space)
// is configurable as well. Provide a fallback.
$domain_name_attribute = $this->config->get('ldap','domain_name_attribute');
if (empty($domain_name_attribute)) {
$domain_name_attribute = 'associateddomain';
}
// Placeholder for the domain names in this deployment
$domain_names = array();
foreach ($domains_list as $domain_dn => $domain_attrs) {
// If $domain_attrs[$domain_name_attribute] is an array, the primary domain name space
// is the first value in the array.
if (is_array($domain_attrs[$domain_name_attribute])) {
$_domain_names = $domain_attrs[$domain_name_attribute];
$domain_name = array_shift($domain_attrs[$domain_name_attribute]);
} else {
$_domain_names = (array)($domain_attrs[$domain_name_attribute]);
$domain_name = $domain_attrs[$domain_name_attribute];
}
$parent_domain_only = $this->config->get($domain_name, 'hosted_parent_domain_only');
if (!empty($parent_domain_only) && in_array(strtolower($parent_domain_only), array('1', 'yes', 'true'))) {
$domain_names = array_merge($domain_names, array($domain_name));
} else {
$domain_names = array_merge($domain_names, $_domain_names);
}
}
// prepare array with proper key ids for form building
foreach ($domain_names as $domain) {
$domain_form_names[$domain] = $domain;
}
return $domain_form_names;
}
/**
* Overrides config_get() from kolab_client_task
* Returns configuration option value for hosting.
*
* @param string $name Option name
* @param mixed $fallback Default value
* @param int $type Value type (one of Conf class constants)
*
* @return mixed Option value
*/
public function config_get($name, $fallback = null, $type = null)
{
$value = $this->config->get('kolab_hosting', $name, $type);
if($value === null) {
$value = parent::config_get($name, $fallback, $type);
}
return $value !== null ? $value : $fallback;
}
}
diff --git a/lib/functions.php b/lib/functions.php
index 8c74cf7..9761358 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -1,134 +1,133 @@
<?php
/*
+--------------------------------------------------------------------------+
| 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 this program. If not, see <http://www.gnu.org/licenses/> |
+--------------------------------------------------------------------------+
| Author: Aleksander Machniak <machniak@kolabsys.com> |
| Author: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> |
+--------------------------------------------------------------------------+
*/
// Initialization and basic functions
// application constants
define('KADM_START', microtime(true));
define('KADM_VERSION', '0.1');
define('KADM_CHARSET', 'utf-8');
define('INSTALL_PATH', dirname(__FILE__));
// Check critical PHP settings here.
$crit_opts = array(
'mbstring.func_overload' => 0,
'magic_quotes_runtime' => 0,
);
foreach ($crit_opts as $optname => $optval) {
if ($optval != ini_get($optname)) {
die("ERROR: Wrong '$optname' option value!");
}
}
$include_path = INSTALL_PATH . PATH_SEPARATOR;
$include_path .= INSTALL_PATH . '/client' . PATH_SEPARATOR;
$include_path .= INSTALL_PATH . '/api' . PATH_SEPARATOR;
$include_path .= INSTALL_PATH . '/ext' . PATH_SEPARATOR;
-$include_path .= INSTALL_PATH . '/hosted' . PATH_SEPARATOR;
$include_path .= ini_get('include_path');
if (set_include_path($include_path) === false) {
die("Fatal error: ini_set/set_include_path does not work.");
}
ini_set('error_reporting', E_ALL&~E_NOTICE);
ini_set('error_log', INSTALL_PATH . '/../logs/errors');
// Set internal charset
mb_internal_encoding(KADM_CHARSET);
@mb_regex_encoding(KADM_CHARSET);
// register autoloader
function class_autoloader($classname)
{
$classname = preg_replace('/(Net|MDB2|HTTP)_(.+)/', "\\1/\\2", $classname);
if ($fp = @fopen("$classname.php", 'r', true)) {
include_once "$classname.php";
fclose($fp);
return true;
}
return false;
}
spl_autoload_register('class_autoloader');
/**
* Prints debug info into the 'console' log
*/
function console()
{
$args = func_get_args();
$msg = array();
foreach ($args as $arg) {
$msg[] = !is_string($arg) ? var_export($arg, true) : $arg;
}
write_log('console', join(";\n", $msg));
}
/**
* Appends a line to a log file in the logs directory.
* Date will be added automatically to the line.
*
* @param string $name Name of the log file
* @param mixed $line Line to append
*/
function write_log($name, $line)
{
if (!is_string($line)) {
$line = var_export($line, true);
}
$log_dir = dirname(__FILE__) . '/../logs';
$logfile = $log_dir . '/' . $name;
$date = date('d-M-Y H:i:s O');
$sess_id = session_id();
$logline = sprintf("[%s]%s: %s\n", $date, $sess_id ? "($sess_id)" : '', $line);
if ($fp = @fopen($logfile, 'a')) {
fwrite($fp, $logline);
fflush($fp);
fclose($fp);
return;
}
if ($name == 'errors') {
// send error to PHPs error handler if write to file didn't succeed
trigger_error($line, E_USER_ERROR);
}
}
function timer($time = null, $label = '')
{
$now = microtime(true);
if ($time) {
//console(($label ? $label.' ' : '') . sprintf('%.4f', $now - $time));
}
return $now;
}
diff --git a/lib/hosted/recaptchalib.php b/lib/recaptchalib.php
similarity index 100%
rename from lib/hosted/recaptchalib.php
rename to lib/recaptchalib.php
diff --git a/public_html/index.php b/public_html/index.php
index 3e78361..1f9f1ed 100644
--- a/public_html/index.php
+++ b/public_html/index.php
@@ -1,42 +1,42 @@
<?php
/*
+--------------------------------------------------------------------------+
| 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 this program. If not, see <http://www.gnu.org/licenses/> |
+--------------------------------------------------------------------------+
| Author: Aleksander Machniak <machniak@kolabsys.com> |
| Author: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> |
+--------------------------------------------------------------------------+
*/
// environment initialization
require_once '../lib/functions.php';
// starting task
$task = kolab_utils::get_input('task', kolab_utils::REQUEST_GET);
-if (!$task) {
+if (!$task || $task == 'signup') {
$task = 'main';
}
$class = "kolab_client_task_$task";
$KADM = new $class;
// run actions and send output
$KADM->run();
$KADM->send();
diff --git a/hosted/js/kolab_hosted.js b/public_html/js/kolab_hosted.js
similarity index 100%
rename from hosted/js/kolab_hosted.js
rename to public_html/js/kolab_hosted.js
diff --git a/hosted/skins/default/hosted.css b/public_html/skins/default/hosted.css
similarity index 89%
rename from hosted/skins/default/hosted.css
rename to public_html/skins/default/hosted.css
index bba4df6..694d19d 100644
--- a/hosted/skins/default/hosted.css
+++ b/public_html/skins/default/hosted.css
@@ -1,44 +1,45 @@
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;
+ background: url(images/logo_kolab.png) 0 0 no-repeat;
}
#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/logo.png b/public_html/skins/default/images/logo_kolab.png
similarity index 100%
rename from hosted/skins/default/images/logo.png
rename to public_html/skins/default/images/logo_kolab.png
diff --git a/hosted/skins/default/templates/signup.html b/public_html/skins/default/templates/signup.html
similarity index 68%
rename from hosted/skins/default/templates/signup.html
rename to public_html/skins/default/templates/signup.html
index 8043859..66a649a 100644
--- a/hosted/skins/default/templates/signup.html
+++ b/public_html/skins/default/templates/signup.html
@@ -1,41 +1,32 @@
<!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 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"}
+ {include file="signup_footer.html"}
</div>
</div>
{$script}
</body>
</html>
diff --git a/hosted/skins/default/templates/footer.html b/public_html/skins/default/templates/signup_footer.html
similarity index 100%
rename from hosted/skins/default/templates/footer.html
rename to public_html/skins/default/templates/signup_footer.html
diff --git a/public_html/skins/default/ui.js b/public_html/skins/default/ui.js
index c0dc901..45bfd51 100644
--- a/public_html/skins/default/ui.js
+++ b/public_html/skins/default/ui.js
@@ -1,172 +1,172 @@
/*
+--------------------------------------------------------------------------+
| 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 this program. If not, see <http://www.gnu.org/licenses/> |
+--------------------------------------------------------------------------+
| Author: Aleksander Machniak <machniak@kolabsys.com> |
+--------------------------------------------------------------------------+
*/
/**
* Search form events
*/
function search_init(command)
{
kadm.env.search_command = command;
$('#searchinput').addClass('inactive')
.blur(function() {
if (this.value == '')
$(this).val(kadm.t('search')).addClass('inactive');
})
.keypress(function(e) {
if (this.value && e.which == 13) { // ENTER key
var props = kadm.serialize_form('#search-form');
props.search = this.value;
kadm.command(kadm.env.search_command, props);
}
})
.focus(function() {
if (this.value == kadm.t('search'))
$(this).val('').removeClass('inactive');
});
};
function search_reset()
{
var input = $('#searchinput');
input.val(kadm.t('search')).addClass('inactive');
kadm.command(kadm.env.search_command, {search: ''});
};
function search_details()
{
var div = $('div.searchdetails', $('#search'));
if (!div.is(':visible'))
div.slideDown(200);
else
div.slideUp(200);
};
/**
* Fieldsets-to-tabs converter
* Warning: don't place "caller" <script> inside page element (id)
*/
function init_tabs(id, current)
{
var content = $('#'+id),
fs = content.children('fieldset');
if (!fs.length)
return;
// find active fieldset
if (!current) {
current = 0;
fs.each(function(idx) { if ($(this).hasClass('active')) { current = idx; return false; } });
}
// first hide not selected tabs
fs.each(function(idx) { if (idx != current) $(this).hide(); });
// create tabs container
var tabs = $('<div>').addClass('tabsbar').prependTo(content);
// convert fildsets into tabs
fs.each(function(idx) {
var tab, a, elm = $(this), legend = elm.children('legend');
// create a tab
a = $('<a>').text(legend.text()).attr('href', '#');
tab = $('<span>').attr({'id': 'tab'+idx, 'class': 'tablink'})
.click(function() { show_tab(id, idx); return false; })
// remove legend
legend.remove();
// style fieldset
elm.addClass('tabbed');
// style selected tab
if (idx == current)
tab.addClass('tablink-selected');
// add the tab to container
tab.append(a).appendTo(tabs);
});
};
function show_tab(id, index)
{
var fs = $('#'+id).children('fieldset');
fs.each(function(idx) {
// Show/hide fieldset (tab content)
$(this)[index == idx ? 'show' : 'hide']();
// Select/unselect tab
$('#tab'+idx).toggleClass('tablink-selected', idx == index);
});
};
// Domain selector initializer
function domain_selector()
{
// domain selector
if (kadm.env.domains && kadm.env.domains.length > 1) {
var form = $('#domain-selector-form');
kadm.env.assoc_fields = {domain: kadm.env.domains};
kadm.form_init('domain-selector-form');
$('input[name="domain"]', form).change(function() {
window.location = '?domain=' + urlencode(this.value);
});
}
};
// Form "onload" handler
function form_load(id)
{
if (id != 'search-form')
init_tabs(id);
};
// UI resize handler
function ui_resize()
{
var h = $('#content').height();
// resize UI elements
if (h - 22 > 380) {
- $('#taskcontent').css({'min-height': h - 22});
+ $('#taskcontent:not(.signup)').css({'min-height': h - 22});
}
};
// UI loader
function ui_load()
{
domain_selector();
}
/**
* UI Initialization
*/
kadm.add_event_listener('form-load', form_load);
kadm.add_event_listener('http-response', ui_resize);
//$(window).resize(function() { ui_resize(); });
$(window).load(function() { ui_load(); });
diff --git a/hosted/skins/kolabsys/hosted.css b/public_html/skins/kolabsys/hosted.css
similarity index 100%
rename from hosted/skins/kolabsys/hosted.css
rename to public_html/skins/kolabsys/hosted.css
diff --git a/public_html/skins/kolabsys/style.css b/public_html/skins/kolabsys/style.css
new file mode 120000
index 0000000..2bc3133
--- /dev/null
+++ b/public_html/skins/kolabsys/style.css
@@ -0,0 +1 @@
+../default/style.css
\ No newline at end of file
diff --git a/hosted/skins/kolabsys/templates/signup.html b/public_html/skins/kolabsys/templates/signup.html
similarity index 100%
rename from hosted/skins/kolabsys/templates/signup.html
rename to public_html/skins/kolabsys/templates/signup.html
diff --git a/public_html/skins/kolabsys/ui.js b/public_html/skins/kolabsys/ui.js
new file mode 120000
index 0000000..b845f3f
--- /dev/null
+++ b/public_html/skins/kolabsys/ui.js
@@ -0,0 +1 @@
+../default/ui.js
\ No newline at end of file
diff --git a/hosted/skins/minimal/hosted.css b/public_html/skins/minimal/hosted.css
similarity index 100%
rename from hosted/skins/minimal/hosted.css
rename to public_html/skins/minimal/hosted.css
diff --git a/public_html/skins/minimal/style.css b/public_html/skins/minimal/style.css
new file mode 120000
index 0000000..2bc3133
--- /dev/null
+++ b/public_html/skins/minimal/style.css
@@ -0,0 +1 @@
+../default/style.css
\ No newline at end of file
diff --git a/hosted/skins/minimal/templates/signup.html b/public_html/skins/minimal/templates/signup.html
similarity index 94%
rename from hosted/skins/minimal/templates/signup.html
rename to public_html/skins/minimal/templates/signup.html
index 961dbf8..ccf16b8 100644
--- a/hosted/skins/minimal/templates/signup.html
+++ b/public_html/skins/minimal/templates/signup.html
@@ -1,23 +1,23 @@
<!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"}
+ {include file="signup_footer.html"}
</div>
{$script}
</body>
</html>
diff --git a/hosted/skins/minimal/templates/footer.html b/public_html/skins/minimal/templates/signup_footer.html
similarity index 100%
rename from hosted/skins/minimal/templates/footer.html
rename to public_html/skins/minimal/templates/signup_footer.html
diff --git a/public_html/skins/minimal/ui.js b/public_html/skins/minimal/ui.js
new file mode 120000
index 0000000..b845f3f
--- /dev/null
+++ b/public_html/skins/minimal/ui.js
@@ -0,0 +1 @@
+../default/ui.js
\ No newline at end of file

File Metadata

Mime Type
text/x-diff
Expires
Mon, Apr 6, 3:09 AM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18832147
Default Alt Text
(39 KB)

Event Timeline