$args = cubePage::getArgs($args);\r
// Si l'utilisateur n'est pas connecté, on affiche le formulaire\r
// de login\r
- if ((!isset($args[0]) || $args[0] != 'stats') && (is_null($core->user) || !$core->user)) {\r
+ \r
+ $bypass=array('stats','telecharger','telechargerr');\r
+ \r
+ if ((!isset($args[0]) || !in_array($args[0],$bypass)) && (is_null($core->user) || !$core->user)) {\r
$args = array('login');\r
} else {\r
if (isset($args[0]) && $args[0] == 'login') {\r
$bundle = $infos['CFBundleIdentifier'];\r
$appName = $infos['CFBundleDisplayName'];\r
$version = $infos['CFBundleVersion'];\r
- $ipaURL = 'http://' . $_SERVER['HTTP_HOST'] . '/telecharger/' . self::hashFile($fichier->relPath . '//') . '/' . $fichier->relPath;\r
+ $ipaURL = 'http://' . $_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
return sha1('!!//' . $path . '||--');\r
}\r
\r
- public static function telecharger($args) {\r
-\r
+ public static function telechargerr($args) {\r
+ return self::telecharger($args, true);\r
+ }\r
\r
+ public static function telecharger($args, $relay = false) {\r
array_shift($args);\r
$hash = array_shift($args);\r
$path = implode('/', $args);\r
\r
$dir = md5($path . (rand(1, 235548684) * 50.5));\r
\r
- @mkdir(ROOT . '/cache/download/' . $dir, 0755, true);\r
- copy(FTPROOT . $path, ROOT . '/cache/download/' . $dir . '/' . $nom);\r
+ if ($relay) {\r
+ files::$mimeType['ipa'] = 'application/octet-stream';\r
\r
- http::redirect(WEBROOT . '/cache/download/' . $dir . '/' . $nom);\r
+ cubeHTTP::relayFile(FTPROOT . $path);\r
+ } else {\r
+ @mkdir(ROOT . '/cache/download/' . $dir, 0755, true);\r
+ copy(FTPROOT . $path, ROOT . '/cache/download/' . $dir . '/' . $nom);\r
+ http::redirect('/cache/download/' . $dir . '/' . $nom);\r
+ }\r
}\r
\r
public static function upload($args) {\r