]> git.mxchange.org Git - friendica.git/blobdiff - mod/admin.php
The addon "statistics_json" becomes the system setting "nodeinfo"
[friendica.git] / mod / admin.php
index 393fe1614783c96811460f8e1be78aa7d1066abf..a7d25ee74dffa4fb05fdb003696862d47dd8b743 100644 (file)
@@ -105,7 +105,8 @@ function admin_content(&$a) {
                'users'  =>     Array($a->get_baseurl(true)."/admin/users/", t("Users") , "users"),
                'plugins'=>     Array($a->get_baseurl(true)."/admin/plugins/", t("Plugins") , "plugins"),
                'themes' =>     Array($a->get_baseurl(true)."/admin/themes/", t("Themes") , "themes"),
-               'dbsync' => Array($a->get_baseurl(true)."/admin/dbsync/", t('DB updates'), "dbsync"),
+               'dbsync' =>     Array($a->get_baseurl(true)."/admin/dbsync/", t('DB updates'), "dbsync"),
+               'queue'  =>     Array($a->get_baseurl(true)."/admin/queue/", t('Inspect Queue'), "queue"),
                //'update' =>   Array($a->get_baseurl(true)."/admin/update/", t("Software Update") , "update")
        );
 
@@ -165,6 +166,9 @@ function admin_content(&$a) {
                        case 'update':
                                $o = admin_page_remoteupdate($a);
                                break;
+                       case 'queue':
+                               $o = admin_page_queue($a);
+                               break;
                        default:
                                notice( t("Item not found.") );
                }
@@ -181,7 +185,30 @@ function admin_content(&$a) {
        }
 }
 
+/**
+ * Admin Inspect Queue Page
+ * @param App $a
+ * return string
+ */
+function admin_page_queue(&$a) {
+       // get content from the queue table
+       $r = q("SELECT c.name,c.nurl,q.id,q.network,q.created,q.last from queue as q, contact as c where c.id=q.cid order by q.cid, q.created;");
 
+       $t = get_markup_template("admin_queue.tpl");
+       return replace_macros($t, array(
+               '$title' => t('Administration'),
+               '$page' => t('Inspect Queue'),
+               '$count' => sizeof($r),
+               'id_header' => t('ID'),
+               '$to_header' => t('Recipient Name'),
+               '$url_header' => t('Recipient Profile'),
+               '$network_header' => t('Network'),
+               '$created_header' => t('Created'),
+               '$last_header' => t('Last Tried'),
+               '$info' => t('This page lists the content of the queue for outgoing postings. These are postings the initial delivery failed for. They will be resend later and eventually deleted if the delivery fails permanently.'),
+               '$entries' => $r,
+       ));
+}
 /**
  * Admin Summary Page
  * @param App $a
@@ -226,6 +253,7 @@ function admin_page_summary(&$a) {
                '$accounts' => $accounts,
                '$pending' => Array( t('Pending registrations'), $pending),
                '$version' => Array( t('Version'), FRIENDICA_VERSION),
+               '$baseurl' => $a->get_baseurl(),
                '$platform' => FRIENDICA_PLATFORM,
                '$codename' => FRIENDICA_CODENAME,
                '$build' =>  get_config('system','build'),
@@ -359,7 +387,10 @@ function admin_page_site_post(&$a){
        $maxloadavg             =       ((x($_POST,'maxloadavg'))               ? intval(trim($_POST['maxloadavg']))            : 50);
        $maxloadavg_frontend    =       ((x($_POST,'maxloadavg_frontend'))      ? intval(trim($_POST['maxloadavg_frontend']))   : 50);
        $poco_completion        =       ((x($_POST,'poco_completion'))          ? intval(trim($_POST['poco_completion']))       : false);
-       $poco_discovery         =       ((x($_POST,'poco_discovery'))           ? intval(trim($_POST['poco_discovery']))        : false);
+       $poco_discovery         =       ((x($_POST,'poco_discovery'))           ? intval(trim($_POST['poco_discovery']))        : 0);
+       $poco_discovery_since   =       ((x($_POST,'poco_discovery_since'))     ? intval(trim($_POST['poco_discovery_since']))  : 30);
+       $poco_local_search      =       ((x($_POST,'poco_local_search'))        ? intval(trim($_POST['poco_local_search']))     : false);
+       $nodeinfo               =       ((x($_POST,'nodeinfo'))                 ? intval(trim($_POST['nodeinfo']))              : false);
        $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);
@@ -382,8 +413,8 @@ function admin_page_site_post(&$a){
        $old_pager              =       ((x($_POST,'old_pager'))                ? True                                          : False);
        $only_tag_search        =       ((x($_POST,'only_tag_search'))          ? True                                          : False);
        $rino                   =       ((x($_POST,'rino'))                             ? intval($_POST['rino'])                                : 0);
-       
-       
+
+
        if($ssl_policy != intval(get_config('system','ssl_policy'))) {
                if($ssl_policy == SSL_POLICY_FULL) {
                        q("update `contact` set
@@ -431,6 +462,9 @@ function admin_page_site_post(&$a){
        set_config('system','maxloadavg_frontend',$maxloadavg_frontend);
        set_config('system','poco_completion',$poco_completion);
        set_config('system','poco_discovery',$poco_discovery);
+       set_config('system','poco_discovery_since',$poco_discovery_since);
+       set_config('system','poco_local_search',$poco_local_search);
+       set_config('system','nodeinfo',$nodeinfo);
        set_config('config','sitename',$sitename);
        set_config('config','hostname',$hostname);
        set_config('config','sender_email', $sender_email);
@@ -586,6 +620,20 @@ function admin_page_site(&$a) {
                        "1440" => t("Daily")
                        );
 
+               $poco_discovery_choices = array(
+                       "0" => t("Disabled"),
+                       "1" => t("Users"),
+                       "2" => t("Users, Global Contacts"),
+                       "3" => t("Users, Global Contacts/fallback"),
+                       );
+
+               $poco_discovery_since_choices = array(
+                       "30" => t("One month"),
+                       "91" => t("Three months"),
+                       "182" => t("Half a year"),
+                       "365" => t("One year"),
+                       );
+
                /* get user names to make the install a personal install of X */
                $user_names = array();
                $user_names['---'] = t('Multi user instance');
@@ -634,7 +682,7 @@ function admin_page_site(&$a) {
                '$upload' => t('File upload'),
                '$corporate' => t('Policies'),
                '$advanced' => t('Advanced'),
-               '$portable_contacts' => t('Portable Contact Directory'),
+               '$portable_contacts' => t('Auto Discovered Contact Directory'),
                '$performance' => t('Performance'),
                '$relocate'=> t('Relocate - WARNING: advanced function. Could make this server unreachable.'),
                '$baseurl' => $a->get_baseurl(true),
@@ -692,8 +740,12 @@ function admin_page_site(&$a) {
                '$maxloadavg'           => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
                '$maxloadavg_frontend'  => array('maxloadavg_frontend', t("Maximum Load Average (Frontend)"), ((intval(get_config('system','maxloadavg_frontend')) > 0)?get_config('system','maxloadavg_frontend'):50), t("Maximum system load before the frontend quits service - default 50.")),
 
-               '$poco_completion'      => array('poco_completion', t("Completion of incoming contacts"), get_config('system','poco_completion'), t("Complete data of incomplete incoming contacts that are provided by the 'portable contacts' functionality. (Useful for poco exchange with Redmatrix and friendica servers before 3.3)")),
-               '$poco_discovery'       => array('poco_discovery', t("Discover contacts from other servers"), get_config('system','poco_discovery'), t("Periodically query other friendica servers for their recent contacts.")),
+               '$poco_completion'      => array('poco_completion', t("Periodical check of global contacts"), get_config('system','poco_completion'), t("If enabled, the global contacts are checked periodically for missing or outdated data and the vitality of the contacts and servers.")),
+               '$poco_discovery'       => array('poco_discovery', t("Discover contacts from other servers"), (string) intval(get_config('system','poco_discovery')), t("Periodically query other servers for contacts. You can choose between 'users': the users on the remote system, 'Global Contacts': active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren't available. The fallback increases the server load, so the recommened setting is 'Users, Global Contacts'."), $poco_discovery_choices),
+               '$poco_discovery_since' => array('poco_discovery_since', t("Timeframe for fetching global contacts"), (string) intval(get_config('system','poco_discovery_since')), t("When the discovery is activated, this value defines the timeframe for the activity of the global contacts that are fetched from other servers."), $poco_discovery_since_choices),
+               '$poco_local_search'    => array('poco_local_search', t("Search the local directory"), get_config('system','poco_local_search'), t("Search the local directory instead of the global directory. When searching locally, every search will be executed on the global directory in the background. This improves the search results when the search is repeated.")),
+
+               '$nodeinfo'             => array('nodeinfo', t("Publish server information"), get_config('system','nodeinfo'), t("If enabled, general server information and usage data will be published. Th data contains the number of users, number of posts and the activated connectors. See <a href='http://the-federation.info/'>the-federation.info</a> for details.")),
 
                '$use_fulltext_engine'  => array('use_fulltext_engine', t("Use MySQL full text engine"), get_config('system','use_fulltext_engine'), t("Activates the full text engine. Speeds up search - but can only search for four and more characters.")),
                '$suppress_language'    => array('suppress_language', t("Suppress Language"), get_config('system','suppress_language'), t("Suppress language information in meta information about a posting.")),
@@ -809,7 +861,7 @@ function admin_page_users_post(&$a){
        $nu_nickname = ( x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : '');
        $nu_email = ( x($_POST, 'new_user_email') ? $_POST['new_user_email'] : '');
 
-       check_form_security_token_redirectOnErr($a->get_baseurl().'/admin/users', 'admin_users');
+       check_form_security_token_redirectOnErr('/admin/users', 'admin_users');
 
        if (!($nu_name==="") && !($nu_email==="") && !($nu_nickname==="")) {
                require_once('include/user.php');