r8conf2016/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 45 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
Spaces must be used to indent lines; tabs are not allowed Open
Open
include('../mysql_access.php');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} elseif($exec_page){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo "<p>There's been an error. This page doesn't have any content.</p>";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
require_once('login_form.php');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo "<h2>Sorry</h2>";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_insuff_permissions();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$exec_authorized = True;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} elseif($active_page){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_public();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_public();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} else{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_error();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if($exec_authorized){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_exec();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_insuff_permissions();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if($public_page){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$sql = "SELECT * FROM exec_permissions WHERE position = \"{$_SESSION['sessionposition']}\" AND page = \"{$_SERVER['PHP_SELF']}\";";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if($exec_page){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_active();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} elseif($public_page){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_active();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo "<div class=\"small-12 columns\">";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo "</div>";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} elseif($exec_page || $active_page){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if(mysqli_num_rows($result) != 0){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if($active_page){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo "<p>Only certain members of exec can view this page.</p>";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo "</div>";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$exec_authorized = False;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$result = $db->query($sql);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_error();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} elseif($public_page){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo "<h2>Oops</h2>";
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
Open
$sql = "SELECT * FROM exec_permissions WHERE position = \"{$_SESSION['sessionposition']}\" AND page = \"{$_SERVER['PHP_SELF']}\";";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} elseif($exec_page){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} else{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_error();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_login();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if($_SESSION['sessionexec'] == 1){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} else{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} else{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
show_public();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo "<div class=\"small-12 columns\">";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if(isset($_SESSION['sessionID'])){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if($exec_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if(isset($_SESSION['sessionID'])){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} elseif($public_page){
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if($active_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if($active_page){
- Exclude checks
Expected 1 space after ELSE keyword; 0 found Open
Open
} else{
- Exclude checks
Expected 1 space after ELSE keyword; 0 found Open
Open
} else{
- Exclude checks
Expected 1 space after ELSEIF keyword; 0 found Open
Open
} elseif($public_page){
- 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($active_page){
- Exclude checks
Opening brace should be on a new line Open
Open
function show_login() {
- Exclude checks
Expected 1 space after ELSEIF keyword; 0 found Open
Open
} elseif($exec_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} elseif($exec_page || $active_page){
- Exclude checks
Expected 1 space after ELSEIF keyword; 0 found Open
Open
} elseif($exec_page || $active_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if($public_page){
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if($_SESSION['sessionexec'] == 1){
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if(mysqli_num_rows($result) != 0){
- Exclude checks
Opening brace should be on a new line Open
Open
function show_error() {
- 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($public_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if($exec_authorized){
- Exclude checks
Expected 1 space after ELSEIF keyword; 0 found Open
Open
} elseif($public_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} elseif($public_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} elseif($exec_page){
- 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($exec_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if(mysqli_num_rows($result) != 0){
- Exclude checks
Expected 1 space after ELSE keyword; 0 found Open
Open
} else{
- Exclude checks
Expected 1 space after ELSEIF keyword; 0 found Open
Open
} elseif($exec_page){
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} elseif($exec_page){
- Exclude checks
A closing tag is not permitted at the end of a PHP file Open
Open
?>
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if($_SESSION['sessionexec'] == 1){
- 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($active_page){
- Exclude checks
Expected 1 newline at end of file; 0 found Open
Open
?>
- Exclude checks