Bug 103054: remove dead code: profile/Acct and profile/Acctidl, r=varada.
git-svn-id: svn://10.0.0.236/trunk@104730 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
c5f3324458
commit
075bab9fca
@ -1,35 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
LIBRARY_NAME = profileAcct
|
||||
IS_COMPONENT = 1
|
||||
|
||||
CPPSRCS = nsAccount.cpp
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,113 +0,0 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH = ..\..
|
||||
REQUIRES = \
|
||||
xpcom \
|
||||
string \
|
||||
profile \
|
||||
pref \
|
||||
necko \
|
||||
$(NULL)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
DLLNAME = xpacct$(MOZ_BITS)
|
||||
DLL1NAME = xaccount$(MOZ_BITS)
|
||||
PDBFILE = $(DLLNAME).pdb
|
||||
MAPFILE = $(DLLNAME).map
|
||||
DLL =.\$(OBJDIR)\$(DLLNAME).dll
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
|
||||
LCFLAGS = -DMOZILLA_CLIENT
|
||||
|
||||
# I'm hardcoding the directory name here to fix MOZ_LITE
|
||||
# it was $(DIST_PREFIX) instead of WIN, which is the same
|
||||
# in communicator, but breaks when MOZ_LITE sets $DIST to NAV
|
||||
# This will need to be fixed in a better way, but it depends
|
||||
# on the Security team to fix stuff in what is being passed here.
|
||||
# the same change was made in \ns\cmd\winfe\mkfiles32\mozilla.mak
|
||||
!if ("$(MOZ_BITS)" == "16" )
|
||||
BINREL_DIST = $(DIST)
|
||||
!else
|
||||
!ifndef MOZ_DEBUG
|
||||
BINREL_DIST=$(XPDIST)\WIN954.0_OPT.OBJ
|
||||
!else
|
||||
BINREL_DIST=$(XPDIST)\WIN954.0_DBG.OBJD
|
||||
!endif
|
||||
!endif
|
||||
|
||||
# DEFFILE = $(DLLNAME).def
|
||||
LLIBS = \
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\xpcom.lib
|
||||
|
||||
WIN_LIBS = \
|
||||
# rasapi32.lib \
|
||||
ole32.lib \
|
||||
tapi32.lib \
|
||||
shell32.lib
|
||||
#// $(DLL_LIBS)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the files necessary to build the target (ie. OBJS)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\dialshr.obj \
|
||||
.\$(OBJDIR)\nsAccount.obj \
|
||||
.\$(OBJDIR)\rasnt40.obj \
|
||||
.\$(OBJDIR)\ras95.obj \
|
||||
$(NULL)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
|
||||
#// (these must be defined before the common makefiles are included)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
|
||||
@ -1,909 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
//#include <afxwin.h> // MFC core and standard components
|
||||
//#include <afxext.h> // MFC extensions
|
||||
|
||||
#define NS_IMPL_IDS
|
||||
|
||||
#include "dialshr.h"
|
||||
|
||||
#include "nsIAccount.h"
|
||||
#include "nsIPref.h"
|
||||
|
||||
//#include "pratom.h"
|
||||
#include "prmem.h"
|
||||
//#include "nsIRegistry.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "plstr.h"
|
||||
#include "nsIFileSpec.h"
|
||||
#include "nsFileStream.h"
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
//#include "nsIFileLocator.h"
|
||||
//#include "nsFileLocations.h"
|
||||
//#include "nsEscape.h"
|
||||
|
||||
#include "nsIPersistentProperties2.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsNetUtil.h"
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIEnumerator.h"
|
||||
#include <iostream.h> //BAD DOG -- no biscuit!
|
||||
|
||||
#include "nsSpecialSystemDirectory.h"
|
||||
|
||||
#define TEST_URL "resource:/res/test.properties"
|
||||
|
||||
#define NETLIB_DLL "netlib.dll"
|
||||
#define RAPTORBASE_DLL "raptorbase.dll"
|
||||
#define XPCOM_DLL "xpcom32.dll"
|
||||
|
||||
static NS_DEFINE_IID(kIPersistentPropertiesIID, NS_IPERSISTENTPROPERTIES_IID);
|
||||
|
||||
//#ifdef XP_PC
|
||||
#include <direct.h>
|
||||
//#endif
|
||||
|
||||
// included for XPlatform coding
|
||||
//#include "nsFileStream.h"
|
||||
//#include "nsSpecialSystemDirectory.h"
|
||||
|
||||
|
||||
#ifdef XP_MAC
|
||||
//#include "nsIPrompt.h"
|
||||
//#include "nsIStreamListener.h"
|
||||
#endif
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
#define _MAX_LENGTH 256
|
||||
#define _MAX_NUM_PROFILES 50
|
||||
//MUC variables
|
||||
/**
|
||||
enum
|
||||
{
|
||||
// kGetPluginVersion,
|
||||
kCheckEnv,
|
||||
kSelectAcctConfig,
|
||||
kSelectModemConfig,
|
||||
kSelectDialOnDemand,
|
||||
kConfigureDialer,
|
||||
kConnect,
|
||||
kHangup,
|
||||
kEditEntry,
|
||||
kDeleteEntry,
|
||||
kRenameEntry,
|
||||
kMonitor,
|
||||
};
|
||||
**/
|
||||
int gPlatformOS;
|
||||
HINSTANCE gDLL;
|
||||
|
||||
//CMucApp gMUCDLL;
|
||||
#define _MAX_NUM_PROFILES 50
|
||||
#define _MAX_LENGTH 256
|
||||
|
||||
//end of muc variables
|
||||
|
||||
// Globals to hold profile information
|
||||
#ifdef XP_PC
|
||||
//static char *oldWinReg="nsreg.dat";
|
||||
#endif
|
||||
|
||||
//static char gNewAccountData[_MAX_NUM_PROFILES][_MAX_LENGTH] = {'\0'};
|
||||
static int g_Count = 0;
|
||||
|
||||
static char gNCIInfo[_MAX_NUM_PROFILES][_MAX_LENGTH] = {'\0'};
|
||||
static int NCICount = 0;
|
||||
|
||||
static char IspLocation[_MAX_NUM_PROFILES][_MAX_LENGTH] = {'\0'};
|
||||
static int LocCount = 0;
|
||||
|
||||
static char IspPhone[_MAX_NUM_PROFILES][_MAX_LENGTH] = {'\0'};
|
||||
static int PhoneCount = 0;
|
||||
|
||||
char domainname[256];
|
||||
char dnsp[24];
|
||||
char dnss[24];
|
||||
|
||||
// IID and CIDs of all the services needed
|
||||
static NS_DEFINE_CID(kAccountCID, NS_Account_CID);
|
||||
//static NS_DEFINE_IID(kIFileLocatorIID, NS_IFILELOCATOR_IID);
|
||||
|
||||
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
|
||||
//static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
|
||||
//static NS_DEFINE_CID(kRegistryCID, NS_REGISTRY_CID);
|
||||
//static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
||||
|
||||
|
||||
class nsAccount: public nsIAccount {
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
private:
|
||||
static void useDefaultAccountFile(nsAccount *aAccountInst);
|
||||
static nsAccount *mInstance;
|
||||
// nsIRegistry* m_reg;
|
||||
|
||||
public:
|
||||
nsAccount();
|
||||
virtual ~nsAccount();
|
||||
static nsAccount *GetInstance();
|
||||
|
||||
int Parent(const char* relativePath, nsFileSpec& outParent);
|
||||
int IterateDirectoryChildren(nsFileSpec& startChild);
|
||||
int GetNCIValues(nsString MiddleValue);
|
||||
int GetConfigValues(nsString fileName);
|
||||
//extra stuff from dial
|
||||
// BOOL LoadRasFunctions( LPCSTR lpszLibrary );
|
||||
// SizeofRAS95();
|
||||
|
||||
// Initialize/shutdown
|
||||
NS_IMETHOD Startup(void);
|
||||
NS_IMETHOD Shutdown();
|
||||
|
||||
// Getters
|
||||
NS_IMETHOD GetAcctConfig(nsString& AccountList);
|
||||
NS_IMETHOD GetModemConfig(nsString& ModemList);
|
||||
NS_IMETHOD GetLocation(nsString& Locat);
|
||||
NS_IMETHOD GetSiteName(nsString& SiteList);
|
||||
NS_IMETHOD GetPhone(nsString& PhoneList);
|
||||
NS_IMETHOD LoadValues(void);
|
||||
NS_IMETHOD CheckForDun(nsString& dun);
|
||||
|
||||
|
||||
|
||||
// NS_IMETHOD GetModemConfig(nsString returnData);
|
||||
NS_IMETHOD SetDialerConfig(char* returnData);
|
||||
|
||||
//**NS_IMETHOD PEPluginFunc( long selectorCode, void* paramBlock, void* returnData );
|
||||
// char* GetModemConfig(void);
|
||||
|
||||
};
|
||||
|
||||
nsAccount* nsAccount::mInstance = nsnull;
|
||||
|
||||
static PRInt32 g_InstanceCount = 0;
|
||||
static PRInt32 g_LockCount = 0;
|
||||
|
||||
/*
|
||||
* Constructor/Destructor
|
||||
*/
|
||||
nsAccount::nsAccount()
|
||||
//: m_reg(nsnull)
|
||||
{
|
||||
PR_AtomicIncrement(&g_InstanceCount);
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
nsAccount::~nsAccount() {
|
||||
PR_AtomicDecrement(&g_InstanceCount);
|
||||
mInstance = nsnull;
|
||||
}
|
||||
|
||||
nsAccount *nsAccount::GetInstance()
|
||||
{
|
||||
if (mInstance == nsnull) {
|
||||
mInstance = new nsAccount();
|
||||
}
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
/*
|
||||
* nsISupports Implementation
|
||||
*/
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsAccount, nsIAccount)
|
||||
|
||||
/*
|
||||
* nsIProfile Implementation
|
||||
*/
|
||||
// Creates an instance of the mozRegistry (m_reg)
|
||||
// or any other registry that would be finalized for 5.0
|
||||
// Adds subtree Profiles to facilitate profile operations
|
||||
NS_IMETHODIMP nsAccount::Startup(void)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// SetDialogBkColor(); // Set dialog background color to gray
|
||||
// LoadStdProfileSettings(); // Load standard INI file options (including MRU)
|
||||
|
||||
|
||||
OSVERSIONINFO* lpOsVersionInfo = new OSVERSIONINFO;
|
||||
lpOsVersionInfo->dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
|
||||
|
||||
if ( GetVersionEx( lpOsVersionInfo ) )
|
||||
gPlatformOS = (int)lpOsVersionInfo->dwPlatformId;
|
||||
else
|
||||
gPlatformOS = VER_PLATFORM_WIN32_WINDOWS; // Make reasonable assumption
|
||||
|
||||
switch ( gPlatformOS )
|
||||
{
|
||||
case VER_PLATFORM_WIN32_WINDOWS: //win95
|
||||
if( !LoadRasFunctions( "rasapi32.dll" ) )
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case VER_PLATFORM_WIN32_NT: // win nt
|
||||
if( !LoadRasFunctionsNT( "rasapi32.dll" ) )
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsAccount::Shutdown()
|
||||
{
|
||||
if ( lpOsVersionInfo != NULL )
|
||||
{
|
||||
delete lpOsVersionInfo;
|
||||
lpOsVersionInfo = NULL;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Getters
|
||||
*/
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
int nsAccount::Parent(
|
||||
const char* relativePath,
|
||||
nsFileSpec& outParent)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsFilePath myTextFilePath(relativePath, PR_TRUE);
|
||||
const char* pathAsString = (const char*)myTextFilePath;
|
||||
nsOutputConsoleStream mConsole;
|
||||
|
||||
nsFileSpec mySpec(myTextFilePath);
|
||||
|
||||
mySpec.GetParent(outParent);
|
||||
nsFilePath parentPath(outParent);
|
||||
nsFileURL url(parentPath);
|
||||
mConsole
|
||||
<< "GetParent() on "
|
||||
<< "\n\t" << pathAsString
|
||||
<< "\n yields "
|
||||
<< "\n\t" << (const char*)parentPath
|
||||
<< "\n or as a URL"
|
||||
<< "\n\t" << (const char*)url
|
||||
<< nsEndl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
int nsAccount::IterateDirectoryChildren(nsFileSpec& startChild)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// - Test of directory iterator
|
||||
nsresult rv=NS_OK;
|
||||
nsOutputConsoleStream mConsole;
|
||||
|
||||
nsFileSpec grandparent;
|
||||
startChild.GetParent(grandparent); // should be the original default directory.
|
||||
nsFilePath grandparentPath(startChild);
|
||||
mConsole << "Forwards listing of " << (const char*)grandparentPath << ":" << nsEndl;
|
||||
printf ("Outside the iteration \n");
|
||||
for (nsDirectoryIterator i(startChild, +1); i.Exists(); i++)
|
||||
{
|
||||
printf ("Inside the iteration \n");
|
||||
|
||||
char* itemName = (i.Spec()).GetLeafName();
|
||||
PL_strcpy(gNCIInfo[NCICount], itemName);
|
||||
mConsole << '\t' << itemName << nsEndl;
|
||||
mConsole << '\t' << "This is the arraynumber "<<NCICount<<"and value" <<gNCIInfo[NCICount] << nsEndl;
|
||||
nsCRT::free(itemName);
|
||||
NCICount++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsAccount::GetNCIValues(nsString MiddleValue)
|
||||
{
|
||||
nsresult ret;
|
||||
|
||||
nsIInputStream* in = nsnull;
|
||||
nsAutoString Trial(NS_LITERAL_STRING("resource:/res/acct/NCI_Dir/") +
|
||||
MiddleValue);
|
||||
printf("this is the trial value %s \n", NS_LossyConvertUCS2toASCII(Trial).get());
|
||||
nsCOMPtr<nsIIOService> service(do_GetService(kIOServiceCID, &ret));
|
||||
if (NS_FAILED(ret)) return ret;
|
||||
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
ret = NS_NewURI(getter_AddRefs(uri), Trial, nsnull, service);
|
||||
if (NS_FAILED(ret)) return ret;
|
||||
|
||||
nsIChannel *channel = nsnull;
|
||||
ret = NS_OpenURI(&channel, uri, service);
|
||||
if (NS_FAILED(ret)) return ret;
|
||||
|
||||
ret = channel->Open(&in);
|
||||
if (NS_FAILED(ret)) return ret;
|
||||
|
||||
nsIPersistentProperties* props = nsnull;
|
||||
|
||||
ret = nsComponentManager::CreateInstance(kPersistentPropertiesCID, NULL,
|
||||
kIPersistentPropertiesIID, (void**) &props);
|
||||
if (NS_FAILED(ret) || (!props)) {
|
||||
printf("create nsIPersistentProperties failed\n");
|
||||
return 1;
|
||||
}
|
||||
ret = props->Load(in);
|
||||
if (NS_FAILED(ret)) {
|
||||
printf("cannot load properties\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ind = 1;
|
||||
|
||||
// while (1) {
|
||||
char name[256];
|
||||
name[0] = 0;
|
||||
nsAutoString v;
|
||||
sprintf(name, "%s", "SiteName");
|
||||
ret = props->GetStringProperty(NS_ConvertASCIItoUCS2(name), v);
|
||||
|
||||
if (NS_FAILED(ret) || (!v.Length())) {
|
||||
|
||||
printf("Failed to return the Get property \n");
|
||||
}
|
||||
|
||||
PL_strcpy(IspLocation[LocCount], NS_LossyConvertUCS2toASCII(v).get());
|
||||
|
||||
cout << "the value is " << IspLocation[LocCount] << "." << endl;
|
||||
LocCount++;
|
||||
|
||||
sprintf(name, "%s", "Phone");
|
||||
ret = props->GetStringProperty(NS_ConvertASCIItoUCS2(name), v);
|
||||
|
||||
if (NS_FAILED(ret) || (!v.Length())) {
|
||||
|
||||
printf("Failed to return the Get property \n");
|
||||
}
|
||||
char* value = ToNewCString(v);
|
||||
PL_strcpy(IspPhone[PhoneCount], value);
|
||||
// if (value) {
|
||||
cout << "the value is " << IspPhone[PhoneCount] << "." << endl;
|
||||
// printf ("this is the %d and its value \n ",ind);
|
||||
delete[] value;
|
||||
PhoneCount++;
|
||||
|
||||
// }
|
||||
// else {
|
||||
// printf("%d: ToNewCString failed\n", ind);
|
||||
// }
|
||||
// ind++;
|
||||
// }
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int nsAccount::GetConfigValues(nsString fileName)
|
||||
{
|
||||
nsresult ret;
|
||||
|
||||
nsIInputStream* in = nsnull;
|
||||
nsString Trial; Trial.AssignWithConversion("resource:/res/acct/NCI_Dir/");
|
||||
Trial = Trial + fileName;
|
||||
printf("this is the trial value %s \n", NS_LossyConvertUCS2toASCII(Trial).get());
|
||||
nsCOMPtr<nsIIOService> service(do_GetService(kIOServiceCID, &ret));
|
||||
if (NS_FAILED(ret)) return ret;
|
||||
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
ret = NS_NewURI(getter_AddRefs(uri), Trial, nsnull, service);
|
||||
if (NS_FAILED(ret)) return ret;
|
||||
|
||||
nsIChannel *channel = nsnull;
|
||||
ret = NS_OpenURI(&channel, uri, service);
|
||||
if (NS_FAILED(ret)) return ret;
|
||||
|
||||
ret = channel->Open(&in);
|
||||
if (NS_FAILED(ret)) return ret;
|
||||
|
||||
nsIPersistentProperties* props = nsnull;
|
||||
|
||||
ret = nsComponentManager::CreateInstance(kPersistentPropertiesCID, NULL,
|
||||
kIPersistentPropertiesIID, (void**) &props);
|
||||
if (NS_FAILED(ret) || (!props)) {
|
||||
printf("create nsIPersistentProperties failed\n");
|
||||
return 1;
|
||||
}
|
||||
ret = props->Load(in);
|
||||
if (NS_FAILED(ret)) {
|
||||
printf("cannot load properties\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ind = 1;
|
||||
|
||||
// while (1) {
|
||||
char name[256];
|
||||
name[0] = 0;
|
||||
nsAutoString v;
|
||||
|
||||
sprintf(name, "%s", "DomainName");
|
||||
ret = props->GetStringProperty(NS_ConvertASCIItoUCS2(name), v);
|
||||
|
||||
if (NS_FAILED(ret) || (!v.Length())) {
|
||||
|
||||
printf("Failed to return the Get property \n");
|
||||
}
|
||||
|
||||
PL_strcpy(domainname, ToNewCString(v));
|
||||
|
||||
sprintf(name, "%s", "DNSAddress");
|
||||
ret = props->GetStringProperty(NS_ConvertASCIItoUCS2(name), v);
|
||||
|
||||
if (NS_FAILED(ret) || (!v.Length())) {
|
||||
|
||||
printf("Failed to return the Get property \n");
|
||||
}
|
||||
PL_strcpy(dnsp, ToNewCString(v));
|
||||
|
||||
sprintf(name, "%s", "DNSAddress2");
|
||||
ret = props->GetStringProperty(NS_ConvertASCIItoUCS2(name), v);
|
||||
|
||||
if (NS_FAILED(ret) || (!v.Length())) {
|
||||
|
||||
printf("Failed to return the Get property \n");
|
||||
}
|
||||
PL_strcpy(dnss, ToNewCString(v));
|
||||
|
||||
printf (" This is the dnsp name %s \n",dnsp);
|
||||
printf (" This is the dnss name %s \n",dnss);
|
||||
printf (" This is the domain name %s \n",domainname);
|
||||
|
||||
// }
|
||||
// else {
|
||||
// printf("%d: ToNewCString failed\n", ind);
|
||||
// }
|
||||
// ind++;
|
||||
// }
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAccount::GetLocation(nsString& Locat)
|
||||
{
|
||||
nsresult rv=NS_OK;
|
||||
for ( int index=0; index < 10; index++)
|
||||
{
|
||||
PL_strcpy(IspLocation[index],"San Jose");
|
||||
}
|
||||
|
||||
for (int i=0; i < 10; i++)
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
Locat.AppendWithConversion(",");
|
||||
}
|
||||
Locat.AppendWithConversion(gNCIInfo[i]);
|
||||
}
|
||||
return rv;
|
||||
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAccount::GetSiteName(nsString& SiteList)
|
||||
{
|
||||
nsresult rv=NS_OK;
|
||||
for ( int i=0; i < LocCount; i++)
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
SiteList.AppendWithConversion(",");
|
||||
}
|
||||
SiteList.AppendWithConversion(IspLocation[i]);
|
||||
SiteList.AppendWithConversion("^");
|
||||
SiteList.AppendWithConversion(gNCIInfo[i]);
|
||||
|
||||
}
|
||||
LocCount=0;
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAccount::GetPhone(nsString& PhoneList)
|
||||
{
|
||||
nsresult rv=NS_OK;
|
||||
for (int i=0; i < PhoneCount; i++)
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
PhoneList.AppendWithConversion(",");
|
||||
}
|
||||
PhoneList.AppendWithConversion(IspPhone[i]);
|
||||
}
|
||||
PhoneCount =0;
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAccount::LoadValues(void)
|
||||
{
|
||||
nsresult rv =NS_OK;
|
||||
nsOutputConsoleStream mConsole;
|
||||
nsFileSpec parent;
|
||||
int rv1 = Parent("./NCI_Dir/*", parent);
|
||||
|
||||
int rv2 = IterateDirectoryChildren(parent);
|
||||
mConsole << '\t' << "Before entering the sitenames and phone "<<NCICount<<" :"<< nsEndl;
|
||||
|
||||
for (int icount =0; icount < NCICount; icount++)
|
||||
{
|
||||
int rv3 = GetNCIValues(NS_ConvertASCIItoUCS2(gNCIInfo[icount]));
|
||||
|
||||
mConsole << '\t' << "This is the count number "<< icount <<" :"<< nsEndl;
|
||||
|
||||
}
|
||||
mConsole << '\t' << "This is the arraynumber "<<NCICount<<" :"<< nsEndl;
|
||||
NCICount = 0;
|
||||
|
||||
mConsole << '\t' << "This is the after setting to zero "<<NCICount<<" :"<< nsEndl;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAccount::GetModemConfig(nsString& ModemList)
|
||||
{
|
||||
nsresult rv=NS_OK;
|
||||
char** modemResults;
|
||||
nsresult rve = nsAccount::Startup();
|
||||
|
||||
|
||||
int numDevices;
|
||||
int i;
|
||||
nsString str, tmp, returnData;
|
||||
modemResults=(char**)PR_MALLOC(20*256);
|
||||
|
||||
if ( !::GetModemList( &modemResults, &numDevices ) )
|
||||
{
|
||||
if ( modemResults != NULL )
|
||||
{
|
||||
for ( i = 0; i < numDevices; i++ )
|
||||
{
|
||||
if ( modemResults[ i ] != NULL )
|
||||
delete []modemResults[ i ];
|
||||
}
|
||||
delete []modemResults;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// copy all entries to the array
|
||||
// returnData[ 0 ] = 0x00;
|
||||
// returnData ="";
|
||||
|
||||
// pile up account names in a single array, separated by a ()
|
||||
/* for ( i = 0; i < numDevices; i++ )
|
||||
{
|
||||
tmp = modemResults[ i ];
|
||||
str += tmp;
|
||||
str += "()";
|
||||
delete []modemResults[ i ];
|
||||
}
|
||||
*/
|
||||
for ( i=0; i < numDevices; i++)
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
ModemList.AppendWithConversion(",");
|
||||
}
|
||||
ModemList.AppendWithConversion(modemResults[i]);
|
||||
}
|
||||
|
||||
// strcpy( returnData, (const char*)str );
|
||||
// returnData = modemResults[0];
|
||||
// returnData = tmp;
|
||||
printf("this is the modem inside the modemconfig %s \n", NS_LossyConvertUCS2toASCII(ModemList).get());
|
||||
delete []modemResults;
|
||||
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
// Gets the profiles directory for a given profile
|
||||
// Sets the given profile to be a current profile
|
||||
NS_IMETHODIMP nsAccount::GetAcctConfig(nsString& AccountList)
|
||||
{
|
||||
nsresult rv=NS_OK;
|
||||
CONNECTIONPARAMS* connectionNames;
|
||||
int numNames = 0;
|
||||
int i = 0, rtn;
|
||||
nsString str, tmp;
|
||||
|
||||
nsresult rvu = nsAccount::Startup();
|
||||
|
||||
switch ( gPlatformOS )
|
||||
{
|
||||
case VER_PLATFORM_WIN32_WINDOWS: //win95
|
||||
rtn = GetDialUpConnection95( &connectionNames, &numNames );
|
||||
break;
|
||||
|
||||
case VER_PLATFORM_WIN32_NT: // win nt
|
||||
rtn = GetDialUpConnectionNT( &connectionNames, &numNames );
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( rtn )
|
||||
{
|
||||
if ( connectionNames != NULL )
|
||||
{
|
||||
// pile up account names in a single array, separated by a ()
|
||||
for ( i=0; i < numNames; i++)
|
||||
{
|
||||
PL_strcpy(gNCIInfo[i],connectionNames[ i ].szEntryName);
|
||||
}
|
||||
|
||||
for ( i=0; i < numNames; i++)
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
AccountList.AppendWithConversion(",");
|
||||
}
|
||||
AccountList.AppendWithConversion(gNCIInfo[i]);
|
||||
}
|
||||
|
||||
// printf("this is the acct strings %s\n", NS_LossyConvertUCS2toASCII(AccountList).get());
|
||||
delete []connectionNames;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsAccount::SetDialerConfig(char* returnData)
|
||||
{
|
||||
/** OSVERSIONINFO* lpOsVersionInfo = new OSVERSIONINFO;
|
||||
lpOsVersionInfo->dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
|
||||
|
||||
if ( GetVersionEx( lpOsVersionInfo ) )
|
||||
gPlatformOS = (int)lpOsVersionInfo->dwPlatformId;
|
||||
else
|
||||
gPlatformOS = VER_PLATFORM_WIN32_WINDOWS; // Make reasonable assumption
|
||||
|
||||
switch ( gPlatformOS )
|
||||
{
|
||||
case VER_PLATFORM_WIN32_WINDOWS: //win95
|
||||
if( !LoadRasFunctions( "rasapi32.dll" ) )
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case VER_PLATFORM_WIN32_NT: // win nt
|
||||
if( !LoadRasFunctionsNT( "rasapi32.dll" ) )
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
**/
|
||||
nsresult rve = nsAccount::Startup();
|
||||
long returnCode;
|
||||
nsresult rv=NS_OK;
|
||||
printf ("This is the return data %s \n", returnData);
|
||||
|
||||
// if (NCICount > 0)
|
||||
nsString data; data.AssignWithConversion(returnData);
|
||||
|
||||
// Set the gathered info into an array
|
||||
SetDataArray(data);
|
||||
|
||||
char* ncivalue = GetValue ("ncivalue");
|
||||
printf ("this is the nci value inside nsaccount.cpp %s \n",ncivalue );
|
||||
if (strcpy(ncivalue,"1"))
|
||||
{
|
||||
char* filename = GetValue("filename");
|
||||
printf (" This is the file name %s \n",filename);
|
||||
GetConfigValues(NS_ConvertASCIItoUCS2(filename));
|
||||
printf (" This is the dnsp name %s \n",dnsp);
|
||||
printf (" This is the dnss name %s \n",dnss);
|
||||
printf (" This is the domain name %s \n",domainname);
|
||||
|
||||
printf ("This is the returndata %s \n",returnData);
|
||||
strcat(returnData,"domainname=");
|
||||
printf ("This is the returndata %s \n",returnData);
|
||||
strcat(returnData,domainname);
|
||||
printf ("This is the returndata %s \n",returnData);
|
||||
strcat(returnData,"%dnsp=");
|
||||
printf ("This is the returndata %s \n",returnData);
|
||||
strcat(returnData,dnsp);
|
||||
printf ("This is the returndata %s \n",returnData);
|
||||
strcat(returnData,"%dnss=");
|
||||
printf ("This is the returndata %s \n",returnData);
|
||||
strcat(returnData,dnss);
|
||||
printf ("This is the returndata %s \n",returnData);
|
||||
strcat(returnData,"%");
|
||||
printf ("This is the returndata %s \n",returnData);
|
||||
|
||||
}
|
||||
|
||||
returnCode = (long) DialerConfig(returnData);
|
||||
printf("this is the dialer config \n");
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAccount::CheckForDun(nsString& dun)
|
||||
{
|
||||
nsresult rv=NS_OK;
|
||||
dun.AppendWithConversion("0");
|
||||
PRBool dunvalue = CheckEnvironment();
|
||||
if (dunvalue )
|
||||
{
|
||||
dun.AppendWithConversion("1");
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************************/
|
||||
/*********** Account FACTORY ************/
|
||||
/***************************************************************************************/
|
||||
// Factory
|
||||
class nsAccountFactory: public nsIFactory {
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
nsAccountFactory() {
|
||||
NS_INIT_REFCNT();
|
||||
PR_AtomicIncrement(&g_InstanceCount);
|
||||
}
|
||||
|
||||
virtual ~nsAccountFactory() {
|
||||
PR_AtomicDecrement(&g_InstanceCount);
|
||||
}
|
||||
|
||||
NS_IMETHOD CreateInstance(nsISupports *aDelegate,
|
||||
const nsIID &aIID,
|
||||
void **aResult);
|
||||
|
||||
NS_IMETHOD LockFactory(PRBool aLock) {
|
||||
if (aLock) {
|
||||
PR_AtomicIncrement(&g_LockCount);
|
||||
} else {
|
||||
PR_AtomicDecrement(&g_LockCount);
|
||||
}
|
||||
return NS_OK;
|
||||
};
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsAccountFactory, nsIFactory)
|
||||
|
||||
nsresult nsAccountFactory::CreateInstance(nsISupports *aDelegate,
|
||||
const nsIID &aIID,
|
||||
void **aResult)
|
||||
{
|
||||
if (aDelegate != nsnull) {
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
}
|
||||
|
||||
nsAccount *t = nsAccount::GetInstance();
|
||||
|
||||
if (t == nsnull) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
nsresult res = t->QueryInterface(aIID, aResult);
|
||||
|
||||
if (NS_FAILED(res)) {
|
||||
*aResult = nsnull;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT nsresult
|
||||
NSGetFactory(nsISupports* serviceMgr,
|
||||
const nsCID &aClass,
|
||||
const char *aClassName,
|
||||
const char *aContractID,
|
||||
nsIFactory **aFactory)
|
||||
{
|
||||
if (aFactory == nsnull) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aClass.Equals(kAccountCID)) {
|
||||
nsAccountFactory *factory = new nsAccountFactory();
|
||||
nsresult res = CallQueryInterface(factory, aFactory);
|
||||
if (NS_FAILED(res)) {
|
||||
*aFactory = nsnull;
|
||||
delete factory;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* serviceMgr)
|
||||
{
|
||||
return PRBool(g_InstanceCount == 0 && g_LockCount == 0);
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *path)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIServiceManager> servMgr(do_QueryInterface(aServMgr, &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsIComponentManager* compMgr;
|
||||
rv = servMgr->GetService(kComponentManagerCID,
|
||||
NS_GET_IID(nsIComponentManager),
|
||||
(nsISupports**)&compMgr);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = compMgr->RegisterComponent(kAccountCID, nsnull, nsnull, path,
|
||||
PR_TRUE, PR_TRUE);
|
||||
|
||||
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
|
||||
return rv;
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char *path)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIServiceManager> servMgr(do_QueryInterface(aServMgr, &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsIComponentManager* compMgr;
|
||||
rv = servMgr->GetService(kComponentManagerCID,
|
||||
NS_GET_IID(nsIComponentManager),
|
||||
(nsISupports**)&compMgr);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = compMgr->UnregisterComponent(kAccountCID, path);
|
||||
|
||||
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
//#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
//#include <afxwin.h> // MFC core and standard components
|
||||
//#include <afxext.h> // MFC extensions
|
||||
|
||||
extern size_t stRASENTRY;
|
||||
extern size_t stRASCONN;
|
||||
extern size_t stRASCTRYINFO;
|
||||
extern size_t stRASDIALPARAMS;
|
||||
extern size_t stRASDEVINFO;
|
||||
|
||||
#ifdef WINVER
|
||||
#undef WINVER
|
||||
#endif
|
||||
#define WINVER 0x0400
|
||||
|
||||
#include <windows.h>
|
||||
#include <ras.h>
|
||||
|
||||
void SizeofRAS95()
|
||||
{
|
||||
stRASENTRY = sizeof( RASENTRY );
|
||||
stRASCONN = sizeof( RASCONN );
|
||||
stRASCTRYINFO = sizeof( RASCTRYINFO );
|
||||
stRASDIALPARAMS = sizeof( RASDIALPARAMS );
|
||||
stRASDEVINFO = sizeof( RASDEVINFO );
|
||||
}
|
||||
@ -1,63 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
//#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
//#include <afxwin.h> // MFC core and standard components
|
||||
//#include <afxext.h> // MFC extensions
|
||||
|
||||
extern size_t stRASENTRY;
|
||||
extern size_t stRASCONN;
|
||||
extern size_t stRASCTRYINFO;
|
||||
extern size_t stRASDIALPARAMS;
|
||||
extern size_t stRASDEVINFO;
|
||||
|
||||
#ifdef WINVER
|
||||
#undef WINVER
|
||||
#endif
|
||||
#define WINVER 0x0401
|
||||
|
||||
#include <windows.h>
|
||||
#include <ras.h>
|
||||
|
||||
void SizeofRASNT40()
|
||||
{
|
||||
stRASENTRY = sizeof( RASENTRY );
|
||||
stRASCONN = sizeof( RASCONN );
|
||||
stRASCTRYINFO = sizeof( RASCTRYINFO );
|
||||
stRASDIALPARAMS = sizeof( RASDIALPARAMS );
|
||||
stRASDEVINFO = sizeof( RASDEVINFO );
|
||||
}
|
||||
@ -1,2 +0,0 @@
|
||||
_NSCanUnload ; 1
|
||||
_NSRegisterSelf ; 1
|
||||
@ -1,32 +0,0 @@
|
||||
|
||||
SiteName=Ameritech.net
|
||||
|
||||
Description=Ameritech.net
|
||||
|
||||
Phone=638-8775
|
||||
|
||||
SupportPhone=+1 (800) 638-8775
|
||||
|
||||
|
||||
|
||||
SMTP_Server=Call Ameritech Support
|
||||
|
||||
POP_Server=Call Ameritech Support
|
||||
|
||||
IMAP_Server=Not Available
|
||||
|
||||
Default_Mail_Protocol=POP
|
||||
|
||||
NNTP_Server=Call Ameritech Support
|
||||
|
||||
LDAP_Server=Not Available
|
||||
|
||||
|
||||
|
||||
IPAddress=0.0.0.0
|
||||
|
||||
DomainName=ameritech.net
|
||||
|
||||
DNSAddress=12.12.12.12
|
||||
|
||||
DNSAddress2=13.13.13.13
|
||||
@ -1,29 +0,0 @@
|
||||
SiteName=AT&T WorldNet Service
|
||||
|
||||
Description=AT&T WorldNet Service
|
||||
|
||||
Phone=400-1447
|
||||
|
||||
SupportPhone=+1 (800) 400-1447
|
||||
|
||||
|
||||
|
||||
SMTP_Server=mailhost.worldnet.att.net
|
||||
|
||||
POP_Server=postoffice.worldnet.att.net
|
||||
|
||||
Default_Mail_Protocol=POP
|
||||
|
||||
NNTP_Server=netnews.worldnet.att.net
|
||||
|
||||
|
||||
|
||||
|
||||
IPAddress=0.0.0.0
|
||||
|
||||
DomainName=worldnet.att.net
|
||||
|
||||
DNSAddress=204.127.129.1
|
||||
|
||||
DNSAddress2=204.127.160.1
|
||||
|
||||
@ -1,108 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>XPConnect Example</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
var Account = Components.classes["@mozilla.org/profile/Account-services;1"].createInstance();
|
||||
Account = Account.QueryInterface(Components.interfaces.nsIAccountServices);
|
||||
dump("Account = " + Account + "\n");
|
||||
nameGlobal = new Array();
|
||||
nameArray = new Array();
|
||||
var count = 0;
|
||||
var dataCount = 0;
|
||||
|
||||
function Create()
|
||||
{
|
||||
var field = document.getElementById('loginname');
|
||||
Account.SetDialerConfig(field.value);
|
||||
}
|
||||
|
||||
function TestMe()
|
||||
{
|
||||
var field1 = document.getElementById('phone');
|
||||
SetPhonebookValue(field1.id,field1.value);
|
||||
|
||||
var field2 = document.getElementById('loginname');
|
||||
SetPhonebookValue(field2.id,field2.value);
|
||||
var field3 = document.getElementById('loginpass');
|
||||
SetPhonebookValue(field3.id,field3.value);
|
||||
var field4 = document.getElementById('passagain');
|
||||
SetPhonebookValue(field4.id,field4.value);
|
||||
var field5 = document.getElementById('domainname');
|
||||
SetPhonebookValue(field5.id,field5.value);
|
||||
var field6 = document.getElementById('dnsp');
|
||||
SetPhonebookValue(field6.id,field6.value);
|
||||
var field7 = document.getElementById('dnss');
|
||||
SetPhonebookValue(field7.id,field7.value);
|
||||
// var field8 = document.getElementById('callwait');
|
||||
// if (field8.value ==TRUE)
|
||||
// SetPhonebookValue(field8.id,field8.value);
|
||||
// var field9 = document.getElementById('tone');
|
||||
// SetPhonebookValue(field9.id,field9.value);
|
||||
|
||||
Finish();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function SetPhonebookValue(name, value)
|
||||
{
|
||||
dump("Inside SetPhonebookValue\n");
|
||||
var found = false;
|
||||
for (i = 0; i !=dataCount; i++) {
|
||||
if (nameArray[i] == name) {
|
||||
dump("Name exists: "+nameGlobal[i]+"\n");
|
||||
nameGlobal[i] = name+"="+value+"%";
|
||||
dump("New values: "+name+" "+value+"\n");
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!found) {
|
||||
dump("Name does not exist\n");
|
||||
nameGlobal[dataCount] = name+"="+value+"%";
|
||||
dump("Name Value: "+name+" "+value+"\n");
|
||||
|
||||
nameArray[dataCount] = name;
|
||||
dataCount++;
|
||||
}
|
||||
}
|
||||
|
||||
function Finish()
|
||||
{
|
||||
var data = "";
|
||||
var i = 0;
|
||||
dump("before for loop\n");
|
||||
for (i = 0; i !=dataCount; i++) {
|
||||
data = data+nameGlobal[i];
|
||||
}
|
||||
dump("DATA IS: "+data+"\n");
|
||||
Account.SetDialerConfig(data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<form name="form">
|
||||
Current Modem <input type="text" id="modem"> <br><br>
|
||||
Call Waiting <input type="checkbox" id="callwait">
|
||||
<input type="radio" id="tone" value="tone">Tone
|
||||
<input type="radio" id="tone" value="pulse">Pulse<br><br>
|
||||
Phone <input type="text" id="phone"> This information will not be given to anyone else.<br><br>
|
||||
Login Name<input type="text" id="loginname"> <br><br>
|
||||
Password<input type="text" id="loginpass">
|
||||
Enter Again<input type="text" id="passagain"><br><br>
|
||||
Domain Name<input type="text" id="domainname"> <br><br>
|
||||
Primary DNS<input type="text" id="dnsp"> <br><br>
|
||||
Secondary DNS<input type="text" id="dnss"> <br><br>
|
||||
|
||||
<input type="button" value="Create Account" onclick="TestMe();">
|
||||
|
||||
<form>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,37 +0,0 @@
|
||||
[Dial-In Configuration]
|
||||
|
||||
SiteName=Bell Atlantic Internet Solutions
|
||||
|
||||
Description=Bell Atlantic Internet Solutions
|
||||
|
||||
Phone=567-6789
|
||||
|
||||
SupportPhone=+1 (800) 567-6789
|
||||
|
||||
|
||||
|
||||
[Services]
|
||||
|
||||
SMTP_Server=Call Bell Atlantic Support
|
||||
|
||||
POP_Server=Call Bell Atlantic Support
|
||||
|
||||
IMAP_Server=Not Available
|
||||
|
||||
Default_Mail_Protocol=POP
|
||||
|
||||
NNTP_Server=Call Bell Atlantic Support
|
||||
|
||||
LDAP_Server=Not Available
|
||||
|
||||
|
||||
|
||||
[IP]
|
||||
|
||||
IPAddress=0.0.0.0
|
||||
|
||||
DomainName=bellatlantic.net
|
||||
|
||||
DNSAddress=34.34.34.34
|
||||
|
||||
DNSAddress2=35.35.35.35
|
||||
@ -1,34 +0,0 @@
|
||||
SiteName=BellSouth.net
|
||||
|
||||
Description=BellSouth.net
|
||||
|
||||
Phone=436-8638
|
||||
|
||||
SupportPhone=+1 (800) 436-8638
|
||||
|
||||
|
||||
|
||||
|
||||
SMTP_Server=Call BellSouth Support
|
||||
|
||||
POP_Server=Call BellSouth Support
|
||||
|
||||
IMAP_Server=Not Available
|
||||
|
||||
Default_Mail_Protocol=POP
|
||||
|
||||
NNTP_Server=Call BellSouth Support
|
||||
|
||||
LDAP_Server=Not Available
|
||||
|
||||
|
||||
|
||||
|
||||
IPAddress=0.0.0.0
|
||||
|
||||
DomainName=bellsouth.net
|
||||
|
||||
DNSAddress=23.23.23.23
|
||||
|
||||
DNSAddress2=24.24.24.24
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
|
||||
SiteName=Concentric Network
|
||||
|
||||
Description=Concentric Network
|
||||
|
||||
Phone=745-2747
|
||||
|
||||
SupportPhone=+1 (800) 745-2747
|
||||
|
||||
|
||||
|
||||
|
||||
SMTP_Server=smtp.concentric.net
|
||||
|
||||
POP_Server=pop3.concentric.net
|
||||
|
||||
Default_Mail_Protocol=POP
|
||||
|
||||
NNTP_Server=news.concentric.net
|
||||
|
||||
|
||||
|
||||
|
||||
IPAddress=0.0.0.0
|
||||
|
||||
DomainName=concentric.net
|
||||
|
||||
DNSAddress=207.155.184.72
|
||||
|
||||
DNSAddress2=206.173.119.72
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
SiteName=EarthLink Network
|
||||
|
||||
Description=EarthLink Network
|
||||
|
||||
Phone=395-8410
|
||||
|
||||
SupportPhone=+1 (800) 395-8410
|
||||
|
||||
|
||||
|
||||
SMTP_Server=mail.earthlink.net
|
||||
|
||||
POP_Server=mail.earthlink.net
|
||||
|
||||
Default_Mail_Protocol=POP
|
||||
|
||||
NNTP_Server=news.earthlink.net
|
||||
|
||||
|
||||
|
||||
IPAddress=0.0.0.0
|
||||
|
||||
DomainName=earthlink.net
|
||||
|
||||
DNSAddress=206.85.92.79
|
||||
|
||||
DNSAddress2=206.85.92.2
|
||||
|
||||
@ -1,64 +0,0 @@
|
||||
|
||||
SiteName=gateway.net
|
||||
|
||||
Description=gateway.net
|
||||
|
||||
Name=gwsignup
|
||||
|
||||
Password=NOPASSWD
|
||||
|
||||
Phone=+1 (800) 926-6607
|
||||
|
||||
SupportPhone=
|
||||
|
||||
|
||||
|
||||
|
||||
EnableVJCompression=yes
|
||||
|
||||
|
||||
|
||||
|
||||
Enabled=YES
|
||||
|
||||
IPAddress=0.0.0.0
|
||||
|
||||
DomainName=gateway.net
|
||||
|
||||
DNSAddress=208.205.34.1
|
||||
|
||||
DNSAddress2=208.205.34.2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
SMTP_Server=mail.gateway.net
|
||||
|
||||
NNTP_Server=news.gateway.net
|
||||
|
||||
POP_Server=pop.gateway.net
|
||||
|
||||
IMAP_Server=imap.gateway.net
|
||||
|
||||
Default_Mail_Protocol=IMAP
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Publish_URL=
|
||||
|
||||
Publish_Password=
|
||||
|
||||
View_URL=http://gw2k.gateway.net/gw2k/phone.htm
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ScriptFileName=
|
||||
|
||||
|
||||
ConfigurationFileName=
|
||||
|
||||
@ -1,194 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="pm.css" type="text/css"?>
|
||||
|
||||
<window
|
||||
width="640"
|
||||
height="480"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<html:div flex="100%">
|
||||
|
||||
<script>
|
||||
var Account = Components.classes["@mozilla.org/profile/Account-services;1"].createInstance();
|
||||
Account = Account.QueryInterface(Components.interfaces.nsIAccountServices);
|
||||
dump("Account = " + Account + "\n");
|
||||
|
||||
nameGlobal = new Array();
|
||||
nameArray = new Array();
|
||||
var count = 0;
|
||||
var dataCount = 0;
|
||||
|
||||
function TestMe()
|
||||
{
|
||||
var field1 = document.getElementById('phone');
|
||||
SetPhonebookValue(field1.id,field1.value);
|
||||
|
||||
var field2 = document.getElementById('loginname');
|
||||
SetPhonebookValue(field2.id,field2.value);
|
||||
var field3 = document.getElementById('loginpass');
|
||||
SetPhonebookValue(field3.id,field3.value);
|
||||
var field4 = document.getElementById('passagain');
|
||||
SetPhonebookValue(field4.id,field4.value);
|
||||
// var field5 = document.getElementById('domainname');
|
||||
// SetPhonebookValue(field5.id,field5.value);
|
||||
// var field6 = document.getElementById('dnsp');
|
||||
// SetPhonebookValue(field6.id,field6.value);
|
||||
// var field7 = document.getElementById('dnss');
|
||||
// SetPhonebookValue(field7.id,field7.value);
|
||||
// var field8 = document.getElementById('callwait');
|
||||
// if (field8.value ==TRUE)
|
||||
// SetPhonebookValue(field8.id,field8.value);
|
||||
// var field9 = document.getElementById('tone');
|
||||
// SetPhonebookValue(field9.id,field9.value);
|
||||
|
||||
Finish();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function SetPhonebookValue(name, value)
|
||||
{
|
||||
dump("Inside SetPhonebookValue\n");
|
||||
var found = false;
|
||||
for (i = 0; i !=dataCount; i++) {
|
||||
if (nameArray[i] == name) {
|
||||
dump("Name exists: "+nameGlobal[i]+"\n");
|
||||
nameGlobal[i] = name+"="+value+"%";
|
||||
dump("New values: "+name+" "+value+"\n");
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!found) {
|
||||
dump("Name does not exist\n");
|
||||
nameGlobal[dataCount] = name+"="+value+"%";
|
||||
dump("Name Value: "+name+" "+value+"\n");
|
||||
|
||||
nameArray[dataCount] = name;
|
||||
dataCount++;
|
||||
}
|
||||
}
|
||||
|
||||
function Finish()
|
||||
{
|
||||
var data = "";
|
||||
var i = 0;
|
||||
dump("before for loop\n");
|
||||
for (i = 0; i !=dataCount; i++) {
|
||||
data = data+nameGlobal[i];
|
||||
}
|
||||
dump("DATA IS: "+data+"\n");
|
||||
// Account.SetDialerConfig(data);
|
||||
dump ("this is before getting account \n");
|
||||
|
||||
}
|
||||
|
||||
function loadElements()
|
||||
{
|
||||
|
||||
var AccountList = "";
|
||||
AccountList = Account.GetAcctConfig();
|
||||
dump ("this is after getting account \n");
|
||||
AccountList = AccountList.split(",");
|
||||
dump("Got account list of '" + AccountList + "'\n");
|
||||
|
||||
for (var i=0; i < AccountList.length; i++)
|
||||
{
|
||||
var pvals = AccountList[i];
|
||||
addOptions1(pvals,i+1);
|
||||
}
|
||||
|
||||
var ModemList = "";
|
||||
ModemList = Account.GetModemConfig();
|
||||
dump ("this is after getting Modem \n");
|
||||
ModemList = ModemList.split(",");
|
||||
dump("Got Modem list of '" + ModemList + "'\n");
|
||||
|
||||
for (var i=0; i < ModemList.length; i++)
|
||||
{
|
||||
var pvals = ModemList[i];
|
||||
addOptions2(pvals,i+10);
|
||||
}
|
||||
|
||||
var dunlist = "";
|
||||
dunlist = Account.CheckForDun();
|
||||
dump ("dun has been checked \n");
|
||||
dump ("dun is "+dunlist+"\n");
|
||||
if (dunlist == "01")
|
||||
{
|
||||
var rad = document.getElementById("dun2");
|
||||
rad.checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------- begin Hack for OnLoad handling
|
||||
setTimeout("loadElements()", 0);
|
||||
// -------------------------------------------- end Hack for OnLoad handling
|
||||
|
||||
|
||||
function addOptions1(oname, iname)
|
||||
{
|
||||
var sel = document.getElementById("x");
|
||||
dump( "sel="+sel+"\n" );
|
||||
|
||||
var elem = document.createElement( "html:option" );
|
||||
dump( "elem="+elem+"\n" );
|
||||
|
||||
elem.id =iname;
|
||||
dump ("elem id="+elem.id+"\n");
|
||||
|
||||
var text = document.createTextNode( oname );
|
||||
dump( "text="+text+"\n" );
|
||||
|
||||
var rc = elem.appendChild( text );
|
||||
dump( "rc="+rc+"\n" );
|
||||
|
||||
var newsel = sel.appendChild( elem );
|
||||
dump( "newsel="+newsel+"\n" );
|
||||
}
|
||||
function addOptions2(oname, iname)
|
||||
{
|
||||
var sel = document.getElementById("y");
|
||||
dump( "sel="+sel+"\n" );
|
||||
|
||||
var elem = document.createElement( "html:option" );
|
||||
dump( "elem="+elem+"\n" );
|
||||
|
||||
elem.id =iname;
|
||||
dump ("elem id="+elem.id+"\n");
|
||||
|
||||
var text = document.createTextNode( oname );
|
||||
dump( "text="+text+"\n" );
|
||||
|
||||
var rc = elem.appendChild( text );
|
||||
dump( "rc="+rc+"\n" );
|
||||
|
||||
var newsel = sel.appendChild( elem );
|
||||
dump( "newsel="+newsel+"\n" );
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<html:br/>
|
||||
<html:input type="radio" name="dun" id="dun1" value="lan"/>LAN
|
||||
<html:input type="radio" name="dun" id="dun2" value="modem"/>Modem<html:br/><html:br/>
|
||||
|
||||
<html:select id="x">
|
||||
<html:option></html:option>
|
||||
</html:select>
|
||||
|
||||
<html:select id="y">
|
||||
<html:option></html:option>
|
||||
</html:select>
|
||||
<html:br/>
|
||||
|
||||
<button label="Create Account" class="push" />
|
||||
|
||||
|
||||
</html:div>
|
||||
</window>
|
||||
@ -1,153 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="pm.css" type="text/css"?>
|
||||
|
||||
<window
|
||||
width="640"
|
||||
height="480"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<html:div flex="100%">
|
||||
|
||||
<script>
|
||||
var Account = Components.classes["@mozilla.org/profile/Account-services;1"].createInstance();
|
||||
Account = Account.QueryInterface(Components.interfaces.nsIAccountServices);
|
||||
dump("Account = " + Account + "\n");
|
||||
|
||||
nameGlobal = new Array();
|
||||
nameArray = new Array();
|
||||
var count = 0;
|
||||
var dataCount = 0;
|
||||
|
||||
function TestMe()
|
||||
{
|
||||
var field1 = document.getElementById('phone');
|
||||
SetPhonebookValue(field1.id,field1.value);
|
||||
|
||||
var field2 = document.getElementById('loginname');
|
||||
SetPhonebookValue(field2.id,field2.value);
|
||||
var field3 = document.getElementById('loginpass');
|
||||
SetPhonebookValue(field3.id,field3.value);
|
||||
var field4 = document.getElementById('passagain');
|
||||
SetPhonebookValue(field4.id,field4.value);
|
||||
var field5 = document.getElementById('domainname');
|
||||
SetPhonebookValue(field5.id,field5.value);
|
||||
var field6 = document.getElementById('dnsp');
|
||||
SetPhonebookValue(field6.id,field6.value);
|
||||
var field7 = document.getElementById('dnss');
|
||||
SetPhonebookValue(field7.id,field7.value);
|
||||
SetPhonebookValue("ncivalue","0");
|
||||
// var field8 = document.getElementById('callwait');
|
||||
// if (field8.value ==TRUE)
|
||||
// SetPhonebookValue(field8.id,field8.value);
|
||||
// var field9 = document.getElementById('tone');
|
||||
// SetPhonebookValue(field9.id,field9.value);
|
||||
|
||||
Finish();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function SetPhonebookValue(name, value)
|
||||
{
|
||||
dump("Inside SetPhonebookValue\n");
|
||||
var found = false;
|
||||
for (i = 0; i !=dataCount; i++) {
|
||||
if (nameArray[i] == name) {
|
||||
dump("Name exists: "+nameGlobal[i]+"\n");
|
||||
nameGlobal[i] = name+"="+value+"%";
|
||||
dump("New values: "+name+" "+value+"\n");
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!found) {
|
||||
dump("Name does not exist\n");
|
||||
nameGlobal[dataCount] = name+"="+value+"%";
|
||||
dump("Name Value: "+name+" "+value+"\n");
|
||||
|
||||
nameArray[dataCount] = name;
|
||||
dataCount++;
|
||||
}
|
||||
}
|
||||
|
||||
function Finish()
|
||||
{
|
||||
var data = "";
|
||||
var i = 0;
|
||||
dump("before for loop\n");
|
||||
for (i = 0; i !=dataCount; i++) {
|
||||
data = data+nameGlobal[i];
|
||||
}
|
||||
dump("DATA IS: "+data+"\n");
|
||||
Account.SetDialerConfig(data);
|
||||
dump ("Connectoid is created\n");
|
||||
}
|
||||
|
||||
function loadElements()
|
||||
{
|
||||
var ModemList = "";
|
||||
ModemList = Account.GetModemConfig();
|
||||
dump ("this is after getting Modem \n");
|
||||
ModemList = ModemList.split(",");
|
||||
dump("Got Modem list of '" + ModemList + "'\n");
|
||||
|
||||
for (var i=0; i < ModemList.length; i++)
|
||||
{
|
||||
var pvals = ModemList[i];
|
||||
addOptions2(pvals,i+1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// -------------------------------------------- begin Hack for OnLoad handling
|
||||
setTimeout("loadElements()", 0);
|
||||
// -------------------------------------------- end Hack for OnLoad handling
|
||||
function addOptions2(oname, iname)
|
||||
{
|
||||
var sel = document.getElementById("y");
|
||||
dump( "sel="+sel+"\n" );
|
||||
|
||||
var elem = document.createElement( "html:option" );
|
||||
dump( "elem="+elem+"\n" );
|
||||
|
||||
elem.id =iname;
|
||||
dump ("elem id="+elem.id+"\n");
|
||||
|
||||
var text = document.createTextNode( oname );
|
||||
dump( "text="+text+"\n" );
|
||||
|
||||
var rc = elem.appendChild( text );
|
||||
dump( "rc="+rc+"\n" );
|
||||
|
||||
var newsel = sel.appendChild( elem );
|
||||
dump( "newsel="+newsel+"\n" );
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<html:br/>
|
||||
<html:select id="y">
|
||||
<html:option></html:option>
|
||||
</html:select>
|
||||
<html:br/>
|
||||
Call Waiting <html:input type="checkbox" id="callwait"/>
|
||||
<html:input type="radio" id="tone" value="tone"/>Tone
|
||||
<html:input type="radio" id="tone" value="pulse"/>Pulse<html:br/><html:br/>
|
||||
Phone <html:input type="text" id="phone"/> This information will not be given to anyone else.<html:br/><html:br/>
|
||||
Login Name<html:input type="text" id="loginname"/> <html:br/><html:br/>
|
||||
Password<html:input type="text" id="loginpass"/>
|
||||
Enter Again<html:input type="text" id="passagain"/><html:br/><html:br/>
|
||||
Domain Name<html:input type="text" id="domainname"/> <html:br/><html:br/>
|
||||
Primary DNS<html:input type="text" id="dnsp"/> <html:br/><html:br/>
|
||||
Secondary DNS<html:input type="text" id="dnss"/> <html:br/><html:br/>
|
||||
|
||||
<button label="Create Account" class="push" onclick="TestMe();"/>
|
||||
|
||||
|
||||
</html:div>
|
||||
</window>
|
||||
@ -1,175 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="pm.css" type="text/css"?>
|
||||
|
||||
<window
|
||||
width="640"
|
||||
height="480"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<html:div flex="100%">
|
||||
|
||||
<script>
|
||||
var Account = Components.classes["@mozilla.org/profile/Account-services;1"].createInstance();
|
||||
Account = Account.QueryInterface(Components.interfaces.nsIAccountServices);
|
||||
dump("Account = " + Account + "\n");
|
||||
|
||||
nameGlobal = new Array();
|
||||
nameArray = new Array();
|
||||
var count = 0;
|
||||
var dataCount = 0;
|
||||
|
||||
function TestMe()
|
||||
{
|
||||
var field1 = document.getElementById('phone');
|
||||
SetPhonebookValue(field1.id,field1.value);
|
||||
|
||||
var field2 = document.getElementById('loginname');
|
||||
SetPhonebookValue(field2.id,field2.value);
|
||||
var field3 = document.getElementById('loginpass');
|
||||
SetPhonebookValue(field3.id,field3.value);
|
||||
var field4 = document.getElementById('passagain');
|
||||
SetPhonebookValue(field4.id,field4.value);
|
||||
|
||||
var sel = document.getElementById("x");
|
||||
var ind = sel.selectedIndex;
|
||||
var opt = document.getElementById(ind);
|
||||
SetPhonebookValue("filename",opt.label);
|
||||
|
||||
SetPhonebookValue("ncivalue","1");
|
||||
// var field8 = document.getElementById('callwait');
|
||||
// if (field8.value ==TRUE)
|
||||
// SetPhonebookValue(field8.id,field8.value);
|
||||
// var field9 = document.getElementById('tone');
|
||||
// SetPhonebookValue(field9.id,field9.value);
|
||||
|
||||
Finish();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function SetPhonebookValue(name, value)
|
||||
{
|
||||
dump("Inside SetPhonebookValue\n");
|
||||
var found = false;
|
||||
for (i = 0; i !=dataCount; i++) {
|
||||
if (nameArray[i] == name) {
|
||||
dump("Name exists: "+nameGlobal[i]+"\n");
|
||||
nameGlobal[i] = name+"="+value+"%";
|
||||
dump("New values: "+name+" "+value+"\n");
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!found) {
|
||||
dump("Name does not exist\n");
|
||||
nameGlobal[dataCount] = name+"="+value+"%";
|
||||
dump("Name Value: "+name+" "+value+"\n");
|
||||
|
||||
nameArray[dataCount] = name;
|
||||
dataCount++;
|
||||
}
|
||||
}
|
||||
|
||||
function Finish()
|
||||
{
|
||||
var data = "";
|
||||
var i = 0;
|
||||
dump("before for loop\n");
|
||||
for (i = 0; i !=dataCount; i++) {
|
||||
data = data+nameGlobal[i];
|
||||
}
|
||||
dump("DATA IS: "+data+"\n");
|
||||
Account.SetDialerConfig(data);
|
||||
dump ("this is before getting account \n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
function loadElements()
|
||||
{
|
||||
Account.LoadValues();
|
||||
var SiteList = "";
|
||||
SiteList = Account.GetSiteName();
|
||||
dump ("this is after getting SiteList \n");
|
||||
SiteList = SiteList.split(",");
|
||||
dump("Got SiteList of '" + SiteList + "'\n");
|
||||
|
||||
var PhoneList = "";
|
||||
PhoneList = Account.GetPhone();
|
||||
dump ("this is after getting PhoneList \n");
|
||||
PhoneList = PhoneList.split(",");
|
||||
dump("Got PhoneList of '" + PhoneList + "'\n");
|
||||
|
||||
for (var i=0; i < SiteList.length; i++)
|
||||
{
|
||||
var tempval = SiteList[i];
|
||||
var tempval = tempval.split("^");
|
||||
pvals = tempval[0];
|
||||
plabel = tempval [1];
|
||||
pvalue = PhoneList[i];
|
||||
addOptions(pvals,i+1,plabel,pvalue);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// -------------------------------------------- begin Hack for OnLoad handling
|
||||
setTimeout("loadElements()", 0);
|
||||
// -------------------------------------------- end Hack for OnLoad handling
|
||||
|
||||
|
||||
function addOptions(oname,iname,plabel,pvalue)
|
||||
{
|
||||
var sel = document.getElementById("x");
|
||||
dump( "sel="+sel+"\n" );
|
||||
|
||||
var elem = document.createElement( "html:option" );
|
||||
dump( "elem="+elem+"\n" );
|
||||
elem.id = iname;
|
||||
elem.label=plabel;
|
||||
elem.value=pvalue;
|
||||
dump ("elem id label value ="+elem.id+" "+elem.label+" "+elem.value+"\n");
|
||||
|
||||
var text = document.createTextNode( oname );
|
||||
dump( "text="+text+"\n" );
|
||||
|
||||
var rc = elem.appendChild( text );
|
||||
dump( "rc="+rc+"\n" );
|
||||
|
||||
var newsel = sel.appendChild( elem );
|
||||
dump( "newsel="+newsel+"\n" );
|
||||
}
|
||||
|
||||
function SelectCity()
|
||||
{
|
||||
var sel = document.getElementById("x");
|
||||
var ind = sel.selectedIndex;
|
||||
var opt = document.getElementById(ind);
|
||||
var phonel = document.getElementById("phone");
|
||||
phonel.value = opt.value;
|
||||
var filel = document.getElementById("filename");
|
||||
filel.value = opt.label;
|
||||
}
|
||||
</script>
|
||||
|
||||
<html:select id="x">
|
||||
<html:option> </html:option>
|
||||
</html:select>
|
||||
|
||||
<html:br/>
|
||||
<button label="SelectCity" class="push" onclick="SelectCity();"/>
|
||||
<html:br/>
|
||||
Phone <html:input type="text" id="phone"/> This information will not be given to anyone else.<html:br/><html:br/>
|
||||
FileName<html:input type="text" id="filename"/> <html:br/><html:br/>
|
||||
Login Name<html:input type="text" id="loginname"/> <html:br/><html:br/>
|
||||
Password<html:input type="text" id="loginpass"/>
|
||||
Enter Again<html:input type="text" id="passagain"/><html:br/><html:br/>
|
||||
<button label="Create Account" class="push" onclick="TestMe();"/>
|
||||
|
||||
|
||||
</html:div>
|
||||
</window>
|
||||
@ -1,61 +0,0 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..
|
||||
MODULE=AcctIdl
|
||||
REQUIRES = \
|
||||
xpcom \
|
||||
string \
|
||||
profile \
|
||||
$(NULL)
|
||||
|
||||
MAKE_OBJ_TYPE=DLL
|
||||
DLLNAME=$(MODULE)
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
|
||||
XPIDLSRCS= .\nsIAccountServices.idl \
|
||||
$(NULL)
|
||||
|
||||
CPP_OBJS=\
|
||||
.\$(OBJDIR)\nsAccountServices.obj \
|
||||
.\$(OBJDIR)\nsAccountServicesFactory.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS=\
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(LIBPLC) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
|
||||
$(MAKE_INSTALL) Account.html $(DIST)\bin\res\acct
|
||||
$(MAKE_INSTALL) am.xul $(DIST)\bin\res\acct
|
||||
$(MAKE_INSTALL) am2.xul $(DIST)\bin\res\acct
|
||||
$(MAKE_INSTALL) am2a.xul $(DIST)\bin\res\acct
|
||||
$(MAKE_INSTALL) att.nci $(DIST)\bin\res\acct
|
||||
$(MAKE_INSTALL) amertech.nci $(DIST)\bin\res\acct
|
||||
$(MAKE_INSTALL) Batlant.nci $(DIST)\bin\res\acct
|
||||
$(MAKE_INSTALL) Bsouth.nci $(DIST)\bin\res\acct
|
||||
$(MAKE_INSTALL) Earthlnk.nci $(DIST)\bin\res\acct
|
||||
$(MAKE_INSTALL) Concent.nci $(DIST)\bin\res\acct
|
||||
$(MAKE_INSTALL) Gateway.nci $(DIST)\bin\res\acct
|
||||
@ -1,182 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
A sample of XPConnect. This file contains an implementation of
|
||||
nsIAccountServices.
|
||||
|
||||
*/
|
||||
#include "windows.h"
|
||||
#include "nscore.h"
|
||||
#include "nsIAccountServices.h"
|
||||
#include "nsIMemory.h"
|
||||
#include "plstr.h"
|
||||
#include "stdio.h"
|
||||
#include "nsIAccount.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
|
||||
static NS_DEFINE_CID(kAccountCID, NS_Account_CID);
|
||||
|
||||
class AccountServicesImpl : public nsIAccountServices
|
||||
{
|
||||
public:
|
||||
AccountServicesImpl();
|
||||
virtual ~AccountServicesImpl();
|
||||
|
||||
// nsISupports interface
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIAccount interface
|
||||
NS_DECL_NSIACCOUNTSERVICES
|
||||
|
||||
private:
|
||||
nsIAccount *mAccount;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsresult
|
||||
NS_NewAccountServices(nsIAccountServices** aAccount)
|
||||
{
|
||||
NS_PRECONDITION(aAccount != nsnull, "null ptr");
|
||||
if (! aAccount)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
*aAccount = new AccountServicesImpl();
|
||||
if (! *aAccount)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*aAccount);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
AccountServicesImpl::AccountServicesImpl()
|
||||
: mAccount(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
nsresult rv = nsServiceManager::GetService(kAccountCID,
|
||||
NS_GET_IID(nsIAccount),
|
||||
(nsISupports **)&mAccount);
|
||||
}
|
||||
|
||||
|
||||
AccountServicesImpl::~AccountServicesImpl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS1(AccountServicesImpl, nsIAccountServices)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
AccountServicesImpl::SetDialerConfig(const char* aPrefix)
|
||||
{
|
||||
NS_PRECONDITION(aPrefix != nsnull, "null ptr");
|
||||
if (! aPrefix)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
printf("Hey : You are here..........%s \n", aPrefix);
|
||||
mAccount->SetDialerConfig((char *)aPrefix);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
AccountServicesImpl::GetAcctConfig(char** AccountList)
|
||||
{
|
||||
nsString localVar;
|
||||
mAccount->GetAcctConfig(localVar);
|
||||
*AccountList = ToNewCString(localVar);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
AccountServicesImpl::GetModemConfig(char** ModemList)
|
||||
{
|
||||
nsString localVar;
|
||||
mAccount->GetModemConfig(localVar);
|
||||
*ModemList = ToNewCString(localVar);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
AccountServicesImpl::GetSiteName(char** SiteList)
|
||||
{
|
||||
nsString localVar;
|
||||
mAccount->GetSiteName(localVar);
|
||||
*SiteList = ToNewCString(localVar);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
AccountServicesImpl::GetPhone(char** PhoneList)
|
||||
{
|
||||
nsString localVar;
|
||||
mAccount->GetPhone(localVar);
|
||||
*PhoneList = ToNewCString(localVar);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
AccountServicesImpl::LoadValues(void)
|
||||
{
|
||||
mAccount->LoadValues();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
AccountServicesImpl::CheckForDun(char** dunlist)
|
||||
{
|
||||
nsString localVar;
|
||||
mAccount->CheckForDun(localVar);
|
||||
*dunlist = ToNewCString(localVar);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1,226 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
|
||||
A sample of XPConnect. This file contains the XPCOM factory the
|
||||
creates for AccountServicesImpl objects.
|
||||
|
||||
*/
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nscore.h"
|
||||
#include "nsIAccountServices.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsXPComFactory.h"
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
|
||||
static NS_DEFINE_CID(kAccountServicesCID, NS_AccountServices_CID);
|
||||
|
||||
class AccountServicesFactoryImpl : public nsIFactory
|
||||
{
|
||||
public:
|
||||
AccountServicesFactoryImpl(const nsCID &aClass, const char* className, const char* contractID);
|
||||
|
||||
// nsISupports methods
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIFactory methods
|
||||
NS_IMETHOD CreateInstance(nsISupports *aOuter,
|
||||
const nsIID &aIID,
|
||||
void **aResult);
|
||||
|
||||
NS_IMETHOD LockFactory(PRBool aLock);
|
||||
|
||||
protected:
|
||||
virtual ~AccountServicesFactoryImpl();
|
||||
|
||||
protected:
|
||||
nsCID mClassID;
|
||||
const char* mClassName;
|
||||
const char* mContractID;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AccountServicesFactoryImpl::AccountServicesFactoryImpl(const nsCID &aClass,
|
||||
const char* className,
|
||||
const char* contractID)
|
||||
: mClassID(aClass), mClassName(className), mContractID(contractID)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
AccountServicesFactoryImpl::~AccountServicesFactoryImpl()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
AccountServicesFactoryImpl::QueryInterface(const nsIID &aIID, void **aResult)
|
||||
{
|
||||
if (! aResult)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
// Always NULL result, in case of failure
|
||||
*aResult = nsnull;
|
||||
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
*aResult = NS_STATIC_CAST(nsISupports*, this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
} else if (aIID.Equals(kIFactoryIID)) {
|
||||
*aResult = NS_STATIC_CAST(nsIFactory*, this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(AccountServicesFactoryImpl);
|
||||
NS_IMPL_RELEASE(AccountServicesFactoryImpl);
|
||||
|
||||
NS_IMETHODIMP
|
||||
AccountServicesFactoryImpl::CreateInstance(nsISupports *aOuter,
|
||||
const nsIID &aIID,
|
||||
void **aResult)
|
||||
{
|
||||
if (! aResult)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if (aOuter)
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
*aResult = nsnull;
|
||||
|
||||
nsresult rv;
|
||||
|
||||
nsISupports *inst = nsnull;
|
||||
if (mClassID.Equals(kAccountServicesCID)) {
|
||||
if (NS_FAILED(rv = NS_NewAccountServices((nsIAccountServices**) &inst)))
|
||||
return rv;
|
||||
}
|
||||
else {
|
||||
return NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
|
||||
if (! inst)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
if (NS_FAILED(rv = inst->QueryInterface(aIID, aResult))) {
|
||||
// We didn't get the right interface.
|
||||
NS_ERROR("didn't support the interface you wanted");
|
||||
}
|
||||
|
||||
NS_IF_RELEASE(inst);
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult AccountServicesFactoryImpl::LockFactory(PRBool aLock)
|
||||
{
|
||||
// Not implemented in simplest case.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
// return the proper factory to the caller
|
||||
extern "C" PR_IMPLEMENT(nsresult)
|
||||
NSGetFactory(nsISupports* aServMgr,
|
||||
const nsCID &aClass,
|
||||
const char *aClassName,
|
||||
const char *aContractID,
|
||||
nsIFactory **aFactory)
|
||||
{
|
||||
if (! aFactory)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
AccountServicesFactoryImpl* factory = new AccountServicesFactoryImpl(aClass, aClassName, aContractID);
|
||||
if (factory == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(factory);
|
||||
*aFactory = factory;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern "C" PR_IMPLEMENT(nsresult)
|
||||
NSRegisterSelf(nsISupports* aServMgr , const char* aPath)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIServiceManager> servMgr(do_QueryInterface(aServMgr, &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIComponentManager> compMgr =
|
||||
do_GetService(kComponentManagerCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = compMgr->RegisterComponent(kAccountServicesCID,
|
||||
"Account Services",
|
||||
"@mozilla.org/profile/Account-services;1",
|
||||
aPath, PR_TRUE, PR_TRUE);
|
||||
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
extern "C" PR_IMPLEMENT(nsresult)
|
||||
NSUnregisterSelf(nsISupports* aServMgr, const char* aPath)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIServiceManager> servMgr(do_QueryInterface(aServMgr, &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIComponentManager> compMgr =
|
||||
do_GetService(kComponentManagerCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = compMgr->UnregisterComponent(kAccountServicesCID, aPath);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
|
||||
A sample of XPComized ProfileManager. This file contains a profile interface.
|
||||
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(497055C1-3E2D-11d3-B207-006008A6BBCE)]
|
||||
interface nsIAccountServices : nsISupports
|
||||
{
|
||||
void SetDialerConfig(in string data);
|
||||
string GetAcctConfig();
|
||||
string GetModemConfig();
|
||||
string GetSiteName();
|
||||
string GetPhone();
|
||||
void LoadValues();
|
||||
string CheckForDun();
|
||||
};
|
||||
|
||||
|
||||
%{ C++
|
||||
// {497055C2-3E2D-11d3-B207-006008A6BBCE}
|
||||
#define NS_AccountServices_CID \
|
||||
{ 0x497055c2, 0x3e2d, 0x11d3, { 0xb2, 0x07, 0x00, 0x60, 0x08, 0xa6, 0xbb, 0xce } }
|
||||
|
||||
extern nsresult
|
||||
NS_NewAccountServices(nsIAccountServices** aProfile);
|
||||
%}
|
||||
@ -1 +0,0 @@
|
||||
_NSRegisterSelf ; 1
|
||||
Loading…
x
Reference in New Issue
Block a user