WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • CHECK your rights, permissions, chmod, ftpuser, webuser
  • Print
Pages: [1]   Go Down

Author Topic: CHECK your rights, permissions, chmod, ftpuser, webuser  (Read 16179 times)

pcwacht

  • Guest
CHECK your rights, permissions, chmod, ftpuser, webuser
« on: September 25, 2006, 10:18:32 PM »
Just make a code section paste the code and call the page where it is in

Code: [Select]
function check_dir($path) {
   echo "<h1>checking: ".$path."</h1>";
   $dh = opendir($path);
   while (($file = readdir($dh)) !== false) {
      if ($file<>'.' && $file<>'..') {
         if (is_dir($path.'/'.$file)) {
            check_dir($path.'/'.$file);
         } else { 
           if (is_writable($path.'/'.$file)) {
              echo 'Green :'.$file.'<br>';
           } else {
              echo '#### Not ok! :'.$file.'<br>';
           }
         }
      }
   }
   closedir($dh);
}

check_dir('../temp');
check_dir('../templates');
check_dir('../pages');
check_dir('../languages');
check_dir('../media');


Works on Linux, not confirmed on windows

Have fun,
John
Logged

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: CHECK your rights, permissions, chmod, ftpuser, webuser
« Reply #1 on: September 26, 2006, 10:30:57 AM »
Great Script ... works fine on my production host (Linux). On XAMPP it gives errors. Buit I think we can forget about them :-)

cheers

Klaus
Logged

pcwacht

  • Guest
Re: CHECK your rights, permissions, chmod, ftpuser, webuser
« Reply #2 on: September 26, 2006, 02:18:54 PM »
Windows - Xampp users hardly ever have persmission problems ;)

This script just check to see if the WEB user has permissions to write/create/delete files


I like it allso, it is short, fast and easy enough to understand... ;)


Oh did I mention I wrote it?


:P
:P

John
Logged

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: CHECK your rights, permissions, chmod, ftpuser, webuser
« Reply #3 on: September 26, 2006, 06:02:57 PM »
good question ... who wrote it ? :? :evil:

cheers

Klaus
Logged

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: CHECK your rights, permissions, chmod, ftpuser, webuser
« Reply #4 on: September 28, 2006, 08:41:53 PM »
Hi John,

put an initial Page with this script into the WIKI: http://projects.WebsiteBaker.org/websitebaker2/wiki/Docs-EN-Advanced-Howtos-Filepermissions

Would you please chek and eventually correct me? Thanks

cheers

Klaus
Logged

pcwacht

  • Guest
Re: CHECK your rights, permissions, chmod, ftpuser, webuser
« Reply #5 on: September 28, 2006, 08:56:52 PM »
Code: [Select]
If you use it on a HTML Page you need to wrap ....
Many servers can't handle php inside html pages,
they can inside php pages... ;)


This script will only work at a defualt installation (the pages dir for example) and only when the code is put in a firstlevel page
If not the path (../) might be changed to ../../ (if the page wich hold the code is on the irst sublevel)

Maybe note this somewhere
Or change last bit to:
Code: [Select]
$path = '../';   // first level page with code
check_dir($path.'temp');
check_dir($path.'templates');
check_dir($path.'pages');   // default pages dir!
check_dir($path.'languages');
check_dir($path.'media');

Thanks for porting the info btw... I like those wikis wich explain stuff ;)

John
Logged

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: CHECK your rights, permissions, chmod, ftpuser, webuser
« Reply #6 on: September 28, 2006, 09:57:25 PM »
Quote
Many servers can't handle php inside html pages

OK ... fair comment ... removed it.

Quote
This script will only work at a defualt installation (the pages dir for example) and only when the code is put in a firstlevel page

added that info as well ...

cheers and thanks for the corrections

Klaus
Logged

valerie

  • Guest
Re: CHECK your rights, permissions, chmod, ftpuser, webuser
« Reply #7 on: September 29, 2006, 07:28:42 PM »
What should you do when it comes back with a list of around 60 items that are "not ok!"?

I've been having trouble with different permissions on some files/folders in wb so based on woudloper's advice I asked my host to change all permissions. But if I understand correctly, this means that now they don't have the permissions wb needs. I'm not sure what to do...
Logged

Offline Spritemarkiv

  • Posts: 126
  • Gender: Male
    • Diamond Visions Sarl
Re: CHECK your rights, permissions, chmod, ftpuser, webuser
« Reply #8 on: August 08, 2008, 04:54:59 PM »
The part about placing the page in the first level should be on the Knowledge Base. Took me a long time to get it to work. :-( Now working after digging around and finding this topic.
Logged

Argos

  • Guest
Re: CHECK your rights, permissions, chmod, ftpuser, webuser
« Reply #9 on: August 23, 2008, 12:04:38 PM »
I made some changes in the visual aspects:
Code: [Select]
echo "<h1>Checking permissions</h1>";
function check_dir($path) {
   echo "<h4>".$path."</h1>";
   $dh = opendir($path);
   while (($file = readdir($dh)) !== false) {
      if ($file<>'.' && $file<>'..') {
         if (is_dir($path.'/'.$file)) {
            check_dir($path.'/'.$file);
         } else { 
           if (is_writable($path.'/'.$file)) {
              echo '<font color="green">'.$file.'</font><br>';
           } else {
              echo '<font color="red">'.$file.'</font><br>';
           }
         }
      }
   }
   closedir($dh);
}

check_dir('../temp');
check_dir('../templates');
check_dir('../pages');
check_dir('../languages');
check_dir('../media');

However, I don't understand what's the purpose of this thingy. It seems files only get approved if they are writable, but that's not needed for many files, is it?
Logged

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: CHECK your rights, permissions, chmod, ftpuser, webuser
« Reply #10 on: August 23, 2008, 12:14:03 PM »
Nope, not needed
But on some directories they really are needed,
temp, templates, modules etc etc

This thingy just checks php rights on them, thus testing apache rights


John
Logged
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • CHECK your rights, permissions, chmod, ftpuser, webuser
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2