Code

Updated mail account and account_id creation
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Dec 2008 10:03:23 +0000 (10:03 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Dec 2008 10:03:23 +0000 (10:03 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13236 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab.inc
gosa-plugins/mail/admin/groups/mail/class_groupMail.inc
gosa-plugins/mail/admin/groups/mail/mail.tpl

index 97f876c7fcbd74ee687f953f6c39931dc5281256..81e6b4ffe472ec3a20a5e4237e5f66fc2521ccc9 100644 (file)
@@ -29,6 +29,10 @@ class mailMethodKolab extends mailMethodCyrus
   protected $user_prefix    = 'user.';
   protected $share_prefix   = 'shared\\.';
 
+  /* Account ID creation */
+  protected $user_id    = "__PREFIX____UATTRIB__";  
+  protected $share_id   = "__PREFIX____CN__@__DOMAIN__";
+
   protected $userObjectClasses = array("kolabInetOrgPerson");
   protected $shareObjectClasses = array("kolabSharedFolder");
 
@@ -136,7 +140,7 @@ class mailMethodKolab extends mailMethodCyrus
    */
   public function getFolderType($default)
   {
-    if($this->enableFolderTypes && $this->parent->attrs['kolabFolderType'][0]){
+    if($this->enableFolderTypes && isset($this->parent->attrs['kolabFolderType'][0])){
       list($cat,$sub) = split("\.",$this->parent->attrs['kolabFolderType'][0]);
       return(array("CAT" => $cat, "SUB_CAT" => $sub));
     }else{
index 4d035aa43cea387fe8e88bf048734f0563be0fbc..695bae8d87942257a9f214e17055df6dcc4e97b6 100644 (file)
@@ -40,10 +40,22 @@ class mailgroup extends plugin
   var $objectclasses= array("gosaMailAccount");
   var $multiple_support = FALSE; // Not tested yet
 
+  var $uid = "";
+  var $cn ="";
+
   function __construct (&$config, $dn= NULL, $ui= NULL)
   {
     plugin::plugin($config, $dn);
 
+    /* Get attributes from parent object
+     */
+    foreach(array("uid","cn") as $attr){
+      if(isset($this->parent->by_object['group']) && isset($this->parent->by_object['group']->$attr)){
+        $this->$attr = &$this->parent->by_object['group']->$attr;
+      }elseif(isset($this->attrs[$attr])){
+        $this->$attr = $this->attrs[$attr][0];
+      }
+    }
 
     /* Intialize the used mailMethod
      */
@@ -390,6 +402,7 @@ class mailgroup extends plugin
     $smarty= get_smarty();
     $smarty->assign("initially_was_account", $this->initially_was_account);
     $smarty->assign("isModifyableMail", $this->mailMethod->isModifyableMail());
+    $smarty->assign("isModifyableServer", $this->mailMethod->isModifyableServer());
     $smarty->assign("mailEqualsCN", $this->mailMethod->mailEqualsCN());
     $smarty->assign("folder_acls" , $this->postable_acls());
     $smarty->assign("AclTypes" ,    $this->AclTypes);
@@ -546,8 +559,12 @@ class mailgroup extends plugin
     if (isset($_POST['mailedit'])){
 
       $mail = $this->mail;
+      $server = $this->gosaMailServer;
       plugin::save_object();
 
+      if(!$this->mailMethod->isModifyableServer() && $this->initially_was_account){
+        $this->gosaMailServer = $server;
+      }
       if(!$this->mailMethod->isModifyableMail() && $this->initially_was_account){
         $this->mail = $mail;
       }else{
index 25203886a3d771ff110b4842bb85f4575f3f8ee3..1d73a9d1bc581a973b7396f56604bfc004ebc546 100644 (file)
@@ -34,6 +34,9 @@
     <tr>
      <td><label for="gosaMailServer">{t}Server{/t}</label></td>
      <td>
+     {if !$isModifyableServer && $initially_was_account}
+        <input disabled size=30 value="{$gosaMailServer}">
+     {else}
 {render acl=$gosaMailServerACL}
       <select size="1" id="gosaMailServer" name="gosaMailServer" 
                title="{t}Specify the mail server where the user will be hosted on{/t}">
@@ -41,6 +44,7 @@
         <option disabled>&nbsp;</option>
       </select>
 {/render}
+     {/if}
      </td>
     </tr>
     <tr>