diff --git a/MatrixConnection.php b/MatrixConnection.php index e97a39e..e6c52bc 100644 --- a/MatrixConnection.php +++ b/MatrixConnection.php @@ -127,9 +127,7 @@ class MatrixMessage private $message; function __construct() { - $this->message = array( - "msgtype" => "m.notice", - ); + $this->message = ["msgtype" => "m.notice"]; } function set_type($msgtype) { diff --git a/config.sample.php b/config.sample.php index 9717915..6028e67 100644 --- a/config.sample.php +++ b/config.sample.php @@ -1,26 +1,26 @@ "example.com", - "access_token" => "To be used for sending the registration notification", + "homeserver" => "example.com", + "access_token" => "To be used for sending the registration notification", - // Which e-mail-adresse shall the bot use to send e-mails? - "register_email" => 'register_bot@example.com', - // Where should the bot post registration requests to? - "register_room" => '$registerRoomID:example.com', + // Which e-mail-adresse shall the bot use to send e-mails? + "register_email" => 'register_bot@example.com', + // Where should the bot post registration requests to? + "register_room" => '$registerRoomID:example.com', - // Where is the public part of the bot located? make sure you have a / at the end - "webroot" => "https://myregisterdomain.net/", + // Where is the public part of the bot located? make sure you have a / at the end + "webroot" => "https://myregisterdomain.net/", - // optional: Do you have a place where howTo's are located? If not leave this value out - "howToURL" => "https://my-url-for-storing-howTos.net", + // optional: Do you have a place where howTo's are located? If not leave this value out + "howToURL" => "https://my-url-for-storing-howTos.net", - // When you want to collect the password on registration set this to true - "getPasswordOnRegistration" => false, + // When you want to collect the password on registration set this to true + "getPasswordOnRegistration" => false, - // to define where the data should be stored: - "databaseURI" => "sqlite:" . dirname(__FILE__) . "/db_file.sqlite", - // credentials for sqlite not used - "databaseUser" => "dbUser123", - "databasePass" => "secretPassword", + // to define where the data should be stored: + "databaseURI" => "sqlite:" . dirname(__FILE__) . "/db_file.sqlite", + // credentials for sqlite not used + "databaseUser" => "dbUser123", + "databasePass" => "secretPassword", ] ?> diff --git a/internal/login.php b/internal/login.php index 3bf36d1..3219255 100644 --- a/internal/login.php +++ b/internal/login.php @@ -15,14 +15,6 @@ abstract class LoginRequester { $loginRequester = LoginRequester::UNDEFINED; try { - $input = json_decode(' - { - "user": { - "id": "@matrix.id.of.the.user:example.com", - "password": "passwordOfTheUser" - } - } - ',true); $inputJSON = file_get_contents('php://input'); $input = json_decode($inputJSON, TRUE); $mxid = NULL; @@ -101,7 +93,7 @@ try { } } catch (Exception $e) { error_log("Auth failed with error: " . $e->getMessage()); - //$response["auth"]["error"] = $e->getMessage(); + $response["auth"]["error"] = $e->getMessage(); } print (json_encode($response, JSON_PRETTY_PRINT) . "\n"); -?> \ No newline at end of file +?>