• Hi all,

    I am trying to integrate wp 2.5 in an existing website. Now for the admin part i don’t want to let the user login twice. As this is only for one user i even tried the stored user_pass with user_login but it doesn’t seem to work.

    i have tried to compare stored user_pass with a hardcoded password but the hardcoded password is not read right
    [php]
    $storedPass = “….RWwVEO2EP13.lL”;
    $passwd= “….RWwVEO2EP13.lL”;

    WP_Integration::wp_login( $username, $passwd, true );

    but now Hard password: gives just .1L??

    class WP_Integration {

    function wp_login( $userid, $pass, $already_md5 = false)
    {
    print $pass;

    }
    [/php]

    How can i auto login, it can even be hardcoded?

    regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter DDT

    (@ddt)

    ok, i think the $ signs in user_pass are causing the problems. How can i escape this chars?

    Use single quotes, elsewise "$foo" will output the value of the variable $foo.

    Thread Starter DDT

    (@ddt)

    @mastermind, tx

    now
    $passwd = ‘$P$BWf7et……O2EP13.lL/’;
    WP_Integration::wp_login( $username, $passwd, true );

    doesn’t give me an error anymore.

    But it doesn’t work as i thought it would be

    [code]

    <?php if($uid == 'test') {
    ob_start();
    include_once ("incs/wp_functions.php");
    $username = "test";
    $passwd = '$P$BWf7...O2EP13.lL/';
    WP_Integration::wp_login( $username, $passwd, true );
    ob_get_contents();
    ob_end_clean();

    ?>

    • News items
    • <?php }?>
      [/code]

      When you click News items it still shows the login screen??

      Any tips

    Thread Starter DDT

    (@ddt)

    hmm,
    WP_Integration::wp_login( $username, $passwd, true );

    should set a user/password cookie, right?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to do an auto login with WP 2.5?’ is closed to new replies.