Skip to content

Commit

Permalink
Add administrator permission for full access
Browse files Browse the repository at this point in the history
  • Loading branch information
partydragen committed Aug 25, 2021
1 parent 4b25e86 commit 03775d1
Show file tree
Hide file tree
Showing 26 changed files with 78 additions and 24 deletions.
6 changes: 5 additions & 1 deletion core/classes/User.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr9
* NamelessMC version 2.0.0-pr11
*
* User class
*/
Expand Down Expand Up @@ -1071,6 +1071,10 @@ public function hasPermission($permission) {
if ($this->isLoggedIn() && $groups) {
foreach ($groups as $group) {
$this->_permissions = json_decode($group->permissions, true);

if (isset($this->_permissions['administrator']) && $this->_permissions['administrator'] == 1) {
return true;
}

if (isset($this->_permissions[$permission]) && $this->_permissions[$permission] == 1) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion core/installation/views/includes/site_initialize.php
Expand Up @@ -109,7 +109,7 @@
'group_username_color' => '#ff0000',
'group_username_css' => '',
'admin_cp' => 1,
'permissions' => '{"admincp.core":1,"admincp.core.api":1,"admincp.core.seo":1,"admincp.core.general":1,"admincp.core.avatars":1,"admincp.core.fields":1,"admincp.core.debugging":1,"admincp.core.emails":1,"admincp.core.navigation":1,"admincp.core.announcements":1,"admincp.core.reactions":1,"admincp.core.registration":1,"admincp.core.social_media":1,"admincp.core.terms":1,"admincp.errors":1,"admincp.core.placeholders":1,"admincp.integrations":1,"admincp.discord":1,"admincp.minecraft":1,"admincp.minecraft.authme":1,"admincp.minecraft.verification":1,"admincp.minecraft.servers":1,"admincp.minecraft.query_errors":1,"admincp.minecraft.banners":1,"admincp.modules":1,"admincp.pages":1,"admincp.security":1,"admincp.security.acp_logins":1,"admincp.security.template":1,"admincp.styles":1,"admincp.styles.panel_templates":1,"admincp.styles.templates":1,"admincp.styles.templates.edit":1,"admincp.styles.images":1,"admincp.update":1,"admincp.users":1,"admincp.users.edit":1,"admincp.groups":1,"admincp.groups.self":1,"admincp.widgets":1,"modcp.ip_lookup":1,"modcp.punishments":1,"modcp.punishments.warn":1,"modcp.punishments.ban":1,"modcp.punishments.banip":1,"modcp.punishments.revoke":1,"modcp.reports":1,"modcp.profile_banner_reset":1,"usercp.messaging":1,"usercp.signature":1,"admincp.forums":1,"usercp.private_profile":1,"usercp.nickname":1,"usercp.profile_banner":1,"profile.private.bypass":1, "admincp.security.all":1,"admincp.core.hooks":1,"admincp.security.group_sync":1,"admincp.core.emails_mass_message":1,"modcp.punishments.reset_avatar":1,"usercp.gif_avatar":1}',
'permissions' => '{"administrator":1,"admincp.core":1,"admincp.core.api":1,"admincp.core.seo":1,"admincp.core.general":1,"admincp.core.avatars":1,"admincp.core.fields":1,"admincp.core.debugging":1,"admincp.core.emails":1,"admincp.core.navigation":1,"admincp.core.announcements":1,"admincp.core.reactions":1,"admincp.core.registration":1,"admincp.core.social_media":1,"admincp.core.terms":1,"admincp.errors":1,"admincp.core.placeholders":1,"admincp.integrations":1,"admincp.discord":1,"admincp.minecraft":1,"admincp.minecraft.authme":1,"admincp.minecraft.verification":1,"admincp.minecraft.servers":1,"admincp.minecraft.query_errors":1,"admincp.minecraft.banners":1,"admincp.modules":1,"admincp.pages":1,"admincp.security":1,"admincp.security.acp_logins":1,"admincp.security.template":1,"admincp.styles":1,"admincp.styles.panel_templates":1,"admincp.styles.templates":1,"admincp.styles.templates.edit":1,"admincp.styles.images":1,"admincp.update":1,"admincp.users":1,"admincp.users.edit":1,"admincp.groups":1,"admincp.groups.self":1,"admincp.widgets":1,"modcp.ip_lookup":1,"modcp.punishments":1,"modcp.punishments.warn":1,"modcp.punishments.ban":1,"modcp.punishments.banip":1,"modcp.punishments.revoke":1,"modcp.reports":1,"modcp.profile_banner_reset":1,"usercp.messaging":1,"usercp.signature":1,"admincp.forums":1,"usercp.private_profile":1,"usercp.nickname":1,"usercp.profile_banner":1,"profile.private.bypass":1, "admincp.security.all":1,"admincp.core.hooks":1,"admincp.security.group_sync":1,"admincp.core.emails_mass_message":1,"modcp.punishments.reset_avatar":1,"usercp.gif_avatar":1}',

This comment has been minimized.

Copy link
@Derkades

Derkades Aug 25, 2021

Member

Does it still need all individual permissions, instead of just administrator?

This comment has been minimized.

Copy link
@partydragen

partydragen Aug 25, 2021

Author Member

No but idk just in case ¯_(ツ)_/¯

'order' => 1,
'staff' => 1
));
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Chinese(Simplified)/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr9
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -177,6 +177,8 @@
'emails_mass_message_sent_successfully' => '邮件广播发送成功。',
'emails_mass_message_replacements' => '您可在信息中使用占位符。可用占位符: {username}(用户名), {sitename}(网站名)',
'emails_mass_message_loading' => '加载中... 请勿刷新此页面。这可能需要几分钟。',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => '占位符',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Chinese/admin.php
Expand Up @@ -3,7 +3,7 @@
* Made by Samerton
* Translation by Hi_Michael
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -179,6 +179,8 @@
'emails_mass_message_sent_successfully' => 'Successfully sent a mass email message.',
'emails_mass_message_replacements' => 'You can use variables in your email message. Supported variables: {username}, {sitename}',
'emails_mass_message_loading' => 'Loading... Please do not reload the page. This may take a while.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Czech/admin.php
Expand Up @@ -3,7 +3,7 @@
* Made by Samerton
* Translated by Fjuro
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -165,6 +165,8 @@
'emails_mass_message_sent_successfully' => 'Hromadná zpráva úspěšně odeslána.',
'emails_mass_message_replacements' => 'Ve vaší zprávě můžete použít proměnné. Podporované proměnné: {username}, {sitename}',
'emails_mass_message_loading' => 'Načítání... Nenačítejte stránku znovu. Může to chvíli trvat.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholdery',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Danish/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by Samerton & Translated by Codiaz
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr10
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -164,6 +164,8 @@
'emails_mass_message_sent_successfully' => 'Successfully sent a mass email message.',
'emails_mass_message_replacements' => 'You can use variables in your email message. Supported variables: {username}, {sitename}',
'emails_mass_message_loading' => 'Loading... Please do not reload the page. This may take a while.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// SEO
'seo' => 'SEO',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Dutch/admin.php
Expand Up @@ -4,7 +4,7 @@
* en vertaald en bijgewerkt door Sander Lambrechts, Jesse Geerts, Derkades, smessie en Tin Xian
*
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr10
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -177,6 +177,8 @@
'emails_mass_message_sent_successfully' => 'Succesvol een massa e-mail bericht verstuurd.',
'emails_mass_message_replacements' => 'U kunt variabelen gebruiken in uw e-mailbericht. Ondersteunde variabelen: {username}, {sitename}',
'emails_mass_message_loading' => 'Laden... Laad de pagina niet opnieuw. Dit kan een tijdje duren.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/EnglishUK/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -164,6 +164,8 @@
'emails_mass_message_sent_successfully' => 'Successfully sent a mass email message.',
'emails_mass_message_replacements' => 'You can use variables in your email message. Supported variables: {username}, {sitename}',
'emails_mass_message_loading' => 'Loading... Please do not reload the page. This may take a while.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/EnglishUS/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -175,6 +175,8 @@
'emails_mass_message_sent_successfully' => 'Successfully sent a mass email message.',
'emails_mass_message_replacements' => 'You can use variables in your email message. Supported variables: {username}, {sitename}',
'emails_mass_message_loading' => 'Loading... Please do not reload the page. This may take a while.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/French/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by White.
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr10
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -154,6 +154,8 @@
'validation_promote_group_info' => 'C’est le groupe auquel un utilisateur sera promu une fois qu’il aura validé son compte.',
'login_method' => 'Méthode de connexion',
'privacy_and_terms' => 'Confidentialité et conditions',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Espace réservé',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/German/admin.php
Expand Up @@ -3,7 +3,7 @@
* Made by Samerton
* Translation by BukkitTNT, M_Viper
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr10
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -175,6 +175,8 @@
'emails_mass_message_sent_successfully' => 'Erfolgreich eine Massen-E-Mail-Nachricht gesendet.',
'emails_mass_message_replacements' => 'Sie können Variablen in Ihrer E-Mail-Nachricht verwenden. Unterstützte Variablen: {username}, {sitename}',
'emails_mass_message_loading' => 'Laden ... Bitte laden Sie die Seite nicht neu. Das kann eine Weile dauern.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Greek/admin.php
Expand Up @@ -4,7 +4,7 @@
* https://github.com/Ar1sC
* https://twitter.com/Ar1cC
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -177,6 +177,8 @@
'emails_mass_message_sent_successfully' => 'Successfully sent a mass email message.',
'emails_mass_message_replacements' => 'You can use variables in your email message. Supported variables: {username}, {sitename}',
'emails_mass_message_loading' => 'Loading... Please do not reload the page. This may take a while.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Italian/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by alsoGAMER
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -175,6 +175,8 @@
'emails_mass_message_sent_successfully' => 'Inviato con successo un messaggio di massa via email.',
'emails_mass_message_replacements' => 'Puoi utilizzare variabili nel tuo messaggio di email. Variabili supportate: {username}, {sitename}',
'emails_mass_message_loading' => "Caricamento in corso... Non ricaricare la pagina. Potrebbe volerci un po'.",
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Japanese/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr10
* NamelessMC version 2.0.0-pr11
*
* Translator
* - SimplyRin( @SimplyRin_, https://www.simplyrin.net )
Expand Down Expand Up @@ -180,6 +180,8 @@
'emails_mass_message_sent_successfully' => '大量のメールメッセージの送信に成功しました。',
'emails_mass_message_replacements' => 'メールメッセージでは、変数を使用することができます。サポートされている変数: {username}, {sitename}',
'emails_mass_message_loading' => '読み込み中... ページを再読み込みしないでください。しばらく時間がかかる場合があります。',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'プレースホルダー',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Lithuanian/admin.php
Expand Up @@ -3,7 +3,7 @@
* Made by Samerton
* Translation by Locus
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -173,6 +173,8 @@
'emails_mass_message_sent_successfully' => 'Successfully sent a mass email message.',
'emails_mass_message_replacements' => 'You can use variables in your email message. Supported variables: {username}, {sitename}',
'emails_mass_message_loading' => 'Loading... Please do not reload the page. This may take a while.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Norwegian/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Translations by Maiu
* https://github.com/NamelessMC/Nameless/
* NamelessMC versjon 2.0.0-pr8
* NamelessMC versjon 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -175,6 +175,8 @@
'emails_mass_message_sent_successfully' => 'E-post-massemelding har blitt sendt.',
'emails_mass_message_replacements' => 'Du kan bruke variabler i din e-post-massemelding. Støttede variabler: {username}, {sitename}',
'emails_mass_message_loading' => 'Laster inn... Vennligst ikke last inn siden på nytt. Dette kan ta en stund.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Polish/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -175,6 +175,8 @@
'emails_mass_message_sent_successfully' => 'Wysłano wiadomość pomyślnie.',
'emails_mass_message_replacements' => 'Możesz użyć zmiennych w wiadomo. Przykłady:: {username}, {sitename}',
'emails_mass_message_loading' => 'Ładowanie... Nie odświeżaj strony. To trochę zajmie.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Portuguese/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -177,6 +177,8 @@
'emails_mass_message_sent_successfully' => 'Mensagem de email em massa enviada com sucesso.',
'emails_mass_message_replacements' => 'Você pode usar variáveis ​​em sua mensagem de email. Variáveis ​​com suporte: {username}, {sitename}',
'emails_mass_message_loading' => 'Carregando... Por favor, não recarregue a página. Isso pode demorar um pouco.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
2 changes: 2 additions & 0 deletions custom/languages/Romanian/admin.php
Expand Up @@ -180,6 +180,8 @@
'emails_mass_message_sent_successfully' => 'Successfully sent a mass email message.',
'emails_mass_message_replacements' => 'You can use variables in your email message. Supported variables: {username}, {sitename}',
'emails_mass_message_loading' => 'Loading... Please do not reload the page. This may take a while.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Russian/admin.php
Expand Up @@ -3,7 +3,7 @@
* Made by Samerton
* Translated by Я научу тебя шить XIMI
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr9
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -176,6 +176,8 @@
'emails_mass_message_sent_successfully' => 'Сообщения отправлены.',
'emails_mass_message_replacements' => 'Вы можете использовать различные переменные в сообщениях. Поддерживаемые переменные: {username}, {sitename}',
'emails_mass_message_loading' => 'Загрузка... Не перезагружайте страницу. Это займёт какое-то время.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Slovak/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by RobiNN
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr10
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -164,6 +164,8 @@
'emails_mass_message_sent_successfully' => 'Hromadná emailová správa bola úspešne odoslaná.',
'emails_mass_message_replacements' => 'Vo svojej emailovej správe môžete použiť premenné. Podporované premenné: {username}, {sitename}',
'emails_mass_message_loading' => 'Načítava sa... Stránku znova nerefreshujte. Môže to chvíľu trvať.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholdery',
Expand Down
4 changes: 3 additions & 1 deletion custom/languages/Spanish/admin.php
Expand Up @@ -2,7 +2,7 @@
/*
* Made by TheSuperSkills (Edited by Ariuw, iMaykolRD_ and zJerino)
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
* NamelessMC version 2.0.0-pr11
*
* License: MIT
*
Expand Down Expand Up @@ -174,6 +174,8 @@
'emails_mass_message_sent_successfully' => 'Successfully sent a mass email message.',
'emails_mass_message_replacements' => 'You can use variables in your email message. Supported variables: {username}, {sitename}',
'emails_mass_message_loading' => 'Loading... Please do not reload the page. This may take a while.',
'administrator' => 'Administrator',
'administrator_permission_info' => 'Members with this permission will have every permission. This is a dangerous permission to grant.',

// Placeholders
'placeholders' => 'Placeholders',
Expand Down

0 comments on commit 03775d1

Please sign in to comment.