use utf8;
use warnings; no warnings "redefine";
use strict;
use Loader qw(line_in log_update valid_handle);
use Dbase::Help qw(qquote Do DoFn);

sub set_handle_user($;$$) {
	my($pers,$nic,$kn) = @_; 

	return unless valid_handle($pers,$nic,1,$kn);

	my $hand = line_in "NIC-Username: ";
	return undef if $hand eq "";

	if($hand ne "-") {
		$hand = qquote($hand);
	} else {
		$hand = "NULL";
	}
	log_update("nic","person",$pers,"nic",$nic,undef,"username",undef,
		DoFn("select username from nic where person=$pers and nic=$nic"));
	Do("update nic set username=$hand where person=$pers and nic=$nic");
	1;
}
1;
