* [MOD] Minor tweaks.

This commit is contained in:
nuxsmin
2016-02-07 20:54:09 +01:00
parent 7d3e58b089
commit 82d168de34
5 changed files with 39 additions and 12 deletions

View File

@@ -2908,10 +2908,11 @@ class RSA
/**
* Decryption
*
* @see encrypt()
* @access public
* @param string $plaintext
* @see encrypt()
* @access public
* @param $ciphertext
* @return string
* @internal param string $plaintext
*/
function decrypt($ciphertext)
{

View File

@@ -98,12 +98,12 @@ class Config
*/
public static function saveConfig(ConfigData $Config = null, $backup = true)
{
if (is_null($Config)){
Factory::getConfigStorage()->setItems(self::getConfig());
} else {
Factory::getConfigStorage()->setItems($Config);
}
$ConfigData = (is_null($Config)) ? self::getConfig() : $Config;
$ConfigData->setConfigDate(time());
$ConfigData->setConfigSaver(Session::getUserLogin());
$ConfigData->setConfigHash();
Factory::getConfigStorage()->setItems($ConfigData);
Factory::getConfigStorage()->save('config');
if ($backup) {
@@ -131,7 +131,7 @@ class Config
foreach ($Reflection->getProperties() as $property) {
$property->setAccessible(true);
$property->setValue(self::$Config, $items[$property->getName()]);
$property->setValue(self::$Config, @$items[$property->getName()]);
$property->setAccessible(false);
}
} catch (SPException $e) {}

View File

@@ -24,6 +24,7 @@
*/
namespace SP\Config;
use JsonSerializable;
/**
@@ -329,6 +330,10 @@ class ConfigData implements JsonSerializable
* @var bool
*/
private $accountPassToImage = false;
/**
* @var string
*/
private $configSaver = '';
/**
* @return boolean
@@ -755,11 +760,11 @@ class ConfigData implements JsonSerializable
}
/**
* @param string $configHash
*
*/
public function setConfigHash($configHash)
public function setConfigHash()
{
$this->configHash = $configHash;
$this->configHash = md5(serialize($this));
}
/**
@@ -1518,4 +1523,20 @@ class ConfigData implements JsonSerializable
{
return get_object_vars($this);
}
/**
* @return string
*/
public function getConfigSaver()
{
return $this->configSaver;
}
/**
* @param string $configSaver
*/
public function setConfigSaver($configSaver)
{
$this->configSaver = $configSaver;
}
}

View File

@@ -71,6 +71,7 @@ class Request
$CryptPKI = new CryptPKI();
$clearData = $CryptPKI->decryptRSA(base64_decode($encryptedData));
} catch (\Exception $e) {
error_log($e->getMessage());
return $encryptedData;
}

View File

@@ -176,6 +176,8 @@ class XmlHandler implements FileStorageInterface
protected function analyzeItems()
{
if (is_array($this->items)) {
ksort($this->items);
return $this->items;
} elseif (is_object($this->items)) {
return $this->analyzeObject();
@@ -201,6 +203,8 @@ class XmlHandler implements FileStorageInterface
$property->setAccessible(false);
}
ksort($items);
return $items;
}