News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Brigde SMF & MediaWiki

Started by Snakehit, September 21, 2007, 10:26:58 AM

Previous topic - Next topic

Snakehit

Corrupter,

I made some changes on the MediaWiki page, that can be found here. If you have other questions and problems you can always mail me.


ianus

#41
Greetings!

First, thanks for this bridge. Your work is very appreciated.


[*]First explanation:
I would like to set up more than one wiki at my server which are using the same sourcecode.
Something like this: [url=http://www.mediawiki.org/wiki/Manual:Wiki_family]Manual:Wiki family[/url]

First question.
Is it possible to use your code with this kind of wiki-family?

Answer by myself: Yes it is.

  • Second explanation:
    I have two post based groups ("to settle in" with 0 post & inhabitants with more than 0 posts)
    and a range of groups for members with special knowledge.
    This groups are nearly comparable with moderators but with a slightly different ruleset.

    I would like to allow wiki-edits only to members of this groups (and to super-mods and moderators) and prevent that the post based members can edit.

    I know that there is an extension which makes it necessary to create an own group.
    See: Extension:SMF/Users Integration
    At the moment I have the choise an I would prefer to use only existing groups and your extension.


    Second question.
    Is it possible to add something like

    if (in_array(4,5,8, $user_info['groups']))
    $user->addGroup("can edit group");




    [*]Minor question
    Is it possible to use my wiki(s) inside an TinyPortal Article? I think it should be possible with an include(something) or an iframe.

    Answer by myself: Yes ist is


    Have a lot of fun and success with everything you do.

Leidenschafft

Quote from: surra on October 24, 2007, 04:54:24 AM
Got error in editing, after integration:
QuoteYour edit has been rejected because your client mangled the punctuation characters in the edit token. The edit has been rejected to prevent corruption of the article text. This sometimes happens when you are using a buggy web-based anonymous proxy service.
What can be wrong?

same here. wiki works perfect without the smf authentication, as soon as i enable it i get the errormessage above.

i did try to use every charset-setting available, mysql5-support on/off.

the users get logged in correctly, but the edit token breaks everytime.

Snakehit

Did you download the latest version v1.1?

Leidenschafft

@snakehit: yep.

i actually "fixed" this issue by changing
define( 'EDIT_TOKEN_SUFFIX', '+\\' );
to
define( 'EDIT_TOKEN_SUFFIX', '+#+' );

in wiki/includes/User.php

i don't know exactly why this works and what functionality it breaks - or which security holes it will create.
so use it at your own risk - or explain me why this works :)

ianus

Greetings!

I think, I have to delete the questions above. After playing around with some wikis and some bridges, I decide to use mediawiki to offer my users some extra-service.

In general this bridge is working very well. Copy the necessary files, edit some path-settings and I´m done.
Good work wich is very appreciated.

But then I run into the same problem as surra and Leidenschafft

For further investigation eventually this link is helpful:
http://www.mediawiki.org/wiki/Manual:Edit_token


After using the fix Leidenschafft mentioned, the edits are accepted.
Additionally, after the "fix" I can change the user specific settings – like skin, language, etc.


Now I have the same question as above.
I have no clue why this works and what functionality it breaks - or which security holes it will create.
so use it at your own risk - or explain me why this works



I´m running this brigde Version:
·  Version: 1.1
·  Released: 18.09.2007
·  Last updated: 02.12.2007

with
mediawiki-1.11.0
(No other extensions, and a monobook-copy with some css changes)
at
SMF: 1.1.2
and
TinyPortal 0.8.9
(Some extensions which affect bb-code, and a default-theme copy this some changes at css and in the head section of index.template.php)
Mediawiki is included via iframe into an Article.

oblongmedulla

I am having the same issue, and would like to figure it out-

The fix that leidenshaft did works however, any time you use a ' you end up with a  //'

like this  "Consult the [http://meta.wikimedia.org/wiki/Help:Contents User\\\\\\\'s Guide]"

Please if anyone can help on this issue- the integartion has worked I had to change the logout link - otherwise this is the only issue.

This really makes it unusable so I hope someone can help us out on this problem.



ianus

#47
I wasn't brave enought to ask but "yes exactly".

I could copy your text to describe my problem.
You can have a look at
http://www.firopolis.de/wiki/index.php/Testtext
to see what happens.
I used the normal wiki-markup to try to make text ''italic'' with the result: \'\'Italic Text\'\'

Any help would be really appreciated.

Snakehit

Did you guys changed the "define( 'EDIT_TOKEN_SUFFIX', '+\\' )"?

ianus

Quote from: ianus on December 14, 2007, 06:07:41 AM
But then I run into the same problem as surra and Leidenschafft

For further investigation eventually this link is helpful:
http://www.mediawiki.org/wiki/Manual:Edit_token

After using the fix Leidenschafft mentioned, the edits are accepted.
Additionally, after the "fix" I can change the user specific settings – like skin, language, etc.

Now I have the same question as above.
I have no clue why this works and what functionality it breaks - or which security holes it will create.
so use it at your own risk - or explain me why this works



Imho the answer is "yes".

The snipped from my  /wiki/includes/user.php

# Some punctuation to prevent editing from broken text-mangling proxies.
#define( 'EDIT_TOKEN_SUFFIX', '+\\' );
define( 'EDIT_TOKEN_SUFFIX', '+#+' );
/**
* The User object encapsulates all of the user-specific settings (user_id,


As you can see, I deactivate the original
define( 'EDIT_TOKEN_SUFFIX', '+\\' );
and add the "fix"
define( 'EDIT_TOKEN_SUFFIX', '+#+' );


Snakehit

Could you try once with the "define( 'EDIT_TOKEN_SUFFIX', '+#+' );"?
I think the problem is the edit_token_suffix...

oblongmedulla

Quote from: Snakehit on January 08, 2008, 12:22:45 AM
Could you try once with the "define( 'EDIT_TOKEN_SUFFIX', '+#+' );"?
I think the problem is the edit_token_suffix...
This is what I have now-

The initial error not allowing to post or edit message was corrected by editing it to this, but now we are having problems with the apostrophe's like the word Say's would read say/'s after editing in wiki.

Snakehit

Need to go to the office right now, i'll check on this later up today! Must be something with the User.php file... but what and why do you guys have that problem and not me. I'll get back to you later this day.

ianus

#53
Sorry to say that, but I don't think so.

New code (and wiki-original):
s# Some punctuation to prevent editing from broken text-mangling proxies.
define( 'EDIT_TOKEN_SUFFIX', '+\\' );
#define( 'EDIT_TOKEN_SUFFIX', '+#+' );
/**
* The User object encapsulates all of the user-specific settings (user_id,



Same effect. I get the extra / before every '
But this time only in the wiki-preview.


I run into the problem which leads me to change the code.
Your edit has been rejected because your client mangled the punctuation characters in the edit token. The edit has been rejected to prevent corruption of the article text. This sometimes happens when you are using a buggy web-baed anonymous proxy service.


Maybe it is helpful to mention, that the wiki is adding the extra / every time I save a page.

Thanks for investigation and help


edit:
QuoteNeed to go to the office right now
Seems that my "highway to hell" is a little bit shorter. I have 5mins left and time for another coffee. Have a nice day

oblongmedulla

thanks for your help, i sent u a pm with a test account for my site to help troubleshoot.

Snakehit

I've been testing on http://www.ict-blue.be/wiki/Use_me for some hours to find the problem but there is it still working :O

I mean this has not really something to do with the bridge because there i'm running the bridge also without all the configurations we've done here. Just the installation that you can find online...

I will take a closer look this night.

oblongmedulla

Think it would have anything to do with what version of php we are running?
5.1.6-3.7.fc6

NoursoN

Quote from: oblongmedulla on January 09, 2008, 01:11:39 PM
Think it would have anything to do with what version of php we are running?
5.1.6-3.7.fc6


Same trouble here on a local Wampserver installation ( PHP V5.2.5) :-/

Snakehit

We are running 5.1.2. Could you please check this localsettings file with yours and try some things that are otherwise then yours?


<?php

# This file was automatically generated by the MediaWiki installer.
# If you make manual changes, please keep track in case you need to
# recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.

# If you customize your file layout, set $IP to the directory that contains
# the other MediaWiki files. It will be used as a base to locate files.
if( defined'MW_INSTALL_PATH' ) ) {
$IP MW_INSTALL_PATH;
} else {
$IP dirname__FILE__ );
}

$path = array( $IP"$IP/includes""$IP/languages" );
set_include_pathimplodePATH_SEPARATOR$path ) . PATH_SEPARATOR get_include_path() );

require_once( 
"$IP/includes/DefaultSettings.php" );

# If PHP's memory limit is very low, some operations may fail.
ini_set'memory_limit''20M' );

if ( 
$wgCommandLineMode ) {
if ( isset( $_SERVER ) && array_key_exists'REQUEST_METHOD'$_SERVER ) ) {
die( "This script must be run from the command line\n" );
}
}
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;

$wgSitename         "BlueWiki";

## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## If using PHP as a CGI module, use the ugly URLs
$wgScriptPath       "/wiki";
$wgScript           "$wgScriptPath/index.php";
$wgArticlePath      "$wgScriptPath/$1";
$wgRedirectScript   "$wgScriptPath/redirect.php";

#Snakehit FIXED BUG
#http://www.mediawiki.org/wiki/Manual:Short_URL/Problems_with_MediaWiki_1.11
$wgUsePathInfo  false;

## For more information on customizing the URLs please see:
## http://www.mediawiki.org/wiki/Manual:Short_URL

$wgEnableEmail      true;
$wgEnableUserEmail  true;

$wgEmergencyContact "[email protected]";

## For a detailed description of the following switches see
## http://www.mediawiki.org/wiki/Extension:Email_notification 
## and http://www.mediawiki.org/wiki/Extension:Email_notification
## There are many more options for fine tuning available see
## /includes/DefaultSettings.php
## UPO means: this is also a user preference option
$wgEnotifUserTalk true# UPO
$wgEnotifWatchlist false# UPO
$wgEmailAuthentication false;

$wgDBtype           "mysql";
$wgDBserver         "localhost";
$wgDBname           "wiki";
$wgDBuser           "wiki";
$wgDBpassword       "xxx";

# MySQL specific settings
$wgDBprefix         "mw_";

# MySQL table options to use during installation or update
$wgDBTableOptions   "TYPE=MyISAM";

# Experimental charset support for MySQL 4.1/5.0.
$wgDBmysql5 false;

# Postgres specific settings
$wgDBport           "5432";
$wgDBmwschema       "mediawiki";
$wgDBts2schema      "public";

## Shared memory settings
$wgMainCacheType CACHE_NONE;
$wgParserCacheType CACHE_NONE;
$wgMessageCacheType CACHE_NONE;
$wgMemCachedServers = array();
$wgJobRunRate 0.01;
$wgDisableCounters true

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads       false;
$wgAllowExternalImages true;
# $wgUseImageMagick = true;
# $wgImageMagickConvertCommand = "/usr/bin/convert";

## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
# $wgHashedUploadDirectory = false;

## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
$wgUseTeX           false;
$wgLocalInterwiki   $wgSitename;
$wgLanguageCode "nl";
$wgProxyKey "a35f86c1c9ef9f020fab8b743702bf1f2a188e7629a2c35849ff4badac805640";

## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
$wgDefaultSkin 'bluwiki_skin';

## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
# $wgEnableCreativeCommonsRdf = true;
$wgRightsPage ""# Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl "";
$wgRightsText "";
$wgRightsIcon "";
# $wgRightsCode = ""; # Not yet used

$wgDiff3 "";

# When you make changes to this configuration file, this will make
# sure that cached pages are cleared.
$configdate gmdate'YmdHis', @filemtime__FILE__ ) );
$wgCacheEpoch max$wgCacheEpoch$configdate );

#### SMF Authentication
#Snakehit (snakehit (at) gmail.com)

# For all non-logged in users
$wgGroupPermissions['*']['createaccount']   = false# This requires a user be logged into the wiki to make changes.
$wgGroupPermissions['*']['edit']            = false# Specify who may create new accounts: 0 means no, 1 means yes

# Users can use the login function inside of the wiki to login.
$wgUseWikiLogin false;

# Disable everything of caching, caching is boe for the login system.
$wgEnableParserCache false;
$wgCachePages false;

# This requires the link to SMF API. 
$wgSMFPathAPI"../smf_api.php" # The smf_api.php file can be download from SMF website and must be placed in rootdir of your forum)
$wgSMFPathSSI"../SSI.php" # The SSI.php file (watch capitals!) (normally in your rootdir of your forum)

// require the Auth_SMF.php
require_once './extensions/Auth_SMF.php';

$wgAuth = new Auth_SMF();  


Truly there are here some changes to get in touch with the .htaccess file like clean urls and stuff like that. But the problem must be in the localsettings.php file.


Is it possible to install one of you guys a complete clean installation of MediaWiki without the extension. Or delete my extension and try to run mediawiki. If you still have the problem it is somewhere else...

ianus

Greetings!

First I like to send a big "Thank you". Your help is really appreciated.

I have done what you asked for and run a complete clean installation of MediaWiki.
I download the latest release : mediawiki-1.11.0
During the installation, I leave all settings "as is" and add only the necessary things like user name, password, database_prefix,...

But I must say, that it is possible to use the markup without problems. Well, I'm not really surprised. The bridge is the only "mod" I have installed on my first (misbehaving) installation, because the SMF-login, as basis for wiki-edits, is essential.


The new installation can be found here:
http://www.firopolis.de/snakes/index.php/Hauptseite

I leave this installation alone until you have seen it like it is.

Furthermore I am not sure about the next step.

  • Undo the bridge-changes on my first (misbehaving) installation.
  • Leave the bridge-changes on my first (misbehaving) installation and add your files to the new installation again
  • Undo the bridge-changes on my first (misbehaving) installation and add your files only to the new installation.
  • Should I try to use the new LocalSettings for the old installation
  • Something else?

Advertisement: