$newLog->setLevel("INFO"); $newLog->setLoginUtilisateur($loginUtilisateur); $newLog->setMsg("Mise à jour de la description du container " . $container->getNom() . " en ajoutant le mot de passe root."); $newLog->setDateTime(date('Y/m/d G:i:s')); $validTableLog = Table_logDAL::insertOnDuplicate($newLog); } else { $newLog->setLevel("ERROR"); $newLog->setLoginUtilisateur($loginUtilisateur); $newLog->setMsg("Echec de la mise à jour de la description du container " . $container->getNom() . " pour ajouter le mot de passe root."); $newLog->setDateTime(date('Y/m/d G:i:s')); $validTableLog = Table_logDAL::insertOnDuplicate($newLog); //Arret exit; } //====Création de la connection======// $connectionContainer = new Guacamole_Connection(); $connectionContainer->setConnectionName($validName); //DOnne le nom du container à la connection pour pouvoir l'identifier a la suppression ! $connectionContainer->setMaxConnections(null); $connectionContainer->setMaxConnectionsPerUser(null); $connectionContainer->setParent(null); if ($ihm == 'yes') { $newLog->setLevel("INFO"); $newLog->setLoginUtilisateur($loginUtilisateur); $newLog->setMsg("Connexion vnc pour le container " . $validName . "."); $newLog->setDateTime(date('Y/m/d G:i:s')); $validTableLog = Table_logDAL::insertOnDuplicate($newLog); $connectionContainer->setProtocol('vnc'); } else { if ($ihm == 'no') { $newLog->setLevel("INFO");
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; }