Remove backwards compatible code

The authentication module is supported from the initial release,
therefore the backwards compatible code can be removed.
This commit is contained in:
Jelle van der Waa 2016-08-01 09:53:37 +02:00
parent 300c060be1
commit 0564edfb74

View File

@ -1,9 +1,6 @@
<?php <?php
// For backward compatibility we must check if the file exists require_once(BASE_PATH . 'server/includes/core/class.encryptionstore.php');
if ( file_exists(BASE_PATH . 'server/includes/core/class.encryptionstore.php') ) {
require_once(BASE_PATH . 'server/includes/core/class.encryptionstore.php');
}
/** /**
* PluginMDMModule Module * PluginMDMModule Module
@ -25,27 +22,10 @@ class PluginMDMModule extends Module
$this->server = (PLUGIN_MDM_SERVER_SSL ? 'https://' : 'http://') . PLUGIN_MDM_SERVER; $this->server = (PLUGIN_MDM_SERVER_SSL ? 'https://' : 'http://') . PLUGIN_MDM_SERVER;
// For backward compatibility we will check if the Encryption store exists. If not, // Get the username and password from the Encryption store
// we will fall back to the old way of retrieving the password from the session. $encryptionStore = EncryptionStore::getInstance();
if ( class_exists('EncryptionStore') ) { $this->username = $encryptionStore->get('username');
$this->password = $encryptionStore->get('password');
// Get the username and password from the Encryption store
$encryptionStore = EncryptionStore::getInstance();
$this->username = $encryptionStore->get('username');
$this->password = $encryptionStore->get('password');
} else {
$this->username = $GLOBALS['mapisession']->getUserName();
$this->password = $_SESSION['password'];
if(function_exists('openssl_decrypt')) {
// In PHP 5.3.3 the iv parameter was added
if(version_compare(phpversion(), "5.3.3", "<")) {
$this->password = openssl_decrypt($this->password, "des-ede3-cbc", PASSWORD_KEY, 0);
} else {
$this->password = openssl_decrypt($this->password, "des-ede3-cbc", PASSWORD_KEY, 0, PASSWORD_IV);
}
}
}
$this->url = $this->server .'/Microsoft-Server-ActiveSync?Cmd=WebserviceDevice&DeviceId=webservice&DeviceType=webservice&User=' . $this->username; $this->url = $this->server .'/Microsoft-Server-ActiveSync?Cmd=WebserviceDevice&DeviceId=webservice&DeviceType=webservice&User=' . $this->username;
} }