* Core :
- #183,185 : Implement perms levels : 'pending'+'disabled'. -MC
+ - #154 : Birth fields are now of type DATE. -MC
* Fiche :
- #83,208,222 : New fiche. -MC
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: step3.php,v 1.7 2004-11-22 20:04:41 x2000habouzit Exp $
+ $Id: step3.php,v 1.8 2004-11-30 21:11:39 x2000habouzit Exp $
***************************************************************************/
require_once("xorg.inc.php");
if (!isset($_REQUEST["appli_type2"])) $_REQUEST["appli_type2"]=0;
if (!isset($loginbis)) $loginbis="";
+$birth = printf("%s-%s-%s", substr($_REQUEST["naissance"],4,4), substr($_REQUEST["naissance"],2,2), substr($_REQUEST["naissance"],0,2));
+
// nouvelle inscription
$sql="REPLACE INTO en_cours
SET ins_id='$ins_id', password='$password', matricule='$matricule', promo='$promo',
nom='".addslashes($nom)."', prenom='".addslashes($prenom)."', email='{$_REQUEST['email']}',
- naissance='{$_REQUEST['naissance']}', date='$date', nationalite='{$_REQUEST['nationalite']}',
+ naissance='$birth', date='$date', nationalite='{$_REQUEST['nationalite']}',
appli_id1='{$_REQUEST['appli_id1']}', appli_type1='{$_REQUEST['appli_type1']}',
appli_id2='{$_REQUEST['appli_id2']}', appli_type2='{$_REQUEST['appli_type2']}',
loginbis='$mailorg', username='$forlife'";
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: step4.php,v 1.19 2004-11-22 20:04:41 x2000habouzit Exp $
+ $Id: step4.php,v 1.20 2004-11-30 21:11:39 x2000habouzit Exp $
***************************************************************************/
require_once("xorg.inc.php");
$nom = stripslashes($nom);
$prenom = stripslashes($prenom);
$sql = "UPDATE auth_user_md5 SET password='$password', nationalite=$nationalite, perms='user',
- date='$date', naissance=$naissance, date_ins = NULL WHERE matricule='$matricule'";
+ date='$date', naissance='$naissance', date_ins = NULL WHERE matricule='$matricule'";
$globals->db->query($sql);
$sql = "INSERT INTO auth_user_quick (user_id)
SELECT user_id
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: login.php,v 1.18 2004-11-22 20:04:35 x2000habouzit Exp $
+ $Id: login.php,v 1.19 2004-11-30 21:11:39 x2000habouzit Exp $
***************************************************************************/
require_once("xorg.inc.php");
list($date,$naissance) = mysql_fetch_row($param);
mysql_free_result($param);
-if ($naissance==0) {
+if ($naissance==0 || $naissance=='0000-00-00') {
$page->assign('ask_naissance', true);
$page->run('ask-naissance');
exit;
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: profil.php,v 1.16 2004-11-22 20:04:36 x2000habouzit Exp $
+ $Id: profil.php,v 1.17 2004-11-30 21:11:39 x2000habouzit Exp $
***************************************************************************/
require_once("xorg.inc.php");
}
//sinon
- $globals->db->query("UPDATE auth_user_md5 SET naissance='{$_REQUEST['birth']}' WHERE user_id=".$_SESSION['uid']);
+ $birth = printf("%s-%s-%s", substr($_REQUEST["birth"],4,4), substr($_REQUEST["birth"],2,2), substr($_REQUEST["birth"],0,2));
+ $globals->db->query("UPDATE auth_user_md5 SET naissance='$birth' WHERE user_id=".$_SESSION['uid']);
$page->assign('etat_naissance','ok');
$page->run();
} else {
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: recovery.php,v 1.11 2004-11-22 20:04:36 x2000habouzit Exp $
+ $Id: recovery.php,v 1.12 2004-11-30 21:11:39 x2000habouzit Exp $
***************************************************************************/
require_once("xorg.inc.php");
$page->assign('error', "Date de naissance incorrecte ou incohérente");
$page->run();
}
+ $birth = printf("%s-%s-%s", substr($_REQUEST["birth"],4,4), substr($_REQUEST["birth"],2,2), substr($_REQUEST["birth"],0,2));
$mailorg=strtok($_REQUEST['login'],"@");
$result=$globals->db->query($sql);
if (list($uid,$naissance)=mysql_fetch_array($result)) {
if((strlen($naissance))<5) {
- $globals->db->query("UPDATE auth_user_md5 SET naissance={$_REQUEST['birth']} WHERE user_id=$uid");
- $naissance = $_REQUEST['birth'];
+ $globals->db->query("UPDATE auth_user_md5 SET naissance='$birth' WHERE user_id=$uid");
+ $naissance = $birth;
}
}
mysql_free_result($result);
- if ($naissance == $_REQUEST['birth']) {
+ if ($naissance == $birth) {
$page->assign('ok', true);
$url=rand_url_id();
$stamp=date("Y-m-d H:i:s");
if ($array) { // on a bien eu un résultat : le matricule etait bon
- //on n'envoit que l'age à manageurs
- $year = (int) substr($array['age'],4,4);
- $month = (int) substr($array['age'],2,2);
- $day = (int) substr($array['age'],4,4);
+ //on n'envoit que l'age à manageurs le format est YYYY-MM-DD 0123-56-89
+ $year = (int) substr($array['age'],0,4);
+ $month = (int) substr($array['age'],5,2);
+ $day = (int) substr($array['age'],8,2);
$age = (int) date('Y') - $year - 1;
if(( $month < (int)date('m')) ||
(($month == (int)date('m')) && ($day >= (int)date('d')))) $age += 1;
update auth_user_md5 set perms='pending' where perms='non-inscrit';
alter table auth_user_md5 change column perms perms enum('user','admin','pending','disabled');
alter table auth_user_md5 change column comment comment varchar(64) not null;
+
+alter table auth_user_md5 add column foo int;
+update auth_user_md5 set foo=naissance ;
+alter table auth_user_md5 change column naissance naissance date not null;
+update auth_user_md5 set naissance = concat(foo % 10000, '-', (foo / 10000) % 100, '-', foo / 1000000);
+alter table auth_user_md5 drop column foo;
+
+alter table en_cours add column foo int;
+update en_cours set foo=naissance ;
+alter table en_cours change column naissance naissance date not null;
+update en_cours set naissance = concat(foo % 10000, '-', (foo / 10000) % 100, '-', foo / 1000000);
+alter table en_cours drop column foo;