]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/smaller/templates/signin.tmpl
make clear if only signed in or also authenticated.
[SourceForge/phpwiki.git] / themes / smaller / templates / signin.tmpl
1 <?php // -*-html-*-
2 rcs_id('$Id: signin.tmpl,v 1.2 2004-03-24 14:05:33 rurban Exp $');
3
4 if (empty($FORMNAME))
5     $FORMNAME = 'signin';
6 else
7     $NOFORM = true;
8 ?>
9 <?php if (empty($NOFORM)) { ?>
10   <form method="post" action="<?=$request->getURLtoSelf()?>" accept-charset="<?=CHARSET?>" name="<?=$FORMNAME?>">
11   <?= HiddenInputs($request->getArgs(), false, array('auth')) ?>
12 <?php } ?>
13 <?php 
14 if ($user->isAuthenticated()) {
15     $Sep = $Theme->getButtonSeparator();
16     $SignOutB = $Theme->makeButton(_("Sign Out"), "javascript:SignOut();", 'wikiaction');
17 ?>
18   <?= fmt("You are authenticated as %s", WikiLink($user->getId(), 'auto')) ?>
19   <?=$Sep?>
20   <script language="JavaScript" type="text/javascript"><!--
21     document.write('<input type="hidden" name="auth[logout]" value="0" />');
22     function SignOut() { 
23       document.forms["<?=$FORMNAME?>"].elements["auth[logout]"].value = 1;
24       document.forms["<?=$FORMNAME?>"].submit();
25     }
26     document.write('<?=$SignOutB?>'); // -->
27   </script>
28   <noscript>
29     <?= Button("submit:auth[logout]", _("Sign Out"), 'wikiaction') ?>
30   </noscript>
31 <?php } else { ?>
32     <?php
33     $SignInInput = HTML::input(array('type' => 'text',
34                                      'name' => "auth[userid]",
35                                      'id' => 'auth.userid',
36                                      'size' => 12,
37                                      'maxlength' => 256,
38                                      'onchange' => "SignIn(this.form,false);"));
39     $SignInInput->addTooltip(_("Enter your UserId to sign in"));
40     $userid = $user->getId();
41     if ($user->isSignedIn()) 
42       echo sprintf(_("You are signed but not authenticated as %s. "), 
43                    asXml(HTML::a(array(
44                                        'href'=>'#',
45                                        'title' => sprintf(_("Click to authenticate as %s"),$userid),
46                                        'onclick'=>'SignIn(document.signin,"'.$userid.'");'),
47                                  $userid)));
48 ?>
49
50   <script type="text/javascript"> <!--
51      function SignIn(form,userid) {
52       <?php if (defined('EDITING_POLICY') and EDITING_POLICY) { ?>
53       if (window.focus) {
54         window.open('<?= WikiUrl(EDITING_POLICY) ?>',<!-- url -->
55                     'PleaseReadThisFirst',<!-- window name -->
56                     'width=600,height=430,scrollbars=yes,resizable=yes,toolbar=yes');
57       }
58       <?php } ?>
59       if (userid) document.getElementById("auth.userid").value=userid;
60       form.submit();
61     }
62     //-->
63   </script>
64   <?= Button("submit:auth[login]", _("Sign in as:"), 'wikiaction')?>
65   <?= $SignInInput ?>
66   <noscript>
67     <?= Button("submit:auth[login]", _("Sign in as:"), 'wikiaction')?>
68   </noscript>
69
70 <?php } ?>
71
72 <?php if (empty($NOFORM)) { ?>
73   </form>
74 <?php } ?>