*/
public static function getBackends() {
+ // FIXME: do not rely on php key order for the options order in the UI
$backends['\OC\Files\Storage\Local']=array(
'backend' => 'Local',
'configuration' => array(
private static function encryptPasswords($options) {
if (isset($options['password'])) {
$options['password_encrypted'] = self::encryptPassword($options['password']);
- unset($options['password']);
+ // do not unset the password, we want to keep the keys order
+ // on load... because that's how the UI currently works
+ $options['password'] = '';
}
return $options;
}
$this->assertEquals('\OC\Files\Storage\SMB', $config['ext']['class']);
$savedMountConfig = $config['ext']['configuration'];
$this->assertEquals($mountConfig, $savedMountConfig);
+ // key order needs to be preserved for the UI...
+ $this->assertEquals(array_keys($mountConfig), array_keys($savedMountConfig));
}
/**
$this->assertEquals('\OC\Files\Storage\SMB', $config['ext']['class']);
$savedMountConfig = $config['ext']['configuration'];
$this->assertEquals($mountConfig, $savedMountConfig);
+ // key order needs to be preserved for the UI...
+ $this->assertEquals(array_keys($mountConfig), array_keys($savedMountConfig));
}
/**
$config = $this->readUserConfig();
$savedConfig = $config[$mountType][$applicable]['/' . self::TEST_USER1 . '/files/ext']['options'];
- // no more clear text password in file
- $this->assertFalse(isset($savedConfig['password']));
+ // no more clear text password in file (kept because of key order)
+ $this->assertEquals('', $savedConfig['password']);
// encrypted password is present
$this->assertNotEquals($mountConfig['password'], $savedConfig['password_encrypted']);