mirror of
https://github.com/friendica/friendica
synced 2025-04-25 09:50:11 +00:00
parent
6189f6c8e7
commit
4ca68c7af0
151 changed files with 987 additions and 8742 deletions
|
@ -16,6 +16,7 @@ use Friendica\App;
|
|||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Network\Probe;
|
||||
|
||||
require_once 'include/enotify.php';
|
||||
|
@ -95,7 +96,7 @@ function dfrn_request_post(App $a) {
|
|||
dbesc(normalise_link($dfrn_url))
|
||||
);
|
||||
|
||||
if (dbm::is_result($r)) {
|
||||
if (DBM::is_result($r)) {
|
||||
if(strlen($r[0]['dfrn-id'])) {
|
||||
|
||||
/*
|
||||
|
@ -149,7 +150,7 @@ function dfrn_request_post(App $a) {
|
|||
$photo = $parms["photo"];
|
||||
|
||||
// Escape the entire array
|
||||
dbm::esc_array($parms);
|
||||
DBM::esc_array($parms);
|
||||
|
||||
/*
|
||||
* Create a contact record on our site for the other person
|
||||
|
@ -189,7 +190,7 @@ function dfrn_request_post(App $a) {
|
|||
dbesc($dfrn_url),
|
||||
$parms['key'] // this was already escaped
|
||||
);
|
||||
if (dbm::is_result($r)) {
|
||||
if (DBM::is_result($r)) {
|
||||
$def_gid = get_default_group(local_user(), $r[0]["network"]);
|
||||
if(intval($def_gid))
|
||||
group_add_member(local_user(), '', $r[0]['id'], $def_gid);
|
||||
|
@ -280,7 +281,7 @@ function dfrn_request_post(App $a) {
|
|||
dbesc(datetime_convert('UTC','UTC','now - 24 hours')),
|
||||
intval($uid)
|
||||
);
|
||||
if (dbm::is_result($r) && count($r) > $maxreq) {
|
||||
if (DBM::is_result($r) && count($r) > $maxreq) {
|
||||
notice( sprintf( t('%s has received too many connection requests today.'), $a->profile['name']) . EOL);
|
||||
notice( t('Spam protection measures have been invoked.') . EOL);
|
||||
notice( t('Friends are advised to please try again in 24 hours.') . EOL);
|
||||
|
@ -302,7 +303,7 @@ function dfrn_request_post(App $a) {
|
|||
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE ",
|
||||
dbesc(NETWORK_MAIL2)
|
||||
);
|
||||
if (dbm::is_result($r)) {
|
||||
if (DBM::is_result($r)) {
|
||||
foreach ($r as $rr) {
|
||||
if(! $rr['rel']) {
|
||||
q("DELETE FROM `contact` WHERE `id` = %d AND NOT `self`",
|
||||
|
@ -327,7 +328,7 @@ function dfrn_request_post(App $a) {
|
|||
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 3 DAY ",
|
||||
dbesc(NETWORK_MAIL2)
|
||||
);
|
||||
if (dbm::is_result($r)) {
|
||||
if (DBM::is_result($r)) {
|
||||
foreach ($r as $rr) {
|
||||
if(! $rr['rel']) {
|
||||
q("DELETE FROM `contact` WHERE `id` = %d AND NOT `self`",
|
||||
|
@ -378,7 +379,7 @@ function dfrn_request_post(App $a) {
|
|||
intval($uid)
|
||||
);
|
||||
|
||||
if (! dbm::is_result($r)) {
|
||||
if (! DBM::is_result($r)) {
|
||||
notice( t('This account has not been configured for email. Request failed.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
@ -405,7 +406,7 @@ function dfrn_request_post(App $a) {
|
|||
dbesc($poll),
|
||||
intval($uid)
|
||||
);
|
||||
if (dbm::is_result($r)) {
|
||||
if (DBM::is_result($r)) {
|
||||
$contact_id = $r[0]['id'];
|
||||
|
||||
$def_gid = get_default_group($uid, $r[0]["network"]);
|
||||
|
@ -480,7 +481,7 @@ function dfrn_request_post(App $a) {
|
|||
dbesc($url)
|
||||
);
|
||||
|
||||
if (dbm::is_result($ret)) {
|
||||
if (DBM::is_result($ret)) {
|
||||
if(strlen($ret[0]['issued-id'])) {
|
||||
notice( t('You have already introduced yourself here.') . EOL );
|
||||
return;
|
||||
|
@ -552,7 +553,7 @@ function dfrn_request_post(App $a) {
|
|||
$parms['issued-id'] = $issued_id;
|
||||
$photo = $parms["photo"];
|
||||
|
||||
dbm::esc_array($parms);
|
||||
DBM::esc_array($parms);
|
||||
$r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `name`, `nick`, `issued-id`, `photo`, `site-pubkey`,
|
||||
`request`, `confirm`, `notify`, `poll`, `poco`, `network`, `blocked`, `pending` )
|
||||
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
|
||||
|
@ -584,7 +585,7 @@ function dfrn_request_post(App $a) {
|
|||
$parms['url'],
|
||||
$parms['issued-id']
|
||||
);
|
||||
if (dbm::is_result($r)) {
|
||||
if (DBM::is_result($r)) {
|
||||
$contact_record = $r[0];
|
||||
update_contact_avatar($photo, $uid, $contact_record["id"], true);
|
||||
}
|
||||
|
@ -735,7 +736,7 @@ function dfrn_request_content(App $a) {
|
|||
dbesc($_GET['confirm_key'])
|
||||
);
|
||||
|
||||
if (dbm::is_result($intro)) {
|
||||
if (DBM::is_result($intro)) {
|
||||
|
||||
$r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
||||
WHERE `contact`.`id` = %d LIMIT 1",
|
||||
|
@ -744,7 +745,7 @@ function dfrn_request_content(App $a) {
|
|||
|
||||
$auto_confirm = false;
|
||||
|
||||
if (dbm::is_result($r)) {
|
||||
if (DBM::is_result($r)) {
|
||||
if(($r[0]['page-flags'] != PAGE_NORMAL) && ($r[0]['page-flags'] != PAGE_PRVGROUP))
|
||||
$auto_confirm = true;
|
||||
|
||||
|
@ -861,7 +862,7 @@ function dfrn_request_content(App $a) {
|
|||
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
|
||||
intval($a->profile['uid'])
|
||||
);
|
||||
if (! dbm::is_result($r)) {
|
||||
if (! DBM::is_result($r)) {
|
||||
$mail_disabled = 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue