Merge branch 'master' of git://github.com/kandsten/gallery3-contrib
Conflicts: 3.0/modules/aws_s3/helpers/aws_s3.php
This commit is contained in:
commit
9be482cf49
|
@ -38,12 +38,12 @@ class aws_s3_Core {
|
||||||
pack('H*', sha1((str_pad(module::get_var("aws_s3", "secret_key"), 64, chr(0x00)) ^
|
pack('H*', sha1((str_pad(module::get_var("aws_s3", "secret_key"), 64, chr(0x00)) ^
|
||||||
(str_repeat(chr(0x36), 64))) . $string)))));
|
(str_repeat(chr(0x36), 64))) . $string)))));
|
||||||
}
|
}
|
||||||
|
|
||||||
static function generate_url($resource, $authenticated = false, $updated = null) {
|
static function generate_url($resource, $authenticated = false, $updated = null) {
|
||||||
$find = array("{guid}", "{bucket}", "{resource}");
|
$find = array("{guid}", "{bucket}", "{resource}");
|
||||||
$replace = array(module::get_var("aws_s3", "g3id"), module::get_var("aws_s3", "bucket_name"), $resource);
|
$replace = array(module::get_var("aws_s3", "g3id"), module::get_var("aws_s3", "bucket_name"), $resource);
|
||||||
$url = str_replace($find, $replace, module::get_var("aws_s3", "url_str"));
|
$url = str_replace($find, $replace, module::get_var("aws_s3", "url_str"));
|
||||||
|
|
||||||
if ($authenticated) {
|
if ($authenticated) {
|
||||||
preg_match("%https?://([a-zA-Z0-9\.-]*)/(.*)$%", $url, $matches);
|
preg_match("%https?://([a-zA-Z0-9\.-]*)/(.*)$%", $url, $matches);
|
||||||
$host = module::get_var("aws_s3" , "bucket_name");
|
$host = module::get_var("aws_s3" , "bucket_name");
|
||||||
|
@ -51,7 +51,7 @@ class aws_s3_Core {
|
||||||
$url .= "?AWSAccessKeyId=" . module::get_var("aws_s3", "access_key") .
|
$url .= "?AWSAccessKeyId=" . module::get_var("aws_s3", "access_key") .
|
||||||
"&Expires=" . (time() + module::get_var("aws_s3", "sig_exp")) .
|
"&Expires=" . (time() + module::get_var("aws_s3", "sig_exp")) .
|
||||||
"&Signature=" . urlencode(self::getHash("GET\n\n\n" . (time() + module::get_var("aws_s3", "sig_exp")) . "\n/" . $host . "/" . $resource));
|
"&Signature=" . urlencode(self::getHash("GET\n\n\n" . (time() + module::get_var("aws_s3", "sig_exp")) . "\n/" . $host . "/" . $resource));
|
||||||
|
|
||||||
self::get_s3();
|
self::get_s3();
|
||||||
S3::getAuthenticatedURL(module::get_var("aws_s3", "bucket_name"), $resource, module::get_var("aws_s3", "sig_exp"));
|
S3::getAuthenticatedURL(module::get_var("aws_s3", "bucket_name"), $resource, module::get_var("aws_s3", "sig_exp"));
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue
Block a user