rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: radioactive68 on November 09, 2014, 01:53:19 PM

Title: user list group
Post by: radioactive68 on November 09, 2014, 01:53:19 PM
1. I want to make a list of one group of users. But my script doesn't see the user if it consists of multiple groups

Quote
{.for each|u|{.replace|;|{.no pipe||.}|{.get|accounts.}.}|{:
   {.set|{.^u.}m|{.get account|{.^u.}|member of.}.}
   {.set|{.^u.}g|{.get account|{.^u.}|is group.}.}

   {.if|{.{.^{.^u.}g.}=.}|
      {.if|
         {.{.^{.^u.}m.}=administrator.}
         |
         {.^u.} - admin<br />
      .}
   .}
:}.}



2. what the script will remove the user?
Title: Re: user list group
Post by: rejetto on November 09, 2014, 08:31:10 PM
1.
you are setting those two variables u+m and u+g, but apparently you can use their value directly, without using a variable.
So, it would be this way (not tested!)

Code: [Select]
{.for each|u|{.replace|;|{.no pipe||.}|{.get|accounts.}.}|{:

  {.if
  | {.and
    | {.administrator={.get account|{.^u.}|member of.}.}
    | {.not|{.get account|{.^u.}|is group.}.}
    /and.}
  | {.^u.} - admin<br />   
  /if.}

:}.}

2.
there's no command to delete accounts, currently.
Would you need it?
Title: Re: user list group
Post by: radioactive68 on November 12, 2014, 04:54:46 AM
1.
you are setting those two variables u+m and u+g, but apparently you can use their value directly, without using a variable.
So, it would be this way (not tested!)

Code: [Select]
{.for each|u|{.replace|;|{.no pipe||.}|{.get|accounts.}.}|{:

  {.if
  | {.and
    | {.administrator={.get account|{.^u.}|member of.}.}
    | {.not|{.get account|{.^u.}|is group.}.}
    /and.}
  | {.^u.} - admin<br />   
  /if.}

:}.}

Sorry, does not work. Occurs the same as in the first embodiment

2.
there's no command to delete accounts, currently.
Would you need it?

I am doing the admin panel/private office, I would like to have the function

google translate  8)
Title: Re: user list group
Post by: rejetto on November 12, 2014, 10:33:30 PM
1. ah ah, sorry, while busy optimizing i forgot your real needs :)

instead of {.administrator={.get account|{.^u.}|member of.}.}
use the specific command {.member of|administrator|user={.^u.}.}

you can see documentation at http://www.rejetto.com/wiki/index.php?title=HFS:_scripting_commands#Account_manipulation

2. it already exists, i just forgot to document it!
{.delete account|radioactive68.}
Title: Re: user list group
Post by: radioactive68 on November 14, 2014, 04:10:16 PM
thank you, rejetto