@@ -18,39 +18,34 @@ class Bans
1818{
1919 public function __construct ()
2020 {
21- $ this ->feather = \Slim \Slim::getInstance ();
22- $ this ->start = $ this ->feather ->start ;
23- $ this ->config = $ this ->feather ->config ;
24- $ this ->user = Container::get ('user ' );
25- $ this ->request = $ this ->feather ->request ;
2621 $ this ->model = new \FeatherBB \Model \Admin \Bans ();
27- load_textdomain ('featherbb ' , Config::get ('forum_env ' )['FEATHER_ROOT ' ].'featherbb/lang/ ' .$ this -> user ->language .'/admin/bans.mo ' );
22+ load_textdomain ('featherbb ' , Config::get ('forum_env ' )['FEATHER_ROOT ' ].'featherbb/lang/ ' .Container:: get ( ' user ' ) ->language .'/admin/bans.mo ' );
2823
29- if ($ this -> user ->g_id != Config::get ('forum_env ' )['FEATHER_ADMIN ' ] && ($ this -> user ->g_moderator != '1 ' || $ this -> user ->g_mod_ban_users == '0 ' )) {
24+ if (Container:: get ( ' user ' ) ->g_id != Config::get ('forum_env ' )['FEATHER_ADMIN ' ] && (Container:: get ( ' user ' ) ->g_moderator != '1 ' || Container:: get ( ' user ' ) ->g_mod_ban_users == '0 ' )) {
3025 throw new Error (__ ('No permission ' ), '403 ' );
3126 }
3227 }
3328
34- public function display ()
29+ public function display ($ req , $ res , $ args )
3530 {
3631 Container::get ('hooks ' )->fire ('controller.admin.bans.display ' );
3732
3833 // Display bans
39- if ($ this -> request -> get ('find_ban ' )) {
34+ if (Input:: query ('find_ban ' )) {
4035 $ ban_info = $ this ->model ->find_ban ();
4136
4237 // Determine the ban offset (based on $_GET['p'])
4338 $ num_pages = ceil ($ ban_info ['num_bans ' ] / 50 );
4439
45- $ p = (!$ this -> request -> get ('p ' ) || $ this -> request -> get ('p ' ) <= 1 || $ this -> request -> get ('p ' ) > $ num_pages ) ? 1 : intval ($ this -> request -> get ('p ' ));
40+ $ p = (!Input:: query ('p ' ) || Input:: query ('p ' ) <= 1 || Input:: query ('p ' ) > $ num_pages ) ? 1 : intval (Input:: query ('p ' ));
4641 $ start_from = 50 * ($ p - 1 );
4742
4843 $ ban_data = $ this ->model ->find_ban ($ start_from );
4944
5045 View::setPageInfo (array (
5146 'admin_console ' => true ,
5247 'page ' => $ p ,
53- 'title ' => array (Utils::escape ($ this -> config ['o_board_title ' ]), __ ('Admin ' ), __ ('Bans ' ), __ ('Results head ' )),
48+ 'title ' => array (Utils::escape (Config:: get ( ' forum_settings ' ) ['o_board_title ' ]), __ ('Admin ' ), __ ('Bans ' ), __ ('Results head ' )),
5449 'paging_links ' => '<span class="pages-label"> ' . __ ('Pages ' ) . ' </span> ' . Url::paginate_old ($ num_pages , $ p , '?find_ban=& ' . implode ('& ' , $ ban_info ['query_str ' ])),
5550 'ban_data ' => $ ban_data ['data ' ],
5651 )
@@ -62,17 +57,17 @@ public function display()
6257 View::setPageInfo (array (
6358 'admin_console ' => true ,
6459 'focus_element ' => array ('bans ' , 'new_ban_user ' ),
65- 'title ' => array (Utils::escape ($ this -> config ['o_board_title ' ]), __ ('Admin ' ), __ ('Bans ' )),
60+ 'title ' => array (Utils::escape (Config:: get ( ' forum_settings ' ) ['o_board_title ' ]), __ ('Admin ' ), __ ('Bans ' )),
6661 )
6762 )->addTemplate ('admin/bans/admin_bans.php ' )->display ();
6863 }
6964 }
7065
71- public function add ($ id = null )
66+ public function add ($ req , $ res , $ args )
7267 {
7368 Container::get ('hooks ' )->fire ('controller.admin.bans.add ' );
7469
75- if ($ this -> request -> post ('add_edit_ban ' )) {
70+ if (Input:: post ('add_edit_ban ' )) {
7671 $ this ->model ->insert_ban ();
7772 }
7873
@@ -81,34 +76,34 @@ public function add($id = null)
8176 View::setPageInfo (array (
8277 'admin_console ' => true ,
8378 'focus_element ' => array ('bans2 ' , 'ban_user ' ),
84- 'title ' => array (Utils::escape ($ this -> config ['o_board_title ' ]), __ ('Admin ' ), __ ('Bans ' )),
85- 'ban ' => $ this ->model ->add_ban_info ($ id ),
79+ 'title ' => array (Utils::escape (Config:: get ( ' forum_settings ' ) ['o_board_title ' ]), __ ('Admin ' ), __ ('Bans ' )),
80+ 'ban ' => $ this ->model ->add_ban_info ($ req , $ res , $ args ),
8681 )
8782 )->addTemplate ('admin/bans/add_ban.php ' )->display ();
8883 }
8984
90- public function delete ($ id )
85+ public function delete ($ req , $ res , $ args )
9186 {
9287 Container::get ('hooks ' )->fire ('controller.admin.bans.delete ' );
9388
9489 // Remove the ban
95- $ this ->model ->remove_ban ($ id );
90+ $ this ->model ->remove_ban ($ req , $ res , $ args );
9691 }
9792
98- public function edit ($ id )
93+ public function edit ($ req , $ res , $ args )
9994 {
10095 Container::get ('hooks ' )->fire ('controller.admin.bans.edit ' );
10196
102- if ($ this -> request -> post ('add_edit_ban ' )) {
97+ if (Input:: post ('add_edit_ban ' )) {
10398 $ this ->model ->insert_ban ();
10499 }
105100 AdminUtils::generateAdminMenu ('bans ' );
106101
107102 View::setPageInfo (array (
108103 'admin_console ' => true ,
109104 'focus_element ' => array ('bans2 ' , 'ban_user ' ),
110- 'title ' => array (Utils::escape ($ this -> config ['o_board_title ' ]), __ ('Admin ' ), __ ('Bans ' )),
111- 'ban ' => $ this ->model ->edit_ban_info ($ id ),
105+ 'title ' => array (Utils::escape (Config:: get ( ' forum_settings ' ) ['o_board_title ' ]), __ ('Admin ' ), __ ('Bans ' )),
106+ 'ban ' => $ this ->model ->edit_ban_info ($ req , $ res , $ args ),
112107 )
113108 )->addTemplate ('admin/bans/add_ban.php ' )->display ();
114109 }
0 commit comments