From: Tobias Diekershoff Date: Fri, 20 Dec 2013 17:58:50 +0000 (+0100) Subject: public server: added form to admin panel X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=60f261b4902e27e37b32a339ea150e433ee5dac1;p=friendica-addons.git public server: added form to admin panel --- diff --git a/public_server/public_server.php b/public_server/public_server.php index becf96c3..27e219f6 100644 --- a/public_server/public_server.php +++ b/public_server/public_server.php @@ -3,7 +3,7 @@ /** * Name: public_server * Description: Friendica plugin/addon with functions suitable for a public server. - * Version: 1.0 + * Version: 1.1 * Author: Keith Fernie */ @@ -141,3 +141,23 @@ function public_server_login($a,$b) { local_user() ); } + +function public_server_plugin_admin_post ( &$a ) { + check_form_security_token_redirectOnErr('/admin/plugins/publicserver', 'publicserver'); +} +function public_server_plugin_admin ( &$a, &$o) { + $token = get_form_security_token("publicserver"); + $t = get_markup_template( "admin.tpl", "addon/public_server"); + $o = replace_macros($t, array( + '$submit' => t('Save Settings'), + '$form_security_token' => $token, + '$infotext' => t('Set any of these options to 0 to deactivate it.'), + '$expiredays' => Array( "expiredays","Expire Days", intval(get_config('public_server', 'expiredays')), "When an account is created on the site, it is given a hard "), + '$expireposts' => Array( "expireposts", "Expire Posts", intval(get_config('public_server','expireposts')), "Set the default days for posts to expire here"), + '$nologin' => Array( "nologin", "No Login", intval(get_config('public_server','nologin')), "Remove users who have never logged in after nologin days "), + '$flagusers' => Array( "flagusers", "Flag users", intval(get_config('public_server','flagusers')), "Remove users who last logged in over flagusers days ago"), + '$flagposts' => Array( "flagposts", "Flag posts", intval(get_config('public_server','flagposts')), "For users who last logged in over flagposts days ago set post expiry days to flagpostsexpire "), + '$flagpostsexpire' => Array( "flagpostsexpire", "Flag posts expire", intval(get_config('public_server','flagpostsexpire'))), + )); +} +