rejetto forum

Software => HFS ~ HTTP File Server => Beta => Topic started by: Mars on December 12, 2010, 12:42:01 AM

Title: This NEW TPL for build 272 allow one user to redefine his redirect login
Post by: Mars on December 12, 2010, 12:42:01 AM
on import the template create a new group ""can change redirect"

each user which belong this group can define the current folder as default on redirect login

after login, click on the user name allow to display the commands submenu
 ;)

template attached

Quote
[]
......
   <fieldset id='login'>
      <legend><img src="/~img27"> {.!User.}</legend>
      <center>
      {.if not| %user% |<a href="~login">Login</a>|{:
         <div><a href="#" style='font-size:medium;position:relative; top:5px; left:middle;'>%user%</a></div>
         <div style='margin-top:0.5em;' class='hidden popup'>
            <div id='folder-stats'></div>
         {.if|{.can change pwd.} |{:
            <button onclick='changePwd.call(this)' style='font-size:x-small;cursor:pointer;'>{.!Change password.}</button>
         :}/if.}
         {.if|{.can redirect.}|{:
            <button onclick='var s=("{.encodeURI|%folder%.}");
               $.post("?mode=section&id=ajax.changeredirect",{"redirect":s},getStdAjaxCB());'
               style='font-size:x-small;cursor:pointer;'>{.!Set folder as default on login.}</button>
            :}/if.}
         </div>
      :}/if not.}
      </center>
   </fieldset>
......

**********************************************************************************

[+special:alias]
can redirect=member of|can change redirect

[ajax.changeredirect|no log]
{.break|if={.not|{.can redirect.}.}|result=forbidden.}
{.if|{.postvar|redirect.}|
   {:{.if|{.length|{.set account||redirect={.decodeuri|{.postvar|redirect.}.}.}/length.}|ok|failed.}:}
    |failed
.}

**********************************************************************************

.......
    // login menu appear when it gets focus
    $('#login').focusin(function(evt){
        inLogin = 1;
        if (evt.target.getAttribute('type') == 'submit') return; // the submitter button won't expand the popup, but sets the flag to avoid the popup to be closed
        $("#login .popup").slideDown();
    }).focusout(function(evt){
        inLogin = 0;
        setTimeout(function(){
            if (!inLogin)
                $("#login .popup").fadeOut();
        });
    });

    // search options appear when it gets focus
........


Title: Re: This NEW TPL for build 272 allow one user to redefine his redirect login
Post by: rejetto on December 13, 2010, 03:18:27 PM
it's good that you shared your effort for those who need it,
but i think the default folder is more a tool for administrators.
Users can just bookmark the folder instead of the root to access it directly.
Title: Re: This NEW TPL for build 272 allow one user to redefine his redirect login
Post by: r][m on December 13, 2010, 04:34:19 PM
but i think the default folder is more a tool for administrators.
Thanks for sharing, Mars.
I also think default folder should only be part of remote administration page,
as well as ability to alter comment, and move files.
@ Mars,
Don't suppose you have a (non ajax) super admin panel page with these functions
you'd care to share?  ;D
 
Title: Re: This NEW TPL for build 272 allow one user to redefine his redirect login
Post by: Mars on December 13, 2010, 07:21:00 PM
@rejetto
It is the purpose of this sharing, it is one more for the user, but not an exclusive thing for administrator's panel, the administrator authorizes which users have this possibility, quite as that to change their password, I classify the rerouting in the same category of changig password

users groups: can change password; can change redirect; can change ......(another idea ;D)

I remember that some administrators(directors) wanted to allow the guest to register himself free on hfs, without passing by a panel of administration ;)

If there is an interesting thing to be retained in this topic it is the way is masked the password button, which do not take place to be still visible according to me, so it is possible to put the other functions in this place  ::)


@r][m
Quote
Don't suppose you have a (non ajax) super admin panel page with these functions
you'd care to share?

I am always ready to share, since we do not discourage the willingnesses for new ideas, anything who can not please any, can be very useful for the others. Because of the existence of the button password, I think that the redirect is more acceptable one in the template because the administrator keeps the hand put on authorizations.

The ajax was introduced by the boss into default template and I have of to adapt myself well in spite of me, I preferred sincerely the ancient version made of macros and of simple but understandable javascript.

 Besides the ajax brings only a shape of display different from the ancient version of the template with its checkboxs and the mode multi-page which I had set up

If you want a version not ajax there is nothing more simple, it is enough to be supposed to be by a form as for the admin panel already quite a lot of time ago.

the same without ajax , they are two forms: first simulate ajax, the second works as admin panel with intermediate page

Quote
<form method=post action="/~changeredirect1">
   <input name="redirect" type="hidden" value="%folder%">
   <input name="action" type="submit" value="redirect1">
</form>

<form method=post action="/~changeredirect2">
   <input name="redirect" type="hidden" value="%folder%">
   <input name="action" type="submit" value="redirect2">
</form>

[changeredirect1|no log]
{.if|{.and|{.member of|can change redirect.}|{.postvar|action.}/and.}|
   {:{.set account||redirect={.decodeuri|{.postvar|redirect.}.}.}:}
.}
{.comment| the next macro works as a back link.}
{.add header|Location:{.decodeuri|{.postvar|redirect.}.}.}

[changeredirect2|no log]
<html>
<head>
<title>Redirect to Folder Changer</title>
</head>
<body>
{.if|{.and|{.member of|can change redirect.}|{.postvar|action.}/and.}|{:
   {.set account||redirect={.decodeuri|{.postvar|redirect.}.}.}
   <p><font size="4">Redirect to folder changed!</font></p>
   <p>Click <a href="{.postvar|redirect.}">here</a> to return.</p>
   :}|{.section|error.}.}
</body>
</html>

[error]
<title>Error</title>
</head>
<body bgcolor="#000000">
<p align="center">&nbsp;</p>
<p align="center">&nbsp;</p>
<p align="center"><font size="6" color="#FFFFFF"><b>You do not have sufficient privileges to access this feature.</b></font></p>
<p align="center">&nbsp;</p>
<p align="center">&nbsp;</p>
<p align="center"><font size="6" color="#FFFFFF"><b>You must be an administrator.</b></font></p>
</body>
</html>

Title: Re: This NEW TPL for build 272 allow one user to redefine his redirect login
Post by: Dragon_Hunter on December 13, 2010, 08:18:23 PM
Where in the default should the login, logged and submenu be at ?
Title: Re: This NEW TPL for build 272 allow one user to redefine his redirect login
Post by: Mars on December 13, 2010, 10:02:32 PM
Where in the default should the login, logged and submenu be at ?

load the "new" tpl and compare with the default template of rejetto, it's more easy to you to understand where are the addons ;)
Title: Re: This NEW TPL for build 272 allow one user to redefine his redirect login
Post by: rejetto on December 15, 2010, 08:55:30 PM
change their password, I classify the rerouting in the same category of changig password

assumed that everyone is free to create any function he likes...you missed to reply to my objection. Not that you have to! ;)

Quote
If there is an interesting thing to be retained in this topic it is the way is masked the password button, which do not take place to be still visible according to me, so it is possible to put the other functions in this place  ::)

the idea is good.
I think anyway that having the username as a link for popping the other buttons is not for everyone (usability matters).
The best i can think of is a button with an icon, near the username, i would say on the right, and the icon may be a classic icon for "options", like a gear or a wrench.