Skip to content

Commit a3be868

Browse files
committed
Test massive changes
1 parent 48cedb2 commit a3be868

File tree

159 files changed

+1031
-1235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+1031
-1235
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"php": ">=5.5",
2727
"slim/slim": "~3.1",
2828
"statical/statical": "^1.1",
29-
"akrabat/rka-ip-address-middleware": "^0.4.0"
29+
"slim/flash": "^0.1.0"
3030
},
3131
"support": {
3232
"email": "[email protected]",

featherbb/Controller/Admin/Bans.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct()
2121
$this->feather = \Slim\Slim::getInstance();
2222
$this->start = $this->feather->start;
2323
$this->config = $this->feather->config;
24-
$this->user = $this->feather->user;
24+
$this->user = Container::get('user');
2525
$this->request = $this->feather->request;
2626
$this->model = new \FeatherBB\Model\Admin\Bans();
2727
load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'].'featherbb/lang/'.$this->user->language.'/admin/bans.mo');
@@ -33,7 +33,7 @@ public function __construct()
3333

3434
public function display()
3535
{
36-
$this->feather->hooks->fire('controller.admin.bans.display');
36+
Container::get('hooks')->fire('controller.admin.bans.display');
3737

3838
// Display bans
3939
if ($this->request->get('find_ban')) {
@@ -70,7 +70,7 @@ public function display()
7070

7171
public function add($id = null)
7272
{
73-
$this->feather->hooks->fire('controller.admin.bans.add');
73+
Container::get('hooks')->fire('controller.admin.bans.add');
7474

7575
if ($this->request->post('add_edit_ban')) {
7676
$this->model->insert_ban();
@@ -89,15 +89,15 @@ public function add($id = null)
8989

9090
public function delete($id)
9191
{
92-
$this->feather->hooks->fire('controller.admin.bans.delete');
92+
Container::get('hooks')->fire('controller.admin.bans.delete');
9393

9494
// Remove the ban
9595
$this->model->remove_ban($id);
9696
}
9797

9898
public function edit($id)
9999
{
100-
$this->feather->hooks->fire('controller.admin.bans.edit');
100+
Container::get('hooks')->fire('controller.admin.bans.edit');
101101

102102
if ($this->request->post('add_edit_ban')) {
103103
$this->model->insert_ban();

featherbb/Controller/Admin/Categories.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@ public function __construct()
2222
$this->feather = \Slim\Slim::getInstance();
2323
$this->start = $this->feather->start;
2424
$this->config = $this->feather->config;
25-
$this->user = $this->feather->user;
25+
$this->user = Container::get('user');
2626
$this->request = $this->feather->request;
2727
$this->model = new \FeatherBB\Model\Admin\Categories();
2828
load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'].'featherbb/lang/'.$this->user->language.'/admin/categories.mo');
2929
}
3030

3131
public function add()
3232
{
33-
$this->feather->hooks->fire('controller.admin.categories.add');
33+
Container::get('hooks')->fire('controller.admin.categories.add');
3434

3535
$cat_name = Utils::trim($this->request->post('cat_name'));
3636
if ($cat_name == '') {
37-
Url::redirect($this->feather->urlFor('adminCategories'), __('Must enter name message'));
37+
Router::redirect(Router::pathFor('adminCategories'), __('Must enter name message'));
3838
}
3939

4040
if ($this->model->add_category($cat_name)) {
41-
Url::redirect($this->feather->urlFor('adminCategories'), __('Category added redirect'));
41+
Router::redirect(Router::pathFor('adminCategories'), __('Category added redirect'));
4242
} else { //TODO, add error message
43-
Url::redirect($this->feather->urlFor('adminCategories'), __('Category added redirect'));
43+
Router::redirect(Router::pathFor('adminCategories'), __('Category added redirect'));
4444
}
4545
}
4646

4747
public function edit()
4848
{
49-
$this->feather->hooks->fire('controller.admin.categories.edit');
49+
Container::get('hooks')->fire('controller.admin.categories.edit');
5050

5151
if (empty($this->request->post('cat'))) {
5252
throw new Error(__('Bad request'), '400');
@@ -57,21 +57,21 @@ public function edit()
5757
'name' => Utils::escape($properties['name']),
5858
'order' => (int) $properties['order'], );
5959
if ($category['name'] == '') {
60-
Url::redirect($this->feather->urlFor('adminCategories'), __('Must enter name message'));
60+
Router::redirect(Router::pathFor('adminCategories'), __('Must enter name message'));
6161
}
6262
$this->model->update_category($category);
6363
}
6464

6565
// Regenerate the quick jump cache
6666
$this->feather->cache->store('quickjump', Cache::get_quickjump());
6767

68-
Url::redirect($this->feather->urlFor('adminCategories'), __('Categories updated redirect'));
68+
Router::redirect(Router::pathFor('adminCategories'), __('Categories updated redirect'));
6969

7070
}
7171

7272
public function delete()
7373
{
74-
$this->feather->hooks->fire('controller.admin.categories.delete');
74+
Container::get('hooks')->fire('controller.admin.categories.delete');
7575

7676
$cat_to_delete = (int) $this->request->post('cat_to_delete');
7777

@@ -80,19 +80,19 @@ public function delete()
8080
}
8181

8282
if (intval($this->request->post('disclaimer')) != 1) {
83-
Url::redirect($this->feather->urlFor('adminCategories'), __('Delete category not validated'));
83+
Router::redirect(Router::pathFor('adminCategories'), __('Delete category not validated'));
8484
}
8585

8686
if ($this->model->delete_category($cat_to_delete)) {
87-
Url::redirect($this->feather->urlFor('adminCategories'), __('Category deleted redirect'));
87+
Router::redirect(Router::pathFor('adminCategories'), __('Category deleted redirect'));
8888
} else {
89-
Url::redirect($this->feather->urlFor('adminCategories'), __('Unable to delete category'));
89+
Router::redirect(Router::pathFor('adminCategories'), __('Unable to delete category'));
9090
}
9191
}
9292

9393
public function display()
9494
{
95-
$this->feather->hooks->fire('controller.admin.categories.display');
95+
Container::get('hooks')->fire('controller.admin.categories.display');
9696

9797
AdminUtils::generateAdminMenu('categories');
9898

featherbb/Controller/Admin/Censoring.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ public function __construct()
1919
$this->feather = \Slim\Slim::getInstance();
2020
$this->start = $this->feather->start;
2121
$this->config = $this->feather->config;
22-
$this->user = $this->feather->user;
22+
$this->user = Container::get('user');
2323
$this->request = $this->feather->request;
2424
$this->model = new \FeatherBB\Model\Admin\Censoring();
2525
load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'].'featherbb/lang/'.$this->user->language.'/admin/censoring.mo');
2626
}
2727

2828
public function display()
2929
{
30-
$this->feather->hooks->fire('controller.admin.censoring.display');
30+
Container::get('hooks')->fire('controller.admin.censoring.display');
3131

3232
// Add a censor word
3333
if ($this->request->post('add_word')) {

featherbb/Controller/Admin/Forums.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,35 @@ public function __construct()
2121
$this->feather = \Slim\Slim::getInstance();
2222
$this->start = $this->feather->start;
2323
$this->config = $this->feather->config;
24-
$this->user = $this->feather->user;
24+
$this->user = Container::get('user');
2525
$this->request = $this->feather->request;
2626
$this->model = new \FeatherBB\Model\Admin\Forums();
2727
load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'].'featherbb/lang/'.$this->user->language.'/admin/forums.mo');
2828
}
2929

3030
public function add()
3131
{
32-
$this->feather->hooks->fire('controller.admin.forums.add');
32+
Container::get('hooks')->fire('controller.admin.forums.add');
3333

3434
$cat_id = (int) $this->request->post('cat');
3535

3636
if ($cat_id < 1) {
37-
Url::redirect($this->feather->urlFor('adminForums'), __('Must be valid category'));
37+
Router::redirect(Router::pathFor('adminForums'), __('Must be valid category'));
3838
}
3939

4040
if ($fid = $this->model->add_forum($cat_id, __('New forum'))) {
4141
// Regenerate the quick jump cache
4242
$this->feather->cache->store('quickjump', Cache::get_quickjump());
4343

44-
Url::redirect($this->feather->urlFor('editForum', array('id' => $fid)), __('Forum added redirect'));
44+
Router::redirect(Router::pathFor('editForum', array('id' => $fid)), __('Forum added redirect'));
4545
} else {
46-
Url::redirect($this->feather->urlFor('adminForums'), __('Unable to add forum'));
46+
Router::redirect(Router::pathFor('adminForums'), __('Unable to add forum'));
4747
}
4848
}
4949

5050
public function edit($forum_id)
5151
{
52-
$this->feather->hooks->fire('controller.admin.forums.edit');
52+
Container::get('hooks')->fire('controller.admin.forums.edit');
5353

5454
if($this->request->isPost()) {
5555
if ($this->request->post('save') && $this->request->post('read_forum_old')) {
@@ -62,10 +62,10 @@ public function edit($forum_id)
6262
'redirect_url' => Url::is_valid($this->request->post('redirect_url')) ? Utils::escape($this->request->post('redirect_url')) : NULL);
6363

6464
if ($forum_data['forum_name'] == '') {
65-
Url::redirect($this->feather->urlFor('editForum', array('id' => $forum_id)), __('Must enter name message'));
65+
Router::redirect(Router::pathFor('editForum', array('id' => $forum_id)), __('Must enter name message'));
6666
}
6767
if ($forum_data['cat_id'] < 1) {
68-
Url::redirect($this->feather->urlFor('editForum', array('id' => $forum_id)), __('Must be valid category'));
68+
Router::redirect(Router::pathFor('editForum', array('id' => $forum_id)), __('Must be valid category'));
6969
}
7070

7171
$this->model->update_forum($forum_id, $forum_data);
@@ -101,15 +101,15 @@ public function edit($forum_id)
101101
// Regenerate the quick jump cache
102102
$this->feather->cache->store('quickjump', Cache::get_quickjump());
103103

104-
Url::redirect($this->feather->urlFor('editForum', array('id' => $forum_id)), __('Forum updated redirect'));
104+
Router::redirect(Router::pathFor('editForum', array('id' => $forum_id)), __('Forum updated redirect'));
105105

106106
} elseif ($this->request->post('revert_perms')) {
107107
$this->model->delete_permissions($forum_id);
108108

109109
// Regenerate the quick jump cache
110110
$this->feather->cache->store('quickjump', Cache::get_quickjump());
111111

112-
Url::redirect($this->feather->urlFor('editForum', array('id' => $forum_id)), __('Perms reverted redirect'));
112+
Router::redirect(Router::pathFor('editForum', array('id' => $forum_id)), __('Perms reverted redirect'));
113113
}
114114

115115
} else {
@@ -130,14 +130,14 @@ public function edit($forum_id)
130130

131131
public function delete($forum_id)
132132
{
133-
$this->feather->hooks->fire('controller.admin.forums.delete');
133+
Container::get('hooks')->fire('controller.admin.forums.delete');
134134

135135
if($this->request->isPost()) {
136136
$this->model->delete_forum($forum_id);
137137
// Regenerate the quick jump cache
138138
$this->feather->cache->store('quickjump', Cache::get_quickjump());
139139

140-
Url::redirect($this->feather->urlFor('adminForums'), __('Forum deleted redirect'));
140+
Router::redirect(Router::pathFor('adminForums'), __('Forum deleted redirect'));
141141

142142
} else { // If the user hasn't confirmed
143143

@@ -155,7 +155,7 @@ public function delete($forum_id)
155155

156156
public function edit_positions()
157157
{
158-
$this->feather->hooks->fire('controller.admin.forums.edit_positions');
158+
Container::get('hooks')->fire('controller.admin.forums.edit_positions');
159159

160160
foreach ($this->request->post('position') as $forum_id => $position) {
161161
$position = (int) Utils::trim($position);
@@ -165,12 +165,12 @@ public function edit_positions()
165165
// Regenerate the quick jump cache
166166
$this->feather->cache->store('quickjump', Cache::get_quickjump());
167167

168-
Url::redirect($this->feather->urlFor('adminForums'), __('Forums updated redirect'));
168+
Router::redirect(Router::pathFor('adminForums'), __('Forums updated redirect'));
169169
}
170170

171171
public function display()
172172
{
173-
$this->feather->hooks->fire('controller.admin.forums.display');
173+
Container::get('hooks')->fire('controller.admin.forums.display');
174174

175175
if ($this->request->post('update_positions')) {
176176
$this->edit_positions();

featherbb/Controller/Admin/Groups.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ public function __construct()
2020
$this->feather = \Slim\Slim::getInstance();
2121
$this->start = $this->feather->start;
2222
$this->config = $this->feather->config;
23-
$this->user = $this->feather->user;
23+
$this->user = Container::get('user');
2424
$this->request = $this->feather->request;
2525
$this->model = new \FeatherBB\Model\Admin\Groups();
2626
load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'].'featherbb/lang/'.$this->user->language.'/admin/groups.mo');
2727
}
2828

2929
public function display()
3030
{
31-
$this->feather->hooks->fire('controller.admin.groups.display');
31+
Container::get('hooks')->fire('controller.admin.groups.display');
3232

3333
$groups = $this->model->fetch_groups();
3434

@@ -51,7 +51,7 @@ public function display()
5151

5252
public function delete($id)
5353
{
54-
$this->feather->hooks->fire('controller.admin.groups.delete');
54+
Container::get('hooks')->fire('controller.admin.groups.delete');
5555

5656
if ($id < 5) {
5757
throw new Error(__('Bad request'), 403);
@@ -98,7 +98,7 @@ public function delete($id)
9898

9999
public function addedit($id = '')
100100
{
101-
$this->feather->hooks->fire('controller.admin.groups.addedit');
101+
Container::get('hooks')->fire('controller.admin.groups.addedit');
102102

103103
$groups = $this->model->fetch_groups();
104104

featherbb/Controller/Admin/Index.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ public function __construct()
2121
$this->feather = \Slim\Slim::getInstance();
2222
$this->start = $this->feather->start;
2323
$this->config = $this->feather->config;
24-
$this->user = $this->feather->user;
24+
$this->user = Container::get('user');
2525
$this->request = $this->feather->request;
2626
load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'].'featherbb/lang/'.$this->user->language.'/admin/index.mo');
2727
}
2828

2929
public function display($action = null)
3030
{
31-
$this->feather->hooks->fire('controller.admin.index.display');
31+
Container::get('hooks')->fire('controller.admin.index.display');
3232

3333
// Check for upgrade
3434
if ($action == 'check_upgrade') {
@@ -42,9 +42,9 @@ public function display($action = null)
4242
}
4343

4444
if (version_compare($this->config['o_cur_version'], $latest_version, '>=')) {
45-
Url::redirect($this->feather->urlFor('adminIndex'), __('Running latest version message'));
45+
Router::redirect(Router::pathFor('adminIndex'), __('Running latest version message'));
4646
} else {
47-
Url::redirect($this->feather->urlFor('adminIndex'), sprintf(__('New version available message'), '<a href="proxy.php?url=http%3A%2F%2Ffeatherbb.org%2F">FeatherBB.org</a>'));
47+
Router::redirect(Router::pathFor('adminIndex'), sprintf(__('New version available message'), '<a href="proxy.php?url=http%3A%2F%2Ffeatherbb.org%2F">FeatherBB.org</a>'));
4848
}
4949
}
5050

featherbb/Controller/Admin/Maintenance.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ public function __construct()
1818
{
1919
$this->feather = \Slim\Slim::getInstance();
2020
$this->model = new \FeatherBB\Model\Admin\Maintenance();
21-
load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'].'featherbb/lang/'.$this->feather->user->language.'/admin/maintenance.mo');
21+
load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'].'featherbb/lang/'.Container::get('user')->language.'/admin/maintenance.mo');
2222
}
2323

2424
public function display()
2525
{
26-
$this->feather->hooks->fire('controller.admin.maintenance.display');
26+
Container::get('hooks')->fire('controller.admin.maintenance.display');
2727

2828
$action = '';
2929
if ($this->feather->request->post('action')) {

featherbb/Controller/Admin/Options.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ public function __construct()
1919
$this->feather = \Slim\Slim::getInstance();
2020
$this->start = $this->feather->start;
2121
$this->config = $this->feather->config;
22-
$this->user = $this->feather->user;
22+
$this->user = Container::get('user');
2323
$this->request = $this->feather->request;
2424
$this->model = new \FeatherBB\Model\Admin\Options();
2525
load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'].'featherbb/lang/'.$this->user->language.'/admin/options.mo');
2626
}
2727

2828
public function display()
2929
{
30-
$this->feather->hooks->fire('controller.admin.options.display');
30+
Container::get('hooks')->fire('controller.admin.options.display');
3131

3232
if ($this->feather->request->isPost()) {
3333
$this->model->update_options();

0 commit comments

Comments
 (0)