Hide All Except Login Form

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
farichte
User
Posts: 30

Hide All Except Login Form

Post by farichte »

Hi, I want to do some appearance editing to login page
is there a way to hide all except the login form?
thank you


mobhar
User
Posts: 11703

Post by mobhar »

Just implement "Advanced Security - Dynamic User Level" for your web app.

Please read "Tutorial - Advanced Security - Dynamic User Level Security" topic from PHPMaker Help menu for more info.


kirondedshem
User
Posts: 642

Post by kirondedshem »

I want to do some appearance editing to login page
If you mean you want to change how the login form looks, then I advise you to use query in startup script to achive that by passing your html and css edits to the form

is there a way to hide all except the login form?
If you mean you want to hide the header and footer on login form to only leave login box, then you can tell login page to not show header and footer like so:
Go to server events->other->login page->page load and paste code
// Page Load event
function Page_Load() {
//echo "Page Load";
//DONT DRAW HEADER AND FOOTER
$GLOBALS['gbSkipHeaderFooter'] = TRUE;
}

Here is an example of changing login page to somehow look similar to AdminLTE login page, its not quite the same but it gives you an example of how to add html and css using query.
go to client scripts->other->login page->startup scripts and paste code:
// Write your startup script here
// document.write("page loaded");

//put the envelope icon next to username
$("#username").parent().addClass("input-group");
$("#username").parent().append('<span class="input-group-addon"><i class="fa fa-envelope"></i></span>');

//add the key icon next to the password filed
$("#password").parent().addClass("input-group");
$("#password").parent().append('<span class="input-group-addon"><i class="fa fa-key"></i></span>');

//make the submit button span the whole area
$("#btnsubmit").addClass("btn-block");

//add a header for the box.
//put a logo above the login page
var header = '<div class="login-logo"><span class="logo-lg"><img src="phpimages/EventsAccessManager Logo.jpg" style="height:130px;max-width:350px;"/></span></div>';
$('[class="login-box ewLoginBox"]').prepend(header);

//enclose the whole login form in a panel like border
$('[class="login-box ewLoginBox"]').addClass("panel panel-success");

//cetner the login box
$("#flogin").attr("class","register-box");

HINT: You can also ust customise the zip template directly to draw your own html, but ist not sustainable as you would need to do this everytime phpmaker updates its templates or versions, BUT the query approach is much cleaner and easy to mantain. ust inspect the various elements in the browser compare css classes, styles etc get what you want it to look like, the write query to apply those css classes or styles to specific elements.


farichte
User
Posts: 30

Post by farichte »

mobhar wrote:
Just implement "Advanced Security - Dynamic User Level" for your
web app.

Please read "Tutorial - Advanced Security - Dynamic User Level
Security" topic from PHPMaker Help menu for more info.

yes, i use Advanced Security - Dynamic User Level in this project
but i failed to understand how it have anything to do with login appearance?


farichte
User
Posts: 30

Post by farichte »

kirondedshem wrote:
I want to do some appearance editing to login page
If you mean you want to change how the login form looks, then I advise you to use
query in startup script to achive that by passing your html and css edits to the form

Yes, i am planning to do that. that's why i want to hide items except the login form

If you mean you want to hide the header and footer on login form to only leave login
box, then you can tell login page to not show header and footer like so:
Go to server events->other->login page->page load and paste code
// Page Load event
function Page_Load() {
//echo "Page Load";
//DONT DRAW HEADER AND FOOTER
$GLOBALS['gbSkipHeaderFooter'] = TRUE;
}

it's working great!, thank you

Here is an example of changing login page to somehow look similar to AdminLTE login
page, its not quite the same but it gives you an example of how to add html and css
using query.
go to client scripts->other->login page->startup scripts and paste code:
// Write your startup script here
// document.write("page loaded");

//put the envelope icon next to username
$("#username").parent().addClass("input-group");
$("#username").parent().append('<span
class="input-group-addon"><i class="fa
fa-envelope"></i></span>');

//add the key icon next to the password filed
$("#password").parent().addClass("input-group");
$("#password").parent().append('<span
class="input-group-addon"><i class="fa
fa-key"></i></span>');

//make the submit button span the whole area
$("#btnsubmit").addClass("btn-block");

//add a header for the box.
//put a logo above the login page
var header = '<div class="login-logo"><span
class="logo-lg"><img src="phpimages/EventsAccessManager
Logo.jpg"
style="height:130px;max-width:350px;"/></span></div>';
$('[class="login-box ewLoginBox"]').prepend(header);

//enclose the whole login form in a panel like border
$('[class="login-box ewLoginBox"]').addClass("panel
panel-success");

//cetner the login box
$("#flogin").attr("class","register-box");

HINT: You can also ust customise the zip template directly to draw your own html, but
ist not sustainable as you would need to do this everytime phpmaker updates its
templates or versions, BUT the query approach is much cleaner and easy to mantain.
ust inspect the various elements in the browser compare css classes, styles etc get
what you want it to look like, the write query to apply those css classes or styles
to specific elements.

Yes i planned to customise the zip template in the template as i am noob at phpmaker
thank you for your example kirondedshem :D
i will study it. I hope getting more breaktrough in the near future TvT


mobhar
User
Posts: 11703

Post by mobhar »

farichte wrote:
but i failed to understand how it have anything to do with login appearance?

When you implement Dynamic User Level Security, then by default, all the generated pages/menus will be hidden, execpt for the Login page. You need to enable permissions for the your desired user level in order to give the permissions to your users.


Post Reply