I just threw together a simple tag extension to embed a twitter live stream search widget from
http://twitter.com/about/resources/widgets/widget_search
in a wiki page. It just takes the following parameters from $input:
title=<title>
subject=<subject>
query=<query>
These get dropped into a <script> that is returned. It works, but now I'm wondering what I should do to sanitize the values of title, subject, and query. I don't want to just use In the js, the values are all inside single quotes. I was thinking that I would use strip_tags combined with substituting single quotes with '
preg_replace('/\W/', '', $t)
would disallow hashtags and @'s, right?
Jim
=====================================
Jim Hu
Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054
Hello listmates,
How do I make it so that no one gets to become a user unless they are
cleared by an administrator of the MW installation?
Thanks.
Boris.
Hello,
I would like to include special signs in my new 1.19 Mediawiki
installation, but they are showing not right. I have 200 *.doc files which
need to be indexed all into one MW Installation.
http://s14.directupload.net/images/120508/ooantyz5.jpg
So How can realize, that the signs are getting included aswell?
Your help is highly appreciated
I have been getting this error for the last few days when I try to
download an extension from Mediawiki. Since other downloads are working
OK I am wondering if there is a problem with the server. Linux system.
FYI
frosty
Volunteer Marcin Cieslak (saper) is doing the great service of leading a
Git and Gerrit tutorial on May 8th 19:00 UTC. It will be 1-1.5 hours.
If you intend to come, please fill out this poll so saper knows how many
people are coming and what they already know.
http://doodle.com/qnrgibpqxyamqhzb
Time conversion:
http://doodle.com/r?url=http%3A%2F%2Ftimeanddate.com%2Fworldclock%2Ffixedti…
To participate, you'll need to:
* get developer access for Git/Gerrit/Wikimedia Labs
https://www.mediawiki.org/wiki/Developer_access
* install a SIP client ("Blink and CSipSimple for Android are
recommended and tested (with HD audio); I'll provide SIP dial-in")
* install vncviewer
* ensure you can ssh from a terminal
Marcin will cover:
Basics:
setting up Git
submitting a patch
commenting on a patch in Gerrit
merging a patch in Gerrit
enough Git internals not to get lost
Branching:
local branch, making, working & pushing
remote branch & git-review to that remote branch
Troubleshooting:
cherrypick changes between branches
amending (rebase vs multiple commit)
squashing work from a branch into a commit and pushing it
resolve merge conflicts
Thanks, Marcin!
--
Sumana Harihareswara
Engineering Community Manager
Wikimedia Foundation
Hi, when I try to use
----------
{{ {{{|safesubst:}}}ifsubst |<includeonly>{{subst:Unsubst|Citation needed|
name|{{{name|¬}}}|reason|{{{reason|¬}}}|
date|{{{date|{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}}
}}</includeonly>|
{{Fix
|name={{{name|Citation needed}}}
|link=Wikipedia:Citation needed
|text=citation needed
|class=Template-Fact
|title=This claim needs references to reliable sources
|date={{{date|}}}
|cat=[[Category:All articles with unsourced statements]]
|cat-date=Category:Articles with unsourced statements
}}
}}
-----------
which is copied directly from wikipedia, and which works perfectly in my
wikipedia sandbox, all I get at my own wiki is (in red):
Template:Ifsubst<http://www.phaust.dk/wiki/index.php?title=Template:Ifsubst&action=edit&redl…>
We are using Mediawiki 1.17.0, if that makes any difference. I've tried
searching for various things on the mediawiki-wiki, but it all seems to be
standard commands?
I hope some one can clear it up :)
Kaare
Hello.
I try to implement my own authorization scheme - connect MediaWiki to
the user database of my other site.
When someone is logged into my portal, and he has an account in
MediaWiki, I want him to be logged into MediaWiki.
As a first step to achieve this, I wanted to do an autologin of
Pmuszynski. This is my function attaced to UserLoadFromSession hook:
function pmUserAuth($user, &$result) {
$user = User::NewFromName('Pmuszynski');
$id = User::idFromName('Pmuszynski');
$user->setId( $id );
$user->loadfromId();
wfSetupSession();
$user->setCookies();
$user->setToken();
$user->saveSettings();
$user->saveToCache() ;
$result = true;
return true;
};
But I'm getting following error on entering Wiki:
Warning: array_merge(): Argument #1 is not an array in
/wiki/includes/User.php on line 2298 Warning: array_unique() expects
parameter 1 to be array, null given in /wiki/includes/User.php on line
2298 Warning: Invalid argument supplied for foreach() in
/wiki/includes/User.php on line 3472 Warning: Invalid argument supplied
for foreach() in /wiki/includes/User.php on line 3481 MediaWiki internal
error.
What am I missing?
Thanks for any help :-)
Pawel
Hello all.
Our problem is this: a user "U1", having permission for a namespace "N1", bellonging to a group "G1" and having edit a page "N1:PAGE1" can not move a page from the custom namespace "N1" to a custom namespace "N2", after we (as sysop) indicate across user right management, that this user "U1" is a member of the group "G2" allowed to "play" in this custom namepace "N2".
When we go in user right management, checking "U1" rights, we see that a sentence indicates "U1" bellongs to "G2", "G1", "user", "emailconfirmed", and to "autoconfirmed" groups. BUT: the boxes are not marked for "G2" and "G1".
You will find bellow the code for our permissions and namespace settings.
What did we wrong ?
Thanks a lot for your help. We are blocked with this.
Antoine
--------------------------- bellow our permissions and namespace settings ----------------
# *********************************************************************
# 2. PERMISSIONS FOR ANONYMOUS
# *********************************************************************
# ---------------------------------------------------------------------
# 2.1 RESTRICTIONS TO ANONYMOUS FOR READING, EDITING CREATING ACCOUNT
# ---------------------------------------------------------------------
# source
# http://www.mediawiki.org/wiki/Manual:Preventing_access
$wgGroupPermissions['*']['read'] = false; // Disable reading by anonymous users
$wgGroupPermissions['*']['edit'] = false; // Disable anonymous editing
$wgGroupPermissions['*']['createaccount'] = false; // Prevent new user registrations except by sysops
$wgWhitelistRead = array ( "Special:Userlogin"); // But allow them to access the login page
# Just add new pages to be read in brakets, after a "," and between "-"
# COMMENT/DECOMMENT NEXT TO ALLOW READ MAIN PAGE, LOGIN, HELP english pages
# $wgWhitelistRead = array ( "Main Page", "Special:Userlogin", "Help:Contents");
# Like previous, but for French (be careful of encoding! save file as UTF-8!)
# $wgWhitelistRead = array( ":Page Principale", "Special:Userlogin", "Aide en français");
# ---------------------------------------------------------------------
# 2.2 FIRST LOGIN
# ---------------------------------------------------------------------
# Source:
# http://www.mediawiki.org/wiki/Manual:User_rights#Examples
# 2.2.1 RESTRICT EDITING TO CONFIRMED USERS ONLY
# ---------------------------------------------------------------------
# Disable for users, too: by default 'user' is allowed to edit, even if '*' is not.
$wgGroupPermissions['user']['edit'] = false;
# Make it so users with confirmed e-mail addresses are in the group
$wgAutopromote['emailconfirmed'] = APCOND_EMAILCONFIRMED;
# Hide group from user list.
$wgImplicitGroups[] = 'emailconfirmed';
# Finally, set it to true for the desired group.
$wgGroupPermissions['emailconfirmed']['edit'] = true;
# 2.2.1 ADD MESSAGE TO THE LOGIN FORM
# ---------------------------------------------------------------------
# Add a message on top of the login form, to indiquate who to contact to ask for a login access:
function efLoginFormMessage( &$template )
{
$template->set( 'header', "Free creating account process will be soon available. While this to append, and if you wish to get an account, please send a email to smallwindturbineproj.contactor (/-\ -|-) gmail ( [)°-|- ) com INCLUDING ONLY in the subject bar of your message, this group of words (inside brackets, numbers included): {1 blue planet 1}. Other demands will not arrive to us. ");
return true;
}
$wgHooks['UserLoginForm'][]='efLoginFormMessage';
# 2.2.3 EMAIL CONFIRMATION REQUIREMENT
# ---------------------------------------------------------------------
$wgEmailConfirmToEdit = true;
# 2.2.4 BLACKLIST AGAINST SPAM
# ---------------------------------------------------------------------
# Blacklist links towards spammer or malicious url
require_once( "$IP/extensions/SpamBlacklist/SpamBlacklist.php" );
$wgSpamBlacklistFiles = array(
"http://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ve…", // Wikimedia's list
// database title
"DB: wikidb MediaWiki:Spam-blacklist",
);
# *********************************************************************
# 6. ACCESS AND CUSTOMIZATION OF NAMESPACES
# *********************************************************************
# ---------------------------------------------------------------------
# 6.1 LOGIC OF NAMESPACE
# ---------------------------------------------------------------------
# space 1: MAIN + PROJECT + CATEGORY: for governwriters
# space 2: TEMPLATE : for wikidesigners
# space 3: HELP : for wikiteachers
# space 4: INCUB : for incubators
# space 5: CONTRIBOX : for firstcontributors
# space 6: DRAFT : for users with email confirmed
# space 7: SANDBOX : for users with email confirmed
# spaces 4, 5, 6, 7 are custom namespaces
# sysop, bureaucrat and moderators can act in all wiki spaces
# common users can play in space 6 and 7, as they want
# the sandbox is open to any users
# sandbox is placed in SANDBOX space
# talk pages are accessible for all
# Users start with Sandbox or Draft and then with Contrib
# Sysop and bureaucrats can change user from one group to others
# ---------------------------------------------------------------------
# 6.2 CREATION OF CUSTOM NAMESPACES
# ---------------------------------------------------------------------
# list of indices of custom naspaces
# CONTRIBOX : 600
# INCUB : 700
# DRAFT : 800
# SANDBOX : 900
# source: http://www.mediawiki.org/wiki/Manual:$wgNamespaceProtection
# 6.2.1 defining custom namespaces
# ---------------------------------------------------------------------
define("NS_CONTRIBOX", 600);
define("NS_CONTRIBOX_TALK", 601);
define("NS_INCUB", 700);
define("NS_INCUB_TALK", 701);
define("NS_DRAFT", 800);
define("NS_DRAFT_TALK", 801);
define("NS_SANDBOX", 900);
define("NS_SANDBOX_TALK", 901);
# 6.2.2 giving extranames to namespaces
# ---------------------------------------------------------------------
$wgExtraNamespaces = array
(
600 => "Contrib",
601 => "Contrib_talk",
700 => "Incub",
701 => "Incub_talk",
800 => "Draft",
801 => "Draft_talk",
900 => "Sandbox",
901 => "Sandbox_talk",
);
# 6.2.4 unable subpages for custom namespaces
# ---------------------------------------------------------------------
$wgNamespacesWithSubpages[NS_CONTRIBOX] =
$wgNamespacesWithSubpages[NS_INCUB] =
$wgNamespacesWithSubpages[NS_DRAFT] =
$wgNamespacesWithSubpages[NS_SANDBOX] = true;
# 6.2.5 include content of namespaces in statistics
# ---------------------------------------------------------------------
$wgContentNamespaces[] = 600;
$wgContentNamespaces[] = 700;
$wgContentNamespaces[] = 800;
$wgContentNamespaces[] = 900;
# ---------------------------------------------------------------------
# 6.3 PERMISSIONS FOR SPACE 1
# ---------------------------------------------------------------------
# permission if given only to group of people with rights called
# govern-edit
$wgNamespaceProtection[NS_MAIN] =
$wgNamespaceProtection[NS_PROJECT] =
$wgNamespaceProtection[NS_CATEGORY] = array( 'govern-edit' );
# right is given only to
# sysop, bureaucrat, moderators, governwriters
$wgGroupPermissions['sysop']['govern-edit'] = true;
$wgGroupPermissions['bureaucrat']['govern-edit'] = true;
$wgGroupPermissions['moderators']['govern-edit'] = true;
$wgGroupPermissions['governwriters']['govern-edit'] = true;
# ------------------------------
# Configuration of space 2:
# ------------------------------
# only people with
# wkdesign-edit
# rights can play in space 2
$wgNamespaceProtection[NS_TEMPLATE] = array( 'wkdesign-edit' );
# sysop, bureaucrat, moderators and
# wikidesigners, have
# 'wkdesign-edit' rights
$wgGroupPermissions['sysop']['wkdesign-edit'] = true;
$wgGroupPermissions['bureaucrat']['wkdesign-edit'] = true;
$wgGroupPermissions['moderators']['wkdesign-edit'] = true;
$wgGroupPermissions['wikidesigners']['wkdesign-edit'] = true;
# ------------------------------
# Configuration of space 3:
# ------------------------------
# only people with
# wkteach-edit
# rights can play in space 3
$wgNamespaceProtection[NS_HELP] = array( 'wkteach-edit' );
# sysop, bureaucrat, moderators and
# wikiteachers, have
# 'wkteach-edit' rights
$wgGroupPermissions['sysop']['wkteach-edit'] = true;
$wgGroupPermissions['bureaucrat']['wkteach-edit'] = true;
$wgGroupPermissions['moderators']['wkteach-edit'] = true;
$wgGroupPermissions['wikiteachers']['wkteach-edit'] = true;
# ------------------------------
# Configuration of space 4:
# ------------------------------
# only people with
# incub-edit
# rights
$wgNamespaceProtection[NS_INCUB] = array( 'incub-edit' );
# sysop, bureaucrat, moderators and
# incubators, have
# 'incub-edit' rights
$wgGroupPermissions['sysop']['incub-edit'] = true;
$wgGroupPermissions['bureaucrat']['incub-edit'] = true;
$wgGroupPermissions['moderators']['incub-edit'] = true;
$wgGroupPermissions['incubators']['incub-edit'] = true;
// Permissions for 'incubators'
$wgGroupPermissions['incubators']['move'] = true;
$wgGroupPermissions['incubators']['move-subpages'] = true;
$wgGroupPermissions['incubators']['move-rootuserpages'] = true; // can move root userpages
$wgGroupPermissions['incubators']['read'] = true;
$wgGroupPermissions['incubators']['edit'] = true;
$wgGroupPermissions['incubators']['createpage'] = true;
$wgGroupPermissions['incubators']['createtalk'] = true;
$wgGroupPermissions['incubators']['writeapi'] = true;
$wgGroupPermissions['incubators']['upload'] = true;
$wgGroupPermissions['incubators']['reupload'] = true;
$wgGroupPermissions['incubators']['reupload-shared'] = true;
$wgGroupPermissions['incubators']['minoredit'] = true;
$wgGroupPermissions['incubators']['purge'] = true; // can use ?action=purge without clicking "ok"
$wgGroupPermissions['incubators']['sendemail'] = true;
# ------------------------------
# Configuration of space 5:
# ------------------------------
# only people with
# contrib-edit
# rights
$wgNamespaceProtection[NS_CONTRIBOX] = array( 'contrib-edit' );
# sysop, bureaucrat, moderators and
# firstcontributors, have
# 'contrib-edit' rights
$wgGroupPermissions['sysop']['contrib-edit'] = true;
$wgGroupPermissions['bureaucrat']['contrib-edit'] = true;
$wgGroupPermissions['moderators']['contrib-edit'] = true;
$wgGroupPermissions['incubators']['contrib-edit'] = true;
$wgGroupPermissions['firstcontributors']['contrib-edit'] = true;
// Permissions for 'firstcontributors'
$wgGroupPermissions['firstcontributors']['move'] = true;
$wgGroupPermissions['firstcontributors']['move-subpages'] = true;
$wgGroupPermissions['firstcontributors']['move-rootuserpages'] = true; // can move root userpages
$wgGroupPermissions['firstcontributors']['read'] = true;
$wgGroupPermissions['firstcontributors']['edit'] = true;
$wgGroupPermissions['firstcontributors']['createpage'] = true;
$wgGroupPermissions['firstcontributors']['createtalk'] = true;
$wgGroupPermissions['firstcontributors']['writeapi'] = true;
$wgGroupPermissions['firstcontributors']['upload'] = true;
$wgGroupPermissions['firstcontributors']['reupload'] = true;
$wgGroupPermissions['firstcontributors']['reupload-shared'] = true;
$wgGroupPermissions['firstcontributors']['minoredit'] = true;
$wgGroupPermissions['firstcontributors']['purge'] = true; // can use ?action=purge without clicking "ok"
$wgGroupPermissions['firstcontributors']['sendemail'] = true;
/////////////////////////////////////////////////////////////////////////////
# next is UNCOMMENT because, space 6 and 7 should be accessible for everyone
# ------------------------------
# Configuration of space 6: // every user can, so no need to restrict
# ------------------------------
# only people with
# draft-edit
# rights can play in space 6
# $wgNamespaceProtection[NS_DRAFT] = array( 'draft-edit' );
# sysop, bureaucrat and
# emailconfirmed, have
# 'draft-edit' rights
# $wgGroupPermissions['sysop']['draft-edit'] = true;
# $wgGroupPermissions['bureaucrat']['draft-edit'] = true;
# $wgGroupPermissions['moderators']['draft-edit'] = true;
# $wgGroupPermissions['firstcontributors']['draft-edit'] = true;
# $wgGroupPermissions['incubators']['draft-edit'] = true;
# $wgGroupPermissions['user']['draft-edit'] = true;
# ------------------------------
# Configuration of space 7: // every user can, so no need to restrict
# ------------------------------
# only people with
# draft-edit
# rights can play in space 6
# $wgNamespaceProtection[NS_SANDBOX] = array( 'sand-edit' );
# sysop, bureaucrat and
# emailconfirmed, have
# 'sand-edit' rights
# $wgGroupPermissions['sysop']['sand-edit'] = true;
# $wgGroupPermissions['bureaucrat']['sand-edit'] = true;
# $wgGroupPermissions['firstcontributors']['sand-edit'] = true;
# $wgGroupPermissions['moderators']['sand-edit'] = true;
# $wgGroupPermissions['incubators']['sand-edit'] = true;
# $wgGroupPermissions['user']['sand-edit'] = true;
#
# END OF : CUSTOMISATION OF NAMESPACES ACCESS
# ////////////////////////////////////////////////////////