~ubuntu-branches/ubuntu/vivid/gosa/vivid

« back to all changes in this revision

Viewing changes to kolab/personal/mail/kolab/class_mail-methods-kolab22.inc

Tags: 2.7.1-1
* New upstream release
* Updated packaging to not include smarty (Closes: #620489)
* Fixed case of POSIX (Closes: #620486)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
 
 
4
class mailMethodKolab22 extends mailMethodKolab
 
5
{
 
6
 
 
7
  /* Allow modification of account_ids for existing mail accounts */
 
8
  protected $modifyableMail = FALSE;
 
9
 
 
10
  /* Enforces same value for 'mail' as used for 'cn' */
 
11
  protected $mailEqualsCN   = TRUE; 
 
12
 
 
13
  /* Enabled mail domain selection. If enabled getMailDomains must the domain parts */ 
 
14
  protected $enableDomainSelection= TRUE;
 
15
  protected $enableQuota          = TRUE;
 
16
  protected $enableSieveManager   = TRUE;
 
17
  protected $enableVacationRange  = TRUE;
 
18
  protected $enableFolderTypes    = TRUE;
 
19
 
 
20
  protected $userObjectClasses = array("kolabInetOrgPerson");
 
21
  protected $shareObjectClasses = array("kolabSharedFolder");
 
22
 
 
23
  protected $acl_map = array(
 
24
//     "lrs"           => "read",
 
25
//     "lrsp"          => "post",
 
26
//     "lrsip"         => "append",
 
27
//     "lrswipkxte"    => "write",
 
28
//     "lrxte"         => "delete",
 
29
//     "lrswipkxtecda" => "admin",
 
30
//     " "             => "none");
 
31
"none"             => "none",
 
32
"post"             => "post",             
 
33
"read"             => "read",
 
34
"read/post"        => "read/post",
 
35
"append"           => "append",
 
36
"write"            => "write",
 
37
"read anon"        => "read anon",
 
38
"read anon/post"   => "read anon/post",
 
39
"read hidden"      => "read hidden",
 
40
"read hidden/post" => "read hidden/post",
 
41
"all"              => "all");
 
42
 
 
43
  protected $default_acls = array("__anyone__" => "none", "__member__" => "write");
 
44
 
 
45
 
 
46
  /*! \brief  Returns configured acls
 
47
   */
 
48
  public function  getFolderACLs($ldap_acls)
 
49
  {
 
50
    $this->reset_error();
 
51
    $imap_acls = mailMethodKolab::getFolderACLs(array());
 
52
 
 
53
    foreach($imap_acls as $user => $acl){
 
54
      if(!isset($ldap_acls[$user])){
 
55
        $ldap_acls[$user] = $acl;
 
56
      }else{
 
57
        // Ldap attributes come first in kolab22.
 
58
      }
 
59
    }
 
60
 
 
61
    /* Merge given ACL with acl mapping
 
62
       This ensures that no ACL will accidentally overwritten by gosa.
 
63
     */
 
64
    foreach($ldap_acls as $user => $acl){
 
65
      if(!isset($this->acl_mapping[$acl])){
 
66
        $this->acl_mapping[$acl] = $acl;
 
67
      }
 
68
    }
 
69
 
 
70
    return($ldap_acls);
 
71
  }
 
72
 
 
73
 
 
74
  /*! \brief Returns a list of configured mail domains 
 
75
      @return Array A list of mail domains
 
76
   */
 
77
  public function getMailDomains()
 
78
  {
 
79
    $domains = array();
 
80
    $ldap = $this->config->get_ldap_link();
 
81
    $ldap->cd($this->config->current['BASE']);
 
82
    $ldap->search("(&(objectClass=kolab)(k=kolab)(postfix-mydestination=*))",array("postfix-mydestination"));
 
83
 
 
84
    if($ldap->count() == 1){
 
85
      $attrs = $ldap->fetch();
 
86
      for($i=0; $i <$attrs['postfix-mydestination']['count']; $i ++ ){
 
87
        $domains[] = $attrs['postfix-mydestination'][$i];
 
88
      }
 
89
      @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "<b>Found: ".trim(implode($domains,", "),", ")."</b>",
 
90
          "Revceiving 'Mail domains for kolab22'.");
 
91
    }elseif($ldap->count() == 0){
 
92
      @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "<b>No domains found. Check k=kolab and postfix-mydestination</b>",
 
93
          "Revceiving 'Mail domains for kolab22'.");
 
94
    }else{
 
95
      @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "<b>Found more than one kolab configuration object. Giving up.</b>",
 
96
          "Revceiving 'Mail domains for kolab22'.");
 
97
    }
 
98
 
 
99
    return($domains);
 
100
  } 
 
101
}
 
102
 
 
103
 
 
104
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 
105
?>