summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-09-18 13:54:13 +0200
committerAleksander Machniak <alec@alec.pl>2012-09-18 13:54:13 +0200
commitf2bf7c79550e23562f60fd27b87a457f8b9e5b88 (patch)
treeda6b641f1c58e24e9ba0dbd86cd200fe5dd547da
parent4111a9bfeb071a39af4da2c826fafa404cd53c79 (diff)
parent74cc89edc121663debb2881ab151bacdd99c46e3 (diff)
downloadwebadmin-f2bf7c79550e23562f60fd27b87a457f8b9e5b88.tar.gz
Merge branch 'master' of ssh://git.kolab.org/git/kolab-wap
-rw-r--r--doc/kolab_hosting-3.0.sql (renamed from doc/kolab_hosting-3.0.1.sql)0
-rw-r--r--doc/kolab_wap-3.0.sql (renamed from doc/kolab_wap-3.0.1.sql)2
-rw-r--r--hosted/skins/default/templates/signup.html2
-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
-rw-r--r--hosted/skins/minimal/templates/signup.html2
-rw-r--r--lib/Auth/LDAP.php41
-rw-r--r--lib/api/kolab_api_service_form_value.php4
14 files changed, 84 insertions, 19 deletions
diff --git a/doc/kolab_hosting-3.0.1.sql b/doc/kolab_hosting-3.0.sql
index cc64e88..cc64e88 100644
--- a/doc/kolab_hosting-3.0.1.sql
+++ b/doc/kolab_hosting-3.0.sql
diff --git a/doc/kolab_wap-3.0.1.sql b/doc/kolab_wap-3.0.sql
index b4d6964..4a3c231 100644
--- a/doc/kolab_wap-3.0.1.sql
+++ b/doc/kolab_wap-3.0.sql
@@ -137,7 +137,7 @@ CREATE TABLE IF NOT EXISTS `user_types` (
INSERT INTO `user_types` (`id`, `key`, `name`, `description`, `attributes`, `used_for`) VALUES
(1, 'kolab', 'Kolab User', 'A Kolab User', '{"auto_form_fields":{"alias":{"type":"list","data":["givenname","preferredlanguage","sn"]},"cn":{"data":["givenname","sn"]},"displayname":{"data":["givenname","sn"]},"mail":{"data":["givenname","preferredlanguage","sn"]},"mailhost":{"optional":true},"uid":{"data":["givenname","preferredlanguage","sn"]},"userpassword":{"optional":true}},"form_fields":{"alias":{"optional":true},"givenname":[],"initials":{"optional":true},"kolabdelegate":{"type":"list","autocomplete":true,"optional":true},"kolabinvitationpolicy":{"type":"select","values":["","ACT_MANUAL","ACT_REJECT"],"optional":true},"kolaballowsmtprecipient":{"type":"list","optional":true},"kolaballowsmtpsender":{"type":"list","optional":true},"l":{"optional":true},"mailalternateaddress":{"type":"list","optional":true},"mailquota":{"optional":true},"mobile":{"optional":true},"nsroledn":{"type":"list","autocomplete":true,"optional":true},"o":{"optional":true},"ou":{"type":"select"},"pager":{"optional":true},"postalcode":{"optional":true},"preferredlanguage":{"type":"select"},"sn":[],"street":{"optional":true},"telephonenumber":{"optional":true},"title":{"optional":true},"userpassword":{"optional":true}},"fields":{"objectclass":["top","inetorgperson","kolabinetorgperson","mailrecipient","organizationalperson","person"]}}', NULL),
-(2, 'posix', 'POSIX User', 'A POSIX user (with a home directory and shell access)', '{"auto_form_fields":{"cn":{"data":["givenname","sn"]},"displayname":{"data":["givenname","sn"]},"gidnumber":[],"homedirectory":{"data":["givenname","sn"]},"uid":{"data":["givenname","sn"]},"uidnumber":[],"userpassword":{"optional":true}},"form_fields":{"givenname":[],"initials":{"optional":true},"preferredlanguage":{"type":"select","values":["en_US","de_DE","de_CH","en_GB","fi_FI","fr_FR","hu_HU"]},"loginshell":{"type":"select","values":["/bin/bash","/usr/bin/git-shell","/sbin/nologin"]},"ou":{"type":"select"},"sn":[],"title":{"optional":true},"userpassword":{"optional":true}},"fields":{"objectclass":["top","inetorgperson","organizationalperson","person","posixaccount"]}}', NULL),
+(2, 'posix', 'POSIX User', 'A POSIX user (with a home directory and shell access)', '{"auto_form_fields":{"cn":{"data":["givenname","sn"]},"displayname":{"data":["givenname","sn"]},"gidnumber":[],"homedirectory":{"data":["givenname","preferredlanguage","sn"]},"uid":{"data":["givenname","preferredlanguage","sn"]},"uidnumber":[],"userpassword":{"optional":true}},"form_fields":{"givenname":[],"initials":{"optional":true},"preferredlanguage":{"type":"select","values":["en_US","de_DE","de_CH","en_GB","fi_FI","fr_FR","hu_HU"]},"loginshell":{"type":"select","values":["/bin/bash","/usr/bin/git-shell","/sbin/nologin"]},"ou":{"type":"select"},"sn":[],"title":{"optional":true},"userpassword":{"optional":true}},"fields":{"objectclass":["top","inetorgperson","organizationalperson","person","posixaccount"]}}', NULL),
(3, 'kolab_posix', 'Mail-enabled POSIX User', 'A mail-enabled POSIX User', '{"auto_form_fields":{"alias":{"data":["givenname","preferredlanguage","sn"]},"cn":{"data":["givenname","preferredlanguage","sn"]},"displayname":{"data":["givenname","preferredlanguage","sn"]},"gidnumber":[],"homedirectory":{"data":["givenname","preferredlanguage","sn"]},"mail":{"data":["givenname","preferredlanguage","sn"]},"mailhost":{"optional":true},"uid":{"data":["givenname","preferredlanguage","sn"]},"uidnumber":[],"userpassword":{"optional":true}},"form_fields":{"alias":{"optional":true},"givenname":[],"initials":{"optional":true},"kolabdelegate":{"type":"list","autocomplete":true,"optional":true},"kolabinvitationpolicy":{"type":"select","values":["","ACT_MANUAL","ACT_REJECT"],"optional":true},"kolaballowsmtprecipient":{"type":"list","optional":true},"kolaballowsmtpsender":{"type":"list","optional":true},"l":{"optional":true},"loginshell":{"type":"select","values":["/bin/bash","/usr/bin/git-shell","/sbin/nologin"]},"mailalternateaddress":{"type":"list","optional":true},"mailquota":{"optional":true},"mobile":{"optional":true},"nsroledn":{"type":"list","autocomplete":true,"optional":true},"o":{"optional":true},"ou":{"type":"select"},"pager":{"optional":true},"postalcode":{"optional":true},"preferredlanguage":{"type":"select"},"sn":[],"street":{"optional":true},"telephonenumber":{"optional":true},"title":{"optional":true},"userpassword":{"optional":true}},"fields":{"objectclass":["top","inetorgperson","kolabinetorgperson","mailrecipient","organizationalperson","person","posixaccount"]}}', NULL);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
diff --git a/hosted/skins/default/templates/signup.html b/hosted/skins/default/templates/signup.html
index 9ca4736..463f832 100644
--- a/hosted/skins/default/templates/signup.html
+++ b/hosted/skins/default/templates/signup.html
@@ -8,7 +8,7 @@
<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="http://www.google.com/recaptcha/api/js/recaptcha_ajax.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>
diff --git a/hosted/skins/kolabsys/hosted.css b/hosted/skins/kolabsys/hosted.css
new file mode 100644
index 0000000..427d57d
--- /dev/null
+++ b/hosted/skins/kolabsys/hosted.css
@@ -0,0 +1,26 @@
+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
new file mode 120000
index 0000000..fe901a7
--- /dev/null
+++ b/hosted/skins/kolabsys/images/error.png
@@ -0,0 +1 @@
+../../../../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
new file mode 120000
index 0000000..7ee1ea8
--- /dev/null
+++ b/hosted/skins/kolabsys/images/favicon.png
@@ -0,0 +1 @@
+../../../../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
new file mode 120000
index 0000000..8e1fec7
--- /dev/null
+++ b/hosted/skins/kolabsys/images/info.png
@@ -0,0 +1 @@
+../../../../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
new file mode 120000
index 0000000..aaca76f
--- /dev/null
+++ b/hosted/skins/kolabsys/images/loading.gif
@@ -0,0 +1 @@
+../../../../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
new file mode 120000
index 0000000..6f5490d
--- /dev/null
+++ b/hosted/skins/kolabsys/style.css
@@ -0,0 +1 @@
+../../../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
new file mode 100644
index 0000000..7c756ae
--- /dev/null
+++ b/hosted/skins/kolabsys/templates/signup.html
@@ -0,0 +1,20 @@
+<!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
new file mode 120000
index 0000000..625253b
--- /dev/null
+++ b/hosted/skins/kolabsys/ui.js
@@ -0,0 +1 @@
+../../../public_html/skins/default/ui.js \ No newline at end of file
diff --git a/hosted/skins/minimal/templates/signup.html b/hosted/skins/minimal/templates/signup.html
index 0245091..10ff483 100644
--- a/hosted/skins/minimal/templates/signup.html
+++ b/hosted/skins/minimal/templates/signup.html
@@ -8,7 +8,7 @@
<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="http://www.google.com/recaptcha/api/js/recaptcha_ajax.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>
diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index 858c422..7c4e626 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -967,26 +967,19 @@ class LDAP extends Net_LDAP3 {
}
private function sort_and_slice(&$result, &$params) {
+ $entries = $result->entries(TRUE);
+
if (!empty($params) && is_array($params)) {
if (array_key_exists('sort_by', $params)) {
- if (is_array($params['sort_by'])) {
- $sort = array_shift($params['sort_by']);
- } else {
- $sort = $params['sort_by'];
- }
-
- $result->sort($sort);
-
+ $this->sort_result_key = $params['sort_by'];
+ uasort($entries, array($this, 'sort_result'));
}
if (array_key_exists('page_size', $params) && array_key_exists('page', $params)) {
- $entries = $result->entries(TRUE);
if ($result->count() > $params['page_size']) {
$entries = array_slice($entries, (($params['page'] - 1) * $params['page_size']), $params['page_size'], TRUE);
}
- } else {
- $entries = $result->entries(TRUE);
}
if (array_key_exists('sort_order', $params) && !empty($params['sort_order'])) {
@@ -994,13 +987,33 @@ class LDAP extends Net_LDAP3 {
$entries = array_reverse($entries, TRUE);
}
}
- } else {
- $entries = $result->entries(TRUE);
}
return $entries;
}
+ /**
+ * Result sorting callback for uasort()
+ */
+ private function sort_result($a, $b)
+ {
+ if (is_array($this->sort_result_key)) {
+ foreach ($this->sort_result_key as $attrib) {
+ if (array_key_exists($attrib, $a) && !$str1) {
+ $str1 = $a[$attrib];
+ }
+ if (array_key_exists($attrib, $b) && !$str2) {
+ $str2 = $b[$attrib];
+ }
+ }
+ } else {
+ $str1 = $a[$this->sort_result_key];
+ $str2 = $b[$this->sort_result_key];
+ }
+
+ return strcmp(mb_strtoupper($str1), mb_strtoupper($str2));
+ }
+
private function unique_attribute() {
$unique_attr = $this->conf->get("unique_attribute");
return empty($unique_attr) ? 'nsuniqueid' : $unique_attr;
@@ -1224,7 +1237,7 @@ class LDAP extends Net_LDAP3 {
$_aci,
// Search Access,
- "(targetattr = \"*\") (version 3.0;acl \"Search Access\";allow (read,compare,search)(userdn = \"ldap:///" . $inetdomainbasedn . "\");)",
+ "(targetattr = \"*\") (version 3.0;acl \"Search Access\";allow (read,compare,search)(userdn = \"ldap:///" . $inetdomainbasedn . "??sub?(objectclass=*)\");)",
// Service Search Access
"(targetattr = \"*\") (version 3.0;acl \"Service Search Access\";allow (read,compare,search)(userdn = \"ldap:///" . $service_bind_dn . "\");)",
diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index 4936f30..4d90d68 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -340,7 +340,7 @@ class kolab_api_service_form_value extends kolab_api_service
$highest_gidnumber = 999;
}
- foreach ($groups as $dn => $attributes) {
+ foreach ($groups['list'] as $dn => $attributes) {
if (!array_key_exists('gidnumber', $attributes)) {
continue;
}
@@ -641,7 +641,7 @@ class kolab_api_service_form_value extends kolab_api_service
$highest_uidnumber = 999;
}
- foreach ($users as $dn => $attributes) {
+ foreach ($users['list'] as $dn => $attributes) {
if (!array_key_exists('uidnumber', $attributes)) {
continue;
}