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/functions.domain_admin.inc.php

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

functions.domain_admin.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
function domain_admin($_action, $_data = null) {
Open commit View diff
2 function domain_admin($_action, $_data = null) {
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
  global $pdo;
Open commit View diff
3 global $pdo;
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
4
  global $lang;
Open commit View diff
4 global $lang;
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
5
  $_data_log = $_data;
Open commit View diff
5 $_data_log = $_data;
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
6
  !isset($_data_log['password']) ?: $_data_log['password'] = '*';
Open commit View diff
6 !isset($_data_log['password']) ?: $_data_log['password'] = '*';
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
7
  !isset($_data_log['password2']) ?: $_data_log['password2'] = '*';
Open commit View diff
7 !isset($_data_log['password2']) ?: $_data_log['password2'] = '*';
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
  !isset($_data_log['user_old_pass']) ?: $_data_log['user_old_pass'] = '*';
Open commit View diff
8 !isset($_data_log['user_old_pass']) ?: $_data_log['user_old_pass'] = '*';
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
  !isset($_data_log['user_new_pass']) ?: $_data_log['user_new_pass'] = '*';
Open commit View diff
9 !isset($_data_log['user_new_pass']) ?: $_data_log['user_new_pass'] = '*';
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
10
  !isset($_data_log['user_new_pass2']) ?: $_data_log['user_new_pass2'] = '*';
Open commit View diff
10 !isset($_data_log['user_new_pass2']) ?: $_data_log['user_new_pass2'] = '*';
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
11
  switch ($_action) {
Open commit View diff
11 switch ($_action) {
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
12
    case 'add':
Open commit View diff
12 case 'add':
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
      $username		= strtolower(trim($_data['username']));
Open commit View diff
13 $username = strtolower(trim($_data['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
14
      $password		= $_data['password'];
Open commit View diff
14 $password = $_data['password'];
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
      $password2  = $_data['password2'];
Open commit View diff
15 $password2 = $_data['password2'];
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
      $domains    = (array)$_data['domains'];
Open commit View diff
16 $domains = (array)$_data['domains'];
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
      $active     = intval($_data['active']);
Open commit View diff
17 $active = intval($_data['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
18
      if ($_SESSION['mailcow_cc_role'] != "admin") {
Open commit View diff
18 if ($_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
19
        $_SESSION['return'][] = array(
Open commit View diff
19 $_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
20
          'type' => 'danger',
Open commit View diff
20 'type' => 'danger',
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
          'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
21 'log' => array(__FUNCTION__, $_action, $_data_log),
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
          'msg' => 'access_denied'
Open commit View diff
22 'msg' => 'access_denied'
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
        );
Open commit View diff
23 );
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
        return false;
Open commit View diff
24 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
25
      }
Open commit View diff
25 }
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
      if (empty($domains)) {
Open commit View diff
26 if (empty($domains)) {
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
        $_SESSION['return'][] = array(
Open commit View diff
27 $_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
28
          'type' => 'danger',
Open commit View diff
28 'type' => 'danger',
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
          'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
29 'log' => array(__FUNCTION__, $_action, $_data_log),
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
          'msg' => 'domain_invalid'
Open commit View diff
30 'msg' => 'domain_invalid'
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
        return false;
Open commit View diff
32 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
33
      }
Open commit View diff
33 }
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
      if (!ctype_alnum(str_replace(array('_', '.', '-'), '', $username)) || empty ($username) || $username == 'API') {
Open commit View diff
34 if (!ctype_alnum(str_replace(array('_', '.', '-'), '', $username)) || empty ($username) || $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
35
        $_SESSION['return'][] = array(
Open commit View diff
35 $_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
36
          'type' => 'danger',
Open commit View diff
36 'type' => 'danger',
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
          'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
37 'log' => array(__FUNCTION__, $_action, $_data_log),
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
          'msg' => array('username_invalid', $username)
Open commit View diff
38 'msg' => array('username_invalid', $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
39
        );
Open commit View diff
39 );
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
        return false;
Open commit View diff
40 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
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
Open commit View diff
42
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
      $stmt = $pdo->prepare("SELECT `username` FROM `mailbox`
Open commit View diff
43 $stmt = $pdo->prepare("SELECT `username` FROM `mailbox`
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
        WHERE `username` = :username");
Open commit View diff
44 WHERE `username` = :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
45
      $stmt->execute(array(':username' => $username));
Open commit View diff
45 $stmt->execute(array(':username' => $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
46
      $num_results[] = count($stmt->fetchAll(PDO::FETCH_ASSOC));
Open commit View diff
46 $num_results[] = count($stmt->fetchAll(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
47
Open commit View diff
47
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
      $stmt = $pdo->prepare("SELECT `username` FROM `admin`
Open commit View diff
48 $stmt = $pdo->prepare("SELECT `username` FROM `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
49
        WHERE `username` = :username");
Open commit View diff
49 WHERE `username` = :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
50
      $stmt->execute(array(':username' => $username));
Open commit View diff
50 $stmt->execute(array(':username' => $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
51
      $num_results[] = count($stmt->fetchAll(PDO::FETCH_ASSOC));
Open commit View diff
51 $num_results[] = count($stmt->fetchAll(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
52
Open commit View diff
52
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
      $stmt = $pdo->prepare("SELECT `username` FROM `domain_admins`
Open commit View diff
53 $stmt = $pdo->prepare("SELECT `username` FROM `domain_admins`
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
        WHERE `username` = :username");
Open commit View diff
54 WHERE `username` = :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
55
      $stmt->execute(array(':username' => $username));
Open commit View diff
55 $stmt->execute(array(':username' => $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
56
      $num_results[] = count($stmt->fetchAll(PDO::FETCH_ASSOC));
Open commit View diff
56 $num_results[] = count($stmt->fetchAll(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
57
Open commit View diff
57
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
      foreach ($num_results as $num_results_each) {
Open commit View diff
58 foreach ($num_results as $num_results_each) {
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
        if ($num_results_each != 0) {
Open commit View diff
59 if ($num_results_each != 0) {
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
          $_SESSION['return'][] = array(
Open commit View diff
60 $_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
61
            'type' => 'danger',
Open commit View diff
61 'type' => 'danger',
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
            'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
62 'log' => array(__FUNCTION__, $_action, $_data_log),
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
            'msg' => array('object_exists', htmlspecialchars($username))
Open commit View diff
63 'msg' => array('object_exists', htmlspecialchars($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
64
          );
Open commit View diff
64 );
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
          return false;
Open commit View diff
65 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
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
      }
Open commit View diff
67 }
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
      if (password_check($password, $password2) !== true) {
Open commit View diff
68 if (password_check($password, $password2) !== 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
69
        continue;
Open commit View diff
69 continue;
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
      $password_hashed = hash_password($password);
Open commit View diff
71 $password_hashed = hash_password($password);
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
      $valid_domains = 0;
Open commit View diff
72 $valid_domains = 0;
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
      foreach ($domains as $domain) {
Open commit View diff
73 foreach ($domains as $domain) {
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
        if (!is_valid_domain_name($domain) || mailbox('get', 'domain_details', $domain) === false) {
Open commit View diff
74 if (!is_valid_domain_name($domain) || mailbox('get', 'domain_details', $domain) === 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
75
          $_SESSION['return'][] = array(
Open commit View diff
75 $_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
76
            'type' => 'danger',
Open commit View diff
76 'type' => 'danger',
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
            'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
77 'log' => array(__FUNCTION__, $_action, $_data_log),
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
            'msg' => array('domain_invalid', htmlspecialchars($domain))
Open commit View diff
78 'msg' => array('domain_invalid', htmlspecialchars($domain))
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
          );
Open commit View diff
79 );
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
          continue;
Open commit View diff
80 continue;
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
        $valid_domains++;
Open commit View diff
82 $valid_domains++;
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
        $stmt = $pdo->prepare("INSERT INTO `domain_admins` (`username`, `domain`, `created`, `active`)
Open commit View diff
83 $stmt = $pdo->prepare("INSERT INTO `domain_admins` (`username`, `domain`, `created`, `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
84
            VALUES (:username, :domain, :created, :active)");
Open commit View diff
84 VALUES (:username, :domain, :created, :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
85
        $stmt->execute(array(
Open commit View diff
85 $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
86
          ':username' => $username,
Open commit View diff
86 ':username' => $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
87
          ':domain' => $domain,
Open commit View diff
87 ':domain' => $domain,
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
          ':created' => date('Y-m-d H:i:s'),
Open commit View diff
88 ':created' => date('Y-m-d H:i:s'),
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
          ':active' => $active
Open commit View diff
89 ':active' => $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
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
      }
Open commit View diff
91 }
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
      if ($valid_domains != 0) {
Open commit View diff
92 if ($valid_domains != 0) {
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
        $stmt = $pdo->prepare("INSERT INTO `admin` (`username`, `password`, `superadmin`, `active`)
Open commit View diff
93 $stmt = $pdo->prepare("INSERT INTO `admin` (`username`, `password`, `superadmin`, `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
94
          VALUES (:username, :password_hashed, '0', :active)");
Open commit View diff
94 VALUES (:username, :password_hashed, '0', :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
95
        $stmt->execute(array(
Open commit View diff
95 $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
96
          ':username' => $username,
Open commit View diff
96 ':username' => $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
97
          ':password_hashed' => $password_hashed,
Open commit View diff
97 ':password_hashed' => $password_hashed,
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
          ':active' => $active
Open commit View diff
98 ':active' => $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
99
        ));
Open commit View diff
99 ));
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
      }
Open commit View diff
100 }
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
101
      $stmt = $pdo->prepare("INSERT INTO `da_acl` (`username`) VALUES (:username)");
Open commit View diff
101 $stmt = $pdo->prepare("INSERT INTO `da_acl` (`username`) VALUES (: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
102
      $stmt->execute(array(
Open commit View diff
102 $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
103
        ':username' => $username
Open commit View diff
103 ':username' => $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
104
      ));
Open commit View diff
104 ));
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
105
      $_SESSION['return'][] = array(
Open commit View diff
105 $_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
106
        'type' => 'success',
Open commit View diff
106 'type' => 'success',
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
107
        'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
107 'log' => array(__FUNCTION__, $_action, $_data_log),
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
108
        'msg' => array('domain_admin_added', htmlspecialchars($username))
Open commit View diff
108 'msg' => array('domain_admin_added', htmlspecialchars($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
109
      );
Open commit View diff
109 );
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
110
    break;
Open commit View diff
110 break;
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
111
    case 'edit':
Open commit View diff
111 case 'edit':
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
      if ($_SESSION['mailcow_cc_role'] != "admin" && $_SESSION['mailcow_cc_role'] != "domainadmin") {
Open commit View diff
112 if ($_SESSION['mailcow_cc_role'] != "admin" && $_SESSION['mailcow_cc_role'] != "domainadmin") {
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
        $_SESSION['return'][] = array(
Open commit View diff
113 $_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
114
          'type' => 'danger',
Open commit View diff
114 'type' => 'danger',
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
115
          'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
115 'log' => array(__FUNCTION__, $_action, $_data_log),
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
          'msg' => 'access_denied'
Open commit View diff
116 'msg' => 'access_denied'
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
        );
Open commit View diff
117 );
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
        return false;
Open commit View diff
118 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
119
      }
Open commit View diff
119 }
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
120
      // Administrator
Open commit View diff
120 // Administrator
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
121
      if ($_SESSION['mailcow_cc_role'] == "admin") {
Open commit View diff
121 if ($_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
122
        if (!is_array($_data['username'])) {
Open commit View diff
122 if (!is_array($_data['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
123
          $usernames = array();
Open commit View diff
123 $usernames = 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
124
          $usernames[] = $_data['username'];
Open commit View diff
124 $usernames[] = $_data['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
125
        }
Open commit View diff
125 }
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
126
        else {
Open commit View diff
126 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
127
          $usernames = $_data['username'];
Open commit View diff
127 $usernames = $_data['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
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
        foreach ($usernames as $username) {
Open commit View diff
129 foreach ($usernames as $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
130
          $is_now = domain_admin('details', $username);
Open commit View diff
130 $is_now = domain_admin('details', $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
131
          $domains = (isset($_data['domains'])) ? (array)$_data['domains'] : null;
Open commit View diff
131 $domains = (isset($_data['domains'])) ? (array)$_data['domains'] : null;
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
          if (!empty($is_now)) {
Open commit View diff
132 if (!empty($is_now)) {
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
            $active = (isset($_data['active'])) ? intval($_data['active']) : $is_now['active'];
Open commit View diff
133 $active = (isset($_data['active'])) ? intval($_data['active']) : $is_now['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
134
            $domains = (!empty($domains)) ? $domains : $is_now['selected_domains'];
Open commit View diff
134 $domains = (!empty($domains)) ? $domains : $is_now['selected_domains'];
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
            $username_new = (!empty($_data['username_new'])) ? $_data['username_new'] : $is_now['username'];
Open commit View diff
135 $username_new = (!empty($_data['username_new'])) ? $_data['username_new'] : $is_now['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
136
          }
Open commit View diff
136 }
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
          else {
Open commit View diff
137 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
138
            $_SESSION['return'][] = array(
Open commit View diff
138 $_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
139
              'type' => 'danger',
Open commit View diff
139 'type' => 'danger',
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
              'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
140 'log' => array(__FUNCTION__, $_action, $_data_log),
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
              'msg' => 'access_denied'
Open commit View diff
141 'msg' => 'access_denied'
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 );
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
143
            continue;
Open commit View diff
143 continue;
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
144
          }
Open commit View diff
144 }
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
145
          $password     = $_data['password'];
Open commit View diff
145 $password = $_data['password'];
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
146
          $password2    = $_data['password2'];
Open commit View diff
146 $password2 = $_data['password2'];
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
147
          if (!empty($domains)) {
Open commit View diff
147 if (!empty($domains)) {
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
148
            foreach ($domains as $domain) {
Open commit View diff
148 foreach ($domains as $domain) {
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
149
              if (!is_valid_domain_name($domain) || mailbox('get', 'domain_details', $domain) === false) {
Open commit View diff
149 if (!is_valid_domain_name($domain) || mailbox('get', 'domain_details', $domain) === 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
150
                $_SESSION['return'][] = array(
Open commit View diff
150 $_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
151
                  'type' => 'danger',
Open commit View diff
151 'type' => 'danger',
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
152
                  'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
152 'log' => array(__FUNCTION__, $_action, $_data_log),
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
153
                  'msg' => array('domain_invalid', htmlspecialchars($domain))
Open commit View diff
153 'msg' => array('domain_invalid', htmlspecialchars($domain))
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
154
                );
Open commit View diff
154 );
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
155
                continue 2;
Open commit View diff
155 continue 2;
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
156
              }
Open commit View diff
156 }
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
157
            }
Open commit View diff
157 }
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
158
          }
Open commit View diff
158 }
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
159
          if (!ctype_alnum(str_replace(array('_', '.', '-'), '', $username_new))) {
Open commit View diff
159 if (!ctype_alnum(str_replace(array('_', '.', '-'), '', $username_new))) {
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
160
            $_SESSION['return'][] = array(
Open commit View diff
160 $_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
161
              'type' => 'danger',
Open commit View diff
161 'type' => 'danger',
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
162
              'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
162 'log' => array(__FUNCTION__, $_action, $_data_log),
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
163
              'msg' => array('username_invalid', $username_new)
Open commit View diff
163 'msg' => array('username_invalid', $username_new)
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
164
            );
Open commit View diff
164 );
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
165
            continue;
Open commit View diff
165 continue;
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
166
          }
Open commit View diff
166 }
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
167
          if ($username_new != $username) {
Open commit View diff
167 if ($username_new != $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
168
            if (!empty(domain_admin('details', $username_new)['username'])) {
Open commit View diff
168 if (!empty(domain_admin('details', $username_new)['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
169
              $_SESSION['return'][] = array(
Open commit View diff
169 $_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
170
                'type' => 'danger',
Open commit View diff
170 'type' => 'danger',
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
                'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
171 'log' => array(__FUNCTION__, $_action, $_data_log),
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
                'msg' => array('username_invalid', $username_new)
Open commit View diff
172 'msg' => array('username_invalid', $username_new)
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
              );
Open commit View diff
173 );
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
              continue;
Open commit View diff
174 continue;
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
            }
Open commit View diff
175 }
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 }
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
177
          $stmt = $pdo->prepare("DELETE FROM `domain_admins` WHERE `username` = :username");
Open commit View diff
177 $stmt = $pdo->prepare("DELETE FROM `domain_admins` WHERE `username` = :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
178
          $stmt->execute(array(
Open commit View diff
178 $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
179
            ':username' => $username,
Open commit View diff
179 ':username' => $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
180
          ));
Open commit View diff
180 ));
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
181
          $stmt = $pdo->prepare("UPDATE `da_acl` SET `username` = :username_new WHERE `username` = :username");
Open commit View diff
181 $stmt = $pdo->prepare("UPDATE `da_acl` SET `username` = :username_new WHERE `username` = :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
182
          $stmt->execute(array(
Open commit View diff
182 $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
183
            ':username_new' => $username_new,
Open commit View diff
183 ':username_new' => $username_new,
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
184
            ':username' => $username
Open commit View diff
184 ':username' => $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
185
          ));
Open commit View diff
185 ));
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
186
          if (!empty($domains)) {
Open commit View diff
186 if (!empty($domains)) {
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
187
            foreach ($domains as $domain) {
Open commit View diff
187 foreach ($domains as $domain) {
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
188
              $stmt = $pdo->prepare("INSERT INTO `domain_admins` (`username`, `domain`, `created`, `active`)
Open commit View diff
188 $stmt = $pdo->prepare("INSERT INTO `domain_admins` (`username`, `domain`, `created`, `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
189
                VALUES (:username_new, :domain, :created, :active)");
Open commit View diff
189 VALUES (:username_new, :domain, :created, :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
190
              $stmt->execute(array(
Open commit View diff
190 $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
191
                ':username_new' => $username_new,
Open commit View diff
191 ':username_new' => $username_new,
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
192
                ':domain' => $domain,
Open commit View diff
192 ':domain' => $domain,
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
193
                ':created' => date('Y-m-d H:i:s'),
Open commit View diff
193 ':created' => date('Y-m-d H:i:s'),
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
194
                ':active' => $active
Open commit View diff
194 ':active' => $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
195
              ));
Open commit View diff
195 ));
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
196
            }
Open commit View diff
196 }
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
197
          }
Open commit View diff
197 }
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
198
          $force_tfa = intval($_data['force_tfa'] ?? 0) ? 1 : 0;
Open commit View diff
198 $force_tfa = intval($_data['force_tfa'] ?? 0) ? 1 : 0;
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
199
          $force_pw_update = intval($_data['force_pw_update'] ?? 0) ? 1 : 0;
Open commit View diff
199 $force_pw_update = intval($_data['force_pw_update'] ?? 0) ? 1 : 0;
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
200
          if (!empty($password)) {
Open commit View diff
200 if (!empty($password)) {
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
201
            if (password_check($password, $password2) !== true) {
Open commit View diff
201 if (password_check($password, $password2) !== 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
202
              return false;
Open commit View diff
202 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
203
            }
Open commit View diff
203 }
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
204
            $password_hashed = hash_password($password);
Open commit View diff
204 $password_hashed = hash_password($password);
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
205
            $stmt = $pdo->prepare("UPDATE `admin` SET `username` = :username_new, `active` = :active, `password` = :password_hashed,
Open commit View diff
205 $stmt = $pdo->prepare("UPDATE `admin` SET `username` = :username_new, `active` = :active, `password` = :password_hashed,
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
206
              `attributes` = JSON_SET(COALESCE(`attributes`, '{}'), '$.force_tfa', :force_tfa, '$.force_pw_update', :force_pw_update)
Open commit View diff
206 `attributes` = JSON_SET(COALESCE(`attributes`, '{}'), '$.force_tfa', :force_tfa, '$.force_pw_update', :force_pw_update)
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
207
              WHERE `username` = :username");
Open commit View diff
207 WHERE `username` = :username");
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
208
            $stmt->execute(array(
Open commit View diff
208 $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
209
              ':password_hashed' => $password_hashed,
Open commit View diff
209 ':password_hashed' => $password_hashed,
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
210
              ':username_new' => $username_new,
Open commit View diff
210 ':username_new' => $username_new,
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
211
              ':username' => $username,
Open commit View diff
211 ':username' => $username,
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
212
              ':active' => $active,
Open commit View diff
212 ':active' => $active,
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
213
              ':force_tfa' => strval($force_tfa),
Open commit View diff
213 ':force_tfa' => strval($force_tfa),
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
214
              ':force_pw_update' => strval($force_pw_update)
Open commit View diff
214 ':force_pw_update' => strval($force_pw_update)
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
215
            ));
Open commit View diff
215 ));
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
216
            if (isset($_data['disable_tfa'])) {
Open commit View diff
216 if (isset($_data['disable_tfa'])) {
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
217
              $stmt = $pdo->prepare("UPDATE `tfa` SET `active` = '0' WHERE `username` = :username");
Open commit View diff
217 $stmt = $pdo->prepare("UPDATE `tfa` SET `active` = '0' WHERE `username` = :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
218
              $stmt->execute(array(':username' => $username));
Open commit View diff
218 $stmt->execute(array(':username' => $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
219
            }
Open commit View diff
219 }
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
220
            else {
Open commit View diff
220 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
221
              $stmt = $pdo->prepare("UPDATE `tfa` SET `username` = :username_new WHERE `username` = :username");
Open commit View diff
221 $stmt = $pdo->prepare("UPDATE `tfa` SET `username` = :username_new WHERE `username` = :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
222
              $stmt->execute(array(':username_new' => $username_new, ':username' => $username));
Open commit View diff
222 $stmt->execute(array(':username_new' => $username_new, ':username' => $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
223
            }
Open commit View diff
223 }
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
224
          }
Open commit View diff
224 }
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
225
          else {
Open commit View diff
225 else {
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
226
            $stmt = $pdo->prepare("UPDATE `admin` SET `username` = :username_new, `active` = :active,
Open commit View diff
226 $stmt = $pdo->prepare("UPDATE `admin` SET `username` = :username_new, `active` = :active,
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
227
              `attributes` = JSON_SET(COALESCE(`attributes`, '{}'), '$.force_tfa', :force_tfa, '$.force_pw_update', :force_pw_update)
Open commit View diff
227 `attributes` = JSON_SET(COALESCE(`attributes`, '{}'), '$.force_tfa', :force_tfa, '$.force_pw_update', :force_pw_update)
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
228
              WHERE `username` = :username");
Open commit View diff
228 WHERE `username` = :username");
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
229
            $stmt->execute(array(
Open commit View diff
229 $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
230
              ':username_new' => $username_new,
Open commit View diff
230 ':username_new' => $username_new,
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
231
              ':username' => $username,
Open commit View diff
231 ':username' => $username,
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
232
              ':active' => $active,
Open commit View diff
232 ':active' => $active,
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
233
              ':force_tfa' => strval($force_tfa),
Open commit View diff
233 ':force_tfa' => strval($force_tfa),
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
234
              ':force_pw_update' => strval($force_pw_update)
Open commit View diff
234 ':force_pw_update' => strval($force_pw_update)
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
235
            ));
Open commit View diff
235 ));
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
236
            if (isset($_data['disable_tfa'])) {
Open commit View diff
236 if (isset($_data['disable_tfa'])) {
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
237
              $stmt = $pdo->prepare("UPDATE `tfa` SET `active` = '0' WHERE `username` = :username");
Open commit View diff
237 $stmt = $pdo->prepare("UPDATE `tfa` SET `active` = '0' WHERE `username` = :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
238
              $stmt->execute(array(':username' => $username));
Open commit View diff
238 $stmt->execute(array(':username' => $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
239
            }
Open commit View diff
239 }
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
240
            else {
Open commit View diff
240 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
241
              $stmt = $pdo->prepare("UPDATE `tfa` SET `username` = :username_new WHERE `username` = :username");
Open commit View diff
241 $stmt = $pdo->prepare("UPDATE `tfa` SET `username` = :username_new WHERE `username` = :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
242
              $stmt->execute(array(':username_new' => $username_new, ':username' => $username));
Open commit View diff
242 $stmt->execute(array(':username_new' => $username_new, ':username' => $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
243
            }
Open commit View diff
243 }
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
244
          }
Open commit View diff
244 }
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
245
          $_SESSION['return'][] = array(
Open commit View diff
245 $_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
246
            'type' => 'success',
Open commit View diff
246 'type' => 'success',
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
247
            'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
247 'log' => array(__FUNCTION__, $_action, $_data_log),
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
248
            'msg' => array('domain_admin_modified', htmlspecialchars($username))
Open commit View diff
248 'msg' => array('domain_admin_modified', htmlspecialchars($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
249
          );
Open commit View diff
249 );
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
250
        }
Open commit View diff
250 }
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
251
        return true;
Open commit View diff
251 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
252
      }
Open commit View diff
252 }
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
253
      // Domain administrator
Open commit View diff
253 // Domain administrator
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
254
      // Can only edit itself
Open commit View diff
254 // Can only edit itself
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
255
      elseif ($_SESSION['mailcow_cc_role'] == "domainadmin") {
Open commit View diff
255 elseif ($_SESSION['mailcow_cc_role'] == "domainadmin") {
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
256
        $username = $_SESSION['mailcow_cc_username'];
Open commit View diff
256 $username = $_SESSION['mailcow_cc_username'];
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
257
        $password_old		= $_data['user_old_pass'] ?? '';
Open commit View diff
257 $password_old = $_data['user_old_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
258
        $password_new	= $_data['user_new_pass'];
Open commit View diff
258 $password_new = $_data['user_new_pass'];
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
259
        $password_new2	= $_data['user_new_pass2'];
Open commit View diff
259 $password_new2 = $_data['user_new_pass2'];
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
260
Open commit View diff
260
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
261
        // Only verify old password if this is NOT a forced password update
Open commit View diff
261 // Only verify old password if this is NOT a forced password update
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
262
        if (empty($_SESSION['pending_pw_update'])) {
Open commit View diff
262 if (empty($_SESSION['pending_pw_update'])) {
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
263
          $stmt = $pdo->prepare("SELECT `password` FROM `admin`
Open commit View diff
263 $stmt = $pdo->prepare("SELECT `password` FROM `admin`
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
264
              WHERE `username` = :user");
Open commit View diff
264 WHERE `username` = :user");
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
265
          $stmt->execute(array(':user' => $username));
Open commit View diff
265 $stmt->execute(array(':user' => $username));
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
266
          $row = $stmt->fetch(PDO::FETCH_ASSOC);
Open commit View diff
266 $row = $stmt->fetch(PDO::FETCH_ASSOC);
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
267
          if (!verify_hash($row['password'], $password_old)) {
Open commit View diff
267 if (!verify_hash($row['password'], $password_old)) {
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

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

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
269
              'type' => 'danger',
Open commit View diff
269 'type' => 'danger',
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
270
              'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
270 'log' => array(__FUNCTION__, $_action, $_data_log),
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
271
              'msg' => 'access_denied'
Open commit View diff
271 'msg' => 'access_denied'
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
272
            );
Open commit View diff
272 );
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
273
            return false;
Open commit View diff
273 return false;
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
274
          }
Open commit View diff
274 }
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
275
        }
Open commit View diff
275 }
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
276
        if (password_check($password_new, $password_new2) !== true) {
Open commit View diff
276 if (password_check($password_new, $password_new2) !== 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
277
          return false;
Open commit View diff
277 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
278
        }
Open commit View diff
278 }
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
279
        $password_hashed = hash_password($password_new);
Open commit View diff
279 $password_hashed = hash_password($password_new);
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
280
        $stmt = $pdo->prepare("UPDATE `admin` SET `password` = :password_hashed,
Open commit View diff
280 $stmt = $pdo->prepare("UPDATE `admin` SET `password` = :password_hashed,
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
281
          `attributes` = JSON_SET(COALESCE(`attributes`, '{}'), '$.force_pw_update', '0')
Open commit View diff
281 `attributes` = JSON_SET(COALESCE(`attributes`, '{}'), '$.force_pw_update', '0')
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
282
          WHERE `username` = :username");
Open commit View diff
282 WHERE `username` = :username");
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
283
        $stmt->execute(array(
Open commit View diff
283 $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
284
          ':password_hashed' => $password_hashed,
Open commit View diff
284 ':password_hashed' => $password_hashed,
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
285
          ':username' => $username
Open commit View diff
285 ':username' => $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
286
        ));
Open commit View diff
286 ));
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
287
        unset($_SESSION['pending_pw_update']);
Open commit View diff
287 unset($_SESSION['pending_pw_update']);
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
288
        $_SESSION['return'][] = array(
Open commit View diff
288 $_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
289
          'type' => 'success',
Open commit View diff
289 'type' => 'success',
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
290
          'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
290 'log' => array(__FUNCTION__, $_action, $_data_log),
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
291
          'msg' => array('domain_admin_modified', htmlspecialchars($username))
Open commit View diff
291 'msg' => array('domain_admin_modified', htmlspecialchars($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
292
        );
Open commit View diff
292 );
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
293
      }
Open commit View diff
293 }
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
294
    break;
Open commit View diff
294 break;
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
295
    case 'delete':
Open commit View diff
295 case 'delete':
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
296
      if ($_SESSION['mailcow_cc_role'] != "admin") {
Open commit View diff
296 if ($_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
297
        $_SESSION['return'][] = array(
Open commit View diff
297 $_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
298
          'type' => 'danger',
Open commit View diff
298 'type' => 'danger',
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
299
          'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
299 'log' => array(__FUNCTION__, $_action, $_data_log),
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
300
          'msg' => 'access_denied'
Open commit View diff
300 'msg' => 'access_denied'
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
301
        );
Open commit View diff
301 );
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
302
        return false;
Open commit View diff
302 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
303
      }
Open commit View diff
303 }
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
304
      $usernames = (array)$_data['username'];
Open commit View diff
304 $usernames = (array)$_data['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
305
      foreach ($usernames as $username) {
Open commit View diff
305 foreach ($usernames as $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
306
        if (empty(domain_admin('details', $username))) {
Open commit View diff
306 if (empty(domain_admin('details', $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
307
          $_SESSION['return'][] = array(
Open commit View diff
307 $_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
308
            'type' => 'danger',
Open commit View diff
308 'type' => 'danger',
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
309
            'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
309 'log' => array(__FUNCTION__, $_action, $_data_log),
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
310
            'msg' => array('username_invalid', $username)
Open commit View diff
310 'msg' => array('username_invalid', $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
311
          );
Open commit View diff
311 );
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
312
          continue;
Open commit View diff
312 continue;
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
313
        }
Open commit View diff
313 }
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
314
        $stmt = $pdo->prepare("DELETE FROM `domain_admins` WHERE `username` = :username");
Open commit View diff
314 $stmt = $pdo->prepare("DELETE FROM `domain_admins` WHERE `username` = :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
315
        $stmt->execute(array(
Open commit View diff
315 $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
316
          ':username' => $username,
Open commit View diff
316 ':username' => $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
317
        ));
Open commit View diff
317 ));
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
318
        $stmt = $pdo->prepare("DELETE FROM `admin` WHERE `username` = :username");
Open commit View diff
318 $stmt = $pdo->prepare("DELETE FROM `admin` WHERE `username` = :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
319
        $stmt->execute(array(
Open commit View diff
319 $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
320
          ':username' => $username,
Open commit View diff
320 ':username' => $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
321
        ));
Open commit View diff
321 ));
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
322
        $stmt = $pdo->prepare("DELETE FROM `da_acl` WHERE `username` = :username");
Open commit View diff
322 $stmt = $pdo->prepare("DELETE FROM `da_acl` WHERE `username` = :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
323
        $stmt->execute(array(
Open commit View diff
323 $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
324
          ':username' => $username,
Open commit View diff
324 ':username' => $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
325
        ));
Open commit View diff
325 ));
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
326
        $stmt = $pdo->prepare("DELETE FROM `tfa` WHERE `username` = :username");
Open commit View diff
326 $stmt = $pdo->prepare("DELETE FROM `tfa` WHERE `username` = :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
327
        $stmt->execute(array(
Open commit View diff
327 $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
328
          ':username' => $username,
Open commit View diff
328 ':username' => $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
329
        ));
Open commit View diff
329 ));
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
330
        $stmt = $pdo->prepare("DELETE FROM `fido2` WHERE `username` = :username");
Open commit View diff
330 $stmt = $pdo->prepare("DELETE FROM `fido2` WHERE `username` = :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
331
        $stmt->execute(array(
Open commit View diff
331 $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
332
          ':username' => $username,
Open commit View diff
332 ':username' => $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
333
        ));
Open commit View diff
333 ));
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
334
        $_SESSION['return'][] = array(
Open commit View diff
334 $_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
335
          'type' => 'success',
Open commit View diff
335 'type' => 'success',
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
336
          'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
336 'log' => array(__FUNCTION__, $_action, $_data_log),
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
337
          'msg' => array('domain_admin_removed', htmlspecialchars($username))
Open commit View diff
337 'msg' => array('domain_admin_removed', htmlspecialchars($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
338
        );
Open commit View diff
338 );
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
339
      }
Open commit View diff
339 }
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
340
    break;
Open commit View diff
340 break;
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
341
    case 'get':
Open commit View diff
341 case 'get':
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
342
      $domainadmins = array();
Open commit View diff
342 $domainadmins = 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
343
      if ($_SESSION['mailcow_cc_role'] != "admin") {
Open commit View diff
343 if ($_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
344
        $_SESSION['return'][] = array(
Open commit View diff
344 $_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
345
          'type' => 'danger',
Open commit View diff
345 'type' => 'danger',
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
346
          'log' => array(__FUNCTION__, $_action, $_data_log),
Open commit View diff
346 'log' => array(__FUNCTION__, $_action, $_data_log),
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
347
          'msg' => 'access_denied'
Open commit View diff
347 'msg' => 'access_denied'
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
348
        );
Open commit View diff
348 );
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
349
        return false;
Open commit View diff
349 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
350
      }
Open commit View diff
350 }
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
351
      $stmt = $pdo->query("SELECT DISTINCT
Open commit View diff
351 $stmt = $pdo->query("SELECT DISTINCT
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
352
        `username`
Open commit View diff
352 `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
353
          FROM `domain_admins`
Open commit View diff
353 FROM `domain_admins`
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
354
            WHERE `username` IN (
Open commit View diff
354 WHERE `username` IN (
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
355
              SELECT `username` FROM `admin`
Open commit View diff
355 SELECT `username` FROM `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
356
                WHERE `superadmin`!='1'
Open commit View diff
356 WHERE `superadmin`!='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
357
            )");
Open commit View diff
357 )");
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
358
      $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
Open commit View diff
358 $rows = $stmt->fetchAll(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
359
      while ($row = array_shift($rows)) {
Open commit View diff
359 while ($row = array_shift($rows)) {
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
360
        $domainadmins[] = $row['username'];
Open commit View diff
360 $domainadmins[] = $row['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
361
      }
Open commit View diff
361 }
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
362
      return $domainadmins;
Open commit View diff
362 return $domainadmins;
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
363
    break;
Open commit View diff
363 break;
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
364
    case 'details':
Open commit View diff
364 case 'details':
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
365
      $domainadmindata = array();
Open commit View diff
365 $domainadmindata = 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
366
      if ($_SESSION['mailcow_cc_role'] == "domainadmin" && $_data != $_SESSION['mailcow_cc_username']) {
Open commit View diff
366 if ($_SESSION['mailcow_cc_role'] == "domainadmin" && $_data != $_SESSION['mailcow_cc_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
367
        return false;
Open commit View diff
367 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
368
      }
Open commit View diff
368 }
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
369
      elseif ($_SESSION['mailcow_cc_role'] != "admin" || !isset($_data)) {
Open commit View diff
369 elseif ($_SESSION['mailcow_cc_role'] != "admin" || !isset($_data)) {
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
370
        return false;
Open commit View diff
370 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
371
      }
Open commit View diff
371 }
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
372
      if (!ctype_alnum(str_replace(array('_', '.', '-'), '', $_data))) {
Open commit View diff
372 if (!ctype_alnum(str_replace(array('_', '.', '-'), '', $_data))) {
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
373
        return false;
Open commit View diff
373 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
374
      }
Open commit View diff
374 }
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
375
      $stmt = $pdo->prepare("SELECT
Open commit View diff
375 $stmt = $pdo->prepare("SELECT
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
376
        `tfa`.`active` AS `tfa_active`,
Open commit View diff
376 `tfa`.`active` AS `tfa_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
377
        `domain_admins`.`username`,
Open commit View diff
377 `domain_admins`.`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
378
        `domain_admins`.`created`,
Open commit View diff
378 `domain_admins`.`created`,
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
379
        `domain_admins`.`active` AS `active`,
Open commit View diff
379 `domain_admins`.`active` AS `active`,
same change ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
380
        `admin`.`attributes` AS `attributes`
Open commit View diff
380 `admin`.`attributes` AS `attributes`
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
381
          FROM `domain_admins`
Open commit View diff
381 FROM `domain_admins`
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
382
          LEFT OUTER JOIN `tfa` ON `tfa`.`username`=`domain_admins`.`username`
Open commit View diff
382 LEFT OUTER JOIN `tfa` ON `tfa`.`username`=`domain_admins`.`username`
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
383
          LEFT OUTER JOIN `admin` ON `admin`.`username`=`domain_admins`.`username`
Open commit View diff
383 LEFT OUTER JOIN `admin` ON `admin`.`username`=`domain_admins`.`username`
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
384
            WHERE `domain_admins`.`username`= :domain_admin");
Open commit View diff
384 WHERE `domain_admins`.`username`= :domain_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
385
      $stmt->execute(array(
Open commit View diff
385 $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
386
        ':domain_admin' => $_data
Open commit View diff
386 ':domain_admin' => $_data
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
387
      ));
Open commit View diff
387 ));
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
388
      $row = $stmt->fetch(PDO::FETCH_ASSOC);
Open commit View diff
388 $row = $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
389
      if (empty($row)) {
Open commit View diff
389 if (empty($row)) {
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
390
        return false;
Open commit View diff
390 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
391
      }
Open commit View diff
391 }
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
392
      $domainadmindata['username'] = $row['username'];
Open commit View diff
392 $domainadmindata['username'] = $row['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
393
      $domainadmindata['tfa_active'] = (is_null($row['tfa_active'])) ? 0 : $row['tfa_active'];
Open commit View diff
393 $domainadmindata['tfa_active'] = (is_null($row['tfa_active'])) ? 0 : $row['tfa_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
394
      $domainadmindata['tfa_active_int'] = (is_null($row['tfa_active'])) ? 0 : $row['tfa_active'];
Open commit View diff
394 $domainadmindata['tfa_active_int'] = (is_null($row['tfa_active'])) ? 0 : $row['tfa_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
395
      $domainadmindata['active'] = $row['active'];
Open commit View diff
395 $domainadmindata['active'] = $row['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
396
      $domainadmindata['active_int'] = $row['active'];
Open commit View diff
396 $domainadmindata['active_int'] = $row['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
397
      $domainadmindata['created'] = $row['created'];
Open commit View diff
397 $domainadmindata['created'] = $row['created'];
FreddleSpl0it 5 months ago ad5b94a

[Web] Add forced 2FA setup and password update enforcement

Full commit hash
ad5b94af5e48297631629c2a118e7f163a044a07
Author
FreddleSpl0it <[email protected]>
Date
5 months ago
Selected line
398
      $domainadmindata['attributes'] = json_decode($row['attributes'], true) ?? array('force_tfa' => '0', 'force_pw_update' => '0');
Open commit View diff
398 $domainadmindata['attributes'] = json_decode($row['attributes'], true) ?? array('force_tfa' => '0', 'force_pw_update' => '0');
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
399
      // GET SELECTED
Open commit View diff
399 // GET SELECTED
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
400
      $stmt = $pdo->prepare("SELECT `domain` FROM `domain`
Open commit View diff
400 $stmt = $pdo->prepare("SELECT `domain` FROM `domain`
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
401
        WHERE `domain` IN (
Open commit View diff
401 WHERE `domain` IN (
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
402
          SELECT `domain` FROM `domain_admins`
Open commit View diff
402 SELECT `domain` FROM `domain_admins`
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
403
            WHERE `username`= :domain_admin)");
Open commit View diff
403 WHERE `username`= :domain_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
404
      $stmt->execute(array(':domain_admin' => $_data));
Open commit View diff
404 $stmt->execute(array(':domain_admin' => $_data));
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
405
      $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
Open commit View diff
405 $rows = $stmt->fetchAll(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
406
      while($row = array_shift($rows)) {
Open commit View diff
406 while($row = array_shift($rows)) {
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
407
        $domainadmindata['selected_domains'][] = $row['domain'];
Open commit View diff
407 $domainadmindata['selected_domains'][] = $row['domain'];
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
408
      }
Open commit View diff
408 }
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
409
      // GET UNSELECTED
Open commit View diff
409 // GET UNSELECTED
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
410
      $stmt = $pdo->prepare("SELECT `domain` FROM `domain`
Open commit View diff
410 $stmt = $pdo->prepare("SELECT `domain` FROM `domain`
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
411
        WHERE `domain` NOT IN (
Open commit View diff
411 WHERE `domain` NOT IN (
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
412
          SELECT `domain` FROM `domain_admins`
Open commit View diff
412 SELECT `domain` FROM `domain_admins`
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
413
            WHERE `username`= :domain_admin)");
Open commit View diff
413 WHERE `username`= :domain_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
414
      $stmt->execute(array(':domain_admin' => $_data));
Open commit View diff
414 $stmt->execute(array(':domain_admin' => $_data));
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
415
      $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
Open commit View diff
415 $rows = $stmt->fetchAll(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
416
      while($row = array_shift($rows)) {
Open commit View diff
416 while($row = array_shift($rows)) {
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
417
        $domainadmindata['unselected_domains'][] = $row['domain'];
Open commit View diff
417 $domainadmindata['unselected_domains'][] = $row['domain'];
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
418
      }
Open commit View diff
418 }
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
419
      if (!isset($domainadmindata['unselected_domains'])) {
Open commit View diff
419 if (!isset($domainadmindata['unselected_domains'])) {
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
420
        $domainadmindata['unselected_domains'] = "";
Open commit View diff
420 $domainadmindata['unselected_domains'] = "";
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
421
      }
Open commit View diff
421 }
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
422
Open commit View diff
422
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
423
      return $domainadmindata;
Open commit View diff
423 return $domainadmindata;
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
424
    break;
Open commit View diff
424 break;
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
425
  }
Open commit View diff
425 }
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
426
}
Open commit View diff
426 }
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
427
function domain_admin_sso($_action, $_data) {
Open commit View diff
427 function domain_admin_sso($_action, $_data) {
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
428
  global $pdo;
Open commit View diff
428 global $pdo;
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
429
Open commit View diff
429
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
430
  switch ($_action) {
Open commit View diff
430 switch ($_action) {
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
431
    case 'check':
Open commit View diff
431 case '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
432
      $token = $_data;
Open commit View diff
432 $token = $_data;
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
433
Open commit View diff
433
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
434
      $stmt = $pdo->prepare("SELECT `t1`.`username` FROM `da_sso` AS `t1` JOIN `admin` AS `t2` ON `t1`.`username` = `t2`.`username` WHERE `t1`.`token` = :token AND `t1`.`created` > DATE_SUB(NOW(), INTERVAL '30' SECOND) AND `t2`.`active` = 1 AND `t2`.`superadmin` = 0;");
Open commit View diff
434 $stmt = $pdo->prepare("SELECT `t1`.`username` FROM `da_sso` AS `t1` JOIN `admin` AS `t2` ON `t1`.`username` = `t2`.`username` WHERE `t1`.`token` = :token AND `t1`.`created` > DATE_SUB(NOW(), INTERVAL '30' SECOND) AND `t2`.`active` = 1 AND `t2`.`superadmin` = 0;");
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
435
      $stmt->execute(array(
Open commit View diff
435 $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
436
        ':token' => preg_replace('/[^a-zA-Z0-9-]/', '', $token)
Open commit View diff
436 ':token' => preg_replace('/[^a-zA-Z0-9-]/', '', $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
437
      ));
Open commit View diff
437 ));
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
438
      $return = $stmt->fetch(PDO::FETCH_ASSOC);
Open commit View diff
438 $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
439
      return empty($return['username']) ? false : $return['username'];
Open commit View diff
439 return empty($return['username']) ? false : $return['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
440
    case 'issue':
Open commit View diff
440 case 'issue':
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
441
      if ($_SESSION['mailcow_cc_role'] != "admin") {
Open commit View diff
441 if ($_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
442
        $_SESSION['return'][] = array(
Open commit View diff
442 $_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
443
          'type' => 'danger',
Open commit View diff
443 'type' => 'danger',
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
444
          'log' => array(__FUNCTION__, $_action, $_data),
Open commit View diff
444 'log' => array(__FUNCTION__, $_action, $_data),
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
445
          'msg' => 'access_denied'
Open commit View diff
445 'msg' => 'access_denied'
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
446
        );
Open commit View diff
446 );
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
447
        return false;
Open commit View diff
447 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
448
      }
Open commit View diff
448 }
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
449
Open commit View diff
449
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
450
      $username = $_data['username'];
Open commit View diff
450 $username = $_data['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
451
Open commit View diff
451
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
452
      $stmt = $pdo->prepare("SELECT `username` FROM `domain_admins`
Open commit View diff
452 $stmt = $pdo->prepare("SELECT `username` FROM `domain_admins`
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
453
        WHERE `username` = :username");
Open commit View diff
453 WHERE `username` = :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
454
      $stmt->execute(array(':username' => $username));
Open commit View diff
454 $stmt->execute(array(':username' => $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
455
      $num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC));
Open commit View diff
455 $num_results = count($stmt->fetchAll(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
456
Open commit View diff
456
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
457
      if ($num_results < 1) {
Open commit View diff
457 if ($num_results < 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
458
        $_SESSION['return'][] = array(
Open commit View diff
458 $_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
459
          'type' => 'danger',
Open commit View diff
459 'type' => 'danger',
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
460
          'log' => array(__FUNCTION__, $_action, $_data),
Open commit View diff
460 'log' => array(__FUNCTION__, $_action, $_data),
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
461
          'msg' => array('object_doesnt_exist', htmlspecialchars($username))
Open commit View diff
461 'msg' => array('object_doesnt_exist', htmlspecialchars($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
462
        );
Open commit View diff
462 );
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
463
        return false;
Open commit View diff
463 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
464
      }
Open commit View diff
464 }
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
465
Open commit View diff
465
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
466
      $token = implode('-', array(
Open commit View diff
466 $token = implode('-', 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
467
        strtoupper(bin2hex(random_bytes(3))),
Open commit View diff
467 strtoupper(bin2hex(random_bytes(3))),
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
468
        strtoupper(bin2hex(random_bytes(3))),
Open commit View diff
468 strtoupper(bin2hex(random_bytes(3))),
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
469
        strtoupper(bin2hex(random_bytes(3))),
Open commit View diff
469 strtoupper(bin2hex(random_bytes(3))),
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
470
        strtoupper(bin2hex(random_bytes(3))),
Open commit View diff
470 strtoupper(bin2hex(random_bytes(3))),
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
471
        strtoupper(bin2hex(random_bytes(3)))
Open commit View diff
471 strtoupper(bin2hex(random_bytes(3)))
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
472
      ));
Open commit View diff
472 ));
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
473
Open commit View diff
473
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
474
      $stmt = $pdo->prepare("INSERT INTO `da_sso` (`username`, `token`)
Open commit View diff
474 $stmt = $pdo->prepare("INSERT INTO `da_sso` (`username`, `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
475
            VALUES (:username, :token)");
Open commit View diff
475 VALUES (:username, :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
476
      $stmt->execute(array(
Open commit View diff
476 $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
477
        ':username' => $username,
Open commit View diff
477 ':username' => $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
478
        ':token' => $token
Open commit View diff
478 ':token' => $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
479
      ));
Open commit View diff
479 ));
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
480
Open commit View diff
480
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
481
      // perform cleanup
Open commit View diff
481 // perform cleanup
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
482
      $pdo->query("DELETE FROM `da_sso` WHERE created < DATE_SUB(NOW(), INTERVAL '30' SECOND);");
Open commit View diff
482 $pdo->query("DELETE FROM `da_sso` WHERE created < DATE_SUB(NOW(), INTERVAL '30' SECOND);");
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
483
Open commit View diff
483
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
484
      return ['token' => $token];
Open commit View diff
484 return ['token' => $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
485
    break;
Open commit View diff
485 break;
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
486
  }
Open commit View diff
486 }
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
487
}
Open commit View diff
487 }