mirror of
https://github.com/YunoHost-Apps/rainloop_ynh.git
synced 2024-09-03 20:16:18 +02:00
Rename LDAP suggestions
This commit is contained in:
parent
b114d8cc45
commit
89d0c04cde
6 changed files with 13 additions and 17 deletions
|
@ -38,12 +38,12 @@ app=rainloop
|
||||||
sudo mkdir -p $rainloop_path
|
sudo mkdir -p $rainloop_path
|
||||||
|
|
||||||
# Use of latest community edition
|
# Use of latest community edition
|
||||||
sudo unzip ../sources/rainloop-community.zip -d $rainloop_path/
|
sudo unzip -q ../sources/rainloop-community.zip -d $rainloop_path/
|
||||||
|
|
||||||
# Install plugins
|
# Install plugins
|
||||||
sudo mkdir -p $rainloop_path/data/_data_/_default_/plugins
|
sudo mkdir -p $rainloop_path/data/_data_/_default_/plugins
|
||||||
sudo cp -rf ../sources/plugins/ynh-login-mapping $rainloop_path/data/_data_/_default_/plugins/.
|
sudo cp -rf ../sources/plugins/ynh-login-mapping $rainloop_path/data/_data_/_default_/plugins/.
|
||||||
sudo cp -rf ../sources/plugins/ynh-ldap-addressbooks $rainloop_path/data/_data_/_default_/plugins/.
|
sudo cp -rf ../sources/plugins/ynh-ldap-suggestions $rainloop_path/data/_data_/_default_/plugins/.
|
||||||
|
|
||||||
# Autoconfig
|
# Autoconfig
|
||||||
sudo mkdir -p $rainloop_path/data/_data_/_default_/configs/
|
sudo mkdir -p $rainloop_path/data/_data_/_default_/configs/
|
||||||
|
@ -61,7 +61,7 @@ app=rainloop
|
||||||
plugins="ynh-login-mapping"
|
plugins="ynh-login-mapping"
|
||||||
if [ "$ldap" = "Yes" ];
|
if [ "$ldap" = "Yes" ];
|
||||||
then
|
then
|
||||||
plugins="$plugins,ynh-ldap-addressbooks"
|
plugins="$plugins,ynh-ldap-suggestions"
|
||||||
fi
|
fi
|
||||||
sudo yunohost app setting $app plugins -v $plugins
|
sudo yunohost app setting $app plugins -v $plugins
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,7 @@ app=rainloop
|
||||||
# the old version is not deleted... the new version is in a new path
|
# the old version is not deleted... the new version is in a new path
|
||||||
|
|
||||||
# Use of latest community edition
|
# Use of latest community edition
|
||||||
sudo unzip ../sources/rainloop-community.zip -d $rainloop_path/
|
sudo unzip -q ../sources/rainloop-community.zip -d $rainloop_path/
|
||||||
|
|
||||||
# Install plugins
|
|
||||||
sudo mkdir -p $rainloop_path/data/_data_/_default_/plugins
|
|
||||||
sudo cp -rf ../sources/plugins/ynh-login-mapping $rainloop_path/data/_data_/_default_/plugins/.
|
|
||||||
|
|
||||||
# Update patch to auto load version
|
# Update patch to auto load version
|
||||||
sudo cp ../sources/patch/index_auto_version.php $rainloop_path/index.php
|
sudo cp ../sources/patch/index_auto_version.php $rainloop_path/index.php
|
||||||
|
@ -31,7 +27,7 @@ app=rainloop
|
||||||
# Update ynh plugins:
|
# Update ynh plugins:
|
||||||
sudo mkdir -p $rainloop_path/data/_data_/_default_/plugins
|
sudo mkdir -p $rainloop_path/data/_data_/_default_/plugins
|
||||||
sudo cp -rf ../sources/plugins/ynh-login-mapping $rainloop_path/data/_data_/_default_/plugins/.
|
sudo cp -rf ../sources/plugins/ynh-login-mapping $rainloop_path/data/_data_/_default_/plugins/.
|
||||||
sudo cp -rf ../sources/plugins/ynh-ldap-addressbooks $rainloop_path/data/_data_/_default_/plugins/.
|
sudo cp -rf ../sources/plugins/ynh-ldap-suggestions $rainloop_path/data/_data_/_default_/plugins/.
|
||||||
|
|
||||||
# update SSO and auto version
|
# update SSO and auto version
|
||||||
if [ $final_path == $rainloop_path ]
|
if [ $final_path == $rainloop_path ]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
class YnhLdapAddressbooks implements \RainLoop\Providers\Suggestions\ISuggestions {
|
class YnhLdapSuggestions implements \RainLoop\Providers\Suggestions\ISuggestions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -49,7 +49,7 @@ class YnhLdapAddressbooks implements \RainLoop\Providers\Suggestions\ISuggestion
|
||||||
$aResult = array ();
|
$aResult = array ();
|
||||||
$oCon = @\ldap_connect ();
|
$oCon = @\ldap_connect ();
|
||||||
if (! $oCon) {
|
if (! $oCon) {
|
||||||
$this->oLogger->Write ( 'YnhLdapAddressbooks: Could not connect to LDAP server', \MailSo\Log\Enumerations\Type::ERROR );
|
$this->oLogger->Write ( 'YnhLdapSuggestions: Could not connect to LDAP server', \MailSo\Log\Enumerations\Type::ERROR );
|
||||||
return $aResult;
|
return $aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ class YnhLdapAddressbooks implements \RainLoop\Providers\Suggestions\ISuggestion
|
||||||
// return $aResult;
|
// return $aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->oLogger->Write ( 'YnhLdapAddressbooks: connected to LDAP', \MailSo\Log\Enumerations\Type::INFO, 'LDAP' );
|
$this->oLogger->Write ( 'YnhLdapSuggestions: connected to LDAP', \MailSo\Log\Enumerations\Type::INFO, 'LDAP' );
|
||||||
|
|
||||||
$sSearchDn = 'dc=yunohost,dc=org';
|
$sSearchDn = 'dc=yunohost,dc=org';
|
||||||
|
|
||||||
|
@ -78,12 +78,12 @@ class YnhLdapAddressbooks implements \RainLoop\Providers\Suggestions\ISuggestion
|
||||||
'displayName'
|
'displayName'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->oLogger->Write ( 'YnhLdapAddressbooks: ldap_search : ' . $sSearchDn . ' / ' . $sFilter, \MailSo\Log\Enumerations\Type::INFO, 'LDAP' );
|
$this->oLogger->Write ( 'YnhLdapSuggestions: ldap_search : ' . $sSearchDn . ' / ' . $sFilter, \MailSo\Log\Enumerations\Type::INFO, 'LDAP' );
|
||||||
|
|
||||||
$oS = @\ldap_search ( $oCon, $sSearchDn, $sFilter, $aItems, 0, $iLimit, $iLimit );
|
$oS = @\ldap_search ( $oCon, $sSearchDn, $sFilter, $aItems, 0, $iLimit, $iLimit );
|
||||||
if ($oS) {
|
if ($oS) {
|
||||||
$aEntries = @\ldap_get_entries ( $oCon, $oS );
|
$aEntries = @\ldap_get_entries ( $oCon, $oS );
|
||||||
$this->oLogger->Write ( 'YnhLdapAddressbooks: ldap_search => ' . var_export ( $aEntries ), \MailSo\Log\Enumerations\Type::INFO, 'LDAP' );
|
$this->oLogger->Write ( 'YnhLdapSuggestions: ldap_search => ' . var_export ( $aEntries ), \MailSo\Log\Enumerations\Type::INFO, 'LDAP' );
|
||||||
|
|
||||||
if (is_array ( $aEntries )) {
|
if (is_array ( $aEntries )) {
|
||||||
if (isset ( $aEntries ['count'] )) {
|
if (isset ( $aEntries ['count'] )) {
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
class YnhLdapAddressbooksPlugin extends \RainLoop\Plugins\AbstractPlugin {
|
class YnhLdapSuggestionsPlugin extends \RainLoop\Plugins\AbstractPlugin {
|
||||||
public function Init() {
|
public function Init() {
|
||||||
$this->addHook ( 'main.fabrica', 'MainFabrica' );
|
$this->addHook ( 'main.fabrica', 'MainFabrica' );
|
||||||
}
|
}
|
||||||
|
@ -23,13 +23,13 @@ class YnhLdapAddressbooksPlugin extends \RainLoop\Plugins\AbstractPlugin {
|
||||||
*/
|
*/
|
||||||
public function MainFabrica($sName, &$mResult) {
|
public function MainFabrica($sName, &$mResult) {
|
||||||
if ($sName === 'suggestions') {
|
if ($sName === 'suggestions') {
|
||||||
include_once __DIR__ . '/YnhLdapAddressbooks.php';
|
include_once __DIR__ . '/YnhLdapSuggestions.php';
|
||||||
|
|
||||||
if (! \is_array ( $mResult )) {
|
if (! \is_array ( $mResult )) {
|
||||||
$mResult = array ();
|
$mResult = array ();
|
||||||
}
|
}
|
||||||
|
|
||||||
$oProvider = new YnhLdapAddressbooks ();
|
$oProvider = new YnhLdapSuggestions ();
|
||||||
$mResult [] = $oProvider;
|
$mResult [] = $oProvider;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue