The MU forums have moved to WordPress.org

Script for Register User his Blog (7 posts)

  1. ciuli
    Member
    Posted 16 years ago #

    What i want to do is this :
    I have a website where i want to integrate MU WordPress. I already have a database with user table so i already have a working register/login system.
    The question is it possible to make a script or there is somewhere a script which can do what i want.
    And offcourse i want a user to be logged into WP too.

    ps: i`ve searched this forum for 3 days with no luck.

  2. mysorehead
    Member
    Posted 16 years ago #

    Have a look at the user auth functions that are pluggable. In the pluggable file in the mu-plugins folder (I think)

    Richard

  3. ciuli
    Member
    Posted 16 years ago #

    Ok thanks, ive saw that file and tested the login but didnt successed, lets say that the login part is not so important right now what i want is info about the register process.

    In the end i can doit , but i think it will slow my registration process becose ive tested when a user registers and i saw what tables are created , i can do create those tables too and thats why i`m here asking if there is a posability to use some built-in/pluggable functions.

    Thanks

  4. drmiketemp
    Member
    Posted 16 years ago #

    It's possible but without knowing what other program you;re running, how the tables are setup, etc, all we can do is make guesses like Richard did.

  5. ciuli
    Member
    Posted 16 years ago #

    I dont understand why do you need to know the structure of my user table, anyway it`s a simple table : id , username, passwod , email (+ 2 or 3 not so important fields).

    what do you mean by "other program"? other script? if yes then i`m not using any scripts right now only a website created by me.

    Thanks.

  6. rickybrennanjr
    Member
    Posted 16 years ago #

    There's a few different ways you could go about this, we had to do something somewhat similar.

    In my situation we're a site within a bigger commercial site, which has it's own user auth/reg. When a user logs in or registers on our page, they're sent thru the global auth/reg process, and then redirected back to our page. What we do in the background is create a WP account for them & set a WP cookie, so that they then have access to whatever WP functionality we allow. They never directly have to login to WP per se, it's done for them so long as they're logged into the "main" system.

    Essentially this just means that in short:
    if they're cookied with main site: find matching user acct in WP , cookie them, else create acct for them in WP.

    Depending on how many user records you have, and what else you're doing with your existing user db, you could simply write a script that loops thru your current db & inserts a user record in wp_users. If you're only storing username, pw & email, I'd say those "not so important" fields & anything "extra" you want to store for your users could simply be stored in wp_usermeta. (wp_usermeta is invaluable in my experience :)

    That's just one approach. As Richard mentioned, you could also just fiddle with hooking into the existing user auth functions, if you don't want to create user records in wp_users. You'll probably at least need to set the wp cookie & all that, I would imagine. But I'd say if you don't have tons of data, just move them into wp_users. You can still user your existing login, and do the WPMU stuff in the background.

    Hope that helps!

  7. ciuli
    Member
    Posted 16 years ago #

    Hello again , and sorry for the delay , well what was the purpose of this thread :
    why do i need a script?!

    well , MU WP will be one of 6 scripts that ill have to integrate into my website. Just think about what will happen with my register system if for every script ill have to recode the entire register system ( like the every initial script register system ) , it will work too slow. As i said in one of the above posts i can create every table and every record from it but this is not a solution for me right now.

    The main problem that i forgot to post it is that everithing in my site uses ajax for register/login and everithing else.

    So in the end there isnt a function/class/script allready/integrated in the script which can produce what i want?

    Thanks.

About this Topic