Statistics
| Branch: | Revision:

root / src / pithos / content / login / pithos-login.html @ 63:dea79565e317

History | View | Annotate | Download (1.4 kB)

1
<html>
2
<head>
3
        <title>Pithos Firefox Plug-in</title>
4
        <script type="text/javascript" src="chrome://pithos/content/moz.js"/>
5

6
        <!-- FireFox BUG !!!!!!!!!!!!!! -->
7
        <!-- If this is not present, then the script on BODY will not execute !!!!! -->
8
        <script type="text/javascript">
9
        </script>
10
</head>
11

    
12
<body>
13
        <script type="application/x-javascript">
14
        function hasNonEmptyCookie() {
15
    var cookie = moz.findCookieByHostAndName('.pithos.grnet.gr', '_gss_a')
16
    var exists = cookie != undefined
17
    var nonEmpty = exists && cookie.value != undefined && cookie.value != ''
18
//    alert('exists = ' + exists + ', nonEmpty = ' + nonEmpty)
19

20
    return nonEmpty
21
        }
22

23
        function checkAndReplace() {
24
                if( hasNonEmptyCookie() ) {
25
                        window.location.replace('chrome://pithos/content/pithos.xul');
26
                        return true;
27
                }
28

29
                return false;
30
        }
31

32
        // Just in case we are already logged-in and the user wants one more tab.
33
        // Then it is up to the network how fast we get to the directory listing.
34
        var allRight = checkAndReplace();
35

36
        if( !allRight ) {
37
                var attempts = 0;
38

39
                function update() {
40
                        if( !checkAndReplace() ) {
41
                                attempts++;
42
                                window.setTimeout('update();', 1000);
43
                                if (attempts % 30 == 0) {
44
                                        alert('Cannot open Pithos File Manager (' + attempts + ' seconds passed)');
45
                                }
46
                        }
47
                }
48
                
49
                window.setTimeout('update();', 1000);
50
        }
51

    
52
        </script>
53
        <iframe src="http://pithos.grnet.gr/pithos/login?next=http://pithos.grnet.gr/pithos/login" width="100%" height="100%" />
54
</body>
55
</html>