-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathauth.demo.txt
1 lines (1 loc) · 6.53 KB
/
auth.demo.txt
1
a:4:{s:6:"tables";a:2:{s:4:"code";a:2:{s:6:"fields";a:7:{s:2:"id";a:9:{s:4:"name";s:2:"id";s:7:"default";N;s:4:"type";s:3:"int";s:4:"size";i:11;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:1;s:7:"primary";b:1;s:7:"comment";s:0:"";}s:4:"code";a:9:{s:4:"name";s:4:"code";s:7:"default";N;s:4:"type";s:4:"text";s:4:"size";N;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:0;s:7:"primary";b:0;s:7:"comment";s:6:"代码";}s:4:"name";a:9:{s:4:"name";s:4:"name";s:7:"default";N;s:4:"type";s:7:"varchar";s:4:"size";i:64;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:0;s:7:"primary";b:0;s:7:"comment";s:12:"函数名称";}s:3:"uid";a:9:{s:4:"name";s:3:"uid";s:7:"default";N;s:4:"type";s:3:"int";s:4:"size";i:11;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:0;s:7:"primary";b:0;s:7:"comment";s:8:"用户ID";}s:5:"uname";a:9:{s:4:"name";s:5:"uname";s:7:"default";N;s:4:"type";s:7:"varchar";s:4:"size";i:32;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:0;s:7:"primary";b:0;s:7:"comment";s:9:"用户名";}s:9:"create_at";a:9:{s:4:"name";s:9:"create_at";s:7:"default";N;s:4:"type";s:8:"datetime";s:4:"size";N;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:0;s:7:"primary";b:0;s:7:"comment";s:12:"创建时间";}s:7:"private";a:9:{s:4:"name";s:7:"private";s:7:"default";s:1:"0";s:4:"type";s:7:"tinyint";s:4:"size";i:1;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:0;s:7:"primary";b:0;s:7:"comment";s:18:"只对自己可见";}}s:5:"names";a:7:{i:0;s:2:"id";i:1;s:4:"code";i:2;s:4:"name";i:3;s:3:"uid";i:4;s:5:"uname";i:5;s:9:"create_at";i:6;s:7:"private";}}s:4:"user";a:2:{s:6:"fields";a:5:{s:2:"id";a:9:{s:4:"name";s:2:"id";s:7:"default";N;s:4:"type";s:3:"int";s:4:"size";i:11;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:1;s:7:"primary";b:1;s:7:"comment";s:0:"";}s:5:"email";a:9:{s:4:"name";s:5:"email";s:7:"default";N;s:4:"type";s:7:"varchar";s:4:"size";i:128;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:0;s:7:"primary";b:0;s:7:"comment";s:12:"电子邮件";}s:4:"name";a:9:{s:4:"name";s:4:"name";s:7:"default";N;s:4:"type";s:7:"varchar";s:4:"size";i:32;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:0;s:7:"primary";b:0;s:7:"comment";s:9:"帐号名";}s:8:"password";a:9:{s:4:"name";s:8:"password";s:7:"default";N;s:4:"type";s:7:"varchar";s:4:"size";i:256;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:0;s:7:"primary";b:0;s:7:"comment";s:6:"密码";}s:5:"level";a:9:{s:4:"name";s:5:"level";s:7:"default";s:1:"1";s:4:"type";s:7:"tinyint";s:4:"size";i:1;s:5:"scale";N;s:7:"notnull";b:1;s:4:"auto";b:0;s:7:"primary";b:0;s:7:"comment";s:12:"用户等级";}}s:5:"names";a:5:{i:0;s:2:"id";i:1;s:5:"email";i:2;s:4:"name";i:3;s:8:"password";i:4;s:5:"level";}}}s:14:"mysql_settings";a:5:{s:10:"mysql_host";s:9:"127.0.0.1";s:10:"mysql_port";s:4:"8889";s:10:"mysql_user";s:4:"root";s:14:"mysql_password";s:4:"root";s:14:"mysql_database";s:10:"coderemote";}s:9:"functions";s:724:"PD9waHANCi8vIOWFrOWFseWHveaVsOWGmei/memHjO+8jOS+i+WmguajgOafpeWHveaVsOOAgei/h+a7pOWHveaVsOOAgeadg+mZkOajgOafpeWHveaVsA0KZnVuY3Rpb24gY2hlY2tfbWFpbF9sciggJGVtYWlsICkNCnsNCiAgICByZXR1cm4gZmlsdGVyX3ZhciggJGVtYWlsICwgRklMVEVSX1ZBTElEQVRFX0VNQUlMICk7DQp9DQoNCmZ1bmN0aW9uIG5vdygpDQp7DQogICAgcmV0dXJuIGRhdGUoIlktbS1kIEg6aTpzIik7DQp9DQoNCmZ1bmN0aW9uIHVpZCgpDQp7DQogICAgcmV0dXJuICRfU0VTU0lPTlsndWlkJ107DQp9DQoNCmZ1bmN0aW9uIHVuYW1lKCkNCnsNCiAgICByZXR1cm4gJF9TRVNTSU9OWyd1bmFtZSddOw0KfQ0KDQpmdW5jdGlvbiBsYXp5cmVzdF9hdXRoX2NoZWNrKCkNCnsNCiAgICBpZiggaW50dmFsKCAkX1NFU1NJT05bJ2xldmVsJ10gKSA8IDEgKQ0KICAgIHsNCiAgICAgICAgc2VuZF9lcnJvciggJ0FVVEgnICwgJ+W9k+WJjeadg+mZkOS4jei2s+S7peiuv+mXruacrOaOpeWPoycgKTsNCiAgICAgICAgZXhpdDsNCiAgICB9DQp9DQo=";s:9:"interface";a:1:{s:4:"info";a:2:{s:12:"帐号注册";s:1446:"{"id":1460691333694,"modify":true,"active_logic":"lcadd","iname":"帐号注册","iuri":"/account/reg","iget":null,"ipost":1,"ipublic":"1","inoauth":"1","target_table_list":"user","input-fileds":[{"field_enname":"password","field_table":"user","field_cnname":"密码","field_cannull":"0","field_checkfunction":"check_not_empty","field_filterfunction":""},{"field_enname":"name","field_table":"user","field_cnname":"帐号名","field_cannull":"0","field_checkfunction":"check_not_empty","field_filterfunction":""},{"field_enname":"email","field_table":"user","field_cnname":"电子邮件","field_cannull":"0","field_checkfunction":"check_mail_lr","field_filterfunction":""}],"inputcode":"<?php\n// 在自动化输入检查之后执行\n// 可以直接使用input里边的变量\n$password = sha1( $password );\n?>\t\t\t\t\t\t\t","unique-fileds":[{"field_enname":"email","field_cnname":"电子邮件"}],"mwhere-fileds":[],"lwhere-fileds":[],"dwhere-fileds":[],"logiccode":"<?php\n// 在$sql拼接之前,可以对其组成数组进行修改\n// 在UPDATE、DELETE操作中,可使用$last对原始记录进行检查\t\t\t\t\t\t\t","output-fileds":[{"field_enname":"level","field_filterfunction":""},{"field_enname":"name","field_filterfunction":""},{"field_enname":"email","field_filterfunction":""},{"field_enname":"id","field_filterfunction":""}],"outputcode":"<?php\n// 在return之前运行,可以对$return_item 就行修改\t\t\t\t\t\t\t"}";s:11:"获得token";s:1577:"{"id":1460694654897,"modify":true,"active_logic":"lccustom","iname":"获得token","iuri":"/account/token","iget":null,"ipost":1,"ipublic":"1","inoauth":"1","target_table_list":"user","input-fileds":[{"field_enname":"email","field_table":"user","field_cnname":"电子邮件","field_cannull":"0","field_checkfunction":"check_email_lr","field_filterfunction":""},{"field_enname":"password","field_table":"user","field_cnname":"密码","field_cannull":"0","field_checkfunction":"check_not_empty","field_filterfunction":""}],"inputcode":"<?php\n// 在自动化输入检查之后执行\n// 可以直接使用input里边的变量\n?>\t\t\t\t\t\t\t","unique-fileds":[],"mwhere-fileds":[],"lwhere-fileds":[],"dwhere-fileds":[],"logiccode":"<?php\n// 在$sql拼接之前,可以对其组成数组进行修改\n// 在UPDATE、DELETE操作中,可使用$last对原始记录进行检查\t\n// 首先取得用户信息\nif( $user = get_line( \"SELECT * FROM `user` WHERE `email` = '\" . s( $email ) . \"'\" ) )\n{\n if( $user['password'] == sha1( $password ) )\n {\n // 创建一个Session\n session_start();\n $_SESSION['uid'] = $user['id'];\n $_SESSION['uname'] = $user['name'];\n $_SESSION['level'] = $user['level'];\n \n return render_json( session_id() );\n \n }\n else\n return send_error( 'AUTH' , '错误的密码' );\n}\nelse\n return send_error( 'INPUT' , '电子邮件不存在' );","output-fileds":[],"outputcode":"<?php\n// 在return之前运行,可以对$return_item 就行修改\t\t\t\t\t\t\t"}";}}}