WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Use WP 2.7.1 login code (10 posts)

  1. Ashfame
    Member
    Posted 5 years ago #

    Hello!
    I am trying to have login sync between WP 2.7.1 and some custom PHP code of mine.
    I tried studying login related functions of WP but what all other variables will be required for creating the same login code as used in WP and with all those variables.
    Any pointers & any help will be highly appreciated.

  2. sojweb
    Member
    Posted 5 years ago #

    I assume you want to use an external source of authentication? If so, there's a wp_authenticate hook you can use to authenticate a username and/or a password. Then, you can manually log the person in, bypassing WordPress's login screen altogether; you can also auto-create accounts for people who validate. I created a plugin that lets me authenticate against an LDAP server with a custom login screen; that way, I could tie my WordPress install into a larger database of users.

  3. Ashfame
    Member
    Posted 5 years ago #

    I tried and find a workaround.
    I will check for cookie and if everything is ok then I will allow to pass through else I will re-direct it to wp-login.php with a hidden field "redirect_to" containing the current URL.
    Now how can I read and check for cookies the right way? I can do that but is there anything that I need to know about WP in this regard.
    Thanks in advance!

  4. nina_french
    Member
    Posted 5 years ago #

    Hi,

    I read what you two wrote and maybe you could help me...as my problem seems to be linked to authentification...

    I've just upgraded from 2.0.4 to 2.7.1. I followed the instructions, but encountered a few problems. Anyway, I've solved most of them, but one : I can't edit pages.

    I see the list, and underneath each title, I can only click to see the page. Whenever I create a new page, the status I get is "pending" and I'm not allowed to delete the page.

    I can edit posts and approve/disaprove/erase comments, but I can't do anything with the pages.

    I have no plugin currently running and I've "repopulated" each folder just in case.

    It seems like I don't have that admin right anymore : how come? I'm the first and only admin !

    If anyone could help... I'm getting seriously nervous (I need this for my job)

  5. Ashfame
    Member
    Posted 5 years ago #

    @nina
    We are discussing here something different. It might be a good option for more exposure if you open a new thread for your issue.

    P.S. I am unable to help as I am new to WP code too

  6. nina_french
    Member
    Posted 5 years ago #

    @ashfame

    I already did this, with little success...

    sorry, I thought my problem could be solved somehow by manually logging as explained by sojweb...

    thank you anyway.

  7. Ashfame
    Member
    Posted 5 years ago #

    I just need to know how can i read WordPress cookies if they are stored on user's side and if its valid?

  8. sojweb
    Member
    Posted 5 years ago #

    I think you can accomplish what you need through WordPress functions. I wouldn't recommend trying to read the cookies directly. Check out these links:

    http://codex.wordpress.org/Function_Reference/auth_redirect
    http://codex.wordpress.org/Function_Reference/is_user_logged_in
    http://codex.wordpress.org/Function_Reference/wp_redirect
    http://codex.wordpress.org/WordPress_Cookies

  9. Ashfame
    Member
    Posted 5 years ago #

    First three links were definitely of great help. I have read the Codex on the 4th link is not updated to reflect the new cookie method being used since WP 2.6 so I asked here.
    Apart from this how can I load the WP environment so that I can call upon WP functions from my custom pages?
    Anything other than loading wp-load.php ?

  10. Ashfame
    Member
    Posted 5 years ago #

    Things are working fine now. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic