Project

General

Profile

« Previous | Next » 

Revision 1943

Added by darkviper over 11 years ago

fixed/updated /admin/groups - permissions

View differences:

save.inc.php
41 41
	// check for valid group_id
42 42
		$sql = '';
43 43

  
44
//		$system_settings = getSystemDefaultPermissions();
45
		$system_settings = isset($_POST['system_permissions']) ? $_POST['system_permissions'] : array();
44
		$aSystemPermissionsPages = (isset($_POST["sp_pages"])) ? $_POST["sp_pages"] : array();
45
		$aSystemPermissionsMedia = (isset($_POST["sp_media"])) ? $_POST["sp_media"] : array();
46
		$aSystemPermissionsModules = (isset($_POST["sp_modules"])) ? $_POST["sp_modules"] : array();
47
		$aSystemPermissionsTemplates = (isset($_POST["sp_templates"])) ? $_POST["sp_templates"] : array();
48
		$aSystemPermissionsLanguages = (isset($_POST["sp_languages"])) ? $_POST["sp_languages"] : array();
49
		$aSystemPermissionsSettings = (isset($_POST["sp_settings"])) ? $_POST["sp_settings"] : array();
50
		$aSystemPermissionsAdmintools = (isset($_POST["sp_admintools"])) ? $_POST["sp_admintools"] : array();
51
		$aSystemPermissionsUsers = (isset($_POST["sp_users"])) ? $_POST["sp_users"] : array();
52
		$aSystemPermissionsGroups = (isset($_POST["sp_groups"])) ? $_POST["sp_groups"] : array();
53
		$aSystemPermissionsPreferences = (isset($_POST["sp_preferences"])) ? $_POST["sp_preferences"] : array();
54
		$aSystemPermissions = array_merge($aSystemPermissionsPages, $aSystemPermissionsMedia, $aSystemPermissionsModules,
55
										$aSystemPermissionsTemplates, $aSystemPermissionsLanguages, $aSystemPermissionsSettings,
56
										$aSystemPermissionsAdmintools, $aSystemPermissionsUsers, $aSystemPermissionsGroups,
57
										$aSystemPermissionsPreferences);
46 58

  
59
		//addons,modules,modules_advanced,modules_install,modules_view,preferences,preferences_view
47 60
	// check FTAN and prevent 'admin'[id=1] from become changed
48 61
		if( $admin->checkFTAN() && $group_id != 1 )
49 62
		{
50
			$system_permissions   = get_system_permissions ($admin,$system_settings);
51
			$system_permissions   = set_system_permissions($system_permissions);
63
			$aSystemPermissions   = get_system_permissions ($admin,$aSystemPermissions);
64
			$sSystemPermissions   = set_system_permissions($aSystemPermissions);
52 65

  
53 66
			$module_permissions   = set_module_permissions($admin);
54 67
			$module_permissions   = implode (',', $module_permissions);
......
58 71

  
59 72
			// prepare empty record to add new group
60 73
			$group_name = $database->escapeString(strip_tags(trim($admin->get_post('name'))));
61
//	print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong>  basename: '.basename(__FILE__).'  line: '.__LINE__.' -> <br />';
62
//	print_r( $_POST ); print '</pre>';
63 74

  
64 75
			$sql  = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'groups` ';
65 76
			$sql .= 'WHERE `group_id` <> '.$group_id.' AND `name` LIKE BINARY \''.$group_name.'\'';
......
88 99
            if( msgQueue::isEmpty() )
89 100
			{
90 101
				$sql .= 'SET `name` = \''.$group_name.'\', ';
91
				$sql .= '`system_permissions` = \''.$system_permissions.'\', ';
102
				$sql .= '`system_permissions` = \''.$sSystemPermissions.'\', ';
92 103
				$sql .= '`module_permissions` = \''.$module_permissions.'\', ';
93 104
				$sql .= '`template_permissions` = \''.$template_permissions.'\' ';
94 105
				$sql .= $where;
......
104 115
		}
105 116
		$admin->print_header();
106 117
		return $group_id;
107
	}
118
	}

Also available in: Unified diff