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