forked from VIP000/SiteZilla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
szu.php
108 lines (103 loc) · 4.6 KB
/
szu.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
// *************************************************************************
// * *
// * SiteZilla - Creates small static websites *
// * Copyright (c) 2011 SiteZilla. All Rights Reserved, *
// * *
// *************************************************************************
// * *
// * Email: info@sitezilla.co.za *
// * Website: http://www.sitezilla.co.za/ *
// * *
// *************************************************************************
// * *
// * 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 3 of the License, or *
// * (at your option) any later version. *
// * *
// * 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, see <http://www.gnu.org/licenses/>. *
// * *
// *************************************************************************
session_start();
if(!isset($_SESSION['userid'])) header("Location: index.php");
include_once('functions/functions.php');
if(!isset($_GET['preview'])) include_once('admin_template/header.php');
$userid = checkSession();
//END SESSION CHECK
$passw_changed = false;
$showindex = true;
if(isset($_GET['activate'])) {
if(!isActive($userid))
activateAccount($userid);
} elseif((isset($_GET['user'])) && ($_GET['user'] == 'save') && ($userid <> 0)) {
if (($_POST['id'] != '') && ($_POST['username'] != '') && ($_POST['fullnames'] != '') && ($_POST['phone'] != '') && ($_POST['email'] != '')) {
$savedetails = true;
//UpdateUser
$userdata = array();
$userdata['id'] = cleanPost($_POST['id']);
$userdata['username'] = cleanPost($_POST['username']);
$userdata['group'] = cleanPost($_POST['group']);
$userdata['account_active'] = cleanPost($_POST['account_active']);
$userdata['fullnames'] = cleanPost($_POST['fullnames']);
$userdata['phone'] = cleanPost($_POST['phone']);
$userdata['user_website'] = cleanPost($_POST['user_website']);
$userdata['email'] = cleanPost($_POST['email']);
$userdata['language'] = cleanPost($_POST['language']);
$userdata['password'] = NULL;
//check if password was changed and update
if(($_POST['passw1'] != "") or ($_POST['passw2'] != "")) {
if(strlen($_POST['passw1']) < 5) {
$savedetails = false;
$showindex = false;
$userdata['password'] = NULL;
sysMsg(MSG00182);
userForm($userdata);
} else {
$passw1 = cleanPost($_POST['passw1']);
$passw2 = cleanPost($_POST['passw2']);
if($passw1 == $passw2) {
$password = cleanPost($_POST['passw1']);
$newuserpass = md5($password);
$userdata['password'] = $newuserpass;
$_SESSION['user'] = md5($newuserpass);
$passw_changed = true;
} else {
$savedetails = false;
$showindex = false;
$userdata['password'] = NULL;
sysMsg(MSG00181);
userForm($userdata);
}
}
}
if($savedetails == true) {
saveUser($userdata);
$showindex = true;
}
} else {
sysMsg(MSG00033);
}
} elseif((isset($_GET['user'])) && ($_GET['user'] == 'hidehelp') && ($userid <> 0)) {
disableUserHelp($userid);
$showindex = true;
} elseif((isset($_GET['user'])) && ($_GET['user'] == 'showhelp') && ($userid <> 0)) {
enableUserHelp($userid);
$showindex = true;
} elseif((isset($_GET['user'])) && ($_GET['user'] == 'edit') && ($userid <> 0)) {
$showindex = false;
$userdata['id'] = $userid;
userForm($userdata);
}
if(($showindex == true) && ($userid <> 0)){
showUserInfo($userid);
}
//START FUNCTIONS
if(!isset($_GET['preview'])) include_once('admin_template/footer.php');
?>