Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Remove obsolete access checks and reworked some If/Else statements
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrisp2 committed Nov 5, 2018
1 parent 1674791 commit 8a96175
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion common/head.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<a class="nav-item nav-link active" href="index.php">Home</a>
<?php
// Check if the user is a CM, and don't give access to project/contributions/tasks
if ($hasaccess != IS_STAFF && $hasaccess >= IS_TRANSLATOR) {
if ($hasaccess < IS_STAFF && $hasaccess >= IS_TRANSLATOR) {
?>
<a class="nav-item nav-link" href="projects.php">Projects</a>
<a class="nav-item nav-link" href="contributions.php">Contributions</a>
Expand Down
8 changes: 1 addition & 7 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ function ConvertArray2CSV($arrayinput, $seperator) {
foreach ($arrayinput as $item) {
$thisarray .= $item;
$i++;
if ($i == $arraycount) {

} else {
if ($i != $arraycount) {
$thisarray .= ",";
}
}
Expand Down Expand Up @@ -938,20 +936,16 @@ function GetSingleReport($reportid) {

function GetMainPageContent() {
if (isset($_COOKIE['username'])) {
$hasaccess = CheckUserAccess($_COOKIE['username']);
return "Welcome, " . $_COOKIE['username'] . ". You are already logged in, and you are registered as a member with access to the app, so feel free to stick around.";
} else {
$hasaccess = NO_ACCESS;
return "This app is only intended for use by the ".$GLOBALS['teamname']." Translation Team. You need to login before you proceed to use anything in this app!<br /><a href=\"https://steemconnect.com/oauth2/authorize?client_id=aristotle.app&redirect_uri=https://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']) . "callback.php&scope=login\" class=\"font-weight-bold\">Secure login via SteemConnect</a>";
}
}

function GetMenu() {
if (isset($_COOKIE['username'])) {
$hasaccess = CheckUserAccess($_COOKIE['username']);
return "<button type=\"button\" class=\"btn btn-secondary dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Welcome ".$_COOKIE['username']."</button><div class=\"dropdown-menu dropdown-menu-right\"><a class=\"btn dropdown-item\" href=\"logout.php\">Logout</a></div>";
} else {
$hasaccess = NO_ACCESS;
return "<button type=\"button\" class=\"btn btn-secondary dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Welcome, Guest</button><div class=\"dropdown-menu dropdown-menu-right\"><a class=\"btn dropdown-item\" href=\"https://steemconnect.com/oauth2/authorize?client_id=aristotle.app&redirect_uri=". $_SERVER['REQUEST_SCHEME'] . "://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']) . "callback.php&scope=login\">Login via SteemConnect</a></div>";
}
}
Expand Down

0 comments on commit 8a96175

Please sign in to comment.