Prosody Module for delivering information about logged in and registered users
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
mod_userstats.lua

README.md

DISCONTINUED!

... in favor of https://github.com/ThomasLeister/mod_serverinfo




\

prosody_mod_userstats

Prosody module for delivering information about logged in and registered users

mod_userstats gives you information about the number of registered and online users on your Prosody XMPP Server. There are two ways to grab the user counts:

Installation

  • (Optional) Specify the path to your module directory in Prosody:

    plugin_paths = { "/opt/prosody-modules" }
    
  • Download the latest Release of this module as an archive

  • Extract the archive to your module directory and rename the new directory to "mod_userstats"

  • Make sure Prosody can access the new directory (chmod -R prosody:prosody /opt/prosody-modules/mod_userstats)

  • Enable mod_userstats in your Prosody configuration:

    modules_enabled = {
      ...
      "userstats";
      ...
    }
    
  • Restart Prosody

Display user counts with PHP and CURL

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'https://yourserver.tld:5281/userstats');
$result = curl_exec($ch);
curl_close($ch);

$obj = json_decode($result);

$onlineusers = $obj->online;
$registeredusers = $obj->registered;

// Now use $onlineusers and $registeredusers ...

?>

Known issues

  • This module does not work with exotic auth mechanisms like "cyrus_sasl".