4 require_once 'plc_login.php';
6 // Get session and API handles
7 require_once 'plc_session.php';
11 require_once 'plc_functions.php';
14 $_person= $plc->person;
15 $_roles= $_person['role_ids'];
18 $is_submitted= isset($_POST['submitted']) ? $_POST['submitted'] : 0;
20 // show details for the current user.
21 if( isset($_GET['id']) && is_numeric($_GET['id']) ) {
22 $person_id= intval($_GET['id']);
24 plc_redirect (l_sites());
31 // get details for the user
32 $person_details= $api->GetPersons( array( intval( $person_id ) ), array( "person_id", "first_name", "last_name", "title", "email", "phone", "url", "bio" ) );
33 if ( $person_details === NULL ) {
34 $errors[] = $api->error();
36 $person_detail= $person_details[0];
38 $first_name= $person_detail['first_name'];
39 $last_name= $person_detail['last_name'];
40 $title= $person_detail['title'];
41 $email= $person_detail['email'];
42 $phone= $person_detail['phone'];
43 $url= $person_detail['url'];
44 $bio= $person_detail['bio'];
49 require_once 'plc_drupal.php';
50 drupal_set_title('Update Person');
51 include 'plc_header.php';
55 <h2>Update Account</h2>
58 if( count($errors) > 0 )
60 print( "<p><strong>The following errors occured:</strong>" );
61 print( "<font color='red' size='-1'><ul>\n" );
62 foreach( $errors as $err )
64 print( "<li>$err\n" );
66 print( "</ul></font>\n" );
70 <h3>Personal Information</h3>
72 <form method="post" action="update.php?id=<?php print($person_id); ?>">
73 <input type="hidden" name="submitted" value="1">
75 <table width="100%" cellspacing="0" cellpadding="4" border="0">
79 <td><input type="text" name="first_name"
80 value="<?php print($first_name); ?>" size="30" maxlength="256"></td>
85 <td><input type="text" name="last_name"
86 value="<?php print($last_name); ?>" size="30" maxlength="256"></td>
91 <td><input type="text" name="title"
92 value="<?php print($title); ?>" size="30" maxlength="256"></td>
97 <td><input type="text" name="email"
98 value="<?php print($email); ?>" size="30" maxlength="256"></td>
103 <td><input type="text" name="phone"
104 value="<?php print($phone); ?>" size="30" maxlength="32"></td>
109 <td><input type="text" name="url"
110 value="<?php print($url); ?>" size="30" maxlength="200"></td>
114 <td valign=top>Bio:</td>
115 <td><textarea name="bio" cols="40" rows="5" wrap>
116 <?php print($bio); ?>
121 <td>Password (blank for no change):</td>
122 <td><input type="password" name="password1" size="30" maxlength="256"></td>
126 <td>Repeat Password:</td>
127 <td><input type="password" name="password2" size="30" maxlength="256"></td>
132 <input type="submit" name="Submit" value="Update">
139 include 'plc_footer.php';