]> git.mxchange.org Git - friendica.git/blobdiff - mod/admin.php
File was missing
[friendica.git] / mod / admin.php
index 287eff27258c41ef278811c8cc486e5a7da74b84..f4cc0cf6fb55f8c717317cdeec86ad1e01145cbf 100644 (file)
@@ -269,13 +269,15 @@ function admin_page_federation(&$a) {
        // off one % two of them are needed in the query
        // Add more platforms if you like, when one returns 0 known nodes it is not
        // displayed on the stats page.
-       $platforms = array('Friendica', 'Diaspora', '%%red%%', 'Hubzilla', 'GNU Social', 'StatusNet');
+       $platforms = array('Friendica', 'Diaspora', '%%red%%', 'Hubzilla', 'BlaBlaNet', 'GNU Social', 'StatusNet', 'Mastodon');
        $colors    = array('Friendica' => '#ffc018',     // orange from the logo
-                           'Diaspora'  => '#a1a1a1',     // logo is black and white, makes a gray
+                          'Diaspora'  => '#a1a1a1',     // logo is black and white, makes a gray
                           '%%red%%'   => '#c50001',     // fire red from the logo
                           'Hubzilla'  => '#43488a',     // blue from the logo
+                          'BlaBlaNet' => '#3B5998',     // blue from the navbar at blablanet-dot-com
                           'GNU Social'=> '#a22430',     // dark red from the logo
-                          'StatusNet' => '#789240');    // the green from the logo (red and blue have already others
+                          'StatusNet' => '#789240',     // the green from the logo (red and blue have already others
+                          'Mastodon'  => '#1a9df9');    // blue from the Mastodon logo
        $counts = array();
        $total = 0;
 
@@ -283,20 +285,27 @@ function admin_page_federation(&$a) {
                // get a total count for the platform, the name and version of the
                // highest version and the protocol tpe
                $c = qu('SELECT COUNT(*) AS `total`, `platform`, `network`, `version` FROM `gserver`
-                               WHERE `platform` LIKE "%s" AND `last_contact` > `last_failure` AND `version` != ""
+                               WHERE `platform` LIKE "%s" AND `last_contact` > `last_failure`
                                ORDER BY `version` ASC;', $p);
                $total = $total + $c[0]['total'];
 
                // what versions for that platform do we know at all?
                // again only the active nodes
                $v = qu('SELECT COUNT(*) AS `total`, `version` FROM `gserver`
-                               WHERE `last_contact` > `last_failure` AND `platform` LIKE "%s"  AND `version` != ""
+                               WHERE `last_contact` > `last_failure` AND `platform` LIKE "%s"
                                GROUP BY `version`
                                ORDER BY `version`;', $p);
 
                //
                // clean up version numbers
                //
+               // some platforms do not provide version information, add a unkown there
+               // to the version string for the displayed list.
+               foreach ($v as $key => $value) {
+                       if ($v[$key]['version'] == '') {
+                               $v[$key] = array('total'=>$v[$key]['total'], 'version'=>t('unknown'));
+                       }
+               }
                // in the DB the Diaspora versions have the format x.x.x.x-xx the last
                // part (-xx) should be removed to clean up the versions from the "head
                // commit" information and combined into a single entry for x.x.x.x
@@ -419,6 +428,21 @@ function admin_page_queue(&$a) {
  * @return string
  */
 function admin_page_summary(&$a) {
+       global $db;
+       // are there MyISAM tables in the DB? If so, trigger a warning message
+       $r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1",
+               dbesc($db->database_name()));
+       $showwarning = false;
+       $warningtext = array();
+       if (dbm::is_result($r)) {
+               $showwarning = true;
+               $warningtext[] = sprintf(t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the <tt>convert_innodb.sql</tt> in the <tt>/util</tt> directory of your Friendica installation.<br />'), 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
+       }
+       // MySQL >= 5.7.4 doesn't support the IGNORE keyword in ALTER TABLE statements
+       if ((version_compare($db->server_info(), '5.7.4') >= 0) AND
+               !(strpos($db->server_info(), 'MariaDB') !== false)) {
+               $warningtext[] = t('You are using a MySQL version which does not support all features that Friendica uses. You should consider switching to MariaDB.');
+       }
        $r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`");
        $accounts = array(
                array(t('Normal Account'), 0),
@@ -469,7 +493,9 @@ function admin_page_summary(&$a) {
                '$platform' => FRIENDICA_PLATFORM,
                '$codename' => FRIENDICA_CODENAME,
                '$build' =>  get_config('system','build'),
-               '$plugins' => array(t('Active plugins'), $a->plugins)
+               '$plugins' => array(t('Active plugins'), $a->plugins),
+               '$showwarning' => $showwarning,
+               '$warningtext' => $warningtext
        ));
 }
 
@@ -1379,6 +1405,7 @@ function admin_page_users(&$a){
                '$h_deleted' => t('User waiting for permanent deletion'),
                '$th_pending' => array(t('Request date'), t('Name'), t('Email')),
                '$no_pending' =>  t('No registrations.'),
+               '$pendingnotetext' => t('Note from the user'),
                '$approve' => t('Approve'),
                '$deny' => t('Deny'),
                '$delete' => t('Delete'),