]> git.mjollnir.org Git - moodle.git/commitdiff
mnet MDL-19239 changed all instances of fetching config from db to use get_config
authorPenny Leach <penny@liip.ch>
Mon, 11 Jan 2010 22:53:11 +0000 (22:53 +0000)
committerPenny Leach <penny@liip.ch>
Mon, 11 Jan 2010 22:53:11 +0000 (22:53 +0000)
mnet/environment.php
mnet/lib.php

index e4f6f6f800452f46d0f719de45f333560e2a3c2c..5cc649b2e91383e385d5734a385a0624d11cc8cd 100644 (file)
@@ -70,7 +70,7 @@ class mnet_environment {
         if (!empty($this->keypair)) return true;
 
         $this->keypair = array();
-        $keypair = $DB->get_field('config_plugins', 'value', array('plugin'=>'mnet', 'name'=>'openssl'));
+        $keypair = get_config('mnet', 'openssl');
 
         if (!empty($keypair)) {
             // Explode/Implode is faster than Unserialize/Serialize
@@ -84,7 +84,7 @@ class mnet_environment {
             // Key generation/rotation
 
             // 1. Archive the current key (if there is one).
-            $result = $DB->get_field('config_plugins', 'value', array('plugin'=>'mnet', 'name'=>'openssl_history'));
+            $result = get_config('mnet', 'openssl_history');
             if(empty($result)) {
                 set_config('openssl_history', serialize(array()), 'mnet');
                 $openssl_history = array();
@@ -99,7 +99,7 @@ class mnet_environment {
 
             // 2. How many old keys do we want to keep? Use array_slice to get
             // rid of any we don't want
-            $openssl_generations = $DB->get_field('config_plugins', 'value', array('plugin'=>'mnet', 'name'=>'openssl_generations'));
+            $openssl_generations = get_config('mnet', 'openssl_generations');
             if(empty($openssl_generations)) {
                 set_config('openssl_generations', 3, 'mnet');
                 $openssl_generations = 3;
index 4a02505e8ed16121f494bed158234353aa1072a2..f56e9d3769a90de9f0d65f7c3b7fc7adf6d6517f 100644 (file)
@@ -314,7 +314,7 @@ function mnet_get_keypair() {
     global $CFG, $DB;;
     static $keypair = null;
     if (!is_null($keypair)) return $keypair;
-    if ($result = $DB->get_field('config_plugins', 'value', array('plugin'=>'mnet', 'name'=>'openssl'))) {
+    if ($result = get_config('mnet', 'openssl')) {
         list($keypair['certificate'], $keypair['keypair_PEM']) = explode('@@@@@@@@', $result);
         $keypair['privatekey'] = openssl_pkey_get_private($keypair['keypair_PEM']);
         $keypair['publickey']  = openssl_pkey_get_public($keypair['certificate']);