<?php
-/*
+/**
* ejabberd extauth script for the integration with friendica
*
* Originally written for joomla by Dalibor Karlovic <dado@krizevci.info>
namespace Friendica\Util;
-use Friendica\Core\Config;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\User;
*/
public function __construct()
{
- $this->bDebug = (int) Config::get('jabber', 'debug');
+ $this->bDebug = (int) DI::config()->get('jabber', 'debug');
openlog('auth_ejabberd', LOG_PID, LOG_USER);
}
$iHeader = fgets(STDIN, 3);
+ if (empty($iHeader)) {
+ $this->writeLog(LOG_ERR, 'empty stdin');
+ return;
+ }
+
$aLength = unpack('n', $iHeader);
$iLength = $aLength['1'];
$this->host = $host;
- $lockpath = Config::get('jabber', 'lockpath');
+ $lockpath = DI::config()->get('jabber', 'lockpath');
if (is_null($lockpath)) {
$this->writeLog(LOG_INFO, 'No lockpath defined.');
return;