Skip to content
Snippets Groups Projects
Commit d1c28135 authored by Thomas Hackl's avatar Thomas Hackl
Browse files

use token for sysaccount login if given

parent 72b9c0c4
No related branches found
No related tags found
No related merge requests found
......@@ -64,12 +64,14 @@ class MatrixAccount extends SimpleORMap
if (trim(Config::get()->MATRIX_SYSTEM_ACCOUNT_LOGIN_TOKEN) != '') {
$account = new Patrix\Account(trim(Config::get()->MATRIX_SYSTEM_ACCOUNT_USERNAME), '',
trim(Config::get()->MATRIX_SYSTEM_ACCOUNT_LOGIN_TOKEN));
$viaToken = true;
// No token, login by username and password.
} else {
$account = new Patrix\Account(trim(Config::get()->MATRIX_SYSTEM_ACCOUNT_USERNAME),
trim(Config::get()->MATRIX_SYSTEM_ACCOUNT_PASSWORD));
$viaToken = false;
}
MatrixClient::get()->login($account);
MatrixClient::get()->login($account, $viaToken);
return $account;
} else {
......
pluginname=Matrix-Chat
pluginclassname=MatrixPlugin
origin=data-quest
version=1.1.1
version=1.1.2
screenshot=assets/images/matrix_logo.png
description=Matrix chat for Stud.IP courses
studipMinVersion=4.5
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment