add jquery script, use it to autoload on xnet when xorg cookie is present
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 21 Mar 2007 22:28:36 +0000 (22:28 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 21 Mar 2007 22:28:36 +0000 (22:28 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1597 839d8a87-29fc-0310-9880-83ba4fa771e5

Makefile
include/platal.inc.php
modules/xnet.php
templates/xnet/skin.tpl

index 230f576..4004963 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ VCS_FILTER = ! -name .arch-ids ! -name CVS
 
 all: build
 
-build: core banana wiki
+build: core banana wiki jquery
 
 q:
        @echo -e "Code statistics\n"
@@ -102,6 +102,14 @@ htdocs/images/banana:
 htdocs/css/banana.css:
        cd $(@D) && ln -sf /usr/share/banana/css/style.css $(@F)
 
+##
+## jquery
+##
+
+jquery: htdocs/javascript/jquery.js
+htdocs/javascript/jquery.js:
+       wget http://jquery.com/src/jquery-latest.pack.js -O htdocs/javascript/jquery.js -q
+
 ################################################################################
 
 .PHONY: build dist clean wiki build-wiki banana
index 8b0b211..2d49ff7 100644 (file)
@@ -40,7 +40,7 @@ function __autoload($cls)
 {
     $cls  = strtolower($cls);
     $path = dirname(dirname(__FILE__));
-    if (!@include "$path/classes/$cls.php") {
+    if (!include "$path/classes/$cls.php") {
         if (substr($cls, -1, 3) == 'req') {
             @include 'validations.inc.php';
             return;
index 66972df..1f30778 100644 (file)
@@ -200,8 +200,11 @@ class XnetModule extends PLModule
     
     function handler_autologin(&$page)
     {
+        $allkeys = func_get_args();
+        unset($allkeys[0]);
+        $url = join('/',$allkeys);
         header("Content-type: text/javascript; charset=utf-8");
-        echo '$.ajax({ url: "index?forceXml=1", dataType: "xml", success: function(xml) { $("body").empty(); $("body",xml).prependTo("body"); }});';
+        echo '$.ajax({ url: "'.$url.'?forceXml=1", dataType: "xml", success: function(xml) { $("body",xml).insertBefore("body"); $("body:eq(1)").remove(); }});';
         exit;
     }
 }
index 1babec4..e082b2d 100644 (file)
             <td id="perso">
               {list_all_my_groups}
               {if !$smarty.session.auth}
-              <div>Me connecter :</div>
-              <a class='gp' href="login/{if $platal->pl_self() eq 'exit'}index{else}{$platal->pl_self()}{/if}">polytechnicien</a>
+                <div>Me connecter :</div>
+                <a class='gp' href="login/{if $platal->pl_self() eq 'exit'}index{else}{$platal->pl_self()}{/if}">polytechnicien</a>
+                {if $platal->pl_self() neq 'exit'}
+                  <script type="text/javascript" src="javascript/jquery.js"></script>
+                  <script type="text/javascript" src="login/autologin/{$platal->pl_self()}?forceXml=1"></script>
+                {/if}
               {/if}
             </td>
             <td class="right" style="vertical-align: middle">