HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/8.0.30
System: Linux multiplicar 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64
User: root (0)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /var/www/html/ch.sumar.com.py/wp-content/plugins/peepso/classes/sseevents.php
<?php

class PeepSoSSEEvents {
    public static function trigger($event, $user_id = NULL) {

        return TRUE; //SSE is not working yet

        if(!$user_id) {
            $user_id = get_current_user_id();
        }

        $ds = DIRECTORY_SEPARATOR;

        $dir = PeepSo::get_peepso_dir()  . 'sse' . $ds . 'events' . $ds . $user_id . $ds;

        $tokens = @scandir($dir);

        if(is_array($tokens) && count($tokens)) {
            foreach($tokens as $token) {
                if(in_array($token, array('.','..'))) {
                    continue;
                }
                $file = $dir.$token.$ds.$event;
                #echo "$file\n";
                $h=fopen($file, 'w');
                fwrite($h, '1');
            }
        }
    }
}