Added LSaddon::phpLdapAdmin

This commit is contained in:
Benjamin Renard 2013-06-28 16:38:31 +02:00
parent aac96924cf
commit 9f34843ded
6 changed files with 118 additions and 3 deletions

View file

@ -8,6 +8,7 @@
<!ENTITY courier "<application><ulink url='http://www.courier-mta.org/'>Courier</ulink></application>">
<!ENTITY CAS "<application><ulink url='http://www.jasig.org/cas'>CAS</ulink></application>">
<!ENTITY phpCAS "<application><ulink url='http://www.ja-sig.org/wiki/display/CASC/phpCAS'>phpCAS</ulink></application>">
<!ENTITY PhpLdapAdmin "<application><ulink url='http://phpldapadmin.sourceforge.net'>PhpLdapAdmin</ulink></application>">
<!ENTITY subDn "<link linkend='config-subDn'>subDn</link>">
<!ENTITY LSprofile "<link linkend='config-LSprofile'>LSprofile</link>">

View file

@ -12,5 +12,6 @@
&conf-LSaddon_asterisk;
&conf-LSaddon_mail;
&conf-LSaddon_maildir;
&conf-LSaddon_phpldapadmin;
</sect1>

View file

@ -2,7 +2,5 @@
<!ENTITY conf-LSaddon_asterisk SYSTEM "LSaddon_asterisk.docbook">
<!ENTITY conf-LSaddon_maildir SYSTEM "LSaddon_maildir.docbook">
<!ENTITY conf-LSaddon_mail SYSTEM "LSaddon_mail.docbook">
<!ENTITY conf-LSaddon_phpldapadmin SYSTEM "LSaddon_phpldapadmin.docbook">

View file

@ -0,0 +1,25 @@
<sect2 id="config-LSaddon_phpldapadmin">
<title>LSaddon_phpldapadmin</title>
<para>Cet &LSaddon; est utilisé pour permettre un lien facile entre le logiciel
&PhpLdapAdmin; et LdapSaisie. Il sera possible ainsi à partir d'un objet dans
LdapSaisie de voir ce même objet dans &PhpLdapAdmin;.</para>
<para>Il est necessaire de configurer l'URL de votre installation de &PhpLdapAdmin; dans
le fichier de configuration <literal>config.LSaddons.phpldapadmin.php</literal>.</para>
<programlisting linenumbering="unnumbered">
<citetitle>Structure du fichier</citetitle>
<![CDATA[// PhpLdapAdmin View Object URL format
define('LS_PHPLDAPADMIN_VIEW_OBJECT_URL_FORMAT','//'.$_SERVER['SERVER_NAME'].'/phpldapadmin/cmd.php?cmd=template_engine&server_id=0&dn=%{dn}');]]>
</programlisting>
<para>Cet &LSaddon; offre la possibilité d'utilisé la fonction &php;
<function>redirectToPhpLdapAdmin()</function> comme &customActions;.
<funcsynopsis>
<funcprototype>
<funcdef>bool <function>redirectToPhpLdapAdmin</function></funcdef>
<paramdef>LSldapObject <parameter>$ldapObject</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</para>
</sect2>

View file

@ -0,0 +1,24 @@
<?php
/*******************************************************************************
* Copyright (C) 2007 Easter-eggs
* http://ldapsaisie.labs.libre-entreprise.org
*
* Author: See AUTHORS file in top-level directory.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* 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.
******************************************************************************/
// PhpLdapAdmin View Object URL format
define('LS_PHPLDAPADMIN_VIEW_OBJECT_URL_FORMAT','//'.$_SERVER['SERVER_NAME'].'/phpldapadmin/cmd.php?cmd=template_engine&server_id=0&dn=%{dn}');

View file

@ -0,0 +1,66 @@
<?php
/*******************************************************************************
* Copyright (C) 2007 Easter-eggs
* http://ldapsaisie.labs.libre-entreprise.org
*
* Author: See AUTHORS file in top-level directory.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* 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.
******************************************************************************/
// Error messages
// Support
LSerror :: defineError('PHPLDAPADMIN_SUPPORT_01',
__("PhpLdapAdmin Support : The constant %{const} is not defined.")
);
/**
* Verify support of PhpLdapAdmin by LdapSaisie
*
* @author Benjamin Renard <brenard@easter-eggs.com>
*
* @retval boolean true if is supported, false also
*/
function LSaddon_phpldapadmin_support() {
$retval=true;
$MUST_DEFINE_CONST= array(
'LS_PHPLDAPADMIN_VIEW_OBJECT_URL_FORMAT'
);
foreach($MUST_DEFINE_CONST as $const) {
if ( (!defined($const)) || (constant($const) == "")) {
LSerror :: addErrorCode('PHPLDAPADMIN_SUPPORT_01',$const);
$retval=false;
}
}
return $retval;
}
/**
* Redirect to PhpLdapAdmin view object page
*
* @author Benjamin Renard <brenard@easter-eggs.com>
*
* @retval boolean true in all cases
*/
function redirectToPhpLdapAdmin(&$ldapObject) {
$url = $ldapObject->getFData(LS_PHPLDAPADMIN_VIEW_OBJECT_URL_FORMAT);
LSsession::redirect($url);
return true;
}