Difference between revisions of "Issue:Option to only run DPL from protected pages"

From FollowTheScore
Jump to: navigation, search
(Reply)
Line 15: Line 15:
 
*Normal users can't create pages with DPL code
 
*Normal users can't create pages with DPL code
 
*Normal users can't manipulate existing DPL code, because they can't edit the page. This is also possible without this new feature but with "$wgProtectedDPL" they simply can't do things the admin didn't allow with his DPL functions.
 
*Normal users can't manipulate existing DPL code, because they can't edit the page. This is also possible without this new feature but with "$wgProtectedDPL" they simply can't do things the admin didn't allow with his DPL functions.
*Normal users can't create or manipulate DPL code. They can include a protected DPL page or a normal page including DPL code, but then? No abuse :)
+
*Normal users can't create or manipulate DPL code. They can include a protected DPL page or a normal page which itself includes DPL code, but then? No abuse :)
  
 
It may not seem to be important for you but surely for other wikis with sensible data.
 
It may not seem to be important for you but surely for other wikis with sensible data.
Line 45: Line 45:
  
 
:::Thanks a lot. Will test :) --[[User:Subfader|Subfader]] 14:29, 1 May 2009 (UTC)
 
:::Thanks a lot. Will test :) --[[User:Subfader|Subfader]] 14:29, 1 May 2009 (UTC)
 +
 +
::::Works like a charm from what I can tell so far. Returns '1' if the page is not protected. Maybe this could be specified but that's not essential. Happy ;) --[[User:Subfader|Subfader]] 14:46, 1 May 2009 (UTC)

Revision as of 15:46, 1 May 2009

Description: Protect your wiki from DPL abuse. E.g. "$wgProtectedDPL" as option to let DPL run only from protected pages.
Extension / Version: DPL   /   ?
Type / Status: Change Request   /   open

Problem

Note: I talk about an option, not a must.
Some wiki admins may not like the idea that other users can run DPL from any page. E.g. I'm paranoid, somebody copies all my content, so I disabled all Export features etc.

An option to give the full control to the admin is by letting DPL code only run from protected pages. Extension:SecureHTML uses it and it is so simple & safe at the same time. Advantages with "$wgProtectedDPL":

  • To protect a page you have to be an administrator, i.e.
  • Normal users can't create pages with DPL code
  • Normal users can't manipulate existing DPL code, because they can't edit the page. This is also possible without this new feature but with "$wgProtectedDPL" they simply can't do things the admin didn't allow with his DPL functions.
  • Normal users can't create or manipulate DPL code. They can include a protected DPL page or a normal page which itself includes DPL code, but then? No abuse :)

It may not seem to be important for you but surely for other wikis with sensible data.

Reply

What would one have to do to add an option which allows DPL only to be run from protected pages? Gero 21:56, 30 April 2009 (UTC)

Dunno exactly, that's why i request it here. But Extension:SecureHTML uses it:
	/**
	 * Verifies if the target page is protected for 'edit'
	 */
	protected function getAndCheckTitle( &$page_name, &$title )
	{
		$title = Title::newFromText( $page_name );
		if (!is_object( $title ))
			return false;
		
		// if the title does not exist,
		// then the caller will probably generate a broken link
		if ( !$title->exists() )
			return null;
		
		return $title->isProtected( 'edit' );
	}

--Subfader 02:05, 1 May 2009 (UTC)

In fact it was quit easy to do; Release 1.7.7 of DPL contains the new feature. Gero 07:02, 1 May 2009 (UTC)
Thanks a lot. Will test :) --Subfader 14:29, 1 May 2009 (UTC)
Works like a charm from what I can tell so far. Returns '1' if the page is not protected. Maybe this could be specified but that's not essential. Happy ;) --Subfader 14:46, 1 May 2009 (UTC)