spiffy, but I really like the beginning capital and the ending period for changelog.
authorx2000habouzit <x2000habouzit>
Tue, 30 Nov 2004 19:02:06 +0000 (19:02 +0000)
committerx2000habouzit <x2000habouzit>
Tue, 30 Nov 2004 19:02:06 +0000 (19:02 +0000)
+ closes #144

ChangeLog
htdocs/listes/members.php
htdocs/listes/trombi.php
templates/listes/members.tpl
templates/listes/trombi.tpl

index 8432290..4003e2e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,11 +13,11 @@ New :
                - Adds include/conf.d and the glob modifier.                                            -MC
        
        * Distribution :
-               - Do not modify PHP include path from auto.prepend.inc.php                      -SHK
-               - Add install.d/apache.conf with a sample Apache config file            -SHK
-               - Add Makefile to generate distribution tarballs                                        -SHK
-               - Generate xorg.config.inc.php using "make"                                                     -SHK
-               - Add a basic README file                                                                                       -SHK
+               - Do not modify PHP include path from auto.prepend.inc.php.                     -SHK
+               - Add install.d/apache.conf with a sample Apache config file.           -SHK
+               - Add Makefile to generate distribution tarballs.                                       -SHK
+               - Generate xorg.config.inc.php using "make".                                            -SHK
+               - Add a basic README file.                                                                                      -SHK
 
        * Mails : Use HermesMailer.                                                                                             -MC
 
@@ -42,7 +42,8 @@ Bug/Wish :
                - #83,208,222 : New fiche.                                                                                      -MC
 
        * Lists :
-               - #86 : yet another old old wish : lists archives are online !          -MC
+               - #86 : Yet another old old wish : lists archives are online !          -MC
+               - #144 : Users can subscribe from members/trombi page too.                      -MC
                - #184 : Owners can now delete their lists.                                                     -MC
                - #231 : Add a link to the user's fiche on moderation page.                     -MC
 
index f846d55..c9b9161 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: members.php,v 1.13 2004-11-22 20:04:44 x2000habouzit Exp $
+        $Id: members.php,v 1.14 2004-11-30 19:02:07 x2000habouzit Exp $
  ***************************************************************************/
 
 if(empty($_REQUEST['liste'])) header('Location: index.php');
@@ -29,6 +29,14 @@ new_skinned_page('listes/members.tpl', AUTH_COOKIE);
 require_once('xml-rpc-client.inc.php');
 
 $client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949/polytechnique.org");
+if(isset($_GET['del'])) {
+    $client->unsubscribe($liste);
+    header("Location: ?liste=$liste");
+}
+if(isset($_GET['add'])) {
+    $client->subscribe($liste);
+    header("Location: ?liste=$liste");
+}
 $members = $client->get_members($liste);
 
 $tri_promo = empty($_REQUEST['alpha']);
index a299c69..8ea1189 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: trombi.php,v 1.16 2004-11-22 20:04:44 x2000habouzit Exp $
+        $Id: trombi.php,v 1.17 2004-11-30 19:02:07 x2000habouzit Exp $
  ***************************************************************************/
 
 if(empty($_REQUEST['liste'])) header('Location: index.php');
@@ -30,6 +30,14 @@ require_once('xml-rpc-client.inc.php');
 require_once("trombi.inc.php");
 
 $client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949/polytechnique.org");
+if(isset($_GET['del'])) {
+    $client->unsubscribe($liste);
+    header("Location: ?liste=$liste");
+}
+if(isset($_GET['add'])) {
+    $client->subscribe($liste);
+    header("Location: ?liste=$liste");
+}
 
 function getList($offset,$limit) {
     global $client, $globals;
index ddf5757..b439d84 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: members.tpl,v 1.13 2004-11-13 15:56:37 x2000habouzit Exp $
+        $Id: members.tpl,v 1.14 2004-11-30 19:02:07 x2000habouzit Exp $
  ***************************************************************************}
 
 {dynamic}
     <td class='titre'>Nb. membres:</td>
     <td>{$nb_m|default:"0"}</td>
   </tr>
+  <tr class="pair">
+    <td class="titre">Ton statut:</td>
+    <td>
+      {if $details.sub>1}
+      Tu es inscrit sur la liste.<br />
+      Te désinscrire :
+      <a href='?liste={$smarty.request.liste}&amp;del=1'><img src="{rel}/images/retirer.gif" alt="[me désinsiscrire]" /></a>
+      {elseif $details.sub eq 1}
+      Ta demande d'inscription est en cours de validation.
+      {else}
+      Tu n'es pas inscrit.<br />
+      Demander ton inscription :
+      <a href="?liste={$smarty.request.liste}&amp;add=1"><img src="{rel}/images/ajouter.gif" alt="[demander mon inscription]" /></a>
+      {/if}
+    </td>
+  </tr>
 </table>
 {if $details.info}
 <br />
index 8d41c6a..fbaf34d 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: trombi.tpl,v 1.13 2004-11-13 15:56:37 x2000habouzit Exp $
+        $Id: trombi.tpl,v 1.14 2004-11-30 19:02:07 x2000habouzit Exp $
  ***************************************************************************}
 
 {dynamic}
     <td class='titre'> Inscription </td>
     <td>{if $details.ins}modérée{else}libre{/if}</td>
   </tr>
+  <tr class="pair">
+    <td class="titre">Ton statut:</td>
+    <td>
+      {if $details.sub>1}
+      Tu es inscrit sur la liste.<br />
+      Te désinscrire :
+      <a href='?liste={$smarty.request.liste}&amp;del=1'><img src="{rel}/images/retirer.gif" alt="[me désinsiscrire]" /></a>
+      {elseif $details.sub eq 1}
+      Ta demande d'inscription est en cours de validation.
+      {else}
+      Tu n'es pas inscrit.<br />
+      Demander ton inscription :
+      <a href="?liste={$smarty.request.liste}&amp;add=1"><img src="{rel}/images/ajouter.gif" alt="[demander mon inscription]" /></a>
+      {/if}
+    </td>
+  </tr>
 </table>
 
 <h1>