Giter VIP home page Giter VIP logo

Comments (3)

mesler1 avatar mesler1 commented on June 12, 2024

I think this would do it. However, note that you can still overwrite a file with an empty (effectively blanking it).

28a29,30
> $allow_delete = false;
> 
57,58c59,60
<               'is_deleteable' => (!is_dir($i) && is_writable($directory)) || 
<                                  (is_dir($i) && is_writable($directory) && is_recursively_deleteable($i)),
---
>               'is_deleteable' => $allow_delete && ((!is_dir($i) && is_writable($directory)) || 
>                                  (is_dir($i) && is_writable($directory) && is_recursively_deleteable($i))),
70c72,74
<   rmrf($file);
---
>   if($allow_delete) {
>       rmrf($file);
>   }

from simple-file-manager.

jcampbell1 avatar jcampbell1 commented on June 12, 2024

send a pull request with allow_delete at the top, and default to true.
I'll merge it.

On Wed, Jun 22, 2016 at 10:31 AM, mesler1 [email protected] wrote:

I think this would do it. However, note that you can still overwrite a
file with an empty (effectively blanking it).

28a29,30

$allow_delete = false;

57,58c59,60
< 'is_deleteable' => (!is_dir($i) && is_writable($directory)) ||
< (is_dir($i) && is_writable($directory) && is_recursively_deleteable($i)),

      'is_deleteable' => $allow_delete && ((!is_dir($i) && is_writable($directory)) ||
                         (is_dir($i) && is_writable($directory) && is_recursively_deleteable($i))),

70c72,74
< rmrf($file);

if($allow_delete) {
rmrf($file);
}


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#20 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AABjG6cjD3s4pcYyVTJYqxbJdertRWfVks5qOUdfgaJpZM4IuKlZ
.

from simple-file-manager.

jcampbell1 avatar jcampbell1 commented on June 12, 2024

Looks like this has been merged. Closing.

from simple-file-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.