From b1fca288e533278729cf393c1413cd36ac69830e Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 23 Feb 2015 15:28:10 +0000 Subject: [PATCH] --- inc/commons/class.common.url.php | 8 ++-- inc/config.inc.php | 2 + inc/postconfig.inc.php | 9 +++-- inc/ws/Controlleur/class.ws.services.php | 48 ++++++++++++------------ 4 files changed, 35 insertions(+), 32 deletions(-) diff --git a/inc/commons/class.common.url.php b/inc/commons/class.common.url.php index d279e7f2c..3a3b3451a 100644 --- a/inc/commons/class.common.url.php +++ b/inc/commons/class.common.url.php @@ -429,15 +429,15 @@ class commonUrl { $res = ''; if ($ext == 'ipa') { - $res.='' . $core->typo->Telecharger('Installer') . ' '; + $res .= '' . $core->typo->Telecharger('Installer') . ' '; } - $res.= '' . $core->typo->Telecharger('Télécharger') . ''; + $res .= '' . $core->typo->Telecharger('Télécharger') . ''; return $res; } public static function manifestFromIpa($fichier) { $manifest = sha1($fichier->relPath) . '.plist'; - $res = 'http://' . $_SERVER['HTTP_HOST'] . '/cache/iosotamanifest/' . $manifest; + $res = SCHEME . '://' . $_SERVER['HTTP_HOST'] . '/cache/iosotamanifest/' . $manifest; $file = ROOT . '/cache/iosotamanifest/' . $manifest; $tmp = $file . '.info'; $ipa = $fichier->chemin; @@ -459,7 +459,7 @@ class commonUrl { $bundle = $infos['CFBundleIdentifier']; $appName = $infos['CFBundleDisplayName']; $version = $infos['CFBundleVersion']; - $ipaURL = 'http://' . $_SERVER['HTTP_HOST'] . '/telechargerr/' . self::hashFile($fichier->relPath . '//') . '/' . $fichier->relPath; + $ipaURL = SCHEME . '://' . $_SERVER['HTTP_HOST'] . '/telechargerr/' . self::hashFile($fichier->relPath . '//') . '/' . $fichier->relPath; $xml = ' diff --git a/inc/config.inc.php b/inc/config.inc.php index a69aad61a..e75a9f73e 100644 --- a/inc/config.inc.php +++ b/inc/config.inc.php @@ -3,6 +3,8 @@ define('DB_DRIVER', 'mysql'); define('DB_ENGINE', 'MyISAM'); +$scheme = isset($_SERVER['REQUEST_SCHEME']) ? $_SERVER['REQUEST_SCHEME'] : 'http'; + define('ROOT', dirname(__FILE__) . '/..'); define('WEBROOT', ''); diff --git a/inc/postconfig.inc.php b/inc/postconfig.inc.php index 20824fa27..e4573d9cb 100644 --- a/inc/postconfig.inc.php +++ b/inc/postconfig.inc.php @@ -9,6 +9,8 @@ if ($_SERVER['HTTP_HOST'] == 'workshop.studio-france.com') { $theme = 'studiofrance'; } + +define('SCHEME', $scheme); define('THEME', $theme); define('DEV', $dev); @@ -24,8 +26,8 @@ define('DB_USER', 'extranet'); define('DB_PASSWORD', 'WvcAeYBDnrB93RXa'); -define('EXTRANET_URL', 'http://extranet.cubedesigners.com'); -define('WS_URL', 'http://workshop.fluidbook.com'); +define('EXTRANET_URL', SCHEME . '://extranet.cubedesigners.com'); +define('WS_URL', SCHEME . '://workshop.fluidbook.com'); if ($ws) { @@ -34,7 +36,7 @@ if ($ws) { define('MODE', 'extranet'); } -define('STATIC_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . WEBROOT); +define('STATIC_SERVER', SCHEME . '://' . $_SERVER['HTTP_HOST'] . WEBROOT); define('CSS_PATH', WEBROOT . '/style/' . MODE); define('STYLE', CSS_PATH); @@ -52,4 +54,3 @@ if (THEME) { define('TYPOGRAPHP_PATH', ROOT . '/typo/' . MODE); define('TYPOGRAPHP_WEBROOT', IMG . '/typographp'); -?> \ No newline at end of file diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index 6c7b86acc..6c0f743ee 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -65,7 +65,7 @@ class wsServices extends cubeFlashGateway { foreach ($bookmarks as $b) { $range = $b['page']; if ($b['nb'] > 1) { - $range.='-' . ($b['page'] + $b['nb'] - 1); + $range .= '-' . ($b['page'] + $b['nb'] - 1); } $file = $this->getPDFComplex($this->args['id'], $range); @@ -96,7 +96,7 @@ class wsServices extends cubeFlashGateway { } } else { $group[] = $f; - $groupsize+=$size; + $groupsize += $size; } } @@ -263,7 +263,7 @@ class wsServices extends cubeFlashGateway { if (!isset($res[$page])) { $res[$page] = 0; } - $res[$page]+=$f; + $res[$page] += $f; } } $this->xml->addChild('results', json_encode($res)); @@ -411,7 +411,7 @@ class wsServices extends cubeFlashGateway { $this->outputXML = false; $res = ' - + @@ -502,10 +502,10 @@ class wsServices extends cubeFlashGateway { } $fields = array('Civilité' => 'civilite', 'Prénom' => 'prenom', 'Nom' => 'nom', - 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville', - 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie', - 'Type de logement' => 'logement', 'Echéance travaux' => 'echeance', - 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires', 'Coupons sélectionnés' => 'reflist'); + 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville', + 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie', + 'Type de logement' => 'logement', 'Echéance travaux' => 'echeance', + 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires', 'Coupons sélectionnés' => 'reflist'); $mail = new cubeMail(); $mail->charset = 'UTF-8'; @@ -519,7 +519,7 @@ class wsServices extends cubeFlashGateway { $body = ''; foreach ($fields as $k => $f) { - $body.=$k . ' : ' . $this->args[$f] . "\r\n"; + $body .= $k . ' : ' . $this->args[$f] . "\r\n"; $datas[$f] = $this->args[$f]; } $datas['date'] = TIME; @@ -549,7 +549,7 @@ class wsServices extends cubeFlashGateway { foreach ($refs as $ref) { foreach ($xml->xpath('//item[@reference=\'' . $ref . '\']') as $item) { - $code = (string) $item['code']; + $code = (string)$item['code']; } $file = $couponsRoot . $ref . '.pdf'; @@ -590,46 +590,46 @@ class wsServices extends cubeFlashGateway { $xml = simplexml_load_file($couponsRoot . 'references.xml'); $cols = array('Date' => 'date', 'Civilité' => 'civilite', 'Prénom' => 'prenom', 'Nom' => 'nom', - 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville', - 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie', 'Type de logement' => 'logement', - 'Echéance travaux' => 'echeance', - 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires'); + 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville', + 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie', 'Type de logement' => 'logement', + 'Echéance travaux' => 'echeance', + 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires'); $refs = array(); foreach ($xml->xpath('//item') as $i) { - $refs[(string) $i['reference']] = $i['name']; + $refs[(string)$i['reference']] = $i['name']; } // $h = ''; - $h.=''; + $h .= ''; foreach ($cols as $l => $k) { - $h.=''; + $h .= ''; } foreach ($refs as $k => $l) { - $h.=''; + $h .= ''; } - $h.=''; + $h .= ''; $r = $core->con->select('SELECT * FROM grdf' . $annee); while ($r->fetch()) { $d = json_decode($r->datas); $rl = explode(',', $d->reflist); - $h.=''; + $h .= ''; foreach ($cols as $l => $k) { $v = $d->$k; if ($k == 'date') { $v = date('Y-m-d H:i', $v); } - $h.=''; + $h .= ''; } foreach ($refs as $k => $l) { $v = in_array($k, $rl) ? '1' : '0'; - $h.=''; + $h .= ''; } - $h.=''; + $h .= ''; } - $h.='
' . utf8_decode($l) . '' . utf8_decode($l) . '' . utf8_decode($l) . '' . utf8_decode($l) . '
' . utf8_decode($v) . '' . utf8_decode($v) . '' . utf8_decode($v) . '' . utf8_decode($v) . '
'; + $h .= ''; if (!file_exists(ROOT . '/cache/12568/')) { mkdir(ROOT . '/cache/12568/', 0777, true); -- 2.39.5