From 7b95a730888b87c4e1642a5e9b2ca47425d69f9d Mon Sep 17 00:00:00 2001 From: xevidos Date: Tue, 16 Apr 2019 12:52:41 -0400 Subject: [PATCH] Modified in input icon class, Removed debug code, Modified regex expressions, --- components/active/init.js | 7 - components/filemanager/class.filemanager.php | 2 +- components/install/install.php | 4 +- components/install/view.php | 763 ++++++++++--------- components/settings/init.js | 1 - components/user/class.user.php | 2 +- themes/default/screen.css | 2 +- 7 files changed, 410 insertions(+), 371 deletions(-) diff --git a/components/active/init.js b/components/active/init.js index 1316699..428053a 100755 --- a/components/active/init.js +++ b/components/active/init.js @@ -1008,8 +1008,6 @@ return; } - //console.log( codiad.active.position_timer, path, JSON.stringify( position ) ); - $.ajax({ type: 'POST', url: codiad.active.controller + '?action=save_position', @@ -1020,7 +1018,6 @@ success: function( data ) { codiad.active.position_timer = Date.now(); - //console.log( "called save position: ", data ); }, }); }, 500); @@ -1039,8 +1036,6 @@ for( let i = codiad.editor.instances.length;i--; ) { - //console.log( codiad.editor.instances[i].getSession().path, path, ( codiad.editor.instances[i].getSession().path == path ) ); - if( codiad.editor.instances[i].getSession().path == path ) { editor = codiad.editor.instances[i]; @@ -1069,8 +1064,6 @@ cursor = this.getPosition(); } - console.log( "setting position", cursor ); - editor.scrollToLine( cursor.row, true, true, function() {}); editor.moveCursorTo( cursor.row, cursor.column ); }, diff --git a/components/filemanager/class.filemanager.php b/components/filemanager/class.filemanager.php index 4d2585f..8946de7 100755 --- a/components/filemanager/class.filemanager.php +++ b/components/filemanager/class.filemanager.php @@ -774,7 +774,7 @@ class Filemanager extends Common { * trying to rename or delete it, allow the actual file name. */ - $invalid_characters = preg_match( '/[^A-Za-z0-9\-\._\/\ ]/', $path ); + $invalid_characters = preg_match( '/[^A-Za-z0-9\-\._@\/\ ]/', $path ); if( $invalid_characters && ! ( $_GET['action'] == "modify" || $_GET['action'] == "delete" ) ) { diff --git a/components/install/install.php b/components/install/install.php index 568bf31..a51e2fd 100644 --- a/components/install/install.php +++ b/components/install/install.php @@ -88,7 +88,7 @@ class Install { function clean_username( $username ) { - return strtolower( preg_replace( '#[^A-Za-z0-9' . preg_quote( '-_@. ').']#', '', $username ) ); + return strtolower( preg_replace( '/[^\w\-\._@]/', '-', $username ) ); } function create_config() { @@ -162,7 +162,7 @@ define("WSURL", BASE_URL . "/workspace"); if ( ! $this->is_abs_path( $project_path ) ) { - $project_path = str_replace( " ", "_", preg_replace( '/[^\w-\.]/', '', $project_path ) ); + $project_path = preg_replace( '/[^\w-._@]/', '-', $project_path ); if( ! is_dir( $this->workspace . "/" . $project_path ) ) { mkdir( $this->workspace . "/" . $project_path ); diff --git a/components/install/view.php b/components/install/view.php index 6fc1e26..119cf4c 100755 --- a/components/install/view.php +++ b/components/install/view.php @@ -1,4 +1,3 @@ -
getTimezone()->getName(); -if (ini_get('register_globals') == 1) { - $register = true; +if ( ini_get('register_globals') == 1) { + + $register = true; } else { - $register = false; + + $register = false; } -if (ini_get('newrelic.enabled') == 1) { - $newrelic = true; +if ( ini_get('newrelic.enabled') == 1 ) { + + $newrelic = true; } else { - $newrelic = false; + + $newrelic = false; } $query = $_SERVER['QUERY_STRING']; - $autocomplete = array( - 'username' => '', - 'password' => '', - 'password_confirm' => '', - 'project_name' => '', - 'project_path' => '', - 'timezone' => $timeZone, - 'site_name' => '', - - 'dbhost' => '', - 'dbname' => '', - 'dbuser' => '', - 'dbpass' => '', - 'dbtype' => 'mysql', + 'username' => '', + 'password' => '', + 'password_confirm' => '', + 'project_name' => '', + 'project_path' => '', + 'timezone' => $timeZone, + 'site_name' => '', + + 'dbhost' => '', + 'dbname' => '', + 'dbuser' => '', + 'dbpass' => '', + 'dbtype' => 'mysql', ); -if (!empty($query)) { - $params = explode('&', $query); - foreach ($params as $param) { - $param = explode('=', $param); - if (array_key_exists($param[0], $autocomplete)) { - $autocomplete[$param[0]] = urldecode($param[1]); - } - } +if ( ! empty( $query ) ) { + + $params = explode('&', $query); + foreach( $params as $param ) { + + $param = explode( '=', $param ); + if( array_key_exists( $param[0], $autocomplete ) ) { + + $autocomplete[$param[0]] = urldecode($param[1]); + } + } } -if (!$workspace || !$data || !$config || $register || $newrelic) { - ?> -

-

-
-

[SYSTEM]/config.php - PASSED'; -} else { - echo 'ERROR'; -} ?>

-

[SYSTEM]/workspace - PASSED'; -} else { - echo 'ERROR'; -} ?>

-

[SYSTEM]/plugins - PASSED'; -} else { - echo 'ERROR'; -} ?>

-

[SYSTEM]/themes - PASSED'; -} else { - echo 'ERROR'; -} ?>

-

[SYSTEM]/data - PASSED'; -} else { - echo 'ERROR'; -} ?>

-
- -

-
- register_globals: Off

'; -} -if ($newrelic) { - echo '

newrelic.enabled: Off

'; -} ?> -
- - - - -
-

- - -
- "required", - "OpenSSL"=>"required", - "MBString"=>"required", - "MySQL"=>"", - "PGSQL"=>"", - "SQLite3"=>"" - ] as $dep=>$status) { - if (extension_loaded(strtolower($dep))) { ?> -
- -
- -
- - - - - - -
- - - -
- -
- - - -
- -
- - - - -
- -
- -
- - - - - - - - - - - - - - - -
- "(GMT-11:00) Midway Island, Samoa", - "America/Adak" => "(GMT-10:00) Hawaii-Aleutian", - "Etc/GMT+10" => "(GMT-10:00) Hawaii", - "Pacific/Marquesas" => "(GMT-09:30) Marquesas Islands", - "Pacific/Gambier" => "(GMT-09:00) Gambier Islands", - "America/Anchorage" => "(GMT-09:00) Alaska", - "America/Ensenada" => "(GMT-08:00) Tijuana, Baja California", - "Etc/GMT+8" => "(GMT-08:00) Pitcairn Islands", - "America/Los_Angeles" => "(GMT-08:00) Pacific Time (US & Canada)", - "America/Denver" => "(GMT-07:00) Mountain Time (US & Canada)", - "America/Chihuahua" => "(GMT-07:00) Chihuahua, La Paz, Mazatlan", - "America/Dawson_Creek" => "(GMT-07:00) Arizona", - "America/Belize" => "(GMT-06:00) Saskatchewan, Central America", - "America/Cancun" => "(GMT-06:00) Guadalajara, Mexico City, Monterrey", - "Chile/EasterIsland" => "(GMT-06:00) Easter Island", - "America/Chicago" => "(GMT-06:00) Central Time (US & Canada)", - "America/New_York" => "(GMT-05:00) Eastern Time (US & Canada)", - "America/Havana" => "(GMT-05:00) Cuba", - "America/Bogota" => "(GMT-05:00) Bogota, Lima, Quito, Rio Branco", - "America/Caracas" => "(GMT-04:30) Caracas", - "America/Santiago" => "(GMT-04:00) Santiago", - "America/La_Paz" => "(GMT-04:00) La Paz", - "Atlantic/Stanley" => "(GMT-04:00) Faukland Islands", - "America/Campo_Grande" => "(GMT-04:00) Brazil", - "America/Goose_Bay" => "(GMT-04:00) Atlantic Time (Goose Bay)", - "America/Glace_Bay" => "(GMT-04:00) Atlantic Time (Canada)", - "America/St_Johns" => "(GMT-03:30) Newfoundland", - "America/Araguaina" => "(GMT-03:00) UTC-3", - "America/Montevideo" => "(GMT-03:00) Montevideo", - "America/Miquelon" => "(GMT-03:00) Miquelon, St. Pierre", - "America/Godthab" => "(GMT-03:00) Greenland", - "America/Argentina/Buenos_Aires" => "(GMT-03:00) Buenos Aires", - "America/Sao_Paulo" => "(GMT-03:00) Brasilia", - "America/Noronha" => "(GMT-02:00) Mid-Atlantic", - "Atlantic/Cape_Verde" => "(GMT-01:00) Cape Verde Is.", - "Atlantic/Azores" => "(GMT-01:00) Azores", - "Europe/Belfast" => "(GMT) Greenwich Mean Time : Belfast", - "Europe/Dublin" => "(GMT) Greenwich Mean Time : Dublin", - "Europe/Lisbon" => "(GMT) Greenwich Mean Time : Lisbon", - "Europe/London" => "(GMT) Greenwich Mean Time : London", - "Africa/Abidjan" => "(GMT) Monrovia, Reykjavik", - "Europe/Amsterdam" => "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna", - "Europe/Belgrade" => "(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague", - "Europe/Brussels" => "(GMT+01:00) Brussels, Copenhagen, Madrid, Paris", - "Africa/Algiers" => "(GMT+01:00) West Central Africa", - "Africa/Windhoek" => "(GMT+01:00) Windhoek", - "Asia/Beirut" => "(GMT+02:00) Beirut", - "Africa/Cairo" => "(GMT+02:00) Cairo", - "Asia/Gaza" => "(GMT+02:00) Gaza", - "Africa/Blantyre" => "(GMT+02:00) Harare, Pretoria", - "Asia/Jerusalem" => "(GMT+02:00) Jerusalem", - "Europe/Minsk" => "(GMT+02:00) Minsk", - "Asia/Damascus" => "(GMT+02:00) Syria", - "Europe/Moscow" => "(GMT+03:00) Moscow, St. Petersburg, Volgograd", - "Africa/Addis_Ababa" => "(GMT+03:00) Nairobi", - "Asia/Tehran" => "(GMT+03:30) Tehran", - "Asia/Dubai" => "(GMT+04:00) Abu Dhabi, Muscat", - "Asia/Yerevan" => "(GMT+04:00) Yerevan", - "Asia/Kabul" => "(GMT+04:30) Kabul", - "Asia/Yekaterinburg" => "(GMT+05:00) Ekaterinburg", - "Asia/Tashkent" => "(GMT+05:00) Tashkent", - "Asia/Kolkata" => "(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi", - "Asia/Katmandu" => "(GMT+05:45) Kathmandu", - "Asia/Dhaka" => "(GMT+06:00) Astana, Dhaka", - "Asia/Novosibirsk" => "(GMT+06:00) Novosibirsk", - "Asia/Rangoon" => "(GMT+06:30) Yangon (Rangoon)", - "Asia/Bangkok" => "(GMT+07:00) Bangkok, Hanoi, Jakarta", - "Asia/Krasnoyarsk" => "(GMT+07:00) Krasnoyarsk", - "Asia/Hong_Kong" => "(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi", - "Asia/Irkutsk" => "(GMT+08:00) Irkutsk, Ulaan Bataar", - "Australia/Perth" => "(GMT+08:00) Perth", - "Australia/Eucla" => "(GMT+08:45) Eucla", - "Asia/Tokyo" => "(GMT+09:00) Osaka, Sapporo, Tokyo", - "Asia/Seoul" => "(GMT+09:00) Seoul", - "Asia/Yakutsk" => "(GMT+09:00) Yakutsk", - "Australia/Adelaide" => "(GMT+09:30) Adelaide", - "Australia/Darwin" => "(GMT+09:30) Darwin", - "Australia/Brisbane" => "(GMT+10:00) Brisbane", - "Australia/Hobart" => "(GMT+10:00) Hobart", - "Asia/Vladivostok" => "(GMT+10:00) Vladivostok", - "Australia/Lord_Howe" => "(GMT+10:30) Lord Howe Island", - "Etc/GMT-11" => "(GMT+11:00) Solomon Is., New Caledonia", - "Asia/Magadan" => "(GMT+11:00) Magadan", - "Pacific/Norfolk" => "(GMT+11:30) Norfolk Island", - "Asia/Anadyr" => "(GMT+12:00) Anadyr, Kamchatka", - "Pacific/Auckland" => "(GMT+12:00) Auckland, Wellington", - "Etc/GMT-12" => "(GMT+12:00) Fiji, Kamchatka, Marshall Is.", - "Pacific/Chatham" => "(GMT+12:45) Chatham Islands", - "Pacific/Tongatapu" => "(GMT+13:00) Nuku'alofa", - "Pacific/Kiritimati" => "(GMT+14:00) Kiritimati", - ); - ?> - - - - -
- +
+ +

+

+
+

+ [SYSTEM]/config.php - + PASSED'; + } else { + + echo 'ERROR'; + } + ?> +

+

+ [SYSTEM]/workspace - + PASSED'; + } else { + + echo 'ERROR'; + } + ?> +

+

+ [SYSTEM]/plugins - + PASSED'; + } else { + + echo 'ERROR'; + } + ?> +

+

+ [SYSTEM]/themes - + PASSED'; + } else { + + echo 'ERROR'; + } + ?> +

+

+ [SYSTEM]/data - + PASSED'; + } else { + + echo 'ERROR'; + } + ?> +

+
+ +

+
+ register_globals: Off

'; + } + if( $newrelic ) { + echo '

newrelic.enabled: Off

'; + } + ?> +
+ + + +
+

+ +
+ "required", + "OpenSSL"=>"required", + "MBString"=>"required", + "MySQL"=>"", + "PGSQL"=>"", + "SQLite3"=>"" + ] as $dep=>$status) { + if (extension_loaded(strtolower($dep))) { ?> +
+ +
+ +
+ + + + + + +
+ + + +
+ +
+ + + +
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + + + + +
+ "(GMT-11:00) Midway Island, Samoa", + "America/Adak" => "(GMT-10:00) Hawaii-Aleutian", + "Etc/GMT+10" => "(GMT-10:00) Hawaii", + "Pacific/Marquesas" => "(GMT-09:30) Marquesas Islands", + "Pacific/Gambier" => "(GMT-09:00) Gambier Islands", + "America/Anchorage" => "(GMT-09:00) Alaska", + "America/Ensenada" => "(GMT-08:00) Tijuana, Baja California", + "Etc/GMT+8" => "(GMT-08:00) Pitcairn Islands", + "America/Los_Angeles" => "(GMT-08:00) Pacific Time (US & Canada)", + "America/Denver" => "(GMT-07:00) Mountain Time (US & Canada)", + "America/Chihuahua" => "(GMT-07:00) Chihuahua, La Paz, Mazatlan", + "America/Dawson_Creek" => "(GMT-07:00) Arizona", + "America/Belize" => "(GMT-06:00) Saskatchewan, Central America", + "America/Cancun" => "(GMT-06:00) Guadalajara, Mexico City, Monterrey", + "Chile/EasterIsland" => "(GMT-06:00) Easter Island", + "America/Chicago" => "(GMT-06:00) Central Time (US & Canada)", + "America/New_York" => "(GMT-05:00) Eastern Time (US & Canada)", + "America/Havana" => "(GMT-05:00) Cuba", + "America/Bogota" => "(GMT-05:00) Bogota, Lima, Quito, Rio Branco", + "America/Caracas" => "(GMT-04:30) Caracas", + "America/Santiago" => "(GMT-04:00) Santiago", + "America/La_Paz" => "(GMT-04:00) La Paz", + "Atlantic/Stanley" => "(GMT-04:00) Faukland Islands", + "America/Campo_Grande" => "(GMT-04:00) Brazil", + "America/Goose_Bay" => "(GMT-04:00) Atlantic Time (Goose Bay)", + "America/Glace_Bay" => "(GMT-04:00) Atlantic Time (Canada)", + "America/St_Johns" => "(GMT-03:30) Newfoundland", + "America/Araguaina" => "(GMT-03:00) UTC-3", + "America/Montevideo" => "(GMT-03:00) Montevideo", + "America/Miquelon" => "(GMT-03:00) Miquelon, St. Pierre", + "America/Godthab" => "(GMT-03:00) Greenland", + "America/Argentina/Buenos_Aires" => "(GMT-03:00) Buenos Aires", + "America/Sao_Paulo" => "(GMT-03:00) Brasilia", + "America/Noronha" => "(GMT-02:00) Mid-Atlantic", + "Atlantic/Cape_Verde" => "(GMT-01:00) Cape Verde Is.", + "Atlantic/Azores" => "(GMT-01:00) Azores", + "Europe/Belfast" => "(GMT) Greenwich Mean Time : Belfast", + "Europe/Dublin" => "(GMT) Greenwich Mean Time : Dublin", + "Europe/Lisbon" => "(GMT) Greenwich Mean Time : Lisbon", + "Europe/London" => "(GMT) Greenwich Mean Time : London", + "Africa/Abidjan" => "(GMT) Monrovia, Reykjavik", + "Europe/Amsterdam" => "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna", + "Europe/Belgrade" => "(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague", + "Europe/Brussels" => "(GMT+01:00) Brussels, Copenhagen, Madrid, Paris", + "Africa/Algiers" => "(GMT+01:00) West Central Africa", + "Africa/Windhoek" => "(GMT+01:00) Windhoek", + "Asia/Beirut" => "(GMT+02:00) Beirut", + "Africa/Cairo" => "(GMT+02:00) Cairo", + "Asia/Gaza" => "(GMT+02:00) Gaza", + "Africa/Blantyre" => "(GMT+02:00) Harare, Pretoria", + "Asia/Jerusalem" => "(GMT+02:00) Jerusalem", + "Europe/Minsk" => "(GMT+02:00) Minsk", + "Asia/Damascus" => "(GMT+02:00) Syria", + "Europe/Moscow" => "(GMT+03:00) Moscow, St. Petersburg, Volgograd", + "Africa/Addis_Ababa" => "(GMT+03:00) Nairobi", + "Asia/Tehran" => "(GMT+03:30) Tehran", + "Asia/Dubai" => "(GMT+04:00) Abu Dhabi, Muscat", + "Asia/Yerevan" => "(GMT+04:00) Yerevan", + "Asia/Kabul" => "(GMT+04:30) Kabul", + "Asia/Yekaterinburg" => "(GMT+05:00) Ekaterinburg", + "Asia/Tashkent" => "(GMT+05:00) Tashkent", + "Asia/Kolkata" => "(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi", + "Asia/Katmandu" => "(GMT+05:45) Kathmandu", + "Asia/Dhaka" => "(GMT+06:00) Astana, Dhaka", + "Asia/Novosibirsk" => "(GMT+06:00) Novosibirsk", + "Asia/Rangoon" => "(GMT+06:30) Yangon (Rangoon)", + "Asia/Bangkok" => "(GMT+07:00) Bangkok, Hanoi, Jakarta", + "Asia/Krasnoyarsk" => "(GMT+07:00) Krasnoyarsk", + "Asia/Hong_Kong" => "(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi", + "Asia/Irkutsk" => "(GMT+08:00) Irkutsk, Ulaan Bataar", + "Australia/Perth" => "(GMT+08:00) Perth", + "Australia/Eucla" => "(GMT+08:45) Eucla", + "Asia/Tokyo" => "(GMT+09:00) Osaka, Sapporo, Tokyo", + "Asia/Seoul" => "(GMT+09:00) Seoul", + "Asia/Yakutsk" => "(GMT+09:00) Yakutsk", + "Australia/Adelaide" => "(GMT+09:30) Adelaide", + "Australia/Darwin" => "(GMT+09:30) Darwin", + "Australia/Brisbane" => "(GMT+10:00) Brisbane", + "Australia/Hobart" => "(GMT+10:00) Hobart", + "Asia/Vladivostok" => "(GMT+10:00) Vladivostok", + "Australia/Lord_Howe" => "(GMT+10:30) Lord Howe Island", + "Etc/GMT-11" => "(GMT+11:00) Solomon Is., New Caledonia", + "Asia/Magadan" => "(GMT+11:00) Magadan", + "Pacific/Norfolk" => "(GMT+11:30) Norfolk Island", + "Asia/Anadyr" => "(GMT+12:00) Anadyr, Kamchatka", + "Pacific/Auckland" => "(GMT+12:00) Auckland, Wellington", + "Etc/GMT-12" => "(GMT+12:00) Fiji, Kamchatka, Marshall Is.", + "Pacific/Chatham" => "(GMT+12:45) Chatham Islands", + "Pacific/Tongatapu" => "(GMT+13:00) Nuku'alofa", + "Pacific/Kiritimati" => "(GMT+14:00) Kiritimati", + ); + ?> + + + + +
+
diff --git a/components/settings/init.js b/components/settings/init.js index 35df042..cd28450 100755 --- a/components/settings/init.js +++ b/components/settings/init.js @@ -176,7 +176,6 @@ }, success: function( data ) { - console.log( `Update Option ( ${option} ): ` + data ); _self.settings = null; }, error: function(jqXHR, textStatus, errorThrown) { diff --git a/components/user/class.user.php b/components/user/class.user.php index 2b2f93e..e98b544 100755 --- a/components/user/class.user.php +++ b/components/user/class.user.php @@ -347,7 +347,7 @@ class User { public static function CleanUsername( $username ) { - return strtolower( preg_replace( '#[^A-Za-z0-9' . preg_quote( '-_@. ').']#', '', $username ) ); + return strtolower( preg_replace( '/[^\w\-\._@]/', '-', $username ) ); } ////////////////////////////////////////////////////////////////// diff --git a/themes/default/screen.css b/themes/default/screen.css index 9032855..ee6e2c4 100755 --- a/themes/default/screen.css +++ b/themes/default/screen.css @@ -134,7 +134,7 @@ a:hover,a:active {; float: right; position: relative; - top: -30px; + margin: -30px 8px 0 0; } /* FORMS */