rejetto forum
Software => HFS ~ HTTP File Server => Topic started by: Denis on November 09, 2011, 07:27:00 AM
-
Is it possible to print all HFS users and their passwords, that would be great couse i'm administrating a school server, so it could be a lot easier.
Is it also possible to make random passwords for all accounts, so i could then print.
I also have folders in my file system which have the same name as the user account that belong to it, is it possible that HFS gives right to the user that have the same name as the folder.
Hope you can help :)
-
You could save each student's username to a text file, like this user1;user2;user3 and then run a script along the lines of this:
{.for each|username|{.replace|;|{.no pipe||.}|{.load|usernames.txt.}.}|{:
{.set|random|{.random|1|2|3|4|5|6|7|8|9.}{.random|1|2|3|4|5|6|7|8|9.}{.random|1|2|3|4|5|6|7|8|9.}{.random|1|2|3|4|5|6|7|8|9.}{.random|1|2|3|4|5|6|7|8|9.}{.random|1|2|3|4|5|6|7|8|9.}.}
{.set account|{.^username.}|password={.^random.}.}
{.append|passwordlist.txt|
{.^username.} {.^random.}
.}
:}.}
(not tested)
-
So what you're saying is, that when i run this script i will get a text document with all the users and passwords? And where to put or run the code?
And do you also know if i can give folder rights to the username which is the same, maybe a macro?
Thanks for the help!
-
If you put all the names in username.txt, it will output a TXT file with all the names and new random passwords.
Run the script by putting in a section called [test] in the template, then going to http://127.0.0.1/~test in your browser.
EDIT:
If you replace {.load|usernames.txt.} with {.get|accounts.} in the above script, it will automatically load all the account names from HFS.
-
Tested and work :) But, it try to give the group can change password a password :) And is this a macro? And do you know if it's possible to also make a script for the rights, i discribed above?
Thank you so much for the help :)
-
Assuming you have a folder for each user where its name is the title, perhaps something like
{.for each|username|{.replace|;|{.no pipe||.}|{.get|accounts.}.}|{:
{.set folder|{.^username.}|access={.^username.}|delete={.^username.}|upload={.^username.}.}
:}.}
-
It dosen't work,
macro error: set folder
not supported or illegal parameters
apear on the screen, is it possible, couse i have my account which dosen't have a folder and there is also a account named "can change password" which also don't have a folder.
It shows the message more than once, it's a long list with it.
What to do now?
-
Simple, I accidentally put the wrong macro name lol...
It's actually {.set item.} ;)
{.for each|username|{.replace|;|{.no pipe||.}|{.get|accounts.}.}|{:
{.set item|{.^username.}|access={.^username.}|delete={.^username.}|upload={.^username.}.}
:}.}
-
raybob, just a suggestion for your password generation
{.random number | 100000 | 999999 .}
-
And this should be pasted instead of what?
And how do i now give myself permissions to everything?
-
And how do i now give myself permissions to everything?
after you run the raybob's script you can still make any change you want on the HFS window.
Still, you can even automate permissions setting if it follows a simple rule.
-
But how to create the rule?
I'm new in macros, so i don't know pretty much :(
And another problem, all students with danish letters (æ, ø, å) cannot login, what should i do with that?
And is it possible to make all the users be a part of the group can change password?
-
first you have to express the rule in human language,
then you translate it to the scripting language
And another problem, all students with danish letters (æ, ø, å) cannot login, what should i do with that?
that requires some investigation. Sadly i don't have time these days :(
I hope someone else could help you.
Anyway, are you using the default template?
And what exact version of HFS ?
And is it possible to make all the users be a part of the group can change password?
instead of
{.set account|{.^username.}|password={.^random.}.}
use this
{.set account|{.^username.}|password={.^random.}|add member of=can change password.}
i examined this page to know what to do
http://www.rejetto.com/wiki/index.php?title=HFS:_scripting_commands#Account_manipulation
-
I'm using the default template, and using the newest beta version of HFS which is #279 :)
Hope someone can help, couse i really do'nt know what to do! I thought about, could i make so if the user name was æøå so i instead of that put æø&åring; ?
How to i make a script that write all the user names and their passwords to a file, without randomize their passwords?
And, how do i protect the section with the password randomizer?
-
I don't know what to do about the names.
And, how do i protect the section with the password randomizer?
Put |private after the section, like [section|private]
How to i make a script that write all the user names and their passwords to a file, without randomize their passwords?
{.for each|username|{.replace|;|{.no pipe||.}|{.get|accounts.}.}|{:{.append|users.txt|
{.^username.} - {.get account|{.^username.}|password.}.}:}.}
-
Thanks, but after making a private section, how do I administrate who can "acces" it?
Thanks for the help.
-
Put something like this around the script:
{.if|{.=|%user%|admin.}|{:
(script here)
:}.}
-
instead of putting the script in a template [section]
you can put it in the diff template of a virtual folder,
so you can control access as you normally do with folders.
-
With raybob's script i cannot even acces it anymore, it just say "not found" :(
-
When I said put it around the script, the [section header] still needs to go above it.
[section name]
{.if|{.=|%user%|admin.}|{:
(rest of script here)
:}.}