Skip to content

Commit

Permalink
Merge branch 'v2' into user-group-update
Browse files Browse the repository at this point in the history
  • Loading branch information
Derkades committed Nov 7, 2020
2 parents ddc28bf + 060f8f9 commit 461f2e8
Show file tree
Hide file tree
Showing 395 changed files with 25,262 additions and 29,171 deletions.
26 changes: 14 additions & 12 deletions 403.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
Expand Down Expand Up @@ -30,16 +30,18 @@
require(ROOT_PATH . '/core/templates/footer.php');

// Assign Smarty variables
$smarty->assign(array(
'403_TITLE' => $language->get('errors', '403_title'),
'CONTENT' => $language->get('errors', '403_content'),
'CONTENT_LOGIN' => $language->get('errors', '403_login'),
'BACK' => $language->get('errors', '403_back'),
'HOME' => $language->get('errors', '403_home'),
'LOGIN' => $language->get('general', 'sign_in'),
'LOGIN_LINK' => URL::build('/login'),
'PATH' => (defined('CONFIG_PATH') ? CONFIG_PATH : '')
));
$smarty->assign(
array(
'403_TITLE' => $language->get('errors', '403_title'),
'CONTENT' => $language->get('errors', '403_content'),
'CONTENT_LOGIN' => $language->get('errors', '403_login'),
'BACK' => $language->get('errors', '403_back'),
'HOME' => $language->get('errors', '403_home'),
'LOGIN' => $language->get('general', 'sign_in'),
'LOGIN_LINK' => URL::build('/login'),
'PATH' => (defined('CONFIG_PATH') ? CONFIG_PATH : '')
)
);

// Display template
$template->displayTemplate('403.tpl', $smarty);
$template->displayTemplate('403.tpl', $smarty);
24 changes: 13 additions & 11 deletions 404.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
Expand All @@ -9,7 +9,7 @@
* 404 Not Found page
*/

header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");

define('PAGE', 404);
$page_title = '404';
Expand All @@ -30,14 +30,16 @@
require(ROOT_PATH . '/core/templates/footer.php');

// Assign Smarty variables
$smarty->assign(array(
'404_TITLE' => $language->get('errors', '404_title'),
'CONTENT' => $language->get('errors', '404_content'),
'BACK' => $language->get('errors', '404_back'),
'HOME' => $language->get('errors', '404_home'),
'ERROR' => str_replace(array('{x}', '{y}'), array('<a href="' . URL::build('/contact') . '">', '</a>'), $language->get('errors', '404_error')),
'PATH' => (defined('CONFIG_PATH') ? CONFIG_PATH : '')
));
$smarty->assign(
array(
'404_TITLE' => $language->get('errors', '404_title'),
'CONTENT' => $language->get('errors', '404_content'),
'BACK' => $language->get('errors', '404_back'),
'HOME' => $language->get('errors', '404_home'),
'ERROR' => str_replace(array('{x}', '{y}'), array('<a href="' . URL::build('/contact') . '">', '</a>'), $language->get('errors', '404_error')),
'PATH' => (defined('CONFIG_PATH') ? CONFIG_PATH : '')
)
);

// Display template
$template->displayTemplate('404.tpl', $smarty);
$template->displayTemplate('404.tpl', $smarty);
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ Unfortunately it's only possible to view master branch contributions. Once the v
- Spanish: [Ariuw](https://github.com/Ariuw), [iMaykolRD_](https://namelessmc.com/profile/iMaykolRD_/), TheSuperSkills, [zJerino](https://namelessmc.com/profile/zJerino/)
- Swedish: [IsS127](https://github.com/IsS127)
- Turkish: xOrcun
- French: [WhiteSkyAngel](https://github.com/WhiteSkyAngel)
9 changes: 2 additions & 7 deletions core/classes/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,10 @@
class Discord {

public static function discordBotRequest($url = '/') {

$bot_url_attempt = Util::curlGetContents(BOT_URL . $url);
$valid_responses = array('success', 'failure-cannot-interact', 'failure-invalid-api-url');
if (in_array($bot_url_attempt, $valid_responses)) return $bot_url_attempt;
else {
$backup_bot_url_attempt = Util::curlGetContents(BOT_URL_BACKUP . $url);
if (in_array($backup_bot_url_attempt, $valid_responses)) return $backup_bot_url_attempt;
else return false;
}
else return false;
}

public static function getDiscordRoleId(DB $db, $group_id) {
Expand Down Expand Up @@ -51,7 +46,7 @@ public static function removeDiscordRole($user_query, $group, Language $language

$api_url = rtrim(Util::getSelfURL(), '/') . rtrim(URL::build('/api/v2/' . Output::getClean(Util::getSetting(DB::getInstance(), 'mc_api_key')), '', 'non-friendly'), '/');

// TODO: Probably a nicer way to do this
// Probably a nicer way to do this
$url = '/roleChange?id=' . $user_query->discord_id . '&guild_id=' . Util::getSetting(DB::getInstance(), 'discord');

if ($group_discord_id == null) return;
Expand Down
Loading

0 comments on commit 461f2e8

Please sign in to comment.