-
Notifications
You must be signed in to change notification settings - Fork 3
/
users.php
162 lines (143 loc) · 5.62 KB
/
users.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
$active_page = 'users';
require_once 'functions.php';
require_once 'config.php';
session_secure_start();
require_once 'l10n/'.$_SESSION['language'].'.php';
$export_type = $_SESSION['export_type'];
echo "<html lang='{$_SESSION['language']}'>";
?>
<head>
<link rel="stylesheet" type="text/css" href="style.php">
<meta charset="UTF-8">
<title>Nextcloud Userexport</title>
<script>
function toggle(source) {
checkboxes = document.getElementsByClassName('checkbox');
for(var i=0, n=checkboxes.length;i<n;i++) {
checkboxes[i].checked = source.checked;
}
}
</script>
</head>
<body>
<?php
include 'navigation.php';
if(!$_SESSION['authenticated']) {
header('Content-Type: text/html; charset=utf-8');
exit('<br>'.L10N_CONNECTION_NEEDED);
}
print_status_overview();
echo '<br><u>'.L10N_SELECT_USER_DATA.'</u><br><br>
<form method="post" action="users_detail.php">
<table id="options">
<tr>';
foreach($_SESSION['data_options'] as $option => $title) {
$checked = in_array($option, $_SESSION['data_choices'])
? " checked"
: "";
switch ($option) {
case 'email':
case 'enabled':
case 'percentage_used':
case 'subadmin':
case 'locale':
echo "<td><input type='checkbox' class='checkbox' name='$option' value='true'$checked>$title</td></tr>";
break;
case 'lastLogin':
case 'quota':
case 'free':
case 'language':
echo "<tr><td><input type='checkbox' class='checkbox' name='$option' value='true'$checked>$title</td>";
break;
default:
echo "<td><input type='checkbox' class='checkbox' name='$option' value='true'$checked>$title</td>";
}
}
echo "<tr><td colspan=3 style='height: 10px;'></td></tr>
<tr><td style='border: 1px solid #ddd;'>
<input type='checkbox' onClick='toggle(this)' /> "
.L10N_TOGGLE_ALL. "
</td></tr>
</table><br><br>
<u>".L10N_FILTER_BY."</u><br><br>
<table>
<tr>
<td style='padding-bottom: 0.3em;'>
<input type='checkbox' 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>
<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>
<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>";
?>
<br><br>
<u><?php echo L10N_FORMAT_AS ?></u>
<input type='radio' name='export_type' value='table'
<?php if ($export_type == 'table' || $export_type == null)
echo 'checked=\"checked\"'; ?>> <?php echo L10N_TABLE ?>
<input type='radio' name='export_type' value='csv'
<?php if ($export_type == 'csv')
echo 'checked=\"checked\"'; ?>> CSV
<br><br>
<button id='button-display' type='submit' name='submit'
value='display'><?php echo L10N_DISPLAY ?></button>
<br><br><br>
<u><?php echo L10N_COLUMN_HEADERS ?></u>
<input type='radio' name='csv_headers' value='default'
<?php if ($csv_headers == 'true' || $csv_headers === null)
echo 'checked=\"checked\"'; ?>> <?php echo L10N_YES ?>
<input type='radio' name='csv_headers' value='no_headers'
<?php if ($csv_headers == 'false')
echo 'checked=\"checked\"'; ?>> <?php echo L10N_NO ?>
<br><br>
<button id='button-download' type='submit' name='submit'
value='download'><?php echo L10N_DOWNLOAD_CSV ?></button>
</form>
</body>
</html>