Prechádzať zdrojové kódy

Update permissions for several admin db access. Removed unused files.

seavenois 10 rokov pred
rodič
commit
277cd2f070

+ 1 - 1
www-admin/actividades/add/add.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 	$http_host = $_SERVER['HTTP_HOST'];
 	$http_host = $_SERVER['HTTP_HOST'];
 	include("../../functions.php");
 	include("../../functions.php");
-	$con = startdb();
+	$con = startdb('rw');
 	if (!checkSession($con)){
 	if (!checkSession($con)){
 		header("Location: /index.php");
 		header("Location: /index.php");
 		exit (-1);
 		exit (-1);

+ 1 - 1
www-admin/actividades/add/additinerary.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 	$http_host = $_SERVER['HTTP_HOST'];
 	$http_host = $_SERVER['HTTP_HOST'];
 	include("../../functions.php");
 	include("../../functions.php");
-	$con = startdb();
+	$con = startdb('rw');
 	if (!checkSession($con)){
 	if (!checkSession($con)){
 		header("Location: /index.php");
 		header("Location: /index.php");
 		exit (-1);
 		exit (-1);

+ 12 - 1
www-admin/actividades/moderate/index.php

@@ -1,3 +1,12 @@
+<?php
+	$http_host = $_SERVER['HTTP_HOST'];
+	include("../../functions.php");
+	$con = startdb();
+	if (!checkSession($con)){
+		header("Location: /index.php");
+		exit (-1);
+	}
+	else{ ?>
 <html>
 <html>
 	<head>
 	<head>
 		<meta content="text/html; charset=windows-1252" http-equiv="content-type"/>
 		<meta content="text/html; charset=windows-1252" http-equiv="content-type"/>
@@ -15,4 +24,6 @@
 	</head>
 	</head>
 	<body>
 	<body>
 	</body>
 	</body>
-</html>
+</html>
+
+<?php } ?>

+ 0 - 1
www-admin/actividades/script.js

@@ -1 +0,0 @@
-// DELETE ME

+ 0 - 2
www-admin/actividades/translate/apply.php

@@ -56,10 +56,8 @@
 	}
 	}
 	
 	
 	//Update itinerary entries
 	//Update itinerary entries
-	//echo $total_i;
 	for ($i = 0; $i < $total_i; $i ++){
 	for ($i = 0; $i < $total_i; $i ++){
 		$q_i = mysqli_query($con, "SELECT * FROM activity_itinerary WHERE activity = $id AND id = $i_id[$i];");
 		$q_i = mysqli_query($con, "SELECT * FROM activity_itinerary WHERE activity = $id AND id = $i_id[$i];");
-		//echo "SELECT * FROM activity_itinerary WHERE activity = $id AND id = $i_id[$i];";
 		if (mysqli_num_rows($q_i) > 0){
 		if (mysqli_num_rows($q_i) > 0){
 			$r_i = mysqli_fetch_array($q_i);
 			$r_i = mysqli_fetch_array($q_i);
 			if (strlen($i_name_en[$i]) > 0 && $i_name_en[$i] != $r_i['name_en']){
 			if (strlen($i_name_en[$i]) > 0 && $i_name_en[$i] != $r_i['name_en']){

+ 1 - 1
www-admin/blog/edit/edit.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 	$http_host = $_SERVER['HTTP_HOST'];
 	$http_host = $_SERVER['HTTP_HOST'];
 	include("../../functions.php");
 	include("../../functions.php");
-	$con = startdb();
+	$con = startdb('rw');
 	if (!checkSession($con)){
 	if (!checkSession($con)){
 		header("Location: /index.php");
 		header("Location: /index.php");
 		exit (-1);
 		exit (-1);

+ 11 - 1
www-admin/blog/moderate/index.php

@@ -1,3 +1,13 @@
+<?php
+	$http_host = $_SERVER['HTTP_HOST'];
+	include("../../functions.php");
+	$con = startdb();
+	if (!checkSession($con)){
+		header("Location: /index.php");
+		exit (-1);
+	}
+?>
+
 <html>
 <html>
 	<head>
 	<head>
 		<meta content="text/html; charset=windows-1252" http-equiv="content-type"/>
 		<meta content="text/html; charset=windows-1252" http-equiv="content-type"/>
@@ -15,4 +25,4 @@
 	</head>
 	</head>
 	<body>
 	<body>
 	</body>
 	</body>
-</html>
+</html>

+ 0 - 17
www-admin/galeria/add/index.php

@@ -1,17 +0,0 @@
-<html>
-	<head>
-		<meta content="text/html; charset=windows-1252" http-equiv="content-type"/>
-		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
-		<title>Nuevo post - Administracion</title>
-		<!-- CSS files -->
-		<link rel="stylesheet" type="text/css" href="/css/ui.css"/>
-		<link rel="stylesheet" type="text/css" href="/css/blog.css"/>
-		<!-- CSS for mobile version -->
-		<link rel="stylesheet" type="text/css" media="(max-width : 990px)" href="/css/m/ui.css"/>
-		<link rel="stylesheet" type="text/css" media="(max-width : 990px)" href="/css/m/blog.css"/>
-		<!-- Script files -->
-		<script type="text/javascript" src="/script/ui.js"></script>
-	</head>
-	<body>
-	</body>
-</html>

+ 1 - 1
www-admin/galeria/translate/apply.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 	$http_host = $_SERVER['HTTP_HOST'];
 	$http_host = $_SERVER['HTTP_HOST'];
 	include("../../functions.php");
 	include("../../functions.php");
-	$con = startdb();
+	$con = startdb('rw');
 	if (!checkSession($con)){
 	if (!checkSession($con)){
 		header("Location: /index.php");
 		header("Location: /index.php");
 		exit (-1);
 		exit (-1);

+ 0 - 1
www-admin/galeria/translate/translate.php

@@ -1,4 +1,3 @@
- 
 <?php
 <?php
 	$http_host = $_SERVER['HTTP_HOST'];
 	$http_host = $_SERVER['HTTP_HOST'];
 	$http_standard = substr($_SERVER['HTTP_HOST'], 0, strrpos($_SERVER['HTTP_HOST'], ':'));
 	$http_standard = substr($_SERVER['HTTP_HOST'], 0, strrpos($_SERVER['HTTP_HOST'], ':'));

+ 1 - 1
www-admin/lablanca/calculate.php

@@ -2,7 +2,7 @@
 	$http_host = $_SERVER['HTTP_HOST'];
 	$http_host = $_SERVER['HTTP_HOST'];
 	$default_host = substr($http_host, 0, strpos($http_host, ':'));
 	$default_host = substr($http_host, 0, strpos($http_host, ':'));
 	include("../functions.php");
 	include("../functions.php");
-	$con = startdb('rw');
+	$con = startdb();
 	if (!checkSession($con)){
 	if (!checkSession($con)){
 		exit (-1);
 		exit (-1);
 	}
 	}

+ 0 - 1
www-admin/members.php

@@ -1 +0,0 @@
-<!-- DELETE ME -->

+ 0 - 1
www-admin/public/translate.php

@@ -1 +0,0 @@
-<!-- DELETE ME -->

+ 0 - 1
www-admin/translate/activity/activity.php

@@ -1 +0,0 @@
- 

+ 0 - 1
www-admin/translate/activity/index.php

@@ -1 +0,0 @@
- 

+ 0 - 1
www-admin/translate/gallery/gallery.php

@@ -1 +0,0 @@
- 

+ 0 - 1
www-admin/translate/gallery/index.php

@@ -1 +0,0 @@
- 

+ 0 - 21
www-admin/translate/index.php

@@ -1,21 +0,0 @@
-<?php
-	include("../functions.php");
-	$con = startdb();
-?>
-<html>
-	<head>
-	</head>
-	<body>
-		<?php
-			$res_post = mysqli_query($con, "SELECT id FROM post WHERE text_en = text_es OR text_eu = text_es OR text_en IS NULL OR text_eu IS null;");
-			$res_activity = mysqli_query($con, "SELECT id FROM activity WHERE text_en = text_es OR text_eu = text_es OR text_en IS NULL OR text_eu IS null;");
-			$res_gallery = mysqli_query($con, "SELECT id FROM photo WHERE description_en = description_es OR description_eu = description_es OR description_en IS NULL OR description_eu IS null;");
-		?>
-		<ul>
-			<li><a href="post/">Traducir posts</a> (<?php echo mysqli_num_rows($res_post); ?> posts sin traduccion)</li>
-			<li><a href="activities/">Traducir actividades</a> (<?php echo mysqli_num_rows($res_activity); ?> actividades sin traduccion)</li>
-			<li><a href="gallery/">Traducir fotos</a> (<?php echo mysqli_num_rows($res_gallery); ?> fotos sin traduccion)</li>
-		</ul>
-	</body>
-</html>
- 

+ 0 - 34
www-admin/translate/post/index.php

@@ -1,34 +0,0 @@
-<?php
-	include("../../functions.php");
-	$con = startdb();
-?>
-<html>
-	<head>
-	</head>
-	<body>
-		<table>
-			<tr>
-				<th>Post</th>
-				<th>Euskera</th>
-				<th>Ingles</th>
-				<th> </th>
-			</tr>
-			<?php
-				$res = mysqli_query($con, "SELECT id, title_es, text_es, text_eu, text_en FROM post;");
-				while ($row = mysqli_fetch_array($res)){
-					echo "<tr><td>$row[title_es]</td>\n";
-					if ($row['text_eu'] == $row['text_es'] || strlen($row['text_eu']) == 0)
-						echo "<td></td>\n";
-					else
-						echo "<td>Si</td>\n";
-					if ($row['text_en'] == $row['text_es'] || strlen($row['text_en']) == 0)
-						echo "<td></td>\n";
-					else
-						echo "<td>Si</td>\n";
-					echo "<td><a href='post.php?id=$row[id]'>Traducir</a>\n";
-				}
-			?>
-		</table>
-	</body>
-</html>
- 

+ 0 - 1
www-admin/translate/post/post.php

@@ -1 +0,0 @@
- 

+ 1 - 3
www/lablanca/fiestas.php

@@ -28,9 +28,7 @@
 							echo formatFestivalDate($r_days['date']) . " - $r_days[name]</h4>\n";
 							echo formatFestivalDate($r_days['date']) . " - $r_days[name]</h4>\n";
 							echo "</div>\n";
 							echo "</div>\n";
 							echo "<div class='day_schedule' id='day_schedule_$r_days[id]'>\n";
 							echo "<div class='day_schedule' id='day_schedule_$r_days[id]'>\n";
-							$q_sch = mysqli_query($con, "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 1 AND start > str_to_date(addtime('$r_days[isodate] 00:00:00', '08:00:00'), '%Y-%m-%d %T') AND start < str_to_date(addtime('$r_days[isodate] 00:00:00', '32:00:00'), '%Y-%m-%d %T');");
-							//echo "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 1 AND start > str_to_date(addtime('$r_days[isodate] 00:00:00', '08:00:00'), '%Y-%m-%d %T') AND start < str_to_date(addtime('$r_days[isodate] 00:00:00', '32:00:00'), '%Y-%m-%d %T');";
-							//echo "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 1 AND start > str_to_date(addtime('$r_days[isodate] 00:00:00', '08:00:00'), '%Y-%m-%d %T') AND start < str_to_date(addtime('$r_days[isodate] 00:00:00', '32:00:00'), '%Y-%m-%d %T');";
+							$q_sch = mysqli_query($con, "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 1 AND start > str_to_date(addtime('$r_days[isodate] 00:00:00', '08:00:00'), '%Y-%m-%d %T') AND start < str_to_date(addtime('$r_days[isodate] 00:00:00', '32:00:00'), '%Y-%m-%d %T') ORDER BY start;");
 							if (mysqli_num_rows($q_sch) > 0){
 							if (mysqli_num_rows($q_sch) > 0){
 								echo "<table class='schedule'>\n";
 								echo "<table class='schedule'>\n";
 								while ($r_sch = mysqli_fetch_array($q_sch)){
 								while ($r_sch = mysqli_fetch_array($q_sch)){