person; $_roles= $_person['role_ids']; $is_submitted= isset($_POST['submitted']) ? $_POST['submitted'] : 0; // show details for the current user. if( isset($_GET['id']) && is_numeric($_GET['id']) ) { $person_id= intval($_GET['id']); } else { header( "location: index.php" ); exit(); } $errors= array(); if( $is_submitted ) { // attempt to update this person $first_name= $_POST['first_name']; $last_name= $_POST['last_name']; $title= $_POST['title']; $email= $_POST['email']; $phone= $_POST['phone']; $url= $_POST['url']; $bio= str_replace("\r", "", $_POST['bio']); $password1= $_POST['password1']; $password2= $_POST['password2']; if( $password1 != $password2 ) { $errors[]= "The passwords do not match"; } if( count($errors) == 0 ) { $update_vals= array(); $update_vals['first_name']= $first_name; $update_vals['last_name']= $last_name; $update_vals['title']= $title; $update_vals['email']= $email; $update_vals['phone']= $phone; $update_vals['url']= $url; $update_vals['bio']= $bio; if( $password1 != "" ) $update_vals['password']= $password1; $rc= $api->UpdatePerson( intval( $person_id ), $update_vals); if( $rc == 1 ) { Header( "Location: /db/persons/index.php?id=$person_id" ); exit(); } elseif ($rc === NULL) { $errors[] = $api->error(); } } } else { // get details for the user $person_details= $api->GetPersons( array( intval( $person_id ) ), array( "person_id", "first_name", "last_name", "title", "email", "phone", "url", "bio" ) ); if ( $person_details === NULL ) { $errors[] = $api->error(); } else { $person_detail= $person_details[0]; $first_name= $person_detail['first_name']; $last_name= $person_detail['last_name']; $title= $person_detail['title']; $email= $person_detail['email']; $phone= $person_detail['phone']; $url= $person_detail['url']; $bio= $person_detail['bio']; } } // Print header require_once 'plc_drupal.php'; drupal_set_title('Update Person'); include 'plc_header.php'; ?>

Update Account

0 ) { print( "

The following errors occured:" ); print( "

\n" ); } ?>

Personal Information

First Name:
Last Name:
Title:
Email:
Phone:
URL:
Bio:
Password (blank for no change):
Repeat Password: