Project

General

Profile

« Previous | Next » 

Revision 1789

Added by Dietmar about 12 years ago

! update Group Permission, add module_advanced
! upgrade-script will be updating Adminitrator Group

View differences:

branches/2.8.x/CHANGELOG
13 13

  
14 14

  
15 15

  
16
14 Oct-2012 Build 1789 Dietmar Woellbrink (Luisehahne)
17
! update Group Permission, add module_advanced
18
! upgrade-script will be updating Adminitrator Group
16 19
13 Oct-2012 Build 1788 Dietmar Woellbrink (Luisehahne)
17 20
# fixed page settings for php Version less 5.2.9
18 21
13 Oct-2012 Build 1787 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/upgrade-script.php
66 66
			'[ADMIN]/themes/',
67 67
		 );
68 68

  
69
if(version_compare(WB_REVISION, '1785', '<'))
69
if(version_compare(WB_REVISION, '1788', '<'))
70 70
{
71 71
    $filesRemove['0'] = array(
72 72

  
......
735 735

  
736 736
    if($bDebugModus) {
737 737
        echo implode(PHP_EOL,$aDebugMessage);
738
        $aDebugMessage = array();
738 739
    }
740

  
741
	/**********************************************************
742
     * Modify Administrator on groups table
743
     */
744
	echo "<h4>Update group Administrator on table groups</h4>";
745
	$aDebugMessage[] = "<span>Modify Administrator on groups table</span>";
746
    $sModulePermissions = '';
747
    $sTemplatePermissions = '';
748
	$sSystemPermissions  = 'access,addons,admintools,admintools_view,groups,groups_add,groups_delete,groups_modify,groups_view,';
749
	$sSystemPermissions .= 'languages,languages_install,languages_uninstall,languages_view,media,media_create,media_delete,media_rename,media_upload,media_view,';
750
	$sSystemPermissions .= 'modules,modules_advanced,modules_install,modules_uninstall,modules_view,pages,pages_add,pages_add_l0,pages_delete,pages_intro,pages_modify,pages_settings,pages_view,';
751
	$sSystemPermissions .= 'preferences,preferences_view,settings,settings_advanced,settings_basic,settings_view,templates,templates_install,templates_uninstall,templates_view,users,users_add,users_delete,users_modify,users_view';
752

  
753
	$sql  = 'UPDATE `'.TABLE_PREFIX.'groups` ';
754
	$sql .= 'SET `name` = \'Administrators\', ';
755
	$sql .= '`system_permissions` = \''.$sSystemPermissions.'\', ';
756
	$sql .= '`module_permissions` = \''.$sModulePermissions.'\', ';
757
	$sql .= '`template_permissions` = \''.$sTemplatePermissions.'\' ';
758
	$sql .= 'WHERE `group_id` = \'1\' ';
759
    $aDebugMessage[] = ($database->query($sql)) ? " $OK<br />" : " $FAIL!<br />";
760

  
761
    if($bDebugModus) {
762
        echo implode(PHP_EOL,$aDebugMessage);
763
        $aDebugMessage = array();
764
    }
739 765
    echo '</div>';
740 766

  
741 767
}
......
779 805
    echo '<h4>Upgrade media directory '.MEDIA_DIRECTORY.'/ index.php protect files</h4>';
780 806
    $array = rebuildFolderProtectFile($dir);
781 807
    if( sizeof( $array ) ){
782
    	print '<span><strong>Upgrade '.sizeof( $array ).' directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $OK<br />";
808
    	echo '<span><strong>Upgrade '.sizeof( $array ).' directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $OK<br />";
783 809
    } else {
784
    	print '<span><strong>Upgrade directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $FAIL!<br />";
785
    	print implode ('<br />',$array);
810
    	echo '<span><strong>Upgrade directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $FAIL!<br />";
811
    	echo implode ('<br />',$array);
786 812
    }
787 813

  
788 814
    /**********************************************************
......
796 822
    $sPagePath = (defined('PAGES_DIRECTORY') && (PAGES_DIRECTORY != '') ? PAGES_DIRECTORY : '');
797 823
    $msg = rebuild_all_accessfiles();
798 824

  
799
	print implode ('<br />',$msg);
825
	echo implode ('<br />',$msg);
800 826
    echo '</div>';
801 827
    /* *****************************************************************************
802 828
     * - check for deprecated / never needed files
branches/2.8.x/wb/admin/groups/upgradePermissions.php
196 196
		function addons(& $val, $key, $vars = '')
197 197
		{
198 198
			$val = rtrim($val, '_');
199
            $val = ($val == 'modules') || ($val == 'templates') || ($val == 'languages') ? 'addons' : $val;
199
            $val = ($val == 'modules_view') || ($val == 'templates_view') || ($val == 'languages_view') ? 'addons' : $val;
200 200
		}
201 201
	}
202 202

  
......
211 211
	if(!function_exists('access')){
212 212
		function access(& $val, $key, $vars = '')
213 213
		{
214
            $val = ($val == 'groups') || ($val == 'users') ? 'access' : $val;
214
            $val = ($val == 'groups_view') || ($val == 'users_view') ? 'access' : $val;
215 215
		}
216 216
	}
217 217
	function convertArrayToString ($val=null)
branches/2.8.x/wb/admin/templates/index.php
73 73
		'<a href="' . ADMIN_URL . '/modules/index.php">' . $mLang->MENU_MODULES . '</a>' : '<b>'.$mLang->MENU_MODULES.'</b>',
74 74
	'URL_LANGUAGES' => $admin->get_permission('languages') ?
75 75
		'<a href="' . ADMIN_URL . '/languages/index.php">' . $mLang->MENU_LANGUAGES . '</a>' : '<b>'.$mLang->MENU_LANGUAGES.'</b>',
76
	'URL_ADVANCED' => $admin->get_permission('settings_advanced')
76
	'URL_ADVANCED' => $admin->get_permission('modules_advanced')
77 77
                ? '<a href="' . ADMIN_URL . '/addons/index.php?advanced">' . $mLang->TEXT_ADVANCED . '</a>' : '<b>'.$mLang->TEXT_ADVANCED.'</b>' ,
78 78
	)
79 79
);
branches/2.8.x/wb/admin/skel/themes/htt/groups_form.htt
194 194
								<input name="system_permissions[modules_uninstall]" id="modules_uninstall" type="checkbox" value="1" {modules_uninstall_checked} />
195 195
								<label for="modules_uninstall">{TEXT_DELETE}</label>
196 196
								</li>
197
								<li class="c100">
198
								<input name="system_permissions[modules_advanced]" id="modules_advanced" type="checkbox" value="1" {modules_advanced_checked} />
199
								<label for="modules_advanced">{TEXT_ADVANCED}</label>
200
								</li>
197 201
							</ul>
198 202
						</div>
199 203
					</div>
......
215 219
									<input name="system_permissions[templates_uninstall]" id="templates_uninstall" type="checkbox" value="1" {templates_uninstall_checked} />
216 220
									<label for="templates_uninstall">{TEXT_DELETE}</label>
217 221
								</li>
222
								<li class="c100">
223
									<label for="templates">&nbsp;</label>
224
								</li>
218 225
							</ul>
219 226
						</div>
220 227
					</div>
......
236 243
									<input name="system_permissions[languages_uninstall]" id="languages_uninstall" type="checkbox" value="1" {languages_uninstall_checked} />
237 244
									<label for="languages_uninstall">{TEXT_DELETE}</label>
238 245
								</li>
246
								<li class="c100">
247
									<label for="languages">&nbsp;</label>
248
								</li>
239 249
							</ul>
240 250
						</div>
241 251
					</div>
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '1788');
54
if(!defined('REVISION')) define('REVISION', '1789');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/admin/modules/index.php
118 118
		'<a href="' . ADMIN_URL . '/templates/index.php">' . $mLang->MENU_TEMPLATES . '</a>' : '<b>'.$mLang->MENU_TEMPLATES.'</b>',
119 119
	'URL_LANGUAGES' => $admin->get_permission('languages') ?
120 120
		'<a href="' . ADMIN_URL . '/languages/index.php">' . $mLang->MENU_LANGUAGES . '</a>' : '<b>'.$mLang->MENU_LANGUAGES.'</b>',
121
	'URL_ADVANCED' => $admin->get_permission('settings_advanced') ?
121
	'URL_ADVANCED' => $admin->get_permission('modules_advanced') ?
122 122
		'<a href="' . ADMIN_URL . '/modules/index.php?advanced">' . $mLang->TEXT_ADVANCED . '</a>' : '<b>'.$mLang->TEXT_ADVANCED.'</b>' ,
123 123
	'HEADING_CHANGE_TEMPLATE_NOTICE' => ''
124 124
	)
branches/2.8.x/wb/admin/addons/index.php
49 49
if($admin->get_permission('modules') != true) {	$template->set_var('DISPLAY_MODULES', $display_none); }
50 50
if($admin->get_permission('templates') != true) { $template->set_var('DISPLAY_TEMPLATES', $display_none); }
51 51
if($admin->get_permission('languages') != true) { $template->set_var('DISPLAY_LANGUAGES', $display_none); }
52
if($admin->get_permission('admintools') != true) { $template->set_var('DISPLAY_ADVANCED', $display_none); }
52
if($admin->get_permission('modules_advanced') != true) { $template->set_var('DISPLAY_ADVANCED', $display_none); }
53 53

  
54
if(!isset($_GET['advanced']) || $admin->get_permission('admintools') != true) {
54
if(!isset($_GET['advanced']) || $admin->get_permission('modules_advanced') != true) {
55 55
	$template->set_var('DISPLAY_RELOAD', $display_none);
56 56
}
57 57
/**
......
59 59
 */
60 60
$template->set_var(array(
61 61
	'ADDONS_OVERVIEW' => $MENU['ADDONS'],
62
	'FTAN'=> $admin->getFTAN(),
62 63
	'MODULES' => $MENU['MODULES'],
63 64
	'TEMPLATES' => $MENU['TEMPLATES'],
64 65
	'LANGUAGES' => $MENU['LANGUAGES'],
......
66 67
	'TEMPLATES_OVERVIEW' => $OVERVIEW['TEMPLATES'],
67 68
	'LANGUAGES_OVERVIEW' => $OVERVIEW['LANGUAGES'],
68 69
	'TXT_ADMIN_SETTINGS' => $TEXT['ADMIN'] . ' ' . $TEXT['SETTINGS'],
69
	'MESSAGE_RELOAD_ADDONS' => $MESSAGE['ADDON']['RELOAD'],
70
	'MESSAGE_RELOAD_ADDONS' => $MESSAGE['ADDON_RELOAD'],
70 71
	'TEXT_RELOAD' => $TEXT['RELOAD'],
72

  
71 73
	'RELOAD_URL' => ADMIN_URL . '/addons/reload.php',
72
	'URL_ADVANCED' => $admin->get_permission('admintools')
74
	'URL_ADVANCED' => $admin->get_permission('modules_advanced')
73 75
                ? '<a href="' . ADMIN_URL . '/addons/index.php?advanced">' . $TEXT['ADVANCED'] . '</a>' : '',
74
	'ADVANCED_URL' => $admin->get_permission('admintools') ? ADMIN_URL . '/addons/index.php' : '',
76
	'ADVANCED_URL' => $admin->get_permission('modules_advanced') ? ADMIN_URL . '/addons/index.php' : '',
75 77
    'TEXT_ADVANCED' => $TEXT['ADVANCED'],
76
	'FTAN'			=> $admin->getFTAN()
78
    'TEXT_EMPTY' => '&nbsp;',
77 79
	)
78 80
);
79 81

  
......
84 86
if ( $admin->get_permission('templates') == true) { $template->parse('main_block', "templates_block", true); }
85 87
if ( $admin->get_permission('languages') == true) { $template->parse('main_block', "languages_block", true); }
86 88
// start advanced block
87
if ( isset($_GET['advanced']) AND $admin->get_permission('admintools') == true) {
89
if ( isset($_GET['advanced']) AND $admin->get_permission('modules_advanced') == true) {
88 90
	$template->set_var(array(
89 91
		'TXT_THEME_COPY_CURRENT'  => $TEXT['THEME_COPY_CURRENT'],
90 92
		'TXT_THEME_NEW_NAME'      => $TEXT['THEME_NEW_NAME'],
branches/2.8.x/wb/framework/class.login.php
80 80
			$sql  = 'SELECT * FROM `'.$this->users_table.'` ';
81 81
			$sql .= 'WHERE `user_id`=\''.$this->get_safe_remember_key().'\'';
82 82
			$query_details = $database->query($sql);
83
			$fetch_details = $query_details->fetchRow();
83
			$fetch_details = $query_details->fetchRow(MYSQL_ASSOC);
84 84
			$this->username = $fetch_details['username'];
85 85
			$this->password = $fetch_details['password'];
86 86
			// Check if the user exists (authenticate them)
......
188 188
			$_SESSION['TEMPLATE_PERMISSIONS'] = array();
189 189
			$_SESSION['GROUP_NAME'] = array();
190 190

  
191
            $aGroupsIds = ((explode(',', $this->get_session('GROUPS_ID'))));
192
            $bOnlyAdminGroup = $this->ami_group_member('1') && (sizeof($aGroupsIds) == 1);
193
			$first_group = true;
191 194

  
192

  
193
			$first_group = true;
194
			foreach (explode(",", $this->get_session('GROUPS_ID')) as $cur_group_id)
195
			foreach ( $aGroupsIds  as $cur_group_id)
195 196
            {
196 197
				$sql = 'SELECT * FROM `'.$this->groups_table.'` WHERE `group_id`=\''.$cur_group_id.'\'';
197
				$results = $database->query($sql);
198
				$results_array = $results->fetchRow();
199
				$_SESSION['GROUP_NAME'][$cur_group_id] = $results_array['name'];
198
				if($results = $database->query($sql)) {
199
    				$results_array = $results->fetchRow(MYSQL_ASSOC);
200
    				$_SESSION['GROUP_NAME'][$cur_group_id] = $results_array['name'];
201
				}
202

  
200 203
				// Set system permissions
201
				if( $results_array['system_permissions'] != '' ) {
202
					$_SESSION['SYSTEM_PERMISSIONS'] = array_merge($_SESSION['SYSTEM_PERMISSIONS'], explode(',', $results_array['system_permissions']));
204
				if( ($results_array['system_permissions'] != '') ) {
205
                    switch ($cur_group_id) :
206
                        case 1:
207
                            if($bOnlyAdminGroup) {
208
                                $_SESSION['SYSTEM_PERMISSIONS'] = array_merge($_SESSION['SYSTEM_PERMISSIONS'], explode(',', $results_array['system_permissions']));
209
                            }
210
                            break;
211
                        default:
212
        					$_SESSION['SYSTEM_PERMISSIONS'] = array_merge($_SESSION['SYSTEM_PERMISSIONS'], explode(',', $results_array['system_permissions']));
213
                    endswitch;
203 214
				}
215

  
204 216
				// Set module permissions
205 217
				if( $results_array['module_permissions'] != '' ) {
206 218
					if ($first_group) {
......
220 232
				$first_group = false;
221 233
			}
222 234

  
223
            if( $this->ami_group_member('1')) {
235
            if( $$bOnlyAdminGroup ) {
224 236
    			$_SESSION['MODULE_PERMISSIONS'] = array();
225 237
    			$_SESSION['TEMPLATE_PERMISSIONS'] = array();
226 238
            }
branches/2.8.x/wb/templates/wb_theme/css/screen.css
260 260
div.page-settings-leftcol label a:link { text-decoration :none; color :#003366; }
261 261
div.page-settings-leftcol label a:hover { color :#006699; text-decoration :underline; }
262 262
div.page-settings-leftcol textarea { resize :vertical; }
263
#overDiv { max-width :450px; background-position :center; background-attachment :fixed; text-align :left; padding :1px; font-size :120%; }
263
#overDiv { max-width :450px; background-position :center; background-attachment :fixed; text-align :left; line-height :1em; padding :1px; font-size :120%; }
264 264
div.page-settings span.overlib { width :20px; margin-left :-20px; }
265 265

  
266 266
/* */
branches/2.8.x/wb/templates/argos_theme/css/screen.css
294 294
div.page-settings-leftcol label a:link { text-decoration :none; color :#003366; }
295 295
div.page-settings-leftcol label a:hover { color : #006699; text-decoration : underline; }
296 296
div.page-settings-leftcol textarea { resize :vertical; } 
297
#overDiv { max-width :450px; background-position :center; background-attachment :fixed; text-align :left; padding :1px; font-size :120%; }
297
#overDiv { max-width :450px; background-position :center; background-attachment :fixed; text-align :left; line-height :1em; padding :1px; font-size :120%; }
298 298
div.page-settings span.overlib { width :20px; margin-left :-20px; }
299 299
/* */
300 300
div.page_group { height: 180px;max-height: 260px; margin: 0; padding: 0; overflow: auto; }
branches/2.8.x/wb/install/save.php
549 549
	// Admin group
550 550
	$full_system_permissions  = 'access,addons,admintools,admintools_view,groups,groups_add,groups_delete,groups_modify,groups_view,';
551 551
	$full_system_permissions .= 'languages,languages_install,languages_uninstall,languages_view,media,media_create,media_delete,media_rename,media_upload,media_view,';
552
	$full_system_permissions .= 'modules,modules_install,modules_uninstall,modules_view,pages,pages_add,pages_add_l0,pages_delete,pages_intro,pages_modify,pages_settings,pages_view,';
552
	$full_system_permissions .= 'modules,modules_advanced,modules_install,modules_uninstall,modules_view,pages,pages_add,pages_add_l0,pages_delete,pages_intro,pages_modify,pages_settings,pages_view,';
553 553
	$full_system_permissions .= 'preferences,preferences_view,settings,settings_advanced,settings_basic,settings_view,templates,templates_install,templates_uninstall,templates_view,users,users_add,users_delete,users_modify,users_view';
554 554
	$insert_admin_group = "INSERT INTO `".TABLE_PREFIX."groups` VALUES ('1', 'Administrators', '$full_system_permissions', '', '')";
555 555
	$database->query($insert_admin_group);

Also available in: Unified diff