Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: Article Manager 2:
Access Level Field Editor

 

 


scritty
User

Jan 5, 2007, 5:22 AM

Post #1 of 3 (415 views)
Shortcut
Access Level Field Editor Can't Post

In the User Accounts table, there is a field named accessLevel. This field defines the different types of users. Each type of user has been assigned a value:

Disabled - 0
Writer - 2
Trusted Writer - 3
Editor - 4
Administrator - 9

What do the values 0, 2, 3, 4, and 9 mean? I couldn't find this in any of the documentation or see it discussed anywhere in the forums.

I'm looking to create a new type of user called a Sub-administrators who would have the same permissions as an Editor but would also have the ability to manage categories. However, the Sub-administrators would not have the ability to edit Publishing Rules or Placeholders.

Is this possible?


ross
Staff / Moderator


Jan 6, 2007, 12:09 PM

Post #2 of 3 (398 views)
Shortcut
Re: [scritty] Access Level Field Editor [In reply to] Can't Post

Hi there.

Thanks for posting!

I must admit to not knowing exactly why we went with those particular numbers. What you'll find though is that the access levels are coded right into the main program so I am not exactly sure how you would go about adding a new level to that list.

The code is all available there though so feel free to try some things out. One thing to keep in mind though is that we don't really support changes to the code like that.

If you get something going, it would be great if you could post up some examples of what you ended up doing Smile.
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.




pfhowe
User

Feb 2, 2007, 3:27 PM

Post #3 of 3 (367 views)
Shortcut
Re: [scritty] Access Level Field Editor [In reply to] Can't Post

Hi Scritty

This mod permits Editors to access the Category management utility opposed to creating a new user type and corresponding access level for a Sub-Administrator as you described. Beware that as Ross said, this kind of mod is not supported by interactivetools but it works perfect for me with AM 2.02. I don't guarantee it will work for you and I accept no responsibility if things go wrong. It may also not be compatable with future releases of AM, so bear that in mind.

First of all you need to locate _wrapper.html located at "cgi-bin/artman2/templates/admin/_wrapper.html". Open it and find...

<!-- templateIf : $currentuser.accessLevel$ == "" -->

<td class="$selectedMenuOption:replace('login', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=loginForm" class="mLink">Login</a></td>

<td class="$selectedMenuOption:replace('about', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=loginAbout" class="mLink">About</a></td>

<!-- /templateIf -->

<!-- templateIf : $currentuser.accessLevel$ >= "1" -->

<td class="$selectedMenuOption:replace('home', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=home" class="mLink">Home</a></td>

<!-- /templateIf -->

<!-- templateIf : $currentuser.accessLevel$ == "2" -->

<td class="$selectedMenuOption:replace('article', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=articleAdd" class="mLink">Create Article</a></td>

<!-- /templateIf -->

<!-- templateIf : $currentuser.accessLevel$ >= "3" -->

<td class="$selectedMenuOption:replace('article', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=articleList" class="mLink">Articles</a></td>

<!-- /templateIf -->

<!-- templateIf : $currentuser.accessLevel$ >= "9" -->

<td class="$selectedMenuOption:replace('category', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=categoryList" class="mLink">Categories</a></td>

<td class="$selectedMenuOption:replace('admin', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=admin" class="mLink">Admin</a></td>

<!-- /templateIf -->

and change it to this...

<!-- templateIf : $currentuser.accessLevel$ == "" -->
<td class="$selectedMenuOption:replace('login', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=loginForm" class="mLink">Login</a></td>
<td class="$selectedMenuOption:replace('about', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=loginAbout" class="mLink">About</a></td>
<!-- /templateIf -->


<!-- templateIf : $currentuser.accessLevel$ == "1" -->
<td class="$selectedMenuOption:replace('home', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=home" class="mLink">Home</a></td>
<!-- /templateIf -->


<!-- templateIf : $currentuser.accessLevel$ == "2" -->
<td class="$selectedMenuOption:replace('article', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=articleAdd" class="mLink">Create Article</a></td>
<!-- /templateIf -->


<!-- templateIf : $currentuser.accessLevel$ == "3" -->
<td class="$selectedMenuOption:replace('article', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=articleList" class="mLink">Articles</a></td>
<!-- /templateIf -->

<!-- templateIf : $currentuser.accessLevel$ == "4" -->
<td class="$selectedMenuOption:replace('article', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=articleList" class="mLink">Articles</a></td><td class="$selectedMenuOption:replace('category', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=categoryList" class="mLink">Categories</a></td>
<!-- /templateIf -->


<!-- templateIf : $currentuser.accessLevel$ == "9" -->
<td class="$selectedMenuOption:replace('category', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=categoryList" class="mLink">Categories</a></td>
<td class="$selectedMenuOption:replace('admin', 'menuOn', 'menuOff')$"><a href="$_cgiurl$?action=admin" class="mLink">Admin</a></td>
<!-- /templateIf -->


Now open admin.cgi located at "cgi-bin/artman2/admin.cgi" and look for the following...

# dispatch user actions (login required)
&IT::App::Menu::Login::requireValidLogin();
&_dispatchUserActions($action) if ($CURRENT_USER->{'accessLevel'} >= 1);
&_dispatchAdminActions($action) if ($CURRENT_USER->{'accessLevel'} >= 9);
&IT::App::home("Unknown action '$action'"); # display error for unknown actions
exit;


and change it to this...

# dispatch user actions (login required)
&IT::App::Menu::Login::requireValidLogin();
&_dispatchUserActions($action) if ($CURRENT_USER->{'accessLevel'} >= 1);
&_dispatchAdminActions($action) if ($CURRENT_USER->{'accessLevel'} >= 4);
&_dispatchAdminActions($action) if ($CURRENT_USER->{'accessLevel'} >= 9);
&IT::App::home("Unknown action '$action'"); # display error for unknown actions
exit;


Save the files and upload them to your server. If you get it right, Editors and Administrators will have access to the Category management utility but not Writers and Trusted Writers. The link will appear in the blue bar at the top of the page.


If you also wish to add the Category icon to the Editor's home page you need to do the following...

Locate home.html at "cgi-bin/templates/menus/home.html" and find the following...

<!-- templateIf : $currentUser.accessLevel$ >= "3" -->

<tr>

<td><a href="$_cgiurl$?action=articleAdd"><img src="$_weburl$images/icons/home_add.gif" height="65" width="65" border="0" alt="" /></a></td>

<td width="33%"><b><a href="$_cgiurl$?action=articleAdd">Create Article</a></b><br /> Add a brand new article.</td>

<td rowspan="99">&nbsp;&nbsp;&nbsp;&nbsp;</td>

<td><a href="$_cgiurl$?action=articleList"><img src="$_weburl$images/icons/home_list.gif" height="65" width="65" border="0" alt="" /></a></td>

<td width="33%"><b><a href="$_cgiurl$?action=articleList">Articles</a></b><br /> Display a list of existing articles.</td>

<td rowspan="99">&nbsp;&nbsp;&nbsp;&nbsp;</td>

<td><a href="$_cgiurl$?action=userPreferencesEdit"><img src="$_weburl$images/icons/home_details.gif" height="65" width="65" border="0" alt="" /></a></td>

<td width="33%"><b><a href="$_cgiurl$?action=userPreferencesEdit">User Preferences</a></b><br /> Edit your user settings, such as email and password.</td>

</tr>

<tr><td colspan="8" height="25"></td></tr>



<tr>



<!-- templateIf : $currentUser.accessLevel$ >= "9" -->

<!-- Admin exclusive features -->

<td><a href="$_cgiurl$?action=admin"><img src="$_weburl$images/icons/home_admin.gif" height="65" width="65" border="0" alt="" /></a></td>

<td><b><a href="$_cgiurl$?action=admin">Admin Menu</a></b><br /> Modify program configuration settings and user accounts.</td>

<td><a href="$_cgiurl$?action=categoryList"><img src="$_weburl$images/icons/home_categories.gif" height="65" width="65" border="0" alt="" /></a></td>

<td><b><a href="$_cgiurl$?action=categoryList">Categories</a></b><br /> Add or update Categories.</td>

<!-- /templateIf -->



<td><a href="$_cgiurl$?action=logoff"><img src="$_weburl$images/icons/home_logoff.gif" height="65" width="65" border="0" alt="" /></a></td>

<td><b><a href="$_cgiurl$?action=logoff">Logoff Program</a></b><br /> Exit the program and remove cookies.</td>

</tr>

<!-- /templateIf -->

and change it to this...

<!-- templateIf : $currentUser.accessLevel$ >= "3" -->
<tr>
<td><a href="$_cgiurl$?action=articleAdd"><img src="$_weburl$images/icons/home_add.gif" height="65" width="65" border="0" alt="" /></a></td>
<td width="33%"><b><a href="$_cgiurl$?action=articleAdd">Create Article</a></b><br /> Add a brand new article.</td>


<td rowspan="99">&nbsp;&nbsp;&nbsp;&nbsp;</td>

<td><a href="$_cgiurl$?action=articleList"><img src="$_weburl$images/icons/home_list.gif" height="65" width="65" border="0" alt="" /></a></td>
<td width="33%"><b><a href="$_cgiurl$?action=articleList">Articles</a></b><br /> Display a list of existing articles.</td>


<td rowspan="99">&nbsp;&nbsp;&nbsp;&nbsp;</td>

<!-- templateIf : $currentUser.accessLevel$ >= "4" -->


<td><a href="$_cgiurl$?action=categoryList"><img src="$_weburl$images/icons/home_categories.gif" height="65" width="65" border="0" alt="" /></a></td>
<td><b><a href="$_cgiurl$?action=categoryList">Categories</a></b><br /> Add or update Categories.</td>
<!-- /templateIf -->


</tr>


<tr><td colspan="8" height="25"></td></tr>


<tr>



<!-- templateIf : $currentUser.accessLevel$ >= "9" -->
<!-- Admin exclusive features -->
<td><a href="$_cgiurl$?action=admin"><img src="$_weburl$images/icons/home_admin.gif" height="65" width="65" border="0" alt="" /></a></td>
<td><b><a href="$_cgiurl$?action=admin">Admin Menu</a></b><br /> Modify program configuration settings and user accounts.</td>


<!-- /templateIf -->


You must make the changes exactly as shown or you will have massive problems and need to reinstall the original files. Be sure to make backups of them. Let us know how you get on.


(This post was edited by pfhowe on Feb 2, 2007, 6:23 PM)

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4