diff --git a/D3K.ahk b/D3K.ahk index 828d6a7..b605322 100644 --- a/D3K.ahk +++ b/D3K.ahk @@ -112,6 +112,15 @@ If (glovar = 1) } } } + If InStr(StoredSection, "GuestAdmin") ; If the section is "GuestAdmin", make everything uppercase + { + StringUpper, REValue, REValue ; Makes it uppercase + WinWaitNotActive, GloVar.ini ; Just to make sure + { + ini_write(glovarini, REKey, REValue) + FileGetTime, gvMod, %glovarini% + } + } If InStr(REKey, "case") ; If a key contains "case". Case numbers are all in the format "LETTERS-NUMBERS". { StringUpper, REValue, REValue ; Makes it uppercase @@ -138,14 +147,46 @@ If (glovar = 1) If (RESection) ; If we have a section { StoredSection := RESection + If InStr(RESection, "GuestAdmin") ; For giving other people access to orgs + { + If !(GuestAdmin) + { + FileRead, initemp, %glovarini% ; Read the ini + initemp := "[GuestAdmin]`nid=`nusr=`norg=`n[Info]`ncase=" + FileAppend, %initemp%, temptemp + FileCopy, temptemp, %glovarini%, 1 + FileDelete, temptemp + FileRead, gvMod, %glovarini% + FileDelete, glovar.ahk ; THE CLEAN SLATE + FileAppend, %glovarstart%, glovar.ahk + + Sleep, 500 + FileGetTime, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code + If FileExist("glovar.ahk") + { + Run glovar.ahk + } + } + GuestAdmin := True + } + If InStr(RESection, "clear") ; Will clear the ini and save its and the documentation file's contents to a log { - FileRead, doctemp, %docfile% ; Read documentation file, set in settings + If !(GuestAdmin) + { + FileRead, doctemp, %docfile% ; Read documentation file, set in settings + } FileRead, initemp, %glovarini% ; Read the ini initemp := RegExReplace(initemp, "(?<=\[)clear(?=\])", "Info") ; Replace the "clear" section we set with Info CurrTime := GetDateTime("en") ; get the current date and time as "YYYY-MM-DD at HH:MM GMT" - writethis := "Case on " . CurrTime . "`n`n`n" . doctemp . "`n`n" . initemp ; Save the current time, what was in the doc file, and glovarini to a variable + If !(GuestAdmin) + { + writethis := "Case on " . CurrTime . "`n`n`n" . doctemp . "`n`n" . initemp ; Save the current time, what was in the doc file, and glovarini to a variable + } else { + writethis := "Case on " . CurrTime . "`n`n" . initemp ; Save the current time and glovarini to a variable if it was just giving access to an org + } + FileAppend, % "`n`n" writethis "`n`n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", %A_MyDocuments%/D3KLog.txt ; Write a few new lines , the content, and a line underneath FileAppend,, temptemp FileCopy, glovarsource, %glovarini%, 1 ; Copies and replaces any text in glovar.ini with the template @@ -161,6 +202,7 @@ If (glovar = 1) { Run glovar.ahk } + GuestAdmin := False Return } }