<?php
/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
+ * Copyright (C) 2003-2007 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
function handler_photo_change(&$page)
{
- $page->changeTpl('trombino.tpl');
+ $page->changeTpl('profile/trombino.tpl');
require_once('validations.inc.php');
.'/'.S::v('forlife').'.jpg';
if (Env::has('upload')) {
- $file = isset($_FILES['userfile']['tmp_name'])
- ? $_FILES['userfile']['tmp_name']
- : Env::v('photo');
- if ($data = file_get_contents($file)) {
- if ($myphoto = new PhotoReq(S::v('uid'), $data)) {
+ if (isset($_FILES['userfile']['tmp_name'])
+ && !is_uploaded_file($_FILES['userfile']['tmp_name'])) {
+ $page->trig('Une erreur s\'est produite lors du transfert du fichier');
+ } else {
+ $file = is_uploaded_file($_FILES['userfile']['tmp_name'])
+ ? $_FILES['userfile']['tmp_name']
+ : Env::v('photo');
+ if ($data = file_get_contents($file)) {
+ $myphoto = new PhotoReq(S::v('uid'), $data);
$myphoto->submit();
+ } else {
+ $page->trig('Fichier inexistant ou vide');
}
- } else {
- $page->trig('Fichier inexistant ou vide');
}
} elseif (Env::has('trombi')) {
$myphoto = new PhotoReq(S::v('uid'),
global $globals;
require_once 'user.func.inc.php';
- $page->changeTpl('fiche.tpl', SIMPLE);
+ $page->changeTpl('profile/profile.tpl', SIMPLE);
$view = 'private';
if (!S::logged() || Env::v('view') == 'public') $view = 'public';
{
global $globals;
- $page->changeTpl('profil.tpl');
+ $page->changeTpl('profile/edit.tpl');
$page->addCssLink('profil.css');
$page->assign('xorg_title', 'Polytechnique.org - Mon Profil');
if($page->nb_errs()) {
require_once "profil/assign_{$opened_tab}.inc.php";
$page->assign('onglet', $opened_tab);
- $page->assign('onglet_tpl', "profil/$opened_tab.tpl");
+ $page->assign('onglet_tpl', "profile/$opened_tab.tpl");
return;
}
require_once "profil/assign_{$opened_tab}.inc.php";
$page->assign('onglet', $opened_tab);
- $page->assign('onglet_tpl', "profil/$opened_tab.tpl");
+ $page->assign('onglet_tpl', "profile/$opened_tab.tpl");
return;
}
function handler_p_orange(&$page)
{
- $page->changeTpl('orange.tpl');
+ $page->changeTpl('profile/orange.tpl');
require_once 'validations.inc.php';
require_once 'xorg.misc.inc.php';
return PL_NOT_FOUND;
}
- $page->changeTpl('fiche_referent.tpl', SIMPLE);
+ $page->changeTpl('profile/fiche_referent.tpl', SIMPLE);
$res = XDB::query(
"SELECT prenom, nom, user_id, promo, cv, a.alias AS bestalias
function handler_ref_search(&$page)
{
- $page->changeTpl('referent.tpl');
+ $page->changeTpl('profile/referent.tpl');
$page->assign('xorg_title', 'Polytechnique.org - Conseil Pro');
function handler_p_usage(&$page)
{
- $page->changeTpl('nomusage.tpl');
+ $page->changeTpl('profile/nomusage.tpl');
require_once 'validations.inc.php';
require_once 'xorg.misc.inc.php';
function handler_trombi(&$page, $promo = null)
{
- $page->changeTpl('trombipromo.tpl');
+ $page->changeTpl('profile/trombipromo.tpl');
$page->assign('xorg_title', 'Polytechnique.org - Trombi Promo');
if (is_null($promo)) {
function handler_xnet(&$page)
{
- $page->changeTpl('groupesx.tpl');
+ $page->changeTpl('profile/groupesx.tpl');
$page->assign('xorg_title', 'Polytechnique.org - Promo, Groupes X, Binets');
$req = XDB::query('
}
function handler_admin_trombino(&$page, $uid = null, $action = null) {
- $page->changeTpl('admin/admin_trombino.tpl');
+ $page->changeTpl('profile/admin_trombino.tpl');
$page->assign('xorg_title','Polytechnique.org - Administration - Trombino');
$page->assign('uid', $uid);
$table_editor = new PLTableEditor('admin/medals','profile_medals','id');
$table_editor->describe('text', 'intitulé', true);
$table_editor->describe('img', 'nom de l\'image', false);
+ $table_editor->describe('flags', 'valider', true);
$table_editor->apply($page, $action, $id);
if ($id && $action == 'edit') {
- $page->changeTpl('admin/gerer_decos.tpl');
+ $page->changeTpl('profile/admin_decos.tpl');
$mid = $id;