ImageVerifierCode 换一换
格式:DOCX , 页数:5 ,大小:16.73KB ,
资源ID:17511508      下载积分:12 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/17511508.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(uchome登陆机制分析Word下载.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

uchome登陆机制分析Word下载.docx

1、include_once S_ROOT./uc_client/client.php) system_error); $ucresult = uc_user_login($username, $password); if($ucresult0 0) $passportuid = $ucresult0;username = $ucresult1;email = $ucresult3; return $passport;至此,我们可以发现现在开始和uc_client相关函数关联了.我们进入uc_client文件夹,开始分析,定位至:uchome_ROOT/uc_client/client.php/*

2、 用户登陆检查* param string $username 用户名/uid* param string $password 密码* param int $isuid 是否为uid* param int $checkques 是否使用检查安全问答* param int $questionid 安全提问* param string $answer 安全提问答案* return array (uid/status, username, password, email) 数组第一项 1 : 成功 -1 : 用户不存在,或者被删除 -2 : 密码错*/function uc_user_login($

3、username, $password, $isuid = 0, $checkques = 0, $questionid = , $answer = $isuid = intval($isuid); /define(UC_API_FUNC, UC_CONNECT = mysql ? uc_api_mysqluc_api_post $return = call_user_func(UC_API_FUNC, userlogin, array(=$username, password$password, isuid$isuid, checkques$checkques, questionid$que

4、stionid, answer$answer); return UC_CONNECT = $return : uc_unserialize($return);因为是mysql,故,UC_API_FUNC的值为uc_api_mysql,通过call_user_func()函数,将参数传给uc_api_mysql(),下面进入最关键的函数了:uchome_ROOT/uc_client/client.php = uc_api_mysql()* MYSQL 方式取指定的模块和动作的数据* param string $model 请求的模块* param string $action 请求的动作* pa

5、ram string $args 参数(会加密的方式传送)* return mixfunction uc_api_mysql($model, $action, $args=array() /$model = ,$action= , /$args = Array ( username = test2 password = test isuid = 0 checkques = 0 questionid = answer = ) global $uc_controls; if(empty($uc_controls$model) /UC_ROOT uc_client/ include_once UC_

6、ROOT./lib/db.class.php;./model/base.php include_once UC_ROOT./control/$model.php eva l($uc_controls$model = new $modelcontrol(); /uc_client/control/user.php,usercontrol()类(继承至base基类)实例化 if($action0 != _ $args = uc_addslashes($args, 1, TRUE); $action = on.$action;/onlogin,usercontrol()中的方法,可以考虑改造此函数以

7、实现预定功能 $uc_controls$model-input = $args;/base.php,base基类的方法 /return Array ( 0 = 3 1 = test2 2 = test 3 = test 4 = 0 ) return $uc_controls$model-$action($args);/返回预定数组,供调用函数分析 else return 我们看看usercontrol类的onlogin()方法:uchome_ROOT/uc_client/control/user.php/note public 外部接口 登陆接口function onlogin() $this

8、-init_input(); $isuid = $this-input( $username = $this- $password = $this- $checkques = $this- $questionid = $this- $answer = $this- if($isuid) $user = $_ENV-get_user_by_uid($username);get_user_by_username($username); /这部分即可改动 $passwordmd5 = preg_match(/w32$/, $password) ? $password : md5($password)

9、; /note 用户名不存在 if(empty($user) $status = -1; elseif($user != md5($passwordmd5.$usersalt) $status = -2; elseif($checkques & $usersecques &= $_ENVquescrypt($questionid, $answer) $status = -3; $status = $user; $merge = $status != -1 & !$isuid & $_ENVcheck_mergeuser($username) ? 1 : 0; return array($sta

10、tus, $user, $password, $user, $merge);可以改成如下形式:/note public 外部接口 登陆接 function onlogin($type=myself $type= if($type=) echo $password:.$password. $testmd5 = md5(test/假设数据库中保持的所有的密码为test/ print_r($passwordmd5); print_r($user); if(emptyempty($user) = $passwordmd5) $statusz:.$status. die(); else至此,我们可以更改

11、uchome默认的认证方式了,如果这里更改了,以后相关的也需要作出更改,这个就留下大家自己去跟踪调试了.tips:uchome_ROOT/uc_client/model/user.php下还有一个check_login(),这个函数暂时没有找到调用的地方.1. functioncheck_login($username,$password,$user)2. $user=$this-3. if(empty($user)4. return-1;5. elseif($user!md5(md5($password).$user6. -2;7. 8. $user9. eclipsePDT还是不错的,可以试试这个IDE.

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1