Many thanks Nibbler for releasing this bridge file for phpbb/coppermine users.
I found some code elsewhere here on the site for autocreating albums, here it is..do you think this will work with your bridge file or do you know a better way of doing it.
function authenticate()
{
global $USER_DATA, $CONFIG;
if (!($auth = $this->session_extraction()) && !($auth = $this->cookie_extraction())) {
$this->load_guest_data();
} else {
list ($id, $cookie_pass) = $auth;
$f = $this->field;
if (isset($this->usergroupstable)){
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password,
ug.{$f['usertbl_group_id']} AS group_id ".
"FROM {$this->usertable} AS u, {$this->usergroupstable} AS ug ".
"WHERE u.{$f['user_id']}=ug.{$f['user_id']} AND u.{$f['user_id']}='$id'";
} else {
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password,
u.{$f['usertbl_group_id']}+100 AS group_id ".
"FROM {$this->usertable} AS u INNER JOIN {$this->groupstable} AS g ON
u.{$f['usertbl_group_id']}=g.{$f['grouptbl_group_id']} ".
"WHERE u.{$f['user_id']}='$id'";
}
$result = cpg_db_query($sql, $this->link_id);
if (mysql_num_rows($result)){
$row = mysql_fetch_assoc($result);
mysql_free_result($result);
$db_pass = $this->udb_hash_db($row['password']);
if ($db_pass === $cookie_pass) {
$this->load_user_data($row);
} else {
$this->load_guest_data();
}
} else {
$this->load_guest_data();
}
}
$user_group_set = '(' . implode(',', $USER_DATA['groups']) . ')';
$USER_DATA = array_merge($USER_DATA, $this->get_user_data($USER_DATA['groups'][0], $USER_DATA['groups'], $this->guestgroup));
if ($this->use_post_based_groups){
$USER_DATA['has_admin_access'] = (in_array($USER_DATA['groups'][0] - 100,$this->admingroups)) ? 1 : 0;
} else {
$USER_DATA['has_admin_access'] = ($USER_DATA['groups'][0] == 1) ? 1 : 0;
}
$USER_DATA['can_see_all_albums'] = $USER_DATA['has_admin_access'];
// avoids a template error
if (!$USER_DATA['user_id']) $USER_DATA['can_create_albums'] = 0;
// For error checking
$CONFIG['TABLE_USERS'] = '**ERROR**';
define('USER_ID', $USER_DATA['user_id']);
define('USER_NAME', addslashes($USER_DATA['user_name']));
define('USER_GROUP', $USER_DATA['group_name']);
define('USER_GROUP_SET', $user_group_set);
define('USER_IS_ADMIN', $USER_DATA['has_admin_access']);
define('USER_CAN_SEND_ECARDS', (int)$USER_DATA['can_send_ecards']);
define('USER_CAN_RATE_PICTURES', (int)$USER_DATA['can_rate_pictures']);
define('USER_CAN_POST_COMMENTS', (int)$USER_DATA['can_post_comments']);
define('USER_CAN_UPLOAD_PICTURES', (int)$USER_DATA['can_upload_pictures']);
define('USER_CAN_CREATE_ALBUMS', (int)$USER_DATA['can_create_albums']);
define('USER_UPLOAD_FORM', (int)$USER_DATA['upload_form_config']);
define('CUSTOMIZE_UPLOAD_FORM', (int)$USER_DATA['custom_user_upload']);
define('NUM_FILE_BOXES', (int)$USER_DATA['num_file_upload']);
define('NUM_URI_BOXES', (int)$USER_DATA['num_URI_upload']);
//Autocreating albums
if($USER_DATA['user_id'] != 0)
{
$cid = 10000 + $USER_DATA['user_id'];
$sql = "SELECT aid FROM cpg14x_albums WHERE category = " . $cid;
$result = cpg_db_query($sql);
if(mysql_num_rows($result) == 0)
{
$sql = "INSERT INTO cpg14x_albums (category, title, uploads, pos) VALUES ('$cid', 'My Album', 'NO', '1')";
cpg_db_query($sql);
}
mysql_free_result($result);
}
$this->session_update();
}
Many thanks once again !
Dogbot.