예제 #1
0
파일: user.php 프로젝트: taqfu/rla-old
function user_logged_in($id)
{
    $user['id'] = $id;
    $user['name'] = fetch_username($id);
    $_SESSION['user'] = $user;
    add_points_if_necessary($id);
    //Move this to a chron when this is hosted on a server.
}
예제 #2
0
파일: index.php 프로젝트: taqfu/rla-old
    ?>
        <body id="AchievementsList">
            <div id="error"></div>
                <div style='float:right;font-size:12px;'>
                    <?php 
    if (!isset($_SESSION['user'])) {
        ?>
                    Not logged in.
                    <a href='signup/' class='text-button' style='margin-left:2px;font-size:12px;float:right;'>[ Sign Up ]</a> 
                    <a href='login/' class='text-button' style='margin-left:4px;font-size:12px;float:right;'>[ Login ]</a>
                    
                    <?php 
    } elseif (fetch_current_user_id() != false) {
        ?>
                        Logged in as <?php 
        echo fetch_username(fetch_current_user_id()) . ". (" . fetch_user_points(fetch_current_user_id()) . ")";
        ?>
 
                        <span id='logout' class='hand text-button'> [ Logout ] </span>
                    <?php 
    }
    ?>
                </div>
            <?php 
    if (isset($_SESSION['user'])) {
        ?>
            <div>
                <input id="new_achievement_text_input" type='text' maxlength="255" />          
                <input id="new_achievement_button" type="button" value="Quick Create" />
            </div>
            <?php 
예제 #3
0
파일: index.php 프로젝트: taqfu/rla-old
            width:90px;
            float:left;
        }
    </style>
    <script src="<?php 
echo SITE_ROOT;
?>
/js/jquery-2.1.4.min.js"></script>
    <script src="<?php 
echo SITE_ROOT;
?>
/js/user.js"></script>
    <script src="<?php 
echo SITE_ROOT;
?>
/js/login.js"></script>
</head>
<body>
    <?php 
$user_id = fetch_current_user_id();
if ($user_id == false) {
    require_once "login.htm";
} else {
    if ($user_id != false) {
        echo "Logged in as " . fetch_username(fetch_current_user_id()) . ".";
    }
}
?>
</body></html>