summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog20
-rw-r--r--Makefile.am9
-rw-r--r--configure.ac2
-rw-r--r--kolab-webadmin.spec.in8
-rw-r--r--php/admin/include/auth.class.php12
-rw-r--r--php/admin/include/form.class.php30
-rw-r--r--php/admin/include/ldap.class.php80
-rw-r--r--php/admin/include/menu.php2
-rw-r--r--php/admin/templates/en/codefusion.tpl30
-rw-r--r--php/admin/templates/en/kolab.tpl115
-rw-r--r--php/admin/templates/en/service.tpl20
-rw-r--r--php/admin/templates/en/sflistall.tpl2
-rw-r--r--php/admin/templates/en/userlistall.tpl31
-rw-r--r--www/admin/addressbook/addr.php4
-rw-r--r--www/admin/administrator/admin.php4
-rw-r--r--www/admin/administrator/index.php4
-rw-r--r--www/admin/distributionlist/index.php39
-rw-r--r--www/admin/distributionlist/list.php49
-rw-r--r--www/admin/index.php22
-rw-r--r--www/admin/kolab/codefusion.php1
-rw-r--r--www/admin/kolab/erfrakon.php25
-rw-r--r--www/admin/maintainer/index.php4
-rw-r--r--www/admin/maintainer/maintainer.php28
-rw-r--r--www/admin/pics/kolab_logo.pngbin5421 -> 10568 bytes
-rw-r--r--www/admin/service/index.php26
-rw-r--r--www/admin/service/service.php4
-rw-r--r--www/admin/sharedfolder/index.php12
-rw-r--r--www/admin/sharedfolder/sf.php107
-rw-r--r--www/admin/style.css7
-rw-r--r--www/admin/user/forward.php22
-rw-r--r--www/admin/user/index.php42
-rw-r--r--www/admin/user/user.php111
-rw-r--r--www/admin/user/vacation.php7
33 files changed, 612 insertions, 267 deletions
diff --git a/ChangeLog b/ChangeLog
index b1e1a5c..9885eb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,7 +10,7 @@
2004-07-08 13:44 steffen
- * php/admin/include/form.class.php, www/admin/sharedfolder/sf.php:
+ * php/admin/include/form.class.php, www/admin/kolabsharedfolder/sf.php:
new permissions "read anon" and "read hidden" + allow special
usernames anyone and anonymous in ACLs
@@ -36,7 +36,7 @@
2004-07-07 13:45 steffen
* configure.ac, php/admin/include/ldap.class.php,
- www/admin/sharedfolder/sf.php: fix for issue215
+ www/admin/kolabsharedfolder/sf.php: fix for issue215
2004-07-01 01:40 steffen
@@ -50,7 +50,7 @@
2004-06-28 16:00 steffen
- * kolab-webadmin.spec.in, www/admin/sharedfolder/sf.php: fix for
+ * kolab-webadmin.spec.in, www/admin/kolabsharedfolder/sf.php: fix for
issues 204 and 205
2004-06-23 12:26 steffen
@@ -60,8 +60,8 @@
2004-06-21 03:46 steffen
- * configure.ac, www/admin/sharedfolder/index.php,
- www/admin/sharedfolder/sf.php: shared folder handling + multiple
+ * configure.ac, www/admin/kolabsharedfolder/index.php,
+ www/admin/kolabsharedfolder/sf.php: shared folder handling + multiple
bugfixes
2004-06-18 13:25 steffen
@@ -76,7 +76,7 @@
* php/admin/include/ldap.class.php,
www/admin/distributionlist/list.php, www/admin/user/user.php: fix
- for issue191 + "delegate"
+ for issue191 + "kolabdelegate"
2004-06-15 03:59 steffen
@@ -136,7 +136,7 @@
2004-05-26 01:12 steffen
* www/admin/user/user.php: removed a bit of debug output and made
- homeserver readonly when it should be
+ kolabhomeserver readonly when it should be
2004-05-25 05:25 steffen
@@ -145,7 +145,7 @@
2004-05-24 13:53 steffen
* php/admin/include/auth.class.php, www/admin/user/user.php:
- reasonable default for homeServer. Check IP address when
+ reasonable default for kolabhomeserver. Check IP address when
authenticating to make it more difficult to hijack a session
2004-05-21 15:03 steffen
@@ -155,7 +155,7 @@
2004-05-20 00:26 steffen
* php/admin/templates/en/vacation.tpl, www/admin/user/user.php:
- homeServer entry + escaping of vacation text + fix for buggy
+ kolabhomeserver entry + escaping of vacation text + fix for buggy
html-parser in mozilla 1.0
2004-05-19 13:20 steffen
@@ -205,7 +205,7 @@
www/admin/pics/intevation_logo.png, www/admin/pics/kdab.png,
www/admin/pics/kde.jpg, www/admin/pics/kolab_logo.png,
www/admin/service/index.php, www/admin/service/service.php,
- www/admin/sharedfolder/index.php, www/admin/sharedfolder/sf.php,
+ www/admin/kolabsharedfolder/index.php, www/admin/kolabsharedfolder/sf.php,
www/admin/user/forward.php, www/admin/user/index.php,
www/admin/user/user.php, www/admin/user/vacation.php: new
webinterface for the kolab server
diff --git a/Makefile.am b/Makefile.am
index 208d4f1..ba7315e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,6 +38,7 @@ wsdistributionlist_DATA = $(WSDISTRIBUTIONLIST_FILES)
WSKOLAB_FILES = www/admin/kolab/erfrakon.php \
www/admin/kolab/index.php \
www/admin/kolab/intevation.php \
+ www/admin/kolab/codefusion.php \
www/admin/kolab/kdab.php \
www/admin/kolab/kde.php
@@ -51,6 +52,7 @@ wsmaintainerdir = $(wsadmindir)/maintainer
wsmaintainer_DATA = $(WSMAINTAINER_FILES)
WSPICS_FILES = www/admin/pics/erfrakon.png \
+ www/admin/pics/codefusion.png \
www/admin/pics/intevation_logo.png \
www/admin/pics/kdab.png \
www/admin/pics/kde.jpg \
@@ -64,11 +66,11 @@ WSSERVICE_FILES = www/admin/service/index.php
wsservicedir = $(wsadmindir)/service
wsservice_DATA = $(WSSERVICE_FILES)
-WSSHAREDFOLDER_FILES = www/admin/sharedfolder/sf.php \
+WSsharedfolder_FILES = www/admin/sharedfolder/sf.php \
www/admin/sharedfolder/index.php
wssharedfolderdir = $(wsadmindir)/sharedfolder
-wssharedfolder_DATA = $(WSSHAREDFOLDER_FILES)
+wssharedfolder_DATA = $(WSsharedfolder_FILES)
WSUSER_FILES = www/admin/user/forward.php \
www/admin/user/index.php \
@@ -107,6 +109,7 @@ PHP_TEMPLATES_EN = php/admin/templates/en/maintainerdeleted.tpl \
php/admin/templates/en/addresslist.tpl \
php/admin/templates/en/sflistall.tpl \
php/admin/templates/en/erfrakon.tpl \
+ php/admin/templates/en/codefusion.tpl \
php/admin/templates/en/adminlistall.tpl \
php/admin/templates/en/login.tpl \
php/admin/templates/en/maintainerlistall.tpl \
@@ -136,7 +139,7 @@ EXTRA_DIST += $(WSADMIN_FILES) \
$(WSMAINTAINER_FILES) \
$(WSPICS_FILES) \
$(WSSERVICE_FILES) \
- $(WSSHAREDFOLDER_FILES) \
+ $(WSsharedfolder_FILES) \
$(WSUSER_FILES) \
$(PHP_INCLUDES) \
$(PHP_TEMPLATES_EN)
diff --git a/configure.ac b/configure.ac
index 2999cc7..5de0ec1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ(2.57)
-m4_define(_VERSION,0.2.8)
+m4_define(_VERSION,0.3.1)
AC_INIT([kolab-webadmin],[_VERSION],[kolab-devel@kolab.org])
AC_CONFIG_SRCDIR(php/admin/include/ldap.class.php)
AC_CONFIG_AUX_DIR(.)
diff --git a/kolab-webadmin.spec.in b/kolab-webadmin.spec.in
index ec68b73..c684d82 100644
--- a/kolab-webadmin.spec.in
+++ b/kolab-webadmin.spec.in
@@ -41,10 +41,10 @@ Source0: kolab-webadmin-%{version}.tar.gz
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
-BuildPreReq: OpenPKG, openpkg >= 20040216
-PreReq: OpenPKG, openpkg >= 20040216, kolab
-PreReq: apache >= 1.3.29-20031124, apache::with_gdbm_ndbm = yes, apache::with_mod_auth_ldap = yes, apache::with_mod_dav = yes, apache::with_mod_php = yes, apache::with_mod_php_gdbm = yes, apache::with_mod_php_gettext = yes, apache::with_mod_php_imap = yes, apache::with_mod_php_openldap = yes, apache::with_mod_php_xml = yes, apache::with_mod_php_pear = yes, apache::with_mod_ssl = yes
-PreReq: php-smarty >= 2.6.2
+BuildPreReq: OpenPKG, openpkg >= 2.1.0
+PreReq: OpenPKG, openpkg >= 2.1.0, kolab
+PreReq: apache >= 1.3.31-2.1.0, apache::with_gdbm_ndbm = yes, apache::with_mod_auth_ldap = yes, apache::with_mod_dav = yes, apache::with_mod_php = yes, apache::with_mod_php_gdbm = yes, apache::with_mod_php_gettext = yes, apache::with_mod_php_imap = yes, apache::with_mod_php_openldap = yes, apache::with_mod_php_xml = yes, apache::with_mod_ssl = yes
+PreReq: php-smarty >= 2.6.3
AutoReq: no
AutoReqProv: no
diff --git a/php/admin/include/auth.class.php b/php/admin/include/auth.class.php
index 9060183..57c2f9e 100644
--- a/php/admin/include/auth.class.php
+++ b/php/admin/include/auth.class.php
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright (c) 2004 KlarÃ��¤lvdalens Datakonsult AB
+ * Copyright (c) 2004 Klarälvdalens Datakonsult AB
*
* Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>
*
@@ -57,14 +57,18 @@ class KolabAuth {
// User not logged in, check login/password
if( isset( $_POST['username'] ) && isset( $_POST['password'] ) ) {
$dn = $ldap->dnForUid( $_POST['username'] );
+ if (!$dn) {
+ $dn = $ldap->dnForMail( $_POST['username'] ); // try mail attribute
+ }
if( $dn ) {
+ $auth_user = $ldap->uidForDn( $dn );
$bind_result = $ldap->bind( $dn, $_POST['password'] );
if( $bind_result ) {
// All OK!
$_SESSION['auth_dn'] = $dn;
- $_SESSION['auth_user'] = $_POST['username'];
+ $_SESSION['auth_user'] = $auth_user;
$_SESSION['auth_pw'] = $_POST['password'];
- $_SESSION['auth_group'] = $ldap->groupForUid($_POST['username']);
+ $_SESSION['auth_group'] = $ldap->groupForUid( $auth_user );
$_SESSION['remote_ip'] = $_SERVER['REMOTE_ADDR'];
return true;
} else {
@@ -155,4 +159,4 @@ class KolabAuth {
buffer-file-coding-system: utf-8
End:
*/
-?> \ No newline at end of file
+?>
diff --git a/php/admin/include/form.class.php b/php/admin/include/form.class.php
index e54405d..9b08e35 100644
--- a/php/admin/include/form.class.php
+++ b/php/admin/include/form.class.php
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright (c) 2004 KlarÃ��¿½ï¿½Â¤lvdalens Datakonsult AB
+ * Copyright (c) 2004 Klarälvdalens Datakonsult AB
*
* Writen by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>
*
@@ -102,15 +102,19 @@ class KolabForm {
case 'select':
$str .= '<tr>';
$str .= '<td>'.$value['name'].'</td>';
- $str .= '<td><select name="'.$key.'" '.$value['attrs'].' >';
+ if( ereg( 'readonly', $value['attrs'] ) ) {
+ $str .= '<td><p>'.htmlentities($value['options'][$value['value']]).'</p></td>';
+ } else {
+ $str .= '<td><select name="'.$key.'" '.$value['attrs'].' >';
- for( $i = 0; $i < count($value['options']); ++$i) {
- if( $i == $value['value'] ) $s = 'selected';
- else $s = '';
- $str .= '<option value="'.$i.'" '.$s.'>'.htmlentities($value['options'][$i]).'</option>';
+ for( $i = 0; $i < count($value['options']); ++$i) {
+ if( $i == $value['value'] ) $s = 'selected';
+ else $s = '';
+ $str .= '<option value="'.$i.'" '.$s.'>'.htmlentities($value['options'][$i]).'</option>';
+ }
+ $str .= '</select>';
+ $str .= '</td>';
}
- $str .= '</select>';
- $str .= '</td>';
$str .= '<td>'.$value['comment'].'</td>';
$str .= '</tr>';
break;
@@ -194,12 +198,14 @@ class KolabForm {
function setValues() {
foreach( $this->entries as $k => $v ) {
if( $this->entries[$k]['type'] == 'aclselect' ) {
- $this->entries[$k]['user'] = $this->value('user_'.$k);
- $this->entries[$k]['perm'] = $this->value('perm_'.$k);
+ $this->entries[$k]['user'] = trim($this->value('user_'.$k));
+ $this->entries[$k]['perm'] = $this->value('perm_'.$k);
} else if( $this->entries[$k]['type'] == 'checkbox' ) {
- $this->entries[$k]['value'] = isset( $_REQUEST[$k] );
+ $this->entries[$k]['value'] = isset( $_REQUEST[$k] );
+ } else if( $this->entries[$k]['type'] == 'password' ) {
+ $this->entries[$k]['value'] = $this->value($k);
} else {
- $this->entries[$k]['value'] = $this->value($k);
+ $this->entries[$k]['value'] = trim($this->value($k));
}
}
}
diff --git a/php/admin/include/ldap.class.php b/php/admin/include/ldap.class.php
index 2407437..0deb709 100644
--- a/php/admin/include/ldap.class.php
+++ b/php/admin/include/ldap.class.php
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright (c) 2004 Klarälvdalens Datakonsult AB
+ * Copyright (c) 2004 KlarÃ��¿½ï¿½Â¤lvdalens Datakonsult AB
*
* Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>
*
@@ -156,7 +156,7 @@ class KolabLDAP {
function dnForUid( $uid ) {
if( $this->search( $_SESSION['base_dn'],
- '(&(objectclass=kInetOrgPerson)(uid='.$this->escape($uid).'))' ) ) {
+ '(&(objectclass=kolabInetOrgPerson)(uid='.$this->escape($uid).'))' ) ) {
$entry = $this->firstEntry();
if( $entry ) {
return ldap_get_dn( $this->connection, $entry );
@@ -167,6 +167,66 @@ class KolabLDAP {
return false;
}
+ function mailForDn( $dn ) {
+ global $errors;
+ $res = ldap_read( $this->connection, $dn, '(objectclass=*)', array( 'mail' ) );
+ if( $res ) {
+ $entries = ldap_get_entries( $this->connection, $res );
+ ldap_free_result( $res );
+ if( $entries['count'] == 1 ) {
+ return $entries[0]['mail'][0];
+ } else {
+ $errors[] = _("No such object $dn");
+ }
+ } else {
+ $errors[] = _("LDAP Error searching for DN $dn: ").ldap_error($this->connection);
+ }
+ return false;
+ }
+
+ function dnForMail( $mail ) {
+ if( $this->search( $_SESSION['base_dn'],
+ '(&(objectclass=kolabInetOrgPerson)(mail='.$this->escape($mail).'))' ) ) {
+ $entry = $this->firstEntry();
+ if( $entry ) {
+ return ldap_get_dn( $this->connection, $entry );
+ }
+ } else {
+ echo _("Error searching for DN for Mail=$mail");
+ }
+ return false;
+ }
+
+ function aliasForDn( $dn ) {
+ global $errors;
+ $res = ldap_read( $this->connection, $dn, '(objectclass=*)', array( 'alias' ) );
+ if( $res ) {
+ $entries = ldap_get_entries( $this->connection, $res );
+ ldap_free_result( $res );
+ if( $entries['count'] == 1 ) {
+ return $entries[0]['alias'][0];
+ } else {
+ $errors[] = _("No such object $dn");
+ }
+ } else {
+ $errors[] = _("LDAP Error searching for DN $dn: ").ldap_error($this->connection);
+ }
+ return false;
+ }
+
+ function dnForAlias( $mail ) {
+ if( $this->search( $_SESSION['base_dn'],
+ '(&(objectclass=kolabInetOrgPerson)(alias='.$this->escape($mail).'))' ) ) {
+ $entry = $this->firstEntry();
+ if( $entry ) {
+ return ldap_get_dn( $this->connection, $entry );
+ }
+ } else {
+ echo _("Error searching for DN for Mail=$mail");
+ }
+ return false;
+ }
+
function groupForUid( $uid ) {
$group = false;
if( !$this->is_bound ) {
@@ -190,7 +250,7 @@ class KolabLDAP {
global $errors;
$privmembers = array();
$mybase = 'cn='.$group.','.$base;
- $filter = '(objectClass=groupOfNames)';
+ $filter = '(objectClass=kolabGroupOfNames)';
$res = ldap_search( $this->connection, $mybase, $filter, array('member') );
if( !$res ) {
array_push($errors, _("LDAP Error: Can't read maintainers group: ")
@@ -216,7 +276,11 @@ class KolabLDAP {
// This can be used to check for uniqueness etc.
function countMail( $base, $mail , $excludedn=false ) {
// First count users
- $filter = '(|(mail='.$this->escape($mail).')(alias='.$this->escape($mail).'))';
+ $filter = '(|(|(mail='.$this->escape($mail).')
+ (alias='.$this->escape($mail).')
+ )
+ (uid='.$this->escape($mail).')
+ )';
$res = $this->search( $base, $filter, array( 'dn' ) );
$count = 0;
@@ -232,7 +296,7 @@ class KolabLDAP {
// Now count dist. lists
$cn = substr( $mail, 0, strpos( $mail, '@' ) );
- $filter = '(&(objectClass=groupOfNames)(cn='.$this->escape($cn).'))';
+ $filter = '(&(objectClass=kolabGroupOfNames)(cn='.$this->escape($cn).'))';
$res = $this->search( $base, $filter, array( 'dn' ) );
$entries = ldap_get_entries( $this->connection, $res );
@@ -263,8 +327,8 @@ class KolabLDAP {
$kolab_obj = $this->read( 'k=kolab,'.$_SESSION['base_dn'] );
if( !$kolab_obj ) return false;
$delete_template = array();
- $delete_template['deleteflag'] = $kolab_obj['kolabhost'];
- unset($delete_template['deleteflag']['count']);
+ $delete_template['kolabDeleteflag'] = $kolab_obj['kolabHost'];
+ unset($delete_template['kolabDeleteflag']['count']);
if( !ldap_modify($this->connection,$dn,$delete_template) ) {
return false;
}
@@ -289,4 +353,4 @@ $ldap =& new KolabLDAP;
End:
vim:encoding=utf-8:
*/
-?> \ No newline at end of file
+?>
diff --git a/php/admin/include/menu.php b/php/admin/include/menu.php
index 6981022..7ad9256 100644
--- a/php/admin/include/menu.php
+++ b/php/admin/include/menu.php
@@ -85,6 +85,8 @@ $menuitems['about'] = array( 'name' => _('About Kolab'),
'url' => 'intevation.php' ),
array( 'name' => _('Klarälvdalens Datakonsult'),
'url' => 'kdab.php' ),
+ array( 'name' => _('Code Fusion'),
+ 'url' => 'codefusion.php' ),
array( 'name' => _('KDE'),
'url' => 'kde.php' )
));
diff --git a/php/admin/templates/en/codefusion.tpl b/php/admin/templates/en/codefusion.tpl
new file mode 100644
index 0000000..9b32f0d
--- /dev/null
+++ b/php/admin/templates/en/codefusion.tpl
@@ -0,0 +1,30 @@
+{* Smarty Template *}
+{*
+ (c) 2004 Code Fusion cc
+ This program is Free Software under the GNU General Public License (>=v2).
+ Read the file COPYING that comes with this packages for details.
+*}
+<div class="contentsimple">
+
+<a href="http://www.codefusion.co.za/"><img src="../pics/codefusion.png" alt="Code Fusion" style="border:0"></a>
+
+<p><a href="http://www.codefusion.co.za/">Code Fusion cc</a> is a specialist email solution provider based in Johannesburg, South Africa.</p>
+
+<p>
+Code Fusion has played, and continues to play, an integral part in developing
+and extending the Kolab server; specifically with regards to enhancing the
+base Kolab engine, adding in support for Microsoft Active Directory &reg; as
+an LDAP backend, as well as extending the <a href="http://www.horde.org/">Horde
+project</a> to provide a web-based groupware client for the Kolab server.
+</p>
+
+<p>
+The following people from Code Fusion are involved in the Kolab project (in alphabetical order):
+</p>
+
+<p>
+Stuart K. Bing&euml; <a href="mailto:s.binge@codefusion.co.za">s.binge@codefusion.co.za</a><br>
+Stephan Buys <a href="mailto:s.buys@codefusion.co.za">s.buys@codefusion.co.za</a><br>
+</p>
+
+</div>
diff --git a/php/admin/templates/en/kolab.tpl b/php/admin/templates/en/kolab.tpl
index 8be7e2e..6f1125b 100644
--- a/php/admin/templates/en/kolab.tpl
+++ b/php/admin/templates/en/kolab.tpl
@@ -5,84 +5,119 @@
End:
*}
<div class="contenttext">
+<h1>Kolab2 Groupware Server</h1>
<p>
- This is the Kolab2 Server. It is Free Software developed
- by the <a href="http://www.kolab.org/">Kolab Project</a>
- to bring groupware functionality to both Unix/KDE users
- and Windows desktops.
+This is the Kolab2 Server.
+It is Free Software developed by the
+<a href="http://www.kolab.org/">Kolab Project</a>, with
+the intention of bringing groupware functionality to
+Unix/KDE users as well as Windows desktops.
</p>
<p>
- Kolab builds upon many other Free Software projects, like:
+Kolab builds upon many other Free Software projects, namely:
+<ul>
+ <li><a href="http://www.apache.org/">Apache</a> (HTTP Server)</li>
+ <li><a href="http://asg.web.cmu.edu/cyrus/imapd/">Cyrus</a> (IMAP Server)</li>
+ <li><a href="http://www.openldap.org/">OpenLDAP</a> (LDAP Server)</li>
+ <li><a href="http://www.postfix.org/">Postfix</a> (MTA)</li>
+ <li><a href="http://www.proftpd.org/">ProFTPD</a> (FTP Server)</li>
+</ul>
+The following projects are used in binding the above together,
+in order to create the Kolab Server:
<ul>
- <li><a href="http://www.apache.org/">Apache</a></li>
- <li><a href="http://asg.web.cmu.edu/cyrus/imapd/">Cyrus</a></li>
- <li><a href="http://www.openldap.org/">OpenLDAP</a></li>
<li><a href="http://www.perl.org/">Perl</a></li>
<li><a href="http://www.php.net/">PHP</a></li>
+ <li><a href="http://smarty.php.net/">Smarty Template Engine</a></li>
+</ul>
+The following projects are used as a base for the Kolab Clients:
+<ul>
<li><a href="http://www.kde.org/">K Desktop Environment (KDE)</a></li>
- <li><a href="http://www.openldap.org/">OpenLDAP</a></li>
- <li><a href="http://www.perl.org/">Perl</a></li>
- <li><a href="http://smarty.php.net/">PHP Smarty Template Engine</a></li>
- <li><a href="http://www.postfix.org/">Postfix</a></li>
- <li><a href="http://www.proftpd.org/">Proftpd</a></li>
+ <li><a href="http://www.horde.org/">The Horde Project</a></li>
</ul>
</p>
<p>
-Special kudos to the helpful people at the
-<a href="http://www.openpkg.org/">OpenPKG</a> project.
-OpenPKG allow us to support many different platforms
-in a reliable and predictable manner.
+The Kolab project owes a great deal of thanks to the people of the
+<a href="http://www.openpkg.org/">OpenPKG</a> project. OpenPKG allows Kolab
+to run on many diverse platforms in a reliable and predictable manner, by
+providing a common, easy-to-install, cross-platform base on which to build
+the server.
</p>
<p>
-To use all Kolab features you need an interoperable client.
-The KDE Kolab Client has been the first and so far best supported one.
+To use all Kolab2 features you need an interoperable client.
+The KDE Kolab Client was the
+first such client to be developed and is still considered the reference
+platform for others to follow.
+The KDE groupware component Kontact can act as Kolab2 Client.
Many thanks to the <a href="http://www.kde.org">KDE Project</a>
-for providing such a powerful base to build a solution on.
+for providing such a powerful base on which to build this client solution.
</p>
<p>
-User of Outlook on Microsoft Windows may use a proprietary Plugin
-to get a Kolab Windows Client. For Kolab2 the
-<a href="http://www.toltec.co.za/">Toltec Plug-in</a>
-by Radley Network Technologies CC is the designated plugin.
-Radley has worked with the Kolab community to develop the Kolab 2
-storage format.
-<p>
-Usually the Kolab Website has an
-<a href="www.kolab.org/kolab-plugins.html"
->overview about other outlook-plugins</a>.
+Users of Outlook on Microsoft Windows are able to use a proprietary plug-in to
+inter-operate with the Kolab server. For Kolab2 the preferred plug-in is the
+<a href="http://www.toltec.co.za/">Toltec Plug-in</a> by Radley Network
+Technologies CC. Radley has worked closely with the Kolab community
+to help develop the Kolab2 storage format.
</p>
<p>
-Kolab is developed by a community.
-The project was started 2002 by by a joint-venture of <a href="http://www.erfrakon.com/">erfrakon</a>
-(design, architecture and server),
+A list of additional Outlook plug-ins
+that provide interoperability with the Kolab
+server is <a href="www.kolab.org/kolab-plugins.html">maintained on the Kolab
+website</a>.
+</p>
-<a href="http://www.intevation.de">Intevation</a> (project management and client quality assurance)
+<p>
+There is also a
+<a href="http://www.kolab.org/webclient.html">web-based client</a>
+in development
+which provides full groupware functionality to mobile users through a web
+interface. It allows users to access their email, calendars, tasks, etc. from
+anywhere in the world, by simply connecting through a standard web browser.
+The web client would not have been possible without the excellent
+<a href="http://www.horde.org/">Horde project</a> on which to build.
+</p>
-and
-<a href="http://www.klaralvdalens-datakonsult.se/">Klar&auml;lvdalens Datakonsult</a>.
+<p>
+As Kolab is a Free Software project, anyone can help to
+extend the functionality of the software.
+An active community has developed
+around the software with many people throughout the world contributing.
+The project was originally started in 2002
+by by a joint-venture of three companies: <a href="http://www.erfrakon.com/">erfrakon</a>
+(design, architecture and server);
+<a href="http://www.intevation.de">Intevation</a> (project management)
+and
+<a href="http://www.klaralvdalens-datakonsult.se/">Klar&auml;lvdalens Datakonsult</a> (client).
</p>
+
<p>
-Later <a href="http://www.codefusion.co.za/">Codefusion CC</a> (new kolab engine, horde webclient) joined.
+<a href="http://www.codefusion.co.za/">Code Fusion cc</a> joined the project
+soon after the original Kolab1 server was released.
+Its developers are primarily responsible
+for an updated engine (which forms the base of the Kolab2 server),
+the web client, as well
+as contributing to development of the Kolab2 storage format.
</p>
+
<p>
Other contributors:<br/>
<ul>
<li> <a href="http://www.konsec.com">Konsec GmbH</a> CSSified the Kolab1 web admin GUI</li>
</ul>
</p>
+
<p>
- The prinicipal authors of the kolab client and server software are in alphabetical order:
+The principal authors of the Kolab client and server software are (in alphabetical order):
</p>
<p>
<ul>
- <li><a href="mailto:s.binge@codefusion.co.za">Stuart Binge</a></li>
- <li> <a href="mailto:s.buys@codefusion.co.za">Stephan Buys</a></li>
+ <li><a href="mailto:s.binge@codefusion.co.za">Stuart K. Bing&euml;</a></li>
+ <li><a href="mailto:s.buys@codefusion.co.za">Stephan Buys</a></li>
<li><a href="mailto:kalle@klaralvdalens-datakonsult.se?subject=Kolab Server 1.9">Matthias Kalle Dalheimer</a></li>
<li><a href="mailto:tassilo.erlewein@erfrakon.de?subject=Kolab Server 1.9">Tassilo Erlewein</a></li>
<li><a href="mailto:dfaure@klaralvdalens-datakonsult.se?subject=Kolab Client 1.9">David Faure</a></li>
diff --git a/php/admin/templates/en/service.tpl b/php/admin/templates/en/service.tpl
index adef530..3605e08 100644
--- a/php/admin/templates/en/service.tpl
+++ b/php/admin/templates/en/service.tpl
@@ -40,6 +40,26 @@ Warn users when they have used <input name="quotawarn" size="3" value="{$quotaw
</form>
</div>
<br />
+<h1>Privileged Networks</h1>
+<div class="contentform">
+<form name="postfixmynetworksform" method="POST">
+Networks allowed to relay and send mail through unauthenticated SMTP connections to the Kolab server
+(comma separated networks in x.x.x.x/y format):
+<input type="text" name="postfixmynetworks" size="80" value="{$postfixmynetworks}" />
+<div align="right"><input type="submit" name="submitpostfixmynetworks" value="Update" /></div>
+</form>
+</div>
+<br />
+<h1>Accept Internet Mail</h1>
+<div class="contentform">
+<form name="postfixallowunauthform" method="POST">
+<input type="checkbox" name="postfixallowunauth" {if $postfixallowunauth == 'true' }checked{/if} />
+Accept mail from other domains over non-authenticated SMTP. This must be enabled if you want to use the Kolab server
+to receive mail from other internet domains.
+<div align="right"><input type="submit" name="submitpostfixallowunauth" value="Update" /></div>
+</form>
+</div>
+<br />
<h1>Kolab Hosts</h1>
<table class="contenttable" cellpadding="0" cellspacing="1px">
<tr class="contentrow">
diff --git a/php/admin/templates/en/sflistall.tpl b/php/admin/templates/en/sflistall.tpl
index 5acd87a..ca15880 100644
--- a/php/admin/templates/en/sflistall.tpl
+++ b/php/admin/templates/en/sflistall.tpl
@@ -15,7 +15,7 @@
{section name=id loop=$entries}
<tr class="contentrow{cycle values="even,odd"}">
<td class="contentcell">{$entries[id].cn|escape:"html"}</td>
- <td class="contentcell">{$entries[id].homeserver|escape:"html"}</td>
+ <td class="contentcell">{$entries[id].kolabhomeserver|escape:"html"}</td>
{if $entries[id].deleted neq "FALSE"}
<td class="actioncell" colspan="2">Folder deleted, awaiting cleanup...</td>
{else}
diff --git a/php/admin/templates/en/userlistall.tpl b/php/admin/templates/en/userlistall.tpl
index da7e0dc..0b20d0d 100644
--- a/php/admin/templates/en/userlistall.tpl
+++ b/php/admin/templates/en/userlistall.tpl
@@ -4,18 +4,40 @@
buffer-file-coding-system: utf-8
End:
*}
-<div class="contenttext">
-
+<div class="contentform">
+<form name="filterform" method="POST">
+Filter: <select name="filterattr">
+{foreach key=value item=name from=$filterattrs}
+{if $value eq $filterattr}
+ <option value="{$value}" selected>{$name|escape:"html"}</option>
+{else}
+ <option value="{$value}">{$name|escape:"html"}</option>
+{/if}
+{/foreach}
+</select>
+<select name="filtertype">
+{foreach key=value item=name from=$filtertypes}
+{if $value eq $filtertype}
+ <option value="{$value}" selected>{$name|escape:"html"}</option>
+{else}
+ <option value="{$value}">{$name|escape:"html"}</option>
+{/if}
+{/foreach}
+</select>
+<input type="text" name="filtervalue" value="{$filtervalue|escape:"html"}" />
+<input type="submit" name="filtersubmit" value="Filter" /></form>
</div>
-
+<h3>Email Users<h3>
+<div>
<table class="contenttable" cellpadding="0" cellspacing="1px">
<tr class="contentrow">
- <th>Name</th><th>E-mail</th><th colspan="2">Action</th>
+ <th>Name</th><th>E-mail</th><th>uid</th><th colspan="2">Action</th>
</tr>
{section name=id loop=$entries}
<tr class="contentrow{cycle values="even,odd"}">
<td class="contentcell">{$entries[id].sn|escape:"html"}, {$entries[id].fn|escape:"html"}</td>
<td class="contentcell"><a href="mailto:{$entries[id].mail|escape:"html"}">{$entries[id].mail|escape:"html"}</a></td>
+ <td class="contentcell">{$entries[id].uid|escape:"html"}</td>
{if $entries[id].deleted neq "FALSE"}
<td class="actioncell" colspan="2">User Deleted, awaiting cleanup...</td>
{else}
@@ -25,3 +47,4 @@
</tr>
{/section}
</table>
+</div> \ No newline at end of file
diff --git a/www/admin/addressbook/addr.php b/www/admin/addressbook/addr.php
index 884dd73..0d7a2df 100644
--- a/www/admin/addressbook/addr.php
+++ b/www/admin/addressbook/addr.php
@@ -125,7 +125,7 @@ if( !$errors ) {
$content = $form->outputForm();
} else {
$addressbook_root = "cn=external,".$_SESSION['base_dn'];
- $ldap_object = array('objectClass' => 'inetOrgPerson');
+ $ldap_object = array('objectClass' => array( 'top', 'inetOrgPerson', 'kolabInetOrgPerson' ) );
$firstname = trim($_POST['firstname']);
$lastname = trim($_POST['lastname']);
$ldap_object['sn'] = trim($lastname);
@@ -222,7 +222,7 @@ if( !$errors ) {
if( $result ) {
$ldap_object = ldap_get_entries( $ldap->connection, $result );
if( $ldap_object['count'] == 1 ) {
- fill_form_for_modify( &$form, $ldap_object[0] );
+ fill_form_for_modify( $form, $ldap_object[0] );
$form->entries['action']['value'] = 'kill';
foreach( $form->entries as $key ) {
$form->entries[$key]['attrs'] = 'readonly';
diff --git a/www/admin/administrator/admin.php b/www/admin/administrator/admin.php
index 340dd2c..9f6865c 100644
--- a/www/admin/administrator/admin.php
+++ b/www/admin/administrator/admin.php
@@ -174,7 +174,7 @@ switch( $action ) {
} else {
debug("Process...");
$ldap_object = array();
- $ldap_object['objectClass'] = 'inetOrgPerson';
+ $ldap_object['objectClass'] = array('top','inetOrgPerson', 'kolabInetOrgPerson');
$ldap_object['sn'] = trim($_POST['lastname']);
$ldap_object['cn'] = trim($_POST['firstname']).' '.$ldap_object['sn'];
if( !empty( $_POST['password_0'] ) ) {
@@ -183,7 +183,7 @@ switch( $action ) {
}
if( $action == 'firstsave' ) $ldap_object['uid'] = trim( strtolower( $_POST['uid'] ) );
- var_dump( $ldap_object );
+ debug_var_dump( $ldap_object );
$domain_dn = domain_dn();
diff --git a/www/admin/administrator/index.php b/www/admin/administrator/index.php
index c814acb..7f75325 100644
--- a/www/admin/administrator/index.php
+++ b/www/admin/administrator/index.php
@@ -33,7 +33,7 @@ if( !$errors ) {
$maintainers = $ldap->groupMembers( $base_dn, 'admin' );
$filter = "(&(cn=*)(objectclass=inetOrgPerson)(uid=*)(sn=*))";
- $result = ldap_list($ldap->connection, $base_dn, $filter, array( 'uid', 'sn', 'cn', 'deleteflag' ));
+ $result = ldap_list($ldap->connection, $base_dn, $filter, array( 'uid', 'sn', 'cn', 'kolabdeleteflag' ));
if( $result ) {
$title = _('Manage Administrators (').count($maintainers)._(' Administrators)');
@@ -55,7 +55,7 @@ if( !$errors ) {
while( $entry ) {
$attrs = ldap_get_attributes($ldap->connection, $entry);
$dn = ldap_get_dn($ldap->connection,$entry);
- $deleted = array_key_exists('deleteflag',$attrs)?$attrs['deleteflag'][0]:"FALSE";
+ $deleted = array_key_exists('kolabdeleteflag',$attrs)?$attrs['kolabdeleteflag'][0]:"FALSE";
$userid = $attrs['uid'][0];
$sn = $attrs['sn'][0];
$cn = $attrs['cn'][0];
diff --git a/www/admin/distributionlist/index.php b/www/admin/distributionlist/index.php
index e6ec0ac..61fdfcc 100644
--- a/www/admin/distributionlist/index.php
+++ b/www/admin/distributionlist/index.php
@@ -1,11 +1,24 @@
<?php
/*
- (c) 2004 Klarälvdalens Datakonsult AB
- (c) 2003 Tassilo Erlewein <tassilo.erlewein@erfrakon.de>
- (c) 2003 Martin Konold <martin.konold@erfrakon.de>
- This program is Free Software under the GNU General Public License (>=v2).
- Read the file COPYING that comes with this packages for details.
-*/
+ * Copyright (c) 2004 Klarälvdalens Datakonsult AB
+ * Copyright (c) 2003 Tassilo Erlewein <tassilo.erlewein@erfrakon.de>
+ * Copyright (c) 2003 Martin Konold <martin.konold@erfrakon.de>
+ *
+ * Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2, 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
+ * General Public License for more details.
+ *
+ * You can view the GNU General Public License, online, at the GNU
+ * Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
+ */
require_once('admin/include/mysmarty.php');
require_once('admin/include/headers.php');
@@ -31,7 +44,7 @@ $menuitems[$sidx]['selected'] = 'selected';
if( !$errors ) {
if (isset($_SESSION['base_dn'])) $base_dn = $_SESSION['base_dn'];
else $base_dn = 'k=kolab';
- $filter = "(&(cn=*)(objectclass=groupOfNames))";
+ $filter = "(&(cn=*)(objectclass=kolabGroupOfNames))";
$result = ldap_search($ldap->connection, $base_dn, $filter);
if( $result ) {
$count = ldap_count_entries($ldap->connection, $result);
@@ -43,11 +56,13 @@ if( !$errors ) {
$attrs = ldap_get_attributes($ldap->connection, $entry);
$dn = ldap_get_dn($ldap->connection,$entry);
$cn = $attrs['cn'][0];
- $deleteflag = $attrs['deleteflag'][0];
- $homeserver = _('not yet implemented');
- $entries[] = array( 'dn' => $dn,
- 'cn' => $cn,
- 'deleted' => $deleteflag );
+ if( $cn != 'admin' && $cn != 'maintainer' ) {
+ $kolabdeleteflag = $attrs['kolabdeleteflag'][0];
+ $kolabhomeserver = _('not yet implemented');
+ $entries[] = array( 'dn' => $dn,
+ 'cn' => $cn,
+ 'deleted' => $kolabdeleteflag );
+ }
$entry = ldap_next_entry( $ldap->connection,$entry );
}
}
diff --git a/www/admin/distributionlist/list.php b/www/admin/distributionlist/list.php
index 92903d4..b6d2083 100644
--- a/www/admin/distributionlist/list.php
+++ b/www/admin/distributionlist/list.php
@@ -1,10 +1,22 @@
<?php
/*
- (c) 2004 Klarälvdalens Datakonsult AB
-
- This program is Free Software under the GNU General Public License (>=v2).
- Read the file COPYING that comes with this packages for details.
-*/
+ * Copyright (c) 2004 KlarÃ��¤lvdalens Datakonsult AB
+ *
+ * Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2, 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
+ * General Public License for more details.
+ *
+ * You can view the GNU General Public License, online, at the GNU
+ * Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
+ */
require_once('admin/include/mysmarty.php');
require_once('admin/include/headers.php');
@@ -26,11 +38,15 @@ if( $auth->group() != 'maintainer' && $auth->group() != 'admin') {
require_once('admin/include/menu.php');
function checkemaillist( $form, $key, $value ) {
+ global $ldap;
if( $key == 'members' ) {
$lst = array_unique( array_filter( array_map( 'trim', preg_split( '/\n/', $value ) ), 'strlen') );
- /*foreach( $lst as $a ) {
- if( !ereg('.*@.*', $a ) ) return 'Invalid email address syntax';
- }*/
+ if( count($lst) < 1 ) return _('Please add at least one member');
+ foreach( $lst as $a ) {
+ debug("Trying $a");
+ ($dn = $ldap->dnForMail($a)) || ($dn = $ldap->dnForUid($a)) || ($dn = $ldap->dnForAlias($a));
+ if( !$dn ) return _("No user with email address, UID or alias $a");
+ }
}
return '';
}
@@ -66,9 +82,10 @@ function fill_form_for_modify( &$form, &$ldap_object ) {
$form->entries['action']['value'] = 'save';
$m = $ldap_object['member'];
unset( $m['count'] );
+ debug_var_dump( $m );
$form->entries['members']['value'] = join("\r\n",
array_map( create_function( '$dn',
- 'global $ldap;return $ldap->uidForDn($dn);' ), $m) );
+ 'global $ldap; return $ldap->mailForDn($dn);' ), $m) );
$internaldn = 'cn=internal,'.domain_dn();
debug("internaldn=\"$internaldn\"");
debug("dn=\"$dn\"");
@@ -101,7 +118,7 @@ $entries = array( 'cn' => array( 'name' => _('List Name'),
'comment' => _('Required') ),
'members' => array( 'name' => _('Members'),
'type' => 'textarea',
- 'comment' => _('One UID per line'),
+ 'comment' => _('One email address per line'),
'validation' => 'checkemaillist'));
$entries['hidden'] = array( 'name' => 'Hidden',
@@ -144,18 +161,20 @@ if( !$errors ) {
else $visible = true;
if (!$visible) $dl_root = "cn=internal,".$dl_root;
- $ldap_object = array('objectClass' => 'groupOfNames');
+ $ldap_object = array('objectClass' => 'kolabGroupOfNames');
$cn = trim($_POST['cn']);
$ldap_object['cn'] = $cn;
$ldap_object['member'] = array();
$lst = array_unique( array_filter( array_map( 'trim', preg_split( '/\n/', trim($_POST['members']) ) ), 'strlen') );
foreach( $lst as $a ) {
- $memberdn = $ldap->dnForUid($a);
+ debug("Translating $a");
+ ($memberdn = $ldap->dnForMail($a)) || ($memberdn = $ldap->dnForUid($a)) || ($memberdn = $ldap->dnForAlias($a));
+ debug("Found $memberdn");
if( $memberdn ) {
$ldap_object['member'][] = $memberdn;
} else {
- $errors[] = _("No such UID $a");
+ $errors[] = _("No user with address $a");
break;
}
}
@@ -240,7 +259,7 @@ if( !$errors ) {
}
break;
case 'modify':
- $result = $ldap->search( $dn, '(objectClass=groupOfNames)' );
+ $result = $ldap->search( $dn, '(objectClass=kolabGroupOfNames)' );
if( $result ) {
$ldap_object = ldap_get_entries( $ldap->connection, $result );
if( $ldap_object['count'] == 1 ) {
@@ -256,7 +275,7 @@ if( !$errors ) {
}
break;
case 'delete':
- $result = $ldap->search( $dn, '(objectClass=groupOfNames)' );
+ $result = $ldap->search( $dn, '(objectClass=kolabGroupOfNames)' );
if( $result ) {
$ldap_object = ldap_get_entries( $ldap->connection, $result );
if( $ldap_object['count'] == 1 ) {
diff --git a/www/admin/index.php b/www/admin/index.php
index 34bfeca..81b6ccb 100644
--- a/www/admin/index.php
+++ b/www/admin/index.php
@@ -1,10 +1,22 @@
<?php
/*
- (c) 2004 Klarlvdalens Datakonsult AB
-
- This program is Free Software under the GNU General Public License (>=v2).
- Read the file COPYING that comes with this packages for details.
-*/
+ * Copyright (c) 2004 Klarälvdalens Datakonsult AB
+ *
+ * Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2, 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
+ * General Public License for more details.
+ *
+ * You can view the GNU General Public License, online, at the GNU
+ * Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
+ */
require_once('admin/include/mysmarty.php');
require_once('admin/include/headers.php');
diff --git a/www/admin/kolab/codefusion.php b/www/admin/kolab/codefusion.php
index 3c101b3..a781d6b 100644
--- a/www/admin/kolab/codefusion.php
+++ b/www/admin/kolab/codefusion.php
@@ -23,7 +23,6 @@
require_once('admin/include/mysmarty.php');
require_once('admin/include/headers.php');
-require_once('admin/include/locale.php');
require_once('admin/include/authenticate.php');
/**** Authentication etc. ***/
diff --git a/www/admin/kolab/erfrakon.php b/www/admin/kolab/erfrakon.php
index 81502fb..8bd55c9 100644
--- a/www/admin/kolab/erfrakon.php
+++ b/www/admin/kolab/erfrakon.php
@@ -1,11 +1,24 @@
<?php
/*
- (c) 2004 Klarlvdalens Datakonsult AB
- (c) 2003 Tassilo Erlewein <tassilo.erlewein@erfrakon.de>
- (c) 2003 Martin Konold <martin.konold@erfrakon.de>
- This program is Free Software under the GNU General Public License (>=v2).
- Read the file COPYING that comes with this packages for details.
-*/
+ * Copyright (c) 2004 Klarälvdalens Datakonsult AB
+ * Copyright (c) 2003 Tassilo Erlewein <tassilo.erlewein@erfrakon.de>
+ * Copyright (c) 2003 Martin Konold <martin.konold@erfrakon.de>
+ *
+ * Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2, 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
+ * General Public License for more details.
+ *
+ * You can view the GNU General Public License, online, at the GNU
+ * Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
+ */
require_once('admin/include/mysmarty.php');
require_once('admin/include/headers.php');
diff --git a/www/admin/maintainer/index.php b/www/admin/maintainer/index.php
index 88ca79c..bf129b7 100644
--- a/www/admin/maintainer/index.php
+++ b/www/admin/maintainer/index.php
@@ -40,7 +40,7 @@ if( !$errors ) {
$maintainers = $ldap->groupMembers( $base_dn, 'maintainer' );
$filter = "(&(cn=*)(objectclass=inetOrgPerson)(uid=*)(sn=*))";
- $result = ldap_list($ldap->connection, $base_dn, $filter, array( 'uid', 'sn', 'cn', 'deleteflag' ));
+ $result = ldap_list($ldap->connection, $base_dn, $filter, array( 'uid', 'sn', 'cn', 'kolabdeleteflag' ));
if( $result ) {
$title = _('Manage Maintainers (').count($maintainers)._(' Maintainers)');
@@ -62,7 +62,7 @@ if( !$errors ) {
while( $entry ) {
$attrs = ldap_get_attributes($ldap->connection, $entry);
$dn = ldap_get_dn($ldap->connection,$entry);
- $deleted = array_key_exists('deleteflag',$attrs)?$attrs['deleteflag'][0]:"FALSE";
+ $deleted = array_key_exists('kolabdeleteflag',$attrs)?$attrs['kolabdeleteflag'][0]:"FALSE";
$userid = $attrs['uid'][0];
$sn = $attrs['sn'][0];
$cn = $attrs['cn'][0];
diff --git a/www/admin/maintainer/maintainer.php b/www/admin/maintainer/maintainer.php
index 05e56d6..f04d5c7 100644
--- a/www/admin/maintainer/maintainer.php
+++ b/www/admin/maintainer/maintainer.php
@@ -1,10 +1,22 @@
<?php
/*
- (c) 2004 Klarälvdalens Datakonsult AB
-
- This program is Free Software under the GNU General Public License (>=v2).
- Read the file COPYING that comes with this packages for details.
-*/
+ * Copyright (c) 2004 Klarälvdalens Datakonsult AB
+ *
+ * Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2, 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
+ * General Public License for more details.
+ *
+ * You can view the GNU General Public License, online, at the GNU
+ * Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
+ */
require_once('admin/include/mysmarty.php');
require_once('admin/include/headers.php');
@@ -181,7 +193,7 @@ switch( $action ) {
} else {
debug("Process...");
$ldap_object = array();
- $ldap_object['objectClass'] = 'inetOrgPerson';
+ $ldap_object['objectClass'] = array( 'top', 'inetOrgPerson', 'kolabInetOrgPerson');
$ldap_object['sn'] = trim($_POST['lastname']);
$ldap_object['cn'] = trim($_POST['firstname']).' '.$ldap_object['sn'];
if( !empty( $_POST['password_0'] ) ) {
@@ -190,7 +202,7 @@ switch( $action ) {
}
if( $action == 'firstsave' ) $ldap_object['uid'] = trim( strtolower( $_POST['uid'] ) );
- var_dump( $ldap_object );
+ debug_var_dump( $ldap_object );
$domain_dn = domain_dn();
@@ -315,7 +327,7 @@ switch( $action ) {
.ldap_error($ldap->connection);
}
if( !$errors ) {
- $delete_template['deleteflag'] = 'TRUE';
+ $delete_template['kolabdeleteflag'] = 'TRUE';
if( !$ldap->deleteObject($dn)) {
array_push($errors, _("LDAP Error: could not mark $dn for deletion ")
.ldap_error($ldap->connection));
diff --git a/www/admin/pics/kolab_logo.png b/www/admin/pics/kolab_logo.png
index a09acdd..8c99f6a 100644
--- a/www/admin/pics/kolab_logo.png
+++ b/www/admin/pics/kolab_logo.png
Binary files differ
diff --git a/www/admin/service/index.php b/www/admin/service/index.php
index 8b57f02..40bc485 100644
--- a/www/admin/service/index.php
+++ b/www/admin/service/index.php
@@ -38,6 +38,8 @@ function extract_ldap_values()
global $http;
global $amavis;
global $quotawarn;
+ global $postfixmynetworks;
+ global $postfixallowunauth;
global $kolabhost;
// Get values from LDAP
@@ -53,7 +55,9 @@ function extract_ldap_values()
$http = $attrs['apache-http'][0];
$amavis = $attrs['postfix-enable-virus-scan'][0];
$quotawarn = $attrs['cyrus-quotawarn'][0];
- $kolabhost = $attrs['kolabhost'];
+ $postfixmynetworks = $attrs['postfix-mynetworks'][0];
+ $postfixallowunauth = $attrs['postfix-allow-unauthenticated'][0];
+ $kolabhost = $attrs['kolabHost'];
unset( $kolabhost['count'] );
ldap_free_result($result);
}
@@ -91,6 +95,24 @@ if( $_REQUEST['submitquotawarn'] ) {
}
}
+if( $_REQUEST['submitpostfixmynetworks'] ) {
+ $attrs = array();
+ $attrs['postfix-mynetworks'] = trim( $_REQUEST['postfixmynetworks'] );
+ if( !($result = ldap_modify($ldap->connection, "k=kolab,".$_SESSION['base_dn'], $attrs)) ) {
+ $errors[] = _("LDAP Error: failed to modify kolab configuration object: ")
+ .ldap_error($ldap->connection);
+ }
+}
+
+if( $_REQUEST['submitpostfixallowunauth'] ) {
+ $attrs = array();
+ $attrs['postfix-allow-unauthenticated'] = postvalue( 'postfixallowunauth' );
+ if( !($result = ldap_modify($ldap->connection, "k=kolab,".$_SESSION['base_dn'], $attrs)) ) {
+ $errors[] = _("LDAP Error: failed to modify kolab configuration object: ")
+ .ldap_error($ldap->connection);
+ }
+}
+
if( $_REQUEST['deletekolabhost'] ) {
extract_ldap_values();
$key = array_search($_REQUEST['akolabhost'],$kolabhost);
@@ -135,6 +157,8 @@ $smarty->assign( 'group', $auth->group() );
$smarty->assign( 'page_title', $menuitems[$sidx]['title'] );
$smarty->assign( 'entries', $entries );
$smarty->assign( 'quotawarn', $quotawarn );
+$smarty->assign( 'postfixmynetworks', $postfixmynetworks );
+$smarty->assign( 'postfixallowunauth', toboolstr($postfixallowunauth) );
$smarty->assign( 'kolabhost', $kolabhost );
$smarty->assign( 'menuitems', $menuitems );
$smarty->assign( 'submenuitems',
diff --git a/www/admin/service/service.php b/www/admin/service/service.php
index f902d57..5887520 100644
--- a/www/admin/service/service.php
+++ b/www/admin/service/service.php
@@ -208,7 +208,7 @@ if (!$errors) {
switch ($change) {
case "change":
$attrs = array();
- if ($hostname) $attrs['fqhostname'][0] = $hostname;
+ if ($hostname) $attrs['fqdnhostname'][0] = $hostname;
if ($mydomain) {
if (($result = ldap_read($link, "k=kolab,".$base_dn, "(objectclass=*)")) &&
($entry = ldap_first_entry($link,$result)) &&
@@ -256,7 +256,7 @@ if (!$errors) {
if (($result = ldap_read($link, "k=kolab,".$_SESSION['base_dn'], "(objectclass=*)")) &&
($entry = ldap_first_entry($link, $result)) &&
($attrs = ldap_get_attributes($link, $entry))) {
- $hostname = $attrs['fqhostname'][0];
+ $hostname = $attrs['fqdnhostname'][0];
$mydomain = $attrs['postfix-mydomain'][0];
ldap_free_result($result);
} else array_push($errors, "LDAP Error: could not kolab configuration object ".ldap_error($link));
diff --git a/www/admin/sharedfolder/index.php b/www/admin/sharedfolder/index.php
index 62065a2..69b5355 100644
--- a/www/admin/sharedfolder/index.php
+++ b/www/admin/sharedfolder/index.php
@@ -1,6 +1,6 @@
<?php
/*
- (c) 2004 Klarlvdalens Datakonsult AB
+ (c) 2004 Klarälvdalens Datakonsult AB
(c) 2003 Tassilo Erlewein <tassilo.erlewein@erfrakon.de>
(c) 2003 Martin Konold <martin.konold@erfrakon.de>
This program is Free Software under the GNU General Public License (>=v2).
@@ -31,7 +31,7 @@ $menuitems[$sidx]['selected'] = 'selected';
if( !$errors ) {
if (isset($_SESSION['base_dn'])) $base_dn = $_SESSION['base_dn'];
else $base_dn = 'k=kolab';
- $filter = "(&(cn=*)(objectclass=sharedfolder))";
+ $filter = "(&(cn=*)(objectclass=kolabSharedFolder))";
$result = ldap_search($ldap->connection, $base_dn, $filter);
if( $result ) {
$count = ldap_count_entries($ldap->connection, $result);
@@ -43,12 +43,12 @@ if( !$errors ) {
$attrs = ldap_get_attributes($ldap->connection, $entry);
$dn = ldap_get_dn($ldap->connection,$entry);
$cn = $attrs['cn'][0];
- $deleteflag = $attrs['deleteflag'][0];
- $homeserver = $attrs['homeServer'][0];
+ $deleted = array_key_exists('kolabDeleteflag',$attrs)?$attrs['kolabDeleteflag'][0]:"FALSE";
+ $kolabhomeserver = $attrs['kolabHomeServer'][0];
$entries[] = array( 'dn' => $dn,
'cn' => $cn,
- 'homeserver' => $homeserver,
- 'deleted' => $deleteflag );
+ 'kolabhomeserver' => $kolabhomeserver,
+ 'deleted' => $deleted );
$entry = ldap_next_entry( $ldap->connection,$entry );
}
}
diff --git a/www/admin/sharedfolder/sf.php b/www/admin/sharedfolder/sf.php
index 3b4b44b..8dbe0e4 100644
--- a/www/admin/sharedfolder/sf.php
+++ b/www/admin/sharedfolder/sf.php
@@ -29,12 +29,12 @@ function fill_form_for_modify( &$form, &$ldap_object ) {
else $cn = $ldap_object['cn'];
$form->entries['cn']['value'] = $cn;
- if (is_array($ldap_object['userquota'])) $userquota = $ldap_object['userquota'][0];
- else $userquota = $ldap_object['userquota'];
- $form->entries['userquota']['value'] = $userquota;
+ if (is_array($ldap_object['cyrus-userquota'])) $userquota = $ldap_object['cyrus-userquota'][0];
+ else $userquota = $ldap_object['cyrus-userquota'];
+ $form->entries['cyrus-userquota']['value'] = $userquota;
- if (is_array($ldap_object['homeserver'])) $homeserver = $ldap_object['homeserver'][0];
- $form->entries['homeserver']['value'] = $homeserver;
+ if (is_array($ldap_object['kolabHomeServer'])) $kolabhomeserver = $ldap_object['kolabHomeServer'][0];
+ $form->entries['kolabhomeserver']['value'] = $kolabhomeserver;
$form->entries['action']['value'] = 'save';
//debug("got userquota=$userquota<br/>cn=$cn<br/>");
@@ -45,14 +45,14 @@ function fill_form_for_modify( &$form, &$ldap_object ) {
list($u, $p ) = split( ' ', $acl, 2 );
if( !strncmp( "group:", $u, 6 ) ) $u = substr( $u, 6 );
//debug( "u=$u, p=$p" );
- $form->entries['acl_'.$aclcount] = array( 'name' => _('Permission for UID/GID'),
+ $form->entries['acl_'.$aclcount] = array( 'name' => _('Permission for UID/email/GID'),
'type' => 'aclselect',
'user' => $u,
'perm' => $p
);
$aclcount++;
}
- $form->entries['acl_'.$aclcount] = array( 'name' => _('Permission for UID/GID'),
+ $form->entries['acl_'.$aclcount] = array( 'name' => _('Permission for UID/email/GID'),
'type' => 'aclselect',
'user' => '',
'perm' => 'all'
@@ -69,18 +69,20 @@ function process_acl( $uid, $perm )
// Special users allowed
return "$uid $perm";
}
- $res = $ldap->search( $_SESSION['base_dn'], '(&(uid='.$ldap->escape($uid).')(objectClass=kInetOrgPerson))',
- array('dn') );
+ $res = $ldap->search( $_SESSION['base_dn'], '(&(|(uid='.$ldap->escape($uid).')(mail='.$ldap->escape($uid).')(alias='.$ldap->escape($uid).'))(objectClass=kolabInetOrgPerson))',
+ array('dn', 'mail' ) );
if( $ldap->count($res) == 1 ) {
// Ok, we have a regular user
+ $entries = $ldap->getEntries();
+ $mail = $entries[0]['mail'][0];
$ldap->freeSearchResult();
- return "$uid $perm";
+ return "$mail $perm";
}
$regs = array();
- if( ereg('(.*)@(.*)', $uid, &$regs ) ) {
+ if( ereg('(.*)@(.*)', $uid, $regs ) ) {
$cn = $regs[1];
- $res = $ldap->search( $_SESSION['base_dn'], '(&(cn='.$ldap->escape($cn).')(objectClass=groupOfNames))',
+ $res = $ldap->search( $_SESSION['base_dn'], '(&(cn='.$ldap->escape($cn).')(objectClass=kolabGroupOfNames))',
array('dn') );
if( $ldap->count($res) == 1 ) {
$objects = $ldap->getEntries();
@@ -115,12 +117,12 @@ if (!$errors && $auth->group() != 'maintainer' && $auth->group() != 'admin')
$entries = array( 'cn' => array( 'name' => _('Folder Name'),
'validation' => 'notempty',
'comment' => _('Required') ),
- 'homeserver' => array( 'name' => _('Folder Location'),
+ 'kolabhomeserver' => array( 'name' => _('Folder Location'),
'validation' => 'notempty',
'comment' => ($action=='create')?_('Required, non volatile'):_('Non volatile'),
- 'value' => $_SESSION['fqhostname'] ),
- 'userquota' => array( 'name' => _('Quota Limit'),
- 'comment' => _('KBytes (empty for unlimited)') ),
+ 'value' => $_SESSION['fqdnhostname'] ),
+ 'cyrus-userquota' => array( 'name' => _('Quota Limit'),
+ 'comment' => _('MBytes (empty for unlimited)') ),
'acl_0' => array( 'name' => _('Permission for UID/GID'),
'type' => 'aclselect',
'user' => 'anyone',
@@ -155,10 +157,10 @@ if( !$errors ) {
$content = $form->outputForm();
} else {
$sf_root = $_SESSION['base_dn'];
- $ldap_object = array('objectClass' => 'sharedfolder');
+ $ldap_object = array('objectClass' => 'kolabSharedFolder');
$cn = trim($_POST['cn']);
$ldap_object['cn'] = $cn;
- foreach ( array( 'userquota') as $attr) {
+ foreach ( array( 'cyrus-userquota') as $attr) {
$count = 0;
$key = $attr;
$args = array();
@@ -170,7 +172,7 @@ if( !$errors ) {
if ($count > 0) $ldap_object[$attr] = $args;
else if (!empty($_POST[$key])) $ldap_object[$attr] = $_POST[$key];
}
- if( $ldap_object['userquota'] == '' ) unset($ldap_object['userquota']);
+ if( $ldap_object['cyrus-userquota'] == '' ) unset($ldap_object['cyrus-userquota']);
$aclcount = 0;
while( $_POST['user_acl_'.$aclcount] ) {
if( !empty( $_POST['user_acl_'.$aclcount] ) ) {
@@ -212,7 +214,7 @@ if( !$errors ) {
} else {
if (!$errors) {
$dn = "cn=".$ldap_object['cn'].",".$sf_root;
- $ldap_object['homeserver'] = trim($_POST['homeserver']);
+ $ldap_object['kolabHomeServer'] = trim($_POST['kolabhomeserver']);
if ($dn && !ldap_add($ldap->connection, $dn, $ldap_object))
array_push($errors, _("LDAP Error: could not add object $dn: ")
.ldap_error($ldap->connection));
@@ -227,54 +229,43 @@ if( !$errors ) {
$form->entries['action']['value'] = 'save';
$form->entries['dn'] = array( 'type' => 'hidden', 'value' => $dn );
$form->entries['cn']['attrs'] = 'readonly';
- $form->entries['homeserver']['attrs'] = 'readonly';
+ $form->entries['kolabhomeserver']['attrs'] = 'readonly';
$heading = _('Modify Shared Folder');
- $result = $ldap->search( $dn, '(objectClass=sharedfolder)' );
- if( $result ) {
- $ldap_object = ldap_get_entries( $ldap->connection, $result );
- if( $ldap_object['count'] == 1 ) {
- $ldap_object = $ldap_object[0];
- fill_form_for_modify( $form, $ldap_object );
- }
- $ldap->freeSearchResult();
+ $ldap_object = $ldap->read( $dn );
+ if( $ldap_object ) {
+ fill_form_for_modify( $form, $ldap_object );
}
$content = $form->outputForm();
}
}
break;
case 'modify':
- $result = $ldap->search( $dn, '(objectClass=sharedfolder)' );
- if( $result ) {
- $ldap_object = ldap_get_entries( $ldap->connection, $result );
- if( $ldap_object['count'] == 1 ) {
- fill_form_for_modify( $form, $ldap_object[0] );
- $form->entries['action']['value'] = 'save';
- $form->entries['dn'] = array( 'type' => 'hidden', 'value' => $dn );
- $form->entries['cn']['attrs'] = 'readonly';
- $form->entries['homeserver']['attrs'] = 'readonly';
- $heading = _('Modify Shared Folder');
- $content = $form->outputForm();
- } else {
- array_push($errors, _("Error: Multiple results returned for DN $dn"));
- }
+ $ldap_object = $ldap->read( $dn );
+ if( $ldap_object ) {
+ fill_form_for_modify( $form, $ldap_object );
+ $form->entries['action']['value'] = 'save';
+ $form->entries['dn'] = array( 'type' => 'hidden', 'value' => $dn );
+ $form->entries['cn']['attrs'] = 'readonly';
+ $form->entries['kolabhomeserver']['attrs'] = 'readonly';
+ $heading = _('Modify Shared Folder');
+ $content = $form->outputForm();
+ } else {
+ array_push($errors, _("Error: No results returned for DN $dn"));
}
break;
case 'delete':
- $result = $ldap->search( $dn, '(objectClass=sharedfolder)' );
- if( $result ) {
- $ldap_object = ldap_get_entries( $ldap->connection, $result );
- if( $ldap_object['count'] == 1 ) {
- fill_form_for_modify( $form, $ldap_object[0] );
- $form->entries['action']['value'] = 'kill';
- foreach( $form->entries as $key => $val ) {
- $form->entries[$key]['attrs'] = 'readonly';
- }
- $form->submittext = _('Delete');
- $heading = _('Delete Shared Folder');
- $content = $form->outputForm();
- } else {
- array_push($errors, _("Error: Multiple results returned for DN $dn"));
+ $ldap_object = $ldap->read( $dn );
+ if( $ldap_object ) {
+ fill_form_for_modify( $form, $ldap_object );
+ $form->entries['action']['value'] = 'kill';
+ foreach( $form->entries as $key => $val ) {
+ $form->entries[$key]['attrs'] = 'readonly';
}
+ $form->submittext = _('Delete');
+ $heading = _('Delete Shared Folder');
+ $content = $form->outputForm();
+ } else {
+ array_push($errors, _("Error: No results returned for DN $dn"));
}
break;
case 'kill':
@@ -284,7 +275,7 @@ if( !$errors ) {
$heading = _('Entry Deleted');
$contenttemplate = 'sfdeleted.tpl';
} else {
- array_push($errors, _("LDAP Error: could mark $dn for deletion: ").ldap_error($link));
+ array_push($errors, _("LDAP Error: Could not mark $dn for deletion: ").ldap_error($link));
}
}
break;
diff --git a/www/admin/style.css b/www/admin/style.css
index 97d2d31..415753c 100644
--- a/www/admin/style.css
+++ b/www/admin/style.css
@@ -33,8 +33,8 @@ a:hover { color: #113399; }
display:block;
background-image: url(pics/kolab_logo.png);
background-color: #B0BCD0;
- width: 236px;
- height: 68px;
+ width: 245px;
+ height: 70px;
margin-left: 1em;
margin-top: 0.4em;
float: left;
@@ -87,6 +87,9 @@ a:hover { color: #113399; }
#logout {
color: red;
}
+#maintitle {
+ font-size: 200%;
+}
#maincontent {
display:block;
padding: 1em;
diff --git a/www/admin/user/forward.php b/www/admin/user/forward.php
index bc1dc0b..1b316ab 100644
--- a/www/admin/user/forward.php
+++ b/www/admin/user/forward.php
@@ -1,10 +1,22 @@
<?php
/*
- (c) 2004 Klarälvdalens Datakonsult AB
-
- This program is Free Software under the GNU General Public License (>=v2).
- Read the file COPYING that comes with this packages for details.
-*/
+ * Copyright (c) 2004 Klarälvdalens Datakonsult AB
+ *
+ * Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2, 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
+ * General Public License for more details.
+ *
+ * You can view the GNU General Public License, online, at the GNU
+ * Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
+ */
require_once 'admin/include/mysmarty.php';
require_once 'admin/include/headers.php';
diff --git a/www/admin/user/index.php b/www/admin/user/index.php
index 0a81d9c..87b2fb4 100644
--- a/www/admin/user/index.php
+++ b/www/admin/user/index.php
@@ -40,8 +40,29 @@ if( !$errors ) {
$privmembers = array_merge( $ldap->groupMembers( $base_dn, 'admin' ),
$ldap->groupMembers( $base_dn, 'maintainer' ) );
- $filter = "(&(cn=*)(objectclass=inetOrgPerson)(uid=*)(mail=*)(sn=*))";
- $result = ldap_search($ldap->connection, $base_dn, $filter, array( 'uid', 'mail', 'sn', 'cn', 'deleteflag' ));
+ $userfilter = "cn=*";
+ $filterattr = $_REQUEST['filterattr'];
+ $filtertype = $_REQUEST['filtertype'];
+ $filtervalue = $_REQUEST['filtervalue'];
+ if( !in_array( $filterattr, array( 'cn', 'uid', 'mail' ) ) ) $filterattr = 'cn';
+ if( isset( $filtervalue ) && !empty( $filtervalue ) ) {
+ switch( $filtertype ) {
+ case 'contains': // contains
+ $userfilter = "$filterattr=*".$ldap->escape($filtervalue).'*';
+ break;
+ case 'is': // is
+ $userfilter = "$filterattr=".$ldap->escape($filtervalue);
+ break;
+ case 'begins': // begins with
+ $userfilter = "$filterattr=".$ldap->escape($filtervalue).'*';
+ break;
+ case 'ends': // ends with
+ $userfilter = "$filterattr=*".$ldap->escape($filtervalue);
+ break;
+ }
+ }
+ $filter = "(&($userfilter)(objectclass=inetOrgPerson)(uid=*)(mail=*)(sn=*))";
+ $result = ldap_search($ldap->connection, $base_dn, $filter, array( 'uid', 'mail', 'sn', 'cn', 'kolabDeleteflag' ));
if( $result ) {
$count = ldap_count_entries($ldap->connection, $result);
@@ -64,8 +85,8 @@ if( !$errors ) {
while( $entry ) {
$attrs = ldap_get_attributes($ldap->connection, $entry);
$dn = ldap_get_dn($ldap->connection,$entry);
- $deleted = array_key_exists('deleteflag',$attrs)?$attrs['deleteflag'][0]:"FALSE";
- $userid = $attrs['uid'][0];
+ $deleted = array_key_exists('kolabDeleteflag',$attrs)?$attrs['kolabDeleteflag'][0]:"FALSE";
+ $uid = $attrs['uid'][0];
$mail = $attrs['mail'][0];
$sn = $attrs['sn'][0];
$cn = $attrs['cn'][0];
@@ -78,6 +99,7 @@ if( !$errors ) {
'sn' => $sn,
'fn' => $fn,
'mail' => $mail,
+ 'uid' => $uid,
'deleted' => $deleted );
}
$entry = ldap_next_entry( $ldap->connection,$entry );
@@ -92,6 +114,18 @@ $smarty->assign( 'errors', $errors );
$smarty->assign( 'uid', $auth->uid() );
$smarty->assign( 'group', $auth->group() );
$smarty->assign( 'page_title', $menuitems[$sidx]['title'] );
+
+$smarty->assign( 'filterattrs', array( 'cn' => _('Name'),
+ 'mail' => _('Email'),
+ 'uid' => _('UID') ) );
+$smarty->assign( 'filtertypes', array( 'contains' => _('contains'),
+ 'is' => _('is'),
+ 'begins' => _('begins with'),
+ 'ends' => _('ends with') ) );
+$smarty->assign( 'filterattr', $filterattr );
+$smarty->assign( 'filtertype', $filtertype );
+$smarty->assign( 'filtervalue', $filtervalue );
+
$smarty->assign( 'entries', $entries );
$smarty->assign( 'menuitems', $menuitems );
$smarty->assign( 'submenuitems',
diff --git a/www/admin/user/user.php b/www/admin/user/user.php
index 3c1461f..9edb78c 100644
--- a/www/admin/user/user.php
+++ b/www/admin/user/user.php
@@ -1,7 +1,7 @@
<?php
/*
(c) 2004 Klarlvdalens Datakonsult AB
-
+ (c) 2004 Martin Konold erfrakon <martin.konold@erfrakon.de>
This program is Free Software under the GNU General Public License (>=v2).
Read the file COPYING that comes with this packages for details.
*/
@@ -66,12 +66,28 @@ function checkuniquealias( $form, $key, $value ) {
foreach( $lst as $alias ) {
debug( "looking at $alias, exluding $dn" );
if( $ldap->countMail( $_SESSION['base_dn'], $alias, $excludedn ) > 0 ) {
- $str .= _('Mail address ').htmlentities($alias)._(' already exists<br />');
+ $str .= _('Email address ').htmlentities($alias)._(' collision <br />');
}
}
return $str;
}
+function checkuid( $form, $key, $value ) {
+ global $ldap;
+ global $action;
+ global $dn;
+ $excludedn = false;
+ if( $action == 'save' ) $excludedn = trim($dn);
+ $lst = array_unique( array_filter( array_map( 'trim', preg_split( '/\n/', $value ) ), 'strlen') );
+ $str = '';
+ foreach( $lst as $uid ) {
+ if( $ldap->countMail( $_SESSION['base_dn'], $uid, $excludedn ) > 0 ) {
+ $str .= _('UID ').htmlentities($uid)._(' collision <br />');
+ }
+ }
+ return $str;
+}
+
function checkdelegate( $form, $key, $value ) {
global $ldap;
global $action;
@@ -80,7 +96,7 @@ function checkdelegate( $form, $key, $value ) {
$lst = array_unique( array_filter( array_map( 'trim', preg_split( '/\n/', $value ) ), 'strlen') );
$str = '';
foreach( $lst as $delegate ) {
- if( $ldap->count( $ldap->search( $_SESSION['base_dn'], '(uid='.$ldap->escape($delegate).')' ) ) == 0 ) {
+ if( $ldap->count( $ldap->search( $_SESSION['base_dn'], '(mail='.$ldap->escape($delegate).')' ) ) == 0 ) {
return _("Delegate $delegate does not exist");
}
}
@@ -138,6 +154,7 @@ function fill_form_for_modify( &$form, $dn, &$ldap_object ) {
} else {
$form->entries['accttype']['value'] = 0;
}
+ $form->entries['accttype']['attrs'] = 'readonly';
// visible
$internaldn = 'cn=internal,'.domain_dn();
@@ -164,34 +181,34 @@ function fill_form_for_modify( &$form, $dn, &$ldap_object ) {
unset( $arr['count'] );
$v = join("\n", $arr );
}
- else $v = $ldap_object[$attr];
+ else $v = "";
$form->entries['alias']['value'] = $v;
- // delegate
- if (is_array($ldap_object['delegate'])) {
- $arr = $ldap_object['delegate'];
+ // kolabdelegate
+ if (is_array($ldap_object['kolabDelegate'])) {
+ $arr = $ldap_object['kolabDelegate'];
unset( $arr['count'] );
$v = join("\n", $arr );
}
- else $v = $ldap_object[$attr];
- $form->entries['delegate']['value'] = $v;
+ else $v = "";
+ $form->entries['kolabdelegate']['value'] = $v;
- // homeServer
- if( is_array($ldap_object['homeServer']) ) {
- $form->entries['homeserver']['value'] = $ldap_object['homeServer'][0];
+ // kolabhomeserver
+ if( is_array($ldap_object['kolabHomeServer']) ) {
+ $form->entries['kolabhomeserver']['value'] = $ldap_object['kolabHomeServer'][0];
}
- $form->entries['homeserver']['attrs'] = 'readonly';
+ $form->entries['kolabhomeserver']['attrs'] = 'readonly';
$form->entries['action']['value'] = 'save';
// userquota
- if( isset( $form->entries['userquota'] ) ) {
- if (is_array($ldap_object['userquota'])) $userquota = $ldap_object['userquota'][0];
- else $userquota = $ldap_object['userquota'];
+ if( isset( $form->entries['cyrus-userquota'] ) ) {
+ if (is_array($ldap_object['cyrus-userquota'])) $userquota = $ldap_object['cyrus-userquota'][0];
+ else $userquota = $ldap_object['cyrus-userquota'];
if( $userquota > 0 ) {
- $form->entries['userquota']['value'] = $userquota;
+ $form->entries['cyrus-userquota']['value'] = $userquota;
} else {
- $form->entries['userquota']['value'] = '';
+ $form->entries['cyrus-userquota']['value'] = '';
}
}
}
@@ -233,11 +250,11 @@ if( !$errors && $auth->group() == 'user' && ($action == 'firstsave' || $action =
if ($action == "create") {
$comment_mail_0 = _('Required, non volatile');
$comment_password = _('Required');
- $comment_homeserver = _('Required, non volatile');
+ $comment_kolabhomeserver = _('Required, non volatile');
} else {
$comment_mail_0 = _('Non volatile');
$comment_password = _('Leave blank to keep password unchanged');
- $comment_homeserver = _('Non volatile');
+ $comment_kolabhomeserver = _('Non volatile');
}
$entries = array( 'firstname' => array( 'name' => _('First Name'),
@@ -258,12 +275,12 @@ $entries = array( 'firstname' => array( 'name' => _('First Name'),
'validation' => 'notempty',
'comment' => $comment_mail_0 ),
'uid' => array( 'name' => _('Unique Identity (UID)'),
- #'validation' => '',
+ 'validation' => 'checkuid',
'comment' => _('Optional - Defaults to Primary Email Address') ),
- 'homeserver' => array( 'name' => _('Mailbox Home Server'),
+ 'kolabhomeserver' => array( 'name' => _('Mailbox Home Server'),
'validation' => 'notempty',
- 'comment' => $comment_homeserver,
- 'value' => $_SESSION['fqhostname'] ),
+ 'comment' => $comment_kolabhomeserver,
+ 'value' => $_SESSION['fqdnhostname'] ),
'accttype' => array( 'name' => _('Account Type'),
'type' => 'select',
'options' => array( _('User Account'), _('Group Account'), _('Resource Account') ),
@@ -273,10 +290,10 @@ $entries['alias'] = array( 'name' => _('Email Aliases'),
'type' => 'textarea',
'validation' => 'checkuniquealias',
'comment' => _('One address per line') );
-$entries['delegate'] =array( 'name' => _('Delegates'),
+$entries['kolabdelegate'] =array( 'name' => _('Delegates'),
'type' => 'textarea',
'validation' => 'checkdelegate',
- 'comment' => _('One UID per line') );
+ 'comment' => _('One Email address per line') );
$entries['o_0'] = array( 'name' => _('Organisation') );
$entries['ou_0'] = array( 'name' => _('Organisational Unit') );
$entries['roomNumber_0'] = array( 'name' => _('Room Number') );
@@ -292,12 +309,13 @@ $entries['visible'] = array( 'name' => _('Addressbook'),
'value' => true,
'comment' => _('Check here to make this users address <br> visible in the address book'));
if( $auth->group() == "admin" || $auth->group() == "maintainer" ) {
- $entries['userquota'] = array( 'name' => _('User Quota in KB'),
+ $entries['cyrus-userquota'] = array( 'name' => _('User Quota in MBytes'),
'comment' => _('Leave blank for unlimited') );
} else {
$entries['alias']['attrs'] = 'readonly';
- $entries['homeserver']['attrs'] = 'readonly';
+ $entries['kolabhomeserver']['attrs'] = 'readonly';
$entries['accttype']['attrs'] = 'readonly';
+ $entries['uid']['attrs'] = 'readonly';
}
$entries['action'] = array( 'name' => 'action',
'type' => 'hidden' );
@@ -322,7 +340,7 @@ switch( $action ) {
$content = $form->outputForm();
} else {
$ldap_object = array();
- $ldap_object['objectClass'] = 'kInetOrgPerson';
+ $ldap_object['objectClass'] = array('top', 'inetOrgPerson','kolabInetOrgPerson');
$ldap_object['sn'] = trim($_POST['lastname']);
$ldap_object['cn'] = trim($_POST['firstname']).' '.$ldap_object['sn'];
$ldap_object['givenName'] = trim($_POST['firstname']);
@@ -345,7 +363,7 @@ switch( $action ) {
$sslerr .= $msg.' ';
$errors[] = $sslerr;
} else {
- $ldap_object['encryptedPassword'] = base64_encode( $encpw );
+ $ldap_object['kolabEncryptedPassword'] = base64_encode( $encpw );
}
openssl_free_key( $pkey );
}
@@ -354,9 +372,8 @@ switch( $action ) {
$ldap_object['mail'] = trim( strtolower( $_POST['mail_0'] ) );
$ldap_object['uid'] = trim( strtolower( $_POST['uid'] ) );
if( $action == 'firstsave' ) {
- $ldap_object['uid'] = $ldap_object['mail'];
if ($ldap_object['uid'] == "") $ldap_object['uid'] = $ldap_object['mail'];
- $ldap_object['homeServer'] = trim($_POST['homeserver']);
+ $ldap_object['kolabHomeServer'] = trim($_POST['kolabhomeserver']);
}
foreach( array( 'title', 'o', 'ou', 'roomNumber', 'street', 'postOfficeBox',
'postalCode', 'l', 'c', 'telephoneNumber',
@@ -371,14 +388,15 @@ switch( $action ) {
}
if ($count > 0) $ldap_object[$attr] = $args;
elseif (!empty($_POST[$key])) $ldap_object[$attr] = $_POST[$key];
+ else $ldap_object[$attr] = array();
}
$dn_add = "";
- // delegate
- $ldap_object['delegate'] = array_unique( array_filter( array_map( 'trim',
- preg_split( '/\n/', $_POST['delegate'] ) ), 'strlen') );
- if( !$ldap_object['delegate'] && $action == 'firstsave' ) unset($ldap_object['delegate']);
+ // kolabdelegate
+ $ldap_object['kolabDelegate'] = array_unique( array_filter( array_map( 'trim',
+ preg_split( '/\n/', $_POST['kolabdelegate'] ) ), 'strlen') );
+ if( !$ldap_object['kolabDelegate'] && $action == 'firstsave' ) unset($ldap_object['kolabDelegate']);
if ($auth->group() == "maintainer" || $auth->group() == "admin") {
@@ -392,10 +410,10 @@ switch( $action ) {
else $visible = false;
// userquota
- if( isset( $_POST['userquota'] ) ) {
- $ldap_object['userquota'] = $_POST['userquota'];
- if( empty( $ldap_object['userquota'] ) ) {
- $ldap_object['userquota'] = array();
+ if( isset( $_POST['cyrus-userquota'] ) ) {
+ $ldap_object['cyrus-userquota'] = trim($_POST['cyrus-userquota']);
+ if( empty( $ldap_object['cyrus-userquota'] ) ) {
+ $ldap_object['cyrus-userquota'] = array();
}
}
if (!$visible) $dn_add = ",cn=internal";
@@ -420,9 +438,9 @@ switch( $action ) {
$ldap_object['uid'] = $oldattrs['uid'][0];
$ldap_object['mail'] = $oldattrs['mail'][0];
if( !$ldap_object['userPassword'] ) $ldap_object['userPassword'] = $oldattrs['userPassword'][0];
- if( $ldap_object['userquota'] == array() ) unset( $ldap_object['userquota'] );
- if( $ldap_object['delegate'] == array() ) unset( $ldap_object['delegate'] );
- if( $ldap_object['alias'] == array() ) unset( $ldap_object['alias'] );
+ foreach( $ldap_object as $k => $v ) {
+ if( $v == array() ) unset($ldap_object[$k]);
+ }
if ( !$errors && !ldap_add($ldap->connection,$newdn, $ldap_object) ) {
array_push($errors, _("LDAP Error: Could not rename $dn to $newdn: ")
.ldap_error($ldap->connection));
@@ -442,6 +460,7 @@ switch( $action ) {
unset($ldap_object['sn']);
unset($ldap_object['cn']);
unset($ldap_object['mail']);
+ unset($ldap_object['uid']);
}
if (!ldap_modify($ldap->connection, $dn, $ldap_object)) {
array_push($errors, _("LDAP Error: Could not modify object $dn: ")
@@ -466,7 +485,7 @@ switch( $action ) {
if( !$errors ) $messages[] = _("User '$dn' successfully modified");
$form->setValues();
$form->entries['mail_0']['attrs'] = 'readonly';
- $form->entries['homeserver']['attrs'] = 'readonly';
+ $form->entries['kolabhomeserver']['attrs'] = 'readonly';
$form->entries['action']['value'] = 'save';
$form->entries['dn'] = array( 'name' => 'dn',
'type' => 'hidden',
@@ -476,7 +495,9 @@ switch( $action ) {
// firstsave
if (!$errors) {
$dn = "cn=".$ldap_object['cn'].$dn_add.",".$domain_dn;
- if( $ldap_object['userquota'] == array() ) unset( $ldap_object['userquota'] );
+ foreach( $ldap_object as $k => $v ) {
+ if( $v == array() ) unset($ldap_object[$k]);
+ }
debug("Calling ldap_add with dn=$dn");
if ($dn && !ldap_add($ldap->connection, $dn, $ldap_object))
array_push($errors, _("LDAP Error: could not add object $dn: ").ldap_error($ldap->connection));
diff --git a/www/admin/user/vacation.php b/www/admin/user/vacation.php
index 0b17081..7e0f408 100644
--- a/www/admin/user/vacation.php
+++ b/www/admin/user/vacation.php
@@ -1,6 +1,6 @@
<?php
/*
- (c) 2004 Klarälvdalens Datakonsult AB
+ (c) 2004 Klarälvdalens Datakonsult AB
This program is Free Software under the GNU General Public License (>=v2).
Read the file COPYING that comes with this packages for details.
@@ -86,7 +86,10 @@ if( !$errors ) {
$text = undotstuff($text);
}
}
- if( !$addresses ) $addresses = array( $auth->uid() );
+ if( !$addresses ) {
+ $object = $ldap->read( $auth->dn() );
+ $addresses = array_merge( $object['mail'], $object['alias'] );
+ }
if( !$days ) $days = 7;
if( !$text ) {
$date = strftime(_('%x'));