PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Authentication » LiveUser_Admin » Bug #8198

fail : inserting new user

Details

Submitted2006-07-13 06:33 UTC
Fromweblogik at hotmail dot com
StatusBogus
PackageLiveUser_Admin
PHP Version5.1.4
OSWindows XP
Roadmaps(Not assigned)

Comments

[2006-07-13 06:33 UTC] weblogik at hotmail dot com

Description:
------------
I intalled the package and configured it like this :

sample code from my conf. file :
--------------------------------
'authContainers' => array(
array(
'type'=> 'DB',
'expireTime' => 3600,
'idleTime' => 1800,
'allowDuplicateHandles' => 0,
'allowEmptyPasswords' => 1,
'passwordEncryptionMode'=> 'MD5',
'storage' => array(
'dsn' => $dsn,
'prefix'=> '',
'alias' => array(s
// database alias
'applications' => 'jos_vm_auth_applications',
'area_admin_areas'=> 'jos_vm_auth_area_admin_areas',
'areas' => 'jos_vm_auth_areas',
'group_subgroups' => 'jos_vm_auth_group_subgroups',
'grouprights' => 'jos_vm_auth_grouprights',
'groups' => 'jos_core_acl_aro_groups',
'groupusers' => 'jos_vm_auth_groupusers',
'perm_users' => 'jos_vm_auth_perm_users',
'right_implied' => 'jos_vm_auth_right_implied',
'rights' => 'jos_vm_auth_rights',
'userrights' => 'jos_vm_auth_userrights',
'users' => 'jos_users',

The fact is that i use a cms an i already have some user in my 'jos_user' table. So, i manually inserted rights for each of them in the 'jos_vm_auth_perm_users' table.

When i tried to insert a new user permission, i got this error :
"Couldn't create the query, reason: DB Error: constraint violation-INSERT INTO jos_vm_auth_perm_users
(auth_user_id, auth_container_name, perm_type, perm_user_id)
VALUES (2, 0, 1, 1) [nativecode=1062 ** Duplicate entry '1' for key 1]"

The problem is in your 'getBeforeId' function, you call the DB::nextId function with onDemand = true, so this one will create a new seq table on demand with an id initiazed at 1, but if i already have some data in my table, the id will not be unique.

In your 'getBeforeId' function, you should verify if this id is unique.

sorry for my bad english, im french :)