Пример #1
0
<?php

# phpWebNotes - a php based note addition system
# Copyright (C) 2000-2002 Webnotes Team - webnotes-devel@sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the files README and LICENSE for details
# --------------------------------------------------------
# $Id: logout.php,v 1.15 2002/10/03 00:23:19 vboctor Exp $
# --------------------------------------------------------
require_once 'core' . DIRECTORY_SEPARATOR . 'api.php';
### remove cookie
setcookie($g_string_cookie, '', 0, $g_cookie_url);
util_header_redirect($g_logout_redirect_page);
Пример #2
0
<?php

# phpWebNotes - a php based note addition system
# Copyright (C) 2000-2002 Webnotes Team - webnotes-devel@sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the files README and LICENSE for details
# --------------------------------------------------------
# $Id: signup_page.php,v 1.3 2002/09/26 12:03:59 vboctor Exp $
# --------------------------------------------------------
require_once 'core' . DIRECTORY_SEPARATOR . 'api.php';
if (OFF == config_get('allow_signup')) {
    util_header_redirect($g_login_page);
}
print_html_top();
print_head_top();
print_title($g_window_title);
print_css($g_css_inc_file);
print_meta_inc($g_meta_inc_file);
print_head_bottom();
print_body_top();
print_header($g_page_title);
print_top_page($g_top_page_inc);
if (isset($submit)) {
    $t_username = gpc_get_string('f_username');
    $t_email = gpc_get_string('f_email');
    if (user_signup($t_username, $t_email)) {
        echo <<<EOT
\t\t\t\t<div align="center">
\t\t\t\t\t<p>An e-mail is sent to <a href="mailto:{$t_email}">{$t_email}</a> with the login details. It is recommended to change your password on first login.</p>
\t\t\t\t\t[ <a href="{$g_login_page}"><strong>Login</strong></a> ]
\t\t\t\t</div>
Пример #3
0
function login_cookie_check($p_redirect_url = '')
{
    global $g_string_cookie_val, $g_login_page, $g_logout;
    ### if logged in
    if (isset($g_string_cookie_val)) {
        if (empty($g_string_cookie_val)) {
            util_header_redirect($g_login_page);
        }
        ### go to redirect
        if (!empty($p_redirect_url)) {
            util_header_redirect($p_redirect_url);
        } else {
            return;
        }
    } else {
        util_header_redirect($g_login_page);
    }
}
Пример #4
0
    }
}
# The access level check is done in the APIs
if (isset($f_page_id)) {
    $c_page_id = stripslashes(urldecode($f_page_id));
    if ('unindex' === $f_action) {
        page_delete($c_page_id);
    }
    if ('index' === $f_action) {
        page_add($c_page_id);
    }
    $t_url = $HTTP_REFERER;
}
if (isset($f_wait)) {
    print_html_top();
    print_head_top();
    print_title($g_window_title);
    print_css($g_css_inc_file);
    print_head_bottom();
    print_body_top();
    print_header($g_page_title);
    print_top_page($g_top_page_inc);
    print_admin_menu();
    echo "<br /><div align=\"center\">Operation Successful<br /><a href=\"{$t_url}\">[ Click here to proceed ]</a></div><br />";
    print_footer(__FILE__);
    print_bottom_page($g_bottom_page_inc);
    print_body_bottom();
    print_html_bottom();
} else {
    util_header_redirect($t_url);
}
# phpWebNotes - a php based note addition system
# Copyright (C) 2000-2002 Webnotes Team - webnotes-devel@sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the files README and LICENSE for details
# --------------------------------------------------------
# $Id: admin_manage_users_update.php,v 1.6 2002/10/07 02:54:39 vboctor Exp $
# --------------------------------------------------------
require_once 'core' . DIRECTORY_SEPARATOR . 'api.php';
login_cookie_check();
access_ensure_check_action(ACTION_USERS_EDIT);
$f_user_id = gpc_get('f_user_id');
$f_email = gpc_get('f_email');
$f_password = gpc_get('f_password');
$f_password_confirm = gpc_get('f_password_confirm');
$f_access_level = gpc_get('f_access_level');
if ($f_password != $f_password_confirm) {
    util_header_redirect($g_admin_manage_users_edit . '?f_user_id=' . $f_user_id);
}
if (isset($f_enabled)) {
    $f_enabled = 1;
} else {
    $f_enabled = 0;
}
if (isset($f_protected)) {
    $f_protected = 1;
} else {
    $f_protected = 0;
}
user_update($f_user_id, $f_email, $f_password, $f_access_level, $f_enabled, $f_protected);
util_header_redirect($g_admin_manage_users);
Пример #6
0
require_once 'core' . DIRECTORY_SEPARATOR . 'api.php';
$f_username = gpc_get_string('f_username');
$f_password = gpc_get_string('f_password');
$f_perm_login = gpc_get_string('f_perm_login', 'off');
$row = user_get_info(user_where_username_equals_and_enabled($f_username));
if ($row) {
    extract($row, EXTR_PREFIX_ALL, 'v');
} else {
    ### invalid login, retry
    util_header_redirect("{$g_login_page}?f_msg=error");
}
if (password_match($f_password, $v_password)) {
    ### set permanent cookie (1 year)
    if (isset($f_perm_login) && $f_perm_login == "on") {
        if (!setcookie($g_string_cookie, $v_cookie_string, time() + $g_cookie_time_length, $g_cookie_url)) {
            # @@@@ Proper error message
            echo "Unable to set cookie";
            exit;
        }
    } else {
        if (!setcookie($g_string_cookie, $v_cookie_string, 0, $g_cookie_url)) {
            # @@@@ Proper error message
            echo "Unable to set cookie";
            exit;
        }
    }
    util_header_redirect($g_admin_page);
} else {
    ### invalid login, retry
    util_header_redirect("{$g_login_page}?f_msg=error");
}
Пример #7
0
<?php

# phpWebNotes - a php based note addition system
# Copyright (C) 2000-2002 Webnotes Team - webnotes-devel@sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the files README and LICENSE for details
# --------------------------------------------------------
# $Id: index.php,v 1.4 2002/10/03 00:23:19 vboctor Exp $
# --------------------------------------------------------
require_once 'core' . DIRECTORY_SEPARATOR . 'api.php';
util_header_redirect('user_home_page.php');