Skip to content

Commit

Permalink
注册半成品
Browse files Browse the repository at this point in the history
  • Loading branch information
duanyong committed Oct 2, 2012
1 parent bbd08fc commit 0170f4b
Show file tree
Hide file tree
Showing 12 changed files with 480 additions and 54 deletions.
6 changes: 1 addition & 5 deletions css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
float: right;
margin: 5px;
font-size: 9px;
cursor: pointer;
}

.ui-dialog .column {
Expand Down Expand Up @@ -113,12 +114,7 @@
}

.overlay {
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.9;
position: absolute;
background-color: #EAEDEC;
z-index: 99;
}
Expand Down
5 changes: 2 additions & 3 deletions dev/conf/aiyuji.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*
CREATE TABLE `user` (
CREATE TABLE `201208aiyuji_user` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` CHAR(64) NOT NULL DEFAULT '' COMMENT '用户手机',
`password` CHAR(32) NOT NULL DEFAULT '' COMMENT '用户密码',
Expand All @@ -33,6 +32,7 @@ CREATE TABLE `user` (
`sex` BOOLEAN NOT NULL DEFAULT FALSE COMMENT '用户性别',
`regip` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '注册IP',
`sum` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '留言总数',

`time` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '注册时间',
`ftime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '注册时间',
`status` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '当前状态',
Expand All @@ -45,7 +45,6 @@ CREATE TABLE `user` (
INDEX `idx_status` (`status`)

) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='用户信息表';
*/
/*!40101 SET character_set_client = @saved_cs_client */;


Expand Down
15 changes: 15 additions & 0 deletions dev/devapp.config.php
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');

8 changes: 1 addition & 7 deletions dev/devinc.SSOCookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,18 @@
* Version: 1.0
*/


class SSOCookie {
const COOKIE_SUE = 'SUE'; //sina user encrypt info
const COOKIE_SUP = 'SUP'; //sina user plain info
//const COOKIE_KEY_FILE = '/data1/publish/cookie.conf';

private $_error;
private $_errno = 0;
private $_arrConf; // the infomation in cookie.conf
private static $_arrKeyMap = array(
"cv" => "cookieversion",
"bt" => "begintime",
"et" => "expiredtime",
"uid" => "uniqueid",
"user" => "userid",
"ag" => "appgroup",
"nick" => "displayname",
"sex" => "gender",
"ps" => "paysign",
Expand All @@ -41,9 +38,6 @@ public function getCookie(&$arrUserInfo) {
if (!isset($_COOKIE[self::COOKIE_SUE])
|| !isset($_COOKIE[self::COOKIE_SUP])
) {
$this->_setError('');
//$this->_setError('not all cookie are exists ');

return false;
}

Expand Down
6 changes: 5 additions & 1 deletion dev/devinc.action.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
//
////////////////////////////////////////////////////////////////////////////////

function a_action_uuid() {
function a_action_uuid($token=false) {
if ($token = false) {
$token = '';
}

$uuid = date('Y-m-d H:i:s')
. rand(1000000, 9000000)
. rand(1000000, 9000000)
Expand Down
104 changes: 104 additions & 0 deletions dev/devinc.password.php
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);
}

5 changes: 5 additions & 0 deletions js/jquery-1.7.2.min.js

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions js/jquery.form.js
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);
Loading

0 comments on commit 0170f4b

Please sign in to comment.