aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzottel <github@zottel.net>2015-09-07 08:51:34 +0200
committerzottel <github@zottel.net>2015-09-07 08:51:34 +0200
commit24b90b475b029fa535893e8d571a6714c1c54ebf (patch)
tree102193a26c00f689ceed9b1b0772529366d48b2f
parent938ef930d4b7353cc4e3c1f9dac015e91b96667b (diff)
parent2312f03eacd973c18342e26087d279ea2bebd4a8 (diff)
downloadvolse-hubzilla-24b90b475b029fa535893e8d571a6714c1c54ebf.tar.gz
volse-hubzilla-24b90b475b029fa535893e8d571a6714c1c54ebf.tar.bz2
volse-hubzilla-24b90b475b029fa535893e8d571a6714c1c54ebf.zip
Merge remote-tracking branch 'upstream/master'
-rw-r--r--README.md6
-rw-r--r--doc/dav_dolphin.bb4
-rw-r--r--doc/dav_mount.bb8
-rw-r--r--doc/dav_nautilus.bb4
-rw-r--r--doc/dav_nemo.bb10
-rw-r--r--doc/dav_windows.bb6
-rw-r--r--images/hubzilla_house_arrows.pngbin0 -> 22076 bytes
-rw-r--r--include/attach.php44
-rwxr-xr-xinclude/items.php2
-rw-r--r--include/photos.php4
-rw-r--r--mod/photos.php2
-rw-r--r--mod/public.php8
-rw-r--r--mod/rpost.php15
-rw-r--r--view/js/mod_rpost.js1
14 files changed, 69 insertions, 45 deletions
diff --git a/README.md b/README.md
index ac62f721a..44357eb3c 100644
--- a/README.md
+++ b/README.md
@@ -2,10 +2,10 @@
Hubzilla
========
-###Websites. Redefined.
+Websites. Redefined.
+--------------------
-
-![Hubzilla](images/ghash-32.png)
+![Hubzilla](images/hubzilla_house_arrows.png)
**What are Hubs?**
diff --git a/doc/dav_dolphin.bb b/doc/dav_dolphin.bb
index a1ebba394..ae60a6d52 100644
--- a/doc/dav_dolphin.bb
+++ b/doc/dav_dolphin.bb
@@ -1,8 +1,8 @@
[b]Using The Cloud - Dolphin[/b]
-Visit webdavs://example.com/cloud where &quot;example.com&quot; is the URL of your hub.
+Visit webdavs://example.com/dav where &quot;example.com&quot; is the URL of your hub.
-When prompted for a username and password, enter your username (the first part of your webbie - no @ or domain name) and password for your normal account.
+When prompted for a username and password, enter your channel name (the first part of your webbie - no @ or domain name) and password for your normal account.
Note, if you are already logged in to the web interface via Konqueror, you will not be prompted for further authentication.
diff --git a/doc/dav_mount.bb b/doc/dav_mount.bb
index d8cb2e08e..0fd3d4691 100644
--- a/doc/dav_mount.bb
+++ b/doc/dav_mount.bb
@@ -25,14 +25,14 @@ Edit /etc/fstab
to include your cloud directory by adding
[code]
-[baseurl]/cloud/ /mount/point davfs user,noauto,uid=&lt;DesktopUser&gt;,file_mode=600,dir_mode=700 0 1
+[baseurl]/dav/ /mount/point davfs user,noauto,uid=&lt;DesktopUser&gt;,file_mode=600,dir_mode=700 0 1
[/code]
Where [baseurl] is the URL of your hub, /mount/point is the location you want to mount the cloud, and &lt;DesktopUser&gt; is the user you log in to one your computer. Note that if you are mounting as a normal user (not root) the mount point must be in your home directory.
For example, if I wanted to mount my cloud to a directory called 'cloud' in my home directory, and my username was bob, my fstab would be
-[code][baseurl]/cloud/ /home/bob/cloud davfs user,noauto,uid=bob,file_mode=600,dir_mode=700 0 1[/code]
+[code][baseurl]/dav/ /home/bob/cloud davfs user,noauto,uid=bob,file_mode=600,dir_mode=700 0 1[/code]
Now, create the mount point.
@@ -49,7 +49,7 @@ Create a file called 'secrets'
and add your cloud login credentials
[code]
-[baseurl]/cloud &lt;username&gt; &lt;password&gt;
+[baseurl]/dav &lt;username&gt; &lt;password&gt;
[/code]
Where &lt;username&gt; and &lt;password&gt; are the username and password [i]for your hub[/i].
@@ -60,7 +60,7 @@ Don't let this file be writeable by anyone who doesn't need it with
Finally, mount the drive.
-[code]mount [baseurl]/cloud[/code]
+[code]mount [baseurl]/dav[/code]
You can now find your cloud at /home/bob/cloud and use it as though it were part of your local filesystem - even if the applications you are using have no dav support themselves.
diff --git a/doc/dav_nautilus.bb b/doc/dav_nautilus.bb
index 51663b6de..c8911cda8 100644
--- a/doc/dav_nautilus.bb
+++ b/doc/dav_nautilus.bb
@@ -2,8 +2,8 @@
1. Open a File browsing window (that's Nautilus)
2. Select File &gt; Connect to server from the menu
-3. Type davs://&lt;domain_name&gt;/cloud/&lt;your_username&gt; and click Connect
-4. You will be prompted for your username (same as above) and password
+3. Type davs://&lt;domain_name&gt;/dav/&lt;your_channelname&gt; and click Connect
+4. You will be prompted for your channel name (same as above) and password
5. Your personal DAV directory will be shown in the window
#include doc/macros/cloud_footer.bb;
diff --git a/doc/dav_nemo.bb b/doc/dav_nemo.bb
index 2c88b0782..f2d994fbb 100644
--- a/doc/dav_nemo.bb
+++ b/doc/dav_nemo.bb
@@ -3,16 +3,16 @@
For (file browser) Nemo 1.8.2 under Linux Mint 15, Cinnamon 1.8.8. Nemo ist the standard file browser there.
1st way
-type &quot;davs://yourusername@friendicared.net/cloud&quot; in the address bar
+type &quot;davs://&lt;domain_name&gt;/dav/&lt;your_channelname&gt;&quot; in the address bar.
2nd way
Menu &gt; file &gt; connect to server
Fill the dialog
-- Server: friendicared.net
+- Server: hubzilla_domain_name
- Type: Secure WebDAV (https)
-- Folder: /cloud
-- Username: yourusername
-- Passwort: yourpasswort
+- Folder: /dav
+- Username: yourchannelname
+- Password: yourpassword
Once open you can set a bookmark.
diff --git a/doc/dav_windows.bb b/doc/dav_windows.bb
index 0eaffd4d0..96862e2b5 100644
--- a/doc/dav_windows.bb
+++ b/doc/dav_windows.bb
@@ -4,8 +4,8 @@ RedDav using Windows 7 graphical user interface wizard:
1. Left-click the Start-button to open the start menu.
2. Right-click the My computer icon to access its menu.
3. Left-click Map network drive... to open the connection dialog wizard.
-4. Type #^[url=https://example.net/cloud/your_user_name]https://example.net/cloud/your_user_name[/url] in the textbox and click the Complete button where &quot;example.net&quot; is the URL of your hub.
-5. Type your Red account's user name. IMPORTANT - NO at-sign or domain name.
-6. Type your Red password
+4. Type #^[url=https://example.net/dav/your_channel_name]https://example.net/dav/your_channel_name[/url] in the textbox and click the Complete button where &quot;example.net&quot; is the URL of your hub.
+5. Type your Hubzilla account's user name. IMPORTANT - NO at-sign or domain name.
+6. Type your Hubzilla password
#include doc/macros/cloud_footer.bb;
diff --git a/images/hubzilla_house_arrows.png b/images/hubzilla_house_arrows.png
new file mode 100644
index 000000000..56402a96b
--- /dev/null
+++ b/images/hubzilla_house_arrows.png
Binary files differ
diff --git a/include/attach.php b/include/attach.php
index 620c7620c..513486bfc 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -405,6 +405,9 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
require_once('include/photos.php');
+
+ call_hooks('photo_upload_begin',$arr);
+
$ret = array('success' => false);
$channel_id = $channel['channel_id'];
$sql_options = '';
@@ -451,15 +454,28 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$hash = $arr['resource_id'];
}
elseif($options !== 'update') {
- if(! x($_FILES,'userfile')) {
- $ret['message'] = t('No source file.');
- return $ret;
- }
+ $f = array('src' => '', 'filename' => '', 'filesize' => 0, 'type' => '');
- $src = $_FILES['userfile']['tmp_name'];
- $filename = basename($_FILES['userfile']['name']);
- $filesize = intval($_FILES['userfile']['size']);
+ call_hooks('photo_upload_file',$f);
+ call_hooks('attach_upload_file',$f);
+ if (x($f,'src') && x($f,'filesize')) {
+ $src = $f['src'];
+ $filename = $f['filename'];
+ $filesize = $f['filesize'];
+ $type = $f['type'];
+
+ } else {
+
+ if(! x($_FILES,'userfile')) {
+ $ret['message'] = t('No source file.');
+ return $ret;
+ }
+
+ $src = $_FILES['userfile']['tmp_name'];
+ $filename = basename($_FILES['userfile']['name']);
+ $filesize = intval($_FILES['userfile']['size']);
+ }
}
$existing_size = 0;
@@ -615,6 +631,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
if(($maxfilesize) && ($filesize > $maxfilesize)) {
$ret['message'] = sprintf( t('File exceeds size limit of %d'), $maxfilesize);
@unlink($src);
+ call_hooks('photo_upload_end',$ret);
return $ret;
}
@@ -627,10 +644,11 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
if(($r) && (($r[0]['total'] + $filesize) > ($limit - $existing_size))) {
$ret['message'] = upgrade_message(true) . sprintf(t("You have reached your limit of %1$.0f Mbytes attachment storage."), $limit / 1024000);
@unlink($src);
+ call_hooks('photo_upload_end',$ret);
return $ret;
}
}
- $mimetype = z_mime_content_type($filename);
+ $mimetype = ((isset($type) && $type) ? $type : z_mime_content_type($filename));
}
$os_basepath = 'store/' . $channel['channel_address'] . '/' ;
@@ -658,7 +676,6 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
else
$edited = $created;
-
if($options === 'replace') {
$r = q("update attach set filename = '%s', filetype = '%s', folder = '%s', filesize = %d, os_storage = %d, is_photo = %d, data = '%s', edited = '%s' where id = %d and uid = %d",
dbesc($filename),
@@ -714,6 +731,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
);
}
else {
+
$r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, filetype, folder, filesize, revision, os_storage, is_photo, data, created, edited, allow_cid, allow_gid,deny_cid, deny_gid )
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
intval($channel['channel_account_id']),
@@ -738,6 +756,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
}
if($is_photo) {
+
$args = array( 'source' => $source, 'visible' => 0, 'resource_id' => $hash, 'album' => basename($pathname), 'os_path' => $os_basepath . $os_relpath, 'filename' => $filename, 'getimagesize' => $gis, 'directory' => $direct);
if($arr['contact_allow'])
$args['contact_allow'] = $arr['contact_allow'];
@@ -772,6 +791,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
if(! $r) {
$ret['message'] = t('File upload failed. Possible system limit or action terminated.');
+ call_hooks('photo_upload_end',$ret);
return $ret;
}
@@ -784,13 +804,17 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
if(! $r) {
$ret['message'] = t('Stored file could not be verified. Upload failed.');
+ call_hooks('photo_upload_end',$ret);
return $ret;
}
$ret['success'] = true;
$ret['data'] = $r[0];
-
+ if(! $is_photo) {
+ // This would've been called already with a success result in photos_upload() if it was a photo.
+ call_hooks('photo_upload_end',$ret);
+ }
return $ret;
}
diff --git a/include/items.php b/include/items.php
index 9807831e3..91afad0e6 100755
--- a/include/items.php
+++ b/include/items.php
@@ -3322,7 +3322,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent) {
dbesc($title),
dbesc($body),
intval($item_wall),
- $intval($item_origin),
+ intval($item_origin),
intval($item_id)
);
diff --git a/include/photos.php b/include/photos.php
index b4129fbf1..25818124a 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -27,7 +27,7 @@ function photo_upload($channel, $observer, $args) {
return $ret;
}
- call_hooks('photo_upload_begin', $args);
+// call_hooks('photo_upload_begin', $args);
/*
* Determine the album to use
@@ -84,7 +84,7 @@ function photo_upload($channel, $observer, $args) {
} else {
$f = array('src' => '', 'filename' => '', 'filesize' => 0, 'type' => '');
- call_hooks('photo_upload_file',$f);
+// call_hooks('photo_upload_file',$f);
if (x($f,'src') && x($f,'filesize')) {
$src = $f['src'];
diff --git a/mod/photos.php b/mod/photos.php
index d06a8e69c..f48603d71 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -85,7 +85,7 @@ function photos_post(&$a) {
$owner_record = $s[0];
- $acl = AccessList($a->data['channel']);
+ $acl = new AccessList($a->data['channel']);
if((argc() > 3) && (argv(2) === 'album')) {
diff --git a/mod/public.php b/mod/public.php
index 2106be7a6..45edda6c0 100644
--- a/mod/public.php
+++ b/mod/public.php
@@ -22,7 +22,7 @@ function public_content(&$a, $update = 0, $load = false) {
$maxheight = get_config('system','home_divmore_height');
if(! $maxheight)
- $maxheight = 75;
+ $maxheight = 400;
$o .= '<div id="live-public"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . ((intval(local_channel())) ? local_channel() : (-1))
@@ -80,10 +80,12 @@ function public_content(&$a, $update = 0, $load = false) {
$a->data['firehose'] = intval($sys['channel_id']);
}
+ if(get_config('system','public_list_mode'))
+ $page_mode = 'list';
+ else
+ $page_mode = 'client';
- $page_mode = 'list';
-
$simple_update = (($update) ? " and item.item_unseen = 1 " : '');
if($update && $_SESSION['loadtime'])
diff --git a/mod/rpost.php b/mod/rpost.php
index 4a6b87cc6..d519a996b 100644
--- a/mod/rpost.php
+++ b/mod/rpost.php
@@ -94,15 +94,13 @@ function rpost_content(&$a) {
$channel = $a->get_channel();
- $channel_acl = array(
- 'allow_cid' => $channel['channel_allow_cid'],
- 'allow_gid' => $channel['channel_allow_gid'],
- 'deny_cid' => $channel['channel_deny_cid'],
- 'deny_gid' => $channel['channel_deny_gid']
- );
+
+ $acl = new AccessList($channel);
+
+ $channel_acl = $acl->get();
if($_REQUEST['url']) {
- $x = z_fetch_url(z_root() . '/urlinfo?f=&url=' . urlencode($_REQUEST['url']));
+ $x = z_fetch_url(z_root() . '/linkinfo?f=&url=' . urlencode($_REQUEST['url']));
if($x['success'])
$_REQUEST['body'] = $_REQUEST['body'] . $x['body'];
}
@@ -112,8 +110,7 @@ function rpost_content(&$a) {
'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
'default_location' => $channel['channel_location'],
'nickname' => $channel['channel_address'],
- 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
- || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
+ 'lockstate' => (($acl->is_private()) ? 'lock' : 'unlock'),
'acl' => populate_acl($channel_acl),
'bang' => '',
'visitor' => true,
diff --git a/view/js/mod_rpost.js b/view/js/mod_rpost.js
new file mode 100644
index 000000000..06b67136b
--- /dev/null
+++ b/view/js/mod_rpost.js
@@ -0,0 +1 @@
+$(document).ready(function() { initEditor(); });