HI iSh0w
I've tried two or three times in the past to get this plugin to work. Each time i came across the same problem. the "Unlock" would work, but the "lock" would not.
This weekend I had some time on my hands, so i had a bit of play with the plugin. I figured out it was not a problem with the ".bat" files, as i could run that directly from the OS (windows7, server 2008). it was a problem with the Python code. I put a line the Code to make a logger entry everytime it got to the "L0ck" procedure, and i could see in the log, that it was making an entry, for the "unlock" request, but was not triggering when "lock" ing.
This means that the issue had to be here :-
oc.add(DirectoryObject(key=Callback(L0ck, path=BASEPATHL0CK, task='L0cked', query=""), title="L0ck", thumb=R(L0CK_ICON))) oc.add(InputDirectoryObject(key=Callback(L0ck, path=BASEPATHUNL0CK, task='UnL0cked'), title="UnL0ck", thumb=R(UNL0CK_ICON), prompt="Enter your password")) oc.add(DirectoryObject(key=Callback(Updates), title="Update Feed", thumb=R(UPDATES_ICON))) Return oc
again after some messing around, i made it Lock/unlock by duplicaiting the "unlock" line, and changing the "unlocks" to "locks", this worked, but it asked for a password everytime.
So i directed my attention to the first line, and put a value, any value, in the query="" var eg query="1". and it worked!!
for some reason on my systems, if the query is blank, the code, just won't execute through to the "lock" procedure.
I also changed the SQL that executes when locking and unlocking. I had a niggle about the need to restart/refresh the client after unlocking/locking. so I added a Library called "Restricted", added some content into it, and had a play. what i ended up was this :-
for locking update metadata_items set library_section_id = 999 where library_section_id = 25For unlocking
update metadata_items set library_section_id = 25 where library_section_id = 999
this means that after running the lock, there will be nothing in the library "25", and after unlocking the content will be there, No need to refresh/restart the client. but you do have a Library that will always be empty when the content is locked.
Thought i would share...
Good plugin. thanks for all the hard work.