\r
<IfModule mod_deflate.c>\r
SetOutputFilter DEFLATE\r
- SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|swf|zip|exe|mp3|f4v|ogv|ogg|ogm|webm|mp4|flv|gz|pdf|swc)$ no-gzip dont-vary\r
+ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|swf|zip|exe|mp3|f4v|ogv|ogg|ogm|webm|mp4|flv|gz|pdf|swc|ipa|plist)$ no-gzip dont-vary\r
\r
<IfModule mod_headers.c>\r
Header append Vary User-Agent\r
RewriteRule ^telecharger/([0-9a-fA-F]+)/([0-9]+)/(.*)$ index.php/telecharger/$1/$2/$3 [L]\r
RewriteRule ^telechargerr/([0-9a-fA-F]+)/([0-9]+)/(.*)$ index.php/telechargerr/$1/$2/$3 [L]\r
\r
-\r
RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.html$ viewer/$1_$2_$3/index [L]\r
RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.swf$ fluidbook/compile/index.swf [L]\r
RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/player.swf$ fluidbook/compile/player.swf [L]\r
RewriteRule ^.*$ - [NC,L]\r
\r
RewriteRule ^([-,_a-zA-Z0-9\./]+)$ index.php/$1 [L]\r
-</IfModule>
\ No newline at end of file
+</IfModule>\r
+\r
+XSendFile On
\ No newline at end of file
$openssl->setArg('-outform', 'PEM');
$openssl->execute();
+ fb($openssl->commande);
+ fb($openssl->output);
+
// Generate p12 file
$openssl = new cubeCommandLine('openssl');
$openssl->setPath(CONVERTER_PATH);
$openssl->setArg('-out', $p12);
$openssl->execute();
+ fb($openssl->commande);
+ fb($openssl->output);
+
// Generate pem bundle file
$openssl = new cubeCommandLine('openssl');
$openssl->setPath(CONVERTER_PATH);
$openssl->setArg('-clcerts');
$openssl->execute();
+ fb($openssl->commande);
+ fb($openssl->output);
+
unlink($tmp . '/.rnd');
$tmpfile = cubeFiles::tempnam() . '.zip';
commonDroits::min(array('extranet' => 0, 'ws' => 1));\r
\r
$settings = $core->user->getSettings('fichiers');\r
-\r
- if ($core->user->grade > 0 && isset($args[1])) {\r
+ if ($core->user->ws_grade > 0 && isset($args[1])) {\r
$dao = new commonDAOClient($core->con);\r
$client = $dao->selectById($args[1]);\r
$_SESSION['entreprise_fichiers'] = $client->entreprise;\r
+ } else {\r
+ unset($_SESSION['entreprise_fichiers']);\r
}\r
\r
$shortcuts = array();\r
commonDroits::min(array('extranet' => 0, 'ws' => 1));\r
\r
global $core;\r
- if ($core->user->grade <= 0) {\r
+ if ($core->user->ws_grade <= 0) {\r
$entreprise = $core->user->entreprise;\r
} else {\r
$entreprise = $_SESSION['entreprise_fichiers'];\r
}\r
\r
+ fb($entreprise);\r
+\r
$settings = is_null($settings) ? $core->user->getSettings('fichiers') : $settings;\r
$dao = new commonDAOFichier($core->con);\r
$change = 'Fichiers';\r
}\r
\r
public static function manifestFromIpa($fichier) {\r
- $manifest = sha1($fichier->relPath) . '.plist';\r
- $res = SCHEME . '://' . $_SERVER['HTTP_HOST'] . '/cache/iosotamanifest/' . $manifest;\r
- $file = ROOT . '/cache/iosotamanifest/' . $manifest;\r
+ $path = '/cache/iosotamanifest/' . sha1($fichier->relPath) . '/';\r
+ $webpath = SCHEME . '://' . $_SERVER['HTTP_HOST'] . $path;\r
+ $filepath = ROOT . $path;\r
+\r
+ if (!file_exists($filepath)) {\r
+ mkdir($filepath, 0777, true);\r
+ }\r
+\r
+ $res = $webpath . 'manifest.plist';\r
+ $file = $filepath . 'manifest.plist';\r
$tmp = $file . '.info';\r
$ipa = $fichier->chemin;\r
\r
\r
$infos = $plist->toArray();\r
\r
+ $protocol = 'https';\r
\r
$bundle = $infos['CFBundleIdentifier'];\r
$appName = $infos['CFBundleDisplayName'];\r
$version = $infos['CFBundleVersion'];\r
- $ipaURL = 'https://' . $_SERVER['HTTP_HOST'] . '/telechargerr/' . self::hashFile($fichier->relPath . '//') . '/' . $fichier->relPath;\r
+ $ipaURL = $protocol . '://' . $_SERVER['HTTP_HOST'] . '/telechargerr/' . self::hashFile($fichier->relPath . '//') . '/' . $fichier->relPath;\r
\r
$xml = '<?xml version="1.0" encoding="UTF-8"?>\r
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\r
<key>needs-shine</key>\r
<false/>\r
<key>url</key>\r
- <string>https://workshop.fluidbook.com/images/ws/ios/512.png</string>\r
+ <string>' . $protocol . '://workshop.fluidbook.com/images/ws/ios/512.png</string>\r
</dict>\r
<dict>\r
<key>kind</key>\r
<key>needs-shine</key>\r
<false/>\r
<key>url</key>\r
- <string>https://workshop.fluidbook.com/images/ws/ios/57.png</string>\r
+ <string>' . $protocol . '://workshop.fluidbook.com/images/ws/ios/57.png</string>\r
</dict>\r
</array>\r
<key>metadata</key>\r
<key>bundle-identifier</key>\r
<string>' . $bundle . '</string>\r
<key>bundle-version</key>\r
- <string>' . $version . '.' . time() . '</string>\r
+ <string>' . $version . '</string>\r
<key>kind</key>\r
<string>software</string>\r
<key>title</key>\r
</plist>';\r
\r
file_put_contents($file, $xml);\r
-\r
unlink($tmp);\r
}\r
- return $res;\r
+ return str_replace('http://', 'https://', $res);\r
}\r
\r
public static function hashFile($path) {\r
return;\r
}\r
\r
+ cubeHTTP::xsendFile(FTPROOT . $path, false, true);\r
+\r
$dir = md5($path . (rand(1, 235548684) * 50.5));\r
\r
if ($relay) {\r
files::$mimeType['ipa'] = 'application/octet-stream';\r
-\r
cubeHTTP::relayFile(FTPROOT . $path);\r
} else {\r
@mkdir(ROOT . '/cache/download/' . $dir, 0755, true);\r
return $a;\r
}\r
\r
-}\r
-\r
-?>
\ No newline at end of file
+}
\ No newline at end of file