I am helping out with a website that is written in php and uses XML for their navigation system and also permission system.
However I need to change the layout of the navigation and need some help figuring out this xml permission/navigation system.
So basically the site has a main.xml file that lists all the possible navigation links what what attributes each link will have such as allow and deny. Where allow of course means the link should be visible to the user and deny means the link should not be visible to the user.
Each user also has their own xml listing their permissions. When a user logs in and a page is loaded the main xml file is compared against the individual users xml file in order to determain what links should be visible.
So what I am hoping is someone can tell me how via php I would load the main.xml file and then also load the users xml which is pulled from a mysql column and how I would write the php to say to display each section and application line where the verb is ALLOW
listing of all website links <?xml version="1.0" encoding="UTF-8"?> <application name="root"> <section name="Phone Lists" rel="employeephonelist" id="Customer Center" description="Customer Management Interface" verbs="DENY,ALLOW" > <application name="Employee Phone List" id="Employee Phone List" href="phonelist_employee.php" description="company phone list. shows employees." verbs="DENY,ALLOW" /> <application name="Client Phone List" id="Client Phone List" href="phonelist_customer.php" description="clients phone list" verbs="DENY,ALLOW"/> <application name="Vendor Phone List" id="Vendor Phone List" href="./kernel/plugins/customercenter/phonelist_vendor.php" description="vendors phone list" verbs="DENY,ALLOW"/> </section> <section name="My Profile" rel="profileedit" id="My Profile" description="Manage Your profile" url="profile.php" verbs="DENY,ALLOW" > </section> <section name="Employee Center" rel="employeephonelist" id="Employee Center" description="Employee Resources Center" verbs="DENY,ALLOW"> <application name="Forms" id="Employee Forms" href="employeecenter/form_viewer.php" description="company forms" verbs="DENY,ALLOW" /> <application name="Weather" id="Employee Weather" href="employeecenter/weather.php" description="See the weather nearby" verbs="DENY,ALLOW"/> <application name="Directions" id="Directions" href="./kernel/plugins/employeecenter/directions.php" description="Directions" verbs="DENY,ALLOW"/> <application name="Calendar" id="Calendar" href="./kernel/plugins/employeecenter/mycalendar.php" description="Company Calendar" verbs="DENY,ALLOW" /> </section> </application> users individual link permissions <?xml version="1.0" encoding="UTF-8"?> <apps> <app name="root"> <permission name="Phone Lists" value="ALLOW"/><permission name="Employee Phone List" value="ALLOW"/><permission name="Client Phone List" value="ALLOW"/> <permission name="Employee Center" value="ALLOW"/><permission name="Forms" value="ALLOW"/><permission name="Weather" value="ALLOW"/><permission name="Directions" value="ALLOW"/> <permission name="Calendar" value="ALLOW"/> </app> </apps>
Thanks