$begindate = trim($_POST['startdate']);
$enddate = trim($_POST['enddate']);
$url = trim($_POST['rurl']);
- Config::set('blackout','begindate',$begindate);
- Config::set('blackout','enddate',$enddate);
- Config::set('blackout','url',$url);
+ DI::config()->set('blackout','begindate',$begindate);
+ DI::config()->set('blackout','enddate',$enddate);
+ DI::config()->set('blackout','url',$url);
}
}
function blockbot_addon_admin_post(&$a) {
- Config::set('blockbot', 'good_crawlers', $_POST['good_crawlers'] ?? false);
- Config::set('blockbot', 'block_gab', $_POST['block_gab'] ?? false);
- Config::set('blockbot', 'training', $_POST['training'] ?? false);
+ DI::config()->set('blockbot', 'good_crawlers', $_POST['good_crawlers'] ?? false);
+ DI::config()->set('blockbot', 'block_gab', $_POST['block_gab'] ?? false);
+ DI::config()->set('blockbot', 'training', $_POST['training'] ?? false);
info(DI::l10n()->t('Settings updated.'). EOL);
}
$client_id = (!empty($_POST['client_id']) ? Strings::escapeTags(trim($_POST['client_id'])) : '');
$client_secret = (!empty($_POST['client_secret']) ? Strings::escapeTags(trim($_POST['client_secret'])) : '');
- Config::set('buffer', 'client_id' , $client_id);
- Config::set('buffer', 'client_secret', $client_secret);
+ DI::config()->set('buffer', 'client_id' , $client_id);
+ DI::config()->set('buffer', 'client_secret', $client_secret);
info(DI::l10n()->t('Settings updated.'). EOL);
}
}
if ($_POST['cookienotice-submit']) {
- Config::set('cookienotice', 'text', trim(strip_tags($_POST['cookienotice-text'])));
- Config::set('cookienotice', 'oktext', trim(strip_tags($_POST['cookienotice-oktext'])));
+ DI::config()->set('cookienotice', 'text', trim(strip_tags($_POST['cookienotice-text'])));
+ DI::config()->set('cookienotice', 'oktext', trim(strip_tags($_POST['cookienotice-oktext'])));
info(DI::l10n()->t('cookienotice Settings saved.'));
}
}
}
if (!empty($_POST['curweather-submit'])) {
- Config::set('curweather', 'appid', trim($_POST['appid']));
- Config::set('curweather', 'cachetime', trim($_POST['cachetime']));
+ DI::config()->set('curweather', 'appid', trim($_POST['appid']));
+ DI::config()->set('curweather', 'cachetime', trim($_POST['cachetime']));
info(DI::l10n()->t('Curweather settings saved.' . PHP_EOL));
}
function geocoordinates_addon_admin_post(&$a)
{
$api_key = (!empty($_POST['api_key']) ? Strings::escapeTags(trim($_POST['api_key'])) : '');
- Config::set('geocoordinates', 'api_key', $api_key);
+ DI::config()->set('geocoordinates', 'api_key', $api_key);
$language = (!empty($_POST['language']) ? Strings::escapeTags(trim($_POST['language'])) : '');
- Config::set('geocoordinates', 'language', $language);
+ DI::config()->set('geocoordinates', 'language', $language);
info(DI::l10n()->t('Settings updated.') . EOL);
}
$default_avatar = (!empty($_POST['avatar']) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon');
$rating = (!empty($_POST['rating']) ? Strings::escapeTags(trim($_POST['rating'])) : 'g');
- Config::set('gravatar', 'default_avatar', $default_avatar);
- Config::set('gravatar', 'rating', $rating);
+ DI::config()->set('gravatar', 'default_avatar', $default_avatar);
+ DI::config()->set('gravatar', 'rating', $rating);
info(DI::l10n()->t('Gravatar settings updated.') .EOL);
}
$notes = (!empty($_POST['notes']) ? (trim($_POST['notes'])) : '');
$email = (!empty($_POST['email']) ? Strings::escapeTags(trim($_POST['email'])) : '');
$footer_text = (!empty($_POST['footer_text']) ? (trim($_POST['footer_text'])) : '');
- Config::set('impressum','owner',strip_tags($owner));
- Config::set('impressum','ownerprofile',strip_tags($ownerprofile));
- Config::set('impressum','postal',strip_tags($postal));
- Config::set('impressum','email',strip_tags($email));
- Config::set('impressum','notes',strip_tags($notes));
- Config::set('impressum','footer_text',strip_tags($footer_text));
+ DI::config()->set('impressum','owner',strip_tags($owner));
+ DI::config()->set('impressum','ownerprofile',strip_tags($ownerprofile));
+ DI::config()->set('impressum','postal',strip_tags($postal));
+ DI::config()->set('impressum','email',strip_tags($email));
+ DI::config()->set('impressum','notes',strip_tags($notes));
+ DI::config()->set('impressum','footer_text',strip_tags($footer_text));
info(DI::l10n()->t('Settings updated.'). EOL );
}
function impressum_addon_admin (&$a, &$o) {
return;
if($_POST['irc-submit']) {
- Config::set('irc','autochans',trim($_POST['autochans']));
- Config::set('irc','sitechats',trim($_POST['sitechats']));
+ DI::config()->set('irc','autochans',trim($_POST['autochans']));
+ DI::config()->set('irc','sitechats',trim($_POST['sitechats']));
/* stupid pop-up thing */
info(DI::l10n()->t('IRC settings saved.') . EOL);
}
// set standard configuration
$info_text = DI::config()->get("jappixmini", "infotext");
if (!$info_text)
- Config::set("jappixmini", "infotext", "To get the chat working, you need to know a BOSH host which works with your Jabber account. " .
+ DI::config()->set("jappixmini", "infotext", "To get the chat working, you need to know a BOSH host which works with your Jabber account. " .
"An example of a BOSH server that works for all accounts is https://bind.jappix.com/, but keep " .
"in mind that the BOSH server can read along all chat messages. If you know that your Jabber " .
"server also provides an own BOSH server, it is much better to use this one!"
$bosh_proxy = DI::config()->get("jappixmini", "bosh_proxy");
if ($bosh_proxy === "") {
- Config::set("jappixmini", "bosh_proxy", "1");
+ DI::config()->set("jappixmini", "bosh_proxy", "1");
}
// set addon version so that safe updates are possible later
$addon_version = DI::config()->get("jappixmini", "version");
if ($addon_version === "") {
- Config::set("jappixmini", "version", "1");
+ DI::config()->set("jappixmini", "version", "1");
}
}
$default_user = intval($_REQUEST['jappixmini-defaultuser']);
$bosh_address = $_REQUEST['jappixmini-address'];
$default_server = $_REQUEST['jappixmini-server'];
- Config::set("jappixmini", "infotext", $info_text);
- Config::set("jappixmini", "bosh_proxy", $bosh_proxy);
- Config::set("jappixmini", "bosh_address", $bosh_address);
- Config::set("jappixmini", "default_server", $default_server);
- Config::set("jappixmini", "default_user", $default_user);
+ DI::config()->set("jappixmini", "infotext", $info_text);
+ DI::config()->set("jappixmini", "bosh_proxy", $bosh_proxy);
+ DI::config()->set("jappixmini", "bosh_address", $bosh_address);
+ DI::config()->set("jappixmini", "default_server", $default_server);
+ DI::config()->set("jappixmini", "default_user", $default_user);
}
}
function jappixmini_cron(App $a, $d)
{
// For autosubscribe/autoapprove, we need to maintain a list of jabber addresses of our contacts.
- Config::set("jappixmini", "last_cron_execution", $d);
+ DI::config()->set("jappixmini", "last_cron_execution", $d);
// go through list of users with jabber enabled
$users = q("SELECT `uid` FROM `pconfig` WHERE `cat`='jappixmini' AND (`k`='autosubscribe' OR `k`='autoapprove') AND `v`='1'");
*/
if (sizeof($sites)) {
- Config::set('leistungsschutzrecht','sites',$sites);
+ DI::config()->set('leistungsschutzrecht','sites',$sites);
}
}
}
}
leistungsschutzrecht_fetchsites();
- Config::set('leistungsschutzrecht','last_poll', time());
+ DI::config()->set('leistungsschutzrecht','last_poll', time());
}
?>
BaseModule::checkFormSecurityToken('libravatarrsave');
$default_avatar = (!empty($_POST['avatar']) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon');
- Config::set('libravatar', 'default_avatar', $default_avatar);
+ DI::config()->set('libravatar', 'default_avatar', $default_avatar);
info(DI::l10n()->t('Libravatar settings updated.') .EOL);
}
q('ALTER TABLE `mailstream_item` DROP INDEX `contact-id`');
q('ALTER TABLE `mailstream_item` DROP INDEX `plink`');
q('ALTER TABLE `mailstream_item` CHANGE `plink` `uri` char(255) NOT NULL');
- Config::set('mailstream', 'dbversion', '0.2');
+ DI::config()->set('mailstream', 'dbversion', '0.2');
}
if (DI::config()->get('mailstream', 'dbversion') == '0.2') {
q('DELETE FROM `pconfig` WHERE `cat` = "mailstream" AND `k` = "delay"');
- Config::set('mailstream', 'dbversion', '0.3');
+ DI::config()->set('mailstream', 'dbversion', '0.3');
}
if (DI::config()->get('mailstream', 'dbversion') == '0.3') {
q('ALTER TABLE `mailstream_item` CHANGE `created` `created` timestamp NOT NULL DEFAULT now()');
q('ALTER TABLE `mailstream_item` CHANGE `completed` `completed` timestamp NULL DEFAULT NULL');
- Config::set('mailstream', 'dbversion', '0.4');
+ DI::config()->set('mailstream', 'dbversion', '0.4');
}
if (DI::config()->get('mailstream', 'dbversion') == '0.4') {
q('ALTER TABLE `mailstream_item` CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin');
- Config::set('mailstream', 'dbversion', '0.5');
+ DI::config()->set('mailstream', 'dbversion', '0.5');
}
if (DI::config()->get('mailstream', 'dbversion') == '0.5') {
- Config::set('mailstream', 'dbversion', '1.0');
+ DI::config()->set('mailstream', 'dbversion', '1.0');
}
if (DI::config()->get('retriever', 'dbversion') != '1.0') {
foreach ($arr as $a) {
$r = q($a);
}
- Config::set('mailstream', 'dbversion', '1.0');
+ DI::config()->set('mailstream', 'dbversion', '1.0');
}
}
function mailstream_addon_admin_post ($a) {
if (!empty($_POST['frommail'])) {
- Config::set('mailstream', 'frommail', $_POST['frommail']);
+ DI::config()->set('mailstream', 'frommail', $_POST['frommail']);
}
}
$lsn = (!empty($_POST['localsupportname']) ? Strings::escapeTags(trim($_POST['localsupportname'])) : "");
$gs = intval($_POST['linkglobalsupport']);
$ls = intval($_POST['linklocalsupport']);
- Config::set('newmemberwidget', 'freetext', trim($ft));
- Config::set('newmemberwidget', 'linkglobalsupport', $gs);
- Config::set('newmemberwidget', 'linklocalsupport', $ls);
- Config::set('newmemberwidget', 'localsupport', trim($lsn));
+ DI::config()->set('newmemberwidget', 'freetext', trim($ft));
+ DI::config()->set('newmemberwidget', 'linkglobalsupport', $gs);
+ DI::config()->set('newmemberwidget', 'linklocalsupport', $ls);
+ DI::config()->set('newmemberwidget', 'localsupport', trim($lsn));
}
function newmemberwidget_addon_admin(&$a, &$o)
$zoom = ($_POST['zoom'] ?? '') ?: OSM_ZOOM;
$marker = ($_POST['marker'] ?? '') ?: OSM_MARKER;
- Config::set('openstreetmap', 'tmsserver', $urltms);
- Config::set('openstreetmap', 'nomserver', $urlnom);
- Config::set('openstreetmap', 'zoom', $zoom);
- Config::set('openstreetmap', 'marker', $marker);
+ DI::config()->set('openstreetmap', 'tmsserver', $urltms);
+ DI::config()->set('openstreetmap', 'nomserver', $urlnom);
+ DI::config()->set('openstreetmap', 'zoom', $zoom);
+ DI::config()->set('openstreetmap', 'marker', $marker);
info(DI::l10n()->t('Settings updated.') . EOL);
}
if(!empty($_POST['pageheader-submit'])) {
if (isset($_POST['pageheader-words'])) {
- Config::set('pageheader', 'text', trim(strip_tags($_POST['pageheader-words'])));
+ DI::config()->set('pageheader', 'text', trim(strip_tags($_POST['pageheader-words'])));
}
info(DI::l10n()->t('pageheader Settings saved.'));
}
$id = (!empty($_POST['siteid']) ? trim($_POST['siteid']) : '');
$optout = (!empty($_POST['optout']) ? trim($_POST['optout']) : '');
$async = (!empty($_POST['async']) ? trim($_POST['async']) : '');
- Config::set('piwik', 'baseurl', $url);
- Config::set('piwik', 'siteid', $id);
- Config::set('piwik', 'optout', $optout);
- Config::set('piwik', 'async', $async);
+ DI::config()->set('piwik', 'baseurl', $url);
+ DI::config()->set('piwik', 'siteid', $id);
+ DI::config()->set('piwik', 'optout', $optout);
+ DI::config()->set('piwik', 'async', $async);
info(DI::l10n()->t('Settings updated.'). EOL);
}
$flagusers = (!empty($_POST['flagusers']) ? Strings::escapeTags(trim($_POST['flagusers'])) : '');
$flagposts = (!empty($_POST['flagposts']) ? Strings::escapeTags(trim($_POST['flagposts'])) : '');
$flagpostsexpire = (!empty($_POST['flagpostsexpire']) ? Strings::escapeTags(trim($_POST['flagpostsexpire'])) : '');
- Config::set('public_server', 'expiredays', $expiredays);
- Config::set('public_server', 'expireposts', $expireposts);
- Config::set('public_server', 'nologin', $nologin);
- Config::set('public_server', 'flagusers', $flagusers);
- Config::set('public_server', 'flagposts', $flagposts);
- Config::set('public_server', 'flagpostsexpire', $flagpostsexpire);
+ DI::config()->set('public_server', 'expiredays', $expiredays);
+ DI::config()->set('public_server', 'expireposts', $expireposts);
+ DI::config()->set('public_server', 'nologin', $nologin);
+ DI::config()->set('public_server', 'flagusers', $flagusers);
+ DI::config()->set('public_server', 'flagposts', $flagposts);
+ DI::config()->set('public_server', 'flagpostsexpire', $flagpostsexpire);
info(DI::l10n()->t('Settings saved').EOL);
}
Logger::log('pumpio: cron_end');
- Config::set('pumpio', 'last_poll', time());
+ DI::config()->set('pumpio', 'last_poll', time());
}
function pumpio_cron(App $a, $b)
function remote_permissions_addon_admin_post(&$a){
$choice = (!empty($_POST['remotepermschoice']) ? Strings::escapeTags(trim($_POST['remotepermschoice'])) : '');
- Config::set('remote_perms','global',($choice == 1 ? 1 : 0));
+ DI::config()->set('remote_perms','global',($choice == 1 ? 1 : 0));
info(DI::l10n()->t('Settings updated.'). EOL);
}
}
}
- $sites = Config::set('statusnet', 'sites', $sites);
+ $sites = DI::config()->set('statusnet', 'sites', $sites);
}
function statusnet_addon_admin(App $a, &$o)
Logger::log('statusnet: cron_end');
- Config::set('statusnet', 'last_poll', time());
+ DI::config()->set('statusnet', 'last_poll', time());
}
function statusnet_fetchtimeline(App $a, $uid)
$consumer_key = (!empty($_POST['consumer_key']) ? Strings::escapeTags(trim($_POST['consumer_key'])) : '');
$consumer_secret = (!empty($_POST['consumer_secret']) ? Strings::escapeTags(trim($_POST['consumer_secret'])): '');
- Config::set('tumblr', 'consumer_key',$consumer_key);
- Config::set('tumblr', 'consumer_secret',$consumer_secret);
+ DI::config()->set('tumblr', 'consumer_key',$consumer_key);
+ DI::config()->set('tumblr', 'consumer_secret',$consumer_secret);
info(DI::l10n()->t('Settings updated.'). EOL);
}
Logger::info('twitter_post send', ['id' => $b['id'], 'result' => $result]);
if (!empty($result->source)) {
- Config::set("twitter", "application_name", strip_tags($result->source));
+ DI::config()->set("twitter", "application_name", strip_tags($result->source));
}
if (!empty($result->errors)) {
{
$consumerkey = !empty($_POST['consumerkey']) ? Strings::escapeTags(trim($_POST['consumerkey'])) : '';
$consumersecret = !empty($_POST['consumersecret']) ? Strings::escapeTags(trim($_POST['consumersecret'])) : '';
- Config::set('twitter', 'consumerkey', $consumerkey);
- Config::set('twitter', 'consumersecret', $consumersecret);
+ DI::config()->set('twitter', 'consumerkey', $consumerkey);
+ DI::config()->set('twitter', 'consumersecret', $consumersecret);
info(DI::l10n()->t('Settings updated.') . EOL);
}
Logger::notice('twitter: cron_end');
- Config::set('twitter', 'last_poll', time());
+ DI::config()->set('twitter', 'last_poll', time());
}
function twitter_expire(App $a)
}
function webrtc_addon_admin_post (&$a) {
$url = (!empty($_POST['webrtcurl']) ? Strings::escapeTags(trim($_POST['webrtcurl'])) : '');
- Config::set('webrtc', 'webrtcurl', $url);
+ DI::config()->set('webrtc', 'webrtcurl', $url);
info(DI::l10n()->t('Settings updated.'). EOL);
}
$bosh_proxy = (!empty($_POST['bosh_proxy']) ? trim($_POST['bosh_proxy']) : '');
$central_userbase = (!empty($_POST['central_userbase']) ? intval($_POST['central_userbase']) : false);
- Config::set('xmpp', 'bosh_proxy', $bosh_proxy);
- Config::set('xmpp', 'central_userbase', $central_userbase);
+ DI::config()->set('xmpp', 'bosh_proxy', $bosh_proxy);
+ DI::config()->set('xmpp', 'central_userbase', $central_userbase);
info(DI::l10n()->t('Settings updated.') . EOL);
}