rejetto forum

Admin Panel : Creating a proper admin panel.

Ryan J · 84 · 47428

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
A thing  or two that silentpliz forgot to clarify is that you should modify in no way the syntax of check of the authorized admin

Quote
{.if|{.is substring|;%user%;|;{.!admin.};.}|
  .....
|{.section|error.}.}

Here every semicolon is important because it serves for differentiating every admin account

Quote
[special:strings]
admin=admin;administrator;root

So it is enough to modify the 'admin=' line  to give access to the management of the accounts whom we wish it.

If you do not respect the syntax of semicolons, you risk to have an account %user% which is a substring of another account and gives him access to the part administration

by example:
 admin is a substring of administrator

if {.!admin.}=new user;administrator;root  and %user%=user
 then {.is substring|user|new user;administrator;root.} return 'true'
 but  {.is substring|;user;|;new user;administrator;root;.} return 'false' and it is what we hope to obtain
 
It is also reassuring to know as if you do not distribute your template, it is impossible to know what are the accounts authorized for the administration, because all the macro are converted before sending to the user and as well as the section [ special|strings] is inalienable at distance.

Another solution is to create a sub-directory '~adminpanel' , to put it there hidden with the authorizations of access for the authorized accounts and to allocate to him a diff tpl with all the part of administration.

« Last Edit: January 07, 2009, 08:31:32 PM by mars »


Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
Quote
One problem, though.  I have an account missing in both dropdowns.  It just happens to be the first one in the list in my HFS.
I also have the first account missing in the dropdown list.
Mars
Not sure if this
Quote
You can correct the problem the by replacing [ ,;]  by [;]  in each of them
was to be the "fix" for this. If so, it didn't.


Offline TEA-Time

  • Occasional poster
  • *
    • Posts: 76
    • View Profile
Quote
One problem, though.  I have an account missing in both dropdowns.  It just happens to be the first one in the list in my HFS.
I also have the first account missing in the dropdown list.
Mars
Not sure if this
Quote
You can correct the problem the by replacing [ ,;]  by [;]  in each of them
was to be the "fix" for this. If so, it didn't.

I don't think that was to fix the bug I reported.  I'm pretty sure it was to fix this:

Small bug indicated by silentpliz:

The accounts containing a space or a comma appeared on two lines

I'm guessing SilentPliz reported it to mars elsewhere, because I never saw a post about it here in this thread.  I did try it anyway just to see if it might help, but it didn't.

However, SilentPliz's default_Updated.tpl in the post right after mars' fix does work.  Don't ask me what the difference is, though. Heh


Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
Tea Time
Thanks for your reply.
I just removed the drop down. I have
Code: [Select]
Groups: {.get | accounts | groups .} and Linked Accounts ( %linked-accounts% )posted right above, so I didn't need it anyway.
Edit: I tried the default one you mentioned. It listed 2 of everything
but it didn't skip the first one
;D

I'd really like to see an example of how to name and add
a folder to a selected directory. I think that would be as useful
as these other items in admin panel.
« Last Edit: January 08, 2009, 08:42:00 AM by r][m »


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
However, SilentPliz's default_Updated.tpl in the post right after mars' fix does work.  Don't ask me what the difference is, though. Heh

It should be added in the 2 lines concerned of template.

for (var i=tableau.length-1; i>=0; i--) {

Mars have given me the solution ... but he had to forget for him.  :)
« Last Edit: January 08, 2009, 10:45:08 AM by SilentPliz »


Offline Ryan J

  • Occasional poster
  • *
    • Posts: 38
  • Soon to be coder...
    • View Profile
Things have really advanced since I first started!
I am glad that I (hopefully) inspired a few people
I'm sorry I havent posted in a while but i'm only 14 and I was banned for a while off my pc :-[ , i've just started working AND i'm making my family a website :P
I will eventully get around to working on this again but I don't think I can do much more for now due to my limited programming knowledge.
Thanks to every1 here for helping me and I hope to be posting again soon! ;D


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
Hi Ryan J !

Things have really advanced since I first started!
I am glad that I (hopefully) inspired a few people

Absolutely true...It's a good idea you had.  8)

I'm sorry I havent posted in a while but i'm only 14 and I was banned for a while off my pc :
-[ , i've just started working AND i'm making my family a website

Tell your parents that this is a bad idea to banish you of your PC.
You banish cakes and others desserts would be more advantageous for you ... for them ... and for us.   ;) :D

Thanks to every1 here for helping me and I hope to be posting again soon!

We hope ... we are confident. :)

...soon!... :)

« Last Edit: January 18, 2009, 07:21:41 AM by SilentPliz »


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
new admin tpl with folder permissions

somes bugs are related in the topic build 218

last 10 january 2009
« Last Edit: January 09, 2009, 11:18:29 PM by mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
hi guys!
this is a great topic, and i'm glad to see so much collaboration.
i hope to come back to you in monday, or sooner!
our new apartment is finally ready, and we are very happy.
but i may be busy with my job in the weekend :(
consider it's 2am here and i just had a look at the forum after i stopped working.
i have so many posts to read, some very old.
some already read but need more time to write a good reply.


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
Update default template.
Everything works perfectly.

@ rejetto
You see, you just move house, and we repainting the walls of tpl.  :D

Be happy, you and your girlfriend in yours new apartment.  ;)



Edit: January 09, 2009, 04:24  (23:24 heure française)

Small changes "cosmetics".
« Last Edit: January 10, 2009, 03:26:14 PM by SilentPliz »


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
At the RAWR-Designs camp we have been talking today on MSN about creating a proper external admin panel for HFS. The one created here by Ryan J, is great as a proof of concept because it has shown some possible flaws in the way this would work. For instance having to go in and out of pages is irritating, and having to memorise accounts is also. So we would use a mix of Flash or JavaScript and some AHAH for dynamic updating.

First of all, when editing a parameter of a file or folder, for access rights, if you edit a sub-folder of a real-folder, does this edited file or folder and its related directory now appear in the HFS Virtual File System?
What if you turn off download or other access rights for a sub-folder, you can only turn it back on using this external admin panel?

Now, I think for security and simplicity reasons, detecting manually in the template if a user is called 'admin' is not enough. I think a macro like {.get|is admin.} is required. And in the Account Properties of HFS we can place next to 'Enabled, Group, Ignore Limits' a property called 'Administrator'. I think this setting should be used to give the account supreme power. This setting would be great for the HFS owner or nominated administrators. Of course you can then go out of the account properties and turn off certain things after this setting has been set, but as a default setting 'Administrator' would grant supreme power.

I am just concerned that editing the template file to have your preferred username is hard for someone that doesn't know what macro is. What if you want to allow a group of people? or another user who deserves supreme power over the HFS? how will they access the administration panel? So my suggestion is a macro like the following:

{.if|{.get|is admin.}|Pew|Pew.}
« Last Edit: January 28, 2009, 12:04:05 PM by That_Stevens_Guy »


Offline luca69

  • Occasional poster
  • *
    • Posts: 95
    • View Profile
Admin panel: great idea!
My hint: would it be nice to have it somehow separated from the "main" template, so that it would be easy to integrate it into the HFS embedded template.
About the user rights, maybe it is simpler to have a predefined group called "Administrators" in HFS and assign the users to this group.
The macro {.if|{.get|is admin.}|Pew|Pew.} would than check if the user is member of this group.
Life is what happens to you while you are busy making other plans


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Admin panel: great idea!
My hint: would it be nice to have it somehow separated from the "main" template, so that it would be easy to integrate it into the HFS embedded template.
About the user rights, maybe it is simpler to have a predefined group called "Administrators" in HFS and assign the users to this group.
The macro {.if|{.get|is admin.}|Pew|Pew.} would than check if the user is member of this group.

I think the way you have suggested there is a good idea, but it would not really work if you want to name another group as an administrator, that's why I suggested it as a privilege setting... maybe I don't fully understand this whole groups thing...

Also, yes the the Admin Panel we create would be separate. It would require a template though so I would have to use a hfs.diff.tpl and put the folder in the root to use it or something... but that's for later concern. This probably wont happen in full swing until our new website is online, I just have time to think waiting for Richard to come online, but its good to get the ball rolling early with HFS :)

I would also like to add download only selected files to the next template releases, so hopefully this is a priority for rejetto, if not I'll obviously just release an update without it.
« Last Edit: January 28, 2009, 12:27:56 PM by That_Stevens_Guy »


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
@TSG

You should download the latest version in the last pages of topic of Ryan J... the first are not updated.

Otherwise, if you're interested ... In "my" French version of hfs ago a version with additional features (ONLY FOR HFS IN FRENCH) :-\.

http://hfsupgradefrench.webhop.org/hfs/hfs220FR.exe

http://www.rejetto.com/forum/index.php?topic=5173.msg1039827#msg1039827

The .tpl may be bilingual in amending the section [special:strings]

[special:strings]
admins=admin;administrator;root;tsg;dad;mum  :D
menu=.: Menu / Options :.
[add an fake section here for use this template in english language]

« Last Edit: January 28, 2009, 12:51:18 PM by SilentPliz »


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
@TSG

You should download the latest version in the last pages of topic of Ryan J... the first are not updated.

The only one I could get to work was his initial ones... but it was that topic that sparked the idea. I have spent the night scrubbing up my knowledge of HFS and Macros, I was so far behind it was embarrassing lol. As soon as our website is online, its in very early stages, this will be our first move, to create a nice interface administration panel (dynamic, single page with dynamic content) and seamless installation process, hopefully with this Administrator setting and macro implemented so its as easy as adding a folder to implement. Of course with the new website we can write a tutorial to show how it works and how to install it, but all in time :)

I have added you to my MSN SilentPliz, you seem to have better English than mars (no offense), maybe we can have proper conversations about this stuff. With the changes to our website we are looking for experienced HFS users to help out.
« Last Edit: January 28, 2009, 12:58:55 PM by That_Stevens_Guy »