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: How to write a bridge file?  (Read 13710 times)

0 Members and 1 Guest are viewing this topic.

THEMike

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Fuckingbrit.com: The World of Mike
How to write a bridge file?
« on: June 30, 2005, 05:34:02 pm »

Hi,

I am a core developer on the geeklog project.

I am attempting to write a bridge file for geeklog. This should be pretty straightforward.

Is there any documentation on what functions a bridge file must provide and what they must return? For example, the udb_authenticate in the phpbb integration is quite a large function and appears to be setting up various info in an array. Rather than reverse engineer the array from this example bridge, I'd like to read the spec for what I should put in the array.

And so on...
Logged

Nibbler

  • Guest
Re: How to write a bridge file?
« Reply #1 on: June 30, 2005, 07:19:29 pm »

Reverse engineering is pretty much your only option, as there are no docs on bridge file coding. Note that there is a new bridging system in CPG 1.4 which should be easier to work with so you may like to wait for that or check it out from CVS.
Logged

THEMike

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Fuckingbrit.com: The World of Mike
Re: How to write a bridge file?
« Reply #2 on: July 01, 2005, 08:35:04 am »

How far off is 1.4 in the scheme of things? Are we talking "When it's ready" or is it getting close enough to say a month or two?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to write a bridge file?
« Reply #3 on: July 01, 2005, 10:30:51 am »

I'm currently in the process of packaging a public beta, but it should be pretty stable already. If you know what you're doing (and I guess you do ;)), I'd say it's save to go for cpg1.4.x
Logged

THEMike

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Fuckingbrit.com: The World of Mike
Re: How to write a bridge file?
« Reply #4 on: July 01, 2005, 07:24:42 pm »

ok which module name should I grab? It's a bit confusing...
Logged

Nibbler

  • Guest
Re: How to write a bridge file?
« Reply #5 on: July 01, 2005, 07:41:30 pm »

Grab devel.
Logged

THEMike

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Fuckingbrit.com: The World of Mike
Re: How to write a bridge file?
« Reply #6 on: July 01, 2005, 10:03:07 pm »

Ok got it, I wasn't sure as there was stable, and mention of beta's was made. Plus NG (Next Generation?) or just cpg...

Perhaps that should be noted somewhere easy to find on the site?

Questions:

1) // Table field names

Some of the fields we don't track in the simple tables. For example, last login, in geeklog is not stored in the user table but in a seperate table. Ditto the location and other profile info. The user table strictly controls access. Groups are also not held in the user table, this is stored in gl_group_assignments as it's a many to many relationship. The $this->field array doesn't appear to allow me to handle these issues. How can I deal with it?

2) session_extraction

What do I have to return here? The examples seem inconsistent. What should the keys in the array be? Can I return multiple groups?
Logged

Nibbler

  • Guest
Re: How to write a bridge file?
« Reply #7 on: July 01, 2005, 10:17:53 pm »

If fields are not there, just enter "''" - a pair of single quotes in double quotes, then the query goes to SELECT '' as location for example.

For session_extraction return there shouldn't be specified keys as the values are extracted from the array using list(), the values are just the userid and password, which doesn't make much sense really but such is life. It's an optional function.

See also - http://forum.coppermine-gallery.net/index.php?topic=18395.msg87266#msg87266
Logged

THEMike

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Fuckingbrit.com: The World of Mike
Re: How to write a bridge file?
« Reply #8 on: July 08, 2005, 08:57:21 am »

Right, after a slight delay due to children, dogs and other chaos in my life...

I have a "working" CPG 1.4.1 beta -> Geeklog 1.3.12CVS bridge file. It should work with geeklog 1.3.11 also, but I have only tested it on my CVS test instance. However, in the admin "Groups" section, I get four Coppermine user groups, not my geeklog user groups.

Care to suggest why this is?
Logged

Nibbler

  • Guest
Re: How to write a bridge file?
« Reply #9 on: July 08, 2005, 02:45:26 pm »

To use imported groups you need to enable and support post based groups.
Logged

THEMike

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Fuckingbrit.com: The World of Mike
Re: How to write a bridge file?
« Reply #10 on: July 08, 2005, 08:52:39 pm »

OK, when I return groups for a user, should I add 100 to them? Or does the rest of the code apply the offset? Or am I barking up the wrong tree...

Currently, guest user causes this error:

While executing query "SELECT aid FROM cpg140_albums WHERE visibility != '0' AND visibility !='10000' AND visibility NOT IN " on 0

mySQL error: You have an error in your SQL syntax near '' at line 1

What is the stuff that should be after IN? Where should I be looking to find what I'm not setting right?
Logged

Nibbler

  • Guest
Re: How to write a bridge file?
« Reply #11 on: July 08, 2005, 08:57:04 pm »

The set of groups the user is in should be inside the IN().
Logged

THEMike

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Fuckingbrit.com: The World of Mike
Re: How to write a bridge file?
« Reply #12 on: July 08, 2005, 10:58:24 pm »

I Was missing:

Code: [Select]
$user_group_set = '(' . implode(',', $USER_DATA['groups']) . ')';
Logged

THEMike

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Fuckingbrit.com: The World of Mike
Re: How to write a bridge file?
« Reply #13 on: July 08, 2005, 11:05:19 pm »

attached is a fully working bridge.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to write a bridge file?
« Reply #14 on: July 11, 2005, 08:22:30 am »

I started a new thread for your contribution: http://forum.coppermine-gallery.net/index.php?topic=19686.0
Logged

THEMike

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Fuckingbrit.com: The World of Mike
Re: How to write a bridge file?
« Reply #15 on: July 20, 2005, 01:10:34 pm »

Can you mark multiple groups as admin groups?

I don't have access to the code from here, unfortunately, but I think if I remember correctly, there is a single value for "the admin group" set up in the init function of the bridge class.

I'm tweaking my Bridge in light of some plugin integration work, so that I can mark specific geeklog user groups as having the "coppermine.admin" permission. The Root user group always has all permissions, but I want to grant gallery admin rights to specific other groups. Likewise, I want to grant "coppermine.use" permission to multiple groups of people who have non-admin access to the coppermine gallery (and then use Coppermine admin to say which galleries and what functions those multiple groups have).

The later (user access) is no problem, but I think that I'm limited to one group for admin, which would mean that if I wanted to grant a user access to the gallery admin, I would have to grant them root access to the entire of geeklog.

I've also got a custom theme nearly done that embeds the Gallery within the Geeklog UI. Just need to tidy up one or two details and I can release that.
Logged

Nibbler

  • Guest
Re: How to write a bridge file?
« Reply #16 on: July 20, 2005, 02:13:36 pm »

Admin groups are set as an array, put as many as you like.
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.