Project

General

Profile

« Previous | Next » 

Revision 2076

Added by darkviper almost 11 years ago

  1. some fixes in admin/users
  2. some fixes in admin/pages

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12
===============================================================================
13 13

  
14
06 Jan-2014 Build 2076 Manuela v.d.Decken(DarkViper)
15
# some fixes in admin/users
16
# some fixes in admin/pages
14 17
06 Jan-2014 Build 2075 Manuela v.d.Decken(DarkViper)
15 18
! Installer and upgradescript will never start with php below 5.3.2
16 19
# little correction for autoloading PHPMailer in install/save
branches/2.8.x/wb/admin/skel/themes/htt/users.htt
35 35
    <!-- END list_confirmed_activation_block -->
36 36
    </select>
37 37
    <input type="submit" name="delete_outdated" style="width: 100px;" value="{TEXT_DELETE}" onclick="return confirm('{CONFIRM_DELETE}');" class="{DISPLAY_DELETE}" />
38
    <input type="submit" name="enable_outdated" style="width: 100px;" value="{TEXT_USER_ACTIVATE}" onclick="return confirm('{CONFIRM_DELETE}');" class="{DISPLAY_DELETE}" />
38 39
<!-- END show_confirmed_activation_block -->
39 40

  
40 41
</form>
branches/2.8.x/wb/admin/skel/themes/htt/pages_settings.htt
41 41
				<label for="page_title">{TEXT_PAGE_TITLE}:</label>
42 42
				<input type="text" id="page_title" name="page_title" value="{PAGE_TITLE}" />
43 43
			</div>
44
			<div class="{PAGE_EXTENDET_HIDE}">
44
			<div id="extented" style="{PAGE_ICONDIR_HIDE}">
45 45
				<label for="page_icon" class="overlib"
46 46
					style="background-image: url({THEME_URL}/icons/help_16.png);"
47
					{p_page_icon_dir}>{TEXT_PAGE_ICON}: 
47
					{p_page_icon_dir}>{TEXT_PAGE_ICON}:
48 48
				</label>
49 49
				<select id="page_icon" name="page_icon">
50 50
					<option value="0">--- {TEXT_NO_SELECTION} ---</option>
......
256 256
			<input type="submit" name="submit" value="{TEXT_SAVE}" />
257 257
			<input type="submit" name="back_submit" value="{TEXT_SAVE_BACK}" />
258 258
			<span style="padding-left: 2em;"><input type="reset" name="reset" value="{TEXT_RESET}" />
259
		<!-- BEGIN show_extended_input_block -->
259 260
			<input type="submit" value="{TEXT_EXTENDED}" id="{VISIBILITY}_extended" name="extendet_submit" /></span>
261
		<!-- END show_extended_input_block -->
260 262
		</div>
261 263
	</div>
262 264
</form>
263
<!-- END main_block -->
265
<!-- END main_block -->
branches/2.8.x/wb/admin/pages/settings.php
114 114
		{
115 115
			$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
116 116
		}
117
	}else {
117
	} else {
118 118
		$admin->print_header();
119 119
		$admin->print_error($database->get_error());
120 120
	}
......
238 238
	}
239 239

  
240 240
/*-- collect page-icons for select boxes -----------------------------------------------*/
241
  $sAllowedImageTypes = '\.jpg|\.jpeg|\.png|\.gif';
241
    $sAllowedImageTypes = '\.jpg|\.jpeg|\.png|\.gif';
242 242
	$aPageIcons = array();
243 243
	$aIcon = array();
244 244
	$sTemplate = ($aCurrentPage['template'] == '' ? DEFAULT_TEMPLATE : $aCurrentPage['template']);
245 245
	$sIconDir = str_replace('\\', '/', ((defined('PAGE_ICON_DIR') && PAGE_ICON_DIR != '') ? PAGE_ICON_DIR : MEDIA_DIRECTORY));
246 246
	$sIconDir = str_replace('/*', '/'.$sTemplate, $sIconDir);
247
	$bIconDirHide = ($page_extend==true) ? 'display:block;' : 'display:none;';
247
	$bMenuIconDirHide = (($page_extend==true) ? 'display:block;' : 'display:none;');
248
	$bPageIconDirHide = (($page_extend==true) ? 'display:block;' : 'display:none;');
249
//	$bPageIconDirHide = (($page_extend==true)||($admin->get_permission('media_view') == true) ? 'display:block;' : 'display:none;');
248 250

  
249 251
//	$oTpl->set_var('ICON_DIR', WB_REL.$sIconDir);
250 252
	$sHelp = replaceVars($mLang->HELP_PAGE_IMAGE_DIR, array('icon_dir'=>WB_REL.$sIconDir ) );
......
254 256
	$sAccesFile = (($database->get_one($sql)));
255 257
	$sFilename = replaceVars($mLang->HELP_SEO_TITLE, array('filename'=>PAGES_DIRECTORY.$sAccesFile.PAGE_EXTENSION ) );
256 258

  
257
	$oTpl->set_var('PAGE_EXTENDET_HIDE',  $bIconDirHide);
259
	$oTpl->set_var('PAGE_ICONDIR_HIDE',  $bPageIconDirHide);
260
	$oTpl->set_var('PAGE_EXTENDET_HIDE', $bMenuIconDirHide);
258 261
	$oTpl->set_var('p_page_icon_dir',  p($sHelp,$mLang->TEXT_PAGE_ICON_DIR));
259 262
	$oTpl->set_var('p_menu_icon0_dir', p($sHelp,$mLang->TEXT_MENU_ICON_0_DIR));
260 263
	$oTpl->set_var('p_menu_icon1_dir', p($sHelp,$mLang->TEXT_MENU_ICON_1_DIR));
......
495 498
		$iLastEntryLevel = 0;
496 499
		$bSkipChildren = false;
497 500
	// loop through all items
498
		while (list(, $aPage) = each($aLangCodePagesList)) 
501
		while (list(, $aPage) = each($aLangCodePagesList))
499 502
		{
500 503
		// skip child pages where current user has no rights for
501 504
			if($bSkipChildren && ($aPage['level'] > $iLastEntryLevel)) { continue; }
......
515 518
			    && $aCurrentPage['page_code'] != 0
516 519
				&& !$bPageCodeIsSelected
517 520
			  )
518
			{ // 
521
			{ //
519 522
				$aTplItemData['PAGE_CODE_SELECTED'] = $sSelected;
520 523
				$bPageCodeIsSelected = true;
521 524
			} elseif(!$aPage['iswriteable'])
522
			{ // 
525
			{ //
523 526
				$aTplItemData['PAGE_CODE_SELECTED'] = $sDisabled.' class="disabled"';
524 527
				$bSkipChildren = true;
525 528
			} else {
......
634 637
	$oTpl->set_var('SELF_SELECTED',  ($aCurrentPage['target'] == '_self'  ? $sSelected : ''));
635 638
	$oTpl->set_var('BLANK_SELECTED', ($aCurrentPage['target'] == '_blank' ? $sSelected : ''));
636 639

  
640
/*-- show_extended_input_block ---------------------------------------------------------*/
641
	$oTpl->set_block('main_block', 'show_extended_input_block', 'extended_input');
642
	if($admin->get_permission('settings_advanced') == true) {
643
		$oTpl->parse('extended_input', 'show_extended_input_block', true);
644
	} else {
645
		$oTpl->parse('extended_input', '', true);
646
	}
637 647
/*-- insert all needed vars from language files ----------------------------------------*/
638 648
	$oTpl->set_var($mLang->getLangArray());
639 649
/*-- finalize the page -----------------------------------------------------------------*/
......
686 696
		}
687 697
	}
688 698
	return $subject;
689
}
699
}
branches/2.8.x/wb/admin/pages/sections.php
35 35
$debug = true; // to show position
36 36
If(!defined('DEBUG')) { define('DEBUG',$debug);}
37 37
// Create new admin object
38
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
38
// if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
39 39
$admin = new admin('Pages', 'pages_view', false);
40

  
41 40
// Include the WB functions file
42 41
if(!function_exists('directory_list')) { require(WB_PATH.'/framework/functions.php'); }
43 42
$mLang = Translate::getinstance();
44 43
$mLang->enableAddon('admin\pages');
45

  
44
$oDb = WbDatabase::getInstance();
46 45
$action = 'show';
47 46
// Get page id
48 47
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
......
64 63
        if($admin->get_permission('pages_delete') == false)
65 64
        {
66 65
			$admin->print_header();
67
			$admin->print_error($module.' '.strtolower($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']),$backlink);
66
			$admin->print_error($module.' '.mb_strtolower($mLang->MESSAGE_PAGES_INSUFFICIENT_PERMISSIONS, 'UTF-8'), $backlink);
68 67
        }
69 68

  
70 69
		if( ( !($section_id = intval($admin->checkIDKEY('section_id', 0, $_SERVER['REQUEST_METHOD'])) )) )
71 70
		{
72 71
			if($admin_header) { $admin->print_header(); }
73
			$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],$backlink);
72
			$admin->print_error($mlang->MESSAGE_GENERIC_SECURITY_ACCESS,$backlink);
74 73
		}
75 74

  
76 75
		$action = 'show';
77
	    $sql  = 'SELECT `module` FROM `'.TABLE_PREFIX.'sections` ';
78
	    $sql .= 'WHERE `section_id` ='.$section_id;
79
        if( ( ($modulname = $database->get_one($sql)) == $module) && ($section_id > 0 ) ) {
76
	    $sql = 'SELECT `module` FROM `'.$oDb->TablePrefix.'sections` '
77
	         . 'WHERE `section_id` ='.$section_id;
78
        if ((($modulname = $oDb->getOne($sql)) == $module) && ($section_id > 0 ) ) {
80 79
			// Include the modules delete file if it exists
81 80
			if(file_exists(WB_PATH.'/modules/'.$modulname.'/delete.php'))
82 81
		    {
83 82
				require(WB_PATH.'/modules/'.$modulname.'/delete.php');
84 83
			}
85
		    $sql  = 'DELETE FROM `'.TABLE_PREFIX.'sections` ';
86
		    $sql .= 'WHERE `section_id` ='.(int)$section_id.' LIMIT 1';
87
			if( !$database->query($sql) ) {
84
		    $sql = 'DELETE FROM `'.$oDb->TablePrefix.'sections` '
85
		         . 'WHERE `section_id` ='.(int)$section_id.' LIMIT 1';
86
			if (!$oDb->doQuery($sql)) {
88 87
				if($admin_header) { $admin->print_header(); }
89
				$admin->print_error($database->get_error(),$backlink);
90
			}  else {
88
				$admin->print_error($oDb->get_error(),$backlink);
89
			} else {
91 90
				require_once(WB_PATH.'/framework/class.order.php');
92
				$order = new order(TABLE_PREFIX.'sections', 'position', 'section_id', 'page_id');
91
				$order = new order($oDb->TablePrefix.'sections', 'position', 'section_id', 'page_id');
93 92
				$order->clean($page_id);
94
				$format = $mLang->TEXT_SECTION.' %d  %s %s '.strtolower( $mLang->TEXT_DELETED);
95
				$message = sprintf ($format,$section_id,strtoupper($modulname),strtolower($mLang->TEXT_SUCCESS));
93
				$format = $mLang->TEXT_SECTION.' %d  %s %s '.mb_strtolower($mLang->TEXT_DELETED, 'UTF-8');
94
				$message = sprintf ($format,$section_id, mb_strtoupper($modulname, 'UTF-8'),mb_strtolower($mLang->TEXT_SUCCESS, 'UTF-8'));
96 95
				if($admin_header) { $admin->print_header(); }
97 96
				$admin_header = false;
98 97
				unset($_POST);
......
100 99
			}
101 100
        } else {
102 101
			if($admin_header) { $admin->print_header(); }
103
			$admin->print_error($module.' '.strtolower($mLang->TEXT_NOT_FOUND),$backlink);
102
			$admin->print_error($module.' '.mb_strtolower($mLang->TEXT_NOT_FOUND, 'UTF-8'),$backlink);
104 103
        }
105 104

  
106 105
		break;
......
108 107
        if($admin->get_permission('pages_add') == false)
109 108
        {
110 109
			$admin->print_header();
111
			$admin->print_error($module.' '.strtolower($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']),$backlink);
110
			$admin->print_error($module.' '.mb_strtolower($mLang->MESSAGE_PAGES_INSUFFICIENT_PERMISSIONS, 'UTF-8'),$backlink);
112 111
        }
113 112
		if (!$admin->checkFTAN())
114 113
		{
115 114
			$admin->print_header();
116
			$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],$backlink);
115
			$admin->print_error($mLang->MESSAGE_GENERIC_SECURITY_ACCESS,$backlink);
117 116
		}
118 117
		$action = 'show';
119 118
		$module = preg_replace('/\W/', '', $module );  // fix secunia 2010-91-4
120 119
		require_once(WB_PATH.'/framework/class.order.php');
121 120
		// Get new order
122
		$order = new order(TABLE_PREFIX.'sections', 'position', 'section_id', 'page_id');
121
		$order = new order($oDb->TablePrefix.'sections', 'position', 'section_id', 'page_id');
123 122
		$position = $order->get_new($page_id);
124 123
		// Insert module into DB
125
	    $sql  = 'INSERT INTO `'.TABLE_PREFIX.'sections` SET ';
126
	    $sql .= '`page_id` = '.(int)$page_id.', ';
127
	    $sql .= '`module` = \''.$module.'\', ';
128
	    $sql .= '`position` = '.(int)$position.', ';
129
	    $sql .= '`block` = \'1\', ';
130
        $sql .= '`publ_start` = \'0\',';
131
        $sql .= '`publ_end` = \'0\' ';
124
	    $sql  = 'INSERT INTO `'.$oDb->TablePrefix.'sections` '
125
              . 'SET `page_id` = '.(int)$page_id.', '
126
              .     '`module` = \''.$module.'\', '
127
	          .     '`position` = '.(int)$position.', '
128
	          .     '`block` = \'1\', '
129
              .     '`publ_start` = \'0\', '
130
              .     '`publ_end` = \'0\'';
132 131

  
133
        if($database->query($sql)) {
132
        if($oDb->doQuery($sql)) {
134 133
			// Get the section id
135
			$section_id = $database->get_one("SELECT LAST_INSERT_ID()");
134
			$section_id = $oDb->getOne('SELECT LAST_INSERT_ID()');
136 135
			// Include the selected modules add file if it exists
137 136
			if(file_exists(WB_PATH.'/modules/'.$module.'/add.php'))
138 137
		    {
139 138
				require(WB_PATH.'/modules/'.$module.'/add.php');
140 139
			}
141
        } elseif ($database->is_error())  {
140
        } elseif ($oDb->is_error())  {
142 141
			if($admin_header) { $admin->print_header(); }
143
			$admin->print_error($database->get_error());
142
			$admin->print_error($oDb->get_error());
144 143
		}
145 144
		break;
146 145
	default:
......
152 151

  
153 152
		if($admin_header) { $admin->print_header(); }
154 153
		// Get perms
155
		$sql  = 'SELECT `admin_groups`,`admin_users` FROM `'.TABLE_PREFIX.'pages` ';
156
		$sql .= 'WHERE `page_id` = '.$page_id;
157
		$results = $database->query($sql);
158

  
159
		$results_array = $results->fetchRow();
160
		$old_admin_groups = explode(',', $results_array['admin_groups']);
161
		$old_admin_users = explode(',', $results_array['admin_users']);
162
		$in_old_group = FALSE;
163
		foreach($admin->get_groups_id() as $cur_gid)
164
		{
165
			if (in_array($cur_gid, $old_admin_groups))
166
		    {
167
				$in_old_group = TRUE;
168
			}
169
		}
170
		if((!$in_old_group) && !is_numeric(array_search($admin->get_user_id(), $old_admin_users)))
171
		{
154
		$sql  = 'SELECT `admin_groups`,`admin_users` FROM `'.$oDb->TablePrefix.'pages` '
155
		      . 'WHERE `page_id` = '.$page_id;
156
		$oPage = $oDb->doQuery($sql);
157
		$aPageRights = $oPage->fetchRow(MYSQL_ASSOC);
158
    // Get user permisions
159
        if (!$admin->ami_group_member($aPageRights['admin_groups']) && !$admin->is_group_match($admin->get_user_id(), $aPageRights['admin_users'])) {
172 160
			$admin->print_header();
173
			$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
174
		}
175

  
161
			$admin->print_error($mLang->MESSAGE_PAGES_INSUFFICIENT_PERMISSIONS);
162
        }
163
//		$old_admin_groups = explode(',', $results_array['admin_groups']);
164
//		$old_admin_users = explode(',', $results_array['admin_users']);
165
//		$in_old_group = FALSE;
166
//		foreach($admin->get_groups_id() as $cur_gid)
167
//		{
168
//			if (in_array($cur_gid, $old_admin_groups))
169
//		    {
170
//				$in_old_group = TRUE;
171
//			}
172
//		}
173
//		if((!$in_old_group) && !is_numeric(array_search($admin->get_user_id(), $old_admin_users)))
174
//		{
175
//			$admin->print_header();
176
//			$admin->print_error($mLang->MESSAGE_PAGES_INSUFFICIENT_PERMISSIONS);
177
//		}
176 178
		// Get page details
177
		$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'pages` ';
179
		$sql  = 'SELECT * FROM `'.$oDb->TablePrefix.'pages` ';
178 180
		$sql .= 'WHERE `page_id` = '.$page_id;
179
		$results = $database->query($sql);
181
		$results = $oDb->doQuery($sql);
180 182

  
181
		if($database->is_error())
183
		if($oDb->is_error())
182 184
		{
183 185
			// $admin->print_header();
184
			$admin->print_error($database->get_error());
186
			$admin->print_error($oDb->get_error());
185 187
		}
186 188
		if($results->numRows() == 0)
187 189
		{
188 190
			// $admin->print_header();
189
			$admin->print_error($MESSAGE['PAGES_NOT_FOUND']);
191
			$admin->print_error($mLang->MESSAGE_PAGES_NOT_FOUND);
190 192
		}
191 193
		$results_array = $results->fetchRow();
192 194

  
......
215 217
		{
216 218
			require($template_location);
217 219
		}
218
 // check block settings from template/info.php
219
	if(isset($block) && is_array($block) && sizeof($block) > 0) {
220
		if(isset($block[0])) {
221
		throw new AppException('Invalid index 0 for $block[] in '.str_replace(WB_PATH,'',$template_location).'. '
222
		                     . 'The list must start with $block[1]. Please correct it!');
223
		}
224
		foreach($block as $iIndex=>$sBlockTitle) {
225
			if(trim($sBlockTitle) == '' ) {
226
			 $block[$iIndex] = $mLang->TEXT_BLOCK.'_'.$iIndex;
227
			}
228
		}
229
	}else {
230
		// Make our own menu list
231
		$block = array(1, $mLang->TEXT_MAIN);
232
	}
220
    // check block settings from template/info.php
221
       if(isset($block) && is_array($block) && sizeof($block) > 0) {
222
           if(isset($block[0])) {
223
           throw new AppException('Invalid index 0 for $block[] in '.str_replace(WB_PATH,'',$template_location).'. '
224
                                . 'The list must start with $block[1]. Please correct it!');
225
           }
226
           foreach($block as $iIndex=>$sBlockTitle) {
227
               if(trim($sBlockTitle) == '' ) {
228
                $block[$iIndex] = $mLang->TEXT_BLOCK.'_'.$iIndex;
229
               }
230
           }
231
       }else {
232
           // Make our own menu list
233
           $block = array(1 => $mLang->TEXT_MAIN);
234
       }
233 235
		/*-- load css files with jquery --*/
234 236
		// include jscalendar-setup
235 237
		$jscal_use_time = true; // whether to use a clock, too
......
257 259
						'MENU_TITLE' => ($results_array['menu_title']),
258 260
						'TEXT_CURRENT_PAGE' => $mLang->TEXT_CURRENT_PAGE,
259 261
						'TEXT_LAST_MODIFIED' => $mLang->TEXT_LAST_UPDATED_BY,
260
						'HEADING_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
261
						'HEADING_MODIFY_PAGE' => $HEADING['MODIFY_PAGE'],
262
						'HEADING_MANAGE_SECTIONS' => $mLang->HEADING_MANAGE_SECTIONS,
263
						'HEADING_MODIFY_PAGE' => $mLang->HEADING_MODIFY_PAGE,
262 264
						'TEXT_CHANGE_SETTINGS' => $mLang->TEXT_CHANGE_SETTINGS,
263 265
						'TEXT_ADD_SECTION' => $mLang->TEXT_ADD_SECTION,
264 266
						'TEXT_SECTION' => $mLang->TEXT_SECTION,
265 267
						'TEXT_ID' => 'ID',
266 268
						'TEXT_TYPE' => $mLang->TEXT_TYPE,
267 269
						'TEXT_BLOCK' => $mLang->TEXT_BLOCK,
268
						'TEXT_PUBL_START_DATE' => $TEXT{'PUBL_START_DATE'},
270
						'TEXT_PUBL_START_DATE' => $mLang->TEXT_PUBL_START_DATE,
269 271
						'TEXT_PUBL_END_DATE' => $mLang->TEXT_PUBL_END_DATE,
270 272
						'TEXT_ACTIONS' => $mLang->TEXT_ACTIONS,
271 273
						'MODIFIED_BY'          => $user['display_name'],
......
320 322
					);
321 323
// setting trash only if more than one section exists
322 324
		$tpl->set_block('section_block', 'delete_block', 'delete');
323
		if( $bSectionCanDelete = ($database->get_one('SELECT COUNT(*) FROM `'.TABLE_PREFIX.'sections` WHERE `page_id`='.$page_id))!=1 ) {
325
        $sql = 'SELECT COUNT(*) FROM `'.$oDb->TablePrefix.'sections` '
326
             . 'WHERE `page_id`='.$page_id;
327
		$bSectionCanDelete = ($oDb->getOne($sql) > 1);
328
		$sql = 'SELECT `section_id`,`module`,`position`,`block`,`publ_start`,`publ_end` '
329
		     . 'FROM `'.$oDb->TablePrefix.'sections` '
330
		     . 'WHERE `page_id` = '.$page_id.' '
331
		     . 'ORDER BY `position` ASC';
332
		$query_sections = $oDb->doQuery($sql);
333
        $num_sections = $query_sections->numRows();
334
        while ($section = $query_sections->fetchRow(MYSQL_ASSOC)) {
335
            if (!is_numeric(array_search($section['module'], $module_permissions))) {
336
                // Get the modules real name
337
                $sql = 'SELECT `name` FROM `'.$oDb->TablePrefix.'addons` '
338
                     . 'WHERE `directory` = "'.$section['module'].'"';
339
                if (!$oDb->getOne($sql) || !file_exists(WB_PATH.'/modules/'.$section['module'])) {
340
                    $edit_page = '<span class="module_disabled">'.$section['module'].'</span>';
341
                } else {
342
                    $edit_page = '';
343
                }
344
                $sSectionIdPrefix = ( defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR : 'Sec');
345
                $edit_page_0 = '<a id="sid'.$section['section_id'].'" href="'.ADMIN_URL.'/pages/modify.php?page_id='.$results_array['page_id'];
346
                $edit_page_1  = ($sSectionIdPrefix!='') ? '#'.$sSectionIdPrefix.$section['section_id'].'">' : '">';
347
                $edit_page_1 .= $section['module'].'</a>';
348
                if (SECTION_BLOCKS) {
349
                    if ($edit_page == '') {
350
                        if (defined('EDIT_ONE_SECTION') && EDIT_ONE_SECTION) {
351
                            $edit_page = $edit_page_0.'&amp;wysiwyg='.$section['section_id'].$edit_page_1;
352
                        } else {
353
                            $edit_page = $edit_page_0.$edit_page_1;
354
                        }
355
                    }
356
                    $input_attribute = 'input_normal';
357
                    $tpl->set_var(array(
358
                            'STYLE_DISPLAY_SECTION_BLOCK' => ' style="visibility:visible;"',
359
                            'NAME_SIZE' => 300,
360
                            'INPUT_ATTRIBUTE' => $input_attribute,
361
                            'VAR_SECTION_ID' => $section['section_id'],
362
                            'VAR_SECTION_IDKEY' => $admin->getIDKEY($section['section_id']),
363
                            // 'VAR_SECTION_IDKEY' => $section['section_id'],
364
                            'VAR_POSITION' => $section['position'],
365
                            'LINK_MODIFY_URL_VAR_MODUL_NAME' => $edit_page,
366
                            'SELECT' => '',
367
                            'SET_NONE_DISPLAY_OPTION' => ''
368
                            )
369
                        );
370
                    // Add block options to the section_list
371
                    $tpl->clear_var('block_list');
372
                    foreach ($block AS $number => $name) {
373
                        $tpl->set_var('NAME', htmlentities(strip_tags($name)));
374
                        $tpl->set_var('VALUE', $number);
375
                        $tpl->set_var('SIZE', 1);
376
                        if ($section['block'] == $number) {
377
                            $tpl->set_var('SELECTED', ' selected="selected"');
378
                        } else {
379
                            $tpl->set_var('SELECTED', '');
380
                        }
381
                        $tpl->parse('block_list', 'block_block', true);
382
                    }
383
                } else {
384
                    if ($edit_page == '') {
385
                        $edit_page = $edit_page_0.'#wb_'.$edit_page_1;
386
                    }
387
                    $input_attribute = 'input_normal';
388
                    reset($block);
389
                    $tpl->set_var(array(
390
                            'STYLE_DISPLAY_SECTION_BLOCK' => ' style="visibility:hidden;"',
391
                            'NAME_SIZE' => 300,
392
                            'INPUT_ATTRIBUTE' => $input_attribute,
393
                            'VAR_SECTION_ID' => $section['section_id'],
394
                            'VAR_SECTION_IDKEY' => $admin->getIDKEY($section['section_id']),
395
                            // 'VAR_SECTION_IDKEY' => $section['section_id'],
396
                            'VAR_POSITION' => $section['position'],
397
                            'LINK_MODIFY_URL_VAR_MODUL_NAME' => $edit_page,
398
                            'NAME' => htmlentities(strip_tags(key($block))),
399
                            'VALUE' => 1,
400
                            'SET_NONE_DISPLAY_OPTION' => '<option>&nbsp;</option>'
401
                            )
402
                        );
403
                }
404
                // Insert icon and images
405
                $tpl->set_var(array(
406
                            'CLOCK_16_PNG' => 'clock_16.png',
407
                            'CLOCK_DEL_16_PNG' => 'clock_del_16.png',
408
                            'DELETE_16_PNG' => 'delete_16.png'
409
                            )
410
                        );
411
                // set calendar start values
412
                if ($section['publ_start']==0) {
413
                    $tpl->set_var('VALUE_PUBL_START', '');
414
                } else {
415
                    $tpl->set_var('VALUE_PUBL_START', date($jscal_format, $section['publ_start']+TIMEZONE));
416
                }
417
                // set calendar start values
418
                if ($section['publ_end']==0) {
419
                    $tpl->set_var('VALUE_PUBL_END', '');
420
                } else {
421
                    $tpl->set_var('VALUE_PUBL_END', date($jscal_format, $section['publ_end']+TIMEZONE));
422
                }
423
                // Insert icons up and down
424
                if ($section['position'] != 1 ) {
425
                    $tpl->set_var(
426
                                'VAR_MOVE_UP_URL',
427
                                '<a href="'.ADMIN_URL.'/pages/move_up.php?page_id='.$page_id.'&amp;section_id='.$section['section_id'].'">
428
                                <img src="'.THEME_URL.'/images/up_16.png" alt="{TEXT_MOVE_UP}" />
429
                                </a>' );
430
                } else {
431
                    $tpl->set_var(array(
432
                                'VAR_MOVE_UP_URL' => ''
433
                                )
434
                            );
435
                }
436
                if ($section['position'] != $num_sections ) {
437
                    $tpl->set_var(
438
                                'VAR_MOVE_DOWN_URL',
439
                                '<a href="'.ADMIN_URL.'/pages/move_down.php?page_id='.$page_id.'&amp;section_id='.$section['section_id'].'">
440
                                <img src="'.THEME_URL.'/images/down_16.png" alt="{TEXT_MOVE_DOWN}" />
441
                                </a>' );
442
                } else {
443
                    $tpl->set_var(array(
444
                                'VAR_MOVE_DOWN_URL' => ''
445
                                )
446
                            );
447
                }
448
            } else { continue; }
449
            $tpl->set_var(array(
450
                            'DISPLAY_DEBUG' => ' style="visibility:visible;"',
451
                            'TEXT_SID' => 'SID',
452
                            'DEBUG_COLSPAN_SIZE' => 9
453
                            )
454
                        );
455
            if ($debug) {
456
                $tpl->set_var(array(
457
                                'DISPLAY_DEBUG' => ' style="visibility:visible;"',
458
                                'TEXT_PID' => 'PID',
459
                                'TEXT_SID' => 'SID',
460
                                'POSITION' => $section['position']
461
                                )
462
                            );
463
            } else {
464
                $tpl->set_var(array(
465
                                'DISPLAY_DEBUG' => ' style="display:none;"',
466
                                'TEXT_PID' => '',
467
                                'POSITION' => ''
468
                                )
469
                            );
470
            }
471
            if ($bSectionCanDelete) {
472
                $tpl->parse('delete', 'delete_block', false);
473
            } else {
474
                $tpl->parse('delete', '', false);
475
            }
476
            $tpl->parse('section_list', 'section_block', true);
324 477
		}
325 478

  
326
		$sql  = 'SELECT `section_id`,`module`,`position`,`block`,`publ_start`,`publ_end` ';
327
		$sql .= 'FROM `'.TABLE_PREFIX.'sections` ';
328
		$sql .= 'WHERE `page_id` = '.$page_id.' ';
329
		$sql .= 'ORDER BY `position` ASC';
330
		$query_sections = $database->query($sql);
331

  
332
		if($query_sections->numRows() > 0)
333
		{
334
			$num_sections = $query_sections->numRows();
335
			while($section = $query_sections->fetchRow(MYSQL_ASSOC))
336
		    {
337
				if(!is_numeric(array_search($section['module'], $module_permissions)))
338
		        {
339
					// Get the modules real name
340
		            $sql = 'SELECT `name` FROM `'.TABLE_PREFIX.'addons` ';
341
		            $sql .= 'WHERE `directory` = "'.$section['module'].'"';
342
		            if(!$database->get_one($sql) || !file_exists(WB_PATH.'/modules/'.$section['module']))
343
					{
344
						$edit_page = '<span class="module_disabled">'.$section['module'].'</span>';
345
					}else
346
					{
347
						$edit_page = '';
348
					}
349
					$sSectionIdPrefix = ( defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR : 'Sec');
350
					$edit_page_0 = '<a id="sid'.$section['section_id'].'" href="'.ADMIN_URL.'/pages/modify.php?page_id='.$results_array['page_id'];
351
					$edit_page_1  = ($sSectionIdPrefix!='') ? '#'.$sSectionIdPrefix.$section['section_id'].'">' : '">';
352
					$edit_page_1 .= $section['module'].'</a>';
353
					if(SECTION_BLOCKS)
354
		            {
355
						if($edit_page == '')
356
						{
357
							if(defined('EDIT_ONE_SECTION') && EDIT_ONE_SECTION)
358
							{
359
								$edit_page = $edit_page_0.'&amp;wysiwyg='.$section['section_id'].$edit_page_1;
360
							} else {
361
								$edit_page = $edit_page_0.$edit_page_1;
362
							}
363
						}
364
						$input_attribute = 'input_normal';
365
						$tpl->set_var(array(
366
								'STYLE_DISPLAY_SECTION_BLOCK' => ' style="visibility:visible;"',
367
								'NAME_SIZE' => 300,
368
								'INPUT_ATTRIBUTE' => $input_attribute,
369
								'VAR_SECTION_ID' => $section['section_id'],
370
								'VAR_SECTION_IDKEY' => $admin->getIDKEY($section['section_id']),
371
								// 'VAR_SECTION_IDKEY' => $section['section_id'],
372
								'VAR_POSITION' => $section['position'],
373
								'LINK_MODIFY_URL_VAR_MODUL_NAME' => $edit_page,
374
								'SELECT' => '',
375
								'SET_NONE_DISPLAY_OPTION' => ''
376
								)
377
							);
378
						// Add block options to the section_list
379
						$tpl->clear_var('block_list');
380
						foreach($block AS $number => $name)
381
		                {
382
							$tpl->set_var('NAME', htmlentities(strip_tags($name)));
383
							$tpl->set_var('VALUE', $number);
384
							$tpl->set_var('SIZE', 1);
385
							if($section['block'] == $number)
386
		                    {
387
								$tpl->set_var('SELECTED', ' selected="selected"');
388
							} else {
389
								$tpl->set_var('SELECTED', '');
390
							}
391
							$tpl->parse('block_list', 'block_block', true);
392
						}
393
					} else {
394
						if($edit_page == '')
395
						{
396
							$edit_page = $edit_page_0.'#wb_'.$edit_page_1;
397
						}
398
						$input_attribute = 'input_normal';
399
						$tpl->set_var(array(
400
								'STYLE_DISPLAY_SECTION_BLOCK' => ' style="visibility:hidden;"',
401
								'NAME_SIZE' => 300,
402
								'INPUT_ATTRIBUTE' => $input_attribute,
403
								'VAR_SECTION_ID' => $section['section_id'],
404
								'VAR_SECTION_IDKEY' => $admin->getIDKEY($section['section_id']),
405
								// 'VAR_SECTION_IDKEY' => $section['section_id'],
406
								'VAR_POSITION' => $section['position'],
407
								'LINK_MODIFY_URL_VAR_MODUL_NAME' => $edit_page,
408
								'NAME' => htmlentities(strip_tags($block[1])),
409
								'VALUE' => 1,
410
								'SET_NONE_DISPLAY_OPTION' => '<option>&nbsp;</option>'
411
								)
412
							);
413
					}
414
					// Insert icon and images
415
					$tpl->set_var(array(
416
								'CLOCK_16_PNG' => 'clock_16.png',
417
								'CLOCK_DEL_16_PNG' => 'clock_del_16.png',
418
								'DELETE_16_PNG' => 'delete_16.png'
419
								)
420
							);
421
					// set calendar start values
422
					if($section['publ_start']==0)
423
		            {
424
						$tpl->set_var('VALUE_PUBL_START', '');
425
					} else {
426
						$tpl->set_var('VALUE_PUBL_START', date($jscal_format, $section['publ_start']+TIMEZONE));
427
					}
428
					// set calendar start values
429
					if($section['publ_end']==0)
430
		            {
431
						$tpl->set_var('VALUE_PUBL_END', '');
432
					} else {
433
						$tpl->set_var('VALUE_PUBL_END', date($jscal_format, $section['publ_end']+TIMEZONE));
434
					}
435
					// Insert icons up and down
436
					if($section['position'] != 1 )
437
		            {
438
						$tpl->set_var(
439
									'VAR_MOVE_UP_URL',
440
									'<a href="'.ADMIN_URL.'/pages/move_up.php?page_id='.$page_id.'&amp;section_id='.$section['section_id'].'">
441
									<img src="'.THEME_URL.'/images/up_16.png" alt="{TEXT_MOVE_UP}" />
442
									</a>' );
443
					} else {
444
						$tpl->set_var(array(
445
									'VAR_MOVE_UP_URL' => ''
446
									)
447
								);
448
					}
449
					if($section['position'] != $num_sections ) {
450
						$tpl->set_var(
451
									'VAR_MOVE_DOWN_URL',
452
									'<a href="'.ADMIN_URL.'/pages/move_down.php?page_id='.$page_id.'&amp;section_id='.$section['section_id'].'">
453
									<img src="'.THEME_URL.'/images/down_16.png" alt="{TEXT_MOVE_DOWN}" />
454
									</a>' );
455
					} else {
456
						$tpl->set_var(array(
457
									'VAR_MOVE_DOWN_URL' => ''
458
									)
459
								);
460
					}
461

  
462
				} else {
463
				  continue;
464
				}
465

  
466
					$tpl->set_var(array(
467
									'DISPLAY_DEBUG' => ' style="visibility:visible;"',
468
									'TEXT_SID' => 'SID',
469
									'DEBUG_COLSPAN_SIZE' => 9
470
									)
471
								);
472
				if($debug)
473
		        {
474
					$tpl->set_var(array(
475
									'DISPLAY_DEBUG' => ' style="visibility:visible;"',
476
									'TEXT_PID' => 'PID',
477
									'TEXT_SID' => 'SID',
478
									'POSITION' => $section['position']
479
									)
480
								);
481
				} else {
482
					$tpl->set_var(array(
483
									'DISPLAY_DEBUG' => ' style="display:none;"',
484
									'TEXT_PID' => '',
485
									'POSITION' => ''
486
									)
487
								);
488
				}
489
				if($bSectionCanDelete) {
490
					$tpl->parse('delete', 'delete_block', false);
491
				} else {
492
					$tpl->parse('delete', '', false);
493
				} 
494
				$tpl->parse('section_list', 'section_block', true);
495
			}
496

  
497
		}
498

  
499 479
		// now add the calendars -- remember to to set the range to [1970, 2037] if the date is used as timestamp!
500 480
		// the loop is simply a copy from above.
501
		$sql  = 'SELECT `section_id`,`module` FROM `'.TABLE_PREFIX.'sections` ';
502
		$sql .= 'WHERE page_id = '.$page_id.' ';
503
		$sql .= 'ORDER BY `position` ASC';
504
		$query_sections = $database->query($sql);
481
		$sql = 'SELECT `section_id`,`module` FROM `'.$oDb->TablePrefix.'sections` '
482
		     . 'WHERE page_id = '.$page_id.' '
483
		     . 'ORDER BY `position` ASC';
484
		$query_sections = $oDb->doQuery($sql);
505 485

  
506
		if($query_sections->numRows() > 0)
507
		{
486
		if ($query_sections->numRows() > 0) {
508 487
			$num_sections = $query_sections->numRows();
509
			while($section = $query_sections->fetchRow())
510
		    {
488
			while ($section = $query_sections->fetchRow()) {
511 489
				// Get the modules real name
512
		        $sql  = 'SELECT `name` FROM `'.TABLE_PREFIX.'addons` ';
513
		        $sql .= 'WHERE `directory` = "'.$section['module'].'"';
514
		        $module_name = $database->get_one($sql);
515

  
516
				if(!is_numeric(array_search($section['module'], $module_permissions)))
517
		        {
490
		        $sql = 'SELECT `name` FROM `'.$oDb->TablePrefix.'addons` '
491
		             . 'WHERE `directory` = "'.$section['module'].'"';
492
		        $module_name = $oDb->getOne($sql);
493
				if (!is_numeric(array_search($section['module'], $module_permissions))) {
518 494
					$tpl->set_var(array(
519 495
								'jscal_ifformat' => $jscal_ifformat,
520 496
								'jscal_firstday' => $jscal_firstday,
......
525 501
								'trigger_end' => 'trigger_stop'.$section['section_id']
526 502
								)
527 503
							);
528
					if(isset($jscal_use_time) && $jscal_use_time==TRUE) {
504
					if (isset($jscal_use_time) && $jscal_use_time==TRUE) {
529 505
						$tpl->set_var(array(
530 506
								'showsTime' => "true",
531 507
								'timeFormat' => "24"
532 508
								)
533 509
							);
534
					}  else {
510
					} else {
535 511
						$tpl->set_var(array(
536 512
								'showsTime' => "false",
537 513
								'timeFormat' => "24"
......
544 520
		}
545 521

  
546 522
		// Work-out if we should show the "Add Section" form
547
		$sql  = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` ';
548
		$sql .= 'WHERE `page_id` = '.$page_id.' AND `module` = "menu_link"';
549
		$query_sections = $database->query($sql);
523
		$sql = 'SELECT `section_id` FROM `'.$oDb->TablePrefix.'sections` '
524
		     . 'WHERE `page_id` = '.$page_id.' AND `module` = "menu_link"';
525
		$query_sections = $oDb->doQuery($sql);
550 526
		$tpl->set_var('TEXT_PLEASE_SELECT', $mLang->TEXT_NONE);
551
		if($query_sections->numRows() == 0)
552
		{
527
		if ($query_sections->numRows() == 0) {
553 528
			$tpl->set_var('TEXT_PLEASE_SELECT', $mLang->TEXT_PLEASE_SELECT);
554 529
			// Modules list
555
		    $sql  = 'SELECT `name`,`directory`,`type` FROM `'.TABLE_PREFIX.'addons` ';
556
		    $sql .= 'WHERE `type` = "module" AND `function` = "page" AND `directory` != "menu_link" ';
557
		    $sql .= 'ORDER BY `name`';
558
		    $result = $database->query($sql);
559
		// if(DEBUG && $database->is_error()) { $admin->print_error($database->get_error()); }
560

  
561
			if($result->numRows() > 0)
562
		    {
563
				while ($module = $result->fetchRow())
564
		        {
530
		    $sql = 'SELECT `name`,`directory`,`type` FROM `'.$oDb->TablePrefix.'addons` '
531
		         . 'WHERE `type` = "module" AND `function` = "page" AND `directory` != "menu_link" '
532
		         . 'ORDER BY `name`';
533
		    $result = $oDb->doQuery($sql);
534
		// if(DEBUG && $oDb->is_error()) { $admin->print_error($oDb->get_error()); }
535
			if ($result->numRows() > 0) {
536
				while ($module = $result->fetchRow()) {
565 537
					// Check if user is allowed to use this module   echo  $module['directory'],'<br />';
566
					if(!is_numeric(array_search($module['directory'], $module_permissions)))
567
		            {
538
					if (!is_numeric(array_search($module['directory'], $module_permissions))) {
568 539
						$tpl->set_var('VALUE', $module['directory']);
569 540
						$tpl->set_var('NAME', $module['name']);
570
						if($module['directory'] == 'wysiwyg')
571
		                {
541
						if ($module['directory'] == 'wysiwyg') {
572 542
							$tpl->set_var('SELECTED', ' selected="selected"');
573 543
						} else {
574 544
							$tpl->set_var('SELECTED', '');
......
582 552
		}
583 553
		// Insert language text and messages
584 554
		$tpl->set_var(array(
585
							'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
555
							'TEXT_MANAGE_SECTIONS' => $mLang->HEADING_MANAGE_SECTIONS,
586 556
							'TEXT_ARE_YOU_SURE' => $mLang->TEXT_ARE_YOU_SURE,
587 557
							'TEXT_TYPE' => $mLang->TEXT_TYPE,
588 558
							'TEXT_ADD' => $mLang->TEXT_ADD,
589 559
							'TEXT_SAVE' =>  $mLang->TEXT_SAVE,
590
							'TEXTLINK_MODIFY_PAGE' => $HEADING['MODIFY_PAGE'],
560
							'TEXTLINK_MODIFY_PAGE' => $mLang->HEADING_MODIFY_PAGE,
591 561
							'TEXT_CALENDAR' => $mLang->TEXT_CALENDAR,
592 562
							'TEXT_DELETE_DATE' => $mLang->TEXT_DELETE_DATE,
593 563
							'TEXT_ADD_SECTION' => $mLang->TEXT_ADD_SECTION,
......
598 568
		$tpl->parse('main', 'main_block', false);
599 569
		$tpl->pparse('output', 'page');
600 570
		// include the required file for Javascript admin
601
		if(file_exists(WB_PATH.'/modules/jsadmin/jsadmin_backend_include.php'))
602
		{
571
		if(file_exists(WB_PATH.'/modules/jsadmin/jsadmin_backend_include.php')) {
603 572
			include(WB_PATH.'/modules/jsadmin/jsadmin_backend_include.php');
604 573
		}
605 574
		break;
606 575
endswitch;
607

  
608 576
// Print admin footer
609 577
$admin->print_footer();
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.4');
54
if(!defined('REVISION')) define('REVISION', '2075');
54
if(!defined('REVISION')) define('REVISION', '2076');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/admin/users/user_list.php
137 137
        $oTpl->set_block('main_block', 'show_confirmed_activation_block', 'show_confirmed_activation');
138 138
        if($admin->ami_group_member('1')) {
139 139
                $oTpl->set_block('show_confirmed_activation_block', 'list_confirmed_activation_block', 'list_confirmed_activation');
140
            	$oTpl->set_var('DISPLAY_WAITING_ACTIVATION', $mLang->MESSAGE_USERS_WAITING_ACTIVATION);
140
                $oTpl->set_var(array(
141
                		'DISPLAY_WAITING_ACTIVATION' => $mLang->MESSAGE_USERS_WAITING_ACTIVATION,
142
                		'TEXT_USER_ACTIVATE' => $mLang->TEXT_ACTIVATE,
143
                		'TEXT_USER_DELETE' => (($iUserStatus == 1) ? $mLang->TEXT_DEACTIVE : $mLang->TEXT_DELETE),
144
                		)
145
                );
141 146
        		$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'users` ';
142 147
        		$sql .= 'WHERE `confirm_timeout` != 0 ';
143 148
                $sql .=   'AND `active` = 0 ';
......
309 314

  
310 315
        return $output;
311 316

  
312
    }
317
    }
branches/2.8.x/wb/admin/users/delete.php
32 32

  
33 33
    $action = 'default';
34 34
    $action = (isset($aActionRequest['delete']) ? 'delete' : $action );
35
    $action = (isset($aActionRequest['delete_outdated']) ? 'delete_outdated' : $action );
35
    $action = (isset($aActionRequest['delete_outdated']) ? 'delete_outdated'   : $action );
36
    $action = (isset($aActionRequest['enable_outdated']) ? 'enable_outdated' : $action );
36 37

  
37 38
	switch($action) :
38 39
		case 'delete': // delete the user
......
42 43
    		    } else {
43 44
    		        $aUserID = $aActionRequest['user_id'];
44 45
    		    }
45
    	    } 
46
    	    }
46 47
    		break;
47 48
		case 'delete_outdated': // delete Users awaiting activation
48 49
            if(isset($aActionRequest['activation_user_id'])) {
......
53 54
        	    }
54 55
            }
55 56
    		break;
57
		case 'enable_outdated': // enable Users awaiting activation
58
            if(isset($aActionRequest['activation_user_id'])) {
59
        		if(!is_array($aActionRequest['activation_user_id'])) {
60
        	        $aUserID[] = $aActionRequest['activation_user_id'];
61
        	    } else {
62
        	        $aUserID = $aActionRequest['activation_user_id'];
63
        	    }
64
            }
65
    		break;
56 66
		default: // show userlist with empty modify mask
57 67
	endswitch; // end of switch
58
    
68

  
59 69
//    if(isset($aActionRequest['activation_user_id'])) {
60 70
//		if(!is_array($aActionRequest['activation_user_id'])) {
61
//	
71
//
62 72
//	        $aUserID[] = $aActionRequest['activation_user_id'];
63 73
//	    } else {
64 74
//	        $aUserID = $aActionRequest['activation_user_id'];
......
66 76
//    } else {
67 77
//	    if(isset($aActionRequest['user_id'])) {
68 78
//			if(!is_array($aActionRequest['user_id'])) {
69
//		
79
//
70 80
//		        $aUserID[] = $aActionRequest['user_id'];
71 81
//		    } else {
72 82
//		        $aUserID = $aActionRequest['user_id'];
73 83
//		    }
74
//	    } 
75
//    } 
76
    
84
//	    }
85
//    }
77 86

  
87

  
78 88
    foreach ( $aUserID AS $key => $value)
79 89
    {
80 90
        switch ($_SERVER['REQUEST_METHOD']) :
......
101 111

  
102 112
		if( ($msg = msgQueue::getError()) == '')
103 113
		{
104
			$sql  = 'SELECT `active` FROM `'.TABLE_PREFIX.'users` '.
105
                    'WHERE `user_id` = '.$user_id;
106
            if( ($iDeleteUser = $database->get_one($sql)) != null ) {
107
                if($iDeleteUser) {
108
    				// Deactivate the user
109
        			$sql  = 'UPDATE `'.TABLE_PREFIX.'users` SET '.
110
                            '`active` = 0 '.
111
                            'WHERE `user_id` = '.$user_id;
112
                    if( $database->query($sql) ) {
113
                        msgQueue::add($mLang->TEXT_USERS_MARKED_DELETED, true);
114

  
115
    	switch($action) :
116
    		case 'enable_outdated': // enable Users awaiting activation
117
    			$sql  = 'SELECT `display_name` FROM `'.TABLE_PREFIX.'users` '.
118
                        'WHERE `user_id` = '.$user_id;
119
                if( ($sDisplayUser = $database->getOne($sql)) != null ) {
120
            		$sql = 'UPDATE `'.TABLE_PREFIX.'users` '
121
            		     . 'SET `active`=1, '
122
            		     .     '`confirm_code`=\'\', '
123
            		     .     '`confirm_timeout`=0 '
124
            		     . 'WHERE `user_id`='.$user_id;
125
            		if($database->query($sql)) {
126
                        msgQueue::add($mLang->MESSAGE_USERS_ADDED.' ('.$sDisplayUser.')', true);
127
                        $bRetVal = true;
128
                    } else {
129
                        msgQueue::add($mLang->TEXT_ENABLE.$mLang->MESSAGE_GENERIC_NOT_COMPARE.' ('.$sDisplayUser.')');
114 130
                    }
115
                } else {
131
                }
132
        		break;
133
    		default: // show userlist with empty modify mask
134
    			$sql  = 'SELECT `active` FROM `'.TABLE_PREFIX.'users` '.
135
                        'WHERE `user_id` = '.$user_id;
136
                if( ($iDeleteUser = $database->get_one($sql)) != null ) {
137
                    if($iDeleteUser) {
138
        				// Deactivate the user
139
            			$sql  = 'UPDATE `'.TABLE_PREFIX.'users` SET '.
140
                                '`active` = 0 '.
141
                                'WHERE `user_id` = '.$user_id;
142
                        if( $database->query($sql) ) {
143
                            msgQueue::add($mLang->TEXT_USERS_MARKED_DELETED, true);
144
                        }
145
                    } else {
116 146

  
117 147

  
118
        			$sql  = 'DELETE FROM `'.TABLE_PREFIX.'users` '.
119
                            'WHERE `user_id` = '.$user_id;
120
                    if( $database->query($sql) ) {
121
                        msgQueue::add($mLang->MESSAGE_USERS_DELETED, true);
148
            			$sql  = 'DELETE FROM `'.TABLE_PREFIX.'users` '.
149
                                'WHERE `user_id` = '.$user_id;
150
                        if( $database->query($sql) ) {
151
                            msgQueue::add($mLang->MESSAGE_USERS_DELETED, true);
152
                        }
122 153
                    }
154
                    $bRetVal = true;
123 155
                }
124
                $bRetVal = true;
125
            }
126
            if($database->is_error()) {
127
                msgQueue::add( implode('<br />',explode(';',$database->get_error())) );
128
                $bRetVal = false;
129
           }
130
		}
131
    }
156
                if($database->is_error()) {
157
                    msgQueue::add( implode('<br />',explode(';',$database->get_error())) );
158
                    $bRetVal = false;
159
               }
160
    	endswitch; // end of switch
161
		} // getError
162
    } // foreach users
132 163
    if(isset($aActionRequest['clearmsg'])) { msgQueue::clear();  }
133 164
    return $bRetVal;
134 165
}
......
137 168
    $requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
138 169
    $aActionRequest = (isset(${$requestMethod})) ? ${$requestMethod} : null;
139 170
    $aActionRequest['clearmsg'] = true;
140
}
171
}
branches/2.8.x/wb/admin/users/index.php
49 49
        $action = (isset($aActionRequest['modify']) ? 'modify' : $action );
50 50
        $action = (isset($aActionRequest['delete']) ? 'delete' : $action );
51 51
        $action = (isset($aActionRequest['delete_outdated']) ? 'delete_outdated' : $action );
52
        $action = (isset($aActionRequest['enable_outdated']) ? 'enable_outdated' : $action );
52 53

  
53 54
		switch($action) :
54 55
			case 'delete': // delete the user
55 56
			case 'delete_outdated': // delete Users awaiting activation
57
			case 'enable_outdated': // enable Users awaiting activation
56 58
    			$admin = new admin('Access', 'users_delete',false);
57 59
				include($sAdminPath.'/delete.php');
58 60
    			delete_user($admin,$aActionRequest);
......
185 187

  
186 188
	admin_users_index($aActionRequest);
187 189
	exit;
188
// end of file
190
// end of file

Also available in: Unified diff