aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/admin.php2
-rw-r--r--mod/channel.php1
-rw-r--r--mod/cloud.php58
-rw-r--r--mod/connedit.php9
-rw-r--r--mod/dav.php9
-rw-r--r--mod/display.php1
-rwxr-xr-xmod/events.php4
-rw-r--r--mod/home.php1
-rw-r--r--mod/impel.php4
-rw-r--r--mod/item.php6
-rw-r--r--mod/mail.php3
-rw-r--r--mod/network.php9
-rw-r--r--mod/photos.php4
-rw-r--r--mod/profiles.php21
-rw-r--r--mod/search.php1
-rw-r--r--mod/siteinfo.php3
16 files changed, 77 insertions, 59 deletions
diff --git a/mod/admin.php b/mod/admin.php
index 74a373738..1503bf18e 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -288,6 +288,8 @@ function admin_page_site_post(&$a){
del_config('system','admininfo');
}
else {
+ require_once('include/text.php');
+ linkify_tags($a, $admininfo, local_user());
set_config('system','admininfo', $admininfo);
}
set_config('system','language', $language);
diff --git a/mod/channel.php b/mod/channel.php
index e819de0e0..c8ac83baf 100644
--- a/mod/channel.php
+++ b/mod/channel.php
@@ -286,6 +286,7 @@ function channel_content(&$a, $update = 0, $load = false) {
'$cats' => (($category) ? $category : ''),
'$tags' => (($hashtags) ? $hashtags : ''),
'$mid' => $mid,
+ '$verb' => '',
'$dend' => $datequery,
'$dbegin' => $datequery2
));
diff --git a/mod/cloud.php b/mod/cloud.php
index abeae88eb..ad85eba34 100644
--- a/mod/cloud.php
+++ b/mod/cloud.php
@@ -3,7 +3,7 @@
* @file mod/cloud.php
* @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;
@@ -12,45 +12,31 @@ use RedMatrix\RedDAV;
// composer autoloader for SabreDAV
require_once('vendor/autoload.php');
-if(! defined('TRINIDAD')) {
- // workaround for HTTP-auth in CGI mode
- if (x($_SERVER, 'REDIRECT_REMOTE_USER')) {
- $userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 6)) ;
- if(strlen($userpass)) {
- list($name, $password) = explode(':', $userpass);
- $_SERVER['PHP_AUTH_USER'] = $name;
- $_SERVER['PHP_AUTH_PW'] = $password;
- }
+// workaround for HTTP-auth in CGI mode
+if (x($_SERVER, 'REDIRECT_REMOTE_USER')) {
+ $userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 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;
- }
+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.
*
* @param App &$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');
if (! is_dir('store'))
@@ -130,19 +116,13 @@ function cloud_init(&$a) {
}
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());
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');
diff --git a/mod/connedit.php b/mod/connedit.php
index 3f31134cd..5c36c3184 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -55,6 +55,15 @@ function connedit_post(&$a) {
if(! $contact_id)
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",
intval($contact_id),
intval(local_user())
diff --git a/mod/dav.php b/mod/dav.php
index 1bff5ffbc..e3719cb93 100644
--- a/mod/dav.php
+++ b/mod/dav.php
@@ -37,15 +37,6 @@ if (x($_SERVER, 'HTTP_AUTHORIZATION')) {
* @param App &$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');
diff --git a/mod/display.php b/mod/display.php
index 7d7f4ca13..f14aca6da 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -136,6 +136,7 @@ function display_content(&$a, $update = 0, $load = false) {
'$tags' => '',
'$dend' => '',
'$dbegin' => '',
+ '$verb' => '',
'$mid' => $item_hash
));
diff --git a/mod/events.php b/mod/events.php
index e016311d5..28a816ea4 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -75,6 +75,10 @@ function events_post(&$a) {
$location = escape_tags(trim($_POST['location']));
$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;
$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) {
diff --git a/mod/home.php b/mod/home.php
index b2538795f..e82aab385 100644
--- a/mod/home.php
+++ b/mod/home.php
@@ -144,6 +144,7 @@ function home_content(&$a, $update = 0, $load = false) {
'$tags' => '',
'$dend' => '',
'$mid' => '',
+ '$verb' => '',
'$dbegin' => ''
));
}
diff --git a/mod/impel.php b/mod/impel.php
index 1c7541bef..60e80ff9f 100644
--- a/mod/impel.php
+++ b/mod/impel.php
@@ -75,11 +75,11 @@ function impel_init(&$a) {
$execflag = false;
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())
);
- 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;
}
}
diff --git a/mod/item.php b/mod/item.php
index 7a14a8ae9..bc8cfd047 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -449,10 +449,10 @@ function item_post(&$a) {
$execflag = false;
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)
);
- 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'])) {
$execflag = true;
}
@@ -576,7 +576,7 @@ function item_post(&$a) {
// 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_linkified_perms($results, $str_contact_allow, $str_group_allow, $profile_uid, $parent_item);
diff --git a/mod/mail.php b/mod/mail.php
index 6c778b956..37679aebf 100644
--- a/mod/mail.php
+++ b/mod/mail.php
@@ -83,6 +83,9 @@ function mail_post(&$a) {
// $body = fix_mce_lf($body);
// }
+ require_once('include/text.php');
+ linkify_tags($a, $body, local_user());
+
if(! $recipient) {
notice('No recipient found.');
$a->argc = 2;
diff --git a/mod/network.php b/mod/network.php
index d444dbd59..65332e3f6 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -47,7 +47,7 @@ function network_content(&$a, $update = 0, $load = false) {
$gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0);
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
-
+ $verb = ((x($_REQUEST,'verb')) ? $_REQUEST['verb'] : '');
$search = (($_GET['search']) ? $_GET['search'] : '');
if($search) {
@@ -251,6 +251,7 @@ function network_content(&$a, $update = 0, $load = false) {
'$tags' => $hashtags,
'$dend' => $datequery,
'$mid' => '',
+ '$verb' => $verb,
'$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)) {
$sql_extra .= term_query('item',$file,TERM_FILE);
}
diff --git a/mod/photos.php b/mod/photos.php
index df9880c8d..b2eb2847f 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -140,7 +140,7 @@ function photos_post(&$a) {
);
if($r) {
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)
proc_run('php','include/notifier.php','drop',$i['id']);
}
@@ -354,7 +354,7 @@ function photos_post(&$a) {
require_once('include/text.php');
$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'];
$post_tags = array();
diff --git a/mod/profiles.php b/mod/profiles.php
index fa6a6e35c..ef5f6b379 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -296,7 +296,24 @@ function profiles_post(&$a) {
$work = fix_mce_lf(escape_tags(trim($_POST['work'])));
$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'])) : '');
@@ -605,7 +622,7 @@ function profiles_content(&$a) {
$opt_tpl = get_markup_template("profile_hide_friends.tpl");
$hide_friends = replace_macros($opt_tpl,array('$field' => array(
- 'hide-friends',
+ 'hide_friends',
t('Hide your contact/friend list from viewers of this profile?'),
$r[0]['hide_friends'],
'',
diff --git a/mod/search.php b/mod/search.php
index 6df9d631a..2ea6ad86f 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -109,6 +109,7 @@ function search_content(&$a,$update = 0, $load = false) {
'$cats' => '',
'$tags' => '',
'$mid' => '',
+ '$verb' => '',
'$dend' => '',
'$dbegin' => ''
));
diff --git a/mod/siteinfo.php b/mod/siteinfo.php
index 01804e62a..1f3cd4479 100644
--- a/mod/siteinfo.php
+++ b/mod/siteinfo.php
@@ -126,7 +126,8 @@ function siteinfo_content(&$a) {
else
$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'))
$donate .= file_get_contents('doc/site_donate.html');