Merge remote-tracking branch 'upstream/master' into toc
This commit is contained in:
commit
dfab241692
2
boot.php
2
boot.php
@ -221,7 +221,7 @@ define ( 'PAGE_NORMAL', 0x0000 );
|
|||||||
define ( 'PAGE_HIDDEN', 0x0001 );
|
define ( 'PAGE_HIDDEN', 0x0001 );
|
||||||
define ( 'PAGE_AUTOCONNECT', 0x0002 );
|
define ( 'PAGE_AUTOCONNECT', 0x0002 );
|
||||||
define ( 'PAGE_APPLICATION', 0x0004 );
|
define ( 'PAGE_APPLICATION', 0x0004 );
|
||||||
|
define ( 'PAGE_ALLOWCODE', 0x0008 );
|
||||||
define ( 'PAGE_PREMIUM', 0x0010 );
|
define ( 'PAGE_PREMIUM', 0x0010 );
|
||||||
define ( 'PAGE_ADULT', 0x0020 );
|
define ( 'PAGE_ADULT', 0x0020 );
|
||||||
define ( 'PAGE_CENSORED', 0x0040 ); // Site admin has blocked this channel from appearing in casual search results and site feeds
|
define ( 'PAGE_CENSORED', 0x0040 ); // Site admin has blocked this channel from appearing in casual search results and site feeds
|
||||||
|
@ -267,6 +267,15 @@ class RedBrowser extends DAV\Browser\Plugin {
|
|||||||
|
|
||||||
get_app()->page['content'] = $html;
|
get_app()->page['content'] = $html;
|
||||||
load_pdl(get_app());
|
load_pdl(get_app());
|
||||||
|
|
||||||
|
$theme_info_file = "view/theme/" . current_theme() . "/php/theme.php";
|
||||||
|
if (file_exists($theme_info_file)){
|
||||||
|
require_once($theme_info_file);
|
||||||
|
if (function_exists(str_replace('-', '_', current_theme()) . '_init')) {
|
||||||
|
$func = str_replace('-', '_', current_theme()) . '_init';
|
||||||
|
$func(get_app());
|
||||||
|
}
|
||||||
|
}
|
||||||
construct_page(get_app());
|
construct_page(get_app());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1205,21 +1205,9 @@ function advanced_profile(&$a) {
|
|||||||
|
|
||||||
if($txt = prepare_text($a->profile['dislikes'])) $profile['dislikes'] = array( t('Dislikes:'), $txt);
|
if($txt = prepare_text($a->profile['dislikes'])) $profile['dislikes'] = array( t('Dislikes:'), $txt);
|
||||||
|
|
||||||
|
|
||||||
if($txt = prepare_text($a->profile['contact'])) $profile['contact'] = array( t('Contact information and Social Networks:'), $txt);
|
if($txt = prepare_text($a->profile['contact'])) $profile['contact'] = array( t('Contact information and Social Networks:'), $txt);
|
||||||
|
|
||||||
// Support tags in the other channels field (probably want to restrict it to channels only?)
|
if($txt = prepare_text($a->profile['channels'])) $profile['channels'] = array( t('My other channels:'), $txt);
|
||||||
$txt = $a->profile['channels'];
|
|
||||||
$matches = get_tags($txt);
|
|
||||||
$access_tag = '';
|
|
||||||
$str_tags = '';
|
|
||||||
foreach($matches as $m) {
|
|
||||||
$success = handle_tag($a, $txt, $access_tag, $str_tags, $a->profile_uid, $m); // Use uid of the profile maker
|
|
||||||
}
|
|
||||||
|
|
||||||
if($txt = prepare_text($txt)) {
|
|
||||||
$profile['channels'] = array( t('My other channels:'), $txt);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($txt = prepare_text($a->profile['music'])) $profile['music'] = array( t('Musical interests:'), $txt);
|
if($txt = prepare_text($a->profile['music'])) $profile['music'] = array( t('Musical interests:'), $txt);
|
||||||
|
|
||||||
|
@ -2673,7 +2673,7 @@ function tag_deliver($uid,$item_id) {
|
|||||||
* Fetch stuff we need - a channel and an item
|
* Fetch stuff we need - a channel and an item
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$u = q("select * from channel where channel_id = %d limit 1",
|
$u = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_id = %d limit 1",
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
if(! $u)
|
if(! $u)
|
||||||
@ -2811,7 +2811,7 @@ function tag_deliver($uid,$item_id) {
|
|||||||
if($terms)
|
if($terms)
|
||||||
logger('tag_deliver: post mentions: ' . print_r($terms,true), LOGGER_DATA);
|
logger('tag_deliver: post mentions: ' . print_r($terms,true), LOGGER_DATA);
|
||||||
|
|
||||||
$link = normalise_link($a->get_baseurl() . '/channel/' . $u[0]['channel_address']);
|
$link = normalise_link($u[0]['xchan_url']);
|
||||||
|
|
||||||
if($terms) {
|
if($terms) {
|
||||||
foreach($terms as $term) {
|
foreach($terms as $term) {
|
||||||
@ -2952,7 +2952,7 @@ function tgroup_check($uid,$item) {
|
|||||||
if(! perm_is_allowed($uid,$item['author_xchan'],'tag_deliver'))
|
if(! perm_is_allowed($uid,$item['author_xchan'],'tag_deliver'))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$u = q("select * from channel where channel_id = %d limit 1",
|
$u = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_id = %d limit 1",
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -2964,7 +2964,7 @@ function tgroup_check($uid,$item) {
|
|||||||
if($terms)
|
if($terms)
|
||||||
logger('tgroup_check: post mentions: ' . print_r($terms,true), LOGGER_DATA);
|
logger('tgroup_check: post mentions: ' . print_r($terms,true), LOGGER_DATA);
|
||||||
|
|
||||||
$link = normalise_link($a->get_baseurl() . '/channel/' . $u[0]['channel_address']);
|
$link = normalise_link($u[0]['xchan_url']);
|
||||||
|
|
||||||
if($terms) {
|
if($terms) {
|
||||||
foreach($terms as $term) {
|
foreach($terms as $term) {
|
||||||
@ -3939,7 +3939,7 @@ function drop_items($items) {
|
|||||||
// $stage = 1 => set deleted flag on the item and perform intial notifications
|
// $stage = 1 => set deleted flag on the item and perform intial notifications
|
||||||
// $stage = 2 => perform low level delete at a later stage
|
// $stage = 2 => perform low level delete at a later stage
|
||||||
|
|
||||||
function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL) {
|
function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL,$force = false) {
|
||||||
|
|
||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
@ -3959,6 +3959,8 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL) {
|
|||||||
|
|
||||||
$item = $r[0];
|
$item = $r[0];
|
||||||
|
|
||||||
|
$linked_item = (($item['resource_id']) ? true : false);
|
||||||
|
|
||||||
$ok_to_delete = false;
|
$ok_to_delete = false;
|
||||||
|
|
||||||
// system deletion
|
// system deletion
|
||||||
@ -3980,10 +3982,11 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL) {
|
|||||||
// hook calls a remote process which loops. We'll delete it properly in a second.
|
// hook calls a remote process which loops. We'll delete it properly in a second.
|
||||||
|
|
||||||
$r = q("UPDATE item SET item_restrict = ( item_restrict | %d ) WHERE id = %d",
|
$r = q("UPDATE item SET item_restrict = ( item_restrict | %d ) WHERE id = %d",
|
||||||
intval(ITEM_DELETED),
|
intval(($linked_item && ! $force) ? ITEM_HIDDEN : ITEM_DELETED),
|
||||||
intval($item['id'])
|
intval($item['id'])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$arr = array('item' => $item, 'interactive' => $interactive, 'stage' => $stage);
|
$arr = array('item' => $item, 'interactive' => $interactive, 'stage' => $stage);
|
||||||
call_hooks('drop_item', $arr );
|
call_hooks('drop_item', $arr );
|
||||||
|
|
||||||
@ -3995,10 +3998,10 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL) {
|
|||||||
);
|
);
|
||||||
if($items) {
|
if($items) {
|
||||||
foreach($items as $i)
|
foreach($items as $i)
|
||||||
delete_item_lowlevel($i,$stage);
|
delete_item_lowlevel($i,$stage,$force);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
delete_item_lowlevel($item,$stage);
|
delete_item_lowlevel($item,$stage,$force);
|
||||||
|
|
||||||
if(! $interactive)
|
if(! $interactive)
|
||||||
return 1;
|
return 1;
|
||||||
@ -4030,8 +4033,9 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL) {
|
|||||||
// It merely destroys all resources associated with an item.
|
// It merely destroys all resources associated with an item.
|
||||||
// Please do not use without a suitable wrapper.
|
// Please do not use without a suitable wrapper.
|
||||||
|
|
||||||
function delete_item_lowlevel($item,$stage = DROPITEM_NORMAL) {
|
function delete_item_lowlevel($item,$stage = DROPITEM_NORMAL,$force = false) {
|
||||||
|
|
||||||
|
$linked_item = (($item['resource_id']) ? true : false);
|
||||||
|
|
||||||
switch($stage) {
|
switch($stage) {
|
||||||
case DROPITEM_PHASE2:
|
case DROPITEM_PHASE2:
|
||||||
@ -4047,7 +4051,7 @@ function delete_item_lowlevel($item,$stage = DROPITEM_NORMAL) {
|
|||||||
case DROPITEM_PHASE1:
|
case DROPITEM_PHASE1:
|
||||||
$r = q("UPDATE item SET item_restrict = ( item_restrict | %d ),
|
$r = q("UPDATE item SET item_restrict = ( item_restrict | %d ),
|
||||||
changed = '%s', edited = '%s' WHERE id = %d",
|
changed = '%s', edited = '%s' WHERE id = %d",
|
||||||
intval(ITEM_DELETED),
|
intval(($linked_item && ! $force) ? ITEM_HIDDEN : ITEM_DELETED),
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval($item['id'])
|
intval($item['id'])
|
||||||
@ -4056,13 +4060,24 @@ function delete_item_lowlevel($item,$stage = DROPITEM_NORMAL) {
|
|||||||
|
|
||||||
case DROPITEM_NORMAL:
|
case DROPITEM_NORMAL:
|
||||||
default:
|
default:
|
||||||
$r = q("UPDATE item SET item_restrict = ( item_restrict | %d ), body = '', title = '',
|
if($linked_item && ! $force) {
|
||||||
changed = '%s', edited = '%s' WHERE id = %d",
|
$r = q("UPDATE item SET item_restrict = ( item_restrict | %d ),
|
||||||
intval(ITEM_DELETED),
|
changed = '%s', edited = '%s' WHERE id = %d",
|
||||||
dbesc(datetime_convert()),
|
intval(ITEM_HIDDEN),
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval($item['id'])
|
dbesc(datetime_convert()),
|
||||||
);
|
intval($item['id'])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$r = q("UPDATE item SET item_restrict = ( item_restrict | %d ), body = '', title = '',
|
||||||
|
changed = '%s', edited = '%s' WHERE id = %d",
|
||||||
|
intval(ITEM_DELETED),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
intval($item['id'])
|
||||||
|
);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4074,25 +4089,6 @@ function delete_item_lowlevel($item,$stage = DROPITEM_NORMAL) {
|
|||||||
intval($item['uid'])
|
intval($item['uid'])
|
||||||
);
|
);
|
||||||
|
|
||||||
// If item is a link to a photo/event resource, nuke all the associated photos/events
|
|
||||||
// This only applies to photos uploaded from the photos page. Photos inserted into a post do not
|
|
||||||
// generate a resource_id and therefore aren't intimately linked to the item.
|
|
||||||
|
|
||||||
if(strlen($item['resource_id'])) {
|
|
||||||
if($item['resource_type'] === 'event') {
|
|
||||||
q("delete from event where event_hash = '%s' and uid = %d",
|
|
||||||
dbesc($item['resource_id']),
|
|
||||||
intval($item['uid'])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
elseif($item['resource_type'] === 'photo') {
|
|
||||||
q("DELETE FROM `photo` WHERE `resource_id` = '%s' AND `uid` = %d ",
|
|
||||||
dbesc($item['resource_id']),
|
|
||||||
intval($item['uid'])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// network deletion request. Keep the message structure so that we can deliver delete notifications.
|
// network deletion request. Keep the message structure so that we can deliver delete notifications.
|
||||||
// Come back after several days (or perhaps a month) to do the lowlevel delete (DROPITEM_PHASE2).
|
// Come back after several days (or perhaps a month) to do the lowlevel delete (DROPITEM_PHASE2).
|
||||||
@ -4115,8 +4111,7 @@ function delete_item_lowlevel($item,$stage = DROPITEM_NORMAL) {
|
|||||||
intval(TERM_OBJ_POST)
|
intval(TERM_OBJ_POST)
|
||||||
);
|
);
|
||||||
|
|
||||||
// FIXME remove notifications for this item
|
// FIXME remove notifications for this item
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -92,10 +92,10 @@ function z_input_filter($channel_id,$s,$type = 'text/bbcode') {
|
|||||||
return escape_tags($s);
|
return escape_tags($s);
|
||||||
if($type == 'text/plain')
|
if($type == 'text/plain')
|
||||||
return escape_tags($s);
|
return escape_tags($s);
|
||||||
$r = q("select account_id, account_roles from account left join channel on channel_account_id = account_id where channel_id = %d limit 1",
|
$r = q("select account_id, account_roles, channel_pageflags from account left join channel on channel_account_id = account_id where channel_id = %d limit 1",
|
||||||
intval($channel_id)
|
intval($channel_id)
|
||||||
);
|
);
|
||||||
if($r && ($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE)) {
|
if($r && (($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($r[0]['channel_pageflags'] & PAGE_ALLOWCODE))) {
|
||||||
if(local_user() && (get_account_id() == $r[0]['account_id'])) {
|
if(local_user() && (get_account_id() == $r[0]['account_id'])) {
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
@ -1584,13 +1584,13 @@ function mimetype_select($channel_id, $current = 'text/bbcode') {
|
|||||||
'text/plain'
|
'text/plain'
|
||||||
);
|
);
|
||||||
|
|
||||||
$r = q("select account_id, account_roles from account left join channel on account_id = channel_account_id where
|
$r = q("select account_id, account_roles, channel_pageflags from account left join channel on account_id = channel_account_id where
|
||||||
channel_id = %d limit 1",
|
channel_id = %d limit 1",
|
||||||
intval($channel_id)
|
intval($channel_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($r) {
|
if($r) {
|
||||||
if($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) {
|
if(($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($r[0]['channel_pageflags'] & PAGE_ALLOWCODE)) {
|
||||||
if(local_user() && get_account_id() == $r[0]['account_id'])
|
if(local_user() && get_account_id() == $r[0]['account_id'])
|
||||||
$x[] = 'application/x-php';
|
$x[] = 'application/x-php';
|
||||||
}
|
}
|
||||||
@ -2351,7 +2351,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
|
|||||||
return array('replaced' => $replaced, 'termtype' => $termtype, 'term' => $newname, 'url' => $url, 'contact' => $r[0]);
|
return array('replaced' => $replaced, 'termtype' => $termtype, 'term' => $newname, 'url' => $url, 'contact' => $r[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function linkify_tags($a, &$body, $uid, $profile_uid) {
|
function linkify_tags($a, &$body, $uid) {
|
||||||
$str_tags = '';
|
$str_tags = '';
|
||||||
$tagged = array();
|
$tagged = array();
|
||||||
$result = array();
|
$result = array();
|
||||||
|
@ -288,6 +288,8 @@ function admin_page_site_post(&$a){
|
|||||||
del_config('system','admininfo');
|
del_config('system','admininfo');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
require_once('include/text.php');
|
||||||
|
linkify_tags($a, $admininfo, local_user());
|
||||||
set_config('system','admininfo', $admininfo);
|
set_config('system','admininfo', $admininfo);
|
||||||
}
|
}
|
||||||
set_config('system','language', $language);
|
set_config('system','language', $language);
|
||||||
|
@ -286,6 +286,7 @@ function channel_content(&$a, $update = 0, $load = false) {
|
|||||||
'$cats' => (($category) ? $category : ''),
|
'$cats' => (($category) ? $category : ''),
|
||||||
'$tags' => (($hashtags) ? $hashtags : ''),
|
'$tags' => (($hashtags) ? $hashtags : ''),
|
||||||
'$mid' => $mid,
|
'$mid' => $mid,
|
||||||
|
'$verb' => '',
|
||||||
'$dend' => $datequery,
|
'$dend' => $datequery,
|
||||||
'$dbegin' => $datequery2
|
'$dbegin' => $datequery2
|
||||||
));
|
));
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* @file mod/cloud.php
|
* @file mod/cloud.php
|
||||||
* @brief Initialize RedMatrix's cloud (SabreDAV).
|
* @brief Initialize RedMatrix's cloud (SabreDAV).
|
||||||
*
|
*
|
||||||
* Module for accessing the DAV storage area from a web client.
|
* Module for accessing the DAV storage area.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Sabre\DAV;
|
use Sabre\DAV;
|
||||||
@ -12,28 +12,24 @@ use RedMatrix\RedDAV;
|
|||||||
// composer autoloader for SabreDAV
|
// composer autoloader for SabreDAV
|
||||||
require_once('vendor/autoload.php');
|
require_once('vendor/autoload.php');
|
||||||
|
|
||||||
if(! defined('TRINIDAD')) {
|
// workaround for HTTP-auth in CGI mode
|
||||||
// workaround for HTTP-auth in CGI mode
|
if (x($_SERVER, 'REDIRECT_REMOTE_USER')) {
|
||||||
if (x($_SERVER, 'REDIRECT_REMOTE_USER')) {
|
$userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 6)) ;
|
||||||
$userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 6)) ;
|
if(strlen($userpass)) {
|
||||||
if(strlen($userpass)) {
|
list($name, $password) = explode(':', $userpass);
|
||||||
list($name, $password) = explode(':', $userpass);
|
$_SERVER['PHP_AUTH_USER'] = $name;
|
||||||
$_SERVER['PHP_AUTH_USER'] = $name;
|
$_SERVER['PHP_AUTH_PW'] = $password;
|
||||||
$_SERVER['PHP_AUTH_PW'] = $password;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (x($_SERVER, 'HTTP_AUTHORIZATION')) {
|
|
||||||
$userpass = base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"], 6)) ;
|
|
||||||
if(strlen($userpass)) {
|
|
||||||
list($name, $password) = explode(':', $userpass);
|
|
||||||
$_SERVER['PHP_AUTH_USER'] = $name;
|
|
||||||
$_SERVER['PHP_AUTH_PW'] = $password;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (x($_SERVER, 'HTTP_AUTHORIZATION')) {
|
||||||
|
$userpass = base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"], 6)) ;
|
||||||
|
if(strlen($userpass)) {
|
||||||
|
list($name, $password) = explode(':', $userpass);
|
||||||
|
$_SERVER['PHP_AUTH_USER'] = $name;
|
||||||
|
$_SERVER['PHP_AUTH_PW'] = $password;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Fires up the SabreDAV server.
|
* @brief Fires up the SabreDAV server.
|
||||||
@ -41,16 +37,6 @@ if(! defined('TRINIDAD')) {
|
|||||||
* @param App &$a
|
* @param App &$a
|
||||||
*/
|
*/
|
||||||
function cloud_init(&$a) {
|
function cloud_init(&$a) {
|
||||||
// call ($currenttheme)_init since we're operating outside of index.php
|
|
||||||
$theme_info_file = "view/theme/" . current_theme() . "/php/theme.php";
|
|
||||||
if (file_exists($theme_info_file)){
|
|
||||||
require_once($theme_info_file);
|
|
||||||
if (function_exists(str_replace('-', '_', current_theme()) . '_init')) {
|
|
||||||
$func = str_replace('-', '_', current_theme()) . '_init';
|
|
||||||
$func($a);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once('include/reddav.php');
|
require_once('include/reddav.php');
|
||||||
|
|
||||||
if (! is_dir('store'))
|
if (! is_dir('store'))
|
||||||
@ -130,19 +116,13 @@ function cloud_init(&$a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((! $auth->observer) && (! $isapublic_file) && (! $davguest)) {
|
if ((! $auth->observer) && (! $isapublic_file) && (! $davguest)) {
|
||||||
if(defined('TRINIDAD')) {
|
try {
|
||||||
|
$auth->Authenticate($server, t('RedMatrix - Guests: Username: {your email address}, Password: +++'));
|
||||||
|
}
|
||||||
|
catch (Exception $e) {
|
||||||
logger('mod_cloud: auth exception' . $e->getMessage());
|
logger('mod_cloud: auth exception' . $e->getMessage());
|
||||||
http_status_exit($e->getHTTPCode(), $e->getMessage());
|
http_status_exit($e->getHTTPCode(), $e->getMessage());
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
try {
|
|
||||||
$auth->Authenticate($server, t('RedMatrix channel'));
|
|
||||||
}
|
|
||||||
catch (Exception $e) {
|
|
||||||
logger('mod_cloud: auth exception' . $e->getMessage());
|
|
||||||
http_status_exit($e->getHTTPCode(), $e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('include/RedDAV/RedBrowser.php');
|
require_once('include/RedDAV/RedBrowser.php');
|
||||||
|
@ -55,6 +55,15 @@ function connedit_post(&$a) {
|
|||||||
if(! $contact_id)
|
if(! $contact_id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// TODO if configured for hassle-free permissions, we'll post the form with ajax as soon as the
|
||||||
|
// connection enable is toggled to a special autopost url and set permissions immediately, leaving
|
||||||
|
// the other form elements alone pending a manual submit of the form. The downside is that there
|
||||||
|
// will be a window of opportunity when the permissions have been set but before you've had a chance
|
||||||
|
// to review and possibly restrict them. The upside is we won't have to warn you that your connection
|
||||||
|
// can't do anything until you save the bloody form.
|
||||||
|
|
||||||
|
$autopost = (((argc() > 2) && (argv(2) === 'auto')) ? true : false);
|
||||||
|
|
||||||
$orig_record = q("SELECT * FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
|
$orig_record = q("SELECT * FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
|
@ -37,15 +37,6 @@ if (x($_SERVER, 'HTTP_AUTHORIZATION')) {
|
|||||||
* @param App &$a
|
* @param App &$a
|
||||||
*/
|
*/
|
||||||
function dav_init(&$a) {
|
function dav_init(&$a) {
|
||||||
// call ($currenttheme)_init since we're operating outside of index.php
|
|
||||||
$theme_info_file = "view/theme/" . current_theme() . "/php/theme.php";
|
|
||||||
if (file_exists($theme_info_file)){
|
|
||||||
require_once($theme_info_file);
|
|
||||||
if (function_exists(str_replace('-', '_', current_theme()) . '_init')) {
|
|
||||||
$func = str_replace('-', '_', current_theme()) . '_init';
|
|
||||||
$func($a);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once('include/reddav.php');
|
require_once('include/reddav.php');
|
||||||
|
|
||||||
|
@ -136,6 +136,7 @@ function display_content(&$a, $update = 0, $load = false) {
|
|||||||
'$tags' => '',
|
'$tags' => '',
|
||||||
'$dend' => '',
|
'$dend' => '',
|
||||||
'$dbegin' => '',
|
'$dbegin' => '',
|
||||||
|
'$verb' => '',
|
||||||
'$mid' => $item_hash
|
'$mid' => $item_hash
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -75,6 +75,10 @@ function events_post(&$a) {
|
|||||||
$location = escape_tags(trim($_POST['location']));
|
$location = escape_tags(trim($_POST['location']));
|
||||||
$type = 'event';
|
$type = 'event';
|
||||||
|
|
||||||
|
require_once('include/text.php');
|
||||||
|
linkify_tags($a, $desc, local_user());
|
||||||
|
linkify_tags($a, $location, local_user());
|
||||||
|
|
||||||
$action = ($event_hash == '') ? 'new' : "event/" . $event_hash;
|
$action = ($event_hash == '') ? 'new' : "event/" . $event_hash;
|
||||||
$onerror_url = $a->get_baseurl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish";
|
$onerror_url = $a->get_baseurl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish";
|
||||||
if(strcmp($finish,$start) < 0 && !$nofinish) {
|
if(strcmp($finish,$start) < 0 && !$nofinish) {
|
||||||
|
@ -144,6 +144,7 @@ function home_content(&$a, $update = 0, $load = false) {
|
|||||||
'$tags' => '',
|
'$tags' => '',
|
||||||
'$dend' => '',
|
'$dend' => '',
|
||||||
'$mid' => '',
|
'$mid' => '',
|
||||||
|
'$verb' => '',
|
||||||
'$dbegin' => ''
|
'$dbegin' => ''
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -75,11 +75,11 @@ function impel_init(&$a) {
|
|||||||
$execflag = false;
|
$execflag = false;
|
||||||
|
|
||||||
if($arr['mimetype'] === 'application/x-php') {
|
if($arr['mimetype'] === 'application/x-php') {
|
||||||
$z = q("select account_id, account_roles from account left join channel on channel_account_id = account_id where channel_id = %d limit 1",
|
$z = q("select account_id, account_roles, channel_pageflags from account left join channel on channel_account_id = account_id where channel_id = %d limit 1",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
if($z && ($z[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE)) {
|
if($z && (($z[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($z[0]['channel_pageflags'] & PAGE_ALLOWCODE))) {
|
||||||
$execflag = true;
|
$execflag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -449,10 +449,10 @@ function item_post(&$a) {
|
|||||||
$execflag = false;
|
$execflag = false;
|
||||||
|
|
||||||
if($mimetype === 'application/x-php') {
|
if($mimetype === 'application/x-php') {
|
||||||
$z = q("select account_id, account_roles from account left join channel on channel_account_id = account_id where channel_id = %d limit 1",
|
$z = q("select account_id, account_roles, channel_pageflags from account left join channel on channel_account_id = account_id where channel_id = %d limit 1",
|
||||||
intval($profile_uid)
|
intval($profile_uid)
|
||||||
);
|
);
|
||||||
if($z && ($z[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE)) {
|
if($z && (($z[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($z[0]['channel_pageflags'] & PAGE_ALLOWCODE))) {
|
||||||
if($uid && (get_account_id() == $z[0]['account_id'])) {
|
if($uid && (get_account_id() == $z[0]['account_id'])) {
|
||||||
$execflag = true;
|
$execflag = true;
|
||||||
}
|
}
|
||||||
@ -576,7 +576,7 @@ function item_post(&$a) {
|
|||||||
|
|
||||||
|
|
||||||
// Look for tags and linkify them
|
// Look for tags and linkify them
|
||||||
$results = linkify_tags($a, $body, $uid, $profile_uid);
|
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
|
||||||
|
|
||||||
// Set permissions based on tag replacements
|
// Set permissions based on tag replacements
|
||||||
set_linkified_perms($results, $str_contact_allow, $str_group_allow, $profile_uid, $parent_item);
|
set_linkified_perms($results, $str_contact_allow, $str_group_allow, $profile_uid, $parent_item);
|
||||||
|
@ -83,6 +83,9 @@ function mail_post(&$a) {
|
|||||||
// $body = fix_mce_lf($body);
|
// $body = fix_mce_lf($body);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
require_once('include/text.php');
|
||||||
|
linkify_tags($a, $body, local_user());
|
||||||
|
|
||||||
if(! $recipient) {
|
if(! $recipient) {
|
||||||
notice('No recipient found.');
|
notice('No recipient found.');
|
||||||
$a->argc = 2;
|
$a->argc = 2;
|
||||||
|
@ -47,7 +47,7 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
$gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0);
|
$gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0);
|
||||||
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
|
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
|
||||||
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
|
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
|
||||||
|
$verb = ((x($_REQUEST,'verb')) ? $_REQUEST['verb'] : '');
|
||||||
|
|
||||||
$search = (($_GET['search']) ? $_GET['search'] : '');
|
$search = (($_GET['search']) ? $_GET['search'] : '');
|
||||||
if($search) {
|
if($search) {
|
||||||
@ -251,6 +251,7 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
'$tags' => $hashtags,
|
'$tags' => $hashtags,
|
||||||
'$dend' => $datequery,
|
'$dend' => $datequery,
|
||||||
'$mid' => '',
|
'$mid' => '',
|
||||||
|
'$verb' => $verb,
|
||||||
'$dbegin' => $datequery2
|
'$dbegin' => $datequery2
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -279,6 +280,12 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($verb) {
|
||||||
|
$sql_extra .= sprintf(" AND item.verb like '%s' ",
|
||||||
|
dbesc(protect_sprintf('%' . $verb . '%'))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if(strlen($file)) {
|
if(strlen($file)) {
|
||||||
$sql_extra .= term_query('item',$file,TERM_FILE);
|
$sql_extra .= term_query('item',$file,TERM_FILE);
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ function photos_post(&$a) {
|
|||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
foreach($r as $i) {
|
foreach($r as $i) {
|
||||||
drop_item($i['id'],false);
|
drop_item($i['id'],false,DROPITEM_PHASE1,true /* force removal of linked items */);
|
||||||
if(! $item_restrict)
|
if(! $item_restrict)
|
||||||
proc_run('php','include/notifier.php','drop',$i['id']);
|
proc_run('php','include/notifier.php','drop',$i['id']);
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@ function photos_post(&$a) {
|
|||||||
require_once('include/text.php');
|
require_once('include/text.php');
|
||||||
$profile_uid = $a->profile['profile_uid'];
|
$profile_uid = $a->profile['profile_uid'];
|
||||||
|
|
||||||
$results = linkify_tags($a, $rawtags, local_user(), $profile_uid);
|
$results = linkify_tags($a, $rawtags, (local_user()) ? local_user() : $profile_uid);
|
||||||
|
|
||||||
$success = $results['success'];
|
$success = $results['success'];
|
||||||
$post_tags = array();
|
$post_tags = array();
|
||||||
|
@ -296,7 +296,24 @@ function profiles_post(&$a) {
|
|||||||
$work = fix_mce_lf(escape_tags(trim($_POST['work'])));
|
$work = fix_mce_lf(escape_tags(trim($_POST['work'])));
|
||||||
$education = fix_mce_lf(escape_tags(trim($_POST['education'])));
|
$education = fix_mce_lf(escape_tags(trim($_POST['education'])));
|
||||||
|
|
||||||
$hide_friends = (($_POST['hide_friends'] == 1) ? 1: 0);
|
$hide_friends = ((intval($_POST['hide_friends'])) ? 1: 0);
|
||||||
|
|
||||||
|
require_once('include/text.php');
|
||||||
|
linkify_tags($a, $likes, local_user());
|
||||||
|
linkify_tags($a, $dislikes, local_user());
|
||||||
|
linkify_tags($a, $about, local_user());
|
||||||
|
linkify_tags($a, $interest, local_user());
|
||||||
|
linkify_tags($a, $interest, local_user());
|
||||||
|
linkify_tags($a, $contact, local_user());
|
||||||
|
linkify_tags($a, $channels, local_user());
|
||||||
|
linkify_tags($a, $music, local_user());
|
||||||
|
linkify_tags($a, $book, local_user());
|
||||||
|
linkify_tags($a, $tv, local_user());
|
||||||
|
linkify_tags($a, $film, local_user());
|
||||||
|
linkify_tags($a, $romance, local_user());
|
||||||
|
linkify_tags($a, $work, local_user());
|
||||||
|
linkify_tags($a, $education, local_user());
|
||||||
|
|
||||||
|
|
||||||
$with = ((x($_POST,'with')) ? escape_tags(trim($_POST['with'])) : '');
|
$with = ((x($_POST,'with')) ? escape_tags(trim($_POST['with'])) : '');
|
||||||
|
|
||||||
@ -605,7 +622,7 @@ function profiles_content(&$a) {
|
|||||||
|
|
||||||
$opt_tpl = get_markup_template("profile_hide_friends.tpl");
|
$opt_tpl = get_markup_template("profile_hide_friends.tpl");
|
||||||
$hide_friends = replace_macros($opt_tpl,array('$field' => array(
|
$hide_friends = replace_macros($opt_tpl,array('$field' => array(
|
||||||
'hide-friends',
|
'hide_friends',
|
||||||
t('Hide your contact/friend list from viewers of this profile?'),
|
t('Hide your contact/friend list from viewers of this profile?'),
|
||||||
$r[0]['hide_friends'],
|
$r[0]['hide_friends'],
|
||||||
'',
|
'',
|
||||||
|
@ -109,6 +109,7 @@ function search_content(&$a,$update = 0, $load = false) {
|
|||||||
'$cats' => '',
|
'$cats' => '',
|
||||||
'$tags' => '',
|
'$tags' => '',
|
||||||
'$mid' => '',
|
'$mid' => '',
|
||||||
|
'$verb' => '',
|
||||||
'$dend' => '',
|
'$dend' => '',
|
||||||
'$dbegin' => ''
|
'$dbegin' => ''
|
||||||
));
|
));
|
||||||
|
@ -126,7 +126,8 @@ function siteinfo_content(&$a) {
|
|||||||
else
|
else
|
||||||
$plugins_text = t('No installed plugins/addons/apps');
|
$plugins_text = t('No installed plugins/addons/apps');
|
||||||
|
|
||||||
$admininfo = bbcode(get_config('system','admininfo'));
|
$txt = get_config('system','admininfo');
|
||||||
|
$admininfo = bbcode($txt);
|
||||||
|
|
||||||
if(file_exists('doc/site_donate.html'))
|
if(file_exists('doc/site_donate.html'))
|
||||||
$donate .= file_get_contents('doc/site_donate.html');
|
$donate .= file_get_contents('doc/site_donate.html');
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
var bParam_dend = "{{$dend}}";
|
var bParam_dend = "{{$dend}}";
|
||||||
var bParam_dbegin = "{{$dbegin}}";
|
var bParam_dbegin = "{{$dbegin}}";
|
||||||
var bParam_mid = "{{$mid}}";
|
var bParam_mid = "{{$mid}}";
|
||||||
|
var bParam_verb = "{{$verb}}";
|
||||||
|
|
||||||
function buildCmd() {
|
function buildCmd() {
|
||||||
var udargs = ((page_load) ? "/load" : "");
|
var udargs = ((page_load) ? "/load" : "");
|
||||||
@ -51,6 +52,7 @@
|
|||||||
if(bParam_dend != "") bCmd = bCmd + "&dend=" + bParam_dend;
|
if(bParam_dend != "") bCmd = bCmd + "&dend=" + bParam_dend;
|
||||||
if(bParam_dbegin != "") bCmd = bCmd + "&dbegin=" + bParam_dbegin;
|
if(bParam_dbegin != "") bCmd = bCmd + "&dbegin=" + bParam_dbegin;
|
||||||
if(bParam_mid != "") bCmd = bCmd + "&mid=" + bParam_mid;
|
if(bParam_mid != "") bCmd = bCmd + "&mid=" + bParam_mid;
|
||||||
|
if(bParam_verb != "") bCmd = bCmd + "&verb=" + bParam_verb;
|
||||||
if(bParam_page != 1) bCmd = bCmd + "&page=" + bParam_page;
|
if(bParam_page != 1) bCmd = bCmd + "&page=" + bParam_page;
|
||||||
return(bCmd);
|
return(bCmd);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user