# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277128196 -10800 # Node ID 352850cbed81aa883e7027e6fa18815149af6a9b # Parent 74294b43d4011d87255466a2a7df01fe0989e1d6 Revision: 201023 Kit: 2010125 diff -r 74294b43d401 -r 352850cbed81 vpnclient_sis/group/create_vpnclient_sis.pl --- a/vpnclient_sis/group/create_vpnclient_sis.pl Wed Jun 09 10:48:33 2010 +0300 +++ b/vpnclient_sis/group/create_vpnclient_sis.pl Mon Jun 21 16:49:56 2010 +0300 @@ -101,10 +101,7 @@ # remove temp files unlink ; - -} -elsif ($config eq "UDEB") -{ + # nokia_vpn_client_localised_armv5_udeb.pkg replace_line_and_create_temp( '^\(0x101F5147\),.*?,.*?,.*?, TYPE=SA, RU$', @@ -121,6 +118,11 @@ # remove temp files unlink ; + +} +elsif ($config eq "UDEB") +{ +#empty } else { diff -r 74294b43d401 -r 352850cbed81 vpnengine/vpnmanager/group/vpnmanager.mmp --- a/vpnengine/vpnmanager/group/vpnmanager.mmp Wed Jun 09 10:48:33 2010 +0300 +++ b/vpnengine/vpnmanager/group/vpnmanager.mmp Mon Jun 21 16:49:56 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,7 +21,7 @@ TARGETTYPE exe UID 0x1000008d 0x101F7993 -CAPABILITY NetworkControl NetworkServices ProtServ WriteDeviceData +CAPABILITY NetworkControl NetworkServices ProtServ WriteDeviceData ReadDeviceData VENDORID VID_DEFAULT SOURCEPATH ../src @@ -75,6 +75,7 @@ LIBRARY charconv.lib LIBRARY cmmanager.lib LIBRARY cryptography.lib +LIBRARY centralrepository.lib DEBUGLIBRARY flogger.lib diff -r 74294b43d401 -r 352850cbed81 vpnengine/vpnmanager/group/vpnmanager_test.mmp --- a/vpnengine/vpnmanager/group/vpnmanager_test.mmp Wed Jun 09 10:48:33 2010 +0300 +++ b/vpnengine/vpnmanager/group/vpnmanager_test.mmp Mon Jun 21 16:49:56 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,23 +15,21 @@ * */ - - #include TARGET vpnmanager.exe TARGETTYPE exe UID 0x1000008d 0x101F7993 -CAPABILITY NetworkControl NetworkServices ProtServ WriteDeviceData +CAPABILITY NetworkControl NetworkServices ProtServ WriteDeviceData ReadDeviceData VENDORID VID_DEFAULT SOURCEPATH ../src SOURCE fileutil.cpp -SOURCE pinparser.cpp -SOURCE pkiutil.cpp +SOURCE pinparser.cpp +SOURCE pkiutil.cpp SOURCE pwdchanger.cpp -SOURCE policyimporter.cpp +SOURCE policyimporter.cpp SOURCE policypatcher.cpp SOURCE policystore.cpp SOURCE vpnapiservant.cpp @@ -78,6 +76,7 @@ LIBRARY charconv.lib LIBRARY cmmanager.lib LIBRARY cryptography.lib +LIBRARY centralrepository.lib DEBUGLIBRARY flogger.lib diff -r 74294b43d401 -r 352850cbed81 vpnengine/vpnmanager/src/policystore.cpp --- a/vpnengine/vpnmanager/src/policystore.cpp Wed Jun 09 10:48:33 2010 +0300 +++ b/vpnengine/vpnmanager/src/policystore.cpp Mon Jun 21 16:49:56 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2000-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,11 +15,11 @@ * */ - - #include #include #include // vpn plugin +#include +#include #include "policystore.h" #include "pinparser.h" #include "ikepolparser.h" @@ -188,6 +188,39 @@ iFileUtil.DeleteFileL(*polFile); } CleanupStack::PopAndDestroy(2); // polFile, pinFile + + // Policy was deleted successfully. + TUint policyCount = PolicyCount(); + + if ( policyCount == 0 ) + { + CRepository* repository = CRepository::NewLC( KCRUidBrowser ); + TInt tempMode; + TBrowserCenRepApSelectionModeValues mode; + + TUint err = repository->Get( KBrowserOccAccessPointSelectionMode, tempMode ); + mode = static_cast ( tempMode ); + + // This was the last policy. Now restore old value, if appropriate. + if (mode != EBrowserCenRepApSelModeAlwaysAsk) + { + // Nothing to change because user has edited the setting in meanwhile and this code will not + // mess up user's choice. + LOG(Log::Printf(_L("Browser user has changed mode from EBrowserCenRepApSelModeAlwaysAsk - no change"))); + } + else + { + // Reset to original value + TInt err = repository->Reset( KBrowserOccAccessPointSelectionMode ); + LOG(Log::Printf(_L("Set KBrowserOccAccessPointSelectionMode -> Original value"))); + } + CleanupStack::PopAndDestroy( repository ); + } + else + { + LOG(Log::Printf(_L("Browser settings not changed because policy count > 0"))); + } + LOG(Log::Printf(_L("<- CPolicyStore::DeletePolicyL()"))); return KErrNone; } @@ -298,6 +331,40 @@ } CleanupStack::PopAndDestroy(policyInfo); + + // Policy was installed successfully. + // Now change Browser's settings so that it must ask always for SNAP/IAP. + // This is done because otherwise the VPN usage is seen difficult for Browser users. + TUint policyCount = PolicyCount(); + + if ( policyCount == 1 ) + { + CRepository* repository = CRepository::NewLC( KCRUidBrowser ); + TInt tempMode; + TBrowserCenRepApSelectionModeValues mode; + + TInt err = repository->Get( KBrowserOccAccessPointSelectionMode, tempMode ); + mode = static_cast ( tempMode ); + + // This is the first policy. Now do the changes and save old value. + if (mode == EBrowserCenRepApSelModeAlwaysAsk) + { + // Nothing to change + LOG(Log::Printf(_L("Browser already uses mode EBrowserCenRepApSelModeAlwaysAsk"))); + } + else + { + TInt err = repository->Set( KBrowserOccAccessPointSelectionMode, EBrowserCenRepApSelModeAlwaysAsk ); + LOG_1("Set KBrowserOccAccessPointSelectionMode -> EBrowserCenRepApSelModeAlwaysAsk, error code: %d", err); + } + + CleanupStack::PopAndDestroy( repository ); + } + else + { + LOG(Log::Printf(_L("Browser settings not changed because policy count > 1"))); + } + LOG(Log::Printf(_L("<- CPolicyStore::AddPolicyL"))); }