diff options
author | Michael Tänzer <neo@nhng.de> | 2012-04-03 16:03:09 +0200 |
---|---|---|
committer | Michael Tänzer <neo@nhng.de> | 2012-04-03 16:03:09 +0200 |
commit | b35b874af560b4c69cf952229b28bd1668dcf5d9 (patch) | |
tree | 8009733b941cb1c60cc1dada90109af45738edd2 | |
parent | f6129590b312f0b6b680f6085ff15f1d41c70691 (diff) | |
download | cacert-devel-b35b874af560b4c69cf952229b28bd1668dcf5d9.tar.gz cacert-devel-b35b874af560b4c69cf952229b28bd1668dcf5d9.tar.xz cacert-devel-b35b874af560b4c69cf952229b28bd1668dcf5d9.zip |
Source code taken from cacert-20120329.tar.bz2
-rw-r--r-- | pages/account/40.php | 10 | ||||
-rw-r--r-- | scripts/40de-ate-hamburg-email.txt | 66 | ||||
-rw-r--r-- | scripts/40de-ate-hamburg-mail.php.txt | 112 | ||||
-rw-r--r-- | scripts/41de-ate-jena-email.txt | 33 | ||||
-rw-r--r-- | scripts/41de-ate-jena-mail.php.txt | 109 | ||||
-rwxr-xr-x | scripts/cron/permissionreview.php | 102 | ||||
-rwxr-xr-x | scripts/cron/removedead.php (renamed from scripts/removedead.php) | 4 | ||||
-rwxr-xr-x | scripts/cron/updatesort.php (renamed from scripts/updatesort.php) | 46 | ||||
-rwxr-xr-x | scripts/cron/warning.php (renamed from scripts/warning.php) | 2 |
9 files changed, 475 insertions, 9 deletions
diff --git a/pages/account/40.php b/pages/account/40.php index 8391903..499bf4d 100644 --- a/pages/account/40.php +++ b/pages/account/40.php @@ -19,6 +19,15 @@ if(!array_key_exists('secrethash',$_SESSION['_config'])) $_SESSION['_config']['s ?> <H3><?=_("Contact Us")?></H3> +<p><? printf(_("To contact us please log out and then use the contact form ". + "there or send us an email to %s. We are working to fix this ". + "situation so you may contact us while staying logged in again."), + + "<a href='mailto:support@cacert.org'>support@cacert.org</a>" + ) ?> +</p> + +<?/* <p><b><?=_("General Questions")?></b></p> <p><b><?=_("PLEASE NOTE: Due to the large amounts of support questions, incorrectly directed emails may be over looked, this is a volunteer effort and directing general questions to the right place will help everyone, including yourself as you will get a reply quicker.")?></b></p> <p><b><?=_("If you are contacting us about advertising, please use the form at the bottom of the website, the first contact form is not the correct place.")?></b></p> @@ -84,3 +93,4 @@ Australia</p> document.form2.secrethash2.value = pagehash; --> </script> +*/ diff --git a/scripts/40de-ate-hamburg-email.txt b/scripts/40de-ate-hamburg-email.txt new file mode 100644 index 0000000..ddf7c0f --- /dev/null +++ b/scripts/40de-ate-hamburg-email.txt @@ -0,0 +1,66 @@ +CAcert Assurer Training Event Hamburg [Deutsch] +:::::::::::::::::::::::::::::::::::::::::::::::::: + +Es hat sich viel getan im letzten Jahr. Eine ganze Reihe von bisher eher "muendlich ueberlieferten" Regeln wurden in Policies gegossen. Neue Prozeduren (z.B. die Assurer Challenge) und Verpflichtungen (z.B. in dem CAcert Community Agreement) wurden beschlossen. Die Assurer Training Events wollen versuchen, die ganzen Informationen unter’s Volk zu bringen: + +- Was hast du auf dem CAP Formular hinzuzufuegen, wenn du Minderjaehrige ueberpruefst ? +- Was sind die 2 wesentlichen Punkte der CCA die du einem Assuree vermitteln koennen sollst ? +- Unter welchen Umstaenden koennen z.Bsp. niederlaendische Rufnamen akzeptiert werden? + +Antworten auf diese und weitere Fragen erhaelst du bei den Assurer Training Events (ATEs). + +Die kommende Veranstaltung in deiner Naehe findet statt am: + +Dienstag den 14. Februar 2012, 19:00 - 22:00 + +Attraktor e.V. +Mexikoring 21 +22297 Hamburg + +Das Veranstaltungs-Team freut sich schon auf Eure Teilnahme. + +Details zum Veranstaltungsort und Anfahrthinweise findet Ihr im +Wiki [https://wiki.cacert.org/events/20120214-ATE-Hamburg-3] +Blog [http://blog.cacert.org/2012/02/547.html] + + + +Unverbindliche Anmeldung und Registrierung: +Rueckantwort mit 'Ich moechte teilnehmen: ATE-Hamburg' + +Kontakt: events@cacert.org + + +CAcert Assurer Training Event Hamburg [English] +:::::::::::::::::::::::::::::::::::::::::::::::::: + +Much has happened during the past 3 years. The old way of +orally-transmitted procedures has now gone, and our rules have been cast +into formal policies. New procedures (e.g. the Assurer Challenge) and +obligations (e.g. in the CAcert Community Agreement) have been approved. +The Assurer Training Events bring all this to you, the Community: + +- What you have to add onto the CAP form if you assure U18 people ? +- What are the 2 essential topics regarding CCA you have to present an Assuree ? +- When you can accept i.e. a Dutch "roepnaam" ? + +Answers to these and many other questions are given at the Assurer +Training Events (ATEs). + +ATE-Hamburg takes place on: +Tuesday, Feb 14, 2012, 19:00 - 22:00 + +Attraktor e.V. +Mexikoring 21 +22297 Hamburg + +The Event-Team is looking forward to hearing from you. + +Details on Location and Transportation you will find under +Wiki [https://wiki.cacert.org/events/20120214-ATE-Hamburg-3] +Blog [http://blog.cacert.org/2012/02/547.html] + +Registration for ATE-Hamburg: please reply +'I will attend: ATE-Hamburg' + +Contact: events@cacert.org diff --git a/scripts/40de-ate-hamburg-mail.php.txt b/scripts/40de-ate-hamburg-mail.php.txt new file mode 100644 index 0000000..54ec1b8 --- /dev/null +++ b/scripts/40de-ate-hamburg-mail.php.txt @@ -0,0 +1,112 @@ +#!/usr/bin/php -q +<? /* + LibreSSL - CAcert web application + Copyright (C) 2004-2009 CAcert Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + include_once("../includes/mysql.php"); + + $lines = ""; + $fp = fopen("40de-ate-hamburg-email.txt", "r"); + while(!feof($fp)) + { + $line = trim(fgets($fp, 4096)); + $lines .= wordwrap($line, 75, "\n")."\n"; + } + fclose($fp); + + +// $locid = intval($_REQUEST['location']); +// $maxdist = intval($_REQUEST['maxdist']); +// maxdist in [Km] - changed to 350 to include glasgow + london + $maxdist = 200; + + +// location location.ID +// verified: 29.4.09 u.schroeter +// $locid = 7902857; // Paris +// $locid = 238568; // Bielefeld +// $locid = 715191; // Hamburg +// $locid = 1102495; // London +// $locid = 520340; // Duesseldorf +// $locid = 1260319; // Muenchen +// $locid = 606058; // Frankfurt +// $locid = 1775784; // Stuttgart +// $locid = 228950; // Berlin +// $locid = 606058; // Frankfurt +// $locid = 599389; // Flensburg +// $locid = 61065; // Amsterdam, Eemnes +// $locid = 228950; // Berlin +// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, US +// $locid = 1486658; // Potsdam +// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden +// $locid = 2094781; // Mission Hills (Los Angeles), California, US +// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark +// $locid = 2257312; // Sydney, New South Wales, Australia +// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany +// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany +// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany +// $locid = 2102723; // Washington (District of Columbia, ..., US +// $locid = 2177566; // New York (Bronx), New York, United States +// $locid = 1486658; // Potsdam BLIT2011 +// $locid = 2237836; // Blacksburg (Montgomery), Virginia, United States + +// ATE Manchester 2012 +// $locid = 1161640; // Manchester, Manchester, United Kingdom +// $eventname = "ATE-Manchester"; +// $city = "Manchester/Crewe UK"; + +// ATE Hamburg, DE, Feb 14 2012 + $locid = 715191; // Hamburg + $eventname = "ATE-Hamburg"; + $city = "Feb 14, 2012"; + + $query = "select * from `locations` where `id`='$locid'"; + $loc = mysql_fetch_assoc(mysql_query($query)); + + $query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) + + (COS(PI() * $loc[lat] / 180 ) * COS(PI() * `locations`.`lat` / 180) * + COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`, sum(`points`) as pts, `users`.* + FROM `locations` + inner join `users` on `users`.`locid` = `locations`.`id` + inner join `alerts` on `users`.`id`=`alerts`.`memid` + inner join `notary` on `users`.`id`=`notary`.`to` + WHERE (`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1) + GROUP BY `users`.`id` + HAVING `distance` <= '$maxdist' + ORDER BY `distance` "; + echo $query; + + // comment next line when starting to send mail not only to me + // $query = "select * from `users` where `email` like 'cacerttest%'"; + + $res = mysql_query($query); + $xrows = mysql_num_rows($res); + + while($row = mysql_fetch_assoc($res)) + { + // uncomment next line to send mails ... + sendmail($row['email'], "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + } + // 1x cc to events.cacert.org + sendmail("events@cacert.org", "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + // 1x mailing report to events.cacert.org + sendmail("events@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + + // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20090525.1 + sendmail("p.dunkel@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + echo "invitation sent to $xrows recipients.\n"; + +?> diff --git a/scripts/41de-ate-jena-email.txt b/scripts/41de-ate-jena-email.txt new file mode 100644 index 0000000..f70dc85 --- /dev/null +++ b/scripts/41de-ate-jena-email.txt @@ -0,0 +1,33 @@ +CAcert Assurer Training Event Jena [Deutsch] +:::::::::::::::::::::::::::::::::::::::::::: + +Es hat sich viel getan im letzten Jahr. Eine ganze Reihe von bisher eher "muendlich ueberlieferten" Regeln wurden in Policies gegossen. Neue Prozeduren (z.B. die Assurer Challenge) und Verpflichtungen (z.B. in dem CAcert Community Agreement) wurden beschlossen. Die Assurer Training Events wollen versuchen, die ganzen Informationen unter’s Volk zu bringen: + +- Was hast du auf dem CAP Formular hinzuzufuegen, wenn du Minderjaehrige ueberpruefst ? +- Warum solltest du dir R/L/O einpraegen ? +- Wie verhaelst du dich, wenn du ein fremdes Ausweis Dokument das erste mal pruefst ? + +Antworten auf diese und weitere Fragen erhaelst du bei den Assurer Training Events (ATEs). + +Die kommende Veranstaltung in deiner Naehe findet statt am: + +Donnerstag den 29. Maerz 2012, 19:00 - 22:00 + +Adresse: Am Johannisfriedhof 2, Jena +Gebaeude: Universitaetsrechenzentrum der Friedrich-Schiller-Universitaet Jena +OSM: [http://osm.org/go/0MAe9XhNp-] +Webseite: [http://www.uni-jena.de/URZ.html] + + +Das Veranstaltungs-Team freut sich schon auf Eure Teilnahme. + +Details zum Veranstaltungsort und Anfahrthinweise findet Ihr im +Wiki [https://wiki.cacert.org/Events/2012-03-29ATE-Jena] +Blog [http://blog.cacert.org/2012/03/550.html] + + + +Unverbindliche Anmeldung und Registrierung: +Rueckantwort mit 'Ich moechte teilnehmen: ATE-Jena' + +Kontakt: events@cacert.org diff --git a/scripts/41de-ate-jena-mail.php.txt b/scripts/41de-ate-jena-mail.php.txt new file mode 100644 index 0000000..5691f63 --- /dev/null +++ b/scripts/41de-ate-jena-mail.php.txt @@ -0,0 +1,109 @@ +#!/usr/bin/php -q +<? /* + LibreSSL - CAcert web application + Copyright (C) 2004-2009 CAcert Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + include_once("../includes/mysql.php"); + + $lines = ""; + $fp = fopen("41de-ate-jena-email.txt", "r"); + while(!feof($fp)) + { + $line = trim(fgets($fp, 4096)); + $lines .= wordwrap($line, 75, "\n")."\n"; + } + fclose($fp); + + +// $locid = intval($_REQUEST['location']); +// $maxdist = intval($_REQUEST['maxdist']); +// maxdist in [Km] - changed to 350 to include glasgow + london + $maxdist = 200; + + +// location location.ID +// verified: 29.4.09 u.schroeter +// $locid = 7902857; // Paris +// $locid = 238568; // Bielefeld +// $locid = 715191; // Hamburg +// $locid = 1102495; // London +// $locid = 520340; // Duesseldorf +// $locid = 1260319; // Muenchen +// $locid = 606058; // Frankfurt +// $locid = 1775784; // Stuttgart +// $locid = 228950; // Berlin +// $locid = 606058; // Frankfurt +// $locid = 599389; // Flensburg +// $locid = 61065; // Amsterdam, Eemnes +// $locid = 228950; // Berlin +// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, US +// $locid = 1486658; // Potsdam +// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden +// $locid = 2094781; // Mission Hills (Los Angeles), California, US +// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark +// $locid = 2257312; // Sydney, New South Wales, Australia +// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany +// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany +// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany +// $locid = 2102723; // Washington (District of Columbia, ..., US +// $locid = 2177566; // New York (Bronx), New York, United States +// $locid = 1486658; // Potsdam BLIT2011 +// $locid = 2237836; // Blacksburg (Montgomery), Virginia, United States +// $locid = 1161640; // Manchester, Manchester, United Kingdom + +// ATE Jena, DE, Mar 29 2012 + $locid = 803095; // Jena, Thueringen, Germany + $eventname = "ATE-Jena"; + $city = "Mar 29, 2012"; + + + $query = "select * from `locations` where `id`='$locid'"; + $loc = mysql_fetch_assoc(mysql_query($query)); + + $query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) + + (COS(PI() * $loc[lat] / 180 ) * COS(PI() * `locations`.`lat` / 180) * + COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`, sum(`points`) as pts, `users`.* + FROM `locations` + inner join `users` on `users`.`locid` = `locations`.`id` + inner join `alerts` on `users`.`id`=`alerts`.`memid` + inner join `notary` on `users`.`id`=`notary`.`to` + WHERE (`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1) + GROUP BY `users`.`id` + HAVING `distance` <= '$maxdist' + ORDER BY `distance` "; + echo $query; + + // comment next line when starting to send mail not only to me + // $query = "select * from `users` where `email` like 'cacerttest%'"; + + $res = mysql_query($query); + $xrows = mysql_num_rows($res); + + while($row = mysql_fetch_assoc($res)) + { + // uncomment next line to send mails ... + sendmail($row['email'], "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + } + // 1x cc to events.cacert.org + sendmail("events@cacert.org", "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + // 1x mailing report to events.cacert.org + sendmail("events@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + + // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20090525.1 + sendmail("p.dunkel@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + echo "invitation sent to $xrows recipients.\n"; + +?> diff --git a/scripts/cron/permissionreview.php b/scripts/cron/permissionreview.php new file mode 100755 index 0000000..572c1fd --- /dev/null +++ b/scripts/cron/permissionreview.php @@ -0,0 +1,102 @@ +#!/usr/bin/php -q +<?php +/* +LibreSSL - CAcert web application +Copyright (C) 2004-2012 CAcert Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +require_once(dirname(__FILE__).'/../../includes/mysql.php'); + +$BOARD_PRIVATE = 'cacert-board-private@lists.cacert.org'; + +$flags = array( + 'admin' => 'Support Engineer', + 'orgadmin' => 'Organisation Assurer', + 'board' => 'Board Member', + 'ttpadmin' => 'Trusted Third Party Admin', + 'tverify' => 'Tverify Admin', + 'locadmin' => 'Location Admin' + ); + +$adminlist = array(); + +foreach ($flags as $flag => $description) { + $query = "select `fname`, `lname`, `email` from `users` where `$flag` = 1"; + if(! $res = mysql_query($query) ) { + fwrite(STDERR, + "MySQL query for flag $flag failed:\n". + "\"$query\"\n". + mysql_error() + ); + + continue; + } + + $admins = array(); + $adminlist[$flag] = ""; + + while ($row = mysql_fetch_assoc($res)) { + $admins[] = $row; + $adminlist[$flag] .= "$row[fname] $row[lname] $row[email]\n"; + } + + foreach ($admins as $admin) { + $message = <<<EOF +Hello $admin[fname], + +you get this message, because you are listed as $description on +CAcert.org. Please review the following list of persons with the same privilege +and report to the responsible team leader or board +($BOARD_PRIVATE) if you spot any errors. + +$adminlist[$flag] + + +Best Regards, +CAcert Support +EOF; + sendmail($admin['email'], "Permissions Review", $message, 'support@cacert.org'); + } +} + + + +$message = <<<EOF +Dear Board Members, + +it's time for the permission review again. Here is the list of privileged users +in the CAcert web application. Please review them and also ask the persons +responsible for an up-to-date copy of access lists not directly recorded in the +web application (critical admins, software assessors etc.) + + +EOF; + +foreach ($flags as $flag => $description) { + $message .= <<<EOF +List of ${description}s: +$adminlist[$flag] + +EOF; +} + +$message .= <<<EOF + +Best Regards, +CAcert Support +EOF; + +sendmail($BOARD_PRIVATE, "Permissions Review", $message, 'support@cacert.org'); diff --git a/scripts/removedead.php b/scripts/cron/removedead.php index 23c4cd9..aadda81 100755 --- a/scripts/removedead.php +++ b/scripts/cron/removedead.php @@ -17,8 +17,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - include_once("/home/cacert/www/includes/mysql.php"); - require_once('/home/cacert/www/includes/lib/l10n.php'); + require_once(dirname(__FILE__).'/../../includes/mysql.php'); + require_once(dirname(__FILE__).'/../../includes/lib/l10n.php'); $query = "select * from `users` where `users`.`verified`=0 and (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`users`.`created`)) >= 172800"; diff --git a/scripts/updatesort.php b/scripts/cron/updatesort.php index 4d36bfc..498eda2 100755 --- a/scripts/updatesort.php +++ b/scripts/cron/updatesort.php @@ -16,12 +16,27 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - include_once("../includes/mysql.php"); + require_once(dirname(__FILE__).'/../../includes/mysql.php'); - //mysql_query("update users set assurer=0"); - $query = "select notary.`to` as uid from notary group by notary.`to` having sum(points)>=100;"; + /* Set assurer flag for accounts who miss it + + See also includes/lib/account.php, function fix_assurer_flag($userID) + + We may have some performance problems here, there are 150k assurances and 220k users + in the production database. The exists-clause on cats_passed should be a good filter... */ + + /* Synchronisation of assurer flag currently deactivated, see https://bugs.cacert.org/view.php?id=1003 + and https://bugs.cacert.org/view.php?id=1024 */ +/* + $query = "select `n`.`to` as `uid` from `notary` as `n`, `users` as `u` ". + " where `n`.`to`=`u`.`id` and `u`.`assurer`<>'1' ". + " and (`n`.`expire` > now() OR `n`.`expire` IS NULL) ". + " and exists(select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` ". + " where `cp`.`variant_id`=`cv`.`id` and `cv`.`type_id` = 1 and `cp`.`user_id`=`n`.`to`)". + " group by `n`.`to` having sum(`n`.`points`)>=100"; + $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { @@ -29,7 +44,28 @@ //echo $query."\n"; mysql_query($query); } - +*/ + /* Remove assurer flag from accounts not eligible. + + Also a bit performance critical, but assurer flag is only set at 5k accounts + + */ + /* Synchronisation of assurer flag currently deactivated, see https://bugs.cacert.org/view.php?id=1003 + and https://bugs.cacert.org/view.php?id=1024 */ +/* + $query = "select `u`.id as `uid` from `users` as `u` " . + " where `u`.`assurer` = '1' ". + " and (not exists(select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` ". + " where `cp`.`variant_id`=`cv`.`id` and `cv`.`type_id` = 1 and `cp`.`user_id`=`u`.`id`) ". + " or (select sum(`n`.`points`) from `notary` as `n` where `n`.`to`=`u`.`id` and (`n`.`expire` > now() OR `n`.`expire` IS NULL)) < 100) "; + $res = mysql_query($query); + while($row = mysql_fetch_assoc($res)) + { + $query = "update users set `assurer`='0' where `id`='${row['uid']}'"; + //echo $query."\n"; + mysql_query($query); + } +*/ mysql_query("update `locations` set `acount`=0"); $query = "SELECT `users`.`locid` AS `locid`, count(*) AS `total` FROM `users` @@ -72,6 +108,4 @@ } - - ?> diff --git a/scripts/warning.php b/scripts/cron/warning.php index b578c09..18e89da 100755 --- a/scripts/warning.php +++ b/scripts/cron/warning.php @@ -17,7 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - include_once("/home/cacert/www/includes/mysql.php"); + require_once(dirname(__FILE__).'/../../includes/mysql.php'); $days = array("1" => "3", "15" => "2", "30" => "1", "45" => "0"); |