XOOPS 2.5.6
Final
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
deactivate.php
Go to the documentation of this file.
1
<?php
2
include
'admin_header.php'
;
3
xoops_cp_header
();
4
5
if
( !isset(
$_REQUEST
[
'uid'
]) ) {
6
redirect_header
(
"index.php"
, 2,
_PROFILE_AM_NOSELECTION
);
7
}
8
$member_handler
=
xoops_gethandler
(
'member'
);
9
$user
=
$member_handler
->getUser(
$_REQUEST
[
'uid'
]);
10
if
( !
$user
||
$user
->isNew() ) {
11
redirect_header
(
"index.php"
, 2,
_PROFILE_AM_USERDONEXIT
);
12
}
13
14
if
( in_array(XOOPS_GROUP_ADMIN,
$user
->getGroups() ) ) {
15
redirect_header
(
"index.php"
, 2, _PROFILE_AM_CANNOTDEACTIVATEWEBMASTERS);
16
}
17
$user
->setVar(
'level'
,
$_REQUEST
[
'level'
]);
18
if
(
$member_handler
->insertUser(
$user
) ) {
19
if
(
$_REQUEST
[
'level'
] == 1 ) {
20
$message =
_PROFILE_AM_USER_ACTIVATED
;
21
}
else
{
22
$message =
_PROFILE_AM_USER_DEACTIVATED
;
23
}
24
}
else
{
25
if
(
$_REQUEST
[
'level'
] == 1 ) {
26
$message =
_PROFILE_AM_USER_NOT_ACTIVATED
;
27
}
else
{
28
$message =
_PROFILE_AM_USER_NOT_DEACTIVATED
;
29
}
30
}
31
redirect_header
(
"../userinfo.php?uid="
.
$user
->getVar(
'uid'
), 3, $message);
32
?>
L:
0xoops
xoops-2.5.6
htdocs
modules
profile
admin
deactivate.php
Generated on Fri May 10 2013 01:04:28 for XOOPS 2.5.6 by
1.8.3.1