├── .gitattributes
├── .gitignore
├── .htaccess
├── LICENSE
├── README.md
├── apps
├── Common
│ └── base.php
├── Conf
│ └── config.php
├── Lib
│ ├── Action
│ │ ├── Console
│ │ │ ├── CBaseAction.class.php
│ │ │ ├── CategoriesAction.class.php
│ │ │ ├── IndexAction.class.php
│ │ │ ├── PasswordAction.class.php
│ │ │ ├── ProfileAction.class.php
│ │ │ ├── RecycleAction.class.php
│ │ │ └── ToolAction.class.php
│ │ ├── Home
│ │ │ ├── AccountAction.class.php
│ │ │ └── IndexAction.class.php
│ │ └── PDMAction.class.php
│ ├── Rover
│ │ ├── Captcha.class.php
│ │ ├── Page.class.php
│ │ ├── Tree.class.php
│ │ └── Waf.class.php
│ └── Widget
│ │ └── URIWidget.class.php
└── Tpl
│ ├── Console
│ ├── Categories_index.htm
│ ├── Categories_mod.htm
│ ├── Index_index.htm
│ ├── Password_collect.htm
│ ├── Password_index.htm
│ ├── Password_mod.htm
│ ├── Password_view.htm
│ ├── Profile_index.htm
│ ├── Recycle_index.htm
│ ├── Tool_index.htm
│ ├── Zeninc_footer.htm
│ └── Zeninc_header.htm
│ └── Home
│ ├── Account_authentication.htm
│ ├── Account_forgot.htm
│ ├── Account_login.htm
│ ├── Account_resetpassword.htm
│ ├── Account_signin.htm
│ ├── Index_index.htm
│ ├── Xeninc_footer.htm
│ └── Xeninc_header.htm
├── index.php
├── pdm.sql
├── wp-config.php
├── wp-content
├── css
│ └── pdm.css
├── images
│ └── misc
│ │ ├── lock.png
│ │ ├── pdm_error.gif
│ │ └── pdm_success.gif
├── js
│ ├── jquery.min.js
│ └── pdm.js
└── third-party
│ └── bootstrap
│ ├── css
│ ├── bootstrap-theme.css
│ ├── bootstrap-theme.css.map
│ ├── bootstrap-theme.min.css
│ ├── bootstrap.css
│ ├── bootstrap.css.map
│ └── bootstrap.min.css
│ ├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ └── glyphicons-halflings-regular.woff
│ ├── js
│ ├── bootstrap.js
│ └── bootstrap.min.js
│ └── plugins
│ └── typeahead
│ └── bootstrap-typeahead.js
└── wp-include
├── ErrorPage
├── error.htm
└── exception.htm
├── ThinkPHP
├── Common
│ ├── common.php
│ ├── functions.php
│ └── runtime.php
├── Conf
│ ├── alias.php
│ ├── convention.php
│ ├── debug.php
│ └── tags.php
├── Extend
│ └── README.txt
├── LICENSE.txt
├── Lang
│ ├── en-us.php
│ └── zh-cn.php
├── Lib
│ ├── Behavior
│ │ ├── CheckRouteBehavior.class.php
│ │ ├── ContentReplaceBehavior.class.php
│ │ ├── ParseTemplateBehavior.class.php
│ │ ├── ReadHtmlCacheBehavior.class.php
│ │ ├── ShowPageTraceBehavior.class.php
│ │ ├── ShowRuntimeBehavior.class.php
│ │ ├── TokenBuildBehavior.class.php
│ │ └── WriteHtmlCacheBehavior.class.php
│ ├── Core
│ │ ├── Action.class.php
│ │ ├── App.class.php
│ │ ├── Behavior.class.php
│ │ ├── Cache.class.php
│ │ ├── Db.class.php
│ │ ├── Dispatcher.class.php
│ │ ├── Log.class.php
│ │ ├── Model.class.php
│ │ ├── Think.class.php
│ │ ├── ThinkException.class.php
│ │ ├── View.class.php
│ │ └── Widget.class.php
│ ├── Driver
│ │ ├── Cache
│ │ │ └── CacheFile.class.php
│ │ ├── Db
│ │ │ ├── DbMysql.class.php
│ │ │ └── DbMysqli.class.php
│ │ └── TagLib
│ │ │ └── TagLibCx.class.php
│ └── Template
│ │ ├── TagLib.class.php
│ │ └── ThinkTemplate.class.php
├── README.txt
├── ThinkPHP.php
├── Tpl
│ ├── default_index.tpl
│ ├── dispatch_jump.tpl
│ ├── page_trace.tpl
│ └── think_exception.tpl
└── logo.png
├── ThirdParty
├── Captcha
│ ├── bg_0.jpg
│ ├── bg_1.jpg
│ ├── bg_2.jpg
│ ├── fonts
│ │ ├── CourierNewBold.ttf
│ │ └── ERASDEMI.ttf
│ └── words
│ │ └── en.php
└── PHPMailer
│ ├── PHPMailerAutoload.php
│ ├── class.phpmailer.php
│ ├── class.pop3.php
│ ├── class.smtp.php
│ ├── language
│ ├── phpmailer.lang-ar.php
│ ├── phpmailer.lang-be.php
│ ├── phpmailer.lang-br.php
│ ├── phpmailer.lang-ca.php
│ ├── phpmailer.lang-ch.php
│ ├── phpmailer.lang-cz.php
│ ├── phpmailer.lang-de.php
│ ├── phpmailer.lang-dk.php
│ ├── phpmailer.lang-el.php
│ ├── phpmailer.lang-eo.php
│ ├── phpmailer.lang-es.php
│ ├── phpmailer.lang-et.php
│ ├── phpmailer.lang-fa.php
│ ├── phpmailer.lang-fi.php
│ ├── phpmailer.lang-fo.php
│ ├── phpmailer.lang-fr.php
│ ├── phpmailer.lang-gl.php
│ ├── phpmailer.lang-he.php
│ ├── phpmailer.lang-hr.php
│ ├── phpmailer.lang-hu.php
│ ├── phpmailer.lang-it.php
│ ├── phpmailer.lang-ja.php
│ ├── phpmailer.lang-ka.php
│ ├── phpmailer.lang-lt.php
│ ├── phpmailer.lang-lv.php
│ ├── phpmailer.lang-nl.php
│ ├── phpmailer.lang-no.php
│ ├── phpmailer.lang-pl.php
│ ├── phpmailer.lang-pt.php
│ ├── phpmailer.lang-ro.php
│ ├── phpmailer.lang-ru.php
│ ├── phpmailer.lang-se.php
│ ├── phpmailer.lang-sk.php
│ ├── phpmailer.lang-sr.php
│ ├── phpmailer.lang-tr.php
│ ├── phpmailer.lang-uk.php
│ ├── phpmailer.lang-vi.php
│ ├── phpmailer.lang-zh.php
│ └── phpmailer.lang-zh_cn.php
│ └── templates
│ ├── forget_password.htm
│ └── register_success.htm
└── load.php
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .metadata
8 | bin/
9 | tmp/
10 | *.tmp
11 | *.bak
12 | *.swp
13 | *~.nib
14 | local.properties
15 | .classpath
16 | .settings/
17 | .loadpath
18 |
19 | # External tool builders
20 | .externalToolBuilders/
21 |
22 | # Locally stored "Eclipse launch configurations"
23 | *.launch
24 |
25 | # CDT-specific
26 | .cproject
27 |
28 | # PDT-specific
29 | .buildpath
30 |
31 |
32 | #################
33 | ## Visual Studio
34 | #################
35 |
36 | ## Ignore Visual Studio temporary files, build results, and
37 | ## files generated by popular Visual Studio add-ons.
38 |
39 | # User-specific files
40 | *.suo
41 | *.user
42 | *.sln.docstates
43 |
44 | # Build results
45 |
46 | [Dd]ebug/
47 | [Rr]elease/
48 | x64/
49 | build/
50 | [Bb]in/
51 | [Oo]bj/
52 |
53 | # MSTest test Results
54 | [Tt]est[Rr]esult*/
55 | [Bb]uild[Ll]og.*
56 |
57 | *_i.c
58 | *_p.c
59 | *.ilk
60 | *.meta
61 | *.obj
62 | *.pch
63 | *.pdb
64 | *.pgc
65 | *.pgd
66 | *.rsp
67 | *.sbr
68 | *.tlb
69 | *.tli
70 | *.tlh
71 | *.tmp
72 | *.tmp_proj
73 | *.log
74 | *.vspscc
75 | *.vssscc
76 | .builds
77 | *.pidb
78 | *.log
79 | *.scc
80 |
81 | # Visual C++ cache files
82 | ipch/
83 | *.aps
84 | *.ncb
85 | *.opensdf
86 | *.sdf
87 | *.cachefile
88 |
89 | # Visual Studio profiler
90 | *.psess
91 | *.vsp
92 | *.vspx
93 |
94 | # Guidance Automation Toolkit
95 | *.gpState
96 |
97 | # ReSharper is a .NET coding add-in
98 | _ReSharper*/
99 | *.[Rr]e[Ss]harper
100 |
101 | # TeamCity is a build add-in
102 | _TeamCity*
103 |
104 | # DotCover is a Code Coverage Tool
105 | *.dotCover
106 |
107 | # NCrunch
108 | *.ncrunch*
109 | .*crunch*.local.xml
110 |
111 | # Installshield output folder
112 | [Ee]xpress/
113 |
114 | # DocProject is a documentation generator add-in
115 | DocProject/buildhelp/
116 | DocProject/Help/*.HxT
117 | DocProject/Help/*.HxC
118 | DocProject/Help/*.hhc
119 | DocProject/Help/*.hhk
120 | DocProject/Help/*.hhp
121 | DocProject/Help/Html2
122 | DocProject/Help/html
123 |
124 | # Click-Once directory
125 | publish/
126 |
127 | # Publish Web Output
128 | *.Publish.xml
129 | *.pubxml
130 |
131 | # NuGet Packages Directory
132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
133 | #packages/
134 |
135 | # Windows Azure Build Output
136 | csx
137 | *.build.csdef
138 |
139 | # Windows Store app package directory
140 | AppPackages/
141 |
142 | # Others
143 | sql/
144 | *.Cache
145 | ClientBin/
146 | [Ss]tyle[Cc]op.*
147 | ~$*
148 | *~
149 | *.dbmdl
150 | *.[Pp]ublish.xml
151 | *.pfx
152 | *.publishsettings
153 |
154 | # RIA/Silverlight projects
155 | Generated_Code/
156 |
157 | # Backup & report files from converting an old project file to a newer
158 | # Visual Studio version. Backup files are not needed, because we have git ;-)
159 | _UpgradeReport_Files/
160 | Backup*/
161 | UpgradeLog*.XML
162 | UpgradeLog*.htm
163 |
164 | # SQL Server files
165 | App_Data/*.mdf
166 | App_Data/*.ldf
167 |
168 | #############
169 | ## Windows detritus
170 | #############
171 |
172 | # Windows image file caches
173 | Thumbs.db
174 | ehthumbs.db
175 |
176 | # Folder config file
177 | Desktop.ini
178 |
179 | # Recycle Bin used on file shares
180 | $RECYCLE.BIN/
181 |
182 | # Mac crap
183 | .DS_Store
184 |
185 |
186 | #############
187 | ## Python
188 | #############
189 |
190 | *.py[co]
191 |
192 | # Packages
193 | *.egg
194 | *.egg-info
195 | dist/
196 | build/
197 | eggs/
198 | parts/
199 | var/
200 | sdist/
201 | develop-eggs/
202 | .installed.cfg
203 |
204 | # Installer logs
205 | pip-log.txt
206 |
207 | # Unit test / coverage reports
208 | .coverage
209 | .tox
210 |
211 | #Translations
212 | *.mo
213 |
214 | #Mr Developer
215 | .mr.developer.cfg
216 |
--------------------------------------------------------------------------------
/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | RewriteEngine on
3 | RewriteCond %{REQUEST_FILENAME} !-d
4 | RewriteCond %{REQUEST_FILENAME} !-f
5 | RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
6 |
7 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #pdm 2.0(密码管理系统)#
2 |
3 |
4 | ##演示地址##
5 |
6 | http://demo.markdream.com/pdm
7 |
8 |
9 | ##依赖##
10 |
11 | PHP5.3+(需要mcrypt组件支持)
12 | MySQL5.0+
13 | SSL(可选)
14 |
15 | ##安装##
16 | 警告:PDM2.0版本不兼容1.0项目
17 |
18 | 1、请在mysql中创建一个名为pdm(你可以自行修改)的数据库,然后将pdm.sql文件导入到pdm数据库中,即完成数据库导入工作。
19 |
20 | 2、在根目录中找到wp-config.php文件,修改里面的数据库配置文件参数为您实际数据库连接信息即可。
21 |
22 | 3、修改index.php文件中的"PDM_URL"改成你的PDM实际访问地址, 比如
23 | http://127.0.0.1/
24 | http://127.0.0.1/pdm/
25 | http://demo.markdream.com/pdm/
26 |
27 | 具体以你项目部署的情况而定。
28 |
29 | 4、注册需要邮件发送支持,请修改“wp-include/load.php”文件中的“邮件设置”项目进行填写即可,具体参见各个邮件服务商的配置信息。
30 |
31 | OK,然后试着打开浏览器访问PDM2.0吧。
--------------------------------------------------------------------------------
/apps/Conf/config.php:
--------------------------------------------------------------------------------
1 | PDM_SHOWTRACE,
13 |
14 | //group settings
15 | 'APP_GROUP_LIST' => 'Home,Console',
16 | 'DEFAULT_GROUP' => 'Home',
17 | 'TMPL_FILE_DEPR' => '_',
18 | 'LOAD_EXT_FILE' => 'base',
19 |
20 | //error settings
21 | 'TMPL_EXCEPTION_FILE' => PDM_INC_PATH.'/ErrorPage/exception.htm',
22 | 'TMPL_ACTION_SUCCESS' => PDM_INC_PATH.'/ErrorPage/error.htm',
23 | 'TMPL_ACTION_ERROR' => PDM_INC_PATH.'/ErrorPage/error.htm',
24 |
25 | //url & template settings
26 | 'TMPL_TEMPLATE_SUFFIX'=>'.htm',
27 | 'URL_CASE_INSENSITIVE'=>1,
28 | 'URL_MODEL'=>0,
29 | 'URL_HTML_SUFFIX'=>'',
30 |
31 | 'TOKEN_ON' => 1,
32 | 'TOKEN_NAME' => 'o_o',
33 | // 'TOKEN_RESET'=>true,
34 |
35 | 'TMPL_STRIP_SPACE' => 1,
36 |
37 | //variables settings
38 | 'VAR_GROUP'=>'m',
39 | 'VAR_MODULE'=>'c',
40 | 'VAR_ACTION'=>'a',
41 |
42 |
43 | //database settings
44 | 'DB_HOST'=>DB_HOST,
45 | 'DB_NAME'=>DB_NAME,
46 | 'DB_USER'=>DB_USER,
47 | 'DB_PWD'=>DB_PWD,
48 | 'DB_PREFIX'=>DB_PREFIX,
49 | 'DB_PORT'=>DB_PORT,
50 |
51 | );
52 | ?>
--------------------------------------------------------------------------------
/apps/Lib/Action/Console/CBaseAction.class.php:
--------------------------------------------------------------------------------
1 | _checkTimeout ();
21 |
22 | $this->uid = $_session ['id'];
23 | $this->auth_code = $_session ['auth_code'];
24 | $this->timeout = $_session ['timeout'];
25 | session ( 'pdm_timeout', NOW_TIME );
26 | }
27 |
28 | /* 超时检查 */
29 | private function _checkTimeout() {
30 | $optTime = session ( 'pdm_timeout' );
31 | $session_user = session ( 'user' );
32 | if (NOW_TIME > ($optTime + 60 * $session_user ['timeout'])) {
33 | $_email = base64_encode ( $session_user ['email'] );
34 | session ( 'user', null );
35 | redirect ( PDM_URL );
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/apps/Lib/Action/Console/CategoriesAction.class.php:
--------------------------------------------------------------------------------
1 | categories = M ( 'categories' );
14 | }
15 |
16 | function index() {
17 | import ( '@.Rover.Tree' );
18 | $tree = new Tree ();
19 | $map ['user_id'] = $this->uid;
20 | $list = $this->categories->where ( $map )->order ( 'listorder' )->select ();
21 | $tree->init ( $list );
22 |
23 | $_linkAddType = pdm_ux ( 'add?parent=' );
24 | $_linkEditType = pdm_ux ( 'edit?id=' );
25 | $_linkDeleteType = pdm_ux ( 'delete?id=' );
26 |
27 | $lanmu = " \$title (\$sum) 添加子类 | 修改 | 删除";
28 | $moji = " \$title (\$sum) 添加子类 | 修改 | 删除";
29 | $html = $tree->get_treeview ( 0, 'myTree', $lanmu, $moji );
30 | $this->assign ( 'html', $html );
31 | $this->display ();
32 | }
33 |
34 | function add() {
35 | if (IS_POST) {
36 | $post = I ( 'post.' );
37 | $data ['parent'] = $post ['parent'];
38 | $data ['title'] = $post ['title'];
39 | $data ['listorder'] = $post ['listorder'];
40 | $data ['add_time'] = NOW_TIME;
41 | $data ['user_id'] = $this->uid;
42 |
43 | if ($this->categories->add ( $data ) !== false) {
44 | $this->success ( '类别添加成功!' );
45 | } else {
46 | $this->error ( '类别添加失败!' );
47 | }
48 | } else {
49 | $parent = I ( 'parent' );
50 | $map ['user_id'] = $this->uid;
51 | $list = $this->categories->where ( $map )->order ( 'listorder' )->select ();
52 | import ( '@.Rover.Tree' );
53 | $tree = new Tree ();
54 | $tree->init ( $list );
55 | $str = "";
56 | $selected = $tree->get_tree ( 0, $str, $parent );
57 | $this->assign ( 'selected', $selected );
58 | $this->display ( 'mod' );
59 | }
60 | }
61 |
62 | function edit() {
63 | if (IS_POST) {
64 | $post = I ( 'post.' );
65 | $data ['parent'] = $post ['parent'];
66 | $data ['title'] = $post ['title'];
67 | $data ['listorder'] = $post ['listorder'];
68 | $map ['user_id'] = $this->uid;
69 | $map ['id'] = $post ['id'];
70 | if ($this->categories->where ( $map )->save ( $data ) !== false) {
71 | $this->success ( '类别修改成功!' );
72 | } else {
73 | $this->error ( '类别修改失败!' );
74 | }
75 | } else {
76 | $id = I ( 'id' );
77 | $map_categories ['id'] = $id;
78 | $map_categories ['user_id'] = $this->uid;
79 |
80 | $data = $this->categories->where ( $map_categories )->field ( true )->find ();
81 | if ($data == null) {
82 | $this->error ( '没有这个类别!' );
83 | }
84 |
85 | $map ['user_id'] = $this->uid;
86 | $list = $this->categories->where ( $map )->order ( 'listorder' )->select ();
87 | import ( '@.Rover.Tree' );
88 | $tree = new Tree ();
89 | $tree->init ( $list );
90 | $str = "";
91 | $selected = $tree->get_tree ( 0, $str, $data ['parent'] );
92 | $this->assign ( 'selected', $selected );
93 | $this->assign ( 'data', $data );
94 | $this->display ( 'mod' );
95 | }
96 | }
97 |
98 | function delete() {
99 | $id = I ( 'id' );
100 | $map ['id'] = $id;
101 | $map ['user_id'] = $this->uid;
102 | // 检查类别下是否存在密码
103 | $sum = $this->categories->where ( $map )->getField ( 'sum' );
104 | if ($sum > 0) {
105 | $this->error ( '你不能删除它,因为这个类别下面存在密码!' );
106 | }
107 |
108 | if ($this->categories->where ( $map )->delete () > 0) {
109 | $this->success ( '类别删除成功!' );
110 | } else {
111 | $this->error ( '类别删除失败!' );
112 | }
113 | }
114 | }
--------------------------------------------------------------------------------
/apps/Lib/Action/Console/IndexAction.class.php:
--------------------------------------------------------------------------------
1 | pwd = M ( 'password' );
14 | }
15 |
16 | function index() {
17 | C ( 'TOKEN_ON', 0 );
18 | $wd = I ( 'wd' );
19 | if ($wd != '') {
20 | $map ['title|note'] = array ( 'LIKE','%' . $wd . '%' );
21 | }
22 | $map ['user_id'] = $this->uid;
23 | $hits_list = $this->pwd->where ( $map )->order ( 'hits DESC' )->limit ( 5 )->select ();
24 | $this->assign ( 'list', $hits_list );
25 | $this->display ();
26 | }
27 | }
--------------------------------------------------------------------------------
/apps/Lib/Action/Console/ProfileAction.class.php:
--------------------------------------------------------------------------------
1 | user = M ( 'users' );
14 | $this->password = M ( 'password' );
15 | }
16 |
17 | function index() {
18 | $map ['id'] = $this->uid;
19 | $data = $this->user->where ( $map )->field ( 'id,email,password,login_count,register_time,register_ip,login_count,timeout' )->find ();
20 | if (IS_POST) {
21 | $post = I ( 'post.' );
22 | if ($post ['opassword'] != '' || $post ['password'] != '') {
23 | if ($post ['opassword'] != pdm_decode ( $data ['password'] )) {
24 | $this->error ( '你的旧密码填写错误!' );
25 | }
26 | $data_user ['password'] = pdm_encode ( $post ['password'] );
27 | }
28 |
29 | $data_user ['timeout'] = $post ['timeout'];
30 | if ($data_user ['timeout'] < 1 || $data_user ['timeout'] > 15) {
31 | $this->error ( '你填写的超时时间不在1~15分钟之内!' );
32 | }
33 | if ($this->user->where ( $map )->save ( $data_user ) !== false) {
34 | $this->success ( '修改成功!' );
35 | } else {
36 | $this->error ( '修改失败!' );
37 | }
38 | } else {
39 | $map_secret ['user_id'] = $this->uid;
40 | $data ['password_sum'] = $this->password->where ( $map_secret )->count ();
41 | $this->assign ( 'data', $data );
42 | $this->display ();
43 | }
44 | }
45 |
46 | /**
47 | * 注销
48 | */
49 | function logout() {
50 | session ( 'user', null );
51 | redirect ( pdm_ux ( 'Home/Account/login' ) );
52 | }
53 | }
--------------------------------------------------------------------------------
/apps/Lib/Action/Console/RecycleAction.class.php:
--------------------------------------------------------------------------------
1 | password = M ( 'password' );
15 | $this->categories = M ( 'categories' );
16 | }
17 |
18 | function index() {
19 | $map ['user_id'] = $this->uid;
20 | $map ['status'] = 1;
21 | $page = $this->pageInit ( $this->password->where ( $map )->count (), '条密码记录' );
22 | $list = $this->password->where ( $map )->field ( 'id,title,delete_time' )->order ( 'delete_time DESC' )->limit ( $page->firstRow, $page->listRows )->select ();
23 | $this->assign ( 'list', $list );
24 | $this->display ();
25 | }
26 |
27 | /**
28 | * 撤销
29 | */
30 | function rollback() {
31 | $id = I ( 'id' );
32 | $map ['user_id'] = $this->uid;
33 | $map ['id'] = pdm_code ( $id, 'DECODE' );
34 |
35 | $category_id = $this->password->where ( $map )->getField ( 'category_id' );
36 |
37 | $data_save ['status'] = 0;
38 | $data_save ['delete_time'] = 0;
39 | if ($this->password->where ( $map )->save ( $data_save ) !== false) {
40 | $this->_update_password ( $category_id );
41 | $this->success ( '密码撤销成功!' );
42 | } else {
43 | $this->error ( '操作失败!' );
44 | }
45 | }
46 |
47 | /**
48 | * 删除密码
49 | */
50 | function delete() {
51 | $id = I ( 'id' );
52 | $map ['user_id'] = $this->uid;
53 | $map ['id'] = pdm_code ( $id, 'DECODE' );
54 | $map ['status'] = 1;
55 | // 获取密码信息
56 | $data = $this->password->field ( 'category_id,delete_time' )->where ( $map )->find ();
57 |
58 | $expire_time = $data ['delete_time'] + PDM_ALLOW_DELETE_DAY * 86400;
59 | if (NOW_TIME <= $expire_time) {
60 | $this->error ( '这个密码放入回收站没有超过' . PDM_ALLOW_DELETE_DAY . '天,你不能删除它!' );
61 | }
62 |
63 | if ($this->password->where ( $map )->delete () > 0) {
64 | $this->_update_password ( $data ['category_id'] );
65 | $this->success ( '密码删除成功!' );
66 | } else {
67 | $this->error ( '密码删除失败!' );
68 | }
69 | }
70 |
71 | /**
72 | * 更新密码栏目数目
73 | * @param int $typeid 栏目id
74 | */
75 | private function _update_password($typeid) {
76 | $map ['category_id'] = $typeid;
77 | $map ['user_id'] = $this->uid;
78 | $map ['status'] = 0;
79 | $count = $this->password->where ( $map )->count ();
80 | $map_category ['id'] = $typeid;
81 | $data_category ['sum'] = $count;
82 | $this->categories->where ( $map_category )->save ( $data_category );
83 | }
84 | }
--------------------------------------------------------------------------------
/apps/Lib/Action/Console/ToolAction.class.php:
--------------------------------------------------------------------------------
1 | history = M ( 'history' );
20 | }
21 |
22 | function index() {
23 | C ( 'TOKEN_ON', 0 );
24 | $this->display ();
25 | }
26 |
27 | /**
28 | * 生成密码
29 | */
30 | function builder() {
31 | $request = I ( 'post.' );
32 | $alen = $request ['alen'];
33 | $plen = $request ['plen'];
34 | $char = $request ['char'];
35 | $type = $request ['type'];
36 | $chars = '';
37 | if ($char == 1) {
38 | $chars = '_+=@$()[]0Oo1Ll';
39 | }
40 | $data ['user'] = pdm_rand_code ( $alen, $type, $chars );
41 | $data ['pwd'] = pdm_rand_code ( $plen, $type, $chars );
42 |
43 | if ($data ['user'] != '' && $data ['pwd'] != '') {
44 | $data_history ['user_id'] = $this->uid;
45 | $data_history ['uname'] = pdm_encode ( $data ['user'], $this->auth_code );
46 | $data_history ['pwd'] = pdm_encode ( $data ['pwd'], $this->auth_code );
47 | $data_history ['create_time'] = NOW_TIME;
48 | $data_history ['create_ip'] = get_client_ip ( 1 );
49 |
50 | if ($this->history->add ( $data_history ) !== false) {
51 | $lastId = $this->history->getLastInsID ();
52 | $data ['signature'] = pdm_code ( $lastId );
53 | $this->jsonRender ( $data );
54 | }
55 | }
56 | $this->jsonRender ( null, - 1, 'error!' );
57 | }
58 | }
--------------------------------------------------------------------------------
/apps/Lib/Action/Home/IndexAction.class.php:
--------------------------------------------------------------------------------
1 | display();
17 | }
18 | }
--------------------------------------------------------------------------------
/apps/Lib/Action/PDMAction.class.php:
--------------------------------------------------------------------------------
1 | url = $url;
26 | }
27 | $page->setConfig ( 'header', $header );
28 | $page->setConfig ( 'first', '首页' );
29 | $page->setConfig ( 'last', '尾页' );
30 | $page->setConfig ( 'theme', '
%upPage% %downPage%' );
31 | $this->assign ( 'page', $page->show () );
32 |
33 | //开始记录分页序号 S
34 | if ($page->nowPage == 1) {
35 | $current_page = 0;
36 | $row = 0;
37 | } else {
38 | $row = $page->listRows;
39 | $current_page = $page->nowPage;
40 | }
41 | $this->assign ( 'page_now', $current_page );
42 | $this->assign ( 'page_row', $row );
43 | //开始记录分页序号 E
44 | return $page;
45 | }
46 |
47 | /**
48 | * 高级json返回
49 | * @param mix $data 数据
50 | * @param int $code 返回码
51 | * @param string $msg 错误信息
52 | */
53 | protected function jsonRender($data=null, $code = 0, $msg = '') {
54 | if ($code == 0) {
55 | if($data==null)
56 | $data=array('state'=>'successful');
57 | $status ['code'] = 0;
58 | $tmp = array_merge ( $status, $data );
59 | } else {
60 | $tmp ['code'] = $code;
61 | $tmp ['info'] = $msg;
62 | }
63 | $this->ajaxReturn ( $tmp );
64 | }
65 | }
--------------------------------------------------------------------------------
/apps/Lib/Rover/Waf.class.php:
--------------------------------------------------------------------------------
1 | "\\=\\+\\/v(?:8|9|\\+|\\/)|\\%0acontent\\-(?:id|location|type|transfer\\-encoding)" );
20 |
21 | private static $args_arr = array ('xss' => "[\\'\\\"\\;\\*\\<\\>].*\\bon[a-zA-Z]{3,15}[\\s\\r\\n\\v\\f]*\\=|\\b(?:expression)\\(|\\
23 |
24 |
25 |
26 |
27 | - 添加类别
28 |
29 |
30 |
31 | {$html}
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/apps/Tpl/Console/Categories_mod.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
29 |
30 |
31 |
59 |
60 |
--------------------------------------------------------------------------------
/apps/Tpl/Console/Index_index.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | 标题 |
27 | 添加日期 |
28 |
29 |
30 |
31 |
32 | $_pid=pdm_code($vo['id']);
33 |
34 | {$vo.title} |
35 | {$vo.add_time|pdm_time_format} |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
68 |
--------------------------------------------------------------------------------
/apps/Tpl/Console/Password_collect.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 序号 |
10 | 标题 |
11 | 添加日期 |
12 | 操作 |
13 |
14 |
15 |
16 |
17 | $_pid=pdm_code($vo['id']);
18 |
19 | {$i+$page_now*$page_row-$page_row} |
20 | {$vo.title} |
21 | {$vo.add_time|pdm_time_format} |
22 | 放入回收站 |
23 |
24 |
25 |
26 |
27 |
28 |
33 |
34 |
--------------------------------------------------------------------------------
/apps/Tpl/Console/Password_index.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
23 |
24 |
25 |
26 |
27 | {$html}
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/apps/Tpl/Console/Password_mod.htm:
--------------------------------------------------------------------------------
1 |
2 |
38 |
--------------------------------------------------------------------------------
/apps/Tpl/Console/Password_view.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
查看密码
7 |
8 | - 类别:{$data.category_name}
9 | - 标题:{$data.title}
10 | - 帐号:
{$data.uname}
11 | - 密码:
{$data.pwd}
12 | - {$data.note}
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/apps/Tpl/Console/Profile_index.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
帐号信息
8 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/apps/Tpl/Console/Recycle_index.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 序号 |
10 | 标题 |
11 | 回收日期 |
12 | 操作 |
13 |
14 |
15 |
16 |
17 | $_pid=pdm_code($vo['id']);
18 |
19 | {$i+$page_now*$page_row-$page_row} |
20 | {$vo.title} |
21 | {$vo.delete_time|pdm_time_format} |
22 | 撤销 | 彻底删除 |
23 |
24 |
25 |
26 |
27 |
28 |
33 |
34 |
--------------------------------------------------------------------------------
/apps/Tpl/Console/Tool_index.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
生成密码
8 |
66 |
67 |
68 |
73 |
74 |
75 |
95 |
--------------------------------------------------------------------------------
/apps/Tpl/Console/Zeninc_footer.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |