*/
use Friendica\App;
-
-require_once 'include/Emailer.php';
+use Friendica\Core\PConfig;
+use Friendica\Util\Emailer;
/* because the fraking openpgp-php is in composer, require libs in composer
* and then don't use autoloader to load classes... */
return;
}
- $enable = intval(get_pconfig(local_user(), 'securemail', 'enable'));
- $publickey = get_pconfig(local_user(), 'securemail', 'pkey');
+ $enable = intval(PConfig::get(local_user(), 'securemail', 'enable'));
+ $publickey = PConfig::get(local_user(), 'securemail', 'pkey');
$t = get_markup_template('admin.tpl', 'addon/securemail/');
}
if ($_POST['securemail-submit']) {
- set_pconfig(local_user(), 'securemail', 'pkey', trim($_POST['securemail-pkey']));
+ PConfig::set(local_user(), 'securemail', 'pkey', trim($_POST['securemail-pkey']));
$enable = ((x($_POST, 'securemail-enable')) ? 1 : 0);
- set_pconfig(local_user(), 'securemail', 'enable', $enable);
+ PConfig::set(local_user(), 'securemail', 'enable', $enable);
info(t('Secure Mail Settings saved.') . EOL);
if ($_POST['securemail-submit'] == t('Save and send test')) {
);
// enable addon for test
- set_pconfig(local_user(), 'securemail', 'enable', 1);
+ PConfig::set(local_user(), 'securemail', 'enable', 1);
$res = Emailer::send($params);
// revert to saved value
- set_pconfig(local_user(), 'securemail', 'enable', $enable);
+ PConfig::set(local_user(), 'securemail', 'enable', $enable);
if ($res) {
info(t('Test email sent') . EOL);
$uid = $b['uid'];
- $enable_checked = get_pconfig($uid, 'securemail', 'enable');
+ $enable_checked = PConfig::get($uid, 'securemail', 'enable');
if (!$enable_checked) {
return;
}
- $public_key_ascii = get_pconfig($uid, 'securemail', 'pkey');
+ $public_key_ascii = PConfig::get($uid, 'securemail', 'pkey');
preg_match('/-----BEGIN ([A-Za-z ]+)-----/', $public_key_ascii, $matches);
$marker = (empty($matches[1])) ? 'MESSAGE' : $matches[1];