Modified in input icon class, Removed debug code, Modified regex expressions,

This commit is contained in:
xevidos 2019-04-16 12:52:41 -04:00
parent 9b452b33bd
commit 7b95a73088
7 changed files with 410 additions and 371 deletions

View File

@ -1008,8 +1008,6 @@
return; return;
} }
//console.log( codiad.active.position_timer, path, JSON.stringify( position ) );
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: codiad.active.controller + '?action=save_position', url: codiad.active.controller + '?action=save_position',
@ -1020,7 +1018,6 @@
success: function( data ) { success: function( data ) {
codiad.active.position_timer = Date.now(); codiad.active.position_timer = Date.now();
//console.log( "called save position: ", data );
}, },
}); });
}, 500); }, 500);
@ -1039,8 +1036,6 @@
for( let i = codiad.editor.instances.length;i--; ) { 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 ) { if( codiad.editor.instances[i].getSession().path == path ) {
editor = codiad.editor.instances[i]; editor = codiad.editor.instances[i];
@ -1069,8 +1064,6 @@
cursor = this.getPosition(); cursor = this.getPosition();
} }
console.log( "setting position", cursor );
editor.scrollToLine( cursor.row, true, true, function() {}); editor.scrollToLine( cursor.row, true, true, function() {});
editor.moveCursorTo( cursor.row, cursor.column ); editor.moveCursorTo( cursor.row, cursor.column );
}, },

View File

@ -774,7 +774,7 @@ class Filemanager extends Common {
* trying to rename or delete it, allow the actual file name. * 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" ) ) { if( $invalid_characters && ! ( $_GET['action'] == "modify" || $_GET['action'] == "delete" ) ) {

View File

@ -88,7 +88,7 @@ class Install {
function clean_username( $username ) { function clean_username( $username ) {
return strtolower( preg_replace( '#[^A-Za-z0-9' . preg_quote( '-_@. ').']#', '', $username ) ); return strtolower( preg_replace( '/[^\w\-\._@]/', '-', $username ) );
} }
function create_config() { function create_config() {
@ -162,7 +162,7 @@ define("WSURL", BASE_URL . "/workspace");
if ( ! $this->is_abs_path( $project_path ) ) { 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 ) ) { if( ! is_dir( $this->workspace . "/" . $project_path ) ) {
mkdir( $this->workspace . "/" . $project_path ); mkdir( $this->workspace . "/" . $project_path );

View File

@ -1,4 +1,3 @@
<div id="installer">
<?php <?php
/* /*
@ -10,402 +9,450 @@
require_once( __DIR__ . "/install.php" ); require_once( __DIR__ . "/install.php" );
$path = rtrim( str_replace("index.php", "", $_SERVER['SCRIPT_FILENAME']), "/"); $path = rtrim( str_replace("index.php", "", $_SERVER['SCRIPT_FILENAME']), "/");
$workspace = is_writable($path . "/workspace"); $workspace = is_writable($path . "/workspace");
$data = is_writable($path . "/data"); $data = is_writable($path . "/data");
$plugins = is_writable($path . "/plugins"); $plugins = is_writable($path . "/plugins");
$themes = is_writable($path . "/themes"); $themes = is_writable($path . "/themes");
$workspace = is_writable($path . "/workspace"); $workspace = is_writable($path . "/workspace");
$conf = $path . '/config.php'; $conf = $path . '/config.php';
$config = is_writable(file_exists($conf) ? $conf : $path); $config = is_writable(file_exists($conf) ? $conf : $path);
$date = new DateTime(); $date = new DateTime();
$timeZone = $date->getTimezone()->getName(); $timeZone = $date->getTimezone()->getName();
if (ini_get('register_globals') == 1) { if ( ini_get('register_globals') == 1) {
$register = true;
$register = true;
} else { } else {
$register = false;
$register = false;
} }
if (ini_get('newrelic.enabled') == 1) { if ( ini_get('newrelic.enabled') == 1 ) {
$newrelic = true;
$newrelic = true;
} else { } else {
$newrelic = false;
$newrelic = false;
} }
$query = $_SERVER['QUERY_STRING']; $query = $_SERVER['QUERY_STRING'];
$autocomplete = array( $autocomplete = array(
'username' => '', 'username' => '',
'password' => '', 'password' => '',
'password_confirm' => '', 'password_confirm' => '',
'project_name' => '', 'project_name' => '',
'project_path' => '', 'project_path' => '',
'timezone' => $timeZone, 'timezone' => $timeZone,
'site_name' => '', 'site_name' => '',
'dbhost' => '', 'dbhost' => '',
'dbname' => '', 'dbname' => '',
'dbuser' => '', 'dbuser' => '',
'dbpass' => '', 'dbpass' => '',
'dbtype' => 'mysql', 'dbtype' => 'mysql',
); );
if (!empty($query)) { if ( ! empty( $query ) ) {
$params = explode('&', $query);
foreach ($params as $param) { $params = explode('&', $query);
$param = explode('=', $param); foreach( $params as $param ) {
if (array_key_exists($param[0], $autocomplete)) {
$autocomplete[$param[0]] = urldecode($param[1]); $param = explode( '=', $param );
} if( array_key_exists( $param[0], $autocomplete ) ) {
}
$autocomplete[$param[0]] = urldecode($param[1]);
}
}
} }
if (!$workspace || !$data || !$config || $register || $newrelic) { ?>
?> <div id="installer">
<h1><?php i18n("Installation Error"); ?></h1> <?php
<p><?php i18n("Please make sure the following exist and are writeable:"); ?></p> if ( ! $workspace || ! $data || ! $config || $register || $newrelic ) {
<div class="install_issues">
<p>[SYSTEM]/config.php - <?php if ($config) {
echo '<font style="color:green">PASSED</font>';
} else {
echo '<font style="color:red">ERROR</font>';
} ?></p>
<p>[SYSTEM]/workspace - <?php if ($workspace) {
echo '<font style="color:green">PASSED</font>';
} else {
echo '<font style="color:red">ERROR</font>';
} ?></p>
<p>[SYSTEM]/plugins - <?php if ($plugins) {
echo '<font style="color:green">PASSED</font>';
} else {
echo '<font style="color:red">ERROR</font>';
} ?></p>
<p>[SYSTEM]/themes - <?php if ($themes) {
echo '<font style="color:green">PASSED</font>';
} else {
echo '<font style="color:red">ERROR</font>';
} ?></p>
<p>[SYSTEM]/data - <?php if ($data) {
echo '<font style="color:green">PASSED</font>';
} else {
echo '<font style="color:red">ERROR</font>';
} ?></p>
</div>
<?php if ($register || $newrelic) { ?>
<p><?php i18n("Please make sure these environmental variables are set:"); ?></p>
<div class="install_issues">
<?php if ($register) {
echo '<p>register_globals: Off</p>';
}
if ($newrelic) {
echo '<p>newrelic.enabled: Off</p>';
} ?>
</div>
<?php } ?>
<button onclick="window.location.reload();">Re-Test</button>
<?php ?>
} else { <h1><?php i18n("Installation Error");?></h1>
?> <p><?php i18n("Please make sure the following exist and are writeable:");?></p>
<form id="install"> <div class="install_issues">
<h1><?php i18n("Initial Setup"); ?></h1> <p>
[SYSTEM]/config.php -
<?php
if( $config ) {
<label><?php i18n("Dependencies"); ?></label> echo '<font style="color:green">PASSED</font>';
<div id="dependencies"> } else {
<?php foreach ([
"ZIP"=>"required",
"OpenSSL"=>"required",
"MBString"=>"required",
"MySQL"=>"",
"PGSQL"=>"",
"SQLite3"=>""
] as $dep=>$status) {
if (extension_loaded(strtolower($dep))) { ?>
<div class="success"><span class="icon-check"></span> <?=$dep?></div>
<?php
} else {
$class_name = ($status == 'required') ? 'error' : 'warning';
?>
<div class="<?php echo $class_name; ?>"><span class="icon-cancel"></span> <?=$dep?></div>
<?php
}
} ?>
</div>
<input type="hidden" name="path" value="<?php echo($path); ?>"> echo '<font style="color:red">ERROR</font>';
}
?>
</p>
<p>
[SYSTEM]/workspace -
<?php
if ( $workspace ) {
<label><?php i18n("New Username"); ?></label> echo '<font style="color:green">PASSED</font>';
<input type="text" name="username" autofocus="autofocus" value="<?php echo($autocomplete['username']); ?>"> } else {
<div style="float:left; width: 48%; margin-right: 4%;"> echo '<font style="color:red">ERROR</font>';
}
?>
</p>
<p>
[SYSTEM]/plugins -
<?php
if( $plugins ) {
<label> echo '<font style="color:green">PASSED</font>';
<?php i18n("Password"); ?> } else {
<input type="password" name="password" value="<?php echo($autocomplete['password']); ?>">
<span class="icon-eye in-field-icon-right hide_field">
</label>
</div> echo '<font style="color:red">ERROR</font>';
}
?>
</p>
<p>
[SYSTEM]/themes -
<?php
if( $themes ) {
<div style="float:left; width: 48%;"> echo '<font style="color:green">PASSED</font>';
} else {
<label> echo '<font style="color:red">ERROR</font>';
<?php i18n("Confirm Password"); ?> }
<input type="password" name="password_confirm" value="<?php echo($autocomplete['password_confirm']); ?>"> ?>
<span class="icon-eye in-field-icon-right hide_field"> </p>
</label> <p>
[SYSTEM]/data -
<?php
if( $data ) {
</div> echo '<font style="color:green">PASSED</font>';
} else {
<div style="float:left; width: 48%; margin-right: 4%;"> echo '<font style="color:red">ERROR</font>';
}
?>
</p>
</div>
<?php
if( $register || $newrelic ) {
<label><?php i18n("Site Name"); ?></label> ?>
<input type="text" name="site_name" value="<?php echo($autocomplete['site_name']); ?>"> <p><?php i18n("Please make sure these environmental variables are set:");?></p>
<div class="install_issues">
<?php
if( $register ) {
</div> echo '<p>register_globals: Off</p>';
}
if( $newrelic ) {
echo '<p>newrelic.enabled: Off</p>';
}
?>
</div>
<?php
}
?>
<button onclick="window.location.reload();">Re-Test</button>
<?php
} else {
<div style="clear:both;"></div> ?>
<form id="install">
<h1><?php i18n("Initial Setup"); ?></h1>
<label><?php i18n("Dependencies"); ?></label>
<div id="dependencies">
<?php foreach ([
"ZIP"=>"required",
"OpenSSL"=>"required",
"MBString"=>"required",
"MySQL"=>"",
"PGSQL"=>"",
"SQLite3"=>""
] as $dep=>$status) {
if (extension_loaded(strtolower($dep))) { ?>
<div class="success"><span class="icon-check"></span> <?=$dep?></div>
<?php
} else {
$class_name = ($status == 'required') ? 'error' : 'warning';
?>
<div class="<?php echo $class_name; ?>"><span class="icon-cancel"></span> <?=$dep?></div>
<?php
}
} ?>
</div>
<hr> <input type="hidden" name="path" value="<?php echo($path); ?>">
<label><?php i18n("New Project Name"); ?></label> <label><?php i18n("New Username"); ?></label>
<input type="text" name="project_name" value="<?php echo($autocomplete['project_name']); ?>"> <input type="text" name="username" autofocus="autofocus" value="<?php echo($autocomplete['username']); ?>">
<label><?php i18n("Folder Name or Absolute Path"); ?></label>
<input type="text" name="project_path" value="<?php echo($autocomplete['project_path']); ?>">
<label><?php i18n("Database Host"); ?></label> <div style="float:left; width: 48%; margin-right: 4%;">
<input type="text" name="dbhost" value="<?php echo($autocomplete['dbhost']); ?>">
<label><?php i18n("Database Name"); ?></label>
<input type="text" name="dbname" value="<?php echo($autocomplete['dbname']); ?>">
<label><?php i18n("Database User"); ?></label>
<input type="text" name="dbuser" value="<?php echo($autocomplete['dbuser']); ?>">
<label>
<?php i18n("Database Pass"); ?>
<input type="password" name="dbpass" value="<?php echo($autocomplete['dbpass']); ?>">
<span class="icon-eye in-field-icon-right hide_field">
</label>
<label><?php i18n("Database Type"); ?></label>
<select name="dbtype">
<?php
$select_dbtypes = "";
foreach (sql::DB_TYPES as $db_name => $key) {
if ($autocomplete['dbtype'] == $key) {
$select_dbtypes .= '<option selected="selected" value="' . $key . '">' . $db_name . '</option>';
} else {
$select_dbtypes .= '<option value="' . $key . '">' . $db_name . '</option>';
}
}
echo($select_dbtypes);
unset($select_dbtypes);
?>
</select>
<hr>
<?php
$location = array(
"Pacific/Midway" => "(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",
);
?>
<label><?php i18n("Timezone"); ?></label> <label>
<select name="timezone"> <?php i18n("Password"); ?>
<?php <input type="password" name="password" value="<?php echo($autocomplete['password']); ?>">
$timezones = ""; <span class="icon-eye in-field-icon-right hide_field">
foreach ($location as $key => $city) { </label>
if ($autocomplete['timezone'] == $key) {
$timezones .= '<option value="' . $key . '" selected="selected">' . $city . '</option>'; </div>
} else {
$timezones .= '<option value="' . $key . '">' . $city . '</option>'; <div style="float:left; width: 48%;">
}
} <label>
echo($timezones); <?php i18n("Confirm Password"); ?>
unset($timezones); <input type="password" name="password_confirm" value="<?php echo($autocomplete['password_confirm']); ?>">
?> <span class="icon-eye in-field-icon-right hide_field">
</select> </label>
<button><?php i18n("Install"); ?></button>
</form> </div>
<?php
<div style="float:left; width: 48%; margin-right: 4%;">
<label><?php i18n("Site Name"); ?></label>
<input type="text" name="site_name" value="<?php echo($autocomplete['site_name']); ?>">
</div>
<div style="clear:both;"></div>
<hr>
<label><?php i18n("New Project Name"); ?></label>
<input type="text" name="project_name" value="<?php echo($autocomplete['project_name']); ?>">
<label><?php i18n("Folder Name or Absolute Path"); ?></label>
<input type="text" name="project_path" value="<?php echo($autocomplete['project_path']); ?>">
<label><?php i18n("Database Host"); ?></label>
<input type="text" name="dbhost" value="<?php echo($autocomplete['dbhost']); ?>">
<label><?php i18n("Database Name"); ?></label>
<input type="text" name="dbname" value="<?php echo($autocomplete['dbname']); ?>">
<label><?php i18n("Database User"); ?></label>
<input type="text" name="dbuser" value="<?php echo($autocomplete['dbuser']); ?>">
<label>
<?php i18n("Database Pass"); ?>
<input type="password" name="dbpass" value="<?php echo($autocomplete['dbpass']); ?>">
<span class="icon-eye in-field-icon-right hide_field">
</label>
<label><?php i18n("Database Type"); ?></label>
<select name="dbtype">
<?php
$select_dbtypes = "";
foreach (sql::DB_TYPES as $db_name => $key) {
if ($autocomplete['dbtype'] == $key) {
$select_dbtypes .= '<option selected="selected" value="' . $key . '">' . $db_name . '</option>';
} else {
$select_dbtypes .= '<option value="' . $key . '">' . $db_name . '</option>';
}
}
echo($select_dbtypes);
unset($select_dbtypes);
?>
</select>
<hr>
<?php
$location = array(
"Pacific/Midway" => "(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",
);
?>
<label><?php i18n("Timezone"); ?></label>
<select name="timezone">
<?php
$timezones = "";
foreach ($location as $key => $city) {
if ($autocomplete['timezone'] == $key) {
$timezones .= '<option value="' . $key . '" selected="selected">' . $city . '</option>';
} else {
$timezones .= '<option value="' . $key . '">' . $city . '</option>';
}
}
echo($timezones);
unset($timezones);
?>
</select>
<button><?php i18n("Install"); ?></button>
</form>
<?php
} }
?> ?>
</div> </div>
<script> <script>
$(function(){ $(function(){
$('html, body').css('overflow', 'auto'); $('html, body').css('overflow', 'auto');
// Automatically select first timezone with the appropriate GMT offset // Automatically select first timezone with the appropriate GMT offset
function getTimeZoneString() { function getTimeZoneString() {
var num = new Date().getTimezoneOffset(); var num = new Date().getTimezoneOffset();
if (num === 0) { if (num === 0) {
return "GMT"; return "GMT";
} else { } else {
var hours = Math.floor(num / 60); var hours = Math.floor(num / 60);
var minutes = Math.floor((num - (hours * 60))); var minutes = Math.floor((num - (hours * 60)));
if (hours < 10) hours = "0" + Math.abs(hours); if (hours < 10) hours = "0" + Math.abs(hours);
if (minutes < 10) minutes = "0" + Math.abs(minutes); if (minutes < 10) minutes = "0" + Math.abs(minutes);
return "GMT" + (num < 0 ? "+" : "-") + hours + ":" + minutes; return "GMT" + (num < 0 ? "+" : "-") + hours + ":" + minutes;
} }
} }
var timezone = getTimeZoneString(); var timezone = getTimeZoneString();
$("[name=timezone] option").each(function() { $("[name=timezone] option").each(function() {
if($(this).text().indexOf(timezone) > -1) $("[name=timezone]").val($(this).val()); if($(this).text().indexOf(timezone) > -1) $("[name=timezone]").val($(this).val());
}) })
$(".hide_field").click( function( e ) { $(".hide_field").click( function( e ) {
let input = e.target.parentElement.querySelector( 'input' ); let input = e.target.parentElement.querySelector( 'input' );
if( input.type == "password" ) { if( input.type == "password" ) {
input.type = "text"; input.type = "text";
} else { } else {
input.type = "password"; input.type = "password";
} }
}); });
$('#install').on('submit',function(e){ $('#install').on('submit',function(e){
e.preventDefault(); e.preventDefault();
// Check empty fields // Check empty fields
empty_fields = false; empty_fields = false;
$('input').each(function(){ $('input').each(function(){
if($(this).val()=='' && $(this).attr('name')!='path'){ empty_fields = true; } if($(this).val()=='' && $(this).attr('name')!='path'){ empty_fields = true; }
}); });
if(empty_fields){ alert('All fields must be filled out'); } if(empty_fields){ alert('All fields must be filled out'); }
// Check password // Check password
password_match = true; password_match = true;
if($('input[name="password"]').val()!=$('input[name="password_confirm"]').val()){ if($('input[name="password"]').val()!=$('input[name="password_confirm"]').val()){
password_match = false; password_match = false;
} }
// Check Path // Check Path
check_path = true; check_path = true;
projectPath = ''; projectPath = '';
if($('input[name="project_path"]').length) { if($('input[name="project_path"]').length) {
projectPath = $('input[name="project_path"]').val(); projectPath = $('input[name="project_path"]').val();
} }
if ( projectPath.indexOf("/") == 0 ) { if ( projectPath.indexOf("/") == 0 ) {
check_path = confirm('Do you really want to create project with absolute path "' + projectPath + '"?'); check_path = confirm('Do you really want to create project with absolute path "' + projectPath + '"?');
} }
if(!password_match){ alert('The passwords entered do not match'); } if(!password_match){ alert('The passwords entered do not match'); }
if(!empty_fields && password_match && check_path){ if(!empty_fields && password_match && check_path){
$.post('components/install/install.php',$('#install').serialize(),function( data ) { $.post('components/install/install.php',$('#install').serialize(),function( data ) {
if( data == 'success' ){ if( data == 'success' ){
window.location.reload(); window.location.reload();
} else { } else {
data = JSON.parse( data ); data = JSON.parse( data );
console.log( data.error ); console.log( data.error );
alert( "An Error Occurred\n" + data.message ); alert( "An Error Occurred\n" + data.message );
} }
}); });
} }
}); });
}); });
</script> </script>

View File

@ -176,7 +176,6 @@
}, },
success: function( data ) { success: function( data ) {
console.log( `Update Option ( ${option} ): ` + data );
_self.settings = null; _self.settings = null;
}, },
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {

View File

@ -347,7 +347,7 @@ class User {
public static function CleanUsername( $username ) { public static function CleanUsername( $username ) {
return strtolower( preg_replace( '#[^A-Za-z0-9' . preg_quote( '-_@. ').']#', '', $username ) ); return strtolower( preg_replace( '/[^\w\-\._@]/', '-', $username ) );
} }
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////

View File

@ -134,7 +134,7 @@ a:hover,a:active {;
float: right; float: right;
position: relative; position: relative;
top: -30px; margin: -30px 8px 0 0;
} }
/* FORMS */ /* FORMS */