<commit_before>
--[[
LuCI - Lua Configuration Interface

Copyright 2008 <NAME> <<EMAIL>>
Copyright 2011 <NAME> <<EMAIL>>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

$Id$
]]--

--[[
LuCI - Lua Configuration Interface
$Id: users.lua 12/12/2014 by Hostle 
]]--

module("luci.controller.admin.users", package.seeall)

function index()
local fs = require "nixio.fs"
local http = require "luci.http"
local util = require "luci.util"
local sess = luci.http.getcookie("sysauth")
local sdat = (util.ubus("session", "get", { ubus_rpc_session = sess }) or { }).values

--## get user anywhere i can find it ??? ##--
  local function get_user()
  if sdat then 
	  user = sdat.user
	  return(user)
  elseif http.formvalue("username") then
	  user = http.formvalue("username")
	  return(user)
  elseif http.getenv("HTTP_AUTH_USER") then
	  user = http.getenv("HTTP_AUTH_USER")
	  return(user)
  else
	  user = "nobody"
	  return(user)
  end
end

	local user = get_user()
	if user == "root" then
	  entry({"admin", "users"}, alias("admin", "users", "users"), _("Edit Users"), 55).index = true
	  entry({"admin", "users", "users"}, cbi("admin_users/users"), _("User Options"), 60)<commit_msg>Update users.lua<commit_after>
--[[
LuCI - Lua Configuration Interface

Copyright 2008 <NAME> <<EMAIL>>
Copyright 2011 <NAME> <<EMAIL>>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

$Id$
]]--

--[[
LuCI - Lua Configuration Interface
$Id: users.lua 12/12/2014 by Hostle 
]]--

module("luci.controller.admin.users", package.seeall)

function index()
local nw = require "luci.dispatcher"

	local user = nw.get_user()
	if user == "root" then
	  entry({"admin", "users"}, alias("admin", "users", "users"), _("Edit Users"), 55).index = true
	  entry({"admin", "users", "users"}, cbi("admin_users/users"), _("User Options"), 60)
{'fraction_non_alphanumeric': 0.16136576239476147, 'fraction_numerical': 0.02245088868101029, 'mean_word_length': 4.229828850855745, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1890679', 'n_tokens_mistral': 767, 'n_tokens_neox': 703, 'n_words': 223}