rejetto forum
May 26, 2012, 02:49:58 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: HFS print list of users  (Read 1566 times)
0 Members and 1 Guest are viewing this topic.
Denis
Regular poster
**
Offline Offline

Denmark Denmark

Posts: 25


View Profile
« on: November 09, 2011, 01: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 Smiley
Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #1 on: November 09, 2011, 05:44:12 AM »

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:

Code:
{.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)

Follow members gave a thank to your post:

Denis

For this post, 1 member gave a thank you!
Logged
Denis
Regular poster
**
Offline Offline

Denmark Denmark

Posts: 25


View Profile
« Reply #2 on: November 09, 2011, 12:24:22 PM »

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!
Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #3 on: November 09, 2011, 02:26:19 PM »

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.

Follow members gave a thank to your post:

Denis

For this post, 1 member gave a thank you!
« Last Edit: November 09, 2011, 09:04:16 PM by raybob » Logged
Denis
Regular poster
**
Offline Offline

Denmark Denmark

Posts: 25


View Profile
« Reply #4 on: November 10, 2011, 08:19:59 AM »

Tested and work Smiley But, it try to give the group can change password a password Smiley 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 Smiley
Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #5 on: November 10, 2011, 03:06:11 PM »

Assuming you have a folder for each user where its name is the title, perhaps something like

Code:
{.for each|username|{.replace|;|{.no pipe||.}|{.get|accounts.}.}|{:
{.set folder|{.^username.}|access={.^username.}|delete={.^username.}|upload={.^username.}.}
:}.}

Follow members gave a thank to your post:

Denis

For this post, 1 member gave a thank you!
« Last Edit: November 11, 2011, 08:23:16 AM by raybob » Logged
rejetto forum
« Reply #5 on: November 10, 2011, 03:06:11 PM »

Do you like this software? Consider even $2
 Logged
Denis
Regular poster
**
Offline Offline

Denmark Denmark

Posts: 25


View Profile
« Reply #6 on: November 11, 2011, 01:34:24 AM »

It dosen't work,
Quote
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?
Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #7 on: November 11, 2011, 08:22:12 AM »

Simple, I accidentally put the wrong macro name lol...

It's actually {.set item.}   Wink

Code:
{.for each|username|{.replace|;|{.no pipe||.}|{.get|accounts.}.}|{:
{.set item|{.^username.}|access={.^username.}|delete={.^username.}|upload={.^username.}.}
:}.}

Follow members gave a thank to your post:

Denis

For this post, 1 member gave a thank you!
« Last Edit: November 11, 2011, 08:24:12 AM by raybob » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #8 on: November 13, 2011, 04:52:50 PM »

raybob, just a suggestion for your password generation
{.random number | 100000 | 999999 .}

Follow members gave a thank to your post:

raybob, Denis

For this post, 2 members gave a thank you!
Logged
Denis
Regular poster
**
Offline Offline

Denmark Denmark

Posts: 25


View Profile
« Reply #9 on: November 14, 2011, 03:25:33 AM »

And this should be pasted instead of what?

And how do i now give myself permissions to everything?
« Last Edit: November 14, 2011, 03:27:58 AM by Denis » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #10 on: November 14, 2011, 04:15:31 AM »

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.
Logged
Denis
Regular poster
**
Offline Offline

Denmark Denmark

Posts: 25


View Profile
« Reply #11 on: November 15, 2011, 01:05:04 AM »

But how to create the rule?

I'm new in macros, so i don't know pretty much Sad

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?
« Last Edit: November 15, 2011, 05:24:24 AM by Denis, Reason: Had more questions :) » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #12 on: November 15, 2011, 08:04:16 AM »

first you have to express the rule in human language,
then you translate it to the scripting language

Quote
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 Sad
I hope someone else could help you.
Anyway, are you using the default template?
And what exact version of HFS ?

Quote
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

Follow members gave a thank to your post:

Denis

For this post, 1 member gave a thank you!
Logged
Denis
Regular poster
**
Offline Offline

Denmark Denmark

Posts: 25


View Profile
« Reply #13 on: November 15, 2011, 10:50:02 AM »

I'm using the default template, and using the newest beta version of HFS which is #279 Smiley

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?
« Last Edit: November 17, 2011, 08:18:59 AM by Denis, Reason: Had some more questions! :-) » Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #14 on: November 17, 2011, 01:40:26 PM »

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?

Code:
{.for each|username|{.replace|;|{.no pipe||.}|{.get|accounts.}.}|{:{.append|users.txt|
{.^username.} - {.get account|{.^username.}|password.}.}:}.}

« Last Edit: November 17, 2011, 01:42:24 PM by raybob » Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 24, 2012, 08:28:21 PM
anything