terminalsecurity/SCP/SCPTimestampPlugin/src/SCPTimestampPlugin.cpp
branchRCL_3
changeset 34 696f5dd11939
parent 19 86979fe66c4c
child 59 13d7c31c74e0
--- a/terminalsecurity/SCP/SCPTimestampPlugin/src/SCPTimestampPlugin.cpp	Tue May 25 13:36:17 2010 +0300
+++ b/terminalsecurity/SCP/SCPTimestampPlugin/src/SCPTimestampPlugin.cpp	Wed Jun 09 10:37:30 2010 +0300
@@ -298,7 +298,8 @@
         iConfiguration->Get( KSCPUsedTolerance, tolerance ); // ignore errors
         Dprint( ( _L( "CSCPPatternPlugin::IsChangeAllowedL(): tolerance get: %d"), tolerance ) );                
         Dprint( ( _L( "CSCPPatternPlugin::IsChangeAllowedL(): iMinTolerance : %d"), iMinTolerance ) );                
-        if ( tolerance >= iMinTolerance )
+
+        if ( iMinTolerance > 0 && tolerance >= iMinTolerance )
             {
             ret = KErrSCPCodeChangeNotAllowed;
             Dprint( (_L("CSCPTimestampPlugin::IsChangeAllowedL() KErrSCPCodeChangeNotAllowed") )); 
@@ -426,11 +427,13 @@
             {
             // Set the last time the password was changed, for expiration
             iConfiguration->Set( KSCPLastChangeTime, timeBuf );
-            }        
+            }
+
         Dprint( ( _L( "CSCPPatternPlugin::PasswordChanged(): iMinInterval: %d"), iMinInterval ) );
-        if ( iMinInterval > 0 )
-            {
+
+        if ( iMinInterval > 0 && iMinTolerance > 0) {
             TInt ret = IsAfter( KSCPIntervalStartTime, iMinInterval, KSCPTypeHours );
+
             if ( ret == KSCPIsAfter )
                 {                                                        
                 // Interval exceeded, start a new interval from here
@@ -462,7 +465,12 @@
                 Dprint( ( _L( "CSCPPatternPlugin::PasswordChanged(): tolerance set: %d"), tolerance ) );  
                 }                       
             }        
-        
+		else {
+			iConfiguration->Set( KSCPIntervalStartTime, 0 );
+			iConfiguration->Set( KSCPUsedTolerance, 0 );
+		}
+
+
         WriteConfiguration();
         }
         else