예제 #1
0
 /**
  * Gets the user details by ip address and session id
  * @param unknown_type $ip_address
  * @param unknown_type $session_id
  * @param unknown_type $create_if_empty
  */
 public static function get_user_details($ip_address, $session_id, $create_if_empty, $data_services)
 {
     $wp_user_details = HA_Common::get_wp_user_details();
     $current_time = current_time('mysql');
     $user_role = $wp_user_details['user_role'];
     $username = $wp_user_details['username'];
     $user_id = '';
     if ($data_services != null) {
         $params = array('ip_address' => $ip_address, 'session_id' => $session_id, 'create_if_empty' => $create_if_empty, 'current_time' => $current_time, 'user_role' => $user_role, 'username' => $username);
         $data = $data_services->custom_query('add_retrieve_user_details', $params);
         $user_id = $data->user_id;
     }
     return array('user_id' => $user_id, 'ip_address' => $ip_address, 'session_id' => $session_id, 'user_role' => $user_role, 'username' => $username);
 }