/** * Called when a user is created : set up default rights on this user * * @param jEvent $event the event */ function onAuthNewUser($event) { if (jApp::config()->acl['driver'] == 'db') { $user = $event->getParam('user'); jAclDbUserGroup::createUser($user->login); } }
/** * Called when a user is created : set up default rights on this user * * @param jEvent $event the event */ function onAuthNewUser($event) { if ($GLOBALS['gJConfig']->acl['driver'] == 'db') { $user = $event->getParam('user'); jAclDbUserGroup::createUser($user->login); } }
public function testAddUserIntoGroup() { // ajout d'un user dans un groupe jAclDbUserGroup::createUser('robert'); $this->grpId7 = $this->getLastId('id_aclgrp', 'jacl_group'); jAclDbUserGroup::addUserToGroup('robert', $this->grpId1); $this->groups[] = array('id_aclgrp' => $this->grpId7, 'name' => 'robert', 'grouptype' => 2, 'ownerlogin' => 'robert'); $this->assertTableContainsRecords('jacl_group', $this->groups); $this->usergroups = array(array('login' => 'laurent', 'id_aclgrp' => $this->grpId5), array('login' => 'max', 'id_aclgrp' => $this->grpId6), array('login' => 'max', 'id_aclgrp' => $this->defaultGroupId), array('login' => 'robert', 'id_aclgrp' => $this->grpId7), array('login' => 'robert', 'id_aclgrp' => $this->defaultGroupId), array('login' => 'robert', 'id_aclgrp' => $this->grpId1)); $this->assertTableContainsRecords('jacl_user_group', $this->usergroups); }