forked from Clrkz/VPSAutoScrptz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
41 lines (34 loc) · 910 Bytes
/
home.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
<?php
class Home extends Controller {
protected
$me;
function beforeRoute($f3) {
if ( ! $f3->exists('SESSION.id',$id)) $f3->reroute('/logout');
$me = new \User;
$me->id($id)->reroute('/logout');
$f3->set('me',$me);
$f3->set('content','home.html');
$this->me = $me;
}
function Index($f3) {
$f3->reroute('/home/setting');
}
function Setting($f3) {
$f3->set('subcontent','setting.html');
}
function NewPass($f3) {
$me = $this->me;
if ( ! Check::pass($f3->get('POST.oldpass'), $me->password)) {
$this->flash('Wrong Password');
} elseif ( ! Check::confirm('POST.password')) {
$this->flash('Confirm Password Mismatch');
} elseif ( ! $f3->exists('POST.password',$pass)) {
$this->flash('Password Can not be Empty');
} else {
$me->password = $pass;
/*$me->save();*/
$this->flash('Change Password Success','success');
}
$f3->reroute($f3->get('URI'));
}
}