<?php

#############################################################################
#           			                   Site@School
# Site@School is a website management system designed for primary schools.
#
# About Site@School:
# Comissioned by: City District 'de Baarsjes', Amsterdam, Netherlands
# Original idea, coding (version 1.0) and design : Mark de Haan (mark@starwave.nl)
# Ideas, improvements, expansions (version 1.1 - 2.4): Fred Stuurman 
# Current coder & maintainer: Fred Stuurman (fc.stuurman@hccnet.nl)
############################################################################
# saslogin.inc.php: last changed 02/1/2004  2.4.10
#                   by Fred Stuurman (fc.stuurman@hccnet.nl)
#$Id: saslogin.inc.php,v 1.2 2006/10/15 19:08:55 fstuurman Exp $
############################################################################
#                        LICENSE INFORMATION
# Copyright (C) 2002 - 2006 Municipality of Amsterdam, City District
#  'de Baarsjes', Amsterdam, the Netherlands.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# 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.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
##############################################################################
if (!defined('IN_SAS'))
{
	die("Hacking attempt");
}

if (IsSet ($_GET['username']))
{
	$username = $_GET['username'];
}
if (IsSet ($_GET['error']))
{
	$error = $_GET['error'];
}
else
{
	$error = "";
}

if ($error == "true")
{
	print "<script language=\"Javascript\">
				   <!--
				   alert (\"" . $sas_lang['password_change_problem'] . "\");
				   //-->
				   </script>";
}
elseif ($option == "new_password") //passwords reset
{
	print "<script language=\"Javascript\">
				   <!--
				   alert (\"" . $sas_lang['password_need_change'] . "\");
				   //-->
				   </script>";
}

print "
<HTML>
<HEAD>
<meta http-equiv=Content-Type content=\"text/html; charset=" . $sas_lang['lang_charset'] . "\">
<TITLE>Site@School " . $sas_lang['login'] . "</TITLE>
</HEAD>

<BODY background=\"graphics/puzzle_tile.gif\" text=\"#000000\" onLoad=\"self.focus();document.loginform.sn_username.focus()\">

<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" width=\"100%\" height=\"100%\">
  <tr>
    <td valign=\"center\" align=\"center\">
     <form method=\"post\" action=\"index.php\" name=\"loginform\">
 <input type=\"hidden\" name=\"submitted\" value=\"1\">
 <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
   <tr>
       <td colspan=\"2\" align=\"right\"><img border=\"0\" src=\"graphics/saslogo.gif\"></td></tr>
   <tr><td colspan=\"2\">&nbsp;</td></tr>
   <tr><td align=\"right\">
     <font face=\"Verdana\" size=\"2\"><b>" . $sas_lang['username'] . ":&nbsp;</b></font></td>
     <td><input type=\"text\" TABINDEX=1 name=\"sn_username\" value=\"$username\" size=\"25\" style=\"color : black; font-size : 14px; border : 1px inset #CCDAEC;\">
     </td>
   </tr>
   <tr>
   <td height=\"5\" colspan=\"2\"></td>
   </tr>
   <tr>
     <td align=right><font size=\"2\" face=\"Verdana\"><b>" . $sas_lang['password'] . ":&nbsp;</b></font></td>
     <td> <input type=\"password\" TABINDEX=2 name=\"sn_password\" size=\"25\" style=\"color : black; font-size : 14px; border : 1px inset #CCDAEC;\">
     </td>
   </tr>";
if ($_GET['option'] == "new_password") //passwords reset
{
	print "<tr><td>&nbsp;</td></tr><tr><td align=\"center\" colspan=\"2\">" . $sas_lang['password_twice'] . "</td></tr>
	     <tr><td align=right><font size=\"2\" face=\"Verdana\"><b>" . $sas_lang['password'] . ":&nbsp;</b></font></td>
	     <td> <input type=\"password\" TABINDEX=3 name=\"password_new1\" size=\"25\" style=\"color : black; font-size : 14px; border : 1px inset #CCDAEC;\">
	     <input type=\"hidden\" name=\"option\" value=\"save_new_password\"></td>
	   </tr>
	   <tr>
	   <td height=\"5\" colspan=\"2\"></td>
	   </tr>
	   <tr>
	   <tr>
	     <td align=right><font size=\"2\" face=\"Verdana\"><b>" . $sas_lang['password'] . ":&nbsp;</b></font></td>
	     <td> <input type=\"password\" TABINDEX=4 name=\"password_new2\" size=\"25\" style=\"color : black; font-size : 14px; border : 1px inset #CCDAEC;\">
	     </td>
	   </tr>";
}
if ($_GET['option'] != "new_password") //passwords reset
{
	print "<tr>
			 <td>&nbsp;</td> 
			 <td><font size=\"1\" face=\"Verdana\"><a href=sendpw.php?option=admin>" . $sas_lang['logged_password_forget'] . "</a></font></td>
		   </tr>";
}
print "<tr>
     <td>&nbsp;</td>
     <td align=\"center\" height=\"50\"><font face=\"Verdana\">
 <input type=\"submit\" TABINDEX=5 value=\"" . $sas_lang['login'] . "\" style=\"color : black; font-size : 14px; border : 1px outset #CCDAEC;\"></font></td>
   </tr>
 </table>
     </form>
 </td>
  </tr>
</table>

</BODY>
</HTML>";
?>
