';
+}
+
+?>
+
diff --git a/htdocs/banana/include/hack.inc.php b/htdocs/banana/include/hack.inc.php
new file mode 100644
index 0000000..f0bebaa
--- /dev/null
+++ b/htdocs/banana/include/hack.inc.php
@@ -0,0 +1,14 @@
+
diff --git a/htdocs/banana/include/header.inc.php b/htdocs/banana/include/header.inc.php
new file mode 100644
index 0000000..acb6c35
--- /dev/null
+++ b/htdocs/banana/include/header.inc.php
@@ -0,0 +1,2 @@
+
diff --git a/htdocs/banana/include/password.inc.php b/htdocs/banana/include/password.inc.php
new file mode 100644
index 0000000..0a8ec3c
--- /dev/null
+++ b/htdocs/banana/include/password.inc.php
@@ -0,0 +1,17 @@
+
diff --git a/htdocs/banana/include/profile.inc.php b/htdocs/banana/include/profile.inc.php
new file mode 100644
index 0000000..c1878fa
--- /dev/null
+++ b/htdocs/banana/include/profile.inc.php
@@ -0,0 +1,64 @@
+xorgid == $_SESSION['forlife'] or has_perms());
+}
+
+/** getprofile : sets profile variables
+ * @return ARRAY associative array. Keys are 'name' (name), 'sig' (signature), 'org'
+ * (organization), 'display' (display threads with new posts only or all threads),
+ * 'lastnews' (timestamp for empasizing new posts)
+ */
+
+function getprofile() {
+ if (logged()) {
+ $req = mysql_query("SELECT nom,mail,sig,if(FIND_IN_SET('threads',flags),'1','0'),
+ IF(FIND_IN_SET('automaj',flags),'1','0')
+ FROM forums.profils
+ WHERE uid='{$_SESSION['uid']}'");
+ if (!(list($nom,$mail,$sig,$disp,$maj)=mysql_fetch_row($req))) {
+ $nom = $_SESSION['prenom']." ".$_SESSION['nom'];
+ $mail = $_SESSION['forlife']."@polytechnique.org";
+ $sig = $nom." (".$_SESSION['promo'].")";
+ $disp = 0;
+ $maj = 1;
+ }
+ $array['name'] = "$nom <$mail>";
+ $array['sig'] = $sig;
+ $array['org'] = "Utilisateur de Polytechnique.org";
+ $array['customhdr'] = "";
+ $array['display'] = $disp;
+ $array['autoup'] = $maj;
+ $array['lastnews'] = $_SESSION['lastnewslogin'];
+ $array['dropsig'] = true;
+ if ($maj) {
+ mysql_query("UPDATE auth_user_md5 SET lastnewslogin='"
+ .gmdate("YmdHis")."' WHERE user_id='{$_SESSION['uid']}'");
+ }
+ $req=mysql_query("SELECT nom
+ FROM forums.abos
+ LEFT JOIN forums.list ON list.fid=abos.fid
+ WHERE uid={$_SESSION['uid']};");
+ $array['subscribe']=array();
+ while (list($fnom)=mysql_fetch_array($req)) {
+ array_push($array['subscribe'],$fnom);
+ }
+ } else {
+ $array = array();
+ }
+ $array['locale'] = "locales/fr.inc.php";
+ return $array;
+}
+?>
diff --git a/htdocs/banana/include/session.inc.php b/htdocs/banana/include/session.inc.php
new file mode 100644
index 0000000..a845aaf
--- /dev/null
+++ b/htdocs/banana/include/session.inc.php
@@ -0,0 +1,29 @@
+
diff --git a/htdocs/banana/include/subscribe.inc.php b/htdocs/banana/include/subscribe.inc.php
new file mode 100644
index 0000000..649265c
--- /dev/null
+++ b/htdocs/banana/include/subscribe.inc.php
@@ -0,0 +1,37 @@
+
diff --git a/htdocs/banana/index.php b/htdocs/banana/index.php
new file mode 100644
index 0000000..cff7f97
--- /dev/null
+++ b/htdocs/banana/index.php
@@ -0,0 +1,18 @@
+caching = false;
+require('hack.inc.php');
+
+$page->register_function('banana', 'banana', false);
+
+$page->run();
+?>
diff --git a/htdocs/banana/install.sh b/htdocs/banana/install.sh
new file mode 100755
index 0000000..ce25a36
--- /dev/null
+++ b/htdocs/banana/install.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+ln -sf ../../../banana/{img,locales,scripts} .
+
+pushd include &> /dev/null
+ln -sf ../../../../banana/include/*.php .
+popd &> /dev/null
+
+chmod a+w spool
diff --git a/htdocs/banana/post.php b/htdocs/banana/post.php
new file mode 100644
index 0000000..cff7f97
--- /dev/null
+++ b/htdocs/banana/post.php
@@ -0,0 +1,18 @@
+caching = false;
+require('hack.inc.php');
+
+$page->register_function('banana', 'banana', false);
+
+$page->run();
+?>
diff --git a/htdocs/banana/scripts/spoolgen.php b/htdocs/banana/scripts/spoolgen.php
new file mode 100755
index 0000000..996aee0
--- /dev/null
+++ b/htdocs/banana/scripts/spoolgen.php
@@ -0,0 +1,47 @@
+authinfo($news["user"],$news["pass"]);
+ if (!$result) {
+ print "authentication error\n";
+ exit;
+ }
+}
+unset($result);
+
+$groups = new groups($nntp,2);
+$list = array_keys($groups->overview);
+unset($groups);
+foreach ($list as $g) {
+ print "Generating spool for $g : ";
+ $spool = new spool($nntp,$g);
+ print "done.\n";
+ unset($spool);
+}
+$nntp->quit();
+?>
diff --git a/htdocs/banana/spool/.cvsignore b/htdocs/banana/spool/.cvsignore
new file mode 100644
index 0000000..72e8ffc
--- /dev/null
+++ b/htdocs/banana/spool/.cvsignore
@@ -0,0 +1 @@
+*
diff --git a/htdocs/banana/subscribe.php b/htdocs/banana/subscribe.php
new file mode 100644
index 0000000..cff7f97
--- /dev/null
+++ b/htdocs/banana/subscribe.php
@@ -0,0 +1,18 @@
+caching = false;
+require('hack.inc.php');
+
+$page->register_function('banana', 'banana', false);
+
+$page->run();
+?>
diff --git a/htdocs/banana/thread.php b/htdocs/banana/thread.php
new file mode 100644
index 0000000..cff7f97
--- /dev/null
+++ b/htdocs/banana/thread.php
@@ -0,0 +1,18 @@
+caching = false;
+require('hack.inc.php');
+
+$page->register_function('banana', 'banana', false);
+
+$page->run();
+?>
diff --git a/htdocs/banana/xface.php b/htdocs/banana/xface.php
new file mode 100644
index 0000000..cff7f97
--- /dev/null
+++ b/htdocs/banana/xface.php
@@ -0,0 +1,18 @@
+caching = false;
+require('hack.inc.php');
+
+$page->register_function('banana', 'banana', false);
+
+$page->run();
+?>
diff --git a/htdocs/confbanana.php b/htdocs/confbanana.php
new file mode 100644
index 0000000..9dacf9e
--- /dev/null
+++ b/htdocs/confbanana.php
@@ -0,0 +1,59 @@
+db->query("
+ SELECT nom,mail,sig,if(FIND_IN_SET('threads',flags),'1','0'),
+ IF(FIND_IN_SET('automaj',flags),'1','0')
+ FROM forums.profils
+ WHERE uid='{$_SESSION['uid']}'");
+ if (!(list($nom,$mail,$sig,$disp,$maj)=mysql_fetch_row($req))) {
+ $nom = $_SESSION["prenom"]." ".$_SESSION["nom"];
+ $mail = $_SESSION["forlife"]."@polytechnique.org";
+ $sig = $nom." ({$_SESSION['promo']})";
+ $disp=0;
+ $maj=0;
+ }
+ $page->assign('nom', $nom);
+ $page->assign('mail', $mail);
+ $page->assign('sig', $sig);
+ $page->assign('disp', $disp);
+ $page->assign('maj', $maj);
+} else {
+ mysql_query("REPLACE INTO forums.profils (uid,sig,mail,nom,flags)
+ VALUES ('{$_SESSION['uid']}','{$_POST['bananasig']}',
+ '{$_POST['bananamail']}','{$_POST['banananame']}',
+ '".($_POST['bananadisplay']?"threads":"").","
+ .($_POST['bananaupdate']?"automaj":"")."')");
+}
+
+$page->run();
+?>
diff --git a/templates/banana.head.tpl b/templates/banana.head.tpl
new file mode 100644
index 0000000..5cf1d3f
--- /dev/null
+++ b/templates/banana.head.tpl
@@ -0,0 +1,25 @@
+{***************************************************************************
+ * Copyright (C) 2003-2004 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * 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; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * 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., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************
+ $Id: banana.head.tpl,v 1.1 2004-09-26 15:02:34 x2000habouzit Exp $
+ ***************************************************************************}
+
+
+
+{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/banana.tpl b/templates/banana.tpl
new file mode 100644
index 0000000..1eb7535
--- /dev/null
+++ b/templates/banana.tpl
@@ -0,0 +1,25 @@
+{***************************************************************************
+ * Copyright (C) 2003-2004 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * 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; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * 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., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************
+ $Id: banana.tpl,v 1.1 2004-09-26 15:02:34 x2000habouzit Exp $
+ ***************************************************************************}
+
+{banana}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/confbanana.tpl b/templates/confbanana.tpl
new file mode 100644
index 0000000..f804a12
--- /dev/null
+++ b/templates/confbanana.tpl
@@ -0,0 +1,122 @@
+{***************************************************************************
+ * Copyright (C) 2003-2004 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * 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; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * 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., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************
+ $Id: confbanana.tpl,v 1.1 2004-09-26 15:02:34 x2000habouzit Exp $
+ ***************************************************************************}
+
+
+ Configuration de Banana
+
+
+{dynamic}
+{if !$smarty.post}
+
+
+ Tu peux régler quelques paramètres qui apparaîtront sur les messages lorsque
+ tu posteras sur les forums. Cela ne te permettra pas d'être anonyme, puisque
+ tout le monde pourra remonter à ton identité en regardant ta fiche. L'objectif
+ est simplement de permettre plus de convivialité.
+
+
+ Tu pourras voir dans les forums les nouveaux messages mis en valeur (en
+ général en gras). Si tu consultes les forums régulièrement, tu peux en avoir
+ assez de voir tout le contenu du forum : la dernière option te permet de
+ n'afficher que les fils de discussion contenant des messages lus.
+