one more + obsolete one
authorx2000habouzit <x2000habouzit>
Mon, 19 Jul 2004 09:33:21 +0000 (09:33 +0000)
committerx2000habouzit <x2000habouzit>
Mon, 19 Jul 2004 09:33:21 +0000 (09:33 +0000)
etat_migration
htdocs/admin/admin_trombino.php [new file with mode: 0644]
templates/admin/admin_trombino.tpl [new file with mode: 0644]

index 3b30f1e..7e19069 100644 (file)
@@ -16,8 +16,6 @@
 ------+-------------------------------------------+----------------
 Etat  | Ancien nom                                                               | Nouveau nom
 ------+-[ admin ]---------------------------------+----------------
-;        | admin/admin_trombino.php                              | 
-;        | admin/correction_adr.php                              | 
 ;        | admin/evenements.php                                          | 
 ------+-[ marketing ]-----------------------------+----------------
 ;        | admin/utilisateurs_identification.php         | marketing/
@@ -93,6 +91,7 @@ xx      | AccesPermanentOn.php                                          | cookie_on.php
 xx       | acces_redirect.php                                            | carva_redirect.php
 xx       | acces_smtp.php                                                        | -
 xx       | acces_wap.php                                                         | -
+xx       | admin/admin_trombino.php                              | 
 xx       | admin/ax-xorg.php                                             | -
 xx       | admin/deces_promo.php                                         | -
 xx       | admin/envoidirect.php                                         | marketing/envoidirect.php
@@ -184,6 +183,7 @@ xx    | trezo/gere_operations.php                             | -
 xx       | trezo/index.php                                                       | -
 xx       | vcard.php                                                             | -
 ------+-------------------------------------------+----------------
+x!!      | admin/correction_adr.php                              | 
 x!!      | admin/logger_events.php                                       | géré par logger.php
 x!!      | admin/logger_user.php                                         | géré par logger.php
 x!!      | admin/newsletter_form.inc.php                         | -
diff --git a/htdocs/admin/admin_trombino.php b/htdocs/admin/admin_trombino.php
new file mode 100644 (file)
index 0000000..67fbb8e
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+require("auto.prepend.inc.php");
+new_admin_page('admin/admin_trombino.tpl');
+
+$q = $globals->db->query("SELECT username,promo FROM auth_user_md5 WHERE user_id = '" . $_REQUEST["uid"] . "'");
+list($username, $promo) = mysql_fetch_row($q);
+
+if (isset($_REQUEST["action"])) {
+    switch ($_REQUEST["action"]) {
+
+    case "ecole":
+        header("Content-type: image/jpeg");
+       readfile("/home/web/trombino/photos".$promo."/".$username.".jpg");
+        exit;
+       break;
+
+    case "valider":
+        $handle = fopen ($_FILES['userfile']['tmp_name'], "r");
+       $data = fread ($handle, filesize ($_FILES['userfile']['tmp_name']));
+       fclose ($handle);
+       list($x, $y) = getimagesize($_FILES['userfile']['tmp_name']);
+       $mimetype = substr($_FILES['userfile']['type'], 6);
+       unlink($_FILES['userfile']['tmp_name']);
+        $globals->db->query(
+         "REPLACE INTO photo
+          SET uid='".$_REQUEST["uid"]."',
+          attachmime = '".$mimetype."',
+          attach='".addslashes($data)."',
+          x='".$x."', y='".$y."'");
+       break;
+
+    case "supprimer":
+        $globals->db->query("DELETE FROM photo WHERE uid = '".$_REQUEST["uid"]."'");
+        break;
+    }
+}
+
+$page->assign('username', $username);
+$page->run();
+?>
diff --git a/templates/admin/admin_trombino.tpl b/templates/admin/admin_trombino.tpl
new file mode 100644 (file)
index 0000000..da9b5e3
--- /dev/null
@@ -0,0 +1,32 @@
+{* $Id: admin_trombino.tpl,v 1.1 2004-07-19 09:33:21 x2000habouzit Exp $ *}
+
+<div class="rubrique">
+  Gestion du trombino
+</div>
+
+{dynamic}
+<p>
+Photo actuelle de {$username}
+</p>
+
+<img src="../getphoto.php?x={$smarty.request.uid}" />
+<br />
+
+<p>
+<a href="{$smarty.server.PHP_SELF}?uid={$smarty.request.uid}&amp;action=supprimer">Supprimer cette photo</a>
+</p>
+
+<p>
+<a href="{$smarty.server.PHP_SELF}?uid={$smarty.request.uid}&amp;action=ecole">Voir sa photo de trombi récupérée à l'école (si disponible)</a>
+</p>
+
+<form action="{$smarty.server.PHP_SELF}" method="post" enctype="multipart/form-data">
+  <input type="hidden" name="uid" value="{$smarty.request.uid}" />
+  <input type="hidden" name="action" value="valider" />
+  <input name="userfile" type="file" size="20" maxlength="150" />
+  <input type="submit" value="Envoyer" />
+</form>
+
+{/dynamic}
+
+{* vim:set et sw=2 sts=2 sws=2: *}