* And still there are notices that have to be removed ...
* Notice removed in ACL part
* Fix missing fields for notifications
* Fixes issue 5630
$body = sprintf($body, System::baseUrl(), $user['email'], $result['password'], Config::get('config', 'sitename'));
notification([
- 'type' => SYSTEM_EMAIL,
+ 'type' => SYSTEM_EMAIL,
+ 'language' => $user['language'],
+ 'to_name' => $user['username'],
'to_email' => $user['email'],
- 'subject' => L10n::t('Registration details for %s', Config::get('config', 'sitename')),
+ 'uid' => $user['uid'],
+ 'subject' => L10n::t('Registration details for %s', Config::get('config', 'sitename')),
'preamble' => $preamble,
- 'body' => $body]);
+ 'body' => $body]);
}
if (x($_POST, 'page_users_block')) {
}
$condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
- $user = DBA::selectFirst('user', ['uid', 'username', 'email'], $condition);
+ $user = DBA::selectFirst('user', ['uid', 'username', 'email', 'language'], $condition);
if (!DBA::isResult($user)) {
notice(L10n::t('No valid account found.') . EOL);
goaway(System::baseUrl());
notification([
'type' => SYSTEM_EMAIL,
+ 'language' => $user['language'],
+ 'to_name' => $user['username'],
'to_email' => $user['email'],
'uid' => $user['uid'],
'subject' => L10n::t('Password reset requested at %s', $sitename),
if ($a->argc > 1) {
$pwdreset_token = $a->argv[1];
- $user = DBA::selectFirst('user', ['uid', 'username', 'email', 'pwdreset_time'], ['pwdreset' => $pwdreset_token]);
+ $user = DBA::selectFirst('user', ['uid', 'username', 'email', 'pwdreset_time', 'language'], ['pwdreset' => $pwdreset_token]);
if (!DBA::isResult($user)) {
notice(L10n::t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
notification([
'type' => SYSTEM_EMAIL,
+ 'language' => $user['language'],
+ 'to_name' => $user['username'],
'to_email' => $user['email'],
'uid' => $user['uid'],
'subject' => L10n::t('Your password has been changed at %s', $sitename),
'allow_location' => $a->user['allow_location'],
'default_location' => $a->user['default-location'],
'nickname' => $a->user['nickname'],
- 'lockstate' => (((is_array($a->user) &&
- ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) ||
- (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
+ 'lockstate' => (is_array($a->user) &&
+ (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) ||
+ strlen($a->user['deny_cid']) || strlen($a->user['deny_gid'])) ? 'lock' : 'unlock'),
'default_perms' => ACL::getDefaultUserPermissions($a->user),
'acl' => ACL::getFullSelectorHTML($a->user, true),
'bang' => '',
'allow_location' => $a->user['allow_location'],
'default_location' => $a->user['default-location'],
'nickname' => $a->user['nickname'],
- 'lockstate' => ((($gid) || ($cid) || ($nets) || (is_array($a->user) &&
- ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) ||
- (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
+ 'lockstate' => ($gid || $cid || $nets || (is_array($a->user) &&
+ (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) ||
+ strlen($a->user['deny_cid']) || strlen($a->user['deny_gid']))) ? 'lock' : 'unlock'),
'default_perms' => ACL::getDefaultUserPermissions($a->user),
'acl' => ACL::getFullSelectorHTML($a->user, true, $default_permissions),
'bang' => (($gid || $cid || $nets) ? '!' : ''),
$notif_tpl = get_markup_template('notifications.tpl');
+ if (!isset($notifs['ident'])) {
+ logger('Missing data in notifs: ' . System::callstack(20), LOGGER_DEBUG);
+ }
+
// Process the data for template creation
if ($notifs['ident'] === 'introductions') {
$sugg = get_markup_template('suggestions.tpl');
// send email to admins
$admin_mails = explode(",", str_replace(" ", "", Config::get('config', 'admin_email')));
foreach ($admin_mails as $mail) {
- $admin = DBA::selectFirst('user', ['uid', 'language', 'email'], ['email' => $mail]);
+ $admin = DBA::selectFirst('user', ['uid', 'language', 'email', 'username'], ['email' => $mail]);
if (!DBA::isResult($admin)) {
continue;
}
'preamble' => L10n::t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'),
'body' => L10n::t('The user id is %d', local_user()),
'to_email' => $admin['email'],
+ 'to_name' => $admin['username'],
'uid' => $admin['uid'],
'language' => $admin['language'] ? $admin['language'] : 'en',
'show_in_notification_page' => false
function viewcontacts_init(App $a)
{
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
- return;
+ System::httpExit(403, ["title" => L10n::t('Access denied.')]);
}
if ($a->argc < 2) {
);
if (!DBA::isResult($r)) {
- return;
+ System::httpExit(404, ["title" => L10n::t('Page not found.')]);
}
$a->data['user'] = $r[0];
function xrd_init(App $a)
{
if ($a->argv[0] == 'xrd') {
+ if (empty($_GET['uri'])) {
+ killme();
+ }
+
$uri = urldecode(notags(trim($_GET['uri'])));
if (defaults($_SERVER, 'HTTP_ACCEPT', '') == 'application/jrd+json') {
$mode = 'json';
$mode = 'xml';
}
} else {
+ if (empty($_GET['resource'])) {
+ killme();
+ }
+
$uri = urldecode(notags(trim($_GET['resource'])));
if (defaults($_SERVER, 'HTTP_ACCEPT', '') == 'application/xrd+xml') {
$mode = 'xml';
}
}
- return trim($data["text"] . ' ' . $return . ' ' . $data["after"]);
+ return trim(defaults($data, 'text', '') . ' ' . $return . ' ' . defaults($data, 'after', ''));
}
public static function removeShareInformation($Text, $plaintext = false, $nolink = false)
'$showall' => L10n::t('Visible to everybody'),
'$show' => L10n::t('show'),
'$hide' => L10n::t('don\'t show'),
- '$allowcid' => json_encode($default_permissions['allow_cid']),
- '$allowgid' => json_encode($default_permissions['allow_gid']),
- '$denycid' => json_encode($default_permissions['deny_cid']),
- '$denygid' => json_encode($default_permissions['deny_gid']),
+ '$allowcid' => json_encode(defaults($default_permissions, 'allow_cid', '')),
+ '$allowgid' => json_encode(defaults($default_permissions, 'allow_gid', '')),
+ '$denycid' => json_encode(defaults($default_permissions, 'deny_cid', '')),
+ '$denygid' => json_encode(defaults($default_permissions, 'deny_gid', '')),
'$networks' => $show_jotnets,
'$emailcc' => L10n::t('CC: email addresses'),
'$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'),
*/
public static function contactAutocomplete($search, $mode)
{
- if ((Config::get('system', 'block_public')) && (!local_user()) && (!remote_user())) {
+ if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
return [];
}
{
if (!isset($contact['url'])) {
- logger('Empty contact. ' . System::callstack(10), LOGGER_DEBUG);
+ logger('Empty contact: ' . json_encode($contact) . ' - ' . System::callstack(20), LOGGER_DEBUG);
}
// Contact already archived or "self" contact? => nothing to do