Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
Merge branch 'develop' into 1.4.bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmi3yy committed Jun 8, 2018
2 parents 884f35a + cfda19c commit 2ac3aff
Show file tree
Hide file tree
Showing 161 changed files with 4,395 additions and 8,984 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

# Manager
/manager/includes/config.inc.php
/manager/includes/config_mutator.php

# Composer
/composer.phar
Expand Down
97 changes: 97 additions & 0 deletions assets/docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,103 @@
This file shows the changes in recent releases of Evolution CMS. The most current release is usually the
development release, and is only shown to give an idea of what's currently in the pipeline.

Evolution CMS 1.4.4 (Jun 08, 2018)
* [GitHub:#5d177a4ea] - [I] Auto set Sender (Евгений Борисов)
* [GitHub:#f13d19d60] - [I] Move color switcher icon (Mr B)
* [GitHub:#ee5cb56b2] - [I] Remove css / colour switch conflict (Mr B)
* [GitHub:#32d2165c7] - [I] Update save_user.processor.php (Mr B)
* [GitHub:#a450d22af] - [I] Trim user/webuser email address (Mr B)
* [GitHub:#cdbeaf8b9] - [I] Update web_user_management.static.php (Mr B)
* [GitHub:#82cda9654] - [I] Replace gender on user/webuser tables (Mr B)
* [GitHub:#b9c3e474c] - [F] - Ignored if default class is extended (Евгений Борисов)
* [GitHub:#dda339c27] - [I] config_mutator.php (Agel_Nash)
* [GitHub:#cb55e213c] - [I] Define MODX_CLI (Agel_Nash)
* [GitHub:#a3fc8c57c] - [I] refactoring webAlertAndQuit (Agel_Nash)
* [GitHub:#bbefb5a28] - [I] $_lang['invalid_event_response'] (Agel_Nash)
* [GitHub:#c60c6a8e6] - [I] OnBeforeMinifyCss (Agel_Nash)
* [GitHub:#81c160eea] - [I] Native support mixed types in a output statement (Agel_Nash)
* [GitHub:#019462178] - [F] Conflict with DLTemplate::renderDoc() (Евгений Борисов)
* [GitHub:#0f0095dd7] - [F] style for 1200px - (dmi3yy)
* [GitHub:#21b31569c] - Update preload.functions.inc.php (Евгений Борисов)
* [GitHub:#d568f89d2] - [I] Code style (Agel_Nash)
* [GitHub:#769270b96] - [S] Cross-Site Scripting https://www.exploit-db.com/exploits/44775/ Site name field XSS fix: https://github.com/nathunandwani/ClipperCMS/commit/f286fbfa81dc3728dbbf6d9d817c8848edcad0b2 (Agel_Nash)
* [GitHub:#ddb47a7d0] - [F] Fix buttons transition and focus background-color (Serg)
* [GitHub:#5edac57c8] - [I] Moving tv parameters without a category to the General tab (Serg)
* [GitHub:#2950b760d] - [F] correct install finish (dmi3yy)
* [GitHub:#ebed40c60] - [F] undeclared variable (Serg)
* [GitHub:#f399f2ea8] - [F] broken OnParseProperties event (Pathologic)
* [GitHub:#ef95a606a] - [F] update DocLister and FormLister (dmi3yy)
* [GitHub:#8c873d61a] - [F] Update tab6_filemanager_settings.inc.php (Mr B)
* [GitHub:#3608ab90f] - [F] Update tab5_security_settings.inc.php (Mr B)
* [GitHub:#0c2fa0ddd] - [I] Add missing events for System Settings tabs (Mr B)
* [GitHub:#323e9cdc9] - [F] tab3 invokeEvent to last tr (Mr B)
* [GitHub:#8d1a0ebac] - [F] revert tab change (Mr B)
* [GitHub:#aff400f72] - [F] Correct message urls (Mr B)
* [GitHub:#6fa23c6a7] - [I] Show element icon (Mr B)
* [GitHub:#7b3692125] - [F] fix locked (Ser1ous)
* [GitHub:#e32d25e19] - [F] Fix strict mode bug on get tv list (Ser1ous)
* [GitHub:#67117ab6b] - [F] fix error log in phpmailer (Pathologic)
* [GitHub:#569a1533c] - [I] singleton (Pathologic)
* [GitHub:#946f7f5de] - [F] fix code format (Ser1ous)
* [GitHub:#bb174a09d] - [I] Ctr+Alt+L on PhpStorm (Ser1ous)
* [GitHub:#4c5a44233] - [I] Add event pub/unpub documents (Ser1ous)
* [GitHub:#99edc5fb5] - [F] Fix ios iframe scroll so only applied to ios (Mr B)
* [GitHub:#bd7237579] - [F] Update qm.inc.php (Mr B)
* [GitHub:#2905e58c7] - [I] Give custom QM buttons a title (Mr B)
* [GitHub:#d287e2b85] - [F] Update execute_module.processor.php (Mr B)
* [GitHub:#12c151b13] - [I] Make store fit iframe width (Mr B)
* [GitHub:#ccb4ac7a6] - [I] Change html check for scroller (Mr B)
* [GitHub:#e100bef00] - [I] iframe scroller for for Module if no need fix add to GET &api=1 (dmi3yy)
* [GitHub:#97179a3bd] - [I] Stacked table cells for system configuration (Piotr Matysiak)
* [GitHub:#84617f23b] - [I] Stacked table cells on small screens (Piotr Matysiak)
* [GitHub:#4db235560] - [F] fix for module iframe scrolling (Mr B)
* [GitHub:#c07af3d5f] - [F] Update modx.min.js (Mr B)
* [GitHub:#c84388af0] - [I] Restrict menu tree auto hide to small mobile (Mr B)
* [GitHub:#7acb549af] - [I] Polish translation (Piotr Matysiak)
* [GitHub:#dbd75f74f] - [I] move login page and menu setting to tab 4 (dmi3yy)
* [GitHub:#f266be8b6] - [F] TinyMCE darcness theme by default - need set lightgray by default #613 (dmi3yy)
* [GitHub:#5c6d120ed] - [F] update DocLister 2.3.15 (dmi3yy)
* [GitHub:#8aed61699] - [F] update FormLister to 1.7.19 (dmi3yy)
* [GitHub:#10a9a62b0] - [I] add params for manager_menu_position (dmi3yy)
* [GitHub:#816c645a0] - [F] welcome widget fix (Piotr Matysiak)
* [GitHub:#cc0e2294c] - [F] Fix manager restrict by day login (Mr B)
* [GitHub:#3658514a8] - [I] welcome widget change (Piotr Matysiak)
* [GitHub:#631286ca9] - [F] welcome and online widgets stacked (Piotr Matysiak)
* [GitHub:#a0198c207] - [F] #650 Display valid-hostnames after setting them (Deesen)
* [GitHub:#ffd97e6bf] - [F] #616 Fix TinyMCE4 custom-theme´s toolbars with global settings (Deesen)
* [GitHub:#657088dc1] - [F] Update .htaccess (Евгений Борисов)
* [GitHub:#454f4f975] - [F] Update index.css (Mr B)
* [GitHub:#bdc53cbf2] - [F] Update modx.min.js (Mr B)
* [GitHub:#135e9b047] - [F] Update modx.js (Mr B)
* [GitHub:#009388364] - [F] iOS iframe Scrolling/jumping (Mr B)
* [GitHub:#bec6c2f09] - [F] #643 Fix TinyMCE4 mobile-mode (Deesen)
* [GitHub:#c26f0eaa6] - [I] Add space to bottom of menu tree (Mr B)
* [GitHub:#8ecd06ecf] - [I] Remove 'Top how many' option as not used (Mr B)
* [GitHub:#30673e780] - refactor stay icons (Serg)
* [GitHub:#adc145943] - [S] Secutiy fix for old version (dmi3yy)
* [GitHub:#1c7f67c1b] - [F] #629 Fix issue with HTTP2/SSL & check connection to server (Deesen)
* [GitHub:#aa7892eea] - [F] store sql fixed (mnoskov)
* [GitHub:#4e6d54387] - [F] box-shadow (Piotr Matysiak)
* [GitHub:#57821c93c] - [I] Remove scrollbars in centered layout (Piotr Matysiak)
* [GitHub:#be9830839] - [I] Login form positions (Piotr Matysiak)
* [GitHub:#e6fec0458] - [F] Set loginbox position CSS class (Piotr Matysiak)
* [GitHub:#160590f23] - [I] Login page - set images placeholders (Piotr Matysiak)
* [GitHub:#009833f50] - [I] Manager Polish Translation update (Piotr Matysiak)
* [GitHub:#28a082472] - [I] Manager Polish Translation (Piotr Matysiak)
* [GitHub:#b69d83b50] - [I] Optimized images (Piotr Matysiak)
* [GitHub:#60cc4b893] - [I] First commit of new login page (Piotr Matysiak)
* [GitHub:#0e628b256] - [I] setting for customize login page (dmi3yy)
* [GitHub:#9b0f507c2] - [F] for TinyMCE skin by default lightgray (dmi3yy)
* [GitHub:#73ebfee5a] - [F] missing tabheader border (Piotr Matysiak)
* [GitHub:#0840e3a31] - [F] minify css default theme (Serg)
* [GitHub:#3cf94bf7d] - [F] width auto for select size=1 (Serg)
* [GitHub:#c2a4032d7] - [F] logo page help (Serg)
* [GitHub:#74da26055] - [F] class input-group-addon (Serg)
* [GitHub:#f8f91e41a] - [F] pagination darkness theme (Serg)
* [GitHub:#4eb2414d3] - [F] hover background-color mainMenu item version (Serg)
* [GitHub:#19b1f5534] - [F] fix for darkness mode (Piotr Matysiak)
* [GitHub:#27b5a37fb] - [F] Fix missing border (Piotr Matysiak)

Evolution CMS 1.4.3 (Apr 04, 2018)
* [GitHub:#e10383b14] - update DocLister (dmi3yy)
* [GitHub:#2654f2c59] - update Formlister (dmi3yy)
Expand Down
Binary file added assets/js/easy-ui/themes/modx/images/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions assets/lib/APIHelpers.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,39 @@ public static function checkString($value, $minLen = 1, $alph = array(), $mixArr
return $flag;
}

/**
* @param $IDs
* @param string $sep
* @param integer[] $ignore
* @return array
* @throws Exception
*/
public static function cleanIDs($IDs, $sep = ',', $ignore = array())
{
$out = array();
if (!is_array($IDs)) {
if (is_scalar($IDs)) {
$IDs = explode($sep, $IDs);
} else {
$IDs = array();
throw new Exception('Invalid IDs list <pre>' . print_r($IDs, 1) . '</pre>');
}
}
foreach ($IDs as $item) {
$item = trim($item);
if (is_scalar($item) && (int)$item >= 0) { //Fix 0xfffffffff
if (!empty($ignore) && in_array((int)$item, $ignore, true)) {
$this->log[] = 'Ignore id ' . (int)$item;
} else {
$out[] = (int)$item;
}
}
}
$out = array_unique($out);

return $out;
}

/**
* Переменовывание элементов массива
*
Expand Down
21 changes: 1 addition & 20 deletions assets/lib/MODxAPI/MODx.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,26 +559,7 @@ public function isChanged($key)
*/
final public function cleanIDs($IDs, $sep = ',', $ignore = array())
{
$out = array();
if (!is_array($IDs)) {
if (is_scalar($IDs)) {
$IDs = explode($sep, $IDs);
} else {
$IDs = array();
throw new Exception('Invalid IDs list <pre>' . print_r($IDs, 1) . '</pre>');
}
}
foreach ($IDs as $item) {
$item = trim($item);
if (is_scalar($item) && (int)$item >= 0) { //Fix 0xfffffffff
if (!empty($ignore) && in_array((int)$item, $ignore, true)) {
$this->log[] = 'Ignore id ' . (int)$item;
} else {
$out[] = (int)$item;
}
}
}
$out = array_unique($out);
$out = APIhelpers::cleanIDs($IDs, $sep, $ignore);

return $out;
}
Expand Down
16 changes: 11 additions & 5 deletions assets/lib/MODxAPI/modResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ public function get($key)
$tvID = APIHelpers::getkey($this->tv, $key, 0);
if (in_array($tvID, $tvTPL) && is_null($out)) {
$out = APIHelpers::getkey($this->tvd, $key, null);
$out = $out['default'];
}
}

Expand Down Expand Up @@ -468,24 +469,29 @@ public function edit($id)
$this->close();
$this->markAllEncode();
$this->newDoc = false;

$result = $this->query("SELECT * from {$this->makeTable('site_content')} where `id`=" . (int)$id);
$this->fromArray($this->modx->db->getRow($result));
$result = $this->query("SELECT * from {$this->makeTable('site_tmplvar_contentvalues')} where `contentid`=" . (int)$id);
while ($row = $this->modx->db->getRow($result)) {
$this->field[$this->tvid[$row['tmplvarid']]] = $row['value'];
}
$fld = array();
foreach ($this->tvd as $name => $tv) {
if ($this->belongsToTemplate($this->tv[$name])) {
$fld[$name] = $tv['default'];
}
};
$this->store(array_merge($fld, $this->field));
if (empty($this->field['id'])) {
$this->id = null;
} else {
$this->id = $this->field['id'];
$this->set('editedby', null)->touch();
$this->decodeFields();
}
$this->store($this->toArray(null, null, null, false));
unset($this->field['id']);
}

return $this;
}

Expand Down Expand Up @@ -590,7 +596,7 @@ public function save($fire_events = false, $clearCache = false)
foreach ($fld as $key => $value) {
if (empty($this->tv[$key]) || !$this->isChanged($key) || !$this->belongsToTemplate($this->tv[$key])) {
continue;
} elseif ($value === '') {
} elseif ($value === '' || is_null($value) || (isset($this->tvd[$key]) && $value == $this->tvd[$key]['default'])) {
$_deleteTVs[] = $this->tv[$key];
} else {
$_insertTVs[$this->tv[$key]] = $this->escape($value);
Expand Down Expand Up @@ -794,7 +800,7 @@ protected function checkAlias($alias)
*/
public function issetField($key)
{
return (array_key_exists($key, $this->default_field) || array_key_exists($key, $this->tv));
return (array_key_exists($key, $this->default_field) || (array_key_exists($key, $this->tv) && $this->belongsToTemplate($this->tv[$key])));
}

/**
Expand Down
63 changes: 55 additions & 8 deletions assets/lib/MODxAPI/modUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class modUsers extends MODxAPI
),
'attribute' => array(
'fullname' => '',
'role' => '',
'role' => 0,
'email' => '',
'phone' => '',
'mobilephone' => '',
Expand Down Expand Up @@ -52,6 +52,11 @@ class modUsers extends MODxAPI
*/
protected $givenPassword = '';
protected $groupIds = array();
protected $userIdCache = array(
'attribute.internalKey' => '',
'attribute.email' => '',
'user.username' => ''
);

/**
* @var integer
Expand Down Expand Up @@ -135,14 +140,42 @@ public function create($data = array())
return $this;
}

/**
*
*/
public function close()
{
parent::close();
$this->userIdCache = array(
'attribute.internalKey' => '',
'attribute.email' => '',
'user.username' => ''
);
}

/**
* @param $id
* @return mixed
*/
protected function getUserId($id) {
$find = $this->findUser($id);
if ($find && !empty($this->userIdCache[$find])) {
$id = $this->userIdCache[$find];
} else {
$id = null;
}

return $id;
}

/**
* @param $id
* @return $this
*/
public function edit($id)
{
$id = is_scalar($id) ? trim($id) : '';
if ($this->getID() != $id) {
if ($this->getUserId($id) != $id) {
$this->close();
$this->newDoc = false;

Expand All @@ -152,6 +185,9 @@ public function edit($id)
$this->set('editedon', time());
$this->editQuery($find, $id);
$this->id = empty($this->field['internalKey']) ? null : $this->get('internalKey');
$this->userIdCache['attribute.internalKey'] = $this->getID();
$this->userIdCache['attribute.email'] = $this->get('email');
$this->userIdCache['user.username'] = $this->get('username');
$this->store($this->toArray());
unset($this->field['id']);
unset($this->field['internalKey']);
Expand Down Expand Up @@ -233,7 +269,7 @@ public function save($fire_events = false, $clearCache = false)
return false;
}

if (!$this->checkUnique('web_users', 'username')) {
if ($this->isChanged('username') && !$this->checkUnique('web_users', 'username')) {
$this->log['UniqueUsername'] = 'username not unique <pre>' . print_r(
$this->get('username'),
true
Expand All @@ -242,7 +278,7 @@ public function save($fire_events = false, $clearCache = false)
return false;
}

if (!$this->checkUnique('web_user_attributes', 'email', 'internalKey')) {
if ($this->isChanged('username') && !$this->checkUnique('web_user_attributes', 'email', 'internalKey')) {
$this->log['UniqueEmail'] = 'Email not unique <pre>' . print_r($this->get('email'), true) . '</pre>';

return false;
Expand Down Expand Up @@ -372,6 +408,9 @@ public function delete($ids, $fire_events = false)
return $flag;
}

/**
* @return mixed
*/
protected function deleteQuery()
{
return $this->query("
Expand Down Expand Up @@ -415,8 +454,12 @@ public function authUser($id = 0, $fulltime = true, $cookieName = 'WebLoginPE',
*/
public function checkBlock($id = 0)
{
$tmp = clone $this;
if ($id && $tmp->getID() != $id) {
if ($this->getID()) {
$tmp = clone $this;
} else {
$tmp = $this;
}
if ($id && $tmp->getUserId($id) != $id) {
$tmp->edit($id);
}
$now = time();
Expand All @@ -439,8 +482,12 @@ public function checkBlock($id = 0)
*/
public function testAuth($id, $password, $blocker, $fire_events = false)
{
$tmp = clone $this;
if ($id && $tmp->getID() != $id) {
if ($this->getID()) {
$tmp = clone $this;
} else {
$tmp = $this;
}
if ($id && $tmp->getUserId($id) != $id) {
$tmp->edit($id);
}

Expand Down
4 changes: 2 additions & 2 deletions assets/lib/class.modxRTEbridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function __construct($editorKey = NULL, $bridgeConfig=array(), $tvOptions
foreach($this->gSettingsRows as $param=>$row) {
if(isset($row['defaultCheckbox']) && $row['defaultCheckbox']) {
$useGlobalName = $editorKey . '_' . $param . '_useglobal';
$this->modxParams[$param . '_useglobal'] = !empty($editorConfig[$useGlobalName]) || (isset($editorConfig[$useGlobalName]) && is_null($editorConfig[$useGlobalName])) ? '1' : '0';
$this->modxParams[$param . '_useglobal'] = !isset($editorConfig[$useGlobalName]) || !empty($editorConfig[$useGlobalName]) || (isset($editorConfig[$useGlobalName]) && is_null($editorConfig[$useGlobalName])) ? '1' : '0';
}
}

Expand All @@ -94,7 +94,7 @@ public function __construct($editorKey = NULL, $bridgeConfig=array(), $tvOptions
// Handle defaultCheckbox
if(isset($row['defaultCheckbox']) && $row['defaultCheckbox']) {
$useGlobalName = $editorKey . '_' . $param . '_useglobal';
$this->modxParams[$param . '_useglobal'] = !empty($editorConfig[$useGlobalName]) || (isset($editorConfig[$useGlobalName]) && is_null($editorConfig[$useGlobalName])) ? '1' : '0';
$this->modxParams[$param . '_useglobal'] = !isset($editorConfig[$useGlobalName]) || !empty($editorConfig[$useGlobalName]) || (isset($editorConfig[$useGlobalName]) && is_null($editorConfig[$useGlobalName])) ? '1' : '0';
}
};

Expand Down
3 changes: 1 addition & 2 deletions assets/modules/store/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ body {
}

.pagetitle {
position: relative;
left: 10px
margin-left: 10px;
}

.github {
Expand Down
Loading

0 comments on commit 2ac3aff

Please sign in to comment.