Changeset 4001:a2dd2cb6fd33
- Timestamp:
- 07/01/19 11:23:37 (6 years ago)
- Branch:
- default
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.namespace.php
r3874 r4001 349 349 350 350 /** 351 * Removes every existing specific setting in a namespace 352 * 353 * @param string $id Setting ID 354 * @param boolean $global Remove global setting too 355 */ 356 public function dropEvery($id, $global = false) 357 { 358 if (!$this->ns) { 359 throw new Exception(__('No namespace specified')); 360 } 361 362 $strReq = 'DELETE FROM ' . $this->table . ' '; 363 if (!$global) { 364 $strReq .= 'WHERE blog_id IS NOT NULL '; 365 } 366 $strReq .= "AND setting_id = '" . $this->con->escape($id) . "' "; 367 $strReq .= "AND setting_ns = '" . $this->con->escape($this->ns) . "' "; 368 369 $this->con->execute($strReq); 370 } 371 372 /** 351 373 Removes all existing settings in a Namespace 352 374 -
inc/core/class.dc.workspace.php
r3874 r4001 365 365 366 366 /** 367 * Removes every existing specific pref. in a workspace 368 * 369 * @param string $id Pref ID 370 * @param boolean $global Remove global pref too 371 */ 372 public function dropEvery($id, $global = false) 373 { 374 if (!$this->ws) { 375 throw new Exception(__('No workspace specified')); 376 } 377 378 $strReq = 'DELETE FROM ' . $this->table . ' '; 379 if (!$global) { 380 $strReq .= 'WHERE user_id IS NOT NULL '; 381 } 382 $strReq .= "AND pref_id = '" . $this->con->escape($id) . "' "; 383 $strReq .= "AND pref_ws = '" . $this->con->escape($this->ws) . "' "; 384 385 $this->con->execute($strReq); 386 } 387 388 /** 367 389 Removes all existing pref. in a Workspace 368 390 -
locales/fr/plugins.po
r3953 r4001 1487 1487 msgstr "Utiliser un délai de rappel différent pour chaque tâche" 1488 1488 1489 msgid "Content-Security-Policy" 1490 msgstr "Content-Security-Policy" 1491 1492 msgid "Enable Content-Security-Policy system" 1493 msgstr "Activer le système Content-Security-Policy" 1494 1495 msgid "Enable Content-Security-Policy report only" 1496 msgstr "Activer le rapport seul pour le système Content-Security-Policy" 1497 1498 msgid "Enable Content-Security-Policy system by default" 1499 msgstr "Activer par défaut le système Content-Security-Policy" 1500 1501 msgid "Enable Content-Security-Policy report only by default" 1502 msgstr "Activer par défaut le rapport seul pour le système Content-Security-Policy" 1503 1504 msgid "Also reset all Content-Security-Policy blogs's settings to default" 1505 msgstr "Remettre tous les réglages Content-Security-Policy des blogs aux valeurs par défaut" 1506 1507 msgid "System settings have been saved." 1508 msgstr "Les réglages système ont été enregistrés." 1509 1510 msgid "All blog's Content-Security-Policy settings have been reset to default." 1511 msgstr "Tous les réglages Content-Security-Policy des blogs ont été remis aux valeurs par défaut." 1512 1489 1513 msgid "New page" 1490 1514 msgstr "Nouvelle page" -
plugins/maintenance/index.php
r3994 r4001 99 99 } 100 100 101 // Save system settings 102 103 if (!empty($_POST['save_system'])) { 104 105 try { 106 // Default (global) settings 107 $core->blog->settings->system->put('csp_admin_on', !empty($_POST['system_csp_global']), null, null, true, true); 108 $core->blog->settings->system->put('csp_admin_report_only', !empty($_POST['system_csp_global_report_only']), null, null, true, true); 109 // Current blog settings 110 $core->blog->settings->system->put('csp_admin_on', !empty($_POST['system_csp'])); 111 $core->blog->settings->system->put('csp_admin_report_only', !empty($_POST['system_csp_report_only'])); 112 113 dcPage::addSuccessNotice(__('System settings have been saved.')); 114 115 if (!empty($_POST['system_csp_reset'])) { 116 $core->blog->settings->system->dropEvery('csp_admin_on'); 117 $core->blog->settings->system->dropEvery('csp_admin_report_only'); 118 dcPage::addSuccessNotice(__('All blog\'s Content-Security-Policy settings have been reset to default.')); 119 } 120 121 http::redirect($p_url . '&tab=' . $tab . '#' . $tab); 122 } catch (Exception $e) { 123 $core->error->add($e->getMessage()); 124 } 125 } 126 101 127 // Combos 102 128 … … 127 153 <body>'; 128 154 129 // Check if there is som thing to display according to user permissions155 // Check if there is something to display according to user permissions 130 156 if (empty($tasks)) { 131 157 echo dcPage::breadcrumb( … … 324 350 '</form>' . 325 351 '</div>'; 352 353 // System tab 354 if ($core->auth->isSuperAdmin()) { 355 echo 356 '<div id="system" class="multi-part" title="' . __('System') . '">' . 357 '<h3>' . __('System settings') . '</h3>' . 358 '<form action="' . $p_url . '" method="post">'; 359 360 echo 361 '<div class="fieldset two-cols clearfix">' . 362 '<h4 class="pretty-title">' . __('Content-Security-Policy') . '</h4>' . 363 364 '<div class="col">' . 365 '<p><label for="system_csp" class="classic">' . 366 form::checkbox('system_csp', '1', $core->blog->settings->system->csp_admin_on) . 367 __('Enable Content-Security-Policy system') . '</label></p>' . 368 '<p><label for="system_csp_report_only" class="classic">' . 369 form::checkbox('system_csp_report_only', '1', $core->blog->settings->system->csp_admin_report_only) . 370 __('Enable Content-Security-Policy report only') . '</label></p>' . 371 '</div>' . 372 373 '<div class="col">' . 374 '<p><label for="system_csp_global" class="classic">' . 375 form::checkbox('system_csp_global', '1', $core->blog->settings->system->getGlobal('csp_admin_on')) . 376 __('Enable Content-Security-Policy system by default') . '</label></p>' . 377 '<p><label for="system_csp_global_report_only" class="classic">' . 378 form::checkbox('system_csp_global_report_only', '1', $core->blog->settings->system->getGlobal('csp_admin_report_only')) . 379 __('Enable Content-Security-Policy report only by default') . '</label></p>' . 380 '<p><label for="system_csp_reset" class="classic">' . 381 form::checkbox('system_csp_reset', '1', 0) . 382 __('Also reset all Content-Security-Policy blogs\'s settings to default') . '</label></p>' . 383 '</div>' . 384 '</div>'; 385 386 echo 387 '<p class="field wide"><input type="submit" value="' . __('Save') . '" /> ' . 388 form::hidden(['tab'], 'system') . 389 form::hidden(['save_system'], 1) . 390 $core->formNonce() . '</p>' . 391 '</form>' . 392 '</div>'; 393 } 394 326 395 } 327 396
Note: See TracChangeset
for help on using the changeset viewer.