Write User Name on Plugins Registration/Authorization
-
I will show you how I did it as soon as I get home.
It will be like around 6pm
-
@Jay said in Write User Name on Plugins Registration/Authorization:
It will be like around 6pm
What time zone? For me you sent that message at 7pm :p
-
@Jay Thank you. :) I am waiting .
-
Hi, @Christoph-Hart @d-healey @Jay Tried a Simple Authorization System with FileSystem and FILE API but not working. What am i missing?
Content.makeFrontInterface(300, 200); const var mainGUI = Content.getComponent("mainGUI"); const var authorise = Content.getComponent("authorise"); const var submit = Content.getComponent("submit"); const var uid = Content.getComponent("uid"); const Desktop = FileSystem.getFolder(FileSystem.Desktop); uid.set("text" , ""); if(value) { var f = Desktop.getChildFile("UID.txt"); if (f.isFile) { uid.set("text",f.loadAsString()); mainGUI.showControl(true); // GUI only be shown after successful UID validation } } inline function onsubmitControl(component, value) { if(value) { local f = Desktop.getChildFile("UID.txt"); f.writeString(uid.getValue()); uid.set("text",""); // authorise.showControl(false); mainGUI.showControl(true); } else { mainGUI.showControl(false); //authorise.showControl(true); } }; Content.getComponent("submit").setControlCallback(onsubmitControl); /// Tried but Not working....
HiseSnippet 1379.3ocsWssaabCDkqiYgkrUQCPeouQ3mjAbk2ckrkLLBhhuEHT6DkJG29TMn1kqEg2kTXWJaKDXf7oz26OQ9j5eP6v8hD0E6FXzrODGx4BOyYFNbT2XoGKIQFirJcw3gLj0F3diEpAGMfxEnNGir9I7o7PVuwJVD4MiTCjw7DphKEnCGOjljv7QVVu3sZ0sJsJJ86ue8gzPpviMcKD5RI2icFOhqlta21+BOL7TpO6Bdjg1MZ2wSJNRFJGAP6EXazPp2MzqYuipUaELx56Nwmqjw8TTEKAYs5gR+w8FHuSjo+k7Dd+PldgCpG3nrsOUF5qQrdWzQC3g9cKnfDD3ktSIjWjQH+H9btOex9SIleHU.YpEl7g0JOE7bLgm8WO7rLf2pYv6k3ddw7gpoRzXacbGghEGPgTfIrxzEsxesJ9HIngPUKhdC6zXXwDKpV21dahqs8VGToLjFRTjaowjHHve6G6PdEovzqYpijQCkBXQ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1IM0iWmKX9Iu0isIR3pwlie+MY7yuV39RbWtxavxw6JKAuPixu03MeX9J3SBBXdpofcU7o+929I2Q+pbjBdo8bJL7BT2he2nndP4fGCPh.5xneVyZE8CPYqs0q0LSOlvOcw+.e4BczqsxE5THDEQgFdW4k8rk9mKrV5N.lDo+poR3y0qINEuXgw10rQQP+vq77zTwOCXe4139Lro9yvlFOCa18YXydOCaZ9Lro0SZi9oH32TKixtl.az8jzIGrrNI8spzJRz+FtW3bO
-
@DabDab Take a look at Christoph's Hise tutorials projects :
https://github.com/christophhart/hise_tutorial -
@Matt_SF Sorry But where is Plugins Authorization Tutorials ? I mean where is new FileSytem and File API Authorization Tutorials ?
-
You don't need a File/Filesystem tutorial, you already have what you need for that.
if(value) { var f = Desktop.getChildFile("UID.txt"); if (f.isFile) { uid.set("text",f.loadAsString()); mainGUI.showControl(true); // GUI only be shown after successful UID validation } }
if (value)
makes no sense in on init. That check is neccessary in a momentary button to check if the value of the button is on or off, but in on init there isn't anything called value.You should avoid using
var
for variables whenever possible, use const or reg. It doesn't matter so much in on init but it's just a good habit because it does matter elsewhere.Checking if the file exists is not a very good validation technique, anyone could create a file called
UID.txt
You need an authorization tutorial which I believe Christoph posted. -
@d-healey
Where can I get @Christoph-Hart Tutorial ? @Matt_SF also told me for that tutorial. I guess the Authorization tutorial is based on old method.
Yesterday @Christoph-Hart advised this method is deprecated. So I am trying new File System and File API for Simple validation check andWriteEncryptedObject
. But no luck. -
Yesterday @Christoph-Hart advised this method is deprecated
You're mixing up things. Christoph said the dump json function is deprecated, that is totally separate from his authorization method.
Here is the tutorial for authorization. Just swap out the dump json stuff with the write string stuff - if it's too complicated for you then just stick with dump json, it's deprecated but it still works.
-
@d-healey OK. Now I Understand. @Christoph-Hart has a scientist brain. My brain is ordinary. So messed up. :beaming_face_with_smiling_eyes:
-
@d-healey said in Write User Name on Plugins Registration/Authorization:
Yesterday @Christoph-Hart advised this method is deprecated
You're mixing up things. Christoph said the dump json function is deprecated, that is totally separate from his authorization method.
Here is the tutorial for authorization. Just swap out the dump json stuff with the write string stuff - if it's too complicated for you then just stick with dump json, it's deprecated but it still works.
yeah but....the file API documentation is fundamentally lacking....there is a lot of stuff about how to act upon a file, but nothing that tells you how to create a new file....Engine.dumpAsJSON(someData, "myFileName.js") creates a file....I cant see anything in the documentation that allows me to do this:
var profileData = Engine.loadFromJSON("ProfileData.js"); if (profileData == "") { profileData = [ { ProfileName: "FirstOne", someValue: [80] } ]; Engine.dumpAsJSON(profileData,"ProfileData.js"); };
-
@Lindon said in Write User Name on Plugins Registration/Authorization:
I cant see anything in the documentation that allows me to do this:
I already made a tutorial snippet for dabdab covering this.
-
@d-healey I think you are missing the point I'm making. Its not that:
"You cant do this in HISE"
but:
"Its not explained in the documentaiton how to do this in HISE"
-
@Lindon said in Write User Name on Plugins Registration/Authorization:
"Its not explained in the documentaiton how to do this in HISE"
I get it, I'm just saying that dabdab has a solution for that part of the puzzle. I'll try and add something to the docs this evening if I have some free time.
-
@Lindon Exactly...... As a beginner I am very much suffering. Figuring out the way and how it works a nightmare to me.
-
@d-healey yeah basically this comment needs expanding:
Returns a child file if this is a directory.
to:
Returns a child file if this is a directory. Returns a new file if childFileName does not exist
-
@DabDab said in Write User Name on Plugins Registration/Authorization:
As a beginner
Have you done any javascript script tutorials or watched my HISE scripting 101 video?
-
@d-healey Yes Sir, Each Function or most used function should come with an Example. So the beginner can understand how to write /declare it.
You gave me a good starting point yesterday. Still many functions need proper Example.
-
@d-healey Yup. I am a Youtube warm. HISESAUCE is my favourite.
-
@DabDab said in Write User Name on Plugins Registration/Authorization:
Still many functions need proper Example.
Definitely. But Christoph is only one person so we need more people to help out.
Anyone who wants to contribute can access the docs repo here - https://github.com/christophhart/hise_documentation