changeset 8:7258ccd8ef7d

new: user need to login in LGServices
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 27 May 2015 15:36:58 +0200
parents 3abf39f0eb46
children 28f26315506e
files check_sections_details.php
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/check_sections_details.php	Wed May 27 14:32:34 2015 +0200
+++ b/check_sections_details.php	Wed May 27 15:36:58 2015 +0200
@@ -104,9 +104,16 @@
     $output = file_get_contents($lg_url);
     $user_info = json_decode($output, true);
 	$current_editor = (string)$user_info['userName'];
+	
+	if ($current_editor == null) {
+		// redirect to LGServices homepage
+		header('Location: http://localgazetteers/LGServices');
+	}
 
 } else {
 	// test locally
+	// redirect to LGServices homepage
+	header('Location: http://localgazetteers/LGServices');
 }
 
 ?>
@@ -179,6 +186,8 @@
 		    var current_editor = <?php echo json_encode($current_editor) ?>;
 		    if (current_editor != "") {
 				$("#saveBook .editor").val(current_editor);
+		    } else {
+		    	console.log("You have to login from LGService!");
 		    }
 		}