1 -- Licensed to the public under the Apache License 2.0.
3 m = Map("samba4", translate("Network Shares"))
5 s = m:section(TypedSection, "samba", "Samba")
8 s:tab("general", translate("General Settings"))
9 s:tab("template", translate("Edit Template"))
11 s:taboption("general", Value, "name", translate("Hostname"))
12 s:taboption("general", Value, "description", translate("Description"))
13 s:taboption("general", Value, "workgroup", translate("Workgroup"))
14 h = s:taboption("general", Flag, "homes", translate("Share home-directories"),
15 translate("Allow system users to reach their home directories via " ..
18 s:taboption("general", Flag, "disable_netbios", translate("Disable Netbios"))
19 s:taboption("general", Flag, "disable_ad_dc", translate("Disable Active Directory Domain Controller"))
20 s:taboption("general", Flag, "disable_winbind", translate("Disable Winbind"))
22 tmpl = s:taboption("template", Value, "_tmpl",
23 translate("Edit the template that is used for generating the samba configuration."),
24 translate("This is the content of the file '/etc/samba/smb.conf.template' from which your samba configuration will be generated. " ..
25 "Values enclosed by pipe symbols ('|') should not be changed. They get their values from the 'General Settings' tab."))
27 tmpl.template = "cbi/tvalue"
30 function tmpl.cfgvalue(self, section)
31 return nixio.fs.readfile("/etc/samba/smb.conf.template")
34 function tmpl.write(self, section, value)
35 value = value:gsub("\r\n?", "\n")
36 nixio.fs.writefile("/etc/samba/smb.conf.template", value)
40 s = m:section(TypedSection, "sambashare", translate("Shared Directories")
41 , translate("Please add directories to share. Each directory refers to a folder on a mounted device."))
44 s.template = "cbi/tblsection"
46 s:option(Value, "name", translate("Name"))
47 pth = s:option(Value, "path", translate("Path"))
48 if nixio.fs.access("/etc/config/fstab") then
49 pth.titleref = luci.dispatcher.build_url("admin", "system", "fstab")
52 s:option(Value, "users", translate("Allowed users")).rmempty = true
54 ro = s:option(Flag, "read_only", translate("Read-only"))
59 br = s:option(Flag, "browseable", translate("Browseable"))
65 go = s:option(Flag, "guest_ok", translate("Allow guests"))
70 gon = s:option(Flag, "guest_only", translate("Guests only"))
75 io = s:option(Flag, "inherit_owner", translate("Inherit owner"))
80 cm = s:option(Value, "create_mask", translate("Create mask"))
84 dm = s:option(Value, "dir_mask", translate("Directory mask"))
88 s:option(Value, "vfs_objects", translate("Vfs objects")).rmempty = true