Пример #1
0
        <div id="site_content">
	<?php 
if (isset($_COOKIE['app_session_id']) && $_COOKIE["app_session_id"] != "") {
    include "sidebar_menu.inc";
} else {
    include "common_sidebar.php";
}
$user_id = 0;
$user_name = "";
if (isset($_COOKIE['app_session_id']) && $_COOKIE['app_session_id'] != '') {
    include_once "/var/www/includes/session.php";
    $s = new user_session();
    if ($s->decode_session($_COOKIE['app_session_id'])) {
        $user_name = $s->get_uname();
        $user_id = $s->get_uid();
    }
}
include_once "/var/www/includes/game.php";
?>
		   <div class="content">
			<h3><font color="red">Scoreboard has been modified to remove discrepancies due to flag sharing</font></h3>
			<?php 
if ($user_id != 0) {
    $my_g = new game();
    $my_result = $my_g->get_my_scoreboard($user_id);
    if (count($my_result) != 0) {
        ?>
				<table width="80%">
					<tr>
						<th width="25%">Category</th>
Пример #2
0
        echo $qObj->get_qname();
        ?>
 </p>
	<p style="font-size: 70%; color: red">Hint: <?php 
        echo $qObj->get_hint();
        ?>
 </p>

	<?php 
        $u = new user_session();
        if (!$u->get_user_session()) {
            header('Location: /index.php');
        } else {
            include_once "includes/game.php";
            $g = new game();
            if (!$g->solved_already($u->get_uid(), $qid)) {
                ?>
		<form id="challenge" action="<?php 
                echo $_SERVER['PHP_SELF'];
                ?>
" method="post">
    	      <div class="form_settings">
        	    <p><font color="red"><?php 
                echo $err_msg;
                ?>
</font></p>
            	<p><span> Got the Answer!!! </span><input class="contact" type="text" name="answer" value="" /> 
                	<input type="hidden" name="q" value="<?php 
                echo $qid;
                ?>
" /></p>
Пример #3
0
    } else {
        if ($new_pwd != $con_pwd) {
            $msg = "New and confirm password are mismatch";
        } elseif (isset($_COOKIE['app_session_id']) && $_COOKIE['app_session_id'] != '') {
            try {
                include_once "/var/www/includes/user.php";
                include_once "/var/www/includes/session.php";
                include_once "/var/www/includes/crypt.php";
                $cr = new crypto();
                $password = $cr->one_way_crypt($new_pwd);
                $old_pwd = $cr->one_way_crypt($old_pwd);
                $cookie_token = $_COOKIE['app_session_id'];
                $s = new user_session();
                if ($s->decode_session($cookie_token)) {
                    $u = new user();
                    if (!$u->update_password($s->get_uid(), $old_pwd, $password)) {
                        throw new Exception("Password Mismacth: Try Again");
                    }
                    $msg = "Password Updated Successfully";
                } else {
                    $msg = "Session Expired";
                }
            } catch (Exception $e) {
                $msg = $e->getMesage();
            }
        } else {
            $msg = "Session Expired";
        }
    }
    //header('Location: ' . $_SERVER['REQUEST_URI']);
}