---
title: "joomla注册过程简解"
author: "aiou"
date: "2009-06-18T17:33:59Z"
tags: ["PHP"]
categories: ["编程语言"]
slug: "joomla"
draft: false
lastmod: "2009-06-18T17:36:33Z"
id: 411020
url: "https://aiou.iteye.com/blog/411020"
---

只是单纯的注册过程（新用户），不包括用户修改（已有用户）
注册表单将task = regist_savet提交给controllor调用
Controller.php 的 register_save()方法：
1.其中$user = clone(JFactory::getUser());实例化JFactory类的getUser()方法
该方法中
    1.jimport('joomla.user.user');将libraries/joomla/user/user.php引入，
    2.再$instance =& JUser::getInstance();实例化/user.php 的JUser类
所以$user = $instance;
2.然后调用JUser类的bind()方法$user->bind()绑定数据；
3.然后调用JUser类的save()方法$user->save()存储数据；
    在$user->save()中的重要过程：
    1.$table=&$this->getTable();获取libraries/joomla/database/table/user.php的JTableUser类。
    2. $table->check()进行有效性检查；
    3. $result = $table->store()存储数据；
        在$table->store()中的重要过程：
        1.$acl =& JFactory::getACL();引入权限管理
        2.$ret = $this->_db->insertObject( $this->_tbl, $this, $this->_tbl_key );//插入数据
        3.$acl->add_object( $section_value, $this->name, $this->$k, null, null, 'ARO' );
	4.$acl->add_group_object( $this->gid, $section_value, $this->$k, 'ARO' );
	//3、4同步acl权限表jos_core_acl_aro、jos_core_acl_groups_aro_map
4.发送验证邮件


有关表简要关系示意
#__core_acl_aro_groups.id —>#__core_acl_groups_aro_map<—#__core_acl_aro.id<—jos_core_users.(id,name)
jos_core_acl_aro_sections\ jos_core_acl_aro_map其实没用