themes: only check password for uid=0 pages, nobody cannot read shadow (#426)
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 6 Jun 2012 10:44:55 +0000 (10:44 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 6 Jun 2012 10:44:55 +0000 (10:44 +0000)
themes/bootstrap/luasrc/view/themes/bootstrap/header.htm
themes/freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm
themes/openwrt/luasrc/view/themes/openwrt.org/header.htm

index 60c7a6e..33e2e48 100644 (file)
@@ -190,7 +190,7 @@ You may obtain a copy of the License at
   </header>
 
 
-<%- if luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
+<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
 <div class="container">
        <div class="alert-message warning">
                <h4><%:No password set!%></h4>
index 8787fae..25068a2 100644 (file)
@@ -94,7 +94,7 @@ You may obtain a copy of the License at
 </div></div>
 <![endif]-->
 
-<%- if luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
+<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
        <div class="warning">
                <strong><%:No password set!%></strong><br />
                <%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%>
index ddd9604..3db8445 100644 (file)
@@ -173,7 +173,7 @@ if tree.nodes[category] and tree.nodes[category].ucidata then
                        </div>
                </noscript>
 
-               <%- if luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
+               <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
                <div class="errorbox">
                        <strong><%:No password set!%></strong><br />
                        <%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%><br />