permissions.php
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 48 and the first side effect is on line 4. Open
Open
<?php
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "True" Open
Open
$exec_authorized = True;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "False" Open
Open
$exec_authorized = False;
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
Open
$sql = "SELECT * FROM exec_permissions WHERE position = \"{$_SESSION['sessionposition']}\" AND page = \"$permissions_page\";";
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
include('mysql_access.php');
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
show_exec();
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if(isset($_SESSION['sessionID'])){
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if($exec_page){
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
$result = $db->query($sql);
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 6 Open
Open
}
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
show_active();
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} elseif($exec_page){
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
if($public_page){
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
echo "<h2>Sorry</h2>";
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
if($_SESSION['sessionexec'] == 1){
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
$exec_authorized = False;
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 6 Open
Open
if (!isset($permissions_page)) {
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 8 Open
Open
$exec_authorized = True;
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} elseif($public_page){
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
} else{
- Exclude checks
Expected 1 space after ELSE keyword; 0 found Open
Open
} else{
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if($active_page){
- Exclude checks
Expected 1 space after ELSEIF keyword; 0 found Open
Open
} elseif($exec_page){
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
show_insuff_permissions();
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
show_login();
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
} else{
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if($exec_authorized){
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if($_SESSION['sessionexec'] == 1){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} elseif($public_page){
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
}
- Exclude checks
Expected 1 space after ELSE keyword; 0 found Open
Open
} else{
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
}
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if(mysqli_num_rows($result) != 0){
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
} elseif($exec_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if($_SESSION['sessionexec'] == 1){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if($exec_page){
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 6 Open
Open
if(mysqli_num_rows($result) != 0){
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
show_insuff_permissions();
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
}
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if(mysqli_num_rows($result) != 0){
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
} elseif($active_page){
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
require_once('login_form.php');
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if(isset($_SESSION['sessionID'])){
- Exclude checks
Expected 1 space after ELSEIF keyword; 0 found Open
Open
} elseif($active_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} elseif($active_page){
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
} elseif($public_page){
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
} elseif($exec_page || $active_page){
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
$sql = "SELECT * FROM exec_permissions WHERE position = \"{$_SESSION['sessionposition']}\" AND page = \"$permissions_page\";";
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
} elseif($public_page){
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
show_public();
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
show_public();
- Exclude checks
Expected 1 space after ELSEIF keyword; 0 found Open
Open
} elseif($exec_page || $active_page){
- Exclude checks
Expected 1 space after ELSE keyword; 0 found Open
Open
} else{
- Exclude checks
Opening brace should be on a new line Open
Open
function show_error() {
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
echo "<h2>Oops</h2>";
- Exclude checks
Opening brace should be on a new line Open
Open
function show_login() {
- Exclude checks
A closing tag is not permitted at the end of a PHP file Open
Open
?>
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
if($exec_page){
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 6 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
if($exec_authorized){
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
show_public();
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
show_error();
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if($public_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} elseif($exec_page || $active_page){
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
echo "<div class=\"small-12 columns\">";
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
echo "<p>Only certain members of exec can view this page.</p>";
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 8 Open
Open
$permissions_page = $_SERVER['PHP_SELF'];
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if($exec_authorized){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} elseif($exec_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if($active_page){
- Exclude checks
Expected 1 space after ELSEIF keyword; 0 found Open
Open
} elseif($public_page){
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
show_error();
- Exclude checks
Expected 1 space after ELSEIF keyword; 0 found Open
Open
} elseif($public_page){
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
show_active();
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if($public_page){
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
echo "</div>";
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
if($active_page){
- Exclude checks
Expected 1 space after ELSE keyword; 0 found Open
Open
} else{
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
echo "<p>There's been an error. This page doesn't have any content.</p>";
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
} else{
- Exclude checks
Expected 1 space after ELSE keyword; 0 found Open
Open
} else{
- Exclude checks
Opening brace should be on a new line Open
Open
function show_insuff_permissions() {
- Exclude checks
Expected 1 space after ELSEIF keyword; 0 found Open
Open
} elseif($exec_page){
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
Open
show_error();
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
} else{
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
} elseif($exec_page){
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
echo "</div>";
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
echo "<div class=\"small-12 columns\">";
- Exclude checks