Subversion Repositories Transart_hsartstorage

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 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
<script type="text/javascript" src="scripts/jquery/jquery.min.js"></script>
89
<script type="text/javascript" src="scripts/jquery/jquery-ui/jquery-ui.js"></script>
90
<script type="text/javascript" src="semantic/semantic.min.js"></script>
91
<link rel="stylesheet" type="text/css" href="semantic/semantic.min.css">
92
<link href="stil.css" rel="stylesheet" type="text/css" />
93
</head>
94
<body>
95
<table class="master_tabelle">
96
  <tr>
97
    <td valign="top"><table width="400" border="0" cellspacing="0">
98
      <tr>
99
        <td><p><img src="img/logo.png" width="206" height="41" /></p>
100
          <p>&nbsp;</p></td>
101
		  <td><a class="ui violet circular label">V1.107</a></td>
102
        <td>&nbsp;</td>
103
        <td>&nbsp;</td>
104
      </tr>
105
      <tr>
106
        <td valign="top"><?
107
		/////// Deklariere Globale SESSION VARIABLEN
108
		$_SESSION['datumaktuell']=date("Y-m-d");
109
		?></td>
110
        <td valign="top">&nbsp;</td>
111
        <td valign="top">&nbsp;</td>
112
        <td valign="top">&nbsp;</td>
113
      </tr>
114
      <tr>
115
        <td valign="top"><form ACTION="<?php echo $loginFormAction; ?>" id="form1" name="form1" method="POST">
116
          <table class="ui inverted grey table">
117
            <tr>
118
              <td>Login</td>
119
              <td><label>
120
                <input name="login" type="text" id="login" />
121
                <script type="text/javascript">
122
			  document.form1.login.focus();
123
			  </script>
124
              </label></td>
125
            </tr>
126
            <tr>
127
              <td>Passwort</td>
128
              <td><label>
129
                <input name="passwort" type="password" id="passwort" />
130
                </label></td>
131
            </tr>
132
            </table>
133
            <input name="button" type="submit" id="button" value="Senden" class="ui teal button active"/>
134
          </form>        </td>
135
        <td valign="top">&nbsp;</td>
136
        <td valign="top">&nbsp;</td>
137
        <td valign="top">&nbsp;</td>
138
      </tr>
139
      <tr>
140
        <td></td>
141
        <td>&nbsp;</td>
142
        <td>&nbsp;</td>
143
        <td>&nbsp;</td>
144
      </tr>
145
      <tr>
146
        <td>
147
        <table class="ui inverted grey table">
148
        <?php
149
// Die Datei test.xml enthält ein XML-Dokument mit einem Wurzel-Element
150
// und mindestens einem Element /[root]/title.
151
 
152
if ($xml = simplexml_load_file('http://rss.orf.at/news.xml')) {
153
 
154
    //print_r($xml);
155
 
156
	   foreach ($xml->item as $item) {
157
		 echo "<tr>";
158
  		 echo "<td>".$item->title."</td>"; echo "<td><a href='".$item->link."' target='_blank'>";
159
		  ?>
160
		  <button class="ui icon button">
161
  		<i class="right arrow icon"></i>
162
</button>
163
		   <?php
164
		 echo "</a></td>";
165
		 echo '</tr>';
166
	}
167
} else {
168
    exit('Konnte File nicht öffnen.');
169
}
170
?>
171
        </table>
172
        </td>
173
        <td>&nbsp;</td>
174
        <td valign="top"><div id="mylocation">-</div></td>
175
        <td>&nbsp;</td>
176
      </tr>
177
      <tr>
178
        <td>
179
                </td>
180
        <td>&nbsp;</td>
181
        <td>&nbsp;</td>
182
        <td>&nbsp;</td>
183
      </tr>
184
      <tr>
185
        <td>
186
        </td>
187
        <td>&nbsp;</td>
188
        <td>&nbsp;</td>
189
        <td>&nbsp;</td>
190
      </tr>
191
    </table>    </td>
192
  </tr>
193
</table>
194
 
195
</body>
196
</html>