- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / system_admin / edv-datenbank-pass.php
blobc62ecb443c83cd71f9f672b9006ca48fe536daaa
1 <?php
2 if(($sid==NULL)||($sid!=$$ck_sid_buffer)) { header("location:invalid-access-warning.php"); exit;}
4 require_once($root_path.'include/inc_config_color.php');
8 srand(time()*1000);
9 $r=rand(1,1000);
10 $dbname="maho";
12 $allowedarea="System_Admin";
14 $fileforward="edv-datenbank.php";
15 $thisfile="edv-datenbank-pass.php";
16 $breakfile="edv.php";
18 if($HTTP_COOKIE_VARS['ck_login_logged'.$sid]&&$HTTP_COOKIE_VARS['ck_login_userid'.$sid])
20 header("location: passcheck-intern.php?sid=$sid&lang=$lang&allowedarea=$allowedarea&fileforward=$fileforward&retfilepath=$thisfile");
21 exit;
23 //setcookie(ck_edv_db_user,"");
25 function validarea($area,$zeile2,$range)
27 for ($i=0;$i<$range;$i++)
28 if(($zeile2[$i]==$area)or($zeile2[$i]=="alle")) return 1;
29 return 0;
32 function logentry($userid,$key,$report,$remark1,$remark2)
34 $logpath="logs/access/".date(Y)."/";
35 if (file_exists($logpath))
37 $logpath=$logpath.date("Y_m_d").".log";
38 $file=fopen($logpath,"a");
39 if ($file)
40 { if ($userid=="") $userid="blank";
41 $line=date("d.m.Y").' '.date("H.i").' '.$report.' Username='.$userid.' Password='.$key.' Fileaccess='.$remark1.' Fileforward='.$remark2;
42 fputs($file,$line);fputs($file,"\r\n");
43 fclose($file);
49 if ($versand=="Abschicken")
52 $link=mysql_connect("localhost","httpd","");
53 if ($link)
54 { if(mysql_select_db($dbname,$link))
55 { $sql='SELECT * FROM mahopass WHERE mahopass_id="'.$userid.'"';
56 $ergebnis=$db->Execute($sql);
57 if($ergebnis)
58 {$zeile=$ergebnis->FetchRow();
59 if (($zeile[mahopass_password]==$keyword)&&($zeile[mahopass_id]==$userid))
61 if (!($zeile[mahopass_lockflag]))
63 if (validarea($allowedarea,$zeile,mysql_num_fields($ergebnis)))
65 setcookie(ck_edv_db_user,$zeile[mahopass_name]);
66 logentry($zeile[mahopass_name],"*","IP:".$REMOTE_ADDR."EDV DB verwalten Access OK'd",$thisfile,$fileforward);
67 header("Location: $fileforward?sid=$$ck_sid_buffer");
68 exit;
69 }else {$passtag=2;};
70 }else $passtag=3;
71 }else {$passtag=1;};
73 else {$passtag=1;};
78 else
79 { echo "Verbindung zur Datenbank konnte nicht hergestellt werden.<br>"; $passtag=5;}
85 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN" "html.dtd">
86 <HTML>
87 <HEAD>
88 <?php echo setCharSet(); ?>
89 <TITLE>EDV - Datenbank Verwalten</TITLE>
91 <?php if($cfg['dhtml'])
92 { echo'
93 <script language="javascript" src="../js/hilitebu.js">
94 </script>
96 <STYLE TYPE="text/css">
97 A:link {text-decoration: none; color: '.$cfg['body_txtcolor'].';}
98 A:hover {text-decoration: underline; color: '.$cfg['body_hover'].';}
99 A:active {text-decoration: none; color: '.$cfg['body_alink'].';}
100 A:visited {text-decoration: none; color: '.$cfg['body_txtcolor'].';}
101 A:visited:active {text-decoration: none; color: '.$cfg['body_alink'].';}
102 A:visited:hover {text-decoration: underline; color: '.$cfg['body_hover'].';}
103 </style>';
107 </HEAD>
109 <BODY <?php if (!$nofocus) echo 'onLoad="document.passwindow.userid.focus()"'; echo ' bgcolor='.$cfg['body_bgcolor'];
110 if (!$cfg['dhtml']){ echo ' link='.$cfg['body_txtcolor'].' alink='.$cfg['body_alink'].' vlink='.$cfg['body_txtcolor']; }
114 <FONT SIZE=-1 FACE="Arial">
117 <FONT COLOR=#cc6600 SIZE=5 FACE="verdana"> <b>Datenbank Verwalten</b></font>
119 <table width=100% border=0 cellpadding="0" cellspacing="0">
120 <tr>
121 <td colspan=3><img src=../img/einga-b.gif border=0 width=130 height=25><!-- <a href="op-pflege-logbuch-such-pass.php?sid=<?php echo $$ck_sid_buffer;?>"><img src="../img/such-gray.gif" border=0 width=130 height=25 <?php if($cfg['dhtml'])echo'style=filter:alpha(opacity=70) onMouseover=hilite(this,1) onMouseOut=hilite(this,0)>';?></a><a href="op-pflege-logbuch-arch-pass.php?sid=<?php echo $$ck_sid_buffer;?>"><img src="../img/arch-gray.gif" border=0 width=130 height=25 <?php if($cfg['dhtml'])echo'style=filter:alpha(opacity=70) onMouseover=hilite(this,1) onMouseOut=hilite(this,0)>';?></a> --></td>
122 </tr>
124 <tr>
125 <td bgcolor=#333399 colspan=3>
126 <FONT SIZE=1 FACE="Arial"><STRONG>&nbsp;</STRONG></FONT>
127 </td>
128 </tr>
130 <tr bgcolor="#DDE1EC">
131 <td bgcolor=#333399><font size=1>&nbsp;</td>
133 <td>
135 <p><br>
136 <center>
139 <?php if ((($userid!=NULL)||($keyword!=NULL))&&($passtag!=NULL))
141 echo '<FONT COLOR="red" SIZE=+2 FACE="Arial"><STRONG>';
143 $errbuf="EDV - DB verwalten ";
145 switch($passtag)
147 case 1:$errbuf=$errbuf."Falsche Eingabe"; echo '<img src=../img/cat-fe.gif align=left>';break;
148 case 2:$errbuf=$errbuf."Keine Berechtigung"; echo '<img src=../img/cat-noacc.gif align=left>';break;
149 default:$errbuf=$errbuf."Zugang gesperrt"; echo '<img src=../img/warn.gif align=left>';
153 logentry($userid,$keyword,$errbuf,$thisfile,$fileforward);
156 echo '</STRONG></FONT><P>';
161 <table border=0 cellpadding=0 cellspacing=0>
162 <tr>
163 <?php if(!$passtag) echo'
164 <td>
166 <img src="../img/ned2r.gif" border=0 width=100 height=138 >
167 </td>
170 <td bgcolor="#999999" valign=top>
172 <table cellpadding=1 bgcolor=#999999 cellspacing=0>
173 <tr>
174 <td>
175 <table cellpadding=20 bgcolor=#eeeeee >
176 <tr>
177 <td>
180 <FORM action="<?php echo $thisfile; ?>" method="post" name="passwindow">
182 <font color=maroon size=3>
183 <b>Passwort ist erforderlich!</b></font><p>
184 <font face="Arial,Verdana" color="#000000" size=-1>
185 Benutzername eingeben:<br></font>
186 <INPUT type="text" name="userid" size="14" maxlength="25"> <p>
187 <font face="Arial,Verdana" color="#000000" size=-1>Passwort eingeben:</font><br>
188 <INPUT type="password" name="keyword" size="14" maxlength="25">
189 <input type="hidden" name="versand" value="Abschicken">
190 <input type="hidden" name="sid" value="<?php echo $sid; ?>">
191 <input type="image" src="../img/abschic.gif" border=0 width=110 height=24>
192 </font>
193 </FORM>
195 <FORM action="<?php echo $breakfile;?>" name=cancelbut>
196 <input type="hidden" name="sid" value="<?php echo $sid; ?>">
197 <input type="image" src="../img/abbrech.gif" border=0 width=103 height=24>
198 </font></FORM>
200 </td>
201 </tr>
202 </table>
203 </td>
204 </tr>
205 </table>
206 </td>
207 </tr>
208 </table>
210 <p><br>
212 </center>
214 </td>
215 <td bgcolor=#333399><font size=1>&nbsp;</td>
216 </tr>
218 <tr >
219 <td bgcolor="#333399" colspan=3><font size=1>
220 &nbsp;
221 </td>
222 </tr>
225 </table>
228 <img src="../img/small_help.gif"> <a href="<?php echo $root_path; ?>main/ucons.php<?php echo URL_APPEND; ?>">Einführung in die SQL Datenbank.</a><br>
229 <img src="../img/small_help.gif"> <a href="<?php echo $root_path; ?>main/ucons.php<?php echo URL_APPEND; ?>">Wie mache ich was hier?</a><br>
230 <HR>
233 <?php
234 require($root_path.'include/inc_load_copyrite.php');
238 </FONT>
241 </BODY>
242 </HTML>