]> git.mxchange.org Git - friendica.git/blobdiff - mod/admin.php
Add max_daily_registrations to admin panel.
[friendica.git] / mod / admin.php
index 318858275b76901158bcbcb2492eb9a23d6f7937..bd0d14bef7f3e421a58c98127a72faab0229f34c 100644 (file)
@@ -244,6 +244,7 @@ function admin_page_site_post(&$a){
        
        
        $register_policy        =       ((x($_POST,'register_policy'))          ? intval(trim($_POST['register_policy']))       :  0);
+       $daily_registrations    =       ((x($_POST,'max_daily_registrations'))  ? intval(trim($_POST['max_daily_registrations']))       :0);    
        $abandon_days           =       ((x($_POST,'abandon_days'))             ? intval(trim($_POST['abandon_days']))          :  0);
 
        $register_text          =       ((x($_POST,'register_text'))            ? notags(trim($_POST['register_text']))         : '');  
@@ -339,6 +340,7 @@ function admin_page_site_post(&$a){
        set_config('system','jpeg_quality', $jpegimagequality);
        
        set_config('config','register_policy', $register_policy);
+       set_config('system','max_daily_registrations', $daily_registrations);
        set_config('system','account_abandon_days', $abandon_days);
        set_config('config','register_text', $register_text);
        set_config('system','allowed_sites', $allowed_sites);
@@ -448,7 +450,7 @@ function admin_page_site(&$a) {
                
                '$baseurl' => $a->get_baseurl(true),
                // name, label, value, help string, extra data...
-               '$sitename'             => array('sitename', t("Site name"), htmlentities($a->config['sitename'], ENT_QUOTES), ""),
+               '$sitename'             => array('sitename', t("Site name"), htmlentities($a->config['sitename'], ENT_QUOTES), 'UTF-8'),
                '$banner'               => array('banner', t("Banner/Logo"), $banner, ""),
                '$language'             => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
                '$theme'                => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
@@ -459,6 +461,7 @@ function admin_page_site(&$a) {
                '$jpegimagequality'             => array('jpegimagequality', t("JPEG image quality"), get_config('system','jpeg_quality'), t("Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.")),
 
                '$register_policy'      => array('register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices),
+               '$daily_registrations'  => array('max_daily_registrations', t("Maximum Daily Registrations"), get_config('system', 'max_daily_registrations'), t("If registration is permitted above, this sets the maximum number of new user registrations to accept per day.  If register is set to closed, this setting has no effect.")),
                '$register_text'        => array('register_text', t("Register text"), htmlentities($a->config['register_text'], ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")),
                '$abandon_days'         => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')),
                '$allowed_sites'        => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")),
@@ -474,7 +477,7 @@ function admin_page_site(&$a) {
                '$no_regfullname'       => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")),
                '$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_disable'), 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_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.")),    
                '$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.")),
@@ -664,6 +667,7 @@ function admin_page_users(&$a){
                                );
                                        
        function _setup_users($e){
+        $a = get_app();
                $accounts = Array(
                        t('Normal Account'), 
                        t('Soapbox Account'),
@@ -674,6 +678,7 @@ function admin_page_users(&$a){
                $e['register_date'] = relative_date($e['register_date']);
                $e['login_date'] = relative_date($e['login_date']);
                $e['lastitem_date'] = relative_date($e['lastitem_date']);
+        $e['is_admin'] = ($e['email'] === $a->config['admin_email']);
                return $e;
        }
        $users = array_map("_setup_users", $users);
@@ -694,6 +699,7 @@ function admin_page_users(&$a){
                '$delete' => t('Delete'),
                '$block' => t('Block'),
                '$unblock' => t('Unblock'),
+        '$siteadmin' => t('Site admin'),
                
                '$h_users' => t('Users'),
                '$th_users' => array( t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'),  t('Account') ),