diff options
author | Ted Trask <ttrask01@yahoo.com> | 2010-01-13 16:06:52 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2010-01-13 16:06:52 +0000 |
commit | 301c747b1f0532d81e4a919a09ad80026460c96b (patch) | |
tree | c795b527baf297329d616e91b462981f08aa537f | |
parent | 10137bade6701598f212c73e51f605f2cec56aee (diff) | |
download | acf-alpine-baselayout-301c747b1f0532d81e4a919a09ad80026460c96b.tar.bz2 acf-alpine-baselayout-301c747b1f0532d81e4a919a09ad80026460c96b.tar.xz |
Moved skins to acf-core.
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | alpine-baselayout.roles | 4 | ||||
-rw-r--r-- | skins-controller.lua | 14 | ||||
-rw-r--r-- | skins-model.lua | 49 | ||||
-rw-r--r-- | skins-read-html.lsp | 17 | ||||
-rw-r--r-- | skins.menu | 2 |
6 files changed, 2 insertions, 85 deletions
@@ -10,7 +10,6 @@ APP_DIST=\ interfaces* \ logfiles* \ syslog* \ - skins* \ rc* \ password* \ modules* \ diff --git a/alpine-baselayout.roles b/alpine-baselayout.roles index a6359b3..23cae01 100644 --- a/alpine-baselayout.roles +++ b/alpine-baselayout.roles @@ -1,5 +1,5 @@ GUEST=hostname:read -USER=cron:status,cron:startstop,health:system,health:storage,health:proc,health:network,health:modules,health:networkstats,interfaces:status,interfaces:read,interfaces:restart,logfiles:status,logfiles:view,logfiles:download,logfiles:tail,modules:status,skins:update,skins:read,syslog:status,syslog:loginfo,syslog:startstop,rc:status +USER=cron:status,cron:startstop,health:system,health:storage,health:proc,health:network,health:modules,health:networkstats,interfaces:status,interfaces:read,interfaces:restart,logfiles:status,logfiles:view,logfiles:download,logfiles:tail,modules:status,syslog:status,syslog:loginfo,syslog:startstop,rc:status EDITOR=cron:listjobs,hostname:edit,interfaces:delete,interfaces:create,interfaces:update,interfaces:ifup,interfaces:ifdown,logfiles:delete,syslog:config,rc:edit EXPERT=cron:editjob,cron:deletejob,cron:movejob,cron:createjob,cron:expert,syslog:expert,interfaces:editintfile,modules:edit,modules:reload -ADMIN=cron:status,cron:startstop,cron:listjobs,cron:editjob,cron:deletejob,cron:movejob,cron:createjob,cron:expert,hostname:read,health:system,health:storage,health:proc,health:network,health:modules,health:networkstats,interfaces:status,interfaces:read,interfaces:restart,logfiles:status,logfiles:view,logfiles:download,logfiles:tail,modules:status,skins:update,skins:read,syslog:status,syslog:loginfo,syslog:startstop,rc:status,hostname:edit,interfaces:delete,interfaces:create,interfaces:update,interfaces:ifup,interfaces:ifdown,logfiles:delete,syslog:config,rc:edit,syslog:expert,interfaces:editintfile,modules:edit,modules:reload,password:edit +ADMIN=cron:status,cron:startstop,cron:listjobs,cron:editjob,cron:deletejob,cron:movejob,cron:createjob,cron:expert,hostname:read,health:system,health:storage,health:proc,health:network,health:modules,health:networkstats,interfaces:status,interfaces:read,interfaces:restart,logfiles:status,logfiles:view,logfiles:download,logfiles:tail,modules:status,syslog:status,syslog:loginfo,syslog:startstop,rc:status,hostname:edit,interfaces:delete,interfaces:create,interfaces:update,interfaces:ifup,interfaces:ifdown,logfiles:delete,syslog:config,rc:edit,syslog:expert,interfaces:editintfile,modules:edit,modules:reload,password:edit diff --git a/skins-controller.lua b/skins-controller.lua deleted file mode 100644 index 5d4d0d7..0000000 --- a/skins-controller.lua +++ /dev/null @@ -1,14 +0,0 @@ -module (..., package.seeall) - --- Public methods - -default_action = "read" - -read = function (self ) - return self.model.get(self) -end - -update = function (self ) - return self:redirect_to_referrer(self.model.update(self, self.clientdata.skin or "")) -end - diff --git a/skins-model.lua b/skins-model.lua deleted file mode 100644 index 8b5a57e..0000000 --- a/skins-model.lua +++ /dev/null @@ -1,49 +0,0 @@ --- acf model for displaying logfiles recusivly -module (..., package.seeall) - -require("fs") -require("format") - -local function set_skins(self, skin) - local content = "\n"..(fs.read_file(self.conf.conffile) or "") - local count - content,count = string.gsub(content, "\n%s*skin%s*=[^\n]*", "\nskin="..format.escapespecialcharacters(skin)) - if count == 0 then - content = "\nskin="..format.escapespecialcharacters(skin)..content - end - fs.write_file(self.conf.conffile, string.sub(content,2)) - local cmdoutput = "New skin selected" - return cmdoutput, errtxt -end - -local function list_skins(self) - local skinarray = {} - for i,file in ipairs(posix.dir(self.conf.wwwdir ..self.conf.skindir) or {}) do - -- Ignore files that begins with a '.' and 'cgi-bin' and only list folders - if not ((string.match(file, "^%.")) or (string.match(file, "^cgi[-]bin")) or (string.match(file, "^static")) or (posix.stat(self.conf.wwwdir .. self.conf.skindir .. file).type ~= "directory")) then - local entry = cfe({ value=file, label="Skin name" }) - local current = conf.skin - entry.inuse = (file == current) - table.insert(skinarray, entry) - end - end - return cfe({ type="list", value=skinarray, label="Skins" }) -end - - -get = function (self) - return list_skins(self) -end - -update = function (self, newskin) - -- Make sure no one can inject code into the model. - local availableskins = list_skins(self) - local cmdoutput = "Failed to set skin" - local errtxt = "Invalid selection" - for i,skin in ipairs(availableskins.value) do - if ( skin.value == newskin) then - cmdoutput, errtxt = set_skins(self, newskin) - end - end - return cfe({ value=cmdoutput, errtxt=errtxt, label="Set skin result" }) -end diff --git a/skins-read-html.lsp b/skins-read-html.lsp deleted file mode 100644 index 95547a5..0000000 --- a/skins-read-html.lsp +++ /dev/null @@ -1,17 +0,0 @@ -<% local view, viewlibrary, page_info, session = ... %> -<% require("viewfunctions") %> - -<% displaycommandresults({"update"}, session) %> - -<h1>Available skins</h1> - -<DL> -<% for i,skin in ipairs(view.value) do %> - <dt><%= html.html_escape(skin.value) %></dt> - <% if (skin.inuse) then %> - <dd>in use</dd> - <% else %> - <dd>[<a href="update?skin=<%= html.html_escape(skin.value) %>">use this skin</a>]</dd> - <% end %> -<% end %> -</DL> diff --git a/skins.menu b/skins.menu deleted file mode 100644 index bd98be6..0000000 --- a/skins.menu +++ /dev/null @@ -1,2 +0,0 @@ -#CAT GROUP/DESC TAB ACTION -System 98Skins Status read |