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.presets.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.presets.inc.php on main
Author Date Commit Line Code
tinect over 6 years ago 943b7c6

+ add api for presets

Full commit hash
943b7c6bb266c724a5a1d38975b323044110b5f0
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
1
<?php
Open commit View diff
1 <?php
andryyy over 6 years ago 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
2
function presets($_action, $_kind) {
Open commit View diff
2 function presets($_action, $_kind) {
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
3
  switch ($_action) {
Open commit View diff
3 switch ($_action) {
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
4
    case 'get':
Open commit View diff
4 case 'get':
andryyy over 6 years ago 2b1ff6c

[Web] Fix sieve example insert

Full commit hash
2b1ff6c9a39aba42114ccb7200917080c548c474
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
5
      if ($_SESSION['mailcow_cc_role'] != "admin" && $_SESSION['mailcow_cc_role'] != "domainadmin") {
Open commit View diff
5 if ($_SESSION['mailcow_cc_role'] != "admin" && $_SESSION['mailcow_cc_role'] != "domainadmin") {
andryyy over 6 years ago 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
6
        return false;
Open commit View diff
6 return false;
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
7
      }
Open commit View diff
7 }
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
8
      $presets = array();
Open commit View diff
8 $presets = array();
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
9
      $kind = strtolower(trim($_kind));
Open commit View diff
9 $kind = strtolower(trim($_kind));
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
10
      $lang_base = 'admin';
Open commit View diff
10 $lang_base = 'admin';
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
11
      $presets_path = __DIR__ . '/presets/' . $kind;
Open commit View diff
11 $presets_path = __DIR__ . '/presets/' . $kind;
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
12
      if (!in_array($kind, ['rspamd', 'sieve'], true)) {
Open commit View diff
12 if (!in_array($kind, ['rspamd', 'sieve'], true)) {
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
13
        return array();
Open commit View diff
13 return array();
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
14
      }
Open commit View diff
14 }
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
15
      if ($kind === 'sieve') {
Open commit View diff
15 if ($kind === 'sieve') {
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
16
        $lang_base = 'mailbox';
Open commit View diff
16 $lang_base = 'mailbox';
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
17
      }
Open commit View diff
17 }
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
18
      foreach (glob($presets_path . '/*.yml') as $filename) {
Open commit View diff
18 foreach (glob($presets_path . '/*.yml') as $filename) {
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
19
        $presets[] = getPresetFromFilePath($filename, $lang_base);
Open commit View diff
19 $presets[] = getPresetFromFilePath($filename, $lang_base);
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
20
      }
Open commit View diff
20 }
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
21
      return $presets;
Open commit View diff
21 return $presets;
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
22
    break;
Open commit View diff
22 break;
tinect over 6 years ago 943b7c6

+ add api for presets

Full commit hash
943b7c6bb266c724a5a1d38975b323044110b5f0
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
23
  }
Open commit View diff
23 }
andryyy over 6 years ago 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
24
  return array();
Open commit View diff
24 return array();
tinect over 6 years ago 943b7c6

+ add api for presets

Full commit hash
943b7c6bb266c724a5a1d38975b323044110b5f0
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
25
}
Open commit View diff
25 }
andryyy over 6 years ago 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
26
function getPresetFromFilePath($filePath, $lang_base) {
Open commit View diff
26 function getPresetFromFilePath($filePath, $lang_base) {
tinect over 6 years ago 9f754c9

add ability to get specific preset, defaulting to all

Full commit hash
9f754c95b9dd41c07429de8b960d24d0c202e3b4
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
27
  global $lang;
Open commit View diff
27 global $lang;
same change 9f754c9

add ability to get specific preset, defaulting to all

Full commit hash
9f754c95b9dd41c07429de8b960d24d0c202e3b4
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
28
  $preset = Spyc::YAMLLoad($filePath);
Open commit View diff
28 $preset = Spyc::YAMLLoad($filePath);
same change 9f754c9

add ability to get specific preset, defaulting to all

Full commit hash
9f754c95b9dd41c07429de8b960d24d0c202e3b4
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
29
  $preset = ['name' => basename($filePath, '.yml')] + $preset;
Open commit View diff
29 $preset = ['name' => basename($filePath, '.yml')] + $preset;
same change 9f754c9

add ability to get specific preset, defaulting to all

Full commit hash
9f754c95b9dd41c07429de8b960d24d0c202e3b4
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
30
  /* get translated headlines */
Open commit View diff
30 /* get translated headlines */
same change 9f754c9

add ability to get specific preset, defaulting to all

Full commit hash
9f754c95b9dd41c07429de8b960d24d0c202e3b4
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
31
  if (isset($preset['headline']) && strpos($preset['headline'], 'lang.') === 0) {
Open commit View diff
31 if (isset($preset['headline']) && strpos($preset['headline'], 'lang.') === 0) {
same change 9f754c9

add ability to get specific preset, defaulting to all

Full commit hash
9f754c95b9dd41c07429de8b960d24d0c202e3b4
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
32
    $langTextName = trim(substr($preset['headline'], 5));
Open commit View diff
32 $langTextName = trim(substr($preset['headline'], 5));
andryyy over 6 years ago 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
33
    if (isset($lang[$lang_base][$langTextName])) {
Open commit View diff
33 if (isset($lang[$lang_base][$langTextName])) {
same change 8003f3b

[Web] Small adjustments to presets

Full commit hash
8003f3b4b338b1cc47d46bf5e5275f9698239806
Author
andryyy <[email protected]>
Date
over 6 years ago
Selected line
34
      $preset['headline'] = $lang[$lang_base][$langTextName];
Open commit View diff
34 $preset['headline'] = $lang[$lang_base][$langTextName];
tinect over 6 years ago 9f754c9

add ability to get specific preset, defaulting to all

Full commit hash
9f754c95b9dd41c07429de8b960d24d0c202e3b4
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
35
    }
Open commit View diff
35 }
same change 9f754c9

add ability to get specific preset, defaulting to all

Full commit hash
9f754c95b9dd41c07429de8b960d24d0c202e3b4
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
36
  }
Open commit View diff
36 }
same change 9f754c9

add ability to get specific preset, defaulting to all

Full commit hash
9f754c95b9dd41c07429de8b960d24d0c202e3b4
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
37
  return $preset;
Open commit View diff
37 return $preset;
same change 9f754c9

add ability to get specific preset, defaulting to all

Full commit hash
9f754c95b9dd41c07429de8b960d24d0c202e3b4
Author
tinect <[email protected]>
Date
over 6 years ago
Selected line
38
}
Open commit View diff
38 }