Php 如何将joomla(ACL)从joomla 1.5转换为joomla 2.5版本
我在joomla 1.5中有一个函数Php 如何将joomla(ACL)从joomla 1.5转换为joomla 2.5版本,php,joomla,joomla1.5,joomla2.5,Php,Joomla,Joomla1.5,Joomla2.5,我在joomla 1.5中有一个函数 function saveuser($row){ $db =& JFactory::getDBO(); $instance = new JUser(); jimport('joomla.application.component.helper'); $config = &JComponentHelper::getParams('com_users'); if(!isset($row['usertyp
function saveuser($row){
$db =& JFactory::getDBO();
$instance = new JUser();
jimport('joomla.application.component.helper');
$config = &JComponentHelper::getParams('com_users');
if(!isset($row['usertype']))
$row['usertype'] = $config->get( 'new_usertype', 'Registered' );
$acl =& JFactory::getACL();
if(!$row['gid'])
$row['gid'] = $acl->get_group_id( '', $usertype);
$instance->set( 'id' , $row['id'] );
$instance->set( 'name' , $row['name'] );
$instance->set( 'username' , $row['username'] );
$instance->set( 'password' , $row['password'] );
$instance->set( 'email' , $row['email'] );
$instance->set( 'gid' , $row['gid']);
$instance->set( 'usertype' , $row['usertype'] );
unset($instance->password_clear);
unset($instance->guest);
unset($instance->aid);
$ret = $db->insertObject( '#__users', $instance, 'id' );
if(!$ret){
return false;
}
$acl->add_object( 'users', $row['username'], $row['id'], null, null, 'ARO' );
$acl->add_group_object( $row['gid'], 'users', $row['id'], 'ARO' );
return true;
}
但当运行joomla 2.5时,错误是:
Fatal error: Call to undefined method JAccess::get_group_id() in ... on line ...
Fatal error: Call to undefined method JAccess::add_object() in ... on line ...
Fatal error: Call to undefined method JAccess::add_group_object() ... on line ...
How to fix this function to joomla 2.5, How to ideas ?
Joomla的ACL系统!2.5是完全不同的,您的问题没有简单的答案(Joomla!1.5在ACL上的尝试只实现了一半) 你最好在Joomla上以“”开头!博士的网站。阅读2.5核心组件,如
com\u用户
和com\u内容