Give a better error if User::class has been screwed up somehow
This commit is contained in:
parent
88f1df9ca6
commit
316f7ff858
1 changed files with 7 additions and 1 deletions
|
@ -55,8 +55,14 @@ class User {
|
||||||
$this->email = $row['email'];
|
$this->email = $row['email'];
|
||||||
$this->join_date = $row['joindate'];
|
$this->join_date = $row['joindate'];
|
||||||
$this->passhash = $row['pass'];
|
$this->passhash = $row['pass'];
|
||||||
|
|
||||||
|
if(array_key_exists($row["class"], $_user_classes)) {
|
||||||
$this->class = $_user_classes[$row["class"]];
|
$this->class = $_user_classes[$row["class"]];
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
throw SCoreException("User '{$this->name}' has invalid class '{$row["class"]}'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a User by session.
|
* Construct a User by session.
|
||||||
|
|
Reference in a new issue