From: x2000habouzit Date: Sun, 2 Jul 2006 12:25:36 +0000 (+0000) Subject: always include md5/sha/secure_hash.js X-Git-Tag: xorg/0.9.10~21 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=56f0495ad630c97f8ca3f01ab0692339f2c87452;p=platal.git always include md5/sha/secure_hash.js remove very fragile and clumsy .js.php + .js.tpl files. now we need to fix pasword changes :/ git-svn-id: svn+ssh://murphy/home/svn/platal/branches/platal-0.9.10@353 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/templates/javascript/do_challenge_response.js.tpl b/htdocs/javascript/do_challenge_response.js similarity index 96% rename from templates/javascript/do_challenge_response.js.tpl rename to htdocs/javascript/do_challenge_response.js index b54b1ce..8120894 100644 --- a/templates/javascript/do_challenge_response.js.tpl +++ b/htdocs/javascript/do_challenge_response.js @@ -18,9 +18,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -document.write(''); - -{literal} function correctUserName() { var u = document.forms.login.username; // login with no space @@ -62,4 +59,3 @@ function doChallengeResponse() { document.forms.loginsub.submit(); } -{/literal} \ No newline at end of file diff --git a/htdocs/javascript/do_challenge_response.js.php b/htdocs/javascript/do_challenge_response.js.php deleted file mode 100644 index dacd54f..0000000 --- a/htdocs/javascript/do_challenge_response.js.php +++ /dev/null @@ -1,25 +0,0 @@ -run(); -?> diff --git a/templates/javascript/do_challenge_response_logged.js.tpl b/htdocs/javascript/do_challenge_response_logged.js similarity index 95% rename from templates/javascript/do_challenge_response_logged.js.tpl rename to htdocs/javascript/do_challenge_response_logged.js index 226d9ea..80277f0 100644 --- a/templates/javascript/do_challenge_response_logged.js.tpl +++ b/htdocs/javascript/do_challenge_response_logged.js @@ -18,9 +18,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -document.write(''); - -{literal} function readCookie(name) { var nameEQ = name + "="; @@ -49,4 +46,3 @@ function doChallengeResponse() { document.forms.login.password.value = ""; document.forms.loginsub.submit(); } -{/literal} \ No newline at end of file diff --git a/htdocs/javascript/do_challenge_response_logged.js.php b/htdocs/javascript/do_challenge_response_logged.js.php deleted file mode 100644 index 122bd95..0000000 --- a/htdocs/javascript/do_challenge_response_logged.js.php +++ /dev/null @@ -1,25 +0,0 @@ -run(); -?> diff --git a/templates/javascript/motdepasse.js.tpl b/htdocs/javascript/motdepasse.js similarity index 95% rename from templates/javascript/motdepasse.js.tpl rename to htdocs/javascript/motdepasse.js index a08e6c3..5e4c5c8 100644 --- a/templates/javascript/motdepasse.js.tpl +++ b/htdocs/javascript/motdepasse.js @@ -18,9 +18,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -document.write(''); - -{literal} function EnCryptedResponse() { pw1 = document.forms.changepass.nouveau.value; pw2 = document.forms.changepass.nouveau2.value; @@ -48,4 +45,3 @@ function EnCryptedResponse() { document.forms.changepass2.submit(); return true; } -{/literal} diff --git a/htdocs/javascript/motdepasse.js.php b/htdocs/javascript/motdepasse.js.php deleted file mode 100644 index 6a28c41..0000000 --- a/htdocs/javascript/motdepasse.js.php +++ /dev/null @@ -1,25 +0,0 @@ -run(); -?> diff --git a/templates/javascript/secure_hash.js.tpl b/htdocs/javascript/secure_hash.js similarity index 88% rename from templates/javascript/secure_hash.js.tpl rename to htdocs/javascript/secure_hash.js index 2ffbc55..19a913e 100644 --- a/templates/javascript/secure_hash.js.tpl +++ b/htdocs/javascript/secure_hash.js @@ -18,10 +18,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -document.write(''); -document.write(''); - -{literal} function hash_encrypt(a) { return hex_sha1(a); } @@ -52,4 +48,3 @@ function hash_xor(a, b) { c += a.charAt(k); return c; } -{/literal} diff --git a/htdocs/javascript/secure_hash.js.php b/htdocs/javascript/secure_hash.js.php deleted file mode 100644 index 8c46ce0..0000000 --- a/htdocs/javascript/secure_hash.js.php +++ /dev/null @@ -1,25 +0,0 @@ -run(); -?> diff --git a/htdocs/motdepasse.php b/htdocs/motdepasse.php index 48a2cdf..1f79fb8 100644 --- a/htdocs/motdepasse.php +++ b/htdocs/motdepasse.php @@ -25,7 +25,7 @@ if (Post::has('response2')) { require_once('secure_hash.inc.php'); if (hash_encrypt($_SESSION['password'].":".$_SESSION['session']->challenge) != Post::get('response')) { new_skinned_page('motdepasse.tpl', AUTH_MDP); - $page->addJsLink('javascript/motdepasse.js.php'); + $page->addJsLink('javascript/motdepasse.js'); $page->assign('xorg_title','Polytechnique.org - Mon mot de passe'); $page->trig('Ancien mot de passe erronné'); $page->run(); @@ -47,7 +47,7 @@ if (Post::has('response2')) { } new_skinned_page('motdepasse.tpl', AUTH_MDP); -$page->addJsLink('javascript/motdepasse.js.php'); +$page->addJsLink('javascript/motdepasse.js'); $page->assign('xorg_title','Polytechnique.org - Mon mot de passe'); $page->run(); ?> diff --git a/htdocs/tmpPWD.php b/htdocs/tmpPWD.php index 7841a1e..aa1b62b 100644 --- a/htdocs/tmpPWD.php +++ b/htdocs/tmpPWD.php @@ -38,7 +38,7 @@ if ($ligne = $res->fetchOneAssoc()) { $page->run(); } else { new_skinned_page('motdepasse.tpl', AUTH_PUBLIC); - $page->addJsLink('javascript/motdepasse.js.php'); + $page->addJsLink('javascript/motdepasse.js'); $page->run(); } } else { diff --git a/include/xnet/session.inc.php b/include/xnet/session.inc.php index c234e3f..ad2c4bf 100644 --- a/include/xnet/session.inc.php +++ b/include/xnet/session.inc.php @@ -136,7 +136,7 @@ class XnetSession extends DiogenesCoreSession function doLogin(&$page) { // login for non-x has been disabled, so don't need this js anymore - //$page->addJsLink('javascript/do_challenge_response.js.php'); + //$page->addJsLink('javascript/do_challenge_response.js'); $page->assign("xorg_tpl", "xnet/login.tpl"); $page->run(); } diff --git a/include/xorg/session.inc.php b/include/xorg/session.inc.php index 2ad7784..e435712 100644 --- a/include/xorg/session.inc.php +++ b/include/xorg/session.inc.php @@ -185,12 +185,12 @@ class XorgSession extends DiogenesCoreSession { if (logged() and !$new_name) { $page->changeTpl('password_prompt_logged.tpl'); - $page->addJsLink('javascript/do_challenge_response_logged.js.php'); + $page->addJsLink('javascript/do_challenge_response_logged.js'); $page->assign("xorg_tpl", "password_prompt_logged.tpl"); $page->run(); } else { $page->changeTpl('password_prompt.tpl'); - $page->addJsLink('javascript/do_challenge_response.js.php'); + $page->addJsLink('javascript/do_challenge_response.js'); $page->assign("xorg_tpl", "password_prompt.tpl"); global $globals; diff --git a/templates/skin/common.header.tpl b/templates/skin/common.header.tpl index 6c81f96..41b1f06 100644 --- a/templates/skin/common.header.tpl +++ b/templates/skin/common.header.tpl @@ -44,6 +44,9 @@ {/foreach} + + + {if $xorg_rss}