2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
16 m = Map("samba", translate("Network Shares"))
18 s = m:section(TypedSection, "samba", "Samba")
21 s:tab("general", translate("General Settings"))
22 s:tab("template", translate("Edit Template"))
24 s:taboption("general", Value, "name", translate("Hostname"))
25 s:taboption("general", Value, "description", translate("Description"))
26 s:taboption("general", Value, "workgroup", translate("Workgroup"))
27 s:taboption("general", Value, "homes", translate("Share home-directories"),
28 translate("Allow system users to reach their home directories via " ..
31 tmpl = s:taboption("template", Value, "_tmpl",
32 translate("Edit the template that is used for generating the samba configuration."),
33 translate("This is the content of the file '/etc/samba/smb.conf.template' from which your samba configuration will be generated. " ..
34 "Values enclosed by pipe symbols ('|') should not be changed. They get their values from the 'General Settings' tab."))
36 tmpl.template = "cbi/tvalue"
39 function tmpl.cfgvalue(self, section)
40 return nixio.fs.readfile("/etc/samba/smb.conf.template")
43 function tmpl.write(self, section, value)
44 value = value:gsub("\r\n?", "\n")
45 nixio.fs.writefile("//etc/samba/smb.conf.template", value)
49 s = m:section(TypedSection, "sambashare", translate("Shared Directories"))
52 s.template = "cbi/tblsection"
54 s:option(Value, "name", translate("Name"))
55 pth = s:option(Value, "path", translate("Path"))
56 if nixio.fs.access("/etc/config/fstab") then
57 pth.titleref = luci.dispatcher.build_url("admin", "system", "fstab")
60 s:option(Value, "users", translate("Allowed users")).rmempty = true
62 ro = s:option(Flag, "read_only", translate("Read-only"))
67 go = s:option(Flag, "guest_ok", translate("Allow guests"))
72 cm = s:option(Value, "create_mask", translate("Create mask"),
73 translate("Mask for new files"))
77 dm = s:option(Value, "dir_mask", translate("Directory mask"),
78 translate("Mask for new directories"))