How to use information method in lisa

Best Python code snippet using lisa_python

ntdll.py

Source:ntdll.py Github

copy

Full Screen

1#!/usr/bin/env python2# -*- coding: utf-8 -*-34# Copyright (c) 2009-2014, Mario Vilas5# All rights reserved.6#7# Redistribution and use in source and binary forms, with or without8# modification, are permitted provided that the following conditions are met:9#10# * Redistributions of source code must retain the above copyright notice,11# this list of conditions and the following disclaimer.12# * Redistributions in binary form must reproduce the above copyright13# notice,this list of conditions and the following disclaimer in the14# documentation and/or other materials provided with the distribution.15# * Neither the name of the copyright holder nor the names of its16# contributors may be used to endorse or promote products derived from17# this software without specific prior written permission.18#19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"20# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE21# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE22# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE23# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR24# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF25# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS26# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN27# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)28# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE29# POSSIBILITY OF SUCH DAMAGE.3031"""32Wrapper for ntdll.dll in ctypes.33"""3435__revision__ = "$Id$"3637from winappdbg.win32.defines import *3839#==============================================================================40# This is used later on to calculate the list of exported symbols.41_all = None42_all = set(vars().keys())43_all.add('peb_teb')44#==============================================================================4546from winappdbg.win32.peb_teb import *4748#--- Types --------------------------------------------------------------------4950SYSDBG_COMMAND = DWORD51PROCESSINFOCLASS = DWORD52THREADINFOCLASS = DWORD53FILE_INFORMATION_CLASS = DWORD5455#--- Constants ----------------------------------------------------------------5657# DEP flags for ProcessExecuteFlags58MEM_EXECUTE_OPTION_ENABLE = 159MEM_EXECUTE_OPTION_DISABLE = 260MEM_EXECUTE_OPTION_ATL7_THUNK_EMULATION = 461MEM_EXECUTE_OPTION_PERMANENT = 86263# SYSTEM_INFORMATION_CLASS64# http://www.informit.com/articles/article.aspx?p=22442&seqNum=465SystemBasicInformation = 1 # 0x002C66SystemProcessorInformation = 2 # 0x000C67SystemPerformanceInformation = 3 # 0x013868SystemTimeInformation = 4 # 0x002069SystemPathInformation = 5 # not implemented70SystemProcessInformation = 6 # 0x00F8 + per process71SystemCallInformation = 7 # 0x0018 + (n * 0x0004)72SystemConfigurationInformation = 8 # 0x001873SystemProcessorCounters = 9 # 0x0030 per cpu74SystemGlobalFlag = 10 # 0x000475SystemInfo10 = 11 # not implemented76SystemModuleInformation = 12 # 0x0004 + (n * 0x011C)77SystemLockInformation = 13 # 0x0004 + (n * 0x0024)78SystemInfo13 = 14 # not implemented79SystemPagedPoolInformation = 15 # checked build only80SystemNonPagedPoolInformation = 16 # checked build only81SystemHandleInformation = 17 # 0x0004 + (n * 0x0010)82SystemObjectInformation = 18 # 0x0038+ + (n * 0x0030+)83SystemPagefileInformation = 19 # 0x0018+ per page file84SystemInstemulInformation = 20 # 0x008885SystemInfo20 = 21 # invalid info class86SystemCacheInformation = 22 # 0x002487SystemPoolTagInformation = 23 # 0x0004 + (n * 0x001C)88SystemProcessorStatistics = 24 # 0x0000, or 0x0018 per cpu89SystemDpcInformation = 25 # 0x001490SystemMemoryUsageInformation1 = 26 # checked build only91SystemLoadImage = 27 # 0x0018, set mode only92SystemUnloadImage = 28 # 0x0004, set mode only93SystemTimeAdjustmentInformation = 29 # 0x000C, 0x0008 writeable94SystemMemoryUsageInformation2 = 30 # checked build only95SystemInfo30 = 31 # checked build only96SystemInfo31 = 32 # checked build only97SystemCrashDumpInformation = 33 # 0x000498SystemExceptionInformation = 34 # 0x001099SystemCrashDumpStateInformation = 35 # 0x0008100SystemDebuggerInformation = 36 # 0x0002101SystemThreadSwitchInformation = 37 # 0x0030102SystemRegistryQuotaInformation = 38 # 0x000C103SystemLoadDriver = 39 # 0x0008, set mode only104SystemPrioritySeparationInformation = 40 # 0x0004, set mode only105SystemInfo40 = 41 # not implemented106SystemInfo41 = 42 # not implemented107SystemInfo42 = 43 # invalid info class108SystemInfo43 = 44 # invalid info class109SystemTimeZoneInformation = 45 # 0x00AC110SystemLookasideInformation = 46 # n * 0x0020111# info classes specific to Windows 2000112# WTS = Windows Terminal Server113SystemSetTimeSlipEvent = 47 # set mode only114SystemCreateSession = 48 # WTS, set mode only115SystemDeleteSession = 49 # WTS, set mode only116SystemInfo49 = 50 # invalid info class117SystemRangeStartInformation = 51 # 0x0004118SystemVerifierInformation = 52 # 0x0068119SystemAddVerifier = 53 # set mode only120SystemSessionProcessesInformation = 54 # WTS121122# NtQueryInformationProcess constants (from MSDN)123##ProcessBasicInformation = 0124##ProcessDebugPort = 7125##ProcessWow64Information = 26126##ProcessImageFileName = 27127128# PROCESS_INFORMATION_CLASS129# http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/NT%20Objects/Process/PROCESS_INFORMATION_CLASS.html130ProcessBasicInformation = 0131ProcessQuotaLimits = 1132ProcessIoCounters = 2133ProcessVmCounters = 3134ProcessTimes = 4135ProcessBasePriority = 5136ProcessRaisePriority = 6137ProcessDebugPort = 7138ProcessExceptionPort = 8139ProcessAccessToken = 9140ProcessLdtInformation = 10141ProcessLdtSize = 11142ProcessDefaultHardErrorMode = 12143ProcessIoPortHandlers = 13144ProcessPooledUsageAndLimits = 14145ProcessWorkingSetWatch = 15146ProcessUserModeIOPL = 16147ProcessEnableAlignmentFaultFixup = 17148ProcessPriorityClass = 18149ProcessWx86Information = 19150ProcessHandleCount = 20151ProcessAffinityMask = 21152ProcessPriorityBoost = 22153154ProcessWow64Information = 26155ProcessImageFileName = 27156157# http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx158ProcessDebugObjectHandle = 30159160ProcessExecuteFlags = 34161162# THREAD_INFORMATION_CLASS163ThreadBasicInformation = 0164ThreadTimes = 1165ThreadPriority = 2166ThreadBasePriority = 3167ThreadAffinityMask = 4168ThreadImpersonationToken = 5169ThreadDescriptorTableEntry = 6170ThreadEnableAlignmentFaultFixup = 7171ThreadEventPair = 8172ThreadQuerySetWin32StartAddress = 9173ThreadZeroTlsCell = 10174ThreadPerformanceCount = 11175ThreadAmILastThread = 12176ThreadIdealProcessor = 13177ThreadPriorityBoost = 14178ThreadSetTlsArrayAddress = 15179ThreadIsIoPending = 16180ThreadHideFromDebugger = 17181182# OBJECT_INFORMATION_CLASS183ObjectBasicInformation = 0184ObjectNameInformation = 1185ObjectTypeInformation = 2186ObjectAllTypesInformation = 3187ObjectHandleInformation = 4188189# FILE_INFORMATION_CLASS190FileDirectoryInformation = 1191FileFullDirectoryInformation = 2192FileBothDirectoryInformation = 3193FileBasicInformation = 4194FileStandardInformation = 5195FileInternalInformation = 6196FileEaInformation = 7197FileAccessInformation = 8198FileNameInformation = 9199FileRenameInformation = 10200FileLinkInformation = 11201FileNamesInformation = 12202FileDispositionInformation = 13203FilePositionInformation = 14204FileFullEaInformation = 15205FileModeInformation = 16206FileAlignmentInformation = 17207FileAllInformation = 18208FileAllocationInformation = 19209FileEndOfFileInformation = 20210FileAlternateNameInformation = 21211FileStreamInformation = 22212FilePipeInformation = 23213FilePipeLocalInformation = 24214FilePipeRemoteInformation = 25215FileMailslotQueryInformation = 26216FileMailslotSetInformation = 27217FileCompressionInformation = 28218FileCopyOnWriteInformation = 29219FileCompletionInformation = 30220FileMoveClusterInformation = 31221FileQuotaInformation = 32222FileReparsePointInformation = 33223FileNetworkOpenInformation = 34224FileObjectIdInformation = 35225FileTrackingInformation = 36226FileOleDirectoryInformation = 37227FileContentIndexInformation = 38228FileInheritContentIndexInformation = 37229FileOleInformation = 39230FileMaximumInformation = 40231232# From http://www.nirsoft.net/kernel_struct/vista/EXCEPTION_DISPOSITION.html233# typedef enum _EXCEPTION_DISPOSITION234# {235# ExceptionContinueExecution = 0,236# ExceptionContinueSearch = 1,237# ExceptionNestedException = 2,238# ExceptionCollidedUnwind = 3239# } EXCEPTION_DISPOSITION;240ExceptionContinueExecution = 0241ExceptionContinueSearch = 1242ExceptionNestedException = 2243ExceptionCollidedUnwind = 3244245#--- PROCESS_BASIC_INFORMATION structure --------------------------------------246247# From MSDN:248#249# typedef struct _PROCESS_BASIC_INFORMATION {250# PVOID Reserved1;251# PPEB PebBaseAddress;252# PVOID Reserved2[2];253# ULONG_PTR UniqueProcessId;254# PVOID Reserved3;255# } PROCESS_BASIC_INFORMATION;256##class PROCESS_BASIC_INFORMATION(Structure):257## _fields_ = [258## ("Reserved1", PVOID),259## ("PebBaseAddress", PPEB),260## ("Reserved2", PVOID * 2),261## ("UniqueProcessId", ULONG_PTR),262## ("Reserved3", PVOID),263##]264265# From http://catch22.net/tuts/tips2266# (Only valid for 32 bits)267#268# typedef struct269# {270# ULONG ExitStatus;271# PVOID PebBaseAddress;272# ULONG AffinityMask;273# ULONG BasePriority;274# ULONG_PTR UniqueProcessId;275# ULONG_PTR InheritedFromUniqueProcessId;276# } PROCESS_BASIC_INFORMATION;277278# My own definition follows:279class PROCESS_BASIC_INFORMATION(Structure):280 _fields_ = [281 ("ExitStatus", SIZE_T),282 ("PebBaseAddress", PVOID), # PPEB283 ("AffinityMask", KAFFINITY),284 ("BasePriority", SDWORD),285 ("UniqueProcessId", ULONG_PTR),286 ("InheritedFromUniqueProcessId", ULONG_PTR),287]288289#--- THREAD_BASIC_INFORMATION structure ---------------------------------------290291# From http://undocumented.ntinternals.net/UserMode/Structures/THREAD_BASIC_INFORMATION.html292#293# typedef struct _THREAD_BASIC_INFORMATION {294# NTSTATUS ExitStatus;295# PVOID TebBaseAddress;296# CLIENT_ID ClientId;297# KAFFINITY AffinityMask;298# KPRIORITY Priority;299# KPRIORITY BasePriority;300# } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;301class THREAD_BASIC_INFORMATION(Structure):302 _fields_ = [303 ("ExitStatus", NTSTATUS),304 ("TebBaseAddress", PVOID), # PTEB305 ("ClientId", CLIENT_ID),306 ("AffinityMask", KAFFINITY),307 ("Priority", SDWORD),308 ("BasePriority", SDWORD),309]310311#--- FILE_NAME_INFORMATION structure ------------------------------------------312313# typedef struct _FILE_NAME_INFORMATION {314# ULONG FileNameLength;315# WCHAR FileName[1];316# } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;317class FILE_NAME_INFORMATION(Structure):318 _fields_ = [319 ("FileNameLength", ULONG),320 ("FileName", WCHAR * 1),321 ]322323#--- SYSDBG_MSR structure and constants ---------------------------------------324325SysDbgReadMsr = 16326SysDbgWriteMsr = 17327328class SYSDBG_MSR(Structure):329 _fields_ = [330 ("Address", ULONG),331 ("Data", ULONGLONG),332]333334#--- IO_STATUS_BLOCK structure ------------------------------------------------335336# typedef struct _IO_STATUS_BLOCK {337# union {338# NTSTATUS Status;339# PVOID Pointer;340# };341# ULONG_PTR Information;342# } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;343class IO_STATUS_BLOCK(Structure):344 _fields_ = [345 ("Status", NTSTATUS),346 ("Information", ULONG_PTR),347 ]348 def __get_Pointer(self):349 return PVOID(self.Status)350 def __set_Pointer(self, ptr):351 self.Status = ptr.value352 Pointer = property(__get_Pointer, __set_Pointer)353354PIO_STATUS_BLOCK = POINTER(IO_STATUS_BLOCK)355356#--- ntdll.dll ----------------------------------------------------------------357358# ULONG WINAPI RtlNtStatusToDosError(359# __in NTSTATUS Status360# );361def RtlNtStatusToDosError(Status):362 _RtlNtStatusToDosError = windll.ntdll.RtlNtStatusToDosError363 _RtlNtStatusToDosError.argtypes = [NTSTATUS]364 _RtlNtStatusToDosError.restype = ULONG365 return _RtlNtStatusToDosError(Status)366367# NTSYSAPI NTSTATUS NTAPI NtSystemDebugControl(368# IN SYSDBG_COMMAND Command,369# IN PVOID InputBuffer OPTIONAL,370# IN ULONG InputBufferLength,371# OUT PVOID OutputBuffer OPTIONAL,372# IN ULONG OutputBufferLength,373# OUT PULONG ReturnLength OPTIONAL374# );375def NtSystemDebugControl(Command, InputBuffer = None, InputBufferLength = None, OutputBuffer = None, OutputBufferLength = None):376 _NtSystemDebugControl = windll.ntdll.NtSystemDebugControl377 _NtSystemDebugControl.argtypes = [SYSDBG_COMMAND, PVOID, ULONG, PVOID, ULONG, PULONG]378 _NtSystemDebugControl.restype = NTSTATUS379380 # Validate the input buffer381 if InputBuffer is None:382 if InputBufferLength is None:383 InputBufferLength = 0384 else:385 raise ValueError(386 "Invalid call to NtSystemDebugControl: "387 "input buffer length given but no input buffer!")388 else:389 if InputBufferLength is None:390 InputBufferLength = sizeof(InputBuffer)391 InputBuffer = byref(InputBuffer)392393 # Validate the output buffer394 if OutputBuffer is None:395 if OutputBufferLength is None:396 OutputBufferLength = 0397 else:398 OutputBuffer = ctypes.create_string_buffer("", OutputBufferLength)399 elif OutputBufferLength is None:400 OutputBufferLength = sizeof(OutputBuffer)401402 # Make the call (with an output buffer)403 if OutputBuffer is not None:404 ReturnLength = ULONG(0)405 ntstatus = _NtSystemDebugControl(Command, InputBuffer, InputBufferLength, byref(OutputBuffer), OutputBufferLength, byref(ReturnLength))406 if ntstatus != 0:407 raise ctypes.WinError( RtlNtStatusToDosError(ntstatus) )408 ReturnLength = ReturnLength.value409 if ReturnLength != OutputBufferLength:410 raise ctypes.WinError(ERROR_BAD_LENGTH)411 return OutputBuffer, ReturnLength412413 # Make the call (without an output buffer)414 ntstatus = _NtSystemDebugControl(Command, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength, None)415 if ntstatus != 0:416 raise ctypes.WinError( RtlNtStatusToDosError(ntstatus) )417418ZwSystemDebugControl = NtSystemDebugControl419420# NTSTATUS WINAPI NtQueryInformationProcess(421# __in HANDLE ProcessHandle,422# __in PROCESSINFOCLASS ProcessInformationClass,423# __out PVOID ProcessInformation,424# __in ULONG ProcessInformationLength,425# __out_opt PULONG ReturnLength426# );427def NtQueryInformationProcess(ProcessHandle, ProcessInformationClass, ProcessInformationLength = None):428 _NtQueryInformationProcess = windll.ntdll.NtQueryInformationProcess429 _NtQueryInformationProcess.argtypes = [HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG]430 _NtQueryInformationProcess.restype = NTSTATUS431 if ProcessInformationLength is not None:432 ProcessInformation = ctypes.create_string_buffer("", ProcessInformationLength)433 else:434 if ProcessInformationClass == ProcessBasicInformation:435 ProcessInformation = PROCESS_BASIC_INFORMATION()436 ProcessInformationLength = sizeof(PROCESS_BASIC_INFORMATION)437 elif ProcessInformationClass == ProcessImageFileName:438 unicode_buffer = ctypes.create_unicode_buffer(u"", 0x1000)439 ProcessInformation = UNICODE_STRING(0, 0x1000, addressof(unicode_buffer))440 ProcessInformationLength = sizeof(UNICODE_STRING)441 elif ProcessInformationClass in (ProcessDebugPort, ProcessWow64Information, ProcessWx86Information, ProcessHandleCount, ProcessPriorityBoost):442 ProcessInformation = DWORD()443 ProcessInformationLength = sizeof(DWORD)444 else:445 raise Exception("Unknown ProcessInformationClass, use an explicit ProcessInformationLength value instead")446 ReturnLength = ULONG(0)447 ntstatus = _NtQueryInformationProcess(ProcessHandle, ProcessInformationClass, byref(ProcessInformation), ProcessInformationLength, byref(ReturnLength))448 if ntstatus != 0:449 raise ctypes.WinError( RtlNtStatusToDosError(ntstatus) )450 if ProcessInformationClass == ProcessBasicInformation:451 retval = ProcessInformation452 elif ProcessInformationClass in (ProcessDebugPort, ProcessWow64Information, ProcessWx86Information, ProcessHandleCount, ProcessPriorityBoost):453 retval = ProcessInformation.value454 elif ProcessInformationClass == ProcessImageFileName:455 vptr = ctypes.c_void_p(ProcessInformation.Buffer)456 cptr = ctypes.cast( vptr, ctypes.c_wchar * ProcessInformation.Length )457 retval = cptr.contents.raw458 else:459 retval = ProcessInformation.raw[:ReturnLength.value]460 return retval461462ZwQueryInformationProcess = NtQueryInformationProcess463464# NTSTATUS WINAPI NtQueryInformationThread(465# __in HANDLE ThreadHandle,466# __in THREADINFOCLASS ThreadInformationClass,467# __out PVOID ThreadInformation,468# __in ULONG ThreadInformationLength,469# __out_opt PULONG ReturnLength470# );471def NtQueryInformationThread(ThreadHandle, ThreadInformationClass, ThreadInformationLength = None):472 _NtQueryInformationThread = windll.ntdll.NtQueryInformationThread473 _NtQueryInformationThread.argtypes = [HANDLE, THREADINFOCLASS, PVOID, ULONG, PULONG]474 _NtQueryInformationThread.restype = NTSTATUS475 if ThreadInformationLength is not None:476 ThreadInformation = ctypes.create_string_buffer("", ThreadInformationLength)477 else:478 if ThreadInformationClass == ThreadBasicInformation:479 ThreadInformation = THREAD_BASIC_INFORMATION()480 elif ThreadInformationClass == ThreadHideFromDebugger:481 ThreadInformation = BOOLEAN()482 elif ThreadInformationClass == ThreadQuerySetWin32StartAddress:483 ThreadInformation = PVOID()484 elif ThreadInformationClass in (ThreadAmILastThread, ThreadPriorityBoost):485 ThreadInformation = DWORD()486 elif ThreadInformationClass == ThreadPerformanceCount:487 ThreadInformation = LONGLONG() # LARGE_INTEGER488 else:489 raise Exception("Unknown ThreadInformationClass, use an explicit ThreadInformationLength value instead")490 ThreadInformationLength = sizeof(ThreadInformation)491 ReturnLength = ULONG(0)492 ntstatus = _NtQueryInformationThread(ThreadHandle, ThreadInformationClass, byref(ThreadInformation), ThreadInformationLength, byref(ReturnLength))493 if ntstatus != 0:494 raise ctypes.WinError( RtlNtStatusToDosError(ntstatus) )495 if ThreadInformationClass == ThreadBasicInformation:496 retval = ThreadInformation497 elif ThreadInformationClass == ThreadHideFromDebugger:498 retval = bool(ThreadInformation.value)499 elif ThreadInformationClass in (ThreadQuerySetWin32StartAddress, ThreadAmILastThread, ThreadPriorityBoost, ThreadPerformanceCount):500 retval = ThreadInformation.value501 else:502 retval = ThreadInformation.raw[:ReturnLength.value]503 return retval504505ZwQueryInformationThread = NtQueryInformationThread506507# NTSTATUS508# NtQueryInformationFile(509# IN HANDLE FileHandle,510# OUT PIO_STATUS_BLOCK IoStatusBlock,511# OUT PVOID FileInformation,512# IN ULONG Length,513# IN FILE_INFORMATION_CLASS FileInformationClass514# );515def NtQueryInformationFile(FileHandle, FileInformationClass, FileInformation, Length):516 _NtQueryInformationFile = windll.ntdll.NtQueryInformationFile517 _NtQueryInformationFile.argtypes = [HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, DWORD]518 _NtQueryInformationFile.restype = NTSTATUS519 IoStatusBlock = IO_STATUS_BLOCK()520 ntstatus = _NtQueryInformationFile(FileHandle, byref(IoStatusBlock), byref(FileInformation), Length, FileInformationClass)521 if ntstatus != 0:522 raise ctypes.WinError( RtlNtStatusToDosError(ntstatus) )523 return IoStatusBlock524525ZwQueryInformationFile = NtQueryInformationFile526527# DWORD STDCALL CsrGetProcessId (VOID);528def CsrGetProcessId():529 _CsrGetProcessId = windll.ntdll.CsrGetProcessId530 _CsrGetProcessId.argtypes = []531 _CsrGetProcessId.restype = DWORD532 return _CsrGetProcessId()533534#==============================================================================535# This calculates the list of exported symbols.536_all = set(vars().keys()).difference(_all)537__all__ = [_x for _x in _all if not _x.startswith('_')]538__all__.sort() ...

Full Screen

Full Screen

screen.js

Source:screen.js Github

copy

Full Screen

1import React, { useEffect, useState } from 'react';2import { useHistory } from 'react-router-dom';3import { reset } from "redux-form";4import './styles.scss';5const { defaultConfig: { PLATFORM, LOCATION } } = require(`../../../../../../config/default`);6const { STRINGS } = require(`../../../../../../shared/${PLATFORM}/constants/${LOCATION}/strings`)7const { ROUTES, LABELS, LOGIN_TYPES, PASSWORD_HIDE_ICON,8 PASSWORD_EYE } = require(`../../../../../../shared/${PLATFORM}/constants`);9const { EditProfileForm } = require("./editProfileForm.js")10const { ChangePasswordForm } = require("./changePassword.js")11const { SnackbarWrapper } = require(`../../../../../../components/${PLATFORM}/molecules/snackbar-wrapper`);12export const Screen = ({ getProfile,13 getProfileInformation, changePassword, prevLocation, updateMember }) => {14 const [editProfileMode, setEditProfileMode] = useState(false);15 let history = useHistory();16 const updateProfileFunction = () => {17 getProfile(() => { }, (error) => {18 setSnackBarData({19 variant: error.status ? 'success' : 'error',20 message: error.msg || 'error'21 });22 setOpenSnackbar(true)23 })24 }25 useEffect(() => {26 updateProfileFunction()27 }, [])28 const [fields, setFields] = useState({29 name: '',30 surname: '',31 email: '',32 dob: '',33 phoneNumber: '',34 phoneKey: '',35 city: '',36 country: ''37 })38 const [snackbarData, setSnackBarData] = useState({39 variant: '',40 message: ''41 });42 const [popupVisible, setPopVisible] = useState(false);43 const [openSnackBar, setOpenSnackbar] = useState(false);44 const capitalizeFirstLetter = (string) => {45 if (string) {46 return string.charAt(0).toUpperCase() + string.slice(1);47 }48 }49 useEffect(() => {50 setFields({51 name: getProfileInformation && getProfileInformation.name,52 surname: getProfileInformation && getProfileInformation.surname,53 email: getProfileInformation && getProfileInformation.email,54 dob: getProfileInformation && getProfileInformation.dob,55 phoneNumber: getProfileInformation && getProfileInformation.phoneNumber && getProfileInformation.phoneNumber.phone,56 phoneKey: getProfileInformation && getProfileInformation.phoneNumber && getProfileInformation.phoneNumber.code,57 city: getProfileInformation && getProfileInformation.city,58 country: {59 label: capitalizeFirstLetter(getProfileInformation && getProfileInformation.country),60 value: capitalizeFirstLetter(getProfileInformation && getProfileInformation.country)61 }62 })63 }, [getProfileInformation])64 return (65 <>66 <div className="app-main_outer">67 <SnackbarWrapper68 visible={openSnackBar}69 onClose={() => setOpenSnackbar(false)}70 variant={snackbarData.variant}71 message={snackbarData.message}72 />73 <div className="container-fluid myProfile">74 <h5 className="mb-4"> {75 editProfileMode === false ? 'Here is your profile'76 : 'Edit your profile'}77 </h5>78 <div className="profile_info">79 {80 editProfileMode === false ?81 <>82 <ul className="profile_info profile_shw mb-2">83 <li><label>{STRINGS.NAME}:</label> {getProfileInformation && getProfileInformation.name ? getProfileInformation.name : ''}84 {getProfileInformation && getProfileInformation.surname ? ` ${getProfileInformation.surname}` : ''} </li>85 <li><label>{STRINGS.EMAIL}:</label> {getProfileInformation && getProfileInformation.name ? getProfileInformation.email : ''}</li>86 {/* <li><label>{STRINGS.PHONE_NO}:</label>{getProfileInformation && getProfileInformation.phoneNumber ? getProfileInformation.phoneNumber.code : ''}87 {getProfileInformation && getProfileInformation.phoneNumber ? ` ${getProfileInformation.phoneNumber.phone}` : ''}88 </li> */}89 <li><label>{STRINGS.ADDRESS}:</label> {getProfileInformation && getProfileInformation.city ? `${capitalizeFirstLetter(getProfileInformation.city)}, ` : ''}90 {getProfileInformation && getProfileInformation.country ? capitalizeFirstLetter(getProfileInformation.country) : ''}</li>91 {/* <li><label>{STRINGS.DOB.toUpperCase()}:</label>92 {getProfileInformation && getProfileInformation.dob ? moment(getProfileInformation.dob).format("DD/MM/YYYY") : ''}93 </li> */}94 </ul>95 <a className="btn btn-sm btn-primary my-2" onClick={() => {96 setEditProfileMode(true)97 }} style={{ color: 'white' }}>{STRINGS.EDIT}</a>98 {(getProfileInformation && getProfileInformation.loginType) === LOGIN_TYPES.NORMAL ?99 <div className="form-fields my-4">100 <label className="mb-3">{LABELS.changePasswordheading}</label>101 <ChangePasswordForm102 passwordHideLogo={PASSWORD_HIDE_ICON}103 passwordEyeLogo={PASSWORD_EYE}104 onSubmit={(credentials, dispatch) => {105 let postData = {106 "currentPassword": credentials.password,107 "newPassword": credentials.Password108 }109 changePassword(postData, (response) => {110 setSnackBarData({111 variant: response.status ? 'success' : 'error',112 message: response.msg || 'error'113 });114 setOpenSnackbar(true)115 dispatch(reset('ChangePasswordForm'))116 // history.replace(ROUTES.DASHBOARD)117 }, (error) => {118 setSnackBarData({119 variant: error.status ? 'success' : 'error',120 message: error.msg || 'error'121 });122 setOpenSnackbar(true)123 })124 }}125 />126 </div>127 : ''128 }129 </>130 :131 <EditProfileForm132 setEditProfileMode={setEditProfileMode}133 updateProfile={updateMember}134 fields={fields}135 setFields={setFields}136 onSubmit={(credentials) => {137 let postData138 const { email, name, city, country, phoneKey, phoneNumber, surname, dob } = credentials139 if (credentials) {140 postData = {141 name,142 email,143 city,144 country: country.value,145 surname,146 dob: new Date(dob)147 }148 }149 updateMember(postData, (response) => {150 setSnackBarData({151 variant: response.status ? 'success' : 'error',152 message: response.msg || 'error'153 });154 setOpenSnackbar(true)155 updateProfileFunction()156 setEditProfileMode(false)157 if (prevLocation === ROUTES.VEHICLE_SUMMARY && (getProfileInformation.loginType === 2 ||158 getProfileInformation.loginType === 3)) {159 history.replace(ROUTES.VEHICLE_SUMMARY)160 }161 }, (error) => {162 setSnackBarData({163 variant: error.status ? 'success' : 'error',164 message: error.msg || 'error'165 });166 setOpenSnackbar(true)167 })168 }} />169 }170 </div>171 </div>172 </div>173 </>174 )...

Full Screen

Full Screen

privacy-policy.js

Source:privacy-policy.js Github

copy

Full Screen

1import React from 'react';2import styled from '@emotion/styled';3import Layout from '../components/layouts/Layout';4import { P } from '../components/reusableStyles/typography/Typography';5import SEO from '../hooks/SEO';6const CustomP = styled(P)`7 font-size: 1.4rem;8 margin: 2rem 0;9`;10const Section = styled.div`11 max-width: 800px;12 margin: 0 auto;13 padding: 2rem;14`;15const PrivacyPolicyPage = () => {16 return (17 <Layout>18 <SEO19 title="Privacy Policy | Codepaper "20 description="Codepaper | Privacy Policy <br /> This Privacy Policy describes how21 your personal information is collected, used, and shared when you22 visit or make a purchase from https://codepaper.dev (the “Site”).23 PERSONAL INFORMATION WE COLLECT When you visit the Site, we24 automatically collect certain information about your device, including25 information about your web browser, IP address, time zone, and some of26 the cookies that are installed on your device."27 path="/privacy-policy"28 />29 <Section>30 <CustomP>31 Codepaper | Privacy Policy <br /> This Privacy Policy describes how32 your personal information is collected, used, and shared when you33 visit or make a purchase from https://codepaper.dev (the “Site”).34 PERSONAL INFORMATION WE COLLECT When you visit the Site, we35 automatically collect certain information about your device, including36 information about your web browser, IP address, time zone, and some of37 the cookies that are installed on your device.38 </CustomP>39 <CustomP>40 Additionally, as you browse the Site, we collect information about the41 individual web pages or products that you view, what websites or42 search terms referred you to the Site, and information about how you43 interact with the Site. We refer to this automatically-collected44 information as “Device Information.” We collect Device Information45 using the following technologies: - “Cookies” are data files that are46 placed on your device or computer and often include an anonymous47 unique identifier. For more information about cookies, and how to48 disable cookies, visit http://www.allaboutcookies.org. - “Log files”49 track actions occurring on the Site, and collect data including your50 IP address, browser type, Internet service provider, referring/exit51 pages, and date/time stamps. - “Web beacons,” “tags,” and “pixels” are52 electronic files used to record information about how you browse the53 Site. Additionally when you make a purchase or attempt to make a54 purchase through the Site, we collect certain information from you,55 including your name, billing address, shipping address, payment56 information (including credit card numbers, email address, and phone57 number. We refer to this information as “Order Information.”58 </CustomP>59 <CustomP>60 When we talk about “Personal Information” in this Privacy Policy, we61 are talking both about Device Information and Order Information. HOW62 DO WE USE YOUR PERSONAL INFORMATION? We use the Order Information that63 we collect generally to fulfill any orders placed through the Site64 (including processing your payment information, arranging for65 shipping, and providing you with invoices and/or order confirmations).66 Additionally, we use this Order Information to: Communicate with you;67 Screen our orders for potential risk or fraud; and When in line with68 the preferences you have shared with us, provide you with information69 or advertising relating to our products or services. We use the Device70 Information that we collect to help us screen for potential risk and71 fraud (in particular, your IP address), and more generally to improve72 and optimize our Site (for example, by generating analytics about how73 our customers browse and interact with the Site, and to assess the74 success of our marketing and advertising campaigns).75 </CustomP>76 <CustomP>77 SHARING YOUR PERSONAL INFORMATION We share your Personal Information78 with third parties to help us use your Personal Information, as79 described above. For example, we also use Google Analytics to help us80 understand how our customers use the Site--you can read more about how81 Google uses your Personal Information here:82 https://www.google.com/intl/en/policies/privacy/. You can also opt-out83 of Google Analytics here: https://tools.google.com/dlpage/gaoptout.84 Finally, we may also share your Personal Information to comply with85 applicable laws and regulations, to respond to a subpoena, search86 warrant or other lawful request for information we receive, or to87 otherwise protect our rights.88 </CustomP>89 <CustomP>90 {' '}91 BEHAVIOURAL ADVERTISING As described above, we use your Personal92 Information to provide you with targeted advertisements or marketing93 communications we believe may be of interest to you. For more94 information about how targeted advertising works, you can visit the95 Network Advertising Initiative’s (“NAI”) educational page at96 http://www.networkadvertising.org/understanding-online-advertising/how-does-it-work.97 You can opt out of targeted advertising by: Additionally, you can opt98 out of some of these services by visiting the Digital Advertising99 Alliance’s opt-out portal at: http://optout.aboutads.info/. DO NOT100 TRACK Please note that we do not alter our Site’s data collection and101 use practices when we see a Do Not Track signal from your browser.102 YOUR RIGHTS If you are a European resident, you have the right to103 access personal information we hold about you and to ask that your104 personal information be corrected, updated, or deleted. If you would105 like to exercise this right, please contact us through the contact106 information below. Additionally, if you are a European resident we107 note that we are processing your information in order to fulfill108 contracts we might have with you (for example if you make an order109 through the Site), or otherwise to pursue our legitimate business110 interests listed above. Additionally, please note that your111 information will be transferred outside of Europe, including to Canada112 and the United States.113 </CustomP>114 <CustomP>115 DATA RETENTION When you place an order through the Site, we will116 maintain your Order Information for our records unless and until you117 ask us to delete this information. CHANGES We may update this privacy118 policy from time to time in order to reflect, for example, changes to119 our practices or for other operational, legal or regulatory reasons.120 We may also collect data through user forms for the purpose of serving121 your content may be related to your interests and the content of our122 site123 </CustomP>124 <CustomP>125 CONTACT US For more information about our privacy practices, if you126 have questions, or if you would like to make a complaint, please127 contact us by e-mail at codepaper.dev@gmail.com or by mail using the128 details provided below: 11033 127 St NW, Edmonton, AB, T5M 2L7, Canada129 </CustomP>130 </Section>131 </Layout>132 );133};...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run lisa automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful