From c43e65e26baba930a0cf29eacb102efaf43844be Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 25 Mar 2013 11:00:13 +0100 Subject: [PATCH 1/2] OStatus conversation poll option in the admin panel --- mod/admin.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mod/admin.php b/mod/admin.php index e019e855a..fefe13abb 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -274,6 +274,7 @@ function admin_page_site_post(&$a){ $maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50); $dfrn_only = ((x($_POST,'dfrn_only')) ? True : False); $ostatus_disabled = !((x($_POST,'ostatus_disabled')) ? True : False); + $ostatus_poll_interval = ((x($_POST,'ostatus_poll_interval')) ? intval(trim($_POST['ostatus_poll_interval'])) : 0); $diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? True : False); $ssl_policy = ((x($_POST,'ssl_policy')) ? intval($_POST['ssl_policy']) : 0); $new_share = ((x($_POST,'new_share')) ? True : False); @@ -388,6 +389,7 @@ function admin_page_site_post(&$a){ set_config('system','curl_timeout', $timeout); set_config('system','dfrn_only', $dfrn_only); set_config('system','ostatus_disabled', $ostatus_disabled); + set_config('system','ostatus_poll_interval', $ostatus_poll_interval); set_config('system','diaspora_enabled', $diaspora_enabled); set_config('config','private_addons', $private_addons); @@ -442,7 +444,16 @@ function admin_page_site(&$a) { $theme_choices[$f] = $theme_name; } } - } + } + + /* OStatus conversation poll choices */ + $ostatus_poll_choices = array( + "-1" => t("Never"), + "0" => t("Frequently"), + "60" => t("Hourly"), + "720" => t("Twice daily"), + "1440" => t("Daily") + ); /* get user names to make the install a personal install of X */ $user_names = array(); @@ -520,6 +531,7 @@ function admin_page_site(&$a) { '$no_utf' => array('no_utf', t("UTF-8 Regular expressions"), !get_config('system','no_utf'), t("Use PHP UTF8 regular expressions")), '$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), t("Display a Community page showing all recent public postings on this site.")), '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disabled'), t("Provide built-in OStatus \x28identi.ca, status.net, etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")), + '$ostatus_poll_interval' => array('ostatus_poll_interval', t("OStatus conversation completion interval"), (string) intval(get_config('system','ostatus_poll_interval')), t("How often shall the poller check for new entries in OStatus conversations? This can be a very ressource task."), $ostatus_poll_choices), '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")), '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")), '$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")), From 8666673175eb22d871f2ae89984dfebe7049745d Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 25 Mar 2013 11:01:54 +0100 Subject: [PATCH 2/2] template additions for the options --- view/admin_site.tpl | 1 + view/smarty3/admin_site.tpl | 1 + 2 files changed, 2 insertions(+) diff --git a/view/admin_site.tpl b/view/admin_site.tpl index f66d31cdc..0f0fdd426 100644 --- a/view/admin_site.tpl +++ b/view/admin_site.tpl @@ -79,6 +79,7 @@ {{ inc field_checkbox.tpl with $field=$force_publish }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$no_community_page }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$ostatus_disabled }}{{ endinc }} + {{ inc field_select.tpl with $field=$ostatus_poll_interval }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$diaspora_enabled }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ endinc }} {{ inc field_input.tpl with $field=$global_directory }}{{ endinc }} diff --git a/view/smarty3/admin_site.tpl b/view/smarty3/admin_site.tpl index 8d5b72a46..c33897c36 100644 --- a/view/smarty3/admin_site.tpl +++ b/view/smarty3/admin_site.tpl @@ -84,6 +84,7 @@ {{include file="field_checkbox.tpl" field=$force_publish}} {{include file="field_checkbox.tpl" field=$no_community_page}} {{include file="field_checkbox.tpl" field=$ostatus_disabled}} + {{include file="field_select.tpl" field=$ostatus_poll_interval}} {{include file="field_checkbox.tpl" field=$diaspora_enabled}} {{include file="field_checkbox.tpl" field=$dfrn_only}} {{include file="field_input.tpl" field=$global_directory}}