Setting tag plewww-4.3-67
[plewww.git] / planetlab / persons / update.php
index cd7f99c..96d626b 100644 (file)
@@ -9,7 +9,6 @@ global $plc, $api;
 
 // Common functions
 require_once 'plc_functions.php';
-require_once 'plc_sorts.php';
 
 // find person roles
 $_person= $plc->person;
@@ -22,51 +21,12 @@ $is_submitted= isset($_POST['submitted']) ? $_POST['submitted'] : 0;
 if( isset($_GET['id']) && is_numeric($_GET['id']) ) {
   $person_id= intval($_GET['id']);
  } else {
-  header( "location: index.php" );
-  exit();
+  plc_redirect (l_sites());
  }
 
 $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" ) );
@@ -97,7 +57,7 @@ include 'plc_header.php';
 <?
 if( count($errors) > 0 )
 {
-  print( "<p><strong>The following errors occured:</strong>" );
+  print( "<p><span class='bold'>The following errors occured:</span>" );
   print( "<font color='red' size='-1'><ul>\n" );
   foreach( $errors as $err )
     {