Put something along the lines of this in functions.php or a plugin. It may need some tweaking and modification, it's not intended as an 'as is' example, but it should put you on the right path.
The following adds a new field UI to the default registration form, and then checks if its 11 characters long, and that no other user has the same UID. It stores the UID in the users meta data.
If you have a custom registration form, a text input with the name 'user_uid' will suffice, and to grab the uid of a user, use: $uid = get_the_author_meta( 'user_uid', $user->ID );
Example as follows:
<?php
add_action('register_form','show_uid_field');
add_action('register_post','check_fields',10,3);
add_action('user_register', 'register_extra_fields');
function show_uid_field(){
?>
<p>
<label>Unique ID<br />
<input id="user_uid" class="input" type="text" tabindex="20" size="25" value="<?php echo $_POST['user_uid']; ?>" name="first"/>
</label>
</p>
<?php
}
function check_fields($login, $email, $errors) {
global $user_uid;
if ($_POST['user_uid'] == '') {
$errors->add('empty_user_uid', "<strong>ERROR</strong>: Please Enter your UID");
} else {
$user_uid = $_POST['user_uid'];
if(strlen(trim($user_uid)) != 11){
$errors->add('invalid_user_uid', "<strong>ERROR</strong>: Invalid value, please Enter your UID");
} else {
$szSort = "user_nicename";
$aUsersID = $wpdb->get_col( $wpdb->prepare( "SELECT $wpdb->users.ID FROM $wpdb->users ORDER BY %s ASC", $szSort ));
foreach ( $aUsersID as $iUserID ) {
$user = get_userdata( $iUserID );
$uid = get_the_author_meta( 'user_uid', $user->ID );
if($uid == $user_uid){
$errors->add('notunique_user_uid', "<strong>ERROR</strong>: This UID is already taken, please enter your UID");
break;
}
}
// do your soap check here
}
}
}
function register_extra_fields($user_id, $password="", $meta=array()) {
update_usermeta( $user_id, 'user_uid', $_POST['user_uid'] );
}
?>
I would also note that while gravity forms is great, if your trying to extend it your in for a world of pain.