have you installed OpenCATS? Proud of your customizations and want to share it? Post here and wait for the praise...

Moderators: RussH, cptr13

Forum rules: Just please remember to play nicely once you walk through the door. You can disagree with us, or any other commenters in this forum, but keep your comments directed to the topic at hand - not at the commenter.
#3434
Hello all.

I recently was asked to modify a 0.9.3 version of opencats because the owner of the implementation wanted specific behavior to be implemented, and I thought I would share the change with the community.

The owner is an opencats admin who wants to prevent non-admin (read only) users of the system from being able to run data exports.

In order to implement this I followed the code back to the ExportUI.php module in the modules folder in the opencats implementation. In that module is a function called HandleRequest. I wrapped the export code with an if statement that verifies that the current user is an admin, by testing the Access level of the page to see if the user has at least admin permissions. The following is the code to do this. If you wish to implement this then simply replace the current handlerequest portion of the code. The other part of this story is that the non-admin user will see the export link under the action button, but when they click on it nothing will happen; the administrator's behavior will be as expected.
Code: Select all
    public function handleRequest()
    {
        $action = $this->getAction();

		$accesslev = $this->_accessLevel;

		if($this->_accessLevel >= ACCESS_LEVEL_SA)
		{
				switch ($action)
				{
						case 'exportByDataGrid':
							$this->onExportByDataGrid();
							break;

						case 'export':
							default:
							$this->onExport();
							break;
				}
		
		}
		else
		{
			//redirect if the user is not an SA		
			header("Location: {$_SERVER['HTTP_REFERER']}");
			exit;
		}

    }

It's essential to keep these synchronized to ensur[…]

Export part in Job Order order search

Same problem as mine. Maybe you're right, I'll che[…]

The error message you're encountering indicates th[…]

Errors restoring mysqldump backup

doesnot work for me