コード例 #1
0
function pathos_sessions_login($user)
{
    $ticket = null;
    $ticket->uid = $user->id;
    $ticket->ticket = uniqid("", true);
    $ticket->last_active = time();
    $ticket->start_time = time();
    $ticket->browser = $_SERVER['HTTP_USER_AGENT'];
    $ticket->ip_address = $_SERVER['REMOTE_ADDR'];
    global $db;
    $db->insertObject($ticket, 'sessionticket');
    $_SESSION[SYS_SESSION_KEY]['ticket'] = $ticket->ticket;
    $_SESSION[SYS_SESSION_KEY]['user'] = $user;
    pathos_permissions_load($user);
}
コード例 #2
0
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: saveuserperms.php,v 1.5 2005/04/18 15:22:39 filetreefrog Exp $
##################################################
if (!defined("PATHOS")) {
    exit("");
}
if (pathos_permissions_check("administrate", $loc)) {
    $users = explode(";", $_POST['permdata']);
    if (!defined("SYS_USERS")) {
        require_once BASE . "subsystems/users.php";
    }
    foreach ($users as $user_str) {
        $perms = explode(":", $user_str);
        $u = pathos_users_getUserById($perms[0]);
        pathos_permissions_revokeAll($u, $loc);
        for ($i = 1; $i < count($perms); $i++) {
            pathos_permissions_grant($u, $perms[$i], $loc);
        }
        if ($perms[0] == $user->id) {
            pathos_permissions_load($user);
        }
    }
    pathos_permissions_triggerRefresh();
    pathos_flow_redirect();
} else {
    echo SITE_403_HTML;
}