1,277
edits
Changes
m
no edit summary
* On some pages in MediaWiki project (www.mediawiki.org), I seen that: non-logged users cannot edit pages ("view source"), but can edit discussion pages. How to do it in my wiki?
::There's a hack shown at [http://www.mediawiki.org/wiki/Help:$wgWhitelistEdit %24wgWhitelistEdit Mediawiki:Help:$wgWhitelistEdit], but it doesn't seem to work in version 1.6.5. I've been using the following hack. It goes in the file <code>includes/User.php</code>, in the function <code>isAllowed($action='')</code>. Here's the complete modified code for the function:
<pre>
function isAllowed($action='') {
global $wgTitle;
//Allow them to edit talk pages
if ($wgTitle->isTalkPage()&& strcmp("edit", $action) == 0) return true; //No special cases relevant. Use established rules stored in DB. $this->loadFromDatabase(); return in_array( $action , $this->mRights );}</pre>:All the usual warnings and disclaimers about no gauruntees of safety or that it'll work. Do it at your own risk. '''In particular;''' the use of the string constant "edit" seems like a horrible mistake to me, but I haven't yet found any constants that define the word for this action. [[User:Bmearns|Bmearns]] 00:13, 19 May 2006 (UTC) ::(For global restrictions, this is '''should''' be done like that: $wgGroupPermissions['*' ]['editpage'] = false; and $wgGroupPermissions['*' ]['edittalk'] = true; ...but it is not implemented :( ):::$wgGroupPermissions['*']['createaccount'] = false;:::$wgGroupPermissions['*']['read'] = true;:::$wgGroupPermissions['*']['edit'] = false;:::$wgGroupPermissions['*']['talk'] = true;:::works fine for me. ::::works for me too, except, non-logged in users still can't edit discussion pages! * Is it possible to create Group Administrators, i.e. make a user or a different group that can add and delete members of a specific group? * Is it possible to create a privlidge so that only the page creator can edit their own pages within a given namespace/prevent all modifications to pages within a given namespace? * Is it possible, (using [[ParserFunctions]], perhaps) to have a page display different content for users who are logged-in vs. those not logged-in? I'm trying to create a page for my group where Main_Page is rather bland and uninformative for those without an account, but interesting for those that are. * I want to provide a wiki in different languages and I want to create '''users with "steward"-rights''' so they can make users to sysops / bureaucrats and the other way round in all languages. The structure is the same as wikipedia's (a subdomain per language and a "commons"-wiki, every wiki can access the other's database-tables and files). How do I have to set-up the wiki for featuring stewards? * Is it possible to define the inactivity timeout for users logged in?::You can define session timeouts by adding the following entry in a .htaccess file in your directory::::php_value session.gc_maxlifetime 14400::where the number is the amount of seconds before timing out.