summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d4cdd3a)
raw | patch | inline | side by side (parent: d4cdd3a)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 17 Jan 2008 12:20:06 +0000 (12:20 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 17 Jan 2008 12:20:06 +0000 (12:20 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8439 594d385d-05f5-0310-b6e9-bd551577e9d8
14 files changed:
diff --git a/gosa-core/plugins/personal/netatalk/class_netatalk.inc b/gosa-core/plugins/personal/netatalk/class_netatalk.inc
+++ /dev/null
@@ -1,387 +0,0 @@
-<?php
-/*
- This code is part of GOsa (https://gosa.gonicus.de)
- Copyright (C) 2006 Gina Haeussge <osd@foosel.net>
- Copyright (C) 2006 Bernd Zeimetz <bernd@zeimetz.de>
-
- 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
- */
-
-/*! \brief netatalk plugin
- \author Gina Haeussge <osd@foosel.net>
- \author Bernd Zeimetz <bernd@zeimetz.de>
- \version 0.1
- \date 21.3.2006
-
- This class provides the functionality to read and write all attributes
- relevant for netatalk from/to the LDAP. It does syntax checking
- and displays the formulars required.
- */
-
-class netatalk extends plugin {
-
- /* Definitions */
- var $plHeadline = "Netatalk";
- var $plDescription = "Manage netatalk account";
-
- /* CLI vars */
- var $cli_summary = "Manage netatalk account";
- var $cli_description = "Manage Account \nfor netatalk";
- var $cli_parameters = array ("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
- var $view_logged = FALSE;
-
- /* Plugin specific values */
- var $apple_user_homepath_raw = "";
- var $apple_user_homeurl_raw = "";
- var $apple_user_homeurl_xml = "";
- var $apple_user_homeurl = "";
- var $apple_user_homeDirectory = "";
- var $apple_user_share = "";
- var $shares = array();
- var $shares_settings = array();
- var $selectedshare = "";
- var $mountDirectory = "/Network/Servers";
-
- /* Attributes to save to LDAP */
- var $attributes = array ("apple-user-homeurl", "apple-user-homeDirectory");
- var $CopyPasteVars= array("apple_user_homeurl", "apple_user_homeDirectory","apple_user_share","shares_settings","apple_user_homepath_raw",
- "apple_user_homeurl_raw","apple_user_homeurl_xml","apple_user_homeurl","selectedshare","mountDirectory");
-
- /* Attributes to use in smarty template */
- var $smarty_attributes = array ("apple_user_homepath_raw", "shares", "selectedshare");
-
- /* Attributes to save from $_POST */
- var $post_attributes = array ("apple_user_share", "apple_user_homepath_raw");
-
- /* Objectclasses */
- var $objectclasses = array ("apple-user");
-
- /* Checkboxes */
- var $is_chk_box = array ();
-
- var $uid ="";
-
- /* The constructor just saves a copy of the config. You may add what ever you need. */
- function netatalk(&$config, $dn = NULL) {
-
- /* Include config object */
- $this->config = $config;
- plugin::plugin($config, $dn);
-
- /* set user id */
- if(isset($this->attrs['uid'])){
- $this->uid = $this->attrs['uid'][0];
- }
-
- /* Copy needed attributes */
- foreach($this->attributes as $val) {
- if (isset($this->attrs["$val"][0])) {
- $name = str_replace('-', '_', $val);
- $this->$name = $this->attrs["$val"][0];
- }
- }
-
- if (strlen($this->apple_user_homeDirectory) >0) {
- $this->apple_user_homepath_raw = substr($this->apple_user_homeDirectory, strrpos($this->apple_user_homeDirectory, '/') + 1 );
- }
-
- /* get share list an set default values */
- $this->get_netatalk_shares();
- $this->apple_user_share = $this->selectedshare;
-
- /* Save initial account state */
- $this->initially_was_account = $this->is_account;
- }
-
-
-
- /* Get netatalk shares */
- function get_netatalk_shares()
- {
- /* Get netatalk shares */
- $this->shares = array();
- $ldap = $this->config->get_ldap_link();
-
- if($this->dn === "new" || $this->dn === NULL) {
- $base = session::get('CurrentMainBase');
- } else {
- $base = preg_replace("/^[^,]+,".normalizePreg(get_people_ou())."/","",$this->dn);
- }
-
- $ldap->cd($base);
- $ldap->search ("(&(objectClass=mount)(|(mountType=url)(mountType=nfs))(cn=*))");
-
- while ($attrs = $ldap->fetch()){
- $tmp = split(":", $attrs["cn"][0]);
- $host = trim($tmp[0]);
- $dir = trim($tmp[1]);
- $mountType = trim($attrs["mountType"][0]);
- if ($mountType == "url") {
- $mountTypeReal = "netatalk";
- } else {
- $mountTypeReal = $mountType;
- }
- $share = $attrs["cn"][0]. " (" . $mountTypeReal . ")";
- $this->shares[$share] = $share;
- $this->shares_settings[$share]["mountType"]=$mountType;
- $this->shares_settings[$share]["dir"]=$dir;
- $this->shares_settings[$share]["host"]=$host;
-
- $oldShare=substr($this->apple_user_homeDirectory, 0, strrpos($this->apple_user_homeDirectory, '/'));
- $newShare=($this->mountDirectory . "/". $host . $dir );
- if (strcmp($oldShare, $newShare)==0) {
- $this->selectedshare = $share;
- }
- }
- asort($this->shares);
- }
-
-
- /* Execute the plugin, produce the output. */
- function execute()
- {
- plugin :: execute();
-
- /* Log view */
- if($this->is_account && !$this->view_logged){
- $this->view_logged = TRUE;
- new log("view","users/".get_class($this),$this->dn);
- }
-
- /* Use the smarty templating engine here... */
- $smarty = get_smarty();
- $display = "";
-
- /* Do we need to flip is_account state? */
- if (isset ($_POST['modify_state'])) {
- $this->is_account = !$this->is_account;
- }
-
- /* Do we represent a valid account? */
- if (!$this->is_account && $this->parent === NULL) {
- $display = "<img alt=\"\"src=\"images/stop.png\" align=\"middle\"> <b>"._("This account has no netatalk extensions.")."</b>";
-
- $display .= back_to_main();
- return ($display);
- }
-
- /* Show tab dialog headers */
- if ($this->parent !== NULL) {
- if ($this->is_account) {
- $display = $this->show_disable_header(_("Remove netatalk account"), _("This account has netatalk features enabled. You can disable them by clicking below."));
- } else {
- $errmsg="";
- $obj = $this->parent->by_object['posixAccount'];
- if (!($obj->is_account) ) {
- $errmsg.="Posix features are needed for netatalk accounts, enable them first. ";
- }
- if (count($this->shares)== 0) {
- $errmsg.="At least one share with netatalk or NFS mount entry needed.";
- }
- if($errmsg==""){
- $display = $this->show_enable_header(_("Create netatalk account"), _("This account has netatalk features disabled. You can enable them by clicking below."));
- } else {
- $display = $this->show_enable_header(_("Create netatalk account"), _($errmsg), TRUE);
- }
- return ($display);
- }
- }
-
- /* Assign attributes and ACL to smarty */
- $SkipWrite = (!isset($this->parent) || !$this->parent) && !session::is_set('edit');
- $smarty->assign("netatalkShareACL", $this->getacl("netatalkShare",$SkipWrite));
- $smarty->assign("netatalkUserHomepathACL", $this->getacl("netatalkUserHomepath",$SkipWrite));
-
- foreach ($this->smarty_attributes as $val) {
- $smarty->assign("$val", $this-> $val);
- if (in_array($val, $this->is_chk_box)) {
- if ($this-> $val == "checked") {
- $smarty->assign($val."CHK", " checked ");
- } else {
- $smarty->assign($val."CHK", "");
- }
- }
- }
-
- /* Let smarty fetch and process the page. */
- $display .= ($smarty->fetch(get_template_path('netatalk.tpl', TRUE, dirname(__FILE__))));
- return ($display);
- }
-
-
- /* Check if we have correct data */
- function check() {
- $message = array ();
-
- if (strlen($this->apple_user_share) == 0) {
- $message[] = _("You must select a share to use.");
- }
-
- return ($message);
- }
-
- /* Save to LDAP */
- function save() {
- /* remove a / at the end of the homepath, we neither need it there nor
- * do we want to check for it later.
- */
- if(substr($this->apple_user_homepath_raw, -1, 1) === '/') {
- $this->apple_user_homepath_raw=substr($this->apple_user_homepath_raw, 0, -1);
- }
-
- $mountType=$this->shares_settings[$this->apple_user_share]["mountType"];
- $dir=$this->shares_settings[$this->apple_user_share]["dir"];
- $host=$this->shares_settings[$this->apple_user_share]["host"];
-
- /* Convert raw data to wished format */
- if ($this->is_account) {
- if($mountType=="url") {
- $this->apple_user_homeurl_xml = '<home_dir><url>afp://'.$host.$dir . '</url><path>'.$this->apple_user_homepath_raw.'</path></home_dir>';
- $this->apple_user_homeurl = base64_encode($this->apple_user_homeurl_xml);
- } else {
- $this->apple_user_homeurl = "";
- }
- $this->apple_user_homeDirectory = $this->mountDirectory . '/' . $host .$dir . '/' . $this->apple_user_homepath_raw;
- } else {
- $this->apple_user_homeurl = "";
- $this->apple_user_homeDirectory = "";
- }
-
- $ldap = $this->config->get_ldap_link();
-
- /* Reset array of used attributes, because plugin::save()
- will not work with '-' in attributes names
- after calling save restore attributes array */
- $attributes = $this->attributes;
- $this->attributes = array();
- plugin :: save();
- $this->attributes = $attributes;
-
- /* Do attribute conversion */
- foreach ($this->attributes as $val) {
- $name = str_replace('-', '_', $val);
- if ($this->$name != "") {
- $this->attrs[$val] = $this->$name;
- } else {
- $this->attrs[$val] = array();
- }
- unset ($this->attrs[$name]);
- }
-
- /* Write back to ldap */
- $ldap->cd($this->dn);
- $this->cleanup();
- $ldap->modify($this->attrs);
-
- if($this->initially_was_account){
- new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }else{
- new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }
-
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/netatalk account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- if ($this->initially_was_account == $this->is_account) {
- if ($this->is_modified) {
- $this->handle_post_events("modify",array("uid" => $this->uid));
- }
- } else {
- $this->handle_post_events("add",array("uid" => $this->uid));
- }
- }
-
- /* Use Save_object for every Post handling */
- function save_object() {
- if (isset ($_POST['netatalkTab'])) {
- /* Save ldap attributes */
- plugin :: save_object();
-
- foreach($this->post_attributes as $val) {
- if (isset ($_POST[$val])) {
- $this->$val = $_POST[$val];
- } else {
- $this->$val = "";
- }
- }
-
- /* Specialhandling for checkboxes */
- foreach ($this->is_chk_box as $val) {
- if (isset ($_POST[$val])) {
- $this-> $val = "checked";
- } else {
- $this-> $val = "unchecked";
- }
- }
-
- $this->apple_user_homeurl_raw = 'afp://' . $this->apple_user_share;
- }
- }
-
- function remove_from_parent() {
- /* Cancel if there's nothing to do here */
- if (!$this->initially_was_account) {
- return;
- }
-
- /* include global link_info */
- $ldap = $this->config->get_ldap_link();
-
- /* Remove and write to LDAP */
- plugin :: remove_from_parent();
-
- /* Adapt attributes if needed */
- // $method= new $this->method($this->config);
- // $method->fixAttributesOnRemove($this);
-
- @ DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save");
- $ldap->cd($this->dn);
- $this->cleanup();
- $ldap->modify($this->attrs);
-
- new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
-
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/netatalk account with dn '%s' failed."),$this->dn));
-
- /* remove the entry from LDAP */
- unset ($this->attrs['uid']);
-
- /* Optionally execute a command after we're done */
- $this->handle_post_events('remove', array("uid" => $this->uid));
- }
-
-
- /* Return plugin informations for acl handling*/
- static function plInfo()
- {
- return (array(
- "plDescription" => _("Netatalk"),
- "plSelfModify" => TRUE,
- "plDepends" => array("user"),
- "plPriority" => 6,
- "plSection" => array("personal" => _("My account")),
- "plCategory" => array("users"),
- "plOptions" => array(),
-
- "plProvidedAcls" => array(
- "netatalkUserHomepath" => _("User home path"),
- "netatalkShare" => _("Share"))
- ));
- }
-
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-core/plugins/personal/netatalk/main.inc b/gosa-core/plugins/personal/netatalk/main.inc
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-/*
- This code is part of GOsa (https://gosa.gonicus.de)
- Copyright (C) 2006 Gina Haeussge <osd@foosel.net>
- Copyright (C) 2006 Bernd Zeimetz <bernd@zeimetz.de>
-
- 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
- */
-
-if (!$remove_lock) {
- /* Reset requested? */
- if (isset ($_POST['edit_cancel']) || (isset ($_GET['reset']) && $_GET['reset'] == 1)) {
- del_lock($ui->dn);
- session::un_set('edit');
- session::un_set('netatalk');
- }
-
- /* Create netatalk object on demand */
- if (!session::is_set('netatalk') || (isset ($_GET['reset']) && $_GET['reset'] == 1)) {
- $netatalk = new netatalk($config, $ui->dn);
- $netatalk->enable_CSN_check();
- $netatalk->set_acl_base($ui->dn);
- $netatalk->set_acl_category("users");
- session::set('netatalk',$netatalk);
- }
- $netatalk = session::get('netatalk');
-
- /* save changes back to object */
- if (session::is_set('edit')) {
- $netatalk->save_object();
- }
-
- /* Enter edit mode? */
- if (isset ($_POST['edit'])) {
-
- /* Check locking */
- if (($username = get_lock($ui->dn)) != "") {
- session::set('back_plugin',$plug);
- gen_locked_message($username, $ui->dn);
- exit ();
- }
-
- /* Lock the current entry */
- add_lock($ui->dn, $ui->dn);
- session::set('dn',$ui->dn);
- session::set('edit',TRUE);
- }
-
- /* save changes to LDAP and disable edit mode */
- if (isset ($_POST['edit_finish'])) {
-
- /* Perform checks */
- $message = $netatalk->check();
-
- /* No errors, save object */
- if (count($message) == 0) {
- $netatalk->save();
- del_lock($ui->dn);
- session::un_set('edit');
-
- /* Remove object */
- session::un_set('netatalk');
- } else {
- /* Errors found, show message */
- show_errors($message);
- }
- }
-
- /* Execute formular */
- $display = $netatalk->execute();
-
- /* Store changes in session */
- if (session::is_set('edit')) {
- session::set('netatalk',$netatalk);
- }
-
- $info = "";
- /* Show page footer depending on the mode */
- if ($netatalk->is_account) {
- $display .= "<p class=\"plugbottom\">";
-
- /* Are we in edit mode? */
- if (session::is_set('edit')) {
- $display .= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
- $display .= " ";
- $display .= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
- $info = "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/closedlock.png')."\"> ".$ui->dn." ";
- } else {
- $info = "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png')."\"> ".$ui->dn." ";
- if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/netatalk"))){
- $info .= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\"> "._("Click the 'Edit' button below to change informations in this dialog");
- $display .= "<input type=submit name=\"edit\" value=\""._("Edit")."\">\n";
- }
-
- $display .= "<input type=\"hidden\" name=\"ignore\">\n";
- }
- $display .= "</p>\n";
- }
-
- /* Page header*/
- $display = print_header(get_template_path('images/netatalk.png'), _("Netatalk settings"), $info).$display;
-
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-core/plugins/personal/netatalk/netatalk.tpl b/gosa-core/plugins/personal/netatalk/netatalk.tpl
+++ /dev/null
@@ -1,33 +0,0 @@
-<table summary="">
-<tr>
- <td>
- <label for="apple_user_share">{t}Share{/t}</label>
- </td>
- <td>
-
-{render acl=$netatalkShareACL}
- <select name="apple_user_share" id="apple_user_share">
- {html_options options=$shares selected=$selectedshare}
- </select>
-{/render}
- </td>
-<tr>
- <td>
- <label for="apple_user_homepath_raw">{t}Path{/t}</label>
- </td>
- <td>
-{render acl=$netatalkUserHomepathACL}
- <input name="apple_user_homepath_raw" id="apple_user_homepath_raw" type="text" value="{$apple_user_homepath_raw}" size="25" maxlength="65"/>
-{/render}
- </td>
-</tr>
-</table>
-
-<input type="hidden" name="netatalkTab" value="netatalkTab">
-
-<!-- Place cursor -->
-<script language="JavaScript" type="text/javascript">
- <!-- // First input field on page
- focus_field('apple_user_homeurl_raw');
- -->
-</script>
diff --git a/gosa-core/plugins/personal/scalix/class_scalixAccount.inc b/gosa-core/plugins/personal/scalix/class_scalixAccount.inc
+++ /dev/null
@@ -1,538 +0,0 @@
-<?php
-/*! \brief scalix plugin
- \author Jörn Dreyer <gosa.jfd@butonic.de>,
- based on work by Cajus Pollmeier <pollmeier@gonicus.de>
- \version 0.01
- \date 20.10.2006
-
- This class provides the functionality to read and write all attributes
- relevant for scalixAccounts from/to the LDAP. It does syntax checking
- and displays the formulars required.
- */
-
-class scalixAccount extends plugin
-{
- /* Definitions */
- var $plHeadline = "Scalix";
- var $plDescription= "This does something";
-
- /* plugin specific values - scalixUserClass */
- /* MUST */
- var $scalixScalixObject= TRUE; //TRUE or FALSE
- var $scalixMailnode= "";
- /* INDIRECT MUST, scalix will complain if no email was specified */
-
- /* MAY */
- var $scalixAdministrator= FALSE;
- var $scalixMailboxAdministrator = FALSE;
- var $scalixServerLanguage= "";
- var $scalixEmailAddress= array();
- var $scalixLimitMailboxSize= "";
- var $scalixLimitOutboundMail= FALSE;
- var $scalixLimitInboundMail= FALSE;
- var $scalixLimitNotifyUser= FALSE;
- var $scalixHideUserEntry= FALSE;
- var $scalixMailboxClass= "";
-
- var $uid ="";
- var $default_permissions= "none";
- var $member_permissions= "post";
- var $members= array();
- var $admins= array();
- var $vacations= array();
- var $perms= array( "lrs" => "read",
- "lrsp" => "post",
- "lrsip" => "append",
- "lrswipcd" => "write",
- "lrswipcda" => "all" );
-
- /* attribute list for save action */
- var $attributes = array("scalixMailnode", "scalixServerLanguage", "scalixLimitMailboxSize", "scalixMailboxClass");
- var $fakeBooleanAttributes= array("scalixAdministrator", "scalixMailboxAdministrator", "scalixLimitOutboundMail",
- "scalixLimitInboundMail", "scalixLimitNotifyUser", "scalixHideUserEntry");
- var $objectclasses = array("scalixUserClass");
-
-
- /* constructor, if 'dn' is set, the node loads the given
- 'dn' from LDAP */
- function scalixAccount (&$config, $dn= NULL)
- {
- /* dn shouldn't be NULL */
- if($dn === NULL){
- trigger_error("Initialising scalixAccount without valid dn.");
- }
-
- /* Load bases attributes */
- plugin::plugin($config, $dn);
-
- /* Load attributes */
- if ($dn != "new"){
-
- /* Set user id */
- if(isset($this->attrs['uid'][0])){
- $this->uid = $this->attrs['uid'][0];
- }
-
- foreach ($this->fakeBooleanAttributes as $val){
- if (isset($this->attrs["$val"][0])&&$this->attrs["$val"][0]=="TRUE"){
- $this->$val = TRUE;
- } else {
- $this->$val = FALSE;
- }
- }
-
- /* Load attributes containing arrays */
- foreach (array("scalixEmailAddress") as $val){
- if (isset($this->attrs["$val"]["count"])){
- for ($i= 0; $i<$this->attrs["$val"]["count"]; $i++){
- array_push($this->$val, $this->attrs["$val"][$i]);
- }
- }
- }
- }
-
- /* Save initial account state */
- $this->initially_was_account= $this->is_account;
- }
-
-
- function execute()
- {
- /* Call parent execute */
- plugin::execute();
-
- /* Load templating engine */
- $smarty= get_smarty();
- $display= "";
-
- /* Do we need to flip is_account state? */
- if (isset($_POST['modify_state'])){
- $this->is_account= !$this->is_account;
- }
-
- /* Show main page */
- $mailboxClasses = array("", "LIMITED", "FULL");
- $serverLanguages= array("", "GERMAN", "ENGLISH");
-
- /* Do we represent a valid account? */
- if (!$this->is_account && $this->parent === NULL){
- $display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\"> <b>".
- _("This account has no scalix extensions.")."</b>";
-
- $display.= back_to_main();
- return ($display);
- }
-
- /* Show tab dialog headers */
- if ($this->parent !== NULL){
- if ($this->is_account){
- $display= $this->show_disable_header(_("Remove scalix account"),
- _("This account has scalix synchronization enabled. You can disable it by clicking below."));
- } else {
- $display= $this->show_enable_header(_("Create scalix account"), _("This account has scalix synchronization disabled. You can enable it by clicking below."));
- return ($display);
- }
- }
-
- /* Trigger forward add dialog? */
- if (isset($_POST['add_local_forwarder'])){
- $this->forward_dialog= TRUE;
- $this->dialog= TRUE;
- }
-
- /* Cancel forward add dialog? */
- if (isset($_POST['add_locals_cancel'])){
- $this->forward_dialog= FALSE;
- $this->dialog= FALSE;
- }
-
-
- $smarty->assign("mailboxClasses", $mailboxClasses);
- $smarty->assign("serverLanguages", $serverLanguages);
- foreach(array("perms", "scalixScalixObject", "scalixMailnode", "scalixAdministrator", "scalixMailboxAdministrator",
- "scalixServerLanguage", "scalixLimitMailboxSize", "scalixLimitOutboundMail", "scalixEmailAddress",
- "scalixLimitInboundMail", "scalixLimitNotifyUser", "scalixHideUserEntry", "scalixMailboxClass") as $val){
-
- $smarty->assign("$val", $this->$val);
- $smarty->assign("$val"."ACL", $this->getacl($val));
- }
-
- /* Fill checkboxes */
- if ($this->scalixAdministrator) {
- $smarty->assign("scalixAdministrator", "checked");
- } else {
- $smarty->assign("scalixAdministrator", "");
- }
- if ($this->scalixMailboxAdministrator) {
- $smarty->assign("scalixMailboxAdministrator", "checked");
- } else {
- $smarty->assign("scalixMailboxAdministrator", "");
- }
- if ($this->scalixLimitOutboundMail) {
- $smarty->assign("scalixLimitOutboundMail", "checked");
- } else {
- $smarty->assign("scalixLimitOutboundMail", "");
- }
- if ($this->scalixLimitInboundMail) {
- $smarty->assign("scalixLimitInboundMail", "checked");
- } else {
- $smarty->assign("scalixLimitInboundMail", "");
- }
- if ($this->scalixLimitNotifyUser) {
- $smarty->assign("scalixLimitNotifyUser", "checked");
- } else {
- $smarty->assign("scalixLimitNotifyUser", "");
- }
- if ($this->scalixHideUserEntry) {
- $smarty->assign("scalixHideUserEntry", "checked");
- } else {
- $smarty->assign("scalixHideUserEntry", "");
- }
-
- $display.= $smarty->fetch (get_template_path('generic.tpl', TRUE, dirname(__FILE__)));
- return ($display);
- }
-
-
- /* remove object from parent */
- function remove_from_parent()
- {
- /* Cancel if there's nothing to do here */
- if (!$this->initially_was_account){
- return;
- }
-
- /* include global link_info */
- $ldap= $this->config->get_ldap_link();
-
- /* Remove and write to LDAP */
- plugin::remove_from_parent();
-
- /* Zero arrays */
- $this->attrs['scalixEmailAddress']= array();
-
- /* Unset fake boolean attributes from entry */
- foreach ($this->fakeBooleanAttributes as $val){
- $this->attrs["$val"]= array();
- }
-
- /*unset scalixScalixObject*/
- $this->attrs['scalixScalixObject']=array();
-
- @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,$this->attributes, "Save");
- $ldap->cd($this->dn);
- $ldap->modify($this->attrs);
- show_ldap_error($ldap->get_error());
-
- /* Optionally execute a command after we're done */
- $this->handle_post_events("remove");
- }
-
-
- /* Save data to object */
- function save_object()
- {
- if (isset($_POST['scalixTab'])){
-
- /* Save ldap attributes */
- plugin::save_object();
-
- /* Check if given value is not empty */
- if ($_POST['email_address'] != ""){
- $valid= FALSE;
-
- /* Valid mail address */
- if( ($this->is_template && !tests::is_email($_POST['email_address'], TRUE)) ||
- (!$this->is_template && !tests::is_email($_POST['email_address'])) ){
- msg_dialog::display(_("Error"), _("Cannot add invalid mail address!"), ERROR_DIALOG);
- }else{
- $valid = TRUE;
- }
-
- /* Check write access */
- if(!$this->acl_is_writeable("scalixEmailAddress")){
- msg_dialog::display(_("Error"), _("You have no permission to modify these addresses."), ERROR_DIALOG);
- }else{
-
- /* Mail address already in use ? */
- if ($valid && ($user= $this->addEmail ($_POST['email_address'])) != ""){
- $ui= get_userinfo();
- if ($user != $ui->username){
- msg_dialog::display(_("Error"), sprintf(_("Cannot add mail address: it is already used by user '%s'."), $user),
- ERROR_DIALOG);
- }
- }
- }
- }
-
- /* Delete email addresses */
- if (isset($_POST['delete_email']) && isset ($_POST['emails_list'])){
- if(!$this->acl_is_writeable("scalixEmailAddress")){
- msg_dialog::display(_("Error"), _("You have no permission to modify these addresses."), ERROR_DIALOG);
- }else{
- if (count($_POST['emails_list'])){
- $this->delEmail ($_POST['emails_list']);
- }
- }
- }
-
- /* Save fakeBooleanAttributes*/
- foreach ($this->fakeBooleanAttributes as $val){
- if ($this->acl_is_writeable($val)) {
- if( isset ($_POST["$val"])) {
- $data = TRUE;
- } else {
- $data = FALSE;
- }
- if ($this->$val != $data){
- $this->is_modified= TRUE;
- }
-
- $this->$val= $data;
- }
- }
- }
- }
-
-
- /* Save data to LDAP, depending on is_account we save or delete */
- function save()
- {
- $ldap= $this->config->get_ldap_link();
-
- /* Call parents save to prepare $this->attrs */
- plugin::save();
-
- /* Save arrays */
- $this->attrs['scalixEmailAddress']= $this->scalixEmailAddress;
-
- /* Save boolean vars ... the scalix schema expects them as strings */
- $this->attrs['scalixScalixObject'] = $this->scalixScalixObject?"TRUE":"FALSE";
- $this->attrs['scalixAdministrator'] = $this->scalixAdministrator?"TRUE":"FALSE";
- $this->attrs['scalixMailboxAdministrator'] = $this->scalixMailboxAdministrator?"TRUE":"FALSE";
- $this->attrs['scalixLimitOutboundMail'] = $this->scalixLimitOutboundMail?"TRUE":"FALSE";
- $this->attrs['scalixLimitInboundMail'] = $this->scalixLimitInboundMail?"TRUE":"FALSE";
- $this->attrs['scalixLimitNotifyUser'] = $this->scalixLimitNotifyUser?"TRUE":"FALSE";
- $this->attrs['scalixHideUserEntry'] = $this->scalixHideUserEntry?"TRUE":"FALSE";
-
- /* Remove Mailquota if = "" */
- if((isset($this->attrs['scalixLimitMailboxSize']))&&($this->attrs['scalixLimitMailboxSize']=="")) {
- $this->attrs['scalixLimitMailboxSize']=array();
- }
-
- /* Save data to LDAP */
- $ldap->cd($this->dn);
- $ldap->modify($this->attrs);
- show_ldap_error($ldap->get_error());
-
- /* Optionally execute a command after we're done */
- if ($this->initially_was_account == $this->is_account){
- if ($this->is_modified){
- $this->handle_post_events("modify");
- }
- } else {
- $this->handle_post_events("add");
- }
-
- }
-
- /* Check formular input */
- function check()
- {
- $ldap= $this->config->get_ldap_link();
-
- $message= array();
-
- if(empty($this->scalixMailnode)){
- $message[]= _("There is no scalix mailnode specified.");
- }
- if(empty($this->scalixScalixObject)){
- $message[]= _("scalixScalixObject must be set!");
- }
-
- $ldap->cd($this->config->current['BASE']);
- foreach($this->scalixEmailAddress as $k => $mail) {
- $ldap->search ("(&(!(objectClass=gosaUserTemplate))(objectClass=scalixUserClass)(scalixEmailAddress=".
- $mail.")(!(uid=".$this->uid."))(!(cn=".$this->uid.")))", array("uid"));
-
- if ($ldap->count() != 0){
- $message[]= _("The email address '$mail' you've entered is already in use.");
- }
- }
-
- /* Check quota */
- if ($this->scalixLimitMailboxSize != '' && $this->acl_is_writeable("scalixLimitMailboxSize")){
- if (!is_numeric($this->scalixLimitMailboxSize)) {
- $message[]= _("Value in 'Limit Mailbox size' is not valid.");
- } else {
- $this->scalixLimitMailboxSize= (int) $this->scalixLimitMailboxSize;
- }
- }
-
- return ($message);
- }
-
- /* Adapt from template, using 'dn' */
- function adapt_from_template($dn)
- {
- plugin::adapt_from_template($dn);
-
- foreach (array("scalixEmailAddress") as $val){
- $this->$val= array();
- if (isset($this->attrs["$val"]["count"])){
- for ($i= 0; $i<$this->attrs["$val"]["count"]; $i++){
- $value= $this->attrs["$val"][$i];
- foreach (array("sn", "givenName", "uid") as $repl){
- if (preg_match("/%$repl/i", $value)){
- $value= preg_replace ("/%$repl/i", $this->parent->$repl, $value);
- }
- }
- array_push($this->$val, strtolower(rewrite($value)));
- }
- }
- }
- $this->mail= strtolower(rewrite($this->mail));
- }
-
- function addEmail($address)
- {
- $ldap= $this->config->get_ldap_link();
-
- $address= strtolower($address);
-
- /* Is this address already assigned in LDAP? */
- $ldap->cd ($this->config->current['BASE']);
- $ldap->search ("(&(objectClass=scalixUserClass)(|(scalixEmailAddress=$address)".
- "(scalixEmailAddress=$address)))", array("uid"));
-
- if ($ldap->count() > 0){
- $attrs= $ldap->fetch ();
- return ($attrs["uid"][0]);
- }
-
- /* Add to list of alternates */
- if (!in_array($address, $this->scalixEmailAddress)){
- $this->scalixEmailAddress[]= $address;
- $this->is_modified= TRUE;
- }
-
- //sort ($this->scalixEmailAddress); //scalix makes the first email the destination, all others can receive
- reset ($this->scalixEmailAddress);
-
- return ("");
- }
-
-
- function delEmail($addresses)
- {
- $this->scalixEmailAddress= array_remove_entries ($addresses, $this->scalixEmailAddress);
- $this->is_modified= TRUE;
- }
-
-
- static function plInfo()
- {
- return (array(
- "plDescription" => _("Scalix account"),
- "plSelfModify" => TRUE,
- "plDepends" => array("user"),
- "plPriority" => 2,
- "plSection" => array("personal" => _("My account")),
- "plCategory" => array("users"),
- "plOptions" => array(),
-
- "plProvidedAcls" => array(
-
- "scalixMailnode" => _("Scalix Mail node"),
- "scalixMailboxClass" => _("Mailbox class"),
- "scalixServerLanguage" => _("Server language"),
- "scalixAdministrator" => _("Administrator"),
- "scalixMailboxAdministrator"=> _("Mailbox administrator"),
- "scalixHideUserEntry" => _("Hide user entry in Scalix"),
- "scalixLimitMailboxSize" => _("Mailbox size limitations"),
- "scalixLimitOutboundMail" => _("Limit outbound"),
- "scalixLimitInboundMail" => _("Limit inbound"),
- "scalixLimitNotifyUser" => _("Notify user"),
- "scalixEmailAddress" => _("Scalix email addresses"))
-
- ));
- }
-
-
- function saveCopyDialog()
- {
- if (isset($_POST['scalixTab'])){
-
- /* Add email addresses */
- if (isset($_POST['add_email'])){
-
- /* Check if given value is not empty */
- if ($_POST['email_address'] != ""){
- $valid= FALSE;
-
- /* Valid mail address */
- if( ($this->is_template && !tests::is_email($_POST['email_address'], TRUE)) ||
- (!$this->is_template && !tests::is_email($_POST['email_address'])) ){
- msg_dialog::display(_("Error"), _("Cannot add invalid mail address!"), ERROR_DIALOG);
- }else{
- $valid = TRUE;
- }
-
- /* Mail address already in use ? */
- if ($valid && ($user= $this->addEmail ($_POST['email_address'])) != ""){
- $ui= get_userinfo();
- if ($user != $ui->username){
- msg_dialog::display(_("Error"), sprintf(_("Cannot add mail address: it is already used by user '%s'."), $user), ERROR_DIALOG);
- }
- }
- }
- }
-
- /* Delete email addresses */
- if (isset($_POST['delete_email']) && isset ($_POST['emails_list'])){
- if (count($_POST['emails_list'])){
- $this->delEmail ($_POST['emails_list']);
- }
- }
- }
- }
-
-
- function PrepareForCopyPaste($source)
- {
- plugin::PrepareForCopyPaste($source);
- foreach ($this->fakeBooleanAttributes as $val){
- if (isset($source["$val"][0])&&$source["$val"][0]=="TRUE"){
- $this->$val = TRUE;
- } else {
- $this->$val = FALSE;
- }
- }
-
- /* Load attributes containing arrays */
- foreach (array("scalixEmailAddress") as $val){
- if (isset($source["$val"]["count"])){
- for ($i= 0; $i<$source["$val"]["count"]; $i++){
- array_push($this->$val, $source["$val"][$i]);
- }
- }
- }
- }
-
-
- /* Create the posix dialog part for copy & paste */
- function getCopyDialog()
- {
- $smarty = get_smarty();
- $smarty->assign("scalixEmailAddress",$this->scalixEmailAddress);
- $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__)));
- $ret = array();
- $ret['string'] = $str;
- $ret['status'] = "";
- return($ret);
-
- }
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler
-?>
diff --git a/gosa-core/plugins/personal/scalix/generic.tpl b/gosa-core/plugins/personal/scalix/generic.tpl
+++ /dev/null
@@ -1,127 +0,0 @@
-<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding="0" border="0">
- <tr>
- <td style="width:50%; vertical-align:top;">
- <h2><img class="center" alt="" align="middle" src="images/rightarrow.png" /> {t}Generic{/t}</h2>
- <table summary="">
- <tr>
- <td><label for="scalixMailnode">{t}Scalix mailnode{/t}</label>{$must}</td>
- <td>
-{render acl=$scalixMailnodeACL}
- <input id="scalixMailnode" name="scalixMailnode" size=35 maxlength=65 value="{$scalixMailnode}">
-{/render}
- </td>
- </tr>
- <tr>
- <td><label for="scalixMailboxClass">{t}Salix mailbox class{/t}</label></td>
- <td>
-{render acl=$scalixMailboxClassACL}
- <select size="1" id="scalixMailboxClass" name="scalixMailboxClass"
- title="{t}Limited users con not make use of the group calendar functionality in Scalix{/t}">
- {html_options values=$mailboxClasses output=$mailboxClasses selected=$scalixMailboxClass}
- </select>
-{/render}
- </td>
- </tr>
- <tr>
- <td><label for="scalixServerLanguage">{t}Scalix server language{/t}</label></td>
- <td>
-{render acl=$scalixServerLanguageACL}
- <select size="1" id="scalixServerLanguage" name="scalixServerLanguage"
- title="{t}Message catalog language for client.{/t}">
- {html_options values=$serverLanguages output=$serverLanguages selected=$scalixServerLanguage}
- </select>
-{/render}
- </td>
- </tr>
- </table>
-
- <p class="seperator"> </p>
-
- <table summary="">
- <tr>
- <td>
-{render acl=$scalixAdministratorACL}
- <input type=checkbox name="scalixAdministrator" value="1" {$scalixAdministrator}
- title="{t}Select for admin capability.{/t}"> {t}Scalix Administrator{/t}
-{/render}
- <br>
-{render acl=$scalixMailboxAdministratorACL}
- <input type=checkbox name="scalixMailboxAdministrator" value="1" {$scalixMailboxAdministrator}
- title="{t}Select for mailbox admin capability.{/t}"> {t}Scalix Mailbox Administrator{/t}
-{/render}
- <br>
-{render acl=$scalixHideUserEntryACL}
- <input type=checkbox name="scalixHideUserEntry" value="1" {$scalixHideUserEntry}
- title="{t}Hide user entry from addressbook.{/t}"> {t}Hide this user entry in Scalix{/t}
-{/render}
- <br>
- </table>
-
- <p class="seperator"> </p>
-
- <table summary="">
- <tr>
- <td><label for="scalixLimitMailboxSize">{t}Limit mailbox size{/t}</label></td>
- <td>
-{render acl=$scalixLimitMailboxSizeACL}
- <input id="scalixLimitMailboxSize" name="scalixLimitMailboxSize" size=5 maxlength=10 value="{$scalixLimitMailboxSize}"> {t}MB{/t}
-{/render}
- </td>
- </tr>
- <tr>
- <td >
-{render acl=$scalixLimitOutboundMailACL}
- <input type=checkbox name="scalixLimitOutboundMail" value="1" {$scalixLimitOutboundMail}
- title="{t}As sanction on mailbox quota overuse, stop user from sending mail.{/t}"> {t}Limit Outbound Mail{/t}
-{/render}
- <br>
-{render acl=$scalixLimitInboundMailACL}
- <input type=checkbox name="scalixLimitInboundMail" value="1" {$scalixLimitInboundMail}
- title="{t}As sanction on mailbox quota overuse, stop user from receiving mail.{/t}"> {t}Limit Inbound Mail{/t}
-{/render}
- <br>
-{render acl=$scalixLimitNotifyUserACL}
- <input type=checkbox name="scalixLimitNotifyUser" value="1" {$scalixLimitNotifyUser}
- title="{t}As sanction on mailbox quota overuse, notify the user by eMail.{/t}"> {t}Notify User{/t}
-{/render}
- <br>
- </td>
- </tr>
- </table>
- </td>
-
- <td style="border-left:1px solid #A0A0A0">
-
- </td>
-
- <td style="vertical-align:top;">
- <h2><img class="center" alt="" align="middle" src="images/envelope.png" /><label for="emails_list"> {t}Scalix email addresses{/t}</label></h2>
-{render acl=$scalixEmailAddressACL}
- <select id="emails_list" style="width:100%;height:100px;" name="emails_list[]" size="15"
- multiple title="{t}List of scalix email addresses{/t}" >
- {html_options values=$scalixEmailAddress output=$scalixEmailAddress}
- <option disabled> </option>
- </select>
-{/render}
- <br />
-{render acl=$scalixEmailAddressACL}
- <input name="email_address" size="30" align="middle" maxlength="65" value="">
-{/render}
-{render acl=$scalixEmailAddressACL}
- <input type=submit value="{t}Add{/t}" name="add_email">
-{/render}
-{render acl=$scalixEmailAddressACL}
- <input type=submit value="{t}Delete{/t}" name="delete_email">
-{/render}
- </td>
- </tr>
-</table>
-
-<input type="hidden" name="scalixTab" value="scalixTab">
-
-<!-- Place cursor -->
-<script language="JavaScript" type="text/javascript">
- <!-- // First input field on page
- focus_field('scalixMailnode');
- -->
-</script>
diff --git a/gosa-core/plugins/personal/scalix/main.inc b/gosa-core/plugins/personal/scalix/main.inc
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-/*
- This code is part of GOsa (https://gosa.gonicus.de)
- Copyright (C) 2006 Jörn Dreyer, based on work by
- 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
- */
-
-if (!$remove_lock){
- /* Reset requested? */
- if (isset($_POST['edit_cancel']) ||
- (isset($_GET['reset']) && $_GET['reset'] == 1)){
- del_lock ($ui->dn);
- session::un_set ('edit');
- session::un_set ('scalixAccount');
- }
-
- /* Create mail object on demand */
- if (!session::is_set('scalixAccount') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
- $scalixAccount= new scalixAccount ($config, $ui->dn);
- $scalixAccount->enable_CSN_check();
- $scalixAccount->set_acl_base($ui->dn);
- $scalixAccount->set_acl_category("users");
- session::set('scalixAccount',$scalixAccount);
- }
- $scalixAccount = session::get('scalixAccount');
-
- /* save changes back to object */
- if (session::is_set('edit')){
- $scalixAccount->save_object ();
- }
-
- /* Enter edit mode? */
- if (isset($_POST['edit'])){
-
- /* Check locking */
- if (($username= get_lock($ui->dn)) != ""){
- session::set('back_plugin',$plug);
- session::set('LOCK_VARS_TO_USE',array("/^edit$/","/^plug$/"));
- $lock_msg = gen_locked_message ($username, $ui->dn);
-
- }else{
-
- /* Lock the current entry */
- add_lock ($ui->dn, $ui->dn);
- session::set('dn',$ui->dn);
- session::set('edit',TRUE);
- }
- }
-
- /* save changes to LDAP and disable edit mode */
- if (isset($_POST['edit_finish'])){
-
- /* Perform checks */
- $message= $scalixAccount->check ();
-
- /* No errors, save object */
- if (count ($message) == 0){
- $scalixAccount->save ();
- gosa_log ("User/scalix object'".$ui->dn."' has been saved");
- $scalixAccount->acl= "#none#";
- del_lock ($ui->dn);
- session::un_set ('edit');
-
- /* Remove object */
- session::un_set ('scalixAccount');
- } else {
- /* Errors found, show message */
- show_errors ($message);
- }
- }
-
- /* Execute formular */
- $display= $scalixAccount->execute ();
-
- /* Store changes in session */
- if (session::is_set('edit')){
- session::set('scalixAccount',$scalixAccount);
- }
-
- /* Show page footer depending on the mode */
- if ($scalixAccount->is_account){
-
- $display.= "<p class=\"plugbottom\">";
-
- /* Are we in edit mode? */
- if (session::is_set('edit')){
- $display.= "<input type=submit name=\"edit_finish\" value=\""._("Save")."\">\n";
- $display.= " ";
- $display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
- $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/closedlock.png').
- "\"> ".$ui->dn." ";
- } else {
- $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png').
- "\"> ".$ui->dn." ";
-
- if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/scalix"))){
- $info.= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\"> ".
- _("Click the 'Edit' button below to change informations in this dialog");
-
- $display.= "<input type=submit name=\"edit\" value=\""._("Edit")."\">\n";
- }
- $display.= "<input type=\"hidden\" name=\"ignore\">\n";
- }
- $display.= "</p>\n";
- }
-
-
- $info= "";
-
- /* Page header*/
- $display= print_header(get_template_path('images/scalix.png'), _("Scalix settings"), $info).$display;
-
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-core/plugins/personal/scalix/paste_generic.tpl b/gosa-core/plugins/personal/scalix/paste_generic.tpl
+++ /dev/null
@@ -1,25 +0,0 @@
-<table>
- <tr>
- <td style="vertical-align:top;">
- <h2><img class="center" alt="" align="middle" src="images/envelope.png" /><label for="emails_list"> {t}Scalix email addresses{/t}</label></h2>
- <select id="emails_list" style="width:100%;height:100px;" name="emails_list[]" size="15"
- multiple title="{t}List of scalix email addresses{/t}" >
- {html_options values=$scalixEmailAddress output=$scalixEmailAddress}
- <option disabled> </option>
- </select>
- <br />
- <input name="email_address" size="30" align="middle" maxlength="65" value="">
- <input type=submit value="{t}Add{/t}" name="add_email">
- <input type=submit value="{t}Delete{/t}" name="delete_email">
- </td>
- </tr>
-</table>
-
-<input type="hidden" name="scalixTab" value="scalixTab">
-
-<!-- Place cursor -->
-<script language="JavaScript" type="text/javascript">
- <!-- // First input field on page
- document.mainform.scalixMailnode.focus();
- -->
-</script>
diff --git a/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc b/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc
--- /dev/null
@@ -0,0 +1,387 @@
+<?php
+/*
+ This code is part of GOsa (https://gosa.gonicus.de)
+ Copyright (C) 2006 Gina Haeussge <osd@foosel.net>
+ Copyright (C) 2006 Bernd Zeimetz <bernd@zeimetz.de>
+
+ 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
+ */
+
+/*! \brief netatalk plugin
+ \author Gina Haeussge <osd@foosel.net>
+ \author Bernd Zeimetz <bernd@zeimetz.de>
+ \version 0.1
+ \date 21.3.2006
+
+ This class provides the functionality to read and write all attributes
+ relevant for netatalk from/to the LDAP. It does syntax checking
+ and displays the formulars required.
+ */
+
+class netatalk extends plugin {
+
+ /* Definitions */
+ var $plHeadline = "Netatalk";
+ var $plDescription = "Manage netatalk account";
+
+ /* CLI vars */
+ var $cli_summary = "Manage netatalk account";
+ var $cli_description = "Manage Account \nfor netatalk";
+ var $cli_parameters = array ("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
+ var $view_logged = FALSE;
+
+ /* Plugin specific values */
+ var $apple_user_homepath_raw = "";
+ var $apple_user_homeurl_raw = "";
+ var $apple_user_homeurl_xml = "";
+ var $apple_user_homeurl = "";
+ var $apple_user_homeDirectory = "";
+ var $apple_user_share = "";
+ var $shares = array();
+ var $shares_settings = array();
+ var $selectedshare = "";
+ var $mountDirectory = "/Network/Servers";
+
+ /* Attributes to save to LDAP */
+ var $attributes = array ("apple-user-homeurl", "apple-user-homeDirectory");
+ var $CopyPasteVars= array("apple_user_homeurl", "apple_user_homeDirectory","apple_user_share","shares_settings","apple_user_homepath_raw",
+ "apple_user_homeurl_raw","apple_user_homeurl_xml","apple_user_homeurl","selectedshare","mountDirectory");
+
+ /* Attributes to use in smarty template */
+ var $smarty_attributes = array ("apple_user_homepath_raw", "shares", "selectedshare");
+
+ /* Attributes to save from $_POST */
+ var $post_attributes = array ("apple_user_share", "apple_user_homepath_raw");
+
+ /* Objectclasses */
+ var $objectclasses = array ("apple-user");
+
+ /* Checkboxes */
+ var $is_chk_box = array ();
+
+ var $uid ="";
+
+ /* The constructor just saves a copy of the config. You may add what ever you need. */
+ function netatalk(&$config, $dn = NULL) {
+
+ /* Include config object */
+ $this->config = $config;
+ plugin::plugin($config, $dn);
+
+ /* set user id */
+ if(isset($this->attrs['uid'])){
+ $this->uid = $this->attrs['uid'][0];
+ }
+
+ /* Copy needed attributes */
+ foreach($this->attributes as $val) {
+ if (isset($this->attrs["$val"][0])) {
+ $name = str_replace('-', '_', $val);
+ $this->$name = $this->attrs["$val"][0];
+ }
+ }
+
+ if (strlen($this->apple_user_homeDirectory) >0) {
+ $this->apple_user_homepath_raw = substr($this->apple_user_homeDirectory, strrpos($this->apple_user_homeDirectory, '/') + 1 );
+ }
+
+ /* get share list an set default values */
+ $this->get_netatalk_shares();
+ $this->apple_user_share = $this->selectedshare;
+
+ /* Save initial account state */
+ $this->initially_was_account = $this->is_account;
+ }
+
+
+
+ /* Get netatalk shares */
+ function get_netatalk_shares()
+ {
+ /* Get netatalk shares */
+ $this->shares = array();
+ $ldap = $this->config->get_ldap_link();
+
+ if($this->dn === "new" || $this->dn === NULL) {
+ $base = session::get('CurrentMainBase');
+ } else {
+ $base = preg_replace("/^[^,]+,".normalizePreg(get_people_ou())."/","",$this->dn);
+ }
+
+ $ldap->cd($base);
+ $ldap->search ("(&(objectClass=mount)(|(mountType=url)(mountType=nfs))(cn=*))");
+
+ while ($attrs = $ldap->fetch()){
+ $tmp = split(":", $attrs["cn"][0]);
+ $host = trim($tmp[0]);
+ $dir = trim($tmp[1]);
+ $mountType = trim($attrs["mountType"][0]);
+ if ($mountType == "url") {
+ $mountTypeReal = "netatalk";
+ } else {
+ $mountTypeReal = $mountType;
+ }
+ $share = $attrs["cn"][0]. " (" . $mountTypeReal . ")";
+ $this->shares[$share] = $share;
+ $this->shares_settings[$share]["mountType"]=$mountType;
+ $this->shares_settings[$share]["dir"]=$dir;
+ $this->shares_settings[$share]["host"]=$host;
+
+ $oldShare=substr($this->apple_user_homeDirectory, 0, strrpos($this->apple_user_homeDirectory, '/'));
+ $newShare=($this->mountDirectory . "/". $host . $dir );
+ if (strcmp($oldShare, $newShare)==0) {
+ $this->selectedshare = $share;
+ }
+ }
+ asort($this->shares);
+ }
+
+
+ /* Execute the plugin, produce the output. */
+ function execute()
+ {
+ plugin :: execute();
+
+ /* Log view */
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","users/".get_class($this),$this->dn);
+ }
+
+ /* Use the smarty templating engine here... */
+ $smarty = get_smarty();
+ $display = "";
+
+ /* Do we need to flip is_account state? */
+ if (isset ($_POST['modify_state'])) {
+ $this->is_account = !$this->is_account;
+ }
+
+ /* Do we represent a valid account? */
+ if (!$this->is_account && $this->parent === NULL) {
+ $display = "<img alt=\"\"src=\"images/stop.png\" align=\"middle\"> <b>"._("This account has no netatalk extensions.")."</b>";
+
+ $display .= back_to_main();
+ return ($display);
+ }
+
+ /* Show tab dialog headers */
+ if ($this->parent !== NULL) {
+ if ($this->is_account) {
+ $display = $this->show_disable_header(_("Remove netatalk account"), _("This account has netatalk features enabled. You can disable them by clicking below."));
+ } else {
+ $errmsg="";
+ $obj = $this->parent->by_object['posixAccount'];
+ if (!($obj->is_account) ) {
+ $errmsg.="Posix features are needed for netatalk accounts, enable them first. ";
+ }
+ if (count($this->shares)== 0) {
+ $errmsg.="At least one share with netatalk or NFS mount entry needed.";
+ }
+ if($errmsg==""){
+ $display = $this->show_enable_header(_("Create netatalk account"), _("This account has netatalk features disabled. You can enable them by clicking below."));
+ } else {
+ $display = $this->show_enable_header(_("Create netatalk account"), _($errmsg), TRUE);
+ }
+ return ($display);
+ }
+ }
+
+ /* Assign attributes and ACL to smarty */
+ $SkipWrite = (!isset($this->parent) || !$this->parent) && !session::is_set('edit');
+ $smarty->assign("netatalkShareACL", $this->getacl("netatalkShare",$SkipWrite));
+ $smarty->assign("netatalkUserHomepathACL", $this->getacl("netatalkUserHomepath",$SkipWrite));
+
+ foreach ($this->smarty_attributes as $val) {
+ $smarty->assign("$val", $this-> $val);
+ if (in_array($val, $this->is_chk_box)) {
+ if ($this-> $val == "checked") {
+ $smarty->assign($val."CHK", " checked ");
+ } else {
+ $smarty->assign($val."CHK", "");
+ }
+ }
+ }
+
+ /* Let smarty fetch and process the page. */
+ $display .= ($smarty->fetch(get_template_path('netatalk.tpl', TRUE, dirname(__FILE__))));
+ return ($display);
+ }
+
+
+ /* Check if we have correct data */
+ function check() {
+ $message = array ();
+
+ if (strlen($this->apple_user_share) == 0) {
+ $message[] = _("You must select a share to use.");
+ }
+
+ return ($message);
+ }
+
+ /* Save to LDAP */
+ function save() {
+ /* remove a / at the end of the homepath, we neither need it there nor
+ * do we want to check for it later.
+ */
+ if(substr($this->apple_user_homepath_raw, -1, 1) === '/') {
+ $this->apple_user_homepath_raw=substr($this->apple_user_homepath_raw, 0, -1);
+ }
+
+ $mountType=$this->shares_settings[$this->apple_user_share]["mountType"];
+ $dir=$this->shares_settings[$this->apple_user_share]["dir"];
+ $host=$this->shares_settings[$this->apple_user_share]["host"];
+
+ /* Convert raw data to wished format */
+ if ($this->is_account) {
+ if($mountType=="url") {
+ $this->apple_user_homeurl_xml = '<home_dir><url>afp://'.$host.$dir . '</url><path>'.$this->apple_user_homepath_raw.'</path></home_dir>';
+ $this->apple_user_homeurl = base64_encode($this->apple_user_homeurl_xml);
+ } else {
+ $this->apple_user_homeurl = "";
+ }
+ $this->apple_user_homeDirectory = $this->mountDirectory . '/' . $host .$dir . '/' . $this->apple_user_homepath_raw;
+ } else {
+ $this->apple_user_homeurl = "";
+ $this->apple_user_homeDirectory = "";
+ }
+
+ $ldap = $this->config->get_ldap_link();
+
+ /* Reset array of used attributes, because plugin::save()
+ will not work with '-' in attributes names
+ after calling save restore attributes array */
+ $attributes = $this->attributes;
+ $this->attributes = array();
+ plugin :: save();
+ $this->attributes = $attributes;
+
+ /* Do attribute conversion */
+ foreach ($this->attributes as $val) {
+ $name = str_replace('-', '_', $val);
+ if ($this->$name != "") {
+ $this->attrs[$val] = $this->$name;
+ } else {
+ $this->attrs[$val] = array();
+ }
+ unset ($this->attrs[$name]);
+ }
+
+ /* Write back to ldap */
+ $ldap->cd($this->dn);
+ $this->cleanup();
+ $ldap->modify($this->attrs);
+
+ if($this->initially_was_account){
+ new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }else{
+ new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/netatalk account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ if ($this->initially_was_account == $this->is_account) {
+ if ($this->is_modified) {
+ $this->handle_post_events("modify",array("uid" => $this->uid));
+ }
+ } else {
+ $this->handle_post_events("add",array("uid" => $this->uid));
+ }
+ }
+
+ /* Use Save_object for every Post handling */
+ function save_object() {
+ if (isset ($_POST['netatalkTab'])) {
+ /* Save ldap attributes */
+ plugin :: save_object();
+
+ foreach($this->post_attributes as $val) {
+ if (isset ($_POST[$val])) {
+ $this->$val = $_POST[$val];
+ } else {
+ $this->$val = "";
+ }
+ }
+
+ /* Specialhandling for checkboxes */
+ foreach ($this->is_chk_box as $val) {
+ if (isset ($_POST[$val])) {
+ $this-> $val = "checked";
+ } else {
+ $this-> $val = "unchecked";
+ }
+ }
+
+ $this->apple_user_homeurl_raw = 'afp://' . $this->apple_user_share;
+ }
+ }
+
+ function remove_from_parent() {
+ /* Cancel if there's nothing to do here */
+ if (!$this->initially_was_account) {
+ return;
+ }
+
+ /* include global link_info */
+ $ldap = $this->config->get_ldap_link();
+
+ /* Remove and write to LDAP */
+ plugin :: remove_from_parent();
+
+ /* Adapt attributes if needed */
+ // $method= new $this->method($this->config);
+ // $method->fixAttributesOnRemove($this);
+
+ @ DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->attributes, "Save");
+ $ldap->cd($this->dn);
+ $this->cleanup();
+ $ldap->modify($this->attrs);
+
+ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/netatalk account with dn '%s' failed."),$this->dn));
+
+ /* remove the entry from LDAP */
+ unset ($this->attrs['uid']);
+
+ /* Optionally execute a command after we're done */
+ $this->handle_post_events('remove', array("uid" => $this->uid));
+ }
+
+
+ /* Return plugin informations for acl handling*/
+ static function plInfo()
+ {
+ return (array(
+ "plDescription" => _("Netatalk"),
+ "plSelfModify" => TRUE,
+ "plDepends" => array("user"),
+ "plPriority" => 6,
+ "plSection" => array("personal" => _("My account")),
+ "plCategory" => array("users"),
+ "plOptions" => array(),
+
+ "plProvidedAcls" => array(
+ "netatalkUserHomepath" => _("User home path"),
+ "netatalkShare" => _("Share"))
+ ));
+ }
+
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/netatalk/personal/netatalk/main.inc b/gosa-plugins/netatalk/personal/netatalk/main.inc
--- /dev/null
@@ -0,0 +1,118 @@
+<?php
+/*
+ This code is part of GOsa (https://gosa.gonicus.de)
+ Copyright (C) 2006 Gina Haeussge <osd@foosel.net>
+ Copyright (C) 2006 Bernd Zeimetz <bernd@zeimetz.de>
+
+ 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
+ */
+
+if (!$remove_lock) {
+ /* Reset requested? */
+ if (isset ($_POST['edit_cancel']) || (isset ($_GET['reset']) && $_GET['reset'] == 1)) {
+ del_lock($ui->dn);
+ session::un_set('edit');
+ session::un_set('netatalk');
+ }
+
+ /* Create netatalk object on demand */
+ if (!session::is_set('netatalk') || (isset ($_GET['reset']) && $_GET['reset'] == 1)) {
+ $netatalk = new netatalk($config, $ui->dn);
+ $netatalk->enable_CSN_check();
+ $netatalk->set_acl_base($ui->dn);
+ $netatalk->set_acl_category("users");
+ session::set('netatalk',$netatalk);
+ }
+ $netatalk = session::get('netatalk');
+
+ /* save changes back to object */
+ if (session::is_set('edit')) {
+ $netatalk->save_object();
+ }
+
+ /* Enter edit mode? */
+ if (isset ($_POST['edit'])) {
+
+ /* Check locking */
+ if (($username = get_lock($ui->dn)) != "") {
+ session::set('back_plugin',$plug);
+ gen_locked_message($username, $ui->dn);
+ exit ();
+ }
+
+ /* Lock the current entry */
+ add_lock($ui->dn, $ui->dn);
+ session::set('dn',$ui->dn);
+ session::set('edit',TRUE);
+ }
+
+ /* save changes to LDAP and disable edit mode */
+ if (isset ($_POST['edit_finish'])) {
+
+ /* Perform checks */
+ $message = $netatalk->check();
+
+ /* No errors, save object */
+ if (count($message) == 0) {
+ $netatalk->save();
+ del_lock($ui->dn);
+ session::un_set('edit');
+
+ /* Remove object */
+ session::un_set('netatalk');
+ } else {
+ /* Errors found, show message */
+ show_errors($message);
+ }
+ }
+
+ /* Execute formular */
+ $display = $netatalk->execute();
+
+ /* Store changes in session */
+ if (session::is_set('edit')) {
+ session::set('netatalk',$netatalk);
+ }
+
+ $info = "";
+ /* Show page footer depending on the mode */
+ if ($netatalk->is_account) {
+ $display .= "<p class=\"plugbottom\">";
+
+ /* Are we in edit mode? */
+ if (session::is_set('edit')) {
+ $display .= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
+ $display .= " ";
+ $display .= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
+ $info = "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/closedlock.png')."\"> ".$ui->dn." ";
+ } else {
+ $info = "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png')."\"> ".$ui->dn." ";
+ if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/netatalk"))){
+ $info .= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\"> "._("Click the 'Edit' button below to change informations in this dialog");
+ $display .= "<input type=submit name=\"edit\" value=\""._("Edit")."\">\n";
+ }
+
+ $display .= "<input type=\"hidden\" name=\"ignore\">\n";
+ }
+ $display .= "</p>\n";
+ }
+
+ /* Page header*/
+ $display = print_header(get_template_path('images/netatalk.png'), _("Netatalk settings"), $info).$display;
+
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/netatalk/personal/netatalk/netatalk.tpl b/gosa-plugins/netatalk/personal/netatalk/netatalk.tpl
--- /dev/null
@@ -0,0 +1,33 @@
+<table summary="">
+<tr>
+ <td>
+ <label for="apple_user_share">{t}Share{/t}</label>
+ </td>
+ <td>
+
+{render acl=$netatalkShareACL}
+ <select name="apple_user_share" id="apple_user_share">
+ {html_options options=$shares selected=$selectedshare}
+ </select>
+{/render}
+ </td>
+<tr>
+ <td>
+ <label for="apple_user_homepath_raw">{t}Path{/t}</label>
+ </td>
+ <td>
+{render acl=$netatalkUserHomepathACL}
+ <input name="apple_user_homepath_raw" id="apple_user_homepath_raw" type="text" value="{$apple_user_homepath_raw}" size="25" maxlength="65"/>
+{/render}
+ </td>
+</tr>
+</table>
+
+<input type="hidden" name="netatalkTab" value="netatalkTab">
+
+<!-- Place cursor -->
+<script language="JavaScript" type="text/javascript">
+ <!-- // First input field on page
+ focus_field('apple_user_homeurl_raw');
+ -->
+</script>
diff --git a/gosa-plugins/scalix/scalix/class_scalixAccount.inc b/gosa-plugins/scalix/scalix/class_scalixAccount.inc
--- /dev/null
@@ -0,0 +1,538 @@
+<?php
+/*! \brief scalix plugin
+ \author Jörn Dreyer <gosa.jfd@butonic.de>,
+ based on work by Cajus Pollmeier <pollmeier@gonicus.de>
+ \version 0.01
+ \date 20.10.2006
+
+ This class provides the functionality to read and write all attributes
+ relevant for scalixAccounts from/to the LDAP. It does syntax checking
+ and displays the formulars required.
+ */
+
+class scalixAccount extends plugin
+{
+ /* Definitions */
+ var $plHeadline = "Scalix";
+ var $plDescription= "This does something";
+
+ /* plugin specific values - scalixUserClass */
+ /* MUST */
+ var $scalixScalixObject= TRUE; //TRUE or FALSE
+ var $scalixMailnode= "";
+ /* INDIRECT MUST, scalix will complain if no email was specified */
+
+ /* MAY */
+ var $scalixAdministrator= FALSE;
+ var $scalixMailboxAdministrator = FALSE;
+ var $scalixServerLanguage= "";
+ var $scalixEmailAddress= array();
+ var $scalixLimitMailboxSize= "";
+ var $scalixLimitOutboundMail= FALSE;
+ var $scalixLimitInboundMail= FALSE;
+ var $scalixLimitNotifyUser= FALSE;
+ var $scalixHideUserEntry= FALSE;
+ var $scalixMailboxClass= "";
+
+ var $uid ="";
+ var $default_permissions= "none";
+ var $member_permissions= "post";
+ var $members= array();
+ var $admins= array();
+ var $vacations= array();
+ var $perms= array( "lrs" => "read",
+ "lrsp" => "post",
+ "lrsip" => "append",
+ "lrswipcd" => "write",
+ "lrswipcda" => "all" );
+
+ /* attribute list for save action */
+ var $attributes = array("scalixMailnode", "scalixServerLanguage", "scalixLimitMailboxSize", "scalixMailboxClass");
+ var $fakeBooleanAttributes= array("scalixAdministrator", "scalixMailboxAdministrator", "scalixLimitOutboundMail",
+ "scalixLimitInboundMail", "scalixLimitNotifyUser", "scalixHideUserEntry");
+ var $objectclasses = array("scalixUserClass");
+
+
+ /* constructor, if 'dn' is set, the node loads the given
+ 'dn' from LDAP */
+ function scalixAccount (&$config, $dn= NULL)
+ {
+ /* dn shouldn't be NULL */
+ if($dn === NULL){
+ trigger_error("Initialising scalixAccount without valid dn.");
+ }
+
+ /* Load bases attributes */
+ plugin::plugin($config, $dn);
+
+ /* Load attributes */
+ if ($dn != "new"){
+
+ /* Set user id */
+ if(isset($this->attrs['uid'][0])){
+ $this->uid = $this->attrs['uid'][0];
+ }
+
+ foreach ($this->fakeBooleanAttributes as $val){
+ if (isset($this->attrs["$val"][0])&&$this->attrs["$val"][0]=="TRUE"){
+ $this->$val = TRUE;
+ } else {
+ $this->$val = FALSE;
+ }
+ }
+
+ /* Load attributes containing arrays */
+ foreach (array("scalixEmailAddress") as $val){
+ if (isset($this->attrs["$val"]["count"])){
+ for ($i= 0; $i<$this->attrs["$val"]["count"]; $i++){
+ array_push($this->$val, $this->attrs["$val"][$i]);
+ }
+ }
+ }
+ }
+
+ /* Save initial account state */
+ $this->initially_was_account= $this->is_account;
+ }
+
+
+ function execute()
+ {
+ /* Call parent execute */
+ plugin::execute();
+
+ /* Load templating engine */
+ $smarty= get_smarty();
+ $display= "";
+
+ /* Do we need to flip is_account state? */
+ if (isset($_POST['modify_state'])){
+ $this->is_account= !$this->is_account;
+ }
+
+ /* Show main page */
+ $mailboxClasses = array("", "LIMITED", "FULL");
+ $serverLanguages= array("", "GERMAN", "ENGLISH");
+
+ /* Do we represent a valid account? */
+ if (!$this->is_account && $this->parent === NULL){
+ $display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\"> <b>".
+ _("This account has no scalix extensions.")."</b>";
+
+ $display.= back_to_main();
+ return ($display);
+ }
+
+ /* Show tab dialog headers */
+ if ($this->parent !== NULL){
+ if ($this->is_account){
+ $display= $this->show_disable_header(_("Remove scalix account"),
+ _("This account has scalix synchronization enabled. You can disable it by clicking below."));
+ } else {
+ $display= $this->show_enable_header(_("Create scalix account"), _("This account has scalix synchronization disabled. You can enable it by clicking below."));
+ return ($display);
+ }
+ }
+
+ /* Trigger forward add dialog? */
+ if (isset($_POST['add_local_forwarder'])){
+ $this->forward_dialog= TRUE;
+ $this->dialog= TRUE;
+ }
+
+ /* Cancel forward add dialog? */
+ if (isset($_POST['add_locals_cancel'])){
+ $this->forward_dialog= FALSE;
+ $this->dialog= FALSE;
+ }
+
+
+ $smarty->assign("mailboxClasses", $mailboxClasses);
+ $smarty->assign("serverLanguages", $serverLanguages);
+ foreach(array("perms", "scalixScalixObject", "scalixMailnode", "scalixAdministrator", "scalixMailboxAdministrator",
+ "scalixServerLanguage", "scalixLimitMailboxSize", "scalixLimitOutboundMail", "scalixEmailAddress",
+ "scalixLimitInboundMail", "scalixLimitNotifyUser", "scalixHideUserEntry", "scalixMailboxClass") as $val){
+
+ $smarty->assign("$val", $this->$val);
+ $smarty->assign("$val"."ACL", $this->getacl($val));
+ }
+
+ /* Fill checkboxes */
+ if ($this->scalixAdministrator) {
+ $smarty->assign("scalixAdministrator", "checked");
+ } else {
+ $smarty->assign("scalixAdministrator", "");
+ }
+ if ($this->scalixMailboxAdministrator) {
+ $smarty->assign("scalixMailboxAdministrator", "checked");
+ } else {
+ $smarty->assign("scalixMailboxAdministrator", "");
+ }
+ if ($this->scalixLimitOutboundMail) {
+ $smarty->assign("scalixLimitOutboundMail", "checked");
+ } else {
+ $smarty->assign("scalixLimitOutboundMail", "");
+ }
+ if ($this->scalixLimitInboundMail) {
+ $smarty->assign("scalixLimitInboundMail", "checked");
+ } else {
+ $smarty->assign("scalixLimitInboundMail", "");
+ }
+ if ($this->scalixLimitNotifyUser) {
+ $smarty->assign("scalixLimitNotifyUser", "checked");
+ } else {
+ $smarty->assign("scalixLimitNotifyUser", "");
+ }
+ if ($this->scalixHideUserEntry) {
+ $smarty->assign("scalixHideUserEntry", "checked");
+ } else {
+ $smarty->assign("scalixHideUserEntry", "");
+ }
+
+ $display.= $smarty->fetch (get_template_path('generic.tpl', TRUE, dirname(__FILE__)));
+ return ($display);
+ }
+
+
+ /* remove object from parent */
+ function remove_from_parent()
+ {
+ /* Cancel if there's nothing to do here */
+ if (!$this->initially_was_account){
+ return;
+ }
+
+ /* include global link_info */
+ $ldap= $this->config->get_ldap_link();
+
+ /* Remove and write to LDAP */
+ plugin::remove_from_parent();
+
+ /* Zero arrays */
+ $this->attrs['scalixEmailAddress']= array();
+
+ /* Unset fake boolean attributes from entry */
+ foreach ($this->fakeBooleanAttributes as $val){
+ $this->attrs["$val"]= array();
+ }
+
+ /*unset scalixScalixObject*/
+ $this->attrs['scalixScalixObject']=array();
+
+ @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,$this->attributes, "Save");
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ show_ldap_error($ldap->get_error());
+
+ /* Optionally execute a command after we're done */
+ $this->handle_post_events("remove");
+ }
+
+
+ /* Save data to object */
+ function save_object()
+ {
+ if (isset($_POST['scalixTab'])){
+
+ /* Save ldap attributes */
+ plugin::save_object();
+
+ /* Check if given value is not empty */
+ if ($_POST['email_address'] != ""){
+ $valid= FALSE;
+
+ /* Valid mail address */
+ if( ($this->is_template && !tests::is_email($_POST['email_address'], TRUE)) ||
+ (!$this->is_template && !tests::is_email($_POST['email_address'])) ){
+ msg_dialog::display(_("Error"), _("Cannot add invalid mail address!"), ERROR_DIALOG);
+ }else{
+ $valid = TRUE;
+ }
+
+ /* Check write access */
+ if(!$this->acl_is_writeable("scalixEmailAddress")){
+ msg_dialog::display(_("Error"), _("You have no permission to modify these addresses."), ERROR_DIALOG);
+ }else{
+
+ /* Mail address already in use ? */
+ if ($valid && ($user= $this->addEmail ($_POST['email_address'])) != ""){
+ $ui= get_userinfo();
+ if ($user != $ui->username){
+ msg_dialog::display(_("Error"), sprintf(_("Cannot add mail address: it is already used by user '%s'."), $user),
+ ERROR_DIALOG);
+ }
+ }
+ }
+ }
+
+ /* Delete email addresses */
+ if (isset($_POST['delete_email']) && isset ($_POST['emails_list'])){
+ if(!$this->acl_is_writeable("scalixEmailAddress")){
+ msg_dialog::display(_("Error"), _("You have no permission to modify these addresses."), ERROR_DIALOG);
+ }else{
+ if (count($_POST['emails_list'])){
+ $this->delEmail ($_POST['emails_list']);
+ }
+ }
+ }
+
+ /* Save fakeBooleanAttributes*/
+ foreach ($this->fakeBooleanAttributes as $val){
+ if ($this->acl_is_writeable($val)) {
+ if( isset ($_POST["$val"])) {
+ $data = TRUE;
+ } else {
+ $data = FALSE;
+ }
+ if ($this->$val != $data){
+ $this->is_modified= TRUE;
+ }
+
+ $this->$val= $data;
+ }
+ }
+ }
+ }
+
+
+ /* Save data to LDAP, depending on is_account we save or delete */
+ function save()
+ {
+ $ldap= $this->config->get_ldap_link();
+
+ /* Call parents save to prepare $this->attrs */
+ plugin::save();
+
+ /* Save arrays */
+ $this->attrs['scalixEmailAddress']= $this->scalixEmailAddress;
+
+ /* Save boolean vars ... the scalix schema expects them as strings */
+ $this->attrs['scalixScalixObject'] = $this->scalixScalixObject?"TRUE":"FALSE";
+ $this->attrs['scalixAdministrator'] = $this->scalixAdministrator?"TRUE":"FALSE";
+ $this->attrs['scalixMailboxAdministrator'] = $this->scalixMailboxAdministrator?"TRUE":"FALSE";
+ $this->attrs['scalixLimitOutboundMail'] = $this->scalixLimitOutboundMail?"TRUE":"FALSE";
+ $this->attrs['scalixLimitInboundMail'] = $this->scalixLimitInboundMail?"TRUE":"FALSE";
+ $this->attrs['scalixLimitNotifyUser'] = $this->scalixLimitNotifyUser?"TRUE":"FALSE";
+ $this->attrs['scalixHideUserEntry'] = $this->scalixHideUserEntry?"TRUE":"FALSE";
+
+ /* Remove Mailquota if = "" */
+ if((isset($this->attrs['scalixLimitMailboxSize']))&&($this->attrs['scalixLimitMailboxSize']=="")) {
+ $this->attrs['scalixLimitMailboxSize']=array();
+ }
+
+ /* Save data to LDAP */
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ show_ldap_error($ldap->get_error());
+
+ /* Optionally execute a command after we're done */
+ if ($this->initially_was_account == $this->is_account){
+ if ($this->is_modified){
+ $this->handle_post_events("modify");
+ }
+ } else {
+ $this->handle_post_events("add");
+ }
+
+ }
+
+ /* Check formular input */
+ function check()
+ {
+ $ldap= $this->config->get_ldap_link();
+
+ $message= array();
+
+ if(empty($this->scalixMailnode)){
+ $message[]= _("There is no scalix mailnode specified.");
+ }
+ if(empty($this->scalixScalixObject)){
+ $message[]= _("scalixScalixObject must be set!");
+ }
+
+ $ldap->cd($this->config->current['BASE']);
+ foreach($this->scalixEmailAddress as $k => $mail) {
+ $ldap->search ("(&(!(objectClass=gosaUserTemplate))(objectClass=scalixUserClass)(scalixEmailAddress=".
+ $mail.")(!(uid=".$this->uid."))(!(cn=".$this->uid.")))", array("uid"));
+
+ if ($ldap->count() != 0){
+ $message[]= _("The email address '$mail' you've entered is already in use.");
+ }
+ }
+
+ /* Check quota */
+ if ($this->scalixLimitMailboxSize != '' && $this->acl_is_writeable("scalixLimitMailboxSize")){
+ if (!is_numeric($this->scalixLimitMailboxSize)) {
+ $message[]= _("Value in 'Limit Mailbox size' is not valid.");
+ } else {
+ $this->scalixLimitMailboxSize= (int) $this->scalixLimitMailboxSize;
+ }
+ }
+
+ return ($message);
+ }
+
+ /* Adapt from template, using 'dn' */
+ function adapt_from_template($dn)
+ {
+ plugin::adapt_from_template($dn);
+
+ foreach (array("scalixEmailAddress") as $val){
+ $this->$val= array();
+ if (isset($this->attrs["$val"]["count"])){
+ for ($i= 0; $i<$this->attrs["$val"]["count"]; $i++){
+ $value= $this->attrs["$val"][$i];
+ foreach (array("sn", "givenName", "uid") as $repl){
+ if (preg_match("/%$repl/i", $value)){
+ $value= preg_replace ("/%$repl/i", $this->parent->$repl, $value);
+ }
+ }
+ array_push($this->$val, strtolower(rewrite($value)));
+ }
+ }
+ }
+ $this->mail= strtolower(rewrite($this->mail));
+ }
+
+ function addEmail($address)
+ {
+ $ldap= $this->config->get_ldap_link();
+
+ $address= strtolower($address);
+
+ /* Is this address already assigned in LDAP? */
+ $ldap->cd ($this->config->current['BASE']);
+ $ldap->search ("(&(objectClass=scalixUserClass)(|(scalixEmailAddress=$address)".
+ "(scalixEmailAddress=$address)))", array("uid"));
+
+ if ($ldap->count() > 0){
+ $attrs= $ldap->fetch ();
+ return ($attrs["uid"][0]);
+ }
+
+ /* Add to list of alternates */
+ if (!in_array($address, $this->scalixEmailAddress)){
+ $this->scalixEmailAddress[]= $address;
+ $this->is_modified= TRUE;
+ }
+
+ //sort ($this->scalixEmailAddress); //scalix makes the first email the destination, all others can receive
+ reset ($this->scalixEmailAddress);
+
+ return ("");
+ }
+
+
+ function delEmail($addresses)
+ {
+ $this->scalixEmailAddress= array_remove_entries ($addresses, $this->scalixEmailAddress);
+ $this->is_modified= TRUE;
+ }
+
+
+ static function plInfo()
+ {
+ return (array(
+ "plDescription" => _("Scalix account"),
+ "plSelfModify" => TRUE,
+ "plDepends" => array("user"),
+ "plPriority" => 2,
+ "plSection" => array("personal" => _("My account")),
+ "plCategory" => array("users"),
+ "plOptions" => array(),
+
+ "plProvidedAcls" => array(
+
+ "scalixMailnode" => _("Scalix Mail node"),
+ "scalixMailboxClass" => _("Mailbox class"),
+ "scalixServerLanguage" => _("Server language"),
+ "scalixAdministrator" => _("Administrator"),
+ "scalixMailboxAdministrator"=> _("Mailbox administrator"),
+ "scalixHideUserEntry" => _("Hide user entry in Scalix"),
+ "scalixLimitMailboxSize" => _("Mailbox size limitations"),
+ "scalixLimitOutboundMail" => _("Limit outbound"),
+ "scalixLimitInboundMail" => _("Limit inbound"),
+ "scalixLimitNotifyUser" => _("Notify user"),
+ "scalixEmailAddress" => _("Scalix email addresses"))
+
+ ));
+ }
+
+
+ function saveCopyDialog()
+ {
+ if (isset($_POST['scalixTab'])){
+
+ /* Add email addresses */
+ if (isset($_POST['add_email'])){
+
+ /* Check if given value is not empty */
+ if ($_POST['email_address'] != ""){
+ $valid= FALSE;
+
+ /* Valid mail address */
+ if( ($this->is_template && !tests::is_email($_POST['email_address'], TRUE)) ||
+ (!$this->is_template && !tests::is_email($_POST['email_address'])) ){
+ msg_dialog::display(_("Error"), _("Cannot add invalid mail address!"), ERROR_DIALOG);
+ }else{
+ $valid = TRUE;
+ }
+
+ /* Mail address already in use ? */
+ if ($valid && ($user= $this->addEmail ($_POST['email_address'])) != ""){
+ $ui= get_userinfo();
+ if ($user != $ui->username){
+ msg_dialog::display(_("Error"), sprintf(_("Cannot add mail address: it is already used by user '%s'."), $user), ERROR_DIALOG);
+ }
+ }
+ }
+ }
+
+ /* Delete email addresses */
+ if (isset($_POST['delete_email']) && isset ($_POST['emails_list'])){
+ if (count($_POST['emails_list'])){
+ $this->delEmail ($_POST['emails_list']);
+ }
+ }
+ }
+ }
+
+
+ function PrepareForCopyPaste($source)
+ {
+ plugin::PrepareForCopyPaste($source);
+ foreach ($this->fakeBooleanAttributes as $val){
+ if (isset($source["$val"][0])&&$source["$val"][0]=="TRUE"){
+ $this->$val = TRUE;
+ } else {
+ $this->$val = FALSE;
+ }
+ }
+
+ /* Load attributes containing arrays */
+ foreach (array("scalixEmailAddress") as $val){
+ if (isset($source["$val"]["count"])){
+ for ($i= 0; $i<$source["$val"]["count"]; $i++){
+ array_push($this->$val, $source["$val"][$i]);
+ }
+ }
+ }
+ }
+
+
+ /* Create the posix dialog part for copy & paste */
+ function getCopyDialog()
+ {
+ $smarty = get_smarty();
+ $smarty->assign("scalixEmailAddress",$this->scalixEmailAddress);
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__)));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+
+ }
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler
+?>
diff --git a/gosa-plugins/scalix/scalix/generic.tpl b/gosa-plugins/scalix/scalix/generic.tpl
--- /dev/null
@@ -0,0 +1,127 @@
+<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding="0" border="0">
+ <tr>
+ <td style="width:50%; vertical-align:top;">
+ <h2><img class="center" alt="" align="middle" src="images/rightarrow.png" /> {t}Generic{/t}</h2>
+ <table summary="">
+ <tr>
+ <td><label for="scalixMailnode">{t}Scalix mailnode{/t}</label>{$must}</td>
+ <td>
+{render acl=$scalixMailnodeACL}
+ <input id="scalixMailnode" name="scalixMailnode" size=35 maxlength=65 value="{$scalixMailnode}">
+{/render}
+ </td>
+ </tr>
+ <tr>
+ <td><label for="scalixMailboxClass">{t}Salix mailbox class{/t}</label></td>
+ <td>
+{render acl=$scalixMailboxClassACL}
+ <select size="1" id="scalixMailboxClass" name="scalixMailboxClass"
+ title="{t}Limited users con not make use of the group calendar functionality in Scalix{/t}">
+ {html_options values=$mailboxClasses output=$mailboxClasses selected=$scalixMailboxClass}
+ </select>
+{/render}
+ </td>
+ </tr>
+ <tr>
+ <td><label for="scalixServerLanguage">{t}Scalix server language{/t}</label></td>
+ <td>
+{render acl=$scalixServerLanguageACL}
+ <select size="1" id="scalixServerLanguage" name="scalixServerLanguage"
+ title="{t}Message catalog language for client.{/t}">
+ {html_options values=$serverLanguages output=$serverLanguages selected=$scalixServerLanguage}
+ </select>
+{/render}
+ </td>
+ </tr>
+ </table>
+
+ <p class="seperator"> </p>
+
+ <table summary="">
+ <tr>
+ <td>
+{render acl=$scalixAdministratorACL}
+ <input type=checkbox name="scalixAdministrator" value="1" {$scalixAdministrator}
+ title="{t}Select for admin capability.{/t}"> {t}Scalix Administrator{/t}
+{/render}
+ <br>
+{render acl=$scalixMailboxAdministratorACL}
+ <input type=checkbox name="scalixMailboxAdministrator" value="1" {$scalixMailboxAdministrator}
+ title="{t}Select for mailbox admin capability.{/t}"> {t}Scalix Mailbox Administrator{/t}
+{/render}
+ <br>
+{render acl=$scalixHideUserEntryACL}
+ <input type=checkbox name="scalixHideUserEntry" value="1" {$scalixHideUserEntry}
+ title="{t}Hide user entry from addressbook.{/t}"> {t}Hide this user entry in Scalix{/t}
+{/render}
+ <br>
+ </table>
+
+ <p class="seperator"> </p>
+
+ <table summary="">
+ <tr>
+ <td><label for="scalixLimitMailboxSize">{t}Limit mailbox size{/t}</label></td>
+ <td>
+{render acl=$scalixLimitMailboxSizeACL}
+ <input id="scalixLimitMailboxSize" name="scalixLimitMailboxSize" size=5 maxlength=10 value="{$scalixLimitMailboxSize}"> {t}MB{/t}
+{/render}
+ </td>
+ </tr>
+ <tr>
+ <td >
+{render acl=$scalixLimitOutboundMailACL}
+ <input type=checkbox name="scalixLimitOutboundMail" value="1" {$scalixLimitOutboundMail}
+ title="{t}As sanction on mailbox quota overuse, stop user from sending mail.{/t}"> {t}Limit Outbound Mail{/t}
+{/render}
+ <br>
+{render acl=$scalixLimitInboundMailACL}
+ <input type=checkbox name="scalixLimitInboundMail" value="1" {$scalixLimitInboundMail}
+ title="{t}As sanction on mailbox quota overuse, stop user from receiving mail.{/t}"> {t}Limit Inbound Mail{/t}
+{/render}
+ <br>
+{render acl=$scalixLimitNotifyUserACL}
+ <input type=checkbox name="scalixLimitNotifyUser" value="1" {$scalixLimitNotifyUser}
+ title="{t}As sanction on mailbox quota overuse, notify the user by eMail.{/t}"> {t}Notify User{/t}
+{/render}
+ <br>
+ </td>
+ </tr>
+ </table>
+ </td>
+
+ <td style="border-left:1px solid #A0A0A0">
+
+ </td>
+
+ <td style="vertical-align:top;">
+ <h2><img class="center" alt="" align="middle" src="images/envelope.png" /><label for="emails_list"> {t}Scalix email addresses{/t}</label></h2>
+{render acl=$scalixEmailAddressACL}
+ <select id="emails_list" style="width:100%;height:100px;" name="emails_list[]" size="15"
+ multiple title="{t}List of scalix email addresses{/t}" >
+ {html_options values=$scalixEmailAddress output=$scalixEmailAddress}
+ <option disabled> </option>
+ </select>
+{/render}
+ <br />
+{render acl=$scalixEmailAddressACL}
+ <input name="email_address" size="30" align="middle" maxlength="65" value="">
+{/render}
+{render acl=$scalixEmailAddressACL}
+ <input type=submit value="{t}Add{/t}" name="add_email">
+{/render}
+{render acl=$scalixEmailAddressACL}
+ <input type=submit value="{t}Delete{/t}" name="delete_email">
+{/render}
+ </td>
+ </tr>
+</table>
+
+<input type="hidden" name="scalixTab" value="scalixTab">
+
+<!-- Place cursor -->
+<script language="JavaScript" type="text/javascript">
+ <!-- // First input field on page
+ focus_field('scalixMailnode');
+ -->
+</script>
diff --git a/gosa-plugins/scalix/scalix/main.inc b/gosa-plugins/scalix/scalix/main.inc
--- /dev/null
@@ -0,0 +1,130 @@
+<?php
+/*
+ This code is part of GOsa (https://gosa.gonicus.de)
+ Copyright (C) 2006 Jörn Dreyer, based on work by
+ 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
+ */
+
+if (!$remove_lock){
+ /* Reset requested? */
+ if (isset($_POST['edit_cancel']) ||
+ (isset($_GET['reset']) && $_GET['reset'] == 1)){
+ del_lock ($ui->dn);
+ session::un_set ('edit');
+ session::un_set ('scalixAccount');
+ }
+
+ /* Create mail object on demand */
+ if (!session::is_set('scalixAccount') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
+ $scalixAccount= new scalixAccount ($config, $ui->dn);
+ $scalixAccount->enable_CSN_check();
+ $scalixAccount->set_acl_base($ui->dn);
+ $scalixAccount->set_acl_category("users");
+ session::set('scalixAccount',$scalixAccount);
+ }
+ $scalixAccount = session::get('scalixAccount');
+
+ /* save changes back to object */
+ if (session::is_set('edit')){
+ $scalixAccount->save_object ();
+ }
+
+ /* Enter edit mode? */
+ if (isset($_POST['edit'])){
+
+ /* Check locking */
+ if (($username= get_lock($ui->dn)) != ""){
+ session::set('back_plugin',$plug);
+ session::set('LOCK_VARS_TO_USE',array("/^edit$/","/^plug$/"));
+ $lock_msg = gen_locked_message ($username, $ui->dn);
+
+ }else{
+
+ /* Lock the current entry */
+ add_lock ($ui->dn, $ui->dn);
+ session::set('dn',$ui->dn);
+ session::set('edit',TRUE);
+ }
+ }
+
+ /* save changes to LDAP and disable edit mode */
+ if (isset($_POST['edit_finish'])){
+
+ /* Perform checks */
+ $message= $scalixAccount->check ();
+
+ /* No errors, save object */
+ if (count ($message) == 0){
+ $scalixAccount->save ();
+ gosa_log ("User/scalix object'".$ui->dn."' has been saved");
+ $scalixAccount->acl= "#none#";
+ del_lock ($ui->dn);
+ session::un_set ('edit');
+
+ /* Remove object */
+ session::un_set ('scalixAccount');
+ } else {
+ /* Errors found, show message */
+ show_errors ($message);
+ }
+ }
+
+ /* Execute formular */
+ $display= $scalixAccount->execute ();
+
+ /* Store changes in session */
+ if (session::is_set('edit')){
+ session::set('scalixAccount',$scalixAccount);
+ }
+
+ /* Show page footer depending on the mode */
+ if ($scalixAccount->is_account){
+
+ $display.= "<p class=\"plugbottom\">";
+
+ /* Are we in edit mode? */
+ if (session::is_set('edit')){
+ $display.= "<input type=submit name=\"edit_finish\" value=\""._("Save")."\">\n";
+ $display.= " ";
+ $display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
+ $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/closedlock.png').
+ "\"> ".$ui->dn." ";
+ } else {
+ $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png').
+ "\"> ".$ui->dn." ";
+
+ if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/scalix"))){
+ $info.= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\"> ".
+ _("Click the 'Edit' button below to change informations in this dialog");
+
+ $display.= "<input type=submit name=\"edit\" value=\""._("Edit")."\">\n";
+ }
+ $display.= "<input type=\"hidden\" name=\"ignore\">\n";
+ }
+ $display.= "</p>\n";
+ }
+
+
+ $info= "";
+
+ /* Page header*/
+ $display= print_header(get_template_path('images/scalix.png'), _("Scalix settings"), $info).$display;
+
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/scalix/scalix/paste_generic.tpl b/gosa-plugins/scalix/scalix/paste_generic.tpl
--- /dev/null
@@ -0,0 +1,25 @@
+<table>
+ <tr>
+ <td style="vertical-align:top;">
+ <h2><img class="center" alt="" align="middle" src="images/envelope.png" /><label for="emails_list"> {t}Scalix email addresses{/t}</label></h2>
+ <select id="emails_list" style="width:100%;height:100px;" name="emails_list[]" size="15"
+ multiple title="{t}List of scalix email addresses{/t}" >
+ {html_options values=$scalixEmailAddress output=$scalixEmailAddress}
+ <option disabled> </option>
+ </select>
+ <br />
+ <input name="email_address" size="30" align="middle" maxlength="65" value="">
+ <input type=submit value="{t}Add{/t}" name="add_email">
+ <input type=submit value="{t}Delete{/t}" name="delete_email">
+ </td>
+ </tr>
+</table>
+
+<input type="hidden" name="scalixTab" value="scalixTab">
+
+<!-- Place cursor -->
+<script language="JavaScript" type="text/javascript">
+ <!-- // First input field on page
+ document.mainform.scalixMailnode.focus();
+ -->
+</script>