add vpopmail presets to shellcommands_withdomain export
[freeside.git] / FS / FS / part_export / sqlradius.pm
index 0f93703..60450ee 100644 (file)
@@ -187,11 +187,15 @@ sub sqlradius_insert { #subroutine, not method
     } else {
 
       my $i_sth = $dbh->prepare(
-        "INSERT INTO rad$table ( UserName, Attribute, Value ) ".
-          "VALUES ( ?, ?, ? )"
+        "INSERT INTO rad$table ( UserName, Attribute, op, Value ) ".
+          "VALUES ( ?, ?, ?, ? )"
       ) or die $dbh->errstr;
-      $i_sth->execute( $username, $attribute, $attributes{$attribute} )
-        or die $i_sth->errstr;
+      $i_sth->execute(
+        $username,
+        $attribute,
+        ( $attribute =~ /Password/i ? '==' : ':=' ),
+        $attributes{$attribute},
+      ) or die $i_sth->errstr;
 
     }
 
@@ -207,7 +211,7 @@ sub sqlradius_usergroup_insert { #subroutine, not method
     "INSERT INTO usergroup ( UserName, GroupName ) VALUES ( ?, ? )"
   ) or die $dbh->errstr;
   foreach my $group ( @groups ) {
-    $sth->execute( '', $username, $group )
+    $sth->execute( $username, $group )
       or die "can't insert into groupname table: ". $sth->errstr;
   }
   $dbh->disconnect;