Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Ban with bridge to IPB 1.3  (Read 2860 times)

0 Members and 1 Guest are viewing this topic.

Sephiros

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Ban with bridge to IPB 1.3
« on: March 30, 2004, 02:33:19 am »

Hello,

First of all thanks for this great gallery it's awesome :)

I Bridged Coppermine to my IPB forum and everything works perfecly well.
I only have a question concerning banning:

Is it possible to ban a specific member of the forum from the gallery using the built-in ban feature?

When I try to it gives me this error:

Code: [Select]

While executing query "SELECT user_id FROM **ERROR** WHERE user_name = 'Sephiros'" on 0

mySQL error: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '**ERROR** WHERE user_name = 'Sephiros'' at line 1


of course as I bridged Coppermine with the forum, there is no users in my "user_name" field of the database.

So i wonder if there is a way to make it work, if I missed something in the configurations (again everything else works perfectly) or anything else.

Thank you,
Sephiros
Logged

Nibbler

  • Guest
Ban with bridge to IPB 1.3
« Reply #1 on: March 30, 2004, 04:15:30 am »

Hi,

This *should* be fixed in 1.3.0 when it is released, but to fix this for now you can do something like -

in functions.inc.php:

change:

Code: [Select]

//        } elseif (defined('UDB_INTEGRATION')) {
//           return udb_get_user_name($uid);


to

Code: [Select]

        } elseif (defined('UDB_INTEGRATION')) {
           return udb_get_user_id($username);


+ In your bridge file add a new function udb_get_user_id:

Code: [Select]

function udb_get_user_id($username)
{
    global $UDB_DB_LINK_ID, $UDB_DB_NAME_PREFIX, $CONFIG;

    $sql = "SELECT id " . "FROM " . $UDB_DB_NAME_PREFIX . IB_TABLE_PREFIX . IB_USER_TABLE . " " . "WHERE name = '$username'";

    $result = db_query($sql, $UDB_DB_LINK_ID);

    if (mysql_num_rows($result)) {
        $row = mysql_fetch_array($result);
        mysql_free_result($result);
        return $row['id'];
    } else {
        return '';
    }
}


Can't test this as I don't use IPB, hope it works :D
Logged

Sephiros

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Ban with bridge to IPB 1.3
« Reply #2 on: March 30, 2004, 07:50:35 pm »

Thanks for the quick response Nibbler!

I carefully followed your instructions but still no luck, with exactly the same error...

I know too little of php to see what's wrong  :?
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 14 queries.