|
From: MW <jo...@us...> - 2008-02-09 21:14:34
|
Update of /cvsroot/mxbb/core/modules/mx_users/admin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17233/modules/mx_users/admin Modified Files: admin_prune_users.php Log Message: more use of request_vars wrapper class Index: admin_prune_users.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_users/admin/admin_prune_users.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** admin_prune_users.php 4 Feb 2008 18:53:12 -0000 1.2 --- admin_prune_users.php 9 Feb 2008 21:14:27 -0000 1.3 *************** *** 41,45 **** } ! if ( $_POST['submit'] ) { foreach ( $_POST['inactive_users'] as $user_id ) --- 41,45 ---- } ! if ($mx_request_vars->is_post('submit')) { foreach ( $_POST['inactive_users'] as $user_id ) *************** *** 220,224 **** mx_message_die(GENERAL_MESSAGE, $message); } ! elseif ( isset ( $_POST['fetch'] ) ) { // fetch inactive users list --- 220,224 ---- mx_message_die(GENERAL_MESSAGE, $message); } ! elseif ($mx_request_vars->is_post('fetch')) { // fetch inactive users list *************** *** 259,279 **** ); ! // build template switches ! if ( isset( $_POST['login_check'] ) ) ! { ! $template->assign_block_vars("inactive_users.user_lastvisit", array() ); ! } ! if ( isset( $_POST['registered_check'] ) ) ! { ! $template->assign_block_vars("inactive_users.user_regdate", array() ); ! } ! if ( isset( $_POST['active_check'] ) ) ! { ! $template->assign_block_vars("inactive_users.user_active", array() ); ! } ! if ( isset( $_POST['posts_check'] ) ) ! { ! $template->assign_block_vars("inactive_users.user_posts", array() ); ! } } --- 259,279 ---- ); ! // build template switches ! if ($mx_request_vars->is_post('login_check')) ! { ! $template->assign_block_vars("inactive_users.user_lastvisit", array() ); ! } ! if ($mx_request_vars->is_post('registered_check')) ! { ! $template->assign_block_vars("inactive_users.user_regdate", array() ); ! } ! if ($mx_request_vars->is_post('active_check')) ! { ! $template->assign_block_vars("inactive_users.user_active", array() ); ! } ! if ($mx_request_vars->is_post('posts_check')) ! { ! $template->assign_block_vars("inactive_users.user_posts", array() ); ! } } *************** *** 282,301 **** // build template switches ! if ( isset( $_POST['login_check'] ) ) { $template->assign_block_vars("user_lastvisit", array() ); $number_of_columns++; } ! if ( isset( $_POST['registered_check'] ) ) { $template->assign_block_vars("user_regdate", array() ); $number_of_columns++; } ! if ( isset( $_POST['active_check'] ) ) { $template->assign_block_vars("user_active", array() ); $number_of_columns++; } ! if ( isset( $_POST['posts_check'] ) ) { $template->assign_block_vars("user_posts", array() ); --- 282,301 ---- // build template switches ! if ($mx_request_vars->is_post('login_check')) { $template->assign_block_vars("user_lastvisit", array() ); $number_of_columns++; } ! if ($mx_request_vars->is_post('registered_check')) { $template->assign_block_vars("user_regdate", array() ); $number_of_columns++; } ! if ($mx_request_vars->is_post('active_check')) { $template->assign_block_vars("user_active", array() ); $number_of_columns++; } ! if ($mx_request_vars->is_post('posts_check')) { $template->assign_block_vars("user_posts", array() ); *************** *** 441,462 **** function mx_users_inactive() { ! global $db, $lang, $board_config, $_POST; $inactive_users = array(); ! if ( $_POST['registered_check'] ) { ! $sql_registered = " " . str_replace("\'", "''", $_POST['user_registered_condition']) . " `user_regdate` >= '" . ( int ) str_replace("\'", "''", $_POST['user_registered']) . "'"; } ! if ( $_POST['login_check'] ) { ! $sql_login = " " . str_replace("\'", "''", $_POST['user_lastvisit_condition']) . " `user_lastvisit` <= '" . ( int ) str_replace("\'", "''", $_POST['user_lastvisit']) . "'"; } ! if ( $_POST['active_check'] ) { ! $sql_active = " " . str_replace("\'", "''", $_POST['user_active_condition']) . " `user_active` = '" . ( int ) str_replace("\'", "''", $_POST['user_active']) . "'"; } ! if ( $_POST['posts_check'] ) { ! $sql_posts = " " . str_replace("\'", "''", $_POST['user_posts_condition']) . " `user_posts` " . str_replace("\'", "''", $_POST['user_posts_sign']) . " '" . ( int ) str_replace("\'", "''", $_POST['user_posts']) . "'"; } --- 441,462 ---- function mx_users_inactive() { ! global $db, $lang, $board_config, $mx_request_vars; $inactive_users = array(); ! if ($mx_request_vars->is_post('registered_check')) { ! $sql_registered = " " . str_replace("\'", "''", $mx_request_vars->post('user_registered_condition', MX_TYPE_NO_TAGS)) . " `user_regdate` >= '" . ( int ) str_replace("\'", "''", $mx_request_vars->post('user_registered', MX_TYPE_NO_TAGS)) . "'"; } ! if ($mx_request_vars->is_post('login_check')) { ! $sql_login = " " . str_replace("\'", "''", $mx_request_vars->post('user_lastvisit_condition', MX_TYPE_NO_TAGS)) . " `user_lastvisit` <= '" . ( int ) str_replace("\'", "''", $mx_request_vars->post('user_lastvisit', MX_TYPE_NO_TAGS)) . "'"; } ! if ($mx_request_vars->is_post('active_check')) { ! $sql_active = " " . str_replace("\'", "''", $mx_request_vars->post('user_active_condition', MX_TYPE_NO_TAGS)) . " `user_active` = '" . ( int ) str_replace("\'", "''", $mx_request_vars->post('user_active', MX_TYPE_NO_TAGS)) . "'"; } ! if ($mx_request_vars->is_post('posts_check')) { ! $sql_posts = " " . str_replace("\'", "''", $mx_request_vars->post('user_posts_condition', MX_TYPE_NO_TAGS)) . " `user_posts` " . str_replace("\'", "''", $mx_request_vars->post('user_posts_sign', MX_TYPE_NO_TAGS)) . " '" . ( int ) str_replace("\'", "''", $mx_request_vars->post('user_posts', MX_TYPE_NO_TAGS)) . "'"; } *************** *** 466,473 **** // Build conditions array $conditions = array( ! 'user_regdate' => array( 'check' => 'registered_check', 'variable' => 'sql_registered', 'condition' => str_replace("\'", "''", $_POST['user_registered_condition'] ) ), ! 'user_lastvisit' => array( 'check' => 'login_check', 'variable' => 'sql_login', 'condition' => str_replace("\'", "''", $_POST['user_lastvisit_condition']) ), ! 'user_active' => array( 'check' => 'active_check', 'variable' => 'sql_active', 'condition' => str_replace("\'", "''", $_POST['user_active_condition']) ), ! 'user_posts' => array( 'check' => 'posts_check', 'variable' => 'sql_posts', 'condition' => str_replace("\'", "''", $_POST['user_posts_condition']) ), 'non_anonymous' => array( 'variable' => 'sql_non_anonymous', 'condition' => 'AND' ) ); --- 466,473 ---- // Build conditions array $conditions = array( ! 'user_regdate' => array( 'check' => 'registered_check', 'variable' => 'sql_registered', 'condition' => str_replace("\'", "''", $mx_request_vars->post('user_registered_condition', MX_TYPE_NO_TAGS)) ), ! 'user_lastvisit' => array( 'check' => 'login_check', 'variable' => 'sql_login', 'condition' => str_replace("\'", "''", $mx_request_vars->post('user_lastvisit_condition', MX_TYPE_NO_TAGS))), ! 'user_active' => array( 'check' => 'active_check', 'variable' => 'sql_active', 'condition' => str_replace("\'", "''", $mx_request_vars->post('user_active_condition', MX_TYPE_NO_TAGS))), ! 'user_posts' => array( 'check' => 'posts_check', 'variable' => 'sql_posts', 'condition' => str_replace("\'", "''", $mx_request_vars->post('user_posts_condition', MX_TYPE_NO_TAGS))), 'non_anonymous' => array( 'variable' => 'sql_non_anonymous', 'condition' => 'AND' ) ); |