Handles canceled payment transactions.
[platal.git] / bin / cron / checkdb.php
index 5eef761..a2dd732 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2011 Polytechnique.org                              *
+ *  Copyright (C) 2003-2014 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -210,6 +210,27 @@ check("SELECT  p.*
                                                       WHERE  p.link_id = g.id)",
       "Téléphones de type 'group' reliés à un groupe inexistant.");
 
+// List domain aliasing with depth higher than 1: they will not be found by postfix.
+check("SELECT  evd.name
+         FROM  email_virtual_domains AS evd
+   INNER JOIN  email_virtual_domains AS evd2 ON (evd.aliasing = evd2.id)
+        WHERE  evd2.id != evd2.aliasing",
+      "Domaines aliasés de niveau 2 ou plus qui ne sont pas vu par postfix.");
+
+// Account viewing statistics
+info("SELECT  nb_profiles, hruid
+        FROM  (
+           SELECT  a.hruid AS hruid, COUNT(DISTINCT le.data) AS nb_profiles
+             FROM  log_events AS le
+        LEFT JOIN  log_sessions AS ls ON (ls.id = le.session)
+        LEFT JOIN  accounts AS a ON (a.uid = ls.uid)
+            WHERE  le.action = 30 AND ls.start >= DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY)
+         GROUP BY  a.hruid
+              ) AS profile_views
+       WHERE  nb_profiles >= 100
+    ORDER BY  nb_profiles DESC",
+     "Camarades ayant consulté plus de 100 fiches au cours des 7 derniers jours.");
+
 // Counts empty profile fields that should never be empty.
 infoCountEmpty('profile_addresses', 'type');
 infoCountEmpty('profile_phones', 'link_type');
@@ -226,5 +247,5 @@ infoCountEmpty('profile_phones', 'display_tel');
 // XXX: counts the number of remaining issues due to the merge (to be removed once all merge related issues have been fixed)
 infoCountEmpty('profile_merge_issues', 'issues', true);
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>