Merge remote-tracking branch 'upstream/develop' into 1701-curl-range
Conflicts: mod/oexchange.php mod/uimport.php
This commit is contained in:
commit
e67133ef56
162 changed files with 798 additions and 757 deletions
2
LICENSE
2
LICENSE
|
@ -1,5 +1,5 @@
|
||||||
Friendica Communications Server
|
Friendica Communications Server
|
||||||
Copyright (c) 2010-2016 the Friendica Project
|
Copyright (c) 2010-2017 the Friendica Project
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published by
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
8
boot.php
8
boot.php
|
@ -1540,7 +1540,7 @@ function check_db() {
|
||||||
* Sets the base url for use in cmdline programs which don't have
|
* Sets the base url for use in cmdline programs which don't have
|
||||||
* $_SERVER variables
|
* $_SERVER variables
|
||||||
*/
|
*/
|
||||||
function check_url(App &$a) {
|
function check_url(App $a) {
|
||||||
|
|
||||||
$url = get_config('system','url');
|
$url = get_config('system','url');
|
||||||
|
|
||||||
|
@ -1562,7 +1562,7 @@ function check_url(App &$a) {
|
||||||
/**
|
/**
|
||||||
* @brief Automatic database updates
|
* @brief Automatic database updates
|
||||||
*/
|
*/
|
||||||
function update_db(App &$a) {
|
function update_db(App $a) {
|
||||||
$build = get_config('system','build');
|
$build = get_config('system','build');
|
||||||
if(! x($build))
|
if(! x($build))
|
||||||
$build = set_config('system','build',DB_UPDATE_VERSION);
|
$build = set_config('system','build',DB_UPDATE_VERSION);
|
||||||
|
@ -1678,7 +1678,7 @@ function run_update_function($x) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function check_plugins(App &$a) {
|
function check_plugins(App $a) {
|
||||||
|
|
||||||
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
|
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r))
|
||||||
|
@ -2414,7 +2414,7 @@ function get_temppath() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @deprecated
|
/// @deprecated
|
||||||
function set_template_engine(App &$a, $engine = 'internal') {
|
function set_template_engine(App $a, $engine = 'internal') {
|
||||||
/// @note This function is no longer necessary, but keep it as a wrapper to the class method
|
/// @note This function is no longer necessary, but keep it as a wrapper to the class method
|
||||||
/// to avoid breaking themes again unnecessarily
|
/// to avoid breaking themes again unnecessarily
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ Arguments
|
||||||
---
|
---
|
||||||
Your hook callback functions will be called with at least one and possibly two arguments
|
Your hook callback functions will be called with at least one and possibly two arguments
|
||||||
|
|
||||||
function myhook_function(&$a, &$b) {
|
function myhook_function(App $a, &$b) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,9 +77,9 @@ This will include:
|
||||||
$a->argc = 3
|
$a->argc = 3
|
||||||
$a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
|
$a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
|
||||||
|
|
||||||
Your module functions will often contain the function plugin_name_content(App &$a), which defines and returns the page body content.
|
Your module functions will often contain the function plugin_name_content(App $a), which defines and returns the page body content.
|
||||||
They may also contain plugin_name_post(App &$a) which is called before the _content function and typically handles the results of POST forms.
|
They may also contain plugin_name_post(App $a) which is called before the _content function and typically handles the results of POST forms.
|
||||||
You may also have plugin_name_init(App &$a) which is called very early on and often does module initialisation.
|
You may also have plugin_name_init(App $a) which is called very early on and often does module initialisation.
|
||||||
|
|
||||||
Templates
|
Templates
|
||||||
---
|
---
|
||||||
|
@ -285,7 +285,7 @@ $b is an array with:
|
||||||
is called after the other queries have passed.
|
is called after the other queries have passed.
|
||||||
The registered function can add, change or remove the acl_lookup() variables.
|
The registered function can add, change or remove the acl_lookup() variables.
|
||||||
|
|
||||||
'results' => array of the acl_lookup() vars
|
'results' => array of the acl_lookup() vars
|
||||||
|
|
||||||
|
|
||||||
Complete list of hook callbacks
|
Complete list of hook callbacks
|
||||||
|
|
|
@ -32,7 +32,7 @@ Let's say you have a php file in "include/" that define a very useful class:
|
||||||
file: include/ItemsManager.php
|
file: include/ItemsManager.php
|
||||||
<?php
|
<?php
|
||||||
namespace \Friendica;
|
namespace \Friendica;
|
||||||
|
|
||||||
class ItemsManager {
|
class ItemsManager {
|
||||||
public function getAll() { ... }
|
public function getAll() { ... }
|
||||||
public function getByID($id) { ... }
|
public function getByID($id) { ... }
|
||||||
|
@ -67,11 +67,11 @@ The code will be something like:
|
||||||
```
|
```
|
||||||
file: mod/network.php
|
file: mod/network.php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function network_content(App &$a) {
|
function network_content(App $a) {
|
||||||
$itemsmanager = new \Friendica\ItemsManager();
|
$itemsmanager = new \Friendica\ItemsManager();
|
||||||
$items = $itemsmanager->getAll();
|
$items = $itemsmanager->getAll();
|
||||||
|
|
||||||
// pass $items to template
|
// pass $items to template
|
||||||
// return result
|
// return result
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ Going further: now we have a bunch of "*Manager" classes that cause some code du
|
||||||
file: include/BaseManager.php
|
file: include/BaseManager.php
|
||||||
<?php
|
<?php
|
||||||
namespace \Friendica;
|
namespace \Friendica;
|
||||||
|
|
||||||
class BaseManager {
|
class BaseManager {
|
||||||
public function thatFunctionEveryManagerUses() { ... }
|
public function thatFunctionEveryManagerUses() { ... }
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ and then let's change the ItemsManager class to use this code
|
||||||
file: include/ItemsManager.php
|
file: include/ItemsManager.php
|
||||||
<?php
|
<?php
|
||||||
namespace \Friendica;
|
namespace \Friendica;
|
||||||
|
|
||||||
class ItemsManager extends BaseManager {
|
class ItemsManager extends BaseManager {
|
||||||
public function getAll() { ... }
|
public function getAll() { ... }
|
||||||
public function getByID($id) { ... }
|
public function getByID($id) { ... }
|
||||||
|
@ -110,9 +110,9 @@ It works with the "BaseManager" example here, it works when we need to call stat
|
||||||
|
|
||||||
```
|
```
|
||||||
file: include/dfrn.php
|
file: include/dfrn.php
|
||||||
<?php
|
<?php
|
||||||
namespace \Friendica;
|
namespace \Friendica;
|
||||||
|
|
||||||
class dfrn {
|
class dfrn {
|
||||||
public static function mail($item, $owner) { ... }
|
public static function mail($item, $owner) { ... }
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ It works with the "BaseManager" example here, it works when we need to call stat
|
||||||
```
|
```
|
||||||
file: mod/mail.php
|
file: mod/mail.php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
mail_post($a){
|
mail_post($a){
|
||||||
...
|
...
|
||||||
\Friendica\dfrn::mail($item, $owner);
|
\Friendica\dfrn::mail($item, $owner);
|
||||||
|
@ -134,15 +134,15 @@ If your code is in same namespace as the class you need, you don't need to prepe
|
||||||
```
|
```
|
||||||
file: include/delivery.php
|
file: include/delivery.php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace \Friendica;
|
namespace \Friendica;
|
||||||
|
|
||||||
// this is the same content of current include/delivery.php,
|
// this is the same content of current include/delivery.php,
|
||||||
// but has been declared to be in "Friendica" namespace
|
// but has been declared to be in "Friendica" namespace
|
||||||
|
|
||||||
[...]
|
[...]
|
||||||
switch($contact['network']) {
|
switch($contact['network']) {
|
||||||
|
|
||||||
case NETWORK_DFRN:
|
case NETWORK_DFRN:
|
||||||
if ($mail) {
|
if ($mail) {
|
||||||
$item['body'] = ...
|
$item['body'] = ...
|
||||||
|
@ -160,11 +160,11 @@ But if you want to use classes from another library, you need to use the full na
|
||||||
|
|
||||||
```
|
```
|
||||||
<?php
|
<?php
|
||||||
namespace \Frienidca;
|
namespace \Friendica;
|
||||||
|
|
||||||
class Diaspora {
|
class Diaspora {
|
||||||
public function md2bbcode() {
|
public function md2bbcode() {
|
||||||
$html = \Michelf\MarkdownExtra::defaultTransform($text);
|
$html = \Michelf\MarkdownExtra::defaultTransform($text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -173,13 +173,13 @@ if you use that class in many places of the code and you don't want to write the
|
||||||
|
|
||||||
```
|
```
|
||||||
<?php
|
<?php
|
||||||
namespace \Frienidca;
|
namespace \Friendica;
|
||||||
|
|
||||||
use \Michelf\MarkdownExtra;
|
use \Michelf\MarkdownExtra;
|
||||||
|
|
||||||
class Diaspora {
|
class Diaspora {
|
||||||
public function md2bbcode() {
|
public function md2bbcode() {
|
||||||
$html = MarkdownExtra::defaultTransform($text);
|
$html = MarkdownExtra::defaultTransform($text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -190,7 +190,7 @@ You can go more deep if you want to, like:
|
||||||
```
|
```
|
||||||
<?php
|
<?php
|
||||||
namespace \Friendica\Network;
|
namespace \Friendica\Network;
|
||||||
|
|
||||||
class DFRN {
|
class DFRN {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -200,7 +200,7 @@ or
|
||||||
```
|
```
|
||||||
<?php
|
<?php
|
||||||
namespace \Friendica\DBA;
|
namespace \Friendica\DBA;
|
||||||
|
|
||||||
class MySQL {
|
class MySQL {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -40,7 +40,7 @@ Argumente
|
||||||
|
|
||||||
Deine Hook-Callback-Funktion wird mit mindestens einem und bis zu zwei Argumenten aufgerufen
|
Deine Hook-Callback-Funktion wird mit mindestens einem und bis zu zwei Argumenten aufgerufen
|
||||||
|
|
||||||
function myhook_function(&$a, &$b) {
|
function myhook_function(App $a, &$b) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,9 +67,9 @@ So würde http://example.com/plugin/arg1/arg2 nach einem Modul "plugin" suchen u
|
||||||
$a->argc = 3
|
$a->argc = 3
|
||||||
$a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
|
$a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
|
||||||
|
|
||||||
Deine Modulfunktionen umfassen oft die Funktion plugin_name_content(App &$a), welche den Seiteninhalt definiert und zurückgibt.
|
Deine Modulfunktionen umfassen oft die Funktion plugin_name_content(App $a), welche den Seiteninhalt definiert und zurückgibt.
|
||||||
Sie können auch plugin_name_post(App &$a) umfassen, welches vor der content-Funktion aufgerufen wird und normalerweise die Resultate der POST-Formulare handhabt.
|
Sie können auch plugin_name_post(App $a) umfassen, welches vor der content-Funktion aufgerufen wird und normalerweise die Resultate der POST-Formulare handhabt.
|
||||||
Du kannst ebenso plugin_name_init(App &$a) nutzen, was oft frühzeitig aufgerufen wird und das Modul initialisert.
|
Du kannst ebenso plugin_name_init(App $a) nutzen, was oft frühzeitig aufgerufen wird und das Modul initialisert.
|
||||||
|
|
||||||
|
|
||||||
Derzeitige Hooks
|
Derzeitige Hooks
|
||||||
|
@ -311,7 +311,7 @@ mod/photos.php: call_hooks('photo_post_end',intval($item_id));
|
||||||
|
|
||||||
mod/photos.php: call_hooks('photo_upload_form',$ret);
|
mod/photos.php: call_hooks('photo_upload_form',$ret);
|
||||||
|
|
||||||
mod/friendica.php: call_hooks('about_hook', $o);
|
mod/friendica.php: call_hooks('about_hook', $o);
|
||||||
|
|
||||||
mod/editpost.php: call_hooks('jot_tool', $jotplugins);
|
mod/editpost.php: call_hooks('jot_tool', $jotplugins);
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ the 1st part of the line is the name of the CSS file (without the .css) the 2nd
|
||||||
Calling the t() function with the common name makes the string translateable.
|
Calling the t() function with the common name makes the string translateable.
|
||||||
The selected 1st part will be saved in the database by the theme_post function.
|
The selected 1st part will be saved in the database by the theme_post function.
|
||||||
|
|
||||||
function theme_post(App &$a){
|
function theme_post(App $a){
|
||||||
// non local users shall not pass
|
// non local users shall not pass
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
@ -168,7 +168,7 @@ The content of this file should be something like
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
/* meta informations for the theme, see below */
|
/* meta informations for the theme, see below */
|
||||||
function duepuntozero_lr_init(App &$a) {
|
function duepuntozero_lr_init(App $a) {
|
||||||
$a-> theme_info = array(
|
$a-> theme_info = array(
|
||||||
'extends' => 'duepuntozero'.
|
'extends' => 'duepuntozero'.
|
||||||
);
|
);
|
||||||
|
@ -251,7 +251,7 @@ Next crucial part of the theme.php file is a definition of an init function.
|
||||||
The name of the function is <theme-name>_init.
|
The name of the function is <theme-name>_init.
|
||||||
So in the case of quattro it is
|
So in the case of quattro it is
|
||||||
|
|
||||||
function quattro_init(App &$a) {
|
function quattro_init(App $a) {
|
||||||
$a->theme_info = array();
|
$a->theme_info = array();
|
||||||
set_template_engine($a, 'smarty3');
|
set_template_engine($a, 'smarty3');
|
||||||
}
|
}
|
||||||
|
|
|
@ -612,7 +612,7 @@ function get_contact($url, $uid = 0, $no_update = false) {
|
||||||
*
|
*
|
||||||
* @return string posts in HTML
|
* @return string posts in HTML
|
||||||
*/
|
*/
|
||||||
function posts_from_gcontact($a, $gcontact_id) {
|
function posts_from_gcontact(App $a, $gcontact_id) {
|
||||||
|
|
||||||
require_once('include/conversation.php');
|
require_once('include/conversation.php');
|
||||||
|
|
||||||
|
@ -664,7 +664,7 @@ function posts_from_gcontact($a, $gcontact_id) {
|
||||||
*
|
*
|
||||||
* @return string posts in HTML
|
* @return string posts in HTML
|
||||||
*/
|
*/
|
||||||
function posts_from_contact_url($a, $contact_url) {
|
function posts_from_contact_url(App $a, $contact_url) {
|
||||||
|
|
||||||
require_once('include/conversation.php');
|
require_once('include/conversation.php');
|
||||||
|
|
||||||
|
|
|
@ -283,7 +283,7 @@ class Photo {
|
||||||
do {
|
do {
|
||||||
|
|
||||||
// FIXME - implement horizantal bias for scaling as in followin GD functions
|
// FIXME - implement horizantal bias for scaling as in followin GD functions
|
||||||
// to allow very tall images to be constrained only horizontally.
|
// to allow very tall images to be constrained only horizontally.
|
||||||
|
|
||||||
$this->image->scaleImage($dest_width, $dest_height);
|
$this->image->scaleImage($dest_width, $dest_height);
|
||||||
} while ($this->image->nextImage());
|
} while ($this->image->nextImage());
|
||||||
|
@ -943,7 +943,7 @@ function scale_image($width, $height, $max) {
|
||||||
return array("width" => $dest_width, "height" => $dest_height);
|
return array("width" => $dest_width, "height" => $dest_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
function store_photo($a, $uid, $imagedata = "", $url = "") {
|
function store_photo(App $a, $uid, $imagedata = "", $url = "") {
|
||||||
$r = q("SELECT `user`.`nickname`, `user`.`page-flags`, `contact`.`id` FROM `user` INNER JOIN `contact` on `user`.`uid` = `contact`.`uid`
|
$r = q("SELECT `user`.`nickname`, `user`.`page-flags`, `contact`.`id` FROM `user` INNER JOIN `contact` on `user`.`uid` = `contact`.`uid`
|
||||||
WHERE `user`.`uid` = %d AND `user`.`blocked` = 0 AND `contact`.`self` = 1 LIMIT 1",
|
WHERE `user`.`uid` = %d AND `user`.`blocked` = 0 AND `contact`.`self` = 1 LIMIT 1",
|
||||||
intval($uid));
|
intval($uid));
|
||||||
|
|
|
@ -372,7 +372,7 @@ function populate_acl($user = null, $show_jotnets = false) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function construct_acl_data(&$a, $user) {
|
function construct_acl_data(App $a, $user) {
|
||||||
|
|
||||||
// Get group and contact information for html ACL selector
|
// Get group and contact information for html ACL selector
|
||||||
$acl_data = acl_lookup($a, 'html');
|
$acl_data = acl_lookup($a, 'html');
|
||||||
|
@ -404,7 +404,7 @@ function construct_acl_data(&$a, $user) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function acl_lookup(&$a, $out_type = 'json') {
|
function acl_lookup(App $a, $out_type = 'json') {
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return '';
|
return '';
|
||||||
|
@ -687,11 +687,11 @@ function acl_lookup(&$a, $out_type = 'json') {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief Searching for global contacts for autocompletion
|
* @brief Searching for global contacts for autocompletion
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return array with the search results
|
* @return array with the search results
|
||||||
*/
|
*/
|
||||||
function navbar_complete(App &$a) {
|
function navbar_complete(App $a) {
|
||||||
|
|
||||||
// logger('navbar_complete');
|
// logger('navbar_complete');
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@
|
||||||
* @hook 'logged_in'
|
* @hook 'logged_in'
|
||||||
* array $user logged user record
|
* array $user logged user record
|
||||||
*/
|
*/
|
||||||
function api_login(App &$a){
|
function api_login(App $a){
|
||||||
// login with oauth
|
// login with oauth
|
||||||
try{
|
try{
|
||||||
$oauth = new FKOAuth1();
|
$oauth = new FKOAuth1();
|
||||||
|
@ -251,7 +251,7 @@
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string API call result
|
* @return string API call result
|
||||||
*/
|
*/
|
||||||
function api_call(App &$a){
|
function api_call(App $a){
|
||||||
global $API, $called_api;
|
global $API, $called_api;
|
||||||
|
|
||||||
$type="json";
|
$type="json";
|
||||||
|
@ -404,7 +404,7 @@
|
||||||
* @param array $user_info
|
* @param array $user_info
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function api_rss_extra(&$a, $arr, $user_info){
|
function api_rss_extra(App $a, $arr, $user_info){
|
||||||
if (is_null($user_info)) $user_info = api_get_user($a);
|
if (is_null($user_info)) $user_info = api_get_user($a);
|
||||||
$arr['$user'] = $user_info;
|
$arr['$user'] = $user_info;
|
||||||
$arr['$rss'] = array(
|
$arr['$rss'] = array(
|
||||||
|
@ -444,7 +444,7 @@
|
||||||
* @param int|string $contact_id Contact ID or URL
|
* @param int|string $contact_id Contact ID or URL
|
||||||
* @param string $type Return type (for errors)
|
* @param string $type Return type (for errors)
|
||||||
*/
|
*/
|
||||||
function api_get_user(&$a, $contact_id = Null, $type = "json"){
|
function api_get_user(App $a, $contact_id = Null, $type = "json"){
|
||||||
global $called_api;
|
global $called_api;
|
||||||
$user = null;
|
$user = null;
|
||||||
$extra_query = "";
|
$extra_query = "";
|
||||||
|
@ -712,7 +712,7 @@
|
||||||
* @param array $item : item from db
|
* @param array $item : item from db
|
||||||
* @return array(array:author, array:owner)
|
* @return array(array:author, array:owner)
|
||||||
*/
|
*/
|
||||||
function api_item_get_user(&$a, $item) {
|
function api_item_get_user(App $a, $item) {
|
||||||
|
|
||||||
$status_user = api_get_user($a, $item["author-link"]);
|
$status_user = api_get_user($a, $item["author-link"]);
|
||||||
|
|
||||||
|
@ -2451,7 +2451,7 @@
|
||||||
'homepage' => $profile['homepage'],
|
'homepage' => $profile['homepage'],
|
||||||
'users' => null);
|
'users' => null);
|
||||||
return $profile;
|
return $profile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2874,14 +2874,14 @@
|
||||||
// BadRequestException if no id specified (for clients using Twitter API)
|
// BadRequestException if no id specified (for clients using Twitter API)
|
||||||
if ($id == 0) throw new BadRequestException('Message id not specified');
|
if ($id == 0) throw new BadRequestException('Message id not specified');
|
||||||
|
|
||||||
// add parent-uri to sql command if specified by calling app
|
// add parent-uri to sql command if specified by calling app
|
||||||
$sql_extra = ($parenturi != "" ? " AND `parent-uri` = '" . dbesc($parenturi) . "'" : "");
|
$sql_extra = ($parenturi != "" ? " AND `parent-uri` = '" . dbesc($parenturi) . "'" : "");
|
||||||
|
|
||||||
// get data of the specified message id
|
// get data of the specified message id
|
||||||
$r = q("SELECT `id` FROM `mail` WHERE `uid` = %d AND `id` = %d" . $sql_extra,
|
$r = q("SELECT `id` FROM `mail` WHERE `uid` = %d AND `id` = %d" . $sql_extra,
|
||||||
intval($uid),
|
intval($uid),
|
||||||
intval($id));
|
intval($id));
|
||||||
|
|
||||||
// error message if specified id is not in database
|
// error message if specified id is not in database
|
||||||
if (!dbm::is_result($r)) {
|
if (!dbm::is_result($r)) {
|
||||||
if ($verbose == "true") {
|
if ($verbose == "true") {
|
||||||
|
@ -2893,8 +2893,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete message
|
// delete message
|
||||||
$result = q("DELETE FROM `mail` WHERE `uid` = %d AND `id` = %d" . $sql_extra,
|
$result = q("DELETE FROM `mail` WHERE `uid` = %d AND `id` = %d" . $sql_extra,
|
||||||
intval($uid),
|
intval($uid),
|
||||||
intval($id));
|
intval($id));
|
||||||
|
|
||||||
if ($verbose == "true") {
|
if ($verbose == "true") {
|
||||||
|
@ -3860,7 +3860,7 @@
|
||||||
|
|
||||||
// get data of the specified message id
|
// get data of the specified message id
|
||||||
$r = q("SELECT `id` FROM `mail` WHERE `id` = %d AND `uid` = %d",
|
$r = q("SELECT `id` FROM `mail` WHERE `id` = %d AND `uid` = %d",
|
||||||
intval($id),
|
intval($id),
|
||||||
intval($uid));
|
intval($uid));
|
||||||
// error message if specified id is not in database
|
// error message if specified id is not in database
|
||||||
if (!dbm::is_result($r)) {
|
if (!dbm::is_result($r)) {
|
||||||
|
@ -3869,8 +3869,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// update seen indicator
|
// update seen indicator
|
||||||
$result = q("UPDATE `mail` SET `seen` = 1 WHERE `id` = %d AND `uid` = %d",
|
$result = q("UPDATE `mail` SET `seen` = 1 WHERE `id` = %d AND `uid` = %d",
|
||||||
intval($id),
|
intval($id),
|
||||||
intval($uid));
|
intval($uid));
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
@ -3921,7 +3921,7 @@
|
||||||
// message if nothing was found
|
// message if nothing was found
|
||||||
if (!dbm::is_result($r))
|
if (!dbm::is_result($r))
|
||||||
$success = array('success' => false, 'search_results' => 'problem with query');
|
$success = array('success' => false, 'search_results' => 'problem with query');
|
||||||
else if (count($r) == 0)
|
else if (count($r) == 0)
|
||||||
$success = array('success' => false, 'search_results' => 'nothing found');
|
$success = array('success' => false, 'search_results' => 'nothing found');
|
||||||
else {
|
else {
|
||||||
$ret = Array();
|
$ret = Array();
|
||||||
|
|
|
@ -466,7 +466,7 @@ function item_condition() {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!function_exists('conversation')) {
|
if(!function_exists('conversation')) {
|
||||||
function conversation(&$a, $items, $mode, $update, $preview = false) {
|
function conversation(App $a, $items, $mode, $update, $preview = false) {
|
||||||
|
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/Contact.php');
|
require_once('include/Contact.php');
|
||||||
|
|
|
@ -264,8 +264,9 @@ function cron_poll_contacts($argc, $argv) {
|
||||||
intval($c['id'])
|
intval($c['id'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (dbm::is_result($res))
|
if (!dbm::is_result($res)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
foreach($res as $contact) {
|
foreach($res as $contact) {
|
||||||
|
|
||||||
|
@ -343,7 +344,7 @@ function cron_poll_contacts($argc, $argv) {
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function cron_clear_cache(App &$a) {
|
function cron_clear_cache(App $a) {
|
||||||
|
|
||||||
$last = get_config('system','cache_last_cleared');
|
$last = get_config('system','cache_last_cleared');
|
||||||
|
|
||||||
|
@ -430,7 +431,7 @@ function cron_clear_cache(App &$a) {
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function cron_repair_diaspora(App &$a) {
|
function cron_repair_diaspora(App $a) {
|
||||||
$r = q("SELECT `id`, `url` FROM `contact`
|
$r = q("SELECT `id`, `url` FROM `contact`
|
||||||
WHERE `network` = '%s' AND (`batch` = '' OR `notify` = '' OR `poll` = '' OR pubkey = '')
|
WHERE `network` = '%s' AND (`batch` = '' OR `notify` = '' OR `poll` = '' OR pubkey = '')
|
||||||
ORDER BY RAND() LIMIT 50", dbesc(NETWORK_DIASPORA));
|
ORDER BY RAND() LIMIT 50", dbesc(NETWORK_DIASPORA));
|
||||||
|
|
|
@ -10,7 +10,7 @@ require_once("include/dfrn.php");
|
||||||
function delivery_run(&$argv, &$argc){
|
function delivery_run(&$argv, &$argc){
|
||||||
global $a, $db;
|
global $a, $db;
|
||||||
|
|
||||||
if (is_null($a)){
|
if (is_null($a)) {
|
||||||
$a = new App;
|
$a = new App;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,8 +32,9 @@ function delivery_run(&$argv, &$argc){
|
||||||
|
|
||||||
load_hooks();
|
load_hooks();
|
||||||
|
|
||||||
if ($argc < 3)
|
if ($argc < 3) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$a->set_baseurl(get_config('system','url'));
|
$a->set_baseurl(get_config('system','url'));
|
||||||
|
|
||||||
|
@ -42,10 +43,11 @@ function delivery_run(&$argv, &$argc){
|
||||||
$cmd = $argv[1];
|
$cmd = $argv[1];
|
||||||
$item_id = intval($argv[2]);
|
$item_id = intval($argv[2]);
|
||||||
|
|
||||||
for($x = 3; $x < $argc; $x ++) {
|
for ($x = 3; $x < $argc; $x ++) {
|
||||||
|
|
||||||
$contact_id = intval($argv[$x]);
|
$contact_id = intval($argv[$x]);
|
||||||
|
|
||||||
|
/// @todo When switching completely to the worker we won't need this anymore
|
||||||
// Some other process may have delivered this item already.
|
// Some other process may have delivered this item already.
|
||||||
|
|
||||||
$r = q("SELECT * FROM `deliverq` WHERE `cmd` = '%s' AND `item` = %d AND `contact` = %d LIMIT 1",
|
$r = q("SELECT * FROM `deliverq` WHERE `cmd` = '%s' AND `item` = %d AND `contact` = %d LIMIT 1",
|
||||||
|
@ -57,8 +59,9 @@ function delivery_run(&$argv, &$argc){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($a->maxload_reached())
|
if ($a->maxload_reached()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// It's ours to deliver. Remove it from the queue.
|
// It's ours to deliver. Remove it from the queue.
|
||||||
|
|
||||||
|
@ -68,8 +71,9 @@ function delivery_run(&$argv, &$argc){
|
||||||
dbesc($contact_id)
|
dbesc($contact_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$item_id || !$contact_id)
|
if (!$item_id || !$contact_id) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$expire = false;
|
$expire = false;
|
||||||
$mail = false;
|
$mail = false;
|
||||||
|
@ -90,14 +94,13 @@ function delivery_run(&$argv, &$argc){
|
||||||
$message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1",
|
$message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1",
|
||||||
intval($item_id)
|
intval($item_id)
|
||||||
);
|
);
|
||||||
if (!count($message)){
|
if (!count($message)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$uid = $message[0]['uid'];
|
$uid = $message[0]['uid'];
|
||||||
$recipients[] = $message[0]['contact-id'];
|
$recipients[] = $message[0]['contact-id'];
|
||||||
$item = $message[0];
|
$item = $message[0];
|
||||||
}
|
} elseif ($cmd === 'expire') {
|
||||||
elseif ($cmd === 'expire') {
|
|
||||||
$normal_mode = false;
|
$normal_mode = false;
|
||||||
$expire = true;
|
$expire = true;
|
||||||
$items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1
|
$items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1
|
||||||
|
@ -106,18 +109,19 @@ function delivery_run(&$argv, &$argc){
|
||||||
);
|
);
|
||||||
$uid = $item_id;
|
$uid = $item_id;
|
||||||
$item_id = 0;
|
$item_id = 0;
|
||||||
if (!count($items))
|
if (!count($items)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
elseif ($cmd === 'suggest') {
|
} elseif ($cmd === 'suggest') {
|
||||||
$normal_mode = false;
|
$normal_mode = false;
|
||||||
$fsuggest = true;
|
$fsuggest = true;
|
||||||
|
|
||||||
$suggest = q("SELECT * FROM `fsuggest` WHERE `id` = %d LIMIT 1",
|
$suggest = q("SELECT * FROM `fsuggest` WHERE `id` = %d LIMIT 1",
|
||||||
intval($item_id)
|
intval($item_id)
|
||||||
);
|
);
|
||||||
if (!count($suggest))
|
if (!count($suggest)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
$uid = $suggest[0]['uid'];
|
$uid = $suggest[0]['uid'];
|
||||||
$recipients[] = $suggest[0]['cid'];
|
$recipients[] = $suggest[0]['cid'];
|
||||||
$item = $suggest[0];
|
$item = $suggest[0];
|
||||||
|
@ -151,26 +155,33 @@ function delivery_run(&$argv, &$argc){
|
||||||
|
|
||||||
$icontacts = null;
|
$icontacts = null;
|
||||||
$contacts_arr = array();
|
$contacts_arr = array();
|
||||||
foreach($items as $item)
|
foreach ($items as $item) {
|
||||||
if (!in_array($item['contact-id'],$contacts_arr))
|
if (!in_array($item['contact-id'],$contacts_arr)) {
|
||||||
$contacts_arr[] = intval($item['contact-id']);
|
$contacts_arr[] = intval($item['contact-id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (count($contacts_arr)) {
|
if (count($contacts_arr)) {
|
||||||
$str_contacts = implode(',',$contacts_arr);
|
$str_contacts = implode(',',$contacts_arr);
|
||||||
$icontacts = q("SELECT * FROM `contact`
|
$icontacts = q("SELECT * FROM `contact`
|
||||||
WHERE `id` IN ( $str_contacts ) "
|
WHERE `id` IN ( $str_contacts ) "
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ( !($icontacts && count($icontacts)))
|
if ( !($icontacts && count($icontacts))) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// avoid race condition with deleting entries
|
// avoid race condition with deleting entries
|
||||||
|
|
||||||
if ($items[0]['deleted']) {
|
if ($items[0]['deleted']) {
|
||||||
foreach($items as $item)
|
foreach ($items as $item) {
|
||||||
$item['deleted'] = 1;
|
$item['deleted'] = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((count($items) == 1) && ($items[0]['uri'] === $items[0]['parent-uri'])) {
|
// When commenting too fast after delivery, a post wasn't recognized as top level post.
|
||||||
|
// The count then showed more than one entry. The additional check should help.
|
||||||
|
// The check for the "count" should be superfluous, but I'm not totally sure by now, so we keep it.
|
||||||
|
if ((($items[0]['id'] == $item_id) || (count($items) == 1)) && ($items[0]['uri'] === $items[0]['parent-uri'])) {
|
||||||
logger('delivery: top level post');
|
logger('delivery: top level post');
|
||||||
$top_level = true;
|
$top_level = true;
|
||||||
}
|
}
|
||||||
|
@ -184,8 +195,9 @@ function delivery_run(&$argv, &$argc){
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!dbm::is_result($r))
|
if (!dbm::is_result($r)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$owner = $r[0];
|
$owner = $r[0];
|
||||||
|
|
||||||
|
@ -217,9 +229,9 @@ function delivery_run(&$argv, &$argc){
|
||||||
|
|
||||||
|
|
||||||
$localhost = $a->get_hostname();
|
$localhost = $a->get_hostname();
|
||||||
if (strpos($localhost,':'))
|
if (strpos($localhost,':')) {
|
||||||
$localhost = substr($localhost,0,strpos($localhost,':'));
|
$localhost = substr($localhost,0,strpos($localhost,':'));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Be VERY CAREFUL if you make any changes to the following line. Seemingly innocuous changes
|
* Be VERY CAREFUL if you make any changes to the following line. Seemingly innocuous changes
|
||||||
|
@ -254,12 +266,12 @@ function delivery_run(&$argv, &$argc){
|
||||||
intval($contact_id)
|
intval($contact_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r)) {
|
||||||
$contact = $r[0];
|
$contact = $r[0];
|
||||||
|
}
|
||||||
if ($contact['self'])
|
if ($contact['self']) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
$deliver_status = 0;
|
$deliver_status = 0;
|
||||||
|
|
||||||
logger("main delivery by delivery: followup=$followup mail=$mail fsuggest=$fsuggest relocate=$relocate - network ".$contact['network']);
|
logger("main delivery by delivery: followup=$followup mail=$mail fsuggest=$fsuggest relocate=$relocate - network ".$contact['network']);
|
||||||
|
@ -275,13 +287,14 @@ function delivery_run(&$argv, &$argc){
|
||||||
} elseif ($fsuggest) {
|
} elseif ($fsuggest) {
|
||||||
$atom = dfrn::fsuggest($item, $owner);
|
$atom = dfrn::fsuggest($item, $owner);
|
||||||
q("DELETE FROM `fsuggest` WHERE `id` = %d LIMIT 1", intval($item['id']));
|
q("DELETE FROM `fsuggest` WHERE `id` = %d LIMIT 1", intval($item['id']));
|
||||||
} elseif ($relocate)
|
} elseif ($relocate) {
|
||||||
$atom = dfrn::relocate($owner, $uid);
|
$atom = dfrn::relocate($owner, $uid);
|
||||||
elseif ($followup) {
|
} elseif ($followup) {
|
||||||
$msgitems = array();
|
$msgitems = array();
|
||||||
foreach($items as $item) { // there is only one item
|
foreach ($items as $item) { // there is only one item
|
||||||
if (!$item['parent'])
|
if (!$item['parent']) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if ($item['id'] == $item_id) {
|
if ($item['id'] == $item_id) {
|
||||||
logger('followup: item: '. print_r($item,true), LOGGER_DATA);
|
logger('followup: item: '. print_r($item,true), LOGGER_DATA);
|
||||||
$msgitems[] = $item;
|
$msgitems[] = $item;
|
||||||
|
@ -290,17 +303,20 @@ function delivery_run(&$argv, &$argc){
|
||||||
$atom = dfrn::entries($msgitems,$owner);
|
$atom = dfrn::entries($msgitems,$owner);
|
||||||
} else {
|
} else {
|
||||||
$msgitems = array();
|
$msgitems = array();
|
||||||
foreach($items as $item) {
|
foreach ($items as $item) {
|
||||||
if (!$item['parent'])
|
if (!$item['parent']) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// private emails may be in included in public conversations. Filter them.
|
// private emails may be in included in public conversations. Filter them.
|
||||||
if ($public_message && $item['private'])
|
if ($public_message && $item['private']) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$item_contact = get_item_contact($item,$icontacts);
|
$item_contact = get_item_contact($item,$icontacts);
|
||||||
if (!$item_contact)
|
if (!$item_contact) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ($normal_mode) {
|
if ($normal_mode) {
|
||||||
if ($item_id == $item['id'] || $item['id'] == $item['parent']) {
|
if ($item_id == $item['id'] || $item['id'] == $item['parent']) {
|
||||||
|
@ -326,10 +342,11 @@ function delivery_run(&$argv, &$argc){
|
||||||
if (link_compare($basepath,App::get_baseurl())) {
|
if (link_compare($basepath,App::get_baseurl())) {
|
||||||
|
|
||||||
$nickname = basename($contact['url']);
|
$nickname = basename($contact['url']);
|
||||||
if ($contact['issued-id'])
|
if ($contact['issued-id']) {
|
||||||
$sql_extra = sprintf(" AND `dfrn-id` = '%s' ", dbesc($contact['issued-id']));
|
$sql_extra = sprintf(" AND `dfrn-id` = '%s' ", dbesc($contact['issued-id']));
|
||||||
else
|
} else {
|
||||||
$sql_extra = sprintf(" AND `issued-id` = '%s' ", dbesc($contact['dfrn-id']));
|
$sql_extra = sprintf(" AND `issued-id` = '%s' ", dbesc($contact['dfrn-id']));
|
||||||
|
}
|
||||||
|
|
||||||
$x = q("SELECT `contact`.*, `contact`.`uid` AS `importer_uid`,
|
$x = q("SELECT `contact`.*, `contact`.`uid` AS `importer_uid`,
|
||||||
`contact`.`pubkey` AS `cpubkey`,
|
`contact`.`pubkey` AS `cpubkey`,
|
||||||
|
@ -362,19 +379,20 @@ function delivery_run(&$argv, &$argc){
|
||||||
|
|
||||||
// If we are setup as a soapbox we aren't accepting top level posts from this person
|
// If we are setup as a soapbox we aren't accepting top level posts from this person
|
||||||
|
|
||||||
if (($x[0]['page-flags'] == PAGE_SOAPBOX) AND $top_level)
|
if (($x[0]['page-flags'] == PAGE_SOAPBOX) AND $top_level) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
logger('mod-delivery: local delivery');
|
logger('mod-delivery: local delivery');
|
||||||
dfrn::import($atom, $x[0]);
|
dfrn::import($atom, $x[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!was_recently_delayed($contact['id']))
|
if (!was_recently_delayed($contact['id'])) {
|
||||||
$deliver_status = dfrn::deliver($owner,$contact,$atom);
|
$deliver_status = dfrn::deliver($owner,$contact,$atom);
|
||||||
else
|
} else {
|
||||||
$deliver_status = (-1);
|
$deliver_status = (-1);
|
||||||
|
}
|
||||||
|
|
||||||
logger('notifier: dfrn_delivery to '.$contact["url"].' with guid '.$target_item["guid"].' returns '.$deliver_status);
|
logger('notifier: dfrn_delivery to '.$contact["url"].' with guid '.$target_item["guid"].' returns '.$deliver_status);
|
||||||
|
|
||||||
|
@ -393,10 +411,12 @@ function delivery_run(&$argv, &$argc){
|
||||||
|
|
||||||
case NETWORK_OSTATUS:
|
case NETWORK_OSTATUS:
|
||||||
// Do not send to otatus if we are not configured to send to public networks
|
// Do not send to otatus if we are not configured to send to public networks
|
||||||
if ($owner['prvnets'])
|
if ($owner['prvnets']) {
|
||||||
break;
|
break;
|
||||||
if (get_config('system','ostatus_disabled') || get_config('system','dfrn_only'))
|
}
|
||||||
|
if (get_config('system','ostatus_disabled') || get_config('system','dfrn_only')) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// There is currently no code here to distribute anything to OStatus.
|
// There is currently no code here to distribute anything to OStatus.
|
||||||
// This is done in "notifier.php" (See "url_recipients" and "push_notify")
|
// This is done in "notifier.php" (See "url_recipients" and "push_notify")
|
||||||
|
@ -405,20 +425,22 @@ function delivery_run(&$argv, &$argc){
|
||||||
case NETWORK_MAIL:
|
case NETWORK_MAIL:
|
||||||
case NETWORK_MAIL2:
|
case NETWORK_MAIL2:
|
||||||
|
|
||||||
if (get_config('system','dfrn_only'))
|
if (get_config('system','dfrn_only')) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
// WARNING: does not currently convert to RFC2047 header encodings, etc.
|
// WARNING: does not currently convert to RFC2047 header encodings, etc.
|
||||||
|
|
||||||
$addr = $contact['addr'];
|
$addr = $contact['addr'];
|
||||||
if (!strlen($addr))
|
if (!strlen($addr)) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if ($cmd === 'wall-new' || $cmd === 'comment-new') {
|
if ($cmd === 'wall-new' || $cmd === 'comment-new') {
|
||||||
|
|
||||||
$it = null;
|
$it = null;
|
||||||
if ($cmd === 'wall-new')
|
if ($cmd === 'wall-new') {
|
||||||
$it = $items[0];
|
$it = $items[0];
|
||||||
else {
|
} else {
|
||||||
$r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($argv[2]),
|
intval($argv[2]),
|
||||||
intval($uid)
|
intval($uid)
|
||||||
|
@ -451,10 +473,12 @@ function delivery_run(&$argv, &$argc){
|
||||||
if ($reply_to) {
|
if ($reply_to) {
|
||||||
$headers = 'From: '.email_header_encode($local_user[0]['username'],'UTF-8').' <'.$reply_to.'>'."\n";
|
$headers = 'From: '.email_header_encode($local_user[0]['username'],'UTF-8').' <'.$reply_to.'>'."\n";
|
||||||
$headers .= 'Sender: '.$local_user[0]['email']."\n";
|
$headers .= 'Sender: '.$local_user[0]['email']."\n";
|
||||||
} else
|
} else {
|
||||||
$headers = 'From: '.email_header_encode($local_user[0]['username'],'UTF-8').' <'.$local_user[0]['email'].'>'."\n";
|
$headers = 'From: '.email_header_encode($local_user[0]['username'],'UTF-8').' <'.$local_user[0]['email'].'>'."\n";
|
||||||
} else
|
}
|
||||||
|
} else {
|
||||||
$headers = 'From: '. email_header_encode($local_user[0]['username'],'UTF-8') .' <'. t('noreply') .'@'.$a->get_hostname() .'>'. "\n";
|
$headers = 'From: '. email_header_encode($local_user[0]['username'],'UTF-8') .' <'. t('noreply') .'@'.$a->get_hostname() .'>'. "\n";
|
||||||
|
}
|
||||||
|
|
||||||
//if ($reply_to)
|
//if ($reply_to)
|
||||||
// $headers .= 'Reply-to: '.$reply_to . "\n";
|
// $headers .= 'Reply-to: '.$reply_to . "\n";
|
||||||
|
@ -478,9 +502,9 @@ function delivery_run(&$argv, &$argc){
|
||||||
dbesc($it['parent-uri']),
|
dbesc($it['parent-uri']),
|
||||||
intval($uid));
|
intval($uid));
|
||||||
|
|
||||||
if (dbm::is_result($r) AND ($r[0]['title'] != ''))
|
if (dbm::is_result($r) AND ($r[0]['title'] != '')) {
|
||||||
$subject = $r[0]['title'];
|
$subject = $r[0]['title'];
|
||||||
else {
|
} else {
|
||||||
$r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d LIMIT 1",
|
$r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($it['parent-uri']),
|
dbesc($it['parent-uri']),
|
||||||
intval($uid));
|
intval($uid));
|
||||||
|
|
|
@ -325,8 +325,9 @@ class Diaspora {
|
||||||
logger("delivering to: ".$rr["username"]);
|
logger("delivering to: ".$rr["username"]);
|
||||||
self::dispatch($rr,$msg);
|
self::dispatch($rr,$msg);
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
logger("No subscribers for ".$msg["author"]." ".print_r($msg, true));
|
logger("No subscribers for ".$msg["author"]." ".print_r($msg, true), LOGGER_DEBUG);
|
||||||
|
}
|
||||||
|
|
||||||
return $message_id;
|
return $message_id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,7 @@ function bbtoevent($s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sort_by_date(App &$a) {
|
function sort_by_date(App $a) {
|
||||||
|
|
||||||
usort($a,'ev_compare');
|
usort($a,'ev_compare');
|
||||||
return $a;
|
return $a;
|
||||||
|
@ -495,7 +495,7 @@ function get_event_strings() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get an event by its event ID
|
* @brief Get an event by its event ID
|
||||||
*
|
*
|
||||||
* @param type $owner_uid The User ID of the owner of the event
|
* @param type $owner_uid The User ID of the owner of the event
|
||||||
* @param type $event_params An assoziative array with
|
* @param type $event_params An assoziative array with
|
||||||
* int 'event_id' => The ID of the event in the event table
|
* int 'event_id' => The ID of the event in the event table
|
||||||
|
@ -523,15 +523,15 @@ function event_by_id($owner_uid = 0, $event_params, $sql_extra = '') {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get all events in a specific timeframe
|
* @brief Get all events in a specific timeframe
|
||||||
*
|
*
|
||||||
* @param int $owner_uid The User ID of the owner of the events
|
* @param int $owner_uid The User ID of the owner of the events
|
||||||
* @param array $event_params An assoziative array with
|
* @param array $event_params An assoziative array with
|
||||||
* int 'ignored' =>
|
* int 'ignored' =>
|
||||||
* string 'start' => Start time of the timeframe
|
* string 'start' => Start time of the timeframe
|
||||||
* string 'finish' => Finish time of the timeframe
|
* string 'finish' => Finish time of the timeframe
|
||||||
* string 'adjust_start' =>
|
|
||||||
* string 'adjust_start' =>
|
* string 'adjust_start' =>
|
||||||
*
|
* string 'adjust_start' =>
|
||||||
|
*
|
||||||
* @param string $sql_extra Additional sql conditions (e.g. permission request)
|
* @param string $sql_extra Additional sql conditions (e.g. permission request)
|
||||||
* @return array Query results
|
* @return array Query results
|
||||||
*/
|
*/
|
||||||
|
@ -564,7 +564,7 @@ function events_by_date($owner_uid = 0, $event_params, $sql_extra = '') {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Convert an array query results in an arry which could be used by the events template
|
* @brief Convert an array query results in an arry which could be used by the events template
|
||||||
*
|
*
|
||||||
* @param array $arr Event query array
|
* @param array $arr Event query array
|
||||||
* @return array Event array for the template
|
* @return array Event array for the template
|
||||||
*/
|
*/
|
||||||
|
@ -623,11 +623,11 @@ function process_events ($arr) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Format event to export format (ical/csv)
|
* @brief Format event to export format (ical/csv)
|
||||||
*
|
*
|
||||||
* @param array $events Query result for events
|
* @param array $events Query result for events
|
||||||
* @param string $format The output format (ical/csv)
|
* @param string $format The output format (ical/csv)
|
||||||
* @param string $timezone The timezone of the user (not implemented yet)
|
* @param string $timezone The timezone of the user (not implemented yet)
|
||||||
*
|
*
|
||||||
* @return string Content according to selected export format
|
* @return string Content according to selected export format
|
||||||
*/
|
*/
|
||||||
function event_format_export ($events, $format = 'ical', $timezone) {
|
function event_format_export ($events, $format = 'ical', $timezone) {
|
||||||
|
@ -641,7 +641,7 @@ function event_format_export ($events, $format = 'ical', $timezone) {
|
||||||
$o = '"Subject", "Start Date", "Start Time", "Description", "End Date", "End Time", "Location"' . PHP_EOL;
|
$o = '"Subject", "Start Date", "Start Time", "Description", "End Date", "End Time", "Location"' . PHP_EOL;
|
||||||
|
|
||||||
foreach ($events as $event) {
|
foreach ($events as $event) {
|
||||||
/// @todo the time / date entries don't include any information about the
|
/// @todo the time / date entries don't include any information about the
|
||||||
// timezone the event is scheduled in :-/
|
// timezone the event is scheduled in :-/
|
||||||
$tmp1 = strtotime($event['start']);
|
$tmp1 = strtotime($event['start']);
|
||||||
$tmp2 = strtotime($event['finish']);
|
$tmp2 = strtotime($event['finish']);
|
||||||
|
@ -650,7 +650,7 @@ function event_format_export ($events, $format = 'ical', $timezone) {
|
||||||
$o .= '"'.$event['summary'].'", "'.strftime($date_format, $tmp1) .
|
$o .= '"'.$event['summary'].'", "'.strftime($date_format, $tmp1) .
|
||||||
'", "'.strftime($time_format, $tmp1).'", "'.$event['desc'] .
|
'", "'.strftime($time_format, $tmp1).'", "'.$event['desc'] .
|
||||||
'", "'.strftime($date_format, $tmp2) .
|
'", "'.strftime($date_format, $tmp2) .
|
||||||
'", "'.strftime($time_format, $tmp2) .
|
'", "'.strftime($time_format, $tmp2) .
|
||||||
'", "'.$event['location'].'"' . PHP_EOL;
|
'", "'.$event['location'].'"' . PHP_EOL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -672,7 +672,7 @@ function event_format_export ($events, $format = 'ical', $timezone) {
|
||||||
foreach ($events as $event) {
|
foreach ($events as $event) {
|
||||||
if ($event['adjust'] == 1) {
|
if ($event['adjust'] == 1) {
|
||||||
$UTC = 'Z';
|
$UTC = 'Z';
|
||||||
} else {
|
} else {
|
||||||
$UTC = '';
|
$UTC = '';
|
||||||
}
|
}
|
||||||
$o .= 'BEGIN:VEVENT' . PHP_EOL;
|
$o .= 'BEGIN:VEVENT' . PHP_EOL;
|
||||||
|
@ -716,16 +716,16 @@ function event_format_export ($events, $format = 'ical', $timezone) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get all events for a user ID
|
* @brief Get all events for a user ID
|
||||||
*
|
*
|
||||||
* The query for events is done permission sensitive
|
* The query for events is done permission sensitive
|
||||||
* If the user is the owner of the calendar he/she
|
* If the user is the owner of the calendar he/she
|
||||||
* will get all of his/her available events.
|
* will get all of his/her available events.
|
||||||
* If the user is only a visitor only the public events will
|
* If the user is only a visitor only the public events will
|
||||||
* be available
|
* be available
|
||||||
*
|
*
|
||||||
* @param int $uid The user ID
|
* @param int $uid The user ID
|
||||||
* @param int $sql_extra Additional sql conditions for permission
|
* @param int $sql_extra Additional sql conditions for permission
|
||||||
*
|
*
|
||||||
* @return array Query results
|
* @return array Query results
|
||||||
*/
|
*/
|
||||||
function events_by_uid($uid = 0, $sql_extra = '') {
|
function events_by_uid($uid = 0, $sql_extra = '') {
|
||||||
|
@ -736,8 +736,8 @@ function events_by_uid($uid = 0, $sql_extra = '') {
|
||||||
if($sql_extra == '')
|
if($sql_extra == '')
|
||||||
$sql_extra = " AND `allow_cid` = '' AND `allow_gid` = '' ";
|
$sql_extra = " AND `allow_cid` = '' AND `allow_gid` = '' ";
|
||||||
|
|
||||||
// does the user who requests happen to be the owner of the events
|
// does the user who requests happen to be the owner of the events
|
||||||
// requested? then show all of your events, otherwise only those that
|
// requested? then show all of your events, otherwise only those that
|
||||||
// don't have limitations set in allow_cid and allow_gid
|
// don't have limitations set in allow_cid and allow_gid
|
||||||
if (local_user() == $uid) {
|
if (local_user() == $uid) {
|
||||||
$r = q("SELECT `start`, `finish`, `adjust`, `summary`, `desc`, `location`, `nofinish`
|
$r = q("SELECT `start`, `finish`, `adjust`, `summary`, `desc`, `location`, `nofinish`
|
||||||
|
@ -756,7 +756,7 @@ function events_by_uid($uid = 0, $sql_extra = '') {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param int $uid The user ID
|
* @param int $uid The user ID
|
||||||
* @param string $format Output format (ical/csv)
|
* @param string $format Output format (ical/csv)
|
||||||
* @return array With the results
|
* @return array With the results
|
||||||
|
@ -764,7 +764,7 @@ function events_by_uid($uid = 0, $sql_extra = '') {
|
||||||
* string 'format' => The output format
|
* string 'format' => The output format
|
||||||
* string 'extension' => The file extension of the output format
|
* string 'extension' => The file extension of the output format
|
||||||
* string 'content' => The formatted output content
|
* string 'content' => The formatted output content
|
||||||
*
|
*
|
||||||
* @todo Respect authenticated users with events_by_uid()
|
* @todo Respect authenticated users with events_by_uid()
|
||||||
*/
|
*/
|
||||||
function event_export($uid, $format = 'ical') {
|
function event_export($uid, $format = 'ical') {
|
||||||
|
@ -815,7 +815,7 @@ function event_export($uid, $format = 'ical') {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the events widget
|
* @brief Get the events widget
|
||||||
*
|
*
|
||||||
* @return string Formated html of the evens widget
|
* @return string Formated html of the evens widget
|
||||||
*/
|
*/
|
||||||
function widget_events() {
|
function widget_events() {
|
||||||
|
@ -835,11 +835,11 @@ function widget_events() {
|
||||||
|
|
||||||
// Cal logged in user (test permission at foreign profile page)
|
// Cal logged in user (test permission at foreign profile page)
|
||||||
// If the $owner uid is available we know it is part of one of the profile pages (like /cal)
|
// If the $owner uid is available we know it is part of one of the profile pages (like /cal)
|
||||||
// So we have to test if if it's the own profile page of the logged in user
|
// So we have to test if if it's the own profile page of the logged in user
|
||||||
// or a foreign one. For foreign profile pages we need to check if the feature
|
// or a foreign one. For foreign profile pages we need to check if the feature
|
||||||
// for exporting the cal is enabled (otherwise the widget would appear for logged in users
|
// for exporting the cal is enabled (otherwise the widget would appear for logged in users
|
||||||
// on foreigen profile pages even if the widget is disabled)
|
// on foreigen profile pages even if the widget is disabled)
|
||||||
if(intval($owner_uid) && local_user() !== $owner_uid && ! feature_enabled($owner_uid, "export_calendar"))
|
if(intval($owner_uid) && local_user() !== $owner_uid && ! feature_enabled($owner_uid, "export_calendar"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If it's a kind of profile page (intval($owner_uid)) return if the user not logged in and
|
// If it's a kind of profile page (intval($owner_uid)) return if the user not logged in and
|
||||||
|
|
|
@ -31,7 +31,7 @@ require_once("mod/proxy.php");
|
||||||
* @param int $profile
|
* @param int $profile
|
||||||
* @param array $profiledata
|
* @param array $profiledata
|
||||||
*/
|
*/
|
||||||
function profile_load(&$a, $nickname, $profile = 0, $profiledata = array()) {
|
function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
|
||||||
|
|
||||||
$user = q("SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
|
$user = q("SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
|
||||||
dbesc($nickname)
|
dbesc($nickname)
|
||||||
|
@ -118,12 +118,12 @@ function profile_load(&$a, $nickname, $profile = 0, $profiledata = array()) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get all profil data of a local user
|
* @brief Get all profil data of a local user
|
||||||
*
|
*
|
||||||
* If the viewer is an authenticated remote viewer, the profile displayed is the
|
* If the viewer is an authenticated remote viewer, the profile displayed is the
|
||||||
* one that has been configured for his/her viewing in the Contact manager.
|
* one that has been configured for his/her viewing in the Contact manager.
|
||||||
* Passing a non-zero profile ID can also allow a preview of a selected profile
|
* Passing a non-zero profile ID can also allow a preview of a selected profile
|
||||||
* by the owner
|
* by the owner
|
||||||
*
|
*
|
||||||
* @param string $nickname
|
* @param string $nickname
|
||||||
* @param int $uid
|
* @param int $uid
|
||||||
* @param int $profile
|
* @param int $profile
|
||||||
|
@ -177,17 +177,17 @@ function get_profiledata_by_nick($nickname, $uid = 0, $profile = 0) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Formats a profile for display in the sidebar.
|
* @brief Formats a profile for display in the sidebar.
|
||||||
*
|
*
|
||||||
* It is very difficult to templatise the HTML completely
|
* It is very difficult to templatise the HTML completely
|
||||||
* because of all the conditional logic.
|
* because of all the conditional logic.
|
||||||
*
|
*
|
||||||
* @param array $profile
|
* @param array $profile
|
||||||
* @param int $block
|
* @param int $block
|
||||||
*
|
*
|
||||||
* @return HTML string stuitable for sidebar inclusion
|
* @return HTML string stuitable for sidebar inclusion
|
||||||
*
|
*
|
||||||
* @note Returns empty string if passed $profile is wrong type or not populated
|
* @note Returns empty string if passed $profile is wrong type or not populated
|
||||||
*
|
*
|
||||||
* @hooks 'profile_sidebar_enter'
|
* @hooks 'profile_sidebar_enter'
|
||||||
* array $profile - profile data
|
* array $profile - profile data
|
||||||
* @hooks 'profile_sidebar'
|
* @hooks 'profile_sidebar'
|
||||||
|
@ -598,7 +598,7 @@ function get_events() {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
function advanced_profile(App &$a) {
|
function advanced_profile(App $a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
$uid = $a->profile['uid'];
|
$uid = $a->profile['uid'];
|
||||||
|
@ -755,7 +755,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
|
||||||
array(
|
array(
|
||||||
'label'=>t('Status'),
|
'label'=>t('Status'),
|
||||||
'url' => $url,
|
'url' => $url,
|
||||||
'sel' => ((!isset($tab)&&$a->argv[0]=='profile')?'active':''),
|
'sel' => ((!isset($tab) && $a->argv[0]=='profile')?'active':''),
|
||||||
'title' => t('Status Messages and Posts'),
|
'title' => t('Status Messages and Posts'),
|
||||||
'id' => 'status-tab',
|
'id' => 'status-tab',
|
||||||
'accesskey' => 'm',
|
'accesskey' => 'm',
|
||||||
|
@ -771,7 +771,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
|
||||||
array(
|
array(
|
||||||
'label' => t('Photos'),
|
'label' => t('Photos'),
|
||||||
'url' => App::get_baseurl() . '/photos/' . $nickname,
|
'url' => App::get_baseurl() . '/photos/' . $nickname,
|
||||||
'sel' => ((!isset($tab)&&$a->argv[0]=='photos')?'active':''),
|
'sel' => ((!isset($tab) && $a->argv[0]=='photos')?'active':''),
|
||||||
'title' => t('Photo Albums'),
|
'title' => t('Photo Albums'),
|
||||||
'id' => 'photo-tab',
|
'id' => 'photo-tab',
|
||||||
'accesskey' => 'h',
|
'accesskey' => 'h',
|
||||||
|
@ -779,7 +779,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
|
||||||
array(
|
array(
|
||||||
'label' => t('Videos'),
|
'label' => t('Videos'),
|
||||||
'url' => App::get_baseurl() . '/videos/' . $nickname,
|
'url' => App::get_baseurl() . '/videos/' . $nickname,
|
||||||
'sel' => ((!isset($tab)&&$a->argv[0]=='videos')?'active':''),
|
'sel' => ((!isset($tab) && $a->argv[0]=='videos')?'active':''),
|
||||||
'title' => t('Videos'),
|
'title' => t('Videos'),
|
||||||
'id' => 'video-tab',
|
'id' => 'video-tab',
|
||||||
'accesskey' => 'v',
|
'accesskey' => 'v',
|
||||||
|
@ -791,7 +791,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
|
||||||
$tabs[] = array(
|
$tabs[] = array(
|
||||||
'label' => t('Events'),
|
'label' => t('Events'),
|
||||||
'url' => App::get_baseurl() . '/events',
|
'url' => App::get_baseurl() . '/events',
|
||||||
'sel' =>((!isset($tab)&&$a->argv[0]=='events')?'active':''),
|
'sel' =>((!isset($tab) && $a->argv[0]=='events')?'active':''),
|
||||||
'title' => t('Events and Calendar'),
|
'title' => t('Events and Calendar'),
|
||||||
'id' => 'events-tab',
|
'id' => 'events-tab',
|
||||||
'accesskey' => 'e',
|
'accesskey' => 'e',
|
||||||
|
@ -802,7 +802,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
|
||||||
$tabs[] = array(
|
$tabs[] = array(
|
||||||
'label' => t('Events'),
|
'label' => t('Events'),
|
||||||
'url' => App::get_baseurl() . '/cal/' . $nickname,
|
'url' => App::get_baseurl() . '/cal/' . $nickname,
|
||||||
'sel' =>((!isset($tab)&&$a->argv[0]=='cal')?'active':''),
|
'sel' =>((!isset($tab) && $a->argv[0]=='cal')?'active':''),
|
||||||
'title' => t('Events and Calendar'),
|
'title' => t('Events and Calendar'),
|
||||||
'id' => 'events-tab',
|
'id' => 'events-tab',
|
||||||
'accesskey' => 'e',
|
'accesskey' => 'e',
|
||||||
|
@ -813,7 +813,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
|
||||||
$tabs[] = array(
|
$tabs[] = array(
|
||||||
'label' => t('Personal Notes'),
|
'label' => t('Personal Notes'),
|
||||||
'url' => App::get_baseurl() . '/notes',
|
'url' => App::get_baseurl() . '/notes',
|
||||||
'sel' =>((!isset($tab)&&$a->argv[0]=='notes')?'active':''),
|
'sel' =>((!isset($tab) && $a->argv[0]=='notes')?'active':''),
|
||||||
'title' => t('Only You Can See This'),
|
'title' => t('Only You Can See This'),
|
||||||
'id' => 'notes-tab',
|
'id' => 'notes-tab',
|
||||||
'accesskey' => 't',
|
'accesskey' => 't',
|
||||||
|
@ -824,7 +824,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
|
||||||
$tabs[] = array(
|
$tabs[] = array(
|
||||||
'label' => t('Contacts'),
|
'label' => t('Contacts'),
|
||||||
'url' => App::get_baseurl() . '/viewcontacts/' . $nickname,
|
'url' => App::get_baseurl() . '/viewcontacts/' . $nickname,
|
||||||
'sel' => ((!isset($tab)&&$a->argv[0]=='viewcontacts')?'active':''),
|
'sel' => ((!isset($tab) && $a->argv[0]=='viewcontacts')?'active':''),
|
||||||
'title' => t('Contacts'),
|
'title' => t('Contacts'),
|
||||||
'id' => 'viewcontacts-tab',
|
'id' => 'viewcontacts-tab',
|
||||||
'accesskey' => 'k',
|
'accesskey' => 'k',
|
||||||
|
@ -845,7 +845,7 @@ function get_my_url() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function zrl_init(App &$a) {
|
function zrl_init(App $a) {
|
||||||
$tmp_str = get_my_url();
|
$tmp_str = get_my_url();
|
||||||
if(validate_url($tmp_str)) {
|
if(validate_url($tmp_str)) {
|
||||||
|
|
||||||
|
@ -891,7 +891,7 @@ function zrl($s,$force = false) {
|
||||||
* settings except their own while on this site.
|
* settings except their own while on this site.
|
||||||
*
|
*
|
||||||
* @return int user ID
|
* @return int user ID
|
||||||
*
|
*
|
||||||
* @note Returns local_user instead of user ID if "always_my_theme"
|
* @note Returns local_user instead of user ID if "always_my_theme"
|
||||||
* is set to true
|
* is set to true
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function nav(App &$a) {
|
function nav(App $a) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use \Friendica\Core\Config;
|
||||||
use \Friendica\Core\PConfig;
|
|
||||||
|
|
||||||
require_once("include/xml.php");
|
require_once("include/xml.php");
|
||||||
require_once('include/Probe.php');
|
require_once('include/Probe.php');
|
||||||
|
|
|
@ -43,11 +43,11 @@ require_once('include/salmon.php');
|
||||||
function notifier_run(&$argv, &$argc){
|
function notifier_run(&$argv, &$argc){
|
||||||
global $a, $db;
|
global $a, $db;
|
||||||
|
|
||||||
if(is_null($a)){
|
if (is_null($a)) {
|
||||||
$a = new App;
|
$a = new App;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_null($db)) {
|
if (is_null($db)) {
|
||||||
@include(".htconfig.php");
|
@include(".htconfig.php");
|
||||||
require_once("include/dba.php");
|
require_once("include/dba.php");
|
||||||
$db = new dba($db_host, $db_user, $db_pass, $db_data);
|
$db = new dba($db_host, $db_user, $db_pass, $db_data);
|
||||||
|
@ -64,8 +64,9 @@ function notifier_run(&$argv, &$argc){
|
||||||
|
|
||||||
load_hooks();
|
load_hooks();
|
||||||
|
|
||||||
if($argc < 3)
|
if ($argc < 3) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$a->set_baseurl(get_config('system','url'));
|
$a->set_baseurl(get_config('system','url'));
|
||||||
|
|
||||||
|
@ -77,7 +78,7 @@ function notifier_run(&$argv, &$argc){
|
||||||
case 'mail':
|
case 'mail':
|
||||||
default:
|
default:
|
||||||
$item_id = intval($argv[2]);
|
$item_id = intval($argv[2]);
|
||||||
if(! $item_id){
|
if (! $item_id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -93,21 +94,20 @@ function notifier_run(&$argv, &$argc){
|
||||||
|
|
||||||
$normal_mode = true;
|
$normal_mode = true;
|
||||||
|
|
||||||
if($cmd === 'mail') {
|
if ($cmd === 'mail') {
|
||||||
$normal_mode = false;
|
$normal_mode = false;
|
||||||
$mail = true;
|
$mail = true;
|
||||||
$message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1",
|
$message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1",
|
||||||
intval($item_id)
|
intval($item_id)
|
||||||
);
|
);
|
||||||
if(! count($message)){
|
if (! count($message)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$uid = $message[0]['uid'];
|
$uid = $message[0]['uid'];
|
||||||
$recipients[] = $message[0]['contact-id'];
|
$recipients[] = $message[0]['contact-id'];
|
||||||
$item = $message[0];
|
$item = $message[0];
|
||||||
|
|
||||||
}
|
} elseif ($cmd === 'expire') {
|
||||||
elseif($cmd === 'expire') {
|
|
||||||
$normal_mode = false;
|
$normal_mode = false;
|
||||||
$expire = true;
|
$expire = true;
|
||||||
$items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1
|
$items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1
|
||||||
|
@ -116,22 +116,23 @@ function notifier_run(&$argv, &$argc){
|
||||||
);
|
);
|
||||||
$uid = $item_id;
|
$uid = $item_id;
|
||||||
$item_id = 0;
|
$item_id = 0;
|
||||||
if(! count($items))
|
if (! count($items)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
elseif($cmd === 'suggest') {
|
} elseif ($cmd === 'suggest') {
|
||||||
$normal_mode = false;
|
$normal_mode = false;
|
||||||
$fsuggest = true;
|
$fsuggest = true;
|
||||||
|
|
||||||
$suggest = q("SELECT * FROM `fsuggest` WHERE `id` = %d LIMIT 1",
|
$suggest = q("SELECT * FROM `fsuggest` WHERE `id` = %d LIMIT 1",
|
||||||
intval($item_id)
|
intval($item_id)
|
||||||
);
|
);
|
||||||
if(! count($suggest))
|
if (! count($suggest)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
$uid = $suggest[0]['uid'];
|
$uid = $suggest[0]['uid'];
|
||||||
$recipients[] = $suggest[0]['cid'];
|
$recipients[] = $suggest[0]['cid'];
|
||||||
$item = $suggest[0];
|
$item = $suggest[0];
|
||||||
} elseif($cmd === 'removeme') {
|
} elseif ($cmd === 'removeme') {
|
||||||
$r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,
|
$r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,
|
||||||
`user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`,
|
`user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`,
|
||||||
`user`.`page-flags`, `user`.`prvnets`, `user`.`account-type`, `user`.`guid`
|
`user`.`page-flags`, `user`.`prvnets`, `user`.`account-type`, `user`.`guid`
|
||||||
|
@ -150,15 +151,15 @@ function notifier_run(&$argv, &$argc){
|
||||||
$self = $r[0];
|
$self = $r[0];
|
||||||
|
|
||||||
$r = q("SELECT * FROM `contact` WHERE NOT `self` AND `uid` = %d", intval($item_id));
|
$r = q("SELECT * FROM `contact` WHERE NOT `self` AND `uid` = %d", intval($item_id));
|
||||||
if(!$r)
|
if (!$r) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
require_once('include/Contact.php');
|
require_once('include/Contact.php');
|
||||||
foreach($r as $contact) {
|
foreach ($r as $contact) {
|
||||||
terminate_friendship($user, $self, $contact);
|
terminate_friendship($user, $self, $contact);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} elseif($cmd === 'relocate') {
|
} elseif ($cmd === 'relocate') {
|
||||||
$normal_mode = false;
|
$normal_mode = false;
|
||||||
$relocate = true;
|
$relocate = true;
|
||||||
$uid = $item_id;
|
$uid = $item_id;
|
||||||
|
@ -170,7 +171,7 @@ function notifier_run(&$argv, &$argc){
|
||||||
intval($item_id)
|
intval($item_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if((! dbm::is_result($r)) || (! intval($r[0]['parent']))) {
|
if ((! dbm::is_result($r)) || (! intval($r[0]['parent']))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,18 +185,19 @@ function notifier_run(&$argv, &$argc){
|
||||||
intval($parent_id)
|
intval($parent_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if(! count($items)) {
|
if (! count($items)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// avoid race condition with deleting entries
|
// avoid race condition with deleting entries
|
||||||
|
|
||||||
if($items[0]['deleted']) {
|
if ($items[0]['deleted']) {
|
||||||
foreach($items as $item)
|
foreach ($items as $item) {
|
||||||
$item['deleted'] = 1;
|
$item['deleted'] = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((count($items) == 1) && ($items[0]['id'] === $target_item['id']) && ($items[0]['uri'] === $items[0]['parent-uri'])) {
|
if ((count($items) == 1) && ($items[0]['id'] === $target_item['id']) && ($items[0]['uri'] === $items[0]['parent-uri'])) {
|
||||||
logger('notifier: top level post');
|
logger('notifier: top level post');
|
||||||
$top_level = true;
|
$top_level = true;
|
||||||
}
|
}
|
||||||
|
@ -220,6 +222,9 @@ function notifier_run(&$argv, &$argc){
|
||||||
|
|
||||||
$hub = get_config('system','huburl');
|
$hub = get_config('system','huburl');
|
||||||
|
|
||||||
|
// Should the post be transmitted to Diaspora?
|
||||||
|
$diaspora_delivery = true;
|
||||||
|
|
||||||
// If this is a public conversation, notify the feed hub
|
// If this is a public conversation, notify the feed hub
|
||||||
$public_message = true;
|
$public_message = true;
|
||||||
|
|
||||||
|
@ -229,7 +234,7 @@ function notifier_run(&$argv, &$argc){
|
||||||
// fill this in with a single salmon slap if applicable
|
// fill this in with a single salmon slap if applicable
|
||||||
$slap = '';
|
$slap = '';
|
||||||
|
|
||||||
if(! ($mail || $fsuggest || $relocate)) {
|
if (! ($mail || $fsuggest || $relocate)) {
|
||||||
|
|
||||||
$slap = ostatus::salmon($target_item,$owner);
|
$slap = ostatus::salmon($target_item,$owner);
|
||||||
|
|
||||||
|
@ -240,7 +245,7 @@ function notifier_run(&$argv, &$argc){
|
||||||
$thr_parent = q("SELECT `network`, `author-link`, `owner-link` FROM `item` WHERE `uri` = '%s' AND `uid` = %d",
|
$thr_parent = q("SELECT `network`, `author-link`, `owner-link` FROM `item` WHERE `uri` = '%s' AND `uid` = %d",
|
||||||
dbesc($target_item["thr-parent"]), intval($target_item["uid"]));
|
dbesc($target_item["thr-parent"]), intval($target_item["uid"]));
|
||||||
|
|
||||||
logger('Parent is '.$parent['network'].'. Thread parent is '.$thr_parent[0]['network'], LOGGER_DEBUG);
|
logger('GUID: '.$target_item["guid"].': Parent is '.$parent['network'].'. Thread parent is '.$thr_parent[0]['network'], LOGGER_DEBUG);
|
||||||
|
|
||||||
// This is IMPORTANT!!!!
|
// This is IMPORTANT!!!!
|
||||||
|
|
||||||
|
@ -264,9 +269,9 @@ function notifier_run(&$argv, &$argc){
|
||||||
|
|
||||||
|
|
||||||
$localhost = str_replace('www.','',$a->get_hostname());
|
$localhost = str_replace('www.','',$a->get_hostname());
|
||||||
if(strpos($localhost,':'))
|
if (strpos($localhost,':')) {
|
||||||
$localhost = substr($localhost,0,strpos($localhost,':'));
|
$localhost = substr($localhost,0,strpos($localhost,':'));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Be VERY CAREFUL if you make any changes to the following several lines. Seemingly innocuous changes
|
* Be VERY CAREFUL if you make any changes to the following several lines. Seemingly innocuous changes
|
||||||
|
@ -277,12 +282,12 @@ function notifier_run(&$argv, &$argc){
|
||||||
|
|
||||||
$relay_to_owner = false;
|
$relay_to_owner = false;
|
||||||
|
|
||||||
if(!$top_level && ($parent['wall'] == 0) && !$expire && (stristr($target_item['uri'],$localhost))) {
|
if (!$top_level && ($parent['wall'] == 0) && !$expire && (stristr($target_item['uri'],$localhost))) {
|
||||||
$relay_to_owner = true;
|
$relay_to_owner = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(($cmd === 'uplink') && (intval($parent['forum_mode']) == 1) && !$top_level) {
|
if (($cmd === 'uplink') && (intval($parent['forum_mode']) == 1) && !$top_level) {
|
||||||
$relay_to_owner = true;
|
$relay_to_owner = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,13 +295,13 @@ function notifier_run(&$argv, &$argc){
|
||||||
// we will just use it as a fallback test
|
// we will just use it as a fallback test
|
||||||
// later we will be able to use it as the primary test of whether or not to relay.
|
// later we will be able to use it as the primary test of whether or not to relay.
|
||||||
|
|
||||||
if(! $target_item['origin'])
|
if (! $target_item['origin']) {
|
||||||
$relay_to_owner = false;
|
$relay_to_owner = false;
|
||||||
|
}
|
||||||
if($parent['origin'])
|
if ($parent['origin']) {
|
||||||
$relay_to_owner = false;
|
$relay_to_owner = false;
|
||||||
|
}
|
||||||
if($relay_to_owner) {
|
if ($relay_to_owner) {
|
||||||
logger('notifier: followup '.$target_item["guid"], LOGGER_DEBUG);
|
logger('notifier: followup '.$target_item["guid"], LOGGER_DEBUG);
|
||||||
// local followup to remote post
|
// local followup to remote post
|
||||||
$followup = true;
|
$followup = true;
|
||||||
|
@ -322,9 +327,11 @@ function notifier_run(&$argv, &$argc){
|
||||||
intval($uid),
|
intval($uid),
|
||||||
dbesc(NETWORK_DFRN)
|
dbesc(NETWORK_DFRN)
|
||||||
);
|
);
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r)) {
|
||||||
foreach($r as $rr)
|
foreach ($r as $rr) {
|
||||||
$recipients_followup[] = $rr['id'];
|
$recipients_followup[] = $rr['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger("Notify ".$target_item["guid"]." via PuSH: ".($push_notify?"Yes":"No"), LOGGER_DEBUG);
|
logger("Notify ".$target_item["guid"]." via PuSH: ".($push_notify?"Yes":"No"), LOGGER_DEBUG);
|
||||||
|
@ -335,12 +342,12 @@ function notifier_run(&$argv, &$argc){
|
||||||
|
|
||||||
// don't send deletions onward for other people's stuff
|
// don't send deletions onward for other people's stuff
|
||||||
|
|
||||||
if($target_item['deleted'] && (! intval($target_item['wall']))) {
|
if ($target_item['deleted'] && (! intval($target_item['wall']))) {
|
||||||
logger('notifier: ignoring delete notification for non-wall item');
|
logger('notifier: ignoring delete notification for non-wall item');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((strlen($parent['allow_cid']))
|
if ((strlen($parent['allow_cid']))
|
||||||
|| (strlen($parent['allow_gid']))
|
|| (strlen($parent['allow_gid']))
|
||||||
|| (strlen($parent['deny_cid']))
|
|| (strlen($parent['deny_cid']))
|
||||||
|| (strlen($parent['deny_gid']))) {
|
|| (strlen($parent['deny_gid']))) {
|
||||||
|
@ -355,24 +362,23 @@ function notifier_run(&$argv, &$argc){
|
||||||
// if our parent is a public forum (forum_mode == 1), uplink to the origional author causing
|
// if our parent is a public forum (forum_mode == 1), uplink to the origional author causing
|
||||||
// a delivery fork. private groups (forum_mode == 2) do not uplink
|
// a delivery fork. private groups (forum_mode == 2) do not uplink
|
||||||
|
|
||||||
if((intval($parent['forum_mode']) == 1) && (! $top_level) && ($cmd !== 'uplink')) {
|
if ((intval($parent['forum_mode']) == 1) && (! $top_level) && ($cmd !== 'uplink')) {
|
||||||
proc_run(PRIORITY_HIGH,'include/notifier.php','uplink',$item_id);
|
proc_run(PRIORITY_HIGH,'include/notifier.php','uplink',$item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$conversants = array();
|
$conversants = array();
|
||||||
|
|
||||||
foreach($items as $item) {
|
foreach ($items as $item) {
|
||||||
$recipients[] = $item['contact-id'];
|
$recipients[] = $item['contact-id'];
|
||||||
$conversants[] = $item['contact-id'];
|
$conversants[] = $item['contact-id'];
|
||||||
// pull out additional tagged people to notify (if public message)
|
// pull out additional tagged people to notify (if public message)
|
||||||
if($public_message && strlen($item['inform'])) {
|
if ($public_message && strlen($item['inform'])) {
|
||||||
$people = explode(',',$item['inform']);
|
$people = explode(',',$item['inform']);
|
||||||
foreach($people as $person) {
|
foreach ($people as $person) {
|
||||||
if(substr($person,0,4) === 'cid:') {
|
if (substr($person,0,4) === 'cid:') {
|
||||||
$recipients[] = intval(substr($person,4));
|
$recipients[] = intval(substr($person,4));
|
||||||
$conversants[] = intval(substr($person,4));
|
$conversants[] = intval(substr($person,4));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$url_recipients[] = substr($person,4);
|
$url_recipients[] = substr($person,4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -396,16 +402,19 @@ function notifier_run(&$argv, &$argc){
|
||||||
// We have not only to look at the parent, since it could be a Friendica thread.
|
// We have not only to look at the parent, since it could be a Friendica thread.
|
||||||
if (($thr_parent AND ($thr_parent[0]['network'] == NETWORK_OSTATUS)) OR ($parent['network'] == NETWORK_OSTATUS)) {
|
if (($thr_parent AND ($thr_parent[0]['network'] == NETWORK_OSTATUS)) OR ($parent['network'] == NETWORK_OSTATUS)) {
|
||||||
|
|
||||||
|
$diaspora_delivery = false;
|
||||||
|
|
||||||
logger('Some parent is OStatus for '.$target_item["guid"]." - Author: ".$thr_parent[0]['author-link']." - Owner: ".$thr_parent[0]['owner-link'], LOGGER_DEBUG);
|
logger('Some parent is OStatus for '.$target_item["guid"]." - Author: ".$thr_parent[0]['author-link']." - Owner: ".$thr_parent[0]['owner-link'], LOGGER_DEBUG);
|
||||||
|
|
||||||
// Send a salmon to the parent author
|
// Send a salmon to the parent author
|
||||||
$r = q("SELECT `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
|
$r = q("SELECT `url`, `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
|
||||||
dbesc(normalise_link($thr_parent[0]['author-link'])),
|
dbesc(normalise_link($thr_parent[0]['author-link'])),
|
||||||
intval($uid));
|
intval($uid));
|
||||||
if ($r)
|
if (dbm::is_result($r)) {
|
||||||
$probed_contact = $r[0];
|
$probed_contact = $r[0];
|
||||||
else
|
} else {
|
||||||
$probed_contact = probe_url($thr_parent[0]['author-link']);
|
$probed_contact = probe_url($thr_parent[0]['author-link']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($probed_contact["notify"] != "") {
|
if ($probed_contact["notify"] != "") {
|
||||||
logger('Notify parent author '.$probed_contact["url"].': '.$probed_contact["notify"]);
|
logger('Notify parent author '.$probed_contact["url"].': '.$probed_contact["notify"]);
|
||||||
|
@ -413,13 +422,15 @@ function notifier_run(&$argv, &$argc){
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send a salmon to the parent owner
|
// Send a salmon to the parent owner
|
||||||
$r = q("SELECT `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
|
$r = q("SELECT `url`, `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
|
||||||
dbesc(normalise_link($thr_parent[0]['owner-link'])),
|
dbesc(normalise_link($thr_parent[0]['owner-link'])),
|
||||||
intval($uid));
|
intval($uid));
|
||||||
if ($r)
|
if (dbm::is_result($r)) {
|
||||||
$probed_contact = $r[0];
|
$probed_contact = $r[0];
|
||||||
else
|
} else {
|
||||||
$probed_contact = probe_url($thr_parent[0]['owner-link']);
|
$probed_contact = probe_url($thr_parent[0]['owner-link']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($probed_contact["notify"] != "") {
|
if ($probed_contact["notify"] != "") {
|
||||||
logger('Notify parent owner '.$probed_contact["url"].': '.$probed_contact["notify"]);
|
logger('Notify parent owner '.$probed_contact["url"].': '.$probed_contact["notify"]);
|
||||||
$url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
|
$url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
|
||||||
|
@ -427,10 +438,10 @@ function notifier_run(&$argv, &$argc){
|
||||||
|
|
||||||
// Send a salmon notification to every person we mentioned in the post
|
// Send a salmon notification to every person we mentioned in the post
|
||||||
$arr = explode(',',$target_item['tag']);
|
$arr = explode(',',$target_item['tag']);
|
||||||
foreach($arr as $x) {
|
foreach ($arr as $x) {
|
||||||
//logger('Checking tag '.$x, LOGGER_DEBUG);
|
//logger('Checking tag '.$x, LOGGER_DEBUG);
|
||||||
$matches = null;
|
$matches = null;
|
||||||
if(preg_match('/@\[url=([^\]]*)\]/',$x,$matches)) {
|
if (preg_match('/@\[url=([^\]]*)\]/',$x,$matches)) {
|
||||||
$probed_contact = probe_url($matches[1]);
|
$probed_contact = probe_url($matches[1]);
|
||||||
if ($probed_contact["notify"] != "") {
|
if ($probed_contact["notify"] != "") {
|
||||||
logger('Notify mentioned user '.$probed_contact["url"].': '.$probed_contact["notify"]);
|
logger('Notify mentioned user '.$probed_contact["url"].': '.$probed_contact["notify"]);
|
||||||
|
@ -441,23 +452,19 @@ function notifier_run(&$argv, &$argc){
|
||||||
|
|
||||||
// It only makes sense to distribute answers to OStatus messages to Friendica and OStatus - but not Diaspora
|
// It only makes sense to distribute answers to OStatus messages to Friendica and OStatus - but not Diaspora
|
||||||
$sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."')";
|
$sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."')";
|
||||||
} else
|
} else {
|
||||||
$sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."', '".NETWORK_DIASPORA."', '".NETWORK_MAIL."', '".NETWORK_MAIL2."')";
|
$sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."', '".NETWORK_DIASPORA."', '".NETWORK_MAIL."', '".NETWORK_MAIL2."')";
|
||||||
|
}
|
||||||
$r = q("SELECT * FROM `contact` WHERE `id` IN ($conversant_str) AND NOT `blocked` AND NOT `pending` AND NOT `archive`".$sql_extra);
|
} else {
|
||||||
|
|
||||||
if (dbm::is_result($r))
|
|
||||||
$contacts = $r;
|
|
||||||
|
|
||||||
} else
|
|
||||||
$public_message = false;
|
$public_message = false;
|
||||||
|
}
|
||||||
|
|
||||||
// If this is a public message and pubmail is set on the parent, include all your email contacts
|
// If this is a public message and pubmail is set on the parent, include all your email contacts
|
||||||
|
|
||||||
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
|
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
|
||||||
|
|
||||||
if(! $mail_disabled) {
|
if (! $mail_disabled) {
|
||||||
if((! strlen($target_item['allow_cid'])) && (! strlen($target_item['allow_gid']))
|
if ((! strlen($target_item['allow_cid'])) && (! strlen($target_item['allow_gid']))
|
||||||
&& (! strlen($target_item['deny_cid'])) && (! strlen($target_item['deny_gid']))
|
&& (! strlen($target_item['deny_cid'])) && (! strlen($target_item['deny_gid']))
|
||||||
&& (intval($target_item['pubmail']))) {
|
&& (intval($target_item['pubmail']))) {
|
||||||
$r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `network` = '%s'",
|
$r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `network` = '%s'",
|
||||||
|
@ -465,39 +472,40 @@ function notifier_run(&$argv, &$argc){
|
||||||
dbesc(NETWORK_MAIL)
|
dbesc(NETWORK_MAIL)
|
||||||
);
|
);
|
||||||
if (dbm::is_result($r)) {
|
if (dbm::is_result($r)) {
|
||||||
foreach($r as $rr)
|
foreach ($r as $rr) {
|
||||||
$recipients[] = $rr['id'];
|
$recipients[] = $rr['id'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($followup)
|
if ($followup) {
|
||||||
$recip_str = implode(', ', $recipients_followup);
|
$recip_str = implode(', ', $recipients_followup);
|
||||||
else
|
} else {
|
||||||
$recip_str = implode(', ', $recipients);
|
$recip_str = implode(', ', $recipients);
|
||||||
|
}
|
||||||
if ($relocate)
|
if ($relocate) {
|
||||||
$r = $recipients_relocate;
|
$r = $recipients_relocate;
|
||||||
else
|
} else {
|
||||||
$r = q("SELECT * FROM `contact` WHERE `id` IN (%s) AND NOT `blocked` AND NOT `pending` AND NOT `archive`",
|
$r = q("SELECT * FROM `contact` WHERE `id` IN (%s) AND NOT `blocked` AND NOT `pending` AND NOT `archive`".$sql_extra,
|
||||||
dbesc($recip_str)
|
dbesc($recip_str)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
|
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
|
||||||
|
|
||||||
// If we are using the worker we don't need a delivery interval
|
// If we are using the worker we don't need a delivery interval
|
||||||
if (get_config("system", "worker"))
|
if (get_config("system", "worker")) {
|
||||||
$interval = false;
|
$interval = false;
|
||||||
|
}
|
||||||
// delivery loop
|
// delivery loop
|
||||||
|
|
||||||
if (dbm::is_result($r)) {
|
if (dbm::is_result($r)) {
|
||||||
|
foreach ($r as $contact) {
|
||||||
foreach($r as $contact) {
|
if (!$contact['self']) {
|
||||||
if(!$contact['self']) {
|
if (($contact['network'] === NETWORK_DIASPORA) && ($public_message)) {
|
||||||
if(($contact['network'] === NETWORK_DIASPORA) && ($public_message))
|
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
q("INSERT INTO `deliverq` (`cmd`,`item`,`contact`) VALUES ('%s', %d, %d)",
|
q("INSERT INTO `deliverq` (`cmd`,`item`,`contact`) VALUES ('%s', %d, %d)",
|
||||||
dbesc($cmd),
|
dbesc($cmd),
|
||||||
intval($item_id),
|
intval($item_id),
|
||||||
|
@ -520,17 +528,18 @@ function notifier_run(&$argv, &$argc){
|
||||||
// When using the workerqueue, we don't need this functionality.
|
// When using the workerqueue, we don't need this functionality.
|
||||||
|
|
||||||
$deliveries_per_process = intval(get_config('system','delivery_batch_count'));
|
$deliveries_per_process = intval(get_config('system','delivery_batch_count'));
|
||||||
if (($deliveries_per_process <= 0) OR get_config("system", "worker"))
|
if (($deliveries_per_process <= 0) OR get_config("system", "worker")) {
|
||||||
$deliveries_per_process = 1;
|
$deliveries_per_process = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$this_batch = array();
|
$this_batch = array();
|
||||||
|
|
||||||
for($x = 0; $x < count($r); $x ++) {
|
for ($x = 0; $x < count($r); $x ++) {
|
||||||
$contact = $r[$x];
|
$contact = $r[$x];
|
||||||
|
|
||||||
if($contact['self'])
|
if ($contact['self']) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
logger("Deliver ".$target_item["guid"]." to ".$contact['url']." via network ".$contact['network'], LOGGER_DEBUG);
|
logger("Deliver ".$target_item["guid"]." to ".$contact['url']." via network ".$contact['network'], LOGGER_DEBUG);
|
||||||
|
|
||||||
// potentially more than one recipient. Start a new process and space them out a bit.
|
// potentially more than one recipient. Start a new process and space them out a bit.
|
||||||
|
@ -538,26 +547,28 @@ function notifier_run(&$argv, &$argc){
|
||||||
|
|
||||||
$this_batch[] = $contact['id'];
|
$this_batch[] = $contact['id'];
|
||||||
|
|
||||||
if(count($this_batch) >= $deliveries_per_process) {
|
if (count($this_batch) >= $deliveries_per_process) {
|
||||||
proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$this_batch);
|
proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$this_batch);
|
||||||
$this_batch = array();
|
$this_batch = array();
|
||||||
if($interval)
|
if ($interval) {
|
||||||
@time_sleep_until(microtime(true) + (float) $interval);
|
@time_sleep_until(microtime(true) + (float) $interval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// be sure to pick up any stragglers
|
// be sure to pick up any stragglers
|
||||||
if(count($this_batch))
|
if (count($this_batch)) {
|
||||||
proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$this_batch);
|
proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$this_batch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// send salmon slaps to mentioned remote tags (@foo@example.com) in OStatus posts
|
// send salmon slaps to mentioned remote tags (@foo@example.com) in OStatus posts
|
||||||
// They are especially used for notifications to OStatus users that don't follow us.
|
// They are especially used for notifications to OStatus users that don't follow us.
|
||||||
|
|
||||||
if($slap && count($url_recipients) && ($public_message || $push_notify) && $normal_mode) {
|
if ($slap && count($url_recipients) && ($public_message || $push_notify) && $normal_mode) {
|
||||||
if(!get_config('system','dfrn_only')) {
|
if (!get_config('system','dfrn_only')) {
|
||||||
foreach($url_recipients as $url) {
|
foreach ($url_recipients as $url) {
|
||||||
if ($url) {
|
if ($url) {
|
||||||
logger('notifier: urldelivery: ' . $url);
|
logger('notifier: urldelivery: ' . $url);
|
||||||
$deliver_status = slapper($owner,$url,$slap);
|
$deliver_status = slapper($owner,$url,$slap);
|
||||||
|
@ -568,19 +579,23 @@ function notifier_run(&$argv, &$argc){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($public_message) {
|
if ($public_message) {
|
||||||
|
|
||||||
if (!$followup)
|
$r0 = array();
|
||||||
$r0 = Diaspora::relay_list();
|
$r1 = array();
|
||||||
else
|
|
||||||
$r0 = array();
|
|
||||||
|
|
||||||
$r1 = q("SELECT DISTINCT(`batch`), `id`, `name`,`network` FROM `contact` WHERE `network` = '%s'
|
if ($diaspora_delivery) {
|
||||||
AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch` ORDER BY rand()",
|
if (!$followup) {
|
||||||
dbesc(NETWORK_DIASPORA),
|
$r0 = Diaspora::relay_list();
|
||||||
intval($owner['uid']),
|
}
|
||||||
intval(CONTACT_IS_SHARING)
|
|
||||||
);
|
$r1 = q("SELECT DISTINCT(`batch`), `id`, `name`,`network` FROM `contact` WHERE `network` = '%s'
|
||||||
|
AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch` ORDER BY rand()",
|
||||||
|
dbesc(NETWORK_DIASPORA),
|
||||||
|
intval($owner['uid']),
|
||||||
|
intval(CONTACT_IS_SHARING)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$r2 = q("SELECT `id`, `name`,`network` FROM `contact`
|
$r2 = q("SELECT `id`, `name`,`network` FROM `contact`
|
||||||
WHERE `network` in ( '%s', '%s') AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive`
|
WHERE `network` in ( '%s', '%s') AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive`
|
||||||
|
@ -599,7 +614,7 @@ function notifier_run(&$argv, &$argc){
|
||||||
// throw everything into the queue in case we get killed
|
// throw everything into the queue in case we get killed
|
||||||
|
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
if((! $mail) && (! $fsuggest) && (! $followup)) {
|
if ((! $mail) && (! $fsuggest) && (! $followup)) {
|
||||||
q("INSERT INTO `deliverq` (`cmd`,`item`,`contact`) VALUES ('%s', %d, %d)
|
q("INSERT INTO `deliverq` (`cmd`,`item`,`contact`) VALUES ('%s', %d, %d)
|
||||||
ON DUPLICATE KEY UPDATE `cmd` = '%s', `item` = %d, `contact` = %d",
|
ON DUPLICATE KEY UPDATE `cmd` = '%s', `item` = %d, `contact` = %d",
|
||||||
dbesc($cmd), intval($item_id), intval($rr['id']),
|
dbesc($cmd), intval($item_id), intval($rr['id']),
|
||||||
|
@ -613,16 +628,17 @@ function notifier_run(&$argv, &$argc){
|
||||||
// except for Diaspora batch jobs
|
// except for Diaspora batch jobs
|
||||||
// Don't deliver to folks who have already been delivered to
|
// Don't deliver to folks who have already been delivered to
|
||||||
|
|
||||||
if(($rr['network'] !== NETWORK_DIASPORA) && (in_array($rr['id'],$conversants))) {
|
if (($rr['network'] !== NETWORK_DIASPORA) && (in_array($rr['id'],$conversants))) {
|
||||||
logger('notifier: already delivered id=' . $rr['id']);
|
logger('notifier: already delivered id=' . $rr['id']);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((! $mail) && (! $fsuggest) && (! $followup)) {
|
if ((! $mail) && (! $fsuggest) && (! $followup)) {
|
||||||
logger('notifier: delivery agent: '.$rr['name'].' '.$rr['id'].' '.$rr['network'].' '.$target_item["guid"]);
|
logger('notifier: delivery agent: '.$rr['name'].' '.$rr['id'].' '.$rr['network'].' '.$target_item["guid"]);
|
||||||
proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$rr['id']);
|
proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$rr['id']);
|
||||||
if($interval)
|
if ($interval) {
|
||||||
@time_sleep_until(microtime(true) + (float) $interval);
|
@time_sleep_until(microtime(true) + (float) $interval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -632,13 +648,14 @@ function notifier_run(&$argv, &$argc){
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify PuSH subscribers (Used for OStatus distribution of regular posts)
|
// Notify PuSH subscribers (Used for OStatus distribution of regular posts)
|
||||||
if($push_notify AND strlen($hub)) {
|
if ($push_notify AND strlen($hub)) {
|
||||||
$hubs = explode(',', $hub);
|
$hubs = explode(',', $hub);
|
||||||
if(count($hubs)) {
|
if (count($hubs)) {
|
||||||
foreach($hubs as $h) {
|
foreach ($hubs as $h) {
|
||||||
$h = trim($h);
|
$h = trim($h);
|
||||||
if(! strlen($h))
|
if (! strlen($h)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ($h === '[internal]') {
|
if ($h === '[internal]') {
|
||||||
// Set push flag for PuSH subscribers to this topic,
|
// Set push flag for PuSH subscribers to this topic,
|
||||||
|
@ -654,8 +671,9 @@ function notifier_run(&$argv, &$argc){
|
||||||
post_url($h,$params);
|
post_url($h,$params);
|
||||||
logger('publish for item '.$item_id.' ' . $h . ' ' . $params . ' returned ' . $a->get_curl_code());
|
logger('publish for item '.$item_id.' ' . $h . ' ' . $params . ' returned ' . $a->get_curl_code());
|
||||||
}
|
}
|
||||||
if(count($hubs) > 1)
|
if (count($hubs) > 1) {
|
||||||
sleep(7); // try and avoid multiple hubs responding at precisely the same time
|
sleep(7); // try and avoid multiple hubs responding at precisely the same time
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -665,8 +683,9 @@ function notifier_run(&$argv, &$argc){
|
||||||
|
|
||||||
logger('notifier: calling hooks', LOGGER_DEBUG);
|
logger('notifier: calling hooks', LOGGER_DEBUG);
|
||||||
|
|
||||||
if($normal_mode)
|
if ($normal_mode) {
|
||||||
call_hooks('notifier_normal',$target_item);
|
call_hooks('notifier_normal',$target_item);
|
||||||
|
}
|
||||||
|
|
||||||
call_hooks('notifier_end',$target_item);
|
call_hooks('notifier_end',$target_item);
|
||||||
|
|
||||||
|
|
|
@ -2072,7 +2072,7 @@ class ostatus {
|
||||||
*
|
*
|
||||||
* @return string XML feed
|
* @return string XML feed
|
||||||
*/
|
*/
|
||||||
public static function feed(&$a, $owner_nick, $last_update) {
|
public static function feed(App $a, $owner_nick, $last_update) {
|
||||||
|
|
||||||
$r = q("SELECT `contact`.*, `user`.`nickname`, `user`.`timezone`, `user`.`page-flags`
|
$r = q("SELECT `contact`.*, `user`.`nickname`, `user`.`timezone`, `user`.`page-flags`
|
||||||
FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
||||||
|
|
|
@ -296,7 +296,7 @@ function shortenmsg($msg, $limit, $twitter = false) {
|
||||||
*
|
*
|
||||||
* @return string The converted message
|
* @return string The converted message
|
||||||
*/
|
*/
|
||||||
function plaintext($a, $b, $limit = 0, $includedlinks = false, $htmlmode = 2, $target_network = "") {
|
function plaintext(App $a, $b, $limit = 0, $includedlinks = false, $htmlmode = 2, $target_network = "") {
|
||||||
|
|
||||||
// Remove the hash tags
|
// Remove the hash tags
|
||||||
$URLSearchString = "^\[\]";
|
$URLSearchString = "^\[\]";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function auto_redir(&$a, $contact_nick) {
|
function auto_redir(App $a, $contact_nick) {
|
||||||
|
|
||||||
// prevent looping
|
// prevent looping
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ function auto_redir(&$a, $contact_nick) {
|
||||||
|
|
||||||
if(strlen($dfrn_id) < 3)
|
if(strlen($dfrn_id) < 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$sec = random_string();
|
$sec = random_string();
|
||||||
|
|
||||||
q("INSERT INTO `profile_check` ( `uid`, `cid`, `dfrn_id`, `sec`, `expire`)
|
q("INSERT INTO `profile_check` ( `uid`, `cid`, `dfrn_id`, `sec`, `expire`)
|
||||||
|
@ -84,9 +84,9 @@ function auto_redir(&$a, $contact_nick) {
|
||||||
|
|
||||||
$url = curPageURL();
|
$url = curPageURL();
|
||||||
|
|
||||||
logger('auto_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG);
|
logger('auto_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG);
|
||||||
$dest = (($url) ? '&destination_url=' . $url : '');
|
$dest = (($url) ? '&destination_url=' . $url : '');
|
||||||
goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id
|
goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id
|
||||||
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest );
|
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function can_write_wall(&$a,$owner) {
|
function can_write_wall(App $a, $owner) {
|
||||||
|
|
||||||
static $verified = 0;
|
static $verified = 0;
|
||||||
|
|
||||||
|
@ -148,8 +148,8 @@ function can_write_wall(&$a,$owner) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` INNER JOIN `user` on `user`.`uid` = `contact`.`uid`
|
$r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` INNER JOIN `user` on `user`.`uid` = `contact`.`uid`
|
||||||
WHERE `contact`.`uid` = %d AND `contact`.`id` = %d AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
WHERE `contact`.`uid` = %d AND `contact`.`id` = %d AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||||
AND `user`.`blockwall` = 0 AND `readonly` = 0 AND ( `contact`.`rel` IN ( %d , %d ) OR `user`.`page-flags` = %d ) LIMIT 1",
|
AND `user`.`blockwall` = 0 AND `readonly` = 0 AND ( `contact`.`rel` IN ( %d , %d ) OR `user`.`page-flags` = %d ) LIMIT 1",
|
||||||
intval($owner),
|
intval($owner),
|
||||||
intval($cid),
|
intval($cid),
|
||||||
|
@ -183,10 +183,10 @@ function permissions_sql($owner_id,$remote_verified = false,$groups = null) {
|
||||||
* default permissions - anonymous user
|
* default permissions - anonymous user
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = " AND allow_cid = ''
|
$sql = " AND allow_cid = ''
|
||||||
AND allow_gid = ''
|
AND allow_gid = ''
|
||||||
AND deny_cid = ''
|
AND deny_cid = ''
|
||||||
AND deny_gid = ''
|
AND deny_gid = ''
|
||||||
";
|
";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -194,11 +194,11 @@ function permissions_sql($owner_id,$remote_verified = false,$groups = null) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(($local_user) && ($local_user == $owner_id)) {
|
if(($local_user) && ($local_user == $owner_id)) {
|
||||||
$sql = '';
|
$sql = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticated visitor. Unless pre-verified,
|
* Authenticated visitor. Unless pre-verified,
|
||||||
* check that the contact belongs to this $owner_id
|
* check that the contact belongs to this $owner_id
|
||||||
* and load the groups the visitor belongs to.
|
* and load the groups the visitor belongs to.
|
||||||
* If pre-verified, the caller is expected to have already
|
* If pre-verified, the caller is expected to have already
|
||||||
|
@ -224,11 +224,11 @@ function permissions_sql($owner_id,$remote_verified = false,$groups = null) {
|
||||||
if(is_array($groups) && count($groups)) {
|
if(is_array($groups) && count($groups)) {
|
||||||
foreach($groups as $g)
|
foreach($groups as $g)
|
||||||
$gs .= '|<' . intval($g) . '>';
|
$gs .= '|<' . intval($g) . '>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*$sql = sprintf(
|
/*$sql = sprintf(
|
||||||
" AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' )
|
" AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' )
|
||||||
AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' )
|
AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' )
|
||||||
AND ( allow_gid = '' OR allow_gid REGEXP '%s' )
|
AND ( allow_gid = '' OR allow_gid REGEXP '%s' )
|
||||||
AND ( deny_gid = '' OR NOT deny_gid REGEXP '%s')
|
AND ( deny_gid = '' OR NOT deny_gid REGEXP '%s')
|
||||||
",
|
",
|
||||||
|
@ -280,7 +280,7 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticated visitor. Unless pre-verified,
|
* Authenticated visitor. Unless pre-verified,
|
||||||
* check that the contact belongs to this $owner_id
|
* check that the contact belongs to this $owner_id
|
||||||
* and load the groups the visitor belongs to.
|
* and load the groups the visitor belongs to.
|
||||||
* If pre-verified, the caller is expected to have already
|
* If pre-verified, the caller is expected to have already
|
||||||
|
@ -306,13 +306,13 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null)
|
||||||
if(is_array($groups) && count($groups)) {
|
if(is_array($groups) && count($groups)) {
|
||||||
foreach($groups as $g)
|
foreach($groups as $g)
|
||||||
$gs .= '|<' . intval($g) . '>';
|
$gs .= '|<' . intval($g) . '>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = sprintf(
|
$sql = sprintf(
|
||||||
/*" AND ( private = 0 OR ( private in (1,2) AND wall = 1 AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' )
|
/*" AND ( private = 0 OR ( private in (1,2) AND wall = 1 AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' )
|
||||||
AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' )
|
AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' )
|
||||||
AND ( allow_gid = '' OR allow_gid REGEXP '%s' )
|
AND ( allow_gid = '' OR allow_gid REGEXP '%s' )
|
||||||
AND ( deny_gid = '' OR NOT deny_gid REGEXP '%s')))
|
AND ( deny_gid = '' OR NOT deny_gid REGEXP '%s')))
|
||||||
",
|
",
|
||||||
intval($remote_user),
|
intval($remote_user),
|
||||||
intval($remote_user),
|
intval($remote_user),
|
||||||
|
@ -345,29 +345,29 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null)
|
||||||
* If the new page contains by any chance external elements, then the used security token is exposed by the referrer.
|
* If the new page contains by any chance external elements, then the used security token is exposed by the referrer.
|
||||||
* Actually, important actions should not be triggered by Links / GET-Requests at all, but somethimes they still are,
|
* Actually, important actions should not be triggered by Links / GET-Requests at all, but somethimes they still are,
|
||||||
* so this mechanism brings in some damage control (the attacker would be able to forge a request to a form of this type, but not to forms of other types).
|
* so this mechanism brings in some damage control (the attacker would be able to forge a request to a form of this type, but not to forms of other types).
|
||||||
*/
|
*/
|
||||||
function get_form_security_token($typename = '') {
|
function get_form_security_token($typename = '') {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
$timestamp = time();
|
$timestamp = time();
|
||||||
$sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $timestamp . $typename);
|
$sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $timestamp . $typename);
|
||||||
|
|
||||||
return $timestamp . '.' . $sec_hash;
|
return $timestamp . '.' . $sec_hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_form_security_token($typename = '', $formname = 'form_security_token') {
|
function check_form_security_token($typename = '', $formname = 'form_security_token') {
|
||||||
if (!x($_REQUEST, $formname)) return false;
|
if (!x($_REQUEST, $formname)) return false;
|
||||||
$hash = $_REQUEST[$formname];
|
$hash = $_REQUEST[$formname];
|
||||||
|
|
||||||
$max_livetime = 10800; // 3 hours
|
$max_livetime = 10800; // 3 hours
|
||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
$x = explode('.', $hash);
|
$x = explode('.', $hash);
|
||||||
if (time() > (IntVal($x[0]) + $max_livetime)) return false;
|
if (time() > (IntVal($x[0]) + $max_livetime)) return false;
|
||||||
|
|
||||||
$sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $x[0] . $typename);
|
$sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $x[0] . $typename);
|
||||||
|
|
||||||
return ($sec_hash == $x[1]);
|
return ($sec_hash == $x[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,13 +395,13 @@ function check_form_security_token_ForbiddenOnErr($typename = '', $formname = 'f
|
||||||
|
|
||||||
// Returns an array of group id's this contact is a member of.
|
// Returns an array of group id's this contact is a member of.
|
||||||
// This array will only contain group id's related to the uid of this
|
// This array will only contain group id's related to the uid of this
|
||||||
// DFRN contact. They are *not* neccessarily unique across the entire site.
|
// DFRN contact. They are *not* neccessarily unique across the entire site.
|
||||||
|
|
||||||
|
|
||||||
if(! function_exists('init_groups_visitor')) {
|
if(! function_exists('init_groups_visitor')) {
|
||||||
function init_groups_visitor($contact_id) {
|
function init_groups_visitor($contact_id) {
|
||||||
$groups = array();
|
$groups = array();
|
||||||
$r = q("SELECT `gid` FROM `group_member`
|
$r = q("SELECT `gid` FROM `group_member`
|
||||||
WHERE `contact-id` = %d ",
|
WHERE `contact-id` = %d ",
|
||||||
intval($contact_id)
|
intval($contact_id)
|
||||||
);
|
);
|
||||||
|
|
|
@ -276,7 +276,7 @@ if(! function_exists('paginate_data')) {
|
||||||
* @param int $count [optional] item count (used with alt pager)
|
* @param int $count [optional] item count (used with alt pager)
|
||||||
* @return Array data for pagination template
|
* @return Array data for pagination template
|
||||||
*/
|
*/
|
||||||
function paginate_data(&$a, $count=null) {
|
function paginate_data(App $a, $count=null) {
|
||||||
$stripped = preg_replace('/([&?]page=[0-9]*)/','',$a->query_string);
|
$stripped = preg_replace('/([&?]page=[0-9]*)/','',$a->query_string);
|
||||||
|
|
||||||
$stripped = str_replace('q=','',$stripped);
|
$stripped = str_replace('q=','',$stripped);
|
||||||
|
@ -369,7 +369,7 @@ if(! function_exists('paginate')) {
|
||||||
* @param App $a App instance
|
* @param App $a App instance
|
||||||
* @return string html for pagination #FIXME remove html
|
* @return string html for pagination #FIXME remove html
|
||||||
*/
|
*/
|
||||||
function paginate(App &$a) {
|
function paginate(App $a) {
|
||||||
|
|
||||||
$data = paginate_data($a);
|
$data = paginate_data($a);
|
||||||
$tpl = get_markup_template("paginate.tpl");
|
$tpl = get_markup_template("paginate.tpl");
|
||||||
|
@ -384,7 +384,7 @@ if(! function_exists('alt_pager')) {
|
||||||
* @param int $i
|
* @param int $i
|
||||||
* @return string html for pagination #FIXME remove html
|
* @return string html for pagination #FIXME remove html
|
||||||
*/
|
*/
|
||||||
function alt_pager(&$a, $i) {
|
function alt_pager(App $a, $i) {
|
||||||
|
|
||||||
$data = paginate_data($a, $i);
|
$data = paginate_data($a, $i);
|
||||||
$tpl = get_markup_template("paginate.tpl");
|
$tpl = get_markup_template("paginate.tpl");
|
||||||
|
|
|
@ -78,7 +78,7 @@ function import_cleanup($newuid) {
|
||||||
q("DELETE FROM `pconfig` WHERE uid = %d", $newuid);
|
q("DELETE FROM `pconfig` WHERE uid = %d", $newuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
function import_account(&$a, $file) {
|
function import_account(App $a, $file) {
|
||||||
logger("Start user import from " . $file['tmp_name']);
|
logger("Start user import from " . $file['tmp_name']);
|
||||||
/*
|
/*
|
||||||
STEPS
|
STEPS
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require_once("mod/hostxrd.php");
|
require_once("mod/hostxrd.php");
|
||||||
require_once("mod/nodeinfo.php");
|
require_once("mod/nodeinfo.php");
|
||||||
|
|
||||||
function _well_known_init(App &$a){
|
function _well_known_init(App $a) {
|
||||||
if ($a->argc > 1) {
|
if ($a->argc > 1) {
|
||||||
switch($a->argv[1]) {
|
switch($a->argv[1]) {
|
||||||
case "host-meta":
|
case "host-meta":
|
||||||
|
@ -21,7 +21,7 @@ function _well_known_init(App &$a){
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
function wk_social_relay(App &$a) {
|
function wk_social_relay(App $a) {
|
||||||
|
|
||||||
define('SR_SCOPE_ALL', 'all');
|
define('SR_SCOPE_ALL', 'all');
|
||||||
define('SR_SCOPE_TAGS', 'tags');
|
define('SR_SCOPE_TAGS', 'tags');
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once('include/Scrape.php');
|
||||||
|
|
||||||
function acctlink_init(App &$a) {
|
function acctlink_init(App $a) {
|
||||||
|
|
||||||
if(x($_GET,'addr')) {
|
if(x($_GET,'addr')) {
|
||||||
$addr = trim($_GET['addr']);
|
$addr = trim($_GET['addr']);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
require_once("include/acl_selectors.php");
|
require_once("include/acl_selectors.php");
|
||||||
|
|
||||||
function acl_init(App &$a){
|
function acl_init(App $a) {
|
||||||
acl_lookup($a);
|
acl_lookup($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file mod/admin.php
|
* @file mod/admin.php
|
||||||
*
|
*
|
||||||
* @brief Friendica admin
|
* @brief Friendica admin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ require_once("include/text.php");
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function admin_post(App &$a){
|
function admin_post(App $a) {
|
||||||
|
|
||||||
|
|
||||||
if(!is_site_admin()) {
|
if(!is_site_admin()) {
|
||||||
|
@ -66,7 +66,7 @@ function admin_post(App &$a){
|
||||||
|
|
||||||
$theme = $a->argv[2];
|
$theme = $a->argv[2];
|
||||||
if(is_file("view/theme/$theme/config.php")){
|
if(is_file("view/theme/$theme/config.php")){
|
||||||
function __call_theme_admin_post(&$a, $theme) {
|
function __call_theme_admin_post(App $a, $theme) {
|
||||||
$orig_theme = $a->theme;
|
$orig_theme = $a->theme;
|
||||||
$orig_page = $a->page;
|
$orig_page = $a->page;
|
||||||
$orig_session_theme = $_SESSION['theme'];
|
$orig_session_theme = $_SESSION['theme'];
|
||||||
|
@ -127,7 +127,7 @@ function admin_post(App &$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_content(App &$a) {
|
function admin_content(App $a) {
|
||||||
|
|
||||||
if(!is_site_admin()) {
|
if(!is_site_admin()) {
|
||||||
return login(false);
|
return login(false);
|
||||||
|
@ -260,7 +260,7 @@ function admin_content(App &$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_federation(App &$a) {
|
function admin_page_federation(App $a) {
|
||||||
// get counts on active friendica, diaspora, redmatrix, hubzilla, gnu
|
// get counts on active friendica, diaspora, redmatrix, hubzilla, gnu
|
||||||
// social and statusnet nodes this node is knowing
|
// social and statusnet nodes this node is knowing
|
||||||
//
|
//
|
||||||
|
@ -316,12 +316,12 @@ function admin_page_federation(App &$a) {
|
||||||
$newVC = $vv['total'];
|
$newVC = $vv['total'];
|
||||||
$newVV = $vv['version'];
|
$newVV = $vv['version'];
|
||||||
$posDash = strpos($newVV, '-');
|
$posDash = strpos($newVV, '-');
|
||||||
if($posDash)
|
if($posDash)
|
||||||
$newVV = substr($newVV, 0, $posDash);
|
$newVV = substr($newVV, 0, $posDash);
|
||||||
if(isset($newV[$newVV]))
|
if(isset($newV[$newVV]))
|
||||||
$newV[$newVV] += $newVC;
|
$newV[$newVV] += $newVC;
|
||||||
else
|
else
|
||||||
$newV[$newVV] = $newVC;
|
$newV[$newVV] = $newVC;
|
||||||
}
|
}
|
||||||
foreach ($newV as $key => $value) {
|
foreach ($newV as $key => $value) {
|
||||||
array_push($newVv, array('total'=>$value, 'version'=>$key));
|
array_push($newVv, array('total'=>$value, 'version'=>$key));
|
||||||
|
@ -393,7 +393,7 @@ function admin_page_federation(App &$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_queue(App &$a) {
|
function admin_page_queue(App $a) {
|
||||||
// get content from the queue table
|
// get content from the queue table
|
||||||
$r = q("SELECT `c`.`name`, `c`.`nurl`, `q`.`id`, `q`.`network`, `q`.`created`, `q`.`last`
|
$r = q("SELECT `c`.`name`, `c`.`nurl`, `q`.`id`, `q`.`network`, `q`.`created`, `q`.`last`
|
||||||
FROM `queue` AS `q`, `contact` AS `c`
|
FROM `queue` AS `q`, `contact` AS `c`
|
||||||
|
@ -427,7 +427,7 @@ function admin_page_queue(App &$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_summary(App &$a) {
|
function admin_page_summary(App $a) {
|
||||||
global $db;
|
global $db;
|
||||||
// are there MyISAM tables in the DB? If so, trigger a warning message
|
// are there MyISAM tables in the DB? If so, trigger a warning message
|
||||||
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1",
|
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1",
|
||||||
|
@ -501,10 +501,10 @@ function admin_page_summary(App &$a) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Process send data from Admin Site Page
|
* @brief Process send data from Admin Site Page
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function admin_page_site_post(App &$a) {
|
function admin_page_site_post(App $a) {
|
||||||
if(!x($_POST,"page_site")) {
|
if(!x($_POST,"page_site")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -845,7 +845,7 @@ function admin_page_site_post(App &$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_site(App &$a) {
|
function admin_page_site(App $a) {
|
||||||
|
|
||||||
/* Installed langs */
|
/* Installed langs */
|
||||||
$lang_choices = get_available_languages();
|
$lang_choices = get_available_languages();
|
||||||
|
@ -1072,7 +1072,7 @@ function admin_page_site(App &$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
**/
|
**/
|
||||||
function admin_page_dbsync(App &$a) {
|
function admin_page_dbsync(App $a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
|
@ -1152,10 +1152,10 @@ function admin_page_dbsync(App &$a) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Process data send by Users admin page
|
* @brief Process data send by Users admin page
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function admin_page_users_post(App &$a){
|
function admin_page_users_post(App $a) {
|
||||||
$pending = (x($_POST, 'pending') ? $_POST['pending'] : array());
|
$pending = (x($_POST, 'pending') ? $_POST['pending'] : array());
|
||||||
$users = (x($_POST, 'user') ? $_POST['user'] : array());
|
$users = (x($_POST, 'user') ? $_POST['user'] : array());
|
||||||
$nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : '');
|
$nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : '');
|
||||||
|
@ -1168,7 +1168,7 @@ function admin_page_users_post(App &$a){
|
||||||
if (!($nu_name==="") && !($nu_email==="") && !($nu_nickname==="")) {
|
if (!($nu_name==="") && !($nu_email==="") && !($nu_nickname==="")) {
|
||||||
require_once('include/user.php');
|
require_once('include/user.php');
|
||||||
|
|
||||||
$result = create_user(array('username'=>$nu_name, 'email'=>$nu_email,
|
$result = create_user(array('username'=>$nu_name, 'email'=>$nu_email,
|
||||||
'nickname'=>$nu_nickname, 'verified'=>1, 'language'=>$nu_language));
|
'nickname'=>$nu_nickname, 'verified'=>1, 'language'=>$nu_language));
|
||||||
if (! $result['success']) {
|
if (! $result['success']) {
|
||||||
notice($result['message']);
|
notice($result['message']);
|
||||||
|
@ -1260,7 +1260,7 @@ function admin_page_users_post(App &$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_users(App &$a){
|
function admin_page_users(App $a) {
|
||||||
if($a->argc>2) {
|
if($a->argc>2) {
|
||||||
$uid = $a->argv[3];
|
$uid = $a->argv[3];
|
||||||
$user = q("SELECT `username`, `blocked` FROM `user` WHERE `uid` = %d", intval($uid));
|
$user = q("SELECT `username`, `blocked` FROM `user` WHERE `uid` = %d", intval($uid));
|
||||||
|
@ -1396,7 +1396,7 @@ function admin_page_users(App &$a){
|
||||||
array(t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Account')),
|
array(t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Account')),
|
||||||
$valid_orders
|
$valid_orders
|
||||||
);
|
);
|
||||||
|
|
||||||
$t = get_markup_template("admin_users.tpl");
|
$t = get_markup_template("admin_users.tpl");
|
||||||
$o = replace_macros($t, array(
|
$o = replace_macros($t, array(
|
||||||
// strings //
|
// strings //
|
||||||
|
@ -1460,7 +1460,7 @@ function admin_page_users(App &$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_plugins(App &$a){
|
function admin_page_plugins(App $a) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Single plugin
|
* Single plugin
|
||||||
|
@ -1588,7 +1588,7 @@ function admin_page_plugins(App &$a){
|
||||||
'$baseurl' => App::get_baseurl(true),
|
'$baseurl' => App::get_baseurl(true),
|
||||||
'$function' => 'plugins',
|
'$function' => 'plugins',
|
||||||
'$plugins' => $plugins,
|
'$plugins' => $plugins,
|
||||||
'$pcount' => count($plugins),
|
'$pcount' => count($plugins),
|
||||||
'$noplugshint' => sprintf(t('There are currently no plugins available on your node. You can find the official plugin repository at %1$s and might find other interesting plugins in the open plugin registry at %2$s'), 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
|
'$noplugshint' => sprintf(t('There are currently no plugins available on your node. You can find the official plugin repository at %1$s and might find other interesting plugins in the open plugin registry at %2$s'), 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
|
||||||
'$form_security_token' => get_form_security_token("admin_themes"),
|
'$form_security_token' => get_form_security_token("admin_themes"),
|
||||||
));
|
));
|
||||||
|
@ -1669,7 +1669,7 @@ function rebuild_theme_table($themes) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_themes(App &$a){
|
function admin_page_themes(App $a) {
|
||||||
|
|
||||||
$allowed_themes_str = get_config('system','allowed_themes');
|
$allowed_themes_str = get_config('system','allowed_themes');
|
||||||
$allowed_themes_raw = explode(',',$allowed_themes_str);
|
$allowed_themes_raw = explode(',',$allowed_themes_str);
|
||||||
|
@ -1749,7 +1749,7 @@ function admin_page_themes(App &$a){
|
||||||
|
|
||||||
$admin_form="";
|
$admin_form="";
|
||||||
if(is_file("view/theme/$theme/config.php")) {
|
if(is_file("view/theme/$theme/config.php")) {
|
||||||
function __get_theme_admin_form(&$a, $theme) {
|
function __get_theme_admin_form(App $a, $theme) {
|
||||||
$orig_theme = $a->theme;
|
$orig_theme = $a->theme;
|
||||||
$orig_page = $a->page;
|
$orig_page = $a->page;
|
||||||
$orig_session_theme = $_SESSION['theme'];
|
$orig_session_theme = $_SESSION['theme'];
|
||||||
|
@ -1847,10 +1847,10 @@ function admin_page_themes(App &$a){
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Prosesses data send by Logs admin page
|
* @brief Prosesses data send by Logs admin page
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function admin_page_logs_post(App &$a) {
|
function admin_page_logs_post(App $a) {
|
||||||
if (x($_POST,"page_logs")) {
|
if (x($_POST,"page_logs")) {
|
||||||
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
|
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
|
||||||
|
|
||||||
|
@ -1884,7 +1884,7 @@ function admin_page_logs_post(App &$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_logs(App &$a){
|
function admin_page_logs(App $a) {
|
||||||
|
|
||||||
$log_choices = array(
|
$log_choices = array(
|
||||||
LOGGER_NORMAL => 'Normal',
|
LOGGER_NORMAL => 'Normal',
|
||||||
|
@ -1893,7 +1893,7 @@ function admin_page_logs(App &$a){
|
||||||
LOGGER_DATA => 'Data',
|
LOGGER_DATA => 'Data',
|
||||||
LOGGER_ALL => 'All'
|
LOGGER_ALL => 'All'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ini_get('log_errors')) {
|
if (ini_get('log_errors')) {
|
||||||
$phplogenabled = t('PHP log currently enabled.');
|
$phplogenabled = t('PHP log currently enabled.');
|
||||||
} else {
|
} else {
|
||||||
|
@ -1941,7 +1941,7 @@ function admin_page_logs(App &$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_viewlogs(App &$a){
|
function admin_page_viewlogs(App $a) {
|
||||||
$t = get_markup_template("admin_viewlogs.tpl");
|
$t = get_markup_template("admin_viewlogs.tpl");
|
||||||
$f = get_config('system','logfile');
|
$f = get_config('system','logfile');
|
||||||
$data = '';
|
$data = '';
|
||||||
|
@ -1980,10 +1980,10 @@ function admin_page_viewlogs(App &$a){
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Prosesses data send by the features admin page
|
* @brief Prosesses data send by the features admin page
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function admin_page_features_post(App &$a) {
|
function admin_page_features_post(App $a) {
|
||||||
|
|
||||||
check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features');
|
check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features');
|
||||||
|
|
||||||
|
@ -2017,20 +2017,20 @@ function admin_page_features_post(App &$a) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Subpage for global additional feature management
|
* @brief Subpage for global additional feature management
|
||||||
*
|
*
|
||||||
* This functin generates the subpage 'Manage Additional Features'
|
* This functin generates the subpage 'Manage Additional Features'
|
||||||
* for the admin panel. At this page the admin can set preferences
|
* for the admin panel. At this page the admin can set preferences
|
||||||
* for the user settings of the 'additional features'. If needed this
|
* for the user settings of the 'additional features'. If needed this
|
||||||
* preferences can be locked through the admin.
|
* preferences can be locked through the admin.
|
||||||
*
|
*
|
||||||
* The returned string contains the HTML code of the subpage 'Manage
|
* The returned string contains the HTML code of the subpage 'Manage
|
||||||
* Additional Features'
|
* Additional Features'
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_features(App &$a) {
|
function admin_page_features(App $a) {
|
||||||
|
|
||||||
if((argc() > 1) && (argv(1) === 'features')) {
|
if((argc() > 1) && (argv(1) === 'features')) {
|
||||||
$arr = array();
|
$arr = array();
|
||||||
$features = get_features(false);
|
$features = get_features(false);
|
||||||
|
@ -2049,7 +2049,7 @@ function admin_page_features(App &$a) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tpl = get_markup_template("admin_settings_features.tpl");
|
$tpl = get_markup_template("admin_settings_features.tpl");
|
||||||
$o .= replace_macros($tpl, array(
|
$o .= replace_macros($tpl, array(
|
||||||
'$form_security_token' => get_form_security_token("admin_manage_features"),
|
'$form_security_token' => get_form_security_token("admin_manage_features"),
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
require_once('mod/contacts.php');
|
require_once('mod/contacts.php');
|
||||||
|
|
||||||
function allfriends_content(App &$a) {
|
function allfriends_content(App $a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function amcd_content(App &$a) {
|
function amcd_content(App $a) {
|
||||||
//header("Content-type: text/json");
|
//header("Content-type: text/json");
|
||||||
echo <<< EOT
|
echo <<< EOT
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@ function oauth_get_client($request){
|
||||||
return $r[0];
|
return $r[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
function api_post(App &$a) {
|
function api_post(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -34,7 +34,7 @@ function api_post(App &$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function api_content(App &$a) {
|
function api_content(App $a) {
|
||||||
if ($a->cmd=='api/oauth/authorize'){
|
if ($a->cmd=='api/oauth/authorize'){
|
||||||
/*
|
/*
|
||||||
* api/oauth/authorize interact with the user. return a standard page
|
* api/oauth/authorize interact with the user. return a standard page
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function apps_content(App &$a) {
|
function apps_content(App $a) {
|
||||||
$privateaddons = get_config('config','private_addons');
|
$privateaddons = get_config('config','private_addons');
|
||||||
if ($privateaddons === "1") {
|
if ($privateaddons === "1") {
|
||||||
if((! (local_user()))) {
|
if((! (local_user()))) {
|
||||||
|
@ -20,6 +20,6 @@ function apps_content(App &$a) {
|
||||||
'$apps' => $a->apps,
|
'$apps' => $a->apps,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
|
|
||||||
function attach_init(App &$a) {
|
function attach_init(App $a) {
|
||||||
|
|
||||||
if($a->argc != 2) {
|
if($a->argc != 2) {
|
||||||
notice( t('Item not available.') . EOL);
|
notice( t('Item not available.') . EOL);
|
||||||
|
|
|
@ -9,55 +9,55 @@ function visible_lf($s) {
|
||||||
return str_replace("\n",'<br />', $s);
|
return str_replace("\n",'<br />', $s);
|
||||||
}
|
}
|
||||||
|
|
||||||
function babel_content(App &$a) {
|
function babel_content(App $a) {
|
||||||
|
|
||||||
$o .= '<h1>Babel Diagnostic</h1>';
|
$o .= '<h1>Babel Diagnostic</h1>';
|
||||||
|
|
||||||
$o .= '<form action="babel" method="post">';
|
$o .= '<form action="babel" method="post">';
|
||||||
$o .= t('Source (bbcode) text:') . EOL . '<textarea name="text" >' . htmlspecialchars($_REQUEST['text']) .'</textarea>' . EOL;
|
$o .= t('Source (bbcode) text:') . EOL . '<textarea name="text" >' . htmlspecialchars($_REQUEST['text']) .'</textarea>' . EOL;
|
||||||
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
|
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
|
||||||
|
|
||||||
$o .= '<br /><br />';
|
$o .= '<br /><br />';
|
||||||
|
|
||||||
$o .= '<form action="babel" method="post">';
|
$o .= '<form action="babel" method="post">';
|
||||||
$o .= t('Source (Diaspora) text to convert to BBcode:') . EOL . '<textarea name="d2bbtext" >' . htmlspecialchars($_REQUEST['d2bbtext']) .'</textarea>' . EOL;
|
$o .= t('Source (Diaspora) text to convert to BBcode:') . EOL . '<textarea name="d2bbtext" >' . htmlspecialchars($_REQUEST['d2bbtext']) .'</textarea>' . EOL;
|
||||||
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
|
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
|
||||||
|
|
||||||
$o .= '<br /><br />';
|
$o .= '<br /><br />';
|
||||||
|
|
||||||
if(x($_REQUEST,'text')) {
|
if(x($_REQUEST,'text')) {
|
||||||
|
|
||||||
$text = trim($_REQUEST['text']);
|
$text = trim($_REQUEST['text']);
|
||||||
$o .= "<h2>" . t("Source input: ") . "</h2>" . EOL. EOL;
|
$o .= "<h2>" . t("Source input: ") . "</h2>" . EOL. EOL;
|
||||||
$o .= visible_lf($text) . EOL. EOL;
|
$o .= visible_lf($text) . EOL. EOL;
|
||||||
|
|
||||||
$html = bbcode($text);
|
$html = bbcode($text);
|
||||||
$o .= "<h2>" . t("bb2html (raw HTML): ") . "</h2>" . EOL. EOL;
|
$o .= "<h2>" . t("bb2html (raw HTML): ") . "</h2>" . EOL. EOL;
|
||||||
$o .= htmlspecialchars($html). EOL. EOL;
|
$o .= htmlspecialchars($html). EOL. EOL;
|
||||||
|
|
||||||
//$html = bbcode($text);
|
//$html = bbcode($text);
|
||||||
$o .= "<h2>" . t("bb2html: ") . "</h2>" . EOL. EOL;
|
$o .= "<h2>" . t("bb2html: ") . "</h2>" . EOL. EOL;
|
||||||
$o .= $html. EOL. EOL;
|
$o .= $html. EOL. EOL;
|
||||||
|
|
||||||
$bbcode = html2bbcode($html);
|
$bbcode = html2bbcode($html);
|
||||||
$o .= "<h2>" . t("bb2html2bb: ") . "</h2>" . EOL. EOL;
|
$o .= "<h2>" . t("bb2html2bb: ") . "</h2>" . EOL. EOL;
|
||||||
$o .= visible_lf($bbcode) . EOL. EOL;
|
$o .= visible_lf($bbcode) . EOL. EOL;
|
||||||
|
|
||||||
$diaspora = bb2diaspora($text);
|
$diaspora = bb2diaspora($text);
|
||||||
$o .= "<h2>" . t("bb2md: ") . "</h2>" . EOL. EOL;
|
$o .= "<h2>" . t("bb2md: ") . "</h2>" . EOL. EOL;
|
||||||
$o .= visible_lf($diaspora) . EOL. EOL;
|
$o .= visible_lf($diaspora) . EOL. EOL;
|
||||||
|
|
||||||
$html = Markdown($diaspora);
|
$html = Markdown($diaspora);
|
||||||
$o .= "<h2>" . t("bb2md2html: ") . "</h2>" . EOL. EOL;
|
$o .= "<h2>" . t("bb2md2html: ") . "</h2>" . EOL. EOL;
|
||||||
$o .= $html. EOL. EOL;
|
$o .= $html. EOL. EOL;
|
||||||
|
|
||||||
$bbcode = diaspora2bb($diaspora);
|
$bbcode = diaspora2bb($diaspora);
|
||||||
$o .= "<h2>" . t("bb2dia2bb: ") . "</h2>" . EOL. EOL;
|
$o .= "<h2>" . t("bb2dia2bb: ") . "</h2>" . EOL. EOL;
|
||||||
$o .= visible_lf($bbcode) . EOL. EOL;
|
$o .= visible_lf($bbcode) . EOL. EOL;
|
||||||
|
|
||||||
$bbcode = html2bbcode($html);
|
$bbcode = html2bbcode($html);
|
||||||
$o .= "<h2>" . t("bb2md2html2bb: ") . "</h2>" . EOL. EOL;
|
$o .= "<h2>" . t("bb2md2html2bb: ") . "</h2>" . EOL. EOL;
|
||||||
$o .= visible_lf($bbcode) . EOL. EOL;
|
$o .= visible_lf($bbcode) . EOL. EOL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,13 +66,13 @@ function babel_content(App &$a) {
|
||||||
if(x($_REQUEST,'d2bbtext')) {
|
if(x($_REQUEST,'d2bbtext')) {
|
||||||
|
|
||||||
$d2bbtext = trim($_REQUEST['d2bbtext']);
|
$d2bbtext = trim($_REQUEST['d2bbtext']);
|
||||||
$o .= "<h2>" . t("Source input (Diaspora format): ") . "</h2>" . EOL. EOL;
|
$o .= "<h2>" . t("Source input (Diaspora format): ") . "</h2>" . EOL. EOL;
|
||||||
$o .= visible_lf($d2bbtext) . EOL. EOL;
|
$o .= visible_lf($d2bbtext) . EOL. EOL;
|
||||||
|
|
||||||
|
|
||||||
$bb = diaspora2bb($d2bbtext);
|
$bb = diaspora2bb($d2bbtext);
|
||||||
$o .= "<h2>" . t("diaspora2bb: ") . "</h2>" . EOL. EOL;
|
$o .= "<h2>" . t("diaspora2bb: ") . "</h2>" . EOL. EOL;
|
||||||
$o .= visible_lf($bb) . EOL. EOL;
|
$o .= visible_lf($bb) . EOL. EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
require_once('include/conversation.php');
|
require_once('include/conversation.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
function bookmarklet_init(App &$a) {
|
function bookmarklet_init(App $a) {
|
||||||
$_GET["mode"] = "minimal";
|
$_GET["mode"] = "minimal";
|
||||||
}
|
}
|
||||||
|
|
||||||
function bookmarklet_content(App &$a) {
|
function bookmarklet_content(App $a) {
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
$o = '<h2>'.t('Login').'</h2>';
|
$o = '<h2>'.t('Login').'</h2>';
|
||||||
$o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
|
$o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
require_once('include/event.php');
|
require_once('include/event.php');
|
||||||
require_once('include/redir.php');
|
require_once('include/redir.php');
|
||||||
|
|
||||||
function cal_init(App &$a) {
|
function cal_init(App $a) {
|
||||||
if($a->argc > 1)
|
if($a->argc > 1)
|
||||||
auto_redir($a, $a->argv[1]);
|
auto_redir($a, $a->argv[1]);
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ function cal_init(App &$a) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function cal_content(App &$a) {
|
function cal_content(App $a) {
|
||||||
nav_set_selected('events');
|
nav_set_selected('events');
|
||||||
|
|
||||||
$editselect = 'none';
|
$editselect = 'none';
|
||||||
|
|
|
@ -5,19 +5,19 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function cb_init(App &$a) {
|
function cb_init(App $a) {
|
||||||
call_hooks('cb_init');
|
call_hooks('cb_init');
|
||||||
}
|
}
|
||||||
|
|
||||||
function cb_post(App &$a) {
|
function cb_post(App $a) {
|
||||||
call_hooks('cb_post', $_POST);
|
call_hooks('cb_post', $_POST);
|
||||||
}
|
}
|
||||||
|
|
||||||
function cb_afterpost(App &$a) {
|
function cb_afterpost(App $a) {
|
||||||
call_hooks('cb_afterpost');
|
call_hooks('cb_afterpost');
|
||||||
}
|
}
|
||||||
|
|
||||||
function cb_content(App &$a) {
|
function cb_content(App $a) {
|
||||||
$o = '';
|
$o = '';
|
||||||
call_hooks('cb_content', $o);
|
call_hooks('cb_content', $o);
|
||||||
return $o;
|
return $o;
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
require_once('mod/contacts.php');
|
require_once('mod/contacts.php');
|
||||||
|
|
||||||
function common_content(App &$a) {
|
function common_content(App $a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function community_init(App &$a) {
|
function community_init(App $a) {
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
unset($_SESSION['theme']);
|
unset($_SESSION['theme']);
|
||||||
unset($_SESSION['mobile-theme']);
|
unset($_SESSION['mobile-theme']);
|
||||||
|
@ -10,7 +10,7 @@ function community_init(App &$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function community_content(&$a, $update = 0) {
|
function community_content(App $a, $update = 0) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
|
|
||||||
function contactgroup_content(App &$a) {
|
function contactgroup_content(App $a) {
|
||||||
|
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ require_once('include/Scrape.php');
|
||||||
require_once('mod/proxy.php');
|
require_once('mod/proxy.php');
|
||||||
require_once('include/Photo.php');
|
require_once('include/Photo.php');
|
||||||
|
|
||||||
function contacts_init(App &$a) {
|
function contacts_init(App $a) {
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ function contacts_init(App &$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function contacts_batch_actions(App &$a){
|
function contacts_batch_actions(App $a) {
|
||||||
$contacts_id = $_POST['contact_batch'];
|
$contacts_id = $_POST['contact_batch'];
|
||||||
if (!is_array($contacts_id)) return;
|
if (!is_array($contacts_id)) return;
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ function contacts_batch_actions(App &$a){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function contacts_post(App &$a) {
|
function contacts_post(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
@ -349,7 +349,7 @@ function _contact_drop($contact_id, $orig_record) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function contacts_content(App &$a) {
|
function contacts_content(App $a) {
|
||||||
|
|
||||||
$sort_type = 0;
|
$sort_type = 0;
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -831,13 +831,13 @@ function contacts_content(App &$a) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief List of pages for the Contact TabBar
|
* @brief List of pages for the Contact TabBar
|
||||||
*
|
*
|
||||||
* Available Pages are 'Status', 'Profile', 'Contacts' and 'Common Friends'
|
* Available Pages are 'Status', 'Profile', 'Contacts' and 'Common Friends'
|
||||||
*
|
*
|
||||||
* @param app $a
|
* @param app $a
|
||||||
* @param int $contact_id The ID of the contact
|
* @param int $contact_id The ID of the contact
|
||||||
* @param int $active_tab 1 if tab should be marked as active
|
* @param int $active_tab 1 if tab should be marked as active
|
||||||
*
|
*
|
||||||
* @return array with with contact TabBar data
|
* @return array with with contact TabBar data
|
||||||
*/
|
*/
|
||||||
function contacts_tab($a, $contact_id, $active_tab) {
|
function contacts_tab($a, $contact_id, $active_tab) {
|
||||||
|
@ -961,9 +961,9 @@ function _contact_detail_for_template($rr){
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gives a array with actions which can performed to a given contact
|
* @brief Gives a array with actions which can performed to a given contact
|
||||||
*
|
*
|
||||||
* This includes actions like e.g. 'block', 'hide', 'archive', 'delete' and others
|
* This includes actions like e.g. 'block', 'hide', 'archive', 'delete' and others
|
||||||
*
|
*
|
||||||
* @param array $contact Data about the Contact
|
* @param array $contact Data about the Contact
|
||||||
* @return array with contact related actions
|
* @return array with contact related actions
|
||||||
*/
|
*/
|
||||||
|
@ -1019,7 +1019,7 @@ function contact_actions($contact) {
|
||||||
|
|
||||||
$contact_actions['delete'] = array(
|
$contact_actions['delete'] = array(
|
||||||
'label' => t('Delete'),
|
'label' => t('Delete'),
|
||||||
'url' => 'contacts/' . $contact['id'] . '/drop',
|
'url' => 'contacts/' . $contact['id'] . '/drop',
|
||||||
'title' => t('Delete contact'),
|
'title' => t('Delete contact'),
|
||||||
'sel' => '',
|
'sel' => '',
|
||||||
'id' => 'delete',
|
'id' => 'delete',
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
// and 10-20 milliseconds to fetch all the child items.
|
// and 10-20 milliseconds to fetch all the child items.
|
||||||
|
|
||||||
|
|
||||||
function content_content(&$a, $update = 0) {
|
function content_content(App $a, $update = 0) {
|
||||||
|
|
||||||
require_once('include/conversation.php');
|
require_once('include/conversation.php');
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ function content_content(&$a, $update = 0) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$contact_id = $a->cid;
|
$contact_id = $a->cid;
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ function content_content(&$a, $update = 0) {
|
||||||
$def_acl = array('allow_cid' => $str);
|
$def_acl = array('allow_cid' => $str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$sql_options = (($star) ? " and starred = 1 " : '');
|
$sql_options = (($star) ? " and starred = 1 " : '');
|
||||||
$sql_options .= (($bmark) ? " and bookmark = 1 " : '');
|
$sql_options .= (($bmark) ? " and bookmark = 1 " : '');
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ function content_content(&$a, $update = 0) {
|
||||||
}
|
}
|
||||||
elseif($cid) {
|
elseif($cid) {
|
||||||
|
|
||||||
$r = q("SELECT `id`,`name`,`network`,`writable`,`nurl` FROM `contact` WHERE `id` = %d
|
$r = q("SELECT `id`,`name`,`network`,`writable`,`nurl` FROM `contact` WHERE `id` = %d
|
||||||
AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
|
AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
|
||||||
intval($cid)
|
intval($cid)
|
||||||
);
|
);
|
||||||
|
@ -307,7 +307,7 @@ function content_content(&$a, $update = 0) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function render_content(&$a, $items, $mode, $update, $preview = false) {
|
function render_content(App $a, $items, $mode, $update, $preview = false) {
|
||||||
|
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('mod/proxy.php');
|
require_once('mod/proxy.php');
|
||||||
|
@ -382,7 +382,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
|
|
||||||
if($mode === 'network-new' || $mode === 'search' || $mode === 'community') {
|
if($mode === 'network-new' || $mode === 'search' || $mode === 'community') {
|
||||||
|
|
||||||
// "New Item View" on network page or search page results
|
// "New Item View" on network page or search page results
|
||||||
// - just loop through the items and format them minimally for display
|
// - just loop through the items and format them minimally for display
|
||||||
|
|
||||||
//$tpl = get_markup_template('search_item.tpl');
|
//$tpl = get_markup_template('search_item.tpl');
|
||||||
|
@ -402,7 +402,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
|| (activity_match($item['verb'],ACTIVITY_DISLIKE))
|
|| (activity_match($item['verb'],ACTIVITY_DISLIKE))
|
||||||
|| activity_match($item['verb'],ACTIVITY_ATTEND)
|
|| activity_match($item['verb'],ACTIVITY_ATTEND)
|
||||||
|| activity_match($item['verb'],ACTIVITY_ATTENDNO)
|
|| activity_match($item['verb'],ACTIVITY_ATTENDNO)
|
||||||
|| activity_match($item['verb'],ACTIVITY_ATTENDMAYBE))
|
|| activity_match($item['verb'],ACTIVITY_ATTENDMAYBE))
|
||||||
&& ($item['id'] != $item['parent']))
|
&& ($item['id'] != $item['parent']))
|
||||||
continue;
|
continue;
|
||||||
$nickname = $item['nickname'];
|
$nickname = $item['nickname'];
|
||||||
|
@ -450,7 +450,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
|
|
||||||
$drop = array(
|
$drop = array(
|
||||||
'dropping' => $dropping,
|
'dropping' => $dropping,
|
||||||
'select' => t('Select'),
|
'select' => t('Select'),
|
||||||
'delete' => t('Delete'),
|
'delete' => t('Delete'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -540,11 +540,11 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
$comments[$item['parent']] = 1;
|
$comments[$item['parent']] = 1;
|
||||||
else
|
else
|
||||||
$comments[$item['parent']] += 1;
|
$comments[$item['parent']] += 1;
|
||||||
} elseif(! x($comments,$item['parent']))
|
} elseif(! x($comments,$item['parent']))
|
||||||
$comments[$item['parent']] = 0; // avoid notices later on
|
$comments[$item['parent']] = 0; // avoid notices later on
|
||||||
}
|
}
|
||||||
|
|
||||||
// map all the like/dislike/attendance activities for each parent item
|
// map all the like/dislike/attendance activities for each parent item
|
||||||
// Store these in the $alike and $dlike arrays
|
// Store these in the $alike and $dlike arrays
|
||||||
|
|
||||||
foreach($items as $item) {
|
foreach($items as $item) {
|
||||||
|
@ -633,14 +633,14 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
|
|
||||||
$redirect_url = 'redir/' . $item['cid'] ;
|
$redirect_url = 'redir/' . $item['cid'] ;
|
||||||
|
|
||||||
$lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
$lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
||||||
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
|
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
|
||||||
? t('Private Message')
|
? t('Private Message')
|
||||||
: false);
|
: false);
|
||||||
|
|
||||||
|
|
||||||
// Top-level wall post not written by the wall owner (wall-to-wall)
|
// Top-level wall post not written by the wall owner (wall-to-wall)
|
||||||
// First figure out who owns it.
|
// First figure out who owns it.
|
||||||
|
|
||||||
$osparkle = '';
|
$osparkle = '';
|
||||||
|
|
||||||
|
@ -667,13 +667,13 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
if((! $owner_linkmatch) && (! $alias_linkmatch) && (! $owner_namematch)) {
|
if((! $owner_linkmatch) && (! $alias_linkmatch) && (! $owner_namematch)) {
|
||||||
|
|
||||||
// The author url doesn't match the owner (typically the contact)
|
// The author url doesn't match the owner (typically the contact)
|
||||||
// and also doesn't match the contact alias.
|
// and also doesn't match the contact alias.
|
||||||
// The name match is a hack to catch several weird cases where URLs are
|
// The name match is a hack to catch several weird cases where URLs are
|
||||||
// all over the park. It can be tricked, but this prevents you from
|
// all over the park. It can be tricked, but this prevents you from
|
||||||
// seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn
|
// seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn
|
||||||
// well that it's the same Bob Smith.
|
// well that it's the same Bob Smith.
|
||||||
|
|
||||||
// But it could be somebody else with the same name. It just isn't highly likely.
|
// But it could be somebody else with the same name. It just isn't highly likely.
|
||||||
|
|
||||||
|
|
||||||
$owner_url = $item['owner-link'];
|
$owner_url = $item['owner-link'];
|
||||||
|
@ -682,7 +682,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
$template = $wallwall;
|
$template = $wallwall;
|
||||||
$commentww = 'ww';
|
$commentww = 'ww';
|
||||||
// If it is our contact, use a friendly redirect link
|
// If it is our contact, use a friendly redirect link
|
||||||
if((link_compare($item['owner-link'],$item['url']))
|
if((link_compare($item['owner-link'],$item['url']))
|
||||||
&& ($item['network'] === NETWORK_DFRN)) {
|
&& ($item['network'] === NETWORK_DFRN)) {
|
||||||
$owner_url = $redirect_url;
|
$owner_url = $redirect_url;
|
||||||
$osparkle = ' sparkle';
|
$osparkle = ' sparkle';
|
||||||
|
@ -694,7 +694,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$likebuttons = '';
|
$likebuttons = '';
|
||||||
$shareable = ((($profile_owner == local_user()) && ($item['private'] != 1)) ? true : false);
|
$shareable = ((($profile_owner == local_user()) && ($item['private'] != 1)) ? true : false);
|
||||||
|
|
||||||
if($page_writeable) {
|
if($page_writeable) {
|
||||||
/* if($toplevelpost) { */
|
/* if($toplevelpost) { */
|
||||||
|
@ -714,7 +714,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
|
|
||||||
if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) {
|
if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) {
|
||||||
$comment = replace_macros($cmnt_tpl,array(
|
$comment = replace_macros($cmnt_tpl,array(
|
||||||
'$return_path' => '',
|
'$return_path' => '',
|
||||||
'$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''),
|
'$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''),
|
||||||
'$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'),
|
'$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'),
|
||||||
'$id' => $item['item_id'],
|
'$id' => $item['item_id'],
|
||||||
|
@ -756,7 +756,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
|
|
||||||
$drop = array(
|
$drop = array(
|
||||||
'dropping' => $dropping,
|
'dropping' => $dropping,
|
||||||
'select' => t('Select'),
|
'select' => t('Select'),
|
||||||
'delete' => t('Delete'),
|
'delete' => t('Delete'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* addons repository will be listed though ATM)
|
* addons repository will be listed though ATM)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function credits_content (App &$a) {
|
function credits_content (App $a) {
|
||||||
/* fill the page with credits */
|
/* fill the page with credits */
|
||||||
$f = fopen('util/credits.txt','r');
|
$f = fopen('util/credits.txt','r');
|
||||||
$names = fread($f, filesize('util/credits.txt'));
|
$names = fread($f, filesize('util/credits.txt'));
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
require_once("include/contact_selectors.php");
|
require_once("include/contact_selectors.php");
|
||||||
require_once("mod/contacts.php");
|
require_once("mod/contacts.php");
|
||||||
|
|
||||||
function crepair_init(App &$a) {
|
function crepair_init(App $a) {
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ function crepair_init(App &$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function crepair_post(App &$a) {
|
function crepair_post(App $a) {
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ function crepair_post(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function crepair_content(App &$a) {
|
function crepair_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
require_once('mod/settings.php');
|
require_once('mod/settings.php');
|
||||||
|
|
||||||
function delegate_init(App &$a) {
|
function delegate_init(App $a) {
|
||||||
return settings_init($a);
|
return settings_init($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function delegate_content(App &$a) {
|
function delegate_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -90,12 +90,12 @@ function delegate_content(App &$a) {
|
||||||
|
|
||||||
// find every contact who might be a candidate for delegation
|
// find every contact who might be a candidate for delegation
|
||||||
|
|
||||||
$r = q("select nurl from contact where substring_index(contact.nurl,'/',3) = '%s'
|
$r = q("select nurl from contact where substring_index(contact.nurl,'/',3) = '%s'
|
||||||
and contact.uid = %d and contact.self = 0 and network = '%s' ",
|
and contact.uid = %d and contact.self = 0 and network = '%s' ",
|
||||||
dbesc(normalise_link(App::get_baseurl())),
|
dbesc(normalise_link(App::get_baseurl())),
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc(NETWORK_DFRN)
|
dbesc(NETWORK_DFRN)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! dbm::is_result($r)) {
|
if (! dbm::is_result($r)) {
|
||||||
notice( t('No potential page delegates located.') . EOL);
|
notice( t('No potential page delegates located.') . EOL);
|
||||||
|
|
|
@ -22,7 +22,7 @@ require_once('include/enotify.php');
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
require_once('include/Probe.php');
|
require_once('include/Probe.php');
|
||||||
|
|
||||||
function dfrn_confirm_post(&$a,$handsfree = null) {
|
function dfrn_confirm_post(App $a, $handsfree = null) {
|
||||||
|
|
||||||
if(is_array($handsfree)) {
|
if(is_array($handsfree)) {
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ require_once('include/event.php');
|
||||||
|
|
||||||
require_once('library/defuse/php-encryption-1.2.1/Crypto.php');
|
require_once('library/defuse/php-encryption-1.2.1/Crypto.php');
|
||||||
|
|
||||||
function dfrn_notify_post(App &$a) {
|
function dfrn_notify_post(App $a) {
|
||||||
logger(__function__, LOGGER_TRACE);
|
logger(__function__, LOGGER_TRACE);
|
||||||
$dfrn_id = ((x($_POST,'dfrn_id')) ? notags(trim($_POST['dfrn_id'])) : '');
|
$dfrn_id = ((x($_POST,'dfrn_id')) ? notags(trim($_POST['dfrn_id'])) : '');
|
||||||
$dfrn_version = ((x($_POST,'dfrn_version')) ? (float) $_POST['dfrn_version'] : 2.0);
|
$dfrn_version = ((x($_POST,'dfrn_version')) ? (float) $_POST['dfrn_version'] : 2.0);
|
||||||
|
@ -221,7 +221,7 @@ function dfrn_notify_post(App &$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function dfrn_notify_content(App &$a) {
|
function dfrn_notify_content(App $a) {
|
||||||
|
|
||||||
if(x($_GET,'dfrn_id')) {
|
if(x($_GET,'dfrn_id')) {
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once('include/auth.php');
|
||||||
require_once('include/dfrn.php');
|
require_once('include/dfrn.php');
|
||||||
|
|
||||||
|
|
||||||
function dfrn_poll_init(App &$a) {
|
function dfrn_poll_init(App $a) {
|
||||||
|
|
||||||
|
|
||||||
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
||||||
|
@ -163,7 +163,7 @@ function dfrn_poll_init(App &$a) {
|
||||||
|
|
||||||
if($final_dfrn_id != $orig_id) {
|
if($final_dfrn_id != $orig_id) {
|
||||||
logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
|
logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
|
||||||
// did not decode properly - cannot trust this site
|
// did not decode properly - cannot trust this site
|
||||||
xml_status(3, 'Bad decryption');
|
xml_status(3, 'Bad decryption');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ function dfrn_poll_init(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function dfrn_poll_post(App &$a) {
|
function dfrn_poll_post(App $a) {
|
||||||
|
|
||||||
$dfrn_id = ((x($_POST,'dfrn_id')) ? $_POST['dfrn_id'] : '');
|
$dfrn_id = ((x($_POST,'dfrn_id')) ? $_POST['dfrn_id'] : '');
|
||||||
$challenge = ((x($_POST,'challenge')) ? $_POST['challenge'] : '');
|
$challenge = ((x($_POST,'challenge')) ? $_POST['challenge'] : '');
|
||||||
|
@ -260,7 +260,7 @@ function dfrn_poll_post(App &$a) {
|
||||||
|
|
||||||
if($final_dfrn_id != $orig_id) {
|
if($final_dfrn_id != $orig_id) {
|
||||||
logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
|
logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
|
||||||
// did not decode properly - cannot trust this site
|
// did not decode properly - cannot trust this site
|
||||||
xml_status(3, 'Bad decryption');
|
xml_status(3, 'Bad decryption');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ function dfrn_poll_post(App &$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function dfrn_poll_content(App &$a) {
|
function dfrn_poll_content(App $a) {
|
||||||
|
|
||||||
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
||||||
$type = ((x($_GET,'type')) ? $_GET['type'] : 'data');
|
$type = ((x($_GET,'type')) ? $_GET['type'] : 'data');
|
||||||
|
|
|
@ -17,7 +17,7 @@ require_once('include/Scrape.php');
|
||||||
require_once('include/Probe.php');
|
require_once('include/Probe.php');
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
|
|
||||||
function dfrn_request_init(App &$a) {
|
function dfrn_request_init(App $a) {
|
||||||
|
|
||||||
if($a->argc > 1)
|
if($a->argc > 1)
|
||||||
$which = $a->argv[1];
|
$which = $a->argv[1];
|
||||||
|
@ -42,7 +42,7 @@ function dfrn_request_init(App &$a) {
|
||||||
* After logging in, we click 'submit' to approve the linkage.
|
* After logging in, we click 'submit' to approve the linkage.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function dfrn_request_post(App &$a) {
|
function dfrn_request_post(App $a) {
|
||||||
|
|
||||||
if(($a->argc != 2) || (! count($a->profile))) {
|
if(($a->argc != 2) || (! count($a->profile))) {
|
||||||
logger('Wrong count of argc or profiles: argc=' . $a->argc . ',profile()=' . count($a->profile));
|
logger('Wrong count of argc or profiles: argc=' . $a->argc . ',profile()=' . count($a->profile));
|
||||||
|
@ -658,7 +658,7 @@ function dfrn_request_post(App &$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function dfrn_request_content(App &$a) {
|
function dfrn_request_content(App $a) {
|
||||||
|
|
||||||
if (($a->argc != 2) || (! count($a->profile))) {
|
if (($a->argc != 2) || (! count($a->profile))) {
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function directory_init(App &$a) {
|
function directory_init(App $a) {
|
||||||
$a->set_pager_itemspage(60);
|
$a->set_pager_itemspage(60);
|
||||||
|
|
||||||
if(local_user()) {
|
if(local_user()) {
|
||||||
|
@ -20,19 +20,19 @@ function directory_init(App &$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function directory_post(App &$a) {
|
function directory_post(App $a) {
|
||||||
if(x($_POST,'search'))
|
if(x($_POST,'search'))
|
||||||
$a->data['search'] = $_POST['search'];
|
$a->data['search'] = $_POST['search'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function directory_content(App &$a) {
|
function directory_content(App $a) {
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
require_once("mod/proxy.php");
|
require_once("mod/proxy.php");
|
||||||
|
|
||||||
if((get_config('system','block_public')) && (! local_user()) && (! remote_user()) ||
|
if((get_config('system','block_public')) && (! local_user()) && (! remote_user()) ||
|
||||||
(get_config('system','block_local_dir')) && (! local_user()) && (! remote_user())) {
|
(get_config('system','block_local_dir')) && (! local_user()) && (! remote_user())) {
|
||||||
notice( t('Public access denied.') . EOL);
|
notice( t('Public access denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
|
@ -124,7 +124,7 @@ function directory_content(App &$a) {
|
||||||
}
|
}
|
||||||
// if(strlen($rr['dob'])) {
|
// if(strlen($rr['dob'])) {
|
||||||
// if(($years = age($rr['dob'],$rr['timezone'],'')) != 0)
|
// if(($years = age($rr['dob'],$rr['timezone'],'')) != 0)
|
||||||
// $details .= '<br />' . t('Age: ') . $years ;
|
// $details .= '<br />' . t('Age: ') . $years ;
|
||||||
// }
|
// }
|
||||||
// if(strlen($rr['gender']))
|
// if(strlen($rr['gender']))
|
||||||
// $details .= '<br />' . t('Gender: ') . $rr['gender'];
|
// $details .= '<br />' . t('Gender: ') . $rr['gender'];
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
require_once('mod/contacts.php');
|
require_once('mod/contacts.php');
|
||||||
|
|
||||||
function dirfind_init(App &$a) {
|
function dirfind_init(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL );
|
notice( t('Permission denied.') . EOL );
|
||||||
|
@ -23,7 +23,7 @@ function dirfind_init(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function dirfind_content(&$a, $prefix = "") {
|
function dirfind_content(App $a, $prefix = "") {
|
||||||
|
|
||||||
$community = false;
|
$community = false;
|
||||||
$discover_user = false;
|
$discover_user = false;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function display_init(App &$a) {
|
function display_init(App $a) {
|
||||||
|
|
||||||
if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
||||||
return;
|
return;
|
||||||
|
@ -194,7 +194,7 @@ function display_fetchauthor($a, $item) {
|
||||||
return($profiledata);
|
return($profiledata);
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_content(&$a, $update = 0) {
|
function display_content(App $a, $update = 0) {
|
||||||
|
|
||||||
if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
||||||
notice(t('Public access denied.') . EOL);
|
notice(t('Public access denied.') . EOL);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/acl_selectors.php');
|
require_once('include/acl_selectors.php');
|
||||||
|
|
||||||
function editpost_content(App &$a) {
|
function editpost_content(App $a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ require_once('include/datetime.php');
|
||||||
require_once('include/event.php');
|
require_once('include/event.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
function events_init(App &$a) {
|
function events_init(App $a) {
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ function events_init(App &$a) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function events_post(App &$a) {
|
function events_post(App $a) {
|
||||||
|
|
||||||
logger('post: ' . print_r($_REQUEST,true));
|
logger('post: ' . print_r($_REQUEST,true));
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ function events_post(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function events_content(App &$a) {
|
function events_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -10,7 +10,7 @@ require_once('include/Photo.php');
|
||||||
/**
|
/**
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function fbrowser_content(App &$a){
|
function fbrowser_content(App $a) {
|
||||||
|
|
||||||
if (!local_user())
|
if (!local_user())
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -6,9 +6,7 @@ require_once("include/crypto.php");
|
||||||
require_once("include/diaspora.php");
|
require_once("include/diaspora.php");
|
||||||
require_once("include/xml.php");
|
require_once("include/xml.php");
|
||||||
|
|
||||||
/// @TODO You always make it like this: function foo(&$a)
|
function fetch_init(App $a) {
|
||||||
/// @TODO This means that the value of $a can be changed in anything, remove & and use App as type-hint
|
|
||||||
function fetch_init(App &$a){
|
|
||||||
|
|
||||||
if (($a->argc != 3) OR (!in_array($a->argv[1], array("post", "status_message", "reshare")))) {
|
if (($a->argc != 3) OR (!in_array($a->argv[1], array("post", "status_message", "reshare")))) {
|
||||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
|
||||||
function filer_content(App &$a) {
|
function filer_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
killme();
|
killme();
|
||||||
|
@ -30,7 +30,7 @@ function filer_content(App &$a) {
|
||||||
'$field' => array('term', t("Save to Folder:"), '', '', $filetags, t('- select -')),
|
'$field' => array('term', t("Save to Folder:"), '', '', $filetags, t('- select -')),
|
||||||
'$submit' => t('Save'),
|
'$submit' => t('Save'),
|
||||||
));
|
));
|
||||||
|
|
||||||
echo $o;
|
echo $o;
|
||||||
}
|
}
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function filerm_content(App &$a) {
|
function filerm_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/follow.php');
|
||||||
require_once('include/Contact.php');
|
require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
|
|
||||||
function follow_content(App &$a) {
|
function follow_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -152,7 +152,7 @@ function follow_content(App &$a) {
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
function follow_post(App &$a) {
|
function follow_post(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function friendica_init(App &$a) {
|
function friendica_init(App $a) {
|
||||||
if ($a->argv[1]=="json"){
|
if ($a->argv[1]=="json"){
|
||||||
$register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
|
$register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ function friendica_init(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function friendica_content(App &$a) {
|
function friendica_content(App $a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
$o .= '<h3>Friendica</h3>';
|
$o .= '<h3>Friendica</h3>';
|
||||||
|
@ -70,7 +70,7 @@ function friendica_content(App &$a) {
|
||||||
$o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
|
$o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
|
||||||
$o .= t('running at web location') . ' ' . z_root() . '</p><p>';
|
$o .= t('running at web location') . ' ' . z_root() . '</p><p>';
|
||||||
|
|
||||||
$o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
|
$o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
|
||||||
|
|
||||||
$o .= t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">'.t('the bugtracker at github').'</a></p><p>';
|
$o .= t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">'.t('the bugtracker at github').'</a></p><p>';
|
||||||
$o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
|
$o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
|
||||||
|
@ -102,7 +102,7 @@ function friendica_content(App &$a) {
|
||||||
else
|
else
|
||||||
$o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
|
$o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
|
||||||
|
|
||||||
call_hooks('about_hook', $o);
|
call_hooks('about_hook', $o);
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function fsuggest_post(App &$a) {
|
function fsuggest_post(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
@ -40,11 +40,11 @@ function fsuggest_post(App &$a) {
|
||||||
VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')",
|
VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
dbesc($r[0]['name']),
|
dbesc($r[0]['name']),
|
||||||
dbesc($r[0]['url']),
|
dbesc($r[0]['url']),
|
||||||
dbesc($r[0]['request']),
|
dbesc($r[0]['request']),
|
||||||
dbesc($r[0]['photo']),
|
dbesc($r[0]['photo']),
|
||||||
dbesc($hash),
|
dbesc($hash),
|
||||||
dbesc(datetime_convert())
|
dbesc(datetime_convert())
|
||||||
);
|
);
|
||||||
$r = q("SELECT `id` FROM `fsuggest` WHERE `note` = '%s' AND `uid` = %d LIMIT 1",
|
$r = q("SELECT `id` FROM `fsuggest` WHERE `note` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
|
@ -71,7 +71,7 @@ function fsuggest_post(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function fsuggest_content(App &$a) {
|
function fsuggest_content(App $a) {
|
||||||
|
|
||||||
require_once('include/acl_selectors.php');
|
require_once('include/acl_selectors.php');
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ function fsuggest_content(App &$a) {
|
||||||
|
|
||||||
$o .= '<form id="fsuggest-form" action="fsuggest/' . $contact_id . '" method="post" >';
|
$o .= '<form id="fsuggest-form" action="fsuggest/' . $contact_id . '" method="post" >';
|
||||||
|
|
||||||
$o .= contact_selector('suggest','suggest-select', false,
|
$o .= contact_selector('suggest','suggest-select', false,
|
||||||
array('size' => 4, 'exclude' => $contact_id, 'networks' => 'DFRN_ONLY', 'single' => true));
|
array('size' => 4, 'exclude' => $contact_id, 'networks' => 'DFRN_ONLY', 'single' => true));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ function validate_members(&$item) {
|
||||||
$item = intval($item);
|
$item = intval($item);
|
||||||
}
|
}
|
||||||
|
|
||||||
function group_init(App &$a) {
|
function group_init(App $a) {
|
||||||
if(local_user()) {
|
if(local_user()) {
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
$a->page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0));
|
$a->page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0));
|
||||||
|
@ -13,7 +13,7 @@ function group_init(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function group_post(App &$a) {
|
function group_post(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -69,7 +69,7 @@ function group_post(App &$a) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function group_content(App &$a) {
|
function group_content(App $a) {
|
||||||
$change = false;
|
$change = false;
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function hcard_init(App &$a) {
|
function hcard_init(App $a) {
|
||||||
|
|
||||||
$blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
|
$blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ if (!function_exists('load_doc_file')) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function help_content(App &$a) {
|
function help_content(App $a) {
|
||||||
|
|
||||||
nav_set_selected('help');
|
nav_set_selected('help');
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('home_init')) {
|
if(! function_exists('home_init')) {
|
||||||
function home_init(App &$a) {
|
function home_init(App $a) {
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
call_hooks('home_init',$ret);
|
call_hooks('home_init',$ret);
|
||||||
|
@ -17,7 +17,7 @@ function home_init(App &$a) {
|
||||||
}}
|
}}
|
||||||
|
|
||||||
if(! function_exists('home_content')) {
|
if(! function_exists('home_content')) {
|
||||||
function home_content(App &$a) {
|
function home_content(App $a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/crypto.php');
|
require_once('include/crypto.php');
|
||||||
|
|
||||||
function hostxrd_init(App &$a) {
|
function hostxrd_init(App $a) {
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
header("Content-type: text/xml");
|
header("Content-type: text/xml");
|
||||||
$pubkey = get_config('system','site_pubkey');
|
$pubkey = get_config('system','site_pubkey');
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
require_once("include/socgraph.php");
|
require_once("include/socgraph.php");
|
||||||
require_once("include/Contact.php");
|
require_once("include/Contact.php");
|
||||||
|
|
||||||
function hovercard_init(App &$a) {
|
function hovercard_init(App $a) {
|
||||||
// Just for testing purposes
|
// Just for testing purposes
|
||||||
$_GET["mode"] = "minimal";
|
$_GET["mode"] = "minimal";
|
||||||
}
|
}
|
||||||
|
@ -96,10 +96,10 @@ function hovercard_content() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the raw content of a template file
|
* @brief Get the raw content of a template file
|
||||||
*
|
*
|
||||||
* @param string $template The name of the template
|
* @param string $template The name of the template
|
||||||
* @param string $root Directory of the template
|
* @param string $root Directory of the template
|
||||||
*
|
*
|
||||||
* @return string|bool Output the raw content if existent, otherwise false
|
* @return string|bool Output the raw content if existent, otherwise false
|
||||||
*/
|
*/
|
||||||
function get_template_content($template, $root = "") {
|
function get_template_content($template, $root = "") {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function ignored_init(App &$a) {
|
function ignored_init(App $a) {
|
||||||
|
|
||||||
$ignored = 0;
|
$ignored = 0;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once "include/Photo.php";
|
||||||
$install_wizard_pass=1;
|
$install_wizard_pass=1;
|
||||||
|
|
||||||
|
|
||||||
function install_init(App &$a){
|
function install_init(App $a) {
|
||||||
|
|
||||||
// $baseurl/install/testrwrite to test if rewite in .htaccess is working
|
// $baseurl/install/testrwrite to test if rewite in .htaccess is working
|
||||||
if ($a->argc==2 && $a->argv[1]=="testrewrite") {
|
if ($a->argc==2 && $a->argv[1]=="testrewrite") {
|
||||||
|
@ -24,7 +24,7 @@ function install_init(App &$a){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_post(App &$a) {
|
function install_post(App $a) {
|
||||||
global $install_wizard_pass, $db;
|
global $install_wizard_pass, $db;
|
||||||
|
|
||||||
switch($install_wizard_pass) {
|
switch($install_wizard_pass) {
|
||||||
|
@ -132,7 +132,7 @@ function get_db_errno() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_content(App &$a) {
|
function install_content(App $a) {
|
||||||
|
|
||||||
global $install_wizard_pass, $db;
|
global $install_wizard_pass, $db;
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -565,7 +565,7 @@ function check_imagik(&$checks) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function manual_config(App &$a) {
|
function manual_config(App $a) {
|
||||||
$data = htmlentities($a->data['txt'],ENT_COMPAT,'UTF-8');
|
$data = htmlentities($a->data['txt'],ENT_COMPAT,'UTF-8');
|
||||||
$o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
|
$o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
|
||||||
$o .= "<textarea rows=\"24\" cols=\"80\" >$data</textarea>";
|
$o .= "<textarea rows=\"24\" cols=\"80\" >$data</textarea>";
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
require_once('include/email.php');
|
require_once('include/email.php');
|
||||||
|
|
||||||
function invite_post(App &$a) {
|
function invite_post(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -73,8 +73,8 @@ function invite_post(App &$a) {
|
||||||
$nmessage = $message;
|
$nmessage = $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = mail($recip, email_header_encode( t('Please join us on Friendica'),'UTF-8'),
|
$res = mail($recip, email_header_encode( t('Please join us on Friendica'),'UTF-8'),
|
||||||
$nmessage,
|
$nmessage,
|
||||||
"From: " . $a->user['email'] . "\n"
|
"From: " . $a->user['email'] . "\n"
|
||||||
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
||||||
. 'Content-transfer-encoding: 8bit' );
|
. 'Content-transfer-encoding: 8bit' );
|
||||||
|
@ -97,7 +97,7 @@ function invite_post(App &$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function invite_content(App &$a) {
|
function invite_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -136,7 +136,7 @@ function invite_content(App &$a) {
|
||||||
'$msg_text' => t('Your message:'),
|
'$msg_text' => t('Your message:'),
|
||||||
'$default_message' => t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n"
|
'$default_message' => t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n"
|
||||||
. $linktxt
|
. $linktxt
|
||||||
. "\r\n" . "\r\n" . (($invonly) ? t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') .t('Once you have registered, please connect with me via my profile page at:')
|
. "\r\n" . "\r\n" . (($invonly) ? t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') .t('Once you have registered, please connect with me via my profile page at:')
|
||||||
. "\r\n" . "\r\n" . App::get_baseurl() . '/profile/' . $a->user['nickname']
|
. "\r\n" . "\r\n" . App::get_baseurl() . '/profile/' . $a->user['nickname']
|
||||||
. "\r\n" . "\r\n" . t('For more information about the Friendica project and why we feel it is important, please visit http://friendica.com') . "\r\n" . "\r\n" ,
|
. "\r\n" . "\r\n" . t('For more information about the Friendica project and why we feel it is important, please visit http://friendica.com') . "\r\n" . "\r\n" ,
|
||||||
'$submit' => t('Submit')
|
'$submit' => t('Submit')
|
||||||
|
|
|
@ -27,7 +27,7 @@ require_once('include/Scrape.php');
|
||||||
require_once('include/diaspora.php');
|
require_once('include/diaspora.php');
|
||||||
require_once('include/Contact.php');
|
require_once('include/Contact.php');
|
||||||
|
|
||||||
function item_post(App &$a) {
|
function item_post(App $a) {
|
||||||
|
|
||||||
if((! local_user()) && (! remote_user()) && (! x($_REQUEST,'commenter')))
|
if((! local_user()) && (! remote_user()) && (! x($_REQUEST,'commenter')))
|
||||||
return;
|
return;
|
||||||
|
@ -1066,7 +1066,7 @@ function item_post_return($baseurl, $api_source, $return_path) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function item_content(App &$a) {
|
function item_content(App $a) {
|
||||||
|
|
||||||
if ((! local_user()) && (! remote_user())) {
|
if ((! local_user()) && (! remote_user())) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
require_once('include/like.php');
|
require_once('include/like.php');
|
||||||
|
|
||||||
function like_content(App &$a) {
|
function like_content(App $a) {
|
||||||
if(! local_user() && ! remote_user()) {
|
if(! local_user() && ! remote_user()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require_once('include/datetime.php');
|
require_once('include/datetime.php');
|
||||||
|
|
||||||
|
|
||||||
function localtime_post(App &$a) {
|
function localtime_post(App $a) {
|
||||||
|
|
||||||
$t = $_REQUEST['time'];
|
$t = $_REQUEST['time'];
|
||||||
if(! $t)
|
if(! $t)
|
||||||
|
@ -16,7 +16,7 @@ function localtime_post(App &$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function localtime_content(App &$a) {
|
function localtime_content(App $a) {
|
||||||
$t = $_REQUEST['time'];
|
$t = $_REQUEST['time'];
|
||||||
if(! $t)
|
if(! $t)
|
||||||
$t = 'now';
|
$t = 'now';
|
||||||
|
@ -38,7 +38,7 @@ function localtime_content(App &$a) {
|
||||||
|
|
||||||
$o .= '<form action ="' . App::get_baseurl() . '/localtime?f=&time=' . $t . '" method="post" >';
|
$o .= '<form action ="' . App::get_baseurl() . '/localtime?f=&time=' . $t . '" method="post" >';
|
||||||
|
|
||||||
$o .= '<p>' . t('Please select your timezone:') . '</p>';
|
$o .= '<p>' . t('Please select your timezone:') . '</p>';
|
||||||
|
|
||||||
$o .= select_timezone(($_REQUEST['timezone']) ? $_REQUEST['timezone'] : 'America/Los_Angeles');
|
$o .= select_timezone(($_REQUEST['timezone']) ? $_REQUEST['timezone'] : 'America/Los_Angeles');
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function lockview_content(App &$a) {
|
function lockview_content(App $a) {
|
||||||
|
|
||||||
$type = (($a->argc > 1) ? $a->argv[1] : 0);
|
$type = (($a->argc > 1) ? $a->argv[1] : 0);
|
||||||
if (is_numeric($type)) {
|
if (is_numeric($type)) {
|
||||||
$item_id = intval($type);
|
$item_id = intval($type);
|
||||||
|
@ -10,13 +10,13 @@ function lockview_content(App &$a) {
|
||||||
} else {
|
} else {
|
||||||
$item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
|
$item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! $item_id)
|
if(! $item_id)
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
if (!in_array($type, array('item','photo','event')))
|
if (!in_array($type, array('item','photo','event')))
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
$r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1",
|
$r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1",
|
||||||
dbesc($type),
|
dbesc($type),
|
||||||
intval($item_id)
|
intval($item_id)
|
||||||
|
@ -34,7 +34,7 @@ function lockview_content(App &$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
|
if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
|
||||||
&& (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
|
&& (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
|
||||||
|
|
||||||
echo t('Remote privacy information not available.') . '<br />';
|
echo t('Remote privacy information not available.') . '<br />';
|
||||||
|
@ -54,7 +54,7 @@ function lockview_content(App &$a) {
|
||||||
dbesc(implode(', ', $allowed_groups))
|
dbesc(implode(', ', $allowed_groups))
|
||||||
);
|
);
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r))
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
$l[] = '<b>' . $rr['name'] . '</b>';
|
$l[] = '<b>' . $rr['name'] . '</b>';
|
||||||
}
|
}
|
||||||
if(count($allowed_users)) {
|
if(count($allowed_users)) {
|
||||||
|
@ -62,7 +62,7 @@ function lockview_content(App &$a) {
|
||||||
dbesc(implode(', ',$allowed_users))
|
dbesc(implode(', ',$allowed_users))
|
||||||
);
|
);
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r))
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
$l[] = $rr['name'];
|
$l[] = $rr['name'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ function lockview_content(App &$a) {
|
||||||
dbesc(implode(', ', $deny_groups))
|
dbesc(implode(', ', $deny_groups))
|
||||||
);
|
);
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r))
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
$l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
|
$l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
|
||||||
}
|
}
|
||||||
if(count($deny_users)) {
|
if(count($deny_users)) {
|
||||||
|
@ -80,7 +80,7 @@ function lockview_content(App &$a) {
|
||||||
dbesc(implode(', ',$deny_users))
|
dbesc(implode(', ',$deny_users))
|
||||||
);
|
);
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r))
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
$l[] = '<strike>' . $rr['name'] . '</strike>';
|
$l[] = '<strike>' . $rr['name'] . '</strike>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function login_content(App &$a) {
|
function login_content(App $a) {
|
||||||
if(x($_SESSION,'theme'))
|
if(x($_SESSION,'theme'))
|
||||||
unset($_SESSION['theme']);
|
unset($_SESSION['theme']);
|
||||||
if(x($_SESSION,'mobile-theme'))
|
if(x($_SESSION,'mobile-theme'))
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once('include/email.php');
|
||||||
require_once('include/enotify.php');
|
require_once('include/enotify.php');
|
||||||
require_once('include/text.php');
|
require_once('include/text.php');
|
||||||
|
|
||||||
function lostpass_post(App &$a) {
|
function lostpass_post(App $a) {
|
||||||
|
|
||||||
$loginame = notags(trim($_POST['login-name']));
|
$loginame = notags(trim($_POST['login-name']));
|
||||||
if(! $loginame)
|
if(! $loginame)
|
||||||
|
@ -77,7 +77,7 @@ function lostpass_post(App &$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function lostpass_content(App &$a) {
|
function lostpass_content(App $a) {
|
||||||
|
|
||||||
|
|
||||||
if(x($_GET,'verify')) {
|
if(x($_GET,'verify')) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function maintenance_content(App &$a) {
|
function maintenance_content(App $a) {
|
||||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||||
header('Status: 503 Service Temporarily Unavailable');
|
header('Status: 503 Service Temporarily Unavailable');
|
||||||
header('Retry-After: 600');
|
header('Retry-After: 600');
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require_once("include/text.php");
|
require_once("include/text.php");
|
||||||
|
|
||||||
|
|
||||||
function manage_post(App &$a) {
|
function manage_post(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
@ -92,7 +92,7 @@ function manage_post(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function manage_content(App &$a) {
|
function manage_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -10,10 +10,10 @@ require_once('mod/proxy.php');
|
||||||
* It takes keywords from your profile and queries the directory server for
|
* It takes keywords from your profile and queries the directory server for
|
||||||
* matching keywords from other profiles.
|
* matching keywords from other profiles.
|
||||||
*
|
*
|
||||||
* @param App &$a
|
* @param App $a
|
||||||
* @return void|string
|
* @return void|string
|
||||||
*/
|
*/
|
||||||
function match_content(App &$a) {
|
function match_content(App $a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once('include/acl_selectors.php');
|
||||||
require_once('include/message.php');
|
require_once('include/message.php');
|
||||||
require_once('include/Smilies.php');
|
require_once('include/Smilies.php');
|
||||||
|
|
||||||
function message_init(App &$a) {
|
function message_init(App $a) {
|
||||||
|
|
||||||
$tabs = '';
|
$tabs = '';
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ function message_init(App &$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function message_post(App &$a) {
|
function message_post(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -173,7 +173,7 @@ function item_redir_and_replace_images($body, $images, $cid) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function message_content(App &$a) {
|
function message_content(App $a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
nav_set_selected('messages');
|
nav_set_selected('messages');
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('library/asn1.php');
|
require_once('library/asn1.php');
|
||||||
|
|
||||||
function modexp_init(App &$a) {
|
function modexp_init(App $a) {
|
||||||
|
|
||||||
if($a->argc != 2)
|
if($a->argc != 2)
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
|
||||||
function mood_init(App &$a) {
|
function mood_init(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
@ -60,7 +60,7 @@ function mood_init(App &$a) {
|
||||||
|
|
||||||
$uri = item_new_uri($a->get_hostname(),$uid);
|
$uri = item_new_uri($a->get_hostname(),$uid);
|
||||||
|
|
||||||
$action = sprintf( t('%1$s is currently %2$s'), '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' , $verbs[$verb]);
|
$action = sprintf( t('%1$s is currently %2$s'), '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' , $verbs[$verb]);
|
||||||
|
|
||||||
$arr = array();
|
$arr = array();
|
||||||
$arr['guid'] = get_guid(32);
|
$arr['guid'] = get_guid(32);
|
||||||
|
@ -109,7 +109,7 @@ function mood_init(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function mood_content(App &$a) {
|
function mood_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function msearch_post(App &$a) {
|
function msearch_post(App $a) {
|
||||||
|
|
||||||
$perpage = (($_POST['n']) ? $_POST['n'] : 80);
|
$perpage = (($_POST['n']) ? $_POST['n'] : 80);
|
||||||
$page = (($_POST['p']) ? intval($_POST['p'] - 1) : 0);
|
$page = (($_POST['p']) ? intval($_POST['p'] - 1) : 0);
|
||||||
|
@ -28,8 +28,8 @@ function msearch_post(App &$a) {
|
||||||
if (dbm::is_result($r)) {
|
if (dbm::is_result($r)) {
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
$results[] = array(
|
$results[] = array(
|
||||||
'name' => $rr['name'],
|
'name' => $rr['name'],
|
||||||
'url' => App::get_baseurl() . '/profile/' . $rr['nickname'],
|
'url' => App::get_baseurl() . '/profile/' . $rr['nickname'],
|
||||||
'photo' => App::get_baseurl() . '/photo/avatar/' . $rr['uid'] . '.jpg',
|
'photo' => App::get_baseurl() . '/photo/avatar/' . $rr['uid'] . '.jpg',
|
||||||
'tags' => str_replace(array(',',' '),array(' ',' '),$rr['pub_keywords'])
|
'tags' => str_replace(array(',',' '),array(' ',' '),$rr['pub_keywords'])
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once("include/nav.php");
|
require_once("include/nav.php");
|
||||||
|
|
||||||
function navigation_content(App &$a) {
|
function navigation_content(App $a) {
|
||||||
|
|
||||||
$nav_info = nav_info($a);
|
$nav_info = nav_info($a);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
function network_init(App &$a) {
|
function network_init(App $a) {
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
|
@ -221,7 +221,7 @@ function saved_searches($search) {
|
||||||
*
|
*
|
||||||
* @return Array ( $no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active );
|
* @return Array ( $no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active );
|
||||||
*/
|
*/
|
||||||
function network_query_get_sel_tab(App &$a) {
|
function network_query_get_sel_tab(App $a) {
|
||||||
$no_active='';
|
$no_active='';
|
||||||
$starred_active = '';
|
$starred_active = '';
|
||||||
$new_active = '';
|
$new_active = '';
|
||||||
|
@ -292,7 +292,7 @@ function network_query_get_sel_net() {
|
||||||
return $network;
|
return $network;
|
||||||
}
|
}
|
||||||
|
|
||||||
function network_query_get_sel_group(App &$a) {
|
function network_query_get_sel_group(App $a) {
|
||||||
$group = false;
|
$group = false;
|
||||||
|
|
||||||
if($a->argc >= 2 && is_numeric($a->argv[1])) {
|
if($a->argc >= 2 && is_numeric($a->argv[1])) {
|
||||||
|
@ -303,7 +303,7 @@ function network_query_get_sel_group(App &$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function network_content(&$a, $update = 0) {
|
function network_content(App $a, $update = 0) {
|
||||||
|
|
||||||
require_once('include/conversation.php');
|
require_once('include/conversation.php');
|
||||||
|
|
||||||
|
@ -728,7 +728,7 @@ function network_content(&$a, $update = 0) {
|
||||||
intval($parents),
|
intval($parents),
|
||||||
intval($max_comments + 1)
|
intval($max_comments + 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (dbm::is_result($thread_items))
|
if (dbm::is_result($thread_items))
|
||||||
$items = array_merge($items, $thread_items);
|
$items = array_merge($items, $thread_items);
|
||||||
}
|
}
|
||||||
|
@ -805,11 +805,11 @@ function network_content(&$a, $update = 0) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the network tabs menu
|
* @brief Get the network tabs menu
|
||||||
*
|
*
|
||||||
* @param app $a The global App
|
* @param app $a The global App
|
||||||
* @return string Html of the networktab
|
* @return string Html of the networktab
|
||||||
*/
|
*/
|
||||||
function network_tabs(App &$a) {
|
function network_tabs(App $a) {
|
||||||
// item filter tabs
|
// item filter tabs
|
||||||
/// @TODO fix this logic, reduce duplication
|
/// @TODO fix this logic, reduce duplication
|
||||||
/// $a->page['content'] .= '<div class="tabs-wrapper">';
|
/// $a->page['content'] .= '<div class="tabs-wrapper">';
|
||||||
|
@ -892,7 +892,7 @@ function network_tabs(App &$a) {
|
||||||
|
|
||||||
$arr = array('tabs' => $tabs);
|
$arr = array('tabs' => $tabs);
|
||||||
call_hooks('network_tabs', $arr);
|
call_hooks('network_tabs', $arr);
|
||||||
|
|
||||||
$tpl = get_markup_template('common_tabs.tpl');
|
$tpl = get_markup_template('common_tabs.tpl');
|
||||||
|
|
||||||
return replace_macros($tpl, array('$tabs' => $arr['tabs']));
|
return replace_macros($tpl, array('$tabs' => $arr['tabs']));
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function newmember_content(App &$a) {
|
function newmember_content(App $a) {
|
||||||
|
|
||||||
|
|
||||||
$o = '<h1>' . t('Welcome to Friendica') . '</h1>';
|
$o = '<h1>' . t('Welcome to Friendica') . '</h1>';
|
||||||
|
@ -15,7 +15,7 @@ function newmember_content(App &$a) {
|
||||||
|
|
||||||
$o .= '<ul>';
|
$o .= '<ul>';
|
||||||
|
|
||||||
$o .= '<li> ' . '<a target="newmember" href="help/guide">' . t('Friendica Walk-Through') . '</a><br />' . t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;
|
$o .= '<li> ' . '<a target="newmember" href="help/guide">' . t('Friendica Walk-Through') . '</a><br />' . t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '</ul>';
|
$o .= '</ul>';
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ function newmember_content(App &$a) {
|
||||||
|
|
||||||
$o .= '<ul>';
|
$o .= '<ul>';
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="settings">' . t('Go to Your Settings') . '</a><br />' . t('On your <em>Settings</em> page - change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="settings">' . t('Go to Your Settings') . '</a><br />' . t('On your <em>Settings</em> page - change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '<li>' . t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;
|
$o .= '<li>' . t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ function newmember_content(App &$a) {
|
||||||
|
|
||||||
$o .= '<ul>';
|
$o .= '<ul>';
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="profile_photo">' . t('Upload Profile Photo') . '</a><br />' . t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="profile_photo">' . t('Upload Profile Photo') . '</a><br />' . t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Edit Your Profile') . '</a><br />' . t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Edit Your Profile') . '</a><br />' . t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ function newmember_content(App &$a) {
|
||||||
$o .= '<ul>';
|
$o .= '<ul>';
|
||||||
|
|
||||||
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
|
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
|
||||||
|
|
||||||
if(! $mail_disabled)
|
if(! $mail_disabled)
|
||||||
$o .= '<li>' . '<a target="newmember" href="settings/connectors">' . t('Importing Emails') . '</a><br />' . t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="settings/connectors">' . t('Importing Emails') . '</a><br />' . t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @file mod/nodeinfo.php
|
* @file mod/nodeinfo.php
|
||||||
*
|
*
|
||||||
* Documentation: http://nodeinfo.diaspora.software/schema.html
|
* Documentation: http://nodeinfo.diaspora.software/schema.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once("include/plugin.php");
|
require_once("include/plugin.php");
|
||||||
|
|
||||||
function nodeinfo_wellknown(App &$a) {
|
function nodeinfo_wellknown(App $a) {
|
||||||
if (!get_config("system", "nodeinfo")) {
|
if (!get_config("system", "nodeinfo")) {
|
||||||
http_status_exit(404);
|
http_status_exit(404);
|
||||||
killme();
|
killme();
|
||||||
|
@ -20,7 +20,7 @@ function nodeinfo_wellknown(App &$a) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
function nodeinfo_init(App &$a){
|
function nodeinfo_init(App $a) {
|
||||||
if (!get_config("system", "nodeinfo")) {
|
if (!get_config("system", "nodeinfo")) {
|
||||||
http_status_exit(404);
|
http_status_exit(404);
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once('include/Contact.php');
|
||||||
require_once('include/socgraph.php');
|
require_once('include/socgraph.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
|
|
||||||
function nogroup_init(App &$a) {
|
function nogroup_init(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
@ -21,7 +21,7 @@ function nogroup_init(App &$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function nogroup_content(App &$a) {
|
function nogroup_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function noscrape_init(App &$a) {
|
function noscrape_init(App $a) {
|
||||||
|
|
||||||
if($a->argc > 1)
|
if($a->argc > 1)
|
||||||
$which = $a->argv[1];
|
$which = $a->argv[1];
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function notes_init(App &$a) {
|
function notes_init(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
@ -17,7 +17,7 @@ function notes_init(App &$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function notes_content(&$a,$update = false) {
|
function notes_content(App $a, $update = false) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/* identi.ca -> friendica items permanent-url compatibility */
|
/* identi.ca -> friendica items permanent-url compatibility */
|
||||||
|
|
||||||
function notice_init(App &$a){
|
function notice_init(App $a) {
|
||||||
$id = $a->argv[1];
|
$id = $a->argv[1];
|
||||||
$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
|
$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
|
||||||
intval($id)
|
intval($id)
|
||||||
|
|
|
@ -9,7 +9,7 @@ require_once("include/NotificationsManager.php");
|
||||||
require_once("include/contact_selectors.php");
|
require_once("include/contact_selectors.php");
|
||||||
require_once("include/network.php");
|
require_once("include/network.php");
|
||||||
|
|
||||||
function notifications_post(App &$a) {
|
function notifications_post(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
|
@ -65,7 +65,7 @@ function notifications_post(App &$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function notifications_content(App &$a) {
|
function notifications_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
require_once('include/NotificationsManager.php');
|
require_once('include/NotificationsManager.php');
|
||||||
|
|
||||||
function notify_init(App &$a) {
|
function notify_init(App $a) {
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ function notify_init(App &$a) {
|
||||||
$note = $nm->getByID($a->argv[2]);
|
$note = $nm->getByID($a->argv[2]);
|
||||||
if ($note) {
|
if ($note) {
|
||||||
$nm->setSeen($note);
|
$nm->setSeen($note);
|
||||||
|
|
||||||
// The friendica client has problems with the GUID. this is some workaround
|
// The friendica client has problems with the GUID. this is some workaround
|
||||||
if ($a->is_friendica_app()) {
|
if ($a->is_friendica_app()) {
|
||||||
require_once("include/items.php");
|
require_once("include/items.php");
|
||||||
|
@ -39,13 +39,13 @@ function notify_init(App &$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function notify_content(App &$a) {
|
function notify_content(App $a) {
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return login();
|
return login();
|
||||||
}
|
}
|
||||||
|
|
||||||
$nm = new NotificationsManager();
|
$nm = new NotificationsManager();
|
||||||
|
|
||||||
$notif_tpl = get_markup_template('notifications.tpl');
|
$notif_tpl = get_markup_template('notifications.tpl');
|
||||||
|
|
||||||
$not_tpl = get_markup_template('notify.tpl');
|
$not_tpl = get_markup_template('notify.tpl');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
require_once("include/oembed.php");
|
require_once("include/oembed.php");
|
||||||
|
|
||||||
function oembed_content(App &$a){
|
function oembed_content(App $a) {
|
||||||
// logger('mod_oembed ' . $a->query_string, LOGGER_ALL);
|
// logger('mod_oembed ' . $a->query_string, LOGGER_ALL);
|
||||||
|
|
||||||
if ($a->argv[1]=='b2h'){
|
if ($a->argv[1]=='b2h'){
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
function oexchange_init(App $a) {
|
||||||
function oexchange_init(App &$a) {
|
|
||||||
|
|
||||||
if (($a->argc > 1) && ($a->argv[1] === 'xrd')) {
|
if (($a->argc > 1) && ($a->argv[1] === 'xrd')) {
|
||||||
$tpl = get_markup_template('oexchange_xrd.tpl');
|
$tpl = get_markup_template('oexchange_xrd.tpl');
|
||||||
|
@ -11,7 +10,7 @@ function oexchange_init(App &$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function oexchange_content(App &$a) {
|
function oexchange_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
$o = login(false);
|
$o = login(false);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
require_once('library/openid.php');
|
require_once('library/openid.php');
|
||||||
|
|
||||||
|
|
||||||
function openid_content(App &$a) {
|
function openid_content(App $a) {
|
||||||
|
|
||||||
$noid = get_config('system','no_openid');
|
$noid = get_config('system','no_openid');
|
||||||
if($noid)
|
if($noid)
|
||||||
|
@ -47,7 +47,7 @@ function openid_content(App &$a) {
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
authenticate_success($r[0],true,true);
|
authenticate_success($r[0],true,true);
|
||||||
|
|
||||||
// just in case there was no return url set
|
// just in case there was no return url set
|
||||||
// and we fell through
|
// and we fell through
|
||||||
|
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
function opensearch_content(App &$a) {
|
function opensearch_content(App $a) {
|
||||||
|
|
||||||
$tpl = get_markup_template('opensearch.tpl');
|
$tpl = get_markup_template('opensearch.tpl');
|
||||||
|
|
||||||
header("Content-type: application/opensearchdescription+xml");
|
header("Content-type: application/opensearchdescription+xml");
|
||||||
|
|
||||||
$o = replace_macros($tpl, array(
|
$o = replace_macros($tpl, array(
|
||||||
'$baseurl' => App::get_baseurl(),
|
'$baseurl' => App::get_baseurl(),
|
||||||
'$nodename' => $a->get_hostname(),
|
'$nodename' => $a->get_hostname(),
|
||||||
));
|
));
|
||||||
|
|
||||||
echo $o;
|
echo $o;
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -3,7 +3,7 @@
|
||||||
require_once('include/Scrape.php');
|
require_once('include/Scrape.php');
|
||||||
require_once('include/follow.php');
|
require_once('include/follow.php');
|
||||||
|
|
||||||
function ostatus_subscribe_content(App &$a) {
|
function ostatus_subscribe_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file mod/parse_url.php
|
* @file mod/parse_url.php
|
||||||
* @brief The parse_url module
|
* @brief The parse_url module
|
||||||
*
|
*
|
||||||
* This module does parse an url for embedable content (audio, video, image files or link)
|
* This module does parse an url for embedable content (audio, video, image files or link)
|
||||||
* information and does format this information to BBCode or html (this depends
|
* information and does format this information to BBCode or html (this depends
|
||||||
* on the user settings - default is BBCode output).
|
* on the user settings - default is BBCode output).
|
||||||
|
@ -11,15 +11,15 @@
|
||||||
* (Note: This is not always possible and in some case not useful because
|
* (Note: This is not always possible and in some case not useful because
|
||||||
* the richtext editor doesn't support all kind of html).
|
* the richtext editor doesn't support all kind of html).
|
||||||
* Otherwise the output will be constructed BBCode.
|
* Otherwise the output will be constructed BBCode.
|
||||||
*
|
*
|
||||||
* @see ParseUrl::getSiteinfo() for more information about scraping embeddable content
|
* @see ParseUrl::getSiteinfo() for more information about scraping embeddable content
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\ParseUrl;
|
use \Friendica\ParseUrl;
|
||||||
|
|
||||||
require_once("include/items.php");
|
require_once("include/items.php");
|
||||||
|
|
||||||
function parse_url_content(App &$a) {
|
function parse_url_content(App $a) {
|
||||||
|
|
||||||
$text = null;
|
$text = null;
|
||||||
$str_tags = "";
|
$str_tags = "";
|
||||||
|
@ -153,20 +153,20 @@ function parse_url_content(App &$a) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Legacy function to call ParseUrl::getSiteinfoCached
|
* @brief Legacy function to call ParseUrl::getSiteinfoCached
|
||||||
*
|
*
|
||||||
* Note: We have moved the function to ParseUrl.php. This function is only for
|
* Note: We have moved the function to ParseUrl.php. This function is only for
|
||||||
* legacy support and will be remove in the future
|
* legacy support and will be remove in the future
|
||||||
*
|
*
|
||||||
* @param type $url The url of the page which should be scraped
|
* @param type $url The url of the page which should be scraped
|
||||||
* @param type $no_guessing If true the parse doens't search for
|
* @param type $no_guessing If true the parse doens't search for
|
||||||
* preview pictures
|
* preview pictures
|
||||||
* @param type $do_oembed The false option is used by the function fetch_oembed()
|
* @param type $do_oembed The false option is used by the function fetch_oembed()
|
||||||
* to avoid endless loops
|
* to avoid endless loops
|
||||||
*
|
*
|
||||||
* @return array which contains needed data for embedding
|
* @return array which contains needed data for embedding
|
||||||
*
|
*
|
||||||
* @see ParseUrl::getSiteinfoCached()
|
* @see ParseUrl::getSiteinfoCached()
|
||||||
*
|
*
|
||||||
* @todo Remove this function after all Addons has been changed to use
|
* @todo Remove this function after all Addons has been changed to use
|
||||||
* ParseUrl::getSiteinfoCached
|
* ParseUrl::getSiteinfoCached
|
||||||
*/
|
*/
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue