dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse

This website has run out of funding so feel free to contribute if you can afford it (see footer)

  • SA Chat 8 0 10 1
Currently:  

Author Topic: SA Chat  (Read 3656 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6493
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 05:48:14 PM
  • Deeply Confused Learner
  • Profession: IT Engineer
SA Chat
« on: August 17, 2015, 05:34:17 PM »
http://custom.simplemachines.org/mods/index.php?mod=2534

Please note that I am using the earlier version as I find it more reliable - there is a later version (REV120)  if you wish to try it but it requires changes to accomodate 2.0.16 and above.

EDIT: copy the sachat/cache directory to any backup system for it to work correctly or start afresh with an empty cache file.

NOTE: PrettyURLs (not desired or installed here) messes up .htaccess and stops SA Chat from working.
« Last Edit: March 06, 2020, 09:02:06 AM by Chip »
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6493
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 05:48:14 PM
  • Deeply Confused Learner
  • Profession: IT Engineer
Re: SA Chat
« Reply #1 on: October 30, 2019, 03:36:31 AM »
Now available to all.

Chat logs are retained for a period of time and then purged.

You will be audited randomly so be smart and cautious.

Clearing/closing of persistent chat windows is by clearing cache/cookies (which will log you out of most sites)
« Last Edit: February 11, 2020, 08:53:23 PM by Chip »
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6493
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 05:48:14 PM
  • Deeply Confused Learner
  • Profession: IT Engineer
Re: SA Chat
« Reply #2 on: February 11, 2020, 08:56:30 PM »
Not compatible with SMF 2.0.16 and 2.0.17.

Maybe we can patch it accordingly as per these observations
« Last Edit: February 12, 2020, 02:44:02 AM by Chip »
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6493
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 05:48:14 PM
  • Deeply Confused Learner
  • Profession: IT Engineer
Re: SA Chat
« Reply #3 on: February 21, 2020, 10:24:45 AM »
Since the new version (REV120) is not as reliable as the old version for me so this is how to upgrade the old revision (SAChatBar-0.1.5 Rev110) to 2.0.16 -> 17 partially borrowed from SMF's Diego AndrĂ©s here   

Locate: ./sachat/index.php
Code: [Select]
//SMF Cookie autentication!!!
list ($member_id, $password) = initCookies();

Replace:
Code: [Select]
//SMF Cookie autentication!!!
$member_id = initCookies();

Locate:
Code: [Select]
        // Lets validate the password, anyone can put a number in a cookie, lets see if the password checks out.
        if (isset($user_settings['passwd']) && strlen($password) != 40 || isset($user_settings['passwd']) && sha1($user_settings['passwd'] . $user_settings['password_salt']) != $password) {
                $context['JSON']['STATUS'] = 'AUTH FAILED';
                doOutput();
        } else {
                $context['JSON']['STATUS'] = 'ACTIVE';
        }

Replace:
Code: [Select]
        // No need to validate the password since 2.0.16
        $context['JSON']['STATUS'] = 'ACTIVE';

Locate: ./sachat/functions.php
Code: [Select]
function initCookies() {
global $cookiename;

if (isset($_COOKIE[$cookiename]) && preg_match('~^a:[34]:\{i:0;(i:\d{1,6}|s:[1-8]:"\d{1,8}");i:1;s:(0|40):"([a-fA-F0-9]{40})?";i:2;[id]:\d{1,14};(i:3;i:\d;)?\}$~i', $_COOKIE[$cookiename]) == 1) {
list ($member_id, $password) = @unserialize($_COOKIE[$cookiename]);
$member_id = !empty($member_id) && strlen($password) > 0 ? (int) $member_id : 0;

return array($member_id, $password);
} elseif (isset($_COOKIE[$cookiename])) {
list ($member_id, $password) = @unserialize(stripslashes($_COOKIE[$cookiename]));
$member_id = !empty($member_id) && strlen($password) > 0 ? (int) $member_id : 0;

return array($member_id, $password);
}
}

Replace:
Code: [Select]
function initCookies() {
global $cookiename;

if (isset($_COOKIE[$cookiename]) && preg_match('~^a:[34]:\{i:0;(i:\d{1,6}|s:[1-8]:"\d{1,8}");i:1;s:(0|40):"([a-fA-F0-9]{40})?";i:2;[id]:\d{1,14};(i:3;i:\d;)?\}$~i', $_COOKIE[$cookiename]) == 1) {
list ($id_member, $password) = @unserialize($_COOKIE[$cookiename]);
$id_member = !empty($id_member) && strlen($password) > 0 ? (int) $id_member : 0;

return $id_member;
} elseif (isset($_COOKIE[$cookiename])) {
list ($id_member, $password, $login_span) = @unserialize($_SESSION['login_' . $cookiename]);
$id_member = !empty($id_member) && strlen($password) > 0 ? (int) $id_member : 0;

return $id_member;
}
}



Note: the first attachment contains the changes above
« Last Edit: February 22, 2020, 02:21:06 AM by Chip »
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6493
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 05:48:14 PM
  • Deeply Confused Learner
  • Profession: IT Engineer
Re: SA Chat
« Reply #4 on: May 16, 2021, 01:59:30 PM »
Important PHP 7.2 and onwards bug fix:

in ./sachat/index.php:

find:
Code: [Select]
        session_start();
        session_cache_limiter('nocache'); //Shouldent this be before session_start() http://php.net/manual/en/function.session-cache-limiter.php

replace:
Code: [Select]
        session_cache_limiter('nocache'); // goes before "session_start();" see php.net/manual/en/function.session-cache-limiter.php
        session_start();



Trivial spyware removal: (see https://www.2-spyware.com/remove-s7-addthis-com.html)

in ./sachat/themes/default/js/body.js.php:

comment out this line so it looks like this:
Code: [Select]
//                      $sachat.getScript(\'http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-503f263237ff99da\');
« Last Edit: May 16, 2021, 03:29:01 PM by Chip »
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

Offline smfadmin

  • SMF (internal) Site
  • Administrator
  • Jr. Member
  • *****
  • Join Date: Dec 2014
  • Location: Management
  • Posts: 126
  • Reputation Power: 0
  • smfadmin has hidden their reputation power
  • Last Login:July 13, 2021, 11:33:15 AM
  • Supplied Install Member
Re: SA Chat
« Reply #5 on: May 16, 2021, 11:58:07 PM »
PHP 7.3 - Many warning messages in the SA Error Log ...

Code: [Select]
WARNING: count(): Parameter must be an array or an object that implements Countable
another fix for ./sachat/functions.php (by SMF helpers) for PHP 7.2 and above:

see https://www.simplemachines.org/community/index.php?topic=577720

locate:
Code: [Select]
return count(isset($context['friends']) ? $context['friends'] : null);
replace:
Code: [Select]
return count(isset($context['friends']) ? $context['friends'] : array());
« Last Edit: May 21, 2021, 06:59:50 AM by Chip »
measure twice, cut once

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6493
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 05:48:14 PM
  • Deeply Confused Learner
  • Profession: IT Engineer
Re: SA Chat
« Reply #6 on: May 31, 2021, 09:15:03 PM »
Here are the latest mods with all the patches:

SAChatBar-1.0b.zip is the most recent version

SAChatBar-0.1.7.zip is the original version

Both work on SMF 2.0.18


« Last Edit: June 07, 2021, 11:24:28 AM by smfadmin »
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6493
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 05:48:14 PM
  • Deeply Confused Learner
  • Profession: IT Engineer
Re: SA Chat
« Reply #7 on: June 26, 2021, 03:40:38 PM »
MySQL 5.7 upgrade for the database errors reported at https://www.simplemachines.org/community/index.php?topic=391961.msg4089434#msg4089434

I did some research and found a workaround. It is failing on the INSERT so I had to change my.cnf for MySQL to add:

Code: [Select]
sql_mode=NO_ENGINE_SUBSTITUTION
5.7 is far more stricter than 5.6 and we are using a 0 date/time value for the table 2sichat: isrd column:

Code: [Select]
INSERT INTO smf209_2sichat(`to`, `from`, `msg`, `sent`, `isrd`)
                        VALUES
                                (2, 1, 'msgtext', '2021-06-26 17:26:07', 0)"

see https://www.percona.com/blog/2016/10/18/upgrading-to-mysql-5-7-beware-of-the-new-strict-mode/
« Last Edit: June 26, 2021, 03:47:14 PM by Chip »
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6493
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 05:48:14 PM
  • Deeply Confused Learner
  • Profession: IT Engineer
Re: SA Chat
« Reply #8 on: July 13, 2021, 09:09:18 AM »
Code: [Select]
mysql -u root -passwd -e "USE smf209; SELECT t1.sent, t1.from, t2.member_name, t1.to, t3.member_name, t1.msg FROM smf209_2sichat t1 INNER JOIN smf209_members t2 ON t1.from=t2.id_member INNER JOIN smf209_members t3 ON t1.to=t3.id_member\G;" > /tmp/chatlog

mailx -s "SA_Chat log" -r "SA_Chat" root < "/tmp/chatlog"

The output looks like this:

Code: [Select]
*************************** 10. row ***************************
       sent: 2021-06-23 05:12:07
       from: 2
member_name: Chipper
         to: 1260
member_name: hanna
        msg: welcome back !
*************************** 11. row ***************************
       sent: 2021-06-23 05:12:49
       from: 1260
member_name: hanna
         to: 2
member_name: Chipper
        msg: thx! been awhile my friend
*************************** 12. row ***************************
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

Tags:
 


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal