pluck
pluck 4.7 out now, download it today!

pluck support forums

for all your questions about the easiest CMS on the planet

You are not logged in.

Announcement

New registrations are disabled for some spam problems. New registrations will be avaliable soon. If you want to help to keep forum away from spam - contact us.
Please post your bug reports on Launchpad.

#1 10-12-2009 23:14:23

superdad
Member
Registered: 07-11-2007
Posts: 123

Php script to check permissions after install.

I'm sure others have ha this problem as well. You work on a site locally in say mamp or Xampp, all permissions are correct but once uploaded to an active site, the permissions change. If you try to run the install script it says your site is already installed but yet: you cannot add anything to a page, cannot add to an album..., etc. A script to check all these permissions similar to the one during the install would be nice. One that could be run multiple times to check for additions (modules) that did not have the permissions applied correctly..

Offline

#2 11-12-2009 11:08:32

putyn
Member
From: Romania
Registered: 24-10-2009
Posts: 17

Re: Php script to check permissions after install.

you can do something like this create a new file called check.php

add this inside

<?php
require_once ('data/inc/functions.admin.php');

check_writable('images');
check_writable('data/modules');
check_writable('data/settings');
check_writable('data/trash');
check_writable('data/themes');
check_writable('data/themes/default');
check_writable('data/themes/green');
check_writable('data/themes/oldstyle');
check_writable('data/settings/langpref.php');
check_writable('data/settings/themepref.php');

?>

open admin.php file and add this where do you find similar code

//Check file permissions
			case 'check':
				include_once('data/inc/header.php');
				include_once('data/inc/check.php');
			break;

and if you point your browser to /admin.php?action=check you should see the list with the files

Offline

#3 11-12-2009 13:04:35

a_bach
developer/module guru
From: Poland
Registered: 24-11-2008
Posts: 439
Website

Re: Php script to check permissions after install.

There is a simple way:

edit install.php

find

if (file_exists('data/settings/install.dat')) {
	$titelkop = $lang_install;
	include_once ('data/inc/header2.php');
	redirect('login.php', 3);
	echo $lang_install1;
	include_once ('data/inc/footer.php');
}

and repace it with

if (file_exists('data/settings/install.dat')) {
	$titelkop = $lang_install;
	include_once ('data/inc/header2.php');
		echo $lang_install1."<br /><br />Checks permision:<br />";
			//Writable checks.
			check_writable('images');
			check_writable('data/modules');
			check_writable('data/settings');
			check_writable('data/trash');
			check_writable('data/themes');
			check_writable('data/themes/default');
			check_writable('data/themes/green');
			check_writable('data/themes/oldstyle');
			check_writable('data/settings/langpref.php');
			check_writable('data/settings/themepref.php');
	//redirect('login.php', 3);
	echo "<br />You may also <a href=\"login.php\">Login now!</a>";

	include_once ('data/inc/footer.php');
}

Now when you access install.php file you will see permisions and you will be able also to login.

A_Bach

Offline

#4 11-12-2009 13:22:32

superdad
Member
Registered: 07-11-2007
Posts: 123

Re: Php script to check permissions after install.

These responses are why I love this CMS and forum. Thank you both for you quick replies and solutions. This should be a permanent addition to the current pluck.6.3

Offline

#5 11-12-2009 13:48:45

a_bach
developer/module guru
From: Poland
Registered: 24-11-2008
Posts: 439
Website

Re: Php script to check permissions after install.

superdad wrote:

These responses are why I love this CMS and forum. Thank you both for you quick replies and solutions. This should be a permanent addition to the current pluck.6.3

AFAIK - there will be no changes in 4.6.x - only security updates. All work is on 4.7 and I think this feathure will be avaliable in 4.7.

Offline

Board footer

Powered by FluxBB