$new = Env::v('modif') == 'new';
$user = get_user_details($login, S::v('uid'), $view);
- $user['freetext'] = preg_replace('/((?:https?|ftp):\/\/(?:&|\.*,*[a-z@0-9~%$£µ&i#\-+=_\/\?])*)/i',
- '<a href="\\0">\\0</a>', $user['freetext']);
+ require_once('url_catcher.inc.php');
+ $user['freetext'] = url_catcher($user['freetext'], false);
$title = $user['prenom'] . ' ' . empty($user['nom_usage']) ? $user['nom'] : $user['nom_usage'];
$page->assign('xorg_title', $title);
$evt = array(
'eid' => $eid,
'asso_id' => $globals->asso('id'),
- 'organisateur_uid' => S::v('uid'),
'paiement_id' => Post::v('paiement_id') > 0 ? Post::v('paiement_id') : null,
'debut' => Post::v('deb_Year').'-'.Post::v('deb_Month')
.'-'.Post::v('deb_Day').' '.Post::v('deb_Hour')
);
$trivial = array('intitule', 'descriptif', 'noinvite',
- 'show_participants', 'accept_nonmembre');
+ 'show_participants', 'accept_nonmembre', 'organisateur_uid');
foreach ($trivial as $k) {
$evt[$k] = Post::v($k);
}
+ if (!$eid) {
+ $evt['organisateur_uid'] = S::v('uid');
+ }
if (Post::v('deadline')) {
$evt['deadline_inscription'] = Post::v('inscr_Year').'-'
}
if (is_null($evt['eid'])) {
- pl_redirect('events/'.$eid);
+ pl_redirect('events');
}
}
// when modifying an old event retreive the old datas
if ($eid) {
$res = XDB::query(
- "SELECT eid, intitule, descriptif, debut, fin,
- show_participants, paiement_id, short_name,
- deadline_inscription, noinvite, accept_nonmembre
+ "SELECT eid, intitule, descriptif, debut, fin, organisateur_uid,
+ show_participants, paiement_id, short_name,
+ deadline_inscription, noinvite, accept_nonmembre
FROM groupex.evenements
WHERE eid = {?}", $eid);
$evt = $res->fetchOneAssoc();