Project

General

Profile

« Previous | Next » 

Revision 1943

Added by darkviper over 11 years ago

fixed/updated /admin/groups - permissions

View differences:

upgradePermissions.php
146 146
 * @param
147 147
 * @return string: parsed HTML-content
148 148
 */
149
	function set_system_permissions ($system_permissions = array())
149
	function set_system_permissions ($aSystemPermissions = array())
150 150
	{
151 151
		// Implode system permissions
152
		$imploded_system_permissions = '';
153
		$system_permissions = !is_array($system_permissions) ? array() : $system_permissions;
154
		foreach($system_permissions AS $key => $value)
152
		$aSystemPermissions = !is_array($aSystemPermissions) ? array() : $aSystemPermissions;
153
		$aSystemPermissionsSet = array();
154
		foreach($aSystemPermissions AS $key => $value)
155 155
		{
156 156
			if($value == true)
157 157
			{
158
				if($imploded_system_permissions == '')
159
				{
160
					$imploded_system_permissions = $key;
161
				} else {
162
					$imploded_system_permissions .= ','.$key;
163
				}
158
				$aSystemPermissionsSet[] = $key;
164 159
			}
165 160
		}
166
		return $imploded_system_permissions;
161
		return implode(',', $aSystemPermissionsSet);
167 162
	}
168 163

  
169 164
/* *****************************************************************************
......
302 297
	}
303 298
	if(is_array($SystemPermissions)&& sizeof($SystemPermissions)>0) {
304 299
		$aPermissions = convertStringToKeyArray($SystemPermissions);
305
		$sTempPermissions = convertKeyArrayToString($aPermissions).',';
300
//		$sTempPermissions = convertKeyArrayToString($aPermissions).',';
301
		$sTempPermissions = implode(",", $aPermissions).',';
306 302
	}
307 303
// workout setting preferences
308 304
	if($admin->is_group_match('preferences_view',$sTempPermissions))
......
383 379
		{
384 380
	//		if(strpos($key,'_view')) { continue; }
385 381
		$checked='';
386
			if(array_key_exists($key, $aPermissions)) { 
387
			 continue; 
382
			if(array_key_exists($key, $aPermissions)) {
383
			 continue;
388 384
             }
389 385
			$tpl->set_var('SYS_NAME', "system_permissions[$key]" );
390 386
			$tpl->set_var('SYS_VALUE', 1 );
......
400 396
		foreach($array AS $key => $value)
401 397
		{
402 398
		$checked='';
403
			if(strpos($key,'_view')) { 
404
			 continue; 
399
			if(strpos($key,'_view')) {
400
			 continue;
405 401
             }
406 402
			$tpl->set_var('SYS_NAME', "system_permissions[$key]" );
407 403
			$tpl->set_var('SYS_VALUE', 1 );
......
498 494
		}
499 495
	}
500 496
	return !$database->is_error();
501
}
497
}

Also available in: Unified diff