v1.3.0 Integration? v1.3.0 Integration?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

v1.3.0 Integration?

Started by dbmdude, May 02, 2004, 09:14:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dbmdude

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.


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;
}
   mysql_close($linkID);
   return;
}


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.

TY
DBMDude

Joachim Müller

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.

GauGau