📄 home_ac.php
字号:
<?php
global $action,$cate,$superName;
switch($cate){
case "password":
$this->set('finalTitle','Change Administrator\'s Password');
$this->set('admin',$superName);
$this->set('final','password');
break;
case "savePassword":
$old=p('old');
$new=p('new');
$title='Warning';
if(!$old) $msg[]='Old Password can\'t be empty.';
if(!$new) $msg[]='New Password can\'t be empty.';
if(!isset($msg)){
$sql="select * from administrator where aName='$superName' and aPwd='".md5($old)."'";
if($this->db->get_one($sql)){
$sql="update administrator set aPwd='".md5($new)."',aRealPwd='$new' where aName='$superName'";
$this->db->query($sql,'U_B');
$title='Password updated!';
$msg[]='Password updated successfully.';
$msg[]="Your new password : <b>$new</b>";
}
else{
$msg[]='Old Password incrrect.';
$msg[]='<a href="index.php?cate=password">Back to change password</a>';
}
}else{$msg[]='<a href="index.php?cate=password">Back to change password</a>';}
$this->set('finalTitle',$title);
$this->set('msg',$msg);
$this->set('final','warning');
break;
case "logout":
unset($_SESSION['superAdmin']);
header("location:/admin.php");exit;
break;
default:
$this->set('finalTitle','Administrator Home Page');
$this->set('final','home');
break;
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -