Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename file/dir #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
$_CONFIG['upload_enable'] = true;
$_CONFIG['newdir_enable'] = true;
$_CONFIG['delete_enable'] = false;

$_CONFIG['rename_enable'] = true;
/*
* UPLOADING
*/
Expand Down Expand Up @@ -2045,6 +2045,12 @@ public static function isUploadAllowed(){
return true;
return false;
}

public static function isRenameAllowed(){
if(EncodeExplorer::getConfig("rename_enable") == true && GateKeeper::isUserLoggedIn() == true && GateKeeper::getUserStatus() == "admin")
return true;
return false;
}

public static function isNewdirAllowed(){
if(EncodeExplorer::getConfig("newdir_enable") == true && GateKeeper::isUserLoggedIn() == true && GateKeeper::getUserStatus() == "admin")
Expand Down Expand Up @@ -3270,8 +3276,10 @@ function(){
</div>
<!-- END: Info area -->

<?php
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anyone wants renaming to be allowed explicitly

if(GateKeeper::isAccessAllowed() && GateKeeper::isRenameAllowed()){
?>
<script type="text/javascript">// <![CDATA[
////////////////////////// renaming folder/file
$(function () {
$("td.name").dblclick(function (e) {
e.stopPropagation();
Expand Down Expand Up @@ -3324,6 +3332,9 @@ function updateVal(currentEle, currentVal) {
});
}
// ]]></script>
<?php
}
?>

</body>
</html>
Expand Down