1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rainloop_ynh.git synced 2024-09-03 20:16:18 +02:00
rainloop_ynh/sources/plugins/ynh-ldap-addressbooks/index.php
scith b114d8cc45 LDAP suggestions
Thanks to Djip007
2015-10-24 14:24:50 +02:00

37 lines
805 B
PHP

<?php
class YnhLdapAddressbooksPlugin extends \RainLoop\Plugins\AbstractPlugin {
public function Init() {
$this->addHook ( 'main.fabrica', 'MainFabrica' );
}
/**
* test if ldap is supported (but with ynh it nead ;) )
*
* @return string
*/
public function Supported() {
if (! \function_exists ( 'ldap_connect' )) {
return 'The LDAP PHP exention must be installed to use this plugin';
}
return '';
}
/**
*
* @param string $sName
* @param mixed $mResult
*/
public function MainFabrica($sName, &$mResult) {
if ($sName === 'suggestions') {
include_once __DIR__ . '/YnhLdapAddressbooks.php';
if (! \is_array ( $mResult )) {
$mResult = array ();
}
$oProvider = new YnhLdapAddressbooks ();
$mResult [] = $oProvider;
}
}
}
?>