[freeside-commits] freeside/FS/FS svc_phone.pm,1.8,1.9
Ivan,,,
ivan at wavetail.420.am
Mon Jul 21 03:42:31 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv11404
Modified Files:
svc_phone.pm
Log Message:
generate a SIP password if it is blank
Index: svc_phone.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_phone.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- svc_phone.pm 1 Jul 2008 00:11:46 -0000 1.8
+++ svc_phone.pm 21 Jul 2008 10:42:29 -0000 1.9
@@ -1,12 +1,15 @@
package FS::svc_phone;
use strict;
-use vars qw( @ISA );
+use vars qw( @ISA @pw_set );
#use FS::Record qw( qsearch qsearchs );
use FS::svc_Common;
@ISA = qw( FS::svc_Common );
+#avoid l 1 and o O 0
+ at pw_set = ( 'a'..'k', 'm','n', 'p-z', 'A'..'N', 'P'..'Z' , '2'..'9' );
+
=head1 NAME
FS::svc_phone - Object methods for svc_phone records
@@ -184,6 +187,14 @@
$self->countrycode(1) unless $self->countrycode;
+ unless ( length($self->sip_password) ) {
+
+ $self->sip_password(
+ join('', map $pw_set[ int(rand $#pw_set) ], (0..16) )
+ );
+
+ }
+
$self->SUPER::check;
}
More information about the freeside-commits
mailing list