/** * Get the given username configuration. * * @param string $userid Either "" for the current user, or a user id. * * @return Array */ function getUser($userid = "") { if ($userid === "") { $userid = Core_Common::getCurrentUserLogin(); } Core_Common::checkUserIsSuperUserOrTheUser($userid); var_dump($userid); $db = Zend_Registry::get('db'); $select = $db->select()->from('t_users', array('userid', 'coach', 'athlete', 'superuser', 'dob' => 'TO_CHAR(dob, \'DD/MM/YYYY\')', 'max_heartrate', 'resting_heartrate', 'rider_weight', 'bike_weight'))->where('userid = ?', $userid); $stmt = $db->query($select); $users = $stmt->fetchAll(); if (count($users) == 0) { throw new Exception('Invalid username'); } return $users[0]; }