From 7c3da72f9a61f862857d2234e16b6e491193c318 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 17 Jan 2019 14:57:15 +0800 Subject: [PATCH] Fix #5620 - hide /admin.php and index.php --- Bjs.php | 71 ++++++++++++++++++++++++++++++++++++++++++ UpdateDatabase.php | 7 +++-- _translations_/Bjs.php | 71 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 Bjs.php create mode 100644 _translations_/Bjs.php diff --git a/Bjs.php b/Bjs.php new file mode 100644 index 00000000..1950d847 --- /dev/null +++ b/Bjs.php @@ -0,0 +1,71 @@ +fields from the list.. + */ + +class Pman_Core_Bjs { + + var $json; + var $fields = array(); + + function __construct($file) + { + + $this->json = json_decode(file_get_contents($file)); + $this->iterateFields($this->json->items); + } + + function iterateFields($ar) + { + foreach($ar as $o) { + + switch ($o->xtype) { + case "ComboBox": + $this->fields[] = $o->{'String hiddenName'}; + // fall throught.. + $k = isset($o->{'String name'}) ? 'String name' : 'string name'; + + if (!isset($o->{$k})) { + break; // allowed to not exit. + } + $this->fields[] = $o->{$k}; + + case "Input": + case "TextArea": + case "CheckBox": + case "DateField": + case "Radio": + case "RadioSet": + case "PhoneInput": + case "NumberField": + $k = isset($o->{'String name'}) ? 'String name' : 'string name'; + + if (!isset($o->{$k})) { + echo "missing string name"; + print_r($o);exit; + } + $this->fields[] = $o->{$k}; + break; + + case "MoneyField": + $k = isset($o->{'String currencyName'}) ? 'String currencyName' : 'string currencyName'; + + $this->fields[] = $o->{$k}; + $k = isset($o->{'String name'}) ? 'String name' : 'string name'; + $this->fields[] = $o->{$k}; + break; + default: + if (isset($o->items)) { + $this->iterateFields($o->items); + } + } + + } + + } + + +} diff --git a/UpdateDatabase.php b/UpdateDatabase.php index 2b2a03f0..19c0dd9d 100644 --- a/UpdateDatabase.php +++ b/UpdateDatabase.php @@ -1277,10 +1277,13 @@ class Pman_Core_UpdateDatabase extends Pman function clearApacheDataobjectsCache() { - echo "Clearing Database Cache\n"; + // this needs to clear it's own cache along with remote one.. $url = "http://localhost{$this->local_base_url}/Core/RefreshDatabaseCache"; + + echo "Clearing Database Cache : http://localhost{$this->local_base_url}/Core/RefreshDatabaseCache\n"; + $response = $this->curl($url); $json = json_decode($response, true); @@ -1297,7 +1300,7 @@ class Pman_Core_UpdateDatabase extends Pman function clearApacheAssetCache() { - echo "Clearing Asset Cache\n"; + echo "Clearing Asset Cache : http://localhost{$this->local_base_url}/Core/Asset\n"; $response = $this->curl( "http://localhost{$this->local_base_url}/Core/Asset", array( '_clear_cache' => 1 ,'returnHTML' => 'NO' ), diff --git a/_translations_/Bjs.php b/_translations_/Bjs.php new file mode 100644 index 00000000..a69223cd --- /dev/null +++ b/_translations_/Bjs.php @@ -0,0 +1,71 @@ +json = json_decode(file_get_contents($file)); + $this->iterateFields($this->json->items); + } + + function iterateFields($ar) + { + foreach($ar as $o) { + + switch ($o->xtype) { + case "ComboBox": + $this->fields[] = $o->{'String hiddenName'}; + // fall throught.. + $k = isset($o->{'String name'}) ? 'String name' : 'string name'; + + if (!isset($o->{$k})) { + break; // allowed to not exit. + } + $this->fields[] = $o->{$k}; + + case "Input": + case "TextArea": + case "CheckBox": + case "DateField": + case "Radio": + case "RadioSet": + case "PhoneInput": + case "NumberField": + $k = isset($o->{'String name'}) ? 'String name' : 'string name'; + + if (!isset($o->{$k})) { + echo "missing string name"; + print_r($o);exit; + } + $this->fields[] = $o->{$k}; + break; + + case "MoneyField": + $k = isset($o->{'String currencyName'}) ? 'String currencyName' : 'string currencyName'; + + $this->fields[] = $o->{$k}; + $k = isset($o->{'String name'}) ? 'String name' : 'string name'; + $this->fields[] = $o->{$k}; + break; + default: + if (isset($o->items)) { + $this->fields = $this->iterateFields($o->items); + } + } + + } + + } + + +} -- 2.39.2