├── .gitignore ├── README.md └── modules └── servers └── solusvmpro ├── VERSION ├── callback_example.php ├── configure.ini.example ├── console.php ├── custom-example.php ├── get_client_data.php ├── html5console.php ├── java ├── jcterm │ ├── jcterm-0.0.10.jar │ ├── jsch-0.1.46.jar │ └── jzlib-1.1.1.jar ├── sshterm-applet │ ├── SSHTermApplet-jdk1.3.1-dependencies-signed.jar │ ├── SSHTermApplet-jdkbug-workaround-signed.jar │ ├── SSHTermApplet-signed.jar │ ├── SSHTools-small-logo2.gif │ └── sshterm-applet.htm └── vnc │ ├── AuthPanel.class │ ├── ButtonPanel.class │ ├── CapabilityInfo.class │ ├── CapsContainer.class │ ├── ClipboardFrame.class │ ├── DesCipher.class │ ├── HTTPConnectSocket.class │ ├── HTTPConnectSocketFactory.class │ ├── InStream.class │ ├── MemInStream.class │ ├── OptionsFrame.class │ ├── RecordingFrame.class │ ├── ReloginPanel.class │ ├── RfbProto.class │ ├── SessionRecorder.class │ ├── SocketFactory.class │ ├── VncCanvas.class │ ├── VncCanvas2.class │ ├── VncViewer.class │ ├── VncViewer.jar │ ├── VncViewer.zip │ ├── ZlibInStream.class │ └── index.vnc ├── js ├── get_user_data.js ├── hostname.js ├── rescuemode.js ├── rootpassword.js └── vncpassword.js ├── lang ├── arabic.php ├── avalible │ ├── arabic.txt │ ├── czech.txt │ ├── dutch.txt │ ├── farsi.txt │ ├── french.txt │ ├── hebrew.txt │ ├── hungarian.txt │ ├── italian.txt │ ├── portugues.txt │ ├── spanish.txt │ └── turkish.txt ├── english.php ├── french.php ├── italian.php ├── russian.php ├── spanish.php └── ukranian.php ├── lib ├── CaseInsensitiveArray.php ├── Curl.php └── SolusVM.php ├── novnc ├── images │ ├── alt.png │ ├── clipboard.png │ ├── connect.png │ ├── ctrl.png │ ├── ctrlaltdel.png │ ├── disconnect.png │ ├── drag.png │ ├── esc.png │ ├── favicon.ico │ ├── favicon.png │ ├── keyboard.png │ ├── mouse_left.png │ ├── mouse_middle.png │ ├── mouse_none.png │ ├── mouse_right.png │ ├── power.png │ ├── screen_320x460.png │ ├── screen_57x57.png │ ├── screen_700x700.png │ ├── settings.png │ ├── showextrakeys.png │ └── tab.png └── include │ ├── Orbitron700.ttf │ ├── Orbitron700.woff │ ├── base.css │ ├── base64.js │ ├── black.css │ ├── blue.css │ ├── des.js │ ├── display.js │ ├── input.js │ ├── jsunzip.js │ ├── keyboard.js │ ├── keysym.js │ ├── keysymdef.js │ ├── logo.js │ ├── playback.js │ ├── rfb.js │ ├── ui.js │ ├── util.js │ ├── websock.js │ └── webutil.js ├── solusvmpro.php ├── svm_control.php ├── templates ├── clientarea.tpl ├── clientareaBootstrap.tpl └── error.tpl ├── term └── term.js └── vnc.php /.gitignore: -------------------------------------------------------------------------------- 1 | modules/servers/solusvmpro/.idea 2 | modules/servers/solusvmpro/callback.php 3 | modules/servers/solusvmpro/configure.ini 4 | modules/servers/solusvmpro/custom.php 5 | .idea 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [SolusVM WHMCS Module Documentation](https://docs.solusvm.com/display/BET/SolusVM+WHMCS+billing+module) 3 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/VERSION: -------------------------------------------------------------------------------- 1 | 4.2.1 2 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/callback_example.php: -------------------------------------------------------------------------------- 1 | join( 'tblcustomfieldsvalues', 'tblcustomfieldsvalues.fieldid', '=', 'tblcustomfields.id' ) 72 | ->join( 'tblhosting', 'tblcustomfieldsvalues.relid', '=', 'tblhosting.id' ) 73 | ->join( 'tblservers', 'tblhosting.server', '=', 'tblservers.id' ) 74 | ->select( 'tblcustomfields.id AS field_id', 'tblcustomfields.type AS field_type,', 'tblcustomfields.fieldname AS field_name', 'tblcustomfieldsvalues.fieldid AS value_id', 'tblcustomfieldsvalues.value AS value_value', 'tblcustomfieldsvalues.relid AS value_productid' ) 75 | ->where( 'tblcustomfields.type', 'product' ) 76 | ->where( 'tblcustomfields.fieldname', 'vserverid' ) 77 | ->where( 'tblcustomfieldsvalues.value', $vserverid ) 78 | ->where( 'tblservers.ipaddress', $remote_addr ) 79 | ->first(); 80 | 81 | if ( ! $product ) { 82 | echo "vserverid not found"; 83 | exit(); 84 | } 85 | 86 | $hosting_id = $product->value_productid; 87 | switch ( $action ) { 88 | 89 | case "suspend": 90 | 91 | /** 92 | * Product suspend 93 | */ 94 | 95 | $values["messagename"] = "Service Suspension Notification"; 96 | $values["id"] = $hosting_id; 97 | 98 | Capsule::table( 'tblhosting' ) 99 | ->where( 'id', $hosting_id ) 100 | ->update( 101 | [ 102 | 'domainstatus' => 'Suspended', 103 | 'suspendreason' => $extra_var["suspendreason"], 104 | ] 105 | ); 106 | $output = localAPI( 'sendemail', $values, $admin_user ); 107 | 108 | if ( $output["result"] == "success" ) { 109 | echo "1"; 110 | } else { 111 | echo "Error: " . $output["message"]; 112 | } 113 | 114 | break; 115 | 116 | case "unsuspend": 117 | 118 | /** 119 | * Product unsuspend 120 | */ 121 | 122 | Capsule::table( 'tblhosting' ) 123 | ->where( 'id', $hosting_id ) 124 | ->update( 125 | [ 126 | 'domainstatus' => 'Active', 127 | 'suspendreason' => '', 128 | ] 129 | ); 130 | 131 | echo "1"; 132 | 133 | break; 134 | 135 | case "terminate": 136 | 137 | /** 138 | * Product terminate 139 | */ 140 | 141 | Capsule::table( 'tblhosting' ) 142 | ->where( 'id', $hosting_id ) 143 | ->update( 144 | [ 145 | 'domainstatus' => 'Terminated', 146 | ] 147 | ); 148 | 149 | echo "1"; 150 | 151 | break; 152 | 153 | case "changehostname": 154 | 155 | /** 156 | * Product change hostname 157 | */ 158 | 159 | Capsule::table( 'tblhosting' ) 160 | ->where( 'id', $hosting_id ) 161 | ->update( 162 | [ 163 | 'domain' => $extra_var["newhostname"], 164 | ] 165 | ); 166 | 167 | echo "1"; 168 | 169 | break; 170 | 171 | case "changeip": 172 | 173 | /** 174 | * Product IP Change 175 | */ 176 | 177 | $ip_list = array(); 178 | 179 | if ( isset( $extra_var["ipv4"] ) && $extra_var["ipv4"] ) { 180 | $ipv4_list = explode( ",", $extra_var["ipv4"] ); 181 | foreach ( $ipv4_list as $ipv4 ) { 182 | $ip_list[] = $ipv4; 183 | } 184 | } 185 | 186 | if ( isset( $extra_var["ipv6"] ) && $extra_var["ipv6"] ) { 187 | $ipv6_list = explode( ",", $extra_var["ipv6"] ); 188 | foreach ( $ipv6_list as $ipv6 ) { 189 | $ip_list[] = $ipv6; 190 | } 191 | } 192 | 193 | if ( $ip_list ) { 194 | $ips = implode( "\n", $ip_list ); 195 | } else { 196 | $ips = ""; 197 | } 198 | 199 | Capsule::table( 'tblhosting' ) 200 | ->where( 'id', $hosting_id ) 201 | ->update( 202 | [ 203 | 'assignedips' => $ips, 204 | ] 205 | ); 206 | 207 | echo "1"; 208 | 209 | break; 210 | 211 | case "changerootpassword": 212 | 213 | /** 214 | * Change root password 215 | */ 216 | 217 | $rootValueID = Capsule::table('tblcustomfields') 218 | ->join('tblcustomfieldsvalues', 'tblcustomfieldsvalues.fieldid', '=', 'tblcustomfields.id') 219 | ->select('tblcustomfieldsvalues.fieldid as rootID') 220 | ->where('tblcustomfields.type', 'product') 221 | ->where('tblcustomfieldsvalues.relid', $product->value_productid) 222 | ->where('tblcustomfields.fieldname', 'rootpassword') 223 | ->first(); 224 | 225 | Capsule::table('tblcustomfieldsvalues') 226 | ->where('relid', $hosting_id) 227 | ->where('fieldid', $rootValueID->rootID) 228 | ->update( 229 | [ 230 | 'value' => $extra_var['newrootpassword'], 231 | ] 232 | ); 233 | 234 | echo "1"; 235 | 236 | break; 237 | 238 | default: 239 | 240 | /** 241 | * If no product function is defined 242 | */ 243 | 244 | echo "1"; 245 | } 246 | 247 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/configure.ini.example: -------------------------------------------------------------------------------- 1 | ; This is a test configuration file 2 | ; Comments start with ';' 3 | 4 | debug = true 5 | 6 | ; UsageUpdate 7 | ;enableUsageUpdate = true 8 | ;updateIntervalDay = 2 9 | 10 | ; Theme Customizations 11 | ; Virtual Server color status (hex color) 12 | ;statusOnlineColor = 0C0 13 | ;statusOfflineColor = F00 14 | ;statusDisabledColor = 000 15 | ;statusUnavailableColor = F00 16 | 17 | ; Progress Bar color section (hex color) 18 | ;pbSuccessColor = 36e22d 19 | ;pbWarningColor = f82812 20 | ;pbDangerColor = f8aa12 21 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/console.php: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | '; 27 | 28 | $ca = new WHMCS_ClientArea(); 29 | if ( ! $ca->isLoggedIn() ) { 30 | if((!isset($_SESSION['adminid']) || ((int)$_SESSION['adminid'] <= 0))){ 31 | echo '
' . $_LANG['solusvmpro_unauthorized'] . '
'; 32 | exit(); 33 | } 34 | $uid = (int)$_GET['uid']; 35 | }else{ 36 | $uid = $ca->getUserID(); 37 | } 38 | $servid = (int) $_GET['id']; 39 | if ( $servid == "" ) { 40 | echo '
' . $_LANG['solusvmpro_unauthorized'] . '
'; 41 | exit(); 42 | } 43 | 44 | $params = SolusVM::getParamsFromServiceID( $servid, $uid ); 45 | if ( $params === false ) { 46 | echo '
' . $_LANG['solusvmpro_vserverNotFound'] . '
'; 47 | exit; 48 | } 49 | $solusvm = new SolusVM( $params ); 50 | 51 | if ( $solusvm->getExtData( "clientfunctions" ) == "disable" ) { 52 | echo '
' . $_LANG['solusvmpro_functionDisabled'] . ''; 53 | exit; 54 | } 55 | if ( $solusvm->getExtData( "serialconsole" ) == "disable" ) { 56 | echo '
' . $_LANG['solusvmpro_functionDisabled'] . ''; 57 | exit; 58 | } 59 | 60 | ################### Code ################### 61 | 62 | if ( isset( $_POST["sessioncancel"] ) ) { 63 | $callArray = array( "access" => "disable", "vserverid" => $params['vserver'] ); 64 | } elseif ( isset( $_POST["sessioncreate"] ) ) { 65 | $stime = $_POST["sessiontime"]; 66 | if ( ! is_numeric( $stime ) ) { 67 | exit(); 68 | } else { 69 | $callArray = array( "access" => "enable", "time" => $stime, "vserverid" => $params['vserver'] ); 70 | } 71 | } else { 72 | ## The call string for the connection function 73 | $callArray = array( "vserverid" => $params['vserver'] ); 74 | } 75 | 76 | $solusvm->apiCall( 'vserver-console', $callArray ); 77 | $r = $solusvm->result; 78 | 79 | if ( $r["status"] == "success" ) { 80 | if ( $r["sessionactive"] == "1" ) { 81 | if ( $r["type"] != "openvz" && $r["type"] != "xen" ) { 82 | exit(); 83 | } 84 | 85 | ?> 86 | 87 |


88 | 91 | 92 | 93 | 95 | 96 |
97 |
98 |
99 |
100 | 101 |
102 |
103 | 104 | 109 |
110 |
111 |
112 |
113 |
114 | 115 | 125 |
126 | 127 | 128 |
129 |
130 |
131 |
132 | 133 |
'; 144 | 145 | echo $pagedata; 146 | } 147 | 148 | ################## Code End ################ 149 | 150 | echo ''; 151 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/custom-example.php: -------------------------------------------------------------------------------- 1 | 60 | # 61 | # 62 | # 63 | # 64 | # '; 65 | # return $code; 66 | # } 67 | 68 | # function solusvmpro_create_one($params) 69 | # { 70 | # } 71 | 72 | # function solusvmpro_create_two($params) 73 | # { 74 | # } 75 | 76 | # function solusvmpro_create_three($params) 77 | # { 78 | # } 79 | 80 | # function solusvmpro_create_four($params) 81 | # { 82 | # } 83 | 84 | # function solusvmpro_create_five($params) 85 | # { 86 | # } 87 | 88 | # function solusvmpro_terminate_pre($params) 89 | # { 90 | # } 91 | 92 | # function solusvmpro_terminate_post_success($params) 93 | # { 94 | # } 95 | 96 | # function solusvmpro_terminate_post_error($params) 97 | # { 98 | # } 99 | 100 | # function solusvmpro_suspend_pre($params) 101 | # { 102 | # } 103 | 104 | # function solusvmpro_suspend_post_success($params) 105 | # { 106 | # } 107 | 108 | # function solusvmpro_suspend_post_error($params) 109 | # { 110 | # } 111 | 112 | # function solusvmpro_unsuspend_pre($params) 113 | # { 114 | # } 115 | 116 | # function solusvmpro_unsuspend_post_success($params) 117 | # { 118 | # } 119 | 120 | # function solusvmpro_unsuspend_post_error($params) 121 | # { 122 | # } 123 | 124 | # function solusvmpro_changepackage_pre($params) 125 | # { 126 | # } 127 | 128 | # function solusvmpro_changepackage_post_success($params) 129 | # { 130 | # } 131 | 132 | # function solusvmpro_changepackage_post_error($params) 133 | # { 134 | # } 135 | 136 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/get_client_data.php: -------------------------------------------------------------------------------- 1 | isLoggedIn() ) { 20 | echo $_LANG['solusvmpro_unauthorized'] . ""; 21 | exit(); 22 | } 23 | 24 | $uid = $ca->getUserID(); 25 | 26 | $params = SolusVM::getParamsFromVserviceID( $vserverid, $uid ); 27 | if ( ! $params ) { 28 | $result = array( 29 | 'status' => 'error', 30 | 'displaystatus' => $_LANG['solusvmpro_vserverNotFound'], 31 | ); 32 | echo json_encode( $result ); 33 | exit(); 34 | } 35 | 36 | $solusvm = new SolusVM( $params ); 37 | 38 | $callArray = array( "vserverid" => $vserverid ); 39 | 40 | $solusvm->apiCall( 'vserver-infoall', $callArray ); 41 | $r = $solusvm->result; 42 | 43 | $cparams = $solusvm->clientAreaCalculations( $r ); 44 | 45 | if($r['rescuemode'] != 0){ 46 | $solusvm->apiCall( 'vserver-rescue', $callArray ); 47 | $cparams['rescueData'] = $solusvm->result; 48 | } 49 | 50 | echo json_encode( $cparams ); 51 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/html5console.php: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | <?php echo $_LANG['solusvmpro_html5Console']; ?> 27 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | isLoggedIn()) { 58 | if ((!isset($_SESSION['adminid']) || ((int)$_SESSION['adminid'] <= 0))) { 59 | echo '
' . $_LANG['solusvmpro_unauthorized'] . '
'; 60 | exit(); 61 | } 62 | $uid = (int)$_GET['uid']; 63 | } else { 64 | $uid = $ca->getUserID(); 65 | } 66 | 67 | $servid = (int)$_GET['id']; 68 | if ($servid == "") { 69 | echo '
' . $_LANG['solusvmpro_unauthorized'] . '
'; 70 | exit(); 71 | } 72 | 73 | $params = SolusVM::getParamsFromServiceID($servid, $uid); 74 | if ($params === false) { 75 | echo '
' . $_LANG['solusvmpro_vserverNotFound'] . '
'; 76 | exit; 77 | } 78 | $solusvm = new SolusVM($params); 79 | 80 | if ($solusvm->getExtData("clientfunctions") == "disable") { 81 | echo '
' . $_LANG['solusvmpro_functionDisabled'] . ''; 82 | exit; 83 | } 84 | if ($solusvm->getExtData("html5serialconsole") == "disable") { 85 | echo '
' . $_LANG['solusvmpro_functionDisabled'] . ''; 86 | exit; 87 | } 88 | 89 | ################### Code ################### 90 | 91 | if (isset($_POST["sessioncancel"])) { 92 | $callArray = array("access" => "disable", "vserverid" => $params['vserver']); 93 | } elseif (isset($_POST["sessioncreate"])) { 94 | $stime = $_POST["sessiontime"]; 95 | if (!is_numeric($stime)) { 96 | exit(); 97 | } else { 98 | $callArray = array("access" => "enable", "time" => $stime, "vserverid" => $params['vserver']); 99 | } 100 | } else { 101 | ## The call string for the connection function 102 | $callArray = array("vserverid" => $params['vserver']); 103 | } 104 | 105 | $solusvm->apiCall('vserver-console', $callArray); 106 | $r = $solusvm->result; 107 | 108 | if ($r["status"] == "success") { 109 | if ($r["sessionactive"] == "1") { 110 | if ($r["type"] != "openvz" && $r["type"] != "xen") { 111 | exit(); 112 | } 113 | 114 | /*if(trim($r['consoledomain']) !=='' ){ 115 | $host_connect = $r['consoledomain']; 116 | } else { 117 | $host_connect = $r['consoleip']; 118 | }*/ 119 | $host_connect = $solusvm->cpHostname; 120 | 121 | ?> 122 | 123 |
124 |

125 |
126 |
127 |
128 |
129 |
130 | 131 |
132 |
133 | 134 |
136 |
138 |
Secure Shell Terminal: vt220
139 |
140 | 142 |
143 |
144 | 147 |
148 |
149 | 152 |
153 |
154 | 158 |
159 |
160 | 164 |
165 |
166 | 170 |
171 |
172 |
173 |
175 |
176 |
177 |
178 | 179 | 251 | 252 | 253 | 256 | 257 | 263 |
264 |
265 |
266 |
267 |
268 | 269 | 279 |
280 | 282 | 284 |
285 |
286 |
287 |
288 | 289 |
'; 300 | 301 | echo $pagedata; 302 | } 303 | 304 | ################## Code End ################ 305 | echo ''; 306 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/jcterm/jcterm-0.0.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/jcterm/jcterm-0.0.10.jar -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/jcterm/jsch-0.1.46.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/jcterm/jsch-0.1.46.jar -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/jcterm/jzlib-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/jcterm/jzlib-1.1.1.jar -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/sshterm-applet/SSHTermApplet-jdk1.3.1-dependencies-signed.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/sshterm-applet/SSHTermApplet-jdk1.3.1-dependencies-signed.jar -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/sshterm-applet/SSHTermApplet-jdkbug-workaround-signed.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/sshterm-applet/SSHTermApplet-jdkbug-workaround-signed.jar -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/sshterm-applet/SSHTermApplet-signed.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/sshterm-applet/SSHTermApplet-signed.jar -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/sshterm-applet/SSHTools-small-logo2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/sshterm-applet/SSHTools-small-logo2.gif -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/sshterm-applet/sshterm-applet.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | SSHTerm Applet 9 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 |
 SSHTerm 24 | Applet
27 |

On loading the applet, you 28 | will be asked to accept a certificate registered to 3SP LTD - this is the company 29 | responsible for the continuing development and support of SSHTools and does 30 | not pose a security risk to your system. 31 |

32 | 33 | 34 |

35 | 36 | 37 | 38 | 43 | 46 | 47 | 49 | 50 |
SourceForge.net Logo 44 |

45 | Close Window

48 |
51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/AuthPanel.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/AuthPanel.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/ButtonPanel.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/ButtonPanel.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/CapabilityInfo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/CapabilityInfo.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/CapsContainer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/CapsContainer.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/ClipboardFrame.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/ClipboardFrame.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/DesCipher.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/DesCipher.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/HTTPConnectSocket.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/HTTPConnectSocket.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/HTTPConnectSocketFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/HTTPConnectSocketFactory.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/InStream.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/InStream.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/MemInStream.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/MemInStream.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/OptionsFrame.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/OptionsFrame.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/RecordingFrame.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/RecordingFrame.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/ReloginPanel.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/ReloginPanel.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/RfbProto.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/RfbProto.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/SessionRecorder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/SessionRecorder.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/SocketFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/SocketFactory.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/VncCanvas.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/VncCanvas.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/VncCanvas2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/VncCanvas2.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/VncViewer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/VncViewer.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/VncViewer.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/VncViewer.jar -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/VncViewer.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/VncViewer.zip -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/ZlibInStream.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/java/vnc/ZlibInStream.class -------------------------------------------------------------------------------- /modules/servers/solusvmpro/java/vnc/index.vnc: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | $USER's $DESKTOP desktop ($DISPLAY) 17 | 18 | 20 | 21 | $PARAMS 22 | 23 |
24 | TightVNC site 25 | 26 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/js/get_user_data.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | window.solusvmpro_get_and_fill_client_data = function (vserverid) { 3 | if (typeof vserverid === 'undefined') { 4 | return false; 5 | } 6 | $.ajax({ 7 | method: "GET", 8 | url: "modules/servers/solusvmpro/get_client_data.php", 9 | data: {vserverid: vserverid}, 10 | cache: false, 11 | dataType: 'json'/*, 12 | timeout: 2000*/ 13 | }).done(function (data) { 14 | $('#displayState').html(data.displaystatus); 15 | 16 | if (data.displaybandwidthbar) { 17 | $('#displaybandwidthbarInfoSpan1').html(data.bandwidthused); 18 | $('#displaybandwidthbarInfoSpan2').html(data.bandwidthtotal); 19 | $('#displaybandwidthbarInfoSpan3').html(data.bandwidthfree); 20 | var bandwidthProgressbar = $('#bandwidthProgressbar'); 21 | bandwidthProgressbar.attr('aria-valuenow', data.bandwidthpercent).css('width', data.bandwidthpercent + '%').css('background-color', data.bandwidthcolor); 22 | bandwidthProgressbar.html(data.bandwidthpercent + '%'); 23 | $('#displaybandwidthbar').show(); 24 | } 25 | 26 | if (data.displaymemorybar) { 27 | $('#displaymemorybarInfoSpan1').html(data.memoryused); 28 | $('#displaymemorybarInfoSpan2').html(data.memorytotal); 29 | $('#displaymemorybarInfoSpan3').html(data.memoryfree); 30 | var memoryProgressbar = $('#memoryProgressbar'); 31 | memoryProgressbar.attr('aria-valuenow', data.memorypercent).css('width', data.memorypercent + '%').css('background-color', data.memorycolor); 32 | memoryProgressbar.html(data.memorypercent + '%'); 33 | $('#displaymemorybar').show(); 34 | } 35 | 36 | if (data.displayhddbar) { 37 | $('#displayhddbarInfoSpan1').html(data.hddused); 38 | $('#displayhddbarInfoSpan2').html(data.hddtotal); 39 | $('#displayhddbarInfoSpan3').html(data.hddfree); 40 | var hddProgressbar = $('#hddProgressbar'); 41 | hddProgressbar.attr('aria-valuenow', data.hddpercent).css('width', data.hddpercent + '%').css('background-color', data.hddcolor); 42 | hddProgressbar.html(data.hddpercent + '%'); 43 | $('#displayhddbar').show(); 44 | } 45 | 46 | if (data.controlpanellink) { 47 | $("#controlpanellink").attr("onclick", "window.open('" + data.controlpanellink + "','_blank')"); 48 | } 49 | 50 | var optionsIds = ["displayreboot", "displayshutdown", "displayboot", "displayconsole", "displayhtml5console", "displayvnc", "displayrootpassword", "displayhostname", "displayvncpassword", "displayrescuemode", "displaypanelbutton", "displayclientkeyauth"]; 51 | var showOptions = false; 52 | optionsIds.forEach(function (v) { 53 | if (data.hasOwnProperty(v)) { 54 | if (data[v] == 1) { 55 | $('#' + v).show(); 56 | showOptions = true; 57 | } 58 | } 59 | }); 60 | if (showOptions) { 61 | $('#showOptions').show(); 62 | } 63 | 64 | var itemsDataIds = ["ipcsv"]; 65 | itemsDataIds.forEach(function (v) { 66 | if (data.hasOwnProperty(v)) { 67 | $('#' + v).html(data[v]); 68 | } 69 | }); 70 | 71 | var itemsShowIds = ["displaygraphs", "displayips", "clientkeyautherror", "displaypanelbutton"]; 72 | itemsShowIds.forEach(function (v) { 73 | if (data.hasOwnProperty(v)) { 74 | if (data[v] == 1) { 75 | $('#' + v).show(); 76 | } 77 | } 78 | }); 79 | 80 | if (data.displaytrafficgraph == 1) { 81 | $('#trafficgraph').show(); 82 | $('#trafficgraphurlImg').attr('src', data.trafficgraphurl); 83 | } 84 | if (data.displayloadgraph == 1) { 85 | $('#loadgraph').show(); 86 | $('#loadgraphurlImg').attr('src', data.loadgraphurl); 87 | } 88 | if (data.displaymemorygraph == 1) { 89 | $('#memorygraph').show(); 90 | $('#memorygraphurlImg').attr('src', data.memorygraphurl); 91 | } 92 | if (data.displayhddgraph == 1) { 93 | $('#hddgraph').show(); 94 | $('#hddgraphurlImg').attr('src', data.hddgraphurl); 95 | } 96 | 97 | //rescueMode 98 | if (data.rescuemode == 0) { 99 | $('#rescueEnabled').show(); 100 | $('#rescueDisabled').remove(); 101 | }else if(data.rescueData){ 102 | $('#rescueDisabled').show(); 103 | $('#rescueEnabled').remove(); 104 | 105 | $('#rescueip').html(data.rescueData.ip); 106 | $('#rescueport').html(data.rescueData.port); 107 | $('#rescueuser').html(data.rescueData.user); 108 | $('#rescuepassword').html(data.rescueData.password); 109 | } 110 | 111 | 112 | }).fail(function (jqXHR, textStatus) { 113 | $('#displayState').hide(); 114 | $('#displayStateUnavailable').show(); 115 | }); 116 | 117 | return true; 118 | } 119 | }); 120 | 121 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/js/hostname.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | window.solusvmpro_hostname = function (vserverid, lang, token) { 3 | token = typeof token !== 'undefined' ? token : ""; 4 | if (typeof vserverid === 'undefined') { 5 | return false; 6 | } 7 | 8 | $('#changehostname').on('click', function () { 9 | var button = $(this); 10 | var newhostname = $('#newhostname').val(); 11 | newhostname = newhostname.trim(); 12 | 13 | var msgSuccess = $('#hostnameMsgSuccess'); 14 | var msgError = $('#hostnameMsgError'); 15 | msgSuccess.hide(); 16 | msgError.hide(); 17 | var showSuccessOrErrorMsg = function (success, msg) { 18 | msgSuccess.hide(); 19 | msgError.hide(); 20 | if (success) { 21 | msgSuccess.html(msg); 22 | msgSuccess.show(); 23 | } else { 24 | msgError.html(msg); 25 | msgError.show(); 26 | } 27 | }; 28 | if (newhostname === '') { 29 | showSuccessOrErrorMsg(false, lang['solusvmpro_invalidHostname']); 30 | return false; 31 | } 32 | 33 | button.html(' ' + lang['solusvmpro_change']); 34 | button.prop('disabled', true); 35 | var ajaxData = { 36 | modop: 'custom', 37 | a: 'ChangeHostname', 38 | newhostname: newhostname, 39 | ajax: 1, 40 | ac: 'Custom_ChangeHostname' 41 | }; 42 | $.ajax({ 43 | /*type: "POST",*/ 44 | url: document.location.href + token, 45 | data: ajaxData, 46 | cache: false, 47 | dataType: 'json'/*, 48 | timeout: 2000*/ 49 | }).done(function (data) { 50 | 51 | var dataMsg = ''; 52 | if (data.hasOwnProperty("msg")) { 53 | dataMsg = data.msg; 54 | } 55 | 56 | var dataSuccess = false; 57 | if (data.hasOwnProperty("success")) { 58 | dataSuccess = data.success; 59 | } 60 | 61 | showSuccessOrErrorMsg(dataSuccess, dataMsg); 62 | 63 | button.html(lang['solusvmpro_change']); 64 | button.prop('disabled', false); 65 | 66 | }).fail(function (jqXHR, textStatus) { 67 | //console.log(jqXHR); 68 | //console.log(textStatus); 69 | }); 70 | }); 71 | 72 | return true; 73 | } 74 | }); 75 | 76 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/js/rescuemode.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | window.solusvmpro_rescuemode = function (vserverid, lang, token, area) { 3 | token = typeof token !== 'undefined' ? token : ""; 4 | if (typeof vserverid === 'undefined') { 5 | return false; 6 | } 7 | 8 | $('.changerescuemode').on('click', function () { 9 | var button = $(this); 10 | var rescueAction = 'rescueenable'; 11 | var rescueValue = $('#rescueImage').val(); 12 | 13 | if(typeof rescueValue === "undefined"){ 14 | rescueValue = true; 15 | rescueAction = 'rescuedisable'; 16 | } 17 | 18 | var msgSuccess = $('#rescuemodeMsgSuccess'); 19 | var msgError = $('#rescuemodedMsgError'); 20 | msgSuccess.hide(); 21 | msgError.hide(); 22 | var showSuccessOrErrorMsg = function (success, msg) { 23 | msgSuccess.hide(); 24 | msgError.hide(); 25 | if (success) { 26 | msgSuccess.html(msg); 27 | msgSuccess.show(); 28 | } else { 29 | msgError.html(msg); 30 | msgError.show(); 31 | } 32 | }; 33 | 34 | button.html(' ' + lang['solusvmpro_processing']); 35 | button.prop('disabled', true); 36 | var ajaxData = { 37 | modop: 'custom', 38 | a: 'ChangeRescueMode', 39 | rescueAction: rescueAction, 40 | rescueValue: rescueValue, 41 | ajax: 1, 42 | ac: 'Custom_ChangeRescueMode' 43 | }; 44 | 45 | $.ajax({ 46 | url: document.location.href + token, 47 | data: ajaxData, 48 | cache: false, 49 | dataType: 'json'/*, 50 | timeout: 2000*/ 51 | }).done(function (data) { 52 | 53 | var dataMsg = ''; 54 | if (data.hasOwnProperty("msg")) { 55 | dataMsg = data.msg; 56 | } 57 | 58 | var dataSuccess = false; 59 | if (data.hasOwnProperty("success")) { 60 | dataSuccess = data.success; 61 | } 62 | 63 | showSuccessOrErrorMsg(dataSuccess, dataMsg); 64 | 65 | button.html(lang['solusvmpro_refresh']); 66 | if(area == 'admin'){ 67 | button.attr('onclick', 'loadcontrol();'); 68 | $('#solusvmpro_collapseSeven .btn').removeClass('changerescuemode'); 69 | }else{ 70 | button.attr('onclick', 'location.reload();'); 71 | $('#solusvmpro_collapseSeven .btn').removeClass('changerescuemode'); 72 | } 73 | button.prop('disabled', false); 74 | 75 | }).fail(function (jqXHR, textStatus) { 76 | //console.log(jqXHR); 77 | //console.log(textStatus); 78 | }); 79 | }); 80 | 81 | return true; 82 | } 83 | }); 84 | 85 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/js/rootpassword.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | window.solusvmpro_rootpassword = function (vserverid, lang, token) { 3 | token = typeof token !== 'undefined' ? token : ""; 4 | if (typeof vserverid === 'undefined') { 5 | return false; 6 | } 7 | 8 | $('#changerootpassword').on('click', function () { 9 | var button = $(this); 10 | var newrootpassword = $('#newrootpassword').val(); 11 | var confirmnewrootpassword = $('#confirmnewrootpassword').val(); 12 | 13 | var msgSuccess = $('#rootpasswordMsgSuccess'); 14 | var msgError = $('#rootpasswordMsgError'); 15 | msgSuccess.hide(); 16 | msgError.hide(); 17 | var showSuccessOrErrorMsg = function (success, msg) { 18 | msgSuccess.hide(); 19 | msgError.hide(); 20 | if (success) { 21 | msgSuccess.html(msg); 22 | msgSuccess.show(); 23 | } else { 24 | msgError.html(msg); 25 | msgError.show(); 26 | } 27 | }; 28 | if (newrootpassword === '') { 29 | showSuccessOrErrorMsg(false, lang['solusvmpro_invalidRootpassword']); 30 | return false; 31 | } 32 | if (newrootpassword !== confirmnewrootpassword) { 33 | showSuccessOrErrorMsg(false, lang['solusvmpro_confirmErrorPassword']); 34 | return false; 35 | } 36 | 37 | 38 | button.html(' ' + lang['solusvmpro_change']); 39 | button.prop('disabled', true); 40 | var ajaxData = { 41 | modop: 'custom', 42 | a: 'ChangeRootPassword', 43 | newrootpassword: newrootpassword, 44 | ajax: 1, 45 | ac: 'Custom_ChangeRootPassword' 46 | }; 47 | $.ajax({ 48 | url: document.location.href + token, 49 | data: ajaxData, 50 | cache: false, 51 | dataType: 'json'/*, 52 | timeout: 2000*/ 53 | }).done(function (data) { 54 | 55 | var dataMsg = ''; 56 | if (data.hasOwnProperty("msg")) { 57 | dataMsg = data.msg; 58 | } 59 | 60 | var dataSuccess = false; 61 | if (data.hasOwnProperty("success")) { 62 | dataSuccess = data.success; 63 | } 64 | 65 | showSuccessOrErrorMsg(dataSuccess, dataMsg); 66 | 67 | button.html(lang['solusvmpro_change']); 68 | button.prop('disabled', false); 69 | 70 | }).fail(function (jqXHR, textStatus) { 71 | //console.log(jqXHR); 72 | //console.log(textStatus); 73 | }); 74 | }); 75 | 76 | return true; 77 | } 78 | }); 79 | 80 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/js/vncpassword.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | window.solusvmpro_vncpassword = function (vserverid, lang, token) { 3 | token = typeof token !== 'undefined' ? token : ""; 4 | if (typeof vserverid === 'undefined') { 5 | return false; 6 | } 7 | 8 | $('#changevncpassword').on('click', function () { 9 | var button = $(this); 10 | var newvncpassword = $('#newvncpassword').val(); 11 | var confirmnewvncpassword = $('#confirmnewvncpassword').val(); 12 | 13 | var msgSuccess = $('#vncpasswordMsgSuccess'); 14 | var msgError = $('#vncpasswordMsgError'); 15 | msgSuccess.hide(); 16 | msgError.hide(); 17 | var showSuccessOrErrorMsg = function (success, msg) { 18 | msgSuccess.hide(); 19 | msgError.hide(); 20 | if (success) { 21 | msgSuccess.html(msg); 22 | msgSuccess.show(); 23 | } else { 24 | msgError.html(msg); 25 | msgError.show(); 26 | } 27 | }; 28 | if (newvncpassword === '') { 29 | showSuccessOrErrorMsg(false, lang['solusvmpro_invalidVNCpassword']); 30 | return false; 31 | } 32 | if (newvncpassword !== confirmnewvncpassword) { 33 | showSuccessOrErrorMsg(false, lang['solusvmpro_confirmErrorPassword']); 34 | return false; 35 | } 36 | 37 | 38 | button.html(' ' + lang['solusvmpro_change']); 39 | button.prop('disabled', true); 40 | var ajaxData = { 41 | modop: 'custom', 42 | a: 'ChangeVNCPassword', 43 | newvncpassword: newvncpassword, 44 | ajax: 1, 45 | ac: 'Custom_ChangeVNCPassword' 46 | }; 47 | $.ajax({ 48 | url: document.location.href + token, 49 | data: ajaxData, 50 | cache: false, 51 | dataType: 'json'/*, 52 | timeout: 2000*/ 53 | }).done(function (data) { 54 | 55 | var dataMsg = ''; 56 | if (data.hasOwnProperty("msg")) { 57 | dataMsg = data.msg; 58 | } 59 | 60 | var dataSuccess = false; 61 | if (data.hasOwnProperty("success")) { 62 | dataSuccess = data.success; 63 | } 64 | 65 | showSuccessOrErrorMsg(dataSuccess, dataMsg); 66 | 67 | button.html(lang['solusvmpro_change']); 68 | button.prop('disabled', false); 69 | 70 | }).fail(function (jqXHR, textStatus) { 71 | //console.log(jqXHR); 72 | //console.log(textStatus); 73 | }); 74 | }); 75 | 76 | return true; 77 | } 78 | }); 79 | 80 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/lang/arabic.php: -------------------------------------------------------------------------------- 1 | $value) { 46 | $this->offsetSet($key, $value); 47 | } 48 | } 49 | } 50 | 51 | /** 52 | * Offset Set 53 | * 54 | * Set data at a specified Offset. Converts the offset to lower-case, and 55 | * stores the Case-Sensitive Offset and the Data at the lower-case indexes 56 | * in $this->keys and @this->data. 57 | * 58 | * @see https://secure.php.net/manual/en/arrayaccess.offseteset.php 59 | * 60 | * @param string $offset The offset to store the data at (case-insensitive). 61 | * @param mixed $value The data to store at the specified offset. 62 | * 63 | * @return void 64 | * 65 | * @access public 66 | */ 67 | public function offsetSet($offset, $value) 68 | { 69 | if ($offset === null) { 70 | $this->data[] = $value; 71 | } else { 72 | $offsetlower = strtolower($offset); 73 | $this->data[$offsetlower] = $value; 74 | $this->keys[$offsetlower] = $offset; 75 | } 76 | } 77 | 78 | /** 79 | * Offset Exists 80 | * 81 | * Checks if the Offset exists in data storage. The index is looked up with 82 | * the lower-case version of the provided offset. 83 | * 84 | * @see https://secure.php.net/manual/en/arrayaccess.offsetexists.php 85 | * 86 | * @param string $offset Offset to check 87 | * 88 | * @return bool If the offset exists. 89 | * 90 | * @access public 91 | */ 92 | public function offsetExists($offset) 93 | { 94 | return (bool) array_key_exists(strtolower($offset), $this->data); 95 | } 96 | 97 | /** 98 | * Offset Unset 99 | * 100 | * Unsets the specified offset. Converts the provided offset to lowercase, 101 | * and unsets the Case-Sensitive Key, as well as the stored data. 102 | * 103 | * @see https://secure.php.net/manual/en/arrayaccess.offsetunset.php 104 | * 105 | * @param string $offset The offset to unset. 106 | * 107 | * @return void 108 | * 109 | * @access public 110 | */ 111 | public function offsetUnset($offset) 112 | { 113 | $offsetlower = strtolower($offset); 114 | unset($this->data[$offsetlower]); 115 | unset($this->keys[$offsetlower]); 116 | } 117 | 118 | /** 119 | * Offset Get 120 | * 121 | * Return the stored data at the provided offset. The offset is converted to 122 | * lowercase and the lookup is done on the Data store directly. 123 | * 124 | * @see https://secure.php.net/manual/en/arrayaccess.offsetget.php 125 | * 126 | * @param string $offset Offset to lookup. 127 | * 128 | * @return mixed The data stored at the offset. 129 | * 130 | * @access public 131 | */ 132 | public function offsetGet($offset) 133 | { 134 | $offsetlower = strtolower($offset); 135 | return isset($this->data[$offsetlower]) ? $this->data[$offsetlower] : null; 136 | } 137 | 138 | /** 139 | * Count 140 | * 141 | * @see https://secure.php.net/manual/en/countable.count.php 142 | * 143 | * @param void 144 | * 145 | * @return int The number of elements stored in the Array. 146 | * 147 | * @access public 148 | */ 149 | public function count() 150 | { 151 | return (int) count($this->data); 152 | } 153 | 154 | /** 155 | * Current 156 | * 157 | * @see https://secure.php.net/manual/en/iterator.current.php 158 | * 159 | * @param void 160 | * 161 | * @return mixed Data at the current position. 162 | * 163 | * @access public 164 | */ 165 | public function current() 166 | { 167 | return current($this->data); 168 | } 169 | 170 | /** 171 | * Next 172 | * 173 | * @see https://secure.php.net/manual/en/iterator.next.php 174 | * 175 | * @param void 176 | * 177 | * @return void 178 | * 179 | * @access public 180 | */ 181 | public function next() 182 | { 183 | next($this->data); 184 | } 185 | 186 | /** 187 | * Key 188 | * 189 | * @see https://secure.php.net/manual/en/iterator.key.php 190 | * 191 | * @param void 192 | * 193 | * @return mixed Case-Sensitive key at current position. 194 | * 195 | * @access public 196 | */ 197 | public function key() 198 | { 199 | $key = key($this->data); 200 | return isset($this->keys[$key]) ? $this->keys[$key] : $key; 201 | } 202 | 203 | /** 204 | * Valid 205 | * 206 | * @see https://secure.php.net/manual/en/iterator.valid.php 207 | * 208 | * @param void 209 | * 210 | * @return bool If the current position is valid. 211 | * 212 | * @access public 213 | */ 214 | public function valid() 215 | { 216 | return (bool) !(key($this->data) === null); 217 | } 218 | 219 | /** 220 | * Rewind 221 | * 222 | * @see https://secure.php.net/manual/en/iterator.rewind.php 223 | * 224 | * @param void 225 | * 226 | * @return void 227 | * 228 | * @access public 229 | */ 230 | public function rewind() 231 | { 232 | reset($this->data); 233 | } 234 | } 235 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/alt.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/clipboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/clipboard.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/connect.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/ctrl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/ctrl.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/ctrlaltdel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/ctrlaltdel.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/disconnect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/disconnect.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/drag.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/esc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/esc.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/favicon.ico -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/favicon.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/keyboard.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/mouse_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/mouse_left.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/mouse_middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/mouse_middle.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/mouse_none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/mouse_none.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/mouse_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/mouse_right.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/power.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/screen_320x460.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/screen_320x460.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/screen_57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/screen_57x57.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/screen_700x700.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/screen_700x700.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/settings.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/showextrakeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/showextrakeys.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/images/tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/images/tab.png -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/include/Orbitron700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/include/Orbitron700.ttf -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/include/Orbitron700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solusio/SolusVM-WHMCS-Module/e793453744e9924b077206f53266d309b993375e/modules/servers/solusvmpro/novnc/include/Orbitron700.woff -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/include/base64.js: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | // From: http://hg.mozilla.org/mozilla-central/raw-file/ec10630b1a54/js/src/devtools/jint/sunspider/string-base64.js 6 | 7 | /*jslint white: false, bitwise: false, plusplus: false */ 8 | /*global console */ 9 | 10 | var Base64 = { 11 | 12 | /* Convert data (an array of integers) to a Base64 string. */ 13 | toBase64Table : 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split(''), 14 | base64Pad : '=', 15 | 16 | encode: function (data) { 17 | "use strict"; 18 | var result = ''; 19 | var toBase64Table = Base64.toBase64Table; 20 | var length = data.length 21 | var lengthpad = (length%3); 22 | var i = 0, j = 0; 23 | // Convert every three bytes to 4 ascii characters. 24 | /* BEGIN LOOP */ 25 | for (i = 0; i < (length - 2); i += 3) { 26 | result += toBase64Table[data[i] >> 2]; 27 | result += toBase64Table[((data[i] & 0x03) << 4) + (data[i+1] >> 4)]; 28 | result += toBase64Table[((data[i+1] & 0x0f) << 2) + (data[i+2] >> 6)]; 29 | result += toBase64Table[data[i+2] & 0x3f]; 30 | } 31 | /* END LOOP */ 32 | 33 | // Convert the remaining 1 or 2 bytes, pad out to 4 characters. 34 | if (lengthpad === 2) { 35 | j = length - lengthpad; 36 | result += toBase64Table[data[j] >> 2]; 37 | result += toBase64Table[((data[j] & 0x03) << 4) + (data[j+1] >> 4)]; 38 | result += toBase64Table[(data[j+1] & 0x0f) << 2]; 39 | result += toBase64Table[64]; 40 | } else if (lengthpad === 1) { 41 | j = length - lengthpad; 42 | result += toBase64Table[data[j] >> 2]; 43 | result += toBase64Table[(data[j] & 0x03) << 4]; 44 | result += toBase64Table[64]; 45 | result += toBase64Table[64]; 46 | } 47 | 48 | return result; 49 | }, 50 | 51 | /* Convert Base64 data to a string */ 52 | toBinaryTable : [ 53 | -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, 54 | -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, 55 | -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63, 56 | 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1, 57 | -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, 58 | 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1, 59 | -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, 60 | 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 61 | ], 62 | 63 | decode: function (data, offset) { 64 | "use strict"; 65 | offset = typeof(offset) !== 'undefined' ? offset : 0; 66 | var toBinaryTable = Base64.toBinaryTable; 67 | var base64Pad = Base64.base64Pad; 68 | var result, result_length, idx, i, c, padding; 69 | var leftbits = 0; // number of bits decoded, but yet to be appended 70 | var leftdata = 0; // bits decoded, but yet to be appended 71 | var data_length = data.indexOf('=') - offset; 72 | 73 | if (data_length < 0) { data_length = data.length - offset; } 74 | 75 | /* Every four characters is 3 resulting numbers */ 76 | result_length = (data_length >> 2) * 3 + Math.floor((data_length%4)/1.5); 77 | result = new Array(result_length); 78 | 79 | // Convert one by one. 80 | /* BEGIN LOOP */ 81 | for (idx = 0, i = offset; i < data.length; i++) { 82 | c = toBinaryTable[data.charCodeAt(i) & 0x7f]; 83 | padding = (data.charAt(i) === base64Pad); 84 | // Skip illegal characters and whitespace 85 | if (c === -1) { 86 | console.error("Illegal character code " + data.charCodeAt(i) + " at position " + i); 87 | continue; 88 | } 89 | 90 | // Collect data into leftdata, update bitcount 91 | leftdata = (leftdata << 6) | c; 92 | leftbits += 6; 93 | 94 | // If we have 8 or more bits, append 8 bits to the result 95 | if (leftbits >= 8) { 96 | leftbits -= 8; 97 | // Append if not padding. 98 | if (!padding) { 99 | result[idx++] = (leftdata >> leftbits) & 0xff; 100 | } 101 | leftdata &= (1 << leftbits) - 1; 102 | } 103 | } 104 | /* END LOOP */ 105 | 106 | // If there are any bits left, the base64 string was corrupted 107 | if (leftbits) { 108 | throw {name: 'Base64-Error', 109 | message: 'Corrupted base64 string'}; 110 | } 111 | 112 | return result; 113 | } 114 | 115 | }; /* End of Base64 namespace */ 116 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/include/black.css: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC black CSS 3 | * Copyright (C) 2012 Joel Martin 4 | * Copyright (C) 2013 Samuel Mannehed for Cendio AB 5 | * noVNC is licensed under the MPL 2.0 (see LICENSE.txt) 6 | * This file is licensed under the 2-Clause BSD license (see LICENSE.txt). 7 | */ 8 | 9 | #keyboardinput { 10 | background-color:#000; 11 | } 12 | 13 | .noVNC_status_normal { 14 | background: #4c4c4c; /* Old browsers */ 15 | background: -moz-linear-gradient(top, #4c4c4c 0%, #2c2c2c 50%, #000000 51%, #131313 100%); /* FF3.6+ */ 16 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4c4c4c), color-stop(50%,#2c2c2c), color-stop(51%,#000000), color-stop(100%,#131313)); /* Chrome,Safari4+ */ 17 | background: -webkit-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Chrome10+,Safari5.1+ */ 18 | background: -o-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Opera11.10+ */ 19 | background: -ms-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* IE10+ */ 20 | background: linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* W3C */ 21 | } 22 | .noVNC_status_error { 23 | background: #f04040; /* Old browsers */ 24 | background: -moz-linear-gradient(top, #f04040 0%, #2c2c2c 50%, #000000 51%, #131313 100%); /* FF3.6+ */ 25 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f04040), color-stop(50%,#2c2c2c), color-stop(51%,#000000), color-stop(100%,#131313)); /* Chrome,Safari4+ */ 26 | background: -webkit-linear-gradient(top, #f04040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Chrome10+,Safari5.1+ */ 27 | background: -o-linear-gradient(top, #f04040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Opera11.10+ */ 28 | background: -ms-linear-gradient(top, #f04040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* IE10+ */ 29 | background: linear-gradient(top, #f04040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* W3C */ 30 | } 31 | .noVNC_status_warn { 32 | background: #f0f040; /* Old browsers */ 33 | background: -moz-linear-gradient(top, #f0f040 0%, #2c2c2c 50%, #000000 51%, #131313 100%); /* FF3.6+ */ 34 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f0f040), color-stop(50%,#2c2c2c), color-stop(51%,#000000), color-stop(100%,#131313)); /* Chrome,Safari4+ */ 35 | background: -webkit-linear-gradient(top, #f0f040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Chrome10+,Safari5.1+ */ 36 | background: -o-linear-gradient(top, #f0f040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Opera11.10+ */ 37 | background: -ms-linear-gradient(top, #f0f040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* IE10+ */ 38 | background: linear-gradient(top, #f0f040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* W3C */ 39 | } 40 | 41 | .triangle-right { 42 | border:2px solid #fff; 43 | background:#000; 44 | color:#fff; 45 | } 46 | 47 | .noVNC_status_button { 48 | font-size: 12px; 49 | vertical-align: middle; 50 | border:1px solid #4c4c4c; 51 | 52 | background: #4c4c4c; /* Old browsers */ 53 | background: -moz-linear-gradient(top, #4c4c4c 0%, #2c2c2c 50%, #000000 51%, #131313 100%); /* FF3.6+ */ 54 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4c4c4c), color-stop(50%,#2c2c2c), color-stop(51%,#000000), color-stop(100%,#131313)); /* Chrome,Safari4+ */ 55 | background: -webkit-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Chrome10+,Safari5.1+ */ 56 | background: -o-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Opera11.10+ */ 57 | background: -ms-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* IE10+ */ 58 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313',GradientType=0 ); /* IE6-9 */ 59 | background: linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* W3C */ 60 | } 61 | 62 | .noVNC_status_button_selected { 63 | background: #9dd53a; /* Old browsers */ 64 | background: -moz-linear-gradient(top, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%); /* FF3.6+ */ 65 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9dd53a), color-stop(50%,#a1d54f), color-stop(51%,#80c217), color-stop(100%,#7cbc0a)); /* Chrome,Safari4+ */ 66 | background: -webkit-linear-gradient(top, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* Chrome10+,Safari5.1+ */ 67 | background: -o-linear-gradient(top, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* Opera11.10+ */ 68 | background: -ms-linear-gradient(top, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* IE10+ */ 69 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9dd53a', endColorstr='#7cbc0a',GradientType=0 ); /* IE6-9 */ 70 | background: linear-gradient(top, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* W3C */ 71 | } 72 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/include/blue.css: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC blue CSS 3 | * Copyright (C) 2012 Joel Martin 4 | * Copyright (C) 2013 Samuel Mannehed for Cendio AB 5 | * noVNC is licensed under the MPL 2.0 (see LICENSE.txt) 6 | * This file is licensed under the 2-Clause BSD license (see LICENSE.txt). 7 | */ 8 | 9 | .noVNC_status_normal { 10 | background-color:#04073d; 11 | background-image: -webkit-gradient( 12 | linear, 13 | left bottom, 14 | left top, 15 | color-stop(0.54, rgb(10,15,79)), 16 | color-stop(0.5, rgb(4,7,61)) 17 | ); 18 | background-image: -moz-linear-gradient( 19 | center bottom, 20 | rgb(10,15,79) 54%, 21 | rgb(4,7,61) 50% 22 | ); 23 | } 24 | .noVNC_status_error { 25 | background-color:#f04040; 26 | background-image: -webkit-gradient( 27 | linear, 28 | left bottom, 29 | left top, 30 | color-stop(0.54, rgb(240,64,64)), 31 | color-stop(0.5, rgb(4,7,61)) 32 | ); 33 | background-image: -moz-linear-gradient( 34 | center bottom, 35 | rgb(4,7,61) 54%, 36 | rgb(249,64,64) 50% 37 | ); 38 | } 39 | .noVNC_status_warn { 40 | background-color:#f0f040; 41 | background-image: -webkit-gradient( 42 | linear, 43 | left bottom, 44 | left top, 45 | color-stop(0.54, rgb(240,240,64)), 46 | color-stop(0.5, rgb(4,7,61)) 47 | ); 48 | background-image: -moz-linear-gradient( 49 | center bottom, 50 | rgb(4,7,61) 54%, 51 | rgb(240,240,64) 50% 52 | ); 53 | } 54 | 55 | .triangle-right { 56 | border:2px solid #fff; 57 | background:#04073d; 58 | color:#fff; 59 | } 60 | 61 | #keyboardinput { 62 | background-color:#04073d; 63 | } 64 | 65 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/include/des.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Ported from Flashlight VNC ActionScript implementation: 3 | * http://www.wizhelp.com/flashlight-vnc/ 4 | * 5 | * Full attribution follows: 6 | * 7 | * ------------------------------------------------------------------------- 8 | * 9 | * This DES class has been extracted from package Acme.Crypto for use in VNC. 10 | * The unnecessary odd parity code has been removed. 11 | * 12 | * These changes are: 13 | * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 14 | * 15 | * This software is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 | * 19 | 20 | * DesCipher - the DES encryption method 21 | * 22 | * The meat of this code is by Dave Zimmerman , and is: 23 | * 24 | * Copyright (c) 1996 Widget Workshop, Inc. All Rights Reserved. 25 | * 26 | * Permission to use, copy, modify, and distribute this software 27 | * and its documentation for NON-COMMERCIAL or COMMERCIAL purposes and 28 | * without fee is hereby granted, provided that this copyright notice is kept 29 | * intact. 30 | * 31 | * WIDGET WORKSHOP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY 32 | * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 33 | * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 34 | * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WIDGET WORKSHOP SHALL NOT BE LIABLE 35 | * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR 36 | * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. 37 | * 38 | * THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE 39 | * CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE 40 | * PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT 41 | * NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE 42 | * SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE 43 | * SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE 44 | * PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES"). WIDGET WORKSHOP 45 | * SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR 46 | * HIGH RISK ACTIVITIES. 47 | * 48 | * 49 | * The rest is: 50 | * 51 | * Copyright (C) 1996 by Jef Poskanzer . All rights reserved. 52 | * 53 | * Redistribution and use in source and binary forms, with or without 54 | * modification, are permitted provided that the following conditions 55 | * are met: 56 | * 1. Redistributions of source code must retain the above copyright 57 | * notice, this list of conditions and the following disclaimer. 58 | * 2. Redistributions in binary form must reproduce the above copyright 59 | * notice, this list of conditions and the following disclaimer in the 60 | * documentation and/or other materials provided with the distribution. 61 | * 62 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 63 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 64 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 65 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 66 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 67 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 68 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 69 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 70 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 71 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 72 | * SUCH DAMAGE. 73 | * 74 | * Visit the ACME Labs Java page for up-to-date versions of this and other 75 | * fine Java utilities: http://www.acme.com/java/ 76 | */ 77 | 78 | "use strict"; 79 | /*jslint white: false, bitwise: false, plusplus: false */ 80 | 81 | function DES(passwd) { 82 | 83 | // Tables, permutations, S-boxes, etc. 84 | var PC2 = [13,16,10,23, 0, 4, 2,27,14, 5,20, 9,22,18,11, 3, 85 | 25, 7,15, 6,26,19,12, 1,40,51,30,36,46,54,29,39, 86 | 50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31 ], 87 | totrot = [ 1, 2, 4, 6, 8,10,12,14,15,17,19,21,23,25,27,28], 88 | z = 0x0, a,b,c,d,e,f, SP1,SP2,SP3,SP4,SP5,SP6,SP7,SP8, 89 | keys = []; 90 | 91 | a=1<<16; b=1<<24; c=a|b; d=1<<2; e=1<<10; f=d|e; 92 | SP1 = [c|e,z|z,a|z,c|f,c|d,a|f,z|d,a|z,z|e,c|e,c|f,z|e,b|f,c|d,b|z,z|d, 93 | z|f,b|e,b|e,a|e,a|e,c|z,c|z,b|f,a|d,b|d,b|d,a|d,z|z,z|f,a|f,b|z, 94 | a|z,c|f,z|d,c|z,c|e,b|z,b|z,z|e,c|d,a|z,a|e,b|d,z|e,z|d,b|f,a|f, 95 | c|f,a|d,c|z,b|f,b|d,z|f,a|f,c|e,z|f,b|e,b|e,z|z,a|d,a|e,z|z,c|d]; 96 | a=1<<20; b=1<<31; c=a|b; d=1<<5; e=1<<15; f=d|e; 97 | SP2 = [c|f,b|e,z|e,a|f,a|z,z|d,c|d,b|f,b|d,c|f,c|e,b|z,b|e,a|z,z|d,c|d, 98 | a|e,a|d,b|f,z|z,b|z,z|e,a|f,c|z,a|d,b|d,z|z,a|e,z|f,c|e,c|z,z|f, 99 | z|z,a|f,c|d,a|z,b|f,c|z,c|e,z|e,c|z,b|e,z|d,c|f,a|f,z|d,z|e,b|z, 100 | z|f,c|e,a|z,b|d,a|d,b|f,b|d,a|d,a|e,z|z,b|e,z|f,b|z,c|d,c|f,a|e]; 101 | a=1<<17; b=1<<27; c=a|b; d=1<<3; e=1<<9; f=d|e; 102 | SP3 = [z|f,c|e,z|z,c|d,b|e,z|z,a|f,b|e,a|d,b|d,b|d,a|z,c|f,a|d,c|z,z|f, 103 | b|z,z|d,c|e,z|e,a|e,c|z,c|d,a|f,b|f,a|e,a|z,b|f,z|d,c|f,z|e,b|z, 104 | c|e,b|z,a|d,z|f,a|z,c|e,b|e,z|z,z|e,a|d,c|f,b|e,b|d,z|e,z|z,c|d, 105 | b|f,a|z,b|z,c|f,z|d,a|f,a|e,b|d,c|z,b|f,z|f,c|z,a|f,z|d,c|d,a|e]; 106 | a=1<<13; b=1<<23; c=a|b; d=1<<0; e=1<<7; f=d|e; 107 | SP4 = [c|d,a|f,a|f,z|e,c|e,b|f,b|d,a|d,z|z,c|z,c|z,c|f,z|f,z|z,b|e,b|d, 108 | z|d,a|z,b|z,c|d,z|e,b|z,a|d,a|e,b|f,z|d,a|e,b|e,a|z,c|e,c|f,z|f, 109 | b|e,b|d,c|z,c|f,z|f,z|z,z|z,c|z,a|e,b|e,b|f,z|d,c|d,a|f,a|f,z|e, 110 | c|f,z|f,z|d,a|z,b|d,a|d,c|e,b|f,a|d,a|e,b|z,c|d,z|e,b|z,a|z,c|e]; 111 | a=1<<25; b=1<<30; c=a|b; d=1<<8; e=1<<19; f=d|e; 112 | SP5 = [z|d,a|f,a|e,c|d,z|e,z|d,b|z,a|e,b|f,z|e,a|d,b|f,c|d,c|e,z|f,b|z, 113 | a|z,b|e,b|e,z|z,b|d,c|f,c|f,a|d,c|e,b|d,z|z,c|z,a|f,a|z,c|z,z|f, 114 | z|e,c|d,z|d,a|z,b|z,a|e,c|d,b|f,a|d,b|z,c|e,a|f,b|f,z|d,a|z,c|e, 115 | c|f,z|f,c|z,c|f,a|e,z|z,b|e,c|z,z|f,a|d,b|d,z|e,z|z,b|e,a|f,b|d]; 116 | a=1<<22; b=1<<29; c=a|b; d=1<<4; e=1<<14; f=d|e; 117 | SP6 = [b|d,c|z,z|e,c|f,c|z,z|d,c|f,a|z,b|e,a|f,a|z,b|d,a|d,b|e,b|z,z|f, 118 | z|z,a|d,b|f,z|e,a|e,b|f,z|d,c|d,c|d,z|z,a|f,c|e,z|f,a|e,c|e,b|z, 119 | b|e,z|d,c|d,a|e,c|f,a|z,z|f,b|d,a|z,b|e,b|z,z|f,b|d,c|f,a|e,c|z, 120 | a|f,c|e,z|z,c|d,z|d,z|e,c|z,a|f,z|e,a|d,b|f,z|z,c|e,b|z,a|d,b|f]; 121 | a=1<<21; b=1<<26; c=a|b; d=1<<1; e=1<<11; f=d|e; 122 | SP7 = [a|z,c|d,b|f,z|z,z|e,b|f,a|f,c|e,c|f,a|z,z|z,b|d,z|d,b|z,c|d,z|f, 123 | b|e,a|f,a|d,b|e,b|d,c|z,c|e,a|d,c|z,z|e,z|f,c|f,a|e,z|d,b|z,a|e, 124 | b|z,a|e,a|z,b|f,b|f,c|d,c|d,z|d,a|d,b|z,b|e,a|z,c|e,z|f,a|f,c|e, 125 | z|f,b|d,c|f,c|z,a|e,z|z,z|d,c|f,z|z,a|f,c|z,z|e,b|d,b|e,z|e,a|d]; 126 | a=1<<18; b=1<<28; c=a|b; d=1<<6; e=1<<12; f=d|e; 127 | SP8 = [b|f,z|e,a|z,c|f,b|z,b|f,z|d,b|z,a|d,c|z,c|f,a|e,c|e,a|f,z|e,z|d, 128 | c|z,b|d,b|e,z|f,a|e,a|d,c|d,c|e,z|f,z|z,z|z,c|d,b|d,b|e,a|f,a|z, 129 | a|f,a|z,c|e,z|e,z|d,c|d,z|e,a|f,b|e,z|d,b|d,c|z,c|d,b|z,a|z,b|f, 130 | z|z,c|f,a|d,b|d,c|z,b|e,b|f,z|z,c|f,a|e,a|e,z|f,z|f,a|d,b|z,c|e]; 131 | 132 | // Set the key. 133 | function setKeys(keyBlock) { 134 | var i, j, l, m, n, o, pc1m = [], pcr = [], kn = [], 135 | raw0, raw1, rawi, KnLi; 136 | 137 | for (j = 0, l = 56; j < 56; ++j, l-=8) { 138 | l += l<-5 ? 65 : l<-3 ? 31 : l<-1 ? 63 : l===27 ? 35 : 0; // PC1 139 | m = l & 0x7; 140 | pc1m[j] = ((keyBlock[l >>> 3] & (1<>> 10; 174 | keys[KnLi] |= (raw1 & 0x00000fc0) >>> 6; 175 | ++KnLi; 176 | keys[KnLi] = (raw0 & 0x0003f000) << 12; 177 | keys[KnLi] |= (raw0 & 0x0000003f) << 16; 178 | keys[KnLi] |= (raw1 & 0x0003f000) >>> 4; 179 | keys[KnLi] |= (raw1 & 0x0000003f); 180 | ++KnLi; 181 | } 182 | } 183 | 184 | // Encrypt 8 bytes of text 185 | function enc8(text) { 186 | var i = 0, b = text.slice(), fval, keysi = 0, 187 | l, r, x; // left, right, accumulator 188 | 189 | // Squash 8 bytes to 2 ints 190 | l = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++]; 191 | r = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++]; 192 | 193 | x = ((l >>> 4) ^ r) & 0x0f0f0f0f; 194 | r ^= x; 195 | l ^= (x << 4); 196 | x = ((l >>> 16) ^ r) & 0x0000ffff; 197 | r ^= x; 198 | l ^= (x << 16); 199 | x = ((r >>> 2) ^ l) & 0x33333333; 200 | l ^= x; 201 | r ^= (x << 2); 202 | x = ((r >>> 8) ^ l) & 0x00ff00ff; 203 | l ^= x; 204 | r ^= (x << 8); 205 | r = (r << 1) | ((r >>> 31) & 1); 206 | x = (l ^ r) & 0xaaaaaaaa; 207 | l ^= x; 208 | r ^= x; 209 | l = (l << 1) | ((l >>> 31) & 1); 210 | 211 | for (i = 0; i < 8; ++i) { 212 | x = (r << 28) | (r >>> 4); 213 | x ^= keys[keysi++]; 214 | fval = SP7[x & 0x3f]; 215 | fval |= SP5[(x >>> 8) & 0x3f]; 216 | fval |= SP3[(x >>> 16) & 0x3f]; 217 | fval |= SP1[(x >>> 24) & 0x3f]; 218 | x = r ^ keys[keysi++]; 219 | fval |= SP8[x & 0x3f]; 220 | fval |= SP6[(x >>> 8) & 0x3f]; 221 | fval |= SP4[(x >>> 16) & 0x3f]; 222 | fval |= SP2[(x >>> 24) & 0x3f]; 223 | l ^= fval; 224 | x = (l << 28) | (l >>> 4); 225 | x ^= keys[keysi++]; 226 | fval = SP7[x & 0x3f]; 227 | fval |= SP5[(x >>> 8) & 0x3f]; 228 | fval |= SP3[(x >>> 16) & 0x3f]; 229 | fval |= SP1[(x >>> 24) & 0x3f]; 230 | x = l ^ keys[keysi++]; 231 | fval |= SP8[x & 0x0000003f]; 232 | fval |= SP6[(x >>> 8) & 0x3f]; 233 | fval |= SP4[(x >>> 16) & 0x3f]; 234 | fval |= SP2[(x >>> 24) & 0x3f]; 235 | r ^= fval; 236 | } 237 | 238 | r = (r << 31) | (r >>> 1); 239 | x = (l ^ r) & 0xaaaaaaaa; 240 | l ^= x; 241 | r ^= x; 242 | l = (l << 31) | (l >>> 1); 243 | x = ((l >>> 8) ^ r) & 0x00ff00ff; 244 | r ^= x; 245 | l ^= (x << 8); 246 | x = ((l >>> 2) ^ r) & 0x33333333; 247 | r ^= x; 248 | l ^= (x << 2); 249 | x = ((r >>> 16) ^ l) & 0x0000ffff; 250 | l ^= x; 251 | r ^= (x << 16); 252 | x = ((r >>> 4) ^ l) & 0x0f0f0f0f; 253 | l ^= x; 254 | r ^= (x << 4); 255 | 256 | // Spread ints to bytes 257 | x = [r, l]; 258 | for (i = 0; i < 8; i++) { 259 | b[i] = (x[i>>>2] >>> (8*(3 - (i%4)))) % 256; 260 | if (b[i] < 0) { b[i] += 256; } // unsigned 261 | } 262 | return b; 263 | } 264 | 265 | // Encrypt 16 bytes of text using passwd as key 266 | function encrypt(t) { 267 | return enc8(t.slice(0,8)).concat(enc8(t.slice(8,16))); 268 | } 269 | 270 | setKeys(passwd); // Setup keys 271 | return {'encrypt': encrypt}; // Public interface 272 | 273 | } // function DES 274 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/include/input.js: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC: HTML5 VNC client 3 | * Copyright (C) 2012 Joel Martin 4 | * Copyright (C) 2013 Samuel Mannehed for Cendio AB 5 | * Licensed under MPL 2.0 or any later version (see LICENSE.txt) 6 | */ 7 | 8 | /*jslint browser: true, white: false, bitwise: false */ 9 | /*global window, Util */ 10 | 11 | 12 | // 13 | // Keyboard event handler 14 | // 15 | 16 | function Keyboard(defaults) { 17 | "use strict"; 18 | 19 | var that = {}, // Public API methods 20 | conf = {}, // Configuration attributes 21 | 22 | keyDownList = []; // List of depressed keys 23 | // (even if they are happy) 24 | 25 | // Configuration attributes 26 | Util.conf_defaults(conf, that, defaults, [ 27 | ['target', 'wo', 'dom', document, 'DOM element that captures keyboard input'], 28 | ['focused', 'rw', 'bool', true, 'Capture and send key events'], 29 | 30 | ['onKeyPress', 'rw', 'func', null, 'Handler for key press/release'] 31 | ]); 32 | 33 | 34 | // 35 | // Private functions 36 | // 37 | 38 | /////// setup 39 | 40 | function onRfbEvent(evt) { 41 | if (conf.onKeyPress) { 42 | Util.Debug("onKeyPress " + (evt.type == 'keydown' ? "down" : "up") 43 | + ", keysym: " + evt.keysym.keysym + "(" + evt.keysym.keyname + ")"); 44 | conf.onKeyPress(evt.keysym.keysym, evt.type == 'keydown'); 45 | } 46 | } 47 | 48 | // create the keyboard handler 49 | var k = KeyEventDecoder(kbdUtil.ModifierSync(), 50 | VerifyCharModifier( 51 | TrackKeyState( 52 | EscapeModifiers(onRfbEvent) 53 | ) 54 | ) 55 | ); 56 | 57 | function onKeyDown(e) { 58 | if (! conf.focused) { 59 | return true; 60 | } 61 | if (k.keydown(e)) { 62 | // Suppress bubbling/default actions 63 | Util.stopEvent(e); 64 | return false; 65 | } else { 66 | // Allow the event to bubble and become a keyPress event which 67 | // will have the character code translated 68 | return true; 69 | } 70 | } 71 | function onKeyPress(e) { 72 | if (! conf.focused) { 73 | return true; 74 | } 75 | if (k.keypress(e)) { 76 | // Suppress bubbling/default actions 77 | Util.stopEvent(e); 78 | return false; 79 | } else { 80 | // Allow the event to bubble and become a keyPress event which 81 | // will have the character code translated 82 | return true; 83 | } 84 | } 85 | 86 | function onKeyUp(e) { 87 | if (! conf.focused) { 88 | return true; 89 | } 90 | if (k.keyup(e)) { 91 | // Suppress bubbling/default actions 92 | Util.stopEvent(e); 93 | return false; 94 | } else { 95 | // Allow the event to bubble and become a keyPress event which 96 | // will have the character code translated 97 | return true; 98 | } 99 | } 100 | 101 | function onOther(e) { 102 | k.syncModifiers(e); 103 | } 104 | 105 | function allKeysUp() { 106 | Util.Debug(">> Keyboard.allKeysUp"); 107 | 108 | k.releaseAll(); 109 | Util.Debug("<< Keyboard.allKeysUp"); 110 | } 111 | 112 | // 113 | // Public API interface functions 114 | // 115 | 116 | that.grab = function() { 117 | //Util.Debug(">> Keyboard.grab"); 118 | var c = conf.target; 119 | 120 | Util.addEvent(c, 'keydown', onKeyDown); 121 | Util.addEvent(c, 'keyup', onKeyUp); 122 | Util.addEvent(c, 'keypress', onKeyPress); 123 | 124 | // Release (key up) if window loses focus 125 | Util.addEvent(window, 'blur', allKeysUp); 126 | 127 | //Util.Debug("<< Keyboard.grab"); 128 | }; 129 | 130 | that.ungrab = function() { 131 | //Util.Debug(">> Keyboard.ungrab"); 132 | var c = conf.target; 133 | 134 | Util.removeEvent(c, 'keydown', onKeyDown); 135 | Util.removeEvent(c, 'keyup', onKeyUp); 136 | Util.removeEvent(c, 'keypress', onKeyPress); 137 | Util.removeEvent(window, 'blur', allKeysUp); 138 | 139 | // Release (key up) all keys that are in a down state 140 | allKeysUp(); 141 | 142 | //Util.Debug(">> Keyboard.ungrab"); 143 | }; 144 | 145 | that.sync = function(e) { 146 | k.syncModifiers(e); 147 | } 148 | 149 | return that; // Return the public API interface 150 | 151 | } // End of Keyboard() 152 | 153 | 154 | // 155 | // Mouse event handler 156 | // 157 | 158 | function Mouse(defaults) { 159 | "use strict"; 160 | 161 | var that = {}, // Public API methods 162 | conf = {}, // Configuration attributes 163 | mouseCaptured = false; 164 | 165 | var doubleClickTimer = null, 166 | lastTouchPos = null; 167 | 168 | // Configuration attributes 169 | Util.conf_defaults(conf, that, defaults, [ 170 | ['target', 'ro', 'dom', document, 'DOM element that captures mouse input'], 171 | ['notify', 'ro', 'func', null, 'Function to call to notify whenever a mouse event is received'], 172 | ['focused', 'rw', 'bool', true, 'Capture and send mouse clicks/movement'], 173 | ['scale', 'rw', 'float', 1.0, 'Viewport scale factor 0.0 - 1.0'], 174 | 175 | ['onMouseButton', 'rw', 'func', null, 'Handler for mouse button click/release'], 176 | ['onMouseMove', 'rw', 'func', null, 'Handler for mouse movement'], 177 | ['touchButton', 'rw', 'int', 1, 'Button mask (1, 2, 4) for touch devices (0 means ignore clicks)'] 178 | ]); 179 | 180 | function captureMouse() { 181 | // capturing the mouse ensures we get the mouseup event 182 | if (conf.target.setCapture) { 183 | conf.target.setCapture(); 184 | } 185 | 186 | // some browsers give us mouseup events regardless, 187 | // so if we never captured the mouse, we can disregard the event 188 | mouseCaptured = true; 189 | } 190 | 191 | function releaseMouse() { 192 | if (conf.target.releaseCapture) { 193 | conf.target.releaseCapture(); 194 | } 195 | mouseCaptured = false; 196 | } 197 | // 198 | // Private functions 199 | // 200 | 201 | function resetDoubleClickTimer() { 202 | doubleClickTimer = null; 203 | } 204 | 205 | function onMouseButton(e, down) { 206 | var evt, pos, bmask; 207 | if (! conf.focused) { 208 | return true; 209 | } 210 | 211 | if (conf.notify) { 212 | conf.notify(e); 213 | } 214 | 215 | evt = (e ? e : window.event); 216 | pos = Util.getEventPosition(e, conf.target, conf.scale); 217 | 218 | if (e.touches || e.changedTouches) { 219 | // Touch device 220 | 221 | // When two touches occur within 500 ms of each other and are 222 | // closer than 20 pixels together a double click is triggered. 223 | if (down == 1) { 224 | if (doubleClickTimer == null) { 225 | lastTouchPos = pos; 226 | } else { 227 | clearTimeout(doubleClickTimer); 228 | 229 | // When the distance between the two touches is small enough 230 | // force the position of the latter touch to the position of 231 | // the first. 232 | 233 | var xs = lastTouchPos.x - pos.x; 234 | var ys = lastTouchPos.y - pos.y; 235 | var d = Math.sqrt((xs * xs) + (ys * ys)); 236 | 237 | // The goal is to trigger on a certain physical width, the 238 | // devicePixelRatio brings us a bit closer but is not optimal. 239 | if (d < 20 * window.devicePixelRatio) { 240 | pos = lastTouchPos; 241 | } 242 | } 243 | doubleClickTimer = setTimeout(resetDoubleClickTimer, 500); 244 | } 245 | bmask = conf.touchButton; 246 | // If bmask is set 247 | } else if (evt.which) { 248 | /* everything except IE */ 249 | bmask = 1 << evt.button; 250 | } else { 251 | /* IE including 9 */ 252 | bmask = (evt.button & 0x1) + // Left 253 | (evt.button & 0x2) * 2 + // Right 254 | (evt.button & 0x4) / 2; // Middle 255 | } 256 | //Util.Debug("mouse " + pos.x + "," + pos.y + " down: " + down + 257 | // " bmask: " + bmask + "(evt.button: " + evt.button + ")"); 258 | if (conf.onMouseButton) { 259 | Util.Debug("onMouseButton " + (down ? "down" : "up") + 260 | ", x: " + pos.x + ", y: " + pos.y + ", bmask: " + bmask); 261 | conf.onMouseButton(pos.x, pos.y, down, bmask); 262 | } 263 | Util.stopEvent(e); 264 | return false; 265 | } 266 | 267 | function onMouseDown(e) { 268 | captureMouse(); 269 | onMouseButton(e, 1); 270 | } 271 | 272 | function onMouseUp(e) { 273 | if (!mouseCaptured) { 274 | return; 275 | } 276 | 277 | onMouseButton(e, 0); 278 | releaseMouse(); 279 | } 280 | 281 | function onMouseWheel(e) { 282 | var evt, pos, bmask, wheelData; 283 | if (! conf.focused) { 284 | return true; 285 | } 286 | if (conf.notify) { 287 | conf.notify(e); 288 | } 289 | 290 | evt = (e ? e : window.event); 291 | pos = Util.getEventPosition(e, conf.target, conf.scale); 292 | wheelData = evt.detail ? evt.detail * -1 : evt.wheelDelta / 40; 293 | if (wheelData > 0) { 294 | bmask = 1 << 3; 295 | } else { 296 | bmask = 1 << 4; 297 | } 298 | //Util.Debug('mouse scroll by ' + wheelData + ':' + pos.x + "," + pos.y); 299 | if (conf.onMouseButton) { 300 | conf.onMouseButton(pos.x, pos.y, 1, bmask); 301 | conf.onMouseButton(pos.x, pos.y, 0, bmask); 302 | } 303 | Util.stopEvent(e); 304 | return false; 305 | } 306 | 307 | function onMouseMove(e) { 308 | var evt, pos; 309 | if (! conf.focused) { 310 | return true; 311 | } 312 | if (conf.notify) { 313 | conf.notify(e); 314 | } 315 | 316 | evt = (e ? e : window.event); 317 | pos = Util.getEventPosition(e, conf.target, conf.scale); 318 | //Util.Debug('mouse ' + evt.which + '/' + evt.button + ' up:' + pos.x + "," + pos.y); 319 | if (conf.onMouseMove) { 320 | conf.onMouseMove(pos.x, pos.y); 321 | } 322 | Util.stopEvent(e); 323 | return false; 324 | } 325 | 326 | function onMouseDisable(e) { 327 | var evt, pos; 328 | if (! conf.focused) { 329 | return true; 330 | } 331 | evt = (e ? e : window.event); 332 | pos = Util.getEventPosition(e, conf.target, conf.scale); 333 | /* Stop propagation if inside canvas area */ 334 | if ((pos.realx >= 0) && (pos.realy >= 0) && 335 | (pos.realx < conf.target.offsetWidth) && 336 | (pos.realy < conf.target.offsetHeight)) { 337 | //Util.Debug("mouse event disabled"); 338 | Util.stopEvent(e); 339 | return false; 340 | } 341 | //Util.Debug("mouse event not disabled"); 342 | return true; 343 | } 344 | 345 | // 346 | // Public API interface functions 347 | // 348 | 349 | that.grab = function() { 350 | //Util.Debug(">> Mouse.grab"); 351 | var c = conf.target; 352 | 353 | if ('ontouchstart' in document.documentElement) { 354 | Util.addEvent(c, 'touchstart', onMouseDown); 355 | Util.addEvent(window, 'touchend', onMouseUp); 356 | Util.addEvent(c, 'touchend', onMouseUp); 357 | Util.addEvent(c, 'touchmove', onMouseMove); 358 | } else { 359 | Util.addEvent(c, 'mousedown', onMouseDown); 360 | Util.addEvent(window, 'mouseup', onMouseUp); 361 | Util.addEvent(c, 'mouseup', onMouseUp); 362 | Util.addEvent(c, 'mousemove', onMouseMove); 363 | Util.addEvent(c, (Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel', 364 | onMouseWheel); 365 | } 366 | 367 | /* Work around right and middle click browser behaviors */ 368 | Util.addEvent(document, 'click', onMouseDisable); 369 | Util.addEvent(document.body, 'contextmenu', onMouseDisable); 370 | 371 | //Util.Debug("<< Mouse.grab"); 372 | }; 373 | 374 | that.ungrab = function() { 375 | //Util.Debug(">> Mouse.ungrab"); 376 | var c = conf.target; 377 | 378 | if ('ontouchstart' in document.documentElement) { 379 | Util.removeEvent(c, 'touchstart', onMouseDown); 380 | Util.removeEvent(window, 'touchend', onMouseUp); 381 | Util.removeEvent(c, 'touchend', onMouseUp); 382 | Util.removeEvent(c, 'touchmove', onMouseMove); 383 | } else { 384 | Util.removeEvent(c, 'mousedown', onMouseDown); 385 | Util.removeEvent(window, 'mouseup', onMouseUp); 386 | Util.removeEvent(c, 'mouseup', onMouseUp); 387 | Util.removeEvent(c, 'mousemove', onMouseMove); 388 | Util.removeEvent(c, (Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel', 389 | onMouseWheel); 390 | } 391 | 392 | /* Work around right and middle click browser behaviors */ 393 | Util.removeEvent(document, 'click', onMouseDisable); 394 | Util.removeEvent(document.body, 'contextmenu', onMouseDisable); 395 | 396 | //Util.Debug(">> Mouse.ungrab"); 397 | }; 398 | 399 | return that; // Return the public API interface 400 | 401 | } // End of Mouse() 402 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/include/playback.js: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC: HTML5 VNC client 3 | * Copyright (C) 2012 Joel Martin 4 | * Licensed under MPL 2.0 (see LICENSE.txt) 5 | */ 6 | 7 | "use strict"; 8 | /*jslint browser: true, white: false */ 9 | /*global Util, VNC_frame_data, finish */ 10 | 11 | var rfb, mode, test_state, frame_idx, frame_length, 12 | iteration, iterations, istart_time, 13 | 14 | // Pre-declarations for jslint 15 | send_array, next_iteration, queue_next_packet, do_packet; 16 | 17 | // Override send_array 18 | send_array = function (arr) { 19 | // Stub out send_array 20 | }; 21 | 22 | next_iteration = function () { 23 | if (iteration === 0) { 24 | frame_length = VNC_frame_data.length; 25 | test_state = 'running'; 26 | } else { 27 | rfb.disconnect(); 28 | } 29 | 30 | if (test_state !== 'running') { return; } 31 | 32 | iteration += 1; 33 | if (iteration > iterations) { 34 | finish(); 35 | return; 36 | } 37 | 38 | frame_idx = 0; 39 | istart_time = (new Date()).getTime(); 40 | rfb.connect('test', 0, "bogus"); 41 | 42 | queue_next_packet(); 43 | 44 | }; 45 | 46 | queue_next_packet = function () { 47 | var frame, foffset, toffset, delay; 48 | if (test_state !== 'running') { return; } 49 | 50 | frame = VNC_frame_data[frame_idx]; 51 | while ((frame_idx < frame_length) && (frame.charAt(0) === "}")) { 52 | //Util.Debug("Send frame " + frame_idx); 53 | frame_idx += 1; 54 | frame = VNC_frame_data[frame_idx]; 55 | } 56 | 57 | if (frame === 'EOF') { 58 | Util.Debug("Finished, found EOF"); 59 | next_iteration(); 60 | return; 61 | } 62 | if (frame_idx >= frame_length) { 63 | Util.Debug("Finished, no more frames"); 64 | next_iteration(); 65 | return; 66 | } 67 | 68 | if (mode === 'realtime') { 69 | foffset = frame.slice(1, frame.indexOf('{', 1)); 70 | toffset = (new Date()).getTime() - istart_time; 71 | delay = foffset - toffset; 72 | if (delay < 1) { 73 | delay = 1; 74 | } 75 | 76 | setTimeout(do_packet, delay); 77 | } else { 78 | setTimeout(do_packet, 1); 79 | } 80 | }; 81 | 82 | var bytes_processed = 0; 83 | 84 | do_packet = function () { 85 | //Util.Debug("Processing frame: " + frame_idx); 86 | var frame = VNC_frame_data[frame_idx], 87 | start = frame.indexOf('{', 1) + 1; 88 | bytes_processed += frame.length - start; 89 | if (VNC_frame_encoding === 'binary') { 90 | var u8 = new Uint8Array(frame.length - start); 91 | for (var i = 0; i < frame.length - start; i++) { 92 | u8[i] = frame.charCodeAt(start + i); 93 | } 94 | rfb.recv_message({'data' : u8}); 95 | } else { 96 | rfb.recv_message({'data' : frame.slice(start)}); 97 | } 98 | frame_idx += 1; 99 | 100 | queue_next_packet(); 101 | }; 102 | 103 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/include/websock.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Websock: high-performance binary WebSockets 3 | * Copyright (C) 2012 Joel Martin 4 | * Licensed under MPL 2.0 (see LICENSE.txt) 5 | * 6 | * Websock is similar to the standard WebSocket object but Websock 7 | * enables communication with raw TCP sockets (i.e. the binary stream) 8 | * via websockify. This is accomplished by base64 encoding the data 9 | * stream between Websock and websockify. 10 | * 11 | * Websock has built-in receive queue buffering; the message event 12 | * does not contain actual data but is simply a notification that 13 | * there is new data available. Several rQ* methods are available to 14 | * read binary data off of the receive queue. 15 | */ 16 | 17 | /*jslint browser: true, bitwise: false, plusplus: false */ 18 | /*global Util, Base64 */ 19 | 20 | 21 | // Load Flash WebSocket emulator if needed 22 | 23 | // To force WebSocket emulator even when native WebSocket available 24 | //window.WEB_SOCKET_FORCE_FLASH = true; 25 | // To enable WebSocket emulator debug: 26 | //window.WEB_SOCKET_DEBUG=1; 27 | 28 | if (window.WebSocket && !window.WEB_SOCKET_FORCE_FLASH) { 29 | Websock_native = true; 30 | } else if (window.MozWebSocket && !window.WEB_SOCKET_FORCE_FLASH) { 31 | Websock_native = true; 32 | window.WebSocket = window.MozWebSocket; 33 | } else { 34 | /* no builtin WebSocket so load web_socket.js */ 35 | 36 | Websock_native = false; 37 | (function () { 38 | window.WEB_SOCKET_SWF_LOCATION = Util.get_include_uri() + 39 | "web-socket-js/WebSocketMain.swf"; 40 | if (Util.Engine.trident) { 41 | Util.Debug("Forcing uncached load of WebSocketMain.swf"); 42 | window.WEB_SOCKET_SWF_LOCATION += "?" + Math.random(); 43 | } 44 | Util.load_scripts(["web-socket-js/swfobject.js", 45 | "web-socket-js/web_socket.js"]); 46 | }()); 47 | } 48 | 49 | 50 | function Websock() { 51 | "use strict"; 52 | 53 | var api = {}, // Public API 54 | websocket = null, // WebSocket object 55 | mode = 'base64', // Current WebSocket mode: 'binary', 'base64' 56 | rQ = [], // Receive queue 57 | rQi = 0, // Receive queue index 58 | rQmax = 10000, // Max receive queue size before compacting 59 | sQ = [], // Send queue 60 | 61 | eventHandlers = { 62 | 'message' : function() {}, 63 | 'open' : function() {}, 64 | 'close' : function() {}, 65 | 'error' : function() {} 66 | }, 67 | 68 | test_mode = false; 69 | 70 | 71 | // 72 | // Queue public functions 73 | // 74 | 75 | function get_sQ() { 76 | return sQ; 77 | } 78 | 79 | function get_rQ() { 80 | return rQ; 81 | } 82 | function get_rQi() { 83 | return rQi; 84 | } 85 | function set_rQi(val) { 86 | rQi = val; 87 | } 88 | 89 | function rQlen() { 90 | return rQ.length - rQi; 91 | } 92 | 93 | function rQpeek8() { 94 | return (rQ[rQi] ); 95 | } 96 | function rQshift8() { 97 | return (rQ[rQi++] ); 98 | } 99 | function rQunshift8(num) { 100 | if (rQi === 0) { 101 | rQ.unshift(num); 102 | } else { 103 | rQi -= 1; 104 | rQ[rQi] = num; 105 | } 106 | 107 | } 108 | function rQshift16() { 109 | return (rQ[rQi++] << 8) + 110 | (rQ[rQi++] ); 111 | } 112 | function rQshift32() { 113 | return (rQ[rQi++] << 24) + 114 | (rQ[rQi++] << 16) + 115 | (rQ[rQi++] << 8) + 116 | (rQ[rQi++] ); 117 | } 118 | function rQshiftStr(len) { 119 | if (typeof(len) === 'undefined') { len = rQlen(); } 120 | var arr = rQ.slice(rQi, rQi + len); 121 | rQi += len; 122 | return String.fromCharCode.apply(null, arr); 123 | } 124 | function rQshiftBytes(len) { 125 | if (typeof(len) === 'undefined') { len = rQlen(); } 126 | rQi += len; 127 | return rQ.slice(rQi-len, rQi); 128 | } 129 | 130 | function rQslice(start, end) { 131 | if (end) { 132 | return rQ.slice(rQi + start, rQi + end); 133 | } else { 134 | return rQ.slice(rQi + start); 135 | } 136 | } 137 | 138 | // Check to see if we must wait for 'num' bytes (default to FBU.bytes) 139 | // to be available in the receive queue. Return true if we need to 140 | // wait (and possibly print a debug message), otherwise false. 141 | function rQwait(msg, num, goback) { 142 | var rQlen = rQ.length - rQi; // Skip rQlen() function call 143 | if (rQlen < num) { 144 | if (goback) { 145 | if (rQi < goback) { 146 | throw("rQwait cannot backup " + goback + " bytes"); 147 | } 148 | rQi -= goback; 149 | } 150 | //Util.Debug(" waiting for " + (num-rQlen) + 151 | // " " + msg + " byte(s)"); 152 | return true; // true means need more data 153 | } 154 | return false; 155 | } 156 | 157 | // 158 | // Private utility routines 159 | // 160 | 161 | function encode_message() { 162 | if (mode === 'binary') { 163 | // Put in a binary arraybuffer 164 | return (new Uint8Array(sQ)).buffer; 165 | } else { 166 | // base64 encode 167 | return Base64.encode(sQ); 168 | } 169 | } 170 | 171 | function decode_message(data) { 172 | //Util.Debug(">> decode_message: " + data); 173 | if (mode === 'binary') { 174 | // push arraybuffer values onto the end 175 | var u8 = new Uint8Array(data); 176 | for (var i = 0; i < u8.length; i++) { 177 | rQ.push(u8[i]); 178 | } 179 | } else { 180 | // base64 decode and concat to the end 181 | rQ = rQ.concat(Base64.decode(data, 0)); 182 | } 183 | //Util.Debug(">> decode_message, rQ: " + rQ); 184 | } 185 | 186 | 187 | // 188 | // Public Send functions 189 | // 190 | 191 | function flush() { 192 | if (websocket.bufferedAmount !== 0) { 193 | Util.Debug("bufferedAmount: " + websocket.bufferedAmount); 194 | } 195 | if (websocket.bufferedAmount < api.maxBufferedAmount) { 196 | //Util.Debug("arr: " + arr); 197 | //Util.Debug("sQ: " + sQ); 198 | if (sQ.length > 0) { 199 | websocket.send(encode_message(sQ)); 200 | sQ = []; 201 | } 202 | return true; 203 | } else { 204 | Util.Info("Delaying send, bufferedAmount: " + 205 | websocket.bufferedAmount); 206 | return false; 207 | } 208 | } 209 | 210 | // overridable for testing 211 | function send(arr) { 212 | //Util.Debug(">> send_array: " + arr); 213 | sQ = sQ.concat(arr); 214 | return flush(); 215 | } 216 | 217 | function send_string(str) { 218 | //Util.Debug(">> send_string: " + str); 219 | api.send(str.split('').map( 220 | function (chr) { return chr.charCodeAt(0); } ) ); 221 | } 222 | 223 | // 224 | // Other public functions 225 | 226 | function recv_message(e) { 227 | //Util.Debug(">> recv_message: " + e.data.length); 228 | 229 | try { 230 | decode_message(e.data); 231 | if (rQlen() > 0) { 232 | eventHandlers.message(); 233 | // Compact the receive queue 234 | if (rQ.length > rQmax) { 235 | //Util.Debug("Compacting receive queue"); 236 | rQ = rQ.slice(rQi); 237 | rQi = 0; 238 | } 239 | } else { 240 | Util.Debug("Ignoring empty message"); 241 | } 242 | } catch (exc) { 243 | if (typeof exc.stack !== 'undefined') { 244 | Util.Warn("recv_message, caught exception: " + exc.stack); 245 | } else if (typeof exc.description !== 'undefined') { 246 | Util.Warn("recv_message, caught exception: " + exc.description); 247 | } else { 248 | Util.Warn("recv_message, caught exception:" + exc); 249 | } 250 | if (typeof exc.name !== 'undefined') { 251 | eventHandlers.error(exc.name + ": " + exc.message); 252 | } else { 253 | eventHandlers.error(exc); 254 | } 255 | } 256 | //Util.Debug("<< recv_message"); 257 | } 258 | 259 | 260 | // Set event handlers 261 | function on(evt, handler) { 262 | eventHandlers[evt] = handler; 263 | } 264 | 265 | function init(protocols) { 266 | rQ = []; 267 | rQi = 0; 268 | sQ = []; 269 | websocket = null; 270 | 271 | var bt = false, 272 | wsbt = false, 273 | try_binary = false; 274 | 275 | // Check for full typed array support 276 | if (('Uint8Array' in window) && 277 | ('set' in Uint8Array.prototype)) { 278 | bt = true; 279 | } 280 | 281 | // Check for full binary type support in WebSockets 282 | // TODO: this sucks, the property should exist on the prototype 283 | // but it does not. 284 | try { 285 | if (bt && ('binaryType' in (new WebSocket("ws://localhost:17523")))) { 286 | Util.Info("Detected binaryType support in WebSockets"); 287 | wsbt = true; 288 | } 289 | } catch (exc) { 290 | // Just ignore failed test localhost connections 291 | } 292 | 293 | // Default protocols if not specified 294 | if (typeof(protocols) === "undefined") { 295 | if (wsbt) { 296 | protocols = ['binary', 'base64']; 297 | } else { 298 | protocols = 'base64'; 299 | } 300 | } 301 | 302 | // If no binary support, make sure it was not requested 303 | if (!wsbt) { 304 | if (protocols === 'binary') { 305 | throw("WebSocket binary sub-protocol requested but not supported"); 306 | } 307 | if (typeof(protocols) === "object") { 308 | var new_protocols = []; 309 | for (var i = 0; i < protocols.length; i++) { 310 | if (protocols[i] === 'binary') { 311 | Util.Error("Skipping unsupported WebSocket binary sub-protocol"); 312 | } else { 313 | new_protocols.push(protocols[i]); 314 | } 315 | } 316 | if (new_protocols.length > 0) { 317 | protocols = new_protocols; 318 | } else { 319 | throw("Only WebSocket binary sub-protocol was requested and not supported."); 320 | } 321 | } 322 | } 323 | 324 | return protocols; 325 | } 326 | 327 | function open(uri, protocols) { 328 | protocols = init(protocols); 329 | 330 | if (test_mode) { 331 | websocket = {}; 332 | } else { 333 | websocket = new WebSocket(uri, protocols); 334 | if (protocols.indexOf('binary') >= 0) { 335 | websocket.binaryType = 'arraybuffer'; 336 | } 337 | } 338 | 339 | websocket.onmessage = recv_message; 340 | websocket.onopen = function() { 341 | Util.Debug(">> WebSock.onopen"); 342 | if (websocket.protocol) { 343 | mode = websocket.protocol; 344 | Util.Info("Server chose sub-protocol: " + websocket.protocol); 345 | } else { 346 | mode = 'base64'; 347 | Util.Error("Server select no sub-protocol!: " + websocket.protocol); 348 | } 349 | eventHandlers.open(); 350 | Util.Debug("<< WebSock.onopen"); 351 | }; 352 | websocket.onclose = function(e) { 353 | Util.Debug(">> WebSock.onclose"); 354 | eventHandlers.close(e); 355 | Util.Debug("<< WebSock.onclose"); 356 | }; 357 | websocket.onerror = function(e) { 358 | Util.Debug(">> WebSock.onerror: " + e); 359 | eventHandlers.error(e); 360 | Util.Debug("<< WebSock.onerror"); 361 | }; 362 | } 363 | 364 | function close() { 365 | if (websocket) { 366 | if ((websocket.readyState === WebSocket.OPEN) || 367 | (websocket.readyState === WebSocket.CONNECTING)) { 368 | Util.Info("Closing WebSocket connection"); 369 | websocket.close(); 370 | } 371 | websocket.onmessage = function (e) { return; }; 372 | } 373 | } 374 | 375 | // Override internal functions for testing 376 | // Takes a send function, returns reference to recv function 377 | function testMode(override_send, data_mode) { 378 | test_mode = true; 379 | mode = data_mode; 380 | api.send = override_send; 381 | api.close = function () {}; 382 | return recv_message; 383 | } 384 | 385 | function constructor() { 386 | // Configuration settings 387 | api.maxBufferedAmount = 200; 388 | 389 | // Direct access to send and receive queues 390 | api.get_sQ = get_sQ; 391 | api.get_rQ = get_rQ; 392 | api.get_rQi = get_rQi; 393 | api.set_rQi = set_rQi; 394 | 395 | // Routines to read from the receive queue 396 | api.rQlen = rQlen; 397 | api.rQpeek8 = rQpeek8; 398 | api.rQshift8 = rQshift8; 399 | api.rQunshift8 = rQunshift8; 400 | api.rQshift16 = rQshift16; 401 | api.rQshift32 = rQshift32; 402 | api.rQshiftStr = rQshiftStr; 403 | api.rQshiftBytes = rQshiftBytes; 404 | api.rQslice = rQslice; 405 | api.rQwait = rQwait; 406 | 407 | api.flush = flush; 408 | api.send = send; 409 | api.send_string = send_string; 410 | 411 | api.on = on; 412 | api.init = init; 413 | api.open = open; 414 | api.close = close; 415 | api.testMode = testMode; 416 | 417 | return api; 418 | } 419 | 420 | return constructor(); 421 | 422 | } 423 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/novnc/include/webutil.js: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC: HTML5 VNC client 3 | * Copyright (C) 2012 Joel Martin 4 | * Copyright (C) 2013 NTT corp. 5 | * Licensed under MPL 2.0 (see LICENSE.txt) 6 | * 7 | * See README.md for usage and integration instructions. 8 | */ 9 | 10 | "use strict"; 11 | /*jslint bitwise: false, white: false */ 12 | /*global Util, window, document */ 13 | 14 | // Globals defined here 15 | var WebUtil = {}, $D; 16 | 17 | /* 18 | * Simple DOM selector by ID 19 | */ 20 | if (!window.$D) { 21 | window.$D = function (id) { 22 | if (document.getElementById) { 23 | return document.getElementById(id); 24 | } else if (document.all) { 25 | return document.all[id]; 26 | } else if (document.layers) { 27 | return document.layers[id]; 28 | } 29 | return undefined; 30 | }; 31 | } 32 | 33 | 34 | /* 35 | * ------------------------------------------------------ 36 | * Namespaced in WebUtil 37 | * ------------------------------------------------------ 38 | */ 39 | 40 | // init log level reading the logging HTTP param 41 | WebUtil.init_logging = function(level) { 42 | if (typeof level !== "undefined") { 43 | Util._log_level = level; 44 | } else { 45 | Util._log_level = (document.location.href.match( 46 | /logging=([A-Za-z0-9\._\-]*)/) || 47 | ['', Util._log_level])[1]; 48 | } 49 | Util.init_logging(); 50 | }; 51 | 52 | 53 | WebUtil.dirObj = function (obj, depth, parent) { 54 | var i, msg = "", val = ""; 55 | if (! depth) { depth=2; } 56 | if (! parent) { parent= ""; } 57 | 58 | // Print the properties of the passed-in object 59 | for (i in obj) { 60 | if ((depth > 1) && (typeof obj[i] === "object")) { 61 | // Recurse attributes that are objects 62 | msg += WebUtil.dirObj(obj[i], depth-1, parent + "." + i); 63 | } else { 64 | //val = new String(obj[i]).replace("\n", " "); 65 | if (typeof(obj[i]) === "undefined") { 66 | val = "undefined"; 67 | } else { 68 | val = obj[i].toString().replace("\n", " "); 69 | } 70 | if (val.length > 30) { 71 | val = val.substr(0,30) + "..."; 72 | } 73 | msg += parent + "." + i + ": " + val + "\n"; 74 | } 75 | } 76 | return msg; 77 | }; 78 | 79 | // Read a query string variable 80 | WebUtil.getQueryVar = function(name, defVal) { 81 | var re = new RegExp('.*[?&]' + name + '=([^&#]*)'), 82 | match = document.location.href.match(re); 83 | if (typeof defVal === 'undefined') { defVal = null; } 84 | if (match) { 85 | return decodeURIComponent(match[1]); 86 | } else { 87 | return defVal; 88 | } 89 | }; 90 | 91 | 92 | /* 93 | * Cookie handling. Dervied from: http://www.quirksmode.org/js/cookies.html 94 | */ 95 | 96 | // No days means only for this browser session 97 | WebUtil.createCookie = function(name,value,days) { 98 | var date, expires, secure; 99 | if (days) { 100 | date = new Date(); 101 | date.setTime(date.getTime()+(days*24*60*60*1000)); 102 | expires = "; expires="+date.toGMTString(); 103 | } else { 104 | expires = ""; 105 | } 106 | if (document.location.protocol === "https:") { 107 | secure = "; secure"; 108 | } else { 109 | secure = ""; 110 | } 111 | document.cookie = name+"="+value+expires+"; path=/"+secure; 112 | }; 113 | 114 | WebUtil.readCookie = function(name, defaultValue) { 115 | var i, c, nameEQ = name + "=", ca = document.cookie.split(';'); 116 | for(i=0; i < ca.length; i += 1) { 117 | c = ca[i]; 118 | while (c.charAt(0) === ' ') { c = c.substring(1,c.length); } 119 | if (c.indexOf(nameEQ) === 0) { return c.substring(nameEQ.length,c.length); } 120 | } 121 | return (typeof defaultValue !== 'undefined') ? defaultValue : null; 122 | }; 123 | 124 | WebUtil.eraseCookie = function(name) { 125 | WebUtil.createCookie(name,"",-1); 126 | }; 127 | 128 | /* 129 | * Setting handling. 130 | */ 131 | 132 | WebUtil.initSettings = function(callback) { 133 | var callbackArgs = Array.prototype.slice.call(arguments, 1); 134 | if (window.chrome && window.chrome.storage) { 135 | window.chrome.storage.sync.get(function (cfg) { 136 | WebUtil.settings = cfg; 137 | console.log(WebUtil.settings); 138 | if (callback) { 139 | callback.apply(this, callbackArgs); 140 | } 141 | }); 142 | } else { 143 | // No-op 144 | if (callback) { 145 | callback.apply(this, callbackArgs); 146 | } 147 | } 148 | }; 149 | 150 | // No days means only for this browser session 151 | WebUtil.writeSetting = function(name, value) { 152 | if (window.chrome && window.chrome.storage) { 153 | //console.log("writeSetting:", name, value); 154 | if (WebUtil.settings[name] !== value) { 155 | WebUtil.settings[name] = value; 156 | window.chrome.storage.sync.set(WebUtil.settings); 157 | } 158 | } else { 159 | localStorage.setItem(name, value); 160 | } 161 | }; 162 | 163 | WebUtil.readSetting = function(name, defaultValue) { 164 | var value; 165 | if (window.chrome && window.chrome.storage) { 166 | value = WebUtil.settings[name]; 167 | } else { 168 | value = localStorage.getItem(name); 169 | } 170 | if (typeof value === "undefined") { 171 | value = null; 172 | } 173 | if (value === null && typeof defaultValue !== undefined) { 174 | return defaultValue; 175 | } else { 176 | return value; 177 | } 178 | }; 179 | 180 | WebUtil.eraseSetting = function(name) { 181 | if (window.chrome && window.chrome.storage) { 182 | window.chrome.storage.sync.remove(name); 183 | delete WebUtil.settings[name]; 184 | } else { 185 | localStorage.removeItem(name); 186 | } 187 | }; 188 | 189 | /* 190 | * Alternate stylesheet selection 191 | */ 192 | WebUtil.getStylesheets = function() { var i, links, sheets = []; 193 | links = document.getElementsByTagName("link"); 194 | for (i = 0; i < links.length; i += 1) { 195 | if (links[i].title && 196 | links[i].rel.toUpperCase().indexOf("STYLESHEET") > -1) { 197 | sheets.push(links[i]); 198 | } 199 | } 200 | return sheets; 201 | }; 202 | 203 | // No sheet means try and use value from cookie, null sheet used to 204 | // clear all alternates. 205 | WebUtil.selectStylesheet = function(sheet) { 206 | var i, link, sheets = WebUtil.getStylesheets(); 207 | if (typeof sheet === 'undefined') { 208 | sheet = 'default'; 209 | } 210 | for (i=0; i < sheets.length; i += 1) { 211 | link = sheets[i]; 212 | if (link.title === sheet) { 213 | Util.Debug("Using stylesheet " + sheet); 214 | link.disabled = false; 215 | } else { 216 | //Util.Debug("Skipping stylesheet " + link.title); 217 | link.disabled = true; 218 | } 219 | } 220 | return sheet; 221 | }; 222 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/templates/clientarea.tpl: -------------------------------------------------------------------------------- 1 | {if count($data)>0} 2 | {literal} 3 | 32 | {/literal} 33 | 34 | 35 | 160 | 161 |
36 | 37 | 38 | 86 | 87 | 88 | 89 | 90 | {if $data['displaygraphs'] } 91 | 92 | 93 | 98 | {/if} 99 | 100 | {if $data['displaybandwidthbar'] } 101 | 102 | 103 | 109 | 110 | {/if} 111 | {if $data['displaymemorybar'] } 112 | 113 | 114 | 119 | 120 | {/if} 121 | {if $data['displayhddbar'] } 122 | 123 | 124 | 131 | 132 | {/if} 133 | {if $data['clientkeyautherror'] } 134 | 135 | 140 | 141 | {/if} 142 | 143 | {if $data['displaystatus'] } 144 | 145 | 146 | 149 | 150 | {/if} 151 | 152 | {if $data['displayips'] } 153 | 154 | 155 | 156 | 157 | {/if} 158 |
39 | {if $data['displayreboot'] } 40 | 42 | {/if} 43 | {if $data['displayshutdown'] } 44 | 46 | {/if} 47 | {if $data['displayboot'] } 48 | 50 | {/if} 51 | {if $data['displayconsole'] } 52 | 54 | {/if} 55 | {if $data['displayhtml5console'] } 56 | 58 | {/if} 59 | {if $data['displayvnc'] } 60 | 62 | {/if} 63 | {if $data['displayrootpassword'] } 64 | 66 | {/if} 67 | {if $data['displayhostname'] } 68 | 70 | {/if} 71 | {if $data['displayvncpassword'] } 72 | 74 | {/if} 75 | {if $data['displaypanelbutton'] } 76 | 78 | {/if} 79 | {if $data['displayclientkeyauth'] } 80 |
83 |
84 | {/if} 85 |
{$LANG.graphs}: 96 |
{$LANG.bandwidth}: 104 |
{$data["bandwidthpercent"]}% 105 |
106 |
{$data["bandwidthused"]} {$LANG.of} {$data["bandwidthtotal"]} {$LANG.used} 107 | / {$data["bandwidthfree"]} {$LANG.free} 108 |
{$LANG.memory}: 115 |
{$data["memorypercent"]}% 116 |
117 |
{$data["memoryused"]} {$LANG.of} {$data["memorytotal"]} {$LANG.used} / {$data["memoryfree"]} {$LANG.free} 118 |
Disk: 125 |
{$data["hddpercent"]}% 126 | 127 |
129 |
{$data["hddused"]} {$LANG.of} {$data["hddtotal"]} {$LANG.used} / {$data["hddfree"]} {$LANG.free} 130 |
136 |
137 |

{$LANG.accessUnavailable}

138 |
139 |
{$LANG.status}: 147 | {$data["displaystatus"]} 148 |
{$LANG.ipAddress}:{$data["ipcsv"]}
159 |
162 | {else} 163 | 164 |

{$LANG.VSC}

165 | 166 | 167 | 175 | 176 |
168 | 169 | 170 | 171 | 172 | 173 |
{$LANG.status}:{$LANG.unavailable}
174 |
177 | {/if} -------------------------------------------------------------------------------- /modules/servers/solusvmpro/templates/error.tpl: -------------------------------------------------------------------------------- 1 |

Oops! Something went wrong.

2 | 3 |
4 |

Extra template variables work here too: {$usefulErrorHelper}

5 |
6 | 7 |

Please go back and try again.

8 | 9 |

If the problem persists, please contact support.

10 | -------------------------------------------------------------------------------- /modules/servers/solusvmpro/vnc.php: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | '; 26 | 27 | $ca = new WHMCS_ClientArea(); 28 | if (!$ca->isLoggedIn()) { 29 | if ((!isset($_SESSION['adminid']) || ((int)$_SESSION['adminid'] <= 0))) { 30 | echo '
' . $_LANG['solusvmpro_unauthorized'] . '
'; 31 | exit(); 32 | } 33 | $uid = (int)$_GET['uid']; 34 | } else { 35 | $uid = $ca->getUserID(); 36 | } 37 | 38 | $servid = isset( $_GET['id'] ) ? (int) $_GET['id'] : ""; 39 | 40 | if ( $servid == "" ) { 41 | echo '
' . $_LANG['solusvmpro_unauthorized'] . '
'; 42 | exit(); 43 | } 44 | 45 | $params = SolusVM::getParamsFromServiceID( $servid, $uid ); 46 | 47 | if ( $params === false ) { 48 | echo '
' . $_LANG['solusvmpro_vserverNotFound'] . '
'; 49 | exit; 50 | } 51 | $solusvm = new SolusVM( $params ); 52 | 53 | ################### Code ################### 54 | if ( $solusvm->getExtData["clientfunctions"] == "disable" ) { 55 | echo '
' . $_LANG['solusvmpro_functionDisabled'] . ''; 56 | } 57 | 58 | if ( $solusvm->getExtData["vnc"] == "disable" ) { 59 | echo '
' . $_LANG['solusvmpro_functionDisabled'] . ''; 60 | } 61 | 62 | $callArray = array( "vserverid" => $params["vserver"] ); 63 | $solusvm->apiCall( 'vserver-vnc', $callArray ); 64 | $r = $solusvm->result; 65 | 66 | 67 | if ( $r["status"] != "success" ) { 68 | $pagedata = '
' . $_LANG['solusvmpro_unknownError'] . '
'; 69 | echo $pagedata; 70 | echo ''; 71 | exit(); 72 | } 73 | if ( isset( $r["vncip"] ) ) { 74 | $r["vncip"] = trim( $r["vncip"] ); 75 | } 76 | if ( isset( $r["sockethost"] ) ) { 77 | $r["sockethost"] = trim( $r["sockethost"] ); 78 | } 79 | 80 | if ( $r["type"] != "xenhvm" && $r["type"] != "kvm" ) { 81 | $pagedata = '
' . $_LANG['solusvmpro_unknownError'] . '
'; 82 | echo $pagedata; 83 | echo ''; 84 | exit(); 85 | } 86 | if ( $r["sockethost"] ) { 87 | $htmlvnc = '  '; 88 | } 89 | $javavnc = '  '; 90 | $buttons = '
' . $javavnc . $htmlvnc . '


'; 91 | if ( $_GET['_vnc'] == "java" ) { 92 | $pagedata = $buttons . '
93 | 94 | 95 | 96 | 97 | ' . $_LANG['solusvmpro_needsJavaPlugins'] . ' 98 |
'; 99 | echo $pagedata; 100 | } elseif ( $_GET['_vnc'] == "html" ) { ?> 101 | 102 | 103 | 104 | 105 | 106 | 107 | 117 | <?php echo $_LANG['solusvmpro_noVNC']; ?> 118 | 119 | 120 | 121 | 123 | 124 | 125 | 126 | 128 | 129 | 131 | 132 | 134 | 135 | 137 | 140 | 141 | 142 | 143 | 144 | 145 | 149 | 150 | 151 | 152 | 153 |
154 |
156 | 157 | 158 | 164 | 178 | 179 |
159 |
161 | 162 |
163 |
165 |
166 | 168 | 169 | 171 | 173 | 175 | 176 |
177 |
180 |
181 | 182 | 183 | 184 |
185 | 186 | 335 | 336 | 337 | '; 346 | --------------------------------------------------------------------------------