login/list: retrieve optional user data on demand
[minimedit.git] / auth.inc.php
index e4e8bb9b30dc4fb078b9907f15557a9505e1f9f0..af02ec3b41b6e915ce3b5fbbc1a2883695db5ab3 100644 (file)
@@ -8,6 +8,16 @@ class User
                $this->dir = $dir;
                $this->login = basename($dir);
        }
+
+       function __get($col)
+       {
+               return $this->$col = $this->$col();  # run method and cache
+       }
+
+       function name()
+       {
+               return @file_get_contents("{$this->dir}/name.txt");
+       }
 }
 
 function login_password_verify($input, $test)