X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fport.pm;h=13455ca894879fe2083189e79a0e08e432225474;hb=8c1f9804d9a02c0c054eededeb500c72a640249a;hp=ee4611d212a67c20944d497af08a06f2adb6fda8;hpb=c7effea426d7cefcebc4b32f162fd1719095fc12;p=freeside.git diff --git a/FS/FS/port.pm b/FS/FS/port.pm index ee4611d21..13455ca89 100644 --- a/FS/FS/port.pm +++ b/FS/FS/port.pm @@ -104,7 +104,7 @@ sub check { my $self = shift; my $error = $self->ut_numbern('portnum') - || $self->ut_ipn('ipn') + || $self->ut_ipn('ip') || $self->ut_numbern('nasport') || $self->ut_number('nasnum'); ; @@ -118,53 +118,41 @@ sub check { =item session -Returns the currently open session, or if no session is currently open, the -most recent session. See L. +Returns the currently open session on this port, or if no session is currently +open, the most recent session. See L. =cut - +sub session { + my $self = shift; + qsearchs('session', { 'portnum' => $self->portnum }, '*', + 'ORDER BY login DESC LIMIT 1' ); +} =back =head1 VERSION -$Id: port.pm,v 1.2 2000-12-03 13:44:05 ivan Exp $ +$Id: port.pm,v 1.5 2001-02-14 04:33:06 ivan Exp $ =head1 BUGS The author forgot to customize this manpage. -=head1 SEE ALSO - -L, schema.html from the base documentation. - -=head1 HISTORY - -ivan@voicenet.com 97-jul-1 +The session method won't deal well if you have multiple open sessions on a +port, for example if your RADIUS server drops B records. Suggestions for +how to deal with this sort of lossage welcome; should we close the session +when we get a new session on that port? Tag it as invalid somehow? Close it +one second after it was opened? *sigh* Maybe FS::session shouldn't let you +create overlapping sessions, at least folks will find out their logging is +dropping records. -added hfields -ivan@sisd.com 97-nov-13 +If you think the above refers multiple user logins you need to read the +manpages again. -$Log: port.pm,v $ -Revision 1.2 2000-12-03 13:44:05 ivan -beginnings of web status for session monitor - -Revision 1.1 2000/10/27 20:18:32 ivan -oops, also necessary for session monitor - -Revision 1.1 1999/08/04 08:03:03 ivan -move table subclass examples out of production directory - -Revision 1.4 1998/12/29 11:59:57 ivan -mostly properly OO, some work still to be done with svc_ stuff - -Revision 1.3 1998/11/15 04:33:00 ivan -updates for newest versoin - -Revision 1.2 1998/11/15 03:48:49 ivan -update for current version +=head1 SEE ALSO +L, schema.html from the base documentation. =cut