Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArg = {...}
- local UserKeys = {}
- function Nav(Dir)
- App.Clear()
- App.newText("path",Dir,3,1)
- App.newButton("return","<-","tsk."..fs.getDir(Dir),1,1)
- local list = fs.list(Dir)
- for i = 1, #list do
- local text
- if fs.isDir(list[i]) then
- text = "/"..list[i]
- else
- text = list[i]
- end
- App.newButton("path"..i,text,"tsk."..fs.combine(Dir,list[i]),2, i + 2)
- end
- end
- function getKeys()
- local file = fs.open(fs.combine("os/System/Users",settings.get("active_user"),"UserKeys.txt")),"r")
- UserKeys = textutils.unserialize(file.readAll())
- file.close()
- end
- function CheckKeys(file)
- local Pass = Sec.CheckAccess(file)
- if Pass == true then
- shell.run("edit",file)
- else
- App.Clear()
- App.newButton("error","missing file key","tsk."..fs.getDir(file),1,5)
- end
- end
- getKeys()
- if tArg[1] == "start" then
- Nav("os/System")
- else
- if fs.isDir(tArg[1]) then
- Nav(tArg[1])
- else
- CheckKeys(tArg[1])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement