Page 1 of 1

login prompt (everything else hidden untill a user logs in)

PostPosted: Mon Jun 04, 2012 9:31 pm
by cookie720
Hi everyone,
I have followed this http://xataface.com/documentation/tutorial/getting_started/permissions
and cant get it to work....HELP!

I can login as any user but it does nothing to the functionality. Anonymous, no access, read only and admin all are exactly the same.

All my code is standard (pretty much a fresh install) and all the code matches this exactly:
http://xataface.com/documentation/tutorial/getting_started/permissions

I must be missing something???

Is it permissions or preferences that I should be coding???

// if the user is null then nobody is logged in... no access.
// This will force a login prompt.

That is exactly and all what I want. Basically just the header with the logo, and footer, with a blank screen and alogin prompt....untill someone logs in.
If your website is much like what the comment above comment describes please help!

Thankyou in advance

Re: login prompt (everything else hidden untill a user logs

PostPosted: Tue Jun 05, 2012 4:32 pm
by cookie720
:D
Everyone that has this problem, I suspect the most common mistake is to put your conf folder with the ApplicationDelegate.php inside the xataface folder. This is wrong, it should be in your applications' folder.

Re: login prompt (everything else hidden untill a user logs

PostPosted: Fri Jun 08, 2012 1:15 pm
by shannah
Xataface 2.0 works this way by default (the login page shows nothing but the login options).

You can override the Dataface_Login_Prompt.html template so that it overrides the html_body slot instead of the main_section slot. This would achieve what you want.

-Steve

Re: login prompt (everything else hidden untill a user logs

PostPosted: Mon Jun 11, 2012 5:21 am
by cookie720
Perfect, Thankyou so much!

Re: login prompt (everything else hidden untill a user logs

PostPosted: Thu Jun 14, 2012 6:59 am
by clawes
I am also interested in this feature.

Steve,
Since v2.0 is not yet available, could you elaborate some more on how to do this manually?

TIA

Re: login prompt (everything else hidden untill a user logs

PostPosted: Fri Jun 15, 2012 1:35 am
by cookie720
I hope you are using the latest version.....If so, you should be able to get your login to look exactly like mine.

Image

Go into your yourprogram/xataface/Dataface/templates folder, and take the Dataface_Login_Prompt.html and put it into your templates folder (yourprogram/templates)
this will 'override' the one in the templates older, You can do anything to this file, and if you break it, just grab the original one again.

Select all and change to this (what I have at the moment):

Code: Select all
{use_macro file="Dataface_Main_Template.html"}
   {fill_slot name="custom_stylesheets"}
   <style type="text/css">
   {literal}
      #Login-Username label, #Login-Password label {
         display: block;
         float: left;
         width: 100px;
         text-align: right;
         padding-right: 1em;
      }
   {/literal}
   </style>
   {/fill_slot}
   {fill_slot name="html_body"} <!-- probably the most impotant line here-->
   <div style="width:500px; padding-top:100px; margin-left:auto; margin-right:auto;">
   <div style="width:330px; margin-left:auto; margin-right:auto;"><img src="[b]put a logo in here[/b]" /></div>
      {block name="before_login_form"}
      {define_slot name="login_form"}
      <h1>{translate id="Please Login"}Please Login to access this section of the site{/translate}</h1>
      {if $msg}<div class="portalMessage">{$msg}</div>{/if}
      <form action="{$ENV.DATAFACE_SITE_HREF}" method="post" class="xataface-login-form">
      <input type="hidden" name="-action" value="login" />
      <input type="hidden" name="-redirect" value="{$redirect}" />
      
      <fieldset style="">
      
         {block name="before_login_username}
         <div id="Login-Username" style="padding-top:10px;">
            <label>{translate id="Username"}Username{/translate}:</label>
            <input type="text" name="UserName" value="{$ENV.REQUEST.UserName}">
         </div>
         {block name="after_login_username"}
         <div id="Login-Password">
            <label>{translate id="Password"}Password{/translate}:</label>
            <input type="password" name="Password" value="{$ENV.REQUEST.Password}">
         </div>
         {block name="after_login_password"}
         <input id="Login-submit" name="-submit" type="submit" value="{translate id="scripts.GLOBAL.LABEL_SUBMIT"}Submit{/translate}"/>
         {block name="after_login_submit"}
      </fieldset>
      
      </form>
      {actions category="login_actions" var="login_actions"}
      <ul>
      {foreach from=$login_actions item="action"}
          <li><a href="{$action.url}">{$action.label}</a></li>
      {/foreach}
      </ul>
      {/define_slot}
      {block name="after_login_form"}
   </div>
   {/fill_slot}
{/use_macro}

Re: login prompt (everything else hidden untill a user logs

PostPosted: Sun Jun 17, 2012 11:46 am
by clawes
Thanks, cookie720

I'll give this a try. :D