Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions

You are not logged in.

Announcement

#1 2022-04-07 10:25:34

alexius
Member
Registered: 2022-04-07
Posts: 10

Undefined index: online_timeout and new_message_sound_user_enabled

Hello everybody,
I need your help.

I upgrade LHC from 2.06 to 3.97 version according to the documentation. There are no problems with DB. I updated all need catalogs and settings.ini.php file with new ones. When I try to open LHC I got such messages (debug mode is enabled, cache is disable):

Notice: Undefined index: online_timeout in /chat/modules/lhchat/start.php on line 73

Notice: Undefined index: new_message_sound_user_enabled in /chat/modules/lhchat/start.php on line 118

The message in the error log on server:

Got error 'PHP message: PHP Notice:  Undefined index: online_timeout in /srv/www/htdocs/our.site/__admin/chat/modules/lhchat/start.php on line 73
PHP message: PHP Notice:  Undefined index: new_message_sound_user_enabled in /srv/www/htdocs/our.site/__admin/chat/modules/lhchat/start.php on line 118
PHP message: PHP Notice:  Undefined index: back_office_sinterval in /srv/www/htdocs/our.site/__admin/chat/design/defaulttheme/tpl/pagelayouts/parts/page_head_js.tpl.php on line 9
PHP message: PHP Notice:  Undefined index: chat_message_sinterval in /srv/www/htdocs/our.site/__admin/chat/design/defaulttheme/tpl/pagelayouts/parts/page_head_js.tpl.php on line 10
PHP message: PHP Notice:  Undefined index: new_message_sound_user_enabled in /srv/www/htdocs/our.site/__admin/chat/design/defaulttheme/tpl/pagelayouts/parts/page_head_js.tpl.php on line 24
PHP message: PHP Notice:  Undefined index: repeat_sound in /srv/www/htdocs/our.site/__admin/chat/design/defaulttheme/tpl/pagelayouts/parts/page_head_js.tpl.php on line 48
PHP message: PHP Notice:  Undefined index: repeat_sound_delay in /srv/www/htdocs/our.site/__admin/chat/design/defaulttheme/tpl/pagelayouts/parts/page_head_js.tpl.php on line 49'

LHC is installed on sub folder of our web site. The old version worked perfectly.

What can be the reason of the problem?

On server:
Apache/2.4.41 (Ubuntu)
PHP version: 7.4.3
MySQL 5.7.27-0ubuntu0.18.04.1

Thank you!

Offline

#2 2022-04-07 12:05:00

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Undefined index: online_timeout and new_message_sound_user_enabled

Just go to
https://demo.livehelperchat.com/site_ad … ndesetting similar url and save.

Compare values with demo settings.

I don't think you did proper update just...

Offline

#3 2022-04-07 13:23:32

alexius
Member
Registered: 2022-04-07
Posts: 10

Re: Undefined index: online_timeout and new_message_sound_user_enabled

Thank you for reply.

The values are equal.

The problem is that LHC is installed in the inner folder of our web site. The problem is in the path. There is a class in "oneFolder/secondFolder/ezcomponents/PersistentObject/src/managers/code_manager.php" with function "fetchDefinition( $class )" where the path is determined like

$path = $this->dir
            . strtr( strtolower( $class ), '\\', DIRECTORY_SEPARATOR )
            . '.php';

that gives us a path equal to "./pos/lhuser/lhuser.php". But in our case the path should be "./oneFolder/secondFolder/pos/lhuser/lhuser.php". That's why I changed it to this variant:

$path = $this->dir
            . strtr( strtolower( $class ), '\\', DIRECTORY_SEPARATOR )
            . '.php';

// Our changes
        $path = str_replace('./','', $path);
        $path = $_SERVER['DOCUMENT_ROOT'] . '/oneFolder/secondFolder/' . $path;

Also in the file oneFolder/secondFolder/lib/core/lhconfig/lhconfig.php I had to change from

"$this->conf = include('settings/settings.ini.php');"

to

"$this->conf = include($_SERVER['DOCUMENT_ROOT'] . '/oneFolder/secondFolder/settings/settings.ini.php');"

Now we have proper paths. Maybe it will be good to add additional variable in the settings in case if LHC install in some inner folders.

Also on page doc.livehelperchat.com/docs/install/ it said "Install url is always index.php/site_admin/user/login". But it's not install url but login url. I was a little bit confused.

After all changes I got login page with a login form. But when I input my login (not email, but username) and password, which was before and wasn't change, I get error: "Incorrect username or password". What can be the problem, could you help to figure out? For login it said can be "Username OR E-mail".

Thank you

Last edited by alexius (2022-04-07 13:25:43)

Offline

#4 2022-04-07 13:34:50

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Undefined index: online_timeout and new_message_sound_user_enabled

That's really something wrong with your update or env. As you are the one who reported it. Try to replace all folders with official one including index.php. Or just try new version fresh install and see does it works.

Offline

#5 2022-04-07 13:42:35

alexius
Member
Registered: 2022-04-07
Posts: 10

Re: Undefined index: online_timeout and new_message_sound_user_enabled

I already did this - I downloaded today the last version of LHC and upload it to our web site. Also I got the same parameters from previous settings file. It doesn't help. I can't make login. How can I see where is the problem? Which class I can debug to investigate the problem? Thanks

Offline

#6 2022-04-07 13:44:02

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Undefined index: online_timeout and new_message_sound_user_enabled

Just try a completely fresh install from a different subfolder and see does it works.

As for debug
https://doc.livehelperchat.com/docs/debug/

Offline

#7 2022-04-07 14:10:33

alexius
Member
Registered: 2022-04-07
Posts: 10

Re: Undefined index: online_timeout and new_message_sound_user_enabled

I made debug of authentication process and what I figure out:

the hash of my password in the db was  -  0b779d1fef59d07v912ce4b20dc49831a334f862

when I login to the site first time it give me access to the chat administration but the code change hash to $2y$10$..DI4GSRBiU/9aRJtmP94.7vqDWXZPZaE.

And now I can make login second time and it show me the error "Incorrect username or password".

How to prevent changing of password's hash?

Offline

#8 2022-04-07 14:19:31

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Undefined index: online_timeout and new_message_sound_user_enabled

Old versions password hash was insecure, this new format is more secure and it's perfectly fine it changes it to this format. You should see why you can't login even hash was changed. Or after first login you can try to change password again in your account.

Offline

#9 2022-04-07 14:49:54

alexius
Member
Registered: 2022-04-07
Posts: 10

Re: Undefined index: online_timeout and new_message_sound_user_enabled

Yes, it's correct and more safety.

But the problem is that you use the PHP function "password_hash($password, $algo)" which give you the hash with a length 60 symbols. But the "password" field in DB has a length 40 symbols. That's why your algorithm thinks that this is an old password again and again:


if (strlen($user->password) == 40) { // this is old password
            $passwordVerify = sha1($password.$secretHash.sha1($password));
            $changePassword = true;
        } else {

            if (!password_verify($password, $user->password)) {
                return false;
            };

            $changePassword = false;
            $passwordVerify = $user->password;
       }

When I increased the length of the password field in DB, it started to work.

Offline

#10 2022-04-07 14:51:31

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Undefined index: online_timeout and new_message_sound_user_enabled

In that case I don;'t think you update DB...
As LHC checks for that field type and length smile

{
        "field": "password",
        "type": "varchar(200)",
        "null": "NO",
        "key": "",
        "default": null,
        "extra": "",
        "collation": "utf8mb4_unicode_ci"
      },

Offline

#11 2022-04-07 14:54:46

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Undefined index: online_timeout and new_message_sound_user_enabled

Read this part and update db after replacing files...

https://doc.livehelperchat.com/docs/upgrading/

Offline

#12 2022-04-07 15:00:40

alexius
Member
Registered: 2022-04-07
Posts: 10

Re: Undefined index: online_timeout and new_message_sound_user_enabled

All changes I did after updating the DB with your script and instructions. Everything was done without the errors. Right now I again check Home/System configuration/Live Helper Chat update information and it shows me that there are difference. I did update of DB again and it made all needed changes. Maybe it do these changes step by step that's why it needs to check couple times if there are some differences.

Thank you for support  smile

Offline

Board footer