diff --git a/core/core.php b/core/core.php index 7d109984..e236e7d6 100755 --- a/core/core.php +++ b/core/core.php @@ -2683,6 +2683,7 @@ class layout extends common { $items .= 'getData(['theme','footer','displaymemberAccount']) === false ? ' class="displayNone"' : ''; $items .= '> | ' . template::ico('user', 'all') . ''; + if( $this->getData(['user', $this->getUser('id') , 'files']) === true) $items .= '' . template::ico('folder') . ''; $items .= '' . template::ico('logout','left') . ''; $items .= ''; } @@ -2914,6 +2915,7 @@ class layout extends common { || $this->getData(['theme','footer','displayMemberBar']) === false ) ) { + if( $this->getData(['user', $this->getUser('id') , 'files']) === true) $itemsRight .= '
  • ' . template::ico('folder') . '
  • '; $itemsRight .= '
  • ' . template::ico('user', 'right') . '
  • '; $itemsRight .= '
  • ' . template::ico('logout') . '
  • '; } diff --git a/core/module/user/user.php b/core/module/user/user.php index 6e33f000..73db5078 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -87,7 +87,8 @@ class user extends common { "connectTimeout" => null, "accessUrl" => null, "accessTimer" => null, - "accessCsrf" => null + "accessCsrf" => null, + "files" => $this->getInput('userAddFiles', helper::FILTER_BOOLEAN) ] ]); @@ -256,7 +257,8 @@ class user extends common { 'connectTimeout' => $this->getData(['user',$this->getUrl(2),'connectTimeout']), 'accessUrl' => $this->getData(['user',$this->getUrl(2),'accessUrl']), 'accessTimer' => $this->getData(['user',$this->getUrl(2),'accessTimer']), - 'accessCsrf' => $this->getData(['user',$this->getUrl(2),'accessCsrf']) + 'accessCsrf' => $this->getData(['user',$this->getUrl(2),'accessCsrf']), + 'files' => $this->getInput('userEditFiles', helper::FILTER_BOOLEAN) ] ]); // Redirection spécifique si l'utilisateur change son mot de passe @@ -714,4 +716,4 @@ class user extends common { ]); } -} \ No newline at end of file +} diff --git a/core/module/user/view/add/add.js.php b/core/module/user/view/add/add.js.php index 692460a0..3902e6ee 100644 --- a/core/module/user/view/add/add.js.php +++ b/core/module/user/view/add/add.js.php @@ -42,4 +42,29 @@ $("#userAddId").on("change keydown keyup", function(event) { $("#userAddGroup").on("change", function() { $(".userAddGroupDescription").hide(); $("#userAddGroupDescription" + $(this).val()).show(); -}).trigger("change"); \ No newline at end of file +}).trigger("change"); + +/** + * Autorisation d'upload et de download pour un membre + */ +$(document).ready(function(){ + if($("#userAddGroup").val() === '1') { + $("#userAddMemberFiles").slideDown(); + } + else { + $("#userAddMemberFiles").slideUp(function() { + $("#userAddtFiles").prop("checked", false).trigger("change"); + }); + } +}); + +$("#userAddGroup").on("change", function() { + if($("#userAddGroup").val() === '1') { + $("#userAddMemberFiles").slideDown(); + } + else { + $("#userAddMemberFiles").slideUp(function() { + $("#userAddFiles").prop("checked", false).trigger("change"); + }); + } +}).trigger("change"); diff --git a/core/module/user/view/add/add.php b/core/module/user/view/add/add.php index ad80e4d1..e0f42653 100644 --- a/core/module/user/view/add/add.php +++ b/core/module/user/view/add/add.php @@ -46,6 +46,11 @@ 'label' => 'Groupe', 'selected' => self::GROUP_MEMBER ]); ?> +
    + false + ]); ?> +
    Autorisations :