NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Trace

data/web/inc/sessions.inc.php

Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.

sessions.inc.php on main
Author Date Commit Line Code
Kristian Feldsam over 3 years ago 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
1
<?php
Open commit View diff
1 <?php
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
2
// Start session
Open commit View diff
2 // Start session
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
3
if (session_status() !== PHP_SESSION_ACTIVE) {
Open commit View diff
3 if (session_status() !== PHP_SESSION_ACTIVE) {
FreddleSpl0it 10 months ago 1ef0149

[Web] make SameSite policy and cookie name configurable via vars.local.inc

Full commit hash
1ef014907625d39232ab6df6145419d7b3af32c4
Author
FreddleSpl0it <[email protected]>
Date
10 months ago
Selected line
4
  session_name($SESSION_NAME);
Open commit View diff
4 session_name($SESSION_NAME);
Kristian Feldsam over 3 years ago 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
5
  ini_set("session.cookie_httponly", 1);
Open commit View diff
5 ini_set("session.cookie_httponly", 1);
FreddleSpl0it 10 months ago 1ef0149

[Web] make SameSite policy and cookie name configurable via vars.local.inc

Full commit hash
1ef014907625d39232ab6df6145419d7b3af32c4
Author
FreddleSpl0it <[email protected]>
Date
10 months ago
Selected line
6
  ini_set("session.cookie_samesite", $SESSION_SAMESITE_POLICY);
Open commit View diff
6 ini_set("session.cookie_samesite", $SESSION_SAMESITE_POLICY);
Kristian Feldsam over 3 years ago 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
7
  ini_set('session.gc_maxlifetime', $SESSION_LIFETIME);
Open commit View diff
7 ini_set('session.gc_maxlifetime', $SESSION_LIFETIME);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
8
}
Open commit View diff
8 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
9
Open commit View diff
9
FreddleSpl0it over 1 year ago 8048e0a

[Web] Fix permission exception in IdP actions

Full commit hash
8048e0a53c793ed587cba0b5ee5eadb80efed88e
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
10
$_SESSION['access_all_exception'] = '0';
Open commit View diff
10 $_SESSION['access_all_exception'] = '0';
same change 8048e0a

[Web] Fix permission exception in IdP actions

Full commit hash
8048e0a53c793ed587cba0b5ee5eadb80efed88e
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
11
Open commit View diff
11
Kristian Feldsam over 3 years ago 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
12
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
Open commit View diff
12 if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
13
  strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == "https") {
Open commit View diff
13 strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == "https") {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
14
  if (session_status() !== PHP_SESSION_ACTIVE) {
Open commit View diff
14 if (session_status() !== PHP_SESSION_ACTIVE) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
15
    ini_set("session.cookie_secure", 1);
Open commit View diff
15 ini_set("session.cookie_secure", 1);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
16
  }
Open commit View diff
16 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
17
  $IS_HTTPS = true;
Open commit View diff
17 $IS_HTTPS = true;
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
18
}
Open commit View diff
18 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
19
elseif (isset($_SERVER['HTTPS'])) {
Open commit View diff
19 elseif (isset($_SERVER['HTTPS'])) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
20
  if (session_status() !== PHP_SESSION_ACTIVE) {
Open commit View diff
20 if (session_status() !== PHP_SESSION_ACTIVE) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
21
    ini_set("session.cookie_secure", 1);
Open commit View diff
21 ini_set("session.cookie_secure", 1);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
22
  }
Open commit View diff
22 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
23
  $IS_HTTPS = true;
Open commit View diff
23 $IS_HTTPS = true;
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
24
}
Open commit View diff
24 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
25
else {
Open commit View diff
25 else {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
26
  $IS_HTTPS = false;
Open commit View diff
26 $IS_HTTPS = false;
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
27
}
Open commit View diff
27 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
28
Open commit View diff
28
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
29
if (session_status() !== PHP_SESSION_ACTIVE) {
Open commit View diff
29 if (session_status() !== PHP_SESSION_ACTIVE) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
30
  session_start();
Open commit View diff
30 session_start();
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
31
}
Open commit View diff
31 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
32
Open commit View diff
32
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
33
if (!isset($_SESSION['CSRF']['TOKEN'])) {
Open commit View diff
33 if (!isset($_SESSION['CSRF']['TOKEN'])) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
34
  $_SESSION['CSRF']['TOKEN'] = bin2hex(random_bytes(32));
Open commit View diff
34 $_SESSION['CSRF']['TOKEN'] = bin2hex(random_bytes(32));
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
35
}
Open commit View diff
35 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
36
Open commit View diff
36
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
37
// Set session UA
Open commit View diff
37 // Set session UA
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
38
if (!isset($_SESSION['SESS_REMOTE_UA'])) {
Open commit View diff
38 if (!isset($_SESSION['SESS_REMOTE_UA'])) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
39
  $_SESSION['SESS_REMOTE_UA'] = $_SERVER['HTTP_USER_AGENT'];
Open commit View diff
39 $_SESSION['SESS_REMOTE_UA'] = $_SERVER['HTTP_USER_AGENT'];
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
40
}
Open commit View diff
40 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
41
Open commit View diff
41
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
42
// Keep session active
Open commit View diff
42 // Keep session active
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
43
if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > $SESSION_LIFETIME)) {
Open commit View diff
43 if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > $SESSION_LIFETIME)) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
44
  session_unset();
Open commit View diff
44 session_unset();
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
45
  session_destroy();
Open commit View diff
45 session_destroy();
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
46
}
Open commit View diff
46 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
47
$_SESSION['LAST_ACTIVITY'] = time();
Open commit View diff
47 $_SESSION['LAST_ACTIVITY'] = time();
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
48
Open commit View diff
48
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
49
// API
Open commit View diff
49 // API
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
50
if (!empty($_SERVER['HTTP_X_API_KEY'])) {
Open commit View diff
50 if (!empty($_SERVER['HTTP_X_API_KEY'])) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
51
  $stmt = $pdo->prepare("SELECT * FROM `api` WHERE `api_key` = :api_key AND `active` = '1';");
Open commit View diff
51 $stmt = $pdo->prepare("SELECT * FROM `api` WHERE `api_key` = :api_key AND `active` = '1';");
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
52
  $stmt->execute(array(
Open commit View diff
52 $stmt->execute(array(
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
53
    ':api_key' => preg_replace('/[^a-zA-Z0-9-]/', '', $_SERVER['HTTP_X_API_KEY'])
Open commit View diff
53 ':api_key' => preg_replace('/[^a-zA-Z0-9-]/', '', $_SERVER['HTTP_X_API_KEY'])
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
54
  ));
Open commit View diff
54 ));
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
55
  $api_return = $stmt->fetch(PDO::FETCH_ASSOC);
Open commit View diff
55 $api_return = $stmt->fetch(PDO::FETCH_ASSOC);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
56
  if (!empty($api_return['api_key'])) {
Open commit View diff
56 if (!empty($api_return['api_key'])) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
57
    $skip_ip_check = ($api_return['skip_ip_check'] == 1);
Open commit View diff
57 $skip_ip_check = ($api_return['skip_ip_check'] == 1);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
58
    $remote = get_remote_ip(false);
Open commit View diff
58 $remote = get_remote_ip(false);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
59
    $allow_from = array_map('trim', preg_split( "/( |,|;|\n)/", $api_return['allow_from']));
Open commit View diff
59 $allow_from = array_map('trim', preg_split( "/( |,|;|\n)/", $api_return['allow_from']));
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
60
    if ($skip_ip_check === true || ip_acl($remote, $allow_from)) {
Open commit View diff
60 if ($skip_ip_check === true || ip_acl($remote, $allow_from)) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
61
      $_SESSION['mailcow_cc_username'] = 'API';
Open commit View diff
61 $_SESSION['mailcow_cc_username'] = 'API';
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
62
      $_SESSION['mailcow_cc_role'] = 'admin';
Open commit View diff
62 $_SESSION['mailcow_cc_role'] = 'admin';
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
63
      $_SESSION['mailcow_cc_api'] = true;
Open commit View diff
63 $_SESSION['mailcow_cc_api'] = true;
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
64
      if ($api_return['access'] == 'rw') {
Open commit View diff
64 if ($api_return['access'] == 'rw') {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
65
        $_SESSION['mailcow_cc_api_access'] = 'rw';
Open commit View diff
65 $_SESSION['mailcow_cc_api_access'] = 'rw';
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
66
      }
Open commit View diff
66 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
67
      else {
Open commit View diff
67 else {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
68
        $_SESSION['mailcow_cc_api_access'] = 'ro';
Open commit View diff
68 $_SESSION['mailcow_cc_api_access'] = 'ro';
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
69
      }
Open commit View diff
69 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
70
    }
Open commit View diff
70 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
71
    else {
Open commit View diff
71 else {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
72
      $redis->publish("F2B_CHANNEL", "mailcow UI: Invalid password for API_USER by " . $_SERVER['REMOTE_ADDR']);
Open commit View diff
72 $redis->publish("F2B_CHANNEL", "mailcow UI: Invalid password for API_USER by " . $_SERVER['REMOTE_ADDR']);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
73
      error_log("mailcow UI: Invalid password for " . $user . " by " . $_SERVER['REMOTE_ADDR']);
Open commit View diff
73 error_log("mailcow UI: Invalid password for " . $user . " by " . $_SERVER['REMOTE_ADDR']);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
74
      http_response_code(401);
Open commit View diff
74 http_response_code(401);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
75
      echo json_encode(array(
Open commit View diff
75 echo json_encode(array(
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
76
        'type' => 'error',
Open commit View diff
76 'type' => 'error',
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
77
        'msg' => 'api access denied for ip ' . $_SERVER['REMOTE_ADDR']
Open commit View diff
77 'msg' => 'api access denied for ip ' . $_SERVER['REMOTE_ADDR']
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
78
      ));
Open commit View diff
78 ));
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
79
      unset($_POST);
Open commit View diff
79 unset($_POST);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
80
      exit();
Open commit View diff
80 exit();
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
81
    }
Open commit View diff
81 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
82
  }
Open commit View diff
82 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
83
  else {
Open commit View diff
83 else {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
84
    $redis->publish("F2B_CHANNEL", "mailcow UI: Invalid password for API_USER by " . $_SERVER['REMOTE_ADDR']);
Open commit View diff
84 $redis->publish("F2B_CHANNEL", "mailcow UI: Invalid password for API_USER by " . $_SERVER['REMOTE_ADDR']);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
85
    error_log("mailcow UI: Invalid password for " . $user . " by " . $_SERVER['REMOTE_ADDR']);
Open commit View diff
85 error_log("mailcow UI: Invalid password for " . $user . " by " . $_SERVER['REMOTE_ADDR']);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
86
    http_response_code(401);
Open commit View diff
86 http_response_code(401);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
87
    echo json_encode(array(
Open commit View diff
87 echo json_encode(array(
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
88
      'type' => 'error',
Open commit View diff
88 'type' => 'error',
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
89
      'msg' => 'authentication failed'
Open commit View diff
89 'msg' => 'authentication failed'
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
90
    ));
Open commit View diff
90 ));
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
91
    unset($_POST);
Open commit View diff
91 unset($_POST);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
92
    exit();
Open commit View diff
92 exit();
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
93
  }
Open commit View diff
93 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
94
}
Open commit View diff
94 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
95
Open commit View diff
95
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
96
// Handle logouts
Open commit View diff
96 // Handle logouts
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
97
if (isset($_POST["logout"])) {
Open commit View diff
97 if (isset($_POST["logout"])) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
98
  if (isset($_SESSION["dual-login"])) {
Open commit View diff
98 if (isset($_SESSION["dual-login"])) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
99
    $_SESSION["mailcow_cc_username"] = $_SESSION["dual-login"]["username"];
Open commit View diff
99 $_SESSION["mailcow_cc_username"] = $_SESSION["dual-login"]["username"];
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
100
    $_SESSION["mailcow_cc_role"] = $_SESSION["dual-login"]["role"];
Open commit View diff
100 $_SESSION["mailcow_cc_role"] = $_SESSION["dual-login"]["role"];
FreddleSpl0it over 2 years ago a06c783

[Web] add ldap idp

Full commit hash
a06c78362a29eba6c5ecf1e4a2a6a65362301e1f
Author
FreddleSpl0it <[email protected]>
Date
over 2 years ago
Selected line
101
    unset($_SESSION['sogo-sso-user-allowed']);
Open commit View diff
101 unset($_SESSION['sogo-sso-user-allowed']);
same change a06c783

[Web] add ldap idp

Full commit hash
a06c78362a29eba6c5ecf1e4a2a6a65362301e1f
Author
FreddleSpl0it <[email protected]>
Date
over 2 years ago
Selected line
102
    unset($_SESSION['sogo-sso-pass']);
Open commit View diff
102 unset($_SESSION['sogo-sso-pass']);
Kristian Feldsam over 3 years ago 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
103
    unset($_SESSION["dual-login"]);
Open commit View diff
103 unset($_SESSION["dual-login"]);
FreddleSpl0it over 1 year ago aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
104
    if ($_SESSION["mailcow_cc_role"] == "admin"){
Open commit View diff
104 if ($_SESSION["mailcow_cc_role"] == "admin"){
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
105
      header("Location: /admin/mailbox");
Open commit View diff
105 header("Location: /admin/mailbox");
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
106
    } elseif ($_SESSION["mailcow_cc_role"] == "domainadmin") {
Open commit View diff
106 } elseif ($_SESSION["mailcow_cc_role"] == "domainadmin") {
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
107
      header("Location: /domainadmin/mailbox");
Open commit View diff
107 header("Location: /domainadmin/mailbox");
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
108
    } else {
Open commit View diff
108 } else {
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
109
      header("Location: /");
Open commit View diff
109 header("Location: /");
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
110
    }
Open commit View diff
110 }
Kristian Feldsam over 3 years ago 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
111
    exit();
Open commit View diff
111 exit();
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
112
  }
Open commit View diff
112 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
113
  else {
Open commit View diff
113 else {
FreddleSpl0it over 1 year ago aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
114
    $role = $_SESSION["mailcow_cc_role"];
Open commit View diff
114 $role = $_SESSION["mailcow_cc_role"];
Kristian Feldsam over 3 years ago 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
115
    session_regenerate_id(true);
Open commit View diff
115 session_regenerate_id(true);
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
116
    session_unset();
Open commit View diff
116 session_unset();
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
117
    session_destroy();
Open commit View diff
117 session_destroy();
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
118
    session_write_close();
Open commit View diff
118 session_write_close();
FreddleSpl0it over 1 year ago aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
119
    if ($role == "admin") {
Open commit View diff
119 if ($role == "admin") {
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
120
      header("Location: /admin");
Open commit View diff
120 header("Location: /admin");
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
121
    }
Open commit View diff
121 }
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
122
    elseif ($role == "domainadmin") {
Open commit View diff
122 elseif ($role == "domainadmin") {
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
123
      header("Location: /domainadmin");
Open commit View diff
123 header("Location: /domainadmin");
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
124
    }
Open commit View diff
124 }
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
125
    else {
Open commit View diff
125 else {
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
126
      header("Location: /");
Open commit View diff
126 header("Location: /");
same change aca01c8

[Web] Separate Login pages

Full commit hash
aca01c8aa2607777205226a86be29df338eb51d9
Author
FreddleSpl0it <[email protected]>
Date
over 1 year ago
Selected line
127
    }
Open commit View diff
127 }
Kristian Feldsam over 3 years ago 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
128
  }
Open commit View diff
128 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
129
}
Open commit View diff
129 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
130
Open commit View diff
130
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
131
// Check session
Open commit View diff
131 // Check session
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
132
function session_check() {
Open commit View diff
132 function session_check() {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
133
  if (isset($_SESSION['mailcow_cc_api']) && $_SESSION['mailcow_cc_api'] === true) {
Open commit View diff
133 if (isset($_SESSION['mailcow_cc_api']) && $_SESSION['mailcow_cc_api'] === true) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
134
    return true;
Open commit View diff
134 return true;
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
135
  }
Open commit View diff
135 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
136
  if (!isset($_SESSION['SESS_REMOTE_UA']) || ($_SESSION['SESS_REMOTE_UA'] != $_SERVER['HTTP_USER_AGENT'])) {
Open commit View diff
136 if (!isset($_SESSION['SESS_REMOTE_UA']) || ($_SESSION['SESS_REMOTE_UA'] != $_SERVER['HTTP_USER_AGENT'])) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
137
    $_SESSION['return'][] = array(
Open commit View diff
137 $_SESSION['return'][] = array(
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
138
      'type' => 'warning',
Open commit View diff
138 'type' => 'warning',
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
139
      'msg' => 'session_ua'
Open commit View diff
139 'msg' => 'session_ua'
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
140
    );
Open commit View diff
140 );
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
141
    return false;
Open commit View diff
141 return false;
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
142
  }
Open commit View diff
142 }
FreddleSpl0it 5 months ago 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
143
  // Check if this is a POST request (form-encoded or JSON)
Open commit View diff
143 // Check if this is a POST request (form-encoded or JSON)
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
144
  $is_post_request = !empty($_POST) || (
Open commit View diff
144 $is_post_request = !empty($_POST) || (
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
145
    isset($_SERVER['CONTENT_TYPE']) &&
Open commit View diff
145 isset($_SERVER['CONTENT_TYPE']) &&
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
146
    strpos($_SERVER['CONTENT_TYPE'], 'application/json') !== false
Open commit View diff
146 strpos($_SERVER['CONTENT_TYPE'], 'application/json') !== false
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
147
  );
Open commit View diff
147 );
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
148
Open commit View diff
148
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
149
  if ($is_post_request) {
Open commit View diff
149 if ($is_post_request) {
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
150
    // Skip CSRF check for DataTables server-side processing endpoints
Open commit View diff
150 // Skip CSRF check for DataTables server-side processing endpoints
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
151
    // These are read-only operations (equivalent to GET) authenticated by session
Open commit View diff
151 // These are read-only operations (equivalent to GET) authenticated by session
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
152
    $is_search_endpoint = (
Open commit View diff
152 $is_search_endpoint = (
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
153
      isset($_GET['query']) &&
Open commit View diff
153 isset($_GET['query']) &&
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
154
      preg_match('#^search/(domain|mailbox)$#', $_GET['query'])
Open commit View diff
154 preg_match('#^search/(domain|mailbox)$#', $_GET['query'])
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
155
    );
Open commit View diff
155 );
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
156
Open commit View diff
156
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
157
    if (!$is_search_endpoint && !empty($_POST)) {
Open commit View diff
157 if (!$is_search_endpoint && !empty($_POST)) {
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
158
      if ($_SESSION['CSRF']['TOKEN'] != $_POST['csrf_token']) {
Open commit View diff
158 if ($_SESSION['CSRF']['TOKEN'] != $_POST['csrf_token']) {
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
159
        $_SESSION['return'][] = array(
Open commit View diff
159 $_SESSION['return'][] = array(
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
160
          'type' => 'warning',
Open commit View diff
160 'type' => 'warning',
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
161
          'msg' => 'session_token'
Open commit View diff
161 'msg' => 'session_token'
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
162
        );
Open commit View diff
162 );
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
163
        return false;
Open commit View diff
163 return false;
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
164
      }
Open commit View diff
164 }
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
165
      unset($_POST['csrf_token']);
Open commit View diff
165 unset($_POST['csrf_token']);
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
166
      $_SESSION['CSRF']['TOKEN'] = bin2hex(random_bytes(32));
Open commit View diff
166 $_SESSION['CSRF']['TOKEN'] = bin2hex(random_bytes(32));
same change 43f570e

[Web] switch from GET to POST for datatable requests

Full commit hash
43f570e7617dd5925915c05a6f87b1d3a2630dd1
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
167
      $_SESSION['CSRF']['TIME'] = time();
Open commit View diff
167 $_SESSION['CSRF']['TIME'] = time();
Kristian Feldsam over 3 years ago 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
168
    }
Open commit View diff
168 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
169
  }
Open commit View diff
169 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
170
  return true;
Open commit View diff
170 return true;
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
171
}
Open commit View diff
171 }
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
172
Open commit View diff
172
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
173
if (isset($_SESSION['mailcow_cc_role']) && session_check() === false) {
Open commit View diff
173 if (isset($_SESSION['mailcow_cc_role']) && session_check() === false) {
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
174
  $_POST = array();
Open commit View diff
174 $_POST = array();
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
175
  $_FILES = array();
Open commit View diff
175 $_FILES = array();
same change 5bf6248

[Web] Implemented SSO for domain admins

Full commit hash
5bf62481d51d0dcd7b8202f65fc73d2e6d349f93
Author
Kristian Feldsam <[email protected]>
Date
over 3 years ago
Selected line
176
}
Open commit View diff
176 }