-
Notifications
You must be signed in to change notification settings - Fork 47
/
coderemote.demo.txt
1 lines (1 loc) · 14.2 KB
/
coderemote.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:7:{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"}";s:12:"添加代码";s:2197:"{"id":1460696636149,"modify":true,"active_logic":"lcadd","iname":"添加代码","iuri":"/code/add","iget":null,"ipost":1,"ipublic":"1","inoauth":"0","target_table_list":"code","input-fileds":[{"field_enname":"create_at","field_table":"-phpfunction-","field_cnname":"创建时间","field_cannull":"0","field_checkfunction":"","field_filterfunction":"now"},{"field_enname":"private","field_table":"code","field_cnname":"只对自己可见","field_cannull":"1","field_checkfunction":"","field_filterfunction":"intval"},{"field_enname":"uid","field_table":"-phpfunction-","field_cnname":"用户ID","field_cannull":"0","field_checkfunction":"","field_filterfunction":"uid"},{"field_enname":"code","field_table":"code","field_cnname":"代码","field_cannull":"0","field_checkfunction":"check_not_empty","field_filterfunction":""},{"field_enname":"name","field_table":"code","field_cnname":"函数名称","field_cannull":"0","field_checkfunction":"check_not_empty","field_filterfunction":""},{"field_enname":"uname","field_table":"-phpfunction-","field_cnname":"用户名","field_cannull":"0","field_checkfunction":"","field_filterfunction":"uname"}],"inputcode":"<?php\n// 在自动化输入检查之后执行\n// 可以直接使用input里边的变量\nif( intval( $uid ) < 1 ) return send_error( 'INPUT' , '错误的UID' );\n\nif( strlen( $uname ) < 1 ) return send_error( 'INPUT' , '错误的用户名' );\n?>\t\t\t\t\t\t\t","unique-fileds":[{"field_enname":"name","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":"private","field_filterfunction":""},{"field_enname":"create_at","field_filterfunction":""},{"field_enname":"uname","field_filterfunction":""},{"field_enname":"uid","field_filterfunction":""},{"field_enname":"name","field_filterfunction":""},{"field_enname":"code","field_filterfunction":""},{"field_enname":"id","field_filterfunction":""}],"outputcode":"<?php\n// 在return之前运行,可以对$return_item 就行修改\t\t\t\t\t\t\t"}";s:12:"修改代码";s:1494:"{"id":1460698671844,"modify":false,"active_logic":"lcmodify","iname":"修改代码","iuri":"/code/update","iget":null,"ipost":1,"ipublic":"1","inoauth":"0","target_table_list":"code","input-fileds":[{"field_enname":"id","field_table":"code","field_cnname":"","field_cannull":"0","field_checkfunction":"check_not_empty","field_filterfunction":"intval"},{"field_enname":"code","field_table":"code","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":[{"field_enname":"id","field_table":"code","field_eq":"1"}],"lwhere-fileds":[],"dwhere-fileds":[],"logiccode":"<?php\n// 在$sql拼接之前,可以对其组成数组进行修改\n// 在UPDATE、DELETE操作中,可使用$last对原始记录进行检查\t\t\nif( $last['uid'] != uid() ) return send_error( 'AUTH' , '只能修改自己发布的函数' );","output-fileds":[{"field_enname":"private","field_filterfunction":""},{"field_enname":"create_at","field_filterfunction":""},{"field_enname":"uname","field_filterfunction":""},{"field_enname":"uid","field_filterfunction":""},{"field_enname":"name","field_filterfunction":""},{"field_enname":"code","field_filterfunction":""},{"field_enname":"id","field_filterfunction":""}],"outputcode":"<?php\n// 在return之前运行,可以对$return_item 就行修改\t\t\t\t\t\t\t"}";s:12:"代码列表";s:1430:"{"id":1460699036930,"modify":true,"active_logic":"lclist","iname":"代码列表","iuri":"/code/list","iget":1,"ipost":null,"ipublic":"1","inoauth":"0","target_table_list":"code","input-fileds":[{"field_enname":"name","field_table":"code","field_cnname":"函数名称","field_cannull":"1","field_checkfunction":"","field_filterfunction":""}],"inputcode":"<?php\n// 在自动化输入检查之后执行\n// 可以直接使用input里边的变量\n?>\t\t\t\t\t\t\t","unique-fileds":[],"mwhere-fileds":[],"lwhere-fileds":[{"field_enname":"name","field_table":"code","field_eq":"2"}],"dwhere-fileds":[],"logiccode":"<?php\n// 在$sql拼接之前,可以对其组成数组进行修改\n// 在UPDATE、DELETE操作中,可使用$last对原始记录进行检查\n$add_where = \" `private` != 1 OR `uid` = '\" . intval( uid() ) . \"' \";\n\nif( strlen( t( $where_sql ) ) < 1 ) $where_sql = 'WHERE ' . $add_where;\nelse $where_sql .= ' AND (' . $add_where . ')';","output-fileds":[{"field_enname":"private","field_filterfunction":""},{"field_enname":"create_at","field_filterfunction":""},{"field_enname":"uname","field_filterfunction":""},{"field_enname":"uid","field_filterfunction":""},{"field_enname":"name","field_filterfunction":""},{"field_enname":"code","field_filterfunction":""},{"field_enname":"id","field_filterfunction":""}],"outputcode":"<?php\n// 在return之前运行,可以对$return_item 就行修改\t\t\t\t\t\t\t"}";s:12:"删除代码";s:1340:"{"id":1460700170635,"modify":true,"active_logic":"lcdelete","iname":"删除代码","iuri":"/code/remove","iget":null,"ipost":1,"ipublic":"1","inoauth":"0","target_table_list":"code","input-fileds":[{"field_enname":"id","field_table":"code","field_cnname":"id","field_cannull":"0","field_checkfunction":"check_not_empty","field_filterfunction":"intval"}],"inputcode":"<?php\n// 在自动化输入检查之后执行\n// 可以直接使用input里边的变量\n?>\t\t\t\t\t\t\t","unique-fileds":[],"mwhere-fileds":[],"lwhere-fileds":[],"dwhere-fileds":[{"field_enname":"id","field_table":"code","field_eq":"1"}],"logiccode":"<?php\n// 在$sql拼接之前,可以对其组成数组进行修改\n// 在UPDATE、DELETE操作中,可使用$last对原始记录进行检查\t\t\tif( $last['uid'] != uid() ) return send_error( 'AUTH' , '只能删除自己发布的函数' );","output-fileds":[{"field_enname":"id","field_filterfunction":""},{"field_enname":"code","field_filterfunction":""},{"field_enname":"name","field_filterfunction":""},{"field_enname":"uid","field_filterfunction":""},{"field_enname":"uname","field_filterfunction":""},{"field_enname":"create_at","field_filterfunction":""},{"field_enname":"private","field_filterfunction":""}],"outputcode":"<?php\n// 在return之前运行,可以对$return_item 就行修改\t\t\t\t\t\t\t"}";s:12:"查看代码";s:1229:"{"id":1460785146976,"modify":false,"active_logic":"lccustom","iname":"查看代码","iuri":"/code/detail","iget":1,"ipost":null,"ipublic":"1","inoauth":"0","target_table_list":"code","input-fileds":[{"field_enname":"id","field_table":"code","field_cnname":"","field_cannull":"0","field_checkfunction":"check_not_empty","field_filterfunction":"intval"}],"inputcode":"<?php\n// 在自动化输入检查之后执行\n// 可以直接使用input里边的变量\nif( $id < 1 ) return send_error( 'INPUT' , '错误的ID' );\n?>\t\t\t\t\t\t\t","unique-fileds":[],"mwhere-fileds":[],"lwhere-fileds":[],"dwhere-fileds":[],"logiccode":"<?php\n// 在$sql拼接之前,可以对其组成数组进行修改\n// 在UPDATE、DELETE操作中,可使用$last对原始记录进行检查\nif( !$item = get_line( \"SELECT * FROM `code` WHERE `id` = '\" . intval( $id ) . \"' LIMIT 1\" ))\n{\n return send_error( 'INPUT' , 'ID对应的记录不存在');\n}\n\nif( $item['private'] == 1 && $item['uid'] != uid() )\n{\n return send_error( 'AUTH' , '你不能查看别人的私有代码' );\n}\n\nreturn render_json( $item );\n","output-fileds":[],"outputcode":"<?php\n// 在return之前运行,可以对$return_item 进行修改\t\t\t\t\t\t\t"}";}}}