Project:Support desk

Jump to: navigation, search

About this board

vde   Welcome to MediaWiki.org's Support desk, where you can ask MediaWiki questions!

There are also other places where to askCommunication: IRCCommunication#Chat, mailing listsMailing lists, Q&A etc.

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • MediaWiki
    • PHP
    • Database
  2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
  3. To start a new thread, click "Start a new topic".
By clicking "Add topic", you agree to our Terms of Use and agree to irrevocably release your text under the CC BY-SA 3.0 License and GFDL

Create new page by Perl via MediaWiki::API

3
JanTappenbeck (talkcontribs)

I want to create simple pages in a company-wiki by Perl. In reposetory i found the modul MediaWiki::API - but not a simple example to create a page.

can someone help to me ?

MarkAHershberger (talkcontribs)

This is really a question for the maintainer of the CPAN module (Jools Wills), but there is an example in the documentation that may help. Note I have not tested this.

use MediaWiki::API;

my $mw = MediaWiki::API->new();
$mw->{config}->{api_url} = 'YOUR-API-URL';

# log in to the wiki
$mw->login( { lgname => 'username', lgpassword => 'password' } )
    || die $mw->{error}->{code} . ': ' . $mw->{error}->{details};

my $pagename = "Project:Sandbox";
my $ref = $mw->get_page( { title => $pagename } );
$mw->edit( {
      action => 'edit',
      title => $pagename,
      text => "Additional text"
} ) || die $mw->{error}->{code} . ': ' . $mw->{error}->{details};

If you try that, does it work? If not, what problems do you run into?

JanTappenbeck (talkcontribs)

thanks and first i try to login - but get following message:

2: Failed to decode JSON returned by http://ma22-wiki-001/eblwiki/api.php Decoding Error: malformed JSON string, neither tag, array, object, number, string or atom, at ch aracter offset 0 (before "\x{feff}{"login":{"r...") at C:/strawberry/perl/site/l ib/MediaWiki/API.pm line 400.

in other websites the reason will be declare by wrong api.php-url - but when i call the url in browser i get the dokumentation-side like http://www.exotica.org.uk/mediawiki/api.php but with xml source at the beginning and and like:

<?xml version="1.0"?> <api>

 <error code="help" info="" xml:space="preserve">

i use 1.23.5 of mediawiki.

Reply to "Create new page by Perl via MediaWiki::API"
178.114.20.135 (talkcontribs)

Good day,

The wiki of whonix.org is using the MediaWiki software, as well as the accompanying language extension bundle with its language selector. However, noone really knows how to use it. And after reading through the guidelines written on the "mediawiki wiki", I still am unable to understand it. As far as I could gather, to translate a page, each section of text needs to be surrounded by the <language> tag. However, doing so simply doesn't work. The tags just appear in the text, as if they would serve no purpose. Also, adding the language selector, by using the <languages /> tag, doesn't work either. Only the homepage, was affected by these changes, however other sites of the forum seem to be unaffected.

If someone would be able to explain, what I'm doing wrong, I would be more than thankful.

Have a nice day,

Ego

178.114.20.135 (talkcontribs)

Good day,

I've just had a nice chat with some on the IRC chat. They recommended I should try copying the contents of a page where it does work on a page where it doesn't, to see, whether it would then work. Sadly, the answer is no. No matter what we do the language selector seems to be weirdly selective (no pun intended) about where it works and where it doesn't.

If someone could help me with this, I would be more than grateful.

Have a nice day.

Ego

MarkAHershberger (talkcontribs)

Did you talk to nikerabbit or siebrand in #mediawiki-i18n about this? I don't have any experience with the language bundle, myself.

180.191.122.158 (talkcontribs)

_SF NCCA _FP, Please support claim Word double AA and AddWord's "S" Filipinised NCCA Constitution of NC_aditional down center across slide of "S" the Country Sound's of _CA

NCSCA- National Communittee Sound's Culture and Art's

The claim of double AA sign of last name A._._A hide of words L-igion D-emocracy

A-ssociation (A.S.F)

L-egion

D-emocracy of

A-thority (A.F.P)

Reply to "How does translating work?"
Serena Eclipse (talkcontribs)

Greetings everyone. Im just seeking some help. Im veey new to this software and cant do much without guides quite yet. I found this link http://thread.gmane.org/gmane.org.wikimedia.mediawiki/41614/focus=41697 but im honestly unsure of how to implement anything suggested. I had the link to my wiki available for maybe 1 day before it was slammed with trash pages and bots. Bots registering and posting trash. Im not sure if any anonomous bots have created any pages. I just want it to stop and to clean the wiki. Is there a quick way I can delete all the spam pages and bots? I do have some legitimate users so I believe purging the database is not a good idea. Any help including telling me how to implement the sigges

88.130.117.48 (talkcontribs)

Hi!

Manual:Combating spam and Manual:Combating vandalism have an overview on the topic.

If you know, which users are legitimate, it could be an idea to create a list with all spam users and remove all contributions by these users. Another idea would be, if you have a list of spam pages, to delete all those pages. The latter can be done by Extension:Nuke.

Reply to "Fresh Wiki with over 500+ bot accounts."

How can i delete the files for ever, which are located in image/deleted

3
95.172.68.155 (talkcontribs)

Software Version MediaWiki 1.22.3

PHP 5.4.20 (apache2handler)

MariaDB 5.5.33-MariaDB

My wiki isn't available in the Internet, only intranet. Sorry.

My question is:

We deleted a lot of old files from our wiki, because it wasn't connected and needed any more. Now we would like to do some maintenance and remove the deleted files from the "images/deleted" Folder.

Can i do just rm -r * in "images/deleted" Folder or is there some maintenance tool available for that? And what does the wiki say, when the file is deleted on the filesystem?

Thank you in advance for help.

Daniel

from Essen, Germany.

MarkAHershberger (talkcontribs)

You can test this out yourself by just moving the files out of the way initially. For example, log in with a sysop account and visit a deleted image's file page. Then, in a shell:

$ cd $IP/images
$ mv deleted not-yet-deleted

Now reload the page in your browser -- add ?action=purge to be sure you're seeing something up-to-date -- and see how the page's appearance has changed.

You should also log out of the wiki and see if there is a noticeable problem for less privileged users of the site.

If everything is good, then you can really delete the images. If there is a problem, you can move them back to the deleted folder.

88.130.117.48 (talkcontribs)

The maintenance script deleteArchivedFiles.php does what you want.

Greetings from ... Essen, btw. :-)

Reply to "How can i delete the files for ever, which are located in image/deleted"

Updating a Realy Realy old version (1.15)

7
Summary by MarkAHershberger

Don't forget to update php, too!

Jessemcternan (talkcontribs)

I would like to update my local wiki to the most up-to-date version. The majority of the webpages on this topic I found were for version much newer than mine. Can this level of upgrade even be done? I have quite a bit of information that I don't want to manually re-enter.

MediaWiki 1.15.1
PHP 5.3.2-1ubuntu4.30 (apache2handler)
MySQL 5.1.73-0ubuntu0.10.04.1

My wiki is local. I don't have a link for anyone to follow.

Thank you very kindly for your help.

88.130.95.230 (talkcontribs)

Hi Jesse!

Yes, what you want is possible.

It is important that you make sure you have a working backup of your wiki: The database and the files. Put that on an external disk, unplug it and keep it far away from your actual computer. After that you can try the upgrade and you won't loose anything, should you screw up.

Here is a complete guide on how to upgrade: Upgrade!

If you have further questions, do not hesitate to ask!

Florianschmidtwelzow (talkcontribs)

Hi! First: Good decision to upgrade, MediaWiki 1.15 is already unsupported for a long time :P

You should following the Upgrade tutorial when upgrading. In the FAQ section you'll find a question "How do I upgrade from a really old version? In one step, or in several steps?" :) If you have any specific problem when upgrading, feel free to ask here!

Btw.: You should really really do a backup, it's always possible, that data will be lost after or during an upgrade, even if the last 999 upgrades went fine :)

Please remember, that the latest MediaWiki version needs at least PHP 5.3.2, so you have to upgrade your php version, too.

88.130.95.230 (talkcontribs)
Please remember, that the latest MediaWiki version needs at least PHP 5.3.2, so you have to upgrade your php version, too.

Oh, that's right and not right at the same time. :-) MediaWiki 1.25 in fact needs PHP 5.3.3 at least. That means, if Jesse wants to upgrade to 1.25, he will in fact need to upgrade PHP as well. I missed that. However, according to Compatibility#PHP, MediaWiki 1.24 will work nicely also with PHP 5.3.2.

So for MediaWiki 1.25, a PHP upgrade would be necessary. MediaWiki 1.25 is working nicely also on newer PHP versions; e.g. for Ubuntu, PHP 5.5 is available. This version can be used to run MediaWiki on it.

Florianschmidtwelzow (talkcontribs)

> to the most up-to-date version

:D :P But you're right, 1.24 would work :)

Jessemcternan (talkcontribs)

UPDATE (and thanks for your support so far):

- I backed up my config files, extensions, and images

- I then updated to Ubuntu 12 (from 10). The wiki was still working!

- Then (curse my brash impatience) I updated to Ubutnu 14

Now, the wiki is not found, "Not Found  The requested URL /mediawiki/ was not found on this server."

Any suggestions? I should have stayed with Ubuntu 12...

-

My current Setup:

PHP 5.5.9-1ubuntu4.12

mysql  Ver 14.14 Distrib 5.5.44, for debian-linux-gnu (x86_64) using readline 6.3

Apache/2.4.7 (Ubuntu)

88.130.117.48 (talkcontribs)

Hi!

I guess the Ubuntu upgrade has also upgraded the Apache webserver, right? In that case, I think that something in the server configuration is missing now... Maybe the webroot is pointing to a wrong path now or a virtual host configuration (I don't know if you used one in your old Ubuntu version) is missing.

Reply to "Updating a Realy Realy old version (1.15)"

Approved Revs: Allowing the creators of a page to approve their own content

1
Jaisonmb (talkcontribs)

Hello,

First I apologize if this seems to be a repetitive question however, I have been searching and testing numerous things for a few weeks now. My organization is currently using the ApprovedRevs format of MediaWiki which I understand means that users with Admin/Bureaucrat permissions can approve newly created wiki pages as well as any/all revisions. However, the amount of approvals is getting rather big as more and more of our organization is taking advantage of this wonderful tool so we would like the creator/owner of a wiki page to be able to approval revisions themselves. We do NOT want everyone to be given admin/Bureaucrat permissions as to avoid users going to other pages they did NOT create and editing them whether accidently or on purpose. I have implanted many commands and lines of syntax to try and allow this including the below lines however, I can not seem to get the desired results. Can anyone assist? Thank you very much, Jaison

$egApprovedRevsAutomaticApprovals= false;

$egApprovedRevsApproveLatest = True;

$egApprovedRevsBlankIfUnapproved = True;

$egApprovedrevsSelfOwnedNamespace[] = array (NS_Main, NS_USER)

Reply to "Approved Revs: Allowing the creators of a page to approve their own content"
Summary by MarkAHershberger

TrainCraft, formerly Trains and Zeppelin mod, is a Mincraft mod. This page here however is the Support Desk for MediaWiki.

2A02:A03F:EDA:2B00:64A4:226D:CDA0:F94D (talkcontribs)

Hellow,

Are you working on a version traincraft rotatable on a servuer in 1.7.10 ???

Thanks.

88.130.80.141 (talkcontribs)

TrainCraft, formerly Trains and Zeppelin mod, is a Mincraft mod. This page here however is the Support Desk for MediaWiki, the software used to run wikis like Wikipedia. We are not associated with the developers of the aforementioned mod.

If you have questions on that mod, you should ask the mod developers!

Lmaltier (talkcontribs)

Hello!

I use an internal wiki shared by a small team. When I try to confirm my e-mail address, I don't receive anything. I suspect the reason might be that we use a secure http server, and that the Http user and password must be provided when the software sends a mail.

Which parameters should be used in such a case in Mediawiki parameter files, and in which files?

Thanks

Lmaltier (talkcontribs)

No idea? I would have expected to find this information in Manual:Configuration_settings but I can't find it.

Ciencia Al Poder (talkcontribs)

Email auth should be provided in Manual:$wgSMTP. You can also set a debug log to see what's happening when the mail is sent.

Lmaltier (talkcontribs)

Thanks. I should have found it...

Reply to "HTTP user and password parametrization"

[RESOLVED] How can I hide tabs for users not logged in?

49
Summary by Ciencia Al Poder

Please open a new thread if none of the solutions provided on this thread works for you, explaining what have you tried so far

Holygamer (talkcontribs)

My Versions: MediaWiki: 1.16.5, PHP: 5.2.17, MySQL: 5.1.61

I'm using the Vector skin. I would like to hide the following tabs to people who do not have the right to use them. Is there any way to do this?

Discussion, View History, Edit, Arrow

This post was posted by Holygamer, but signed as Stoped and deleted all :Holygamer.

SVG (talkcontribs)

The following is simple CSS but it should work:

$wgHooks['SkinTemplateSetupPageCss'][] = 'wfHideVariousTabsFromAnonymous';

function wfHideVariousTabsFromAnonymous( &$hidetabcss ) {
	global $wgUser;

	if ( !$wgUser->isLoggedIn() ) {
		$hidetabcss .= 'li#ca-history, li#ca-viewsource, li#ca-edit, li#ca-talk, .vectorMenu { display: none; }';
	}

	return true;
}
Holygamer (talkcontribs)

Thanks but that only hides the tabs. The tabs are still there in the code. Is there any way to make the tabs not show in the first place and where should I put the code in the Vector skin? Thanks

Jasper Deng (talkcontribs)

I think there's an extension for this, but somehow I don't remember what it is.

SVG (talkcontribs)

There is no extension but there might be hooks that could be used. I'll look for it tomorrow.

Jasper Deng (talkcontribs)

What gives me this idea is that Hurricane Electric's wiki (found somewhere on he.net) succeeds in hiding all the special pages and all the tabs.

SVG (talkcontribs)

LQT hides various tabs so I'll take a look inside its files. It's maybe in /mediawiki/trunk/extensions/LiquidThreads/classes/Dispatch.php but I just took a short look.

Holygamer (talkcontribs)

The DynamicTabs extension only works on the Monobook skin.

Jasper Deng (talkcontribs)

and the HE wiki uses Monobook. However, it looks like SVG might be able to make this a wholly new extension.

SVG (talkcontribs)

Can be catched up by:

$wgHooks['SkinTemplateNavigation'][] = 'fnHideVariousTabsFromAnonymousVector';

function fnHideVariousTabsFromAnonymousVector( SkinTemplate &$sktemplate, array &$links ) {
	// the old '$content_actions' array is thankfully just a
	// sub-array of this one
	fnHideVariousNamespaceTabsFromAnonymous( $sktemplate, $links['namespaces'] );
	fnHideVariousActionTabsFromAnonymous( $sktemplate, $links['views'] );
	return true;
}
Jasper Deng (talkcontribs)

It would be great if all users knew it; since they don't, an extension is a better way of presenting this to users. Perhaps include in Extension:Vector?

SVG (talkcontribs)

I'll write a short code, just not today because I'm currently in several spoken conversations (one after the other).

79.183.171.204 (talkcontribs)

Hi, I did this in Common.css:

<?php global $wgUser; if( !$wgUser->isAllowed('edit') ) { ?>

     <style type="text/css">
       #ca-watch { display: none !important; }
     </style> 
   <?php } ?>

But still see all tabs. What can be wrong? Thanks.

MarkAHershberger (talkcontribs)

Next time, please start a new thread.

Next, are you putting PHP code in your MediaWiki:Common.css page? That'll never work.

90.212.81.76 (talkcontribs)

Hi please could you upgrade from Mediawiki 16.5 to Mediawiki 1.19.8 please because Mediawiki 1.165 is now unsupported

SVG (talkcontribs)

Here it is for Vector skin. And don't remove my name, it's a real extension. Just create HideVariousTabsFromUnauthorizedUsers.php, put this code into it, include it in LocalSettings.php and if anonymous users DON'T have edit permission, it'll work. Actions at the arrow shouldn't need to be removed because I can't see an action shown under the arrow that can be executed by anonymous users with default or restricted permissions.

<?php
/**
* HideVariousTabsFromUnauthorizedUsers
*
* @package MediaWiki
* @subpackage Extensions
*
* @author: Tim 'SVG' Weyer <t.weyer@ymail.com>
*
* @copyright Copyright (C) 2012 Tim Weyer
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*
*/

$wgExtensionCredits['other'][] = array(
	'path'           => __FILE__,
	'name'           => 'HideVariousTabsFromUnauthorizedUsers',
	'author'         => array( 'Tim Weyer' ),
	'url'            => 'https://www.mediawiki.org/wiki/User:SVG',
	'description'    => 'Disables various view and namespace tabs from users without <tt>edit</tt> permission for Vector skin',
	'version'        => '04-12-2012',
);

// Hooks
$wgHooks['SkinTemplateNavigation'][] = 'fnHVTFUUremoveTabsFromVector';

// Tabs of view to remove
$wgHVTFUUviewsToRemove = array( 'view' /* read */, 'edit', 'addsection' /* on talkpages */, 'history' );

/**
 * @param $sktemplate Title
 * @param $links
 * @return bool
 */
function fnHVTFUUremoveTabsFromVector( SkinTemplate &$sktemplate, array &$links ) {
	global $wgUser, $wgHVTFUUviewsToRemove;

	// Only remove tabs if user isn't allowed to edit pages
	if ( $wgUser->isAllowed( 'edit' ) ) {
		return false;
	}

	// Generate XML IDs from namespace names
	$subjectId = $sktemplate->mTitle->getNamespaceKey( '' );

	// Determine if this is a talk page
	$isTalk = $sktemplate->mTitle->isTalkPage();

	// Remove talkpage tab
	if ( $subjectId == 'main' ) {
			$talkId = 'talk';
	} else {
			$talkId = "{$subjectId}_talk";
	}
	if ( !$isTalk && $links['namespaces'][$talkId] )
		unset( $links['namespaces'][$talkId] );

	// Remove actions tabs
	foreach ( $wgHVTFUUviewsToRemove as $view ) {
		if ( $links['views'][$view] )
			unset( $links['views'][$view] );
	}

	return true;
}
Holygamer (talkcontribs)

Works perfectly. Thanks. However the View Source tab still shows. Although you don't need permission to view that tab I would like to remove it as it's wasteful to Search Engine Optimization.

SVG (talkcontribs)

Sorry, forgot this tab because I didn't remove the edit permission when I was coding it. Just add 'viewsource' to $wgHVTFUUviewsToRemove array and it should work.

Jasper Deng (talkcontribs)

A long extension name at that :)

SVG (talkcontribs)

Yes, thought the same when I gave it its name. I just wanted to use a very meaningful name ^^

Bjoern~mediawikiwiki (talkcontribs)

Which version of mediawiki is this for?

I think I've followed the instructions above, but get an internal server error on

        // Generate XML IDs from namespace names
        $subjectId = $sktemplate->mTitle->getNamespaceKey( '' );
        // Determine if this is a talk page
        $isTalk = $sktemplate->mTitle->isTalkPage();

This post was posted by Bjoern~mediawikiwiki, but signed as Bjoern.

SVG (talkcontribs)

I've coded it in MediaWiki 1.17.0. Due to Holygamer's testimony, it does also work with MediaWiki 1.16.5 and I've checked both Vector.php. It might not work with MediaWiki 1.18, the code of Vector.php is quite different.

Cheeyang (talkcontribs)

For MediaWiki 1.19, try this:

function fnHVTFUUremoveTabsFromVector( SkinTemplate &$sktemplate, array &$links ) {
        global $wgUser, $wgHVTFUUviewsToRemove;

        // Only remove tabs if user isn't allowed to edit pages
        if ( $wgUser->isAllowed( 'edit' ) ) {
                return false;
        }

        // Remove talkpage tab
        if ( isset( $links['namespaces']['talk'] ))
                unset( $links['namespaces']['talk'] );

        // Remove actions tabs
        foreach ( $wgHVTFUUviewsToRemove as $view ) {
                if ( isset( $links['views'][$view] ))
                        unset( $links['views'][$view] );
        }

        return true;
}
125.21.230.132 (talkcontribs)

HI I am using Midiawiki-1.18.3 version. i have followed the following suggestion to hide "view source" tab for anonymous user.

URL - http://www.mediawiki.org/wiki/Extension:ProtectSource#Configuration

But still i could see option. so please help me solve this.

Operation system: Windows-xp

Rgds, Mohan

SVG (talkcontribs)

You just need to add 'viewsource' to $wgHVTFUUviewsToRemove array and it'll work. I don't get how is this related to ProtectSource extension. HideVariousTabsFromUnauthorizedUsers is NOT ProtectSource.

125.21.230.68 (talkcontribs)

HI Tim,

Could you please tell me in detail. Like do i need to update "LocalSettings.php" with below changes? $wgHVTFUUviewsToRemove['*']['viewsource'] = false; (or) do i need add like $wgHVTFUUviewsToRemove = array('viewsource');

I tried above given two option still i am able to see "View Source".

Thanks, Mohan

SVG (talkcontribs)

Hide viewsource tab for users without edit permission (usually unregistered users if you've set it so): $wgHVTFUUviewsToRemove = array( 'viewsource' );

125.21.230.132 (talkcontribs)

Hi Tim,

i want to hide "View Source" Tab for Anonymous users. In the LocalSettings.php If i set $wgGroupPermissions['*']['edit'] = false; then its hides the Edit Tab, Where as if i set $wgHVTFUUviewsToRemove = array( 'viewsource' ); its still shows the "View soruce" tab. So could you please help me. Thanks in advance.

Thanks, Mohan

This post was posted by 125.21.230.132, but signed as 125.21.230.68.

SVG (talkcontribs)

If you are not loggedin, you shouldn't be able to see viewsource tab (and no edit tab because edit tab gets into viewsource tab if you have no permission to edit pages). Do you use my code from above? You can try to purge the cache with ?action=purge

125.21.230.68 (talkcontribs)

Hi Tim,

i am not logged in but still it shows the "View source" tab. Can you tell me which code & in which file i have to update your code? bcoz my mediawiki version is -1.18.3. The tell me how to try Purge option (under in which file). Rgds, Mohan

SVG (talkcontribs)

Create folder HideVariousTabsFromUnauthorizedUsers in extensions directory, create HideVariousTabsFromUnauthorizedUsers.php file in HideVariousTabsFromUnauthorizedUsers folder and add the code below to your this file. Then add require_once ( "$IP/extensions/HideVariousTabsFromUnauthorizedUsers/HideVariousTabsFromUnauthorizedUsers.php" ); to your LocalSettings.php. Remove $wgGroupPermissions['*']['edit'] = false; and any other earlier setting of HideVariousTabsFromUnauthorizedUsers extension from LocalSettings.php.

<?php
/**
* HideVariousTabsFromUnauthorizedUsers
*
* @package MediaWiki
* @subpackage Extensions
*
* @author: Tim 'SVG' Weyer <t.weyer@ymail.com>
*
* @copyright Copyright (C) 2012 Tim Weyer
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*
*/

$wgExtensionCredits['other'][] = array(
	'path'           => __FILE__,
	'name'           => 'HideVariousTabsFromUnauthorizedUsers',
	'author'         => array( 'Tim Weyer' ),
	'url'            => 'https://www.mediawiki.org/wiki/User:SVG',
	'description'    => 'Disables various view tabs (and originally also namespace tabs) from users without <tt>edit</tt> permission for Vector skin',
	'version'        => '05-28-2012',
);

// Hooks
$wgHooks['SkinTemplateNavigation'][] = 'fnHVTFUUremoveTabsFromVector';

// Tabs of view to remove
$wgHVTFUUviewsToRemove = array( 'viewsource' );

// Remove 'edit' permission from anonymous users
$wgGroupPermissions['*']['edit'] = false;

/**
 * @param $sktemplate Title
 * @param $links
 * @return bool
 */
function fnHVTFUUremoveTabsFromVector( SkinTemplate &$sktemplate, array &$links ) {
	global $wgUser, $wgHVTFUUviewsToRemove;

	// Only remove tabs if user isn't allowed to edit pages
	if ( $wgUser->isAllowed( 'edit' ) ) {
		return false;
	}

	// Remove actions tabs
	foreach ( $wgHVTFUUviewsToRemove as $view ) {
		if ( $links['views'][$view] )
			unset( $links['views'][$view] );
	}

	return true;
}
Brocchinia (talkcontribs)

Hi Tim

It seems to work so far for me, THANKS for this extension. I altered this

// Tabs of view to remove

$wgHVTFUUviewsToRemove = array( 'edit', 'history', 'read', 'talk', 'viewsource' );

But it looks like it only works in the main namespace. Tabs of Pages in the MediaWiki or User Namespace still appear. Any ideas ? If possible I would like to hide all Tabs for unlogged users

SVG (talkcontribs)

What version of MediaWiki do you use and how are the settings of your wiki's user rights? Sorry for my late reply!

Tickihgk (talkcontribs)

Hi Tim,

is your extension still working with version 1.19.2. Maybe because of some different code in the newest vector skin? Thanks a lot!

122.176.133.214 (talkcontribs)

is there anyway i can remove the page title tab also? Eg: the tab named "Article" if u open Wikipedia. So i want to hide that tab too. Please help

MarkAHershberger (talkcontribs)

Untested: if you add "main" to that list it might work.

Coffeehound (talkcontribs)

Really appreciate the work on this as it works like a charm! MW 1.19 Mono Skin Foreclosurepedia ISTAR

85.240.32.6 (talkcontribs)

This works like a charm!

It hidden history and viewsource as i wanted. did not work with talk but the other two were the main important. Talk editing will be denied (anonymous edit off) so what I needed is done with this.

Thanks a lot!!

David

Iantresman (talkcontribs)

Could HideVariousTabsFromUnauthorizedUsers be extended to prevent anonymous non-editors from viewing revisions, ie. any link with an &oldid, as seen on the Revision history page under the links for "cur" and "last" and the revision date?

125.21.230.132 (talkcontribs)

Hi Tim,

i want to hide "View Source" Tab for Anonymous users. In the LocalSettings.php If i set $wgGroupPermissions['*']['edit'] = false; then its hides the Edit Tab, Where as if i set $wgHVTFUUviewsToRemove = array( 'viewsource' ); its still shows the "View soruce" tab. So could you please help me. Thanks in advance.

Here my requirement is that Anonymous users should not see "Edit & View Source" tabs.

Thanks, Mohan

Duplicate striked by SVG.

Besma~mediawikiwiki (talkcontribs)

Hi, Thank you Tim! This extension is pretty cool but it works only with the vector skin! I tried these few lines in the Mediawiki:Common.css and it works :

  1. ca-viewsource { display: none !important; }
  2. ca-talk { display: none !important; }

just put the right tab's id !!

This post was posted by Besma~mediawikiwiki, but signed as Besma.

Cheeyang (talkcontribs)
132.209.111.2 (talkcontribs)

This worked for me, on the Vector Theme:

protected function renderPortals( $portals ) {
    '''global $wgUser;'''

then:

case 'TOOLBOX':
    '''if($wgUser->isAllowed( 'edit' )) {'''
        $this->renderPortal('tb', $this->getToolbox(), 'toolbox', 'SkinTemplateToolboxEnd');
    '''}'''
    break;
90.212.81.76 (talkcontribs)

Hi please could you upgrade from Mediawiki 16.5 to Mediawiki 1.19.8 please because Mediawiki 1.165 is now unsupported

SVG (talkcontribs)

Hi. I haven't committed to MediaWiki for a long time. But if you really need this, contact me right here.

88.130.123.87 (talkcontribs)

Tim, this topic pops up here again and again. There surely is a need for such a feature. If you could add this, it will definitely make many peoples' lives easier.

Gleki.arxokuna (talkcontribs)

This doesn't work on Mediawiki 1.23. Namely, it hides all toolboxes but doesn't hide "Edit", "edit source" and "History" tabs. And it does hide "Tools" toolbox which I don't want to hide. Any solutions?

MarkAHershberger (talkcontribs)

MW 1.23 hasn't been released yet. This sounds like a bug. Could you report it?

202.89.105.45 (talkcontribs)

How do i hide Discussions tab & left sided navigation tabs for unlogged users.please send your reply to mail id satish_nunesh@yahoo.com

Can't upload images from Windows 7 client to Ubuntu wiki host

8
Summary by Coderbynature

In order to get image files to upload I had to change the ownership of my images directory:

sudo chown www-data:www-data -R /var/lib/mediawiki/images

Coderbynature (talkcontribs)

It seems like it's some sort of permissions issue. I get the follow error:

[2f0f4450] /mediawiki/index.php/Special:Upload MWException from line 1856 of .../includes/filerepo/file/LocalFile.php: Could not acquire lock for 'Stephenw_lake640.jpg.'

Backtrace:

#0 .../includes/filerepo/file/LocalFile.php(1148): LocalFile->lock()
#1 .../includes/upload/UploadBase.php(715): LocalFile->upload(string, string, string, integer, array, boolean, User)
#2 .../includes/specials/SpecialUpload.php(476): UploadBase->performUpload(string, string, boolean, User)
#3 .../includes/specials/SpecialUpload.php(195): SpecialUpload->processUpload()
#4 .../includes/specialpage/SpecialPage.php(384): SpecialUpload->execute(NULL)
#5 .../includes/specialpage/SpecialPageFactory.php(582): SpecialPage->run(NULL)
#6 .../includes/MediaWiki.php(267): SpecialPageFactory::executePath(Title, RequestContext)
#7 .../includes/MediaWiki.php(566): MediaWiki->performRequest()
#8 .../includes/MediaWiki.php(414): MediaWiki->main()
#9 .../index.php(41): MediaWiki->run()
#10 {main}

I'm running Windows 7 and get the same error whether I use Google Chrome or Internet Explorer.

The file I'm trying to upload is a 640 wide jpeg image.

MediaWiki is installed on a Linux Ubuntu server and apart from not being able to upload images has been working great.

My /var/www/html/images director is owned by www-data and has drwxr-xr-x permissions.

My /var/www/html/mediawiki/LocalSettings.php file has:

$wgEnableUploads = true;

My php.ini file has uploads enabled.

I'm guessing that the PHP script running on the Ubuntu server is failing to get some sort of permission either on the Ubuntu server or the Windows 7 PC.

I'm not sure what else to try.

Any and all help is greatly appreciated!

Thanks,

Stephen White

MarkAHershberger (talkcontribs)

You don't say what version of MW you're using -- that might help.

I'm pretty sure this has nothing to do with Windows, although you didn't indicate if you could upload from any other system.

I was going to tell you to turn on the debug log but the code doesn't look like it has any good debugging statements.

So, as a last resort, I'll ask you to turn on PHP errors and see if any are reported.

Coderbynature (talkcontribs)

Doh! Sorry, I'm using MediaWiki 1.25.1.

Coderbynature (talkcontribs)

Warning: failed to mkdir "/var/lib/mediawiki/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/lib/mediawiki/includes/GlobalFunctions.php at line 2540] in /var/lib/mediawiki/includes/debug/MWDebug.php on line 300

Warning: fopen(/var/lib/mediawiki/images/lockdir/f00smt22fqj94kquid3mc8ueuj5nipj.lock): failed to open stream: No such file or directory in /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/var/lib/mediawiki/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/lib/mediawiki/includes/GlobalFunctions.php at line 2540] in /var/lib/mediawiki/includes/debug/MWDebug.php on line 300

Warning: fopen(/var/lib/mediawiki/images/lockdir/f00smt22fqj94kquid3mc8ueuj5nipj.lock): failed to open stream: No such file or directory in /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/var/lib/mediawiki/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/lib/mediawiki/includes/GlobalFunctions.php at line 2540] in /var/lib/mediawiki/includes/debug/MWDebug.php on line 300

Warning: fopen(/var/lib/mediawiki/images/lockdir/f00smt22fqj94kquid3mc8ueuj5nipj.lock): failed to open stream: No such file or directory in /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/var/lib/mediawiki/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/lib/mediawiki/includes/GlobalFunctions.php at line 2540] in /var/lib/mediawiki/includes/debug/MWDebug.php on line 300

Warning: fopen(/var/lib/mediawiki/images/lockdir/f00smt22fqj94kquid3mc8ueuj5nipj.lock): failed to open stream: No such file or directory in /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/var/lib/mediawiki/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/lib/mediawiki/includes/GlobalFunctions.php at line 2540] in /var/lib/mediawiki/includes/debug/MWDebug.php on line 300

Warning: fopen(/var/lib/mediawiki/images/lockdir/f00smt22fqj94kquid3mc8ueuj5nipj.lock): failed to open stream: No such file or directory in /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/var/lib/mediawiki/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/lib/mediawiki/includes/GlobalFunctions.php at line 2540] in /var/lib/mediawiki/includes/debug/MWDebug.php on line 300

Warning: fopen(/var/lib/mediawiki/images/lockdir/f00smt22fqj94kquid3mc8ueuj5nipj.lock): failed to open stream: No such file or directory in /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/var/lib/mediawiki/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/lib/mediawiki/includes/GlobalFunctions.php at line 2540] in /var/lib/mediawiki/includes/debug/MWDebug.php on line 300

Warning: fopen(/var/lib/mediawiki/images/lockdir/f00smt22fqj94kquid3mc8ueuj5nipj.lock): failed to open stream: No such file or directory in /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/var/lib/mediawiki/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/lib/mediawiki/includes/GlobalFunctions.php at line 2540] in /var/lib/mediawiki/includes/debug/MWDebug.php on line 300

Warning: fopen(/var/lib/mediawiki/images/lockdir/f00smt22fqj94kquid3mc8ueuj5nipj.lock): failed to open stream: No such file or directory in /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/var/lib/mediawiki/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/lib/mediawiki/includes/GlobalFunctions.php at line 2540] in /var/lib/mediawiki/includes/debug/MWDebug.php on line 300

Warning: fopen(/var/lib/mediawiki/images/lockdir/f00smt22fqj94kquid3mc8ueuj5nipj.lock): failed to open stream: No such file or directory in /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: Cannot modify header information - headers already sent by (output started at /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php:125) in /var/lib/mediawiki/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php:125) in /var/lib/mediawiki/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php:125) in /var/lib/mediawiki/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /var/lib/mediawiki/includes/filebackend/lockmanager/FSLockManager.php:125) in /var/lib/mediawiki/includes/WebResponse.php on line 37

Coderbynature (talkcontribs)

The permissions on /var/lib/mediawiki/images are drwxrwxr-x. The ownership is stephenw stephenw. The only thing in that directory is a README file.

Coderbynature (talkcontribs)

What should the owner of the images directory be set to? I've Google searched around and got different answers such as www-data or apache. How can I tell which one is the appropriate one?

Coderbynature (talkcontribs)

I should also mention that the jpg file is located on a local drive (D:) of the Windows 7 PC. And both the Windows 7 PC and the Ubuntu server are on the same local network. Samba is also running on the Ubuntu server and the Windows 7 PC can connect to the Samba shares just fine.

Coderbynature (talkcontribs)

RESOLVED: I did the following and I can now upload the image:

sudo chown www-data:www-data -R /var/lib/mediawiki/images