parent
61837428ba
commit
029b21bf54
@ -0,0 +1,12 @@ |
||||
<?php |
||||
$RUNTIME_NOAPPS = true; |
||||
|
||||
require_once('../../../lib/base.php'); |
||||
require_once('../lib_share.php'); |
||||
|
||||
$source = $_GET['source']; |
||||
$uid_shared_with = array($_GET['uid_shared_with']); |
||||
$permissions = $_GET['permissions']; |
||||
new OC_SHARE($source, $uid_shared_with, $permissions); |
||||
|
||||
?> |
@ -0,0 +1,12 @@ |
||||
<?php |
||||
$RUNTIME_NOAPPS = true; |
||||
|
||||
require_once('../../../lib/base.php'); |
||||
require_once('../lib_share.php'); |
||||
|
||||
$source = $_GET['source']; |
||||
$uid_shared_with = array($_GET['uid_shared_with']); |
||||
error_log("deleteitem called".$source.$uid_shared_with); |
||||
OC_SHARE::unshare($source, $uid_shared_with); |
||||
|
||||
?> |
@ -0,0 +1,50 @@ |
||||
$(document).ready(function() { |
||||
$( "#source" ).autocomplete({ |
||||
source: "../../files/ajax/autocomplete.php", |
||||
minLength: 1 |
||||
}); |
||||
$("button.delete").live('click', function( event ) { |
||||
event.preventDefault(); |
||||
// var row=$(this);
|
||||
var source=$(this).attr('data-source'); |
||||
var uid_shared_with=$(this).attr('data-uid_shared_with'); |
||||
var data='source='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with); |
||||
$.ajax({ |
||||
type: 'GET', |
||||
url: 'ajax/unshare.php', |
||||
cache: false, |
||||
data: data |
||||
// success: function(){
|
||||
// row.remove();
|
||||
// }
|
||||
}); |
||||
}); |
||||
$('#share_item').submit(function( event ){ |
||||
event.preventDefault(); |
||||
var source=$('#source').val(); |
||||
var uid_shared_with=$('#uid_shared_with').val(); |
||||
var permissions=$('#permissions').val()||0; |
||||
var data='source='+source+'&uid_shared_with='+uid_shared_with+'&permissions='+permissions; |
||||
$.ajax({ |
||||
type: 'GET', |
||||
url: 'ajax/share.php', |
||||
cache: false, |
||||
data: data, |
||||
// success: function(token){
|
||||
// if(token){
|
||||
// var html="<tr class='link' id='"+token+"'>";
|
||||
// html+="<td class='path'>"+path+"</td>";
|
||||
// var expire=($('#expire').val())?$('#expire').val():'Never'
|
||||
// html+="<td class='expire'>"+expire+"</td>"
|
||||
// html+="<td class='link'><a href='get.php?token="+token+"'>"+$('#baseUrl').val()+"?token="+token+"</a></td>"
|
||||
// html+="<td><button class='delete fancybutton' data-token='"+token+"'>Delete</button></td>"
|
||||
// html+="</tr>"
|
||||
// $(html).insertBefore($('#newlink_row'));
|
||||
// $('#expire').val('');
|
||||
// $('#expire_time').val('');
|
||||
// $('#path').val('');
|
||||
// }
|
||||
// }
|
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,40 @@ |
||||
<?php |
||||
/** |
||||
* ownCloud |
||||
* |
||||
* @author Michael Gapczynski |
||||
* @copyright 2011 Michael Gapczynski GapczynskiM@gmail.com |
||||
* |
||||
* This library is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
* License as published by the Free Software Foundation; either |
||||
* version 3 of the License, or any later version. |
||||
* |
||||
* This library is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
||||
* |
||||
* You should have received a copy of the GNU Affero General Public |
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
||||
* |
||||
*/ |
||||
|
||||
require_once('../../lib/base.php'); |
||||
require_once('lib_share.php'); |
||||
require('template.php'); |
||||
|
||||
if (!OC_USER::isLoggedIn()){ |
||||
header( "Location: ".OC_HELPER::linkTo( "index.php" )); |
||||
exit(); |
||||
} |
||||
|
||||
OC_APP::setActiveNavigationEntry("files_sharing_list"); |
||||
|
||||
OC_UTIL::addScript("files_sharing", "list"); |
||||
|
||||
$tmpl = new OC_TEMPLATE("files_sharing", "list", "user"); |
||||
$tmpl->assign("shared_items", OC_SHARE::getMySharedItems()); |
||||
$tmpl->printPage(); |
||||
|
||||
?> |
@ -1,30 +0,0 @@ |
||||
<?php if ($_['shared_items'] == null) {echo "You are not sharing any of your files";} else {?> |
||||
<table id='itemlist'> |
||||
<thead> |
||||
<tr> |
||||
<th>Item</th> |
||||
<th>Shared With</th> |
||||
<th>Permissions</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<?php foreach($_['shared_items'] as $item):?> |
||||
<tr class='link' id='<?php echo $item['id'];?>'>
|
||||
<td class='item'><?php echo $item['item'];?></td>
|
||||
<td class='uid_shared_with'><?php echo $item['uid_shared_with'];?></td>
|
||||
<td class='permissions'><?php echo $item['permissions'];?></td>
|
||||
<td><button class='delete fancybutton' data-token='<?php echo $link['token'];?>'>Delete</button></td>
|
||||
</tr> |
||||
<?php endforeach;?> |
||||
<tr id='newlink_row'> |
||||
<form action='#' id='newlink'> |
||||
<input type='hidden' id='expire_time'/> |
||||
<td class='path'><input placeholder='Item' id='path'/></td> |
||||
<td class='expire'><input placeholder='Share With' id='expire'/></td> |
||||
<td class='permissions'><input placeholder='Permissions' id='expire'/></td> |
||||
<td><input type='submit' value='Share'/></td> |
||||
</form> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<?php } ?> |
@ -0,0 +1,32 @@ |
||||
<fieldset> |
||||
<legend>Your Shared Files</legend> |
||||
<?php if ($_['shared_items'] == null) {echo "You are not sharing any of your files";} else {?> |
||||
<table id='itemlist'> |
||||
<thead> |
||||
<tr> |
||||
<th>Item</th> |
||||
<th>Shared With</th> |
||||
<th>Permissions</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<?php foreach($_['shared_items'] as $item):?> |
||||
<tr class='item'> |
||||
<td class='source'><?php echo substr($item['source'], strlen("/".$_SESSION['user_id']."/files/"));?></td>
|
||||
<td class='uid_shared_with'><?php echo $item['uid_shared_with'];?></td>
|
||||
<td class='permissions'><?php echo $item['is_writeable'];?></td>
|
||||
<td><button class='delete fancybutton' data-source='<?php echo $item['source'];?>' data-uid_shared_with='<?php echo $item['uid_shared_with'];?>'>Delete</button></td>
|
||||
</tr> |
||||
<?php endforeach;?> |
||||
<tr id='share_item_row'> |
||||
<form action='#' id='share_item'> |
||||
<td class='source'><input placeholder='Item' id='source'/></td> |
||||
<td class='uid_shared_with'><input placeholder='Share With' id='uid_shared_with'/></td> |
||||
<td class='permissions'><input placeholder='Permissions' id='permissions'/></td> |
||||
<td><input type='submit' value='Share'/></td> |
||||
</form> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<?php } ?> |
||||
</fieldset> |
Loading…
Reference in new issue