4 require_once 'plc_login.php';
6 // Get session and API handles
7 require_once 'plc_session.php';
11 require_once 'plc_functions.php';
12 require_once 'plc_sorts.php';
15 $_person= $plc->person;
16 $_roles= $_person['role_ids'];
19 $is_submitted= isset($_POST['submitted']) ? $_POST['submitted'] : 0;
21 // show details for the current user.
22 if( isset($_GET['id']) && is_numeric($_GET['id']) ) {
23 $person_id= intval($_GET['id']);
25 plc_redirect (l_sites());
32 // get details for the user
33 $person_details= $api->GetPersons( array( intval( $person_id ) ), array( "person_id", "first_name", "last_name", "title", "email", "phone", "url", "bio" ) );
34 if ( $person_details === NULL ) {
35 $errors[] = $api->error();
37 $person_detail= $person_details[0];
39 $first_name= $person_detail['first_name'];
40 $last_name= $person_detail['last_name'];
41 $title= $person_detail['title'];
42 $email= $person_detail['email'];
43 $phone= $person_detail['phone'];
44 $url= $person_detail['url'];
45 $bio= $person_detail['bio'];
50 require_once 'plc_drupal.php';
51 drupal_set_title('Update Person');
52 include 'plc_header.php';
56 <h2>Update Account</h2>
59 if( count($errors) > 0 )
61 print( "<p><strong>The following errors occured:</strong>" );
62 print( "<font color='red' size='-1'><ul>\n" );
63 foreach( $errors as $err )
65 print( "<li>$err\n" );
67 print( "</ul></font>\n" );
71 <h3>Personal Information</h3>
73 <form method="post" action="update.php?id=<?php print($person_id); ?>">
74 <input type="hidden" name="submitted" value="1">
76 <table width="100%" cellspacing="0" cellpadding="4" border="0">
80 <td><input type="text" name="first_name"
81 value="<?php print($first_name); ?>" size="30" maxlength="256"></td>
86 <td><input type="text" name="last_name"
87 value="<?php print($last_name); ?>" size="30" maxlength="256"></td>
92 <td><input type="text" name="title"
93 value="<?php print($title); ?>" size="30" maxlength="256"></td>
98 <td><input type="text" name="email"
99 value="<?php print($email); ?>" size="30" maxlength="256"></td>
104 <td><input type="text" name="phone"
105 value="<?php print($phone); ?>" size="30" maxlength="32"></td>
110 <td><input type="text" name="url"
111 value="<?php print($url); ?>" size="30" maxlength="200"></td>
115 <td valign=top>Bio:</td>
116 <td><textarea name="bio" cols="40" rows="5" wrap>
117 <?php print($bio); ?>
122 <td>Password (blank for no change):</td>
123 <td><input type="password" name="password1" size="30" maxlength="256"></td>
127 <td>Repeat Password:</td>
128 <td><input type="password" name="password2" size="30" maxlength="256"></td>
133 <input type="submit" name="Submit" value="Update">
140 include 'plc_footer.php';