Location: PHPKode > projects > Tagging manager > version 1.02/admin/processuser.php
<?
  $root_path  = './../';
  
  include_once($root_path.'config.php');
	  
  require_once($root_path.'includes/dbconn.php');
  require_once($root_path.'includes/functions.php');
  require_once($root_path.'includes/template.php');
  require_once($root_path.'includes/metadata.php');
  require_once($root_path.'includes/user.php');
  



switch ($_GET[action]) {
case edit:
	$myUser = new User;
	$myUser->getUserbyid($_GET[id]);
	
	 if (array_key_exists('_submit_check', $_POST)) {
	$myUser->userName = $_POST[username];
	$myUser->userEmail = $_POST[email];
	$myUser->updateUser($_POST[id]);
	header("location:userlist.php");
	}
	
  echo 'edit user('.$myUser->user_id.'): ' . $myUser->userName;
  echo '<form name="metadata" method="post" action="processuser.php?action=edit&id='.$myUser->user_id.'">';
  echo '<input name="username" type="text" id="username" value="' . $myUser->userName . '" size="77">username<br><input name="email" type="text" id="email" value="' . $myUser->userEmail . '" size="77">email<br>';
  echo '<input type="hidden" name="_submit_check" value="1"><input type="hidden" name="id" value="'.$myUser->user_id.'"> ';
	echo '<input name="Submit" type="submit" class="buttonthing" value="edit"> ';
 
	break;
case delete:
  $myUser = new User;
  $myUser->delete($_GET[id]);
  header("location:userlist.php");
  break;
case pass:
	$myUser = new User;
	$myUser->getUserbyid($_GET[id]);
	
	if (array_key_exists('_submit_check', $_POST)) {
	$myUser = new User;
	$myUser->user_id = $_POST[id];
	$myUser->changePassword(md5($_POST[password]));
	header("location:userlist.php");
	}
	
  echo 'edit password user('.$myUser->user_id.'): ' . $myUser->userName;
  echo '<form name="metadata" method="post" action="processuser.php?action=pass&id='.$myUser->user_id.'">';
  echo '<input name="password" type="text" id="password" value="" size="77">';
  echo '<input type="hidden" name="_submit_check" value="1"><input type="hidden" name="id" value="'.$myUser->user_id.'"> ';
	echo '<input name="Submit" type="submit" class="buttonthing" value="set new pass"> ';


  break;
 case add:
	$myUser = new User;
	
	 if (array_key_exists('_submit_check', $_POST)) {
	$myUser->userName = $_POST[username];
	$myUser->userEmail = $_POST[email];
	$myUser->userPassword = md5($_POST[password]);
	$myUser->setuser();
	header("location:userlist.php");
	}
	
  echo 'add user';
  echo '<form name="metadata" method="post" action="processuser.php?action=add">';
  echo '<input name="username" type="text" id="username" value="" size="77">username<br>';
 echo '<input name="email" type="text" id="email" value="" size="77">email<br>';
  echo '<input name="password" type="text" id="password" value="" size="77">password<br>';
  echo '<input type="hidden" name="_submit_check" value="1"><input type="hidden" name="id" value="'.$myUser->user_id.'"> ';
	echo '<input name="Submit" type="submit" class="buttonthing" value="add"> ';
 
	break;
}


  
?>
Return current item: Tagging manager