From a62b8b897c0e57fd7d33cae783cfb2b6376ab226 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Sun, 25 Jan 2004 17:19:21 +0000 Subject: [PATCH 1/1] Initial revision --- .cvsignore | 2 + .htaccess | 2 + htdocs/css/default.css | 124 +++++++++++++++++ htdocs/images/favicon.png | Bin 0 -> 836 bytes htdocs/images/sk_default_ban.jpg | Bin 0 -> 2169 bytes htdocs/images/sk_default_headlogo.jpg | Bin 0 -> 3534 bytes htdocs/images/sk_default_lesX.gif | Bin 0 -> 1920 bytes htdocs/images/sk_default_titre.gif | Bin 0 -> 1131 bytes htdocs/index.php | 6 + htdocs/javascript/getnow.js | 17 +++ include/auto.prepend.inc.php | 37 ++++++ include/menu.inc.php | 70 ++++++++++ include/xorg.common.inc.php | 31 +++++ include/xorg.globals.inc.php | 15 +++ include/xorg.page.inc.php | 154 ++++++++++++++++++++++ include/xorg.session.inc.php | 234 +++++++++++++++++++++++++++++++++ plugins/block.min_auth.php | 20 +++ plugins/block.min_perms.php | 20 +++ plugins/insert.getNbIns.php | 19 +++ plugins/insert.mkStats.php | 51 +++++++ templates/index.head.tpl | 17 +++ templates/index.tpl | 32 +++++ templates/skin/common.bandeau.head.tpl | 22 ++++ templates/skin/common.bandeau.tpl | 13 ++ templates/skin/common.footer.tpl | 17 +++ templates/skin/common.header.tpl | 23 ++++ templates/skin/default.tpl | 71 ++++++++++ 27 files changed, 997 insertions(+) create mode 100644 .cvsignore create mode 100644 .htaccess create mode 100644 htdocs/css/default.css create mode 100644 htdocs/images/favicon.png create mode 100644 htdocs/images/sk_default_ban.jpg create mode 100644 htdocs/images/sk_default_headlogo.jpg create mode 100644 htdocs/images/sk_default_lesX.gif create mode 100644 htdocs/images/sk_default_titre.gif create mode 100644 htdocs/index.php create mode 100644 htdocs/javascript/getnow.js create mode 100644 include/auto.prepend.inc.php create mode 100644 include/menu.inc.php create mode 100644 include/xorg.common.inc.php create mode 100644 include/xorg.globals.inc.php create mode 100644 include/xorg.page.inc.php create mode 100644 include/xorg.session.inc.php create mode 100644 plugins/block.min_auth.php create mode 100644 plugins/block.min_perms.php create mode 100644 plugins/insert.getNbIns.php create mode 100644 plugins/insert.mkStats.php create mode 100644 templates/index.head.tpl create mode 100644 templates/index.tpl create mode 100644 templates/skin/common.bandeau.head.tpl create mode 100644 templates/skin/common.bandeau.tpl create mode 100644 templates/skin/common.footer.tpl create mode 100644 templates/skin/common.header.tpl create mode 100644 templates/skin/default.tpl diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..0c6726a --- /dev/null +++ b/.cvsignore @@ -0,0 +1,2 @@ +cache/ +templates_c/ diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..85c38b2 --- /dev/null +++ b/.htaccess @@ -0,0 +1,2 @@ +php_value auto_prepend_file "include/auto.prepend.inc.php" +php_value include_path ".:..:./include:../include/:/home/x2000habouzit/dev/diogenes/lib/" diff --git a/htdocs/css/default.css b/htdocs/css/default.css new file mode 100644 index 0000000..b992a4a --- /dev/null +++ b/htdocs/css/default.css @@ -0,0 +1,124 @@ +/** DEFAULTS **/ + +body { + background-color: #ffffff; + font-family: "Arial", sans-serif; + color: #000000; +} + +a:link, a:visited, a:active, a:hover { + background-color: inherit; + color: #003399; +} + +a img { border: 0px; } + +td { vertical-align: top; } + +p.normal { + margin-bottom: 0.5em; + text-align: justify; +} + +p.erreur, span.erreur { + font-weight: bold; + background-color: inherit; + color: #ff0000; +} + +div.rubrique { + color: #555555; + background: url('/images/sk_default_titre.gif'); + background-repeat: no-repeat; + + text-indent: 0.2em; + text-align: left; + font-family: "helvetica", sans-serif; + font-weight: bolder; + font-size: 120%; + + margin-top: 1em; + margin-bottom: 1em; + padding-left: 0.5em; +} + +div.ssrubrique { + padding-top: 0.5em; + font-weight: bold; +} + + +/************** + LAYOUTS +***************/ + + #suid { + color: white; + background: red; + width: 100%; + } + + #body { + width: 740px; + margin-left: auto; + margin-right: auto; + } + + #body-left { + width: 140px; + border-right: 1px solid gray; + text-align: center; + font-family: "MS Sans Serif", sans-serif; + } + + #body-top { + border-bottom: 1px solid gray; + text-align: center; + font-size: 75%; + font-weight: bold; + padding: 4px; + padding-bottom: 16px; + font-family: "MS Sans Serif", sans-serif; + } + + #body-top table { width: 100%; padding: 4px; } + #body-top .date-heure { text-align: left; } + #body-top .inscrits { text-align: right; } + + #body-bottom { + border-top: 1px solid gray; + text-align: center; + padding: 4px; + font-size: 75%; + font-family: "MS Sans Serif", sans-serif; + } + + #menu { + width: 100%; + margin-top: 16px; + + font-size: 75%; + font-weight: bold; + } + + #menu .menu_item { + padding-left: 4px; + padding: 2px; + text-align: left; + } + + #menu .menu_title { + color: gray; + background: #eeeeee; + border-top: 1px solid gray; + border-bottom: 1px solid gray; + padding: 1px; + margin-top: 4px; + text-align: center; + } + + #content { + width: 600px; + padding: 4px 10px 4px 10px; + font-size: 95%; + } diff --git a/htdocs/images/favicon.png b/htdocs/images/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..0e4b1d1c6fcb88c7ef089c0ec72f60cc73c18a8b GIT binary patch literal 836 zcmV-K1H1f*P)Ra6wt zBokZ$SN<|7CF3lr$FxX9izKwDKJZ;5X8Y`U^P8UD%$_?>#57f*^zS;N>m$sL)bz0_ zW1P|9SZ7Z+HLKqBbB^RK*tlcAW%yfHLq*0i?;jz~5~FOc?cSAD#TRStJX^ec#kMWG zt)oqQJO%G+-!}NG5%KE#NM(7s0svA9!RXAaDVO$aJbiRuBHVWDz`@Bjvs1y+2M?r_ z=dPD7%v;~y5z<+l0)UXhpqN}~t``q)4@g-(2q%)jtwIz)1Mv62k*%J4U&Q@;WkL#) zmE+-Dnv<*)V-ggcwz{{Y|6^eI{I!a@maub_BX@$~?uY(YwT;10yUD0f0Ej2VIJ>>_ z#-;qiy`8?tr*^K*o-ynFhj#%EnG~;-)injftzSBllkHUM3MDFI=yE!O^{=htGvdzd zHYwMw&9mE`nG}6r`@Ru-m9KuR!)E1OMm9u8D(uYJ%@%+&-97E$-tbU=5=;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mF)gWA;H&yjOoa5BMsmag5+DGl< zBqIyDIF5?Gb%S*m*UOi<<=*dPs}R*4xpJ-_ty#k(vZ2M2G4tgWPO`)HyYl>X-rj55 zhORxu)RSbJ=F7fOi1Kj=_M|!;UstubvFMl2&BF&uX#UNLf?7Ig);vgcmagt~zSzCR z(@D9Ky_H^lZPv=FGSd3T8UHFq+jAx%4wDgSNiOI$PcNnq)2UvxDSp73!_ zZ>xRg^NW1i!zdKltJ&#TnGEHe8(D`{=EAX9cN3D%Yi*dNQjLB{jSlv@Hi-v-D#g2Q t58W35azS=Vjp}RUJ%}GrEz>k+X@*oOcd6{s!_pk`n7SVLEFd9z{SOIY(Q*I) literal 0 HcmV?d00001 diff --git a/htdocs/images/sk_default_headlogo.jpg b/htdocs/images/sk_default_headlogo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..35a296e59cb825a2899758d20208634598b0fe53 GIT binary patch literal 3534 zcmb7`c|26z8^G@@#?A~8#x@wcm$4M`l6{GHjJ-r;i3-`b>_(^*25+KfOj!maQnr$v zQm-ZZ-Y8_t5{cqBdY68`-ygrv=l7iZdG5XEocnyf_c_mVo^vpAFayBNj7*IH5C{aA z&>L_t4(J0=2wlL38VZFnz*t}~1_l@#6Eha3Gwpr^Bo!i(LaSTz*u20Rz5g8obUgZgBAe61h@m<5Re!EMt~p)&_Nr3 z1OPDPkoKoAKw*p^FoZtH4>}zDIYNJ8070POgE4@O-VcUD-~a%sB|7W>~IUB%aDxQAQ6zK6TuHcFO%EoAU`*KtuuU#&`fxt+KW zK9_Xo4`uv@pKgp@p`&OfiM}w^F7+f)= z7UAo()>B5p4t$tjKgL;+5)p{=$>7BvU!l(%Jk~*cV>F4i8r2$f^FVx?#y&0C!ywd3 zha%sXZ_Vwh3jHwFVYyuWJY1&z*-~ztADHOaRLr|3%kZKX(|g;&-{%u>`>!AWbW(@z z3u*eV!axuP0L1XOL+DO|G9X|_c;Q^!Dr!8UD6|rW?iwb#H$e>G+8mjN^3Q#ZxyRo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j7XHf&-1V0X;j8C+7ULWQ?2IgiT@xcHZwr^KlDQ=ZJxIZVa=2Gd9L^ShaHV)CjB1TnYFnfPP2S93 zk$cjI+(dK^PDQDRrFkouO{Nz>#)TLix~`z9hAVEBPN_F2rv$6^xY$zk@~0|__eokQ z@ip>isJ+52gfdo(+izXgr*K3rJvR*dc)PmtoGPW&aX*P)pow5<@`6U8Jd$sbZf3p< z>m5Vtd-<@Fs*ff0j-cdq=!^a1qyil7q;Pre{I>nYLEIx+!&4dI)e7G4GHy#m37}hZ zo=vG$SVU{HM=OCINhkyW27~Ao;pf?h9!VJ2%6DtJxO64bKh*%PYx*@Zw`|z6LBOHr z{C#-`ow`*GX|!|*|0_Mep`0K|y{734bux$87F$#!og{ojN+3Yhfkx8Y?9h_ou99^7RUrKt~=YVT0}RWE{fPTVUP zNmRaiE3Pji+4gqfoS9cB^2{6F)_ZW8fV*E|NjQr=$8xB|H@j97g+vtUW*l6o>j2<- z*&n8fWi*}nsKxnsCdQb~Bmt)v%m45d2%t0Ry5iveq&3mFbfxBh@(u3EKwwpsK2y=~ zH7|ur!X&=>vy8toU*S=@Q1LE4Ls?Ps!gqVQLiRduh36=Nldspbo4+-q9r&t&vl!lS!E1*j=dI=w%Enk@rBJ^MqX)9Un zmWxo8*oBv8%^4hmYaem2Vc76=?9(lwB1}qf-{{bBeVp&ds(}~auAD@=}Bk7`ayOR#a|vVzATDN!x)4D^ET0cX{{`+#2S)$^ literal 0 HcmV?d00001 diff --git a/htdocs/images/sk_default_lesX.gif b/htdocs/images/sk_default_lesX.gif new file mode 100644 index 0000000000000000000000000000000000000000..bdb52859a57e4689697112fe49e1c88a93ca6b2e GIT binary patch literal 1920 zcmeIxjXTo`0KoB|ZO!(}%Z3TzW|mbXI?8scjS17sq|RJj+Kn|yLS5wIH_fs|MxIII z+2%E&Ru`SFWz(}oQ>ol2_XtJadO?p##ohfG_dI?7gwOMQL&LWPkl7CaB47dl4u_MN zn3$H9mYJC;5D4<~^Gixf%FD}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zzdV70&e0+R;eSLm@et&;|fPjF3fq{a8f`fyD zgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@l$4Z} zm6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*!rKP5( zrl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dkwzs#p zxVX5vxw*Q!y1To(yu7@dCU$jHda z$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1lt)=I7_<=;-L_>FMg~>g((4 z?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF){QUg= z{r&#_{{R2~EC2ui0K5Vt000R70RIUbNU)&6g9sBUT*$DY!-o(fN}NcsqQ#3CGiuz( zv7^V2AVZ2ANwTELlPFWFT*VC9O9srf@wv&EGi%=LHL7LKphJru-IM5N z(x_9bUM06S-RL6iUh literal 0 HcmV?d00001 diff --git a/htdocs/index.php b/htdocs/index.php new file mode 100644 index 0000000..def3da0 --- /dev/null +++ b/htdocs/index.php @@ -0,0 +1,6 @@ +display(); +?> diff --git a/htdocs/javascript/getnow.js b/htdocs/javascript/getnow.js new file mode 100644 index 0000000..b7a50b8 --- /dev/null +++ b/htdocs/javascript/getnow.js @@ -0,0 +1,17 @@ +function getNow() { + dt=new Date(); + dy=dt.getDay(); + mh=dt.getMonth(); + wd=dt.getDate(); + yr=dt.getYear(); + if (yr<1000) yr += 1900; + hr=dt.getHours(); + mi=dt.getMinutes(); + if (mi<10) + time=hr+":0"+mi; + else + time=hr+":"+mi; + days=new Array ("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"); + months=new Array ("janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"); + return days[dy]+" "+wd+" "+months[mh]+" "+yr+"
"+time; +} diff --git a/include/auto.prepend.inc.php b/include/auto.prepend.inc.php new file mode 100644 index 0000000..92047b4 --- /dev/null +++ b/include/auto.prepend.inc.php @@ -0,0 +1,37 @@ +assign('xorg_head', $tpl_head); + $page->assign('xorg_tpl', $tpl_name); +} + +function new_skinned_page($tpl_name, $min_auth, $tpl_head="") { + _new_page(SKINNED, $tpl_name, $tpl_head, $min_auth); +} + +function new_popup_page($tpl_name, $min_auth, $tpl_head="") { + _new_page(SKINNED, $tpl_name, $tpl_head, $min_auth); +} + +function new_admin_page($tpl_name, $tpl_head="") { + require("xorg.page.inc.php"); + _new_page(SKINNED, $tpl_name, $tpl_head, AUTH_MDP, true); +} + +?> diff --git a/include/menu.inc.php b/include/menu.inc.php new file mode 100644 index 0000000..2dbb66f --- /dev/null +++ b/include/menu.inc.php @@ -0,0 +1,70 @@ + Array( 'Page d\'accueil' => '###url###' ), + 'Personnaliser' => Array( + 'Mes emails' => '###url###' , + 'Mon profil' => '###url###' , + 'Mes contacts' => '###url###' , + 'Mon mot de passe' => '###url###' , + 'Mes préférences' => '###url###' + ), + 'Services' => Array ( + 'Envoyer un mail' => '###url###' , + 'Forums & PA' => '###url###' , + 'Listes de diffusion' => '###url###' , + 'Micropaiements' => '###url###' , + 'Patte cassée' => '###url###' , + 'Sondages' => '###url###' + ), + 'Communauté X' => Array ( + 'Annuaire' => '###url###', + 'Trombi promo' => '###url###', + 'Groupes X' => '###url###', + 'Sites Polytechniciens' => '###url###' + ), + 'Informations' => Array ( + 'Lettres mensuelles' => '###url###', + 'Documentation' => '###url###', + 'Nous contacter' => '###url###', + 'Emploi' => '###url###' + ) + ); + + if(identified()) { + $array = array_merge( Array('Déconnexion' => '###url###'), $menu[0] ); + } + + if(has_perms()) { + $menu['***'] = Array ( + 'Marketing' => '###url###', + 'Administration' => '###url###', + 'Trackers' => '###url###', + 'Documentations' => '###url###' + ); + } elseif(has_perms($marketing_admin)) { + $menu['***'] = Array ( + 'Marketing' => '###url###' + ); + } +} else { + $menu = Array( + 'Polytechniciens' => Array( + 'Me connecter !' => "###url###", + 'M\'inscrire' => "###url###" + ), + 'Visiteurs' => Array( + 'Annuaire de l\'X' => "###url###", + 'Associations X' => "###url###", + 'Recrutement' => "###url###" + ), + 'Informations' => Array( + 'A propos du site' => "###url###", + 'Nous contacter ' => "###url###", + 'FAQ' => "###url###" + ) + ); +} +$this->assign_by_ref('menu', $menu); +?> diff --git a/include/xorg.common.inc.php b/include/xorg.common.inc.php new file mode 100644 index 0000000..07a9c74 --- /dev/null +++ b/include/xorg.common.inc.php @@ -0,0 +1,31 @@ +dbconnect(); +$conn = $globals->db->connect_id; +?> diff --git a/include/xorg.globals.inc.php b/include/xorg.globals.inc.php new file mode 100644 index 0000000..c0884c3 --- /dev/null +++ b/include/xorg.globals.inc.php @@ -0,0 +1,15 @@ + diff --git a/include/xorg.page.inc.php b/include/xorg.page.inc.php new file mode 100644 index 0000000..35064b6 --- /dev/null +++ b/include/xorg.page.inc.php @@ -0,0 +1,154 @@ +_page_type = SKINNED; + $this->_tpl = $tpl; + + $this->DiogenesCorePage(); + + // if necessary, construct new session + if (!session_is_registered('session')) { + session_register('session'); + $_SESSION['session'] = new XorgSession; + } + + $this->assign('site_dev',$site_dev); + + // si necessaire, c'est *ici* que se fait l'authentification + $_no_legacy = true; + $this->doAuth(); + $this->set_skin(); + } + + function display() { + if($this->_page_type == POPUP) + parent::display('skin/'.$_SESSION['skin_popup'], $this->make_id()); + else + parent::display('skin/'.$_SESSION['skin'], $this->make_id()); + } + + function make_id() { + $auth = (empty($_SESSION['auth']) ? 0 : $_SESSION['auth']); + $perms = (empty($_SESSION['perms']) ? 0 : $_SESSION['perms']); + return $this->_tpl."|$auth|$perms"; + } + + function doAuth() { } + + function set_skin() { + if(logged()) { + $result = mysql_query("SELECT skin FROM auth_user_md5 WHERE username = '{$_SESSION['uid']}'"); + if(list($skin) = mysql_fetch_row($result)) { + $sql = "SELECT normal,popup FROM skins WHERE "; + if ($_SESSION['skin'] == SKIN_STOCHASKIN_ID) { + $sql .= " !FIND_IN_SET('cachee',type) order by rand() limit 1"; + } else { + $sql .= "id='$skin'"; + } + $res = mysql_query($sql); + list($_SESSION['skin'], $_SESSION['skin_popup']) = mysql_fetch_row($res); + mysql_free_result($res); + } else { + $_SESSION['skin'] = SKIN_COMPATIBLE; + $_SESSION['skin_popup'] = SKIN_COMPATIBLE; + } + mysql_free_result($result); + } + + if( !logged() || !isset($_SERVER['HTTP_USER_AGENT']) + || ereg("Mozilla/4\.[0-9]{1,2} \[",$_SERVER['HTTP_USER_AGENT']) ) + { + $_SESSION['skin'] = SKIN_COMPATIBLE; + $_SESSION['skin_popup'] = SKIN_COMPATIBLE; + } + } + +} + + +/** Une classe pour les pages nécessitant l'authentification. + * (equivalent de controlauthentification.inc.php) + */ +class XorgAuth extends XorgPage +{ + function XorgAuth($tpl, $type=SKINNED) + { + $this->XorgPage($tpl, $type); + } + + function doAuth() + { + $_SESSION['session']->doAuth($this); + } +} + + +/** Une classe pour les pages nécessitant l'authentification permanente. + * (equivalent de controlpermanent.inc.php) + */ +class XorgCookie extends XorgPage +{ + function XorgCookie($tpl, $type=SKINNED) + { + $this->XorgPage($tpl, $type); + } + + function doAuth() + { + $_SESSION['session']->doAuthCookie($this); + } +} + + +/** Une classe pour les pages réservées aux admins (authentifiés!). + */ +class XorgAdmin extends XorgAuth +{ + function XorgAdmin($tpl, $type=SKINNED) + { + $this->XorgAuth($tpl, $type); + check_perms(); + } +} + + +/** ajoute le nb de ../ qvb + * Cette fonction recherche login.php dans les chemins donnés par INCLUDE_PATH + * et renvoie l'url avec le nombre de .. qvb + * @param $param URL relative (à la page web) + * @return URL absolue (au site web) + * @see getphoto.php + * @see ax/PasswordPromptScreen.inc + * @see include/footer.inc.php + * @see include/form_data_maj.inc.php + * @see include/header1.inc.php + * @see include/header2.inc.php + * @see include/header_all.inc.php + * @see include/header_logged.inc.php + * @see include/passwordpromptscreen.inc.php + * @see include/passwordpromptscreenlogged.inc.php + * @see listes/index.php + * @see mescontacts.php + */ +function xorg_func_url($params) +{ + extract($params); + + if (empty($rel)) + return; + + $chemins = Array('.', '..', '/'); + foreach ($chemins as $ch) { + if (file_exists("$ch/login.php") || file_exists("$ch/public/login.php")) + return "$ch/$rel"; + } + return ""; +} +?> diff --git a/include/xorg.session.inc.php b/include/xorg.session.inc.php new file mode 100644 index 0000000..075153e --- /dev/null +++ b/include/xorg.session.inc.php @@ -0,0 +1,234 @@ +DiogenesCoreSession(); + $_SESSION['challenge']=rand_token(); + } + + + /** Try to do an authentication. + * + * @param page the calling page (by reference) + */ + function doAuth(&$page) { + if(identified()) { // ok, c'est bon, on n'a rien à faire + return; + } + + if (isset($_REQUEST['username']) and isset($_REQUEST['response']) + and isset($_SESSION['challenge'])) + { + // si on vient de recevoir une identification par passwordpromptscreen.tpl + // ou passwordpromptscreenlogged.tpl + $res = @mysql_query( "SELECT username,user_id,password FROM auth_user_md5 WHERE username='{$_REQUEST['username']}'"); + if(@mysql_num_rows($res) != 0) { + list($username,$uid,$password)=mysql_fetch_row($res); + mysql_free_result($res); + $expected_response=md5("{$_REQUEST['username']}:$password:{$_SESSION['challenge']}"); + if($_REQUEST['response'] == $expected_response) { + unset($_SESSION['challenge']); + // on logge la réussite pour les gens avec cookie + if(isset($_SESSION['log'])) + $_SESSION['log']->log("auth_ok"); + start_connexion($username, $uid, true); + return true; + } else { + // mot de passe incorrect pour le login existant + // on logge l'échec pour les gens avec cookie + if(isset($_SESSION['log'])) + $_SESSION['log']->log("auth_fail","bad password"); + $this->doLogin($page); + } + } else { + // login inexistant dans la base de donnees + // on logge l'échec pour les gens avec cookie + if(isset($_SESSION['log'])) + $_SESSION['log']->log("auth_fail","bad login"); + $this->doLogin($page); + } + } else { + // ni loggué ni tentative de login + $this->doLogin($page); + } + } + + + /** Try to do a cookie-based authentication. + * + * @param page the calling page (by reference) + */ + function doAuthCookie(&$page) { + // si on est deja connecté, c'est bon, rien à faire + if(logged()) + return; + + // on vient de recevoir une demande d'auth, on passe la main a doAuth + if (isset($_REQUEST['username']) and isset($_REQUEST['response'])) + return $this->doAuth($page); + + // sinon, on vérifie que les bons cookies existent + if(!isset($_COOKIE['ORGaccess']) or $_COOKIE['ORGaccess'] == '' + or !isset($_COOKIE['ORGlogin'])) + return $this->doAuth($page); + + + // les bons cookies existent, donc ça veut dire que la session a expirée + // il faut donc vérifier que les cookies sont bons et recréer la session + // et d'authoriser l'accès + $res = @mysql_query( "SELECT user_id,password FROM auth_user_md5 WHERE username='{$_COOKIE['ORGlogin']}'"); + if(@mysql_num_rows($res) != 0) { + list($uid,$password)=mysql_fetch_row($res); + mysql_free_result($res); + $expected_value=md5($password); + if($expected_value == $_COOKIE['ORGaccess']) { + //session_start(); + start_connexion($_COOKIE['ORGlogin'], $uid, false); + return true; + } else { + // ORGaccess n'est pas bon + // cette variable failed_ORGaccess permet à + // controlauthentication.inc.php de mettre + // passwordpromtscreen.inc.php plutôt que + // passwordpromtscreenlogged.inc.php dans le + // cas ou ORGaccess n'est pas bon, permettant à l'utilisateur + // de changer son login ci-nécessaire. + $failed_ORGaccess = true; + return $this->doAuth($page); + } + } else { + // ORGlogin n'est pas bon + return $this->doAuth($page); + } + } + + /** Display login screen. + */ + function doLogin(&$page) { + global $failed_ORGaccess,$site_dev; + + if(isset($_COOKIE['ORGaccess']) and isset($_COOKIE['ORGlogin']) and !isset($failed_ORGaccess)) { + $page->display("passwordpromptscreenlogged.tpl"); + } else { + if (isset($_COOKIE['ORGlogin'])) { + $pre = strtok($_COOKIE['ORGlogin'],"."); + $pre1=strtok($pre,"-"); + $pre2=strtok(" "); + $pre1=ucfirst($pre1); + $pre2=ucfirst($pre2); + if ($pre2) { + $prenom = $pre1."-".$pre2; + } else { + $prenom = $pre1; + } + $page->assign('prenom',$prenom); + } + $page->display("passwordpromptscreen.tpl"); + } + // $page->assign('challenge',$this->challenge); + exit; + } + +} + + +/** verifie si un utilisateur a les droits pour voir une page + ** si ce n'est pas le cas, on affiche une erreur + * @return void + * TODO RECODER + */ +function check_perms($auth_array=array()) { + if (!has_perms($auth_array)) { + $_SESSION['log']->log("noperms",$_SERVER['PHP_SELF']); + echo "
"; + echo "Tu n'as pas les permissions nécessaires pour accéder à cette page."; + echo "
"; + include("footer.inc.php"); + exit; + } +} + + +/** verifie si un utilisateur a les droits pour voir une page + ** soit parce qu'il est admin, soit il est dans une liste + ** supplementaire de personnes utilisées + * @return BOOL + */ + function has_perms($auth_array=array()) { + return logged() + && ( (!empty($auth_array) && in_array($_SESSION['username'], $auth_array)) + || ($_SESSION['perms']==PERMS_ADMIN) ); + } + + +/** renvoie true si la session existe et qu'on est loggué correctement + * false sinon + * @return bool vrai si loggué + * @see header2.inc.php + */ +function logged () { + return(isset($_SESSION['auth']) and $_SESSION['auth']>=AUTH_COOKIE); +} + + + +/** renvoie true si la session existe et qu'on est loggué correctement + * et qu'on a été identifié par un mot de passe depuis le début de la session + * false sinon + * @return bool vrai si loggué + * @see header2.inc.php + */ +function identified () { + return(isset($_SESSION['auth']) and $_SESSION['auth']>=AUTH_MDP); +} + + +/** place les variables de session dépendants de auth_user_md5 + * et met à jour les dates de dernière connexion si nécessaire + * @return void + * @see controlpermanent.inc.php controlauthentication.inc.php + */ +function start_connexion ($username, $uid, $identified) { + $result=mysql_query("SELECT prenom, nom, perms, promo, UNIX_TIMESTAMP(lastnewslogin), UNIX_TIMESTAMP(lastlogin), host, matricule FROM auth_user_md5 WHERE user_id=$uid;"); + list($prenom, $nom, $perms, $promo, $lastnewslogin, $lastlogin, $host, $matricule) = mysql_fetch_row($result); + mysql_free_result($result); + // on garde le logger si il existe (pour ne pas casser les sessions lors d'une + // authentification avec le cookie + // on vérifie que c'est bien un logger de l'utilisateur en question + if(isset($_SESSION['log']) && $_SESSION['log']->uid==$uid) + $logger = $_SESSION['log']; + // on vide la session pour effacer les valeurs précédentes (notamment de skin) + // qui peuvent être celles de quelqu'un d'autre ou celle par defaut + $_SESSION = array(); + if (!isset($_SESSION['suid'])) { + // mise à jour de la date de dernière connexion + // sauf lorsque l'on est en SUID + $newhost=strtolower(gethostbyaddr($_SERVER['REMOTE_ADDR'])); + mysql_query("UPDATE auth_user_md5 SET host='$newhost',lastlogin=NULL WHERE user_id=$uid;"); + $_SESSION['lastlogin'] = $lastlogin; + $_SESSION['host'] = $host; + } + // mise en place des variables de session + $_SESSION['auth'] = ($identified ? AUTH_MDP : AUTH_COOKIE); + $_SESSION['uid'] = $uid; + $_SESSION['username'] = $username; + $_SESSION['prenom'] = $prenom; + $_SESSION['nom'] = $nom; + $_SESSION['perms'] = $perms; + $_SESSION['promo'] = $promo; + $_SESSION['lastnewslogin'] = $lastnewslogin; + $res = mysql_query("SELECT flags FROM identification WHERE matricule = '$matricule' AND FIND_IN_SET(flags, 'femme')"); + $_SESSION['femme'] = mysql_num_rows($res) > 0; + mysql_free_result($res); + // on récupère le logger si il existe, sinon, on logge la connexion + $_SESSION['log'] = (isset($logger) ? $logger : new DiogenesCoreLogger($uid)); + if(empty($logger)) + $_SESSION['log']->log("connexion",$_SERVER['PHP_SELF']); + // le login est stocké pour un an + setcookie('ORGlogin',$username,(time()+25920000),'/','',0); +} + +?> diff --git a/plugins/block.min_auth.php b/plugins/block.min_auth.php new file mode 100644 index 0000000..f6b6691 --- /dev/null +++ b/plugins/block.min_auth.php @@ -0,0 +1,20 @@ + diff --git a/plugins/block.min_perms.php b/plugins/block.min_perms.php new file mode 100644 index 0000000..56244eb --- /dev/null +++ b/plugins/block.min_perms.php @@ -0,0 +1,20 @@ + diff --git a/plugins/insert.getNbIns.php b/plugins/insert.getNbIns.php new file mode 100644 index 0000000..92782de --- /dev/null +++ b/plugins/insert.getNbIns.php @@ -0,0 +1,19 @@ + diff --git a/plugins/insert.mkStats.php b/plugins/insert.mkStats.php new file mode 100644 index 0000000..1251127 --- /dev/null +++ b/plugins/insert.mkStats.php @@ -0,0 +1,51 @@ + + + Valid + Bugs + Todo + + + $stats_req + + + {$nbtrk[0]} / {$nbtrk[1]} + + + + + {$nbtrk[2]} / {$nbtrk[3]} + + + + +EOF; +} +?> diff --git a/templates/index.head.tpl b/templates/index.head.tpl new file mode 100644 index 0000000..d615690 --- /dev/null +++ b/templates/index.head.tpl @@ -0,0 +1,17 @@ +{* index.head.tpl *} +{literal} + +{/literal} +{* vim:set et sw=2 sts=2 sws=2: *} +{* $Id: index.head.tpl,v 1.1 2004-01-25 17:19:21 x2000habouzit Exp $ *} diff --git a/templates/index.tpl b/templates/index.tpl new file mode 100644 index 0000000..aef1870 --- /dev/null +++ b/templates/index.tpl @@ -0,0 +1,32 @@ +{* index.tpl *} +
+ Bienvenue sur le portail des élèves et anciens élèves de l'X ! +
+ +

+ Polytechnique.org est le site qui connecte la communauté des polytechniciens. + Il comporte une partie publique, et une partie privée réservée aux + polytechniciens. +

+
+Si vous êtes un recruteur ou une entreprise, +
    +
  • vous avez la possibilité de proposer une offre d'emploi accessible à tous les X directement en ligne, depuis la partie privée du site.
  • +
+ Si vous êtes polytechnicien, + + Dans tous les cas, vous pouvez : + + +

+ Bonne visite ! +
L'équipe Polytechnique.org +

+{* vim:set et sw=2 sts=2 sws=2: *} +{* $Id: index.tpl,v 1.1 2004-01-25 17:19:21 x2000habouzit Exp $ *} diff --git a/templates/skin/common.bandeau.head.tpl b/templates/skin/common.bandeau.head.tpl new file mode 100644 index 0000000..7dc4295 --- /dev/null +++ b/templates/skin/common.bandeau.head.tpl @@ -0,0 +1,22 @@ +{* Bandeau fédérateur : style *} +{literal} + + + + +{/literal} +{* vim:set et sw=2 sts=2 sws=2: *} +{* $Id: common.bandeau.head.tpl,v 1.1 2004-01-25 17:19:21 x2000habouzit Exp $ *} diff --git a/templates/skin/common.bandeau.tpl b/templates/skin/common.bandeau.tpl new file mode 100644 index 0000000..889bb02 --- /dev/null +++ b/templates/skin/common.bandeau.tpl @@ -0,0 +1,13 @@ +{* Bandeau : body *} + + + +
+ +
  L'École · Institutional site  ~~  FX · AX  ~~  Polytechnique.org · Élèves
+ +
+ + +{* vim:set et sw=2 sts=2 sws=2: *} +{* $Id: common.bandeau.tpl,v 1.1 2004-01-25 17:19:21 x2000habouzit Exp $ *} diff --git a/templates/skin/common.footer.tpl b/templates/skin/common.footer.tpl new file mode 100644 index 0000000..0b00350 --- /dev/null +++ b/templates/skin/common.footer.tpl @@ -0,0 +1,17 @@ +{* foot par defaut *} +

+ Copyright © 1999-2003 Association Polytechnique.org +  -  + A propos de ce site +
+ Sécurité et confidentialité + | Services et Ethique + | Charte +{min_auth level=cookie} + | Disponibilité + | Statistiques +{/min_auth} +

+ +{* vim:set et sw=2 sts=2 sws=2: *} +{* $Id: common.footer.tpl,v 1.1 2004-01-25 17:19:21 x2000habouzit Exp $ *} diff --git a/templates/skin/common.header.tpl b/templates/skin/common.header.tpl new file mode 100644 index 0000000..75f2615 --- /dev/null +++ b/templates/skin/common.header.tpl @@ -0,0 +1,23 @@ +{* head par defaut *} + + + + + + + + + + + + + + + + + + Anciens eleves Polytechnique, annuaire email, Alumni + + +{* vim:set et sw=2 sts=2 sws=2: *} +{* $Id: common.header.tpl,v 1.1 2004-01-25 17:19:21 x2000habouzit Exp $ *} diff --git a/templates/skin/default.tpl b/templates/skin/default.tpl new file mode 100644 index 0000000..0b2643b --- /dev/null +++ b/templates/skin/default.tpl @@ -0,0 +1,71 @@ +{* Skin par défaut *} + + + + +{include file=skin/common.header.tpl} + +{if $xorg_head}{include file=$xorg_head}{/if} +{include file=skin/common.bandeau.head.tpl} + + +{include file=skin/common.bandeau.tpl} + +{if $smarty.session.suid} + + + + + +
{$smarty.session.suid}exit
+{/if} + + + + + + + + + + + + +
+ [ LOGO ] + + [ Polytechnique.org ] + + + + + +
+ + {insert name="getNbIns"} polytechniciens sur le web
+ [LES X SUR LE WEB] +
+{include file=$xorg_tpl} +
+{include file=skin/common.footer.tpl} +
+ + + +{* vim:set et sw=2 sts=2 sws=2: *} +{* $Id: default.tpl,v 1.1 2004-01-25 17:19:21 x2000habouzit Exp $ *} -- 2.1.4