Commit ee85497e authored by Mortier Benoit's avatar Mortier Benoit
Browse files

Merge branch '1.0.14-fixes'

parents 9577d903 e402294e
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: FusionDirectory-110\n"
"Report-Msgid-Bugs-To: bugs@fusiondirectory.org\n"
"POT-Creation-Date: 2016-07-06 14:01+0200\n"
"POT-Creation-Date: 2016-08-11 21:08+0200\n"
"PO-Revision-Date: 2016-01-22 16:04+0000\n"
"Last-Translator: fusiondirectory <contact@fusiondirectory.org>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/fusiondirectory/FusionDirectory-110/language/pt_BR/)\n"
......
......@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: FusionDirectory-110\n"
"Report-Msgid-Bugs-To: bugs@fusiondirectory.org\n"
"POT-Creation-Date: 2016-07-06 14:01+0200\n"
"POT-Creation-Date: 2016-08-11 21:08+0200\n"
"PO-Revision-Date: 2016-04-08 19:09+0000\n"
"Last-Translator: Alexey Matveev\n"
"Language-Team: Russian (http://www.transifex.com/fusiondirectory/FusionDirectory-110/language/ru/)\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: FusionDirectory-110\n"
"Report-Msgid-Bugs-To: bugs@fusiondirectory.org\n"
"POT-Creation-Date: 2016-07-06 14:01+0200\n"
"POT-Creation-Date: 2016-08-11 21:08+0200\n"
"PO-Revision-Date: 2016-01-22 15:30+0000\n"
"Last-Translator: FusionDirectory project <contact@fusiondirectory.org>\n"
"Language-Team: Russian Petrine orthography (http://www.transifex.com/fusiondirectory/FusionDirectory-110/language/ru@petr1708/)\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: FusionDirectory-110\n"
"Report-Msgid-Bugs-To: bugs@fusiondirectory.org\n"
"POT-Creation-Date: 2016-07-06 14:01+0200\n"
"POT-Creation-Date: 2016-08-11 21:08+0200\n"
"PO-Revision-Date: 2016-01-22 16:06+0000\n"
"Last-Translator: fusiondirectory <contact@fusiondirectory.org>\n"
"Language-Team: Swedish (http://www.transifex.com/fusiondirectory/FusionDirectory-110/language/sv/)\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: FusionDirectory-110\n"
"Report-Msgid-Bugs-To: bugs@fusiondirectory.org\n"
"POT-Creation-Date: 2016-07-06 14:01+0200\n"
"POT-Creation-Date: 2016-08-11 21:08+0200\n"
"PO-Revision-Date: 2016-01-22 15:30+0000\n"
"Last-Translator: FusionDirectory project <contact@fusiondirectory.org>\n"
"Language-Team: Uighur (http://www.transifex.com/fusiondirectory/FusionDirectory-110/language/ug/)\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: FusionDirectory-110\n"
"Report-Msgid-Bugs-To: bugs@fusiondirectory.org\n"
"POT-Creation-Date: 2016-07-06 14:01+0200\n"
"POT-Creation-Date: 2016-08-11 21:08+0200\n"
"PO-Revision-Date: 2016-01-22 16:05+0000\n"
"Last-Translator: fusiondirectory <contact@fusiondirectory.org>\n"
"Language-Team: Vietnamese (Viet Nam) (http://www.transifex.com/fusiondirectory/FusionDirectory-110/language/vi_VN/)\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: FusionDirectory-110\n"
"Report-Msgid-Bugs-To: bugs@fusiondirectory.org\n"
"POT-Creation-Date: 2016-07-06 14:01+0200\n"
"POT-Creation-Date: 2016-08-11 21:08+0200\n"
"PO-Revision-Date: 2016-01-22 16:05+0000\n"
"Last-Translator: fusiondirectory <contact@fusiondirectory.org>\n"
"Language-Team: Chinese (http://www.transifex.com/fusiondirectory/FusionDirectory-110/language/zh/)\n"
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier
Copyright (C) 2011-2016 FusionDirectory
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
class serviceApache extends simpleService
{
var $objectclasses = array('whatever');
function __construct ($dn = NULL, $parent = NULL)
{
global $config;
parent::__construct ($dn, $parent, array());
if (($dn != 'new') && ($dn != NULL)) {
$dn_without_base = preg_replace("/,".preg_quote($config->current['BASE'], '/')."$/", "", $this->dn);
$this->vhostList = new serviceApacheVhostManagement($dn_without_base);
/* If there is at least one entry in this -> types, we have apache vhosts enabled */
if ($this->vhostList->count() == 0) {
$this->is_account = FALSE;
} else {
$this->is_account = TRUE;
}
} else {
$this->is_account = FALSE;
}
$this->initially_was_account = $this->is_account;
}
function execute()
{
if (isset($_POST['SaveVhostChanges'])) {
$_POST['edit_finish'] = $_POST['SaveVhostChanges']; // So that the management execute save the entry
}
if (isset($_POST['CancelVhostChanges'])) {
$_POST['edit_cancel'] = $_POST['CancelVhostChanges']; // So that the management execute cancel the entry
}
if (isset($_POST['vhost_delete_confirmed'])) {
$_POST['delete_confirmed'] = $_POST['vhost_delete_confirmed']; // So that the management execute delete the entry
}
if (isset($_POST['vhost_delete_canceled'])) {
$_POST['delete_canceled'] = $_POST['vhost_delete_canceled'];
}
return $this->vhostList->execute();
}
function save()
{
}
/* \brief Return plugin information used by the ACL handling.
@return Array ACL infos.
*/
static function plInfo()
{
return array(
"plShortName" => _("Apache service"),
"plDescription" => _("Apache virtual host service")." ("._("Services").")",
"plIcon" => "geticon.php?context=applications&icon=apache&size=16",
"plProvidedAcls" => array(
"VirtualHost" => _("Virtual hosts")
)
);
}
}
?>
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier
Copyright (C) 2011-2016 FusionDirectory
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* Composite attributes that returns an empty value when all fields are empty */
class CompositeScriptAliasAttribute extends CompositeAttribute
{
function writeValues($values)
{
if (($values[0] == "") && ($values[1] == "")) {
return "";
} else {
return parent::writeValues($values);
}
}
}
class serviceApacheVhostEdit extends simplePlugin
{
var $displayHeader = FALSE;
var $mainTab = TRUE;
var $objectclasses = array("apacheConfig");
var $cn = "";
/*!
* \brief Plugin information
*/
static function plInfo ()
{
return array(
'plHeadline' => _('Apache2'),
'plShortName' => _('Apache2'),
'plDescription' => _('This Plugin is for Apache server'),
'plObjectType' => array('apacheVhost' => array(
'name' => _('Apache Vhost'),
'filter' => 'objectClass=apacheConfig',
'aclCategory' => 'server',
'icon' => 'geticon.php?context=applications&icon=apache&size=16',
)),
'plProvidedAcls' => parent::generatePlProvidedAcls(self::getAttributesInfo())
);
}
/*!
* \brief The main function : information about attributes
*/
static function getAttributesInfo ()
{
return array(
'section1' => array (
'name' => _('Informations'),
'class' => array('fullwidth'),
'attrs' => array(
new StringAttribute (
_('Virtual host name'),
_('The Virtual host name'),
'apacheServerName',
TRUE
),
new StringAttribute (
_('Document root'),
_('Document root for the apache web server'),
'apacheDocumentRoot',
TRUE
),
new StringAttribute (
_('Admin mail address'),
_('Apache admin mail address'),
'apacheServerAdmin',
TRUE
),
new CompositeScriptAliasAttribute (
_('Script Alias'),
'apacheScriptAlias',
array(
new StringAttribute (_('Alias'), _('Alias Directory'), 'aliasdir'),
new StringAttribute (_('Script'), _('Script Directory'), 'scriptdir'),
),
'/^(\S*) (\S*)$/',
'%s %s',
'',
_('Script Alias')
),
new SetAttribute (
new CompositeAttribute (
_('Server Alias'),
'apacheServerAlias',
array(
new StringAttribute (_('URL Alias'), _('URL Alias'), 'urlalias'),
new StringAttribute (_('Directory Path'), _('Directory Path'), 'pathdir'),
),
'/^(\S*) (\S*)$/',
'%s %s',
'',
_('Server Alias')
)
)
)
)
);
}
function __construct ($dn = NULL, $object = NULL)
{
parent::__construct($dn, $object);
$this->attributesInfo['section1']['attrs']['apacheScriptAlias']->setLinearRendering(TRUE);
}
function compute_dn ()
{
return 'apacheServerName='.ldap_escape($this->apacheServerName, '', LDAP_ESCAPE_DN).','.session::get('serviceApacheVhostEditDN');
}
function execute ()
{
$smarty = get_smarty();
return parent::execute().$smarty->fetch(get_template_path('serviceApacheVhostEditFooter.tpl', TRUE, dirname(__FILE__)));
}
}
?>
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier
Copyright (C) 2011-2016 FusionDirectory
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
class serviceApacheVhostManagement extends management
{
var $plHeadline = "Vhosts";
var $plDescription = "Apache vhosts management";
var $plIcon = "geticon.php?context=applications&icon=apache&size=16";
// Tab definition
protected $tabClass = "apachevhosttabs";
protected $tabType = "APACHEVHOSTTABS";
protected $aclCategory = "serviceApacheVhostEdit";
protected $aclPlugin = "serviceApacheVhostEdit";
protected $objectName = "serviceApacheVhostEdit";
function __construct ($storagePoint = NULL)
{
global $config;
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$storagePoint,"Storage point");
session::set('serviceApacheVhostEditDN',$storagePoint.','.$config->current['BASE']);
if (!empty($storagePoint)) {
$this->storagePoints = array($storagePoint);
} else {
trigger_error("Error : did not received any storage point");
}
// Build filter
$filter = new filter(get_template_path("serviceApacheVhostEdit-filter.xml", TRUE, dirname(__FILE__)));
$filter->setObjectStorage($this->storagePoints);
$this->setFilter($filter);
// Build headpage
$headpage = new listing(get_template_path("serviceApacheVhostEdit-list.xml", TRUE, dirname(__FILE__)));
$headpage->setFilter($filter);
parent::__construct("serviceApacheVhostEdit", $headpage);
/* We don't want the normal footer, we have our own at the end of the tpl file,
* that allow us to differenciate plugin saving from service saving */
$this->skipFooter = TRUE;
}
function execute ()
{
$this->skipFooter = TRUE;
return parent::execute();
}
function count ()
{
$this->getHeadpage()->update();
return count($this->getHeadpage()->getEntries());
}
/*!
* \brief Initiates the removal for the given entries
* and displays a confirmation dialog.
*
* \param String $action The name of the action which was the used as trigger.
*
* \param Array $target A list of object dns, which should be affected by this method.
*
* \param Array $all A combination of both 'action' and 'target'.
*/
protected function removeEntryRequested($action = "",$target = array(),$all = array())
{
$ret = parent::removeEntryRequested($action, $target, $all);
// We've at least one entry to delete.
if (!empty($ret)) {
$smarty = get_smarty();
return $smarty->fetch(get_template_path('remove.tpl', TRUE, dirname(__FILE__)));
}
}
}
?>
<div style="font-size:18px;">
<img alt="" src="geticon.php?context=status&icon=dialog-warning&size=32" align=top>&nbsp;{t}Warning{/t}
</div>
<p>
{$info}
{t}This includes all account data, system access rules, imap settings, etc. for this user. Please double check if your really want to do this since there is no way for FusionDirectory to get your data back.{/t}
</p>
<p>
{t}So - if you're sure - press 'Delete' to continue or 'Cancel' to abort.{/t}
</p>
<p class="plugbottom">
<input type=submit name="vhost_delete_confirmed" value="{msgPool type=delButton}">
<input type=submit name="vhost_delete_cancel" value="{msgPool type=cancelButton}">
&nbsp;
</p>
<div class="contentboxh">
<p class="contentboxh">
{t}Filter{/t}
</p>
</div>
<div class="contentboxb">
{$SCOPE}
<table style="width:100%;border-top:1px solid #B0B0B0;">
<tr>
<td>
<label for="NAME">
<img src="geticon.php?context=actions&icon=system-search&size=16" align=middle>&nbsp;{t}Name{/t}
</label>
</td>
<td>
{$NAME}
</td>
</tr>
</table>
<table width="100%" style="background:#EEEEEE;border-top:1px solid #B0B0B0;">
<tr>
<td style="width:100%;text-align:right;">
{$APPLY}
</td>
</tr>
</table>
</div>
<?xml version="1.0" encoding="UTF-8"?>
<filterdef>
<definition>
<category>serviceApacheVhostEdit</category>
<template>services/apache2/serviceApacheVhostEdit-filter.tpl</template>
<initial>true</initial>
</definition>
<search>
<query>
<backend>LDAP</backend>
<filter>(&amp;(objectClass=apacheConfig)$NAME)</filter>
<attribute>dn</attribute>
<attribute>objectClass</attribute>
<attribute>apacheServerName</attribute>
<attribute>apacheDocumentRoot</attribute>
</query>
<scope>one</scope>
</search>
<element>
<type>textfield</type>
<tag>NAME</tag>
<size>20</size>
<maxlength>60</maxlength>
<default></default>
<unset></unset>
<set>(|(apacheServerName=*$*)(apacheDocumentRoot=*$*))</set>
<alphabet>true</alphabet>
<autocomplete>
<backend>LDAP</backend>
<filter>(&amp;(objectClass=apacheConfig)(|(apacheServerName=*$NAME*)(apacheDocumentRoot=*$NAME*)))</filter>
<attribute>apacheServerName</attribute>
<frequency>0.5</frequency>
<characters>3</characters>
</autocomplete>
</element>
</filterdef>
<table style="width:100%;height:100%; vertical-align:top; text-align:left;">
<tr>
<td style="vertical-align:top; width:100%;">
<div class="contentboxh">
<p class="contentboxh">&nbsp;{$HEADLINE}&nbsp;{$SIZELIMIT}</p>
</div>
<div class="contentboxb" style="background:white;">
<table>
<tbody>
<tr>
<td>{$ROOT}&nbsp;</td><td>{$BACK}&nbsp;</td><td>{$HOME}&nbsp;</td><td class="optional">{$RELOAD}&nbsp;</td><td>{$SEPARATOR}&nbsp;</td>
{if $BASE}<td>{t}Base{/t} {$BASE}&nbsp;</td><td>{$SEPARATOR}&nbsp;</td>{/if}
<td>{$ACTIONS}</td>
</tr>
</tbody>
</table>
</div>
<div style='height:4px;'>
</div>
{$LIST}
</td>
<td style='vertical-align:top;min-width:250px'>
{$FILTER}
</td>
</tr>
</table>
<p class="plugbottom">
<input type=submit name="SaveService" value="{msgPool type=saveButton}">
</p>
<input type="hidden" name="ignore">
<?xml version="1.0" encoding="UTF-8"?>
<list>
<definition>
<departmentBrowser>false</departmentBrowser>
<departmentRootVisible>false</departmentRootVisible>
<baseMode>false</baseMode>
<multiSelect>true</multiSelect>
<template>services/apache2/serviceApacheVhostEdit-list.tpl</template>
<module>serviceApacheVhostEdit</module>
<label>List of Apache Vhost</label>
<defaultSortColumn>1</defaultSortColumn>
<objectType>
<label>Template entry</label>
<objectClass>apacheConfig</objectClass>
<category>serviceApacheVhostEdit</category>
<class>serviceApacheVhostEdit</class>
<image>geticon.php?context=applications&amp;icon=apache&amp;size=16</image>
</objectType>
</definition>
<table>
<layout>|20px;c|||150px;r|</layout>
<column>
<value>%{filter:objectType(dn,objectClass)}</value>
</column>
<column>
<label>Server name</label>
<sortAttribute>apacheServerName</sortAttribute>
<sortType>string</sortType>
<value>%{filter:link(row,dn,"%s",apacheServerName)}</value>
<export>true</export>
</column>
<column>
<label>Document root</label>
<sortAttribute>apacheDocumentRoot</sortAttribute>
<sortType>string</sortType>
<value>%{filter:link(row,dn,"%s",apacheDocumentRoot)}</value>
<export>true</export>
</column>
<column>
<label>Actions</label>
<value>%{filter:actions(dn,row,objectClass)}</value>
</column>
</table>
<actionmenu>
<action>
<type>sub</type>
<image>geticon.php?context=actions&amp;icon=document-new&amp;size=16</image>
<label>Create</label>
<action>
<name>new</name>
<type>entry</type>
<image>geticon.php?context=applications&amp;icon=apache&amp;size=16</image>
<label>serviceApacheVhostEdit</label>
</action>