set_maintenance_mode.php 429 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * Configure site maintenance mode
  4. */
  5. $mode = (int)get_input('mode');
  6. $message = get_input('message');
  7. $site = elgg_get_site_entity();
  8. $result = elgg_save_config('elgg_maintenance_mode', $mode, null);
  9. $result = $result && $site->setPrivateSetting('elgg_maintenance_message', $message);
  10. if ($result) {
  11. system_message(elgg_echo('admin:maintenance_mode:saved'));
  12. } else {
  13. register_error(elgg_echo('save:fail'));
  14. }