summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 998ba42)
raw | patch | inline | side by side (parent: 998ba42)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 26 Feb 2007 09:12:40 +0000 (09:12 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 26 Feb 2007 09:12:40 +0000 (09:12 +0000) |
* Fixed mac address saving
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5733 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5733 594d385d-05f5-0310-b6e9-bd551577e9d8
Changelog | patch | blob | history | |
include/class_mail-methods-golab.inc | [new file with mode: 0644] | patch | blob |
plugins/admin/groups/class_groupMail.inc | patch | blob | history | |
plugins/admin/systems/class_printGeneric.inc | patch | blob | history | |
plugins/personal/mail/class_mailAccount.inc | patch | blob | history |
diff --git a/Changelog b/Changelog
index 21890a61da56770b7d75d795237902caa78395c2..8cc2d4b724b7060d11bf08a0f517838287e55460 100644 (file)
--- a/Changelog
+++ b/Changelog
- Added the possiblility to choose a RDN style for DN's when
a CN is already in use
- Fixed a problem with cut'n paste for groups and ogroups
+ - Added new mail method "golab" which has some tweaks against
+ the standard kolab mode
+ - Fixed object tagging for workstation/printer assignement
+ - Fixed undefined index in FAI package lists
+ - Fixed copy'n paste for groups and object groups
+ - Enabled non ASCII characters in vacation messages
* gosa 2.5.8
- Fixed problem with winstations shown in user list.
diff --git a/include/class_mail-methods-golab.inc b/include/class_mail-methods-golab.inc
--- /dev/null
@@ -0,0 +1,262 @@
+<?php
+/*
+ This code is part of GOsa (https://gosa.gonicus.de)
+ Copyright (C) 2004 Cajus Pollmeier
+
+ 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 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+require_once("class_mail-methods-cyrus.inc");
+
+class mailMethodGolab extends mailMethodCyrus
+{
+ var $mbox= "-";
+ var $config;
+ var $gosaMailServer= "";
+ var $uattrib= "mail";
+
+ var $attribute_map= array("gosaMailAlternateAddress" => "alias",
+ "gosaMailQuota" => "cyrus-userquota",
+ "gosaMailServer" => "kolabHomeServer");
+
+ function mailMethodGolab($config)
+ {
+ $this->config= $config->data['SERVERS']['IMAP'];
+ }
+
+ function updateMailbox($folder)
+ {
+ }
+
+ function setQuota($folder, $gosaMailQuota)
+ {
+ return (TRUE);
+ }
+
+ /* Get quota and divide it by 1024, because in gosa we display in MB
+ but we get Kb */
+ function getQuota($folder)
+ {
+ $result= array('quotaUsage' => '', 'gosaMailQuota' => '');
+
+ /* Only use lower case folder names, if folder name is like "@domain.com" */
+ if(preg_match("/@/",$folder)){
+ $folder = strtolower($folder);
+ }
+
+ error_reporting(0);
+
+ /* Load quota settings */
+ $quota_value = @imap_get_quota($this->mbox, $folder);
+ if(is_array($quota_value)) {
+ if (isset($quota_value["STORAGE"]) && is_array($quota_value["STORAGE"])){
+ /* use for PHP >= 4.3 */
+ $result['quotaUsage']= (int) ($quota_value["STORAGE"]['usage'] / 1024);
+ $result['gosaMailQuota']= (int) ($quota_value["STORAGE"]['limit'] / 1024);
+ } else {
+ /* backward icompatible */
+ $result['quotaUsage']= (int) ($quota_value['usage'] / 1024);
+ $result['gosaMailQuota']= (int) ($quota_value['limit'] / 1024);
+ }
+ }elseif(!$quota_value){
+ return(false);
+ }
+
+ error_reporting(E_ALL);
+
+ return ($result);
+ }
+
+
+ function fixAttributesOnLoad(&$mailObject)
+ {
+ /* Kolab shared folder names are like ' shared.uid@server.de '
+ So overwrite uid to match these folder names. Else we can't read quota settings etc.
+ #FIXME is there a better way to detect if it is 'shared.' or 'shared+' or 'kolab+shared.' or what ever ?*/
+ if(get_class($mailObject) == "mailgroup"){
+ $mailObject->uid = $mailObject->uid."@".preg_replace("/^.*@/","",$mailObject->mail);
+ }
+
+ /* Convert attributes and objectClasses */
+ foreach ($this->attribute_map as $dest => $source){
+ /* Hickert 11.11.05 : Alternate email addresses were saved, but not displayed again.
+ if (isset($mailObject->attrs[$source])){
+ $mailObject->attrs[$dest]= $mailObject->attrs[$source];
+ unset ($mailObject->attrs[$source]);
+ */
+
+ if (isset($mailObject->attrs[$source])){
+ unset($mailObject->attrs[$source]['count']);
+ $mailObject->attrs[$dest]= $mailObject->attrs[$source];
+ $mailObject->$dest= $mailObject->attrs[$source];
+
+ unset ($mailObject->$dest['count']);
+ unset ($mailObject->attrs[$source]);
+ }
+ }
+
+ /* Adjust server name if needed */
+ foreach ($mailObject->config->data['SERVERS']['IMAP'] as $srv => $dummy){
+ if (preg_match("%".$mailObject->attrs['gosaMailServer'][0]."$%", $srv)){
+ $mailObject->attrs['gosaMailServer']= array(0 => $srv, "count" => 1);
+ break;
+ }
+ }
+ }
+
+
+ function fixAttributesOnStore(&$mailObject)
+ {
+ global $config;
+
+ /* If quota is empty, remove quota restrictions by setting quota to 0 */
+ if(isset($mailObject->gosaMailQuota) && (empty($mailObject->gosaMailQuota))){
+ $mailObject->attrs['gosaMailQuota'] = 0;
+ }
+
+ /* Convert attributes and objectClasses */
+ foreach ($this->attribute_map as $source => $dest){
+ if (isset($mailObject->attrs[$source])){
+ $mailObject->attrs[$dest]= $mailObject->attrs[$source];
+ unset ($mailObject->attrs[$source]);
+ }
+ }
+ $objectclasses= array();
+ foreach ($mailObject->attrs['objectClass'] as $oc){
+ if ($oc != 'kolabInetOrgPerson' && $oc != 'kolabSharedFolder'){
+ $objectclasses[]= $oc;
+ }
+ }
+ $mailObject->attrs['objectClass']= $objectclasses;
+ if (in_array("posixGroup", $mailObject->attrs['objectClass'])){
+
+ /* Add kolabSharedFoleder Class */
+ $mailObject->attrs['objectClass'][]= 'kolabSharedFolder';
+
+ /* Work on acl attribute */
+ $new_acl= array();
+ foreach ($mailObject->attrs['acl'] as $uacl){
+
+ /* Get user=(mail) & acls */
+ list($user, $acl) = split(" ", $uacl);
+
+ /* Add al users which have seperated acls
+ %members% are all users in this group,
+ which have the standard group acl
+ */
+ if ($user != "%members%"){
+ $new_acl[$user]= $uacl;
+ } else {
+
+ /* All groupmembers will be added */
+ $ldap = $config->get_ldap_link();
+ $ldap->cd($config->current['BASE']);
+ foreach ($mailObject->members as $member){
+
+ /* Get user mail address .... */
+ $ldap->search("(&(objectClass=person)(|(uid=".$member.")(mail=".$member.")))",array("mail"));
+ $res = $ldap->fetch();
+
+ /* Default mail address is set to uid -
+ So if there is no mail address defined the uid is added
+ */
+ $mail = $member;
+
+ /* Use mail address if it is available */
+ if(isset($res['mail'][0])){
+ $mail = $res['mail'][0];
+ }
+
+ /* only append this mail/permission string to acl,
+ if there arn't already some (special) configs for this user */
+ $found =false;
+ foreach($mailObject->imapacl as $mailA => $acl){
+ if(strtolower(trim($mailA))==strtolower(trim($mail))){
+ $found = true;
+ }
+ }
+
+ /* Skipp user, with no email adress too */
+ if($member == $mail){
+ $found = true;
+ }
+
+ /* Append new user acl */
+ if(!$found){
+ $new_acl[$member]= "$mail $acl";
+ }
+
+ /* Old line */
+ // $new_acl[$member]= "$member $acl";
+ }
+ }
+ }
+
+ /* Save shared folder target */
+ $mailObject->attrs['gosaSharedFolderTarget']= "kolab+".$mailObject->mail;
+
+ /* Kolab shared folder names are like ' shared.uid@server.de '
+ So overwrite uid to match these folder names. Else we can't read quota settings etc.
+ #FIXME is there a better way to detect if it is 'shared.' or 'shared+' or 'kolab+shared.' or what ever ?*/
+ $mailObject->uid = $mailObject->uid."@".preg_replace("/^.*@/","",$mailObject->mail);
+
+ /* Assign new acls */
+ $mailObject->attrs['acl']= array();
+ foreach ($new_acl as $key => $value){
+ $mailObject->attrs['acl'][]= $value;
+ }
+ } else {
+ $mailObject->attrs['objectClass'][]= 'kolabInetOrgPerson';
+ }
+
+ /* Remove imap:// tagging */
+ $mailObject->attrs['kolabHomeServer']= preg_replace('%imap://%', '', $mailObject->attrs['kolabHomeServer']);
+ $mailObject->attrs['gosaMailServer']= $mailObject->attrs['kolabHomeServer'];
+ $mailObject->attrs['kolabDeleteFlag']= array();
+ }
+
+ function fixAttributesOnRemove(&$mailObject)
+ {
+ /* Add attribute for object deletion and remove GOsa specific
+ values from entry. */
+ foreach($this->attribute_map as $kolabAttr){
+ $mailObject->attrs[$kolabAttr] = array();
+ }
+
+ /* Only add kolab delete Flag in case of an user.mailAccount */
+ if(!in_array("posixGroup", $mailObject->attrs['objectClass'])){
+ $mailObject->attrs['kolabDeleteFlag']= preg_replace('%imap://%', '', $mailObject->gosaMailServer);
+ }else{
+ /* Kolab shared folder names are like ' shared.uid@server.de '
+ So overwrite uid to match these folder names. Else we can't read quota settings etc.
+ #FIXME is there a better way to detect if it is 'shared.' or 'shared+' or 'kolab+shared.' or what ever ?*/
+ $mailObject->uid = $mailObject->uid."@".preg_replace("/^.*@/","",$mailObject->mail);
+
+ }
+ }
+
+
+ function deleteMailbox($folder)
+ {
+ /* Remove shared folders and skip removing users.
+ KolabD is not able to remove shared folders yet, so we do it instead */
+ if(!(preg_match("/^user\//",$folder))){
+ return mailMethodCyrus::deleteMailbox($folder);
+ }
+ return (TRUE);
+ }
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
index 48e4388b4e33b6514a7b97d4a0103d839d568aa2..f75985244787a789d0f53c0b8673a80a3e68ab81 100644 (file)
/* Load permissions */
$tmp = array();
- if(preg_match("/kolab/i",$this->mmethod)){
+ if(preg_match("/olab/i",$this->mmethod)){
$ldap = $this->config->get_ldap_link();
if (isset($this->attrs['acl'])){
/* Added these ObjectClass and Attributes, because they were not
removed correctly, only in case of kolab ...
*/
- if(isset($this->config->current['MAILMETHOD'])&&preg_match("/kolab/i",$this->config->current['MAILMETHOD'])){
+ if(isset($this->config->current['MAILMETHOD'])&&preg_match("/olab/i",$this->config->current['MAILMETHOD'])){
$this->attributes[]="acl";
$this->objectclasses[] = "kolabSharedFolder";
}
$this->attrs['gosaMailForwardingAddress'] = $this->gosaMailForwardingAddress;
$this->attrs['gosaSharedFolderTarget'] = "share+".$this->uid;
- if(preg_match("/kolab/i",$this->mmethod)){
+ if(preg_match("/olab/i",$this->mmethod)){
/* Save acl's */
$this->attrs['acl']= array();
foreach ($this->imapacl as $user => $acl){
}
/* Only do IMAP actions if we are not a template */
- if(preg_match("/kolab/i",$this->mmethod)){
+ if(preg_match("/olab/i",$this->mmethod)){
if (empty($this->gosaMailServer)||is_array($this->gosaMailServer)){
if(isset($this->attrs['gosaMailServer'][0])){
$this->gosaMailServer = $this->attrs['gosaMailServer'][0];
$memberacl= $this->imapacl['%members%'];
foreach ($this->members as $user){
- if(preg_match("/kolab/i",$this->mmethod)){
+ if(preg_match("/olab/i",$this->mmethod)){
$ldap->cd($this->config->current['BASE']);
$ldap->search("(&(objectClass=person)(|(mail=".$user.")(uid=".$user.")))",array("mail"));
$at = $ldap->fetch();
diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index 483ca2262a83be5515b11916248510a4aad088aa..84c07304eb887215d401f9cab49693c2b40af885 100644 (file)
if($this->BelongsTo == "Workstation"){
$this->dn= preg_replace("/ou=workstations,/","ou=printers,",$this->dn);
+ $this->macAddress = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
}
if(!$this->is_account) return;
diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc
index 93662308dd0c3ae65a175ad428ef9706c9c0012a..d4d239903055d3bf4e85a3b3e2b3b5a38516c5c7 100644 (file)
{
if (isset($this->config->current['MAILMETHOD'])){
$method= $this->config->current['MAILMETHOD'];
- if(preg_match("/kolab/i",$method)){
+ if(preg_match("/olab/i",$method)){
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
$ldap->cat($this->dn);