Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#112: Fixing deprecated error messages by upgrading to smarty4. #151

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@

# Smarty
if (!defined("SMARTY")) {
define("SMARTY", "/usr/share/php/smarty3/Smarty.class.php");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @abpai94

This won't be possible for now, because smarty4 is not available on RHEL platforms.

Please give a look at this issue I have opened here: #158

define("SMARTY", "/usr/share/php/smarty4/Smarty.class.php");
}

# Allow to override current settings with an extra configuration file, whose reference is passed in HTTP_HEADER $header_name_extra_config
Expand Down
2 changes: 1 addition & 1 deletion docs/general-parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ You need to define where Smarty is installed:

.. code-block:: php

define("SMARTY", "/usr/share/php/smarty3/Smarty.class.php");
define("SMARTY", "/usr/share/php/smarty4/Smarty.class.php");

Notify administrator by mail
----------------------------
Expand Down
8 changes: 4 additions & 4 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You need to install these prerequisites:
* Apache or another web server
* php
* php-ldap
* Smarty (version 3)
* Smarty (version 4)

Debian / Ubuntu
---------------
Expand Down Expand Up @@ -54,14 +54,14 @@ You are now ready to install:

.. prompt:: bash #

apt install service-desk smarty3
apt install service-desk smarty4

CentOS / RedHat
---------------

.. warning:: You may need to install first the package `php-Smarty`_ which is not in official repositories.
.. warning:: You may need to install first the package `smarty4` which is not in official repositories.

.. _php-Smarty: https://pkgs.org/download/php-Smarty
.. _smarty4: https://pkgs.org/download/smarty4

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, you are in CentOS / RedHat section, and unfortunately, https://pkgs.org/download/smarty4 is only available for debian packages.


Configure the yum repository:

Expand Down
2 changes: 1 addition & 1 deletion htdocs/display.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
}

# Lock
$pwdLockout = strtolower($ppolicy_entry[0]['pwdlockout'][0]) == "true" ? true : false;
$pwdLockout = strtolower(isset($ppolicy_entry[0]['pwdlockout'][0])) == "true" ? true : false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No.

The value of $ppolicy_entry[0]['pwdlockout'][0] is TRUE (or FALSE, or nonexistent)

This value is the one of pwdLockout attribute in LDAP directory

Also, please don't mix multiple features/bug fixes in the same commit or pull request.

$pwdLockoutDuration = $ppolicy_entry[0]['pwdlockoutduration'][0];
$pwdAccountLockedTime = $entry[0]['pwdaccountlockedtime'][0];

Expand Down
3 changes: 3 additions & 0 deletions htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
$smarty->setCacheDir($cache_dir);
$smarty->debugging = $smarty_debug;

# Muting warnings due to PHP 8+
$smarty->muteUndefinedOrNullWarnings();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems really interesting, but:

  • the method is not available on smarty 3, making service-desk crashing
  • on smarty4, we still have a lot of warnings.

error_reporting(0);
if ($debug) {
error_reporting(E_ALL);
Expand Down