25 require_once(
"config.php");
26 require_once(
"inc/tools.php");
27 require_once(
"inc/messages.class.php");
28 require_once(
"inc/html.class.php");
29 require_once(
"inc/db.class.php");
30 require_once(
"inc/config.class.php");
31 require_once(
"inc/user.class.php");
32 require(
"inc/auth.class.php");
33 require_once(
"inc/user.class.php");
35 $db =
new db( DB_USER, DB_PASS, DB_DATABASE, DB_HOST );
39 if( !isset($_SESSION)){
42 session_regenerate_id();
46 if( (isset($_SESSION[
"previous_url"])) AND ($_SESSION[
"previous_url"] !=
"") ){
47 define(
"LOCATION_AUTH_SUCCESS",$_SESSION[
"previous_url"]);
49 define(
"LOCATION_AUTH_SUCCESS",
"page.php");
55 function print_form(){
60 <form method='POST' id='login_form'>
62 <td> <img src='icons/256/dialog-password.png' alt='' style='height:80px'/> </td>
67 <td><input type='text' id='uname' name='uname' value='$user'/> </td>
71 <td><input type='password' id='pass' name='pass' value='$pass'/></td>
75 <td style='text-align:left;padding-top:10px'><input type='submit' name='login' value='Login' style='width:10em;height:2em'/></td>
88 if ( isset($_POST[
"logout"]) ){
95 if( isset($_SESSION[
"projects"]) ){
96 unset($_SESSION[
"projects"]);
98 unset($_SESSION[
"user"]);
101 header(
"Location: {$_SERVER["SCRIPT_NAME
"]}");
105 if ( isset($_POST[
"login"]) ){
107 $group_mapping =
$au->get_gid_to_name_mapping( $groups_whitelist );
108 if (
$au->auth($_POST[
"uname"],$_POST[
"pass"]) ){
113 $user->name = $_POST[
"uname"];
114 $user->fullName =
$au->userFullName;
115 $user->givenName =
$au->userGivenName;
118 $user->groupName = $group_mapping[
$au->userGroupID];;
119 $user->is_auth =
true;
127 if( isset(
$au->projects) ){
128 $_SESSION[
"projects"] =
$au->projects;
130 $user->load_config(
$db,$_POST[
"uname"]);
132 $_SESSION[
"user"] =
$user;
133 header(
"location:".LOCATION_AUTH_SUCCESS);
135 $messages->add_message(
new errorMessage(
"Login fehlgeschlagen. Bitte Benutzername und Passwort überprüfen. Ist die Feststelltaste aktiviert?") );
143 box-shadow:0px 0px 10px #FFFBE1;
150 border-collapse:collapse;
151 border:1px solid black;
152 background-color:#FFF;
156 #user_table td, #user_table th{
157 /*border:1px solid black;*/
158 padding: 1px 5px 1px 5px;
162 background-color:#FFEBBD;
167 text-decoration:none;
171 border:2px dotted gray;
172 box-shadow:0px 0px 10px #BFBFBF;
173 background-color:#FFF;
183 background-color:#F3F3F3
187 <script type="text/javascript">
188 function login( name , pass ){
189 document.getElementById("uname").value = name;
190 document.getElementById("pass").value = pass;
191 document.getElementsByName("login")[0].click();
199 echo
'<h1 class="first_h1" id="login_header"> <img src="fcs-logo.png" style="height:1em"/> Willkommen auf der Umfragenseite <img src="fcs-logo.png" style="height:1em"/> </h1>';
210 <br/> <br/> <br/> <hr/>
211 <div
id=
"user_table">
214 <tr><th>FullName</th><th>login</th><th>pass</th><th>group</th></tr>
215 <tr style=
'background-color:#F1F1F1'>
216 <td> <a href=
'#' onClick=
'login("adm","adm");'> admin </a> </td>
217 <td><b>adm</b> (1000)</td>
219 <td>admins (500)</td>
222 <td> <a href=
'#' onClick=
'login("jojo","isabelle");'> Johannes th </a> </td>
223 <td><b>jojo</b> (1001)</td>
225 <td>teachers (501)</td>
227 <tr style=
'background-color:#F1F1F1'>
228 <td> <a href=
'#' onClick=
'login("ndr","ndr");'> Natsu Dragneel </a> </td>
229 <td><b>ndr</b> (1002)</td>
231 <td>teachers (501)</td>
234 <td> <a href=
'#' onClick=
'login("lhe","lhe");'> Lucy Heartfilia </a> </td>
235 <td><b>lhe</b> (1003)</td>
237 <td>teachers (501)</td>
239 <tr style=
'background-color:#F1F1F1'>
240 <td> <a href=
'#' onClick=
'login("esc","esc");'> Erza Scarlet </a> </td>
241 <td><b>esc</b> (1004)</td>
243 <td>teachers (501)</td>
246 <td> <a href=
'#' onClick=
'login("gfu","gfu");'> Gray Fullbuster </a> </td>
247 <td><b>gfu</b> (1005)</td>
249 <td>teachers (501)</td>
251 <tr style=
'background-color:#F1F1F1'>
252 <td> <a href=
'#' onClick=
'login("wma","wma");'> Wendy Marvell </a> </td>
253 <td><b>wma</b> (1006)</td>
255 <td>class1 (502)</td>
258 <td> <a href=
'#' onClick=
'login("gre","gre");'> Gajeel Redfox </a> </td>
259 <td><b>gre</b> (1007)</td>
261 <td>class1 (502)</td>
263 <tr style=
'background-color:#F1F1F1'>
264 <td> <a href=
'#' onClick=
'login("mdr","mdr");'> Makarov Dreyar </a> </td>
265 <td><b>mdr</b> (1008)</td>
267 <td>class1 (502)</td>
270 <td> <a href=
'#' onClick=
'login("mst","mst");'> Mirajane Strauss </a> </td>
271 <td><b>mst</b> (1009)</td>
273 <td>class2 (503)</td>
275 <tr style=
'background-color:#F1F1F1'>
276 <td> <a href=
'#' onClick=
'login("est","est");'> Elfman Strauss </a> </td>
277 <td><b>est</b> (1010)</td>
279 <td>class2 (503)</td>
282 <td> <a href=
'#' onClick=
'login("lst","lst");'> Lisanna Strauss </a> </td>
283 <td><b>lst</b> (1011)</td>
285 <td>class2 (503)</td>
287 <tr style=
'background-color:#F1F1F1'>
288 <td> <a href=
'#' onClick=
'login("cal","cal");'> Cana Alberona </a> </td>
289 <td><b>cal</b> (1012)</td>
291 <td>class2 (503)</td>
294 <td> <a href=
'#' onClick=
'login("jlo","jlo");'> Juvia Lockser </a> </td>
295 <td><b>jlo</b> (1013)</td>
297 <td>class3 (504)</td>
299 <tr style=
'background-color:#F1F1F1'>
300 <td> <a href=
'#' onClick=
'login("fju","fju");'> Freed Justine </a> </td>
301 <td><b>fju</b> (1014)</td>
303 <td>class3 (504)</td>
306 <td> <a href=
'#' onClick=
'login("gcl","gcl");'> Gildarts Clive </a> </td>
307 <td><b>gcl</b> (1015)</td>
309 <td>class3 (504)</td>
311 <tr style=
'background-color:#F1F1F1'>
312 <td> <a href=
'#' onClick=
'login("mco","mco");'> Macao Conbolt </a> </td>
313 <td><b>mco</b> (1016)</td>
315 <td>class3 (504)</td>
318 <td> <a href=
'#' onClick=
'login("hap","hap");'> Happy </a> </td>
319 <td><b>hap</b> (1017)</td>
321 <td>class4 (505)</td>
323 <tr style=
'background-color:#F1F1F1'>
324 <td> <a href=
'#' onClick=
'login("car","car");'> Carla </a> </td>
325 <td><b>car</b> (1018)</td>
327 <td>class4 (505)</td>
330 <td> <a href=
'#' onClick=
'login("pan","pan");'> Pantherlily </a> </td>
331 <td><b>pan</b> (1019)</td>
333 <td>class4 (505)</td>