--- /dev/null
+<?php
+/***************************************************************************
+ * 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: panel.php,v 1.1 2004-11-06 18:18:44 x2000habouzit Exp $
+ ***************************************************************************/
+
+require("auto.prepend.inc.php");
+new_skinned_page('carnet/panel.tpl', AUTH_COOKIE);
+require('notifs.inc.php');
+
+$notifs = new Notifs($_SESSION['uid']);
+
+$page->assign_by_ref('notifs', $notifs);
+
+$page->run();
+
+?>
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: notifs.inc.php,v 1.8 2004-11-06 17:37:22 x2000habouzit Exp $
+ $Id: notifs.inc.php,v 1.9 2004-11-06 18:18:44 x2000habouzit Exp $
***************************************************************************/
define("WATCH_FICHE", 1);
define("WATCH_DEATH", 3);
function register_watch_op($uid,$cid,$date='',$info='') {
+ global $globals;
$date = empty($date) ? 'NOW()' : "'$date'";
$globals->db->query("REPLACE INTO watch_ops (uid,cid,known,date,info) VALUES('$uid','$cid',NOW(),$date,'$info')");
if($cid == WATCH_FICHE) {
}
}
+class Notifs {
+ var $_uid;
+ var $_cats = Array();
+ var $_data = Array();
+
+ function Notifs($uid) {
+ global $globals;
+ $this->_uid = $uid;
+
+ $res = $globals->db->query("SELECT * FROM watch_cat");
+ while($tmp = mysql_fetch_assoc($res)) $this->_cats[$tmp['id']] = $tmp;
+ mysql_free_result($res);
+
+ $res = $globals->db->query("SELECT u.promo, u.prenom, IF(u.epouse='',u.nom,u.epouse) AS nom, a.alias AS forlife, wo.*
+ FROM auth_user_quick AS q
+ INNER JOIN contacts AS c ON(q.user_id = c.uid)
+ INNER JOIN watch_ops AS wo ON(wo.uid=c.contact)
+ INNER JOIN watch_sub AS ws ON(wo.cid=ws.cid AND ws.uid=c.uid)
+ INNER JOIN auth_user_md5 AS u ON(u.user_id = wo.uid)
+ LEFT JOIN aliases AS a ON(u.user_id = a.id AND a.type='a_vie')
+ WHERE q.user_id = '$uid' AND q.watch_contacts=1
+ ORDER BY wo.cid,promo,nom");
+ while($tmp = mysql_fetch_assoc($res)) {
+ $this->_data[$tmp['cid']][$tmp['promo']][$tmp['uid']] = $tmp;
+ }
+
+ $res = $globals->db->query("SELECT u.promo, u.prenom, IF(u.epouse='',u.nom,u.epouse) AS nom, a.alias AS forlife, wo.*
+ FROM watch_promo AS w
+ INNER JOIN auth_user_md5 AS u USING(promo)
+ INNER JOIN watch_ops AS wo ON(wo.uid=u.user_id)
+ INNER JOIN watch_sub AS ws ON(wo.cid=ws.cid)
+ INNER JOIN watch_cat AS wc ON(wc.id=wo.cid AND wc.frequent=0)
+ LEFT JOIN aliases AS a ON(u.user_id = a.id AND a.type='a_vie')
+ WHERE w.uid = '$uid'
+ ORDER BY wo.cid,promo,nom");
+ while($tmp = mysql_fetch_assoc($res)) {
+ $this->_data[$tmp['cid']][$tmp['promo']][$tmp['uid']] = $tmp;
+ }
+
+ $res = $globals->db->query("SELECT u.promo, u.prenom, IF(u.epouse='',u.nom,u.epouse) AS nom, a.alias AS forlife, wo.*
+ FROM watch_nonins AS w
+ INNER JOIN auth_user_md5 AS u ON(w.ni_id=u.user_id)
+ INNER JOIN watch_ops AS wo ON(wo.uid=u.user_id)
+ INNER JOIN watch_sub AS ws ON(wo.cid=ws.cid)
+ INNER JOIN watch_cat AS wc ON(wc.id=wo.cid)
+ LEFT JOIN aliases AS a ON(u.user_id = a.id AND a.type='a_vie')
+ WHERE w.uid = '$uid'
+ ORDER BY wo.cid,promo,nom");
+ while($tmp = mysql_fetch_assoc($res)) {
+ $this->_data[$tmp['cid']][$tmp['promo']][$tmp['uid']] = $tmp;
+ }
+ }
+}
+
class Watch {
var $_uid;
var $_promos;
var $_cats = Array();
var $_subs;
var $watch_contacts;
- var $watch_last;
function Watch($uid) {
global $globals;
$this->_promos = new PromoNotifs($uid);
$this->_nonins = new NoninsNotifs($uid);
$this->_subs = new WatchSub($uid);
- $res = $globals->db->query("SELECT watch_contacts,watch_last FROM auth_user_quick WHERE user_id='$uid'");
- list($this->watch_contacts, $this->watch_last) = mysql_fetch_row($res);
+ $res = $globals->db->query("SELECT watch_contacts FROM auth_user_quick WHERE user_id='$uid'");
+ list($this->watch_contacts) = mysql_fetch_row($res);
mysql_free_result($res);
$res = $globals->db->query("SELECT * FROM watch_cat");
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: xorg.session.inc.php,v 1.36 2004-11-06 13:53:52 x2000habouzit Exp $
+ $Id: xorg.session.inc.php,v 1.37 2004-11-06 18:18:44 x2000habouzit Exp $
***************************************************************************/
require("diogenes.core.session.inc.php");
function start_connexion ($uid, $identified) {
global $globals;
$result=$globals->db->query("
- SELECT prenom, nom, perms, promo, matricule, UNIX_TIMESTAMP(s.start) AS lastlogin, s.host,
- a.alias, UNIX_TIMESTAMP(q.lastnewslogin), a2.alias, password, FIND_IN_SET('femme', flags)
+ SELECT prenom, nom, perms, promo, matricule, UNIX_TIMESTAMP(s.start) AS lastlogin, s.host, a.alias,
+ UNIX_TIMESTAMP(q.lastnewslogin), q.watch_last,
+ a2.alias, password, FIND_IN_SET('femme', flags)
FROM auth_user_md5 AS u
INNER JOIN auth_user_quick AS q USING(user_id)
INNER JOIN aliases AS a ON (u.user_id = a.id AND a.type='a_vie')
WHERE u.user_id=$uid
ORDER BY s.start DESC, a2.type != 'epouse', length(a2.alias)
LIMIT 1");
- list($prenom, $nom, $perms, $promo, $matricule, $lastlogin, $host,
- $forlife, $lastnewslogin, $bestalias, $password, $femme) = mysql_fetch_row($result);
+ list($prenom, $nom, $perms, $promo, $matricule, $lastlogin, $host, $forlife,
+ $lastnewslogin, $watch_last,
+ $bestalias, $password, $femme) = mysql_fetch_row($result);
mysql_free_result($result);
// on garde le logger si il existe (pour ne pas casser les sessions lors d'une
// le login est stocké pour un an
$_SESSION['lastlogin'] = $lastlogin;
$_SESSION['lastnewslogin'] = $lastnewslogin;
+ $_SESSION['watch_last'] = $watch_last;
$_SESSION['host'] = $host;
$_SESSION['auth'] = ($identified ? AUTH_MDP : AUTH_COOKIE);
$_SESSION['uid'] = $uid;
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: index.tpl,v 1.2 2004-11-04 15:48:45 x2000habouzit Exp $
+ $Id: index.tpl,v 1.3 2004-11-06 18:18:44 x2000habouzit Exp $
***************************************************************************}
<h1>Carnet polytechnicien</h1>
</th>
</tr>
<tr class="impair">
- <td>
+ <td class='half'>
<div class="question">
<a href="{"carnet/mescontacts.php"|url}">Page de tes contacts</a>
</div>
Tu peux ici lister tes contacts, en ajouter et en retirer.
</div>
</td>
- <td>
+ <td class='half'>
<div class="question">
<a href="{"carnet/mescontacts.php?trombi=1"|url}">Le trombi de tes contacts</a>
</div>
</div>
</td>
</tr>
+</table>
+
+<br />
+
+<table class="bicol">
+ <tr>
+ <th colspan="2">
+ Notifications
+ </th>
+ </tr>
<tr class="pair">
- <td colspan="2">
+ <td class='half'>
+ <div class="question">
+ <a href="{"carnet/panel.php"|url}">Bilan de tes notifications</a>
+ </div>
+ <div class="explication">
+ Affichage de tous les évenements de camarades/promos
+ </div>
+ </td>
+ <td class='half'>
<div class="question">
- <a href="{"carnet/notifs.php"|url}">Notifications hebdomadaires automatiques</a>
+ <a href="{"carnet/notifs.php"|url}">Configurer tes notifications</a>
</div>
<div class="explication">
Être notifié des inscriptions, décès, changement de fiche, ...
--- /dev/null
+{***************************************************************************
+ * 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: panel.tpl,v 1.1 2004-11-06 18:18:44 x2000habouzit Exp $
+ ***************************************************************************}
+
+<h1>Carnet polytechnicien</h1>
+
+<table class="bicol">
+ <tr>
+ <th colspan="2">
+ Tes contacts
+ </th>
+ </tr>
+ <tr class="impair">
+ <td class='half'>
+ <div class="question">
+ <a href="{"carnet/mescontacts.php"|url}">Page de tes contacts</a>
+ </div>
+ <div class="explication">
+ Tu peux ici lister tes contacts, en ajouter et en retirer.
+ </div>
+ </td>
+ <td class='half'>
+ <div class="question">
+ <a href="{"carnet/mescontacts.php?trombi=1"|url}">Le trombi de tes contacts</a>
+ </div>
+ <div class="explication">
+ La même chose que la page de tes contacts... <strong>en images !</strong>
+ </div>
+ </td>
+ </tr>
+</table>
+
+<br />
+
+<table class="bicol">
+ <tr>
+ <th colspan="2">
+ Notifications
+ </th>
+ </tr>
+ <tr class="pair">
+ <td class='half'>
+ <div class="question">
+ <a href="{"carnet/panel.php"|url}">Bilan de tes notifications</a>
+ </div>
+ <div class="explication">
+ Affichage de tous les évenements de camarades/promos
+ </div>
+ </td>
+ <td class='half'>
+ <div class="question">
+ <a href="{"carnet/notifs.php"|url}">Configurer tes notifications</a>
+ </div>
+ <div class="explication">
+ Être notifié des inscriptions, décès, changement de fiche, ...
+ </div>
+ </td>
+ </tr>
+</table>
+
+{* vim:set et sw=2 sts=2 sws=2: *}