]> git.mjollnir.org Git - moodle.git/commitdiff
Added new settings supportname and supportemail MDL-10529 Admin is no longer to...
authormoodler <moodler>
Wed, 1 Aug 2007 08:05:55 +0000 (08:05 +0000)
committermoodler <moodler>
Wed, 1 Aug 2007 08:05:55 +0000 (08:05 +0000)
admin/settings/server.php
lib/db/upgrade.php
version.php

index 90b4ae7239af3aa4ff5b35e9b14a620dc5c25819..3189ba1000901cfa5319e3eb4ba94eaf82c80507 100644 (file)
@@ -54,6 +54,8 @@ $options['0'] = get_string('none');
 $options = array_merge($options, $charsets);
 $temp->add(new admin_setting_configselect('sitemailcharset', get_string('sitemailcharset', 'admin'), get_string('configsitemailcharset','admin'), '', $options));
 $temp->add(new admin_setting_configcheckbox('allowusermailcharset', get_string('allowusermailcharset', 'admin'), get_string('configallowusermailcharset', 'admin'), 0));
+$temp->add(new admin_setting_configtext('supportname', get_string('supportname', 'admin'), get_string('configsupportname', 'admin'), '', PARAM_NOTAGS));
+$temp->add(new admin_setting_configtext('supportemail', get_string('supportemail', 'admin'), get_string('configsupportemail', 'admin'), '', PARAM_NOTAGS));
 $ADMIN->add('server', $temp, 100);
 
 
index ad696fb93b7c0642824b05b373345227b9d44210..cebffb07483644fb3aa746f7d8de9d69649e7d2a 100644 (file)
@@ -1566,6 +1566,13 @@ function xmldb_main_upgrade($oldversion=0) {
         $result = $result && add_key($table, $key);
     }
 
+    if ($result && $oldversion < 2007080101) {
+        if ($firstadmin = get_admin()) {  // the person currently used for support emails
+            set_config('supportname',  s(fullname($firstadmin)));   // New settings same as old
+            set_config('supportemail',  s($firstadmin->email));
+        }
+    }
+
 /*
     /// drop old gradebook tables
     if ($result && $oldversion < 2007072209) {
index 4639b699d6cd9a2daa5a9480698d7c564529d358..af7355132d16f4f9e2721c6121a2e11ce541a35e 100644 (file)
@@ -6,7 +6,7 @@
 // This is compared against the values stored in the database to determine
 // whether upgrades should be performed (see lib/db/*.php)
 
-    $version = 2007080100;  // YYYYMMDD = date
+    $version = 2007080101;  // YYYYMMDD = date
                             //       XY = increments within a single day
 
     $release = '1.9 dev';   // Human-friendly version name