Location: PHPKode > projects > NewsP > admin/userdata.inc.php
<?php include("auth.php");
session_start();
$username = $_SESSION['username'];
if (file_exists('step1.php')) {
$language = urlencode($HTTP_POST_VARS["language"]); 
include("userdata1st.php");
unlink('step1.php');
}


unset($user_del);
unset($neu);
unset($edited);

$edited = $HTTP_POST_VARS["edited"];
	if (isset($edited))
	{
	$password_e = $HTTP_POST_VARS["passwort_e"];
	$password2_e = $HTTP_POST_VARS["passwort2_e"];
	$email_e = $HTTP_POST_VARS["email_e"];
		if (!empty($password_e))
		{
			if ($password_e == $password2_e){
			$new_pass = md5($password_e);
			}else{
			echo"<p style=\"background-color:#FFFF00\"><B>$lg[us014]</B></p>";
			}
		}

	}

### E D I T #################################################
if ((!empty($edited))){
 $userdatei = fopen ("user.txt","r");
   while (!feof($userdatei))
      {	$zeile = fgets($userdatei,500);
	$userdata = explode("|", $zeile);
	$uu_user=$userdata[0];
			if ($uu_user !== "$edited")
			{
			$user_stay[$uu_user][USER] = "$uu_user";
			$user_stay[$uu_user][PW] = "$userdata[1]";
			$user_stay[$uu_user][R1] = "$userdata[2]";
			$user_stay[$uu_user][R2] = "$userdata[3]";
			$user_stay[$uu_user][R3] = "$userdata[4]";
			$user_stay[$uu_user][R4] = "$userdata[5]";
			$user_stay[$uu_user][MAIL] = "$userdata[6]";
			}else{
			$user_stay[$uu_user][USER] = "$uu_user";
				if (!empty($new_pass))
					{
					$user_stay[$uu_user][PW] = "$new_pass";
					}else{
					$user_stay[$uu_user][PW] = "$userdata[1]";
					}
			$user_stay[$uu_user][R1] = "$userdata[2]";
			$user_stay[$uu_user][R2] = "$userdata[3]";
			$user_stay[$uu_user][R3] = "$userdata[4]";
			$user_stay[$uu_user][R4] = "$userdata[5]";
			$user_stay[$uu_user][MAIL] = "$email_e";
}
      }   
fclose($userdatei);
$userdatei = fopen ("user.txt","w");

			foreach ($user_stay as $person)
			{
					if($person[USER] == 'Admin' && $username == 'Admin'){
					$m_set_file = "../settings/m_settings.txt";
					$zaehlfile = fopen("$m_set_file","r"); 
					$inhalt_zaehlfile = fgets($zaehlfile);  
					fclose($zaehlfile); 
					$set_in_dom = unserialize($inhalt_zaehlfile);
					
					$set_in_dom[mail] = "$person[MAIL]";
					
					$loglink = serialize($set_in_dom);
					$loglinkfile = "$m_set_file";
					$logger = fopen("$loglinkfile","w"); 
					fputs($logger, $loglink); 
					fclose($logger); 
					}
if($person[PW] !==""){
			fwrite($userdatei, $person[USER]);
			fwrite($userdatei, "|");
			fwrite($userdatei, $person[PW]);
			fwrite($userdatei, "|");
			fwrite($userdatei, $person[R1]);
			fwrite($userdatei, "|");
			fwrite($userdatei, $person[R2]);
			fwrite($userdatei, "|");
			fwrite($userdatei, $person[R3]);
			fwrite($userdatei, "|");
			fwrite($userdatei, $person[R4]);
			fwrite($userdatei, "|");
			fwrite($userdatei, $person[MAIL]);
if($edited == $person[USER])
{fwrite($userdatei, "\n");}
			}}
			fclose($userdatei);
if(!empty($new_pass)){
     session_destroy();
}

}
#########################################
echo"<H2>$lg[nav11] $username</H2>"; 


   $userdatei = fopen ("user.txt","r");
#########################
   while (!feof($userdatei))
      {	$zeile = fgets($userdatei,500);
	$userdada = explode("|", $zeile);
	$uda_user=$userdada[0];
if ($uda_user == $username){
$mail = $userdada[6];
      }}   
fclose($userdatei);

############################
$fb=1;
echo"<TABLE cellspacing=\"0\" cellpadding=\"5\"><TR>";
echo"<TD class=td_lk$fb><B>$lg[us003]</B></TD>";
echo"<TD class=td_lk$fb><B>$lg[us011]</B></TD>";
echo"<TD class=td_lk$fb><B>$lg[us008]</B></TD>";
echo"<TD class=td_lk$fb><B>$lg[us005]</B></TD>";
echo"<TD class=td_lk$fb>$lg[us009]</TD></TR>";

$fb=2;

if($user_da[PW] !==""){
if ($fb > 2){$fb = 1;}
echo"<TR><TD class=td_lk$fb><B>$username</B>"; 
echo"</TD><TD class=td_lk$fb>";
?>
<form action="" method="post" name="form1">


<input type="text" size="20" maxlength="50" name="email_e" value="<? echo "$mail";?>">
</TD>
<? echo "<TD class=td_lk$fb>";?>
<input type="password" size="20" maxlength="50" name="passwort_e" value="">
</TD>
<? echo "<TD class=td_lk$fb>";?>
<input type="password" size="20" maxlength="50" name="passwort2_e" value="">
</TD>
<?
echo"<TD class=td_lk$fb><input type=\"hidden\" name=\"edited\" value=\"$username\"><input type=\"submit\" value=\"$lg[us010]\"></form></TD>";
echo"</TR>";
$fb++;
}
echo "</TABLE>";
?>

Return current item: NewsP