Dont show "my profile" and "control panel&quo

A place to discuss and receive support for the Web Auction application.

Dont show "my profile" and "control panel&quo

Postby leifbengtsson » Mon Nov 24, 2008 5:12 pm

I don't want the users to change their profile by them self in Webauction.
When users are logged in, the link to control panel shows up under the "logout" prompt.
Are there any easy way to hide these functions?
leifbengtsson
 
Posts: 5
Joined: Fri Oct 31, 2008 6:22 am
Location: Sweden

Postby shannah » Tue Nov 25, 2008 8:35 am

The best way to handle this is with permissions. If you only remove the link then they may still be able to modify their profile by typing in the URL directly.

You can customize permissions in the tables/users/users.php file. You'll notice a getPermissions() method that looks something like:

Code: Select all
function getPermissions(&$record){

        if ( isAdmin() or ( $record and ($record->strval('username') == getUsername()))) {
            $perms = Dataface_PermissionsTool::ALL();
        } else {
            $perms = Dataface_PermissionsTool::READ_ONLY();
        }
        $perms['new'] = 1;
        return $perms;
    }


Change it to:

Code: Select all
function getPermissions(&$record){
    /*
        $app =& Dataface_Application::getInstance();
        $del =& $app->getDelegate();
        $perms =& $del->getPermissions($record);
    */
        //if ( $record ) echo "Yes"; else echo "No";
        //if ( $record and $record->val('username') ) echo "We have a username";
        if ( isAdmin()) {
            $perms = Dataface_PermissionsTool::ALL();
        } else {
            $perms = Dataface_PermissionsTool::READ_ONLY();
        }
        $perms['new'] = 1;
        return $perms;
    }
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 19 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved