Topic: [1.2.15] One Punbb for multiple users.

This functionality isn't present in the current 1.3dev.

It whould be fine for webadmin to have the punbb code outside the forum directory.
I've make something like that in 1.2.15 but it's not complete. I call it punrotisation.
the principle
change all PUN_ROOT.'config.php' by './config.php'
change all define(PUN_ROOT... by include('./punroot.php')
make somewhere a directory racine (it would be the racine of the installations)
mv img and styles in this directory racine
for all PHP with include('./punr create a php file with the same name and just contains an include of punroot.php and of the orginal file
and make some change to prevent conflict for the cache.
The Unix script to make this punrotisation is on on punbb.fr

I think it would be fine to get a better implementation of punrotisation in 1.3 ;-)

Re: [1.2.15] One Punbb for multiple users.

I'm curious, what's would be the purpose?

Re: [1.2.15] One Punbb for multiple users.

Jérémie wrote:

I'm curious, what's would be the purpose?

imagine your administrator for a machine with many punbb installation. If tou 5 punbb and want to install a mod or a new version you need to do the samething five time. Yes five is not realy a problem but with 25, 100, 250 etc ...
The other advantage you ca pu code outside the web vision. It's one ofe the best protection agains't back door.
You can install a new version, make the test, switch one site to the new version (only one file to edit) and if there is a problem switch back the original version.

The rest is to you to imagine.

[french](PS : Je plains les pov' anglophone qui lisent notre prose)[/ french]

Re: [1.2.15] One Punbb for multiple users.

Agreed, your English is pure abomination smile

I'm pretty sure it wouldn't help at all for potential security purpose.

However, the goal to have only one code base to maintain is quite nice, yup. But it might get tricky if the database doesn't follow the multiple-forums scheme. Because a plugin could, for example, store things into the database. Teh you'll have forum A with the plugin in the DB and the code, and forum B with the plugin only in the code.

I guess it depends on how hooks are handle.

I might suggest transforming this feature request into a ?support multiple forum with one PunBB install? one, and if accepted let the dev look for the best way of doing it.

Re: [1.2.15] One Punbb for multiple users.

I doubt it'll ever become a "feature" but there are a number of threads discussing how (and i think a mod) to do exactly this.

Re: [1.2.15] One Punbb for multiple users.

Connorhd wrote:

I doubt it'll ever become a "feature" but there are a number of threads discussing how (and i think a mod) to do exactly this.

Sorry I've made a search but didn't see this threads.

Re: [1.2.15] One Punbb for multiple users.

What about this one?
http://www.punres.org/desc.php?pid=176

FluxBB - v1.4.8

Re: [1.2.15] One Punbb for multiple users.

Jérémie wrote:

Agreed, your English is pure abomination smile

I'm pretty sure it wouldn't help at all for potential security purpose.

However, the goal to have only one code base to maintain is quite nice, yup. But it might get tricky if the database doesn't follow the multiple-forums scheme. Because a plugin could, for example, store things into the database. Teh you'll have forum A with the plugin in the DB and the code, and forum B with the plugin only in the code.

I guess it depends on how hooks are handle.

Well it's idiot for mod or plugin to not prefix table by $db_prefix and they realy may have their own tables

in 1.3 hooks are store in a table so there would be no reals problems.

Re: [1.2.15] One Punbb for multiple users.

lie2815 wrote:

What about this one?
http://www.punres.org/desc.php?pid=176

Well is it realy a mod or a fork ? sad

With my shell script you can "punrotise" even if a mod is intall.
(how i modifie the shell script since i use it so it is not realy "tested"

#!/bin/sh
echo attention untested script 
echo making the  forum racine directory
mkdir ../racine
echo making the bypasses in the racine directory
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_bans.php');" >../racine/admin_bans.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_categories.php');" >../racine/admin_categories.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_censoring.php');" >../racine/admin_censoring.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_forums.php');" >../racine/admin_forums.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_groups.php');" >../racine/admin_groups.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_index.php');" >../racine/admin_index.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_loader.php');" >../racine/admin_loader.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_maintenance.php');" >../racine/admin_maintenance.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_options.php');" >../racine/admin_options.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_options.php.ori');" >../racine/admin_options.php.ori
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_permissions.php');" >../racine/admin_permissions.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_prune.php');" >../racine/admin_prune.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_ranks.php');" >../racine/admin_ranks.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_reports.php');" >../racine/admin_reports.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'admin_users.php');" >../racine/admin_users.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'delete.php');" >../racine/delete.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'edit.php');" >../racine/edit.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'extern.php');" >../racine/extern.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'help.php');" >../racine/help.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'index.php');" >../racine/index.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'install.php');" >../racine/install.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'login.php');" >../racine/login.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'misc.php');" >../racine/misc.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'moderate.php');" >../racine/moderate.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'post.php');" >../racine/post.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'profile.php');" >../racine/profile.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'register.php');" >../racine/register.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'search.php');" >../racine/search.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'userlist.php');" >../racine/userlist.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'viewforum.php');" >../racine/viewforum.php
echo "<?php require('./punroot.php');  include(PUN_ROOT.'viewtopic.php');" >../racine/viewtopic.php
echo suppressi al unused PUN_ROOT definition
sed -i '/define(PUN_ROOT/d' *.php
echo make using local config.php
sed -i "s/PUN_ROOT\.'config/'.\/config/" *.php
sed -i "s/PUN_ROOT\.'config/'.\/config/" include/*.php
echo move img and styles dans in forums racines
mv styles ../racine
mv img ../racine
echo makink cache modification 
sed -i "s/cache\/ca/cache\/'.\$db_prefix.'ca/" *.php
sed -i "s/cache\/ca/cache\/'.\$db->prefix.'ca/" include/cache.php
sed -i "s/cache\/ca/cache\/'.\$db_prefix.'ca/" include/*.php
echo Now you need to create punroot.php in racine
echo exemple
echo <?php define('PUN_ROOT','../../outils/punbb/');

10

Re: [1.2.15] One Punbb for multiple users.

Why not just shift them into an external directory and softlink them, if you only want to maintain one copy of the files? Btw, for security purposes, you should be using http server access controls for protecting those, if you want an extra layer of security.

Re: [1.2.15] One Punbb for multiple users.

MattF wrote:

Why not just shift them into an external directory and softlink them, if you only want to maintain one copy of the files?

Because you'ld may not have a ssh/telnet access to the server.

12 (edited by MattF 2007-06-25 14:53)

Re: [1.2.15] One Punbb for multiple users.

BertrandB wrote:
MattF wrote:

Why not just shift them into an external directory and softlink them, if you only want to maintain one copy of the files?

Because you'ld may not have a ssh/telnet access to the server.

Surely you're joking? You're talking about a scenario which would only serve any purpose in a large scale multi forum site, and you seriously wouldn't have access to administer the system correctly? That is a disaster waiting to happen.

Edit: Edited for a spelling error. big_smile

13 (edited by chucky 2007-06-25 14:42)

Re: [1.2.15] One Punbb for multiple users.

+1, if you have 200 forums on a shared server plz TELL me who this webhost is !!! big_smile big_smile big_smile

softlinks are a very simple and efficient way to deal with multi-forums ... ( i think that's what every forum hosting service like mypunbb does )

Re: [1.2.15] One Punbb for multiple users.

chucky wrote:

+1, if you have 200 forums on a shared server plz TELL me who this webhost is !!! big_smile big_smile big_smile

Dreamhost. That's where PunBB-hosting is.

softlinks are a very simple and efficient way to deal with multi-forums ... ( i think that's what every forum hosting service like mypunbb does )

Hardly, just sending the identifier through the URL is much easier.

15

Re: [1.2.15] One Punbb for multiple users.

elbekko wrote:

softlinks are a very simple and efficient way to deal with multi-forums ... ( i think that's what every forum hosting service like mypunbb does )

Hardly, just sending the identifier through the URL is much easier.

Softlinks are cronable. No input required for those either. big_smile Horses for courses, really. Whichever is ones preferred method. big_smile

16 (edited by BertrandB 2007-06-25 19:21)

Re: [1.2.15] One Punbb for multiple users.

Yes yes yes ...
but
what is the purpose
of the PUN_ROOT constant %o)

17 (edited by MattF 2007-06-25 19:28)

Re: [1.2.15] One Punbb for multiple users.

BertrandB wrote:

Yes yes yes ...
but
what is the purpose
of the PUN_ROOT constant %o)

PUN_ROOT isn't a constant. It's configureable at the top of each script.

define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';

What difference is there in that to your initial post suggestion of changing PUN_ROOT.'include' to ./include?

Again, if you require multi-forum setups, there are far better ways to achieve the result required.

Re: [1.2.15] One Punbb for multiple users.

MattF wrote:

PUN_ROOT isn't a constant. It's configureable at the top of each script.

define('PUN_ROOT', './');

Yes it's a a constant not a variable

MattF wrote:

What difference is there in that to your initial post suggestion of changing PUN_ROOT.'include' to ./include?

Hey not at all in my suggestion i keep PUN_ROOT.'include' PUN_ROOT.'cache' etc ..
But i change PUN_ROOT.'config.php' by './config.php'.
config.php is a configuration so it would not be in the same directory as code. Even with softlink you need one config.php by forum.

MattF wrote:

Again, if you require multi-forum setups, there are far better ways to achieve the result required.

Yes there is always different ways to do the same thing. Soft Links is one of them. An advantage with my way of doing is that you never need maintenance mode, and you can switch forum by forum on new versions of code.

If you don't want my solution ok it's not a problem but consider that with the PUN_ROOT constant and the $db_prefix punbb is only in half way to a multiforums.

For the moment we only spoke of the code. The real problem in multiforum is what to do with img and styles.

19

Re: [1.2.15] One Punbb for multiple users.

elbekko wrote:

Hardly, just sending the identifier through the URL is much easier.

could you be more precise ?

thanks

Re: [1.2.15] One Punbb for multiple users.

myhosting.com/forums/someonesforum/index.php
would be translated by .htaccess to
myhosting.com/forums/index.php?forum=someonesforum

21

Re: [1.2.15] One Punbb for multiple users.

BertrandB wrote:

Yes there is always different ways to do the same thing. Soft Links is one of them. An advantage with my way of doing is that you never need maintenance mode, and you can switch forum by forum on new versions of code.

You wouldn't need maintenance mode with links, either, as mv is atomic.

BertrandB wrote:

If you don't want my solution ok it's not a problem but consider that with the PUN_ROOT constant and the $db_prefix punbb is only in half way to a multiforums.

For the moment we only spoke of the code. The real problem in multiforum is what to do with img and styles.

Just working upon your theory of './include'. What happens if a script needs to call one of your master scripts from a second level depth? i.e: root_forum_dir/scripts/script.php Your method would not work in that scenario.

22

Re: [1.2.15] One Punbb for multiple users.

elbekko wrote:

myhosting.com/forums/someonesforum/index.php
would be translated by .htaccess to
myhosting.com/forums/index.php?forum=someonesforum

i know url rewriting smile
i meant how do you match each url parameter to each forum ? is it something like

/* index.php  && install.php */
$forum = $GET_['forum']

require_once 'thepathtotheconfigfile/config.inc_'.$forum.'.php';

and then you make a script which creates a config.inc_someuser.php when someuser registers ??

thanks

Re: [1.2.15] One Punbb for multiple users.

When I made it, I just used a database prefix.

Re: [1.2.15] One Punbb for multiple users.

MattF wrote:

Just working upon your theory of './include'. What happens if a script needs to call one of your master scripts from a second level depth? i.e: root_forum_dir/scripts/script.php Your method would not work in that scenario.

But I never never speak about "./include" if you know how to use sed look at shell script. And what you speeak may not arrive there is no subdir in local with callable .php (in 1.2.15).
Ok in 1.3 you have the admin subdir.
A solution is to put full path in punroot.php, create a constant in punroot.php with the complete path of config.php and modify install.php et common.php to use this consant. "Et hop dans la poche".

I'm sorry for you but it works fine and I use it. tongue

25

Re: [1.2.15] One Punbb for multiple users.

BertrandB wrote:
MattF wrote:

Just working upon your theory of './include'. What happens if a script needs to call one of your master scripts from a second level depth? i.e: root_forum_dir/scripts/script.php Your method would not work in that scenario.

But I never never speak about "./include" if you know how to use sed look at shell script. And what you speeak may not arrive there is no subdir in local with callable .php (in 1.2.15).
Ok in 1.3 you have the admin subdir.
A solution is to put full path in punroot.php, create a constant in punroot.php with the complete path of config.php and modify install.php et common.php to use this consant. "Et hop dans la poche".

I'm sorry for you but it works fine and I use it. tongue

It was an example, not a factual representatation. big_smile Yes, I do know sed, and of late I know the source code quite well too, so know exactly what you are referring to. smile All I'm meaning to say is that your proposal allows little, if any variation. It's not resilient. It should work fine with a standard system, but that's it. For anyone who has, like I, moved the admin files into a separate forum_root/admin/ dir, for example, that method would be useless. The theory in general I agree with, as using relative paths is a fallacy, (although in 1.3 I believe this has been changed), but I am merely suggesting that some level of adaptation might be better suited for something like this. You are taking a scenario and creating another one in almost the same vein, just via a different method.