Changeset 153 for trunk/services
- Timestamp:
- Jun 7, 2006 8:41:19 PM (18 years ago)
- Location:
- trunk/services
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/services/admins.php
r152 r153 31 31 32 32 // Configure the prefs object. 33 $ prefs =& Prefs::getInstance('admins');34 $ prefs->setParam(array('persistent' => false));33 $tmp_prefs = new Prefs('admins'); 34 $tmp_prefs->setParam(array('persistent' => false)); 35 35 36 36 // Configure the cache object. 37 $cache = & Cache::getInstance('admins');37 $cache = new Cache('admins'); 38 38 $cache->setParam(array('enable' => true)); 39 39 … … 322 322 function deleteRecord($id) 323 323 { 324 global $auth, $lock; 324 global $auth; 325 global $lock; 326 global $cache; 325 327 $app =& App::getInstance(); 326 328 $db =& DB::getInstance(); 327 $cache =& Cache::getInstance('admins');328 329 329 330 $lock->select('admin_tbl', 'admin_id', $id); … … 371 372 { 372 373 global $auth; 374 global $cache; 373 375 $app =& App::getInstance(); 374 376 $db =& DB::getInstance(); 375 $cache =& Cache::getInstance('admins');376 377 377 378 // Remove any stale cached list data. … … 414 415 function updateRecord($frm) 415 416 { 416 global $auth, $lock; 417 global $auth; 418 global $lock; 419 global $cache; 417 420 $app =& App::getInstance(); 418 421 $db =& DB::getInstance(); 419 $cache =& Cache::getInstance('admins');420 422 421 423 $lock->select('admin_tbl', 'admin_id', $frm['admin_id']); … … 460 462 global $page; 461 463 global $so; 464 global $tmp_prefs; 465 global $cache; 462 466 $db =& DB::getInstance(); 463 $prefs =& Prefs::getInstance('admins');464 $cache =& Cache::getInstance('admins');465 467 466 468 $where_clause = ''; … … 514 516 // without knowing the hash. 515 517 $cache_hash = md5($sql . '|' . $page->total_items); 516 if ($ prefs->get('cache_hash') != $cache_hash) {518 if ($tmp_prefs->get('cache_hash') != $cache_hash) { 517 519 $cache->delete('list'); 518 $ prefs->set('cache_hash', $cache_hash);520 $tmp_prefs->set('cache_hash', $cache_hash); 519 521 } 520 522 -
trunk/services/logs.php
r152 r153 37 37 $no_download_files = '/^$/'; 38 38 39 40 // Set the defaults and catch incoming settings. 41 $ prefs =& Prefs::getInstance('admin_logs');42 $ prefs->setDefaults(array(39 // Configure the prefs object. 40 $tmp_prefs = new Prefs('admin_logs'); 41 $tmp_prefs->setParam(array('persistent' => false)); 42 $tmp_prefs->setDefaults(array( 43 43 'log_file' => $app->getParam('log_filename') 44 44 )); 45 $ prefs->set('log_file', getFormData('log'));45 $tmp_prefs->set('log_file', getFormData('log')); 46 46 47 47 // Titles and navigation header. 48 $nav->addPage(sprintf(_("Viewing log: <em>%s</em>"), $ prefs->get('log_file')), '/admin/logs.php');48 $nav->addPage(sprintf(_("Viewing log: <em>%s</em>"), $tmp_prefs->get('log_file')), '/admin/logs.php'); 49 49 50 50 /******************************************************************** … … 59 59 case 'delete' : 60 60 // $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET); 61 deleteLog($ prefs->get('log_file'));62 $ prefs->set('log_file', $app->getParam('log_filename'));61 deleteLog($tmp_prefs->get('log_file')); 62 $tmp_prefs->set('log_file', $app->getParam('log_filename')); 63 63 if ($app->validBoomerangURL('app_log')) { 64 64 // Display boomerang page. … … 71 71 case 'clear' : 72 72 // $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET); 73 clearLog($ prefs->get('log_file'));73 clearLog($tmp_prefs->get('log_file')); 74 74 if ($app->validBoomerangURL('app_log')) { 75 75 // Display boomerang page. … … 82 82 case 'archive' : 83 83 // $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET); 84 if (archiveLog($ prefs->get('log_file'))) {84 if (archiveLog($tmp_prefs->get('log_file'))) { 85 85 // Now flush current log. 86 86 $app->dieURL($_SERVER['PHP_SELF'] . '?op=clear'); … … 100 100 case 'download' : 101 101 header('Content-Type: application/octet-stream'); 102 header(sprintf('Content-Disposition: attachment; filename=%s.txt', $ prefs->get('log_file')));103 printLog($ prefs->get('log_file'));102 header(sprintf('Content-Disposition: attachment; filename=%s.txt', $tmp_prefs->get('log_file'))); 103 printLog($tmp_prefs->get('log_file')); 104 104 die; 105 105 break; 106 106 107 107 default : 108 $list =& getLog($ prefs->get('log_file'), getFormData('search_query'));108 $list =& getLog($tmp_prefs->get('log_file'), getFormData('search_query')); 109 109 $main_template = 'log_list.ihtml'; 110 110 break; … … 128 128 include 'header.ihtml'; 129 129 if ('output' == $main_template) { 130 printLog($ prefs->get('log_file'));130 printLog($tmp_prefs->get('log_file')); 131 131 } else { 132 132 include 'codebase/services/templates/' . $main_template; -
trunk/services/templates/log_list.ihtml
r152 r153 10 10 <tr class="commandtext"> 11 11 <td> 12 <?php if ($l['filename'] == $ prefs->get('log_file')) { ?>12 <?php if ($l['filename'] == $tmp_prefs->get('log_file')) { ?> 13 13 <span class="commanditem"><strong><?php echo sprintf(_("%s"), $l['filename']); ?></strong></span> 14 14 <?php } else { ?>
Note: See TracChangeset
for help on using the changeset viewer.