diff options
author | Vasudev Kamath <kamathvasudev@gmail.com> | 2012-04-27 22:43:26 +0530 |
---|---|---|
committer | Vasudev Kamath <kamathvasudev@gmail.com> | 2012-04-27 22:43:26 +0530 |
commit | 214ec91a3f2c5fec6cced93f669b3a9725f0e40a (patch) | |
tree | d05fd4c7e65cc89cf46d8347a2d0e6df135ed864 /mod/dfrn_request.php | |
parent | f1d84c10458986a0a014f844e784617401764b29 (diff) | |
parent | 4b92e3543c9af26e590cfecf561ff7483e66e6c9 (diff) | |
download | volse-hubzilla-214ec91a3f2c5fec6cced93f669b3a9725f0e40a.tar.gz volse-hubzilla-214ec91a3f2c5fec6cced93f669b3a9725f0e40a.tar.bz2 volse-hubzilla-214ec91a3f2c5fec6cced93f669b3a9725f0e40a.zip |
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'mod/dfrn_request.php')
-rw-r--r-- | mod/dfrn_request.php | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index 77a3124f7..79583ea18 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -314,7 +314,7 @@ function dfrn_request_post(&$a) { if($email_follow) { - if(! strpos($url,'@')) { + if(! validate_email($url)) { notice( t('Invalid email address.') . EOL); return; } @@ -346,11 +346,71 @@ function dfrn_request_post(&$a) { } } + $r = q("insert into contact ( uid, created, addr, name, nick, url, nurl, poll, notify, blocked, pending, network, rel ) + values( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d ) ", + intval($uid), + dbesc(datetime_convert()), + dbesc($addr), + dbesc($name), + dbesc($nick), + dbesc($url), + dbesc($nurl), + dbesc($poll), + dbesc($notify), + intval($blocked), + intval($pending), + dbesc($network), + intval($rel) + ); + $r = q("select id from contact where poll = '%s' and uid = %d limit 1", + dbesc($poll), + intval($uid) + ); + if(count($r)) { + $contact_id = $r[0]['id']; + + $photo = avatar_img($addr); + + $r = q("UPDATE `contact` SET + `photo` = '%s', + `thumb` = '%s', + `micro` = '%s', + `name-date` = '%s', + `uri-date` = '%s', + `avatar-date` = '%s', + `hidden` = 0, + WHERE `id` = %d LIMIT 1 + ", + dbesc($photos[0]), + dbesc($photos[1]), + dbesc($photos[2]), + dbesc(datetime_convert()), + dbesc(datetime_convert()), + dbesc(datetime_convert()), + intval($contact_id) + ); + } + // contact is created. Now create an introduction + $hash = random_string(); + + $r = q("insert into intro ( uid, `contact-id`, knowyou, note, hash, datetime, blocked ) + values( %d , %d, %d, '%s', '%s', '%s', %d ) ", + intval($uid), + intval($contact_id), + ((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0), + dbesc(notags(trim($_POST['dfrn-request-message']))), + dbesc($hash), + dbesc(datetime_convert()), + 1 + ); + + // Next send an email verify form to the requestor. } + else { // Canonicalise email-style profile locator |