{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\froman\fcharset0 Times-Roman;} {\colortbl;\red255\green255\blue255;} \paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0 \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural \f0\fs24 \cf0 The sample code provided here shows how to implement user authentication mechanism in a layer. POIs will be returned only when a user is logged in successfully. \ \ The sample code folder contains the following files: \ \b \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \b0 \cf0 1. \b userAuth_APIv6_sqlQuery.sql \b0 - The sql query to set up the database. A new User table is added. You can see how the database is constructed. \b NOTE \b0 if you already created the database using the query from previous Tutorials, please make sure you do not add duplicated information to the database. \ \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural \cf0 2. \b config.inc.php \b0 - contains all the database configuration settings. \b Please specify them based on your database settings. \b0 \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \cf0 \ Files for enabling user authentication: \ \ 3. \b addUser.php \b0 - A form where user can fill in their new account details. \ 4. \b addUser_submit.php \b0 - Validate user input and insert user account into User table. \ 5. \b loginForm.php \b0 - Logs user in and sets session cookie when a user is logged in successfully. \b Please specify the right layer name in layar intent when user is directed to the AR view.\ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \b0 \cf0 6. \b loggedin.php - \b0 user can choose to logout or go back to the AR view directly. \f1 \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \f0\b \cf0 Please specify the right layer name in layar intent when user is directed to the AR view. \ \b0 7. \b logout.php \b0 - Logs the user out and redirects the user to the loginForm.php. \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \cf0 8. \b functions.php - \b0 custom functions for enabling user authentication shared by several scripts. \b \ \b0 \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \cf0 Two versions of sample code: \ \b \ 1) Simplified version \b0 \ 9. \b userAuth_APIv6_simplified.php \b0 - A limited version. It contains the code provided in the Tutorial itself. You can upload this file and put the link in the API endPoint URL on the publishing site. \ \ \b 2) Generic and complete version \b0 \ The following files provide a more generic and complete version: \ 10. \b abstract_class.php \b0 \ 11. \b commonFuncs.php \b0 \ 12. \b POI.php \b0 \ 13. \b Layer.php\ \b0 14. \b Action.php \b0 \ 15. \b userAuth_APIv6_complete.php \b0 - The link to this file should be put in the API endpoint URL field on the publishing site. \ \ You can simply upload all files from 2-15 to the same directory on your server. \ \ }