Commit 16cd098a authored by Seblu's avatar Seblu

disable logging in http

disable loggin in http on connection page
enforce https on connexion button on index page
disconnect user if it's not in https (dropping if loosing ssl)
delete photo directory and admin page and links in admin page
delete admin page of forum
fix redirect on blacklist site
fix indentation and trailing whitespace in some files
add a sexy redirection function found on http://php.net/manual/fr/function.header.php
add link to munin and phpmyadmin in admin link
fix fucking bad color #d3d3df by #303030 in all admin pages !
svn ignore include/db_connect.php
parent 326b5826
......@@ -40,7 +40,7 @@ $str = '
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
......@@ -146,7 +146,7 @@ $str = '
</FORM>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
......@@ -226,7 +226,7 @@ function dispAdminAddBlacklist() {
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<form name="saisie" method="post" action="index.php?section=AdminHome&section_admin=AddBlacklist">
......@@ -297,7 +297,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......@@ -394,7 +394,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......
......@@ -36,7 +36,7 @@ $str = '
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="2" cellspacing="2" width="100%">
<tr>
<td>
......@@ -132,7 +132,7 @@ function dispAdminAddEdito () {
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<form name="saisie" method="post" action="index.php?section=AdminHome&section_admin=AddEdito&edito_id='.$edito_id.'">
......@@ -196,7 +196,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......@@ -283,7 +283,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......
<?
function dispAdminForum () {
if ($_SESSION["user_right"] < $GLOBALS["EPTV"] )
{
return("t'es ouf");
}
$str = 'Bon voici le forum pour pas y passer des annees entier a le faire marcher en interne <br><br><a href="http://www.link-asso.com/~eptv/forum">OKAY?</a>';
return $str;
}
?>
\ No newline at end of file
......@@ -6,10 +6,8 @@ include_once "admin/admin_tables.php";
include_once "admin/functions_sql_admin.php";
include_once "admin/admin_menu.php";
include_once "admin/admin_videos.php";
include_once "admin/admin_photos.php";
include_once "admin/admin_news.php";
include_once "admin/admin_edito.php";
include_once "admin/admin_forum.php";
include_once "admin/admin_links.php";
include_once "admin/admin_members.php";
include_once "admin/admin_users.php";
......@@ -25,7 +23,7 @@ $str = '
<table width="100%">
<tr>
<td height="589" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td width="20%" valign="top">
......@@ -39,16 +37,16 @@ $str = '
<b>
<font color="#ffffff">
&nbsp;a d m i n
</font>
</b>
</font>
</b>
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table width="100%" cellpadding="2" cellspacing="2" align="center">';
$str .= dispAdminMenu();
$str .= '
</table>
</td>
......@@ -58,7 +56,7 @@ $str .= '
</tr>
</table>
</td>
<td width="85%" valign="top" align="center">
';
......@@ -70,7 +68,7 @@ $str .= '
else
{
$total_size_videos = 0;
$nb_videos_publics = 0;
$nb_videos_tendus = 0;
......@@ -100,36 +98,6 @@ $str .= '
;}
$total_size_photos = 0;
$nb_photos_publics = 0;
$nb_photos_tendus = 0;
$nb_photos_privates = 0;
$nb_photos_eptv = 0;
$nb_photos_bonus = 0;
$nb_photos_adm = 0;
$result = getAllPhotos();
for ($nb_photos = 0; $photo = mysql_fetch_array($result); $nb_photos++) {
$total_size_photos += $photo["photo_size"];
if ($photo["photo_tendu"] == '0')
$nb_photos_publics++;
else if ($photo["photo_tendu"] == '1')
$nb_photos_tendus++;
else if ($photo["photo_tendu"] == '2')
$nb_photos_privates++;
if ($photo["photo_type"] == 'eptvprod')
$nb_photos_eptv++;
else if ($photo["photo_type"] == 'eptvbonus')
$nb_photos_bonus++;
else if ($photo["photo_type"] == 'eptv.adm')
$nb_photos_adm++;
;}
$result = getLastNews(2);
for ($nb_news = 0; $news = mysql_fetch_array($result); $nb_news++) {
;}
......@@ -148,7 +116,7 @@ $str .= '
$result = getAllUsers();
for ($nb_users = 0; $user = mysql_fetch_array($result); $nb_users++) {
if ($user["user_right"] == 1)
$nb_users_basics++;
else if ($user["user_right"] == 2)
......@@ -169,7 +137,7 @@ $str .= '
$str .= '
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#000000">
......@@ -180,12 +148,12 @@ $str .= '
<font color="#ffffff">
&nbsp w e l c o m e &nbsp t o &nbsp a d m i n i s t r a c h e u n
</font>
</b>
</b>
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
......@@ -197,7 +165,7 @@ $str .= '
<TD><b>
Nombre total de Vid&eacute;os:
</b></TD>
<TD><b>'
<TD><b>'
.$nb_videos.
'</b></TD>
</TR>
......@@ -267,90 +235,11 @@ $str .= '
<TR><TD></TD></TR>
<TR>
<TD><b>
Nombre total d\'Albums Photos:
</b></TD>
<TD><b>'
.$nb_photos.
'</b></TD>
</TR>
<TR>
<TD><small>
&nbsp &nbsp Nombre total de Photos:
</small></TD>
<TD align=left><small>'
.$total_size_photos.
' Img</small></TD>
</TR>
<TR>
<TD><small>
&nbsp &nbsp Nombre d\'Albums Photos Publics:
</small></TD>
<TD align=left><small>'
.$nb_photos_publics.
'</small></TD>
</TR>
<TR>
<TD><small>
&nbsp &nbsp Nombre d\'Albums Photos Tendus:
</small></TD>
<TD align=left><small>'
.$nb_photos_tendus.
'</small></TD>
</TR>
<TR>
<TD><small>
&nbsp &nbsp Nombre d\'Albums Photos Priv&eacute;es:
</small></TD>
<TD align=left><small>'
.$nb_photos_privates.
'</small></TD>
</TR>
<TR><TD></TD></TR>
<TR>
<TD><small>
&nbsp &nbsp Nombre d\'Albums Photos Eptv:
</small></TD>
<TD align=left><small>'
.$nb_photos_eptv.
'</small></TD>
</TR>
<TR>
<TD><small>
&nbsp &nbsp Nombre d\'Albums Photos Bonus:
</small></TD>
<TD align=left><small>'
.$nb_photos_bonus.
'</small></TD>
</TR>
<TR>
<TD><small>
&nbsp &nbsp Nombre d\'Albums Photos .Adm:
</small></TD>
<TD align=left><small>'
.$nb_photos_adm.
'</small></TD>
</TR>
<TR><TD></TD></TR>
<TR>
<TD><b>
Nombre total de News:
</b></TD>
<TD><b>'
<TD><b>'
.$nb_news.
'</b></TD>
</TR>
......@@ -445,7 +334,7 @@ $str .= '
</td>
</tr>
</table>
';
......@@ -459,9 +348,9 @@ $str .= '
</table>
</td>
</tr>
</table>
</table>
';
......@@ -473,18 +362,18 @@ $str = '
<table width="100%">
<tr>
<td width="85%" valign="top" align="center">
<BR>
<b>
Arf, pas tout de suite...
Arf, pas tout de suite...
</b>
</td>
</tr>
</tr>
</table>
</tr>
</table>
';
}
......
......@@ -32,7 +32,7 @@ $str = '
</FORM>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
......@@ -128,7 +128,7 @@ function dispAdminAddLink() {
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<form name="saisie" method="post" action="index.php?section=AdminHome&section_admin=AddLink&element_id='.$element_id.'">
......@@ -187,7 +187,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......@@ -258,7 +258,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......
......@@ -46,7 +46,7 @@ function dispAdminMembers () {
$str .= '
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
......@@ -202,7 +202,7 @@ function dispAdminAddMember() {
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<form name="saisie" method="post" action="index.php?section=AdminHome&section_admin=AddMember&element_id='.$element_id.'">
......@@ -352,7 +352,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......@@ -537,7 +537,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......
......@@ -2,8 +2,6 @@
function dispAdminMenu() {
$str = '
</TR>
......@@ -18,9 +16,6 @@ $str = '
}
$str .= '
<div>
<a href="index.php?section=AdminHome&section_admin=AdminPhotos" class="texte_link">Photos</a>
</div>
<div>
<a href="index.php?section=AdminHome&section_admin=AdminNews" class="texte_link">News</a>
</div>
......@@ -28,7 +23,7 @@ $str = '
if ($_SESSION["user_right"] >= $GLOBALS["EPTV"]) {
$str .= '
<div>
<div>
<a href="index.php?section=AdminHome&section_admin=AdminEdito" class="texte_link">Edito</a>
</div>
<div>
......@@ -44,7 +39,10 @@ $str = '
<a href="index.php?section=AdminHome&section_admin=AdminBlacklist" class="texte_link">Blacklist</a>
</div>
<div>
<a href="stats/awstats.eptv.html" class="texte_link">WWW Stats</a>
<a href="munin/" target="_blank" class="texte_link">Munin</a>
</div>
<div>
<a href="phpmyadmin/" target="_blank" class="texte_link">PHPMyAdmin</a>
</div>
';
......
......@@ -33,7 +33,7 @@ $str = '
</FORM>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
......@@ -176,7 +176,7 @@ function dispAdminAddNews() {
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<form name="saisie" method="post" action="index.php?section=AdminHome&section_admin=AddNews&news_id='.$news_id.'">
......@@ -254,7 +254,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......@@ -348,7 +348,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......
This diff is collapsed.
......@@ -12,15 +12,6 @@ $tab_section_admin[ModifVideo] = adminModifVideo; // sql modif a video
$tab_section_admin[AdminDelVideos] = dispAdminDelVideos; // disp admin delete a video
$tab_section_admin[DelVideo] = adminDeleteVideo; // sql delete a video
$tab_section_admin[AdminPhotos] = dispAdminPhotos;
$tab_section_admin[AdminPhotosSolos] = dispAdminPhotosSolos; // disp admin Photos solos
$tab_section_admin[AdminAddPhotos] = dispAdminAddPhotos; // disp admin add a Photo
$tab_section_admin[AddPhoto] = adminAddPhoto; // sql add a Photo
$tab_section_admin[AdminModifPhotos] = dispAdminModifPhotos; // disp admin modif a Photo
$tab_section_admin[ModifPhoto] = adminModifPhoto; // sql modif a Photo
$tab_section_admin[AdminDelPhotos] = dispAdminDelPhotos; // disp admin delete a Photo
$tab_section_admin[DelPhoto] = adminDeletePhoto; // sql delete a Photo
$tab_section_admin[AdminNews] = dispAdminNews;
$tab_section_admin[AdminAddNews] = dispAdminAddNews; // disp admin add a news
$tab_section_admin[AddNews] = adminAddNews; // sql add a news
......@@ -29,8 +20,6 @@ $tab_section_admin[ModifNews] = adminModifNews; // sql modif a news
$tab_section_admin[AdminDelNews] = dispAdminDelNews; // disp admin delete a news
$tab_section_admin[DelNews] = adminDeleteNews; // sql delete a news
$tab_section_admin[AdminEdito] = dispAdminEdito;
$tab_section_admin[AdminAddEdito] = dispAdminAddEdito; // disp admin add an edito
$tab_section_admin[AddEdito] = adminAddEdito; // sql add an edito
......
......@@ -47,7 +47,7 @@ $str = '
$str .= '
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
......@@ -146,7 +146,7 @@ function dispAdminAddUser() {
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<form name="saisie" method="post" action="index.php?section=AdminHome&section_admin=AddUser&element_id='.$element_id.'">
......@@ -254,7 +254,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......@@ -371,7 +371,7 @@ $str = '
</td>
</tr>
<tr>
<td bgcolor="#d3d3df">
<td bgcolor="#303030">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
';
......
This diff is collapsed.
......@@ -7,13 +7,13 @@ body
margin: 0px;
padding: 0px;
font-size: 11px;
color: #CCCCCC;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
color: #CCCCCC;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
}
* {
* {
margin: 0;
padding: 0;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
}
ul, li {
list-style-type: none;
......@@ -37,7 +37,7 @@ img {
.copyrights {
color: #646464;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
text-align: center;
margin: 10px 0px 0px 0px;
}
......@@ -51,7 +51,7 @@ img {
background: #303030;
top: 0px;
width: 901px;
margin: 0 auto;
margin: 0 auto;
}
#main_body {
......@@ -116,7 +116,7 @@ div.top_box
color: #B8B8B8;
padding: 8px 0px 0px 0px;
font-size: 13px;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
text-decoration: none;
text-align: center;
}
......@@ -126,7 +126,7 @@ div.top_box
height: 22px;
color: #99FF33;
font-size: 13px;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
text-decoration: none;
text-align: center;
}
......@@ -185,7 +185,7 @@ div#newsbox li {
div#newsbox h1 {
height: 26px;
font-size: 14px;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
padding: 10px;
background: #1D1D1D;
color: #B8B8B8;
......@@ -224,7 +224,7 @@ div.rightbox li {
div.rightbox h1 {
height: 26px;
font-size: 14px;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
padding: 10px;
background: #1D1D1D;
color: #B8B8B8;
......@@ -263,7 +263,7 @@ div.rightbox h1 {
padding: 0px 0px 5px 20px;
}
#left_side h3 {
#left_side h3 {
color: #aaa28b;
margin: 10px 0px 0px 0px;
padding: 0px 0px 0px 5px;
......@@ -313,15 +313,15 @@ div#menu
margin: 10px 0px 0px 0px;
padding: 0px 0px 0px 5px;
font-size: 12px;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
}
#right_side h3 {
#right_side h3 {
color: #aaa28b;
margin: 10px 0px 0px 0px;
padding: 0px 0px 0px 5px;
font-size: 12px;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
}
......@@ -420,8 +420,7 @@ a {
color: #cccccc;
}
table a.texte_link,
table
table a.texte_link,table
{
color: #FFFFFF;
}
......
......@@ -70,5 +70,23 @@ function get_time(){ // r
return($time);
}
//Try PHP header redirect, then Java redirect, then try http redirect.:
function redirect($url) {
if (!headers_sent()) {
//If headers not sent yet... then do php redirect
header('Location: '.$url);
exit;
}
else {
//If headers are sent... do java redirect... if java disabled, do html redirect.
echo '<script type="text/javascript">';
echo 'window.location.href="'.$url.'";';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
echo '</noscript>';
exit;
}
}
?>
\ No newline at end of file
<?
function dispMenu() {
$str = '<div id="menu"><ul>';
$str .= '<li><a href="index.php?section=Home" id="tabs_home" title="Accueil du site"><strong>Home</strong></a></li>';
$str .= '<li><a href="index.php?section=Videos" id="tabs_members" title="Nos videos"><strong>Vid&eacute;os</strong></a></li>';
#$str .= '<li><a href="index.php?section=Jukebox" id="tabs_cours" title="Le jukebox"><strong>Jukebox</strong></a></li>';
$str .= '<li><a href="index.php?section=Photos" id="tabs_cours" title="Nos Photos"><strong>Photos</strong></a></li>';
$str .= '<li><a href="index.php?section=Members" id="tabs_cours" title="Nos Membres"><strong>Membres</strong></a></li>';
if ($_SESSION["user_right"] >= 5) {
$str .= '<li><a href="index.php?section=AdminHome" id="tabs_cours" title="Toutes nos realisations"><strong>Admin</strong></a></li>';
$str = '<div id="menu"><ul>';
$str .= '<li><a href="index.php?section=Home" id="tabs_home" title="Accueil du site"><strong>Home</strong></a></li>';
$str .= '<li><a href="index.php?section=Videos" id="tabs_members" title="Nos videos"><strong>Vid&eacute;os</strong></a></li>';
$str .= '<li><a href="index.php?section=Members" id="tabs_cours" title="Nos Membres"><strong>Membres</strong></a></li>';
if ($_SESSION["user_right"] >= 5)
$str .= '<li><a href="index.php?section=AdminHome" id="tabs_cours" title="Toutes nos realisations"><strong>Admin</strong></a></li>';
$str .= '<li><a href="index.php?section=Contacts" id="tabs_releases" title="Contactez nous"><strong>Contact</strong></a></li>';
$str .= '</ul>';
// connexion button
$str .= '&nbsp;<img alt="" src="images/puce.png" />&nbsp;&nbsp;';
$str .= '<a href="https://'.$_SERVER['HTTP_HOST'].'/index.php?section=Connection">';
$str .= (($_SESSION["user_right"] > $GLOBALS["ANONYM"]) ? "D&eacute;connexion" : "Connexion");
$str .= '</a>';
$str .= "</div>";
echo $str;
}
$str .= '<li><a href="index.php?section=Contacts" id="tabs_releases" title="Contactez nous"><strong>Contact</strong></a></li>';
#$str .= '<li><a href="eptvforum/" id="tabs_releases" title="Le forum"><strong>Forum</strong></a></li>';
$str .= '</ul>';
$str .= '&nbsp;<img alt="" src="images/puce.png" /><a href="index.php?section=Connection">
';
if ($_SESSION["user_right"] > $GLOBALS["ANONYM"]) {
$str .= "D&eacute;connexion";
}
else {
$str .= "Connexion";
}
$str .= '</a></div>';
echo $str;
}
?>
<?
session_start();
include "include/db_connect.php";
include "include/functions_sql.php";
include "include/tables.php";
......@@ -9,35 +8,31 @@ include "include/menu.php";
include "include/functions_www.php";
include "include/functions_display.php";
include "public/connection.php";
include "public/home.php";
include "public/forum.php";
include "public/jukebox.php";
include "public/photos.php";