function perform_changeuser($HTTP_VARS) { // save existing user_id so we can restore it. register_opendb_session_var('admin_user_id', get_opendb_session_var('user_id')); $user_r = fetch_user_r($HTTP_VARS['uid']); register_opendb_session_var('user_id', $HTTP_VARS['uid']); opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, 'Administrator changed user'); }
$listingObject->setTotalItems(fetch_item_listing_cnt($HTTP_VARS, $v_column_display_config_rs)); } // -------------------------------------- Process the Query here ----------------------------------------------------------------- if ($result = fetch_item_listing_rs($HTTP_VARS, $v_column_display_config_rs, $listingObject->getCurrentOrderBy(), $listingObject->getCurrentSortOrder(), $listingObject->getStartIndex(), $listingObject->getItemsPerPage())) { // ---------------------------------------------------------------------------- // Save current url string, so we can return to last listings page if required. // ---------------------------------------------------------------------------- // The Listing class has already removed any $HTTP_VARS which should not // be passed onto the next request. $v_listing_url_vars = $HTTP_VARS; $v_listing_url_vars['mode'] = NULL; // These are listing specific - we do not want to save them. $v_listing_url_vars['item_id_instance_no'] = NULL; $v_listing_url_vars['checked_item_id_instance_no'] = NULL; $v_listing_url_vars['checked_item_id_instance_no_list'] = NULL; register_opendb_session_var('listing_url_vars', $v_listing_url_vars); while ($item_r = db_fetch_assoc($result)) { $listingObject->startRow(); // Get the Status Type config for the current item_instance.s_status_type, but grab it once. if (!is_array($status_type_rs[$item_r['s_status_type']])) { $status_type_rs[$item_r['s_status_type']] = fetch_status_type_r($item_r['s_status_type']); } if ($show_checkbox_column) { if (!is_item_in_reserve_basket($item_r['item_id'], $item_r['instance_no'], get_opendb_session_var('user_id'))) { if ($status_type_rs[$item_r['s_status_type']]['borrow_ind'] == 'Y' && ($item_r['owner_id'] !== get_opendb_session_var('user_id') || get_opendb_config_var('borrow', 'owner_self_checkout') !== FALSE) && is_user_granted_permission(PERM_USER_BORROWER) && !is_item_reserved_or_borrowed_by_user($item_r['item_id'], $item_r['instance_no']) && (get_opendb_config_var('borrow', 'allow_reserve_if_borrowed') !== FALSE || !is_item_borrowed($item_r['item_id'], $item_r['instance_no'])) && (get_opendb_config_var('borrow', 'allow_multi_reserve') !== FALSE || !is_item_reserved($item_r['item_id'], $item_r['instance_no']))) { $listingObject->addCheckboxColumn($item_r['item_id'] . "_" . $item_r['instance_no'], FALSE); } else { $listingObject->addColumn(); } } else { $listingObject->addColumn();
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // This must be first - includes config.php require_once "./include/begin.inc.php"; include_once "./lib/database.php"; include_once "./lib/auth.php"; include_once "./lib/logging.php"; include_once "./lib/widgets.php"; include_once "./lib/http.php"; include_once "./lib/importcache.php"; if (is_user_admin_changed_user()) { opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, 'Administrator logging out change user'); $user_r = fetch_user_r(get_opendb_session_var('admin_user_id')); register_opendb_session_var('user_id', get_opendb_session_var('admin_user_id')); unregister_opendb_session_var('admin_user_id'); opendb_redirect('index.php'); } else { opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, 'User logged out'); if (strlen(get_opendb_session_var('user_id')) > 0) { import_cache_delete_for_user(get_opendb_session_var('user_id')); } @session_destroy(); $params = session_get_cookie_params(); setcookie(session_name(), '', 0, $params['path'], $params['domain'], $params['secure'], isset($params['httponly'])); remove_opendb_remember_me(); opendb_redirect('index.php'); } // Cleanup after begin.inc.php require_once "./include/end.inc.php";