[wp-hackers] Use WP as an authentication system

Alex Hempton-Smith hempsworth at googlemail.com
Sun Feb 15 19:10:30 GMT 2009


I'm having real trouble with this... I get errors when I try to include the
following code:
require_once('../wp/wp-admin/admin.php');

Saying:
Warning: require_once(../wp-load.php) [function.require-once]: failed
to open stream: No such file or directory in...

Does anybody have any experience of using WP in this way?

-- Alex


On Sun, Feb 15, 2009 at 5:49 PM, Gaarai <gaarai at gaarai.com> wrote:

> I'm about to head out, but I wanted to give you a tip to get you started.
>
> I recommend checking out the wp-admin/index.php file. This should serve as
> a template for your custom app.
>
> You'll also need to look at the $_REQUEST['redirect_to'] query arg so that
> you can properly redirect your user once they've logged in. You can find
> more about it by looking in the wp-login.php file.
>
> Chris Jean
> http://gaarai.com/
> http://wp-roadmap.com/
>
>
>
> Alex Hempton-Smith wrote:
>
>> Hi all,
>> I'm building a set of custom apps/scripts for our charity and I would like
>> to make these available at "staff.example.com". I have a regular install
>> of
>> WP in "example.com/wp/". The staff subdomain's content is actually in
>> /home/
>> example.com/staff/.
>>
>> Instead of re-invent the wheel I (and to have the same
>> usernames/passwords),
>> I would like to use the authentication system from the WP install on my
>> own
>> custom PHP stuff in the subdomain. And then be able to use normal WP
>> functions within my own app, like checking if they're logged in, getting
>> usernames etc.
>>
>> What do I need to do to allow my users to log into the main install, and
>> then be logged into the custom area?
>>
>> I know it'll be more than just including 'wp-blog-header.php', because of
>> cookies etc?
>>
>> Many thanks if anyone can help!
>>
>> -- Alex
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
>>
>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list