@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | $general->logged_out_protect(); |
4 | 4 | $user = $users->userdata($_SESSION['loginid']); |
5 | 5 | if ($user['level'] != 'Admin') { |
6 | - exit("You don't have permission to access this page!"); |
|
6 | + exit("You don't have permission to access this page!"); |
|
7 | 7 | } |
8 | 8 | $slaid = $_GET['id']; |
9 | 9 | $sla = $slas->sla_data($slaid); |
10 | 10 | if (isset($_POST['submit'])) { |
11 | - $namasla = $_POST['namasla']; |
|
12 | - $responsetime = $_POST['responsetime']; |
|
13 | - $resolutiontime = $_POST['resolutiontime']; |
|
14 | - $slawarning = $_POST['slawarning']; |
|
15 | - $slas->update_sla($slaid, $namasla, $responsetime, $resolutiontime, $slawarning); |
|
16 | - header('location:slalist.php'); |
|
11 | + $namasla = $_POST['namasla']; |
|
12 | + $responsetime = $_POST['responsetime']; |
|
13 | + $resolutiontime = $_POST['resolutiontime']; |
|
14 | + $slawarning = $_POST['slawarning']; |
|
15 | + $slas->update_sla($slaid, $namasla, $responsetime, $resolutiontime, $slawarning); |
|
16 | + header('location:slalist.php'); |
|
17 | 17 | } |
18 | 18 | ?> |
19 | 19 | <!DOCTYPE HTML> |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | </fieldset> |
93 | 93 | </form> |
94 | 94 | <?php |
95 | - if (empty($errors) === false) { |
|
96 | - echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>'; |
|
97 | - } |
|
98 | - ?> |
|
95 | + if (empty($errors) === false) { |
|
96 | + echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>'; |
|
97 | + } |
|
98 | + ?> |
|
99 | 99 | </body> |
100 | 100 | </html> |
101 | 101 | \ No newline at end of file |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | $general->logged_out_protect(); |
4 | 4 | $user = $users->userdata($_SESSION['loginid']); |
5 | 5 | if ($user['level'] != 'Admin') { |
6 | - exit("You don't have permission to access this page!"); |
|
6 | + exit("You don't have permission to access this page!"); |
|
7 | 7 | } |
8 | 8 | $members = $users->get_users(); |
9 | 9 | $member_count = count($members); |
@@ -61,22 +61,22 @@ discard block |
||
61 | 61 | </thead> |
62 | 62 | <tbody> |
63 | 63 | <?php |
64 | - foreach ($members as $member) { |
|
65 | - if ($member['confirmed'] == '1') { |
|
66 | - $locked = 'No'; |
|
67 | - } else { |
|
68 | - $locked = 'Yes'; |
|
69 | - } |
|
70 | - echo '<tr><td><a href=useredit.php?id='.$member['id'].'>'.$member['username'].'</a></td>'. |
|
71 | - '<td>'.$member['level'].'</td>'. |
|
72 | - '<td>'.$member['fullname'].'</td>'. |
|
73 | - '<td>'.$member['email'].'</td>'. |
|
74 | - '<td>'.$member['Telp'].'</td>'. |
|
75 | - '<td>'.date('d-M-Y H:i', $member['time']).'</td>'. |
|
76 | - '<td>'.$locked.'</td>'. |
|
77 | - '<td><a href=userdel.php?id='.$member['id'].' onclick="return delete_confirm();">del</a></td></tr>'; |
|
78 | - } |
|
79 | - ?> |
|
64 | + foreach ($members as $member) { |
|
65 | + if ($member['confirmed'] == '1') { |
|
66 | + $locked = 'No'; |
|
67 | + } else { |
|
68 | + $locked = 'Yes'; |
|
69 | + } |
|
70 | + echo '<tr><td><a href=useredit.php?id='.$member['id'].'>'.$member['username'].'</a></td>'. |
|
71 | + '<td>'.$member['level'].'</td>'. |
|
72 | + '<td>'.$member['fullname'].'</td>'. |
|
73 | + '<td>'.$member['email'].'</td>'. |
|
74 | + '<td>'.$member['Telp'].'</td>'. |
|
75 | + '<td>'.date('d-M-Y H:i', $member['time']).'</td>'. |
|
76 | + '<td>'.$locked.'</td>'. |
|
77 | + '<td><a href=userdel.php?id='.$member['id'].' onclick="return delete_confirm();">del</a></td></tr>'; |
|
78 | + } |
|
79 | + ?> |
|
80 | 80 | </tbody> |
81 | 81 | </table> |
82 | 82 | <p> </p> |
@@ -4,16 +4,16 @@ discard block |
||
4 | 4 | $user = $users->userdata($_SESSION['loginid']); |
5 | 5 | $userid = $user['id']; |
6 | 6 | if (isset($_POST['submit'])) { |
7 | - $oldpassword = sha1($_POST['oldpassword']); |
|
8 | - $userpassword = $user['password']; |
|
9 | - if ($oldpassword != $userpassword) { |
|
10 | - $errors[] = 'The old password does not match!'; |
|
11 | - } else { |
|
12 | - $newpassword1 = $_POST['newpassword1']; |
|
13 | - $users->changepwd($userid, $newpassword1); |
|
14 | - $users->log_users($_SESSION['loginid'], 'Change the old password'); |
|
15 | - header('Location: changepwd.php?success'); |
|
16 | - } |
|
7 | + $oldpassword = sha1($_POST['oldpassword']); |
|
8 | + $userpassword = $user['password']; |
|
9 | + if ($oldpassword != $userpassword) { |
|
10 | + $errors[] = 'The old password does not match!'; |
|
11 | + } else { |
|
12 | + $newpassword1 = $_POST['newpassword1']; |
|
13 | + $users->changepwd($userid, $newpassword1); |
|
14 | + $users->log_users($_SESSION['loginid'], 'Change the old password'); |
|
15 | + header('Location: changepwd.php?success'); |
|
16 | + } |
|
17 | 17 | } |
18 | 18 | ?> |
19 | 19 | <!DOCTYPE HTML> |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | </form> |
74 | 74 | <br/> |
75 | 75 | <?php |
76 | - if (empty($errors) === false) { |
|
77 | - echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>'; |
|
78 | - } |
|
79 | - if (isset($_GET['success']) && empty($_GET['success'])) { |
|
80 | - echo 'Your password has been changed. Please logout and relogin with the new password.'; |
|
81 | - } |
|
82 | - ?> |
|
76 | + if (empty($errors) === false) { |
|
77 | + echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>'; |
|
78 | + } |
|
79 | + if (isset($_GET['success']) && empty($_GET['success'])) { |
|
80 | + echo 'Your password has been changed. Please logout and relogin with the new password.'; |
|
81 | + } |
|
82 | + ?> |
|
83 | 83 | </body> |
84 | 84 | </html> |
85 | 85 | \ No newline at end of file |
@@ -3,26 +3,26 @@ discard block |
||
3 | 3 | require 'core/init.php'; |
4 | 4 | $general->logged_in_protect(); |
5 | 5 | if (empty($_POST) === false) { |
6 | - $username = strip_tags(addslashes(trim($_POST['username']))); |
|
7 | - $password = strip_tags(addslashes(trim($_POST['password']))); |
|
8 | - if (empty($username) === true || empty($password) === true) { |
|
9 | - $errors[] = 'Sorry, but we need your username and password.'; |
|
10 | - } elseif ($users->user_exists($username) === false) { |
|
11 | - $errors[] = 'Sorry, that username doesn\'t exists. Please try again.'; |
|
12 | - } else { |
|
13 | - $login = $users->login($username, $password); |
|
14 | - if ($login === false) { |
|
15 | - $errors[] = 'Sorry, that username/password is invalid. Please try again.'; |
|
16 | - } elseif (!$users->email_confirmed($username)) { |
|
17 | - $errors[] = 'Sorry, your account is locked. Please contact Administrator.'; |
|
18 | - } else { |
|
19 | - $_SESSION['loginid'] = $login; |
|
20 | - $users->log_users($login, 'Login to Helpdesk System'); |
|
21 | - echo $login; |
|
22 | - header('location: home.php'); |
|
23 | - exit(); |
|
24 | - } |
|
25 | - } |
|
6 | + $username = strip_tags(addslashes(trim($_POST['username']))); |
|
7 | + $password = strip_tags(addslashes(trim($_POST['password']))); |
|
8 | + if (empty($username) === true || empty($password) === true) { |
|
9 | + $errors[] = 'Sorry, but we need your username and password.'; |
|
10 | + } elseif ($users->user_exists($username) === false) { |
|
11 | + $errors[] = 'Sorry, that username doesn\'t exists. Please try again.'; |
|
12 | + } else { |
|
13 | + $login = $users->login($username, $password); |
|
14 | + if ($login === false) { |
|
15 | + $errors[] = 'Sorry, that username/password is invalid. Please try again.'; |
|
16 | + } elseif (!$users->email_confirmed($username)) { |
|
17 | + $errors[] = 'Sorry, your account is locked. Please contact Administrator.'; |
|
18 | + } else { |
|
19 | + $_SESSION['loginid'] = $login; |
|
20 | + $users->log_users($login, 'Login to Helpdesk System'); |
|
21 | + echo $login; |
|
22 | + header('location: home.php'); |
|
23 | + exit(); |
|
24 | + } |
|
25 | + } |
|
26 | 26 | } |
27 | 27 | ?> |
28 | 28 | <!DOCTYPE html> |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | </table> |
57 | 57 | </div> |
58 | 58 | <?php |
59 | - if (empty($errors) === false) { |
|
60 | - echo '<p class="errormsg">'.implode('</p><p class="errormsg">', $errors).'</p>'; |
|
61 | - } |
|
59 | + if (empty($errors) === false) { |
|
60 | + echo '<p class="errormsg">'.implode('</p><p class="errormsg">', $errors).'</p>'; |
|
61 | + } |
|
62 | 62 | ?> |
63 | 63 | <div class="footer"> |
64 | 64 | </div> |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | $general->logged_out_protect(); |
4 | 4 | $user = $users->userdata($_SESSION['loginid']); |
5 | 5 | if ($user['level'] != 'Admin') { |
6 | - exit("You don't have permission to access this page!"); |
|
6 | + exit("You don't have permission to access this page!"); |
|
7 | 7 | } |
8 | 8 | $logs = $users->get_users_log(); |
9 | 9 | ?> |
@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | </thead> |
56 | 56 | <tbody> |
57 | 57 | <?php |
58 | - foreach ($logs as $log) { |
|
59 | - $username = $users->get_user_by_id($log['iduser']); |
|
60 | - echo '<tr><td>'.date('d-M-Y H:i', $log['time']).'</td>'. |
|
61 | - '<td>'.$username['username'].'</td>'. |
|
62 | - '<td>'.$log['ip'].'</td>'. |
|
63 | - '<td>'.$log['browser'].'</td>'. |
|
64 | - '<td>'.$log['log'].'</td></tr>'; |
|
65 | - } |
|
66 | - ?> |
|
58 | + foreach ($logs as $log) { |
|
59 | + $username = $users->get_user_by_id($log['iduser']); |
|
60 | + echo '<tr><td>'.date('d-M-Y H:i', $log['time']).'</td>'. |
|
61 | + '<td>'.$username['username'].'</td>'. |
|
62 | + '<td>'.$log['ip'].'</td>'. |
|
63 | + '<td>'.$log['browser'].'</td>'. |
|
64 | + '<td>'.$log['log'].'</td></tr>'; |
|
65 | + } |
|
66 | + ?> |
|
67 | 67 | </tbody> |
68 | 68 | </table> |
69 | 69 | </body> |
@@ -4,19 +4,19 @@ |
||
4 | 4 | $id = $_GET['id']; |
5 | 5 | $member = $users->userdata($id); |
6 | 6 | if (isset($_POST['submit'])) { |
7 | - $fullname = $_POST['fullname']; |
|
8 | - $username = htmlentities($_POST['username']); |
|
9 | - $password = $_POST['password']; |
|
10 | - $email = htmlentities($_POST['email']); |
|
11 | - $Telp = $_POST['telp']; |
|
12 | - $level = $_POST['level']; |
|
13 | - $locked = $_POST['locked']; |
|
14 | - //echo 'Old Passw: '.$member['password']. ' New Passw:'. $password; |
|
15 | - if ($password == '') { |
|
16 | - $password = $member['password']; |
|
17 | - } |
|
18 | - $users->update($id, $username, $password, $email, $fullname, $Telp, $level, $locked); |
|
19 | - header('Location: userlist.php'); |
|
7 | + $fullname = $_POST['fullname']; |
|
8 | + $username = htmlentities($_POST['username']); |
|
9 | + $password = $_POST['password']; |
|
10 | + $email = htmlentities($_POST['email']); |
|
11 | + $Telp = $_POST['telp']; |
|
12 | + $level = $_POST['level']; |
|
13 | + $locked = $_POST['locked']; |
|
14 | + //echo 'Old Passw: '.$member['password']. ' New Passw:'. $password; |
|
15 | + if ($password == '') { |
|
16 | + $password = $member['password']; |
|
17 | + } |
|
18 | + $users->update($id, $username, $password, $email, $fullname, $Telp, $level, $locked); |
|
19 | + header('Location: userlist.php'); |
|
20 | 20 | } |
21 | 21 | ?> |
22 | 22 | <!DOCTYPE HTML> |
@@ -2,23 +2,23 @@ discard block |
||
2 | 2 | require 'core/init.php'; |
3 | 3 | $general->logged_out_protect(); |
4 | 4 | if (isset($_POST['submit'])) { |
5 | - if ($users->user_exists($_POST['username']) == true && !empty($_POST['username'])) { |
|
6 | - $errors[] = 'Sorry, username '.$_POST['username'].' is already exists!'; |
|
7 | - } |
|
8 | - if ($users->email_exists($_POST['email']) == true && !empty($_POST['email'])) { |
|
9 | - $errors[] = 'Sorry, email '.$_POST['email'].' is already exists!'; |
|
10 | - } |
|
11 | - if (empty($errors) === true) { |
|
12 | - $fullname = $_POST['fullname']; |
|
13 | - $username = htmlentities($_POST['username']); |
|
14 | - $password = $_POST['password']; |
|
15 | - $email = htmlentities($_POST['email']); |
|
16 | - $Telp = $_POST['telp']; |
|
17 | - $level = $_POST['level']; |
|
18 | - $locked = $_POST['locked']; |
|
19 | - $users->register($username, $password, $email, $fullname, $Telp, $level, $locked); |
|
20 | - header('Location: userlist.php'); |
|
21 | - } |
|
5 | + if ($users->user_exists($_POST['username']) == true && !empty($_POST['username'])) { |
|
6 | + $errors[] = 'Sorry, username '.$_POST['username'].' is already exists!'; |
|
7 | + } |
|
8 | + if ($users->email_exists($_POST['email']) == true && !empty($_POST['email'])) { |
|
9 | + $errors[] = 'Sorry, email '.$_POST['email'].' is already exists!'; |
|
10 | + } |
|
11 | + if (empty($errors) === true) { |
|
12 | + $fullname = $_POST['fullname']; |
|
13 | + $username = htmlentities($_POST['username']); |
|
14 | + $password = $_POST['password']; |
|
15 | + $email = htmlentities($_POST['email']); |
|
16 | + $Telp = $_POST['telp']; |
|
17 | + $level = $_POST['level']; |
|
18 | + $locked = $_POST['locked']; |
|
19 | + $users->register($username, $password, $email, $fullname, $Telp, $level, $locked); |
|
20 | + header('Location: userlist.php'); |
|
21 | + } |
|
22 | 22 | } |
23 | 23 | ?> |
24 | 24 | <!DOCTYPE HTML> |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | </fieldset> |
103 | 103 | </form> |
104 | 104 | <?php |
105 | - if (empty($errors) === false) { |
|
106 | - echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>'; |
|
107 | - } |
|
108 | - ?> |
|
105 | + if (empty($errors) === false) { |
|
106 | + echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>'; |
|
107 | + } |
|
108 | + ?> |
|
109 | 109 | </body> |
110 | 110 | </html> |
111 | 111 | \ No newline at end of file |
@@ -3,21 +3,21 @@ discard block |
||
3 | 3 | $general->logged_out_protect(); |
4 | 4 | $user = $users->userdata($_SESSION['loginid']); |
5 | 5 | if ($user['level'] != 'Admin') { |
6 | - exit("You don't have permission to access this page!"); |
|
6 | + exit("You don't have permission to access this page!"); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | if (isset($_POST['submit'])) { |
10 | - $slaid = $_POST['slaid']; |
|
11 | - $namasla = $_POST['namasla']; |
|
12 | - $responsetime = $_POST['responsetime']; |
|
13 | - $resolutiontime = $_POST['resolutiontime']; |
|
14 | - $slawarning = $_POST['slawarning']; |
|
15 | - if ($slas->sla_exists($slaid) === true) { |
|
16 | - $errors[] = 'SLA ID is already exists!'; |
|
17 | - } else { |
|
18 | - $slas->add_sla($slaid, $namasla, $responsetime, $resolutiontime, $slawarning); |
|
19 | - header('location:slalist.php'); |
|
20 | - } |
|
10 | + $slaid = $_POST['slaid']; |
|
11 | + $namasla = $_POST['namasla']; |
|
12 | + $responsetime = $_POST['responsetime']; |
|
13 | + $resolutiontime = $_POST['resolutiontime']; |
|
14 | + $slawarning = $_POST['slawarning']; |
|
15 | + if ($slas->sla_exists($slaid) === true) { |
|
16 | + $errors[] = 'SLA ID is already exists!'; |
|
17 | + } else { |
|
18 | + $slas->add_sla($slaid, $namasla, $responsetime, $resolutiontime, $slawarning); |
|
19 | + header('location:slalist.php'); |
|
20 | + } |
|
21 | 21 | } |
22 | 22 | ?> |
23 | 23 | <!DOCTYPE HTML> |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | </fieldset> |
101 | 101 | </form> |
102 | 102 | <?php |
103 | - if (empty($errors) === false) { |
|
104 | - echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>'; |
|
105 | - } |
|
106 | - ?> |
|
103 | + if (empty($errors) === false) { |
|
104 | + echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>'; |
|
105 | + } |
|
106 | + ?> |
|
107 | 107 | </body> |
108 | 108 | </html> |
109 | 109 | \ No newline at end of file |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | $general->logged_out_protect(); |
4 | 4 | $user = $users->userdata($_SESSION['loginid']); |
5 | 5 | if ($user['level'] != 'Admin') { |
6 | - exit("You don't have permission to access this page!"); |
|
6 | + exit("You don't have permission to access this page!"); |
|
7 | 7 | } |
8 | 8 | $sla = $slas->get_sla(); |
9 | 9 | ?> |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | </thead> |
59 | 59 | <tbody> |
60 | 60 | <?php |
61 | - foreach ($sla as $slaval) { |
|
62 | - echo '<tr><td>'.$slaval['slaid'].'</td>'. |
|
63 | - '<td><a href=slaedit.php?id='.$slaval['slaid'].'>'.$slaval['namasla'].'</a></td>'. |
|
64 | - '<td>'.$slaval['responsetime'].' Hours</td>'. |
|
65 | - '<td>'.$slaval['resolutiontime'].' Hours</td>'. |
|
66 | - '<td>'.$slaval['slawarning'].' Hours</td>'. |
|
67 | - '<td><a href=sladel.php?id='.$slaval['slaid'].' onclick="return delete_confirm();">del</a></td></tr>'; |
|
68 | - } |
|
69 | - ?> |
|
61 | + foreach ($sla as $slaval) { |
|
62 | + echo '<tr><td>'.$slaval['slaid'].'</td>'. |
|
63 | + '<td><a href=slaedit.php?id='.$slaval['slaid'].'>'.$slaval['namasla'].'</a></td>'. |
|
64 | + '<td>'.$slaval['responsetime'].' Hours</td>'. |
|
65 | + '<td>'.$slaval['resolutiontime'].' Hours</td>'. |
|
66 | + '<td>'.$slaval['slawarning'].' Hours</td>'. |
|
67 | + '<td><a href=sladel.php?id='.$slaval['slaid'].' onclick="return delete_confirm();">del</a></td></tr>'; |
|
68 | + } |
|
69 | + ?> |
|
70 | 70 | </tbody> |
71 | 71 | </table> |
72 | 72 | </div> |