| | 87 | |
| | 88 | If you want multiple host domain, but also want to avoid user to be able to sign on domain other than theirs (e.g. Avoid user@domain1.com to be able to log in user@domain2.com) -- because settings of one domain must not be used on other --, it's possible to add session check in host-specific config files : |
| | 89 | {{{ |
| | 90 | // load and check session data |
| | 91 | if (session_id() == '') { |
| | 92 | session_start(); |
| | 93 | } |
| | 94 | |
| | 95 | $username = NULL; |
| | 96 | |
| | 97 | if (isset($_SESSION['auth_time']) && isset($_SESSION['username'])) { |
| | 98 | // is logged in |
| | 99 | $username = $_SESSION['username']; |
| | 100 | } |
| | 101 | }}} |
| | 102 | |
| | 103 | With such code in host-specific config file, you can check {{{$username}}} (and its domain). |