diff --git a/init.d/rc.piler.in b/init.d/rc.piler.in index abea8b24..23dc7c61 100644 --- a/init.d/rc.piler.in +++ b/init.d/rc.piler.in @@ -44,7 +44,11 @@ case "$1" in start; ;; + reload) + kill -HUP $PID_NUMBER + ;; + *) - echo "Usage: $0 start|stop|restart|status" + echo "Usage: $0 start|stop|restart|reload|status" esac diff --git a/init.d/rc.pilergetd.in b/init.d/rc.pilergetd.in index 938e12d1..a42deb19 100644 --- a/init.d/rc.pilergetd.in +++ b/init.d/rc.pilergetd.in @@ -44,7 +44,11 @@ case "$1" in start; ;; + reload) + kill -HUP $PID_NUMBER + ;; + *) - echo "Usage: $0 start|stop|restart|status" + echo "Usage: $0 start|stop|restart|reload|status" esac diff --git a/webui/controller/policy/apply.php b/webui/controller/policy/apply.php new file mode 100644 index 00000000..09f527ce --- /dev/null +++ b/webui/controller/policy/apply.php @@ -0,0 +1,36 @@ +id = "content"; + $this->template = "policy/apply.tpl"; + $this->layout = "common/layout-empty"; + + + $request = Registry::get('request'); + + $db = Registry::get('db'); + $lang = Registry::get('language'); + + if(Registry::get('admin_user') == 0) { + die("go away"); + } + + system('sudo -n /etc/init.d/rc.piler reload', $val); + + if($val === 0) { + print $lang->data['text_applied']; + } else { + print $lang->data['text_install_sudo_apply']; + } + + + } + +} + +?> diff --git a/webui/language/de/messages.php b/webui/language/de/messages.php index 676a17bd..435d37fe 100644 --- a/webui/language/de/messages.php +++ b/webui/language/de/messages.php @@ -17,6 +17,8 @@ $_['text_advanced'] = "Erweitert"; $_['text_advanced_search'] = "Erweiterte Suche"; $_['text_all'] = "alle"; $_['text_any'] = "jede"; +$_['text_applied'] = "Applied"; +$_['text_apply_changes'] = "Apply changes"; $_['text_archive_size'] = "Archivgröße"; $_['text_archived_messages'] = "Archivierte Nachrichten"; $_['text_archiving_rules'] = "Archivierungsregeln"; @@ -138,6 +140,7 @@ $_['text_import'] = "Import"; $_['text_import_users'] = "Benutzer importieren"; $_['text_import_users_from_LDAP'] = "Benutzer aus LDAP importieren"; $_['text_inbound'] = "eingehend"; +$_['text_install_sudo_apply'] = "Add the following to /etc/sudoers: 'www-data ALL=NOPASSWD: /etc/init.d/rc.piler reload'"; $_['text_internal'] = "intern"; $_['text_invalid_data'] = "Ungültige Daten"; $_['text_invalid_email'] = "Ungültige E-Mail-Adresse"; diff --git a/webui/language/en/messages.php b/webui/language/en/messages.php index b475f1c1..1c2a967a 100644 --- a/webui/language/en/messages.php +++ b/webui/language/en/messages.php @@ -17,6 +17,8 @@ $_['text_advanced'] = "Advanced"; $_['text_advanced_search'] = "Advanced search"; $_['text_all'] = "all"; $_['text_any'] = "any"; +$_['text_applied'] = "Applied"; +$_['text_apply_changes'] = "Apply changes"; $_['text_archive_size'] = "Archive size"; $_['text_archived_messages'] = "Archived messages"; $_['text_archiving_rules'] = "Archiving rules"; @@ -138,6 +140,7 @@ $_['text_import'] = "Import"; $_['text_import_users'] = "Import users"; $_['text_import_users_from_LDAP'] = "Import users from LDAP"; $_['text_inbound'] = "inbound"; +$_['text_install_sudo_apply'] = "Add the following to /etc/sudoers: 'www-data ALL=NOPASSWD: /etc/init.d/rc.piler reload'"; $_['text_internal'] = "internal"; $_['text_invalid_data'] = "Invalid data"; $_['text_invalid_email'] = "Invalid email"; diff --git a/webui/language/hu/messages.iso-8859-2.php b/webui/language/hu/messages.iso-8859-2.php index d683ba72..05ba7e37 100644 --- a/webui/language/hu/messages.iso-8859-2.php +++ b/webui/language/hu/messages.iso-8859-2.php @@ -17,6 +17,8 @@ $_['text_advanced'] = " $_['text_advanced_search'] = "Összetett keresés"; $_['text_all'] = "összes"; $_['text_any'] = "mindegy"; +$_['text_applied'] = "Alkalmazva"; +$_['text_apply_changes'] = "Beállítások alkalmazása"; $_['text_archive_size'] = "Archívum méret"; $_['text_archived_messages'] = "Archivált levelek"; $_['text_archiving_rules'] = "Archiválási szabályok"; @@ -138,6 +140,7 @@ $_['text_import'] = "Import"; $_['text_import_users'] = "Felhasználók importálása"; $_['text_import_users_from_LDAP'] = "Felhasználók importálása LDAP-ból"; $_['text_inbound'] = "bejövõ"; +$_['text_install_sudo_apply'] = "Adja az alábbi sort a /etc/sudoers file-hoz: 'www-data ALL=NOPASSWD: /etc/init.d/rc.piler reload'"; $_['text_internal'] = "belsõ"; $_['text_invalid_data'] = "Érvénytelen adat(ok)"; $_['text_invalid_email'] = "Érvénytelen email cím"; diff --git a/webui/language/hu/messages.php b/webui/language/hu/messages.php index d077bc1c..97287853 100644 --- a/webui/language/hu/messages.php +++ b/webui/language/hu/messages.php @@ -17,6 +17,8 @@ $_['text_advanced'] = "Összetett"; $_['text_advanced_search'] = "Összetett keresés"; $_['text_all'] = "összes"; $_['text_any'] = "mindegy"; +$_['text_applied'] = "Alkalmazva"; +$_['text_apply_changes'] = "Beállítások alkalmazása"; $_['text_archive_size'] = "Archívum méret"; $_['text_archived_messages'] = "Archivált levelek"; $_['text_archiving_rules'] = "Archiválási szabályok"; @@ -138,6 +140,7 @@ $_['text_import'] = "Import"; $_['text_import_users'] = "Felhasználók importálása"; $_['text_import_users_from_LDAP'] = "Felhasználók importálása LDAP-ból"; $_['text_inbound'] = "bejövÅ‘"; +$_['text_install_sudo_apply'] = "Adja az alábbi sort a /etc/sudoers file-hoz: 'www-data ALL=NOPASSWD: /etc/init.d/rc.piler reload'"; $_['text_internal'] = "belsÅ‘"; $_['text_invalid_data'] = "Érvénytelen adat(ok)"; $_['text_invalid_email'] = "Érvénytelen email cím"; diff --git a/webui/language/pt/messages.php b/webui/language/pt/messages.php index 007c4137..68a6bd77 100644 --- a/webui/language/pt/messages.php +++ b/webui/language/pt/messages.php @@ -17,6 +17,8 @@ $_['text_advanced'] = "Avançado"; $_['text_advanced_search'] = "Pesquisa avançada"; $_['text_all'] = "todos"; $_['text_any'] = "qualquer"; +$_['text_applied'] = "Applied"; +$_['text_apply_changes'] = "Apply changes"; $_['text_archive_size'] = "Tamanho do arquivo"; $_['text_archived_messages'] = "Mensagens arquivadas"; $_['text_archiving_rules'] = "Regras de não arquivamento"; @@ -138,6 +140,7 @@ $_['text_import'] = "Importar"; $_['text_import_users'] = "Importar usuários"; $_['text_import_users_from_LDAP'] = "Importar usuários de LDAP"; $_['text_inbound'] = "interno"; +$_['text_install_sudo_apply'] = "Add the following to /etc/sudoers: 'www-data ALL=NOPASSWD: /etc/init.d/rc.piler reload'"; $_['text_internal'] = "interno"; $_['text_invalid_data'] = "Dados inválidos"; $_['text_invalid_email'] = "Email inválido"; diff --git a/webui/view/javascript/piler-in.js b/webui/view/javascript/piler-in.js index 63d58756..886f325a 100644 --- a/webui/view/javascript/piler-in.js +++ b/webui/view/javascript/piler-in.js @@ -774,6 +774,18 @@ var Piler = }, + reload_piler:function() + { + Piler.log("[reload_piler]"); + + jQuery.ajax('index.php?route=policy/apply', { cache: true }) + .done( function(a) { + $('#applyChangesOutput').html(a); + }) + .fail(function(a, b) { alert("Problem retrieving XML data:" + b) }); + }, + + assemble_folder_restrictions: function() { Piler.log("[assemble_folder_restrictions]"); diff --git a/webui/view/theme/default/templates/policy/apply.tpl b/webui/view/theme/default/templates/policy/apply.tpl new file mode 100644 index 00000000..e69de29b diff --git a/webui/view/theme/default/templates/policy/archiving.tpl b/webui/view/theme/default/templates/policy/archiving.tpl index ccf5d5b1..ad471159 100644 --- a/webui/view/theme/default/templates/policy/archiving.tpl +++ b/webui/view/theme/default/templates/policy/archiving.tpl @@ -59,7 +59,7 @@
- +
@@ -105,3 +105,8 @@ + +
+

+ +
diff --git a/webui/view/theme/default/templates/policy/retention.tpl b/webui/view/theme/default/templates/policy/retention.tpl index dc8174ea..28d9e3cc 100644 --- a/webui/view/theme/default/templates/policy/retention.tpl +++ b/webui/view/theme/default/templates/policy/retention.tpl @@ -110,3 +110,9 @@ + +
+

+ +
+ diff --git a/webui/view/theme/orig/templates/policy/apply.tpl b/webui/view/theme/orig/templates/policy/apply.tpl new file mode 100644 index 00000000..e69de29b diff --git a/webui/view/theme/orig/templates/policy/archiving.tpl b/webui/view/theme/orig/templates/policy/archiving.tpl index d32294c1..49401a8d 100644 --- a/webui/view/theme/orig/templates/policy/archiving.tpl +++ b/webui/view/theme/orig/templates/policy/archiving.tpl @@ -103,3 +103,9 @@ + +
+

+ +
+ diff --git a/webui/view/theme/orig/templates/policy/retention.tpl b/webui/view/theme/orig/templates/policy/retention.tpl index b6669989..05834c6d 100644 --- a/webui/view/theme/orig/templates/policy/retention.tpl +++ b/webui/view/theme/orig/templates/policy/retention.tpl @@ -110,3 +110,10 @@ + +
+

+ +
+ +