-
Notifications
You must be signed in to change notification settings - Fork 3
/
email.php
143 lines (115 loc) · 4.94 KB
/
email.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
$active_page = 'email';
require_once 'functions.php';
include_once 'config.php';
session_secure_start();
require_once 'l10n/'.$_SESSION['language'].'.php';
if(!$_SESSION['authenticated']) {
header('Content-Type: text/html; charset=utf-8');
exit('<br>'.L10N_CONNECTION_NEEDED);
}
if($_POST['submit']) {
$_SESSION['message_mode'] = $_POST['message_mode'] ?? $_SESSION['message_mode'];
$_SESSION['filters_set'] = array_keys($_POST, 'set_filter');
$_SESSION['filter_group'] = $_POST['filter_group'];
$_SESSION['filter_quota'] = $_POST['filter_quota'];
$_SESSION['type_quota'] = $_POST['type_quota'] ?? null;
$_SESSION['compare_quota'] = $_POST['compare_quota'] ?? null;
$_SESSION['filter_ll_since'] = $_POST['filter_ll_since'] != ""
? $_POST['filter_ll_since']
: '1970-01-01';
$_SESSION['filter_ll_before'] = $_POST['filter_ll_before'] != ""
? $_POST['filter_ll_before']
: date('Y-m-d');
$userlist = $_SESSION['filters_set']
? filter_users()
: $_SESSION['userlist'];
header("Location: ".build_mailto_list($_SESSION['message_mode'], $userlist));
}
?>
<head>
<link rel="stylesheet" type="text/css" href="style.php">
<meta charset="UTF-8">
<title>Nextcloud Userexport</title>
</head>
<body>
<?php
include 'navigation.php';
$_SESSION['message_mode'] = $_SESSION['message_mode'] ?? 'bcc';
echo "<html lang='{$_SESSION['language']}'>";
print_status_overview();
echo "<form method='post'>
<br>
<table>
<tr><td style='padding-bottom: 1em;'><u>".L10N_SEND_AS."</u></td>
<td style='padding: 0.3em; padding-bottom: 1em;'>";
$value = ['bcc','cc','to'];
foreach($value as $mode) {
echo "<input type='radio' name='message_mode' id='$mode' value='$mode'";
if($mode == $_SESSION['message_mode'])
echo " checked";
echo "> <label for='$mode'>$mode</label>";
}
echo "</td></tr>
<tr>
<td style='padding-bottom: 1em;'><u>".L10N_SEND_TO."</u></td>
<td style='padding: 0.3em; padding-bottom: 1em;'>
<input type='radio' name='filter_group_choice' value='all_users' checked>
<label for='filter_group_choice'>".L10N_ALL_USERS."</label>
<input type='radio' name='filter_group_choice' value='set_filter'"
.check_and_set_filter('group').">
<label for='filter_group_choice'>".L10N_GROUP."</label>
<select name='filter_group'>";
foreach($_SESSION['grouplist'] as $item) {
$selected = $item == $_SESSION['filter_group']
? ' selected'
: '';
echo "<option value='$item'$selected>$item</option>";
}
echo "</select></td></tr>
<tr>
<td><u>".L10N_FILTER_BY."<u></td>
<td style='padding: 0.3em;'>
<input type='checkbox' name='filter_lastLogin_choice' value='set_filter'"
.check_and_set_filter('lastLogin').">
<label for='filter_lastLogin_choice'>".L10N_LAST_LOGIN_BETWEEN." </label>
<input type=date name='filter_ll_since'";
if($_SESSION['filter_ll_since'])
echo " value='{$_SESSION['filter_ll_since']}'";
echo ">".L10N_AND."
<input type=date name='filter_ll_before' value='";
if($_SESSION['filter_ll_before'])
echo $_SESSION['filter_ll_before'];
else
echo date('Y-m-d');
echo "'>
</td>
</tr>
<tr>
<td></td>
<td style='padding: 0.3em;'>
<input type='checkbox' name='filter_quota_choice' value='set_filter'"
.check_and_set_filter('quota').">
<label for='filter_quota_choice'>".L10N_DISK_SPACE." </label>
<select name='type_quota'>
<option value='used'>".L10N_USED."</option>
<option value='quota'>".L10N_ASSIGNED."</option>
<option value='free'>".L10N_FREE."</option>
</select>
<select name='compare_quota'>
<option value='gt'>></option>
<option value='lt'><</option>
<option value='asymp'>≈</option>
<option value='equals'>=</option>
</select>
<input style='width: 6em;' type='number' min=0.5 step=0.5
name='filter_quota' value=$filter_quota> GB
</td>
</tr>
</table>";
echo "<br><input id='button-email' type='submit' name='submit'
value='".L10N_CREATE_LIST."'>
</form>";
?>
</body>
</html>