public function __construct($group = null) { parent::__construct(); if ($group) { $table = 'groups'; if ($this->find($group, $table, ['id', 'prof_link'])) { $this->populate_member_list(); } } }
public function __construct($user = null) { parent::__construct(); $this->_logged_in = false; $this->_groups_populated = false; $this->_groups = []; $this->_historical_groups = []; if (!$user) { // add remember me functionality. Need to be aware of hackers sniffing the cookie, though. if (Session::exists('id')) { $user = Session::get('id'); if ($this->find($user)) { $this->_logged_in = true; $this->populate_groups(); } else { $this->logout(); } } } else { $this->find($user, 'users', ['email', 'prof_link']); } }