}
}
} elseif (Env::v('suppr')) {
- XDB::execute('DELETE FROM photo WHERE uid = {?}',
- S::v('uid'));
- XDB::execute('DELETE FROM requests
- WHERE user_id = {?} AND type="photo"',
- S::v('uid'));
+ XDB::execute('DELETE FROM photo
+ WHERE uid = {?}',
+ S::v('uid'));
+ XDB::execute('DELETE FROM requests
+ WHERE user_id = {?} AND type="photo"',
+ S::v('uid'));
+ update_NbValid();
} elseif (Env::v('cancel')) {
- $sql = XDB::query('DELETE FROM requests
- WHERE user_id={?} AND type="photo"',
- S::v('uid'));
+ $sql = XDB::query('DELETE FROM requests
+ WHERE user_id={?} AND type="photo"',
+ S::v('uid'));
+ update_NbValid();
}
- $sql = XDB::query('SELECT COUNT(*) FROM requests
- WHERE user_id={?} AND type="photo"',
+ $sql = XDB::query('SELECT COUNT(*)
+ FROM requests
+ WHERE user_id={?} AND type="photo"',
S::v('uid'));
$page->assign('submited', $sql->fetchOneCell());
$page->assign('has_trombi_x', file_exists($trombi_x));
{
global $globals;
- // Finish registration procedure
- if (Post::v('register_from_ax_question')) {
- XDB::execute('UPDATE auth_user_quick
- SET profile_from_ax = 1
- WHERE user_id = {?}',
- S::v('uid'));
- }
- if (Post::v('add_to_nl')) {
- require_once 'newsletter.inc.php';
- NewsLetter::subscribe();
- }
- if (Post::v('add_to_ax')) {
- require_once dirname(__FILE__) . '/axletter/axletter.inc.php';
- AXLetter::subscribe();
- }
- if (Post::v('add_to_promo')) {
- $r = XDB::query('SELECT id FROM groupex.asso WHERE diminutif = {?}',
- S::v('promo'));
- $asso_id = $r->fetchOneCell();
- XDB::execute('REPLACE INTO groupex.membres (uid,asso_id)
- VALUES ({?}, {?})',
- S::v('uid'), $asso_id);
- $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);
- }
- }
-
// AX Synchronization
require_once 'synchro_ax.inc.php';
if (is_ax_key_missing()) {
$page->trig('Ton profil a été synchronisé avec celui du site polytechniciens.com');
}
- // Misc checks
- // TODO: Block if birth date is missing ?
-
+ // Build the page
$page->addJsLink('ajax.js');
$page->addJsLink('profile.js');
$page->addJsLink('applis.js');
$wiz->addPage('ProfileMentor', 'Mentoring', 'mentor');
$wiz->apply($page, 'profile/edit', $opened_tab, $mode);
- $page->assign('xorg_title', 'Polytechnique.org - Mon Profil');
+ // Misc checks
+ $res = XDB::query("SELECT user_id
+ FROM auth_user_md5
+ WHERE user_id = {?} AND naissance = '0000-00-00'", S::i('uid'));
+ if ($res->numRows()) {
+ $page->trig("Ta date de naissance n'est pas renseignée, ce qui t'empêcheras de réaliser"
+ . " la procédure de récupération de mot de passe si un jour tu le perdais");
+ }
+
+ $page->assign('xorg_title', 'Polytechnique.org - Mon Profil');
}
function handler_applis_js(&$page)