public static function findByCP($connectionId, $parameterName)
 {
     $data = BaseSingletonGuacamole::select('SELECT guacamole_connection_parameter.connection_id as connection_id, ' . 'guacamole_connection_parameter.parameter_name as parameter_name, ' . 'guacamole_connection_parameter.parameter_value as parameter_value ' . ' FROM guacamole_connection_parameter' . ' WHERE guacamole_connection_parameter.connection_id = ? AND LOWER(guacamole_connection_parameter.parameter_name) = LOWER(?)', array('is', &$connectionId, &$parameterName));
     $guacamoleConnectionParameter = new Guacamole_Connection_Parameter();
     if (sizeof($data) > 0) {
         $guacamoleConnectionParameter->hydrate($data[0]);
     } else {
         $guacamoleConnectionParameter = null;
     }
     return $guacamoleConnectionParameter;
 }
 public static function findByUsername($username)
 {
     $data = BaseSingletonGuacamole::select('SELECT guacamole_user.user_id as user_id, ' . 'guacamole_user.username as username, ' . 'guacamole_user.password_hash as password_hash, ' . 'guacamole_user.password_salt as password_salt, ' . 'guacamole_user.disabled as disabled, ' . 'guacamole_user.expired as expired, ' . 'guacamole_user.access_window_start as access_window_start, ' . 'guacamole_user.access_window_end as access_window_end, ' . 'guacamole_user.valid_from as valid_from, ' . 'guacamole_user.valid_until as valid_until, ' . 'guacamole_user.timezone as timezone ' . ' FROM guacamole_user' . ' WHERE LOWER(guacamole_user.username) = LOWER(?)', array('s', &$username));
     $guacamoleUser = new Guacamole_User();
     if (sizeof($data) > 0) {
         $guacamoleUser->hydrate($data[0]);
     } else {
         $guacamoleUser = null;
     }
     return $guacamoleUser;
 }
 public static function findByUCP($userId, $connectionId, $permission)
 {
     $data = BaseSingletonGuacamole::select('SELECT guacamole_connection_permission.user_id as user_id, ' . 'guacamole_connection_permission.connection_id as connection_id, ' . 'guacamole_connection_permission.permission as permission ' . ' FROM guacamole_connection_permission' . ' WHERE guacamole_connection_permission.user_id = ? AND guacamole_connection_permission.connection_id = ? AND LOWER(guacamole_connection_permission.permission) = LOWER(?)', array('iis', &$userId, &$connectionId, &$permission));
     $guacamoleConnectionPermission = new Guacamole_Connection_Permission();
     if (sizeof($data) > 0) {
         $guacamoleConnectionPermission->hydrate($data[0]);
     } else {
         $guacamoleConnectionPermission = null;
     }
     return $guacamoleConnectionPermission;
 }
 public static function findByCP($connectionName, $protocol)
 {
     $data = BaseSingletonGuacamole::select('SELECT guacamole_connection.connection_id as connection_id, ' . 'guacamole_connection.connection_name as connection_name, ' . 'guacamole_connection.parent_id as parent_id, ' . 'guacamole_connection.protocol as protocol, ' . 'guacamole_connection.max_connections as max_connections, ' . 'guacamole_connection.max_connections_per_user as max_connections_per_user ' . ' FROM guacamole_connection' . ' WHERE LOWER(guacamole_connection.connection_name) = LOWER(?) AND LOWER(guacamole_connection.protocol) = LOWER(?)', array('ss', &$connectionName, &$protocol));
     $guacamoleConnection = new Guacamole_Connection();
     if (sizeof($data) > 0) {
         $guacamoleConnection->hydrate($data[0]);
     } else {
         $guacamoleConnection = null;
     }
     return $guacamoleConnection;
 }