Multi User Categories

5 posts by 2 authors in: Forums > CMS Builder
Last Post: October 8, 2008   (RSS)

Re: [seyrich] Multi User Categories

By Dave - October 7, 2008

Hi Seyrich, welcome to the CMS Builder Forum.

The category menu isn't setup to allow per user access yet so that might be a bit of a problem.

Another way to set it up would be to have two multi record sections, one for stylists and one for services.

Are you post a sample url or mockup of the design and structure you're trying to create?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multi User Categories

By (Deleted User) - October 7, 2008

http://galleriaofsalons.com/stylists/

Currently there is only one stylist on the site right now. There will be more and I ran into the problem when I had 3 or 4 test stylists in the database. If you select the stylist and then the services link from the top you will see where I am trying to set this up.

I guess maybe I should ask a different way. When I created the stylist account I checked that the user is type 'writer' which should not allow her to access any records she did not create. What I found was that they do have access to records that others created in the selection box when choosing parent categories.

Thank you for a great system! I am a php/mysql programmer and have always written my own cms system for my website. This system saves me a ton of time.

Re: [seyrich] Multi User Categories

By Dave - October 7, 2008

Thanks! :)

>What I found was that they do have access to records
>that others created in the selection box when choosing
>parent categories.

Oh I see. Yes I didn't think of having writer access with category sections but that makes sense. I'll fix that for the next version. Here's the steps if you'd like to apply the fix yourself:

- Open /lib/menus/default/edit_functions.php
- Make backup copy of the file
- Search for: globalOrder
- Replace the line 2 below the matched line (in red):

$query = "SELECT * FROM $escapedTableName ORDER BY globalOrder";
$result = mysql_query($query) or die("MySQL Error: " .mysql_error(). "\n");
while ($row = mysql_fetch_assoc($result)) { $categoriesByNum[ $row['num'] ] = $row; }


With this:

$query = "SELECT * FROM $escapedTableName ORDER BY globalOrder";
$result = mysql_query($query) or die("MySQL Error: " .mysql_error(). "\n");
while ($row = mysql_fetch_assoc($result)) {
global $CURRENT_USER;
$isOwner = @$row['createdByUserNum'] == $CURRENT_USER['num'];
if (@$row['createdByUserNum'] && (!$isOwner && !$GLOBALS['hasAdminAccess'])) { continue; }
$categoriesByNum[ $row['num'] ] = $row;
}


Hope that helps! Let me know if that fixes it for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multi User Categories

By (Deleted User) - October 8, 2008

Dave, Thank you

That is awesome! Works exactly as I expected/wanted it to.