Loading...
 
Features / Usability

Features / Usability


Login Box - Display on Edit

posts: 62

Hi All,

I have a specific requirement to make the Login box avaialble to users only when they try to edit a page.

I have given permissions to Anonymous users to view my documents available on the site. Now, I want a functionality that would display the Login box when any user tries to edit a page on the site.

Does TikiWiki support such functionality??? If yes, please give me pointers.

Regards,
Arun Bamania

posts: 113 Ireland

As I understand your question, you do not want the Login box visible except when you are editing a page. That would make it fairly difficult for people to login (they would have to choose to edit a page just to get the ability to login). And really difficult to logout (you have to edit a page to logout)

Visiblity of modules (like the login box) are controlled by the users permissions. The visibility of a column is controlled by the feature (wiki, galleries, forums, ...) Editing a wiki page is just one part of the wiki page functionality. If you decided to say, have a right column visible only in wiki pages, then either viewing or editing will make it visible. If the login module is in the right column, it is only visible when the right column is.

For one client, I added categories to control visibility of modules (if a wiki page was in category X, then modules in category X would be visible). But even this will not do what you want, because viewing and editing a page still sorts on the category of the page. There is no distinction between edit and view of a page.

I don't see how you would do this. Is this reqt really what you want?

gary


posts: 3665 United States

You could easily edit the error page (that appears when you try to access a page that anonymous users do not have permission to view) to also show the login module with the error message. For example, when an anonymous user tries to access my Tiki's sandbox, they are automatically prompted to login: example.

However.... What are your anonymous users going to click in order to get the error page? Normally the EDIT button does not appear (unless you are already logged in).

Can you give a use case example of what you're trying to do?

-R
> Hi All,
>
> I have a specific requirement to make the Login box avaialble to users only when they try to edit a page.
>
> I have given permissions to Anonymous users to view my documents available on the site. Now, I want a functionality that would display the Login box when any user tries to edit a page on the site.
>
> Does TikiWiki support such functionality??? If yes, please give me pointers.
>
> Regards,
> Arun Bamania

posts: 62

Hi Rick,

Here is the problem scenario:

I have created structures for many user guides for our documentation purpose. These guides are available for users in the left pane of our site. Any user can view the documentation on the site. What our client wants is that the "Login" box should not be available in the View mode. However, the "Login" box should appear automatically ONLY when a (any) user tries to edit a page, and ask the user to log on to the site. If the user has a valid username and password, the user can log on to the site and edit the desired page. If not, the user cannot edit the page.

Hope this time I am able to clearly explain my query.

Regards,
Arun Bamania

> You could easily edit the error page (that appears when you try to access a page that anonymous users do not have permission to view) to also show the login module with the error message. For example, when an anonymous user tries to access my Tiki's sandbox, they are automatically prompted to login: example.
>
> However.... What are your anonymous users going to click in order to get the error page? Normally the EDIT button does not appear (unless you are already logged in).
>
> Can you give a use case example of what you're trying to do?
>
> -R
> > Hi All,
> >
> > I have a specific requirement to make the Login box avaialble to users only when they try to edit a page.
> >
> > I have given permissions to Anonymous users to view my documents available on the site. Now, I want a functionality that would display the Login box when any user tries to edit a page on the site.
> >
> > Does TikiWiki support such functionality??? If yes, please give me pointers.
> >
> > Regards,
> > Arun Bamania

posts: 3665 United States

How are you going to let users "try to edit a page"? Are you going to manually add a EDIT button to every wiki page? The EDIT button will not appear (automatically) unless the user is already logged in.

I think a better solution may be:

  1. Remove the login module (this way it won't appear for anonymous users).
  2. Edit the tiki-show_page.tpl template (that is used for displaying wiki pages), and add a single link at the bottom of the page:
Copy to clipboard
{if !$user}<a href="tiki-login.php">Login to edit this page</a>.{/if}


This link will appear only when a user is not yet logged in

I think this covers the functionality that you're trying to accomplish.

HTH,

-Rick

> Hi Rick,
>
> He is the problem scenario:
>
> I have created structures for many user guides for our documentation purpose. These guides are available for users in the left pane of our site. Any user can view the documentation on the site. What our client wants is that the "Login" box should not be available in the View mode. However, the "Login" box should appear automatically ONLY when a (any) user tries to edit a page, and ask the user to log on to the site. If the user has a valid username and password, the user can log on to the site and edit the desired page. If not, the user cannot edit the page.
>
> Hope this time I am able to clearly explain my query.
>
> Regards,
> Arun Bamania
>
> > You could easily edit the error page (that appears when you try to access a page that anonymous users do not have permission to view) to also show the login module with the error message. For example, when an anonymous user tries to access my Tiki's sandbox, they are automatically prompted to login: example.
> >
> > However.... What are your anonymous users going to click in order to get the error page? Normally the EDIT button does not appear (unless you are already logged in).
> >
> > Can you give a use case example of what you're trying to do?
> >
> > -R

posts: 62

Hi Rick,

As per your suggestion, I performed the following steps:

  1. Removed login_box module.
  2. Added the follwing code to the bottom of the tiki-show_page.tpl template:
Copy to clipboard
{if !$user}<a href="tiki-login.php">Login to edit this page</a>.{/if}


Now, Registered or Anonymous users cannot view the "Login" box on the first page of the site. To log on to the site, users need to use the tiki-login.php URL.

Is that how it is???

P.S: I want if a user double-clicks a page without logging on to the site, the "Login" box should appear automatically. After successfully logging on to the site, the users can edit pages.

Regards,
Arun Bamania

> How are you going to let users "try to edit a page"? Are you going to manually add a EDIT button to every wiki page? The EDIT button will not appear (automatically) unless the user is already logged in.
>
> I think a better solution may be:
> #Remove the login module (this way it won't appear for anonymous users).
> #Edit the tiki-show_page.tpl template (that is used for displaying wiki pages), and add a single link at the bottom of the page:

>
Copy to clipboard
> {if !$user}<a href="tiki-login.php">Login to edit this page</a>.{/if} >

>
> This link will appear only when a user is not yet logged in
>
> I think this covers the functionality that you're trying to accomplish.
>
> HTH,
>
> -Rick
>
> > Hi Rick,
> >
> > He is the problem scenario:
> >
> > I have created structures for many user guides for our documentation purpose. These guides are available for users in the left pane of our site. Any user can view the documentation on the site. What our client wants is that the "Login" box should not be available in the View mode. However, the "Login" box should appear automatically ONLY when a (any) user tries to edit a page, and ask the user to log on to the site. If the user has a valid username and password, the user can log on to the site and edit the desired page. If not, the user cannot edit the page.
> >
> > Hope this time I am able to clearly explain my query.
> >
> > Regards,
> > Arun Bamania
> >
> > > You could easily edit the error page (that appears when you try to access a page that anonymous users do not have permission to view) to also show the login module with the error message. For example, when an anonymous user tries to access my Tiki's sandbox, they are automatically prompted to login: example.
> > >
> > > However.... What are your anonymous users going to click in order to get the error page? Normally the EDIT button does not appear (unless you are already logged in).
> > >
> > > Can you give a use case example of what you're trying to do?
> > >
> > > -R

posts: 3665 United States

> Hi Rick,
>
> As per your suggestion, I performed the following steps:
> #Removed login_box module.
> #Added the follwing code to the bottom of the tiki-show_page.tpl template:

>
Copy to clipboard
> {if !$user}<a href="tiki-login.php">Login to edit this page</a>.{/if} >

>
> Now, Registered or Anonymous users cannot view the "Login" box on the first page of the site. To log on to the site, users need to use the tiki-login.php URL.
>
> Is that how it is???


Yes, I thought this is what you wanted, right?

Also, you may want to re-add the login_box module, but only for Registered users (or, you need to add a LOGOUT menu option), otherwise users won't be able to log out of your Tiki.


>
> P.S: I want if a user double-clicks a page without logging on to the site, the "Login" box should appear automatically. After successfully logging on to the site, the users can edit pages.
>

To add a "double-click" to login feature, you'll need to add this code to the header.tpl:
Find the __<body... statement and add:

Copy to clipboard
... {if !$user} inhibited_dblclick="location.href='tiki-login.php';" class="tiki_wiki"{/if} ...


HTH,

-Rick
-My Tiki Blog: Help, Hints, and Hacks



>
>
> Regards,
> Arun Bamania
>

posts: 62

Thanks Rick,

Will let you know if I face any problem or achieve the desired result.

Regards,
Arun Bamania.

> > Hi Rick,
> >
> > As per your suggestion, I performed the following steps:
> > #Removed login_box module.
> > #Added the follwing code to the bottom of the tiki-show_page.tpl template:

> >
Copy to clipboard
> > {if !$user}<a href="tiki-login.php">Login to edit this page</a>.{/if} > >

> >
> > Now, Registered or Anonymous users cannot view the "Login" box on the first page of the site. To log on to the site, users need to use the tiki-login.php URL.
> >
> > Is that how it is???
>
>
> Yes, I thought this is what you wanted, right?
>
> Also, you may want to re-add the login_box module, but only for Registered users (or, you need to add a LOGOUT menu option), otherwise users won't be able to log out of your Tiki.
>
>
> >
> > P.S: I want if a user double-clicks a page without logging on to the site, the "Login" box should appear automatically. After successfully logging on to the site, the users can edit pages.
> >
>
> To add a "double-click" to login feature, you'll need to add this code to the header.tpl:
> Find the __<body... statement and add:
>

>
Copy to clipboard
> ... {if !$user} inhibited_dblclick="location.href='tiki-login.php';" class="tiki_wiki"{/if} ... >

>
> HTH,
>
> -Rick
> -My Tiki Blog: Help, Hints, and Hacks
>
>
>
> >
> >
> > Regards,
> > Arun Bamania
> >