Revert "Update htconfig.sample.php"
This reverts commit f2126ef18c8b66020305d07dcefeacc4e55a3c12
This commit is contained in:
parent
47fd95db9d
commit
5d70d889e9
@ -35,7 +35,6 @@ class Getfile extends \Zotlabs\Web\Controller {
|
|||||||
$sig = $_POST['signature'];
|
$sig = $_POST['signature'];
|
||||||
$resource = $_POST['resource'];
|
$resource = $_POST['resource'];
|
||||||
$revision = intval($_POST['revision']);
|
$revision = intval($_POST['revision']);
|
||||||
$resolution = (-1);
|
|
||||||
|
|
||||||
if(! $hash)
|
if(! $hash)
|
||||||
killme();
|
killme();
|
||||||
@ -81,10 +80,15 @@ class Getfile extends \Zotlabs\Web\Controller {
|
|||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(substr($resource,-2,1) == '-') {
|
if(isset($_POST['resolution']))
|
||||||
|
$resolution = intval($_POST['resolution']);
|
||||||
|
elseif(substr($resource,-2,1) == '-') {
|
||||||
$resolution = intval(substr($resource,-1,1));
|
$resolution = intval(substr($resource,-1,1));
|
||||||
$resource = substr($resource,0,-2);
|
$resource = substr($resource,0,-2);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$resolution = (-1);
|
||||||
|
}
|
||||||
|
|
||||||
$slop = intval(get_pconfig($channel['channel_id'],'system','getfile_time_slop'));
|
$slop = intval(get_pconfig($channel['channel_id'],'system','getfile_time_slop'));
|
||||||
if($slop < 1)
|
if($slop < 1)
|
||||||
|
@ -495,4 +495,31 @@ abstract class PhotoDriver {
|
|||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Stores thumbnail to database or filesystem.
|
||||||
|
*
|
||||||
|
* @param array $arr
|
||||||
|
* @param scale int
|
||||||
|
* @return boolean|array
|
||||||
|
*/
|
||||||
|
public function storeThumbnail($arr, $scale = 0) {
|
||||||
|
|
||||||
|
if(boolval(get_config('system','filesystem_storage_thumbnails', 0)) && $scale > 0) {
|
||||||
|
$channel = \App::get_channel();
|
||||||
|
$arr['os_storage'] = 1;
|
||||||
|
$arr['imgscale'] = $scale;
|
||||||
|
$arr['os_syspath'] = 'store/' . $channel['channel_address'] . '/' . $arr['os_path'] . '-' . $scale;
|
||||||
|
if(! $this->saveImage($arr['os_syspath']))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(! $this->save($arr)) {
|
||||||
|
if(array_key_exists('os_syspath', $arr))
|
||||||
|
@unlink($arr['os_syspath']);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1521,6 +1521,17 @@ function attach_drop_photo($channel_id,$resource) {
|
|||||||
if($x) {
|
if($x) {
|
||||||
drop_item($x[0]['id'],false,(($x[0]['item_hidden']) ? DROPITEM_NORMAL : DROPITEM_PHASE1),true);
|
drop_item($x[0]['id'],false,(($x[0]['item_hidden']) ? DROPITEM_NORMAL : DROPITEM_PHASE1),true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$r = q("SELECT content FROM photo WHERE resource_id = '%s' AND uid = %d AND os_storage = 1",
|
||||||
|
dbesc($resource),
|
||||||
|
intval($channel_id)
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
foreach($r as $i) {
|
||||||
|
@unlink(dbunescbin($i['content']));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
q("DELETE FROM photo WHERE uid = %d AND resource_id = '%s'",
|
q("DELETE FROM photo WHERE uid = %d AND resource_id = '%s'",
|
||||||
intval($channel_id),
|
intval($channel_id),
|
||||||
dbesc($resource)
|
dbesc($resource)
|
||||||
|
@ -1385,13 +1385,14 @@ function sync_files($channel, $files) {
|
|||||||
else
|
else
|
||||||
$p['content'] = (($p['content'])? base64_decode($p['content']) : '');
|
$p['content'] = (($p['content'])? base64_decode($p['content']) : '');
|
||||||
|
|
||||||
if(intval($p['imgscale']) && (! $p['content'])) {
|
if(intval($p['imgscale']) && intval($p['os_storage']) && (! empty($p['content']))) {
|
||||||
|
|
||||||
$time = datetime_convert();
|
$time = datetime_convert();
|
||||||
|
|
||||||
$parr = array('hash' => $channel['channel_hash'],
|
$parr = array(
|
||||||
|
'hash' => $channel['channel_hash'],
|
||||||
'time' => $time,
|
'time' => $time,
|
||||||
'resource' => $att['hash'],
|
'resource' => $p['resource_id'],
|
||||||
'revision' => 0,
|
'revision' => 0,
|
||||||
'signature' => base64url_encode(rsa_sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey'])),
|
'signature' => base64url_encode(rsa_sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey'])),
|
||||||
'resolution' => $p['imgscale']
|
'resolution' => $p['imgscale']
|
||||||
@ -1414,8 +1415,6 @@ function sync_files($channel, $files) {
|
|||||||
|
|
||||||
$x = z_post_url($fetch_url,$parr,$redirects,[ 'filep' => $fp, 'headers' => $headers]);
|
$x = z_post_url($fetch_url,$parr,$redirects,[ 'filep' => $fp, 'headers' => $headers]);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
$p['content'] = file_get_contents($stored_image);
|
|
||||||
unlink($stored_image);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($p['display_path']))
|
if(!isset($p['display_path']))
|
||||||
|
Reference in New Issue
Block a user