applications/luci-samba: forgot to commit a change of #117
[project/luci.git] / applications / luci-samba / luasrc / model / cbi / samba.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
6
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
10
11         http://www.apache.org/licenses/LICENSE-2.0
12
13 $Id$
14 ]]--
15
16 m = Map("samba", translate("Network Shares"))
17
18 s = m:section(TypedSection, "samba", "Samba")
19 s.anonymous = true
20
21 s:option(Value, "name", translate("Hostname"))
22 s:option(Value, "description", translate("Description"))
23 s:option(Value, "workgroup", translate("Workgroup"))
24 s:option(Flag, "homes", translate("Share home-directories"),
25         translate("Allow system users to reach their home directories via " ..
26                 "network shares"))
27
28
29 s = m:section(TypedSection, "sambashare", translate("Shared Directories"))
30 s.anonymous = true
31 s.addremove = true
32 s.template = "cbi/tblsection"
33
34 s:option(Value, "name", translate("Name"))
35 pth = s:option(Value, "path", translate("Path"))
36 if nixio.fs.access("/etc/config/fstab") then
37         pth.titleref = luci.dispatcher.build_url("admin", "system", "fstab")
38 end
39
40 s:option(Value, "users", translate("Allowed users")).rmempty = true
41
42 ro = s:option(Flag, "read_only", translate("Read-only"))
43 ro.rmempty = false
44 ro.enabled = "yes"
45 ro.disabled = "no"
46
47 go = s:option(Flag, "guest_ok", translate("Allow guests"))
48 go.rmempty = false
49 go.enabled = "yes"
50 go.disabled = "no"
51
52 cm = s:option(Value, "create_mask", translate("Create mask"),
53         translate("Mask for new files"))
54 cm.rmempty = true
55 cm.size = 4
56
57 dm = s:option(Value, "dir_mask", translate("Directory mask"),
58         translate("Mask for new directories"))
59 dm.rmempty = true
60 dm.size = 4
61
62
63 return m