+ die "cyrus_insert: error setquota user.$username: $error" if $error;
+ }
+
+ 1;
+}
+
+sub icradius_rc_insert {
+ my( $username, $password, %radcheck ) = @_;
+
+ my $sth = $icradius_dbh->prepare(
+ "INSERT INTO radcheck ( id, UserName, Attribute, Value ) VALUES ( ".
+ join(", ", map { $icradius_dbh->quote($_) } (
+ '',
+ $username,
+ "Password",
+ $password,
+ ) ). " )"
+ );
+ $sth->execute or die "can't insert into radcheck table: ". $sth->errstr;
+
+ foreach my $attribute ( keys %radcheck ) {
+ my $sth = $icradius_dbh->prepare(
+ "INSERT INTO radcheck ( id, UserName, Attribute, Value ) VALUES ( ".
+ join(", ", map { $icradius_dbh->quote($_) } (
+ '',
+ $username,
+ $attribute,
+ $radcheck{$attribute},
+ ) ). " )"
+ );
+ $sth->execute or die "can't insert into radcheck table: ". $sth->errstr;