diff options
author | root <root@diekershoff.homeunix.net> | 2010-12-12 10:34:34 +0100 |
---|---|---|
committer | root <root@diekershoff.homeunix.net> | 2010-12-12 10:34:34 +0100 |
commit | 2e9dca7c9f0e50956723505ad576bf32e762d11e (patch) | |
tree | dbe956c31285682bc620ccb7c5f03f2e3785c6e7 /mod | |
parent | 037cd5d80993dedfccfe9ef25679c54297ef1546 (diff) | |
parent | a50343830f87966b5857be295633d8dff576931a (diff) | |
download | volse-hubzilla-2e9dca7c9f0e50956723505ad576bf32e762d11e.tar.gz volse-hubzilla-2e9dca7c9f0e50956723505ad576bf32e762d11e.tar.bz2 volse-hubzilla-2e9dca7c9f0e50956723505ad576bf32e762d11e.zip |
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'mod')
-rw-r--r-- | mod/dfrn_confirm.php | 10 | ||||
-rw-r--r-- | mod/dfrn_poll.php | 2 | ||||
-rw-r--r-- | mod/dfrn_request.php | 1 | ||||
-rw-r--r-- | mod/display.php | 1 | ||||
-rw-r--r-- | mod/invite.php | 14 | ||||
-rw-r--r-- | mod/profile.php | 48 | ||||
-rw-r--r-- | mod/profile_photo.php | 1 | ||||
-rw-r--r-- | mod/profiles.php | 1 | ||||
-rw-r--r-- | mod/settings.php | 1 | ||||
-rw-r--r-- | mod/update_profile.php | 41 | ||||
-rw-r--r-- | mod/viewcontacts.php | 1 | ||||
-rw-r--r-- | mod/wall_upload.php | 7 |
12 files changed, 56 insertions, 72 deletions
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 7018bf52b..c20770481 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -201,7 +201,15 @@ function dfrn_confirm_post(&$a,$handsfree = null) { logger('dfrn_confirm: Confirm: posting data to ' . $dfrn_confirm . ': ' . print_r($params,true), LOGGER_DATA); - // POST all this stuff to the other site. + /** + * + * POST all this stuff to the other site. + * Temporarily raise the network timeout to 120 seconds because the default 60 + * doesn't always give the other side quite enough time to decrypt everything. + * + */ + + $a->config['system']['curl_timeout'] = 120; $res = post_url($dfrn_confirm,$params); diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index 20fdc8f79..a8c27efc1 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -353,6 +353,8 @@ function dfrn_poll_content(&$a) { } else { $status = 1; + $challenge = ''; + $encrypted_id = ''; } if(($type === 'profile') && (strlen($sec))) { diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index 60106661c..ce422aa9f 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -6,7 +6,6 @@ function dfrn_request_init(&$a) { if($a->argc > 1) $which = $a->argv[1]; - require_once('mod/profile.php'); profile_init($a,$which); return; diff --git a/mod/display.php b/mod/display.php index 369161619..1049b28a0 100644 --- a/mod/display.php +++ b/mod/display.php @@ -5,7 +5,6 @@ function display_content(&$a) { $o = '<div id="live-display"></div>' . "\r\n"; - require_once('mod/profile.php'); profile_init($a); $item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0); diff --git a/mod/invite.php b/mod/invite.php index fe706a524..9d4497f5d 100644 --- a/mod/invite.php +++ b/mod/invite.php @@ -1,15 +1,22 @@ <?php +/** + * module: invite.php + * + * send email invitations to join social network + * + */ function invite_post(&$a) { + if(! local_user()) { notice( t('Permission denied.') . EOL); return; } - $recips = explode("\n",$_POST['recipients']); - $message = $_POST['message']; + $recips = ((x($_POST,'recipients')) ? explode("\n",$_POST['recipients']) : array()); + $message = ((x($_POST,'message')) ? notags(trim($_POST['message'])) : ''); $total = 0; @@ -38,6 +45,7 @@ function invite_post(&$a) { function invite_content(&$a) { + if(! local_user()) { notice( t('Permission denied.') . EOL); return; @@ -51,7 +59,7 @@ function invite_content(&$a) { '$msg_text' => t('Your message:'), '$default_message' => t('Please join my social network on ') . $a->config['sitename'] . t("\r\n") . t("\r\n") . t('To accept this invitation, please visit:') . t("\r\n") . t("\r\n") . $a->get_baseurl() - . t("\r\n") . t("\r\n") . t('Once you have registered, please make an introduction via my profile page at:') + . t("\r\n") . t("\r\n") . t('Once you have registered, please connect with me via my profile page at:') . t("\r\n") . t("\r\n") . $a->get_baseurl() . '/profile/' . $a->user['nickname'] , '$submit' => t('Submit') )); diff --git a/mod/profile.php b/mod/profile.php index a431f4bdd..b40617d03 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -1,53 +1,5 @@ <?php -if(! function_exists('profile_load')) { -function profile_load(&$a, $username, $profile = 0) { - if(remote_user()) { - $r = q("SELECT `profile-id` FROM `contact` WHERE `id` = %d LIMIT 1", - intval($_SESSION['visitor_id'])); - if(count($r)) - $profile = $r[0]['profile-id']; - } - - $r = null; - - if($profile) { - $profile_int = intval($profile); - $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` - LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` - WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d LIMIT 1", - dbesc($username), - intval($profile_int) - ); - } - if(! count($r)) { - $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` - LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` - WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 LIMIT 1", - dbesc($username) - ); - } - - if(($r === false) || (! count($r))) { - notice( t('No profile') . EOL ); - $a->error = 404; - return; - } - - $a->profile = $r[0]; - - $a->page['template'] = 'profile'; - - $a->page['title'] = $a->profile['name']; - $_SESSION['theme'] = $a->profile['theme']; - - if(! (x($a->page,'aside'))) - $a->page['aside'] = ''; - $a->page['aside'] .= contact_block(); - - return; -}} - function profile_init(&$a) { if($a->argc > 1) diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 39808776b..64093b2de 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -8,7 +8,6 @@ function profile_photo_init(&$a) { return; } - require_once("mod/profile.php"); profile_load($a,$a->user['nickname']); } diff --git a/mod/profiles.php b/mod/profiles.php index 604eb2f62..e675af2e4 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -327,7 +327,6 @@ function profiles_content(&$a) { return; } - require_once('mod/profile.php'); profile_load($a,$a->user['nickname'],$r[0]['id']); require_once('include/profile_selectors.php'); diff --git a/mod/settings.php b/mod/settings.php index 7ed7ad32e..a8e02ea40 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -3,7 +3,6 @@ function settings_init(&$a) { if(local_user()) { - require_once("mod/profile.php"); profile_load($a,$a->user['nickname']); } } diff --git a/mod/update_profile.php b/mod/update_profile.php index 9a6729396..13c519d1c 100644 --- a/mod/update_profile.php +++ b/mod/update_profile.php @@ -1,7 +1,11 @@ <?php -// This page is fetched via ajax to update the profile page with -// new content while you are viewing it. +/** + * Module: update_profile + * Purpose: AJAX synchronisation of profile page + * + */ + require_once('mod/profile.php'); @@ -11,19 +15,34 @@ function update_profile_content(&$a) { header("Content-type: text/html"); echo "<!DOCTYPE html><html><body>\r\n"; + + /** + * We can remove this hack once Internet Explorer recognises HTML5 natively + */ + echo (($_GET['msie'] == 1) ? '<div>' : '<section>'); - // Grab the page inner contents, but move any image src attributes to another attribute name. - // Some browsers will prefetch all the images for the page even if we don't need them. - // The only ones we need to fetch are those for new page additions, which we'll discover - // on the client side and then swap the image back. + /** + * + * Grab the page inner contents by calling the content function from the profile module directly, + * but move any image src attributes to another attribute name. This is because + * some browsers will prefetch all the images for the page even if we don't need them. + * The only ones we need to fetch are those for new page additions, which we'll discover + * on the client side and then swap the image back. + * + */ + + $text = profile_content($a,$profile_uid); + + $pattern = "/<img([^>]*) src=\"([^\"]*)\"/"; + $replace = "<img\${1} dst=\"\${2}\""; + $text = preg_replace($pattern, $replace, $text); - $text = profile_content($a,$profile_uid); - $pattern = "/<img([^>]*) src=\"([^\"]*)\"/"; - $replace = "<img\${1} dst=\"\${2}\""; - $text = preg_replace($pattern, $replace, $text); + /** + * reportedly some versions of MSIE don't handle tabs in XMLHttpRequest documents very well + */ - echo str_replace("\t",' ',$text); + echo str_replace("\t",' ',$text); echo (($_GET['msie'] == 1) ? '</div>' : '</section>'); echo "</body></html>\r\n"; killme(); diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php index 562b60c25..bd73b2ffb 100644 --- a/mod/viewcontacts.php +++ b/mod/viewcontacts.php @@ -2,7 +2,6 @@ function viewcontacts_init(&$a) { - require_once("mod/profile.php"); profile_load($a,$a->argv[1]); } diff --git a/mod/wall_upload.php b/mod/wall_upload.php index 25a7ac50e..eb44012d1 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -19,8 +19,9 @@ function wall_upload_post(&$a) { $can_post = false; $visitor = 0; - $page_owner_uid = $r[0]['uid']; - $community_page = (($r[0]['page-flags'] == PAGE_COMMUNITY) ? true : false); + $page_owner_uid = $r[0]['uid']; + $page_owner_nick = $r[0]['nickname']; + $community_page = (($r[0]['page-flags'] == PAGE_COMMUNITY) ? true : false); if((local_user()) && (local_user() == $page_owner_uid)) $can_post = true; @@ -97,7 +98,7 @@ function wall_upload_post(&$a) { } $basename = basename($filename); - echo "<br /><br /><img src=\"".$a->get_baseurl(). "/photo/{$hash}-{$smallest}.jpg\" alt=\"$basename\" /><br /><br />"; + echo '<br /><br /><a href="' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '" ><img src="' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg\" alt=\"$basename\" /></a><br /><br />"; killme(); return; // NOTREACHED |