Home / Community / Blog

To change start page I've added in site.ini.append.php file in SiteSettings section:

[SiteSettings]
IndexPage=/content/view/full/134/
DefaultPage=/content/view/full/134/

I had a problem witch language switching on site where I use two addresses: mysite.eu and mysite.pl. One in English and second in Polish of course (how to do this I've described years ago). After some changes I could change language from English to Polish, but not from Polish to English. Even change from English to English redirect me to mysite.pl (in Polish).

The solution is to check settings/override/site.ini.append.php file. The default installation places there all settings including SiteURL=mysite.pl (in SiteSettings section). Of course in my case (two different addresses) the SiteURL can be defined only in settings/siteaccess/eng/site.ini.append.php and settings/siteaccess/pol/site.ini.append.php files. The values are SiteURL=mysite.eu in first file and SiteURL=mysite.pl in second one.

Now switching works great in both directions.

I've noticed that in one of my old pages, based on ezPublish 4.4 ezcache script does not do anything.

I've found solution. You have to applay patch to kernel/classes/ezcache.php file. Diff looks like this:

--- kernel/classes/ezcache.php-2015-06-10       2012-05-22 18:40:06.000000000 +0200
+++ kernel/classes/ezcache.php  2015-06-11 00:30:00.126363504 +0200
@@ -451,10 +451,12 @@
         $cacheItem['iterationSleep'] = $iterationSleep;
         $cacheItem['iterationMax']   = $iterationMax;
         $cacheItem['expiry']         = $expiry;
-        $functionName = 'function';
+        $functionName = false;
         if ( $purge && isset( $cacheItem['purge-function'] ) )
             $functionName = 'purge-function';
-        if ( isset( $cacheItem[$functionName] ) )
+        else if ( !$purge && isset( $cacheItem['function'] ) )
+            $functionName = 'function';
+        if ( $functionName )
         {
             $function = $cacheItem[$functionName];
             if ( is_callable( $function ) )

Now command

php bin/php/ezcache.php --clear-all --purge

works.

If You want to change Recipient or Email in Feedback form You have to made changes in language which is set as Main.

If not changes in Recipient attribute is discarded and Email is not accessible.

It's simple, but it takes me half an hour to change e-mail address ;-)

LDAP authentication is build in eZ Publish by default - the only thing to do is configuration.

To use LDAP you have to add line

LoginHandler[]=LDAP

in settings/override/site.ini.append.php file in section UserSettings. In my file it looks like this:

[UserSettings]
LogoutRedirect=/
LoginHandler[]=LDAP

In new file settings/override/ldap.ini.append.php you have to specify all connection settings. In my case it looks like this:

[LDAPSettings]
LDAPServer=127.0.0.1
LDAPBaseDn=ou--users,dc--jaqb,dc--gda,dc--pl
LDAPBindUser=cn--ldap-connect-user,ou--users,dc--jaqb,dc--gda,dc--pl
LDAPBindPassword=SecretPassword

The double minus sign is entered instead of equal sign. You can change this using LDAPEqualSign variable.

As you can see, I've created special user only to bind to LDAP server, because my server doesn't allow anonymous bind and you have to enter password in plain text.

When you clear ini cache you can login using LDAP account.

Earlier I've described how to chose proper language depending on domain. When you want to smoothly switch between these two languages you have to comment out SiteURL entry in settings/override/site.ini.append.php file and set this variable in config files of each language.

I have two directories in settings/siteaccess: pol and eng, so I've add in section SiteSettings

SiteURL=www.somedomain.pl

in file settings/siteaccess/pol/site.ini.append.php, and

SiteURL=www.somedomain.eu

in file settings/siteaccess/eng/site.ini.append.php.

Skoro już mam postawionego LDAP to przydałoby się wykorzystać ich również do logowania się do strony. Robi się to bardzo prosto.

W pliku ezpublish_legacy/settings/override/site.ini.append.php (dla starszych wersji bez ezpublish_legacy) w sekcji UserSettings trzeba dopisać

LoginHandler[]=LDAP

a następnie skonfigurować parametry połączenia. Ja skopiowałem plik settings/ldap.ini do settings/override/ldap.ini.append.php i tam zmieniłem:

LDAPServer=ldap.domain.local
LDAPBaseDn=ou--Users,ou--MyOrganization,dc--domain,dc--local
LDAPBindUser=someuser
LDAPBindPassword=somepassword

(w zasadzie w tym pliku wystarczy zrobić tylko powyższe wpisy w sekcji LDAPSettings) po przeładowaniu plików ini w panelu administracyjnym mogłem się zalogować kontem z LDAP.

Do działania oczywiście potrzebna jest obsługa LDAP w PHP, w CentOS pakiet nazywa się (cóż za niespodzianka!) php-ldap.

I want to use Polish language for polish address (.pl) and English version for European address (.eu).

First I've configured web server (apache) to both adresses use same DocumentRoot. I've setup eZ using one of the addresses. Then in settings/override/site.ini.append.php file I've changed in SiteAccessSettings section:

MatchOrder=uri

to

MatchOrder=uri;host
HostMatchType=map

and I've added

HostMatchMapItems[]=www.stona1.pl;pol
HostMatchMapItems[]=www.strona2.eu;eng

now default language depends on address one use to access site.

You have to :

  • transfer you files
  • transfer database
  • modify settings/siteaccess/*/site.ini.append.php files (especially database settings)
  • cleanup cache files - manually (or you can omit transferring)

The last step is important - without cleaning cache files the only I've got was: "You do not have permission to access this area".

Do wygenerowania pliku sitemap.xml można użyć rozszerzenia gg XML View. Wg. informacji autora z forum nie zadziała bez doszlifowania, ale to nie powinien być już problem.

Just my blog...

Mon Tue Wed Thu Fri Sat Sun
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31