git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
contact: strip www. subdomain from mail address
[minimedit.git]
/
auth.inc.php
diff --git
a/auth.inc.php
b/auth.inc.php
index af02ec3b41b6e915ce3b5fbbc1a2883695db5ab3..65b7f72571b9123f036a39b845f82fa93e7fdb1e 100644
(file)
--- a/
auth.inc.php
+++ b/
auth.inc.php
@@
-5,6
+5,9
@@
class User
{
function __construct($dir)
{
{
function __construct($dir)
{
+ if (!file_exists($dir)) {
+ throw new Exception("Gebruiker niet gevonden in $dir");
+ }
$this->dir = $dir;
$this->login = basename($dir);
}
$this->dir = $dir;
$this->login = basename($dir);
}
@@
-14,9
+17,24
@@
class User
return $this->$col = $this->$col(); # run method and cache
}
return $this->$col = $this->$col(); # run method and cache
}
+ function rawname()
+ {
+ return rtrim(@file_get_contents("{$this->dir}/name.txt"));
+ }
+
function name()
{
function name()
{
- return @file_get_contents("{$this->dir}/name.txt");
+ return htmlspecialchars(implode(' & ', explode("\n", $this->rawname)));
+ }
+
+ function admin()
+ {
+ return @file_exists("{$this->dir}/.admin");
+ }
+
+ function seen()
+ {
+ return @filemtime("{$this->dir}/last.log");
}
}
}
}