mirror of
https://github.com/YunoHost-Apps/rainloop_ynh.git
synced 2024-09-03 20:16:18 +02:00
37 lines
802 B
PHP
37 lines
802 B
PHP
<?php
|
|
class YnhLdapSuggestionsPlugin 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__ . '/YnhLdapSuggestions.php';
|
|
|
|
if (! \is_array ( $mResult )) {
|
|
$mResult = array ();
|
|
}
|
|
|
|
$oProvider = new YnhLdapSuggestions ();
|
|
$mResult [] = $oProvider;
|
|
}
|
|
}
|
|
}
|
|
?>
|