Location: PHPKode > projects > ZompLog > admin/editor_users.php
<?php
/* Written by Gerben Schmidt, http://scripts.zomp.nl */

ob_start();
include_once("functions.php");
include('config.php');
include("session.php");
// this setting activates tinyMCE for all textareas in the page
$set_mce = 1;
include("header.php");

$user = loadUser($_SESSION['login'],$link,$table_users);
if(!$_SESSION["loggedIn"] || !$user['admin']){ echo "You don't have enough privileges to view this page."; exit; }


if($_POST["Submit"]){
	
	if(($_POST["password2"]) && (strcmp($_POST["password"], $_POST["password2"]))) {
		
		$messages[]="$lang_mismatch";
	}
	

	
	if(empty($messages)) {
		
		if($_POST[password2]){
		updatePass($user[id],$link,$table_users);
		}

		updateUser($user[id],$link,$table_users);
		
		header("Location: editor_users.php?username=$user[login]&message=4");

	}
}


?>

<div id="submenu"><a href="profile.php" class="sub"><?php echo "$lang_editprofile"; ?></a><?php if($user[admin]){ ?> | <a href="users.php" class="sub"><?php echo "$lang_manage_users"; ?></a><?php } ?></div>


<div id="side">
<div class="title">&nbsp;</div>
<div class="box"><?php
if(!empty($messages)){
	displayErrors($messages);
}

elseif($_GET[message] && empty($messages)){
displayMessage($_GET[message]);
  }

else{
echo "$lang_edit_user<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<strong>$user[login]</strong>";
}  
  
?>
</div></div>


<div id="main">

<form name="myform" method="post" enctype="multipart/form-data">
      <table width="94%"  border="0" cellspacing="0" cellpadding="0" class="text">
        <tr>
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><h1><?php echo "$lang_editprofile: $user[login]"; ?></h1></td>
              <td><input type="submit" name="Submit" value="<?php echo "$lang_submit"; ?>" id="button" /></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td><fieldset id="titlediv">
      <legend><?php echo "$lang_username"; ?></legend> <?php echo "$user[login]"; ?></fieldset></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        
        <tr>
          <td><fieldset id="titlediv">
          <legend><?php echo "$lang_password"; ?></legend>	 
		  <input name="password" type="password" id="password"><br /><br />
		  <em><?php echo "$lang_retype_password"; ?></em><br />
		  <input name="password2" type="password" id="password2" value="">&nbsp;<?php echo "$lang_password_only_when"; ?>
		  </fieldset></td>
        </tr>

        <tr>
          <td>&nbsp;</td>
        </tr>

        <tr>
          <td><fieldset id="titlediv">
      <legend><?php echo "$lang_name"; ?></legend><input name="name" type="text" id="name" value="<?php echo "$user[name]"; ?>"></fieldset></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        
        <tr>
          <td><fieldset id="titlediv">
      <legend><?php echo "$lang_email"; ?></legend><input name="email" type="text" id="email" value="<?php echo "$user[email]"; ?>"></fieldset></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        
        <tr>
          <td><fieldset id="titlediv">
      <legend><?php echo "$lang_about_me"; ?></legend><textarea name="about" cols="65" rows="8" id="about"><?php echo "$user[about]"; ?></textarea>
          </fieldset></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><input type="submit" name="Submit" value="<?php echo "$lang_submit"; ?>" id="submit"></td>
        </tr>
      </table>
    </form>
      </div>
<?php include("footer.php"); ?>
Return current item: ZompLog