[freeside-commits]
freeside/FS/FS Record.pm, 1.128, 1.129 Schema.pm,
1.38, 1.39 svc_broadband.pm, 1.7, 1.8
Jeff Finucane,420,,
jeff at wavetail.420.am
Fri Dec 22 21:37:49 PST 2006
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv21554/FS/FS
Modified Files:
Record.pm Schema.pm svc_broadband.pm
Log Message:
inital prizm support
Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- Schema.pm 20 Dec 2006 09:49:08 -0000 1.38
+++ Schema.pm 23 Dec 2006 05:37:46 -0000 1.39
@@ -1149,9 +1149,11 @@
'speed_down', 'int', '', '', '', '',
'ip_addr', 'varchar', '', 15, '', '',
'mac_addr', 'varchar', 'NULL', 12, '', '',
+ 'authkey', 'varchar', 'NULL', 32, '', '',
'latitude', 'decimal', 'NULL', '', '', '',
'longitude', 'decimal', 'NULL', '', '', '',
- 'vlan', 'int', 'NULL', '', '', '',
+ 'altitude', 'decimal', 'NULL', '', '', '',
+ 'vlan_profile', 'varchar', 'NULL', $char_d, '', '',
],
'primary_key' => 'svcnum',
'unique' => [],
Index: svc_broadband.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_broadband.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- svc_broadband.pm 7 Dec 2006 02:40:31 -0000 1.7
+++ svc_broadband.pm 23 Dec 2006 05:37:46 -0000 1.8
@@ -155,16 +155,17 @@
|| $self->ut_number('speed_down')
|| $self->ut_ipn('ip_addr')
|| $self->ut_hexn('mac_addr')
- || $self->ut_numbern('vlan')
+ || $self->ut_hexn('auth_key')
+ || $self->ut_floatn('latitude')
+ || $self->ut_floatn('longitude')
+ || $self->ut_floatn('altitude')
+ || $self->ut_textn('vlan_profile')
;
return $error if $error;
if($self->speed_up < 0) { return 'speed_up must be positive'; }
if($self->speed_down < 0) { return 'speed_down must be positive'; }
- if($self->vlan < 0 || $self->vlan > 4096) { # apropos?
- return 'vlan is out of range'; }
-
if($self->latitude < -90 || $self->latitude > 90) {
return 'latitude must be between -90 and 90';
}
Index: Record.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Record.pm,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- Record.pm 14 Dec 2006 06:00:45 -0000 1.128
+++ Record.pm 23 Dec 2006 05:37:46 -0000 1.129
@@ -84,6 +84,7 @@
$value = $record->unique('column');
$error = $record->ut_float('column');
+ $error = $record->ut_floatn('column');
$error = $record->ut_number('column');
$error = $record->ut_numbern('column');
$error = $record->ut_snumber('column');
@@ -1285,11 +1286,29 @@
$self->setfield($field,$1);
'';
}
+=item ut_floatn COLUMN
+
+Check/untaint floating point numeric data: 1.1, 1, 1.1e10, 1e10. May be
+null. If there is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub ut_floatn {
+ my($self,$field)=@_ ;
+ ($self->getfield($field) =~ /^(\d*)$/ ||
+ $self->getfield($field) =~ /^(-?\d+\.\d+)$/ ||
+ $self->getfield($field) =~ /^(-?\d+)$/ ||
+ $self->getfield($field) =~ /^(-?\d+\.\d+e\d+)$/ ||
+ $self->getfield($field) =~ /^(-?\d+e\d+)$/)
+ or return "Illegal or empty (float) $field: ". $self->getfield($field);
+ $self->setfield($field,$1);
+ '';
+}
=item ut_snumber COLUMN
-Check/untaint signed numeric data (whole numbers). May not be null. If there
-is an error, returns the error, otherwise returns false.
+Check/untaint signed numeric data (whole numbers). If there is an error,
+returns the error, otherwise returns false.
=cut
More information about the freeside-commits
mailing list