cliParser->addOption("select-backend <backendidentifier>", 0, "Switch storage backend (migrating data if possible)");
cliParser->addSwitch("add-user", 0, "Starts an interactive session to add a new core user");
cliParser->addOption("change-userpass <username>", 0, "Starts an interactive session to change the password of the user identified by username");
+ cliParser->addSwitch("oidentd", 0, "Enable oidentd integration");
+ cliParser->addOption("oidentd-conffile <file>", 0, "change path to oidentd configuration file");
#endif
#ifdef HAVE_KDE
connect(&_v6server, SIGNAL(newConnection()), this, SLOT(incomingConnection()));
if(!startListening()) exit(1); // TODO make this less brutal
- _oidentdConfigGenerator = new OidentdConfigGenerator(this);
+ if(Quassel::isOptionSet("oidentd"))
+ _oidentdConfigGenerator = new OidentdConfigGenerator(this);
}
Core::~Core() {
connect(&socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
#endif
connect(this, SIGNAL(newEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *)));
- connect(this, SIGNAL(newSocket(const CoreIdentity*,QHostAddress,quint16,QHostAddress,quint16)), Core::instance()->oidentdConfigGenerator(), SLOT(addSocket(const CoreIdentity*,QHostAddress,quint16,QHostAddress,quint16)));
+
+ if(Quassel::isOptionSet("oidentd"))
+ connect(this, SIGNAL(newSocket(const CoreIdentity*,QHostAddress,quint16,QHostAddress,quint16)), Core::instance()->oidentdConfigGenerator(), SLOT(addSocket(const CoreIdentity*,QHostAddress,quint16,QHostAddress,quint16)));
}
CoreNetwork::~CoreNetwork() {
bool OidentdConfigGenerator::init() {
configDir = QDir::homePath();
configFileName = ".oidentd.conf";
+
+ if(Quassel::isOptionSet("oidentd-conffile"))
+ configPath = Quassel::optionValue("oidentd-conffile");
+ else
+ configPath = configDir.absoluteFilePath(configFileName);
+
configTag = " stanza created by Quassel";
- _configFile = new QFile(configDir.absoluteFilePath(configFileName));
+ _configFile = new QFile(configPath);
qDebug() << "1: _configFile" << _configFile->fileName();
quasselStanza = QRegExp(QString("^lport .* { .* } #%1$").arg(configTag));
#include <QDateTime>
#include <QHostAddress>
+#include "quassel.h"
#include "coreidentity.h"
#include <QDebug>
public:
explicit OidentdConfigGenerator(QObject *parent = 0);
- QDir configDir;
- QString configFileName;
-
signals:
public slots:
QFile *_configFile;
QByteArray _config;
+ QDir configDir;
+ QString configFileName;
+ QString configPath;
QString configTag;
-
QRegExp quasselStanza;
};