From: Vincent Zanotti Date: Sun, 15 Jun 2008 16:26:36 +0000 (+0200) Subject: Allows the PlUser class to be instantiated lazily (prevents useless SQL queries). X-Git-Tag: xorg/0.10.0~86^2~86 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=f3370db7c9450501a4d2df3779064befd6ef9fef;p=platal.git Allows the PlUser class to be instantiated lazily (prevents useless SQL queries). Signed-off-by: Vincent Zanotti --- diff --git a/classes/pluser.php b/classes/pluser.php index f18bac1..070d289 100644 --- a/classes/pluser.php +++ b/classes/pluser.php @@ -52,8 +52,10 @@ abstract class PlUser // redirection) and an optionnal array of known user properties. public function __construct($login, $values = array()) { - list($this->user_id, $this->hruid) = $this->getLogin($login); $this->fillFromArray($values); + if (!isset($this->user_id) || !isset($this->hruid)) { + list($this->user_id, $this->hruid) = $this->getLogin($login); + } }