Esempio n. 1
0
		<center>
			<div id='logo'>
				<img src='images/logo.png' alt='Grinder' title='...and the machine grinds on!'/>
			</div>
		</center>

		<div id="tabs">
		
			<?php 
if (user_isloggedin()) {
    echo "<ul>";
    echo "<li><a href='system.php'>System</a></li>";
    echo "<li><a href='crashes.php'>Crashes</a></li>";
    echo "<li><a href='fuzzers.php'>Fuzzers</a></li>";
    if (user_isadministrator()) {
        echo "<li><a href='settings.php'>Settings</a></li>";
    }
    echo "<li><a href='account.php'>My Account</a></li>";
    echo "<button id='logout_button' title='Logout' style='width:30px;height:30px;'>&nbsp;</button>";
    echo "</ul>";
} else {
    echo "\t<ul>\n\t\t\t\t\t\t\t\t<li><a href='#ui-tabs-1'>Login</a></li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t<div id='ui-tabs-1'>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<div style='display:none;' class='ui-widget' id='https_warning'>\n\t\t\t\t\t\t\t\t\t<div class='ui-state-error ui-corner-all' style='padding: 0 .7em;'> \n\t\t\t\t\t\t\t\t\t\t<p><span class='ui-icon ui-icon-alert' style='float: left; margin-right: .3em;'></span> \n\t\t\t\t\t\t\t\t\t\t<strong>Warning: </strong>You are not viewing this page over HTTPS. You should be viewing this page over HTTPS.</p>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<p>Please login to the system.</p>\n\t\t\t\t\t\t\t\t<div style='margin-left:30px;'>\n\t\t\t\t\t\t\t\t\t<p>Username: <input id='username' value='' autofocus='autofocus'></input></p>\n\t\t\t\t\t\t\t\t\t<p>Password: <input id='password' type='password' value=''></input></p>\n\t\t\t\t\t\t\t\t\t<button id='login_button'>Login...</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>";
}
?>
		</div>

		<div id='crash-dialog' title=''></div>
		
		<div id="error-message"></div>
		
Esempio n. 2
0
function user_delete($id)
{
    $success = false;
    if (user_isadministrator()) {
        if ($id != $_SESSION['id']) {
            // delete from users
            $sql = "DELETE FROM users WHERE id='" . mysql_real_escape_string($id) . "';";
            $result = mysql_query($sql);
            if ($result) {
                mysql_free_result($result);
                // delete from logins
                $sql = "DELETE FROM logins WHERE id='" . mysql_real_escape_string($id) . "';";
                $result = mysql_query($sql);
                if ($result) {
                    mysql_free_result($result);
                    // delete from filters
                    $sql = "DELETE FROM filters WHERE id='" . mysql_real_escape_string($id) . "';";
                    $result = mysql_query($sql);
                    if ($result) {
                        mysql_free_result($result);
                        // delete from alerts
                        $sql = "DELETE FROM alerts WHERE id='" . mysql_real_escape_string($id) . "';";
                        $result = mysql_query($sql);
                        if ($result) {
                            $success = true;
                            mysql_free_result($result);
                        }
                    }
                }
            }
        }
    }
    return $success;
}