mirror of
https://gitlab.com/JKANetwork/powerfulcomputermanager.git
synced 2026-02-26 23:13:44 +01:00
Cleaning debug
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# Build 13. Using API 2
|
# Build 14. Using API 2
|
||||||
param([Int32]$startup=0)
|
param([Int32]$startup=0)
|
||||||
#Write-Host $startup
|
#Write-Host $startup
|
||||||
$srcdir = $PSCommandPath | Split-Path -Parent
|
$srcdir = $PSCommandPath | Split-Path -Parent
|
||||||
@@ -28,7 +28,6 @@ if ((Get-Host | Select-Object Version).Version.Major -lt 6){#Powershell Windows
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$exists = Invoke-RestMethod -Method Post -Uri "$server/get/computerexists?ComputerName=$computerName&UUID=$UUID"
|
$exists = Invoke-RestMethod -Method Post -Uri "$server/get/computerexists?ComputerName=$computerName&UUID=$UUID"
|
||||||
if ($exists.Result -eq "ERROR"){
|
if ($exists.Result -eq "ERROR"){
|
||||||
if ($exists.EXITCODE -eq '3'){
|
if ($exists.EXITCODE -eq '3'){
|
||||||
@@ -72,10 +71,6 @@ $lastUser = (Get-CimInstance -ClassName Win32_ComputerSystem -Property UserName
|
|||||||
$paramInvoke = -join("$server/upd/computer?ComputerName=$computerName&UUID=",$UUID,"&SOVersion=",$SOVersion,"&SOCaption=",$SOData.Caption,"&SOBit=",$SOData.OsArchitecture.Substring(0,2),"&LastConnection=",$Timestamp,"&RAM=",$RAMInstalled,"&RAMFree=",$RAMFree,"&CPUName=",$CPUName,"&LastUser=",$lastUser,"&HDD=",$DisksData)
|
$paramInvoke = -join("$server/upd/computer?ComputerName=$computerName&UUID=",$UUID,"&SOVersion=",$SOVersion,"&SOCaption=",$SOData.Caption,"&SOBit=",$SOData.OsArchitecture.Substring(0,2),"&LastConnection=",$Timestamp,"&RAM=",$RAMInstalled,"&RAMFree=",$RAMFree,"&CPUName=",$CPUName,"&LastUser=",$lastUser,"&HDD=",$DisksData)
|
||||||
Invoke-RestMethod -Method Post -Uri $paramInvoke | out-null
|
Invoke-RestMethod -Method Post -Uri $paramInvoke | out-null
|
||||||
|
|
||||||
# More info (Only if has to be)
|
|
||||||
# $paramInvoke = -join("$server/upd/computerhis?ComputerName=$computerName&UUID=",$UUID,"&RAMFree=",$RAMFree,"&RAMUsed=",$RAMUsed,"&Timestamp=",$Timestamp,"&DisksUse=",$disksUse)
|
|
||||||
# Invoke-RestMethod -Method Post -Uri $paramInvoke | out-null
|
|
||||||
|
|
||||||
|
|
||||||
# Load Cooks of computer
|
# Load Cooks of computer
|
||||||
$cooks = Invoke-RestMethod -Method Post -Uri "$server/get/cookpend?ComputerName=$computerName&UUID=$UUID"
|
$cooks = Invoke-RestMethod -Method Post -Uri "$server/get/cookpend?ComputerName=$computerName&UUID=$UUID"
|
||||||
|
|||||||
@@ -295,7 +295,6 @@ def m_delcomputergroup():
|
|||||||
|
|
||||||
# Check password before starting all
|
# Check password before starting all
|
||||||
pa = returnvalueapi("/check/password?Password=None",field="EXITCODE")
|
pa = returnvalueapi("/check/password?Password=None",field="EXITCODE")
|
||||||
print(pa)
|
|
||||||
if pa == "3": # No password stored yet
|
if pa == "3": # No password stored yet
|
||||||
passw = easygui.passwordbox(T('There is no password yet in PCM. Please set one below'),T('Set password'))
|
passw = easygui.passwordbox(T('There is no password yet in PCM. Please set one below'),T('Set password'))
|
||||||
passw2 = easygui.passwordbox(T('Confirm it'),T('Set password'))
|
passw2 = easygui.passwordbox(T('Confirm it'),T('Set password'))
|
||||||
@@ -316,7 +315,6 @@ else: # There is a password
|
|||||||
quit()
|
quit()
|
||||||
passha256 = hashlib.sha256(passw.encode()).hexdigest()
|
passha256 = hashlib.sha256(passw.encode()).hexdigest()
|
||||||
re = returnvalueapi("/check/password?Password="+passha256,field="EXITCODE") # Create password in database
|
re = returnvalueapi("/check/password?Password="+passha256,field="EXITCODE") # Create password in database
|
||||||
print(re)
|
|
||||||
if re == '0': # Password is right
|
if re == '0': # Password is right
|
||||||
menuprinc()
|
menuprinc()
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user