aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2014-09-16 09:34:13 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2014-09-16 09:34:13 +0000
commit9a041dbac782566ff5a7ddb1f472e587cd6663f2 (patch)
tree5754879e041bb7e226d1f1df7e1d3e6789b2e3c0
parent11972639df8315753123ebccdadee1f596807ad0 (diff)
Enabled SSL
-rw-r--r--h-source/Application/Controllers/IssuesController.php3
-rw-r--r--h-source/Application/Controllers/UsersController.php3
-rw-r--r--h-source/Application/Controllers/WikiController.php15
-rw-r--r--h-source/Application/Include/hardware.php2
-rw-r--r--h-source/Application/Include/languages.php4
-rw-r--r--h-source/Application/Include/myFunctions.php14
-rw-r--r--h-source/Application/Include/params.php7
-rw-r--r--h-source/Application/Include/wikiFormatting.php10
-rw-r--r--h-source/Application/Models/TalkModel.php3
-rwxr-xr-xh-source/Application/Models/UsersModel.php2
-rw-r--r--h-source/Application/Models/WikiModel.php2
-rw-r--r--h-source/Application/Models/WikitalkModel.php2
-rw-r--r--h-source/Application/Views/Desktop/Rss/modifications.php2
-rw-r--r--h-source/Application/Views/Desktop/Rss/notapproved.php2
-rw-r--r--h-source/Public/Css/main.css84
-rw-r--r--h-source/tables.sql4
16 files changed, 123 insertions, 36 deletions
diff --git a/h-source/Application/Controllers/IssuesController.php b/h-source/Application/Controllers/IssuesController.php
index 87b10d0..9c7b799 100644
--- a/h-source/Application/Controllers/IssuesController.php
+++ b/h-source/Application/Controllers/IssuesController.php
@@ -151,7 +151,8 @@ class IssuesController extends BaseController
$this->m['IssuesModel']->values = array('update_date' => date('Y-m-d H:i:s'));
$this->m['IssuesModel']->update($clean['id_issue']);
- header('Refresh: 0;url=http://'.DOMAIN_NAME.$_SERVER['REQUEST_URI']);
+ $domainName = rtrim(Url::getRoot(),"/");
+ header('Refresh: 0;url='.$domainName.$_SERVER['REQUEST_URI']);
exit;
}
}
diff --git a/h-source/Application/Controllers/UsersController.php b/h-source/Application/Controllers/UsersController.php
index 3c3520c..c324804 100644
--- a/h-source/Application/Controllers/UsersController.php
+++ b/h-source/Application/Controllers/UsersController.php
@@ -70,7 +70,8 @@ class UsersController extends BaseController
if (strcmp($redirect,'') !== 0)
{
$redirect = html_entity_decode($redirect,ENT_QUOTES,DEFAULT_CHARSET);
- header('Location: http://'.DOMAIN_NAME."/".$redirect);
+ $domainName = rtrim(Url::getRoot(),"/");
+ header('Location:'.$domainName."/".$redirect);
}
else
{
diff --git a/h-source/Application/Controllers/WikiController.php b/h-source/Application/Controllers/WikiController.php
index 698519b..5dc05b8 100644
--- a/h-source/Application/Controllers/WikiController.php
+++ b/h-source/Application/Controllers/WikiController.php
@@ -62,7 +62,8 @@ class WikiController extends BaseController
if ($this->m['WikiModel']->queryResult)
{
- header('Location: http://'.DOMAIN_NAME.'/wiki/page/'.$this->lang.'/'.$this->m['WikiModel']->lastTitleClean);
+ $domainName = rtrim(Url::getRoot(),"/");
+ header('Location: '.$domainName.'/wiki/page/'.$this->lang.'/'.$this->m['WikiModel']->lastTitleClean);
die();
}
}
@@ -126,7 +127,8 @@ class WikiController extends BaseController
if ($this->m['WikiModel']->queryResult)
{
- header('Location: http://'.DOMAIN_NAME.'/wiki/page/'.$this->lang.'/'.$this->m['WikiModel']->lastTitleClean);
+ $domainName = rtrim(Url::getRoot(),"/");
+ header('Location: '.$domainName.'/wiki/page/'.$this->lang.'/'.$this->m['WikiModel']->lastTitleClean);
die();
}
}
@@ -149,7 +151,8 @@ class WikiController extends BaseController
}
else
{
- header('Location: http://'.DOMAIN_NAME."/users/login/".$this->lang."?redirect=".$this->controller."/page/".$this->lang."/".titleForRedirect($title));
+ $domainName = rtrim(Url::getRoot(),"/");
+ header('Location: '.$domainName."/users/login/".$this->lang."?redirect=".$this->controller."/page/".$this->lang."/".titleForRedirect($title));
die();
}
}
@@ -213,7 +216,8 @@ class WikiController extends BaseController
$clean['idWiki'] = $rev->getIdPage($res_rev[0]['wiki_revisions']['id_rev']);
$newTitle = $this->m['WikiModel']->getTheModelName($clean['idWiki']);
$n = titleForRedirect($newTitle);
- header('Location: http://'.DOMAIN_NAME.'/wiki/page/'.$this->lang.'/'.$n);
+ $domainName = rtrim(Url::getRoot(),"/");
+ header('Location: '.$domainName.'/wiki/page/'.$this->lang.'/'.$n);
die();
}
else
@@ -439,7 +443,8 @@ class WikiController extends BaseController
if ($this->m['WikiModel']->queryResult)
{
- header('Location: http://'.DOMAIN_NAME.'/wiki/page/'.$this->lang.'/'.$this->m['WikiModel']->lastTitleClean);
+ $domainName = rtrim(Url::getRoot(),"/");
+ header('Location: '.$domainName.'/wiki/page/'.$this->lang.'/'.$this->m['WikiModel']->lastTitleClean);
die();
}
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 "<a href='http://".DOMAIN_NAME."/meet/user/".Lang::$current."/$user'>$user</a>";
+ return "<a href='".Url::getRoot()."meet/user/".Lang::$current."/$user'>$user</a>";
}
}
@@ -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 "<b>duplication</b> of the model having id <b><a href='http://".DOMAIN_NAME."/".$controller."/view/".Lang::$current."/".$clean['id_hard']."/".$name."'>".$clean['id_hard']."</a></b>";
+ return "<b>duplication</b> of the model having id <b><a href='".Url::getRoot().$controller."/view/".Lang::$current."/".$clean['id_hard']."/".$name."'>".$clean['id_hard']."</a></b>";
}
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 "<a title = '".$match[2]."' href='http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($match[2])."'>".$match[2]."</a>";
+ return "<a title = '".$match[2]."' href='".Url::getRoot()."wiki/page/".Lang::$current."/".encodeUrl($match[2])."'>".$match[2]."</a>";
}
function linkToInternalPageWithText($match)
{
- return "<a title = '".$match[2]."' href='http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($match[2])."'>".$match[3]."</a>";
+ return "<a title = '".$match[2]."' href='".Url::getRoot()."wiki/page/".Lang::$current."/".encodeUrl($match[2])."'>".$match[3]."</a>";
}
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) ? "<a title = 'link to notebook $name: $href' href='$href'>".$name."</a>" : $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) ? "<a title = 'link to wifi card $name: $href' href='$href'>".$name."</a>" : $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) ? "<a title = 'link to video card $name: $href' href='$href'>".$name."</a>" : $match[0];
} \ No newline at end of file
diff --git a/h-source/Application/Models/TalkModel.php b/h-source/Application/Models/TalkModel.php
index 0edcdda..1d15ab7 100644
--- a/h-source/Application/Models/TalkModel.php
+++ b/h-source/Application/Models/TalkModel.php
@@ -96,7 +96,8 @@ class TalkModel extends BaseModel {
//send the notice
Account::sendTalkNotice($myName,$ffusers,$clean['id_hard']);
- header('Refresh: 0;url=http://'.DOMAIN_NAME.$_SERVER['REQUEST_URI']);
+ $domainName = rtrim(Url::getRoot(),"/");
+ header('Refresh: 0;url='.$domainName.$_SERVER['REQUEST_URI']);
exit;
}
}
diff --git a/h-source/Application/Models/UsersModel.php b/h-source/Application/Models/UsersModel.php
index ea19a7b..e666e36 100755
--- a/h-source/Application/Models/UsersModel.php
+++ b/h-source/Application/Models/UsersModel.php
@@ -102,7 +102,7 @@ class UsersModel extends Model_Map
}
else
{
- return "<a href='http://".DOMAIN_NAME."/meet/user/".Lang::$current."/$user'>$user</a>";
+ return "<a href='".Url::getRoot()."meet/user/".Lang::$current."/$user'>$user</a>";
}
}
diff --git a/h-source/Application/Models/WikiModel.php b/h-source/Application/Models/WikiModel.php
index 6dc9fd1..bb60b66 100644
--- a/h-source/Application/Models/WikiModel.php
+++ b/h-source/Application/Models/WikiModel.php
@@ -309,7 +309,7 @@ class WikiModel extends Model_Map {
{
$clean['id'] = (int)$id;
$title = $this->getTheModelName($clean['id'], true);
- return "http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".$title;
+ return Url::getRoot()."wiki/page/".Lang::$current."/".$title;
}
public function getDiffArray($oldArray, $newArray)
diff --git a/h-source/Application/Models/WikitalkModel.php b/h-source/Application/Models/WikitalkModel.php
index 8739984..7dee896 100644
--- a/h-source/Application/Models/WikitalkModel.php
+++ b/h-source/Application/Models/WikitalkModel.php
@@ -94,7 +94,7 @@ class WikitalkModel extends BaseModel
//send the notice
Account::sendWikiTalkNotice($myName,$ffusers,$clean['id_wiki']);
- header('Refresh: 0;url=http://'.DOMAIN_NAME."/wiki/talk/".Lang::$current."/".$clean['id_wiki']);
+ header('Refresh: 0;url='.Url::getRoot()."wiki/talk/".Lang::$current."/".$clean['id_wiki']);
exit;
}
}
diff --git a/h-source/Application/Views/Desktop/Rss/modifications.php b/h-source/Application/Views/Desktop/Rss/modifications.php
index addc483..0a9100b 100644
--- a/h-source/Application/Views/Desktop/Rss/modifications.php
+++ b/h-source/Application/Views/Desktop/Rss/modifications.php
@@ -4,7 +4,7 @@
<channel>
<title><?php echo Website::$generalName;?></title>
-<link><?php echo "http://".DOMAIN_NAME;?></link>
+<link><?php echo Url::getRoot();?></link>
<description><?php echo gtext("Database modifications");?></description>
<?php
diff --git a/h-source/Application/Views/Desktop/Rss/notapproved.php b/h-source/Application/Views/Desktop/Rss/notapproved.php
index 8458c9d..dec338b 100644
--- a/h-source/Application/Views/Desktop/Rss/notapproved.php
+++ b/h-source/Application/Views/Desktop/Rss/notapproved.php
@@ -4,7 +4,7 @@
<channel>
<title><?php echo Website::$generalName;?></title>
-<link><?php echo "http://".DOMAIN_NAME;?></link>
+<link><?php echo Url::getRoot();?></link>
<description><?php echo gtext("Device pages that have to be approved");?></description>
<?php foreach ($table as $row) { ?>
diff --git a/h-source/Public/Css/main.css b/h-source/Public/Css/main.css
index 267cfd5..2d84e59 100644
--- a/h-source/Public/Css/main.css
+++ b/h-source/Public/Css/main.css
@@ -579,9 +579,8 @@ div.history_page_list_news a
font-weight:bold;
font: bold 13px/1 sans-serif,arial;
}
-
+/*
ul#menuBlock {
-/* float:right; */
float:left;
margin:0px;
padding:0px;
@@ -600,10 +599,8 @@ ul#menuBlock li {
float:left;
margin-left:3px;
width:139px;
-/* height:22px; */
text-align:center;
background: url('../Img/popup_back.png') no-repeat top left;
-/* background:#FFA500; */
}
ul#menuBlock li a {
@@ -628,9 +625,88 @@ ul#menuBlock li ul li {
background:#ffef84;
border-top:1px solid #ec8459;
padding:3px 0;
+}*/
+
+
+ul.menuBlock {
+ float:left;
+ margin:0px;
+ padding:0px;
+ list-style:none;
+ height:25px;
+ font-size:11px;
+ cursor:pointer;
+}
+ul.menuBlock li {
+ position:relative;
+ display:block;
+ float:left;
+ margin-left:3px;
+ width:139px;
+ min-height:22px;
+ text-align:left;
+ background:#ffffff;
+ padding-top:3px;
+ text-align:center;
+ background: url('../Img/popup_back.png') no-repeat top left;
+}
+ul.menuBlock > li
+{
+ border:1px solid #D3D3D3;
+}
+ul.menuBlock li ul li
+{
+/* width:201px; */
+ cursor:default;
+ width:140px;
+}
+/*ul.menuBlock li.inner_item_id_c {
+ width:300px;
+}*/
+ul.menuBlock li a {
+ color:#000000;
+ font: normal 12px/1 sans-serif,arial;
}
+ul.menuBlock li ul {
+ margin:0px;
+ padding:0px;
+ list-style:none;
+ position:absolute;
+ top:24px;
+ left:-4px;
+ display:none;
+}
+
+ul.menuBlock:hover li ul
+{
+ display:block;
+}
+
+ul.menuBlock li ul li {
+ background:#ffef84;
+ border-top:1px solid #ec8459;
+ padding:3px 0;
+}
+/*.viewall_popup_menu_status
+{
+ clear:left;
+ width:825px;
+ overflow:hidden;
+ margin-left:100px;
+ text-align:center;
+}
+.viewall_popup_menu_status_item
+{
+ width:150px;
+ float:left;
+ margin-left:3px;
+ color:#FF4500;
+ font-weight:bold;
+ margin-top:5px;
+ font: bold 13px/1 sans-serif,arial;
+}*/
/*view files with differences*/
.diff_ext_box
{
diff --git a/h-source/tables.sql b/h-source/tables.sql
index 5943806..6b0f6d6 100644
--- a/h-source/tables.sql
+++ b/h-source/tables.sql
@@ -599,4 +599,6 @@ insert into reggroups (name) values ('moderator');
insert into regusers (username,password) values ('admin',sha1('admin'));
-insert into regusers_groups (id_user, id_group) values (1,1); \ No newline at end of file
+insert into regusers_groups (id_user, id_group) values (1,1);
+insert into regusers_groups (id_user, id_group) values (1,2);
+insert into regusers_groups (id_user, id_group) values (1,3); \ No newline at end of file