-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3a41724
Showing
23 changed files
with
502 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.gitattributes export-ignore | ||
/.github export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: 🐛 Bug Report | ||
description: Create a Bug Report | ||
title: "🐛 [Bug Report]: " | ||
labels: ['bug'] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Hello, thanks for taking the time to fill out this bug report! | ||
Before you begin, **please ensure there is no existing open or closed issue related to your report**. | ||
--- | ||
- type: input | ||
id: module-version | ||
attributes: | ||
label: Module Version | ||
description: e.g. 1.0.0 | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: what-happened | ||
attributes: | ||
label: What happened? | ||
description: Describe the issue in detail. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: issue-reproduce | ||
attributes: | ||
label: How can the issue be reproduced? | ||
description: Describe steps to reproduce the behavior. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: issue-screenshots | ||
attributes: | ||
label: Screenshots | ||
description: Provide screenshots here or share links. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: WoW-CMS Community Support | ||
url: https://discord.wow-cms.com | ||
about: Join our community! Here you can get a faster responses about an issue. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# _Status Module_ | ||
|
||
[![Version](https://img.shields.io/github/v/release/wow-cms/bc-status?color=green&include_prereleases&logo=github&sort=semver&style=flat-square)](https://github.com/WoW-CMS/bc-status/releases) | ||
[![License](https://img.shields.io/github/license/wow-cms/bc-status?color=blue&style=flat-square)](../LICENSE) | ||
|
||
## Requirements | ||
|
||
1. **BlizzCMS version** 2.0.0+ | ||
|
||
## Contributors | ||
|
||
Thanks to everyone who has contributed! | ||
|
||
[![Contributors](https://contrib.rocks/image?repo=wow-cms/bc-status)](https://github.com/WoW-CMS/bc-status/graphs/contributors) | ||
|
||
## License | ||
|
||
This module is released under the [MIT License](../LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
ignore: | ||
- dependency-name: "*" | ||
update-types: ["version-update:semver-minor", "version-update:semver-patch"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
changelog: | ||
exclude: | ||
authors: | ||
- dependabot | ||
categories: | ||
- title: 🚨 Breaking Changes | ||
labels: | ||
- 'breaking change' | ||
- title: 🐛 Bug Fixes | ||
labels: | ||
- bug | ||
- title: ✨ New Features | ||
labels: | ||
- 'new feature' | ||
- title: 🚀 Enhancements | ||
labels: | ||
- enhancement | ||
- refactor | ||
- 'missing feature' | ||
- title: ⚙️ Dependency updates | ||
labels: | ||
- dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# Variables | ||
NAME=$1 | ||
|
||
# Create zip archive | ||
zip -r ${NAME}.zip . -x \ | ||
*.git* \ | ||
.github/\* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
build: | ||
name: Build release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get tag version | ||
id: get_version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_OUTPUT | ||
|
||
- name: Run script | ||
run: | | ||
chmod +x ./.github/scripts/build-zip | ||
./.github/scripts/build-zip status-${{ steps.get_version.outputs.RELEASE_VERSION }} | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: status-${{ steps.get_version.outputs.RELEASE_VERSION }}.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#------------------------- | ||
# Operating Specific Junk Files | ||
#------------------------- | ||
|
||
# OS X | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# OS X Thumbnails | ||
._* | ||
|
||
# Windows image file caches | ||
Thumbs.db | ||
ehthumbs.db | ||
Desktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
# Linux | ||
*~ | ||
|
||
# KDE directory preferences | ||
.directory | ||
|
||
# Linux trash folder which might appear on any partition or disk | ||
.Trash-* | ||
|
||
#------------------------- | ||
# IDE / Development Files | ||
#------------------------- | ||
|
||
# Jetbrains editors (PHPStorm, etc) | ||
.idea/ | ||
*.iml | ||
|
||
# Netbeans | ||
nbproject/ | ||
build/ | ||
nbbuild/ | ||
dist/ | ||
nbdist/ | ||
nbactions.xml | ||
nb-configuration.xml | ||
.nb-gradle/ | ||
|
||
# Sublime Text | ||
*.tmlanguage.cache | ||
*.tmPreferences.cache | ||
*.stTheme.cache | ||
*.sublime-workspace | ||
*.sublime-project | ||
.phpintel | ||
/api/ | ||
|
||
# Visual Studio Code | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 - 2022, WoW-CMS | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
defined('BASEPATH') OR exit('No direct script access allowed'); | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Migrations Status | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Status of the module's migration functionality. | ||
| Disabled by default for security reasons. | ||
| | ||
*/ | ||
$config['migration_enabled'] = true; | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Migrations Version | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Parameter set as the maximum limit to proceed with the | ||
| migration in the module. | ||
| The version use timestamp format: YYYYMMDDHHIISS | ||
| | ||
*/ | ||
$config['migration_version'] = 20220920120000; | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Migrations Path | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Path to the module migrations folder. | ||
| | ||
*/ | ||
$config['migration_path'] = '../migrations/'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
defined('BASEPATH') OR exit('No direct script access allowed'); | ||
|
||
return [ | ||
'name' => 'Status', | ||
'description' => 'Page with the list of online players for each realm', | ||
'version' => '1.0.0', | ||
'author' => [ | ||
'name' => 'WoW-CMS', | ||
'website' => 'https://wow-cms.com' | ||
], | ||
'dashboard' => '' | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
defined('BASEPATH') OR exit('No direct script access allowed'); | ||
|
||
$route['status']['get'] = 'status/index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* BlizzCMS | ||
* | ||
* @author WoW-CMS | ||
* @copyright Copyright (c) 2019 - 2022, WoW-CMS (https://wow-cms.com) | ||
* @license https://opensource.org/licenses/MIT MIT License | ||
*/ | ||
defined('BASEPATH') OR exit('No direct script access allowed'); | ||
|
||
class Status extends BS_Controller | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
is_module_installed('status', true); | ||
|
||
$this->load->model('status_model'); | ||
|
||
$this->load->language('status'); | ||
} | ||
|
||
public function index() | ||
{ | ||
require_permission('view.status'); | ||
|
||
$data = [ | ||
'realms' => $this->realm_model->find_all() | ||
]; | ||
|
||
$this->template->title(lang('online_players'), config_item('app_name')); | ||
|
||
$this->template->build('index', $data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>403 Forbidden</title> | ||
</head> | ||
<body> | ||
<p>Directory access is forbidden.</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>403 Forbidden</title> | ||
</head> | ||
<body> | ||
<p>Directory access is forbidden.</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
defined('BASEPATH') OR exit('No direct script access allowed'); | ||
|
||
$lang['online_players'] = 'Online players'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
defined('BASEPATH') OR exit('No direct script access allowed'); | ||
|
||
$lang['online_players'] = 'Jugadores en linea'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
defined('BASEPATH') OR exit('No direct script access allowed'); | ||
|
||
class Migration_Add_permissions extends CI_Migration | ||
{ | ||
public function up() | ||
{ | ||
$this->permission_model->insert_batch([ | ||
['key' => 'view.status', 'module' => 'status', 'description' => 'Can view status page'] | ||
]); | ||
|
||
$permissions = $this->permission_model->find_all(['module' => 'status']); | ||
$permsLinked = []; | ||
|
||
foreach ($permissions as $permission) { | ||
$permsLinked[] = ['role_id' => '1', 'permission_id' => $permission->id]; | ||
$permsLinked[] = ['role_id' => '2', 'permission_id' => $permission->id]; | ||
$permsLinked[] = ['role_id' => '3', 'permission_id' => $permission->id]; | ||
$permsLinked[] = ['role_id' => '4', 'permission_id' => $permission->id]; | ||
$permsLinked[] = ['role_id' => '5', 'permission_id' => $permission->id]; | ||
} | ||
|
||
$this->role_permission_model->insert_batch($permsLinked); | ||
} | ||
|
||
public function down() | ||
{ | ||
$permissions = $this->permission_model->find_all(['module' => 'status'], 'array'); | ||
$permissionsIds = array_column($permissions, 'id'); | ||
|
||
if ($permissionsIds !== []) { | ||
$this->permission_model->delete_in('id', $permissionsIds); | ||
} | ||
} | ||
} |
Oops, something went wrong.