Team session for "Analysis and conversation" – server file to run yourself
MY COACHING FOR YOU, https://www.my-coaching4you.de/
Free software under the GNU General Public License, version 3 or later (GPL-3.0-or-later) – see LIZENZ.txt.
Deutsch: siehe LIESMICH.txt.

WHAT IT IS FOR
In the "Analysis and conversation" tool (SWOT, GROW, SOAR, retrospective …) several people can work on the same board
at the same time – the "team session". This needs a server through which the participants' browsers exchange cards,
dots and settings. The file team-sitzung.php in this package is that server.

- In the MC4Y Productivity Suite you do NOT need this file: there the team session runs via the suite's own server.
- Outside the suite the tool has no preset address. You enter the address of your own server yourself.
- MY COACHING FOR YOU does not run a server for team sessions and does not offer one.

WHO IS RESPONSIBLE?
Whoever runs team-sitzung.php on a server is responsible for the data of the team sessions – the participants' names
and the contents of the boards. This usually includes your own privacy notice for the participants and, if a hosting
provider supplies the web space, a data processing agreement with that provider (Art. 28 GDPR). Before starting or
joining, the tool asks for consent: data is stored "on the server entered", and whoever operates it is responsible.

REQUIREMENTS
- Web space with PHP 7.1 or later and the mbstring extension (available at almost every host), reachable via https.
- PHP may create a folder next to team-sitzung.php (or write to the data folder, see below).
- Apache or LiteSpeed (both read .htaccess). With nginx, IIS or Caddy you must enter a data folder outside the web
  root (see "Data folder") – otherwise team-sitzung.php refuses every request so that session files are never exposed.

HOW TO
1. Upload team-sitzung.php to your web space via FTP or SFTP, e.g. as https://www.your-domain.com/team-sitzung.php
2. Open the address in your browser. The reply {"ok":false,"error":"methode"} shows that PHP is running – the file only
   accepts requests from the tool.
3. In the "Analysis and conversation" tool click "Team session", enter the address from step 1 in the "Server address"
   field, type your name, tick the consent box and choose "Start session".
4. Give the code and PIN to the participants. If the tool was opened from a web address, the session window also shows
   a link: it contains the code and the server address, but not the PIN.
5. On the first start team-sitzung.php creates the folder team-sitzungen/ next to it, with an .htaccess that blocks all
   web access. Please check: https://www.your-domain.com/team-sitzungen/_ratelimit.json must answer "403 Forbidden".

WHERE THE TOOL CAN RUN
- As a downloaded file (double-click analyse.html): it connects to your server; team-sitzung.php sends the required
  permission ("Access-Control-Allow-Origin").
- From your own web space: upload analyse.html next to team-sitzung.php.
- In the online version on www.my-coaching4you.de the website's security rules do not allow connections to other
  servers. A team session is not possible there; the tool says so when you try and names the two ways above.

DATA FOLDER (recommended where your host allows it)
At the top of team-sitzung.php:   const DATENORDNER = '/path/outside/the/web/root/team-sitzungen';
or set the environment variable MC4Y_TEAM_ORDNER. A missing folder is created.

WHAT IS STORED
One file <CODE>.json per session: the board contents (cards, dots, field names, notes, title, date, focus, timebox),
the names of the people currently taking part with the time of their last activity (the entry disappears after about
30 seconds without activity), PIN and leader key only as hash values. To limit requests, the file _ratelimit.json holds
a hash of the IP address for one minute. No cookies.
Deletion: "End and delete session for everyone" deletes immediately. Otherwise team-sitzung.php deletes sessions 7 days
after the last activity – checked whenever the file is called again (at most once an hour). If it is not called for a
long time, an expired session stays until then; to rule this out, delete the folder by hand or have your host call the
address daily. The host's server log files (with IP addresses) are independent of this.

LIABILITY
team-sitzung.php is provided free of charge and without warranty (see LIZENZ.txt). Liability for damage resulting from
its use, in particular data loss, is limited to intent and gross negligence; liability for injury to life, body or
health and mandatory statutory liability remain unaffected. Operation, security and updates of the server are your
responsibility. Please do not enter particularly sensitive data (e.g. health information) in team sessions.
