diff --git a/INSTALL.txt b/INSTALL.txt index 70e4f24ef..12dca9c5b 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -29,7 +29,7 @@ php.ini file - Mysql 5.x - ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks -(Windows) +(Windows) [Note: other options are presented in Section 7 of this document] - Installation into a top-level domain or sub-domain (without a directory/path component in the URL) is preferred. Directory paths will @@ -89,3 +89,18 @@ You can generally find the location of PHP by executing "which php". If you have troubles with this section please contact your hosting provider for assistance. Friendika will not work correctly if you cannot perform this step. +Alternative: You may be able to use the 'poormancron' plugin to perform this +step if you are using a recent Friendika release. To do this, edit the file +".htconfig.php" and look for a line describing your plugins. On a fresh +installation, it will look like + +$a->config['system']['addon'] = 'js_upload'; + +This indicates the "js_upload" addon module is enabled. You may add additional +addons/plugins using this same line in the configuration file. Change it to +read + +$a->config['system']['addon'] = 'js_upload,poormancron'; + +and save your changes. + diff --git a/addon/poormancron/poormancron.php b/addon/poormancron/poormancron.php new file mode 100644 index 000000000..c31d2772c --- /dev/null +++ b/addon/poormancron/poormancron.php @@ -0,0 +1,48 @@ +300) { + set_config('poormancron','lastupdate', $now); + $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); + proc_run($php_path,"include/poller.php"); + } +} + +function poormancron_procrun($a, $argv) { + logger("poormancron procrun ".implode(", ",$argv)); + array_shift($argv); + $argc = count($argv); + logger("poormancron procrun require_once ".basename($argv[0])); + require_once(basename($argv[0])); + $funcname=str_replace(".php", "", basename($argv[0]))."_run"; + + $funcname($argv, $argc); +} + + + +?> diff --git a/boot.php b/boot.php index 3cc98cc9b..6cbb4f07c 100644 --- a/boot.php +++ b/boot.php @@ -10,6 +10,16 @@ define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); define ( 'DOWN_ARROW', '⇩' ); + +/** + * SSL redirection policies + */ + +define ( 'SSL_POLICY_NONE', 0 ); +define ( 'SSL_POLICY_FULL', 1 ); +define ( 'SSL_POLICY_SELFSIGN', 2 ); + + /** * log levels */ @@ -270,10 +280,17 @@ class App { } function get_baseurl($ssl = false) { - if(strlen($this->baseurl)) - return $this->baseurl; - $this->baseurl = (($ssl) ? 'https' : $this->scheme) . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' ); + $scheme = $this->scheme; + + if(x($this->config,'ssl_policy')) { + if(($ssl) || ($this->config['ssl_policy'] == SSL_POLICY_FULL)) + $scheme = 'https'; + if(($this->config['ssl_policy'] == SSL_POLICY_SELFSIGN) && (local_user() || x($_POST,'auth-params'))) + $scheme = 'https'; + } + + $this->baseurl = $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' ); return $this->baseurl; } @@ -1655,7 +1672,6 @@ function attribute_contains($attr,$s) { if(! function_exists('logger')) { function logger($msg,$level = 0) { - $debugging = get_config('system','debugging'); $loglevel = intval(get_config('system','loglevel')); $logfile = get_config('system','logfile'); @@ -2225,7 +2241,31 @@ function prepare_body($item) { $s = smilies(bbcode($item['body'])); return $s; +}} +/** + * + * Wrap calls to proc_close(proc_open()) and call hook + * so plugins can take part in process :) + * + * args: + * $cmd program to run + * next args are passed as $cmd command line + * + * e.g.: proc_run("ls","-la","/tmp"); + * + * $cmd and string args are surrounded with "" + */ +if(! function_exists('run_proc')) { +function proc_run($cmd){ + $args = func_get_args(); + call_hooks("proc_run", $args); + + foreach ($args as &$arg){ + if(is_string($arg)) $arg='"'.$arg.'"'; + } + $cmdline = implode($args," "); + proc_close(proc_open($cmdline." &",array(),$foo)); +}} -}} \ No newline at end of file diff --git a/include/acl_selectors.php b/include/acl_selectors.php index d0952421e..554782a82 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -30,7 +30,7 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) { -function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false) { +function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false) { $o = ''; @@ -43,6 +43,10 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p $sql_extra .= sprintf(" AND `rel` = %d ", intval(REL_BUD)); } + if($privmail || $privatenet) { + $sql_extra .= " AND `network` IN ( 'dfrn' ) "; + } + if($privmail) $o .= "
@@ -24,13 +26,12 @@
-
-
$lastupdtext$last_update
$updpub
$poll_interval +
diff --git a/view/en/contact_edit.tpl b/view/en/contact_edit.tpl index ea546b784..9aca60188 100644 --- a/view/en/contact_edit.tpl +++ b/view/en/contact_edit.tpl @@ -3,6 +3,8 @@
$name
+ +
@@ -24,13 +26,12 @@
- -
$lastupdtext$last_update
$updpub
$poll_interval +
diff --git a/view/fr/contact_edit.tpl b/view/fr/contact_edit.tpl index c7d2d5975..9f36ddcc4 100644 --- a/view/fr/contact_edit.tpl +++ b/view/fr/contact_edit.tpl @@ -3,6 +3,8 @@
$name
+ +
@@ -24,14 +26,13 @@
- -
$lastupdtext$last_update
$updpub
$poll_interval +
diff --git a/view/it/contact_edit.tpl b/view/it/contact_edit.tpl index d4217ba8c..ac0f13a54 100644 --- a/view/it/contact_edit.tpl +++ b/view/it/contact_edit.tpl @@ -3,6 +3,8 @@
$name
+ +
@@ -24,13 +26,12 @@
- -
$lastupdtext$last_update
$updpub
$poll_interval +
diff --git a/view/theme/default/style.css b/view/theme/default/style.css index 3ef63e265..ae45a4244 100644 --- a/view/theme/default/style.css +++ b/view/theme/default/style.css @@ -1333,6 +1333,9 @@ input#dfrn-url { #contact-edit-poll-text { margin-bottom: 10px; } +#contact-edit-update-now { + margin-top: 15px; +} #contact-edit-photo-wrapper { margin-bottom: 20px; diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 59a5bf88a..d6a1744a6 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -1209,6 +1209,10 @@ input#dfrn-url { margin-bottom: 10px; } +#contact-edit-update-now { + margin-top: 15px; +} + #contact-edit-photo-wrapper { margin-bottom: 20px; }