]> git.mxchange.org Git - friendica.git/commitdiff
protect jappixmini/proxy from typo check, more work on email2 connector
authorfriendica <info@friendica.com>
Mon, 23 Apr 2012 12:16:57 +0000 (05:16 -0700)
committerfriendica <info@friendica.com>
Mon, 23 Apr 2012 12:16:57 +0000 (05:16 -0700)
mod/dfrn_request.php
util/typo.php

index 77a3124f76a2128f39a48b5d9fe69c45e054a59c..74d25adbfde5b9ab9aeab4a3c0c26b840d1ce474 100644 (file)
@@ -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,59 @@ 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 send an email verify form to the requestor.
+                       //
 
 
 
                }
+
                else {
 
                        // Canonicalise email-style profile locator
index e20cce86a5a3c68cc74ef7b7399b1d8abecaaca5..7c275f3ca32e6629488e407e67bf5324454d05bc 100644 (file)
@@ -33,6 +33,8 @@
                $files = glob($dir . '/*.php');
                foreach($files as $file) {
                        echo $file . "\n";
+                       if(stristr($file,'jappixmini/proxy.php'))
+                               continue;
                        include_once($file);
                }
        }