mirror of
https://github.com/unraid/webgui.git
synced 2026-03-10 04:49:14 -05:00
AFP deprecated
This commit is contained in:
@@ -1,80 +0,0 @@
|
||||
Menu="NetworkServices:1"
|
||||
Title="AFP"
|
||||
Icon="icon-apple"
|
||||
Tag="apple"
|
||||
---
|
||||
<?PHP
|
||||
/* Copyright 2005-2020, Lime Technology
|
||||
* Copyright 2012-2020, 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.
|
||||
*/
|
||||
?>
|
||||
<div class='notice' style='margin-bottom:24px'>_(Please note that AFP is **deprecated**, please use SMB instead)_.</div>
|
||||
|
||||
<form markdown="1" method="POST" action="/update.htm" target="progressFrame">
|
||||
_(Enable AFP)_:
|
||||
: <select name="shareAFPEnabled" size="1">
|
||||
<?=mk_option($var['shareAFPEnabled'], "no", _('No'))?>
|
||||
<?=mk_option($var['shareAFPEnabled'], "yes", _('Yes'))?>
|
||||
</select>
|
||||
|
||||
:help81
|
||||
> Select 'Yes' enable [AFP](/Help) protocol support.
|
||||
>
|
||||
> Note: changing this value with array Started may cause a brief interruption in network services.
|
||||
:end
|
||||
|
||||
_(Connected users)_:
|
||||
: <?if ($var['shareAFPEnabled']=="yes"):
|
||||
$AFPUsers = exec("ps anucx|grep -c 'afpd'");
|
||||
if ($AFPUsers>0) $AFPUsers--;
|
||||
echo $AFPUsers;
|
||||
else:
|
||||
echo "<i>"._('not available')."</i>";
|
||||
endif;?>
|
||||
|
||||
|
||||
: <input type="submit" name="changeShare" value="_(Apply)_" disabled><input type="button" value="_(Done)_" onclick="done()">
|
||||
</form>
|
||||
|
||||
:help82
|
||||
> ### Overview
|
||||
> AFP for Unraid includes both `netatalk` to implement Apple Filing Protocol, and `avahi`
|
||||
> to implement Zeroconf, aka, Bonjour.
|
||||
>
|
||||
> As with SMB and NFS, you may export both disk shares and user shares via AFP. There are some important
|
||||
> limitations to be aware of however:
|
||||
>
|
||||
> * You must be very careful when enabling AFP export of a disk share when that disk is also enabled
|
||||
> for user shares. This is because `netatalk` creates several system directories in the root of shares,
|
||||
> and these directories will show up as user shares. To prevent this, you may exclude the disk(s)
|
||||
> from the user share file system on the [Share Settings](/Settings/ShareSettings) page.
|
||||
>
|
||||
> * The netatalk documentation includes a strong warning to not use symlinks anywhere in a file system
|
||||
> being exprted via AFP.
|
||||
>
|
||||
> AFP for Unraid supports Time Machine, and all three security modes.
|
||||
>
|
||||
> ### Bonjour
|
||||
> When AFP is enabled, your server name, with a `-AFP` suffix, should automatically appear in the left-hand pane of
|
||||
> Finder alongside an Xserve icon. Clicking this icon permits you to explore the server shares using AFP protocol.
|
||||
>
|
||||
> In addition, if SMB is enabled, your server name, without any suffix, should also appear. This provides
|
||||
> access to shares using the SMB protocol.
|
||||
>
|
||||
> ### Other notes
|
||||
> [Prevent .DS_Store file creation on network volumes](http://hints.macworld.com/article.php?story=2005070300463515) - from the article:
|
||||
>
|
||||
> To prevent the creation of these files, open the Terminal and type:
|
||||
>
|
||||
> defaults write com.apple.desktopservices DSDontWriteNetworkStores true
|
||||
>
|
||||
> It may be necessary to log out and back in, or even to restart the computer for the change to take effect
|
||||
> (this is what the article states).
|
||||
:end
|
||||
@@ -100,7 +100,7 @@ $wg_up = $wg_up ? explode(' ',$wg_up) : [];
|
||||
$up = count($wg_up);
|
||||
$down = max(count($conf)-$up,0);
|
||||
$fans = exec("sensors -uA 2>/dev/null|grep -c 'fan[0-9]_input'");
|
||||
$group = $var['shareSMBEnabled']=='yes' | $var['shareAFPEnabled']=='yes' | $var['shareNFSEnabled']=='yes';
|
||||
$group = $var['shareSMBEnabled']=='yes' | $var['shareNFSEnabled']=='yes';
|
||||
$url = "/webGui/include/DashUpdate.php";
|
||||
|
||||
$names = [];
|
||||
@@ -393,9 +393,6 @@ foreach ($ports as $port) {
|
||||
<?if ($var['shareSMBEnabled']=='yes'):?>
|
||||
<?=mk_option("", "0", "SMB")?>
|
||||
<?endif;?>
|
||||
<?if ($var['shareAFPEnabled']=='yes'):?>
|
||||
<?=mk_option("", "1", "AFP")?>
|
||||
<?endif;?>
|
||||
<?if ($var['shareNFSEnabled']=='yes'):?>
|
||||
<?=mk_option("", "2", "NFS")?>
|
||||
<?endif;?>
|
||||
@@ -419,19 +416,6 @@ foreach ($shares as $name => $share) {
|
||||
if (!count($shares)) echo "<tr><td></td><td colspan='4' class='none'>"._('No shares present')."</td><td></td></tr>";
|
||||
?></tbody>
|
||||
<?endif;?>
|
||||
<?if ($var['shareAFPEnabled']=='yes'):?>
|
||||
<tbody sort='<?=$N?>' class='afp share share2 sortable'><?
|
||||
foreach ($shares as $name => $share) {
|
||||
$list = "<a href=\"$path/Share?name=".urlencode($name)."\" class=\"blue-text\" title=\"$name settings\">".truncate($name,20)."</a>";
|
||||
if ($share['luksStatus']>0) $list = str_replace('blue-text','green-text',$list);
|
||||
elseif ($share['useCache']=='only') $list = str_replace('blue-text','orange-text',$list);
|
||||
$comment = truncate($share['comment'],40);
|
||||
$security = export_settings($var['shareAFPEnabled'], $sec_afp[$name]);
|
||||
echo "<tr><td></td><td><i class='icon-folder'></i>$list</td><td>$comment</td><td>$security</td><td>-</td><td></td></tr>";
|
||||
}
|
||||
if (!count($shares)) echo "<tr><td></td><td colspan='4' class='none'>"._('No shares present')."</td><td></td></tr>";
|
||||
?></tbody>
|
||||
<?endif;?>
|
||||
<?if ($var['shareNFSEnabled']=='yes'):?>
|
||||
<tbody sort='<?=$N?>' class='nfs share share3 sortable'><?
|
||||
foreach ($shares as $name => $share) {
|
||||
@@ -492,38 +476,6 @@ foreach ($users as $user) {
|
||||
}
|
||||
?></tbody>
|
||||
<?endif;?>
|
||||
<?if ($var['shareAFPEnabled']=='yes'):?>
|
||||
<tbody sort='<?=$N?>' class='afp user user2 sortable'><?
|
||||
foreach ($users as $user) {
|
||||
$name = $user['name'];
|
||||
$list = "<a href=\"$path/UserEdit?name=".urlencode($name)."\" class=\"blue-text\" title=\"$name settings\">".truncate($name,20)."</a>";
|
||||
$desc = truncate($user['desc'],40);
|
||||
if ($name=='root') {
|
||||
$write = '-'; $read = '-';
|
||||
} else {
|
||||
$write = 0; $read = 0;
|
||||
foreach ($shares as $share) {
|
||||
$access = $sec_afp[$share['name']];
|
||||
if ($access['export']=='-') continue;
|
||||
switch ($access['security']) {
|
||||
case 'public':
|
||||
$write++;
|
||||
break;
|
||||
case 'secure':
|
||||
if (in_array($name,explode(',',$access['writeList']))) $write++; else $read++;
|
||||
break;
|
||||
case 'private':
|
||||
if (in_array($name,explode(',',$access['writeList']))) $write++;
|
||||
if (in_array($name,explode(',',$access['readList']))) $read++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($user['passwd']!='yes') $list = str_replace('blue-text','orange-text',$list);
|
||||
echo "<tr><td></td><td><i class='icon-user'></i>$list</td><td>$desc</td><td>$write</td><td>$read</td><td></td></tr>";
|
||||
}
|
||||
?></tbody>
|
||||
<?endif;?>
|
||||
<?if ($var['shareNFSEnabled']=='yes'):?>
|
||||
<tbody sort='<?=$N?>' class='nfs user user3 sortable'><?
|
||||
foreach ($users as $user) {
|
||||
@@ -673,10 +625,6 @@ function changeMode(item) {
|
||||
if (item==0 && user==null) $('.smb.user1').show(); else $('.smb.user1').hide();
|
||||
if (item==0 && share==null) $('.smb.share1').show(); else $('.smb.share1').hide();
|
||||
<?endif;?>
|
||||
<?if ($var['shareAFPEnabled']=='yes'):?>
|
||||
if (item==1 && user==null) $('.afp.user2').show(); else $('.afp.user2').hide();
|
||||
if (item==1 && share==null) $('.afp.share2').show(); else $('.afp.share2').hide();
|
||||
<?endif;?>
|
||||
<?if ($var['shareNFSEnabled']=='yes'):?>
|
||||
if (item==2 && user==null) $('.nfs.user3').show(); else $('.nfs.user3').hide();
|
||||
if (item==2 && share==null) $('.nfs.share3').show(); else $('.nfs.share3').hide();
|
||||
@@ -774,7 +722,7 @@ function update5() {
|
||||
}
|
||||
function update15() {
|
||||
<?if ($var['fsState']=='Started' && $group):?>
|
||||
var tag = $('.smb').is(':visible') ? 'smb' : $('.afp').is(':visible') ? 'afp' : $('.nfs').is(':visible') ? 'nfs' : '';
|
||||
var tag = $('.smb').is(':visible') ? 'smb' : $('.nfs').is(':visible') ? 'nfs' : '';
|
||||
$.post('<?=$url?>',{cmd:'shares',com:tag,names:'<?=addslashes(htmlspecialchars($names))?>'},function(data) {
|
||||
$.each(data.split('\0'),function(k,v) {$('#share'+(k+1)).html(v);});
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@ $(function() {
|
||||
</script>
|
||||
|
||||
<table class="share_status share">
|
||||
<thead><tr><td style="width:15%">_(Name)_</td><td style="width:33%">_(Comment)_</td><td>_(SMB)_</td><td>_(NFS)_</td><td>_(AFP)_</td><td style="width:8%">_(Type)_</td><td style="width:8%">_(Size)_</td><td style="width:8%">_(Free)_</td><td style="width:4%">_(View)_</td></tr></thead>
|
||||
<thead><tr><td style="width:15%">_(Name)_</td><td style="width:30%">_(Comment)_</td><td>_(SMB)_</td><td>_(NFS)_</td><td style="width:10%">_(Type)_</td><td style="width:10%">_(Size)_</td><td style="width:10%">_(Free)_</td><td style="width:4%">_(View)_</td></tr></thead>
|
||||
<tbody id="disk_list"></tbody>
|
||||
</table>
|
||||
<p><input id="compute-disks" type="button" value="_(Compute All)_" onclick="$(this).prop('disabled',true);displayDisks('yes')"></p>
|
||||
@@ -56,6 +56,5 @@ $(function() {
|
||||
> **Special modes:**
|
||||
|
||||
> + SMB security mode displayed in *italics* indicates exported hidden disk shares.
|
||||
> + AFP security mode displayed in *italics* indicates exported time-machine disk shares.
|
||||
> + NFS does not have special modes for disk shares.
|
||||
:end
|
||||
|
||||
@@ -1,364 +0,0 @@
|
||||
Menu="Disk Share"
|
||||
Title="AFP Security Settings"
|
||||
Tag="apple"
|
||||
Cond="(($var['shareAFPEnabled']!='no') && (isset($name)?array_key_exists($name,$sec_afp):0))"
|
||||
---
|
||||
<?PHP
|
||||
/* Copyright 2005-2020, Lime Technology
|
||||
* Copyright 2012-2020, 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.
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once "$docroot/webGui/include/InputSecurity.php";
|
||||
|
||||
$width = [123,300];
|
||||
?>
|
||||
:help22
|
||||
> This section is used to configure the security settings for the share when accessed using AFP and
|
||||
> appears only when AFP is enabled on the Network Services page.
|
||||
>
|
||||
> *Read settings from* is used to preset the AFP security settings of the current selected share with the settings of an existing share.
|
||||
>
|
||||
> Select the desired share name and press **Read** to copy the AFP security settings from the selected source.
|
||||
>
|
||||
> *Write settings to* is used to copy the AFP security settings of the current selected share to one or more other existing shares.
|
||||
>
|
||||
> Select the desired destinations and press **Write** to copy the AFP security settings to the selected shares.
|
||||
:end
|
||||
|
||||
<div class="clone1">
|
||||
<span class="clone">_(Read settings from)_</span><i class="fa fa-arrow-left fa-fw"></i>
|
||||
<span class="wrap"><select name="readafp" class="clone" onchange="toggleButton('readafp',false)">
|
||||
<option disabled selected>_(select)_...</option>
|
||||
<?
|
||||
if (isset($disks[$name])) {
|
||||
foreach (array_filter($disks,'clone_list') as $list) if ($list['name']!=$name) echo mk_option("", $list['name'], my_lang(my_disk($list['name']),3));
|
||||
} else {
|
||||
foreach ($shares as $list) if ($list['name']!=$name) echo mk_option("", $list['name'], $list['name']);
|
||||
}
|
||||
?>
|
||||
</select></span><input type="button" id="readafp" value="_(Read)_" class="clone" onclick="readAFP()" disabled>
|
||||
</div>
|
||||
<div class="clone2">
|
||||
<span class="clone">_(Write settings to)_</span><i class="fa fa-arrow-right fa-fw"></i>
|
||||
<span class="wrap"><select id="afp1" name="writeafp" multiple="multiple" style="display:none" onchange="toggleButton('writeafp',this.id)">
|
||||
<?
|
||||
$rows = [];
|
||||
if (isset($disks[$name])) {
|
||||
foreach (array_filter($disks,'clone_list') as $list) if ($list['name']!=$name) $rows[] = mk_option("", $list['name'], my_lang(my_disk($list['name']),3));
|
||||
} else {
|
||||
foreach ($shares as $list) if ($list['name']!=$name) $rows[] = mk_option("", $list['name'], $list['name']);
|
||||
}
|
||||
if ($rows) echo "<option>("._('All').")</option>";
|
||||
foreach ($rows as $row) echo $row;
|
||||
?>
|
||||
</select></span><input type="button" id="writeafp" value="_(Write)_" class="clone" onclick="writeAFP()" disabled>
|
||||
</div>
|
||||
|
||||
<form markdown="1" name="afp_edit" method="POST" action="/update.htm" target="progressFrame" onchange="toggleButton('writeafp',true);$('#afp1').dropdownchecklist('disable')">
|
||||
<input type="hidden" name="shareName" value="<?=htmlspecialchars($name)?>">
|
||||
|
||||
_(Share name)_:
|
||||
: <?=htmlspecialchars($name)?>
|
||||
|
||||
_(Export)_:
|
||||
: <select name="shareExportAFP" onchange="checkShareSettingsAFP(this.form)">
|
||||
<?=mk_option($sec_afp[$name]['export'], "-", _('No'));?>
|
||||
<?=mk_option($sec_afp[$name]['export'], "e", _('Yes'));?>
|
||||
<?=mk_option($sec_afp[$name]['export'], "et", _('Yes (Time Machine)'));?>
|
||||
</select>
|
||||
|
||||
:help23
|
||||
> The Export setting determines whether this share is exported via AFP (Yes or No)
|
||||
> The Export setting also includes a third option (Yes - Time Machine). This setting enables various
|
||||
> special options for Time Machine; in particular a "volume size limit". Note: Apple recommends not
|
||||
> to use the volume for anything but Time Machine due to the way locks are used.
|
||||
:end
|
||||
|
||||
_(Time Machine volume size limit)_:
|
||||
: <input type="text" name="shareVolsizelimitAFP" maxlen="20" value="<?=$sec_afp[$name]['volsizelimit']?>"> MB
|
||||
|
||||
:help24
|
||||
> This limits the reported volume size, preventing Time Machine from using the entire real disk space
|
||||
> for backup. For example, setting this value to "1024" would limit the reported disk space to 1GB.
|
||||
:end
|
||||
|
||||
_(Volume dbpath)_:
|
||||
: <input type="text" name="shareVoldbpathAFP" maxlen="20" value="<?=htmlspecialchars($sec_afp[$name]['voldbpath'])?>">
|
||||
|
||||
:help25
|
||||
> Sets where to store netatalk database information. A directory with same name as the share will be
|
||||
> created here.
|
||||
>
|
||||
> Leave this field blank to have the database created in the root of the share.
|
||||
:end
|
||||
|
||||
_(Security)_:
|
||||
: <select name="shareSecurityAFP">
|
||||
<?=mk_option($sec_afp[$name]['security'], "public", _('Public'));?>
|
||||
<?=mk_option($sec_afp[$name]['security'], "secure", _('Secure'));?>
|
||||
<?=mk_option($sec_afp[$name]['security'], "private", _('Private'));?>
|
||||
</select>
|
||||
|
||||
:help26
|
||||
> The Unraid AFP implementation supports Guest access and fully supports the three security
|
||||
> modes: Public, Secure, and Private.
|
||||
> In general, when you click on your server's icon in Finder, you will be asked to log in as Guest or to
|
||||
> specify a set of login credentials (user name/password). In order to use Secure or Private security on
|
||||
> a share, you must have a user already defined on the server with appropriate access rights.
|
||||
>
|
||||
> Note: netatalk does not permit the user name <tt>root</tt> to be used for log in purposes.
|
||||
>
|
||||
> **Public** When logged into the server as Guest, a macOS user can view and read/write all shares set as
|
||||
> Public. Files created or modified in the share will be owned by user `nobody` of
|
||||
> the `users` group.<br>
|
||||
> macOS users logged in with a user name/password previously created on the server can also view
|
||||
> and read/write all shares set as Public. In this case, files created or modified on the server will
|
||||
> be owned by the logged in user.
|
||||
>
|
||||
> **Secure** When logged into the server as Guest, a macOS user can view and read (but not write) all
|
||||
> shares set as Secure.<br>
|
||||
> macOS users logged in with a user name/password previously created on the server can also view and
|
||||
> read all shares set as Secure. If their access right is set to read/write for the share on the server,
|
||||
> they may also write the share.
|
||||
>
|
||||
> **Private** When logged onto the server as Guest, no Private shares are visible or accessible to any
|
||||
> macOS user.<br>
|
||||
> macOS users logged in with a user name/password previously created on the server may read or
|
||||
> read/write (or have no access) according their access right for the share on the server.
|
||||
:end
|
||||
|
||||
|
||||
: <input type="submit" name="changeShareSecurityAFP" value="_(Apply)_" disabled><input type="button" value="_(Done)_" onclick="done()">
|
||||
</form>
|
||||
|
||||
<?if ($sec_afp[$name]['security'] == 'secure'):?>
|
||||
<div id="title" class="nocontrol"><dt>_(AFP)_ _(User Access)_</dt><i>_(Guests have **read-only** access)_.</i></div>
|
||||
|
||||
:help27
|
||||
> *Read settings from* is used to preset the AFP User Access settings of the current selected share with the settings of an existing share.
|
||||
>
|
||||
> Select the desired share name and press **Read** to copy the AFP security settings from the selected source.
|
||||
>
|
||||
> *Write settings to* is used to copy the AFP User Access settings of the current share to one or more other existing shares.
|
||||
>
|
||||
> Select the desired destinations and press **Write** to copy the AFP User access settings to the selected shares.
|
||||
:end
|
||||
|
||||
<div class="clone1">
|
||||
<span class="clone">_(Read settings from)_</span><i class="fa fa-arrow-left fa-fw"></i>
|
||||
<span class="wrap"><select name="readuserafp" class="clone" onchange="toggleButton('readuserafp',false)">
|
||||
<option disabled selected>_(select)_...</option>
|
||||
<?
|
||||
if (isset($disks[$name])) {
|
||||
foreach (array_filter($disks,'clone_list') as $list) if ($list['name']!=$name && $sec_afp[$list['name']]['security']=='secure') echo mk_option("", $list['name'], my_lang(my_disk($list['name']),3));
|
||||
} else {
|
||||
foreach ($shares as $list) if ($list['name']!=$name && $sec_afp[$list['name']]['security']=='secure') echo mk_option("", $list['name'], $list['name']);
|
||||
}
|
||||
?>
|
||||
</select></span><input type="button" id="readuserafp" value="_(Read)_" class="clone" onclick="readUserAFP()" disabled>
|
||||
</div>
|
||||
<div class="clone2">
|
||||
<span class="clone">_(Write settings to)_</span><i class="fa fa-arrow-right fa-fw"></i>
|
||||
<span class="wrap"><select id="afp2" name="writeuserafp" multiple="multiple" style="display:none" onchange="toggleButton('writeuserafp',this.id)">
|
||||
<?
|
||||
$rows = [];
|
||||
if (isset($disks[$name])) {
|
||||
foreach (array_filter($disks,'clone_list') as $list) if ($list['name']!=$name && $sec_afp[$list['name']]['security']=='secure') $rows[] = mk_option("", $list['name'], my_lang(my_disk($list['name']),3));
|
||||
} else {
|
||||
foreach ($shares as $list) if ($list['name']!=$name && $sec_afp[$list['name']]['security']=='secure') $rows[] = mk_option("", $list['name'], $list['name']);
|
||||
}
|
||||
if ($rows) echo "<option>("._('All').")</option>";
|
||||
foreach ($rows as $row)echo $row;
|
||||
?>
|
||||
</select></span><input type="button" id="writeuserafp" value="_(Write)_" class="clone" onclick="writeUserAFP()" disabled>
|
||||
</div>
|
||||
|
||||
<form markdown="1" name="afp_user_edit" method="POST" action="/update.htm" target="progressFrame" onchange="toggleButton('writeuserafp',true);$('#afp2').dropdownchecklist('disable')">
|
||||
<input type="hidden" name="shareName" value="<?=htmlspecialchars($name)?>">
|
||||
<?input_secure_users($sec_afp);?>
|
||||
|
||||
|
||||
: <input type="submit" name="changeShareAccessAFP" value="_(Apply)_" disabled><input type="button" value="_(Done)_" onclick="done()">
|
||||
</form>
|
||||
|
||||
<?elseif ($sec_afp[$name]['security'] == 'private'):?>
|
||||
<div id="title" class="nocontrol"><dt>_(AFP)_ _(User Access)_</dt><i>_(Guests have **no** access)_.</i></div>
|
||||
|
||||
:help28
|
||||
> *Read settings from* is used to preset the AFP User Access settings of the current selected share with the settings of an existing share.
|
||||
>
|
||||
> Select the desired share name and press **Read** to copy the AFP security settings from the selected source.
|
||||
>
|
||||
> *Write settings to* is used to copy the AFP User Access settings of the current share to one or more other existing shares.
|
||||
>
|
||||
> Select the desired destinations and press **Write** to copy the AFP User access settings to the selected shares.
|
||||
:end
|
||||
|
||||
<div class="clone1">
|
||||
<span class="clone">_(Read settings from)_</span><i class="fa fa-arrow-left fa-fw"></i>
|
||||
<span class="wrap"><select name="readuserafp" class="clone" onchange="toggleButton('readuserafp',false)">
|
||||
<option disabled selected>_(select)_...</option>
|
||||
<?
|
||||
if (isset($disks[$name])) {
|
||||
foreach (array_filter($disks,'clone_list') as $list) if ($list['name']!=$name && $sec_afp[$list['name']]['security']=='private') echo mk_option("", $list['name'], my_lang(my_disk($list['name']),3));
|
||||
} else {
|
||||
foreach ($shares as $list) if ($list['name']!=$name && $sec_afp[$list['name']]['security']=='private') echo mk_option("", $list['name'], $list['name']);
|
||||
}
|
||||
?>
|
||||
</select></span><input type="button" id="readuserafp" value="_(Read)_" class="clone" onclick="readUserAFP()" disabled>
|
||||
</div>
|
||||
<div class="clone2">
|
||||
<span class="clone">_(Write settings to)_</span><i class="fa fa-arrow-right fa-fw"></i>
|
||||
<span class="wrap"><select id="afp2" name="writeuserafp" multiple="multiple" style="display:none" onchange="toggleButton('writeuserafp',this.id)">
|
||||
<?
|
||||
$rows = [];
|
||||
if (isset($disks[$name])) {
|
||||
foreach (array_filter($disks,'clone_list') as $list) if ($list['name']!=$name && $sec_afp[$list['name']]['security']=='private') $rows[] = mk_option("", $list['name'], my_lang(my_disk($list['name']),3));
|
||||
} else {
|
||||
foreach ($shares as $list) if ($list['name']!=$name && $sec_afp[$list['name']]['security']=='private') $rows[] = mk_option("", $list['name'], $list['name']);
|
||||
}
|
||||
if ($rows) echo "<option>("._('All').")</option>";
|
||||
foreach($rows as $row) echo $row;
|
||||
?>
|
||||
</select></span><input type="button" id="writeuserafp" value="_(Write)_" class="clone" onclick="writeUserAFP()" disabled>
|
||||
</div>
|
||||
|
||||
<form markdown="1" name="afp_user_edit" method="POST" action="/update.htm" target="progressFrame" onchange="toggleButton('writeuserafp',true);$('#afp2').dropdownchecklist('disable')">
|
||||
<input type="hidden" name="shareName" value="<?=htmlspecialchars($name)?>">
|
||||
<?input_private_users($sec_afp);?>
|
||||
|
||||
|
||||
: <input type="submit" name="changeShareAccessAFP" value="_(Apply)_" disabled><input type="button" value="_(Done)_" onclick="done()">
|
||||
</form>
|
||||
<?endif;?>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
checkShareSettingsAFP(document.afp_edit);
|
||||
initDropdownAFP(false);
|
||||
<?if ($tabbed):?>
|
||||
$('<?=$path=='Shares/Share'?'#tab2':'#tab1'?>').bind({click:function(){initDropdownAFP(true);}});
|
||||
<?endif;?>
|
||||
<?if (count($users)==1):?>
|
||||
toggleButton('readuserafp',true);
|
||||
toggleButton('writeuserafp',true);
|
||||
$('#afp2').dropdownchecklist('disable');
|
||||
<?endif;?>
|
||||
});
|
||||
function checkShareSettingsAFP(form) {
|
||||
form.shareVolsizelimitAFP.disabled = form.shareExportAFP.value!="et";
|
||||
}
|
||||
function initDropdownAFP(reset) {
|
||||
if (reset) {
|
||||
$('#afp1').dropdownchecklist('destroy');
|
||||
$('#afp2').dropdownchecklist('destroy');
|
||||
}
|
||||
$("#afp1").dropdownchecklist({firstItemChecksAll:true, emptyText:'_(select)_...', width:<?=$width[0]?>, explicitClose:'..._(close)_'});
|
||||
$("#afp2").dropdownchecklist({firstItemChecksAll:true, emptyText:'_(select)_...', width:<?=$width[0]?>, explicitClose:'..._(close)_'});
|
||||
}
|
||||
function readAFP() {
|
||||
var form = document.afp_edit;
|
||||
var name = $('select[name="readafp"]').val();
|
||||
$.get('/webGui/include/ProtocolData.php',{protocol:'afp',name:name},function(json) {
|
||||
var data = $.parseJSON(json);
|
||||
form.shareExportAFP.value = data.export;
|
||||
form.shareVolsizelimitAFP.value = data.volsizelimit;
|
||||
form.shareVoldbpathAFP.value = data.voldbpath;
|
||||
form.shareSecurityAFP.value = data.security;
|
||||
});
|
||||
$(form).find('select').trigger('change');
|
||||
}
|
||||
function writeAFP(data,n,i) {
|
||||
if (data) {
|
||||
if (n<i) {
|
||||
$.post('/update.htm',data[n], function(){setTimeout(function(){writeAFP(data,++n,i);},3000);});
|
||||
} else {
|
||||
toggleButton('writeafp',false);
|
||||
$('div.spinner.fixed').hide();
|
||||
}
|
||||
} else {
|
||||
$('select#afp1 option').map(function(i) {
|
||||
if ($(this).prop('selected')==true && $(this).val()!='(_(All)_)') {
|
||||
data[i] = {};
|
||||
data[i]['shareName'] = $(this).val();
|
||||
data[i]['shareExportAFP'] = '<?=addslashes(htmlspecialchars($sec_afp[$name]['export']))?>';
|
||||
data[i]['shareVolsizelimitAFP'] = '<?=addslashes(htmlspecialchars($sec_afp[$name]['volsizelimit']))?>';
|
||||
data[i]['shareVoldbpathAFP'] = '<?=addslashes(htmlspecialchars($sec_afp[$name]['voldbpath']))?>';
|
||||
data[i]['shareSecurityAFP'] = '<?=addslashes(htmlspecialchars($sec_afp[$name]['security']))?>';
|
||||
data[i]['changeShareSecurityAFP'] = 'Apply';
|
||||
i++;
|
||||
}
|
||||
});
|
||||
toggleButton('writeafp',true);
|
||||
$('div.spinner.fixed').show('slow');
|
||||
writeAFP(data,0,i);
|
||||
}
|
||||
}
|
||||
function readUserAFP() {
|
||||
var form = document.afp_user_edit;
|
||||
var name = $('select[name="readuserafp"]').val();
|
||||
var users = {};
|
||||
<?
|
||||
foreach ($users as $user) {
|
||||
if ($user['name'] == "root") continue;
|
||||
echo "users['{$user['name']}'] = {$user['idx']};\n";
|
||||
}
|
||||
?>
|
||||
$.get('/webGui/include/ProtocolData.php',{protocol:'afp',name:name},function(json) {
|
||||
var data = $.parseJSON(json);
|
||||
var readList = data.readList.split(',');
|
||||
var writeList = data.writeList.split(',');
|
||||
$(form).find('select[name^="userAccess."]').each(function(){$(this).val('no-access');});
|
||||
for (var i=0; i < readList.length; i++) $(form).find('select[name="userAccess.'+users[readList[i]]+'"]').val('read-only');
|
||||
for (var i=0; i < writeList.length; i++) $(form).find('select[name="userAccess.'+users[writeList[i]]+'"]').val('read-write');
|
||||
});
|
||||
$(form).find('select').trigger('change');
|
||||
}
|
||||
function writeUserAFP(data,n,i) {
|
||||
if (data) {
|
||||
if (n<i) {
|
||||
$.post('/update.htm',data[n], function(){setTimeout(function(){writeUserAFP(data,++n,i);},3000);});
|
||||
} else {
|
||||
toggleButton('writeuserafp',false);
|
||||
$('div.spinner.fixed').hide();
|
||||
}
|
||||
} else {
|
||||
var data = [], i = 0;
|
||||
$('select#afp2 option').map(function(i) {
|
||||
if ($(this).prop('selected')==true && $(this).val()!='(All)') {
|
||||
data[i] = {};
|
||||
data[i]['shareName'] = $(this).val();
|
||||
data[i]['userAccess.0'] = 'no-access';
|
||||
<?
|
||||
$read_list = explode(",", $sec_afp[$name]['readList']);
|
||||
$write_list = explode(",", $sec_afp[$name]['writeList']);
|
||||
foreach ($users as $user) {
|
||||
if ($user['name'] == "root") continue;
|
||||
$idx = $user['idx'];
|
||||
$userAccess = null;
|
||||
if ($sec_afp[$name]['security']=='secure') {
|
||||
$userAccess = in_array($user['name'], $write_list) ? "read-write" : "read-only";
|
||||
} elseif ($sec_afp[$name]['security'] == 'private') {
|
||||
$userAccess = in_array($user['name'], $write_list) ? "read-write" : (in_array($user['name'], $read_list) ? "read-only" : "no-access");
|
||||
}
|
||||
if ($userAccess) echo "data[i]['userAccess.$idx'] = '$userAccess';\n";
|
||||
}
|
||||
?>
|
||||
data[i]['changeShareAccessAFP'] = 'Apply';
|
||||
i++;
|
||||
}
|
||||
});
|
||||
toggleButton('writeuserafp',true);
|
||||
$('div.spinner.fixed').show('slow');
|
||||
writeUserAFP(data,0,i);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -97,7 +97,6 @@ $(function() {
|
||||
<?if ($tabbed):?>
|
||||
<?
|
||||
$path=='Shares/Share' ? $t=2 : $t=1;
|
||||
if ($var['shareAFPEnabled']!='no') $t++;
|
||||
?>
|
||||
$('#tab<?=$t?>').bind({click:function(){initDropdownNFS(true);}});
|
||||
<?endif;?>
|
||||
|
||||
@@ -34,7 +34,7 @@ $(function() {
|
||||
</script>
|
||||
|
||||
<table class="share_status share">
|
||||
<thead><tr><td style="width:15%">_(Name)_</td><td style="width:33%">_(Comment)_</td><td>_(SMB)_</td><td>_(NFS)_</td><td>_(AFP)_</td><td style="width:8%">_(Cache)_</td><td style="width:8%">_(Size)_</td><td style="width:8%">_(Free)_</td><td style="width:4%">_(View)_</td></tr></thead>
|
||||
<thead><tr><td style="width:15%">_(Name)_</td><td style="width:30%">_(Comment)_</td><td>_(SMB)_</td><td>_(NFS)_</td><td style="width:10%">_(Cache)_</td><td style="width:10%">_(Size)_</td><td style="width:10%">_(Free)_</td><td style="width:4%">_(View)_</td></tr></thead>
|
||||
<tbody id="shareslist"></tbody>
|
||||
</table>
|
||||
<p><form name="share_form" method="POST" action="<?=htmlspecialchars($path)?>/Share?name=">
|
||||
@@ -63,6 +63,5 @@ $(function() {
|
||||
> **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.
|
||||
:end
|
||||
|
||||
@@ -23,7 +23,6 @@ $disks = parse_ini_file('state/disks.ini',true);
|
||||
$var = parse_ini_file('state/var.ini');
|
||||
$sec = parse_ini_file('state/sec.ini',true);
|
||||
$sec_nfs = parse_ini_file('state/sec_nfs.ini',true);
|
||||
$sec_afp = parse_ini_file('state/sec_afp.ini',true);
|
||||
$compute = $_GET['compute'];
|
||||
$path = $_GET['path'];
|
||||
$fill = $_GET['fill'];
|
||||
@@ -92,7 +91,6 @@ foreach ($disks as $name => $disk) {
|
||||
echo "<td>{$disk['comment']}</td>";
|
||||
echo "<td>".disk_share_settings($var['shareSMBEnabled'], $sec[$name])."</td>";
|
||||
echo "<td>".disk_share_settings($var['shareNFSEnabled'], $sec_nfs[$name])."</td>";
|
||||
echo "<td>".disk_share_settings($var['shareAFPEnabled'], $sec_afp[$name])."</td>";
|
||||
$cmd="/webGui/scripts/disk_size"."&arg1=".urlencode($name)."&arg2=ssz2";
|
||||
$type = $disk['rotational'] ? _('HDD') : _('SSD');
|
||||
if (array_key_exists($name, $ssz2)) {
|
||||
|
||||
@@ -41,7 +41,7 @@ function build_pages($pattern) {
|
||||
}
|
||||
|
||||
function find_pages($item) {
|
||||
global $docroot,$site,$var,$disks,$devs,$users,$shares,$sec,$sec_nfs,$sec_afp,$name,$display;
|
||||
global $docroot,$site,$var,$disks,$devs,$users,$shares,$sec,$sec_nfs,$name,$display;
|
||||
$pages = [];
|
||||
foreach ($site as $page) {
|
||||
if (empty($page['Menu'])) continue;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<?
|
||||
switch ($_GET['protocol']) {
|
||||
case 'smb': $data = parse_ini_file('state/sec.ini',true); break;
|
||||
case 'afp': $data = parse_ini_file('state/sec_afp.ini',true); break;
|
||||
case 'nfs': $data = parse_ini_file('state/sec_nfs.ini',true); break;
|
||||
}
|
||||
echo json_encode($data[$_GET['name']]);
|
||||
|
||||
@@ -23,7 +23,6 @@ $disks = parse_ini_file('state/disks.ini',true);
|
||||
$var = parse_ini_file('state/var.ini');
|
||||
$sec = parse_ini_file('state/sec.ini',true);
|
||||
$sec_nfs = parse_ini_file('state/sec_nfs.ini',true);
|
||||
$sec_afp = parse_ini_file('state/sec_afp.ini',true);
|
||||
$compute = $_GET['compute'];
|
||||
$path = $_GET['path'];
|
||||
$fill = $_GET['fill'];
|
||||
@@ -93,7 +92,6 @@ foreach ($shares as $name => $share) {
|
||||
echo "<td>{$share['comment']}</td>";
|
||||
echo "<td>".user_share_settings($var['shareSMBEnabled'], $sec[$name])."</td>";
|
||||
echo "<td>".user_share_settings($var['shareNFSEnabled'], $sec_nfs[$name])."</td>";
|
||||
echo "<td>".user_share_settings($var['shareAFPEnabled'], $sec_afp[$name])."</td>";
|
||||
$cmd="/webGui/scripts/share_size"."&arg1=".urlencode($name)."&arg2=ssz1";
|
||||
$cache = _(ucfirst($share['useCache']));
|
||||
if (array_key_exists($name, $ssz1)) {
|
||||
|
||||
@@ -164,7 +164,6 @@ table.share_status.dashboard tbody.array_view tr:last-child>td{padding-bottom:20
|
||||
table.share_status.dashboard tbody.cache_view tr:last-child>td{padding-bottom:20px}
|
||||
table.share_status.dashboard tbody.extra_view tr:last-child>td{padding-bottom:20px}
|
||||
table.share_status.dashboard tbody.smb tr:last-child>td{padding-bottom:20px}
|
||||
table.share_status.dashboard tbody.afp tr:last-child>td{padding-bottom:20px}
|
||||
table.share_status.dashboard tbody.nfs tr:last-child>td{padding-bottom:20px}
|
||||
table.share_status.dashboard tr>td:first-child{width:3.5%}
|
||||
table.share_status.dashboard tr>td:last-child{width:3.5%}
|
||||
|
||||
@@ -164,7 +164,6 @@ table.share_status.dashboard tbody.array_view tr:last-child>td{padding-bottom:20
|
||||
table.share_status.dashboard tbody.cache_view tr:last-child>td{padding-bottom:20px}
|
||||
table.share_status.dashboard tbody.extra_view tr:last-child>td{padding-bottom:20px}
|
||||
table.share_status.dashboard tbody.smb tr:last-child>td{padding-bottom:20px}
|
||||
table.share_status.dashboard tbody.afp tr:last-child>td{padding-bottom:20px}
|
||||
table.share_status.dashboard tbody.nfs tr:last-child>td{padding-bottom:20px}
|
||||
table.share_status.dashboard tr>td:first-child{width:3.5%}
|
||||
table.share_status.dashboard tr>td:last-child{width:3.5%}
|
||||
|
||||
@@ -30,7 +30,6 @@ $disks = (array)parse_ini_file('state/disks.ini',true);
|
||||
$users = (array)parse_ini_file('state/users.ini',true);
|
||||
$shares = (array)parse_ini_file('state/shares.ini',true);
|
||||
$sec_nfs = (array)parse_ini_file('state/sec_nfs.ini',true);
|
||||
$sec_afp = (array)parse_ini_file('state/sec_afp.ini',true);
|
||||
|
||||
// Read network settings
|
||||
extract(parse_ini_file('state/network.ini',true));
|
||||
|
||||
Reference in New Issue
Block a user