Skip to content

Commit

Permalink
fix config-error
Browse files Browse the repository at this point in the history
  • Loading branch information
tgloeggl committed Oct 24, 2016
1 parent 62355c6 commit ec5a542
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 70 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function save_action()
}

foreach ($options as $name => $value) {
$config = new \ElanEv\Driver\ConfigOption($name);
$config = new \ElanEv\Driver\ConfigOption($name, '');
$config->setValue($value);
$config_options[] = $config;
}
Expand Down
68 changes: 0 additions & 68 deletions migrations/017_new_config.php

This file was deleted.

14 changes: 14 additions & 0 deletions migrations/017_skipped_migration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

class SkippedMigration extends Migration
{
function up()
{

}

function down()
{

}
}
84 changes: 84 additions & 0 deletions migrations/018_new_config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php

require __DIR__.'/../vendor/autoload.php';

/**
* Remove old config options and add a new one, holding all config data
*
* @author Till Glöggler <[email protected]>
*/

class NewConfig extends Migration {

/**
* {@inheritdoc}
*/
public function description()
{
return "migrate and remove old config options and add the new one";
}

/**
* {@inheritdoc}
*/
public function up()
{
try {
$query = "REPLACE INTO `config`
(`config_id`, `field`, `value`, `is_default`, `type`, `range`, `section`,
`mkdate`, `chdate`, `description`)
VALUES (MD5(:field), :field, :value, 1, :type, 'global', 'meetings',
UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)";

$statement = DBManager::get()->prepare($query);

$statement->execute(array(
':field' => 'VC_CONFIG',
':value' => '',
':type' => 'string',
':description' => 'Konfiguration des Meetings-Plugins im JSON Format',
));


//migrate current settings
if (Config::get()->VC_DRIVER) {
$current_driver = Config::get()->getValue('VC_DRIVER');

$config = array(
'BigBlueButton' => array(
'enable' => ($current_driver == 'bigbluebutton') ? 1 : 0,
'display_name' => 'BigBlueButton',
'url' => Config::get()->getValue('BBB_URL'),
'api-key' => Config::get()->getValue('BBB_SALT')
),
'DfnVc' => array(
'enable' => ($current_driver == 'dfnvc') ? 1 : 0,
'display_name' => 'Adobe Connect VC',
'url' => Config::get()->getValue('DFN_VC_URL'),
'login' => Config::get()->getValue('DFN_VC_LOGIN'),
'password' => Config::get()->getValue('DFN_VC_PASSWORD')
)
);

\Config::get()->store('VC_CONFIG', json_encode($config));

Config::get()->delete('BBB_URL');
Config::get()->delete('BBB_SALT');
Config::get()->delete('DFN_VC_URL');
Config::get()->delete('DFN_VC_LOGIN');
Config::get()->delete('DFN_VC_PASSWORD');
Config::get()->delete('VC_DRIVER');
Config::get()->delete(\ElanEv\Driver\DriverFactory::DEFAULT_DRIVER_CONFIG_ID);
}
} catch (InvalidArgumentException $ex) {

}
}

/**
* {@inheritdoc}
*/
public function down()
{
}
}
2 changes: 1 addition & 1 deletion plugin.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginname=Meetings
pluginclassname=MeetingPlugin
origin=elan-ev
version=1.1.6
version=1.1.7
studipMinVersion=3.1
studipMaxVersion=3.4.99
description=Virtueller Raum, mit dem Live-Online-Treffen, ***REMOVED***e und Videokonferenzen durchgef�hrt werden k�nnen.
Expand Down

0 comments on commit ec5a542

Please sign in to comment.