Changeset 1142
- Timestamp:
- 06/10/2008 02:11:08 AM (2 years ago)
- Files:
-
- 1 modified
-
trunk/actions/adminusers/adminusers.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/actions/adminusers/adminusers.php
r1106 r1142 17 17 * @since Wikka 1.1.6.4 18 18 * 19 * @uses Wakka::Action() 20 * @uses Wakka::ExistsPage() 21 * @uses Wakka::FormClose() 22 * @uses Wakka::FormOpen() 23 * @uses Wakka::getCount() 24 * @uses Wakka::GetUser() 25 * @uses Wakka::Href() 26 * @uses Wakka::htmlspecialchars_ent() 27 * @uses Wakka::IsAdmin() 28 * @uses Wakka::Link() 29 * @uses Wakka::LoadAll() 30 * @uses Wakka::Redirect() 31 * 32 * @uses Config::$wikka_action_path 33 * 19 34 * @input integer $colcolor optional: enables color for statistics columns 20 35 * 1: enable colored columns; … … 168 183 define('ADMINUSERS_FORM_MASSACTION_SUBMIT','Submit'); 169 184 define('ADMINUSERS_ERROR_NO_MATCHES','Sorry, there are no users matching "%s"'); 185 define('ADMINUSERS_DELETE_USERS_HEADING', 'Delete these users?'); 186 define('ADMINUSERS_DELETE_USERS_BUTTON', 'Delete Users'); 187 define('ADMINUSERS_CANCEL_BUTTON', 'Cancel'); #TODO: replace with appropriate constant from language file! 170 188 171 189 //initialize row & column colors variables … … 197 215 198 216 //perform actions if required 199 if ($_GET['action'] == 'owned') 217 $g_action = ''; 218 if(isset($_GET['action'])) 219 { 220 $g_action = $_GET['action']; 221 } 222 if($g_action == 'owned') 200 223 { 201 224 echo $this->Action('mypages'); 202 225 } 203 elseif ($_GET['action']== 'changes')226 elseif($g_action == 'changes') 204 227 { 205 228 echo $this->Action('mychanges'); 206 229 } 207 elseif ($_GET['action']== 'comments')230 elseif($g_action == 'comments') 208 231 { 209 232 echo $this->Action('recentcomments'); 210 233 } 211 234 /* 212 elseif ($ _GET['action']== 'feedback' || $_REQUEST['mail'])235 elseif ($g_action == 'feedback' || $_REQUEST['mail']) 213 236 { 214 237 echo $this->Action('userfeedback'); #to be added in 1.1.7, see #608 215 238 } 216 239 */ 217 elseif($ _GET['action']== 'delete')240 elseif($g_action == 'delete') 218 241 { 219 242 if(isset($_GET['user'])) … … 228 251 else 229 252 { 230 $this->Redirect($this->Href() );231 } 232 } 233 } 234 else if($ _GET['action']== 'massdelete')253 $this->Redirect($this->Href(), USERDELETE_MESSAGE_SUCCESS); 254 } 255 } 256 } 257 else if($g_action == 'massdelete') 235 258 { 236 259 $usernames = array(); … … 244 267 if(count($usernames) > 0) 245 268 { 246 ?> 247 <h3>Delete these users?</h3><br/> 248 <ul> 249 <?php 269 echo '<h3>'.ADMINUSERS_DELETE_USERS_HEADING.'</h3><br />'."\n".'<ul>'; 250 270 $errors = 0; 251 271 foreach($usernames as $username) … … 254 274 { 255 275 ++$errors; 256 echo "<li><span class='disabled'>".$username." </span><em class='error'>(".ADMINUSERS_FORM_MASSACTION_DELETE_ERROR.")</em></li>\n";276 echo '<li><span class="disabled">'.$username.' </span><em class="error">('.ADMINUSERS_FORM_MASSACTION_DELETE_ERROR.")</em></li>\n"; 257 277 continue; 258 278 } … … 280 300 <input type="hidden" name="massaction" value="massdelete"/> 281 301 <?php if($errors < count($usernames)) { ?> 282 <input type="submit" value=" Delete Users" style="width: 120px" />302 <input type="submit" value="<?php echo ADMINUSERS_DELETE_USERS_BUTTON;?>" style="width: 120px" /> 283 303 <?php } ?> 284 <input type="button" value=" Cancel" onclick="history.back();" style="width: 120px" />304 <input type="button" value="<?php echo ADMINUSERS_CANCEL_BUTTON;?>" onclick="history.back();" style="width: 120px" /> 285 305 </td> 286 306 </tr> … … 315 335 else 316 336 { 317 $this->Redirect($this->Href() );337 $this->Redirect($this->Href(), USERDELETE_MESSAGE_SUCCESS); 318 338 } 319 339 } … … 345 365 346 366 // search string 367 $q = ''; 347 368 if (isset($_POST['q'])) 348 369 { … … 353 374 $q = $_GET['q']; 354 375 } 355 elseif( $_POST['submit'] == ADMINUSERS_FORM_SEARCH_SUBMIT)376 elseif(isset($_POST['submit']) && $_POST['submit'] == ADMINUSERS_FORM_SEARCH_SUBMIT) 356 377 { 357 378 // Reset num recs per page for empty (reset) search … … 376 397 // (search string, num recs per page) get out of sync, requiring 377 398 // multiple submissions. 378 if(!isset($_GET['l']) && $_POST['submit'] != ADMINUSERS_FORM_PAGER_SUBMIT)399 if(!isset($_GET['l']) && isset($_POST['submit']) && $_POST['submit'] != ADMINUSERS_FORM_PAGER_SUBMIT) 379 400 { 380 401 $l = ADMINUSERS_DEFAULT_RECORDS_LIMIT; … … 383 404 // print page header 384 405 echo '<h3>'.ADMINUSERS_PAGE_TITLE.'</h3>'."\n"; 385 $msg = ''; 386 if($msg = $this->GetRedirectMessage()) 387 { 388 echo '<p><em class="error">'.sprintf($msg).'</em></p>'; 389 } 390 406 407 //non-working message retrieval removed, see #753 391 408 // build pager form 392 409 $form_filter = $this->FormOpen('','','post','user_admin_panel');