-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
480 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
/********************************************************* | ||
* 应用的配置文件 | ||
* | ||
* | ||
**********************************************************/ | ||
|
||
|
||
require_once('../SHFramework/v.12/devinc.common.php'); | ||
|
||
define('ROOT_DIR', $_SERVER['DOCUMENT_ROOT']); | ||
|
||
//数据库前缀 | ||
define('APP_DB_PREFIX', '201208aiyuji'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<?php | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// devinc.cookie.php | ||
// cookie操作的相关函数 | ||
// | ||
// | ||
// a_cookie($key, &$value=fase, $day=0) | ||
// 向客户端设置cookie, $day开之后失效。如果不设置,者浏览器关闭后就失败 | ||
// | ||
// a_cookie($name) | ||
// 接收smarty模板,将其渲染出来 | ||
// | ||
// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
//Cookie的配置文件 | ||
define('SSOCOOKIE_CONFIG', 'cookie.conf'); | ||
|
||
//Cookie的配置文件32位的键 | ||
define('SSOCOOKIE_KEY32_1', 'v0'); | ||
|
||
//Cookie的配置文件32位的键 | ||
define('SSOCOOKIE_KEY32_2', 'v1'); | ||
|
||
//Cookie的配置文件32位的键 | ||
define('SSOCOOKIE_KEY32_3', 'rv'); | ||
|
||
//Cookie的配置文件1024位的键 | ||
define('SSOCOOKIE_KEY1024', 'rv0'); | ||
|
||
|
||
function s_ssocookie_config($config=false) { | ||
if ($config === false) { | ||
$config = SSOCOOKIE_CONFIG; | ||
} | ||
|
||
if (!( $config = @parse_ini_file($config) ) | ||
|| !isset($config[SSOCOOKIE_KEY32_1]) | ||
|| !isset($config[SSOCOOKIE_KEY32_2]) | ||
|| !isset($config[SSOCOOKIE_KEY32_3]) | ||
|| !isset($config[SSOCOOKIE_KEY1024]) | ||
) { | ||
return false; | ||
} | ||
|
||
return $config; | ||
} | ||
|
||
|
||
function s_ssocookie_sue() { | ||
if (!( $config = s_ssocookie_config() ) | ||
) { | ||
return false; | ||
} | ||
|
||
return md5(a); | ||
} | ||
|
||
|
||
function s_ssocookie_sup() { | ||
if (!( $config = s_ssocookie_config() ) | ||
) { | ||
return false; | ||
} | ||
|
||
return md5(a); | ||
} | ||
|
||
function s_ssocookie_md5($username, $password) { | ||
if (s_bad_string($username) | ||
|| s_bad_string($password) | ||
|| !( $config = s_ssocookie_config() ) | ||
|
||
) { | ||
return false; | ||
} | ||
|
||
|
||
//混淆用户名和密码 | ||
$lon = md5($username . $config[SSOCOOKIE_KEY1024]) . md5($config[SSOCOOKIE_KEY32_1] . $password); | ||
$sht = '~!@#$%^&*()_+[]\|{}";:,./?><'; //手动添加一些特殊字符,增加md5字符集范围 | ||
|
||
|
||
//以较长的字符串做基准,反序交叉合并字符串 | ||
$new = ""; | ||
$len = mb_strlen($lon); | ||
$mod = mb_strlen($sht); | ||
|
||
do { | ||
$new .= mb_substr($lon, $len, 1); | ||
|
||
if (( $tmp = mb_substr($sht, $len, 1) )) { | ||
//短字符串在pos下标处有值才合并 | ||
$new .= $tmp; | ||
} else { | ||
$new .= mb_substr($lon, $len % $mod, 1); | ||
} | ||
|
||
} while (( -- $len ) >= 0); | ||
|
||
|
||
return md5($new); | ||
} | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/*! | ||
* jQuery Form Plugin | ||
* version: 3.09 (02-SEP-012) | ||
* @requires jQuery v1.3.2 or later | ||
* | ||
* Examples and documentation at: http://malsup.com/jquery/form/ | ||
* Project repository: https://github.com/malsup/form | ||
* Dual licensed under the MIT and GPL licenses: | ||
* http://malsup.github.com/mit-license.txt | ||
* http://malsup.github.com/gpl-license-v2.txt | ||
*/ | ||
;(function($) { | ||
"use strict"; | ||
|
||
/* | ||
Usage Note: | ||
----------- | ||
Do not use both ajaxSubmit and ajaxForm on the same form. These | ||
functions are mutually exclusive. Use ajaxSubmit if you want | ||
to bind your own submit handler to the form. For example, | ||
$(document).ready(function() { | ||
$('#myForm').on('submit', function(e) { | ||
e.preventDefault(); // <-- important | ||
$(this).ajaxSubmit({ | ||
target: '#output' | ||
}); | ||
}); | ||
}); | ||
Use ajaxForm when you want the plugin to manage all the event binding | ||
for you. For example, | ||
$(document).ready(function() { | ||
$('#myForm').ajaxForm({ | ||
target: '#output' | ||
}); | ||
}); | ||
You can also use ajaxForm with delegation (requires jQuery v1.7+), so the | ||
form does not have to exist when you invoke ajaxForm: | ||
$('#myForm').ajaxForm({ | ||
delegation: true, | ||
target: '#output' | ||
}); | ||
When using ajaxForm, the ajaxSubmit function will be invoked for you | ||
at the appropriate time. | ||
*/ | ||
|
||
/** | ||
* Feature detection | ||
*/ | ||
var form, method, data; | ||
|
||
|
||
function ajax(form, callback) { | ||
$.ajax({ | ||
"url" : form.attr('action') + "?r" + Math.random(), | ||
"type" : method ? method : form.attr('method'), | ||
"dataType" : data ? data : "json", | ||
"data" : form.serialize(), | ||
"success" : function(ret) { | ||
callback(ret); | ||
} | ||
}); | ||
} | ||
|
||
|
||
/** | ||
* ajaxSubmit() provides a mechanism for immediately submitting | ||
* an HTML form using AJAX. | ||
*/ | ||
|
||
$.fn.ajax = function(callback, params, method, data) { | ||
/*jshint scripturl:true */ | ||
form = $(this); | ||
data = data; | ||
method = method; | ||
|
||
if (!callback) { | ||
callback = function() {} | ||
} | ||
|
||
ajax(form, callback); | ||
}; | ||
|
||
})(jQuery); |
Oops, something went wrong.