.'/'.S::v('forlife').'.jpg';
if (Env::has('upload')) {
- 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');
- } elseif (strpos(trim(mime_content_type($_FILES['userfile']['tmp_name'])), 'image/') !== 0) {
- $page->trig('Le fichier que tu as transmis n\'est pas une image.');
- } 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);
- if ($myphoto->isValid()) {
- $myphoto->submit();
- }
- } else {
- $page->trig('Fichier inexistant ou vide');
+ $upload = new PlUpload(S::v('forlife'), 'photo');
+ if (!$upload->upload($_FILES['userfile']) && !$upload->download(Env::v('photo'))) {
+ $page->trig('Une erreur est survenue lors du téléchargement du fichier');
+ } else {
+ $myphoto = new PhotoReq(S::v('uid'), $upload);
+ if ($myphoto->isValid()) {
+ $myphoto->submit();
}
}
} elseif (Env::has('trombi')) {
- $myphoto = new PhotoReq(S::v('uid'),
- file_get_contents($trombi_x));
- if ($myphoto->isValid()) {
- $myphoto->commit();
- $myphoto->clean();
+ $upload = new PlUpload(S::v('forlife'), 'photo');
+ if ($upload->copyFrom($trombi_x)) {
+ $myphoto = new PhotoReq(S::v('uid'), $upload);
+ if ($myphoto->isValid()) {
+ $myphoto->commit();
+ $myphoto->clean();
+ }
}
} elseif (Env::v('suppr')) {
XDB::execute('DELETE FROM photo WHERE uid = {?}',
}
$sql = XDB::query('SELECT COUNT(*) FROM requests
- WHERE user_id={?} AND type="photo"',
- S::v('uid'));
+ WHERE user_id={?} AND type="photo"',
+ S::v('uid'));
$page->assign('submited', $sql->fetchOneCell());
$page->assign('has_trombi_x', file_exists($trombi_x));
}
$new = Env::v('modif') == 'new';
$user = get_user_details($login, S::v('uid'), $view);
- require_once('url_catcher.inc.php');
- $user['freetext'] = url_catcher($user['freetext'], false);
+ $user['freetext'] = MiniWiki::WikiToHTML($user['freetext']);
$title = $user['prenom'] . ' ' . empty($user['nom_usage']) ? $user['nom'] : $user['nom_usage'];
$page->assign('xorg_title', $title);
$mmlist = new MMList(S::v('uid'), S::v('password'));
$mmlist->subscribe("promo".S::v('promo'));
}
+ if (Post::v('sub_ml')) {
+ $subs = array_keys(Post::v('sub_ml'));
+ $current_domain = null;
+ foreach ($subs as $list) {
+ list($sub, $domain) = explode('@', $list);
+ if ($domain != $current_domain) {
+ $current_domain = $domain;
+ $client = new MMList(S::v('uid'), S::v('password'), $domain);
+ }
+ $client->subscribe($sub);
+ }
+ }
if (is_ax_key_missing()) {
$page->assign('no_private_key', true);
$x = substr($x, 0, strlen($x) - 4);
}
- require_once('vcard.inc.php');
$vcard = new VCard($x);
$vcard->do_page($page);
}