Page 1 of 1

Unlogical code

Posted: 16 Aug 2011, 10:48
by aemkey
Hi there
I just tried to change the standard access level, when a user creates a new category in the frontend.
So I found some code, which doesn't make sense to me:

In controllers/user.php are the standard values set:
// Set default values
$post['access'] = 0;
//$post['access'] = 1;
$post['parent_id'] = 0;
$post['image_position'] = 'left';
$post['published'] = 1;
$post['accessuserid'] = '-1';
$post['uploaduserid'] = $this->_user->id;
$post['deleteuserid'] = $this->_user->id;
$post['userfolder'] = $this->_userFolder;
$post['owner_id'] = $this->_user->id;
Here I tried to change the access level, but nothing happend. It took me a while to find, that the accesslevel is set again in models/user.php

Code: Select all

function store($data) {
		
		if ($data['alias'] == '') {
			$data['alias'] = $data['title'];
		}
		$data['alias'] 	= PhocaGalleryText::getAliasName($data['alias']);
		$data['access']	= 1;
It doesn't really make sense to me to set this again, especially because the funtion is called right afterwards.
I've change it now for me, but probably it helps other people.
Or it would be a good thing to integrate it in the settings directly. If I find the time, Il will try to write it.

Re: Unlogical code

Posted: 20 Aug 2011, 00:33
by Jan
Hi, thank you for the info, there were removed some pieces of code so not all was removed, I will fix it (for now it has no influence on the function)

Thank you, Jan