Forgot?

Chage default file/dir permissions NinjaExp uses

Reply Topic
Link to this post 15 Nov 09

Hello,

Just dl'ed the latest NinjaExplorer. What a luvely component. Using NinjaExporer to upload a zipped html folder off of my Windows7 pc. Webhost is Rochen and use linux based servers. I don't have FTP turned on in the Joomla backend.

Which file do I need to edit to change default file and directory permissions NinjaExplorer assigns initially?

All dirs on my webhost are 755 and all files are 644. I used NinjaExplorer to upload the bee's html folder zipped up. After it was uploaded to /templates/mytemplateDIR/ I Extracted it and all files dirs/sudDirs are assigned 775 and all files are assigned 664 permissions.

Ideally I'm wanting to make NinjaExporer always assign 755 to dirs and 644 to files whenever it's logic is dictating that it compute a chmod.

Great component. Thanks for the hard work.

Link to this post 15 Nov 09

Hi finack,

Welcome to NinjaForge :)

Give me some time to see if I can replicate this issue and attempt a fix.

Mark

Link to this post 15 Nov 09

Ok I've replicated this and am working on fixing it now.

Link to this post 15 Nov 09

Mark Simpson wrote:

Ok I've replicated this and am working on fixing it now.

Hi Mark. Thanks for the reply. I forgot to add my other testing. But you've replicated it so that's good. Really appreciate your help.

If you use ninjaExplorers file/dir create button the same thing happens. Dirs are assigned 775 and files are assigned 664. That was my simple test anyways, just incase you were wondering.

Look forward to your reply. B)

Link to this post 15 Nov 09

I haven't been able to find the offending code.

I found other permission functions unrelated to this unzip one and the code comments mention they set those permissions to ensure maximum compatibility across platforms.

We did not code NinjaXplorer from scratch, we just forked the original as the original developers decided not to make it Joomla 1.5 native.

I am not a php developer, although I do excel in the dark arts of Copy&Paste ... and haven't been able to sort this out so will wait for Richie to come online.

Cheers

Link to this post 15 Nov 09

Dark art of Copy and Paste.. lol.. heh.. You and me both. I know just enough PHP to be dangerous. :D

Hopefully this helps. The only thing I found that seemed relevant was in:
administrator/components/com_ninjaxplorer/include/fun_extra.php starting with the below function at line 388. The stuff down at the bottom of the function appears to be the juicy part. :D Just being hopeful actually.

The code is gonna look like crap below. Not sure how to format it.


function chmod_recursive($item, $mode) { // chmod file / dir
$ok = true;
if(@is_link($item) || @is_file($item)) {
$ok=@chmod( $item, $mode );
}
elseif(@is_dir($item)) {
if(($handle=@opendir($item))===false) {

add_error(basename($item).": ".$GLOBALS["error_msg"]["opendir"]);
return false;
}

while(($file=readdir($handle))!==false) {
if(($file==".." || $file==".")) continue;

$new_item = $item."/".$file;
if(!@file_exists($new_item)) {
add_error(basename($item).": ".$GLOBALS["error_msg"]["readdir"]);
continue;
}
//if(!get_show_item($item, $new_item)) continue;

if(@is_dir($new_item)) {
$ok=chmod_recursive($new_item, $mode);
if($ok) add_message($GLOBALS['messages']['permchange'].' '.$new_item);
} else {
$ok=@chmod($new_item, $mode);
if($ok) add_message($GLOBALS['messages']['permchange'].' '.$new_item);
}
}
closedir($handle);
if( is_dir( $item )) {
$bin = decbin( $mode );
// when we chmod a directory we must care for the permissions
// to prevent that the directory becomes not readable (when the "execute bits" are removed)
$bin = substr_replace( $bin, '1', 2, 1 ); // set 1st x bit to 1
$bin = substr_replace( $bin, '1', 5, 1 );// set 2nd x bit to 1
$bin = substr_replace( $bin, '1', 8, 1 );// set 3rd x bit to 1
$mode = bindec( $bin );
}
$ok=@chmod( $item, $mode );
if($ok) add_message($GLOBALS['messages']['permchange'].' '.$new_item);
}
return $ok;}

Link to this post 15 Nov 09

Thanks finack,

Richie seems to have fixed it, going by his messages in our Skype chat:

[2:55:30 AM] Richie: fixed bug in NinjaXplorer
[3:14:44 AM] Richie: no i havnt*
[3:26:27 AM] Richie: okay i can change the directory but not file

But he was not online when I came on and it doesn't look like he has released an update. He should be back online in a couple of hours and I'll report back then.

Link to this post 16 Nov 09

Sweet. You guys rock. Hey, something is better than nothing. I suppose we could script something fairly easy in php to change a directory's subdirectories and files with a given path. That would be a nice option. NinjaExplore already gives you the option to recursively apply permissions but it makes no sense because it applies the given permissions to both files and folders.

Anyways... look forward to getting back to.

Link to this post 16 Nov 09

That's a good feature suggestion and one I would like to go into Ninja Xplorer.

Unfortunately it could be a few short months before that happens. The reason is that we have decided to halt development on the current Ninja Xplorer and are building a new one from scratch. This one will be much cleaner, more powerful hopefully, and will be ready for Joomla 1.6 as well.

Development on that new one will begin in earnest once Richie finishes his next version of Ninja Content (due out in two weeks if not sooner)

Link to this post 16 Nov 09

Hi,

the directory permissions is now fixed, you can get the updating version from the downloads page.

i will look at recursive permissions, at least if i dont fix it in NXplorer i can put it in the new version

Richie

Link to this post 17 Nov 09

Mark Simpson wrote:

That's a good feature suggestion and one I would like to go into Ninja Xplorer.

Would of been nice, yes. Look forward to the new and improved version that is being made from scratch.

Unfortunately it could be a few short months before that happens. The reason is that we have decided to halt development on the current Ninja Xplorer and are building a new one from scratch. This one will be much cleaner, more powerful hopefully, and will be ready for Joomla 1.6 as well.

Sweet. I wish I could tag along to watch the developement process take place or atleast help BETA test as the tool progresses to final release. Trying to learn php without much practical experience is a steep learning curve. Look forward to the new goods. :D

Development on that new one will begin in earnest once Richie finishes his next version of Ninja Content (due out in two weeks if not sooner)

Ninja Content.. Hmmm.. I'll have to check that out. Didn't spend much time on the site. Just got what I needed and ran with it. I'll have to see what other goodies are on the site. Fun, Fun. Thanks for all the help Mark.

Link to this post 17 Nov 09

Richie wrote:


the directory permissions is now fixed, you can get the updating version from the downloads page.

Sweet. Thanks Richie.

i will look at recursive permissions, at least if i dont fix it in NXplorer i can put it in the new version.

If it's something that would be a somewhat easy fix then it would be nice. But I wouldn't worry about it. Sounds like you more than have your hands full with existing projects and then the replacement Ninja eXplorer with your own version. Nothing like starting from scratch.

If you need beta testers let me know. I'll have upto 5 production sites up by the end of this month. All will be running NinjaExplorer. Atleast with 2 or 3 of those sites we could beta test for you. I know all the customers personally and they wouldn't mind. If it makes their job of webupdates and file management easier then they will be all for it. Everything is backed up differentially on a daily basis and all backups are kept for a year. So were good to go there. Bring on your BETA. :D

Link to this post 17 Nov 09

Would be great to have you help us test it when it's ready finack :)

Ninja Content basically brings all the power of the backend to the frontend. Good for keeping site editors as well as noob clients within the comfort of the Joomla frontend.

There's a screeny of the dashboard(not quite the latest one) here: http://www.flickr.com/photos/ninjaforge/4111313286/sizes/o/

Link to this post 17 Nov 09

Hi Mark,

I dl'ed the latest NinjaExporer: my file was com_ninjaxplorer_v1.0.3d.zip. Uploaded and installed over the top of my NinjaExporer 1.0.3 version. Opened NE on the backend and uploaded the Beez html folder zipped up. The permissions were 644 on the zip file.

But I'm still having the same issue. When I extract the html folder with NE it's still assigning Dir's 775 and files 664.

Did I miss something?

Mark Simpson wrote:

Would be great to have you help us test it when it's ready finack :)

Would luv to. Send me a pm or an email and let me know when you want to get started with any directions/indestructions and I'll gladly help out.


Ninja Content basically brings all the power of the backend to the frontend. Good for keeping site editors as well as noob clients within the comfort of the Joomla frontend.

There's a screeny of the dashboard(not quite the latest one) here: http://www.flickr.com/photos/ninjaforge/4111313286/sizes/o/[/quote]

Wow.. That's very nice. That would give my customers all the functionality they need without having to login to the backend and possibly brick the joomla install. Sweet. I would luv to beta that one as well if you would like? Let me know of any details.

These will be 2 tools that are a must until Joomla gets around to fixing and listening to there user base. Which, from the looks and sounds of it on the forums, will likely not happen anytime soon.

Thanks Mark.

Link to this post 17 Nov 09

hmmm. Richie will have been notified of your post so I'm sure he'll check that out when he comes online.

Will certainly send a PM to ask for your help with testing, thanks.

Yes, Ninja Content is one of my favorite extensions. It's a gold-level extension though so it depends on how much you need it.

Cheers.

Link to this post 17 Nov 09

Great. I'll look into the memberships. Look forward to the PM for beta'ing when it's time as well as Richie's feedback on this permissions issue.

Cya

Link to this post 17 Nov 09

Hi,

okay with a little prompt from Uwe, this is now fixed and confirmed to be fixed, please let me know if you have any further issues

Richie

Link to this post 17 Nov 09

Richie wrote:

...okay with a little prompt from Uwe, this is now fixed and confirmed to be fixed, please let me know if you have any further issues.

Works like a charm. Thanks Richie. I appreciate your time. Look forward to hopefully beta testing your version of the new and improved NinjaExplorer when the time comes. I'm sure my customers and myself will put it through its paces. :)

Until then, happy coding,
JBanks

Link to this post 17 Nov 09

I'm glad it works for you too finack :)

I know you must be busy, but if it isn't too much trouble, we would appreciate a review and vote on the JED when you can find some extra time :)

TIA
-mark

Link to this post 20 Nov 09

Hi Mark,

I created/registered an account on JED to submit a review. I logged in and wrote up a short but sweet review and submitted it. It's not showing up so I'm assuming they have something in place to screen the reviews before they post. I'll check back there later and make sure it went through.

Very please with NinjaExplorer and most of all your kind and attentive support and they work that was done to remedy my issue. Much appreciated. Hopefully I can talk my customers into signing on with a yearly membership. You guys/gals have lots of very appealing software goodies.

Cya,
JBanks

Link to this post 20 Nov 09

They do moderate all comments, and we normally get an automatic notification when it is published.

Thanks a lot for taking the time to post a review finack, we really appreciate it... thank you for the kind words.

Mark

Home Forum Joomla Extension Support Ninja Xplorer Chage default file/dir permissions NinjaExp uses