<?php
/*
    CREATIVE COMMONS - Attribution-No Derivative Works 3.0 Germany:
    - You may not alter, transform, or build upon this work.
    - Dieses Werk darf nicht bearbeitet oder in anderer Weise verändert werden.
*/
  if (loggedIn())
  {
    zeigeAbmeldeFormular();
    updateUserActivity();
  }
  else
  {
    zeigeAnmeldeFormular();
  }
  
  function zeigeAnmeldeFormular ()
  {
    global $L_UserName;
    global $L_UserPassword;
    global $L_Button27;
    global $CharsUserName;
    global $CharsSetupUserCurrentPassword;
    
    if (isset($_REQUEST['UserName'])) $UserName = $_REQUEST['UserName'];
      else $UserName='';
    if (isset($_REQUEST['UserPassword'])) $UserPassword = $_REQUEST['UserPassword'];
      else $UserPassword='';

    echo '
      <form method="post" action="index.php" accept-charset="UTF-8" id="loginXXX">
        <table>
          <tr>
            <td><label for="username">'.$L_UserName.':</label></td>
            <td><input autofocus class="FeldUserName" type="text" id="username" name="username" maxlength="'.$CharsUserName.'" value="'.$UserName.'" /></td>
          </tr>
          <tr>
            <td><label for="password">'.$L_UserPassword.':</label></td>
            <td><input class="FeldUserPassword" type="password" id="password" name="userpass" maxlength="'.$CharsSetupUserCurrentPassword.'" value="'.$UserPassword.'" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><input name="login" type="submit" value="'.$L_Button27.'" class="button" /></td>
          </tr>
        </table>
      </form>
    ';
  }
  function zeigeAbmeldeFormular ()
  {
    global $L_012;
    global $L_020;

    echo '
      <b>'.$L_020.' '.getCurrentUser().'!</b>
      <form method="post" action="index.php" accept-charset="UTF-8">
        <fieldset>        
          <input name="logout" type="submit" value="'.$L_012.'" class="button" />
        </fieldset>
      </form>
    ';
  }
?>