###############################################################################
# UB_Login.src                                                                #
###############################################################################
# UltraBoard 2000 by UltraScripts.com, Inc.                                   #
# Scripts written by Jacky Wing Wa Yung, WebMaster@UltraScripts.com           #
# Available from http://www.UltraBoard.org/                                   #
# =========================================================================== #
# COPYRIGHT NOTICE :                                                          #
#                                                                             #
# Copyright (c) 1999-2000 UltraScripts.com, Inc. All Rights Reserved.         #
#                                                                             #
# This program is being distributed as shareware. It may be used and modified #
# free for personal, government or non-profit. Any commercial use must be     #
# registered. However, modified versions cannot be sold or distributed. You   #
# cannot alter the copyright and "powered by" notices throughout the scripts. #
# These notices must be clearly visible to the end users.                     #
#                                                                             #
# WARRANTY DISCLAIMER:                                                        #
#                                                                             #
# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT #
# ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR       #
# FITNESS FOR A PARTICULAR PURPOSE.                                           #
###############################################################################

package Source;

sub Login {
  my ($ERROR) = @_;

  &Standard::Require("UB_Login.src", "$UB::INTERFACES_PATH/$SYSTEM::DEFAULT_THEME/UB_Login.src");

  my %FORM = (
    &Standard::ExtraVariables()
  );

  if ( ( $UB::QUERY{'refer'} ) && ( $UB::QUERY{'refer'} ne "" ) ) {
    $FORM{'FORM.ACTION'}  = $UB::QUERY{'refer'};
    $FORM{'FORM.ACTION'} =~ s/^Do//ig;
    $FORM{'MESSAGE'}      = $Login::DYNAMIC{"LANGUAGE.ACTION.".$FORM{'FORM.ACTION'}};
  } else {
    $FORM{'FORM.ACTION'} = "";
  }

  $FORM{"FORM.REF"}       = $UB::QUERY{'refer'};
  $FORM{"FORM.BID"}       = $UB::QUERY{'BID'};
  $FORM{"FORM.CID"}       = $UB::QUERY{'CID'};
  $FORM{"FORM.PID"}       = $UB::QUERY{'PID'};
  $FORM{"FORM.TID"}       = $UB::QUERY{'TID'};
  $FORM{"FORM.DAY_PRUNE"} = $UB::QUERY{'DayPrune'};
  $FORM{"FORM.PAGE"}      = $UB::QUERY{'P'};

  $FORM{'FORM.CHECKBOX.REMEMBER_PASSWORD'} = &HTML::Checkbox (
    NAME    => "FORM_REMEMBER_PASSWORD",
    VALUE   => "1"                     ,
    CHECKED => $UB::QUERY{'FORM_REMEMBER_PASSWORD'} || ""
  );

  $FORM{'ERROR.MESSAGE'}    = ($Login::DYNAMIC{"LANGUAGE.".$ERROR}) ? $Login::DYNAMIC{"LANGUAGE.".$ERROR} : $ERROR;

  &Standard::PrintHTMLHeader();
  print &Login::Parse(\%FORM);
}

###############################################################################
1; # end of UB_Login.src file
###############################################################################