]> git.mxchange.org Git - friendica.git/commitdiff
post branch fixes
authorMike Macgirvin <mike@macgirvin.com>
Tue, 10 Aug 2010 05:58:58 +0000 (22:58 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Tue, 10 Aug 2010 05:58:58 +0000 (22:58 -0700)
boot.php
mod/contacts.php
mod/dfrn_notify.php
mod/dfrn_request.php
mod/photos.php
mod/profiles.php
view/profile.php

index e70e2bf6b7c91a222064710c80807fad54f6a0e8..afb907d595e75c17b987386f148cea72a1a7fe97 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -504,5 +504,8 @@ function expand_acl($s) {
 
 if(! function_exists('sanitise_acl')) {
 function sanitise_acl(&$item) {
-       $item = '<' . intval(notags(trim($item))) . '>';
+       if(intval($item))
+               $item = '<' . intval(notags(trim($item))) . '>';
+       else
+               unset($item);
 }}
index 89e1f24df4727f358ebb51f8330e1da5e3c30a2d..2afa81c9735ace8bf5d296ee17c1daf1808ebf90 100644 (file)
@@ -142,7 +142,7 @@ function contacts_content(&$a) {
                                        intval($_SESSION['uid'])
                        );
        
-                       notice("Contact has been removed." . EOL );
+                       notice( t('Contact has been removed.') . EOL );
                        goaway($a->get_baseurl() . '/contacts');
                        return; // NOTREACHED
                }
index 6aed53a772615c945ce67ea3469dce6d5c06879e..a631434f3fa20a7d0de30f353f48319360212dd2 100644 (file)
@@ -23,7 +23,7 @@ function dfrn_notify_post(&$a) {
 
        // find the local user who owns this relationship.
 
-       $r = q("SELECT `id`, `uid` FROM `contact` WHERE `issued-id` = '%s' LIMIT 1",
+       $r = q("SELECT * FROM `contact` WHERE `issued-id` = '%s' LIMIT 1",
                dbesc($dfrn_id)
        );
        if(! count($r)) {
@@ -47,9 +47,6 @@ function dfrn_notify_post(&$a) {
        $feed->init();
 
        $ismail = false;
-       $photo_time = $feed->get_feed_tags( NAMESPACE_DFRN, 'icon-updated');
-       if($photo_time)
-               $avatar_update = $photo_time[0]['data'];
 
        $rawmail = $feed->get_feed_tags( NAMESPACE_DFRN, 'mail' );
        if(isset($rawmail[0]['child'][NAMESPACE_DFRN])) {
@@ -75,6 +72,29 @@ function dfrn_notify_post(&$a) {
                        . "`) VALUES ('" . implode("', '", array_values($msg)) . "')" );
 
                // send email notification if requested.
+               $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
+                       intval($importer['uid'])
+               );
+               require_once('bbcode.php');
+               if((count($r)) && ($r[0]['notify_flags'] & NOTIFY_MAIL)) {
+                       $tpl = file_get_contents('view/mail_received_eml.tpl');                 
+                       $email_tpl = replace_macros($tpl, array(
+                               '$sitename' => $a->config['sitename'],
+                               '$siteurl' =>  $a->get_baseurl(),
+                               '$username' => $r[0]['username'],
+                               '$email' => $r[0]['email'],
+                               '$from' => $msg['from-name'],
+                               '$fn' => $r[0]['name'],
+                               '$title' => $msg['title'],
+                               '$body' => strip_tags(bbcode($msg['body']))
+                       );
+       
+                       $res = mail($r[0]['email'], t("New mail received at ") . $a->config['sitename'],
+                               $email_tpl,t("From: Administrator@") . $_SERVER[SERVER_NAME] );
+                       if(!$res) {
+                               notice( t("Email notification failed.") . EOL );
+                       }
+               }
 
                xml_status(0);
                return;
index 7ba81681fa3df600d88cd342d87e2270aa943abf..39ff920fac6ff4f4dd77a9988c8c31ab8a80771e 100644 (file)
@@ -283,7 +283,7 @@ function dfrn_request_post(&$a) {
                        // find the contact record we just created
                        if($r) {        
                                $r = q("SELECT `id` FROM `contact` 
-                                       WHERE `uid` = '%s' AND `url` = '%s' AND `issued-id` = '%s' LIMIT 1",
+                                       WHERE `uid` = %d AND `url` = '%s' AND `issued-id` = '%s' LIMIT 1",
                                        intval($uid),
                                        $parms['url'],
                                        $parms['issued-id']
index 7b07f67295b593d61ed3550437c3ef2fab8b33e7..6ef94fb55327259f1623be48dd9a219dc5aee4d3 100644 (file)
@@ -128,13 +128,13 @@ function photos_post(&$a) {
                                        // send the notification upstream/downstream as the case may be
 
                                        if($rr['visible'])
-                                               proc_close(proc_open("php include/notifier.php \"$url\" \"drop\" \"$drop_id\" ",
+                                               proc_close(proc_open("php include/notifier.php \"$url\" \"drop\" \"$drop_id\" ",
                                                        array(),$foo));
 
                                }
                        }
                }
-               goaway($a->get_baseurl() . '/photos/' . $a->data['user']['uid']);
+               goaway($a->get_baseurl() . '/photos/' . $a->data['user']['nickname']);
                return; // NOTREACHED
        }
 
@@ -164,7 +164,7 @@ function photos_post(&$a) {
                                // send the notification upstream/downstream as the case may be
 
                                if($i[0]['visible'])
-                                       proc_close(proc_open("php include/notifier.php \"$url\" \"drop\" \"$drop_id\" ",
+                                       proc_close(proc_open("php include/notifier.php \"$url\" \"drop\" \"$drop_id\" ",
                                                array(),$foo));
                        }
                }
index bfdff5f6b1371cd9fd1c8acc8b4d9136dcac2145..850a4b8ce4aa70f9baef5375a65814f53f86ed23 100644 (file)
@@ -52,7 +52,11 @@ function profiles_post(&$a) {
                $region = notags(trim($_POST['region']));
                $postal_code = notags(trim($_POST['postal_code']));
                $country_name = notags(trim($_POST['country_name']));
+
                $marital = notags(trim(implode(', ',$_POST['marital'])));
+               if($marital != $orig[0]['marital'])
+                       $maritalchanged = true;
+
                $sexual = notags(trim($_POST['sexual']));
                $homepage = notags(trim($_POST['homepage']));
                $politic = notags(trim($_POST['politic']));
index 57130c0732d7660a0e6bdde9428bcf2e3049dae8..64f8f410a79f41fd13708e24f0f2309749d71434 100644 (file)
@@ -56,7 +56,7 @@
 <div class="marital"><span class="marital-label"><span class="heart">&hearts;</span> Status: </span><span class="marital-text"><?php echo $profile['marital']; ?></span></div>\r
 <?php } ?>\r
 <?php if(strlen($profile['url'])) { ?>\r
-<div class="homepage"><span class="homepage-label">Status: </span><span class="homepage-url"><?php echo $profile['homepage']; ?></span></div>\r
+<div class="homepage"><span class="homepage-label">Homepage: </span><span class="homepage-url"><?php echo $profile['homepage']; ?></span></div>\r
 <?php } ?>\r
 <?php echo $page['aside'] ?>\r
 </aside>\r