require_once('include/Probe.php');
require_once('include/group.php');
-function dfrn_request_init(App &$a) {
+function dfrn_request_init(App $a) {
if($a->argc > 1)
$which = $a->argv[1];
* After logging in, we click 'submit' to approve the linkage.
*
*/
-function dfrn_request_post(App &$a) {
+function dfrn_request_post(App $a) {
if(($a->argc != 2) || (! count($a->profile))) {
logger('Wrong count of argc or profiles: argc=' . $a->argc . ',profile()=' . count($a->profile));
$photo = $parms["photo"];
// Escape the entire array
-
- dbesc_array($parms);
-
+ dbm::esc_array($parms);
/*
* Create a contact record on our site for the other person
if (dbm::is_result($r)) {
foreach ($r as $rr) {
if(! $rr['rel']) {
- q("DELETE FROM `contact` WHERE `id` = %d",
+ q("DELETE FROM `contact` WHERE `id` = %d AND NOT `self`",
intval($rr['cid'])
);
}
if (dbm::is_result($r)) {
foreach ($r as $rr) {
if(! $rr['rel']) {
- q("DELETE FROM `contact` WHERE `id` = %d",
+ q("DELETE FROM `contact` WHERE `id` = %d AND NOT `self`",
intval($rr['cid'])
);
}
$parms['issued-id'] = $issued_id;
$photo = $parms["photo"];
- dbesc_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 )",
}
-function dfrn_request_content(App &$a) {
+function dfrn_request_content(App $a) {
if (($a->argc != 2) || (! count($a->profile))) {
return "";
// At first look if an address was provided
// Otherwise take the local address
- if (x($_GET,'addr') AND ($_GET['addr'] != ""))
+ if (x($_GET,'addr') AND ($_GET['addr'] != "")) {
$myaddr = hex2bin($_GET['addr']);
- elseif (x($_GET,'address') AND ($_GET['address'] != ""))
+ } elseif (x($_GET,'address') AND ($_GET['address'] != "")) {
$myaddr = $_GET['address'];
- elseif (local_user()) {
+ } elseif (local_user()) {
if (strlen($a->path)) {
$myaddr = App::get_baseurl() . '/profile/' . $a->user['nickname'];
- }
- else {
+ } else {
$myaddr = $a->user['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 );
}
- }
- else {
+ } else {
// last, try a zrl
$myaddr = get_my_url();
}
if ($a->profile['page-flags'] == PAGE_NORMAL) {
$tpl = get_markup_template('dfrn_request.tpl');
- }
- else {
+ } else {
$tpl = get_markup_template('auto_request.tpl');
}
// see if we are allowed to have NETWORK_MAIL2 contacts
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
- if(get_config('system','dfrn_only'))
+
+ if (get_config('system','dfrn_only')) {
$mail_disabled = 1;
+ }
- if(! $mail_disabled) {
+ if (! $mail_disabled) {
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval($a->profile['uid'])
);