]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 7 Jan 2018 06:01:24 +0000 (06:01 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 7 Jan 2018 06:01:24 +0000 (06:01 +0000)
www/dbq/dbq.php

index 8b06f3d24d63c47c337abf43a54d2781b426cac9..4bb693e3754f2bf43c488394e452201ae1fc7c5d 100644 (file)
@@ -283,7 +283,7 @@ class DbQ extends nb {
 
                        if ($this->http_user()) {
                                $bottom[] = '<a href="/logout"'
-                                       .' style="background:url(\'/ldap/jpegPhoto.jpg?w=20\') right no-repeat;padding-right:22px"'
+                                       .($this->http_user() ? ' style="background:url(\'/ldap/jpegPhoto.jpg?w=20\') right no-repeat;padding-right:22px"' : '')
                                        .'>Logout: '
                                        .$this->http_user()
                                        .' (can: '.$this->perm2h().')'
@@ -846,7 +846,7 @@ EOF;
                ];
 
                $user = '';
-               if (true or $user = $this->logged()) {
+               if (true or $user = $this->http_user()) {
                        if ($user) $rows[] = [ 'name' => 'dbq.user.name', 'value' => $user ];
                        $rows[] = [ 'name' => 'dbq.user.perm', 'value' => $this->perm2h() ];
                }
@@ -986,12 +986,6 @@ EOF;
 
        }
 
-       public function logged() {
-               if (!empty($_SERVER['PHP_AUTH_USER'])) return $_SERVER['PHP_AUTH_USER'];
-               if (!empty($_SERVER['REMOTE_USER'])) return $_SERVER['REMOTE_USER'];
-               return '';
-       }
-
        public function logout() {
 
                if (0) {