@@ -32,14 +32,48 @@ UserAcct::UserAcct():User()
32
32
bytesout=0 ;
33
33
nextupdate=0 ;
34
34
starttime=0 ;
35
-
36
35
}
37
36
38
37
/* * The destructor. Nothing happens here.*/
39
38
UserAcct::~UserAcct ()
40
39
{
41
40
}
42
41
42
+ /* * The assignment-operator.
43
+ * @param u A refernece to a UserAcct.*/
44
+ UserAcct & UserAcct::operator =(const UserAcct &u)
45
+ {
46
+
47
+ if (this !=&u)
48
+ {
49
+ this ->User ::operator =(u);
50
+ this ->gigain =u.gigain ;
51
+ this ->gigaout =u.gigaout ;
52
+ this ->bytesin =u.bytesin ;
53
+ this ->bytesout =u.bytesout ;
54
+ this ->nextupdate =u.nextupdate ;
55
+ this ->starttime =u.starttime ;
56
+ }
57
+ return *this ;
58
+ }
59
+
60
+
61
+
62
+
63
+ /* *The copy constructor, it calls first the copy constructor
64
+ * of the User class.
65
+ * @param UserAcct u : A reference to an UserAcct object.*/
66
+ UserAcct::UserAcct (const UserAcct &u):User(u)
67
+ {
68
+ this ->gigain =u.gigain ;
69
+ this ->gigaout =u.gigaout ;
70
+ this ->bytesin =u.bytesin ;
71
+ this ->bytesout =u.bytesout ;
72
+ this ->nextupdate =u.nextupdate ;
73
+ this ->starttime =u.starttime ;
74
+
75
+ }
76
+
43
77
/* * The method sends an accounting update packet for the user to the radius server.
44
78
* The accounting information are read from the OpenVpn
45
79
* status file. The following attributes are sent to the radius server:
@@ -859,58 +893,7 @@ void UserAcct::addSystemRoutes(PluginContext * context)
859
893
860
894
}
861
895
862
- /* * The assignment-operator.
863
- * @param u A refernece to a UserAcct.*/
864
- UserAcct & UserAcct::operator =(const UserAcct &u)
865
- {
866
-
867
- if (this !=&u)
868
- {
869
- this ->sessionid =u.sessionid ;
870
- // this->servicetype=u.servicetype;
871
-
872
- this ->gigain =u.gigain ;
873
- this ->gigaout =u.gigaout ;
874
- this ->bytesin =u.bytesin ;
875
- this ->bytesout =u.bytesout ;
876
- this ->nextupdate =u.nextupdate ;
877
- this ->starttime =u.starttime ;
878
- }
879
- return *this ;
880
- }
881
-
882
-
883
896
884
- /* *The copy constructor, it calls first the copy constructor
885
- * of the User class.
886
- * @param UserAcct u : A reference to an UserAcct object.*/
887
- UserAcct::UserAcct (const UserAcct &u):User(u)
888
- {
889
-
890
- this ->sessionid =u.sessionid ;
891
- // this->servicetype=u.servicetype;
892
-
893
- this ->gigain =u.gigain ;
894
- this ->gigaout =u.gigaout ;
895
- this ->bytesin =u.bytesin ;
896
- this ->bytesout =u.bytesout ;
897
- this ->nextupdate =u.nextupdate ;
898
- this ->starttime =u.starttime ;
899
-
900
- }
901
-
902
- /* * The getter method for the sessionid.
903
- * @return An integer of the sessionid.*/
904
- string UserAcct::getSessionId (void )
905
- {
906
- return this ->sessionid ;
907
- }
908
- /* *The setter method for the sessionid.
909
- * @param id The session id.*/
910
- void UserAcct::setSessionId (string id)
911
- {
912
- this ->sessionid =id;
913
- }
914
897
915
898
916
899
/* * The getter method for the gigain variable.
@@ -995,7 +978,7 @@ int UserAcct::deleteCcdFile(PluginContext * context)
995
978
{
996
979
string filename;
997
980
filename = context->conf .getCcdPath ()+ this ->getCommonname ();
998
- if (context->conf .getOverWriteCCFiles ())
981
+ if (context->conf .getOverWriteCCFiles ()== true && ( this -> getFramedIp (). length () > 0 || this -> getFramedRoutes (). length () > 0 ) )
999
982
{
1000
983
remove (filename.c_str ());
1001
984
}
0 commit comments