Location: PHPKode > projects > proManager > proman/www/index.php
<?php

  require "inc/init.php";
  require "inc/small_functions.php";

  $post_vars = array('username','password','language');
  include "import_vars_post.inc";

  // validate data

  $username = AddSlashes(StripSlashes($username));
  $username = AddSlashes(StripSlashes($username));
  $password = AddSlashes(StripSlashes($password));


  // if there is no user defined ask for a new root user
  if (!IsUsers()) Header ("Location: first_time.php");


  // verify user authenticity

  if ($user_id) {
    Header ("Location: home.php");
    exit;

  } else if ($username) {

    if (AuthUser($username, $password, $user_id)) {
      setcookie("user_id", "$user_id");
      setcookie("language", $language);
      setcookie("last_language", $language, time()+3600*24*7); // lasts a week
      Header("Location: home.php");
      exit;
    }

  }

  if ($username && !$password) $erro = $strPasswordismissing;
  else if ($password && !$username) $erro = $strUsernameismissing;

?>
<html>
<head>
<title><?php echo $strWelcome;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php if ($charset) print $charset; else print "ISO-8859-1"; ?>">
</head>
<body bgcolor=<?php print $bgcolorLogin; ?>>
<table width=100% height=100%>
 <tr>
  <td valign=middle align=center>
   <form method=post>
<?php

    if ($erro) $content = "<div align=center><font color=#FF0000>$erro</font></div>";

    $content .= "  <br><div align=center>
        $strUsername: <input type=text name=username value=\"$username\"><br>
        $strPassword: <input type=password name=password value=\"$password\"><br>
        <select name=language>";


    reset ($languages);

    while ($key=key($languages)) {
      $value = $languages[$key];

      if ($last_language==$key) $content .= "\n<option value=\"$key\" selected>$value";
      else $content .= "\n<option value=\"$key\">$value";
      
      next ($languages);
    }


    $content .=  "</select><br>
        <input type=submit value=\"$strLogin\"><br>
        </div>";

    $title = $strWelcome;
    $color = $boxcolorLogin;

    $content .= '<center><a href="http://promanager.bin.org/">Promanager Site</a>';

    include "templates/box.php";


?>
      </form>
    </td>
  </tr>
</table>
</body>
</html>
Return current item: proManager