25

Creating A Login Page Within WordPress

Now DAP already provides you with a built-in, out-of-the-box login form, at YourSite.com/dap/login.php . But if you want to put this form “within” your WordPress blog, so as to give your login form the same Look & Feel as the rest of your blog, then do this…

1) Create a WordPress Page (not “Post”) with the text %%LOGIN_FORM%% in the body of the page, and a title of say, Login, and save the new page. If you used the text “Login” for the title, then the actual link to this page would be YourSite.com/blog/login

2) This page now shows up as “Login” along with the rest of your “pages” on your blog.

3) Go to DAP Admin > Setup > Config . Scroll down to the field Login URL

In the text box, enter the full link to your login page from Step 1:
http://YourSite.com/blog/login

Or if your blog is in the root, then…
http://YourSite.com/login

That’s it! When someone clicks on the “Login” link that now shows in your “Pages” menu, they will now see a nicely formatted login form.

Related: Where is the Logout Link?

Click Here to Leave a Comment Below 25 comments
Fern - May 28, 2009

This would be a perfect place to give the logout info.

Reply
Ravi Jayagopal - May 28, 2009

Fern,

Great feedback. Done!

(see updated post above)

– Ravi Jayagopal

Reply
enlightenmental - December 30, 2009

I notice that when a user logs in through DAP, they are not logged into wordpress.

we have WP users and DAP users linked, so when a user is created through DAP, they are also created as a WP user

Am i missing something?

one would assume when the user logs in through DAP, they are also logged in to wordpress

and when logging out of DAP, they are logged out of wordperss

?

Reply
Ravi Jayagopal - December 30, 2009

For that to happen, you need to be using DAP v3.4, and must have turned on “WP User Sync” in your DAP Config (“Advanced”).

Reply
enlightenmental - December 30, 2009

update:

I see that users created are linked correctly
and when they login through DAP, they are logged into wordpress

however, when they logout of DAP, they are still logged into wordpress

Reply
enlightenmental - December 30, 2009

I’ve also noticed, when the “admin” DAP user logs in, they have no access to product content, and i am unable to add that product to the admin user…

?

Reply
Ravi Jayagopal - December 30, 2009

@enlightenmental,

>>Ive also noticed, when the admin DAP user logs in, they have no access to product content, and i am unable to add that product to the admin user<< That is a deliberate feature, of not giving admin default access to all products, because the first thing you tend to do after protecting a post, is to see if it works. And if the admin can get to it, then they start wondering why the post is not being protected. So it's a feature to protect newbie users from inadvertently thinking that the product doesn't work 🙂 To give admin (or any user) access to a product, go to Users>Manage, check on the checkbox next to the Admin (or that user’s email), then, from dropdown on top-right, select product name to which you want to provide access, and click on “Give selected users access to product”.

Feel free to open a ticket and we’ll help you figure it out.

– Ravi Jayagopal

Reply
enlightenmental - December 30, 2009

i see that now, thank you

it looks like it duplicates the user depending on how many products you add to them (which will be confusing for the end admin user) I assumed the user would get additional products listed in the “product name” table row, rather than duplicating the user

while we’re on the subject, our particular site has three product levels

– Free
– Gold
– Platinum

platinum has access to platinum, gold and free content

Im assuming by default, there is no way to have the product “include” other products…

and if I want the platinum to have access to gold, i will need to add the “gold posts” to the platinum product as well?

thank you
(so far DAP is stellar)

Reply
enlightenmental - January 5, 2010

Possible Bug:

When the user logs into DAP, they are logged into wordpress.

When the user logs out of DAP, they are still logged into wordrpess

the user needs to be logged out of both

Reply
Ravi Jayagopal - January 5, 2010

Actually, we haven’t implemented the “universal logout” feature yet.

It’s low on our priority list, but we’ll get there sooner than later.

Thanks for the feedback!

– Ravi Jayagopal

Reply
EnlightenMental - January 18, 2010

hey Ravi,

random question for you,
I have another project I’m starting, but this is a WPMU + Buddypress install

I’m going to assume DAP has not been tested on WPMU using the buddypress plugin

does it work?

if not, how much to get DAP working with WPMU + Buddypress

please feel free to email me

enlightenmental[at]gmail[.]com

Reply
Amy - March 30, 2010

Anyone successfully install a dap horizontal login/logout in the header are of WordPress?

I tried, and I can log into my DAP dashboard, but can’t access the material. I embedded the script and form code from the DAP login into the header.php file. It doesn’t look right yet, but I’d love any thoughts on how to make this work.

site: thedreamtribe.com (still under construction)

Thanks,
Amy

Reply
Amy - March 30, 2010

P.S. the password retrieval works.

Reply
Amy - March 30, 2010

Got it to work.

Reply
Peretz - May 1, 2010

I want to apply CSS to the login form or at least customize the login.php. So I edited the login.inc.php in dap/inc/content but my changes don’t show up.

Am I editing the wrong code?

Reply
Paul - May 21, 2010

How to I lock the whole WordPress site?

I don’t want people seeing the sidebars etc..

Reply
Ravi Jayagopal - May 21, 2010

If you protect every single post on your blog, then it will redirect your non-logged-in visitors to the URL that you have set in Config > Advanced that says “URL where users will be redirected to if there are no posts available for display”.

– Ravi Jayagopal

Reply
Merge Tags in WordPress Posts — DAP Documentation - May 24, 2010

[…] is better suited for a WP “page”. This text will be replaced by a login form using which your members can log in to your membership […]

Reply
Raygun - October 7, 2011

On login redirection for administrator, is there a way to redirect them like a normal users? Example, redirect ALL users to blog homepage.

Reply
Veena Prashanth - October 9, 2011

Raygun,

The dap login redirection only applies to non-admin users. If you want to test login redirects, pls create a test user (via dap admin -> add users page) and login as that user to test the user experience.

DAP admin users are always redirected to the dap admin dashboard upon login.

Reply
Gary Rennilson - July 10, 2012

Am I going to run into any problems with DAP by implementing an SSH plugin to secure my login pages?

Reply
Joe Colgan - June 2, 2013

I created a login page using the login shortcode on the dap login page in OptimizePress, and now whenever I try to view that page I am taken to the DAP Admin Home page. I am no longer able to view the login page.

Reply
Veena Prashanth - June 10, 2013

Joe,

>> I created a login page using the login shortcode on the dap login page in OptimizePress, and now whenever I try to view that page I am taken to the DAP Admin Home page. I am no longer able to view the login page. < < If you are logged in to WP admin, then you will be automatically logged-in to DAP as admin (unless you turn off that option in dap setup -> config -> WordPress related section). If you are logged in to dap as admin and visit the page with the login shortcode (%%LOGIN_FORM%%), you will get redirected to admin panel. To test, please use a browser where you are not logged in to dap as admin.

Thanks,
Veena

Reply
Philip Kahn - June 27, 2013

I’ve been unable to find this documented — is there a function to test if a user is logged in? I’m picturing this:

Reply
Veena Prashanth - June 30, 2013

H Philip,
>>I’ve been unable to find this documented — is there a function to test if a user is logged in? I’m picturing this: << You can use the dap shortcode to see if the user is logged in. Please see: http://www.digitalaccesspass.com/doc/dap-shortcodes/

Thanks,
Veena

Reply

Leave a Reply: