Merge remote-tracking branch 'upstream/master'

This commit is contained in:
zottel 2015-09-07 08:51:34 +02:00
commit 24b90b475b
14 changed files with 70 additions and 46 deletions

View File

@ -2,10 +2,10 @@
Hubzilla
========
###Websites. Redefined.
Websites. Redefined.
--------------------
![Hubzilla](images/ghash-32.png)
![Hubzilla](images/hubzilla_house_arrows.png)
**What are Hubs?**

View File

@ -1,8 +1,8 @@
[b]Using The Cloud - Dolphin[/b]
Visit webdavs://example.com/cloud where "example.com" is the URL of your hub.
Visit webdavs://example.com/dav where "example.com" 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.

View File

@ -25,14 +25,14 @@ Edit /etc/fstab
to include your cloud directory by adding
[code]
[baseurl]/cloud/ /mount/point davfs user,noauto,uid=<DesktopUser>,file_mode=600,dir_mode=700 0 1
[baseurl]/dav/ /mount/point davfs user,noauto,uid=<DesktopUser>,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 <DesktopUser> 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 <username> <password>
[baseurl]/dav <username> <password>
[/code]
Where <username> and <password> 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.

View File

@ -2,8 +2,8 @@
1. Open a File browsing window (that's Nautilus)
2. Select File > Connect to server from the menu
3. Type davs://<domain_name>/cloud/<your_username> and click Connect
4. You will be prompted for your username (same as above) and password
3. Type davs://<domain_name>/dav/<your_channelname> 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;

View File

@ -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 "davs://yourusername@friendicared.net/cloud" in the address bar
type "davs://<domain_name>/dav/<your_channelname>" in the address bar.
2nd way
Menu > file > 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.

View File

@ -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 "example.net" 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 "example.net" 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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -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' => '');
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']);
}
$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;
}

View File

@ -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)
);

View File

@ -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'];

View File

@ -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')) {

View File

@ -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'])

View File

@ -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,

1
view/js/mod_rpost.js Normal file
View File

@ -0,0 +1 @@
$(document).ready(function() { initEditor(); });