From 89d0c04cde1b785e8a7e7c067c019d7cfa6698ce Mon Sep 17 00:00:00 2001 From: scith Date: Sat, 24 Oct 2015 23:51:26 +0200 Subject: [PATCH] Rename LDAP suggestions --- scripts/install | 6 +++--- scripts/upgrade | 8 ++------ .../README | 0 .../VERSION | 0 .../YnhLdapSuggestions.php} | 10 +++++----- .../index.php | 6 +++--- 6 files changed, 13 insertions(+), 17 deletions(-) rename sources/plugins/{ynh-ldap-addressbooks => ynh-ldap-suggestions}/README (100%) rename sources/plugins/{ynh-ldap-addressbooks => ynh-ldap-suggestions}/VERSION (100%) rename sources/plugins/{ynh-ldap-addressbooks/YnhLdapAddressbooks.php => ynh-ldap-suggestions/YnhLdapSuggestions.php} (86%) rename sources/plugins/{ynh-ldap-addressbooks => ynh-ldap-suggestions}/index.php (78%) diff --git a/scripts/install b/scripts/install index 67e4935..c8c0b5a 100644 --- a/scripts/install +++ b/scripts/install @@ -38,12 +38,12 @@ app=rainloop sudo mkdir -p $rainloop_path # 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/. - 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 sudo mkdir -p $rainloop_path/data/_data_/_default_/configs/ @@ -61,7 +61,7 @@ app=rainloop plugins="ynh-login-mapping" if [ "$ldap" = "Yes" ]; then - plugins="$plugins,ynh-ldap-addressbooks" + plugins="$plugins,ynh-ldap-suggestions" fi sudo yunohost app setting $app plugins -v $plugins diff --git a/scripts/upgrade b/scripts/upgrade index 1d3fc33..0990d39 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,11 +19,7 @@ app=rainloop # the old version is not deleted... the new version is in a new path # Use of latest community edition - sudo unzip ../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/. + sudo unzip -q ../sources/rainloop-community.zip -d $rainloop_path/ # Update patch to auto load version sudo cp ../sources/patch/index_auto_version.php $rainloop_path/index.php @@ -31,7 +27,7 @@ app=rainloop # Update ynh 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-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 if [ $final_path == $rainloop_path ] diff --git a/sources/plugins/ynh-ldap-addressbooks/README b/sources/plugins/ynh-ldap-suggestions/README similarity index 100% rename from sources/plugins/ynh-ldap-addressbooks/README rename to sources/plugins/ynh-ldap-suggestions/README diff --git a/sources/plugins/ynh-ldap-addressbooks/VERSION b/sources/plugins/ynh-ldap-suggestions/VERSION similarity index 100% rename from sources/plugins/ynh-ldap-addressbooks/VERSION rename to sources/plugins/ynh-ldap-suggestions/VERSION diff --git a/sources/plugins/ynh-ldap-addressbooks/YnhLdapAddressbooks.php b/sources/plugins/ynh-ldap-suggestions/YnhLdapSuggestions.php similarity index 86% rename from sources/plugins/ynh-ldap-addressbooks/YnhLdapAddressbooks.php rename to sources/plugins/ynh-ldap-suggestions/YnhLdapSuggestions.php index c0294e1..e730453 100644 --- a/sources/plugins/ynh-ldap-addressbooks/YnhLdapAddressbooks.php +++ b/sources/plugins/ynh-ldap-suggestions/YnhLdapSuggestions.php @@ -1,5 +1,5 @@ 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; } @@ -62,7 +62,7 @@ class YnhLdapAddressbooks implements \RainLoop\Providers\Suggestions\ISuggestion // 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'; @@ -78,12 +78,12 @@ class YnhLdapAddressbooks implements \RainLoop\Providers\Suggestions\ISuggestion '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 ); if ($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 (isset ( $aEntries ['count'] )) { diff --git a/sources/plugins/ynh-ldap-addressbooks/index.php b/sources/plugins/ynh-ldap-suggestions/index.php similarity index 78% rename from sources/plugins/ynh-ldap-addressbooks/index.php rename to sources/plugins/ynh-ldap-suggestions/index.php index f7e3368..0f79a59 100644 --- a/sources/plugins/ynh-ldap-addressbooks/index.php +++ b/sources/plugins/ynh-ldap-suggestions/index.php @@ -1,5 +1,5 @@ addHook ( 'main.fabrica', 'MainFabrica' ); } @@ -23,13 +23,13 @@ class YnhLdapAddressbooksPlugin extends \RainLoop\Plugins\AbstractPlugin { */ public function MainFabrica($sName, &$mResult) { if ($sName === 'suggestions') { - include_once __DIR__ . '/YnhLdapAddressbooks.php'; + include_once __DIR__ . '/YnhLdapSuggestions.php'; if (! \is_array ( $mResult )) { $mResult = array (); } - $oProvider = new YnhLdapAddressbooks (); + $oProvider = new YnhLdapSuggestions (); $mResult [] = $oProvider; } }