Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php'; |
| 3 | if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'domainadmin') { |
| 4 | |
| 5 | /* |
| 6 | / DOMAIN ADMIN |
| 7 | */ |
| 8 | |
| 9 | require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php'; |
| 10 | $_SESSION['return_to'] = $_SERVER['REQUEST_URI']; |
| 11 | $tfa_data = get_tfa(); |
| 12 | $fido2_data = fido2(array("action" => "get_friendly_names")); |
| 13 | $username = $_SESSION['mailcow_cc_username']; |
| 14 | |
| 15 | ?> |
| 16 | <div class="container"> |
| 17 | |
| 18 | <h3><?=$lang['user']['user_settings'];?></h3> |
| 19 | <div class="panel panel-default"> |
| 20 | <div class="panel-heading"><?=$lang['user']['user_settings'];?></div> |
| 21 | <div class="panel-body"> |
| 22 | <div class="row"> |
| 23 | <div class="col-sm-offset-3 col-sm-9"> |
| 24 | <p><a href="#pwChangeModal" data-toggle="modal">[<?=$lang['user']['change_password'];?>]</a></p> |
| 25 | <div class="last-login"></div> |
| 26 | <span class="clear-last-logins"><?=$lang['user']['clear_recent_successful_connections'];?></span> |
| 27 | </div> |
| 28 | </div> |
| 29 | <hr> |
| 30 | |
| 31 | <? // TFA ?> |
| 32 | <div class="row"> |
| 33 | <div class="col-sm-3 col-xs-5 text-right"><?=$lang['tfa']['tfa'];?></div> |
| 34 | <div class="col-sm-9 col-xs-7"> |
| 35 | <p id="tfa_pretty"><?=$tfa_data['pretty'];?></p> |
| 36 | <div id="tfa_keys"> |
| 37 | <?php |
| 38 | if (!empty($tfa_data['additional'])) { |
| 39 | foreach ($tfa_data['additional'] as $key_info) { ?> |
| 40 | <form style="display:inline;" method="post"> |
| 41 | <input type="hidden" name="unset_tfa_key" value="<?=$key_info['id'];?>" /> |
| 42 | <div class="label label-default"><i class="bi bi-key-fill"></i> <?=$key_info['key_id'];?> <a href="#" style="font-weight:bold;color:white" onClick='return confirm("<?=$lang['user']['delete_ays'];?>")?$(this).closest("form").submit():"";'>[<?=strtolower($lang['admin']['remove']);?>]</a></div> |
| 43 | </form> |
| 44 | <?php |
| 45 | } |
| 46 | } |
| 47 | ?> |
| 48 | </div> |
| 49 | <br> |
| 50 | </div> |
| 51 | </div> |
| 52 | <div class="row"> |
| 53 | <div class="col-sm-3 col-xs-5 text-right"><?=$lang['tfa']['set_tfa'];?></div> |
| 54 | <div class="col-sm-9 col-xs-7"> |
| 55 | <select id="selectTFA" class="selectpicker" title="<?=$lang['tfa']['select'];?>"> |
| 56 | <option value="yubi_otp"><?=$lang['tfa']['yubi_otp'];?></option> |
| 57 | <option value="u2f"><?=$lang['tfa']['u2f'];?></option> |
| 58 | <option value="totp"><?=$lang['tfa']['totp'];?></option> |
| 59 | <option value="none"><?=$lang['tfa']['none'];?></option> |
| 60 | </select> |
| 61 | </div> |
| 62 | </div> |
| 63 | |
| 64 | <hr> |
| 65 | <? // FIDO2 ?> |
| 66 | <div class="row"> |
| 67 | <div class="col-sm-3 col-xs-5 text-right"> |
| 68 | <p><i class="bi bi-shield-fill-check"></i> <?=$lang['fido2']['fido2_auth'];?></p> |
| 69 | </div> |
| 70 | </div> |
| 71 | <div class="row"> |
| 72 | <div class="col-sm-3 col-xs-5 text-right"><?=$lang['fido2']['known_ids'];?>:</div> |
| 73 | <div class="col-sm-9 col-xs-7"> |
| 74 | <div class="table-responsive"> |
| 75 | <table class="table table-striped table-hover table-condensed" id="fido2_keys"> |
| 76 | <tr> |
| 77 | <th>ID</th> |
| 78 | <th style="min-width:240px;text-align: right"><?=$lang['admin']['action'];?></th> |
| 79 | </tr> |
| 80 | <?php |
| 81 | if (!empty($fido2_data)) { |
| 82 | foreach ($fido2_data as $key_info) { |
| 83 | ?> |
| 84 | <tr> |
| 85 | <td> |
| 86 | <?=($_SESSION['fido2_cid'] == $key_info['cid']) ? '→ ' : NULL; ?><?=(!empty($key_info['fn']))?$key_info['fn']:$key_info['subject'];?> |
| 87 | </td> |
| 88 | <td style="min-width:240px;text-align: right"> |
| 89 | <form style="display:inline;" method="post"> |
| 90 | <input type="hidden" name="unset_fido2_key" value="<?=$key_info['cid'];?>" /> |
| 91 | <div class="btn-group"> |
| 92 | <a href="#" class="btn btn-xs btn-default" data-cid="<?=$key_info['cid'];?>" data-subject="<?=base64_encode($key_info['subject']);?>" data-toggle="modal" data-target="#fido2ChangeFn"><i class="bi bi-pencil-fill"></i> <?=strtolower($lang['fido2']['rename']);?></a> |
| 93 | <a href="#" onClick='return confirm("<?=$lang['user']['delete_ays'];?>")?$(this).closest("form").submit():"";' class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> <?=strtolower($lang['admin']['remove']);?></a> |
| 94 | </form> |
| 95 | </div> |
| 96 | </td> |
| 97 | </tr> |
| 98 | <?php |
| 99 | } |
| 100 | } |
| 101 | ?> |
| 102 | </table> |
| 103 | </div> |
| 104 | <br> |
| 105 | </div> |
| 106 | </div> |
| 107 | <div class="row"> |
| 108 | <div class="col-sm-offset-3 col-sm-9"> |
| 109 | <button class="btn btn-sm btn-primary" id="register-fido2"><?=$lang['fido2']['set_fido2'];?></button> |
| 110 | </div> |
| 111 | </div> |
| 112 | <br> |
| 113 | <div class="row" id="status-fido2"> |
| 114 | <div class="col-sm-3 col-xs-5 text-right"><?=$lang['fido2']['register_status'];?>:</div> |
| 115 | <div class="col-sm-9 col-xs-7"> |
| 116 | <div id="fido2-alerts">-</div> |
| 117 | </div> |
| 118 | <br> |
| 119 | </div> |
| 120 | |
| 121 | </div> |
| 122 | </div> |
| 123 | </div> |
| 124 | <?php |
| 125 | } |
| 126 | elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'user') { |
| 127 | |
| 128 | /* |
| 129 | / USER |
| 130 | */ |
| 131 | |
| 132 | require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php'; |
| 133 | $_SESSION['return_to'] = $_SERVER['REQUEST_URI']; |
| 134 | $username = $_SESSION['mailcow_cc_username']; |
| 135 | $mailboxdata = mailbox('get', 'mailbox_details', $username); |
| 136 | $pushover_data = pushover('get', $username); |
| 137 | $tfa_data = get_tfa(); |
| 138 | $fido2_data = fido2(array("action" => "get_friendly_names")); |
| 139 | |
| 140 | $clientconfigstr = "host=" . urlencode($mailcow_hostname) . "&email=" . urlencode($username) . "&name=" . urlencode($mailboxdata['name']) . "&ui=" . urlencode(strtok($_SERVER['HTTP_HOST'], ':')) . "&port=" . urlencode($autodiscover_config['caldav']['port']); |
| 141 | if ($autodiscover_config['useEASforOutlook'] == 'yes') |
| 142 | $clientconfigstr .= "&outlookEAS=1"; |
| 143 | if (file_exists('thunderbird-plugins/version.csv')) { |
| 144 | $fh = fopen('thunderbird-plugins/version.csv', 'r'); |
| 145 | if ($fh) { |
| 146 | while (($row = fgetcsv($fh, 1000, ';')) !== FALSE) { |
| 147 | if ($row[0] == 'sogo-connector@inverse.ca') { |
| 148 | $clientconfigstr .= "&connector=" . urlencode($row[1]); |
| 149 | } |
| 150 | } |
| 151 | fclose($fh); |
| 152 | } |
| 153 | } |
| 154 | ?> |
| 155 | <div class="container"> |
| 156 | |
| 157 | <!-- Nav tabs --> |
| 158 | <ul class="nav nav-tabs responsive-tabs" role="tablist"> |
| 159 | <li class="dropdown active"> |
| 160 | <a class="dropdown-toggle" data-toggle="dropdown" href="#"><?=$lang['user']['mailbox'];?><span class="caret"></span></a> |
| 161 | <ul class="dropdown-menu"> |
| 162 | <li role="presentation" class="active" data-dont-remember="1"><a href="#tab-user-auth" aria-controls="tab-user-auth" role="tab" data-toggle="tab"><?=$lang['user']['mailbox_general'];?></a></li> |
| 163 | <li role="presentation"><a href="#tab-user-details" aria-controls="tab-config-fwdhosts" role="tab" data-toggle="tab"><?=$lang['user']['mailbox_details'];?></a></li> |
| 164 | <li role="presentation"><a href="#tab-user-settings" aria-controls="tab-config-f2b" role="tab" data-toggle="tab"><?=$lang['user']['mailbox_settings'];?></a></li> |
| 165 | </ul> |
| 166 | </li> |
| 167 | <li role="presentation"><a href="#SpamAliases" aria-controls="SpamAliases" role="tab" data-toggle="tab"><?=$lang['user']['spam_aliases'];?></a></li> |
| 168 | <li role="presentation"><a href="#Spamfilter" aria-controls="Spamfilter" role="tab" data-toggle="tab"><?=$lang['user']['spamfilter'];?></a></li> |
| 169 | <li role="presentation"><a href="#Syncjobs" aria-controls="Syncjobs" role="tab" data-toggle="tab"><?=$lang['user']['sync_jobs'];?></a></li> |
| 170 | <li role="presentation"><a href="#AppPasswds" aria-controls="AppPasswds" role="tab" data-toggle="tab"><?=$lang['user']['app_passwds'];?></a></li> |
| 171 | <li role="presentation"><a href="#Pushover" aria-controls="Pushover" role="tab" data-toggle="tab">Pushover API</a></li> |
| 172 | </ul> |
| 173 | <hr> |
| 174 | |
| 175 | <div class="tab-content"> |
| 176 | |
| 177 | <div role="tabpanel" class="tab-pane active" id="tab-user-auth"> |
| 178 | <div class="panel panel-default"> |
| 179 | <div class="panel-heading"><?=$lang['user']['mailbox_general'];?></div> |
| 180 | <div class="panel-body"> |
| 181 | <?php if (getenv('SKIP_SOGO') != "y") { ?> |
| 182 | <div class="row"> |
| 183 | <div class="hidden-xs col-md-3 col-xs-5 text-right"></div> |
| 184 | <div class="col-md-3 col-xs-12"> |
| 185 | <a target="_blank" href="/sogo-auth.php?login=<?=$username;?>" role="button" class="btn btn-default btn-block btn-xs-lg"> |
| 186 | <i class="bi bi-inbox-fill"></i> <?=$lang['user']['open_webmail_sso'];?> |
| 187 | </a> |
| 188 | </div> |
| 189 | </div> |
| 190 | <hr> |
| 191 | <?php } ?> |
| 192 | <div class="row"> |
| 193 | <div class="col-md-3 col-xs-12 text-right text-xs-left space20"><?=$lang['user']['in_use'];?>:</div> |
| 194 | <div class="col-md-5 col-xs-12"> |
| 195 | <div class="progress"> |
| 196 | <div class="progress-bar progress-bar-<?=$mailboxdata['percent_class'];?>" role="progressbar" aria-valuenow="<?=$mailboxdata['percent_in_use'];?>" aria-valuemin="0" aria-valuemax="100" style="min-width:2em;width: <?=$mailboxdata['percent_in_use'];?>%;"> |
| 197 | <?=$mailboxdata['percent_in_use'];?>% |
| 198 | </div> |
| 199 | </div> |
| 200 | <p><?=formatBytes($mailboxdata['quota_used'], 2);?> / <?=($mailboxdata['quota'] == 0) ? '∞' : formatBytes($mailboxdata['quota'], 2);?><br><?=$mailboxdata['messages'];?> <?=$lang['user']['messages'];?></p> |
| 201 | <hr> |
| 202 | <p><a href="#pwChangeModal" data-toggle="modal"><i class="bi bi-pencil-fill"></i> <?=$lang['user']['change_password'];?></a></p> |
| 203 | </div> |
| 204 | </div> |
| 205 | <hr> |
| 206 | <? // FIDO2 ?> |
| 207 | <div class="row"> |
| 208 | <div class="col-sm-3 col-xs-12 text-right text-xs-left"> |
| 209 | <p><i class="bi bi-shield-fill-check"></i> <?=$lang['fido2']['fido2_auth'];?></p> |
| 210 | </div> |
| 211 | </div> |
| 212 | <div class="row"> |
| 213 | <div class="col-sm-3 col-xs-12 text-right text-xs-left space20"> |
| 214 | <?=$lang['fido2']['known_ids'];?>: |
| 215 | </div> |
| 216 | <div class="col-sm-9 col-xs-12"> |
| 217 | <div class="table-responsive"> |
| 218 | <table class="table table-striped table-hover table-condensed" id="fido2_keys"> |
| 219 | <tr> |
| 220 | <th>ID</th> |
| 221 | <th style="min-width:240px;text-align: right"><?=$lang['admin']['action'];?></th> |
| 222 | </tr> |
| 223 | <?php |
| 224 | if (!empty($fido2_data)) { |
| 225 | foreach ($fido2_data as $key_info) { |
| 226 | ?> |
| 227 | <tr> |
| 228 | <td> |
| 229 | <?=($_SESSION['fido2_cid'] == $key_info['cid']) ? '<i class="bi bi-unlock-fill"></i> ' : NULL; ?><?=(!empty($key_info['fn']))?$key_info['fn']:$key_info['subject'];?> |
| 230 | </td> |
| 231 | <td style="min-width:240px;text-align: right"> |
| 232 | <form style="display:inline;" method="post"> |
| 233 | <input type="hidden" name="unset_fido2_key" value="<?=$key_info['cid'];?>" /> |
| 234 | <div class="btn-group"> |
| 235 | <a href="#" class="btn btn-xs btn-default" data-cid="<?=$key_info['cid'];?>" data-subject="<?=base64_encode($key_info['subject']);?>" data-toggle="modal" data-target="#fido2ChangeFn"><i class="bi bi-pencil-fill"></i> <?=strtolower($lang['fido2']['rename']);?></a> |
| 236 | <a href="#" onClick='return confirm("<?=$lang['user']['delete_ays'];?>")?$(this).closest("form").submit():"";' class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> <?=strtolower($lang['admin']['remove']);?></a> |
| 237 | </div> |
| 238 | </form> |
| 239 | </td> |
| 240 | </tr> |
| 241 | <?php |
| 242 | } |
| 243 | } |
| 244 | ?> |
| 245 | </table> |
| 246 | </div> |
| 247 | <br> |
| 248 | </div> |
| 249 | </div> |
| 250 | <div class="row"> |
| 251 | <div class="col-sm-offset-3 col-sm-9"> |
| 252 | <button class="btn btn-sm btn-primary visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline" id="register-fido2"><?=$lang['fido2']['set_fido2'];?></button> |
| 253 | </div> |
| 254 | </div> |
| 255 | <br> |
| 256 | <div class="row" id="status-fido2"> |
| 257 | <div class="col-sm-3 col-xs-5 text-right"><?=$lang['fido2']['register_status'];?>:</div> |
| 258 | <div class="col-sm-9 col-xs-7"> |
| 259 | <div id="fido2-alerts">-</div> |
| 260 | </div> |
| 261 | <br> |
| 262 | </div> |
| 263 | <hr> |
| 264 | <div class="row"> |
| 265 | <div class="col-md-3 col-xs-12 text-right text-xs-left space20"><i class="bi bi-file-earmark-text"></i> <?=$lang['user']['apple_connection_profile'];?>:</div> |
| 266 | <div class="col-md-9 col-xs-12"> |
| 267 | <p><i class="bi bi-file-earmark-post"></i> <a href="/mobileconfig.php?only_email"><?=$lang['user']['email'];?></a> <small>IMAP, SMTP</small></p> |
| 268 | <p class="help-block"><?=$lang['user']['apple_connection_profile_mailonly'];?></p> |
| 269 | <?php if (getenv('SKIP_SOGO') != "y") { ?> |
| 270 | <p><i class="bi bi-file-earmark-post"></i> <a href="/mobileconfig.php"><?=$lang['user']['email_and_dav'];?></a> <small>IMAP, SMTP, Cal/CardDAV</small></p> |
| 271 | <p class="help-block"><?=$lang['user']['apple_connection_profile_complete'];?></p> |
| 272 | <?php } ?> |
| 273 | </div> |
| 274 | </div> |
| 275 | <hr> |
| 276 | <div class="row"> |
| 277 | <div class="col-sm-offset-3 col-sm-9"> |
| 278 | <?php if ($mailboxdata['attributes']['force_pw_update'] == "1"): ?> |
| 279 | <div class="alert alert-danger"><?=$lang['user']['force_pw_update'];?></div> |
| 280 | <?php endif; ?> |
| 281 | <p><a target="_blank" href="https://mailcow.github.io/mailcow-dockerized-docs/client/#<?=$clientconfigstr;?>">[<?=$lang['user']['client_configuration'];?>]</a></p> |
| 282 | <p><a href="#userFilterModal" data-toggle="modal">[<?=$lang['user']['show_sieve_filters'];?>]</a></p> |
| 283 | <hr> |
| 284 | <h4 class="recent-login-success pull-left"><?=$lang['user']['recent_successful_connections'];?></h4> |
| 285 | <div class="dropdown pull-left pull-xs-right"> |
| 286 | <button class="btn btn-default btn-xs btn-xs-lg dropdown-toggle" type="button" id="history_sasl_days" data-toggle="dropdown"><?=$lang['user']['login_history'];?> <span class="caret"></span></button> |
| 287 | <ul class="dropdown-menu"> |
| 288 | <li class="login-history active" data-days="1"><a href="#">1 <?=$lang['user']['day'];?></a></li> |
| 289 | <li class="login-history" data-days="7"><a href="#">1 <?=$lang['user']['week'];?></a></li> |
| 290 | <li class="login-history" data-days="14"><a href="#">2 <?=$lang['user']['weeks'];?></a></li> |
| 291 | <li class="login-history" data-days="31"><a href="#">1 <?=$lang['user']['month'];?></a></li> |
| 292 | </ul> |
| 293 | </div> |
| 294 | <div class="clearfix"></div> |
| 295 | <div class="last-login"></div> |
| 296 | <span class="clear-last-logins"> |
| 297 | <?=$lang['user']['clear_recent_successful_connections'];?> |
| 298 | </span> |
| 299 | </div> |
| 300 | </div> |
| 301 | </div> |
| 302 | </div> |
| 303 | </div> |
| 304 | |
| 305 | <div role="tabpanel" class="tab-pane" id="tab-user-details"> |
| 306 | <div class="panel panel-default"> |
| 307 | <div class="panel-heading"><?=$lang['user']['mailbox_details'];?></div> |
| 308 | <div class="panel-body"> |
| 309 | <?php // Get user information about aliases |
| 310 | $user_get_alias_details = user_get_alias_details($username); |
| 311 | $user_domains[] = mailbox('get', 'mailbox_details', $username)['domain']; |
| 312 | $user_alias_domains = $user_get_alias_details['alias_domains']; |
| 313 | if (!empty($user_alias_domains)) { |
| 314 | $user_domains = array_merge($user_domains, $user_alias_domains); |
| 315 | } |
| 316 | ?> |
| 317 | <div class="row"> |
| 318 | <div class="col-sm-4 col-md-3 col-xs-12 text-right text-xs-left"><i class="bi bi-pin-angle"></i> <?=$lang['user']['direct_aliases'];?>: |
| 319 | <p class="small"><?=$lang['user']['direct_aliases_desc'];?></p> |
| 320 | </div> |
| 321 | <div class="col-sm-8 col-md-9 col-xs-12"> |
| 322 | <?php |
| 323 | if (empty($user_get_alias_details['direct_aliases'])) { |
| 324 | echo '<i class="bi bi-x-lg"></i>'; |
| 325 | } |
| 326 | else { |
| 327 | foreach (array_filter($user_get_alias_details['direct_aliases']) as $direct_alias => $direct_alias_meta) { |
| 328 | (!empty($direct_alias_meta['public_comment'])) ? |
| 329 | printf('%s — <i class="bi bi-chat-left"></i> %s<br>', $direct_alias, $direct_alias_meta['public_comment']) : |
| 330 | printf('%s<br>', $direct_alias); |
| 331 | } |
| 332 | } |
| 333 | ?> |
| 334 | </div> |
| 335 | </div> |
| 336 | <br> |
| 337 | <div class="row"> |
| 338 | <div class="col-sm-4 col-md-3 col-xs-12 text-right text-xs-left"><i class="bi bi-share"></i> <?=$lang['user']['shared_aliases'];?>: |
| 339 | <p class="small"><?=$lang['user']['shared_aliases_desc'];?></p> |
| 340 | </div> |
| 341 | <div class="col-sm-8 col-md-9 col-xs-12"> |
| 342 | <?php |
| 343 | if (empty($user_get_alias_details['shared_aliases'])) { |
| 344 | echo '<i class="bi bi-x-lg"></i>'; |
| 345 | } |
| 346 | else { |
| 347 | foreach (array_filter($user_get_alias_details['shared_aliases']) as $shared_alias => $shared_alias_meta) { |
| 348 | (!empty($shared_alias_meta['public_comment'])) ? |
| 349 | printf('%s — <span class="bg-info">%s</span><br>', $shared_alias, $shared_alias_meta['public_comment']) : |
| 350 | printf('%s<br>', $shared_alias); |
| 351 | } |
| 352 | } |
| 353 | ?> |
| 354 | </div> |
| 355 | </div> |
| 356 | <hr> |
| 357 | <div class="row"> |
| 358 | <div class="col-sm-4 col-md-3 col-xs-12 text-right text-xs-left space20"><?=$lang['user']['aliases_also_send_as'];?>:</div> |
| 359 | <div class="col-sm-8 col-md-9 col-xs-12"> |
| 360 | <p><?=($user_get_alias_details['aliases_also_send_as'] == '*') ? $lang['user']['sender_acl_disabled'] : ((empty($user_get_alias_details['aliases_also_send_as'])) ? '<i class="bi bi-x-lg"></i>' : $user_get_alias_details['aliases_also_send_as']);?></p> |
| 361 | </div> |
| 362 | </div> |
| 363 | <div class="row"> |
| 364 | <div class="col-sm-4 col-md-3 col-xs-12 text-right text-xs-left space20"><?=$lang['user']['aliases_send_as_all'];?>:</div> |
| 365 | <div class="col-sm-8 col-md-9 col-xs-12"> |
| 366 | <p><?=(empty($user_get_alias_details['aliases_send_as_all'])) ? '<i class="bi bi-x-lg"></i>' : '' ;?></p> |
| 367 | </div> |
| 368 | </div> |
| 369 | <div class="row"> |
| 370 | <div class="col-sm-4 col-md-3 col-xs-12 text-right text-xs-left space20"><?=$lang['user']['is_catch_all'];?>:</div> |
| 371 | <div class="col-sm-8 col-md-9 col-xs-12"> |
| 372 | <p><?=(empty($user_get_alias_details['is_catch_all'])) ? '<i class="bi bi-x-lg"></i>' : '' ;?></p> |
| 373 | </div> |
| 374 | </div> |
| 375 | </div> |
| 376 | </div> |
| 377 | </div> |
| 378 | |
| 379 | <div role="tabpanel" class="tab-pane" id="tab-user-settings"> |
| 380 | <div class="panel panel-default"> |
| 381 | <div class="panel-heading"><?=$lang['user']['mailbox_settings'];?></div> |
| 382 | <div class="panel-body"> |
| 383 | <?php |
| 384 | // Show tagging options |
| 385 | $get_tagging_options = mailbox('get', 'delimiter_action', $username); |
| 386 | ?> |
| 387 | <div class="row"> |
| 388 | <div class="col-sm-3 col-xs-12 text-right text-xs-left text-xs-bold space20"><?=$lang['user']['tag_handling'];?>:</div> |
| 389 | <div class="col-sm-9 col-xs-12"> |
| 390 | <div class="btn-group" data-acl="<?=$_SESSION['acl']['delimiter_action'];?>"> |
| 391 | <button type="button" class="btn btn-sm btn-xs-third visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($get_tagging_options == "subfolder") ? 'active' : null; ?>" |
| 392 | data-action="edit_selected" |
| 393 | data-item="<?= htmlentities($username); ?>" |
| 394 | data-id="delimiter_action" |
| 395 | data-api-url='edit/delimiter_action' |
| 396 | data-api-attr='{"tagged_mail_handler":"subfolder"}'><?=$lang['user']['tag_in_subfolder'];?></button> |
| 397 | <button type="button" class="btn btn-sm btn-xs-third visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($get_tagging_options == "subject") ? 'active' : null; ?>" |
| 398 | data-action="edit_selected" |
| 399 | data-item="<?= htmlentities($username); ?>" |
| 400 | data-id="delimiter_action" |
| 401 | data-api-url='edit/delimiter_action' |
| 402 | data-api-attr='{"tagged_mail_handler":"subject"}'><?=$lang['user']['tag_in_subject'];?></button> |
| 403 | <button type="button" class="btn btn-sm btn-xs-third visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($get_tagging_options == "none") ? 'active' : null; ?>" |
| 404 | data-action="edit_selected" |
| 405 | data-item="<?= htmlentities($username); ?>" |
| 406 | data-id="delimiter_action" |
| 407 | data-api-url='edit/delimiter_action' |
| 408 | data-api-attr='{"tagged_mail_handler":"none"}'><?=$lang['user']['tag_in_none'];?></button> |
| 409 | <div class="clearfix visible-xs"></div> |
| 410 | </div> |
| 411 | <p class="help-block"><?=$lang['user']['tag_help_explain'];?></p> |
| 412 | <p class="help-block"><?=$lang['user']['tag_help_example'];?></p> |
| 413 | </div> |
| 414 | </div> |
| 415 | <?php |
| 416 | // Show TLS policy options |
| 417 | $get_tls_policy = mailbox('get', 'tls_policy', $username); |
| 418 | ?> |
| 419 | <div class="row"> |
| 420 | <div class="col-sm-3 col-xs-12 text-right text-xs-left text-xs-bold space20"><?=$lang['user']['tls_policy'];?>:</div> |
| 421 | <div class="col-sm-9 col-xs-12"> |
| 422 | <div class="btn-group" data-acl="<?=$_SESSION['acl']['tls_policy'];?>"> |
| 423 | <button type="button" class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($get_tls_policy['tls_enforce_in'] == "1") ? "active" : null;?>" |
| 424 | data-action="edit_selected" |
| 425 | data-item="<?= htmlentities($username); ?>" |
| 426 | data-id="tls_policy" |
| 427 | data-api-url='edit/tls_policy' |
| 428 | data-api-attr='{"tls_enforce_in":<?=($get_tls_policy['tls_enforce_in'] == "1") ? "0" : "1";?>}'><?=$lang['user']['tls_enforce_in'];?></button> |
| 429 | <button type="button" class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($get_tls_policy['tls_enforce_out'] == "1") ? "active" : null;?>" |
| 430 | data-action="edit_selected" |
| 431 | data-item="<?= htmlentities($username); ?>" |
| 432 | data-id="tls_policy" |
| 433 | data-api-url='edit/tls_policy' |
| 434 | data-api-attr='{"tls_enforce_out":<?=($get_tls_policy['tls_enforce_out'] == "1") ? "0" : "1";?>}'><?=$lang['user']['tls_enforce_out'];?></button> |
| 435 | <div class="clearfix visible-xs"></div> |
| 436 | </div> |
| 437 | <p class="help-block"><?=$lang['user']['tls_policy_warning'];?></p> |
| 438 | </div> |
| 439 | </div> |
| 440 | <?php |
| 441 | // Show quarantine_notification options |
| 442 | $quarantine_notification = mailbox('get', 'quarantine_notification', $username); |
| 443 | $quarantine_category = mailbox('get', 'quarantine_category', $username); |
| 444 | ?> |
| 445 | <div class="row"> |
| 446 | <div class="col-sm-3 col-xs-12 text-right text-xs-left text-xs-bold space20"><?=$lang['user']['quarantine_notification'];?>:</div> |
| 447 | <div class="col-sm-9 col-xs-12"> |
| 448 | <div class="btn-group" data-acl="<?=$_SESSION['acl']['quarantine_notification'];?>"> |
| 449 | <button type="button" class="btn btn-sm btn-xs-quart visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($quarantine_notification == "never") ? "active" : null;?>" |
| 450 | data-action="edit_selected" |
| 451 | data-item="<?= htmlentities($username); ?>" |
| 452 | data-id="quarantine_notification" |
| 453 | data-api-url='edit/quarantine_notification' |
| 454 | data-api-attr='{"quarantine_notification":"never"}'><?=$lang['user']['never'];?></button> |
| 455 | <button type="button" class="btn btn-sm btn-xs-quart visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($quarantine_notification == "hourly") ? "active" : null;?>" |
| 456 | data-action="edit_selected" |
| 457 | data-item="<?= htmlentities($username); ?>" |
| 458 | data-id="quarantine_notification" |
| 459 | data-api-url='edit/quarantine_notification' |
| 460 | data-api-attr='{"quarantine_notification":"hourly"}'><?=$lang['user']['hourly'];?></button> |
| 461 | <button type="button" class="btn btn-sm btn-xs-quart visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($quarantine_notification == "daily") ? "active" : null;?>" |
| 462 | data-action="edit_selected" |
| 463 | data-item="<?= htmlentities($username); ?>" |
| 464 | data-id="quarantine_notification" |
| 465 | data-api-url='edit/quarantine_notification' |
| 466 | data-api-attr='{"quarantine_notification":"daily"}'><?=$lang['user']['daily'];?></button> |
| 467 | <button type="button" class="btn btn-sm btn-xs-quart visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($quarantine_notification == "weekly") ? "active" : null;?>" |
| 468 | data-action="edit_selected" |
| 469 | data-item="<?= htmlentities($username); ?>" |
| 470 | data-id="quarantine_notification" |
| 471 | data-api-url='edit/quarantine_notification' |
| 472 | data-api-attr='{"quarantine_notification":"weekly"}'><?=$lang['user']['weekly'];?></button> |
| 473 | <div class="clearfix visible-xs"></div> |
| 474 | </div> |
| 475 | <p class="help-block"><?=$lang['user']['quarantine_notification_info'];?></p> |
| 476 | </div> |
| 477 | </div> |
| 478 | <div class="row"> |
| 479 | <div class="col-sm-3 col-xs-12 text-right text-xs-left text-xs-bold space20"><?=$lang['user']['quarantine_category'];?>:</div> |
| 480 | <div class="col-sm-9 col-xs-12"> |
| 481 | <div class="btn-group" data-acl="<?=$_SESSION['acl']['quarantine_category'];?>"> |
| 482 | <button type="button" class="btn btn-sm btn-xs-third visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($quarantine_category == "reject") ? "active" : null;?>" |
| 483 | data-action="edit_selected" |
| 484 | data-item="<?= htmlentities($username); ?>" |
| 485 | data-id="quarantine_category" |
| 486 | data-api-url='edit/quarantine_category' |
| 487 | data-api-attr='{"quarantine_category":"reject"}'><?=$lang['user']['q_reject'];?></button> |
| 488 | <button type="button" class="btn btn-sm btn-xs-third visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($quarantine_category == "add_header") ? "active" : null;?>" |
| 489 | data-action="edit_selected" |
| 490 | data-item="<?= htmlentities($username); ?>" |
| 491 | data-id="quarantine_category" |
| 492 | data-api-url='edit/quarantine_category' |
| 493 | data-api-attr='{"quarantine_category":"add_header"}'><?=$lang['user']['q_add_header'];?></button> |
| 494 | <button type="button" class="btn btn-sm btn-xs-third visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default <?=($quarantine_category == "all") ? "active" : null;?>" |
| 495 | data-action="edit_selected" |
| 496 | data-item="<?= htmlentities($username); ?>" |
| 497 | data-id="quarantine_category" |
| 498 | data-api-url='edit/quarantine_category' |
| 499 | data-api-attr='{"quarantine_category":"all"}'><?=$lang['user']['q_all'];?></button> |
| 500 | <div class="clearfix visible-xs"></div> |
| 501 | </div> |
| 502 | <p class="help-block"><?=$lang['user']['quarantine_category_info'];?></p> |
| 503 | </div> |
| 504 | </div> |
| 505 | <?php if (getenv('SKIP_SOGO') != "y") { ?> |
| 506 | <hr> |
| 507 | <div class="row"> |
| 508 | <div class="col-sm-3 col-xs-12 text-right text-xs-left text-xs-bold space20"><?=$lang['user']['eas_reset'];?>:</div> |
| 509 | <div class="col-sm-9 col-xs-12"> |
| 510 | <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" data-acl="<?=$_SESSION['acl']['eas_reset'];?>" data-action="delete_selected" data-text="<?=$lang['user']['eas_reset'];?>?" data-item="<?= htmlentities($username); ?>" data-id="eas_cache" data-api-url='delete/eas_cache' href="#"><?=$lang['user']['eas_reset_now'];?></button> |
| 511 | <p class="help-block"><?=$lang['user']['eas_reset_help'];?></p> |
| 512 | </div> |
| 513 | </div> |
| 514 | <div class="row"> |
| 515 | <div class="col-sm-3 col-xs-12 text-right text-xs-left text-xs-bold space20"><?=$lang['user']['sogo_profile_reset'];?>:</div> |
| 516 | <div class="col-sm-9 col-xs-12"> |
| 517 | <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" data-acl="<?=$_SESSION['acl']['sogo_profile_reset'];?>" data-action="delete_selected" data-text="<?=$lang['user']['sogo_profile_reset'];?>?" data-item="<?= htmlentities($username); ?>" data-id="sogo_profile" data-api-url='delete/sogo_profile' href="#"><?=$lang['user']['sogo_profile_reset_now'];?></button> |
| 518 | <p class="help-block"><?=$lang['user']['sogo_profile_reset_help'];?></p> |
| 519 | </div> |
| 520 | </div> |
| 521 | <?php } ?> |
| 522 | </div> |
| 523 | </div> |
| 524 | </div> |
| 525 | |
| 526 | <div role="tabpanel" class="tab-pane" id="SpamAliases"> |
| 527 | <div class="row"> |
| 528 | <div class="col-md-12 col-sm-12 col-xs-12"> |
| 529 | <div class="table-responsive"> |
| 530 | <table class="table table-striped" id="tla_table"></table> |
| 531 | </div> |
| 532 | </div> |
| 533 | </div> |
| 534 | <div class="mass-actions-user"> |
| 535 | <div class="btn-group" data-acl="<?=$_SESSION['acl']['spam_alias'];?>"> |
| 536 | <div class="btn-group"> |
| 537 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" id="toggle_multi_select_all" data-id="tla" href="#"><i class="bi bi-check-all"></i> <?=$lang['mailbox']['toggle_all'];?></a> |
| 538 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default dropdown-toggle" data-toggle="dropdown" href="#"><?=$lang['mailbox']['quick_actions'];?> <span class="caret"></span></a> |
| 539 | <ul class="dropdown-menu"> |
| 540 | <li><a data-action="edit_selected" data-id="tla" data-api-url='edit/time_limited_alias' data-api-attr='{"validity":"1"}' href="#"><?=$lang['user']['expire_in'];?> 1 <?=$lang['user']['hour'];?></a></li> |
| 541 | <li><a data-action="edit_selected" data-id="tla" data-api-url='edit/time_limited_alias' data-api-attr='{"validity":"24"}' href="#"><?=$lang['user']['expire_in'];?> 1 <?=$lang['user']['day'];?></a></li> |
| 542 | <li><a data-action="edit_selected" data-id="tla" data-api-url='edit/time_limited_alias' data-api-attr='{"validity":"168"}' href="#"><?=$lang['user']['expire_in'];?> 1 <?=$lang['user']['week'];?></a></li> |
| 543 | <li><a data-action="edit_selected" data-id="tla" data-api-url='edit/time_limited_alias' data-api-attr='{"validity":"744"}' href="#"><?=$lang['user']['expire_in'];?> 1 <?=$lang['user']['month'];?></a></li> |
| 544 | <li><a data-action="edit_selected" data-id="tla" data-api-url='edit/time_limited_alias' data-api-attr='{"validity":"8760"}' href="#"><?=$lang['user']['expire_in'];?> 1 <?=$lang['user']['year'];?></a></li> |
| 545 | <li><a data-action="edit_selected" data-id="tla" data-api-url='edit/time_limited_alias' data-api-attr='{"validity":"87600"}' href="#"><?=$lang['user']['expire_in'];?> 10 <?=$lang['user']['years'];?></a></li> |
| 546 | <li role="separator" class="divider"></li> |
| 547 | <li><a data-action="delete_selected" data-id="tla" data-api-url='delete/time_limited_alias' href="#"><?=$lang['mailbox']['remove'];?></a></li> |
| 548 | </ul> |
| 549 | <div class="clearfix visible-xs-block"></div> |
| 550 | </div> |
| 551 | <div class="btn-group"> |
| 552 | <a class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success dropdown-toggle" data-toggle="dropdown" href="#"><i class="bi bi-plus-lg"></i> <?=$lang['user']['alias_create_random'];?>, 1 <?=$lang['user']['year'];?> <span class="caret"></span></a> |
| 553 | <ul class="dropdown-menu"> |
| 554 | <?php |
| 555 | foreach($user_domains as $domain) { |
| 556 | ?> |
| 557 | <li> |
| 558 | <a data-action="add_item" data-api-url='add/time_limited_alias' data-api-attr='{"domain":"<?=$domain;?>"}' href="#"> |
| 559 | @ <?=$domain;?> |
| 560 | </a> |
| 561 | </li> |
| 562 | <?php |
| 563 | } |
| 564 | ?> |
| 565 | </ul> |
| 566 | </div> |
| 567 | </div> |
| 568 | </div> |
| 569 | </div> |
| 570 | |
| 571 | <div role="tabpanel" class="tab-pane" id="Spamfilter"> |
| 572 | <h4><?=$lang['user']['spamfilter_behavior'];?></h4> |
| 573 | <div class="row"> |
| 574 | <div class="col-sm-12"> |
| 575 | <form class="form-horizontal" role="form" data-id="spam_score" method="post"> |
| 576 | <div class="form-group"> |
| 577 | <div class="col-lg-8 col-sm-12"> |
| 578 | <div id="spam_score" data-provide="slider" data-acl="<?=$_SESSION['acl']['spam_score'];?>"></div> |
| 579 | <input id="spam_score_value" name="spam_score" type="hidden" value="<?=mailbox('get', 'spam_score', $username);?>"> |
| 580 | <ul class="list-group list-group-flush"> |
| 581 | <li class="list-group-item"><span class="label label-ham spam-ham-score"></span> <?=$lang['user']['spamfilter_green'];?></li> |
| 582 | <li class="list-group-item"><span class="label label-spam spam-spam-score"></span> <?=$lang['user']['spamfilter_yellow'];?></li> |
| 583 | <li class="list-group-item"><span class="label label-reject spam-reject-score"></span> <?=$lang['user']['spamfilter_red'];?></li> |
| 584 | </ul> |
| 585 | </div> |
| 586 | </div> |
| 587 | <div class="btn-group" data-acl="<?=$_SESSION['acl']['spam_score'];?>"> |
| 588 | <a type="button" class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="edit_selected" |
| 589 | data-item="<?= htmlentities($username); ?>" |
| 590 | data-id="spam_score" |
| 591 | data-api-url='edit/spam-score' |
| 592 | data-api-attr='{}'><i class="bi bi-save"></i> <?=$lang['user']['save_changes'];?></a> |
| 593 | <a type="button" class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" data-action="edit_selected" |
| 594 | data-item="<?= htmlentities($username); ?>" |
| 595 | data-id="spam_score_reset" |
| 596 | data-api-url='edit/spam-score' |
| 597 | data-api-attr='{"spam_score":"default"}'><?=$lang['user']['spam_score_reset'];?></a> |
| 598 | </div> |
| 599 | </form> |
| 600 | </div> |
| 601 | </div> |
| 602 | <hr> |
| 603 | <div class="row"> |
| 604 | <div class="col-sm-6"> |
| 605 | <h4><?=$lang['user']['spamfilter_wl'];?></h4> |
| 606 | <p><?=$lang['user']['spamfilter_wl_desc'];?></p> |
| 607 | <form class="form-inline space20" data-id="add_wl_policy_mailbox"> |
| 608 | <div class="input-group" data-acl="<?=$_SESSION['acl']['spam_policy'];?>"> |
| 609 | <input type="text" class="form-control" name="object_from" placeholder="*@example.org" required> |
| 610 | <span class="input-group-btn"> |
| 611 | <button class="btn btn-default" data-action="add_item" data-id="add_wl_policy_mailbox" data-api-url='add/mailbox-policy' data-api-attr='{"username":<?= json_encode($username); ?>,"object_list":"wl"}' href="#"><i class="bi bi-plus-lg"></i> <?=$lang['user']['spamfilter_table_add'];?></button> |
| 612 | </span> |
| 613 | </div> |
| 614 | </form> |
| 615 | <div class="table-responsive"> |
| 616 | <table class="table table-striped table-condensed" id="wl_policy_mailbox_table"></table> |
| 617 | </div> |
| 618 | <div class="mass-actions-user"> |
| 619 | <div class="btn-group" data-acl="<?=$_SESSION['acl']['spam_policy'];?>"> |
| 620 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" id="toggle_multi_select_all" data-id="policy_wl_mailbox" href="#"><i class="bi bi-check-all"></i> <?=$lang['mailbox']['toggle_all'];?></a> |
| 621 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-danger" data-action="delete_selected" data-id="policy_wl_mailbox" data-api-url='delete/mailbox-policy' href="#"><?=$lang['mailbox']['remove'];?></a> |
| 622 | <div class="clearfix visible-xs-block"></div> |
| 623 | </div> |
| 624 | </div> |
| 625 | </div> |
| 626 | <div class="col-sm-6"> |
| 627 | <h4><?=$lang['user']['spamfilter_bl'];?></h4> |
| 628 | <p><?=$lang['user']['spamfilter_bl_desc'];?></p> |
| 629 | <form class="form-inline space20" data-id="add_bl_policy_mailbox"> |
| 630 | <div class="input-group" data-acl="<?=$_SESSION['acl']['spam_policy'];?>"> |
| 631 | <input type="text" class="form-control" name="object_from" placeholder="*@example.org" required> |
| 632 | <span class="input-group-btn"> |
| 633 | <button class="btn btn-default" data-action="add_item" data-id="add_bl_policy_mailbox" data-api-url='add/mailbox-policy' data-api-attr='{"username":<?= json_encode($username); ?>,"object_list":"bl"}' href="#"><i class="bi bi-plus-lg"></i> <?=$lang['user']['spamfilter_table_add'];?></button> |
| 634 | </span> |
| 635 | </div> |
| 636 | </form> |
| 637 | <div class="table-responsive"> |
| 638 | <table class="table table-striped table-condensed" id="bl_policy_mailbox_table"></table> |
| 639 | </div> |
| 640 | <div class="mass-actions-user"> |
| 641 | <div class="btn-group" data-acl="<?=$_SESSION['acl']['spam_policy'];?>"> |
| 642 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" id="toggle_multi_select_all" data-id="policy_bl_mailbox" href="#"><i class="bi bi-check-all"></i> <?=$lang['mailbox']['toggle_all'];?></a> |
| 643 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-danger" data-action="delete_selected" data-id="policy_bl_mailbox" data-api-url='delete/mailbox-policy' href="#"><?=$lang['mailbox']['remove'];?></a> |
| 644 | <div class="clearfix visible-xs-block"></div> |
| 645 | </div> |
| 646 | </div> |
| 647 | </div> |
| 648 | </div> |
| 649 | </div> |
| 650 | |
| 651 | <div role="tabpanel" class="tab-pane" id="Syncjobs"> |
| 652 | <div class="table-responsive"> |
| 653 | <table class="table table-striped" id="sync_job_table"></table> |
| 654 | </div> |
| 655 | <div class="mass-actions-user"> |
| 656 | <div class="btn-group" data-acl="<?=$_SESSION['acl']['syncjobs'];?>"> |
| 657 | <div class="btn-group"> |
| 658 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" id="toggle_multi_select_all" data-id="syncjob" href="#"><i class="bi bi-check-all"></i> <?=$lang['mailbox']['toggle_all'];?></a> |
| 659 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default dropdown-toggle" data-toggle="dropdown" href="#"><?=$lang['mailbox']['quick_actions'];?> <span class="caret"></span></a> |
| 660 | <ul class="dropdown-menu"> |
| 661 | <li><a data-action="edit_selected" data-id="syncjob" data-api-url='edit/syncjob' data-api-attr='{"active":"1"}' href="#"><?=$lang['mailbox']['activate'];?></a></li> |
| 662 | <li><a data-action="edit_selected" data-id="syncjob" data-api-url='edit/syncjob' data-api-attr='{"active":"0"}' href="#"><?=$lang['mailbox']['deactivate'];?></a></li> |
| 663 | <li role="separator" class="divider"></li> |
| 664 | <li><a data-action="delete_selected" data-id="syncjob" data-api-url='delete/syncjob' href="#"><?=$lang['mailbox']['remove'];?></a></li> |
| 665 | </ul> |
| 666 | <div class="clearfix visible-xs"></div> |
| 667 | </div> |
| 668 | <div class="btn-group"> |
| 669 | <a class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" href="#" data-toggle="modal" data-target="#addSyncJobModal"><i class="bi bi-plus-lg"></i> <?=$lang['user']['create_syncjob'];?></a> |
| 670 | </div> |
| 671 | </div> |
| 672 | </div> |
| 673 | </div> |
| 674 | |
| 675 | <div role="tabpanel" class="tab-pane" id="AppPasswds"> |
| 676 | <p><?=$lang['user']['app_hint'];?></p> |
| 677 | <div class="table-responsive"> |
| 678 | <table class="table table-striped" id="app_passwd_table"></table> |
| 679 | </div> |
| 680 | <div class="mass-actions-user"> |
| 681 | <div class="btn-group" data-acl="<?=$_SESSION['acl']['app_passwds'];?>"> |
| 682 | <div class="btn-group"> |
| 683 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" id="toggle_multi_select_all" data-id="apppasswd" href="#"><i class="bi bi-check-all"></i> <?=$lang['mailbox']['toggle_all'];?></a> |
| 684 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default dropdown-toggle" data-toggle="dropdown" href="#"><?=$lang['mailbox']['quick_actions'];?> <span class="caret"></span></a> |
| 685 | <ul class="dropdown-menu"> |
| 686 | <li><a data-action="edit_selected" data-id="apppasswd" data-api-url='edit/app-passwd' data-api-attr='{"active":"1"}' href="#"><?=$lang['mailbox']['activate'];?></a></li> |
| 687 | <li><a data-action="edit_selected" data-id="apppasswd" data-api-url='edit/app-passwd' data-api-attr='{"active":"0"}' href="#"><?=$lang['mailbox']['deactivate'];?></a></li> |
| 688 | <li role="separator" class="divider"></li> |
| 689 | <li><a data-action="delete_selected" data-id="apppasswd" data-api-url='delete/app-passwd' href="#"><?=$lang['mailbox']['remove'];?></a></li> |
| 690 | </ul> |
| 691 | <div class="clearfix visible-xs"></div> |
| 692 | </div> |
| 693 | <div class="btn-group"> |
| 694 | <a class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" href="#" data-toggle="modal" data-target="#addAppPasswdModal"><i class="bi bi-plus-lg"></i> <?=$lang['user']['create_app_passwd'];?></a> |
| 695 | </div> |
| 696 | </div> |
| 697 | </div> |
| 698 | </div> |
| 699 | |
| 700 | <div role="tabpanel" class="tab-pane" id="Pushover"> |
| 701 | <form data-id="pushover" class="form well" method="post"> |
| 702 | <input type="hidden" value="0" name="evaluate_x_prio"> |
| 703 | <input type="hidden" value="0" name="only_x_prio"> |
| 704 | <input type="hidden" value="0" name="active"> |
| 705 | <div class="row"> |
| 706 | <div class="col-sm-1"> |
| 707 | <p class="help-block"><a href="https://pushover.net" target="_blank"><img src="data:image/png;base64,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" class="img img-fluid"></a></p> |
| 708 | </div> |
| 709 | <div class="col-sm-10"> |
| 710 | <p class="help-block"><?=sprintf($lang['user']['pushover_info'], $username);?></p> |
| 711 | <p class="help-block"><?=$lang['user']['pushover_vars'];?>: <code>{SUBJECT}</code>, <code>{SENDER}</code></p> |
| 712 | <div class="form-group"> |
| 713 | <div class="row"> |
| 714 | <div class="col-sm-6"> |
| 715 | <div class="form-group"> |
| 716 | <label for="token">API Token/Key (Application)</label> |
| 717 | <input type="text" class="form-control" name="token" maxlength="30" value="<?=$pushover_data['token'];?>" required> |
| 718 | </div> |
| 719 | </div> |
| 720 | <div class="col-sm-6"> |
| 721 | <div class="form-group"> |
| 722 | <label for="key">User/Group Key</label> |
| 723 | <input type="text" class="form-control" name="key" maxlength="30" value="<?=$pushover_data['key'];?>" required> |
| 724 | </div> |
| 725 | </div> |
| 726 | <div class="col-sm-6"> |
| 727 | <div class="form-group"> |
| 728 | <label for="title"><?=$lang['user']['pushover_title'];?></label> |
| 729 | <input type="text" class="form-control" name="title" value="<?=$pushover_data['title'];?>" placeholder="Mail"> |
| 730 | </div> |
| 731 | </div> |
| 732 | <div class="col-sm-6"> |
| 733 | <div class="form-group"> |
| 734 | <label for="text"><?=$lang['user']['pushover_text'];?></label> |
| 735 | <input type="text" class="form-control" name="text" value="<?=$pushover_data['text'];?>" placeholder="You've got mail 📧"> |
| 736 | </div> |
| 737 | </div> |
| 738 | <div class="col-sm-12"> |
| 739 | <div class="form-group"> |
| 740 | <label for="text"><?=$lang['user']['pushover_sender_array'];?></label> |
| 741 | <input type="text" class="form-control" name="senders" value="<?=$pushover_data['senders'];?>" placeholder="sender1@example.com, sender2@example.com"> |
| 742 | </div> |
| 743 | </div> |
| 744 | <div class="col-sm-12"> |
| 745 | <div class="checkbox"> |
| 746 | <label><input type="checkbox" value="1" name="active" <?=($pushover_data['active']=="1") ? "checked" : null;?>> <?=$lang['user']['active'];?></label> |
| 747 | </div> |
| 748 | </div> |
| 749 | <div class="col-sm-12"> |
| 750 | <legend style="cursor:pointer;margin-top:10px" data-target="#po_advanced" unselectable="on" data-toggle="collapse"> |
| 751 | <i style="font-size:10pt;" class="bi bi-plus-square"></i> <?=$lang['user']['advanced_settings'];?> |
| 752 | </legend> |
| 753 | </div> |
| 754 | <div class="col-sm-12"> |
| 755 | <div id="po_advanced" class="collapse"> |
| 756 | <div class="form-group"> |
| 757 | <label for="text"><?=$lang['user']['pushover_sender_regex'];?></label> |
| 758 | <input type="text" class="form-control" name="senders_regex" value="<?=$pushover_data['senders_regex'];?>" placeholder="/(.*@example\.org$|^foo@example\.com$)/i" regex="true"> |
| 759 | <div class="checkbox"> |
| 760 | <label><input type="checkbox" value="1" name="evaluate_x_prio" <?=($pushover_data['attributes']['evaluate_x_prio']=="1") ? "checked" : null;?>> <?=$lang['user']['pushover_evaluate_x_prio'];?></label> |
| 761 | </div> |
| 762 | <div class="checkbox"> |
| 763 | <label><input type="checkbox" value="1" name="only_x_prio" <?=($pushover_data['attributes']['only_x_prio']=="1") ? "checked" : null;?>> <?=$lang['user']['pushover_only_x_prio'];?></label> |
| 764 | </div> |
| 765 | </div> |
| 766 | </div> |
| 767 | </div> |
| 768 | </div> |
| 769 | </div> |
| 770 | <div class="btn-group mass-actions-user" data-acl="<?=$_SESSION['acl']['pushover'];?>"> |
| 771 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="edit_selected" data-id="pushover" data-item="<?=htmlspecialchars($username);?>" data-api-url='edit/pushover' data-api-attr='{}' href="#"><?=$lang['user']['save'];?></a> |
| 772 | <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" data-action="edit_selected" data-id="pushover-test" data-item="<?=htmlspecialchars($username);?>" data-api-url='edit/pushover-test' data-api-attr='{}' href="#"><i class="bi bi-check-all"></i> <?=$lang['user']['pushover_verify'];?></a> |
| 773 | <div class="clearfix visible-xs"></div> |
| 774 | <a id="pushover_delete" class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-danger" data-action="edit_selected" data-id="pushover-delete" data-item="<?=htmlspecialchars($username);?>" data-api-url='edit/pushover' data-api-attr='{"delete":"true"}' href="#"><i class="bi bi-trash"></i> <?=$lang['user']['remove'];?></a> |
| 775 | </div> |
| 776 | </div> |
| 777 | </div> |
| 778 | </div> |
| 779 | </form> |
| 780 | </div> |
| 781 | </div> |
| 782 | </div><!-- /container --> |
| 783 | <div style="margin-bottom:200px;"></div> |
| 784 | <?php |
| 785 | } |
| 786 | if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] != 'admin') { |
| 787 | require_once $_SERVER['DOCUMENT_ROOT'] . '/modals/user.php'; |
| 788 | ?> |
| 789 | <script type='text/javascript'> |
| 790 | <?php |
| 791 | $lang_user = json_encode($lang['user']); |
| 792 | echo "var lang = " . $lang_user . ";\n"; |
| 793 | echo "var user_spam_score = [" . mailbox('get', 'spam_score', $username) . "];\n"; |
| 794 | echo "var acl = '" . json_encode($_SESSION['acl']) . "';\n"; |
| 795 | echo "var csrf_token = '" . $_SESSION['CSRF']['TOKEN'] . "';\n"; |
| 796 | echo "var mailcow_cc_username = '" . $_SESSION['mailcow_cc_username'] . "';\n"; |
| 797 | echo "var pagination_size = '" . $PAGINATION_SIZE . "';\n"; |
| 798 | ?> |
| 799 | </script> |
| 800 | <?php |
| 801 | $js_minifier->add('/web/js/site/user.js'); |
| 802 | $js_minifier->add('/web/js/site/pwgen.js'); |
| 803 | require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php'; |
| 804 | } |
| 805 | else { |
| 806 | header('Location: /'); |
| 807 | exit(); |
| 808 | } |
| 809 | ?> |