$val ) { if( $val == '' ) pla_error( "Error, you left the value for required attribute " . htmlspecialchars( $attr ) . " blank." ); $attr = stripslashes( $attr ); $val = stripslashes( $val ); $new_entry[ $attr ][] = utf8_encode( $val ); } } if( isset( $vals ) && is_array( $vals ) ) { foreach( $vals as $i => $val ) { $val = stripslashes( $val ); $attr = $attrs[$i]; $attr = stripslashes( $attr ); if( trim($val) ) $new_entry[ $attr ][] = utf8_encode( $val ); } } $new_entry['objectClass'] = $object_classes; if( ! in_array( 'top', $new_entry['objectClass'] ) ) $new_entry['objectClass'][] = 'top'; $ds = pla_ldap_connect( $server_id ); $add_result = @ldap_add( $ds, $new_dn, $new_entry ); if( $add_result ) { $edit_url="edit.php?server_id=$server_id&dn=" . rawurlencode( $new_dn ); // update the session tree to reflect the change session_start(); if( session_is_registered( 'tree' ) ) { $tree = $_SESSION['tree']; $tree_icons = $_SESSION['tree_icons']; if( isset( $tree[$server_id][$container] ) ) { $tree[$server_id][$container][] = $new_dn; $tree_icons[$server_id][$new_dn] = get_icon( $server_id, $new_dn ); } $_SESSION['tree'] = $tree; $_SESSION['tree_icons'] = $tree_icons; session_write_close(); } ?>
Redirecting... here.