Example #1
0
            $msg = sprintf(fs_r("Click %s to change your FireStats password, this link will work for a short time"), fs_link(fs_get_absolute_url($_SERVER['REQUEST_URI'] . "&reset&sid={$sid}"), fs_r("here"), true));
            $res = mail($email, $subject, $msg, $headers);
            if ($res === true) {
                echo "<div class='info'>" . fs_r("Email sent") . "</div>";
            } else {
                echo "<div class='error'>" . fs_r("Failed to send email") . "</div>";
            }
        } else {
            echo "<div class='error'>" . $user . "</div>";
        }
    }
    ?>
 <?php 
} else {
    if (isset($_GET['reset'])) {
        $res = fs_resume_user_session();
        if ($res !== true) {
            echo "<div class='error'>" . sprintf(fs_r("Failed, maybe too much time have passed since you generated the email? %s"), fs_link("tools.php?file_id=reset_password", fs_r("try again"))) . "</div>";
        } else {
            ?>
<script type="text/javascript">
//<![CDATA[
FS.changePassword = function(id)
{
	var user = $F('username');
	var pass1 = $F('new_password');
	var pass2 = $F('new_password_verify');
	var request = 'action=changePassword&id='+id+'&username='******'&pass1='+pass1+'&pass2='+pass2;
	sendRequest(request);
}
//]]>
Example #2
0
function fs_page()
{
    $path = fs_get_firestats_path();
    if ($path) {
        if (!fs_full_installation()) {
            if (defined('DEMO')) {
                $user = new stdClass();
                $user->name = "Demo";
                $user->id = 1;
                $user->security_level = SEC_USER;
                $res = fs_start_user_session($user);
            } else {
                $res = fs_resume_user_session();
            }
            if ($res === true) {
                fs_show_embedded_page($path . '/php/tabbed-pane.php');
                return;
            } else {
                fs_show_embedded_page($path . '/login.php', true, true, true);
            }
        } else {
            if (fs_can_use() === true) {
                fs_show_embedded_page($path . '/php/tabbed-pane.php');
                return;
            } else {
                $msg = fs_r("You are not authorized to access FireStats");
                $msg = "<div class='error'>{$msg}</div>";
                fs_show_embedded_page($msg, false);
            }
        }
    } else {
        $href = sprintf("<a href='options-general.php?page=FireStats'>%s</a>", __('Options'));
        echo '<div class="error" style="margin-top:40px;margin-bottom:40px">' . sprintf(__('You need to configure FireStats in the %s menu'), $href) . '</div>';
    }
}