use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Core\Worker;
+use Friendica\Database\DBA;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
function get_theme_config_file($theme)
{
$a = get_app();
- $base_theme = $a->theme_info['extends'];
+ $base_theme = defaults($a->theme_info, 'extends');
if (file_exists("view/theme/$theme/config.php")) {
return "view/theme/$theme/config.php";
}
- if (file_exists("view/theme/$base_theme/config.php")) {
+ if ($base_theme && file_exists("view/theme/$base_theme/config.php")) {
return "view/theme/$base_theme/config.php";
}
return null;
check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
$key = $_POST['remove'];
- dba::delete('tokens', ['id' => $key, 'uid' => local_user()]);
+ DBA::delete('tokens', ['id' => $key, 'uid' => local_user()]);
goaway(System::baseUrl(true)."/settings/oauth/");
return;
}
intval(local_user())
);
if (!DBM::is_result($r)) {
- dba::insert('mailacct', ['uid' => local_user()]);
+ DBA::insert('mailacct', ['uid' => local_user()]);
}
if (strlen($mail_pass)) {
$pass = '';
openssl_public_encrypt($mail_pass, $pass, $a->user['pubkey']);
- dba::update('mailacct', ['pass' => bin2hex($pass)], ['uid' => local_user()]);
+ DBA::update('mailacct', ['pass' => bin2hex($pass)], ['uid' => local_user()]);
}
$r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s',
`action` = %d, `movetofolder` = '%s',
$err .= L10n::t('Invalid email.');
}
// ensure new email is not the admin mail
- //if ((x($a->config, 'admin_email')) && (strcasecmp($email, $a->config['admin_email']) == 0)) {
- if (x($a->config, 'admin_email')) {
- $adminlist = explode(",", str_replace(" ", "", strtolower($a->config['admin_email'])));
+ if (Config::get('config', 'admin_email')) {
+ $adminlist = explode(",", str_replace(" ", "", strtolower(Config::get('config', 'admin_email'))));
if (in_array(strtolower($email), $adminlist)) {
$err .= L10n::t('Cannot change to that email.');
$email = $a->user['email'];
if (($a->argc > 3) && ($a->argv[2] === 'delete')) {
check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth', 't');
- dba::delete('clients', ['client_id' => $a->argv[3], 'uid' => local_user()]);
+ DBA::delete('clients', ['client_id' => $a->argv[3], 'uid' => local_user()]);
goaway(System::baseUrl(true)."/settings/oauth/");
return;
}
* ACCOUNT SETTINGS
*/
- $profile = dba::selectFirst('profile', [], ['is-default' => true, 'uid' => local_user()]);
+ $profile = DBA::selectFirst('profile', [], ['is-default' => true, 'uid' => local_user()]);
if (!DBM::is_result($profile)) {
notice(L10n::t('Unable to find your profile. Please contact your admin.') . EOL);
return;
// Private/public post links for the non-JS ACL form
$private_post = 1;
- if ($_REQUEST['public']) {
+ if (!empty($_REQUEST['public']) && !$_REQUEST['public']) {
$private_post = 0;
}