From 9a041dbac782566ff5a7ddb1f472e587cd6663f2 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Tue, 16 Sep 2014 09:34:13 +0000 Subject: Enabled SSL --- h-source/Application/Include/hardware.php | 2 +- h-source/Application/Include/languages.php | 4 ++-- h-source/Application/Include/myFunctions.php | 14 +++++++------- h-source/Application/Include/params.php | 7 ++++--- h-source/Application/Include/wikiFormatting.php | 10 +++++----- 5 files changed, 19 insertions(+), 18 deletions(-) (limited to 'h-source/Application/Include') diff --git a/h-source/Application/Include/hardware.php b/h-source/Application/Include/hardware.php index 244515f..9ec9766 100644 --- a/h-source/Application/Include/hardware.php +++ b/h-source/Application/Include/hardware.php @@ -186,7 +186,7 @@ class Hardware { if (array_key_exists($type,self::$icons)) { - return "http://".DOMAIN_NAME."/Public/Img/".self::$icons[$type]; + return Url::getRoot()."Public/Img/".self::$icons[$type]; } return null; } diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 6d86e36..c0f127f 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -2307,12 +2307,12 @@ class Go public static function toHardwareType($type) { - return "http://".DOMAIN_NAME."/".Hardware::getControllerFromType($type)."/catalogue/".Lang::$current; + return Url::getRoot().Hardware::getControllerFromType($type)."/catalogue/".Lang::$current; } public static function toHardwareInsert($type) { - return "http://".DOMAIN_NAME."/".Hardware::getControllerFromType($type)."/insert/".Lang::$current; + return Url::getRoot().Hardware::getControllerFromType($type)."/insert/".Lang::$current; } //go to the page of one device from the id of that device diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index dc2eb9c..5cb1036 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -215,7 +215,7 @@ function getLinkToUser($user) } else { - return "$user"; + return "$user"; } } @@ -233,7 +233,7 @@ function getMotivation($row,$controller) $clean['id_hard'] = (int)$row['deletion']['id_duplicate']; $hardware = new HardwareModel(); $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - return "duplication of the model having id ".$clean['id_hard'].""; + return "duplication of the model having id ".$clean['id_hard'].""; } else { @@ -404,24 +404,24 @@ function goToModeratedItem( $row = array() ) $url = 'wiki/page/'.Lang::$current.'/'.encodeUrl(getWikiNameFromId($row['id'])); break; } - return 'http://'.DOMAIN_NAME.'/'.$url; + return Url::getRoot($url); } function getUrlsFromIdHard($id_hard) { $clean['id_hard'] = (int)$id_hard; - $urlView = "http://".DOMAIN_NAME; - $urlTalk = "http://".DOMAIN_NAME; + $urlView = $urlTalk = Url::getRoot(); + $deviceName = null; $hard = new HardwareModel(); $res = $hard->select('type,model')->where(array('id_hard'=>$clean['id_hard']))->send(); if (count($res) > 0) { - $urlView = "http://".DOMAIN_NAME."/".Hardware::$typeToController[$res[0]['hardware']['type']]."/view/".Lang::$current."/".$clean['id_hard']."/".encodeUrl($res[0]['hardware']['model']); + $urlView = Url::getRoot().Hardware::$typeToController[$res[0]['hardware']['type']]."/view/".Lang::$current."/".$clean['id_hard']."/".encodeUrl($res[0]['hardware']['model']); - $urlTalk = "http://".DOMAIN_NAME."/".Hardware::$typeToController[$res[0]['hardware']['type']]."/talk/".Lang::$current."/".$clean['id_hard']; + $urlTalk = Url::getRoot().Hardware::$typeToController[$res[0]['hardware']['type']]."/talk/".Lang::$current."/".$clean['id_hard']; $deviceName = $res[0]['hardware']['model']; } diff --git a/h-source/Application/Include/params.php b/h-source/Application/Include/params.php index 2560da8..2cb1b3f 100644 --- a/h-source/Application/Include/params.php +++ b/h-source/Application/Include/params.php @@ -76,7 +76,7 @@ class Account $siteName = Website::$generalName; $siteMail = Website::$generalMail; - $mess = gtext("Hello,\n\nyou have registered an account at")." $siteName ".gtext("with the following data:\nusername: ").$clean['username']."\n\n".gtext("in order to confirm the registration of the new account please follow the link below")."\nhttp://".DOMAIN_NAME."/users/confirm/".Lang::$current."/".$clean['id_user']."/".$clean['token']."\n\n".gtext("If you don't want to confirm the account registration\nthen wait one hour and your username and e-mail will be deleted from the database")."\n\n".gtext("If you received this e-mail for error, please simply disregard this message"); + $mess = gtext("Hello,\n\nyou have registered an account at")." $siteName ".gtext("with the following data:\nusername: ").$clean['username']."\n\n".gtext("in order to confirm the registration of the new account please follow the link below")."\n".Url::getRoot()."users/confirm/".Lang::$current."/".$clean['id_user']."/".$clean['token']."\n\n".gtext("If you don't want to confirm the account registration\nthen wait one hour and your username and e-mail will be deleted from the database")."\n\n".gtext("If you received this e-mail for error, please simply disregard this message"); $message = Swift_Message::newInstance()->setSubject('['.Website::$projectName.'] '.gtext("account registration"))->setFrom(array(Website::$fromEmail => $siteName))->setTo(array($e_mail))->setBody($mess); @@ -111,7 +111,7 @@ class Account $siteName = Website::$generalName; $siteMail = Website::$generalMail; - $mess = "Hello,\n\nyou have requested a new password for your account at $siteName.\nYour username is:\n".$clean['username']."\n\nin order to obtain a new password for your account follow the link below\nhttp://".DOMAIN_NAME."/users/change/".Lang::$current."/".$clean['id_user']."/".$clean['token']."\n\nIf you don't want to change the password then disregard this mail\n"; + $mess = "Hello,\n\nyou have requested a new password for your account at $siteName.\nYour username is:\n".$clean['username']."\n\nin order to obtain a new password for your account follow the link below\n".Url::getRoot()."users/change/".Lang::$current."/".$clean['id_user']."/".$clean['token']."\n\nIf you don't want to change the password then disregard this mail\n"; $message = Swift_Message::newInstance()->setSubject('['.Website::$projectName.'] request a new password')->setFrom(array(Website::$fromEmail => $siteName))->setTo(array($e_mail))->setBody($mess); @@ -208,7 +208,8 @@ class Account $wiki = new WikiModel(); $pageUrl = $wiki->toWikiPage($id_wiki); - $talkUrl = "http://".DOMAIN_NAME."/wiki/talk/".Lang::$current."/$id_wiki"; + $domainName = rtrim(Url::getRoot(),"/"); + $talkUrl = $domainName."/wiki/talk/".Lang::$current."/$id_wiki"; $mess = "$who has added a message to the talk page of a wiki page you have contributed to maintain at $siteName\n\nThe whole conversation is here:\n\n".$talkUrl."\n\nThe wiki page is here:\n\n".$pageUrl."\n\nBest regards\nthe ".Website::$projectName." team\n\nP.S: you can disable the mail notifications in the profile page of your control panel"; diff --git a/h-source/Application/Include/wikiFormatting.php b/h-source/Application/Include/wikiFormatting.php index e868674..6eb93f7 100644 --- a/h-source/Application/Include/wikiFormatting.php +++ b/h-source/Application/Include/wikiFormatting.php @@ -304,12 +304,12 @@ function createEnum($match) function linkToInternalPage($match) { - return "".$match[2].""; + return "".$match[2].""; } function linkToInternalPageWithText($match) { - return "".$match[3].""; + return "".$match[3].""; } function linkToWithText($match) @@ -331,7 +331,7 @@ function linkToNotebook($match) $hardware = new HardwareModel(); $clean['id_hard'] = (int)$match[2]; $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - $href = "HTTP://".DOMAIN_NAME."/notebooks/view/".Lang::$current."/".$clean['id_hard']."/$name"; + $href = Url::getRoot()."notebooks/view/".Lang::$current."/".$clean['id_hard']."/$name"; return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; } @@ -341,7 +341,7 @@ function linkToWifi($match) $hardware = new HardwareModel(); $clean['id_hard'] = (int)$match[2]; $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - $href = "HTTP://".DOMAIN_NAME."/wifi/view/".Lang::$current."/".$clean['id_hard']."/$name"; + $href = Url::getRoot()."wifi/view/".Lang::$current."/".$clean['id_hard']."/$name"; return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; } @@ -351,6 +351,6 @@ function linkToVideocard($match) $hardware = new HardwareModel(); $clean['id_hard'] = (int)$match[2]; $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - $href = "HTTP://".DOMAIN_NAME."/videocards/view/".Lang::$current."/".$clean['id_hard']."/$name"; + $href = Url::getRoot()."videocards/view/".Lang::$current."/".$clean['id_hard']."/$name"; return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; } \ No newline at end of file -- cgit v1.2.3