close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

multi level users admin, staff, customer

Thread began 10/31/2012 1:25 pm by Christopher West | Last modified 11/02/2012 4:10 pm by Jason Byrnes | 3340 views | 5 replies |

Christopher WestCommunity Expert

multi level users admin, staff, customer

Hi I have only done access levels for page per page view. But what I am attempting now is a little different and just wanted clarification.

I am using one single page (index.php) and the content of this is determined by URL variables. Now I have a login system which will comprise on Admin, Staff and Customers.

In my database I have each page of the website as a record in a table. and in each record there is a userlevel field (1) admin (2) staff (3) customers

Now the whole website can be viewed by all the world..except the admin can create a "customer account" or a "staff account" so that when either a customer or a staff member logs on they will see additional menu links which they can view the content for.

now my question which is the best approach for this. because im trying to figure out the rules or recordsets so that all content is viewable except the staff and customer content which will only show up if they are logged in.

Sign in to reply to this post

Jason ByrnesWebAssist

see the User Level Authentication tutorial on the Security Assist support page in the Archived Documentation Section.

it was written for Security Assist 1, but the concept is the same in Security Assist 2:
securityassist/

Sign in to reply to this post

Christopher WestCommunity Expert

Hi Jason, I checked out that tutorial and its now what I was looking for.

because its not page-by-page access i require..its more content based.

The index page has plugins for the left column, middle, column and right column..and all these are stored as 1 record (for each page). plus each column has its own unique UserAccess level for greater flexability.

IF the record for the page has a Useraccess Level = 0 then this data is shown as default without needing any type of login process...however if the user does log in then the database will also display additional records from this same table relating to their useraccess level.

I just need a work flow of some kind to help me.

Sign in to reply to this post

Jason ByrnesWebAssist

Ok, the content table would need a column for the accessLevel it should be displayed to.

you would then create a recordset to return the default content, and another recordset to return the restricted content.

in the restricted content recordset, use the Access Level Session created by the login page for filtering.

Sign in to reply to this post

Christopher WestCommunity Expert

Hmm thats what I thought...Well I did that for the left column plugin as that column displays the menu links...current the code has a recordset to display all menu links.

then i repeated the recordset twice (for customer and staff) and then created a two extra headings on the left hand column. but for some reason the content wasnt repeating properly. here is the page. as standard without adding any code.


$colname_rsContent = "1";
if (isset($_GET['Content'])) {
$colname_rsContent = $_GET['Content'];
}
mysql_select_db($database_rainbowdb, $rainbowdb);
$query_rsSubMenu = sprintf("SELECT content.ContentMenuName, C2.ContentMenuName AS ParentName FROM content INNER JOIN linkingmenu ON content.ContentID = linkingmenu.LinkingMenuChild LEFT OUTER JOIN content as C2 ON linkingmenu.LinkingMenuParent = C2.ContentID WHERE linkingmenu.LinkingMenuParent = %s AND content.ContentMenuPlacement = 2 AND content.ContentMenuShow = 1 AND content.ContentMenuAccess = 0", GetSQLValueString($colname_rsContent, "int"));
$rsSubMenu = mysql_query($query_rsSubMenu, $rainbowdb) or die(mysql_error());
$row_rsSubMenu = mysql_fetch_assoc($rsSubMenu);
$totalRows_rsSubMenu = mysql_num_rows($rsSubMenu);
?>

<?php

if (isset($_GET['SubContent'])) {
$_GET['Content'] = $_GET['SubContent'];
}
?>
<?php

$colname_rsContent = "1";
if (isset($_GET['Content'])) {
$colname_rsContent = $_GET['Content'];
}

mysql_select_db($database_rainbowdb, $rainbowdb);
$query_rsContent = sprintf("SELECT * FROM content WHERE ContentID = %s AND ContentViewableRight = 1 AND ContentMenuShow = 1", GetSQLValueString($colname_rsContent, "int"));
$rsContent = mysql_query($query_rsContent, $rainbowdb) or die(mysql_error());
$row_rsContent = mysql_fetch_assoc($rsContent);
$totalRows_rsContent = mysql_num_rows($rsContent);
?>

Attached Files
plugins.zip
Sign in to reply to this post

Jason ByrnesWebAssist

  but for some reason the content wasnt repeating properly  




what do you mean by that? please provide details on how it was displaying versus what you expected.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...