do not remove xface.php
[platal.git] / htdocs.net / groupe / edit.php
CommitLineData
0337d704 1<?php
2
3 require 'xnet.inc.php';
4 new_groupadmin_page('xnet/groupe/edit.tpl');
5
6 if (Post::has('submit')) {
7 if (has_perms()) {
8 $globals->xdb->execute(
9 "UPDATE groupex.asso
10 SET nom={?}, diminutif={?}, cat={?}, dom={?}, descr={?}, site={?}, mail={?}, resp={?}, forum={?}, mail_domain={?}, ax={?}, pub={?}, sub_url={?}
11 WHERE id={?}",
12 Post::get('nom'), Post::get('diminutif'), Post::get('cat'), Post::getInt('dom'),
13 Post::get('descr'), Post::get('site'), Post::get('mail'), Post::get('resp'),
14 Post::get('forum'), Post::get('mail_domain'), Post::has('ax'), Post::has('pub')?'private':'public', Post::get('sub_url'), $globals->asso('id'));
15 if (Post::get('mail_domain')) {
16 $globals->xdb->execute('INSERT INTO virtual_domains (domain) VALUES({?})', Post::get('mail_domain'));
17 }
18 } else {
19 $globals->xdb->execute(
20 "UPDATE groupex.asso
21 SET descr={?}, site={?}, mail={?}, resp={?}, forum={?}, ax={?}, pub= {?}, sub_url={?}
22 WHERE id={?}",
23 Post::get('descr'), Post::get('site'), Post::get('mail'), Post::get('resp'),
24 Post::get('forum'), Post::has('ax'), Post::has('pub')?'private':'public', Post::get('sub_url'), $globals->asso('id'));
25 }
26
27 if ($_FILES['logo']['name']) {
28 $logo = file_get_contents($_FILES['logo']['tmp_name']);
29 $mime = $_FILES['logo']['type'];
30 $globals->xdb->execute('UPDATE groupex.asso SET logo={?}, logo_mime={?} WHERE id={?}', $logo, $mime, $globals->asso('id'));
31 }
32
33 header('Location: ../'.Post::get('diminutif', $globals->asso('diminutif')).'/edit.php');
34 }
35
36 if (has_perms()) {
37 $dom = $globals->xdb->iterator('SELECT * FROM groupex.dom ORDER BY nom');
38 $page->assign('dom', $dom);
39 $page->assign('super', true);
40 }
41 $page->run();
42
43?>