# HG changeset patch # User Zoe Hong # Date 1429620789 -7200 # Node ID 26ed9d1d695701a697051028d972a310fc50a535 # Parent 373c8ecad8b449b01379b5433af2a012b4ee7c50 New: get user name from LGService by sessionId diff -r 373c8ecad8b4 -r 26ed9d1d6957 check_sections_details.php --- a/check_sections_details.php Tue Mar 24 11:32:31 2015 +0100 +++ b/check_sections_details.php Tue Apr 21 14:53:09 2015 +0200 @@ -94,27 +94,39 @@ echo $str; } +if (isset($_GET['sessionId'])) { + // check if get session info from LGService, to get username as editor + $session_id = $_GET['sessionId']; + $lg_url = "http://localgazetteers-dev/LGServices/rest/utils/getUser?sessionId=".$session_id; // url to get username from LGService + $output = file_get_contents($lg_url); + $user_info = json_decode($output, true); + $current_editor = $user_info['userName']; + +} else { + // test locally +} + ?> - - - - - - - - - - + + + + + + + + + +
...
- last editor: ".$editor; $missingPageArray=checkMissingPage($bookInfo,$info); - ?> + ?> - - Show editing records: - - - - - - - - - - - - - -
+ + Show editing records: + + + + + + + + + + + + + +
- - -
- + -
+ ?> +
+ + + + - + diff -r 373c8ecad8b4 -r 26ed9d1d6957 config/config.php --- a/config/config.php Tue Mar 24 11:32:31 2015 +0100 +++ b/config/config.php Tue Apr 21 14:53:09 2015 +0200 @@ -4,23 +4,24 @@ if (!$at_local) { // host at localgazetteers-dev server - $systemNAME = "interface"; $mysql_database = "Gazetteer"; $mysql_server = "localhost"; $mysql_user = "root"; $mysql_password = "admin"; - $system_root_url = "http://localgazetteers-dev/LGToc"; - $lgserver_url = "http://localgazetteers-dev/LGServer/"; + $server_host = "http://localgazetteers-dev/"; + $lgserver_url = $server_host."LGServer/"; } else { // localhost - $systemNAME = "interface"; $mysql_database = "Gazetteers"; $mysql_server = "localhost"; $mysql_user = "root"; $mysql_password = "root"; - $system_root_url = "http://localhost:1080/localgazetteers-dev/LGToc"; + $server_host = "http://localhost:1080/localgazetteers-dev/"; $lgserver_url = "http://localgazetteers-dev/LGServer/"; } +$systemNAME = "interface"; +$system_root_url = $server_host."LGToc/"; + ?> diff -r 373c8ecad8b4 -r 26ed9d1d6957 js/check_sections_details.js --- a/js/check_sections_details.js Tue Mar 24 11:32:31 2015 +0100 +++ b/js/check_sections_details.js Tue Apr 21 14:53:09 2015 +0200 @@ -297,8 +297,11 @@ editor=editor[0].replace("editor=",""); editor=editor.replace("%20"," "); $("#saveBook .editor").val(editor); + } else { + setCurrentEditor(); // get from LGService, if user linked this TOC from LGService (the firsttime) } } + function saveBook(version){ var sectionArray=collectSectionArray(); var bookId=$(".entry").first().children(".hiddenInfo").children(".booksId").html();