C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\xoops\html\user.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
// $Id: user.php,v 1.14.6.4.2.1 2005/09/26 14:55:27 mithyt2 Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <http://www.xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //

$xoopsOption['pagetype'] = 'user';
include 
'mainfile.php';

$op 'main';

if ( isset(
$_POST['op']) ) {
    
$op trim($_POST['op']);
} elseif ( isset(
$_GET['op']) ) {
    
$op trim($_GET['op']);
}

if (
$op == 'main') {
    if ( !
$xoopsUser ) {
        
$xoopsOption['template_main'] = 'system_userform.html';
        include 
'header.php';
        
$xoopsTpl->assign('lang_login'_LOGIN);
        
$xoopsTpl->assign('lang_username'_USERNAME);
        if (isset(
$_COOKIE[$xoopsConfig['usercookie']])) {
            
$xoopsTpl->assign('usercookie'$_COOKIE[$xoopsConfig['usercookie']]);
        }
        if (isset(
$_GET['xoops_redirect'])) {
            
$xoopsTpl->assign('redirect_page'htmlspecialchars(trim($_GET['xoops_redirect']), ENT_QUOTES));
        }
        
$xoopsTpl->assign('lang_password'_PASSWORD);
        
$xoopsTpl->assign('lang_notregister'_US_NOTREGISTERED);
        
$xoopsTpl->assign('lang_lostpassword'_US_LOSTPASSWORD);
        
$xoopsTpl->assign('lang_noproblem'_US_NOPROBLEM);
        
$xoopsTpl->assign('lang_youremail'_US_YOUREMAIL);
        
$xoopsTpl->assign('lang_sendpassword'_US_SENDPASSWORD);
        
$xoopsTpl->assign('mailpasswd_token'$GLOBALS['xoopsSecurity']->createToken());
        include 
'footer.php';
    } elseif ( 
$xoopsUser ) {
        
header('Location: '.XOOPS_URL.'/modules/profile/userinfo.php?uid='.$xoopsUser->getVar('uid'));
    }
    exit();
}

if (
$op == 'login') {
    include_once 
XOOPS_ROOT_PATH.'/include/checklogin.php';
    exit();
}

if (
$op == 'logout') {
    
$message '';
    
$_SESSION = array();
    
session_destroy();
    if (
$xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') {
        
setcookie($xoopsConfig['session_name'], ''time()- 3600'/',  ''0);
    }
    
// clear entry from online users table
    
if (is_object($xoopsUser)) {
        
$online_handler =& xoops_gethandler('online');
        
$online_handler->destroy($xoopsUser->getVar('uid'));
    }
    
$message _US_LOGGEDOUT.'<br />'._US_THANKYOUFORVISIT;
    
redirect_header('index.php'1$message);
    exit();
}

if (
$op == 'delete') {
    
header('Location: '.XOOPS_URL.'/modules/profile/edituser.php?op=delete');
}
?>