Menu="Shares:1"
Title="User Shares"
Cond="$var['fsState']=="Started" && $var['shareUser']=='e'"
---
<?PHP
/* Copyright 2005-2016, Lime Technology
 * Copyright 2012-2016, Bergware International.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 2,
 * as published by the Free Software Foundation.
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 */
?>
<script>
function displayShares(all) {
  if (all == 'yes') $('#share_list').html("<tr><td colspan='8' style='text-align:center'><i class='fa fa-spinner fa-spin icon'></i>Please wait... computing user shares!</td></tr>");
  $.get('/webGui/include/ShareList.php',{compute:all,path:'<?=addslashes(htmlspecialchars($path))?>',prev:'<?=addslashes(htmlspecialchars($prev))?>',scale:'<?=$display['scale']?>',number:'<?=$display['number']?>'},function(data){
    $('#share_list').html(data);
    $('#compute-shares').prop('disabled',!data || data.indexOf('colspan=')!=-1);
  });
}
$(function() {
  displayShares('no');
});
</script>

<table class="share_status share <?=$display['view']?>">
<thead><tr><td style="width:15%">Name</td><td style="width:33%">Comment</td><td>SMB</td><td>NFS</td><td>AFP</td><td>Size</td><td>Free</td><td>View</td></tr></thead>
<tbody id="share_list"></tbody>
</table>
<p><form name="share_form" method="GET" action="<?=htmlspecialchars($path)?>/Share">
<input type="hidden" name="name" value="">
<input id="compute-shares" type="button" value="Compute All" onclick="$(this).prop('disabled',true);displayShares('yes')">
<?if ($var['startMode']=='Normal'):?>
<input type="submit" value="Add Share"<?=$var['shareUser']=='e'?'>':' disabled>User shares must be <strong>enabled</strong> to add shares.'?>
<?else:?>
<input type="submit" value="Add Share" disabled>
<?endif;?>
</form></p>

> **Colored Status Indicator** -- the significance of the color indicator at the beginning of each line in *User Shares* is as follows:
>
> <img src="/webGui/images/green-on.png" class="icon">All files are on protected storage.
>
> <img src="/webGui/images/yellow-on.png" class="icon">Some or all files are on unprotected storage.
>
> **Security modes:**

> + '-' -- user share is not exported and unavailable on the network
> + *Public* -- all users including guests have full read/write access (open access)
> + *Secure* -- all users including guests have read access, write access is set per user (limited access)
> + *Private* -- no guest access at all, read/write or read-only access is set per user (closed access)
>
> **Special modes:**

> + SMB security mode displayed in *italics* indicates exported hidden user shares.
> + AFP security mode displayed in *italics* indicates exported time-machine user shares.
> + NFS does not have special modes for user shares.
