Bonne table variable lors de l'install

Corrige un bug dans variable_get
This commit is contained in:
Alan Garcia 2014-01-21 16:52:39 +00:00
parent 6aaeb039c2
commit f81924c72c
3 changed files with 12 additions and 17 deletions

View File

@ -44,7 +44,7 @@ if ($mem->user["lastfail"]) {
if (!empty($error) ) { echo "<p class='alert alert-danger'>$error</p>";$error=''; } if (!empty($error) ) { echo "<p class='alert alert-danger'>$error</p>";$error=''; }
$feed_url = variable_get('rss_feed'); $feed_url = variable_get('rss_feed', 0, 'This is an RSS feed that will be displayed on the users homepages when they log in. Set this to 0 or a "false" string to ignore.');
if (!empty($feed_url)) { if (!empty($feed_url)) {
$cache_time = 60*5; // 5 minutes $cache_time = 60*5; // 5 minutes
$cache_file = "/tmp/alterncpanel_cache_main.rss"; $cache_file = "/tmp/alterncpanel_cache_main.rss";

View File

@ -163,7 +163,7 @@ class m_variables {
if (isset($conf[$name])) { if (isset($conf[$name])) {
return $conf[$name]['value']; return $conf[$name]['value'];
} elseif (!is_null($createit_comment)) { } elseif (!is_null($createit_comment)) {
$this->variable_update_or_create($name, $value, 'DEFAULT', null, null, $createit_comment); $this->variable_update_or_create($name, $default, 'DEFAULT', null, null, $createit_comment);
} }
return $default; return $default;
} }

View File

@ -384,16 +384,18 @@ INSERT IGNORE INTO tld VALUES ('asia', 1);
-- --
-- Table structure for table 'variable' -- Table structure for table 'variable'
-- --
-- Taken from http://cvs.drupal.org/viewcvs/drupal/drupal/database/database.mysql?rev=1.164&view=auto
--
-- if comment is null, then the variable is internal and will not show -- if comment is null, then the variable is internal and will not show
-- up in the generic configuration panel -- up in the generic configuration panel
CREATE TABLE IF NOT EXISTS variable ( CREATE TABLE `variable` (
name varchar(48) NOT NULL default '', `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
value longtext NOT NULL, `name` varchar(48) NOT NULL DEFAULT '',
comment mediumtext NULL, `value` longtext NOT NULL,
PRIMARY KEY (name), `comment` mediumtext,
KEY name (name) `strata` enum('DEFAULT','GLOBAL','FQDN','FQDN_CREATOR','CREATOR','MEMBER','DOMAIN') NOT NULL DEFAULT 'DEFAULT',
`strata_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name_2` (`name`,`strata`,`strata_id`),
KEY `name` (`name`)
) ENGINE=MyISAM; ) ENGINE=MyISAM;
-- hosting_tld: only used, for now, in bureau/admin/adm_*add.php -- hosting_tld: only used, for now, in bureau/admin/adm_*add.php
@ -407,13 +409,6 @@ the domain "username.example.com".
If this is set to 0 or a "false" string, it will be ignored.'); If this is set to 0 or a "false" string, it will be ignored.');
INSERT IGNORE INTO `variable` (name, value, comment) VALUES ('rss_feed', 0,
'This is an RSS feed that will be displayed on the users homepages when
they log in. Set this to 0 or a "false" string to ignore.');
INSERT IGNORE INTO `variable` (name, value, comment) VALUES ('new_email', 0,
'An email will be sent to this address when new accounts are created if set.');
INSERT IGNORE INTO `variable` (name, value, comment) VALUES ('mailname_bounce', '', INSERT IGNORE INTO `variable` (name, value, comment) VALUES ('mailname_bounce', '',
'FQDN of the mail server, used to create vhost virtual mail_adress.'); 'FQDN of the mail server, used to create vhost virtual mail_adress.');