diff --git a/framework/router.class.php b/framework/router.class.php index 21f6536c2e..04d7e0cd3e 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -218,10 +218,14 @@ class router extends baseRouter /* Get user preference. */ $account = isset($this->session->user->account) ? $this->session->user->account : ''; - $sql = new sql(); - $account = $sql->quote($account); $userSetting = array(); - if($this->dbh and !empty($this->config->db->name)) $userSetting = $this->dbh->query('SELECT `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`= $account AND `module`='common' and `key` in ('programLink', 'productLink', 'projectLink', 'executionLink', 'URSR')")->fetchAll(); + if($this->dbh and !empty($this->config->db->name) and $account) + { + $sql = new sql(); + $account = $sql->quote($account); + $userSetting = $this->dbh->query('SELECT `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`= $account AND `module`='common' and `key` in ('programLink', 'productLink', 'projectLink', 'executionLink', 'URSR')")->fetchAll(); + } + foreach($userSetting as $setting) { if($setting->key == 'URSR') $config->URSR = $setting->value;