No Support => General discussion (no support!) => Topic started by: dbmdude on May 02, 2004, 09:14:52 am

Title: v1.3.0 Integration?
Post by: dbmdude on May 02, 2004, 09:14:52 am
Is there anyone here that can tell me how to integrate Coppermine into another BBS software?

I am writing my own BBS front end and would like to be able to send (pass) my username and password information into this software to enable users to have only one login to worry about.  I would like to have MY registration process be dominant and I would manually create the users for Coppermine to match the users on my site.  NOW if there is a way for me to use my Registration that would be cool... right now my registration uses a Session variable called $_SESSION['authorized'] that will be equal to a value queried from a MySQL table that represents the users access level, the username and password are currently NOT in session vars, but they could be.

Code: [Select]
function Encrypt($string) {//hash then encrypt a string
    $crypted = crypt(md5($string), md5($string));
    return $crypted;

function AddUser($database_connHOME, $hostname_connHOME, $username_connHOME, $password_connHOME, $username, $password) { //add user to table logins
    $linkID = mysql_connect($hostname_connHOME, $username_connHOME, $password_connHOME);
    mysql_select_db($database_connHOME, $linkID);
    $password = encrypt($password);
    $username = encrypt($username);
    mysql_query("insert into logins values ('$username', '$password', 1)", $linkID);
return mysql_affected_rows();

function Login($database_connHOME, $hostname_connHOME, $username_connHOME, $password_connHOME, $user, $password) { //attempt to login false if invalid true if correct

    $user = Encrypt($user);
    $linkID = mysql_connect($hostname_connHOME, $username_connHOME, $password_connHOME);
    mysql_select_db($database_connHOME, $linkID);
    $result = mysql_query("select * from logins where user = '$user'", $linkID);
if ($result >= 1) {
      $pass = mysql_fetch_row($result);
      if ($pass[1] == (Encrypt($password))) {
          $_SESSION['authorized'] = $pass[2];
} else {
       $_SESSION['authorized'] = 0;

Anyone got enough savvy with Coppermine to tell me how to do this??

Would I merely set different session vars to make coppermine see the existing un/pw combination?  Or would I have to get more complicated then that?

Please help if you can.

Title: Re: v1.3.0 Integration?
Post by: Joachim Müller on May 02, 2004, 11:39:30 am
take a look at the bridge files that come with coppermine that do enable user management of a third party app (a bbs) to be "in vharge" of user registration/login/management.
Modify one of the bridge files to fit your needs.