@GauGau,
eine Frage vieleicht kanst du mir oder jemand anderer weiterhelfen:
Was brauche ich für eine Funktionierende Bridge im Bridge ordner bzw. wie weit beinflust die datei:
udb_base.inc.php
die Bridge? Muss diese Datei auch angepast werden??
anbei mal eine Bridge fürs wbb3 die aber leider nicht so wirklich funzt. FEHLER bei der datenbankabfrage
<?php
/*************************
Coppermine Photo Gallery WBB Bridge
************************
Copyright (c) 2006 Cyberspectrum
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
Comaptible for Coppermine version: 1.4.3
Author: DrachenKaiser
Date: 2007-05-27
**********************************************/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
require_once 'bridge/udb_base.inc.php';
class cpg_udb extends core_udb {
var $admins=array();
function cpg_udb()
{
global $BRIDGE, $boardurl, $boardconfig;
$this->boardurl = 'http://www.eure-url.de/forum';
//require_once('../forum/acp/lib/config.inc.php');
//require_once("../forum/acp/lib/options.inc.php");
$this->use_post_based_groups =1;# $BRIDGE['use_post_based_groups'];
$this->multigroups = 0;
// Database connection settings
$this->db = array(
'name' => 'dbname',
'host' => 'localhost',
'user' => 'username',
'password' => 'passwort',
'prefix' => 'wcf_'
);
// Board table names
$this->table = array(
'users' => 'user',
'groups' => 'group',
'sessions' => 'session',
'usergroups' => 'user_to_groups'
);
// Derived full table names
$this->usertable = '`' . $this->db['name'] . '`.' . $this->db['prefix'] . $this->table['users'];
$this->groupstable = '`' . $this->db['name'] . '`.' . $this->db['prefix'] . $this->table['groups'];
$this->sessionstable = '`' . $this->db['name'] . '`.' . $this->db['prefix'] . $this->table['sessions'];
$this->usergroupstable= '`' . $this->db['name'] . '`.' . $this->db['prefix'] . $this->table['usergroups'];
// Table field names
$this->field = array(
'username' => 'username', // name of 'username' field in users table
'user_id' => 'userID', // name of 'id' field in users table
'password' => 'password', // name of 'password' field in users table
'email' => 'email', // name of 'email' field in users table
'regdate' => 'registrationDate', // name of 'registered' field in users table
'location' => "''", // name of 'location' field in users table
'website' => "''", // name of 'website' field in users table
'usertbl_group_id' => "groupID", // name of 'group id' field in users table
'grouptbl_group_id' => "groupID", // name of 'group id' field in groups table
'grouptbl_group_name' => "groupName" // name of 'group name' field in groups table
);
// Pages to redirect to
$this->page = array(
'register' => '/register.php',
'editusers' => '/memberslist.php',
'edituserprofile' => "/profile.php?userid=",
);
// Group ids - admin and guest only.
$this->admingroups = array(4);
$this->guestgroup =2;
// Use a special function to collect groups for cpg groups table
$this->group_overrride = 0;
// Cookie settings - used in following functions only
// get cookieprefix from vb3.0.x
$this->cookie_name = "wcf_";
// Connect to db
$this->connect();
$this->admins=array(1); // Ids der Admins hier druch Komma getrennt eintragen
}
function load_user_data($row)
{
global $USER_DATA;
$USER_DATA['user_id'] = $row['id'];
$USER_DATA['user_name'] = $row['username'];
//changed to "row['group_id']" $group_id = $row[($this->usergroupstable)?$this->field['usertbl_group_id']:$this->field['grouptbl_group_id']];
if ($this->multigroups){
$USER_DATA['groups'] = $this->get_groups($row);
} else {
if ($this->use_post_based_groups){
if(in_array($row['id']))$USER_DATA['groups'] = array(0 => 104);
else $USER_DATA['groups'] = array(0 => 103);
} else {
$USER_DATA['groups'] = array(0 => (in_array($row['group_id'] - 100, $this->admingroups)) ? 1 : 2);
}
}
}
// definition of how to extract id, name, group from a session cookie
function session_extraction()
{
if (isset($_COOKIE[$this->cookie_name . 'cookieHash'])) {
$session_id = addslashes($_COOKIE[$this->cookie_name . 'cookieHash']);
$sql = "SELECT u.".$this->field['user_id'].", u.".$this->field['password'].
" FROM ".$this->usertable." AS u, ".$this->sessionstable." AS s".
" WHERE s.".$this->field['user_id']."=u.".$this->field['user_id']." AND s.sessionID='".$session_id."'";
$result = cpg_db_query($sql, $this->link_id);
if (mysql_num_rows($result)){
$row = mysql_fetch_array($result);
return array($row[$this->field['user_id']], $row[$this->field['password']]);
} else {
return false;
}
}
}
function cookie_extraction()
{
return false;
}
function get_groups($row)
{
$int_pref='`'.$this->db['name'].'`.'.$this->db['prefix'];
$id=$row['id'];
$sql="SELECT groupID FROM ".$this->db['prefix']."user_to_groups userID='$id'";
$result = cpg_db_query($sql);
while($groups = mysql_fetch_array($result))
{
$groupids[]=$groups['groupID']+100;
}
return $groupids;
}
// definition of actions required to convert a password from user database form to cookie form
function udb_hash_db($password)
{
return $password; // unused
}
function login_page()
{
$this->redirect("/index.php");
}
function logout_page()
{
$this->redirect("/index.php?action=UserLogout&u=".USER_ID);
}
}
// and go !
$cpg_udb = new cpg_udb;
?>
Was ist fals an der Bridge??