ltb-project / self-service-password

Web interface to change and reset password in an LDAP directory
https://self-service-password.readthedocs.io/en/latest/
GNU General Public License v3.0
1.18k stars 327 forks source link

Compatibility with Smarty 5 #940

Open s-hamann opened 4 months ago

s-hamann commented 4 months ago

It seems that as of version 5, Smarty uses a namespace, which is incompatible with how Self Service Password currently uses Smarty. Trying to access Self Service Password with Smarty 5.3.1 (probably any 5.x version) results in an HTTP status code 500 and the following error logged:

PHP Fatal error:  Uncaught Error: Class "Smarty" not found in /var/www/ssp/htdocs/index.php:213

I fixed this locally by either adding use \Smarty\Smarty; to index.php or instantiating $smarty as new \Smarty\Smarty();. I can't tell if this breaks compatibility with Smarty versions 3 and 4, though.

coudot commented 4 months ago

Smarty 5 seems very young for the moment, we focus our efforts to Smarty 4 by now.

s-hamann commented 4 months ago

In that case, I suggest updating the Prerequisite section in the README.md to reflect that users should not currently try running with Smarty >= 5.