Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: v1.3.0 Integration?  (Read 3609 times)

0 Members and 1 Guest are viewing this topic.

dbmdude

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
v1.3.0 Integration?
« 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;
}
    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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: v1.3.0 Integration?
« Reply #1 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.

GauGau
Logged
Pages: [1]   Go Up
 

Page created in 0.032 seconds with 19 queries.