Project

General

Profile

« Previous | Next » 

Revision 1925

Added by darkviper over 11 years ago

set default rights to dissabled for new installed modules

View differences:

functions.php
1108 1108
		return $subject;
1109 1109
    }
1110 1110

  
1111
function setAccessDeniedToNewTools($sModulName)
1112
{
1113
	$oDb = WbDatabase::getInstance();
1114
	$sql = 'UPDATE `'.$oDb->getTablePrefix.'groups` '
1115
		 . 'SET `module_permissions`= TRIM(LEADING \',\' FROM (CONCAT(`module_permissions`, \','.$sModulName.'\'))) '
1116
	     . 'WHERE `group_id`<>1 AND NOT FIND_IN_SET(\''.$sModulName.'\', `module_permissions`)';
1117
	$oDb->query($sql);
1118
}
1119
	
1111 1120
// Load module into DB
1112 1121
function load_module($directory, $install = false)
1113 1122
{
......
1143 1152
			$sql .= '`license`=\''.addslashes($module_license).'\'';
1144 1153
			$sql .= $sqlwhere;
1145 1154
			$retVal = intval($database->query($sql) ? true : false);
1155
			if($retVal && !$sqlwhere &&
1156
			   ($module_function == 'tool' || $module_function == 'page' || $module_function == 'wysiwyg')
1157
			  ) {
1158
				setAccessDeniedToNewTools($module_directory);
1159
			}
1146 1160
			// Run installation script
1147 1161
			if($install == true) {
1148 1162
				if(file_exists($directory.'/install.php')) {

Also available in: Unified diff