Feature #23188 ยป 15127-backendsearch.patch

Administrator Admin, 2010-07-15 10:16

View differences:

typo3/backend.php (working copy)
291 291
	protected function renderToolbar() {
292 292

  
293 293
			// move search to last position
294
		$search = $this->toolbarItems['backendSearch'];
295
		unset($this->toolbarItems['backendSearch']);
296
		$this->toolbarItems['backendSearch'] = $search;
294
		if (isset($this->toolbarItems['backendSearch'])) {
295
			$search = $this->toolbarItems['backendSearch'];
296
			unset($this->toolbarItems['backendSearch']);
297
			$this->toolbarItems['backendSearch'] = $search;
298
		}
297 299

  
298 300
		$toolbar = '<ul id="typo3-toolbar">';
299 301
		$toolbar.= '<li>'.$this->getLoggedInUserLabel().'</li>
typo3/classes/class.backendsearchmenu.php (working copy)
54 54
	}
55 55

  
56 56
	/**
57
	 * checks whether the user has access to this toolbar item
57
	 * Checks whether the user has access to this toolbar item
58 58
	 *
59 59
	 * @return  boolean  true if user has access, false if not
60 60
	 */
61 61
	public function checkAccess() {
62
			// Backendsearch module is enabled for everybody
63
		return true;
62
		$access = FALSE;
63

  
64
		$tsConfig = $GLOBALS['BE_USER']->getTSConfigVal('options.enableBackendSearch');
65
		if (!isset($tsConfig) || $tsConfig == 1) {
66
			$access = TRUE;
67
		}
68

  
69
			// check if user has access to list module
70
		if ($access && !$GLOBALS['BE_USER']->check('modules','web_list')) {
71
				$access = FALSE;
72
		}
73

  
74
		return $access;
64 75
	}
65 76

  
66 77
	/**
    (1-1/1)