summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/44de-ate-duesseldorf-email.txt104
-rw-r--r--scripts/44de-ate-duesseldorf-mail.php.txt160
-rw-r--r--scripts/45au-ate-melbourne-email.txt32
-rw-r--r--scripts/45au-ate-melbourne-mail.php.txt106
-rw-r--r--scripts/46us-ate-raleigh-email.txt41
-rw-r--r--scripts/46us-ate-raleigh-mail.php.txt112
-rwxr-xr-xscripts/cron/permissionreview.php171
-rwxr-xr-xscripts/cron/updatesort.php49
-rw-r--r--scripts/resetpermissions.php71
9 files changed, 773 insertions, 73 deletions
diff --git a/scripts/44de-ate-duesseldorf-email.txt b/scripts/44de-ate-duesseldorf-email.txt
new file mode 100644
index 0000000..b4b3708
--- /dev/null
+++ b/scripts/44de-ate-duesseldorf-email.txt
@@ -0,0 +1,104 @@
+[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:
+
+- Welcher Satz fehlt auf alten CAP Formularen?
+- Warum soll ich mir 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).
+
+Darueberhinaus wird beim ATE der Vorgang der Identitaetsueberpruefung trainiert und auditiert, um die Qualitaet der Assurances in der taeglichen Praxis zu erfassen. Dabei gilt es moegliche Fehler und Fallstricke zu erkennen und aufzudecken. Die Assurer haben also die Moeglichkeit, sich mit den Fehlern auseinanderzusetzen und zu erfahren, wie diese vermieden werden koennen.
+
+As IanG said: The ATE or Assurer Training Event is exceptionally recommended for all Assurers, and include parts which contribute directly to our audit. Come and find out how you can also contribute.
+
+Die kommende Veranstaltung in deiner Naehe findet statt am:
+
+- Montag, den 09. Juli 2012
+- in der Zeit von: 19:00 - ca. 22:00 Uhr
+- in der Heinrich-Heine-Universitaet Duesseldorf
+- Raum: 25
+- Universitaetsstraße 1
+- 40225 Duesseldorf
+
+
+Details zum Veranstaltungsort und Anfahrthinweise findet Ihr im
+Wiki [http://wiki.cacert.org/events/ATE-Duesseldorf]
+Blog [http://blog.cacert.org/2012/06/559.html]
+
+Teilnehmer Registrierung mit Rueckantwort:
+ 'Ich moechte am ATE-Duesseldorf teilnehmen'
+
+Das Veranstaltungs-Team freut sich schon auf Eure Teilnahme.
+
+Kontakt: events@cacert.org
+
+
+[French]
+
+Bon nombre de changements ont eu lieu au cours de la derniere annee au sein de CAcert. Beaucoup de regles "orales" ont ete transformees en reglements ("Policies"). De nouvelles procedures (par exemple le Challenge Assureur) et devoirs (par exemple le CAcert Community Agreement) ont ete activees. Les Assurer Training Events essaient de propager ces informations :
+
+- Que manque-t-il sur les "anciens" formulaires CAP ?
+- Pourquoi dois-je me souvenir de R/L/O ?
+- Que faire si une personne vous montre un document d'identite qui vous est inconnu ?
+
+Durant les Assurer Training Events (ATEs) vous recevrez les reponses a ces questions et a plein d'autres.
+
+De plus, les ATE vous permettent de vous entrainer a verifier les identites. Ceci sera audite afin de mesurer la qualite des assurances effectuees dans la routine quotidienne. On essaiera de vous induire en erreur. Vous aurez ainsi la possibilite de voir les problemes et d'apprendre a dejouer les pieges.
+
+Comme IanG l'a dit : il est fortement recommande aux assureurs de participer aux ATE. Le programmme contient des parties qui entrent directement en ligne de compte pour le succes de notre audit. Venez et decouvrez comment contribuer.
+
+Le prochain ATE qui aura lieu pres de chez vous sera :
+- Lundi le 09 juli 2012
+- de 19:00 a environ 22:00
+- dans Heinrich-Heine-Universitaet Duesseldorf
+- Chambre: 25
+- Universitaetsstraße 1
+- 40225 Duesseldorf
+
+NB : les exposes auront lieu en Allemand
+
+Plus de renseignements sur le lieu :
+Wiki [http://wiki.cacert.org/events/ATE-Duesseldorf]
+Blog [http://blog.cacert.org/2012/06/566.html]
+
+Pour participer, repondez a ce courriel : 'Je viendrais au ATE-Karlsruhe'
+
+Le comite d'organisation se rejouit de votre venue.
+
+Contact: events@cacert.org
+
+[English]
+
+During the last year many changes took place inside CAcert. Many "oral" rules have been put into Policies. New procedures (e.g. Assurer Challenge) and obligations (e.g. CAcert Community Agreement) have been put into live. The Assurer Training Events (ATE) try to spread this information:
+
+- What is missing on the "old" CAP forms?
+- Why should I remember R/L/O?
+- What can you do if an Assuree shows an ID document unknown to you?
+
+These and more questions will be answered during the Assurer Training Events (ATEs)
+
+Furthermore, the ATE trains how to do assurances and audits assurances, to measure the quality of assurances in the daily routine. Here are some possible errors and pitfalls which need to be found. Assurers have the opportunity to see those errors and how to avoid them.
+
+As IanG said: The ATE or Assurer Training Event is exceptionally recommended for all Assurers and includes parts which contribute directly to our audit. Come and find out how you can also contribute.
+
+The next event held in your area will be:
+
+- Monday 9th July 2012
+- during 19:00 - ca. 22:00
+- in the Heinrich-Heine-Universitaet Duesseldorf
+- Room: 25
+- Universitaetsstraße 1
+- 40225 Duesseldorf
+
+Details to the location can be found:
+Wiki [http://wiki.cacert.org/events/ATE-Duesseldorf]
+Blog [http://blog.cacert.org/2012/06/566.html]
+
+User reply for registration: 'I will attend the ATE-Duesseldorf'
+
+The event team is looking forward for your attendance:
+
+Contact: events@cacert.org
diff --git a/scripts/44de-ate-duesseldorf-mail.php.txt b/scripts/44de-ate-duesseldorf-mail.php.txt
new file mode 100644
index 0000000..7b89e96
--- /dev/null
+++ b/scripts/44de-ate-duesseldorf-mail.php.txt
@@ -0,0 +1,160 @@
+#!/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("44de-ate-duesseldorf-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]
+ $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
+
+// Software Freedom Day 19. Sept 2009
+// $locid = 715191; // Hamburg
+
+// LISA2009 Baltimore, 1.11.2009
+// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, United States
+// $city = "Baltimore, MD - Nov. 3rd 2009";
+
+// OpenSourceTreffen-Muenchen, 20.11.2009
+// $locid = 1260319; // Muenchen
+// $city = "Muenchen - 20. Nov 2009";
+
+// BLIT2009, Brandenburger Linux-Infotag, 21.11.2009
+// $locid = 1486658; // Potsdam
+// $eventname = "Brandenburger Linux-Infotag (BLIT2009)";
+// $city = "Potsdam - 21. Nov 2009";
+
+// ATE-Goteborg, 16.12.2009
+// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden
+// $eventname = "ATE-Goteborg";
+// $city = "Goteborg - Dec 16th 2009";
+
+// Assurance Event Mission Hills CA, 15.01.2010
+// $locid = 2094781; // Mission Hills (Los Angeles), California, United States
+// $eventname = "Assurance Event";
+// $city = "Mission Hills CA - Jan 15th 2010";
+
+// Assurance Event OSD Copenhagen DK, 5.03.2010
+// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark
+// $eventname = "Assurance Event OpenSource-Days 2010";
+// $city = "Copenhagen DK - March 5th/6th 2010";
+
+// SCALE 8x Los Angeles, CA, Feb 19-21 2010
+// $locid = 2093625; // Copenhagen, Kobenhavn*, Denmark
+// $eventname = "SCALE 8x 2010";
+// $city = "Los Angeles, CA - February 19-21 2010";
+
+// ATE Sydney, AU, Mar 24 2010
+// $locid = 2257312; // Sydney, New South Wales, Australia
+// $eventname = "ATE-Sydney";
+// $city = "March 24, 2010";
+
+// ATE Essen, DE, Sept 28 2010
+// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany
+// $eventname = "ATE-Essen";
+// $city = "September 28, 2010";
+
+// ATE Aachen, DE, Oct 4th 2010
+// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany
+// $eventname = "ATE-Aachen";
+// $city = "October 4th, 2010";
+
+// ATE Muenchen, DE, Apr 2nd 2011
+// $locid = 1260319; // Muenchen
+// $eventname = "ATE-Muenchen";
+// $city = "2. April, 2011";
+
+// ATE Bonn, DE, Jun 8th 2011
+// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany
+// $eventname = "ATE-Bonn";
+// $city = "8. Juni, 2011";
+
+// ATE Karlsruhe, DE, May 15th 2012
+// $locid = 873779; // Karlsruhe, Baden-Wuerttemberg, Germany
+// $eventname = "ATE-Karlsruhe";
+// $city = "15. May 2012";
+
+// ATE Duesseldorf, DE, May 15th 2012
+ $locid = 520340; // Dusseldorf, Nordrhein-Westfalen, Germany
+ $eventname = "ATE-Duesseldorf";
+ $city = "09. July 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/45au-ate-melbourne-email.txt b/scripts/45au-ate-melbourne-email.txt
new file mode 100644
index 0000000..aa46112
--- /dev/null
+++ b/scripts/45au-ate-melbourne-email.txt
@@ -0,0 +1,32 @@
+
+
+During the last years many changes took place inside CAcert. Many "oral" rules have been put into Policies. New procedures (e.g. Assurer Challenge) and obligations (e.g. CAcert Community Agreement) have been put into live. The Assurer Training Events (ATE) try to spread this information:
+
+- What is missing on the "old" CAP forms?
+- Why should I remember R/L/O?
+- What can you do if an Assuree shows an ID document unknown to you?
+
+These and more questions will be answered during the Assurer Training Events (ATEs)
+
+Furthermore, the ATE trains how to do assurances and audits assurances, to measure the quality of assurances in the daily routine. Here are some possible errors and pitfalls which need to be found. Assurers have the opportunity to see those errors and how to avoid them.
+
+As IanG said: The ATE or Assurer Training Event is exceptionally recommended for all Assurers and includes parts which contribute directly to our audit. Come and find out how you can also contribute.
+
+The next event held in your area will be:
+
+- Saturday 28th July 2012
+- starting around 05:00 pm
+- Urban Camp
+ Brens Drive
+ Parkville
+ Victoria 3052
+
+Details to the location and time can be found:
+Wiki [http://wiki.cacert.org/events/20120728_ATE-Melbourne]
+Blog [http://blog.cacert.org/2012/07/571.html]
+
+User reply for registration: 'I will attend the ATE-Melbourne'
+
+The event team is looking forward for your attendance:
+
+Contact: events@cacert.org
diff --git a/scripts/45au-ate-melbourne-mail.php.txt b/scripts/45au-ate-melbourne-mail.php.txt
new file mode 100644
index 0000000..5161e97
--- /dev/null
+++ b/scripts/45au-ate-melbourne-mail.php.txt
@@ -0,0 +1,106 @@
+#!/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("45au-ate-melbourne-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]
+ $maxdist = 200;
+
+
+// location location.ID
+// verified: 29.4.09 u.schroeter
+// $locid = 7902857; // Paris
+// $locid = 238568; // Bielefeld
+// $locid = 715191; // Hamburg
+// $locid = 1102495; // London
+// $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, United States
+// $locid = 1486658; // Potsdam
+// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden
+// $locid = 2094781; // Mission Hills (Los Angeles), California, United States
+// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark
+// $locid = 2093625; // Los Angeles, CA ???
+// $locid = 2094326 // Los Angeles (Los Angeles), California, United States
+// $locid = 2257312; // Sydney, New South Wales, Australia
+// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany
+// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany
+// $locid = 1260319; // Muenchen
+// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany
+// $locid = 873779; // Karlsruhe, Baden-Wuerttemberg, Germany
+// $locid = 520340; // Dusseldorf, Nordrhein-Westfalen, Germany
+
+// ATE Melbourne, AU, July 28th 2012
+ $locid = 2262656; // Melbourne, Victoria, Australia
+ $eventname = "ATE-Melbourne";
+ $city = "28th July 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/46us-ate-raleigh-email.txt b/scripts/46us-ate-raleigh-email.txt
new file mode 100644
index 0000000..c263db5
--- /dev/null
+++ b/scripts/46us-ate-raleigh-email.txt
@@ -0,0 +1,41 @@
+
+
+During the last years many changes took place inside CAcert. Many "oral"
+rules have been put into Policies. New procedures (e.g. Assurer Challenge)
+and obligations (e.g. CAcert Community Agreement) have been put into live.
+The Assurer Training Events (ATE) try to spread this information:
+
+- What is missing on the "old" CAP forms?
+- Why should I remember R/L/O?
+- What can you do if an Assuree shows an ID document unknown to you?
+
+These and more questions will be answered during the Assurer Training
+Events (ATEs)
+
+Furthermore, the ATE trains how to do assurances and audits assurances, to
+measure the quality of assurances in the daily routine. Here are some
+possible errors and pitfalls which need to be found. Assurers have the
+opportunity to see those errors and how to avoid them.
+
+As IanG said: The ATE or Assurer Training Event is exceptionally
+recommended for all Assurers and includes parts which contribute directly
+to our audit. Come and find out how you can also contribute.
+
+The next event held in your area will be:
+
+- Saturday 11th August 2012
+- 10:00-13:00
+- Splat Space - Durham's Hackerspace
+ 331 W. Main St - Basement
+ Durham, NC
+
+
+Details to the location and time can be found:
+Wiki [http://wiki.cacert.org/events/ATE-Raleigh]
+Blog [http://blog.cacert.org/2012/07/572.html]
+
+User reply for registration: 'I will attend the ATE-Raleigh'
+
+The event team is looking forward for your attendance:
+
+Contact: events@cacert.org
diff --git a/scripts/46us-ate-raleigh-mail.php.txt b/scripts/46us-ate-raleigh-mail.php.txt
new file mode 100644
index 0000000..0c55567
--- /dev/null
+++ b/scripts/46us-ate-raleigh-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("46us-ate-raleigh-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]
+ $maxdist = 200;
+
+
+// location location.ID
+// verified: 29.4.09 u.schroeter
+// $locid = 7902857; // Paris
+// $locid = 238568; // Bielefeld
+// $locid = 715191; // Hamburg
+// $locid = 1102495; // London
+// $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, United States
+// $locid = 1486658; // Potsdam
+// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden
+// $locid = 2094781; // Mission Hills (Los Angeles), California, United States
+// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark
+// $locid = 2093625; // Los Angeles, CA ???
+// $locid = 2094326 // Los Angeles (Los Angeles), California, United States
+// $locid = 2257312; // Sydney, New South Wales, Australia
+// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany
+// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany
+// $locid = 1260319; // Muenchen
+// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany
+// $locid = 873779; // Karlsruhe, Baden-Wuerttemberg, Germany
+// $locid = 520340; // Dusseldorf, Nordrhein-Westfalen, Germany
+
+// ATE Melbourne, AU, July 28th 2012
+// $locid = 2262656; // Melbourne, Victoria, Australia
+// $eventname = "ATE-Melbourne";
+// $city = "28th July 2012";
+
+// ATE Raleigh, US, August 11th 2012
+ $locid = 2185076; // Raleigh (Wake), North Carolina, United States
+ $eventname = "ATE-Raleigh";
+ $city = "11th August 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
index 572c1fd..0f2fc2e 100755
--- a/scripts/cron/permissionreview.php
+++ b/scripts/cron/permissionreview.php
@@ -21,19 +21,71 @@ 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';
+$ASSURANCE_OFFICER = 'ao@cacert.org';
+$ORGANISATION_ASSURANCE_OFFICER = 'oao@cacert.org';
+
+//defines to whom to send the lists
$flags = array(
- 'admin' => 'Support Engineer',
- 'orgadmin' => 'Organisation Assurer',
- 'board' => 'Board Member',
- 'ttpadmin' => 'Trusted Third Party Admin',
- 'tverify' => 'Tverify Admin',
- 'locadmin' => 'Location Admin'
+ 'admin' => array(
+ 'name' => 'Support Engineer',
+ 'own' => false, //Don't send twice
+ 'board' => true,
+ 'support' => true,
+ 'ao' => false,
+ 'oao' => false
+ ),
+
+ 'orgadmin' => array(
+ 'name' => 'Organisation Assurer',
+ 'own' => true,
+ 'board' => true,
+ 'support' => true,
+ 'ao' => true,
+ 'oao' => true
+ ),
+
+ 'board' => array(
+ 'name' => 'Board Member',
+ 'own' => false,
+ 'board' => true,
+ 'support' => true,
+ 'ao' => true,
+ 'oao' => false
+ ),
+
+ 'ttpadmin' => array(
+ 'name' => 'Trusted Third Party Admin',
+ 'own' => true,
+ 'board' => true,
+ 'support' => true,
+ 'ao' => true,
+ 'oao' => true
+ ),
+
+ 'tverify' => array(
+ 'name' => 'Tverify Admin',
+ 'own' => false,
+ 'board' => true,
+ 'support' => true,
+ 'ao' => true,
+ 'oao' => false
+ ),
+
+ 'locadmin' => array(
+ 'name' => 'Location Admin',
+ 'own' => false,
+ 'board' => true,
+ 'support' => true,
+ 'ao' => false,
+ 'oao' => false
+ ),
);
-$adminlist = array();
-foreach ($flags as $flag => $description) {
+// Build up list of various admins
+$adminlist = array();
+foreach ($flags as $flag => $flag_properties) {
$query = "select `fname`, `lname`, `email` from `users` where `$flag` = 1";
if(! $res = mysql_query($query) ) {
fwrite(STDERR,
@@ -45,52 +97,64 @@ foreach ($flags as $flag => $description) {
continue;
}
- $admins = array();
- $adminlist[$flag] = "";
+ $adminlist[$flag] = array();
while ($row = mysql_fetch_assoc($res)) {
- $admins[] = $row;
- $adminlist[$flag] .= "$row[fname] $row[lname] $row[email]\n";
+ $adminlist[$flag][] = $row;
}
- foreach ($admins as $admin) {
- $message = <<<EOF
+
+ // Send mail to admins of this group if 'own' is set
+ if ($flag_properties['own']) {
+ foreach ($adminlist[$flag] as $admin) {
+ $message = <<<EOF
Hello $admin[fname],
-you get this message, because you are listed as $description on
+you get this message, because you are listed as $flag_properties[name] 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]
+
+EOF;
+
+ foreach ($adminlist[$flag] as $colleague) {
+ $message .= "$colleague[fname] $colleague[lname] $colleague[email]\n";
+ }
+
+ $message .= <<<EOF
Best Regards,
CAcert Support
EOF;
- sendmail($admin['email'], "Permissions Review", $message, 'support@cacert.org');
+
+ sendmail($admin['email'], "Permissions Review", $message, 'support@cacert.org');
+ }
}
}
+// Send to support engineers
$message = <<<EOF
-Dear Board Members,
+Dear Support Engineers,
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.)
+in the CAcert web application. Please review them.
EOF;
-foreach ($flags as $flag => $description) {
- $message .= <<<EOF
-List of ${description}s:
-$adminlist[$flag]
-
-EOF;
+foreach ($flags as $flag => $flag_properties) {
+ if ($flag_properties['support']) {
+ $message .= "List of $flag_properties[name]s:\n\n";
+ foreach ($adminlist[$flag] as $colleague) {
+ $message .= "$colleague[fname] $colleague[lname] $colleague[email]\n";
+ }
+
+ $message .= "\n\n";
+ }
}
$message .= <<<EOF
@@ -99,4 +163,55 @@ Best Regards,
CAcert Support
EOF;
-sendmail($BOARD_PRIVATE, "Permissions Review", $message, 'support@cacert.org');
+foreach ($adminlist['admin'] as $support_engineer) {
+ sendmail(
+ $support_engineer['email'],
+ "Permissions Review",
+ $message,
+ 'support@cacert.org');
+}
+
+
+// Send to one-email addresses
+foreach (array(
+ 'ao' => array(
+ 'description' => 'Assurance Officer',
+ 'email' => $ASSURANCE_OFFICER),
+ 'oao' => array(
+ 'description' => 'Organisation Assurance Officer',
+ 'email' => $ORGANISATION_ASSURANCE_OFFICER),
+ 'board' => array(
+ 'description' => 'Board Members',
+ 'email' => $BOARD_PRIVATE)
+ ) as $key => $values) {
+ $message = <<<EOF
+Dear $values[description],
+
+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 => $flag_properties) {
+ if ($flag_properties[$key]) {
+ $message .= "List of $flag_properties[name]s:\n\n";
+ foreach ($adminlist[$flag] as $colleague) {
+ $message .= "$colleague[fname] $colleague[lname] $colleague[email]\n";
+ }
+ $message .= "\n\n";
+ }
+ }
+
+ $message .= <<<EOF
+
+
+Best Regards,
+CAcert Support
+EOF;
+
+ sendmail($values['email'], "Permissions Review", $message, 'support@cacert.org');
+}
diff --git a/scripts/cron/updatesort.php b/scripts/cron/updatesort.php
index 498eda2..051b179 100755
--- a/scripts/cron/updatesort.php
+++ b/scripts/cron/updatesort.php
@@ -17,55 +17,14 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once(dirname(__FILE__).'/../../includes/mysql.php');
+ require_once(dirname(__FILE__).'/../../includes/lib/account.php');
-
- /* 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))
- {
- $query = "update users set `assurer`='1' where `id`='${row['uid']}'";
- //echo $query."\n";
- mysql_query($query);
+ // Recalculate assurer flag for all accounts
+ if (!fix_assurer_flag()) {
+ fwrite(STDERR, "ERROR on fixing the assurer flag. Continuing anyway");
}
-*/
- /* 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`
diff --git a/scripts/resetpermissions.php b/scripts/resetpermissions.php
new file mode 100644
index 0000000..0bfdaa3
--- /dev/null
+++ b/scripts/resetpermissions.php
@@ -0,0 +1,71 @@
+#!/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');
+
+$flags = array('board', 'tverify');
+
+foreach ($flags as $flag) {
+ echo "Resetting $flag flag:\n";
+ $query = "select `id`, `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;
+ }
+
+ while ($row = mysql_fetch_assoc($res)) {
+ echo "$row[fname] $row[lname] $row[email]";
+
+ $update = "update `users` set `$flag` = 0 where `id` = $row[id]";
+ if(! $res2 = mysql_query($update) ) {
+ echo " NOT RESET!!!\n";
+ fwrite(STDERR,
+ "MySQL query for $flag flag reset on user $row[id] failed:\n".
+ "\"$update\"\n".
+ mysql_error()
+ );
+
+ } else {
+
+ $message = <<<EOF
+Hi $row[fname],
+
+As per Arbitration a20110118.1 [1] the $flag permission has been removed
+from your account.
+
+[1] https://wiki.cacert.org/Arbitrations/a20110118.1
+
+Best Regards,
+CAcert Support
+EOF;
+ sendmail($row['email'], "Permissions have been reset", $message, 'support@cacert.org');
+
+ echo " reset.\n";
+ }
+ }
+
+ echo "\n\n";
+} \ No newline at end of file