mirror of
https://github.com/friendica/friendica
synced 2025-04-23 19:50:11 +00:00
Rename DBM method calls to DBA method calls
This commit is contained in:
parent
8ddb94ef06
commit
0ec44f3e8a
153 changed files with 813 additions and 918 deletions
|
@ -17,7 +17,6 @@ use Friendica\Core\Config;
|
|||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Group;
|
||||
use Friendica\Model\Profile;
|
||||
|
@ -88,7 +87,7 @@ function dfrn_request_post(App $a)
|
|||
dbesc(normalise_link($dfrn_url))
|
||||
);
|
||||
|
||||
if (DBM::is_result($r)) {
|
||||
if (DBA::is_result($r)) {
|
||||
if (strlen($r[0]['dfrn-id'])) {
|
||||
// We don't need to be here. It has already happened.
|
||||
notice(L10n::t("This introduction has already been accepted.") . EOL);
|
||||
|
@ -130,7 +129,7 @@ function dfrn_request_post(App $a)
|
|||
$photo = $parms["photo"];
|
||||
|
||||
// Escape the entire array
|
||||
DBM::esc_array($parms);
|
||||
DBA::esc_array($parms);
|
||||
|
||||
// Create a contact record on our site for the other person
|
||||
$r = q("INSERT INTO `contact` ( `uid`, `created`,`url`, `nurl`, `addr`, `name`, `nick`, `photo`, `site-pubkey`,
|
||||
|
@ -167,7 +166,7 @@ function dfrn_request_post(App $a)
|
|||
dbesc($dfrn_url),
|
||||
$parms['key'] // this was already escaped
|
||||
);
|
||||
if (DBM::is_result($r)) {
|
||||
if (DBA::is_result($r)) {
|
||||
Group::addMember(User::getDefaultGroup(local_user(), $r[0]["network"]), $r[0]['id']);
|
||||
|
||||
if (isset($photo)) {
|
||||
|
@ -243,7 +242,7 @@ function dfrn_request_post(App $a)
|
|||
dbesc(DateTimeFormat::utc('now - 24 hours')),
|
||||
intval($uid)
|
||||
);
|
||||
if (DBM::is_result($r) && count($r) > $maxreq) {
|
||||
if (DBA::is_result($r) && count($r) > $maxreq) {
|
||||
notice(L10n::t('%s has received too many connection requests today.', $a->profile['name']) . EOL);
|
||||
notice(L10n::t('Spam protection measures have been invoked.') . EOL);
|
||||
notice(L10n::t('Friends are advised to please try again in 24 hours.') . EOL);
|
||||
|
@ -259,7 +258,7 @@ function dfrn_request_post(App $a)
|
|||
WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
|
||||
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE "
|
||||
);
|
||||
if (DBM::is_result($r)) {
|
||||
if (DBA::is_result($r)) {
|
||||
foreach ($r as $rr) {
|
||||
if (!$rr['rel']) {
|
||||
DBA::delete('contact', ['id' => $rr['cid'], 'self' => false]);
|
||||
|
@ -306,7 +305,7 @@ function dfrn_request_post(App $a)
|
|||
dbesc($url)
|
||||
);
|
||||
|
||||
if (DBM::is_result($ret)) {
|
||||
if (DBA::is_result($ret)) {
|
||||
if (strlen($ret[0]['issued-id'])) {
|
||||
notice(L10n::t('You have already introduced yourself here.') . EOL);
|
||||
return;
|
||||
|
@ -372,7 +371,7 @@ function dfrn_request_post(App $a)
|
|||
$parms['issued-id'] = $issued_id;
|
||||
$photo = $parms["photo"];
|
||||
|
||||
DBM::esc_array($parms);
|
||||
DBA::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 )",
|
||||
|
@ -404,7 +403,7 @@ function dfrn_request_post(App $a)
|
|||
$parms['url'],
|
||||
$parms['issued-id']
|
||||
);
|
||||
if (DBM::is_result($r)) {
|
||||
if (DBA::is_result($r)) {
|
||||
$contact_record = $r[0];
|
||||
Contact::updateAvatar($photo, $uid, $contact_record["id"], true);
|
||||
}
|
||||
|
@ -538,7 +537,7 @@ function dfrn_request_content(App $a)
|
|||
dbesc($_GET['confirm_key'])
|
||||
);
|
||||
|
||||
if (DBM::is_result($intro)) {
|
||||
if (DBA::is_result($intro)) {
|
||||
$r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
||||
WHERE `contact`.`id` = %d LIMIT 1",
|
||||
intval($intro[0]['contact-id'])
|
||||
|
@ -546,7 +545,7 @@ function dfrn_request_content(App $a)
|
|||
|
||||
$auto_confirm = false;
|
||||
|
||||
if (DBM::is_result($r)) {
|
||||
if (DBA::is_result($r)) {
|
||||
if ($r[0]['page-flags'] != PAGE_NORMAL && $r[0]['page-flags'] != PAGE_PRVGROUP) {
|
||||
$auto_confirm = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue