mirror of
https://github.com/xevidos/codiad.git
synced 2024-11-10 21:26:35 +01:00
Modified in input icon class, Removed debug code, Modified regex expressions,
This commit is contained in:
parent
9b452b33bd
commit
7b95a73088
@ -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 );
|
||||||
},
|
},
|
||||||
|
@ -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" ) ) {
|
||||||
|
|
||||||
|
@ -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 );
|
||||||
|
@ -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>';
|
<h1><?php i18n("Installation Error");?></h1>
|
||||||
} else {
|
<p><?php i18n("Please make sure the following exist and are writeable:");?></p>
|
||||||
echo '<font style="color:red">ERROR</font>';
|
<div class="install_issues">
|
||||||
} ?></p>
|
<p>
|
||||||
<p>[SYSTEM]/workspace - <?php if ($workspace) {
|
[SYSTEM]/config.php -
|
||||||
echo '<font style="color:green">PASSED</font>';
|
<?php
|
||||||
} else {
|
if( $config ) {
|
||||||
echo '<font style="color:red">ERROR</font>';
|
|
||||||
} ?></p>
|
echo '<font style="color:green">PASSED</font>';
|
||||||
<p>[SYSTEM]/plugins - <?php if ($plugins) {
|
} else {
|
||||||
echo '<font style="color:green">PASSED</font>';
|
|
||||||
} else {
|
echo '<font style="color:red">ERROR</font>';
|
||||||
echo '<font style="color:red">ERROR</font>';
|
}
|
||||||
} ?></p>
|
?>
|
||||||
<p>[SYSTEM]/themes - <?php if ($themes) {
|
</p>
|
||||||
echo '<font style="color:green">PASSED</font>';
|
<p>
|
||||||
} else {
|
[SYSTEM]/workspace -
|
||||||
echo '<font style="color:red">ERROR</font>';
|
<?php
|
||||||
} ?></p>
|
if ( $workspace ) {
|
||||||
<p>[SYSTEM]/data - <?php if ($data) {
|
|
||||||
echo '<font style="color:green">PASSED</font>';
|
echo '<font style="color:green">PASSED</font>';
|
||||||
} else {
|
} else {
|
||||||
echo '<font style="color:red">ERROR</font>';
|
|
||||||
} ?></p>
|
echo '<font style="color:red">ERROR</font>';
|
||||||
</div>
|
}
|
||||||
<?php if ($register || $newrelic) { ?>
|
?>
|
||||||
<p><?php i18n("Please make sure these environmental variables are set:"); ?></p>
|
</p>
|
||||||
<div class="install_issues">
|
<p>
|
||||||
<?php if ($register) {
|
[SYSTEM]/plugins -
|
||||||
echo '<p>register_globals: Off</p>';
|
<?php
|
||||||
}
|
if( $plugins ) {
|
||||||
if ($newrelic) {
|
|
||||||
echo '<p>newrelic.enabled: Off</p>';
|
echo '<font style="color:green">PASSED</font>';
|
||||||
} ?>
|
} else {
|
||||||
</div>
|
|
||||||
<?php } ?>
|
echo '<font style="color:red">ERROR</font>';
|
||||||
<button onclick="window.location.reload();">Re-Test</button>
|
}
|
||||||
|
?>
|
||||||
<?php
|
</p>
|
||||||
} else {
|
<p>
|
||||||
?>
|
[SYSTEM]/themes -
|
||||||
<form id="install">
|
<?php
|
||||||
<h1><?php i18n("Initial Setup"); ?></h1>
|
if( $themes ) {
|
||||||
|
|
||||||
<label><?php i18n("Dependencies"); ?></label>
|
echo '<font style="color:green">PASSED</font>';
|
||||||
<div id="dependencies">
|
} else {
|
||||||
<?php foreach ([
|
|
||||||
"ZIP"=>"required",
|
echo '<font style="color:red">ERROR</font>';
|
||||||
"OpenSSL"=>"required",
|
}
|
||||||
"MBString"=>"required",
|
?>
|
||||||
"MySQL"=>"",
|
</p>
|
||||||
"PGSQL"=>"",
|
<p>
|
||||||
"SQLite3"=>""
|
[SYSTEM]/data -
|
||||||
] as $dep=>$status) {
|
<?php
|
||||||
if (extension_loaded(strtolower($dep))) { ?>
|
if( $data ) {
|
||||||
<div class="success"><span class="icon-check"></span> <?=$dep?></div>
|
|
||||||
<?php
|
echo '<font style="color:green">PASSED</font>';
|
||||||
} else {
|
} else {
|
||||||
$class_name = ($status == 'required') ? 'error' : 'warning';
|
|
||||||
?>
|
echo '<font style="color:red">ERROR</font>';
|
||||||
<div class="<?php echo $class_name; ?>"><span class="icon-cancel"></span> <?=$dep?></div>
|
}
|
||||||
<?php
|
?>
|
||||||
}
|
</p>
|
||||||
} ?>
|
</div>
|
||||||
</div>
|
<?php
|
||||||
|
if( $register || $newrelic ) {
|
||||||
<input type="hidden" name="path" value="<?php echo($path); ?>">
|
|
||||||
|
?>
|
||||||
<label><?php i18n("New Username"); ?></label>
|
<p><?php i18n("Please make sure these environmental variables are set:");?></p>
|
||||||
<input type="text" name="username" autofocus="autofocus" value="<?php echo($autocomplete['username']); ?>">
|
<div class="install_issues">
|
||||||
|
<?php
|
||||||
<div style="float:left; width: 48%; margin-right: 4%;">
|
if( $register ) {
|
||||||
|
|
||||||
<label>
|
echo '<p>register_globals: Off</p>';
|
||||||
<?php i18n("Password"); ?>
|
}
|
||||||
<input type="password" name="password" value="<?php echo($autocomplete['password']); ?>">
|
if( $newrelic ) {
|
||||||
<span class="icon-eye in-field-icon-right hide_field">
|
echo '<p>newrelic.enabled: Off</p>';
|
||||||
</label>
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php
|
||||||
<div style="float:left; width: 48%;">
|
}
|
||||||
|
?>
|
||||||
<label>
|
<button onclick="window.location.reload();">Re-Test</button>
|
||||||
<?php i18n("Confirm Password"); ?>
|
<?php
|
||||||
<input type="password" name="password_confirm" value="<?php echo($autocomplete['password_confirm']); ?>">
|
} else {
|
||||||
<span class="icon-eye in-field-icon-right hide_field">
|
|
||||||
</label>
|
?>
|
||||||
|
<form id="install">
|
||||||
</div>
|
<h1><?php i18n("Initial Setup"); ?></h1>
|
||||||
|
<label><?php i18n("Dependencies"); ?></label>
|
||||||
<div style="float:left; width: 48%; margin-right: 4%;">
|
<div id="dependencies">
|
||||||
|
<?php foreach ([
|
||||||
<label><?php i18n("Site Name"); ?></label>
|
"ZIP"=>"required",
|
||||||
<input type="text" name="site_name" value="<?php echo($autocomplete['site_name']); ?>">
|
"OpenSSL"=>"required",
|
||||||
|
"MBString"=>"required",
|
||||||
</div>
|
"MySQL"=>"",
|
||||||
|
"PGSQL"=>"",
|
||||||
<div style="clear:both;"></div>
|
"SQLite3"=>""
|
||||||
|
] as $dep=>$status) {
|
||||||
<hr>
|
if (extension_loaded(strtolower($dep))) { ?>
|
||||||
|
<div class="success"><span class="icon-check"></span> <?=$dep?></div>
|
||||||
<label><?php i18n("New Project Name"); ?></label>
|
<?php
|
||||||
<input type="text" name="project_name" value="<?php echo($autocomplete['project_name']); ?>">
|
} else {
|
||||||
<label><?php i18n("Folder Name or Absolute Path"); ?></label>
|
$class_name = ($status == 'required') ? 'error' : 'warning';
|
||||||
<input type="text" name="project_path" value="<?php echo($autocomplete['project_path']); ?>">
|
?>
|
||||||
|
<div class="<?php echo $class_name; ?>"><span class="icon-cancel"></span> <?=$dep?></div>
|
||||||
<label><?php i18n("Database Host"); ?></label>
|
<?php
|
||||||
<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']); ?>">
|
</div>
|
||||||
<label><?php i18n("Database User"); ?></label>
|
|
||||||
<input type="text" name="dbuser" value="<?php echo($autocomplete['dbuser']); ?>">
|
<input type="hidden" name="path" value="<?php echo($path); ?>">
|
||||||
<label>
|
|
||||||
<?php i18n("Database Pass"); ?>
|
<label><?php i18n("New Username"); ?></label>
|
||||||
<input type="password" name="dbpass" value="<?php echo($autocomplete['dbpass']); ?>">
|
<input type="text" name="username" autofocus="autofocus" value="<?php echo($autocomplete['username']); ?>">
|
||||||
<span class="icon-eye in-field-icon-right hide_field">
|
|
||||||
</label>
|
<div style="float:left; width: 48%; margin-right: 4%;">
|
||||||
<label><?php i18n("Database Type"); ?></label>
|
|
||||||
<select name="dbtype">
|
<label>
|
||||||
<?php
|
<?php i18n("Password"); ?>
|
||||||
$select_dbtypes = "";
|
<input type="password" name="password" value="<?php echo($autocomplete['password']); ?>">
|
||||||
foreach (sql::DB_TYPES as $db_name => $key) {
|
<span class="icon-eye in-field-icon-right hide_field">
|
||||||
if ($autocomplete['dbtype'] == $key) {
|
</label>
|
||||||
$select_dbtypes .= '<option selected="selected" value="' . $key . '">' . $db_name . '</option>';
|
|
||||||
} else {
|
</div>
|
||||||
$select_dbtypes .= '<option value="' . $key . '">' . $db_name . '</option>';
|
|
||||||
}
|
<div style="float:left; width: 48%;">
|
||||||
}
|
|
||||||
echo($select_dbtypes);
|
<label>
|
||||||
unset($select_dbtypes);
|
<?php i18n("Confirm Password"); ?>
|
||||||
?>
|
<input type="password" name="password_confirm" value="<?php echo($autocomplete['password_confirm']); ?>">
|
||||||
</select>
|
<span class="icon-eye in-field-icon-right hide_field">
|
||||||
<hr>
|
</label>
|
||||||
<?php
|
|
||||||
$location = array(
|
</div>
|
||||||
"Pacific/Midway" => "(GMT-11:00) Midway Island, Samoa",
|
|
||||||
"America/Adak" => "(GMT-10:00) Hawaii-Aleutian",
|
<div style="float:left; width: 48%; margin-right: 4%;">
|
||||||
"Etc/GMT+10" => "(GMT-10:00) Hawaii",
|
|
||||||
"Pacific/Marquesas" => "(GMT-09:30) Marquesas Islands",
|
<label><?php i18n("Site Name"); ?></label>
|
||||||
"Pacific/Gambier" => "(GMT-09:00) Gambier Islands",
|
<input type="text" name="site_name" value="<?php echo($autocomplete['site_name']); ?>">
|
||||||
"America/Anchorage" => "(GMT-09:00) Alaska",
|
|
||||||
"America/Ensenada" => "(GMT-08:00) Tijuana, Baja California",
|
</div>
|
||||||
"Etc/GMT+8" => "(GMT-08:00) Pitcairn Islands",
|
|
||||||
"America/Los_Angeles" => "(GMT-08:00) Pacific Time (US & Canada)",
|
<div style="clear:both;"></div>
|
||||||
"America/Denver" => "(GMT-07:00) Mountain Time (US & Canada)",
|
|
||||||
"America/Chihuahua" => "(GMT-07:00) Chihuahua, La Paz, Mazatlan",
|
<hr>
|
||||||
"America/Dawson_Creek" => "(GMT-07:00) Arizona",
|
|
||||||
"America/Belize" => "(GMT-06:00) Saskatchewan, Central America",
|
<label><?php i18n("New Project Name"); ?></label>
|
||||||
"America/Cancun" => "(GMT-06:00) Guadalajara, Mexico City, Monterrey",
|
<input type="text" name="project_name" value="<?php echo($autocomplete['project_name']); ?>">
|
||||||
"Chile/EasterIsland" => "(GMT-06:00) Easter Island",
|
<label><?php i18n("Folder Name or Absolute Path"); ?></label>
|
||||||
"America/Chicago" => "(GMT-06:00) Central Time (US & Canada)",
|
<input type="text" name="project_path" value="<?php echo($autocomplete['project_path']); ?>">
|
||||||
"America/New_York" => "(GMT-05:00) Eastern Time (US & Canada)",
|
|
||||||
"America/Havana" => "(GMT-05:00) Cuba",
|
<label><?php i18n("Database Host"); ?></label>
|
||||||
"America/Bogota" => "(GMT-05:00) Bogota, Lima, Quito, Rio Branco",
|
<input type="text" name="dbhost" value="<?php echo($autocomplete['dbhost']); ?>">
|
||||||
"America/Caracas" => "(GMT-04:30) Caracas",
|
<label><?php i18n("Database Name"); ?></label>
|
||||||
"America/Santiago" => "(GMT-04:00) Santiago",
|
<input type="text" name="dbname" value="<?php echo($autocomplete['dbname']); ?>">
|
||||||
"America/La_Paz" => "(GMT-04:00) La Paz",
|
<label><?php i18n("Database User"); ?></label>
|
||||||
"Atlantic/Stanley" => "(GMT-04:00) Faukland Islands",
|
<input type="text" name="dbuser" value="<?php echo($autocomplete['dbuser']); ?>">
|
||||||
"America/Campo_Grande" => "(GMT-04:00) Brazil",
|
<label>
|
||||||
"America/Goose_Bay" => "(GMT-04:00) Atlantic Time (Goose Bay)",
|
<?php i18n("Database Pass"); ?>
|
||||||
"America/Glace_Bay" => "(GMT-04:00) Atlantic Time (Canada)",
|
<input type="password" name="dbpass" value="<?php echo($autocomplete['dbpass']); ?>">
|
||||||
"America/St_Johns" => "(GMT-03:30) Newfoundland",
|
<span class="icon-eye in-field-icon-right hide_field">
|
||||||
"America/Araguaina" => "(GMT-03:00) UTC-3",
|
</label>
|
||||||
"America/Montevideo" => "(GMT-03:00) Montevideo",
|
<label><?php i18n("Database Type"); ?></label>
|
||||||
"America/Miquelon" => "(GMT-03:00) Miquelon, St. Pierre",
|
<select name="dbtype">
|
||||||
"America/Godthab" => "(GMT-03:00) Greenland",
|
<?php
|
||||||
"America/Argentina/Buenos_Aires" => "(GMT-03:00) Buenos Aires",
|
$select_dbtypes = "";
|
||||||
"America/Sao_Paulo" => "(GMT-03:00) Brasilia",
|
foreach (sql::DB_TYPES as $db_name => $key) {
|
||||||
"America/Noronha" => "(GMT-02:00) Mid-Atlantic",
|
if ($autocomplete['dbtype'] == $key) {
|
||||||
"Atlantic/Cape_Verde" => "(GMT-01:00) Cape Verde Is.",
|
$select_dbtypes .= '<option selected="selected" value="' . $key . '">' . $db_name . '</option>';
|
||||||
"Atlantic/Azores" => "(GMT-01:00) Azores",
|
} else {
|
||||||
"Europe/Belfast" => "(GMT) Greenwich Mean Time : Belfast",
|
$select_dbtypes .= '<option value="' . $key . '">' . $db_name . '</option>';
|
||||||
"Europe/Dublin" => "(GMT) Greenwich Mean Time : Dublin",
|
}
|
||||||
"Europe/Lisbon" => "(GMT) Greenwich Mean Time : Lisbon",
|
}
|
||||||
"Europe/London" => "(GMT) Greenwich Mean Time : London",
|
echo($select_dbtypes);
|
||||||
"Africa/Abidjan" => "(GMT) Monrovia, Reykjavik",
|
unset($select_dbtypes);
|
||||||
"Europe/Amsterdam" => "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",
|
?>
|
||||||
"Europe/Belgrade" => "(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",
|
</select>
|
||||||
"Europe/Brussels" => "(GMT+01:00) Brussels, Copenhagen, Madrid, Paris",
|
<hr>
|
||||||
"Africa/Algiers" => "(GMT+01:00) West Central Africa",
|
<?php
|
||||||
"Africa/Windhoek" => "(GMT+01:00) Windhoek",
|
$location = array(
|
||||||
"Asia/Beirut" => "(GMT+02:00) Beirut",
|
"Pacific/Midway" => "(GMT-11:00) Midway Island, Samoa",
|
||||||
"Africa/Cairo" => "(GMT+02:00) Cairo",
|
"America/Adak" => "(GMT-10:00) Hawaii-Aleutian",
|
||||||
"Asia/Gaza" => "(GMT+02:00) Gaza",
|
"Etc/GMT+10" => "(GMT-10:00) Hawaii",
|
||||||
"Africa/Blantyre" => "(GMT+02:00) Harare, Pretoria",
|
"Pacific/Marquesas" => "(GMT-09:30) Marquesas Islands",
|
||||||
"Asia/Jerusalem" => "(GMT+02:00) Jerusalem",
|
"Pacific/Gambier" => "(GMT-09:00) Gambier Islands",
|
||||||
"Europe/Minsk" => "(GMT+02:00) Minsk",
|
"America/Anchorage" => "(GMT-09:00) Alaska",
|
||||||
"Asia/Damascus" => "(GMT+02:00) Syria",
|
"America/Ensenada" => "(GMT-08:00) Tijuana, Baja California",
|
||||||
"Europe/Moscow" => "(GMT+03:00) Moscow, St. Petersburg, Volgograd",
|
"Etc/GMT+8" => "(GMT-08:00) Pitcairn Islands",
|
||||||
"Africa/Addis_Ababa" => "(GMT+03:00) Nairobi",
|
"America/Los_Angeles" => "(GMT-08:00) Pacific Time (US & Canada)",
|
||||||
"Asia/Tehran" => "(GMT+03:30) Tehran",
|
"America/Denver" => "(GMT-07:00) Mountain Time (US & Canada)",
|
||||||
"Asia/Dubai" => "(GMT+04:00) Abu Dhabi, Muscat",
|
"America/Chihuahua" => "(GMT-07:00) Chihuahua, La Paz, Mazatlan",
|
||||||
"Asia/Yerevan" => "(GMT+04:00) Yerevan",
|
"America/Dawson_Creek" => "(GMT-07:00) Arizona",
|
||||||
"Asia/Kabul" => "(GMT+04:30) Kabul",
|
"America/Belize" => "(GMT-06:00) Saskatchewan, Central America",
|
||||||
"Asia/Yekaterinburg" => "(GMT+05:00) Ekaterinburg",
|
"America/Cancun" => "(GMT-06:00) Guadalajara, Mexico City, Monterrey",
|
||||||
"Asia/Tashkent" => "(GMT+05:00) Tashkent",
|
"Chile/EasterIsland" => "(GMT-06:00) Easter Island",
|
||||||
"Asia/Kolkata" => "(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi",
|
"America/Chicago" => "(GMT-06:00) Central Time (US & Canada)",
|
||||||
"Asia/Katmandu" => "(GMT+05:45) Kathmandu",
|
"America/New_York" => "(GMT-05:00) Eastern Time (US & Canada)",
|
||||||
"Asia/Dhaka" => "(GMT+06:00) Astana, Dhaka",
|
"America/Havana" => "(GMT-05:00) Cuba",
|
||||||
"Asia/Novosibirsk" => "(GMT+06:00) Novosibirsk",
|
"America/Bogota" => "(GMT-05:00) Bogota, Lima, Quito, Rio Branco",
|
||||||
"Asia/Rangoon" => "(GMT+06:30) Yangon (Rangoon)",
|
"America/Caracas" => "(GMT-04:30) Caracas",
|
||||||
"Asia/Bangkok" => "(GMT+07:00) Bangkok, Hanoi, Jakarta",
|
"America/Santiago" => "(GMT-04:00) Santiago",
|
||||||
"Asia/Krasnoyarsk" => "(GMT+07:00) Krasnoyarsk",
|
"America/La_Paz" => "(GMT-04:00) La Paz",
|
||||||
"Asia/Hong_Kong" => "(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi",
|
"Atlantic/Stanley" => "(GMT-04:00) Faukland Islands",
|
||||||
"Asia/Irkutsk" => "(GMT+08:00) Irkutsk, Ulaan Bataar",
|
"America/Campo_Grande" => "(GMT-04:00) Brazil",
|
||||||
"Australia/Perth" => "(GMT+08:00) Perth",
|
"America/Goose_Bay" => "(GMT-04:00) Atlantic Time (Goose Bay)",
|
||||||
"Australia/Eucla" => "(GMT+08:45) Eucla",
|
"America/Glace_Bay" => "(GMT-04:00) Atlantic Time (Canada)",
|
||||||
"Asia/Tokyo" => "(GMT+09:00) Osaka, Sapporo, Tokyo",
|
"America/St_Johns" => "(GMT-03:30) Newfoundland",
|
||||||
"Asia/Seoul" => "(GMT+09:00) Seoul",
|
"America/Araguaina" => "(GMT-03:00) UTC-3",
|
||||||
"Asia/Yakutsk" => "(GMT+09:00) Yakutsk",
|
"America/Montevideo" => "(GMT-03:00) Montevideo",
|
||||||
"Australia/Adelaide" => "(GMT+09:30) Adelaide",
|
"America/Miquelon" => "(GMT-03:00) Miquelon, St. Pierre",
|
||||||
"Australia/Darwin" => "(GMT+09:30) Darwin",
|
"America/Godthab" => "(GMT-03:00) Greenland",
|
||||||
"Australia/Brisbane" => "(GMT+10:00) Brisbane",
|
"America/Argentina/Buenos_Aires" => "(GMT-03:00) Buenos Aires",
|
||||||
"Australia/Hobart" => "(GMT+10:00) Hobart",
|
"America/Sao_Paulo" => "(GMT-03:00) Brasilia",
|
||||||
"Asia/Vladivostok" => "(GMT+10:00) Vladivostok",
|
"America/Noronha" => "(GMT-02:00) Mid-Atlantic",
|
||||||
"Australia/Lord_Howe" => "(GMT+10:30) Lord Howe Island",
|
"Atlantic/Cape_Verde" => "(GMT-01:00) Cape Verde Is.",
|
||||||
"Etc/GMT-11" => "(GMT+11:00) Solomon Is., New Caledonia",
|
"Atlantic/Azores" => "(GMT-01:00) Azores",
|
||||||
"Asia/Magadan" => "(GMT+11:00) Magadan",
|
"Europe/Belfast" => "(GMT) Greenwich Mean Time : Belfast",
|
||||||
"Pacific/Norfolk" => "(GMT+11:30) Norfolk Island",
|
"Europe/Dublin" => "(GMT) Greenwich Mean Time : Dublin",
|
||||||
"Asia/Anadyr" => "(GMT+12:00) Anadyr, Kamchatka",
|
"Europe/Lisbon" => "(GMT) Greenwich Mean Time : Lisbon",
|
||||||
"Pacific/Auckland" => "(GMT+12:00) Auckland, Wellington",
|
"Europe/London" => "(GMT) Greenwich Mean Time : London",
|
||||||
"Etc/GMT-12" => "(GMT+12:00) Fiji, Kamchatka, Marshall Is.",
|
"Africa/Abidjan" => "(GMT) Monrovia, Reykjavik",
|
||||||
"Pacific/Chatham" => "(GMT+12:45) Chatham Islands",
|
"Europe/Amsterdam" => "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",
|
||||||
"Pacific/Tongatapu" => "(GMT+13:00) Nuku'alofa",
|
"Europe/Belgrade" => "(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",
|
||||||
"Pacific/Kiritimati" => "(GMT+14:00) Kiritimati",
|
"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",
|
||||||
<label><?php i18n("Timezone"); ?></label>
|
"Africa/Cairo" => "(GMT+02:00) Cairo",
|
||||||
<select name="timezone">
|
"Asia/Gaza" => "(GMT+02:00) Gaza",
|
||||||
<?php
|
"Africa/Blantyre" => "(GMT+02:00) Harare, Pretoria",
|
||||||
$timezones = "";
|
"Asia/Jerusalem" => "(GMT+02:00) Jerusalem",
|
||||||
foreach ($location as $key => $city) {
|
"Europe/Minsk" => "(GMT+02:00) Minsk",
|
||||||
if ($autocomplete['timezone'] == $key) {
|
"Asia/Damascus" => "(GMT+02:00) Syria",
|
||||||
$timezones .= '<option value="' . $key . '" selected="selected">' . $city . '</option>';
|
"Europe/Moscow" => "(GMT+03:00) Moscow, St. Petersburg, Volgograd",
|
||||||
} else {
|
"Africa/Addis_Ababa" => "(GMT+03:00) Nairobi",
|
||||||
$timezones .= '<option value="' . $key . '">' . $city . '</option>';
|
"Asia/Tehran" => "(GMT+03:30) Tehran",
|
||||||
}
|
"Asia/Dubai" => "(GMT+04:00) Abu Dhabi, Muscat",
|
||||||
}
|
"Asia/Yerevan" => "(GMT+04:00) Yerevan",
|
||||||
echo($timezones);
|
"Asia/Kabul" => "(GMT+04:30) Kabul",
|
||||||
unset($timezones);
|
"Asia/Yekaterinburg" => "(GMT+05:00) Ekaterinburg",
|
||||||
?>
|
"Asia/Tashkent" => "(GMT+05:00) Tashkent",
|
||||||
</select>
|
"Asia/Kolkata" => "(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi",
|
||||||
<button><?php i18n("Install"); ?></button>
|
"Asia/Katmandu" => "(GMT+05:45) Kathmandu",
|
||||||
</form>
|
"Asia/Dhaka" => "(GMT+06:00) Astana, Dhaka",
|
||||||
<?php
|
"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
|
|
||||||
function getTimeZoneString() {
|
|
||||||
var num = new Date().getTimezoneOffset();
|
|
||||||
if (num === 0) {
|
|
||||||
return "GMT";
|
|
||||||
} else {
|
|
||||||
var hours = Math.floor(num / 60);
|
|
||||||
var minutes = Math.floor((num - (hours * 60)));
|
|
||||||
|
|
||||||
if (hours < 10) hours = "0" + Math.abs(hours);
|
// Automatically select first timezone with the appropriate GMT offset
|
||||||
if (minutes < 10) minutes = "0" + Math.abs(minutes);
|
function getTimeZoneString() {
|
||||||
|
var num = new Date().getTimezoneOffset();
|
||||||
return "GMT" + (num < 0 ? "+" : "-") + hours + ":" + minutes;
|
if (num === 0) {
|
||||||
}
|
return "GMT";
|
||||||
}
|
} else {
|
||||||
var timezone = getTimeZoneString();
|
var hours = Math.floor(num / 60);
|
||||||
$("[name=timezone] option").each(function() {
|
var minutes = Math.floor((num - (hours * 60)));
|
||||||
if($(this).text().indexOf(timezone) > -1) $("[name=timezone]").val($(this).val());
|
|
||||||
})
|
|
||||||
|
|
||||||
$(".hide_field").click( function( e ) {
|
|
||||||
|
|
||||||
let input = e.target.parentElement.querySelector( 'input' );
|
|
||||||
|
|
||||||
if( input.type == "password" ) {
|
|
||||||
|
|
||||||
input.type = "text";
|
|
||||||
} else {
|
|
||||||
|
|
||||||
input.type = "password";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#install').on('submit',function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
// Check empty fields
|
if (hours < 10) hours = "0" + Math.abs(hours);
|
||||||
|
if (minutes < 10) minutes = "0" + Math.abs(minutes);
|
||||||
|
|
||||||
empty_fields = false;
|
return "GMT" + (num < 0 ? "+" : "-") + hours + ":" + minutes;
|
||||||
$('input').each(function(){
|
}
|
||||||
if($(this).val()=='' && $(this).attr('name')!='path'){ empty_fields = true; }
|
}
|
||||||
});
|
var timezone = getTimeZoneString();
|
||||||
|
$("[name=timezone] option").each(function() {
|
||||||
|
if($(this).text().indexOf(timezone) > -1) $("[name=timezone]").val($(this).val());
|
||||||
|
})
|
||||||
|
|
||||||
if(empty_fields){ alert('All fields must be filled out'); }
|
$(".hide_field").click( function( e ) {
|
||||||
|
|
||||||
// Check password
|
let input = e.target.parentElement.querySelector( 'input' );
|
||||||
password_match = true;
|
|
||||||
if($('input[name="password"]').val()!=$('input[name="password_confirm"]').val()){
|
|
||||||
password_match = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check Path
|
if( input.type == "password" ) {
|
||||||
check_path = true;
|
|
||||||
projectPath = '';
|
|
||||||
if($('input[name="project_path"]').length) {
|
|
||||||
projectPath = $('input[name="project_path"]').val();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( projectPath.indexOf("/") == 0 ) {
|
input.type = "text";
|
||||||
check_path = confirm('Do you really want to create project with absolute path "' + projectPath + '"?');
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
if(!password_match){ alert('The passwords entered do not match'); }
|
input.type = "password";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if(!empty_fields && password_match && check_path){
|
$('#install').on('submit',function(e){
|
||||||
$.post('components/install/install.php',$('#install').serialize(),function( data ) {
|
e.preventDefault();
|
||||||
|
|
||||||
if( data == 'success' ){
|
|
||||||
window.location.reload();
|
|
||||||
} else {
|
|
||||||
data = JSON.parse( data );
|
|
||||||
console.log( data.error );
|
|
||||||
alert( "An Error Occurred\n" + data.message );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
// Check empty fields
|
||||||
});
|
|
||||||
|
empty_fields = false;
|
||||||
|
$('input').each(function(){
|
||||||
|
if($(this).val()=='' && $(this).attr('name')!='path'){ empty_fields = true; }
|
||||||
|
});
|
||||||
|
|
||||||
|
if(empty_fields){ alert('All fields must be filled out'); }
|
||||||
|
|
||||||
|
// Check password
|
||||||
|
password_match = true;
|
||||||
|
if($('input[name="password"]').val()!=$('input[name="password_confirm"]').val()){
|
||||||
|
password_match = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check Path
|
||||||
|
check_path = true;
|
||||||
|
projectPath = '';
|
||||||
|
if($('input[name="project_path"]').length) {
|
||||||
|
projectPath = $('input[name="project_path"]').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( projectPath.indexOf("/") == 0 ) {
|
||||||
|
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(!empty_fields && password_match && check_path){
|
||||||
|
$.post('components/install/install.php',$('#install').serialize(),function( data ) {
|
||||||
|
|
||||||
|
if( data == 'success' ){
|
||||||
|
window.location.reload();
|
||||||
|
} else {
|
||||||
|
data = JSON.parse( data );
|
||||||
|
console.log( data.error );
|
||||||
|
alert( "An Error Occurred\n" + data.message );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -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) {
|
||||||
|
@ -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 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
||||||
|
@ -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 */
|
||||||
|
Loading…
Reference in New Issue
Block a user