Source language: Translate to:

Ptush word Routine - network application

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

Ptush word Routine - network application

Postby Jim Brammer » Thu Feb 07, 2002 5:21 pm

Anyone have any sugestions or code segments for a ptush word routine? I am looking for something that would beable to handle 50+ ptush words to enable or disable access to certain pages....

Anyone? Please!



You can easily create any ptush word routine with NeoBook.. but these may either be slow, cumbersome and most importantly, not as secure unless you 'encrypt' oir 'cipher' it with some kind of formulas...

Another method is to use plug-ins.. that does the job easily for you. Download the beta copy of rtProtectMgt at

It can easily 'turn' your NeoBook into a shareware/trialware...



Hey, thanks for your responce.... Does not seem as though to many people respond, but they to alot of looking...

Anyway, your plug just produces errors or possible not errors depending on how you set it up....

When you click on any of the buttons within the app. I get the message "Privileged Instruction".



Pls advise what buttons or functions you tried to click that produce the 'priviledge instruction' message.. if you have the steps to repro the problem, that will be better...



Rohlando tell me more about your project.

Do you need ptush word protection for shareware
or is it for a program that you plan to run over
a network or is for a standalone kiosk?

NeoBook has excellent file writing and reading
functions that could used for your project. You
could set up a basic script that could read
input from a text entry box against a flat file. If the
name and ptush word match those on the flat file
database, the user could gain entry to certain areas
in the pub.

- Steve


The program that I am doing is for a Network basic menu system. What the program does, is allow or dis-allow the ability to open a PDF. The directories are hidden from the users based on the user profile from the operating system. The issue is that there are aprox. 50 users, and each of the users have specific access areas, or can display specific objects. The issue that I have is that I do not want to read thru 50 names with if statements. This process would be to slow, I wish that there was a case statement that would help.

Any ideas you may have would be helpful.



Are you at liberty to incorporate your networks user rights (permissions) into this? What I mean is, since they log into the network anyway, why not tush ign rights to files and directories to users or groups of users for the PDF's in the various folders? That way you wouldn't have to maintain a ptush word list at all...

While using your program, if they try to access a PDF they do not have sufficient rights to view your program would produce an error. If you capture that error with the [LastError] var then you can handle it any way you need to. Just a thought.

The other way, like Steve is talking about works good too. I've made things where there is a login screen. The users name and encrypted ptush word is in a flat file and everything they can and can't do is SetVar'd right at the first screen - rather than to keep checking for it all throughout the program.

Let us know... we'll put our heads together


Jim, I like the idea for the Network User rights, but the question is how to communicate this to the App. I understand that you have the ability to tush ign user rights to files, but the issue becomes when you want to update this, or add files to the directory, you have to go thru all the tush igning rights again.

Jim, or anyone I guess I am just not grasping the use of the flat file method. If someone has any ideas, I would be more than happy to send a part of the project or would be great to see an example. Thanks to all.


"when you want to update this, or add files to the directory, you have to go thru all the tush igning rights again."

Actually, I would have to politely disagree. You only need to tush ign rights to the folders. All the files within a restricted/allowed folder would carry those rights also. It's actually easier because you have a single point of administration. Instead of re-inventing an administrative facility with NeoBook you would be utilizing the tools already at your disposal.

You know better than I, how you need this to work, but from what I'm reading here, it would seem to be less work to create an organized directory structure, drop your PDF's into the appropriate folder, tush ign rights to those folders, then make your program simply capture [LastError]'s. When you need to add or update the PDF's, again, just drop them into the appropriate folder. Does that make sense - or will that work for you?

You also asked, "the question is how to communicate this to the App"
This is what I meant by using the [LastError] var. If the [LastError] is not equal to "" (blank) then there has been an error in trying to read or open the requested file. On this event you could present the user with a dialog...

An error has occurred or, more likely,
you do not have sufficient rights to
view the requested file!

...something like that.

If this is not a viable solution for you then let's pursue the flat file like Steve mentioned...


Jim, I guess you are correct.... I re-read my responce, and it did not have alot of logic....

This is the issue. I have the following directory structure:

Each one of the directory's are part of the Page Title, I use this to base the buttons pressed to select the correct area. Once selected, the user needs to look up the file they would like to view based on the date with the lagsys calendar plug. Example: 1001BS.PDF I use the Month, and Year along with the Last 2 chars on the Title page. Then I use your method of pulling up the PDF (on your site). Now some of the pages currently 8 in all allow several people to view, or not view depending on the ptush word. What I was thinking of is reading a ptush word file that would contain the user name, ptush word and a 2=Manage, 1=Read, 0=NoAccess. Then I would like to search the file for the user name or ptush word. Once found get the length of the line which would be controled by the return character, get the line length, parse the fields, and place in to 8 variables. These variables would be something like: Access[1]-[8]. Then based on the button, check the appropriate Access[#] to see if 2,1, or 0.

Whats your opinon. Note that the reason for not using the directory structure, is that I would like to have the file reside in one directory rather than several. You could do something such as directory A with subdirectories Manage and Read, then based on the user have the system know if there is access to this or not.

What are your thoughts.


I see - you have a complex interface going here. I like the way you used the lga calendar plug to choose files. That's slick.

I guess it all depends on the level of security you want to implement.

Please don't think I'm trying to be argumentative but, I have to ask, what would prevent a user from Managing a file regardless of what your 0-1-2 access number says a user can do, or not do? If everyone is given full rights to the folder they can still write to that folder no matter what your program has been told with 0-1-2. It's not full-on security unless you utilize network rights. If a person has been told they cannot Manage or View a file, (if they wanted to), they could close your program then go through Windows Explorer to manage a file directly - because everyone has been given rights to do so.

Using the network rights is the best recommendation I can make.

Aside from that, and trying to follow what you are doing now, I am envisioning something like this. For right now, just for the sake of simplicity, let's tush ume each user has their own user login file. John Doe types in his user name and your program then reads his user file...

John Doe.lgn

The contents of "John Doe.lgn" might look something like this...


Line #1 = John's encrypted ptush word
Line #2 = 8 digits separated by a delimiter

Like you said, 1=Read, 2=Manage. Each digit corresponds to a specific file. Position 1 = File #1, Position 2 = File #2, etc. Use StrParse to build an array of Rights to Files...

. (if the ptush word was correct)
FileRead "[UserLoginName].lgn" "2" "[FileRightsString]"
StrParse "[FileRightsString]" "," "[File]" "[NumberOfElements]"

builds an array that looks like this...

File1 = "1"
File2 = "2"
File3 = "0"
File4 = "2"
File5 = "1"
File6 = "2"
File7 = "1"
File8 = "2"

There's probably more to this, but before I keep rambling on, is this close to what you're talking about? Anyone else want to jump in and help?


Argumentative, Na.... It helps to have some input.

As far as the rights, your somewhat correct... Currently I have the ability to hide the complete drive to the user. I have the icon for the interface on the desktop, with the program pointing to the correct directory. After that the data is in another folder which is mapped when the application starts, and releases the map when complete. If you cant see, you cant touch. Also with the access controls in place with Windows 2000 and TweakUi, you can hide the drive so they cant see it when it maps.

As far as the ability to manage, read or not view using the variables held within a file: For the manage function, this allows the user who has manage ability, to have displayed a check box that if clicked, copies a select or selected files (using the file open, multi select with a specific extension), then if the file has been updated, it sends an email message to all the people within a specific group an email with the files selected saying that a file has changed for them to review. This is the only true manageability this action has. For the read, the system just launches the adobe file to allow the user to view or print. And for the last option..... Well we all know that....

Anyway your method sounds like a winner.... I like the simple ness of it, along with the ability to expand modules. I just hope that its fast enough for the user.

I want to thank Jim for the input, and would like to hear anyones elses ideas. For now I believe that I am going to create a function to do this. Hey Jim, how much slower is the Function rather than a Sub?

Thanks again.


"fast enough for the user"

Actually, maintaining separate user files would be faster than to scan one large file looking for the matching user name. By doing FileRead "[User Name].lgn" points directly at the file you need. If the file is not found, then of course, the user typed in an incorrect or invalid Username.

"how much slower is the Function rather than a Sub"

I don't know that there is a difference in speed. Don't know how there even could be a difference! They both are inside the executable. Unless you have forced your program to use an external Function file. In that case, the CALL would obviously be a bit slower because your program has to read the external file.
Jim Brammer

Return to NeoBook Knowledgebase

Who is online

Users browsing this forum: No registered users and 0 guests