aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-09-30 14:31:20 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-09-30 14:31:20 +0200
commit60e0f79b9f9e94b19cc412eac41e5d8f8fec2383 (patch)
tree6a42698623f3c065851f2266acd9434b4c9776ff /mod
parentdfb3ee6e29b6943f86ec75af12db5a1422a7e1dd (diff)
parent30b7c689292b3a5d06fb9c52a369b53ecb05e57f (diff)
downloadvolse-hubzilla-60e0f79b9f9e94b19cc412eac41e5d8f8fec2383.tar.gz
volse-hubzilla-60e0f79b9f9e94b19cc412eac41e5d8f8fec2383.tar.bz2
volse-hubzilla-60e0f79b9f9e94b19cc412eac41e5d8f8fec2383.zip
Merge remote-tracking branch 'friendika/master'
Diffstat (limited to 'mod')
-rw-r--r--mod/admin.php4
-rw-r--r--mod/hostxrd.php27
-rw-r--r--mod/network.php10
-rw-r--r--mod/profiles.php2
4 files changed, 37 insertions, 6 deletions
diff --git a/mod/admin.php b/mod/admin.php
index da561d554..ebef1ccb9 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -177,6 +177,8 @@ function admin_page_site_post(&$a){
$register_policy = ((x($_POST,'register_policy')) ? intval(trim($_POST['register_policy'])) : 0);
+ $abandon_days = ((x($_POST,'abandon_days')) ? intval(trim($_POST['abandon_days'])) : 0);
+
$register_text = ((x($_POST,'register_text')) ? notags(trim($_POST['register_text'])) : '');
$allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : '');
@@ -215,6 +217,7 @@ function admin_page_site_post(&$a){
set_config('system','maximagesize', $maximagesize);
set_config('config','register_policy', $register_policy);
+ set_config('system','account_abandon_days', $abandon_days);
set_config('config','register_text', $register_text);
set_config('system','allowed_sites', $allowed_sites);
set_config('system','allowed_email', $allowed_email);
@@ -314,6 +317,7 @@ function admin_page_site(&$a) {
'$register_policy' => array('register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices),
'$register_text' => array('register_text', t("Register text"), htmlentities($a->config['register_text'], ENT_QUOTES), "Will be displayed prominently on the registration page."),
+ '$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')),
'$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), "Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains"),
'$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), "Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains"),
'$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), "Check to block public access to all otherwise public personal pages on this site unless you are currently logged in."),
diff --git a/mod/hostxrd.php b/mod/hostxrd.php
index e057cccad..fe61a874c 100644
--- a/mod/hostxrd.php
+++ b/mod/hostxrd.php
@@ -5,9 +5,34 @@ require_once('include/crypto.php');
function hostxrd_init(&$a) {
header('Access-Control-Allow-Origin: *');
header("Content-type: text/xml");
+ $pubkey = get_config('system','site_pubkey');
+
+ if(! $pubkey) {
+
+ // should only have to ever do this once.
+
+ $res=openssl_pkey_new(array(
+ 'digest_alg' => 'sha1',
+ 'private_key_bits' => 4096,
+ 'encrypt_key' => false ));
+
+
+ $prvkey = '';
+
+ openssl_pkey_export($res, $prvkey);
+
+ // Get public key
+
+ $pkey = openssl_pkey_get_details($res);
+ $pubkey = $pkey["key"];
+
+ set_config('system','site_prvkey', $prvkey);
+ set_config('system','site_pubkey', $pubkey);
+ }
+
$tpl = file_get_contents('view/xrd_host.tpl');
echo str_replace(array(
- '$zroot','$domain','$zot_post','$bigkey'),array(z_root(),z_path(),z_root() . '/post', salmon_key(get_config('system','site_pubkey'))),$tpl);
+ '$zhost','$zroot','$domain','$zot_post','$bigkey'),array($a->get_hostname(),z_root(),z_path(),z_root() . '/post', salmon_key(get_config('system','site_pubkey'))),$tpl);
session_write_close();
exit();
diff --git a/mod/network.php b/mod/network.php
index 9488cd973..371a35402 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -78,23 +78,25 @@ function network_init(&$a) {
// network links moved to content to match other pages
// all
- $a->page['content'] .= '<a class="tabs ' . $all_active . '" href="' . $a->get_baseurl() . '/'
+ // added 'button' class for easier styling - not the best place for it, should be moved into the tpl like profile_tabs.tpl
+ // once there is a network_tabs.tpl or something
+ $a->page['content'] .= '<a class="button tabs ' . $all_active . '" href="' . $a->get_baseurl() . '/'
. str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '') . '">'
. t('All') . '</a>';
// new
- $a->page['content'] .= '<a class="tabs ' . $new_active . '" href="' . $a->get_baseurl() . '/'
+ $a->page['content'] .= '<a class="button tabs ' . $new_active . '" href="' . $a->get_baseurl() . '/'
. str_replace('/new', '', $a->cmd) . '/new'
. ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '">'
. t('New') . '</a>';
// starred
- $a->page['content'] .= '<a class="tabs ' . $starred_active . '" href="' . $a->get_baseurl() . '/'
+ $a->page['content'] .= '<a class="button tabs ' . $starred_active . '" href="' . $a->get_baseurl() . '/'
. str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&star=1" >'
. t('Starred') . '</a>';
// bookmarks
- $a->page['content'] .= '<a class="tabs ' . $bookmarked_active . '" href="' . $a->get_baseurl() . '/'
+ $a->page['content'] .= '<a class="button tabs ' . $bookmarked_active . '" href="' . $a->get_baseurl() . '/'
. str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&bmark=1" >'
. t('Bookmarks') . '</a>';
diff --git a/mod/profiles.php b/mod/profiles.php
index 5cc9fa38c..f5f335c7e 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -359,7 +359,7 @@ function profiles_content(&$a) {
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
- $a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"include/country.js\" ></script>";
+ $a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"js/country.js\" ></script>";
$f = get_config('system','birthday_input_format');
if(! $f)