aliases.id => aliases.uid
[platal.git] / modules / poison.php
index b012756..552d596 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -28,6 +28,7 @@ class PoisonModule extends PLModule
         return array(
             'pe'          => $this->make_hook('poison', AUTH_PUBLIC, 'user', NO_HTTPS),
             'pem'         => $this->make_hook('mailto', AUTH_PUBLIC, 'user', NO_HTTPS),
+            'pet'         => $this->make_hook('tags',   AUTH_PUBLIC, 'user', NO_HTTPS),
             // 'per'         => $this->make_hook('rand', AUTH_PUBLIC, 'user', NO_HTTPS),
         );
     }
@@ -46,6 +47,23 @@ class PoisonModule extends PLModule
         exit;
     }
 
+    function handler_tags(&$page, $seed = null, $count = 20)
+    {
+        global $globals;
+
+        $this->load('poison.inc.php');
+        if ($seed == null) {
+            $seed = time();
+        }
+        $emails = get_poison_emails($seed, $count);
+
+        foreach ($emails as $email) {
+            echo "<a href=\"mailto:$email\" >$email</a>". "\n";
+        }
+        echo '<a href="' . $globals->baseurl . '/pem/' . md5($seed) . '">suite</a>';
+        exit;
+    }
+
     function handler_mailto(&$page, $seed = null, $count = 20)
     {
         global $globals;