1
1
Fork 0

basic ssl_policy for important modules

This commit is contained in:
friendica 2012-03-14 21:20:20 -07:00
parent f0a62d8908
commit 110e8f2919
11 changed files with 140 additions and 130 deletions

View file

@ -186,6 +186,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
require_once('bbcode.php');
$ssl_state = ((local_user()) ? true : false);
$profile_owner = 0;
$page_writeable = false;
@ -345,7 +347,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
'like' => '',
'dislike' => '',
'comment' => '',
'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))),
'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))),
'previewing' => $previewing,
'wait' => t('Please wait'),
);
@ -461,7 +463,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$comment_lastcollapsed = true;
}
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
$redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $item['cid'] ;
$lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
@ -543,7 +545,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
}
$edpost = (((($profile_owner == local_user()) && ($toplevelpost) && (intval($item['wall']) == 1)) || ($mode === 'notes'))
? array($a->get_baseurl()."/editpost/".$item['id'], t("Edit"))
? array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit"))
: False);
@ -697,7 +699,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$page_template = get_markup_template("conversation.tpl");
$o .= replace_macros($page_template, array(
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl($ssl_state),
'$mode' => $mode,
'$user' => $a->user,
'$threads' => $threads,
@ -707,7 +709,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
return $o;
}}
function best_link_url($item,&$sparkle) {
function best_link_url($item,&$sparkle,$ssl_state = false) {
$a = get_app();
@ -719,7 +721,7 @@ function best_link_url($item,&$sparkle) {
if((local_user()) && (local_user() == $item['uid'])) {
if(isset($a->contacts) && x($a->contacts,$clean_url)) {
if($a->contacts[$clean_url]['network'] === NETWORK_DFRN) {
$best_url = $a->get_baseurl() . '/redir/' . $a->contacts[$clean_url]['id'];
$best_url = $a->get_baseurl($ssl_state) . '/redir/' . $a->contacts[$clean_url]['id'];
$sparkle = true;
}
else
@ -741,9 +743,13 @@ if(! function_exists('item_photo_menu')){
function item_photo_menu($item){
$a = get_app();
if (local_user() && (! count($a->contacts)))
load_contact_links(local_user());
$ssl_state = false;
if(local_user()) {
$ssl_state = true;
if(! count($a->contacts))
load_contact_links(local_user());
}
$contact_url="";
$pm_url="";
$status_link="";
@ -751,7 +757,7 @@ function item_photo_menu($item){
$posts_link="";
$sparkle = false;
$profile_link = best_link_url($item,$sparkle);
$profile_link = best_link_url($item,$sparkle,$ssl_state);
if($profile_link === 'mailbox')
$profile_link = '';
@ -760,7 +766,7 @@ function item_photo_menu($item){
$status_link = $profile_link . "?url=status";
$photos_link = $profile_link . "?url=photos";
$profile_link = $profile_link . "?url=profile";
$pm_url = $a->get_baseurl() . '/message/new/' . $cid;
$pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid;
}
else {
if(local_user() && local_user() == $item['uid'] && link_compare($item['url'],$item['author-link'])) {
@ -771,8 +777,8 @@ function item_photo_menu($item){
}
}
if(($cid) && (! $item['self'])) {
$contact_url = $a->get_baseurl() . '/contacts/' . $cid;
$posts_link = $a->get_baseurl() . '/network/?cid=' . $cid;
$contact_url = $a->get_baseurl($ssl_state) . '/contacts/' . $cid;
$posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $cid;
}
$menu = Array(
@ -808,7 +814,7 @@ function like_puller($a,$item,&$arr,$mode) {
if((activity_match($item['verb'],$verb)) && ($item['id'] != $item['parent'])) {
$url = $item['author-link'];
if((local_user()) && (local_user() == $item['uid']) && ($item['network'] === 'dfrn') && (! $item['self']) && (link_compare($item['author-link'],$item['url']))) {
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
$url = $a->get_baseurl(true) . '/redir/' . $item['contact-id'];
$sparkle = ' class="sparkle" ';
}
if(! ((isset($arr[$item['parent'] . '-l'])) && (is_array($arr[$item['parent'] . '-l']))))
@ -870,7 +876,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$newpost' => 'true',
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$geotag' => $geotag,
'$nickname' => $x['nickname'],
@ -921,7 +927,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
$o .= replace_macros($tpl,array(
'$return_path' => $a->cmd,
'$action' => $a->get_baseurl().'/item',
'$action' => $a->get_baseurl(true) . '/item',
'$share' => (x($x,'button') ? $x['button'] : t('Share')),
'$upload' => t('Upload photo'),
'$shortupload' => t('upload photo'),
@ -945,7 +951,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
'$ptyp' => (($notes_cid) ? 'note' : 'wall'),
'$content' => '',
'$post_id' => '',
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$defloc' => $x['default_location'],
'$visitor' => $x['visitor'],
'$pvisit' => (($notes_cid) ? 'none' : $x['visitor']),

View file

@ -8,6 +8,8 @@ function nav(&$a) {
*
*/
$ssl_state = ((local_user()) ? true : false);
if(!(x($a->page,'nav')))
$a->page['nav'] = '';
@ -27,7 +29,7 @@ function nav(&$a) {
$myident = ((is_array($a->user) && isset($a->user['nickname'])) ? $a->user['nickname'] . '@' : '');
$sitelocation = $myident . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 );
$sitelocation = $myident . substr($a->get_baseurl($ssl_state),strpos($a->get_baseurl($ssl_state),'//') + 2 );
// nav links: array of array('href', 'text', 'extra css classes', 'title')
@ -53,7 +55,7 @@ function nav(&$a) {
// user info
$r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid']));
$userinfo = array(
'icon' => (count($r) ? $r[0]['micro']: $a->get_baseurl()."/images/default-profile-mm.jpg"),
'icon' => (count($r) ? $r[0]['micro']: $a->get_baseurl($ssl_state)."/images/default-profile-mm.jpg"),
'name' => $a->user['username'],
);
@ -76,7 +78,7 @@ function nav(&$a) {
if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
$nav['register'] = array('register',t('Register'), "", t('Create an account'));
$help_url = $a->get_baseurl() . '/help';
$help_url = $a->get_baseurl($ssl_state) . '/help';
if(! get_config('system','hide_help'))
$nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'));

View file

@ -37,7 +37,7 @@ function admin_post(&$a){
$func($a);
}
}
goaway($a->get_baseurl() . '/admin/plugins/' . $a->argv[2] );
goaway($a->get_baseurl(true) . '/admin/plugins/' . $a->argv[2] );
return; // NOTREACHED
break;
case 'logs':
@ -49,7 +49,7 @@ function admin_post(&$a){
}
}
goaway($a->get_baseurl() . '/admin' );
goaway($a->get_baseurl(true) . '/admin' );
return; // NOTREACHED
}
@ -68,11 +68,11 @@ function admin_content(&$a) {
// array( url, name, extra css classes )
$aside = Array(
'site' => Array($a->get_baseurl()."/admin/site/", t("Site") , "site"),
'users' => Array($a->get_baseurl()."/admin/users/", t("Users") , "users"),
'plugins'=> Array($a->get_baseurl()."/admin/plugins/", t("Plugins") , "plugins"),
'themes' => Array($a->get_baseurl()."/admin/themes/", t("Themes") , "themes"),
'update' => Array($a->get_baseurl()."/admin/update/", t("Update") , "update")
'site' => Array($a->get_baseurl(true)."/admin/site/", t("Site") , "site"),
'users' => Array($a->get_baseurl(true)."/admin/users/", t("Users") , "users"),
'plugins'=> Array($a->get_baseurl(true)."/admin/plugins/", t("Plugins") , "plugins"),
'themes' => Array($a->get_baseurl(true)."/admin/themes/", t("Themes") , "themes"),
'update' => Array($a->get_baseurl(true)."/admin/update/", t("Update") , "update")
);
/* get plugins admin page */
@ -81,18 +81,18 @@ function admin_content(&$a) {
$aside['plugins_admin']=Array();
foreach ($r as $h){
$plugin =$h['name'];
$aside['plugins_admin'][] = Array($a->get_baseurl()."/admin/plugins/".$plugin, $plugin, "plugin");
$aside['plugins_admin'][] = Array($a->get_baseurl(true)."/admin/plugins/".$plugin, $plugin, "plugin");
// temp plugins with admin
$a->plugins_admin[] = $plugin;
}
$aside['logs'] = Array($a->get_baseurl()."/admin/logs/", t("Logs"), "logs");
$aside['logs'] = Array($a->get_baseurl(true)."/admin/logs/", t("Logs"), "logs");
$t = get_markup_template("admin_aside.tpl");
$a->page['aside'] = replace_macros( $t, array(
'$admin' => $aside,
'$h_pending' => t('User registrations waiting for confirmation'),
'$admurl'=> $a->get_baseurl()."/admin/"
'$admurl'=> $a->get_baseurl(true)."/admin/"
));
@ -255,7 +255,7 @@ function admin_page_site_post(&$a){
set_config('system','diaspora_enabled', $diaspora_enabled);
info( t('Site settings updated.') . EOL);
goaway($a->get_baseurl() . '/admin/site' );
goaway($a->get_baseurl(true) . '/admin/site' );
return; // NOTREACHED
}
@ -319,7 +319,7 @@ function admin_page_site(&$a) {
'$corporate' => t('Policies'),
'$advanced' => t('Advanced'),
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
// name, label, value, help string, extra data...
'$sitename' => array('sitename', t("Site name"), htmlentities($a->config['sitename'], ENT_QUOTES), ""),
'$banner' => array('banner', t("Banner/Logo"), $banner, ""),
@ -392,7 +392,7 @@ function admin_page_users_post(&$a){
user_deny($hash);
}
}
goaway($a->get_baseurl() . '/admin/users' );
goaway($a->get_baseurl(true) . '/admin/users' );
return; // NOTREACHED
}
@ -402,7 +402,7 @@ function admin_page_users(&$a){
$user = q("SELECT * FROM `user` WHERE `uid`=%d", intval($uid));
if (count($user)==0){
notice( 'User not found' . EOL);
goaway($a->get_baseurl() . '/admin/users' );
goaway($a->get_baseurl(true) . '/admin/users' );
return; // NOTREACHED
}
switch($a->argv[2]){
@ -421,7 +421,7 @@ function admin_page_users(&$a){
notice( sprintf( ($user[0]['blocked']?t("User '%s' unblocked"):t("User '%s' blocked")) , $user[0]['username']) . EOL);
}; break;
}
goaway($a->get_baseurl() . '/admin/users' );
goaway($a->get_baseurl(true) . '/admin/users' );
return; // NOTREACHED
}
@ -500,7 +500,7 @@ function admin_page_users(&$a){
// values //
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$pending' => $pending,
'$users' => $users,
@ -539,7 +539,7 @@ function admin_page_plugins(&$a){
info( sprintf( t("Plugin %s enabled."), $plugin ) );
}
set_config("system","addon", implode(", ",$a->plugins));
goaway($a->get_baseurl() . '/admin/plugins' );
goaway($a->get_baseurl(true) . '/admin/plugins' );
return; // NOTREACHED
}
// display plugin details
@ -572,7 +572,7 @@ function admin_page_plugins(&$a){
'$page' => t('Plugins'),
'$toggle' => t('Toggle'),
'$settings' => t('Settings'),
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$plugin' => $plugin,
'$status' => $status,
@ -610,7 +610,7 @@ function admin_page_plugins(&$a){
'$title' => t('Administration'),
'$page' => t('Plugins'),
'$submit' => t('Submit'),
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$function' => 'plugins',
'$plugins' => $plugins
));
@ -716,7 +716,7 @@ function admin_page_themes(&$a){
info( sprintf('Theme %s disabled.',$theme));
set_config('system','allowed_themes',$s);
goaway($a->get_baseurl() . '/admin/themes' );
goaway($a->get_baseurl(true) . '/admin/themes' );
return; // NOTREACHED
}
@ -745,7 +745,7 @@ function admin_page_themes(&$a){
'$page' => t('Themes'),
'$toggle' => t('Toggle'),
'$settings' => t('Settings'),
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$plugin' => $theme,
'$status' => $status,
@ -777,7 +777,7 @@ function admin_page_themes(&$a){
'$title' => t('Administration'),
'$page' => t('Themes'),
'$submit' => t('Submit'),
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$function' => 'themes',
'$plugins' => $xthemes,
'$experimental' => t('[Experimental]'),
@ -805,7 +805,7 @@ function admin_page_logs_post(&$a) {
}
info( t("Log settings updated.") );
goaway($a->get_baseurl() . '/admin/logs' );
goaway($a->get_baseurl(true) . '/admin/logs' );
return; // NOTREACHED
}
@ -859,7 +859,7 @@ readable.");
'$submit' => t('Submit'),
'$clear' => t('Clear'),
'$data' => $data,
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$logname' => get_config('system','logfile'),
// name, label, value, help string, extra data...
@ -904,7 +904,7 @@ function admin_page_remoteupdate(&$a) {
$tpl = get_markup_template("admin_remoteupdate.tpl");
return replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$submit' => t("Update now"),
'$close' => t("Close"),
'$localversion' => FRIENDICA_VERSION,

View file

@ -61,7 +61,7 @@ function contacts_post(&$a) {
if(! count($orig_record)) {
notice( t('Could not access contact record.') . EOL);
goaway($a->get_baseurl() . '/contacts');
goaway($a->get_baseurl(true) . '/contacts');
return; // NOTREACHED
}
@ -141,7 +141,7 @@ function contacts_content(&$a) {
if(! count($orig_record)) {
notice( t('Could not access contact record.') . EOL);
goaway($a->get_baseurl() . '/contacts');
goaway($a->get_baseurl(true) . '/contacts');
return; // NOTREACHED
}
@ -149,7 +149,7 @@ function contacts_content(&$a) {
// pull feed and consume it, which should subscribe to the hub.
proc_run('php',"include/poller.php","$contact_id");
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
// NOTREACHED
}
@ -164,7 +164,7 @@ function contacts_content(&$a) {
//notice( t('Contact has been ') . (($blocked) ? t('blocked') : t('unblocked')) . EOL );
info( (($blocked) ? t('Contact has been blocked') : t('Contact has been unblocked')) . EOL );
}
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
return; // NOTREACHED
}
@ -178,7 +178,7 @@ function contacts_content(&$a) {
if($r) {
info( (($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')) . EOL );
}
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
return; // NOTREACHED
}
@ -220,9 +220,9 @@ function contacts_content(&$a) {
contact_remove($orig_record[0]['id']);
info( t('Contact has been removed.') . EOL );
if(x($_SESSION,'return_url'))
goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
else
goaway($a->get_baseurl() . '/contacts');
goaway($a->get_baseurl(true) . '/contacts');
return; // NOTREACHED
}
}
@ -233,7 +233,7 @@ function contacts_content(&$a) {
$contact = $a->data['contact'];
$tpl = get_markup_template('contact_head.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(true)));
require_once('include/contact_selectors.php');
@ -295,17 +295,17 @@ function contacts_content(&$a) {
$tabs = array(
array(
'label' => (($contact['blocked']) ? t('Unblock') : t('Block') ),
'url' => $a->get_baseurl() . '/contacts/' . $contact_id . '/block',
'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/block',
'sel' => '',
),
array(
'label' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
'url' => $a->get_baseurl() . '/contacts/' . $contact_id . '/ignore',
'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/ignore',
'sel' => '',
),
array(
'label' => t('Repair'),
'url' => $a->get_baseurl() . '/crepair/' . $contact_id,
'url' => $a->get_baseurl(true) . '/crepair/' . $contact_id,
'sel' => '',
)
);
@ -322,7 +322,7 @@ function contacts_content(&$a) {
'$lbl_info1' => t('Contact Information / Notes'),
'$infedit' => t('Edit contact notes'),
'$common_text' => $common_text,
'$common_link' => $a->get_baseurl() . '/common/' . $contact['id'],
'$common_link' => $a->get_baseurl(true) . '/common/' . $contact['id'],
'$all_friends' => $all_friends,
'$relation_text' => $relation_text,
'$visit' => sprintf( t('Visit %s\'s profile [%s]'),$contact['name'],$contact['url']),
@ -397,30 +397,30 @@ function contacts_content(&$a) {
$tabs = array(
array(
'label' => t('All Contacts'),
'url' => $a->get_baseurl() . '/contacts/all',
'url' => $a->get_baseurl(true) . '/contacts/all',
'sel' => ($all) ? 'active' : '',
),
array(
'label' => t('Unblocked Contacts'),
'url' => $a->get_baseurl() . '/contacts',
'url' => $a->get_baseurl(true) . '/contacts',
'sel' => ((! $all) && (! $blocked) && (! $hidden) && (! $search) && (! $nets) && (! $ignored)) ? 'active' : '',
),
array(
'label' => t('Blocked Contacts'),
'url' => $a->get_baseurl() . '/contacts/blocked',
'url' => $a->get_baseurl(true) . '/contacts/blocked',
'sel' => ($blocked) ? 'active' : '',
),
array(
'label' => t('Ignored Contacts'),
'url' => $a->get_baseurl() . '/contacts/ignored',
'url' => $a->get_baseurl(true) . '/contacts/ignored',
'sel' => ($ignored) ? 'active' : '',
),
array(
'label' => t('Hidden Contacts'),
'url' => $a->get_baseurl() . '/contacts/hidden',
'url' => $a->get_baseurl(true) . '/contacts/hidden',
'sel' => ($hidden) ? 'active' : '',
),

View file

@ -74,7 +74,7 @@ function manage_post(&$a) {
if($limited_id)
$_SESSION['submanage'] = $original_id;
goaway($a->get_baseurl() . '/profile/' . $a->user['nickname']);
goaway($a->get_baseurl(true) . '/profile/' . $a->user['nickname']);
// NOTREACHED
}

View file

@ -56,23 +56,23 @@ function message_content(&$a) {
return;
}
$myprofile = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
$myprofile = $a->get_baseurl(true) . '/profile/' . $a->user['nickname'];
$tabs = array(
array(
'label' => t('Inbox'),
'url'=> $a->get_baseurl() . '/message',
'url'=> $a->get_baseurl(true) . '/message',
'sel'=> (($a->argc == 1) ? 'active' : ''),
),
array(
'label' => t('Outbox'),
'url' => $a->get_baseurl() . '/message/sent',
'url' => $a->get_baseurl(true) . '/message/sent',
'sel'=> (($a->argv[1] == 'sent') ? 'active' : ''),
),
array(
'label' => t('New Message'),
'url' => $a->get_baseurl() . '/message/new',
'url' => $a->get_baseurl(true) . '/message/new',
'sel'=> (($a->argv[1] == 'new') ? 'active' : ''),
),
);
@ -99,7 +99,7 @@ function message_content(&$a) {
if($r) {
info( t('Message deleted.') . EOL );
}
goaway($a->get_baseurl() . '/message' );
goaway($a->get_baseurl(true) . '/message' );
}
else {
$r = q("SELECT `parent-uri`,`convid` FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1",
@ -129,7 +129,7 @@ function message_content(&$a) {
if($r)
info( t('Conversation removed.') . EOL );
}
goaway($a->get_baseurl() . '/message' );
goaway($a->get_baseurl(true) . '/message' );
}
}
@ -146,7 +146,7 @@ function message_content(&$a) {
$tpl = get_markup_template('msg-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
@ -210,7 +210,7 @@ function message_content(&$a) {
$o .= replace_macros($tpl, array(
'$id' => $rr['id'],
'$from_name' =>$rr['from-name'],
'$from_url' => (($rr['network'] === NETWORK_DFRN) ? $a->get_baseurl() . '/redir/' . $rr['contact-id'] : $rr['url']),
'$from_url' => (($rr['network'] === NETWORK_DFRN) ? $a->get_baseurl(true) . '/redir/' . $rr['contact-id'] : $rr['url']),
'$sparkle' => ' sparkle',
'$from_photo' => $rr['thumb'],
'$subject' => template_escape((($rr['mailseen']) ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>')),
@ -267,7 +267,7 @@ function message_content(&$a) {
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$nickname' => $a->user['nickname'],
'$baseurl' => $a->get_baseurl()
'$baseurl' => $a->get_baseurl(true)
));
@ -278,7 +278,7 @@ function message_content(&$a) {
$sparkle = '';
}
else {
$from_url = $a->get_baseurl() . '/redir/' . $message['contact-id'];
$from_url = $a->get_baseurl(true) . '/redir/' . $message['contact-id'];
$sparkle = ' sparkle';
}
$o .= replace_macros($tpl, array(

View file

@ -44,14 +44,16 @@ function network_init(&$a) {
}
$a->page['aside'] .= group_side('network','network',true,$group_id);
$a->page['aside'] .= networks_widget($a->get_baseurl() . '/network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
$a->page['aside'] .= networks_widget($a->get_baseurl(true) . '/network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
$a->page['aside'] .= saved_searches($search);
$a->page['aside'] .= fileas_widget($a->get_baseurl() . '/network',(x($_GET, 'file') ? $_GET['file'] : ''));
$a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : ''));
}
function saved_searches($search) {
$a = get_app();
$srchurl = '/network?f='
. ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '')
. ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '')
@ -88,7 +90,7 @@ function saved_searches($search) {
$o = replace_macros($tpl, array(
'$title' => t('Saved Searches'),
'$add' => t('add'),
'$searchbox' => search($search,'netsearch-box',$srchurl,true),
'$searchbox' => search($search,'netsearch-box',$a->get_baseurl(true) . $srchurl,true),
'$saved' => $saved,
));
@ -167,38 +169,38 @@ function network_content(&$a, $update = 0) {
$tabs = array(
array(
'label' => t('Commented Order'),
'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?f=&cid=' . $_GET['cid'] : ''),
'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?f=&cid=' . $_GET['cid'] : ''),
'sel'=>$all_active,
),
array(
'label' => t('Posted Order'),
'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel'=>$postord_active,
),
array(
'label' => t('Personal'),
'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&conv=1',
'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&conv=1',
'sel' => $conv_active,
),
array(
'label' => t('New'),
'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
'sel' => $new_active,
),
array(
'label' => t('Starred'),
'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1',
'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1',
'sel'=>$starred_active,
),
array(
'label' => t('Shared Links'),
'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&bmark=1',
'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&bmark=1',
'sel'=>$bookmarked_active,
),
// array(
// 'label' => t('Spam'),
// 'url'=>$a->get_baseurl() . '/network?f=&spam=1'
// 'url'=>$a->get_baseurl(true) . '/network?f=&spam=1'
// 'sel'=> $spam_active,
// ),
@ -300,7 +302,7 @@ function network_content(&$a, $update = 0) {
if($update)
killme();
notice( t('No such group') . EOL );
goaway($a->get_baseurl() . '/network');
goaway($a->get_baseurl(true) . '/network');
// NOTREACHED
}
@ -332,7 +334,7 @@ function network_content(&$a, $update = 0) {
}
else {
notice( t('Invalid contact.') . EOL);
goaway($a->get_baseurl() . '/network');
goaway($a->get_baseurl(true) . '/network');
// NOTREACHED
}
}

View file

@ -42,12 +42,12 @@ function notifications_post(&$a) {
intval(local_user())
);
}
goaway($a->get_baseurl() . '/notifications/intros');
goaway($a->get_baseurl(true) . '/notifications/intros');
}
if($_POST['submit'] == t('Ignore')) {
$r = q("UPDATE `intro` SET `ignore` = 1 WHERE `id` = %d LIMIT 1",
intval($intro_id));
goaway($a->get_baseurl() . '/notifications/intros');
goaway($a->get_baseurl(true) . '/notifications/intros');
}
}
}
@ -69,32 +69,32 @@ function notifications_content(&$a) {
$tabs = array(
array(
'label' => t('System'),
'url'=>$a->get_baseurl() . '/notifications/system',
'url'=>$a->get_baseurl(true) . '/notifications/system',
'sel'=> (($a->argv[1] == 'system') ? 'active' : ''),
),
array(
'label' => t('Network'),
'url'=>$a->get_baseurl() . '/notifications/network',
'url'=>$a->get_baseurl(true) . '/notifications/network',
'sel'=> (($a->argv[1] == 'network') ? 'active' : ''),
),
array(
'label' => t('Personal'),
'url'=>$a->get_baseurl() . '/notifications/personal',
'url'=>$a->get_baseurl(true) . '/notifications/personal',
'sel'=> (($a->argv[1] == 'personal') ? 'active' : ''),
),
array(
'label' => t('Home'),
'url' => $a->get_baseurl() . '/notifications/home',
'url' => $a->get_baseurl(true) . '/notifications/home',
'sel'=> (($a->argv[1] == 'home') ? 'active' : ''),
),
array(
'label' => t('Introductions'),
'url' => $a->get_baseurl() . '/notifications/intros',
'url' => $a->get_baseurl(true) . '/notifications/intros',
'sel'=> (($a->argv[1] == 'intros') ? 'active' : ''),
),
array(
'label' => t('Messages'),
'url' => $a->get_baseurl() . '/message',
'url' => $a->get_baseurl(true) . '/message',
'sel'=> '',
),
);
@ -244,7 +244,7 @@ function notifications_content(&$a) {
switch($it['verb']){
case ACTIVITY_LIKE:
$notif_content .= replace_macros($tpl_item_likes,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => sprintf( t("%s liked %s's post"), $it['author-name'], $it['pname']),
'$item_when' => relative_date($it['created'])
@ -253,7 +253,7 @@ function notifications_content(&$a) {
case ACTIVITY_DISLIKE:
$notif_content .= replace_macros($tpl_item_dislikes,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => sprintf( t("%s disliked %s's post"), $it['author-name'], $it['pname']),
'$item_when' => relative_date($it['created'])
@ -267,7 +267,7 @@ function notifications_content(&$a) {
$it['fname'] = $obj->title;
$notif_content .= replace_macros($tpl_item_friends,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => sprintf( t("%s is now friends with %s"), $it['author-name'], $it['fname']),
'$item_when' => relative_date($it['created'])
@ -281,7 +281,7 @@ function notifications_content(&$a) {
$tpl = (($it['id'] == $it['parent']) ? $tpl_item_posts : $tpl_item_comments);
$notif_content .= replace_macros($tpl,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => $item_text,
'$item_when' => relative_date($it['created'])
@ -314,7 +314,7 @@ function notifications_content(&$a) {
if (count($r) > 0) {
foreach ($r as $it) {
$notif_content .= replace_macros($not_tpl,array(
'$item_link' => $a->get_baseurl().'/notify/view/'. $it['id'],
'$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'],
'$item_image' => $it['photo'],
'$item_text' => strip_tags(bbcode($it['msg'])),
'$item_when' => relative_date($it['date'])
@ -334,7 +334,7 @@ function notifications_content(&$a) {
$notif_tpl = get_markup_template('notifications.tpl');
$myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname'];
$myurl = $a->get_baseurl(true) . '/profile/'. $a->user['nickname'];
$myurl = substr($myurl,strpos($myurl,'://')+3);
$myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
$diasp_url = str_replace('/profile/','/u/',$myurl);
@ -369,7 +369,7 @@ function notifications_content(&$a) {
switch($it['verb']){
case ACTIVITY_LIKE:
$notif_content .= replace_macros($tpl_item_likes,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => sprintf( t("%s liked %s's post"), $it['author-name'], $it['pname']),
'$item_when' => relative_date($it['created'])
@ -378,7 +378,7 @@ function notifications_content(&$a) {
case ACTIVITY_DISLIKE:
$notif_content .= replace_macros($tpl_item_dislikes,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => sprintf( t("%s disliked %s's post"), $it['author-name'], $it['pname']),
'$item_when' => relative_date($it['created'])
@ -392,7 +392,7 @@ function notifications_content(&$a) {
$it['fname'] = $obj->title;
$notif_content .= replace_macros($tpl_item_friends,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => sprintf( t("%s is now friends with %s"), $it['author-name'], $it['fname']),
'$item_when' => relative_date($it['created'])
@ -406,7 +406,7 @@ function notifications_content(&$a) {
$tpl = (($it['id'] == $it['parent']) ? $tpl_item_posts : $tpl_item_comments);
$notif_content .= replace_macros($tpl,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => $item_text,
'$item_when' => relative_date($it['created'])
@ -456,7 +456,7 @@ function notifications_content(&$a) {
switch($it['verb']){
case ACTIVITY_LIKE:
$notif_content .= replace_macros($tpl_item_likes,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => sprintf( t("%s liked %s's post"), $it['author-name'], $it['pname']),
'$item_when' => relative_date($it['created'])
@ -465,7 +465,7 @@ function notifications_content(&$a) {
break;
case ACTIVITY_DISLIKE:
$notif_content .= replace_macros($tpl_item_dislikes,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => sprintf( t("%s disliked %s's post"), $it['author-name'], $it['pname']),
'$item_when' => relative_date($it['created'])
@ -479,7 +479,7 @@ function notifications_content(&$a) {
$it['fname'] = $obj->title;
$notif_content .= replace_macros($tpl_item_friends,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => sprintf( t("%s is now friends with %s"), $it['author-name'], $it['fname']),
'$item_when' => relative_date($it['created'])
@ -488,7 +488,7 @@ function notifications_content(&$a) {
break;
default:
$notif_content .= replace_macros($tpl_item_comments,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'],
'$item_text' => sprintf( t("%s commented on %s's post"), $it['author-name'], $it['pname']),
'$item_when' => relative_date($it['created'])

View file

@ -20,7 +20,7 @@ function notify_init(&$a) {
goaway($r[0]['link']);
}
goaway($a->get_baseurl());
goaway($a->get_baseurl(true));
}
if($a->argc > 2 && $a->argv[1] === 'mark' && $a->argv[2] === 'all' ) {
@ -51,7 +51,7 @@ function notify_content(&$a) {
if (count($r) > 0) {
foreach ($r as $it) {
$notif_content .= replace_macros($not_tpl,array(
'$item_link' => $a->get_baseurl().'/notify/view/'. $it['id'],
'$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'],
'$item_image' => $it['photo'],
'$item_text' => strip_tags(bbcode($it['msg'])),
'$item_when' => relative_date($it['date'])

View file

@ -240,7 +240,7 @@ function profiles_content(&$a) {
);
if(! count($r)) {
notice( t('Profile not found.') . EOL);
goaway($a->get_baseurl() . '/profiles');
goaway($a->get_baseurl(true) . '/profiles');
return; // NOTREACHED
}
@ -260,7 +260,7 @@ function profiles_content(&$a) {
if($r)
info( t('Profile deleted.') . EOL);
goaway($a->get_baseurl() . '/profiles');
goaway($a->get_baseurl(true) . '/profiles');
return; // NOTREACHED
}
@ -297,9 +297,9 @@ function profiles_content(&$a) {
info( t('New profile created.') . EOL);
if(count($r3) == 1)
goaway($a->get_baseurl() . '/profiles/' . $r3[0]['id']);
goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']);
goaway($a->get_baseurl() . '/profiles');
goaway($a->get_baseurl(true) . '/profiles');
}
if(($a->argc > 2) && ($a->argv[1] === 'clone')) {
@ -339,9 +339,9 @@ function profiles_content(&$a) {
);
info( t('New profile created.') . EOL);
if(count($r3) == 1)
goaway($a->get_baseurl() . '/profiles/' . $r3[0]['id']);
goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']);
goaway($a->get_baseurl() . '/profiles');
goaway($a->get_baseurl(true) . '/profiles');
return; // NOTREACHED
}
@ -373,7 +373,7 @@ function profiles_content(&$a) {
));
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(true)));
$a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"js/country.js\" ></script>";
$f = get_config('system','birthday_input_format');
@ -425,7 +425,7 @@ function profiles_content(&$a) {
'$lbl_work' => t('Work/employment'),
'$lbl_school' => t('School/education'),
'$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$profile_id' => $r[0]['id'],
'$profile_name' => $r[0]['profile-name'],
'$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
@ -489,7 +489,7 @@ function profiles_content(&$a) {
'$alt' => t('Profile Image'),
'$profile_name' => $rr['profile-name'],
'$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>'
: '<a href="' . $a->get_baseurl() . '/profperm/' . $rr['id'] . '" />' . t('Edit visibility') . '</a>')
: '<a href="' . $a->get_baseurl(true) . '/profperm/' . $rr['id'] . '" />' . t('Edit visibility') . '</a>')
));
}
}

View file

@ -59,7 +59,7 @@ function settings_post(&$a) {
q("DELETE FROM tokens WHERE id='%s' AND uid=%d",
dbesc($key),
local_user());
goaway($a->get_baseurl()."/settings/oauth/");
goaway($a->get_baseurl(true)."/settings/oauth/");
return;
}
@ -104,7 +104,7 @@ function settings_post(&$a) {
local_user());
}
}
goaway($a->get_baseurl()."/settings/oauth/");
goaway($a->get_baseurl(true)."/settings/oauth/");
return;
}
@ -411,7 +411,7 @@ function settings_post(&$a) {
}
goaway($a->get_baseurl() . '/settings' );
goaway($a->get_baseurl(true) . '/settings' );
return; // NOTREACHED
}
@ -435,27 +435,27 @@ function settings_content(&$a) {
$tabs = array(
array(
'label' => t('Account settings'),
'url' => $a->get_baseurl().'/settings',
'url' => $a->get_baseurl(true).'/settings',
'sel' => (($a->argc == 1)?'active':''),
),
array(
'label' => t('Connector settings'),
'url' => $a->get_baseurl().'/settings/connectors',
'url' => $a->get_baseurl(true).'/settings/connectors',
'sel' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
),
array(
'label' => t('Plugin settings'),
'url' => $a->get_baseurl().'/settings/addon',
'url' => $a->get_baseurl(true).'/settings/addon',
'sel' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
),
array(
'label' => t('Connections'),
'url' => $a->get_baseurl() . '/settings/oauth',
'url' => $a->get_baseurl(true) . '/settings/oauth',
'sel' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
),
array(
'label' => t('Export personal data'),
'url' => $a->get_baseurl() . '/uexport',
'url' => $a->get_baseurl(true) . '/uexport',
'sel' => ''
)
);
@ -517,7 +517,7 @@ function settings_content(&$a) {
$r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d",
dbesc($a->argv[3]),
local_user());
goaway($a->get_baseurl()."/settings/oauth/");
goaway($a->get_baseurl(true)."/settings/oauth/");
return;
}
@ -533,7 +533,7 @@ function settings_content(&$a) {
$tpl = get_markup_template("settings_oauth.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth"),
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$title' => t('Connected Apps'),
'$add' => t('Add application'),
'$edit' => t('Edit'),
@ -789,7 +789,7 @@ function settings_content(&$a) {
$theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']);
$subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . $a->get_baseurl() . '/profile/' . $nickname : '');
$subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . $a->get_baseurl(true) . '/profile/' . $nickname : '');
$tpl_addr = get_markup_template("settings_nick_set.tpl");
@ -819,7 +819,7 @@ function settings_content(&$a) {
'$ptitle' => t('Account Settings'),
'$submit' => t('Submit'),
'$baseurl' => $a->get_baseurl(),
'$baseurl' => $a->get_baseurl(true),
'$uid' => local_user(),
'$form_security_token' => get_form_security_token("settings"),