Subversion Repositories Transart

Rev

Rev 8 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 p.duerhamm 1
<?
2
if (isset($_SESSION)) {
3
session_destroy();
4
}
5
?>
6
<?php require_once('Connections/Transart.php'); ?>
7
<?php
8
if (!function_exists("GetSQLValueString")) {
9
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
10
{
11
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
12
 
13
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
14
 
15
  switch ($theType) {
16
    case "text":
17
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
18
      break;
19
    case "long":
20
    case "int":
21
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
22
      break;
23
    case "double":
24
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
25
      break;
26
    case "date":
27
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
28
      break;
29
    case "defined":
30
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
31
      break;
32
  }
33
  return $theValue;
34
}
35
}
36
?>
37
<?php
38
// *** Validate request to login to this site.
39
if (!isset($_SESSION)) {
40
  session_start();
41
}
42
 
43
$loginFormAction = $_SERVER['PHP_SELF'];
44
if (isset($_GET['accesscheck'])) {
45
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
46
}
47
 
48
if (isset($_POST['login'])) {
49
  $loginUsername=$_POST['login'];
50
  $password=md5($_POST['passwort']);
51
  $MM_fldUserAuthorization = "benutzer_level";
52
  $MM_redirectLoginSuccess = "main/index.php";
53
  $MM_redirectLoginFailed = "main/error.php";
54
  $MM_redirecttoReferrer = false;
55
  mysql_select_db($database_Transart, $Transart);
56
 
57
  $LoginRS__query=sprintf("SELECT benutzer_login, benutzer_passwort, benutzer_level FROM benutzer WHERE benutzer_login=%s AND benutzer_passwort=%s",
58
  GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
59
 
60
  $LoginRS = mysql_query($LoginRS__query, $Transart) or die(mysql_error());
61
  $loginFoundUser = mysql_num_rows($LoginRS);
62
  if ($loginFoundUser) {
63
 
64
    $loginStrGroup  = mysql_result($LoginRS,0,'benutzer_level');
65
 
66
    //declare two session variables and assign them
67
    $_SESSION['MM_Username'] = $loginUsername;
68
    $_SESSION['MM_UserGroup'] = $loginStrGroup;
69
 
70
    if (isset($_SESSION['PrevUrl']) && false) {
71
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
72
    }
73
    header("Location: " . $MM_redirectLoginSuccess );
74
  }
75
  else {
76
    header("Location: ". $MM_redirectLoginFailed );
77
  }
78
}
79
?>
80
<?
81
session_start();
82
?>
83
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
84
<html xmlns="http://www.w3.org/1999/xhtml">
85
<head>
86
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
87
<title>Transart Login</title>
88
<link href="stil.css" rel="stylesheet" type="text/css" />
89
    <script type="text/javascript" src="semantic/semantic.min.js"></script>
90
    <link rel="stylesheet" type="text/css" href="semantic/semantic.min.css">
91
</head>
92
<body>
93
<?php
94
		/////// Deklariere Globale SESSION VARIABLEN
95
		$_SESSION['datumaktuell']=date("Y-m-d");
96
?>
97
<table class="ui celled orange striped table">
98
  <tr>
99
    <td valign="top"><table class="ui table">
100
      <tr>
12 p.duerhamm 101
        <td><p><img src="img/logo.png" width="206" height="41" /><a class="ui green circular label">V1.307.215</a></td>
2 p.duerhamm 102
      <tr>
103
        <td valign="top"><form ACTION="<?php echo $loginFormAction; ?>" id="form1" name="form1" method="POST">
104
          <table width="300" class="tabelle1">
105
            <tr>
106
              <td class="optionen">Login</td>
107
              <td class="stil1"><label>
108
                <input name="login" type="text" class="stil2" id="login" />
109
                <script type="text/javascript">
110
			  document.form1.login.focus();
111
			  </script>
112
              </label></td>
113
            </tr>
114
            <tr>
115
              <td class="optionen">Passwort</td>
116
              <td class="stil1"><label>
117
                <input name="passwort" type="password" class="stil2" id="passwort" />
118
              </label></td>
119
            </tr>
120
            <tr>
121
              <td class="stil1">&nbsp;</td>
122
              <td class="stil1"><label>
123
                <input name="button" type="submit" class="stil2" id="button" value="Senden" />
124
              </label></td>
125
            </tr>
126
  </table>
127
                </form>        </td>
128
      </tr>
129
    </table>    </td>
130
  </tr>
131
</table>
132
 
133
</body>
134
</html>