[wp-hackers] Sharing Users/authentication

Curt Woodard clwoodard at gmail.com
Sat Aug 25 04:56:12 GMT 2007


A view simply allows you to turn a sql statement into a table, of
sorts... You can find out more about views here:
http://philip.greenspun.com/sql/views.html

Though I don't think they can be updated... *ponder* I'll have to look
into that.

Basically, if you set up a view through the plugin that maps SMF data
in the smf_members table so that it looks like the wp_users table,
through a view, that is updatable then I don't have to worry about all
the hullabaloo associated with a lot of program code.

I'll have to research this. But basically an SQL view acts like a
table. You can use it in place of a table name in an SQL query. A view
is basically a select statement that's presented as a table (or a
relation if you want to get into db-speak).

I'll research this and run some tests. If it works then things will
become pretty spiffy for the smf<=>wp world. Especially if these can
be redefined in a plugin.

-Curt

On 8/24/07, wp-hackers-request at lists.automattic.com
<wp-hackers-request at lists.automattic.com> wrote:
> Send wp-hackers mailing list submissions to
>         wp-hackers at lists.automattic.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.automattic.com/mailman/listinfo/wp-hackers
> or, via email, send a message with subject or body 'help' to
>         wp-hackers-request at lists.automattic.com
>
> You can reach the person managing the list at
>         wp-hackers-owner at lists.automattic.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of wp-hackers digest..."
>
>
> Today's Topics:
>
>    1. Re: Sharing Users/authentication (Stephen Rider)
>    2. Re: wpautop should first check if p tags, and if so,      don't
>       autop (Stephen Rider)
>    3. Re: wpautop should first check if p tags, and if so,      don't
>       autop (Rob Miller)
>    4. RE: wpautop should first check if p tags, and if so,      don't
>       autop (Jamie Holly)
>    5. Re: Sharing Users/authentication (Jacob Santos)
>    6. Re: Sharing Users/authentication (Stephen Rider)
>    7. Re: Sharing Users/authentication (Curt Woodard)
>    8. Re: Sharing Users/authentication (Jacob Santos)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 24 Aug 2007 21:03:08 -0500
> From: Stephen Rider <wp-hackers at striderweb.com>
> Subject: Re: [wp-hackers] Sharing Users/authentication
> To: wp-hackers at lists.automattic.com
> Message-ID: <B9F84AB9-E5E4-4B3A-945E-C15C899285B5 at striderweb.com>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> That could be extremely useful for me.  However... when I do that I
> can't get into the admin screen on the "secondary" blog.  All I see is:
>
> You do not have sufficient permissions to access this page.
>
> The main blog still works fine.  Any idea why???
>
> Stephen
>
>
> On Aug 24, 2007, at 1:07 PM, jacobsantos at branson.com wrote:
>
> > Yes. There are defines in the wp-settings.php file that can be
> > defined in the wp-config.php file.
> >
> > wp-config.php
> > -----------------------
> >
> > // Underneath database config info
> > define('CUSTOM_USER_TABLE', 'wp_users');
> > define('CUSTOM_USER_META_TABLE', 'wp_usermeta');
> >
> > In this way, you only need to have one wordpress users table and
> > usermeta table. You will have to keep track of the prefix of the
> > wordpress installation you have all of the users in.
> >
> > Jacob Santos
> >
> > Chris Lott wrote:
> >> Faculty members have discovered CommentPress and would like to use
> >> CommentPress enabled blogs alongside their regular class blogs... is
> >> there a simple way to share the usernames/logins between two WP
> >> installations? All that really needs to be shared is the login name
> >> and password...
> >>
> >> c
> >>
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 24 Aug 2007 21:10:08 -0500
> From: Stephen Rider <wp-hackers at striderweb.com>
> Subject: Re: [wp-hackers] wpautop should first check if p tags, and if
>         so,     don't autop
> To: wp-hackers at lists.automattic.com
> Message-ID: <4FA36B8A-7EEE-4A8E-8912-790F85E374AA at striderweb.com>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> This would be very bad for me.  I quite often have certain paragraphs
> to which I want to apply a class, so I wrap it in <p> tags with the
> class.  The rest of the text I want autoformatted.
>
>
> On Aug 24, 2007, at 7:15 PM, Lloyd Budd wrote:
>
> > wpautop should first check if <p> tag in a $pee, and if so, assume
> > person knows what he is doing and don't autop
>
>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 25 Aug 2007 03:12:49 +0100
> From: Rob Miller <r at robm.me.uk>
> Subject: Re: [wp-hackers] wpautop should first check if p tags, and if
>         so,     don't autop
> To: wp-hackers at lists.automattic.com
> Message-ID: <46CF9021.6000704 at robm.me.uk>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Stephen Rider wrote:
> > This would be very bad for me.  I quite often have certain paragraphs
> > to which I want to apply a class, so I wrap it in <p> tags with the
> > class.  The rest of the text I want autoformatted.
> >
> >
> Same here, and I should imagine the same is true of many users.
>
> --
> Rob Miller
> http://robm.me.uk/
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 24 Aug 2007 22:18:04 -0400
> From: "Jamie Holly" <hovercrafter at earthlink.net>
> Subject: RE: [wp-hackers] wpautop should first check if p tags, and if
>         so,     don't autop
> To: <wp-hackers at lists.automattic.com>
> Message-ID: <008001c7e6be$2eae0640$8c0a12c0$@net>
> Content-Type: text/plain;       charset="us-ascii"
>
> I agree too. I think it would be best served as an option box on each post
> that could be clicked to bypass autop and the value stored in postmeta.
>
> Jamie Holly
> http://www.intoxination.net
> 1.513.252.2919 | Skype:intoxination
>
>
> >-----Original Message-----
> >From: wp-hackers-bounces at lists.automattic.com [mailto:wp-hackers-
> >bounces at lists.automattic.com] On Behalf Of Rob Miller
> >Sent: Friday, August 24, 2007 10:13 PM
> >To: wp-hackers at lists.automattic.com
> >Subject: Re: [wp-hackers] wpautop should first check if p tags, and if
> >so, don't autop
> >
> >Stephen Rider wrote:
> >> This would be very bad for me.  I quite often have certain paragraphs
> >> to which I want to apply a class, so I wrap it in <p> tags with the
> >> class.  The rest of the text I want autoformatted.
> >>
> >>
> >Same here, and I should imagine the same is true of many users.
> >
> >--
> >Rob Miller
> >http://robm.me.uk/
> >
> >_______________________________________________
> >wp-hackers mailing list
> >wp-hackers at lists.automattic.com
> >http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 24 Aug 2007 21:56:08 -0500
> From: Jacob Santos <dragonwing at dragonu.net>
> Subject: Re: [wp-hackers] Sharing Users/authentication
> To: wp-hackers at lists.automattic.com
> Message-ID: <46CF9A48.8000403 at dragonu.net>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> No. You would have to rewrite the Database Access Layer for which all
> other API functions use. Given that WordPress uses MySQL extension, it
> would be a total bitch to switch back and forth (trust me, once you get
> into this realm you'll scream for the final cut across the throat). Be
> easier with PDO or MySQLi and creating two objects with each Database
> Information. This would still require hacking the Database Access Layer
> and hacking the user API functions to use that Database Object or at
> least hacking the User API.
>
> There might be a less painful way, but from what I know and experimented
> with, it is better to just walk away while you still have your sanity.
>
> Jeremy Visser wrote:
> > Wow, I wish someone had told me about that before. Is it possible to
> > tell it to use different databases as well?
> No idea. It could be any number of variables or problems. Write a ticket
> to the forums and see if someone who is experienced knows anything.
>
> Did you change the config of the second blog? Or third? Or Fourth?
>
> Is the second blog on the same database as the first blog?
>
> As I have had no need to attempt something like this, I have no idea how
> to troubleshoot it. I might attempt it to see what the requirements are
> beyond setting those two constants, but I really don't think I will have
> time.
>
> Good Luck,
>
> Jacob Santos
>
> Stephen Rider wrote:
> > That could be extremely useful for me.  However... when I do that I
> > can't get into the admin screen on the "secondary" blog.  All I see is:
> >
> > You do not have sufficient permissions to access this page.
> >
> > The main blog still works fine.  Any idea why???
> >
> > Stephen
> >
> >
> > On Aug 24, 2007, at 1:07 PM, jacobsantos at branson.com wrote:
> >
> >> Yes. There are defines in the wp-settings.php file that can be
> >> defined in the wp-config.php file.
> >>
> >> wp-config.php
> >> -----------------------
> >>
> >> // Underneath database config info
> >> define('CUSTOM_USER_TABLE', 'wp_users');
> >> define('CUSTOM_USER_META_TABLE', 'wp_usermeta');
> >>
> >> In this way, you only need to have one wordpress users table and
> >> usermeta table. You will have to keep track of the prefix of the
> >> wordpress installation you have all of the users in.
> >>
> >> Jacob Santos
> >>
> >> Chris Lott wrote:
> >>> Faculty members have discovered CommentPress and would like to use
> >>> CommentPress enabled blogs alongside their regular class blogs... is
> >>> there a simple way to share the usernames/logins between two WP
> >>> installations? All that really needs to be shared is the login name
> >>> and password...
> >>>
> >>> c
> >>>
> >>
> >> _______________________________________________
> >> 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
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 24 Aug 2007 22:22:14 -0500
> From: Stephen Rider <wp-hackers at striderweb.com>
> Subject: Re: [wp-hackers] Sharing Users/authentication
> To: wp-hackers at lists.automattic.com
> Message-ID: <AB809068-D235-4F76-B15C-FD01DE5D7B7A at striderweb.com>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> Two blogs on the same database.  In fact, I'm trying this on a test
> setup that has the same Users and passwords in each.
>
> The main blog (that is, the blog that uses the table prefix in
> question) is unchanged -- I didn't change the wp-config since it
> already looks at the right tables.  The second blog (that uses a
> different prefix) has the new defines in its wp-config file pointing
> to the tables of the first blog.
>
> I'll do some digging into exactly what happens during the
> authentication, but I can't imagine why this would not work....
>
> Thanks for the info so far.. :)
>
> Stephen
>
> On Aug 24, 2007, at 9:56 PM, Jacob Santos wrote:
>
> > No idea. It could be any number of variables or problems. Write a
> > ticket to the forums and see if someone who is experienced knows
> > anything.
> >
> > Did you change the config of the second blog? Or third? Or Fourth?
> >
> > Is the second blog on the same database as the first blog?
> >
> > As I have had no need to attempt something like this, I have no
> > idea how to troubleshoot it. I might attempt it to see what the
> > requirements are beyond setting those two constants, but I really
> > don't think I will have time.
> >
> > Good Luck,
> >
> > Jacob Santos
> >
> > Stephen Rider wrote:
> >> That could be extremely useful for me.  However... when I do that
> >> I can't get into the admin screen on the "secondary" blog.  All I
> >> see is:
> >>
> >> You do not have sufficient permissions to access this page.
> >>
> >> The main blog still works fine.  Any idea why???
> >>
> >> Stephen
> >>
> >>
> >> On Aug 24, 2007, at 1:07 PM, jacobsantos at branson.com wrote:
> >>
> >>> Yes. There are defines in the wp-settings.php file that can be
> >>> defined in the wp-config.php file.
> >>>
> >>> wp-config.php
> >>> -----------------------
> >>>
> >>> // Underneath database config info
> >>> define('CUSTOM_USER_TABLE', 'wp_users');
> >>> define('CUSTOM_USER_META_TABLE', 'wp_usermeta');
> >>>
> >>> In this way, you only need to have one wordpress users table and
> >>> usermeta table. You will have to keep track of the prefix of the
> >>> wordpress installation you have all of the users in.
> >>>
> >>> Jacob Santos
> >>>
> >>> Chris Lott wrote:
> >>>> Faculty members have discovered CommentPress and would like to use
> >>>> CommentPress enabled blogs alongside their regular class
> >>>> blogs... is
> >>>> there a simple way to share the usernames/logins between two WP
> >>>> installations? All that really needs to be shared is the login name
> >>>> and password...
> >>>>
> >>>> c
> >>>>
> >>>
> >>> _______________________________________________
> >>> 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
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
>
> ------------------------------
>
> Message: 7
> Date: Fri, 24 Aug 2007 23:42:54 -0400
> From: "Curt Woodard" <clwoodard at gmail.com>
> Subject: Re: [wp-hackers] Sharing Users/authentication
> To: wp-hackers at lists.automattic.com
> Message-ID:
>         <a3b809ae0708242042x35691b1av256f41de4abcbfdf at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> > Yes. There are defines in the wp-settings.php file that can be defined
> > in the wp-config.php file.
> >
> > wp-config.php
> > -----------------------
> >
> > // Underneath database config info
> > define('CUSTOM_USER_TABLE', 'wp_users');
> > define('CUSTOM_USER_META_TABLE', 'wp_usermeta');
> >
> > In this way, you only need to have one wordpress users table and
> > usermeta table. You will have to keep track of the prefix of the
> > wordpress installation you have all of the users in.
> >
> > Jacob Santos
> >
> > Chris Lott wrote:
> > > Faculty members have discovered CommentPress and would like to use
> > > CommentPress enabled blogs alongside their regular class blogs... is
> > > there a simple way to share the usernames/logins between two WP
> > > installations? All that really needs to be shared is the login name
> > > and password...
> > >
> > > c
>
> Quick question:
> Can these defines point to a MySQL view instead of actual tables? If
> that's the case then my work will be MUCH easier than I think...
>
> -Curt
>
>
> ------------------------------
>
> Message: 8
> Date: Fri, 24 Aug 2007 22:55:21 -0500
> From: Jacob Santos <dragonwing at dragonu.net>
> Subject: Re: [wp-hackers] Sharing Users/authentication
> To: wp-hackers at lists.automattic.com
> Message-ID: <46CFA829.8090807 at dragonu.net>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> No, the defines replace the default WordPress table names, if they are
> defined. Does not include the prefix with the constant, so the name has
> to be the full custom table name.
>
> If you want to define the user, you can do so by another method. I want
> to say by creating the WordPress cookie or by writing your own User API
> function in a plugin.
>
> Can you explain more by what you mean of 'MySQL view'?
>
> Jacob Santos
>
> Curt Woodard wrote:
> >> Yes. There are defines in the wp-settings.php file that can be defined
> >> in the wp-config.php file.
> >>
> >> wp-config.php
> >> -----------------------
> >>
> >> // Underneath database config info
> >> define('CUSTOM_USER_TABLE', 'wp_users');
> >> define('CUSTOM_USER_META_TABLE', 'wp_usermeta');
> >>
> >> In this way, you only need to have one wordpress users table and
> >> usermeta table. You will have to keep track of the prefix of the
> >> wordpress installation you have all of the users in.
> >>
> >> Jacob Santos
> >>
> >> Chris Lott wrote:
> >>
> >>> Faculty members have discovered CommentPress and would like to use
> >>> CommentPress enabled blogs alongside their regular class blogs... is
> >>> there a simple way to share the usernames/logins between two WP
> >>> installations? All that really needs to be shared is the login name
> >>> and password...
> >>>
> >>> c
> >>>
> >
> > Quick question:
> > Can these defines point to a MySQL view instead of actual tables? If
> > that's the case then my work will be MUCH easier than I think...
> >
> > -Curt
> > _______________________________________________
> > 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
>
>
> End of wp-hackers Digest, Vol 31, Issue 33
> ******************************************
>


More information about the wp-hackers mailing list