Re: syncing with external BB database --- what would you do?

2006-08-29 Thread [EMAIL PROTECTED]

Register Django user in punBB:
##
- open register.php
- find:

// Add user

- after add:

$salt = substr(md5(base64_encode(time())), 0, 5);
$db->query('INSERT INTO auth_user (username, email, password,
is_active, date_joined) VALUES ("'.$db->escape($username).'",
"'.$email1.'", "sha1$'.$salt.'$'.sha1($salt.$password1).'", "1",
"2006-08-29 20:00:34")');

##
Register punBB user in Django:
- use this code:

import sha
user = 'piotr' # login
password = sha.new('piotr').hexdigest() # "piotr" is the password
email = '[EMAIL PROTECTED]' # user email
from django.db import connection
cursor = connection.cursor()
cursor.execute("INSERT INTO pun_users (group_id, username, password,
email, registered) VALUES ('4', '"+ user +"', '"+ password +"', '"+
email +"', '1156874672')")

- place it in your registration view and pass him user email, login and
password :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: syncing with external BB database --- what would you do?

2006-08-28 Thread [EMAIL PROTECTED]

You could cross integrate django and punBB:
-registration on punBB creates a user in Django -> insert proper data
in the proper tables
- Register on django does the same on punBB (this is easier :) )


I've been playing with some punBB PHP integrations so I can help a bit
with the Python one :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



syncing with external BB database --- what would you do?

2006-08-28 Thread [EMAIL PROTECTED]

Ok, so I've got my Django stuff complete with accounts, registration
and all that,, and I've got a legacy db handling punBB, but I'd really
like to set it up so one user registration works everywhere. The
obvious answer would be a BB in django, but the zyons solution doesn't
seem quite ready for production (no offense, Ian).

So how would you handle it?

Attempt to push new registrations over to the Django DB?
Have django retrieve new registrations every so often?
Some other way I"m not thinking of?

I guess the root of the question is how would I make django coexist and
integrate nicely with this existing db?

Note: the punbb database has more than 4000 users, although the number
of new users on any given day isn't particularly high,  if that matters.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---